@cobaltio/cobalt-js 5.1.0 → 6.0.0
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.
- package/README.md +44 -59
- package/cobalt.js +25 -30
- package/docs.md +43 -58
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -71,20 +71,17 @@ cobalt.token = "COBALT_SESSION_TOKEN";
|
|
|
71
71
|
<dt><a href="#InputField">InputField</a> : <code>Object</code></dt>
|
|
72
72
|
<dd><p>An Input field to take input from the user.</p>
|
|
73
73
|
</dd>
|
|
74
|
-
<dt><a href="#Config">Config</a> : <code>Object</code></dt>
|
|
75
|
-
<dd><p>The configuration data for an application.</p>
|
|
76
|
-
</dd>
|
|
77
|
-
<dt><a href="#Workflow">Workflow</a> : <code>Object</code></dt>
|
|
78
|
-
<dd><p>The workflow.</p>
|
|
79
|
-
</dd>
|
|
80
74
|
<dt><a href="#ConfigPayload">ConfigPayload</a> : <code>Object</code></dt>
|
|
81
75
|
<dd><p>The payload object for config.</p>
|
|
82
76
|
</dd>
|
|
83
|
-
<dt><a href="#DynamicField">DynamicField</a> : <code>Object</code></dt>
|
|
84
|
-
<dd><p>Field Mapping Label</p>
|
|
85
|
-
</dd>
|
|
86
77
|
<dt><a href="#Label">Label</a> : <code>Object</code></dt>
|
|
87
|
-
<dd><p>
|
|
78
|
+
<dd><p>Label Mapping</p>
|
|
79
|
+
</dd>
|
|
80
|
+
<dt><a href="#UpdateConfigPayload">UpdateConfigPayload</a> : <code>Object</code></dt>
|
|
81
|
+
<dd><p>The configuration data for an application.</p>
|
|
82
|
+
</dd>
|
|
83
|
+
<dt><a href="#WorkflowPayload">WorkflowPayload</a> : <code>Object</code></dt>
|
|
84
|
+
<dd><p>The workflow.</p>
|
|
88
85
|
</dd>
|
|
89
86
|
</dl>
|
|
90
87
|
|
|
@@ -98,11 +95,11 @@ cobalt.token = "COBALT_SESSION_TOKEN";
|
|
|
98
95
|
* [.getApp([slug])](#Cobalt+getApp) ⇒ [<code>Promise.<Application></code>](#Application)
|
|
99
96
|
* [.connect(slug, [payload])](#Cobalt+connect) ⇒ <code>Promise.<Boolean></code>
|
|
100
97
|
* [.disconnect(slug)](#Cobalt+disconnect) ⇒ <code>Promise.<void></code>
|
|
101
|
-
* [.config(
|
|
102
|
-
* [.updateConfig(
|
|
98
|
+
* [.config(payload)](#Cobalt+config) ⇒ <code>Promise.<Config></code>
|
|
99
|
+
* [.updateConfig(payload)](#Cobalt+updateConfig) ⇒ <code>Promise.<Config></code>
|
|
103
100
|
* [.deleteConfig(slug, [configId])](#Cobalt+deleteConfig) ⇒ <code>Promise.<unknown></code>
|
|
104
|
-
* Additional Methods
|
|
105
|
-
* [.getConfig(slug, [configId])](#Cobalt+getConfig) ⇒
|
|
101
|
+
* Additional Methods
|
|
102
|
+
* [.getConfig(slug, [configId])](#Cobalt+getConfig) ⇒ <code>Promise.<Config></code>
|
|
106
103
|
|
|
107
104
|
<a name="new_Cobalt_new"></a>
|
|
108
105
|
|
|
@@ -126,9 +123,9 @@ it returns all the enabled applications.
|
|
|
126
123
|
**Kind**: instance method of [<code>Cobalt</code>](#Cobalt)
|
|
127
124
|
**Returns**: [<code>Promise.<Application></code>](#Application) - The application details.
|
|
128
125
|
|
|
129
|
-
| Param | Type |
|
|
130
|
-
| --- | --- | --- |
|
|
131
|
-
| [slug] | <code>String</code> |
|
|
126
|
+
| Param | Type | Description |
|
|
127
|
+
| --- | --- | --- |
|
|
128
|
+
| [slug] | <code>String</code> | The application slug. |
|
|
132
129
|
|
|
133
130
|
<a name="Cobalt+connect"></a>
|
|
134
131
|
|
|
@@ -156,24 +153,23 @@ Disconnect the specified application and remove any associated data from Cobalt.
|
|
|
156
153
|
|
|
157
154
|
<a name="Cobalt+config"></a>
|
|
158
155
|
|
|
159
|
-
### cobalt.config(
|
|
156
|
+
### cobalt.config(payload) ⇒ <code>Promise.<Config></code>
|
|
160
157
|
Returns the specified config, or creates one if it doesn't exist.
|
|
161
158
|
|
|
162
159
|
**Kind**: instance method of [<code>Cobalt</code>](#Cobalt)
|
|
163
|
-
**Returns**:
|
|
160
|
+
**Returns**: <code>Promise.<Config></code> - The specified config.
|
|
164
161
|
|
|
165
162
|
| Param | Type | Description |
|
|
166
163
|
| --- | --- | --- |
|
|
167
|
-
|
|
|
168
|
-
| [payload] | [<code>ConfigPayload</code>](#ConfigPayload) | The payload object for config. |
|
|
164
|
+
| payload | [<code>ConfigPayload</code>](#ConfigPayload) | The payload object for config. |
|
|
169
165
|
|
|
170
166
|
<a name="Cobalt+getConfig"></a>
|
|
171
167
|
|
|
172
|
-
### cobalt.getConfig(slug, [configId]) ⇒
|
|
168
|
+
### cobalt.getConfig(slug, [configId]) ⇒ <code>Promise.<Config></code>
|
|
173
169
|
Returns the specified config.
|
|
174
170
|
|
|
175
171
|
**Kind**: instance method of [<code>Cobalt</code>](#Cobalt)
|
|
176
|
-
**Returns**:
|
|
172
|
+
**Returns**: <code>Promise.<Config></code> - The specified config.
|
|
177
173
|
|
|
178
174
|
| Param | Type | Description |
|
|
179
175
|
| --- | --- | --- |
|
|
@@ -182,16 +178,15 @@ Returns the specified config.
|
|
|
182
178
|
|
|
183
179
|
<a name="Cobalt+updateConfig"></a>
|
|
184
180
|
|
|
185
|
-
### cobalt.updateConfig(
|
|
181
|
+
### cobalt.updateConfig(payload) ⇒ <code>Promise.<Config></code>
|
|
186
182
|
Update the specified config.
|
|
187
183
|
|
|
188
184
|
**Kind**: instance method of [<code>Cobalt</code>](#Cobalt)
|
|
189
|
-
**Returns**:
|
|
185
|
+
**Returns**: <code>Promise.<Config></code> - The specified config.
|
|
190
186
|
|
|
191
187
|
| Param | Type | Description |
|
|
192
188
|
| --- | --- | --- |
|
|
193
|
-
|
|
|
194
|
-
| payload | [<code>Config</code>](#Config) | The update payload. |
|
|
189
|
+
| payload | [<code>UpdateConfigPayload</code>](#UpdateConfigPayload) | The update payload. |
|
|
195
190
|
|
|
196
191
|
<a name="Cobalt+deleteConfig"></a>
|
|
197
192
|
|
|
@@ -240,68 +235,58 @@ An Input field to take input from the user.
|
|
|
240
235
|
| placeholder | <code>String</code> | The placeholder of the field. |
|
|
241
236
|
| label | <code>String</code> | The label of the field. |
|
|
242
237
|
|
|
243
|
-
<a name="
|
|
238
|
+
<a name="ConfigPayload"></a>
|
|
244
239
|
|
|
245
|
-
##
|
|
246
|
-
The
|
|
240
|
+
## ConfigPayload : <code>Object</code>
|
|
241
|
+
The payload object for config.
|
|
247
242
|
|
|
248
243
|
**Kind**: global typedef
|
|
249
244
|
**Properties**
|
|
250
245
|
|
|
251
246
|
| Name | Type | Description |
|
|
252
247
|
| --- | --- | --- |
|
|
248
|
+
| slug | <code>String</code> | The application slug. |
|
|
253
249
|
| [config_id] | <code>String</code> | Unique ID for the config. |
|
|
254
|
-
|
|
|
255
|
-
| workflows | [<code>Array.<Workflow></code>](#Workflow) | Whether the workflow is enabled. |
|
|
250
|
+
| labels | <code>Object.<string, Array.<Label>></code> | The dynamic label mappings. |
|
|
256
251
|
|
|
257
|
-
<a name="
|
|
252
|
+
<a name="Label"></a>
|
|
258
253
|
|
|
259
|
-
##
|
|
260
|
-
|
|
254
|
+
## Label : <code>Object</code>
|
|
255
|
+
Label Mapping
|
|
261
256
|
|
|
262
257
|
**Kind**: global typedef
|
|
263
258
|
**Properties**
|
|
264
259
|
|
|
265
260
|
| Name | Type | Description |
|
|
266
261
|
| --- | --- | --- |
|
|
267
|
-
|
|
|
268
|
-
|
|
|
269
|
-
| data_slots | <code>Object.<string, (string\|number\|boolean)></code> | A map of workflow's data slots and their values. |
|
|
262
|
+
| name | <code>string</code> | The label name. |
|
|
263
|
+
| value | <code>string</code> \| <code>number</code> \| <code>boolean</code> | The label value. |
|
|
270
264
|
|
|
271
|
-
<a name="
|
|
265
|
+
<a name="UpdateConfigPayload"></a>
|
|
272
266
|
|
|
273
|
-
##
|
|
274
|
-
The
|
|
267
|
+
## UpdateConfigPayload : <code>Object</code>
|
|
268
|
+
The configuration data for an application.
|
|
275
269
|
|
|
276
270
|
**Kind**: global typedef
|
|
277
271
|
**Properties**
|
|
278
272
|
|
|
279
273
|
| Name | Type | Description |
|
|
280
274
|
| --- | --- | --- |
|
|
275
|
+
| slug | <code>String</code> | The application slug. |
|
|
281
276
|
| [config_id] | <code>String</code> | Unique ID for the config. |
|
|
282
|
-
|
|
|
283
|
-
|
|
284
|
-
<a name="DynamicField"></a>
|
|
277
|
+
| fields | <code>Object.<string, (string\|number\|boolean)></code> | A map of application fields and their values. |
|
|
278
|
+
| workflows | [<code>Array.<WorkflowPayload></code>](#WorkflowPayload) | Whether the workflow is enabled. |
|
|
285
279
|
|
|
286
|
-
|
|
287
|
-
Field Mapping Label
|
|
280
|
+
<a name="WorkflowPayload"></a>
|
|
288
281
|
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
| Name | Type | Description |
|
|
293
|
-
| --- | --- | --- |
|
|
294
|
-
| fields | [<code>Array.<Label></code>](#Label) | The Label name. |
|
|
295
|
-
|
|
296
|
-
<a name="Label"></a>
|
|
297
|
-
|
|
298
|
-
## Label : <code>Object</code>
|
|
299
|
-
Field Mapping Label
|
|
282
|
+
## WorkflowPayload : <code>Object</code>
|
|
283
|
+
The workflow.
|
|
300
284
|
|
|
301
285
|
**Kind**: global typedef
|
|
302
286
|
**Properties**
|
|
303
287
|
|
|
304
288
|
| Name | Type | Description |
|
|
305
289
|
| --- | --- | --- |
|
|
306
|
-
|
|
|
307
|
-
|
|
|
290
|
+
| id | <code>String</code> | The ID of the workflow. |
|
|
291
|
+
| enabled | <code>Boolean</code> | Whether the workflow is enabled. |
|
|
292
|
+
| fields | <code>Object.<string, (string\|number\|boolean)></code> | A map of workflow fields and their values. |
|
package/cobalt.js
CHANGED
|
@@ -24,34 +24,31 @@
|
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
|
-
* @typedef {Object}
|
|
27
|
+
* @typedef {Object} ConfigPayload The payload object for config.
|
|
28
|
+
* @property {String} slug The application slug.
|
|
28
29
|
* @property {String} [config_id] Unique ID for the config.
|
|
29
|
-
* @property {Object.<string,
|
|
30
|
-
* @property {Workflow[]} workflows Whether the workflow is enabled.
|
|
30
|
+
* @property {Object.<string, Label[]>} labels The dynamic label mappings.
|
|
31
31
|
*/
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
|
-
* @typedef {Object}
|
|
35
|
-
* @property {
|
|
36
|
-
* @property {
|
|
37
|
-
* @property {Object.<string, string | number | boolean>} data_slots A map of workflow's data slots and their values.
|
|
34
|
+
* @typedef {Object} Label Label Mapping
|
|
35
|
+
* @property {string} name The label name.
|
|
36
|
+
* @property {string | number | boolean} value The label value.
|
|
38
37
|
*/
|
|
39
38
|
|
|
40
39
|
/**
|
|
41
|
-
* @typedef {Object}
|
|
40
|
+
* @typedef {Object} UpdateConfigPayload The configuration data for an application.
|
|
41
|
+
* @property {String} slug The application slug.
|
|
42
42
|
* @property {String} [config_id] Unique ID for the config.
|
|
43
|
-
* @property {Object.<string,
|
|
43
|
+
* @property {Object.<string, string | number | boolean>} fields A map of application fields and their values.
|
|
44
|
+
* @property {WorkflowPayload[]} workflows Whether the workflow is enabled.
|
|
44
45
|
*/
|
|
45
46
|
|
|
46
47
|
/**
|
|
47
|
-
* @typedef {Object}
|
|
48
|
-
* @property {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* @typedef {Object} Label Field Mapping Label
|
|
53
|
-
* @property {string} name The Label name.
|
|
54
|
-
* @property {string | number | boolean} value The Label value.
|
|
48
|
+
* @typedef {Object} WorkflowPayload The workflow.
|
|
49
|
+
* @property {String} id The ID of the workflow.
|
|
50
|
+
* @property {Boolean} enabled Whether the workflow is enabled.
|
|
51
|
+
* @property {Object.<string, string | number | boolean>} fields A map of workflow fields and their values.
|
|
55
52
|
*/
|
|
56
53
|
|
|
57
54
|
class Cobalt {
|
|
@@ -98,11 +95,11 @@ class Cobalt {
|
|
|
98
95
|
* Returns the application details for the specified application, provided
|
|
99
96
|
* the application is enabled in Cobalt. If no application is specified,
|
|
100
97
|
* it returns all the enabled applications.
|
|
101
|
-
* @param {String} [slug
|
|
98
|
+
* @param {String} [slug] The application slug.
|
|
102
99
|
* @returns {Promise<Application>} The application details.
|
|
103
100
|
*/
|
|
104
|
-
async getApp(slug
|
|
105
|
-
const res = await fetch(`${this.baseUrl}/api/
|
|
101
|
+
async getApp(slug) {
|
|
102
|
+
const res = await fetch(`${this.baseUrl}/api/v2/f-sdk/application${slug ? `/${slug}` : ""}`, {
|
|
106
103
|
headers: {
|
|
107
104
|
authorization: `Bearer ${this.token}`,
|
|
108
105
|
},
|
|
@@ -234,12 +231,11 @@ class Cobalt {
|
|
|
234
231
|
|
|
235
232
|
/**
|
|
236
233
|
* Returns the specified config, or creates one if it doesn't exist.
|
|
237
|
-
* @param {
|
|
238
|
-
* @param {ConfigPayload} [payload] The payload object for config.
|
|
234
|
+
* @param {ConfigPayload} payload The payload object for config.
|
|
239
235
|
* @returns {Promise<Config>} The specified config.
|
|
240
236
|
*/
|
|
241
|
-
async config(
|
|
242
|
-
const res = await fetch(`${this.baseUrl}/api/v2/
|
|
237
|
+
async config(payload) {
|
|
238
|
+
const res = await fetch(`${this.baseUrl}/api/v2/f-sdk/config`, {
|
|
243
239
|
method: "POST",
|
|
244
240
|
headers: {
|
|
245
241
|
authorization: `Bearer ${this.token}`,
|
|
@@ -262,7 +258,7 @@ class Cobalt {
|
|
|
262
258
|
* @returns {Promise<Config>} The specified config.
|
|
263
259
|
*/
|
|
264
260
|
async getConfig(slug, configId) {
|
|
265
|
-
const res = await fetch(`${this.baseUrl}/api/
|
|
261
|
+
const res = await fetch(`${this.baseUrl}/api/v2/f-sdk/slug/${slug}/config${configId ? `/${configId}` : ""}`, {
|
|
266
262
|
headers: {
|
|
267
263
|
authorization: `Bearer ${this.token}`,
|
|
268
264
|
},
|
|
@@ -277,12 +273,11 @@ class Cobalt {
|
|
|
277
273
|
|
|
278
274
|
/**
|
|
279
275
|
* Update the specified config.
|
|
280
|
-
* @param {
|
|
281
|
-
* @param {Config} payload The update payload.
|
|
276
|
+
* @param {UpdateConfigPayload} payload The update payload.
|
|
282
277
|
* @returns {Promise<Config>} The specified config.
|
|
283
278
|
*/
|
|
284
|
-
async updateConfig(
|
|
285
|
-
const res = await fetch(`${this.baseUrl}/api/
|
|
279
|
+
async updateConfig(payload) {
|
|
280
|
+
const res = await fetch(`${this.baseUrl}/api/v2/f-sdk/config`, {
|
|
286
281
|
method: "PUT",
|
|
287
282
|
headers: {
|
|
288
283
|
authorization: `Bearer ${this.token}`,
|
|
@@ -305,7 +300,7 @@ class Cobalt {
|
|
|
305
300
|
* @returns {Promise<unknown>}
|
|
306
301
|
*/
|
|
307
302
|
async deleteConfig(slug, configId) {
|
|
308
|
-
const res = await fetch(`${this.baseUrl}/api/
|
|
303
|
+
const res = await fetch(`${this.baseUrl}/api/v2/f-sdk/slug/${slug}/config${configId ? `/${configId}` : ""}`, {
|
|
309
304
|
method: "DELETE",
|
|
310
305
|
headers: {
|
|
311
306
|
authorization: `Bearer ${this.token}`,
|
package/docs.md
CHANGED
|
@@ -14,20 +14,17 @@
|
|
|
14
14
|
<dt><a href="#InputField">InputField</a> : <code>Object</code></dt>
|
|
15
15
|
<dd><p>An Input field to take input from the user.</p>
|
|
16
16
|
</dd>
|
|
17
|
-
<dt><a href="#Config">Config</a> : <code>Object</code></dt>
|
|
18
|
-
<dd><p>The configuration data for an application.</p>
|
|
19
|
-
</dd>
|
|
20
|
-
<dt><a href="#Workflow">Workflow</a> : <code>Object</code></dt>
|
|
21
|
-
<dd><p>The workflow.</p>
|
|
22
|
-
</dd>
|
|
23
17
|
<dt><a href="#ConfigPayload">ConfigPayload</a> : <code>Object</code></dt>
|
|
24
18
|
<dd><p>The payload object for config.</p>
|
|
25
19
|
</dd>
|
|
26
|
-
<dt><a href="#DynamicField">DynamicField</a> : <code>Object</code></dt>
|
|
27
|
-
<dd><p>Field Mapping Label</p>
|
|
28
|
-
</dd>
|
|
29
20
|
<dt><a href="#Label">Label</a> : <code>Object</code></dt>
|
|
30
|
-
<dd><p>
|
|
21
|
+
<dd><p>Label Mapping</p>
|
|
22
|
+
</dd>
|
|
23
|
+
<dt><a href="#UpdateConfigPayload">UpdateConfigPayload</a> : <code>Object</code></dt>
|
|
24
|
+
<dd><p>The configuration data for an application.</p>
|
|
25
|
+
</dd>
|
|
26
|
+
<dt><a href="#WorkflowPayload">WorkflowPayload</a> : <code>Object</code></dt>
|
|
27
|
+
<dd><p>The workflow.</p>
|
|
31
28
|
</dd>
|
|
32
29
|
</dl>
|
|
33
30
|
|
|
@@ -41,9 +38,9 @@
|
|
|
41
38
|
* [.getApp([slug])](#Cobalt+getApp) ⇒ [<code>Promise.<Application></code>](#Application)
|
|
42
39
|
* [.connect(slug, [payload])](#Cobalt+connect) ⇒ <code>Promise.<Boolean></code>
|
|
43
40
|
* [.disconnect(slug)](#Cobalt+disconnect) ⇒ <code>Promise.<void></code>
|
|
44
|
-
* [.config(
|
|
45
|
-
* [.getConfig(slug, [configId])](#Cobalt+getConfig) ⇒
|
|
46
|
-
* [.updateConfig(
|
|
41
|
+
* [.config(payload)](#Cobalt+config) ⇒ <code>Promise.<Config></code>
|
|
42
|
+
* [.getConfig(slug, [configId])](#Cobalt+getConfig) ⇒ <code>Promise.<Config></code>
|
|
43
|
+
* [.updateConfig(payload)](#Cobalt+updateConfig) ⇒ <code>Promise.<Config></code>
|
|
47
44
|
* [.deleteConfig(slug, [configId])](#Cobalt+deleteConfig) ⇒ <code>Promise.<unknown></code>
|
|
48
45
|
|
|
49
46
|
<a name="new_Cobalt_new"></a>
|
|
@@ -68,9 +65,9 @@ it returns all the enabled applications.
|
|
|
68
65
|
**Kind**: instance method of [<code>Cobalt</code>](#Cobalt)
|
|
69
66
|
**Returns**: [<code>Promise.<Application></code>](#Application) - The application details.
|
|
70
67
|
|
|
71
|
-
| Param | Type |
|
|
72
|
-
| --- | --- | --- |
|
|
73
|
-
| [slug] | <code>String</code> |
|
|
68
|
+
| Param | Type | Description |
|
|
69
|
+
| --- | --- | --- |
|
|
70
|
+
| [slug] | <code>String</code> | The application slug. |
|
|
74
71
|
|
|
75
72
|
<a name="Cobalt+connect"></a>
|
|
76
73
|
|
|
@@ -98,24 +95,23 @@ Disconnect the specified application and remove any associated data from Cobalt.
|
|
|
98
95
|
|
|
99
96
|
<a name="Cobalt+config"></a>
|
|
100
97
|
|
|
101
|
-
### cobalt.config(
|
|
98
|
+
### cobalt.config(payload) ⇒ <code>Promise.<Config></code>
|
|
102
99
|
Returns the specified config, or creates one if it doesn't exist.
|
|
103
100
|
|
|
104
101
|
**Kind**: instance method of [<code>Cobalt</code>](#Cobalt)
|
|
105
|
-
**Returns**:
|
|
102
|
+
**Returns**: <code>Promise.<Config></code> - The specified config.
|
|
106
103
|
|
|
107
104
|
| Param | Type | Description |
|
|
108
105
|
| --- | --- | --- |
|
|
109
|
-
|
|
|
110
|
-
| [payload] | [<code>ConfigPayload</code>](#ConfigPayload) | The payload object for config. |
|
|
106
|
+
| payload | [<code>ConfigPayload</code>](#ConfigPayload) | The payload object for config. |
|
|
111
107
|
|
|
112
108
|
<a name="Cobalt+getConfig"></a>
|
|
113
109
|
|
|
114
|
-
### cobalt.getConfig(slug, [configId]) ⇒
|
|
110
|
+
### cobalt.getConfig(slug, [configId]) ⇒ <code>Promise.<Config></code>
|
|
115
111
|
Returns the specified config.
|
|
116
112
|
|
|
117
113
|
**Kind**: instance method of [<code>Cobalt</code>](#Cobalt)
|
|
118
|
-
**Returns**:
|
|
114
|
+
**Returns**: <code>Promise.<Config></code> - The specified config.
|
|
119
115
|
|
|
120
116
|
| Param | Type | Description |
|
|
121
117
|
| --- | --- | --- |
|
|
@@ -124,16 +120,15 @@ Returns the specified config.
|
|
|
124
120
|
|
|
125
121
|
<a name="Cobalt+updateConfig"></a>
|
|
126
122
|
|
|
127
|
-
### cobalt.updateConfig(
|
|
123
|
+
### cobalt.updateConfig(payload) ⇒ <code>Promise.<Config></code>
|
|
128
124
|
Update the specified config.
|
|
129
125
|
|
|
130
126
|
**Kind**: instance method of [<code>Cobalt</code>](#Cobalt)
|
|
131
|
-
**Returns**:
|
|
127
|
+
**Returns**: <code>Promise.<Config></code> - The specified config.
|
|
132
128
|
|
|
133
129
|
| Param | Type | Description |
|
|
134
130
|
| --- | --- | --- |
|
|
135
|
-
|
|
|
136
|
-
| payload | [<code>Config</code>](#Config) | The update payload. |
|
|
131
|
+
| payload | [<code>UpdateConfigPayload</code>](#UpdateConfigPayload) | The update payload. |
|
|
137
132
|
|
|
138
133
|
<a name="Cobalt+deleteConfig"></a>
|
|
139
134
|
|
|
@@ -182,69 +177,59 @@ An Input field to take input from the user.
|
|
|
182
177
|
| placeholder | <code>String</code> | The placeholder of the field. |
|
|
183
178
|
| label | <code>String</code> | The label of the field. |
|
|
184
179
|
|
|
185
|
-
<a name="
|
|
180
|
+
<a name="ConfigPayload"></a>
|
|
186
181
|
|
|
187
|
-
##
|
|
188
|
-
The
|
|
182
|
+
## ConfigPayload : <code>Object</code>
|
|
183
|
+
The payload object for config.
|
|
189
184
|
|
|
190
185
|
**Kind**: global typedef
|
|
191
186
|
**Properties**
|
|
192
187
|
|
|
193
188
|
| Name | Type | Description |
|
|
194
189
|
| --- | --- | --- |
|
|
190
|
+
| slug | <code>String</code> | The application slug. |
|
|
195
191
|
| [config_id] | <code>String</code> | Unique ID for the config. |
|
|
196
|
-
|
|
|
197
|
-
| workflows | [<code>Array.<Workflow></code>](#Workflow) | Whether the workflow is enabled. |
|
|
192
|
+
| labels | <code>Object.<string, Array.<Label>></code> | The dynamic label mappings. |
|
|
198
193
|
|
|
199
|
-
<a name="
|
|
194
|
+
<a name="Label"></a>
|
|
200
195
|
|
|
201
|
-
##
|
|
202
|
-
|
|
196
|
+
## Label : <code>Object</code>
|
|
197
|
+
Label Mapping
|
|
203
198
|
|
|
204
199
|
**Kind**: global typedef
|
|
205
200
|
**Properties**
|
|
206
201
|
|
|
207
202
|
| Name | Type | Description |
|
|
208
203
|
| --- | --- | --- |
|
|
209
|
-
|
|
|
210
|
-
|
|
|
211
|
-
| data_slots | <code>Object.<string, (string\|number\|boolean)></code> | A map of workflow's data slots and their values. |
|
|
204
|
+
| name | <code>string</code> | The label name. |
|
|
205
|
+
| value | <code>string</code> \| <code>number</code> \| <code>boolean</code> | The label value. |
|
|
212
206
|
|
|
213
|
-
<a name="
|
|
207
|
+
<a name="UpdateConfigPayload"></a>
|
|
214
208
|
|
|
215
|
-
##
|
|
216
|
-
The
|
|
209
|
+
## UpdateConfigPayload : <code>Object</code>
|
|
210
|
+
The configuration data for an application.
|
|
217
211
|
|
|
218
212
|
**Kind**: global typedef
|
|
219
213
|
**Properties**
|
|
220
214
|
|
|
221
215
|
| Name | Type | Description |
|
|
222
216
|
| --- | --- | --- |
|
|
217
|
+
| slug | <code>String</code> | The application slug. |
|
|
223
218
|
| [config_id] | <code>String</code> | Unique ID for the config. |
|
|
224
|
-
|
|
|
225
|
-
|
|
226
|
-
<a name="DynamicField"></a>
|
|
219
|
+
| fields | <code>Object.<string, (string\|number\|boolean)></code> | A map of application fields and their values. |
|
|
220
|
+
| workflows | [<code>Array.<WorkflowPayload></code>](#WorkflowPayload) | Whether the workflow is enabled. |
|
|
227
221
|
|
|
228
|
-
|
|
229
|
-
Field Mapping Label
|
|
222
|
+
<a name="WorkflowPayload"></a>
|
|
230
223
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
| Name | Type | Description |
|
|
235
|
-
| --- | --- | --- |
|
|
236
|
-
| fields | [<code>Array.<Label></code>](#Label) | The Label name. |
|
|
237
|
-
|
|
238
|
-
<a name="Label"></a>
|
|
239
|
-
|
|
240
|
-
## Label : <code>Object</code>
|
|
241
|
-
Field Mapping Label
|
|
224
|
+
## WorkflowPayload : <code>Object</code>
|
|
225
|
+
The workflow.
|
|
242
226
|
|
|
243
227
|
**Kind**: global typedef
|
|
244
228
|
**Properties**
|
|
245
229
|
|
|
246
230
|
| Name | Type | Description |
|
|
247
231
|
| --- | --- | --- |
|
|
248
|
-
|
|
|
249
|
-
|
|
|
232
|
+
| id | <code>String</code> | The ID of the workflow. |
|
|
233
|
+
| enabled | <code>Boolean</code> | Whether the workflow is enabled. |
|
|
234
|
+
| fields | <code>Object.<string, (string\|number\|boolean)></code> | A map of workflow fields and their values. |
|
|
250
235
|
|