bkper 3.3.0 → 3.3.1

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 +97 -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,93 @@ 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
+ # Bot configuration only when additional scopes, other than email, is needed
104
+ # If not specified, a default valid token with the email scope is sent in the http header
105
+ clientId: "The Client ID from GCP project Web Application OAuth Credential"
106
+ scopes:
107
+ - "The Google OAuth scopes used. E.g."
108
+ - "https://www.googleapis.com/auth/userinfo.email"
109
+ - "https://www.googleapis.com/auth/script.external_request"
110
+
111
+ # Google Apps Script bot configuration
112
+ scriptId: "The Google Apps Script ID"
113
+ deploymentId: "The Google Apps Script API Deployment ID"
114
+
115
+ # Webhook bot configuration
116
+ webhookUrl: "The production webhook url"
117
+ webhookUrlDev: "The development webhook url"
118
+
119
+ # Schema to provide autocompletion
120
+ propertiesSchema:
121
+ book:
122
+ keys:
123
+ - "key1"
124
+ - "key2"
125
+ values:
126
+ - "value2"
127
+ - "value2"
128
+ group:
129
+ keys:
130
+ - "key1"
131
+ - "key2"
132
+ values:
133
+ - "value2"
134
+ - "value2"
135
+ account:
136
+ keys:
137
+ - "key1"
138
+ - "key2"
139
+ values:
140
+ - "value2"
141
+ - "value2"
142
+ transaction:
143
+ keys:
144
+ - "key1"
145
+ - "key2"
146
+ values:
147
+ - "value2"
148
+ - "value2"
170
149
 
171
150
  ```
172
151
 
173
152
  #### Accepted expressions in menuUrl property:
153
+
174
154
  - ```${book.id}``` - the current book id
175
155
  - ```${book.properties.xxxxx}``` - any property value from the current book
176
156
  - ```${transactions.query}``` - the current query being executed on transactions list
@@ -190,6 +170,18 @@ Follow [these](https://bkper.com/docs/#rest-api-enabling) steps in order to conf
190
170
 
191
171
  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
172
 
173
+ Example:
174
+
175
+ ```javascript
176
+ import { Bkper } from 'bkper-js';
177
+ import { getOAuthToken } from 'bkper';
178
+
179
+ Bkper.setConfig({
180
+ oauthTokenProvider: async () => getOAuthToken(),
181
+ })
182
+ ```
183
+
184
+
193
185
 
194
186
  ## Documentation
195
187
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bkper",
3
- "version": "3.3.0",
3
+ "version": "3.3.1",
4
4
  "description": "Node.js command line client for Bkper",
5
5
  "bin": {
6
6
  "bkper": "./lib/cli.js"