@cobaltio/cobalt-js 3.0.1 → 3.0.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 (4) hide show
  1. package/README.md +31 -6
  2. package/cobalt.js +11 -0
  3. package/docs.md +24 -3
  4. package/package.json +1 -1
package/README.md CHANGED
@@ -21,10 +21,14 @@ yarn add @cobaltio/cobalt-js
21
21
 
22
22
  #### Browser
23
23
  ```html
24
- <!-- import the latest version -->
24
+ <!-- use a specific version -->
25
+ <script src="https://cdn.jsdelivr.net/npm/@cobaltio/cobalt-js@3.0.1"></script>
26
+ <!-- use a version range instead of a specific version -->
27
+ <script src="https://cdn.jsdelivr.net/npm/@cobaltio/cobalt-js@3"></script>
28
+ <script src="https://cdn.jsdelivr.net/npm/@cobaltio/cobalt-js@3.0"></script>
29
+ <!-- omit the version completely to use the latest one -->
30
+ <!-- you should NOT use this in production -->
25
31
  <script src="https://cdn.jsdelivr.net/npm/@cobaltio/cobalt-js"></script>
26
- <!-- import a specific version -->
27
- <script src="https://cdn.jsdelivr.net/npm/@cobaltio/cobalt-js@2"></script>
28
32
  ```
29
33
 
30
34
  #### Node
@@ -62,6 +66,9 @@ cobalt.token = "COBALT_SESSION_TOKEN";
62
66
  ## Typedefs
63
67
 
64
68
  <dl>
69
+ <dt><a href="#Application">Application</a> : <code>Object</code></dt>
70
+ <dd><p>An application in Cobalt.</p>
71
+ </dd>
65
72
  <dt><a href="#Label">Label</a> : <code>Object</code></dt>
66
73
  <dd><p>Field Mapping Label</p>
67
74
  </dd>
