bkper 3.3.0 → 3.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +86 -105
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -32,8 +32,8 @@ yarn global add bkper
32
32
 
33
33
  - ```login``` - Logs the user in. Saves the client credentials to a ```~/.bkper-credentials.json``` file.
34
34
  - ```logout``` - Logs out the user by deleting client credentials.
35
- - ```app -c``` - Create a new App based on ```./bkperapp.json``` file.
36
- - ```app -u``` - Update an existing App based on ```./bkperapp.json``` file.
35
+ - ```app -c``` - Create a new App based on ```./bkperapp.yaml``` file.
36
+ - ```app -u``` - Update an existing App based on ```./bkperapp.yaml``` file.
37
37
 
38
38
  ### Examples
39
39
  ```
@@ -64,113 +64,82 @@ Follow [these](https://bkper.com/docs/#rest-api-enabling) steps in order to conf
64
64
  > WARNING: Never upload variables to the source code repository.
65
65
 
66
66
 
67
- ### ```./bkperapp.json``` Reference
68
-
69
- ```json
70
- {
71
-
72
- /* App basic configuration */
73
- "id": "The App agent id. It can NOT be changed after the App created.",
74
- "name": "The name of the App or Bot.",
75
- "logoUrl": "Set your logo url from public host. Best fit 200x200 px. Use https://",
76
-
77
- /* Context menu configuration */
78
- "menuUrl": "The menu url to open in the popup window. See reference bellow.",
79
- "menuUrlDev": "The menu url to open in the popup window, when opened by the developer user.",
80
- "menuText": "The context menu call to action.",
81
- "menuPopupWidth": "500 //width in pixels. Default to 80% of screen width.",
82
- "menuPopupHeight": "300 //height in pixels. Default to 90% of screen height.",
83
-
84
- /* Bot events configuration */
85
- "events": [
86
- "TRANSACTION_POSTED",
87
- "TRANSACTION_CHECKED",
88
- "TRANSACTION_UNCHECKED",
89
- "TRANSACTION_UPDATED",
90
- "TRANSACTION_DELETED",
91
- "TRANSACTION_RESTORED",
92
- "ACCOUNT_CREATED",
93
- "ACCOUNT_UPDATED",
94
- "ACCOUNT_DELETED",
95
- "GROUP_CREATED",
96
- "GROUP_UPDATED",
97
- "GROUP_DELETED",
98
- "FILE_CREATED",
99
- "BOOK_UPDATED"
100
- ],
101
-
102
- "filePatterns": [
103
- "The file patterns the Bot is capable of process. It accepts wildcard. E.g.",
104
- "radiusbank*.ofx",
105
- "-*.qif"
106
- ],
107
-
108
-
109
- /* Bot configuration only when additional scopes, other than email, is needed */
110
- /* If not specified, a default valid token with the email scope is sent in the http header */
111
- "clientId": "The Client ID from GCP project Web Application OAuth Credential",
112
- "scopes": [
113
- "The Google OAuth scopes used. E.g.",
114
- "https://www.googleapis.com/auth/userinfo.email",
115
- "https://www.googleapis.com/auth/script.external_request"
116
- ],
117
-
118
- /* Google Apps Script bot configuration */
119
- "scriptId": "The Google Apps Script ID",
120
- "deploymentId": "The Google Apps Script API Deployment ID",
121
-
122
- /* Webhook bot configuration */
123
- "webhookUrl": "The production webhook url",
124
- "webhookUrlDev": "The development webhook url",
125
-
126
- /* Schema to provide autocompletion */
127
- "propertiesSchema": {
128
- "book": {
129
- "keys": [
130
- "key1",
131
- "key2"
132
- ],
133
- "values": [
134
- "value2",
135
- "value2"
136
- ]
137
- },
138
- "group": {
139
- "keys": [
140
- "key1",
141
- "key2"
142
- ],
143
- "values": [
144
- "value2",
145
- "value2"
146
- ]
147
- },
148
- "account": {
149
- "keys": [
150
- "key1",
151
- "key2"
152
- ],
153
- "values": [
154
- "value2",
155
- "value2"
156
- ]
157
- },
158
- "transaction": {
159
- "keys": [
160
- "key1",
161
- "key2"
162
- ],
163
- "values": [
164
- "value2",
165
- "value2"
166
- ]
167
- }
168
- }
169
- }
67
+ ### ```./bkperapp.yaml``` Reference
68
+
69
+ ```yaml
70
+ id: "The App agent id. It can NOT be changed after the App created."
71
+ name: "The name of the App or Bot."
72
+ logoUrl: "Set your logo url from public host. Best fit 200x200 px. Use https://"
73
+
74
+ # Context menu configuration
75
+ menuUrl: "The menu url to open in the popup window. See reference bellow."
76
+ menuUrlDev: "The menu url to open in the popup window, when opened by the developer user."
77
+ menuText: "The context menu call to action."
78
+ menuPopupWidth: 500 # width in pixels. Default to 80% of screen width.
79
+ menuPopupHeight: 300 # height in pixels. Default to 90% of screen height.
80
+
81
+ # Bot events configuration
82
+ events:
83
+ - "TRANSACTION_POSTED"
84
+ - "TRANSACTION_CHECKED"
85
+ - "TRANSACTION_UNCHECKED"
86
+ - "TRANSACTION_UPDATED"
87
+ - "TRANSACTION_DELETED"
88
+ - "TRANSACTION_RESTORED"
89
+ - "ACCOUNT_CREATED"
90
+ - "ACCOUNT_UPDATED"
91
+ - "ACCOUNT_DELETED"
92
+ - "GROUP_CREATED"
93
+ - "GROUP_UPDATED"
94
+ - "GROUP_DELETED"
95
+ - "FILE_CREATED"
96
+ - "BOOK_UPDATED"
97
+
98
+ filePatterns:
99
+ - "The file patterns the Bot is capable of process. It accepts wildcard. E.g."
100
+ - "radiusbank*.ofx"
101
+ - "-*.qif"
102
+
103
+
104
+ # Webhook bot configuration
105
+ webhookUrl: "The production webhook url"
106
+ webhookUrlDev: "The development webhook url"
107
+
108
+ # Schema to provide autocompletion
109
+ propertiesSchema:
110
+ book:
111
+ keys:
112
+ - "key1"
113
+ - "key2"
114
+ values:
115
+ - "value2"
116
+ - "value2"
117
+ group:
118
+ keys:
119
+ - "key1"
120
+ - "key2"
121
+ values:
122
+ - "value2"
123
+ - "value2"
124
+ account:
125
+ keys:
126
+ - "key1"
127
+ - "key2"
128
+ values:
129
+ - "value2"
130
+ - "value2"
131
+ transaction:
132
+ keys:
133
+ - "key1"
134
+ - "key2"
135
+ values:
136
+ - "value2"
137
+ - "value2"
170
138
 
171
139
  ```
172
140
 
173
141
  #### Accepted expressions in menuUrl property:
142
+
174
143
  - ```${book.id}``` - the current book id
175
144
  - ```${book.properties.xxxxx}``` - any property value from the current book
176
145
  - ```${transactions.query}``` - the current query being executed on transactions list
@@ -190,6 +159,18 @@ Follow [these](https://bkper.com/docs/#rest-api-enabling) steps in order to conf
190
159
 
191
160
  The ```getOAuthToken``` returns a Promise that resolves to a valid OAuth token, to be used by the [```bkper-js```](https://github.com/bkper/bkper-js) library
192
161
 
162
+ Example:
163
+
164
+ ```javascript
165
+ import { Bkper } from 'bkper-js';
166
+ import { getOAuthToken } from 'bkper';
167
+
168
+ Bkper.setConfig({
169
+ oauthTokenProvider: async () => getOAuthToken(),
170
+ })
171
+ ```
172
+
173
+
193
174
 
194
175
  ## Documentation
195
176
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bkper",
3
- "version": "3.3.0",
3
+ "version": "3.3.2",
4
4
  "description": "Node.js command line client for Bkper",
5
5
  "bin": {
6
6
  "bkper": "./lib/cli.js"