@zapier/zapier-sdk 0.5.1 → 0.6.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/CHANGELOG.md +19 -0
- package/README.md +107 -83
- package/dist/api/index.d.ts +1 -1
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/schemas.d.ts +6 -6
- package/dist/api/types.d.ts +7 -7
- package/dist/api/types.d.ts.map +1 -1
- package/dist/index.cjs +343 -67
- package/dist/index.d.mts +416 -347
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.mjs +343 -67
- package/dist/plugins/api/index.js +1 -1
- package/dist/plugins/apps/types.d.ts +1 -1
- package/dist/plugins/apps/types.d.ts.map +1 -1
- package/dist/plugins/findFirstAuthentication/index.d.ts.map +1 -1
- package/dist/plugins/findFirstAuthentication/index.js +1 -0
- package/dist/plugins/findUniqueAuthentication/index.d.ts.map +1 -1
- package/dist/plugins/findUniqueAuthentication/index.js +1 -0
- package/dist/plugins/getAction/index.d.ts.map +1 -1
- package/dist/plugins/getAction/index.js +1 -0
- package/dist/plugins/getAction/index.test.js +1 -1
- package/dist/plugins/getApp/index.d.ts +6 -3
- package/dist/plugins/getApp/index.d.ts.map +1 -1
- package/dist/plugins/getApp/index.js +8 -18
- package/dist/plugins/getApp/index.test.js +2 -0
- package/dist/plugins/getAuthentication/index.d.ts.map +1 -1
- package/dist/plugins/getAuthentication/index.js +1 -0
- package/dist/plugins/getAuthentication/index.test.js +12 -1
- package/dist/plugins/getProfile/index.d.ts.map +1 -1
- package/dist/plugins/getProfile/index.js +1 -0
- package/dist/plugins/listActions/index.d.ts +5 -3
- package/dist/plugins/listActions/index.d.ts.map +1 -1
- package/dist/plugins/listActions/index.js +6 -6
- package/dist/plugins/listActions/index.test.js +26 -74
- package/dist/plugins/listActions/schemas.d.ts +4 -4
- package/dist/plugins/listApps/index.d.ts.map +1 -1
- package/dist/plugins/listApps/index.js +1 -0
- package/dist/plugins/listApps/schemas.d.ts +2 -2
- package/dist/plugins/listAuthentications/index.d.ts +4 -2
- package/dist/plugins/listAuthentications/index.d.ts.map +1 -1
- package/dist/plugins/listAuthentications/index.js +9 -12
- package/dist/plugins/listAuthentications/index.test.js +33 -40
- package/dist/plugins/listAuthentications/schemas.d.ts +4 -4
- package/dist/plugins/listInputFields/index.d.ts +3 -1
- package/dist/plugins/listInputFields/index.d.ts.map +1 -1
- package/dist/plugins/listInputFields/index.js +5 -5
- package/dist/plugins/listInputFields/index.test.js +10 -8
- package/dist/plugins/listInputFields/schemas.d.ts +4 -4
- package/dist/plugins/lockVersion/index.d.ts +24 -0
- package/dist/plugins/lockVersion/index.d.ts.map +1 -0
- package/dist/plugins/lockVersion/index.js +72 -0
- package/dist/plugins/lockVersion/index.test.d.ts +2 -0
- package/dist/plugins/lockVersion/index.test.d.ts.map +1 -0
- package/dist/plugins/lockVersion/index.test.js +129 -0
- package/dist/plugins/lockVersion/schemas.d.ts +10 -0
- package/dist/plugins/lockVersion/schemas.d.ts.map +1 -0
- package/dist/plugins/lockVersion/schemas.js +6 -0
- package/dist/plugins/manifest/index.d.ts +24 -0
- package/dist/plugins/manifest/index.d.ts.map +1 -0
- package/dist/plugins/manifest/index.js +119 -0
- package/dist/plugins/manifest/index.test.d.ts +2 -0
- package/dist/plugins/manifest/index.test.d.ts.map +1 -0
- package/dist/plugins/manifest/index.test.js +331 -0
- package/dist/plugins/manifest/schemas.d.ts +64 -0
- package/dist/plugins/manifest/schemas.d.ts.map +1 -0
- package/dist/plugins/manifest/schemas.js +25 -0
- package/dist/plugins/registry/index.d.ts +9 -1
- package/dist/plugins/registry/index.d.ts.map +1 -1
- package/dist/plugins/registry/index.js +68 -3
- package/dist/plugins/request/index.d.ts.map +1 -1
- package/dist/plugins/request/index.js +1 -0
- package/dist/plugins/request/index.test.js +6 -1
- package/dist/plugins/request/schemas.d.ts +4 -4
- package/dist/plugins/runAction/index.d.ts +2 -0
- package/dist/plugins/runAction/index.d.ts.map +1 -1
- package/dist/plugins/runAction/index.js +5 -5
- package/dist/plugins/runAction/index.test.js +9 -8
- package/dist/plugins/runAction/schemas.d.ts +4 -4
- package/dist/schemas/Auth.d.ts +4 -4
- package/dist/schemas/Field.d.ts.map +1 -1
- package/dist/sdk.d.ts +3 -3
- package/dist/sdk.d.ts.map +1 -1
- package/dist/sdk.js +18 -7
- package/dist/sdk.test.js +1 -1
- package/dist/types/errors.d.ts +6 -6
- package/dist/types/errors.d.ts.map +1 -1
- package/dist/types/events.d.ts +1 -1
- package/dist/types/events.d.ts.map +1 -1
- package/dist/types/plugin.d.ts +10 -2
- package/dist/types/plugin.d.ts.map +1 -1
- package/dist/types/sdk.d.ts +13 -2
- package/dist/types/sdk.d.ts.map +1 -1
- package/dist/utils/validation.test.js +2 -1
- package/package.json +2 -2
- package/src/api/client.ts +3 -3
- package/src/api/index.ts +2 -0
- package/src/api/types.ts +15 -7
- package/src/index.ts +0 -2
- package/src/plugins/api/index.ts +1 -1
- package/src/plugins/apps/types.ts +1 -1
- package/src/plugins/findFirstAuthentication/index.ts +1 -0
- package/src/plugins/findUniqueAuthentication/index.ts +1 -0
- package/src/plugins/getAction/index.test.ts +1 -1
- package/src/plugins/getAction/index.ts +1 -0
- package/src/plugins/getApp/index.test.ts +2 -0
- package/src/plugins/getApp/index.ts +12 -24
- package/src/plugins/getAuthentication/index.test.ts +13 -3
- package/src/plugins/getAuthentication/index.ts +1 -0
- package/src/plugins/getProfile/index.ts +1 -0
- package/src/plugins/listActions/index.test.ts +30 -89
- package/src/plugins/listActions/index.ts +34 -27
- package/src/plugins/listApps/index.ts +1 -0
- package/src/plugins/listAuthentications/index.test.ts +38 -47
- package/src/plugins/listAuthentications/index.ts +21 -18
- package/src/plugins/listInputFields/index.test.ts +12 -9
- package/src/plugins/listInputFields/index.ts +10 -6
- package/src/plugins/lockVersion/index.test.ts +176 -0
- package/src/plugins/lockVersion/index.ts +112 -0
- package/src/plugins/lockVersion/schemas.ts +9 -0
- package/src/plugins/manifest/index.test.ts +439 -0
- package/src/plugins/manifest/index.ts +171 -0
- package/src/plugins/manifest/schemas.ts +53 -0
- package/src/plugins/registry/index.ts +89 -8
- package/src/plugins/request/index.test.ts +8 -4
- package/src/plugins/request/index.ts +1 -0
- package/src/plugins/runAction/index.test.ts +9 -8
- package/src/plugins/runAction/index.ts +18 -9
- package/src/schemas/Field.ts +5 -2
- package/src/sdk.test.ts +1 -1
- package/src/sdk.ts +22 -7
- package/src/types/errors.ts +9 -6
- package/src/types/events.ts +1 -1
- package/src/types/plugin.ts +14 -2
- package/src/types/sdk.ts +15 -1
- package/src/utils/validation.test.ts +2 -1
- package/tsconfig.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @zapier/zapier-sdk
|
|
2
2
|
|
|
3
|
+
## 0.6.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- c472d6f: Add manifest plugin to consume a supplied manifest, as well as lockVersion plugin to create or update the manifest.
|
|
8
|
+
- c402bcd: Remove \_\_registry in favor of getRegistry that also provides categories for functions.
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- e08365e: Add support for lock file in generate-types command
|
|
13
|
+
|
|
14
|
+
## 0.5.2
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- 218a3ca: reducing 'any' usage with minimal changes to runtime
|
|
19
|
+
- Updated dependencies [218a3ca]
|
|
20
|
+
- @zapier/zapier-sdk-cli-login@0.3.2
|
|
21
|
+
|
|
3
22
|
## 0.5.1
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -8,22 +8,24 @@
|
|
|
8
8
|
- [Quick Start](#quick-start)
|
|
9
9
|
- [Available Functions](#available-functions)
|
|
10
10
|
- [Actions](#actions)
|
|
11
|
-
- [`listActions`](#listactions)
|
|
12
11
|
- [`getAction`](#getaction)
|
|
12
|
+
- [`listActions`](#listactions)
|
|
13
13
|
- [`listInputFields`](#listinputfields)
|
|
14
14
|
- [`runAction`](#runaction)
|
|
15
15
|
- [Apps](#apps)
|
|
16
|
-
- [`listApps`](#listapps)
|
|
17
16
|
- [`getApp`](#getapp)
|
|
18
|
-
- [
|
|
19
|
-
|
|
20
|
-
- [`getAuthentication`](#getauthentication)
|
|
17
|
+
- [`listApps`](#listapps)
|
|
18
|
+
- [Authentications](#authentications)
|
|
21
19
|
- [`findFirstAuthentication`](#findfirstauthentication)
|
|
22
20
|
- [`findUniqueAuthentication`](#finduniqueauthentication)
|
|
21
|
+
- [`getAuthentication`](#getauthentication)
|
|
22
|
+
- [`listAuthentications`](#listauthentications)
|
|
23
23
|
- [HTTP Requests](#http-requests)
|
|
24
24
|
- [`request`](#request)
|
|
25
|
-
- [
|
|
25
|
+
- [Users](#users)
|
|
26
26
|
- [`getProfile`](#getprofile)
|
|
27
|
+
- [Utilities](#utilities)
|
|
28
|
+
- [`lockVersion`](#lockversion)
|
|
27
29
|
|
|
28
30
|
## Installation
|
|
29
31
|
|
|
@@ -59,50 +61,50 @@ const result = await sdk.runAction({
|
|
|
59
61
|
|
|
60
62
|
### Actions
|
|
61
63
|
|
|
62
|
-
#### `
|
|
64
|
+
#### `getAction`
|
|
63
65
|
|
|
64
|
-
|
|
66
|
+
Get detailed information about a specific action
|
|
65
67
|
|
|
66
68
|
**Parameters:**
|
|
67
69
|
|
|
68
|
-
| Name | Type | Required | Default | Possible Values | Description
|
|
69
|
-
| ------------ | -------- | -------- | ------- | ---------------------------------------------------------------------------------------------- |
|
|
70
|
-
| `appKey` | `string` | ✅ | — | — | App key
|
|
71
|
-
| `actionType` | `string` |
|
|
72
|
-
| `
|
|
73
|
-
| `maxItems` | `number` | ❌ | — | — | Maximum total items to return across all pages |
|
|
70
|
+
| Name | Type | Required | Default | Possible Values | Description |
|
|
71
|
+
| ------------ | -------- | -------- | ------- | ---------------------------------------------------------------------------------------------- | -------------------------------------------------- |
|
|
72
|
+
| `appKey` | `string` | ✅ | — | — | App key (e.g., 'SlackCLIAPI') |
|
|
73
|
+
| `actionType` | `string` | ✅ | — | `read`, `read_bulk`, `write`, `run`, `search`, `search_or_write`, `search_and_write`, `filter` | Action type that matches the action's defined type |
|
|
74
|
+
| `actionKey` | `string` | ✅ | — | — | Action key to execute |
|
|
74
75
|
|
|
75
|
-
**Returns:** `Promise<
|
|
76
|
+
**Returns:** `Promise<ActionItem>`
|
|
76
77
|
|
|
77
78
|
**Example:**
|
|
78
79
|
|
|
79
80
|
```typescript
|
|
80
|
-
const result = await sdk.
|
|
81
|
+
const result = await sdk.getAction({
|
|
81
82
|
appKey: "example-key",
|
|
83
|
+
actionType: "read",
|
|
84
|
+
actionKey: "example-key",
|
|
82
85
|
});
|
|
83
86
|
```
|
|
84
87
|
|
|
85
|
-
#### `
|
|
88
|
+
#### `listActions`
|
|
86
89
|
|
|
87
|
-
|
|
90
|
+
List all actions for a specific app
|
|
88
91
|
|
|
89
92
|
**Parameters:**
|
|
90
93
|
|
|
91
|
-
| Name | Type | Required | Default | Possible Values | Description
|
|
92
|
-
| ------------ | -------- | -------- | ------- | ---------------------------------------------------------------------------------------------- |
|
|
93
|
-
| `appKey` | `string` | ✅ | — | — | App key (e.g., 'SlackCLIAPI')
|
|
94
|
-
| `actionType` | `string` |
|
|
95
|
-
| `
|
|
94
|
+
| Name | Type | Required | Default | Possible Values | Description |
|
|
95
|
+
| ------------ | -------- | -------- | ------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------ |
|
|
96
|
+
| `appKey` | `string` | ✅ | — | — | App key of actions to list (e.g., 'SlackCLIAPI') |
|
|
97
|
+
| `actionType` | `string` | ❌ | — | `read`, `read_bulk`, `write`, `run`, `search`, `search_or_write`, `search_and_write`, `filter` | Filter actions by type |
|
|
98
|
+
| `pageSize` | `number` | ❌ | — | — | Number of actions per page |
|
|
99
|
+
| `maxItems` | `number` | ❌ | — | — | Maximum total items to return across all pages |
|
|
96
100
|
|
|
97
|
-
**Returns:** `Promise<ActionItem
|
|
101
|
+
**Returns:** `Promise<PaginatedResult<ActionItem>>`
|
|
98
102
|
|
|
99
103
|
**Example:**
|
|
100
104
|
|
|
101
105
|
```typescript
|
|
102
|
-
const result = await sdk.
|
|
106
|
+
const result = await sdk.listActions({
|
|
103
107
|
appKey: "example-key",
|
|
104
|
-
actionType: "read",
|
|
105
|
-
actionKey: "example-key",
|
|
106
108
|
});
|
|
107
109
|
```
|
|
108
110
|
|
|
@@ -164,27 +166,6 @@ const result = await sdk.runAction({
|
|
|
164
166
|
|
|
165
167
|
### Apps
|
|
166
168
|
|
|
167
|
-
#### `listApps`
|
|
168
|
-
|
|
169
|
-
List all available apps with optional filtering
|
|
170
|
-
|
|
171
|
-
**Parameters:**
|
|
172
|
-
|
|
173
|
-
| Name | Type | Required | Default | Possible Values | Description |
|
|
174
|
-
| ---------- | -------- | -------- | ------- | --------------- | ------------------------------------------------------------------- |
|
|
175
|
-
| `appKeys` | `array` | ❌ | — | — | Filter apps by app keys (e.g., 'SlackCLIAPI' or slug like 'github') |
|
|
176
|
-
| `search` | `string` | ❌ | — | — | Search for apps by name |
|
|
177
|
-
| `pageSize` | `number` | ❌ | — | — | Number of apps per page |
|
|
178
|
-
| `maxItems` | `number` | ❌ | — | — | Maximum total items to return across all pages |
|
|
179
|
-
|
|
180
|
-
**Returns:** `Promise<PaginatedResult<AppItem>>`
|
|
181
|
-
|
|
182
|
-
**Example:**
|
|
183
|
-
|
|
184
|
-
```typescript
|
|
185
|
-
const result = await sdk.listApps();
|
|
186
|
-
```
|
|
187
|
-
|
|
188
169
|
#### `getApp`
|
|
189
170
|
|
|
190
171
|
Get detailed information about a specific app
|
|
@@ -205,51 +186,28 @@ const result = await sdk.getApp({
|
|
|
205
186
|
});
|
|
206
187
|
```
|
|
207
188
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
#### `listAuthentications`
|
|
189
|
+
#### `listApps`
|
|
211
190
|
|
|
212
|
-
List available
|
|
191
|
+
List all available apps with optional filtering
|
|
213
192
|
|
|
214
193
|
**Parameters:**
|
|
215
194
|
|
|
216
|
-
| Name
|
|
217
|
-
|
|
|
218
|
-
| `
|
|
219
|
-
| `search`
|
|
220
|
-
| `
|
|
221
|
-
| `
|
|
222
|
-
| `owner` | `string` | ❌ | — | — | Filter by owner |
|
|
223
|
-
| `pageSize` | `number` | ❌ | — | — | Number of authentications per page |
|
|
224
|
-
| `maxItems` | `number` | ❌ | — | — | Maximum total items to return across all pages |
|
|
195
|
+
| Name | Type | Required | Default | Possible Values | Description |
|
|
196
|
+
| ---------- | -------- | -------- | ------- | --------------- | ------------------------------------------------------------------- |
|
|
197
|
+
| `appKeys` | `array` | ❌ | — | — | Filter apps by app keys (e.g., 'SlackCLIAPI' or slug like 'github') |
|
|
198
|
+
| `search` | `string` | ❌ | — | — | Search for apps by name |
|
|
199
|
+
| `pageSize` | `number` | ❌ | — | — | Number of apps per page |
|
|
200
|
+
| `maxItems` | `number` | ❌ | — | — | Maximum total items to return across all pages |
|
|
225
201
|
|
|
226
|
-
**Returns:** `Promise<PaginatedResult<
|
|
202
|
+
**Returns:** `Promise<PaginatedResult<AppItem>>`
|
|
227
203
|
|
|
228
204
|
**Example:**
|
|
229
205
|
|
|
230
206
|
```typescript
|
|
231
|
-
const result = await sdk.
|
|
207
|
+
const result = await sdk.listApps();
|
|
232
208
|
```
|
|
233
209
|
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
Get a specific authentication by ID
|
|
237
|
-
|
|
238
|
-
**Parameters:**
|
|
239
|
-
|
|
240
|
-
| Name | Type | Required | Default | Possible Values | Description |
|
|
241
|
-
| ------------------ | -------- | -------- | ------- | --------------- | ----------------------------- |
|
|
242
|
-
| `authenticationId` | `number` | ✅ | — | — | Authentication ID to retrieve |
|
|
243
|
-
|
|
244
|
-
**Returns:** `Promise<Authentication>`
|
|
245
|
-
|
|
246
|
-
**Example:**
|
|
247
|
-
|
|
248
|
-
```typescript
|
|
249
|
-
const result = await sdk.getAuthentication({
|
|
250
|
-
authenticationId: 12345,
|
|
251
|
-
});
|
|
252
|
-
```
|
|
210
|
+
### Authentications
|
|
253
211
|
|
|
254
212
|
#### `findFirstAuthentication`
|
|
255
213
|
|
|
@@ -295,6 +253,50 @@ Find a unique authentication matching the criteria
|
|
|
295
253
|
const result = await sdk.findUniqueAuthentication();
|
|
296
254
|
```
|
|
297
255
|
|
|
256
|
+
#### `getAuthentication`
|
|
257
|
+
|
|
258
|
+
Get a specific authentication by ID
|
|
259
|
+
|
|
260
|
+
**Parameters:**
|
|
261
|
+
|
|
262
|
+
| Name | Type | Required | Default | Possible Values | Description |
|
|
263
|
+
| ------------------ | -------- | -------- | ------- | --------------- | ----------------------------- |
|
|
264
|
+
| `authenticationId` | `number` | ✅ | — | — | Authentication ID to retrieve |
|
|
265
|
+
|
|
266
|
+
**Returns:** `Promise<Authentication>`
|
|
267
|
+
|
|
268
|
+
**Example:**
|
|
269
|
+
|
|
270
|
+
```typescript
|
|
271
|
+
const result = await sdk.getAuthentication({
|
|
272
|
+
authenticationId: 12345,
|
|
273
|
+
});
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
#### `listAuthentications`
|
|
277
|
+
|
|
278
|
+
List available authentications with optional filtering
|
|
279
|
+
|
|
280
|
+
**Parameters:**
|
|
281
|
+
|
|
282
|
+
| Name | Type | Required | Default | Possible Values | Description |
|
|
283
|
+
| ------------ | -------- | -------- | ------- | --------------- | -------------------------------------------------------- |
|
|
284
|
+
| `appKey` | `string` | ❌ | — | — | App key of authentications to list (e.g., 'SlackCLIAPI') |
|
|
285
|
+
| `search` | `string` | ❌ | — | — | Search term to filter authentications by title |
|
|
286
|
+
| `title` | `string` | ❌ | — | — | Filter authentications by exact title match |
|
|
287
|
+
| `account_id` | `string` | ❌ | — | — | Filter by account ID |
|
|
288
|
+
| `owner` | `string` | ❌ | — | — | Filter by owner |
|
|
289
|
+
| `pageSize` | `number` | ❌ | — | — | Number of authentications per page |
|
|
290
|
+
| `maxItems` | `number` | ❌ | — | — | Maximum total items to return across all pages |
|
|
291
|
+
|
|
292
|
+
**Returns:** `Promise<PaginatedResult<Authentication>>`
|
|
293
|
+
|
|
294
|
+
**Example:**
|
|
295
|
+
|
|
296
|
+
```typescript
|
|
297
|
+
const result = await sdk.listAuthentications();
|
|
298
|
+
```
|
|
299
|
+
|
|
298
300
|
### HTTP Requests
|
|
299
301
|
|
|
300
302
|
#### `request`
|
|
@@ -324,7 +326,7 @@ const result = await sdk.request({
|
|
|
324
326
|
});
|
|
325
327
|
```
|
|
326
328
|
|
|
327
|
-
###
|
|
329
|
+
### Users
|
|
328
330
|
|
|
329
331
|
#### `getProfile`
|
|
330
332
|
|
|
@@ -340,4 +342,26 @@ Get current user's profile information
|
|
|
340
342
|
const result = await sdk.getProfile();
|
|
341
343
|
```
|
|
342
344
|
|
|
345
|
+
### Utilities
|
|
346
|
+
|
|
347
|
+
#### `lockVersion`
|
|
348
|
+
|
|
349
|
+
Execute lockVersion
|
|
350
|
+
|
|
351
|
+
**Parameters:**
|
|
352
|
+
|
|
353
|
+
| Name | Type | Required | Default | Possible Values | Description |
|
|
354
|
+
| -------- | -------- | -------- | ------- | --------------- | -------------------------------------------------------- |
|
|
355
|
+
| `appKey` | `string` | ✅ | — | — | The app key to lock version for (e.g., 'slack', 'gmail') |
|
|
356
|
+
|
|
357
|
+
**Returns:** `Promise<any>`
|
|
358
|
+
|
|
359
|
+
**Example:**
|
|
360
|
+
|
|
361
|
+
```typescript
|
|
362
|
+
const result = await sdk.lockVersion({
|
|
363
|
+
appKey: "example-key",
|
|
364
|
+
});
|
|
365
|
+
```
|
|
366
|
+
|
|
343
367
|
<!-- End Generated API Reference -->
|
package/dist/api/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* with Zapier's various APIs. It handles authentication, error handling,
|
|
6
6
|
* polling, and provides consistent patterns across all services.
|
|
7
7
|
*/
|
|
8
|
-
export type { ApiClient, ApiClientOptions, RequestOptions, PollOptions, DebugLogger, Action, Field, Choice, ActionExecutionResult, ActionField, ActionFieldChoice, NeedsRequest, NeedsResponse, Authentication, AuthenticationsResponse, } from "./types";
|
|
8
|
+
export type { ApiClient, ApiClientOptions, RequestOptions, PollOptions, DebugLogger, Action, Field, Choice, ActionExecutionResult, ActionField, ActionFieldChoice, NeedsRequest, NeedsResponse, Authentication, AuthenticationsResponse, Implementation, ImplementationsResponse, } from "./types";
|
|
9
9
|
import type { ApiClient } from "./types";
|
|
10
10
|
export { isJwt, getAuthorizationHeader } from "./auth";
|
|
11
11
|
export { createDebugLogger, createDebugFetch } from "./debug";
|
package/dist/api/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,YAAY,EAEV,SAAS,EACT,gBAAgB,EAChB,cAAc,EACd,WAAW,EACX,WAAW,EAEX,MAAM,EACN,KAAK,EACL,MAAM,EACN,qBAAqB,EACrB,WAAW,EACX,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,cAAc,EACd,uBAAuB,GACxB,MAAM,SAAS,CAAC;AAGjB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAGzC,OAAO,EAAE,KAAK,EAAE,sBAAsB,EAAE,MAAM,QAAQ,CAAC;AAGvD,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAG9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAG9C,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAM3C,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE;IAC3C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ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AsBZ"}
|
package/dist/api/schemas.d.ts
CHANGED
|
@@ -523,6 +523,7 @@ export declare const AuthenticationSchema: z.ZodObject<{
|
|
|
523
523
|
is_invite_only: boolean;
|
|
524
524
|
is_private: boolean;
|
|
525
525
|
shared_with_all: boolean;
|
|
526
|
+
url?: string | undefined;
|
|
526
527
|
title?: string | null | undefined;
|
|
527
528
|
label?: string | null | undefined;
|
|
528
529
|
permissions?: Record<string, boolean> | undefined;
|
|
@@ -533,7 +534,6 @@ export declare const AuthenticationSchema: z.ZodObject<{
|
|
|
533
534
|
is_shared?: string | undefined;
|
|
534
535
|
marked_stale_at?: string | null | undefined;
|
|
535
536
|
identifier?: string | null | undefined;
|
|
536
|
-
url?: string | undefined;
|
|
537
537
|
groups?: string | undefined;
|
|
538
538
|
members?: string | undefined;
|
|
539
539
|
}, {
|
|
@@ -544,6 +544,7 @@ export declare const AuthenticationSchema: z.ZodObject<{
|
|
|
544
544
|
is_invite_only: boolean;
|
|
545
545
|
is_private: boolean;
|
|
546
546
|
shared_with_all: boolean;
|
|
547
|
+
url?: string | undefined;
|
|
547
548
|
title?: string | null | undefined;
|
|
548
549
|
label?: string | null | undefined;
|
|
549
550
|
permissions?: Record<string, boolean> | undefined;
|
|
@@ -554,7 +555,6 @@ export declare const AuthenticationSchema: z.ZodObject<{
|
|
|
554
555
|
is_shared?: string | undefined;
|
|
555
556
|
marked_stale_at?: string | null | undefined;
|
|
556
557
|
identifier?: string | null | undefined;
|
|
557
|
-
url?: string | undefined;
|
|
558
558
|
groups?: string | undefined;
|
|
559
559
|
members?: string | undefined;
|
|
560
560
|
}>;
|
|
@@ -591,6 +591,7 @@ export declare const AuthenticationsResponseSchema: z.ZodObject<{
|
|
|
591
591
|
is_invite_only: boolean;
|
|
592
592
|
is_private: boolean;
|
|
593
593
|
shared_with_all: boolean;
|
|
594
|
+
url?: string | undefined;
|
|
594
595
|
title?: string | null | undefined;
|
|
595
596
|
label?: string | null | undefined;
|
|
596
597
|
permissions?: Record<string, boolean> | undefined;
|
|
@@ -601,7 +602,6 @@ export declare const AuthenticationsResponseSchema: z.ZodObject<{
|
|
|
601
602
|
is_shared?: string | undefined;
|
|
602
603
|
marked_stale_at?: string | null | undefined;
|
|
603
604
|
identifier?: string | null | undefined;
|
|
604
|
-
url?: string | undefined;
|
|
605
605
|
groups?: string | undefined;
|
|
606
606
|
members?: string | undefined;
|
|
607
607
|
}, {
|
|
@@ -612,6 +612,7 @@ export declare const AuthenticationsResponseSchema: z.ZodObject<{
|
|
|
612
612
|
is_invite_only: boolean;
|
|
613
613
|
is_private: boolean;
|
|
614
614
|
shared_with_all: boolean;
|
|
615
|
+
url?: string | undefined;
|
|
615
616
|
title?: string | null | undefined;
|
|
616
617
|
label?: string | null | undefined;
|
|
617
618
|
permissions?: Record<string, boolean> | undefined;
|
|
@@ -622,7 +623,6 @@ export declare const AuthenticationsResponseSchema: z.ZodObject<{
|
|
|
622
623
|
is_shared?: string | undefined;
|
|
623
624
|
marked_stale_at?: string | null | undefined;
|
|
624
625
|
identifier?: string | null | undefined;
|
|
625
|
-
url?: string | undefined;
|
|
626
626
|
groups?: string | undefined;
|
|
627
627
|
members?: string | undefined;
|
|
628
628
|
}>, "many">;
|
|
@@ -636,6 +636,7 @@ export declare const AuthenticationsResponseSchema: z.ZodObject<{
|
|
|
636
636
|
is_invite_only: boolean;
|
|
637
637
|
is_private: boolean;
|
|
638
638
|
shared_with_all: boolean;
|
|
639
|
+
url?: string | undefined;
|
|
639
640
|
title?: string | null | undefined;
|
|
640
641
|
label?: string | null | undefined;
|
|
641
642
|
permissions?: Record<string, boolean> | undefined;
|
|
@@ -646,7 +647,6 @@ export declare const AuthenticationsResponseSchema: z.ZodObject<{
|
|
|
646
647
|
is_shared?: string | undefined;
|
|
647
648
|
marked_stale_at?: string | null | undefined;
|
|
648
649
|
identifier?: string | null | undefined;
|
|
649
|
-
url?: string | undefined;
|
|
650
650
|
groups?: string | undefined;
|
|
651
651
|
members?: string | undefined;
|
|
652
652
|
}[];
|
|
@@ -662,6 +662,7 @@ export declare const AuthenticationsResponseSchema: z.ZodObject<{
|
|
|
662
662
|
is_invite_only: boolean;
|
|
663
663
|
is_private: boolean;
|
|
664
664
|
shared_with_all: boolean;
|
|
665
|
+
url?: string | undefined;
|
|
665
666
|
title?: string | null | undefined;
|
|
666
667
|
label?: string | null | undefined;
|
|
667
668
|
permissions?: Record<string, boolean> | undefined;
|
|
@@ -672,7 +673,6 @@ export declare const AuthenticationsResponseSchema: z.ZodObject<{
|
|
|
672
673
|
is_shared?: string | undefined;
|
|
673
674
|
marked_stale_at?: string | null | undefined;
|
|
674
675
|
identifier?: string | null | undefined;
|
|
675
|
-
url?: string | undefined;
|
|
676
676
|
groups?: string | undefined;
|
|
677
677
|
members?: string | undefined;
|
|
678
678
|
}[];
|
package/dist/api/types.d.ts
CHANGED
|
@@ -19,11 +19,11 @@ export interface ApiClientOptions {
|
|
|
19
19
|
onEvent?: (event: any) => void;
|
|
20
20
|
}
|
|
21
21
|
export interface ApiClient {
|
|
22
|
-
get: (path: string, options?: RequestOptions) => Promise<
|
|
23
|
-
post: (path: string, data?:
|
|
24
|
-
put: (path: string, data?:
|
|
25
|
-
delete: (path: string, options?: RequestOptions) => Promise<
|
|
26
|
-
poll: (path: string, options?: PollOptions) => Promise<
|
|
22
|
+
get: <T = unknown>(path: string, options?: RequestOptions) => Promise<T>;
|
|
23
|
+
post: <T = unknown>(path: string, data?: unknown, options?: RequestOptions) => Promise<T>;
|
|
24
|
+
put: <T = unknown>(path: string, data?: unknown, options?: RequestOptions) => Promise<T>;
|
|
25
|
+
delete: <T = unknown>(path: string, options?: RequestOptions) => Promise<T>;
|
|
26
|
+
poll: <T = unknown>(path: string, options?: PollOptions) => Promise<T>;
|
|
27
27
|
fetch: (path: string, init?: RequestInit & {
|
|
28
28
|
searchParams?: Record<string, string>;
|
|
29
29
|
authRequired?: boolean;
|
|
@@ -36,7 +36,7 @@ export interface RequestOptions {
|
|
|
36
36
|
customErrorHandler?: (errorInfo: {
|
|
37
37
|
status: number;
|
|
38
38
|
statusText: string;
|
|
39
|
-
data:
|
|
39
|
+
data: unknown;
|
|
40
40
|
}) => Error | undefined;
|
|
41
41
|
}
|
|
42
42
|
export interface PollOptions extends RequestOptions {
|
|
@@ -45,7 +45,7 @@ export interface PollOptions extends RequestOptions {
|
|
|
45
45
|
maxDelay?: number;
|
|
46
46
|
successStatus?: number;
|
|
47
47
|
pendingStatus?: number;
|
|
48
|
-
resultExtractor?: (response:
|
|
48
|
+
resultExtractor?: (response: unknown) => unknown;
|
|
49
49
|
}
|
|
50
50
|
export interface DebugLogger {
|
|
51
51
|
(message: string, data?: any): void;
|
package/dist/api/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/api/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,iBAAiB,EACjB,UAAU,EACV,iBAAiB,EACjB,uBAAuB,EACvB,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,2BAA2B,EAC3B,uBAAuB,EACvB,iBAAiB,EACjB,oBAAoB,EACpB,6BAA6B,EAC7B,iBAAiB,EACjB,SAAS,EACT,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,6BAA6B,EAC7B,wBAAwB,EACxB,iCAAiC,EACjC,aAAa,EACb,sBAAsB,EACvB,MAAM,WAAW,CAAC;AAMnB,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAC7C,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,UAAU,CAAC,KAAK,CAAC;IAChC,OAAO,CAAC,EAAE,CAAC,KAA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