@@ -94,7 +101,7 @@ Cobalt Frontend SDK
94
101
  * [.updateConfig(slug, configId, payload)](#Cobalt+updateConfig) ⇒ [<code>Promise.&lt;Config&gt;</code>](#Config)
95
102
  * [.deleteConfig(slug, configId)](#Cobalt+deleteConfig) ⇒ <code>Promise.&lt;unknown&gt;</code>
96
103
  * Additional Methods:
97
- * [.getApp(slug)](#Cobalt+getApp) ⇒ <code>Promise.&lt;Application&gt;</code>
104
+ * [.getApp(slug)](#Cobalt+getApp) ⇒ [<code>Promise.&lt;Application&gt;</code>](#Application)
98
105
  * [.getConfig(slug, configId)](#Cobalt+getConfig) ⇒ [<code>Promise.&lt;Config&gt;</code>](#Config)
99
106
 
100
107
  <a name="new_Cobalt_new"></a>
@@ -111,12 +118,12 @@ Cobalt Frontend SDK
111
118
 
112
119
  <a name="Cobalt+getApp"></a>
113
120
 
114
- ### cobalt.getApp(slug) ⇒ <code>Promise.&lt;Application&gt;</code>
121
+ ### cobalt.getApp(slug) ⇒ [<code>Promise.&lt;Application&gt;</code>](#Application)
115
122
  Returns the application details for the specified application, provided
116
123
  the application is enabled in Cobalt.
117
124
 
118
125
  **Kind**: instance method of [<code>Cobalt</code>](#Cobalt)
119
- **Returns**: <code>Promise.&lt;Application&gt;</code> - The application details.
126
+ **Returns**: [<code>Promise.&lt;Application&gt;</code>](#Application) - The application details.
120
127
 
121
128
  | Param | Type | Description |
122
129
  | --- | --- | --- |
@@ -199,6 +206,24 @@ Delete the specified config.
199
206
  | slug | <code>String</code> | The application slug. |
200
207
  | configId | <code>String</code> | The unique ID of the config. |
201
208
 
209
+ <a name="Application"></a>
210
+
211
+ ## Application : <code>Object</code>
212
+ An application in Cobalt.
213
+
214
+ **Kind**: global typedef
215
+ **Properties**
216
+
217
+ | Name | Type | Description |
218
+ | --- | --- | --- |
219
+ | name | <code>String</code> | The application name. |
220
+ | description | <code>String</code> | The application description. |
221
+ | icon | <code>String</code> | The application icon. |
222
+ | type | <code>String</code> | The application slug for native apps. |
223
+ | [slug] | <code>String</code> | The application slug for custom apps. |
224
+ | auth_type | <code>&quot;oauth2&quot;</code> \| <code>&quot;keybased&quot;</code> | The type of auth used by application. |
225
+ | [connected] | <code>Boolean</code> | Whether the user has connected the application. |
226
+
202
227
  <a name="Label"></a>
203
228
 
204
229
  ## Label : <code>Object</code>
package/cobalt.js CHANGED
@@ -21,6 +21,17 @@ class Cobalt {
21
21
  return this.sessionToken = typeof token === "string" ? token : "";
22
22
  };
23
23
 
24
+ /**
25
+ * @typedef {Object} Application An application in Cobalt.
26
+ * @property {String} name The application name.
27
+ * @property {String} description The application description.
28
+ * @property {String} icon The application icon.
29
+ * @property {String} type The application slug for native apps.
30
+ * @property {String} [slug] The application slug for custom apps.
31
+ * @property {"oauth2"|"keybased"} auth_type The type of auth used by application.
32
+ * @property {Boolean} [connected] Whether the user has connected the application.
33
+ */
34
+
24
35
  /**
25
36
  * Returns the application details for the specified application, provided
26
37
  * the application is enabled in Cobalt.
package/docs.md CHANGED
@@ -9,6 +9,9 @@
9
9
  ## Typedefs
10
10
 
11
11
  <dl>
12
+ <dt><a href="#Application">Application</a> : <code>Object</code></dt>
13
+ <dd><p>An application in Cobalt.</p>
14
+ </dd>
12
15
  <dt><a href="#Label">Label</a> : <code>Object</code></dt>
13
16
  <dd><p>Field Mapping Label</p>
14
17
  </dd>
@@ -35,7 +38,7 @@ Cobalt Frontend SDK
35
38
 
36
39
  * [Cobalt](#Cobalt)
37
40
  * [new Cobalt(options)](#new_Cobalt_new)
38
- * [.getApp(slug)](#Cobalt+getApp) ⇒ <code>Promise.&lt;Application&gt;</code>
41
+ * [.getApp(slug)](#Cobalt+getApp) ⇒ [<code>Promise.&lt;Application&gt;</code>](#Application)
39
42
  * [.connect(slug, [payload])](#Cobalt+connect) ⇒ <code>Promise.&lt;Boolean&gt;</code>
40
43
  * [.disconnect(slug)](#Cobalt+disconnect) ⇒ <code>Promise.&lt;void&gt;</code>
41
44
  * [.config(slug, configId, [fields])](#Cobalt+config) ⇒ [<code>Promise.&lt;Config&gt;</code>](#Config)
@@ -57,12 +60,12 @@ Cobalt Frontend SDK
57
60
 
58
61
  <a name="Cobalt+getApp"></a>
59
62
 
60
- ### cobalt.getApp(slug) ⇒ <code>Promise.&lt;Application&gt;</code>
63
+ ### cobalt.getApp(slug) ⇒ [<code>Promise.&lt;Application&gt;</code>](#Application)
61
64
  Returns the application details for the specified application, provided
62
65
  the application is enabled in Cobalt.
63
66
 
64
67
  **Kind**: instance method of [<code>Cobalt</code>](#Cobalt)
65
- **Returns**: <code>Promise.&lt;Application&gt;</code> - The application details.
68
+ **Returns**: [<code>Promise.&lt;Application&gt;</code>](#Application) - The application details.
66
69
 
67
70
  | Param | Type | Description |
68
71
  | --- | --- | --- |
@@ -145,6 +148,24 @@ Delete the specified config.
145
148
  | slug | <code>String</code> | The application slug. |
146
149
  | configId | <code>String</code> | The unique ID of the config. |
147
150
 
151
+ <a name="Application"></a>
152
+
153
+ ## Application : <code>Object</code>
154
+ An application in Cobalt.
155
+
156
+ **Kind**: global typedef
157
+ **Properties**
158
+
159
+ | Name | Type | Description |
160
+ | --- | --- | --- |
161
+ | name | <code>String</code> | The application name. |
162
+ | description | <code>String</code> | The application description. |
163
+ | icon | <code>String</code> | The application icon. |
164
+ | type | <code>String</code> | The application slug for native apps. |
165
+ | [slug] | <code>String</code> | The application slug for custom apps. |
166
+ | auth_type | <code>&quot;oauth2&quot;</code> \| <code>&quot;keybased&quot;</code> | The type of auth used by application. |
167
+ | [connected] | <code>Boolean</code> | Whether the user has connected the application. |
168
+
148
169
  <a name="Label"></a>
149
170
 
150
171
  ## Label : <code>Object</code>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cobaltio/cobalt-js",
3
- "version": "3.0.1",
3
+ "version": "3.0.2",
4
4
  "description": "Cobalt frontend SDK",
5
5
  "main": "./cobalt.js",
6
6
  "scripts": {