Skip to content

Commit b585156

Browse files
author
WooSignal
committed
initial release
0 parents  commit b585156

20 files changed

+1492
-0
lines changed

.gitignore

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Miscellaneous
2+
*.class
3+
*.log
4+
*.pyc
5+
*.swp
6+
.DS_Store
7+
.atom/
8+
.buildlog/
9+
.history
10+
.svn/
11+
12+
# IntelliJ related
13+
*.iml
14+
*.ipr
15+
*.iws
16+
.idea/
17+
18+
# The .vscode folder contains launch configuration and tasks you configure in
19+
# VS Code which you may wish to be included in version control, so this line
20+
# is commented out by default.
21+
#.vscode/
22+
23+
# Flutter/Dart/Pub related
24+
**/doc/api/
25+
.dart_tool/
26+
.flutter-plugins
27+
.flutter-plugins-dependencies
28+
.packages
29+
.pub-cache/
30+
.pub/
31+
build/
32+
33+
# Android related
34+
**/android/**/gradle-wrapper.jar
35+
**/android/.gradle
36+
**/android/captures/
37+
**/android/gradlew
38+
**/android/gradlew.bat
39+
**/android/local.properties
40+
**/android/**/GeneratedPluginRegistrant.java
41+
42+
# iOS/XCode related
43+
**/ios/**/*.mode1v3
44+
**/ios/**/*.mode2v3
45+
**/ios/**/*.moved-aside
46+
**/ios/**/*.pbxuser
47+
**/ios/**/*.perspectivev3
48+
**/ios/**/*sync/
49+
**/ios/**/.sconsign.dblite
50+
**/ios/**/.tags*
51+
**/ios/**/.vagrant/
52+
**/ios/**/DerivedData/
53+
**/ios/**/Icon?
54+
**/ios/**/Pods/
55+
**/ios/**/.symlinks/
56+
**/ios/**/profile
57+
**/ios/**/xcuserdata
58+
**/ios/.generated/
59+
**/ios/Flutter/App.framework
60+
**/ios/Flutter/Flutter.framework
61+
**/ios/Flutter/Flutter.podspec
62+
**/ios/Flutter/Generated.xcconfig
63+
**/ios/Flutter/app.flx
64+
**/ios/Flutter/app.zip
65+
**/ios/Flutter/flutter_assets/
66+
**/ios/Flutter/flutter_export_environment.sh
67+
**/ios/ServiceDefinitions.json
68+
**/ios/Runner/GeneratedPluginRegistrant.*
69+
70+
# Exceptions to above rules.
71+
!**/ios/**/default.mode1v3
72+
!**/ios/**/default.mode2v3
73+
!**/ios/**/default.pbxuser
74+
!**/ios/**/default.perspectivev3
75+
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages

.metadata

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# This file tracks properties of this Flutter project.
2+
# Used by Flutter tool to assess capabilities and perform upgrades etc.
3+
#
4+
# This file should be version controlled and should not be manually edited.
5+
6+
version:
7+
revision: f139b11009aeb8ed2a3a3aa8b0066e482709dde3
8+
channel: stable
9+
10+
project_type: package

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## [0.0.1] - 2020-04-06
2+
3+
* Initial Release

LICENSE

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
BSD License
2+
3+
Copyright (c) 2020 by WooSignal All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
4+
5+
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
6+
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
7+
Neither the name of the nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
8+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# WordPress and WooCommerce JSON API Dart package for Flutter
2+
3+
[Official WooSignal WooCommerce package](https://woosignal.com)
4+
5+
API features:
6+
7+
**WordPress**
8+
- Register/Sign Up API for Users
9+
- Login (with email or username)
10+
- Get Users Info
11+
- Update Users Info
12+
- Update Users Password
13+
14+
**WooCommerce**:
15+
- Get Customers Info (Billing and Shipping)
16+
- Update Customers details
17+
18+
To use this API you must have the [WP Json API Plugin](https://woosignal.com/plugins/wp-json-api) installed first on your WordPress site, you can download it via the WooSignal website.
19+
20+
### Examples using Wp JSON API
21+
22+
``` dart
23+
import 'package:woosignal/wp_json_api.dart';
24+
25+
...
26+
27+
#1 - Set the base url (e.g. https://mysite.com)
28+
``` dart
29+
String base_url = "https://mywordpress-site.com";
30+
WPJsonAPI.instance.initWith(baseUrl: base_url);
31+
```
32+
33+
#2 - Call a method from the request api
34+
``` dart
35+
WPUserLoginResponse wpUserLoginResponse = await WPJsonAPI.instance.api((request) {
36+
return request.wpLogin(email: email, password: password);
37+
});
38+
```
39+
For help getting started with WooSignal, view our
40+
[online documentation](https://woosignal.com/docs/wordpress-json-api-flutter/1.0/overview), which offers a more detailed guide.
41+
42+
## Usage
43+
To use this plugin, add `wp_json_api` as a [dependency in your pubspec.yaml file](https://flutter.io/platform-plugins/).
44+
45+
Disclaimer: This plugin is not affiliated with or supported by Automattic, Inc. All logos and trademarks are the property of their respective owners.

lib/enums/WPAuthType.dart

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Copyright (c) 2020, WooSignal.
2+
// All rights reserved.
3+
//
4+
// Redistribution and use in source and binary forms are permitted
5+
// provided that the above copyright notice and this paragraph are
6+
// duplicated in all such forms and that any documentation,
7+
// advertising materials, and other materials related to such
8+
// distribution and use acknowledge that the software was developed
9+
// by the WooSignal. The name of the
10+
// WooSignal may not be used to endorse or promote products derived
11+
// from this software without specific prior written permission.
12+
// THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
13+
// IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
14+
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
15+
16+
enum WPAuthType {
17+
/// Auth type [WPAuthType.WpEmail] is used for specifying
18+
/// how you want to authenticate a user when using the Login method
19+
/// This method will authenticate via Email and Password
20+
WpEmail,
21+
22+
/// Auth type [WPAuthType.WpUsername] is used for specifying
23+
/// how you want to authenticate a user when using the Login method
24+
/// This method will authenticate via Username and Password
25+
WpUsername,
26+
}

lib/enums/WPRouteType.dart

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
// Copyright (c) 2020, WooSignal.
2+
// All rights reserved.
3+
//
4+
// Redistribution and use in source and binary forms are permitted
5+
// provided that the above copyright notice and this paragraph are
6+
// duplicated in all such forms and that any documentation,
7+
// advertising materials, and other materials related to such
8+
// distribution and use acknowledge that the software was developed
9+
// by the WooSignal. The name of the
10+
// WooSignal may not be used to endorse or promote products derived
11+
// from this software without specific prior written permission.
12+
// THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
13+
// IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
14+
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
15+
16+
enum WPRouteType {
17+
/// Route type [WPRouteType.UserUpdatePassword] is used to update a WordPress users password.
18+
/// For WordPress
19+
UserUpdatePassword,
20+
21+
/// Route type [WPRouteType.UserUpdateInfo] is used to update a WordPress users account info.
22+
/// For WordPress
23+
UserUpdateInfo,
24+
25+
/// Route type [WPRouteType.UserInfo] is used to return a WordPress users info.
26+
/// For WordPress
27+
UserInfo,
28+
29+
/// Route type [WPRouteType.UserRegister] is used to Register a user on WordPress.
30+
/// For WordPress
31+
UserRegister,
32+
33+
/// Route type [WPRouteType.UserLogin] is used to Login a user on WordPress.
34+
/// For WordPress
35+
UserLogin,
36+
37+
/// Route type [WPRouteType.AuthNonce] is used to get a nonce token to authenticate future API requests.
38+
/// For WordPress
39+
AuthNonce,
40+
41+
/// Route type [WPRouteType.AuthVerify] is used to verify an existing nonce token.
42+
/// For WordPress
43+
AuthVerify,
44+
45+
/// Route type [WPRouteType.WCCustomerInfo] is used to get a Customers info.
46+
/// For WooCommerce
47+
WCCustomerInfo,
48+
49+
/// Route type [WPRouteType.WCCustomerUpdateInfo] is used to Update WooCommerce details for a customer.
50+
/// For WooCommerce
51+
WCCustomerUpdateInfo,
52+
}

0 commit comments

Comments
 (0)