@zapier/zapier-sdk 0.4.0 → 0.5.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 +7 -0
- package/dist/api/auth.d.ts +9 -0
- package/dist/api/auth.d.ts.map +1 -0
- package/dist/api/auth.js +25 -0
- package/dist/api/client.d.ts +9 -0
- package/dist/api/client.d.ts.map +1 -0
- package/dist/api/client.js +322 -0
- package/dist/api/debug.d.ts +13 -0
- package/dist/api/debug.d.ts.map +1 -0
- package/dist/api/debug.js +55 -0
- package/dist/api/index.d.ts +29 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +41 -0
- package/dist/api/polling.d.ts +16 -0
- package/dist/api/polling.d.ts.map +1 -0
- package/dist/api/polling.js +45 -0
- package/dist/api/schemas.d.ts +2473 -0
- package/dist/api/schemas.d.ts.map +1 -0
- package/dist/api/schemas.js +355 -0
- package/dist/api/types.d.ts +75 -0
- package/dist/api/types.d.ts.map +1 -0
- package/dist/api/types.js +11 -0
- package/dist/auth.d.ts +34 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +47 -0
- package/dist/constants.d.ts +10 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +9 -0
- package/dist/index.cjs +2134 -1444
- package/dist/index.d.mts +2456 -584
- package/dist/index.d.ts +17 -840
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +20 -0
- package/dist/index.mjs +2118 -1428
- package/dist/plugins/api/index.d.ts +14 -0
- package/dist/plugins/api/index.d.ts.map +1 -0
- package/dist/plugins/api/index.js +21 -0
- package/dist/plugins/apps/index.d.ts +11 -0
- package/dist/plugins/apps/index.d.ts.map +1 -0
- package/dist/plugins/apps/index.js +91 -0
- package/dist/plugins/apps/types.d.ts +30 -0
- package/dist/plugins/apps/types.d.ts.map +1 -0
- package/dist/plugins/apps/types.js +2 -0
- package/dist/plugins/fetch/index.d.ts +21 -0
- package/dist/plugins/fetch/index.d.ts.map +1 -0
- package/dist/plugins/fetch/index.js +20 -0
- package/dist/plugins/findFirstAuthentication/index.d.ts +20 -0
- package/dist/plugins/findFirstAuthentication/index.d.ts.map +1 -0
- package/dist/plugins/findFirstAuthentication/index.js +24 -0
- package/dist/plugins/findFirstAuthentication/index.test.d.ts +2 -0
- package/dist/plugins/findFirstAuthentication/index.test.d.ts.map +1 -0
- package/dist/plugins/findFirstAuthentication/index.test.js +171 -0
- package/dist/plugins/findFirstAuthentication/schemas.d.ts +29 -0
- package/dist/plugins/findFirstAuthentication/schemas.d.ts.map +1 -0
- package/dist/plugins/findFirstAuthentication/schemas.js +18 -0
- package/dist/plugins/findUniqueAuthentication/index.d.ts +20 -0
- package/dist/plugins/findUniqueAuthentication/index.d.ts.map +1 -0
- package/dist/plugins/findUniqueAuthentication/index.js +31 -0
- package/dist/plugins/findUniqueAuthentication/index.test.d.ts +2 -0
- package/dist/plugins/findUniqueAuthentication/index.test.d.ts.map +1 -0
- package/dist/plugins/findUniqueAuthentication/index.test.js +152 -0
- package/dist/plugins/findUniqueAuthentication/schemas.d.ts +29 -0
- package/dist/plugins/findUniqueAuthentication/schemas.d.ts.map +1 -0
- package/dist/plugins/findUniqueAuthentication/schemas.js +18 -0
- package/dist/plugins/getAction/index.d.ts +23 -0
- package/dist/plugins/getAction/index.d.ts.map +1 -0
- package/dist/plugins/getAction/index.js +28 -0
- package/dist/plugins/getAction/index.test.d.ts +2 -0
- package/dist/plugins/getAction/index.test.d.ts.map +1 -0
- package/dist/plugins/getAction/index.test.js +186 -0
- package/dist/plugins/getAction/schemas.d.ts +23 -0
- package/dist/plugins/getAction/schemas.d.ts.map +1 -0
- package/dist/plugins/getAction/schemas.js +10 -0
- package/dist/plugins/getApp/index.d.ts +22 -0
- package/dist/plugins/getApp/index.d.ts.map +1 -0
- package/dist/plugins/getApp/index.js +39 -0
- package/dist/plugins/getApp/index.test.d.ts +2 -0
- package/dist/plugins/getApp/index.test.d.ts.map +1 -0
- package/dist/plugins/getApp/index.test.js +100 -0
- package/dist/plugins/getApp/schemas.d.ts +18 -0
- package/dist/plugins/getApp/schemas.d.ts.map +1 -0
- package/dist/plugins/getApp/schemas.js +10 -0
- package/dist/plugins/getAuthentication/index.d.ts +22 -0
- package/dist/plugins/getAuthentication/index.d.ts.map +1 -0
- package/dist/plugins/getAuthentication/index.js +41 -0
- package/dist/plugins/getAuthentication/index.test.d.ts +2 -0
- package/dist/plugins/getAuthentication/index.test.d.ts.map +1 -0
- package/dist/plugins/getAuthentication/index.test.js +205 -0
- package/dist/plugins/getAuthentication/schemas.d.ts +17 -0
- package/dist/plugins/getAuthentication/schemas.d.ts.map +1 -0
- package/dist/plugins/getAuthentication/schemas.js +11 -0
- package/dist/plugins/getProfile/index.d.ts +23 -0
- package/dist/plugins/getProfile/index.d.ts.map +1 -0
- package/dist/plugins/getProfile/index.js +29 -0
- package/dist/plugins/getProfile/schemas.d.ts +13 -0
- package/dist/plugins/getProfile/schemas.d.ts.map +1 -0
- package/dist/plugins/getProfile/schemas.js +5 -0
- package/dist/plugins/listActions/index.d.ts +28 -0
- package/dist/plugins/listActions/index.d.ts.map +1 -0
- package/dist/plugins/listActions/index.js +61 -0
- package/dist/plugins/listActions/index.test.d.ts +2 -0
- package/dist/plugins/listActions/index.test.d.ts.map +1 -0
- package/dist/plugins/listActions/index.test.js +467 -0
- package/dist/plugins/listActions/schemas.d.ts +29 -0
- package/dist/plugins/listActions/schemas.d.ts.map +1 -0
- package/dist/plugins/listActions/schemas.js +21 -0
- package/dist/plugins/listApps/index.d.ts +28 -0
- package/dist/plugins/listApps/index.d.ts.map +1 -0
- package/dist/plugins/listApps/index.js +62 -0
- package/dist/plugins/listApps/index.test.d.ts +2 -0
- package/dist/plugins/listApps/index.test.d.ts.map +1 -0
- package/dist/plugins/listApps/index.test.js +313 -0
- package/dist/plugins/listApps/schemas.d.ts +30 -0
- package/dist/plugins/listApps/schemas.d.ts.map +1 -0
- package/dist/plugins/listApps/schemas.js +23 -0
- package/dist/plugins/listAuthentications/index.d.ts +28 -0
- package/dist/plugins/listAuthentications/index.d.ts.map +1 -0
- package/dist/plugins/listAuthentications/index.js +77 -0
- package/dist/plugins/listAuthentications/index.test.d.ts +2 -0
- package/dist/plugins/listAuthentications/index.test.d.ts.map +1 -0
- package/dist/plugins/listAuthentications/index.test.js +564 -0
- package/dist/plugins/listAuthentications/schemas.d.ts +38 -0
- package/dist/plugins/listAuthentications/schemas.d.ts.map +1 -0
- package/dist/plugins/listAuthentications/schemas.js +28 -0
- package/dist/plugins/listInputFields/index.d.ts +28 -0
- package/dist/plugins/listInputFields/index.d.ts.map +1 -0
- package/dist/plugins/listInputFields/index.js +133 -0
- package/dist/plugins/listInputFields/index.test.d.ts +2 -0
- package/dist/plugins/listInputFields/index.test.d.ts.map +1 -0
- package/dist/plugins/listInputFields/index.test.js +325 -0
- package/dist/plugins/listInputFields/schemas.d.ts +38 -0
- package/dist/plugins/listInputFields/schemas.d.ts.map +1 -0
- package/dist/plugins/listInputFields/schemas.js +22 -0
- package/dist/plugins/registry/index.d.ts +11 -0
- package/dist/plugins/registry/index.d.ts.map +1 -0
- package/dist/plugins/registry/index.js +14 -0
- package/dist/plugins/request/index.d.ts +19 -0
- package/dist/plugins/request/index.d.ts.map +1 -0
- package/dist/plugins/request/index.js +62 -0
- package/dist/plugins/request/index.test.d.ts +2 -0
- package/dist/plugins/request/index.test.d.ts.map +1 -0
- package/dist/plugins/request/index.test.js +256 -0
- package/dist/plugins/request/schemas.d.ts +69 -0
- package/dist/plugins/request/schemas.d.ts.map +1 -0
- package/dist/plugins/request/schemas.js +42 -0
- package/dist/plugins/runAction/index.d.ts +28 -0
- package/dist/plugins/runAction/index.d.ts.map +1 -0
- package/dist/plugins/runAction/index.js +86 -0
- package/dist/plugins/runAction/index.test.d.ts +2 -0
- package/dist/plugins/runAction/index.test.d.ts.map +1 -0
- package/dist/plugins/runAction/index.test.js +320 -0
- package/dist/plugins/runAction/schemas.d.ts +37 -0
- package/dist/plugins/runAction/schemas.d.ts.map +1 -0
- package/dist/plugins/runAction/schemas.js +22 -0
- package/dist/resolvers/actionKey.d.ts +9 -0
- package/dist/resolvers/actionKey.d.ts.map +1 -0
- package/dist/resolvers/actionKey.js +19 -0
- package/dist/resolvers/actionType.d.ts +9 -0
- package/dist/resolvers/actionType.d.ts.map +1 -0
- package/dist/resolvers/actionType.js +22 -0
- package/dist/resolvers/appKey.d.ts +7 -0
- package/dist/resolvers/appKey.d.ts.map +1 -0
- package/dist/resolvers/appKey.js +5 -0
- package/dist/resolvers/authenticationId.d.ts +9 -0
- package/dist/resolvers/authenticationId.d.ts.map +1 -0
- package/dist/resolvers/authenticationId.js +33 -0
- package/dist/resolvers/index.d.ts +40 -0
- package/dist/resolvers/index.d.ts.map +1 -0
- package/dist/resolvers/index.js +91 -0
- package/dist/resolvers/inputs.d.ts +8 -0
- package/dist/resolvers/inputs.d.ts.map +1 -0
- package/dist/resolvers/inputs.js +14 -0
- package/dist/schemas/Action.d.ts +243 -0
- package/dist/schemas/Action.d.ts.map +1 -0
- package/dist/schemas/Action.js +34 -0
- package/dist/schemas/App.d.ts +26 -0
- package/dist/schemas/App.d.ts.map +1 -0
- package/dist/schemas/App.js +22 -0
- package/dist/schemas/Auth.d.ts +161 -0
- package/dist/schemas/Auth.d.ts.map +1 -0
- package/dist/schemas/Auth.js +41 -0
- package/dist/schemas/Field.d.ts +144 -0
- package/dist/schemas/Field.d.ts.map +1 -0
- package/dist/schemas/Field.js +105 -0
- package/dist/schemas/UserProfile.d.ts +163 -0
- package/dist/schemas/UserProfile.d.ts.map +1 -0
- package/dist/schemas/UserProfile.js +29 -0
- package/dist/sdk.d.ts +10 -0
- package/dist/sdk.d.ts.map +1 -0
- package/dist/sdk.js +94 -0
- package/dist/sdk.test.d.ts +2 -0
- package/dist/sdk.test.d.ts.map +1 -0
- package/dist/sdk.test.js +135 -0
- package/dist/types/domain.d.ts +36 -0
- package/dist/types/domain.d.ts.map +1 -0
- package/dist/types/domain.js +1 -0
- package/dist/types/domain.test.d.ts +2 -0
- package/dist/types/domain.test.d.ts.map +1 -0
- package/dist/types/domain.test.js +39 -0
- package/dist/types/errors.d.ts +143 -0
- package/dist/types/errors.d.ts.map +1 -0
- package/dist/types/errors.js +187 -0
- package/dist/types/events.d.ts +38 -0
- package/dist/types/events.d.ts.map +1 -0
- package/dist/types/events.js +7 -0
- package/dist/types/functions.d.ts +26 -0
- package/dist/types/functions.d.ts.map +1 -0
- package/dist/types/functions.js +4 -0
- package/dist/types/plugin.d.ts +61 -0
- package/dist/types/plugin.d.ts.map +1 -0
- package/dist/types/plugin.js +9 -0
- package/dist/types/properties.d.ts +22 -0
- package/dist/types/properties.d.ts.map +1 -0
- package/dist/types/properties.js +50 -0
- package/dist/types/sdk.d.ts +43 -0
- package/dist/types/sdk.d.ts.map +1 -0
- package/dist/types/sdk.js +4 -0
- package/dist/utils/array-utils.d.ts +31 -0
- package/dist/utils/array-utils.d.ts.map +1 -0
- package/dist/utils/array-utils.js +36 -0
- package/dist/utils/array-utils.test.d.ts +2 -0
- package/dist/utils/array-utils.test.d.ts.map +1 -0
- package/dist/utils/array-utils.test.js +107 -0
- package/dist/utils/domain-utils.d.ts +78 -0
- package/dist/utils/domain-utils.d.ts.map +1 -0
- package/dist/utils/domain-utils.js +218 -0
- package/dist/utils/domain-utils.test.d.ts +2 -0
- package/dist/utils/domain-utils.test.d.ts.map +1 -0
- package/dist/utils/domain-utils.test.js +192 -0
- package/dist/utils/function-utils.d.ts +45 -0
- package/dist/utils/function-utils.d.ts.map +1 -0
- package/dist/utils/function-utils.js +158 -0
- package/dist/utils/function-utils.test.d.ts +2 -0
- package/dist/utils/function-utils.test.d.ts.map +1 -0
- package/dist/utils/function-utils.test.js +110 -0
- package/dist/utils/pagination-utils.d.ts +37 -0
- package/dist/utils/pagination-utils.d.ts.map +1 -0
- package/dist/utils/pagination-utils.js +165 -0
- package/dist/utils/pagination-utils.test.d.ts +17 -0
- package/dist/utils/pagination-utils.test.d.ts.map +1 -0
- package/dist/utils/pagination-utils.test.js +461 -0
- package/dist/utils/schema-utils.d.ts +45 -0
- package/dist/utils/schema-utils.d.ts.map +1 -0
- package/dist/utils/schema-utils.js +65 -0
- package/dist/utils/validation.d.ts +4 -0
- package/dist/utils/validation.d.ts.map +1 -0
- package/dist/utils/validation.js +30 -0
- package/dist/utils/validation.test.d.ts +2 -0
- package/dist/utils/validation.test.d.ts.map +1 -0
- package/dist/utils/validation.test.js +43 -0
- package/package.json +12 -3
- package/src/api/client.ts +403 -167
- package/src/api/debug.ts +10 -1
- package/src/api/index.ts +0 -2
- package/src/api/polling.ts +31 -14
- package/src/api/schemas.ts +387 -0
- package/src/api/types.ts +73 -138
- package/src/constants.ts +10 -0
- package/src/index.ts +45 -20
- package/src/plugins/api/index.ts +47 -0
- package/src/plugins/apps/index.ts +36 -31
- package/src/plugins/apps/types.ts +24 -12
- package/src/plugins/fetch/index.ts +58 -0
- package/src/plugins/findFirstAuthentication/index.test.ts +206 -0
- package/src/plugins/findFirstAuthentication/index.ts +55 -0
- package/src/plugins/findFirstAuthentication/schemas.ts +41 -0
- package/src/plugins/findUniqueAuthentication/index.test.ts +197 -0
- package/src/plugins/findUniqueAuthentication/index.ts +72 -0
- package/src/plugins/findUniqueAuthentication/schemas.ts +42 -0
- package/src/plugins/getAction/index.test.ts +239 -0
- package/src/plugins/getAction/index.ts +57 -0
- package/src/plugins/getAction/schemas.ts +33 -0
- package/src/plugins/getApp/index.test.ts +127 -0
- package/src/plugins/getApp/index.ts +66 -0
- package/src/plugins/getApp/schemas.ts +38 -0
- package/src/plugins/getAuthentication/index.test.ts +284 -0
- package/src/plugins/getAuthentication/index.ts +86 -0
- package/src/plugins/getAuthentication/schemas.ts +31 -0
- package/src/plugins/getProfile/index.ts +55 -0
- package/src/plugins/getProfile/schemas.ts +26 -0
- package/src/plugins/listActions/index.test.ts +582 -0
- package/src/plugins/listActions/index.ts +115 -0
- package/src/plugins/listActions/schemas.ts +54 -0
- package/src/plugins/listApps/index.test.ts +357 -0
- package/src/plugins/listApps/index.ts +121 -0
- package/src/plugins/listApps/schemas.ts +49 -0
- package/src/plugins/listAuthentications/index.test.ts +709 -0
- package/src/plugins/listAuthentications/index.ts +136 -0
- package/src/plugins/listAuthentications/schemas.ts +60 -0
- package/src/plugins/listInputFields/index.test.ts +408 -0
- package/src/plugins/listInputFields/index.ts +204 -0
- package/src/plugins/listInputFields/schemas.ts +56 -0
- package/src/plugins/registry/index.ts +30 -0
- package/src/plugins/request/index.test.ts +329 -0
- package/src/plugins/request/index.ts +103 -0
- package/src/plugins/request/schemas.ts +64 -0
- package/src/plugins/runAction/index.test.ts +387 -0
- package/src/plugins/runAction/index.ts +176 -0
- package/src/plugins/runAction/schemas.ts +53 -0
- package/src/resolvers/actionKey.ts +6 -4
- package/src/resolvers/actionType.ts +7 -2
- package/src/resolvers/appKey.ts +1 -1
- package/src/resolvers/authenticationId.ts +12 -3
- package/src/resolvers/inputs.ts +3 -1
- package/src/schemas/Action.ts +18 -12
- package/src/schemas/App.ts +11 -19
- package/src/schemas/Auth.ts +18 -13
- package/src/schemas/Field.ts +106 -11
- package/src/schemas/UserProfile.ts +43 -0
- package/src/sdk.test.ts +212 -0
- package/src/sdk.ts +133 -105
- package/src/types/domain.test.ts +50 -0
- package/src/types/domain.ts +43 -75
- package/src/types/errors.ts +275 -0
- package/src/types/functions.ts +27 -0
- package/src/types/optional-zapier-sdk-cli-login.d.ts +37 -0
- package/src/types/plugin.ts +105 -0
- package/src/types/properties.ts +4 -3
- package/src/types/sdk.ts +71 -46
- package/src/utils/array-utils.test.ts +131 -0
- package/src/utils/array-utils.ts +41 -0
- package/src/utils/domain-utils.test.ts +239 -0
- package/src/utils/domain-utils.ts +283 -0
- package/src/utils/function-utils.test.ts +141 -0
- package/src/utils/function-utils.ts +245 -0
- package/src/utils/pagination-utils.test.ts +620 -0
- package/src/utils/pagination-utils.ts +242 -0
- package/src/utils/validation.test.ts +50 -0
- package/src/utils/validation.ts +44 -0
- package/tsconfig.build.json +16 -2
- package/tsconfig.json +3 -1
- package/tsconfig.tsbuildinfo +1 -0
- package/tsup.config.ts +2 -0
- package/src/functions/bundleCode/index.ts +0 -78
- package/src/functions/bundleCode/info.ts +0 -9
- package/src/functions/bundleCode/schemas.ts +0 -30
- package/src/functions/fetch/index.ts +0 -180
- package/src/functions/fetch/info.ts +0 -8
- package/src/functions/fetch/schemas.ts +0 -46
- package/src/functions/findFirstAuthentication/index.ts +0 -24
- package/src/functions/findFirstAuthentication/info.ts +0 -9
- package/src/functions/findFirstAuthentication/schemas.ts +0 -50
- package/src/functions/findUniqueAuthentication/index.ts +0 -35
- package/src/functions/findUniqueAuthentication/info.ts +0 -9
- package/src/functions/findUniqueAuthentication/schemas.ts +0 -50
- package/src/functions/generateTypes/index.ts +0 -363
- package/src/functions/generateTypes/info.ts +0 -9
- package/src/functions/generateTypes/schemas.ts +0 -31
- package/src/functions/getAction/index.ts +0 -33
- package/src/functions/getAction/info.ts +0 -9
- package/src/functions/getAction/schemas.ts +0 -25
- package/src/functions/getApp/index.ts +0 -41
- package/src/functions/getApp/info.ts +0 -9
- package/src/functions/getApp/schemas.ts +0 -20
- package/src/functions/getAuthentication/index.ts +0 -50
- package/src/functions/getAuthentication/info.ts +0 -9
- package/src/functions/getAuthentication/schemas.ts +0 -29
- package/src/functions/listActions/index.ts +0 -149
- package/src/functions/listActions/info.ts +0 -9
- package/src/functions/listActions/schemas.ts +0 -30
- package/src/functions/listApps/index.ts +0 -60
- package/src/functions/listApps/info.ts +0 -9
- package/src/functions/listApps/schemas.ts +0 -32
- package/src/functions/listAuthentications/index.ts +0 -162
- package/src/functions/listAuthentications/info.ts +0 -9
- package/src/functions/listAuthentications/schemas.ts +0 -50
- package/src/functions/listFields/index.ts +0 -86
- package/src/functions/listFields/info.ts +0 -9
- package/src/functions/listFields/schemas.ts +0 -36
- package/src/functions/runAction/index.ts +0 -127
- package/src/functions/runAction/info.ts +0 -9
- package/src/functions/runAction/schemas.ts +0 -34
- package/src/plugins/apps/info.ts +0 -12
- /package/src/{schema-utils.ts → utils/schema-utils.ts} +0 -0
package/src/api/types.ts
CHANGED
|
@@ -4,8 +4,37 @@
|
|
|
4
4
|
* This module contains all type definitions related to the Zapier API client,
|
|
5
5
|
* including configuration options, client interfaces, request/response types,
|
|
6
6
|
* and API response models.
|
|
7
|
+
*
|
|
8
|
+
* API response model types are inferred from Zod schemas defined in api/schemas.ts
|
|
9
|
+
* to ensure a single source of truth and eliminate duplication.
|
|
7
10
|
*/
|
|
8
11
|
|
|
12
|
+
import { z } from "zod";
|
|
13
|
+
import {
|
|
14
|
+
NeedChoicesSchema,
|
|
15
|
+
NeedSchema,
|
|
16
|
+
ActionLinksSchema,
|
|
17
|
+
ActionPermissionsSchema,
|
|
18
|
+
ActionSchema,
|
|
19
|
+
ChoiceSchema,
|
|
20
|
+
FieldSchema,
|
|
21
|
+
ActionExecutionResultSchema,
|
|
22
|
+
ActionFieldChoiceSchema,
|
|
23
|
+
ActionFieldSchema,
|
|
24
|
+
AuthenticationSchema,
|
|
25
|
+
AuthenticationsResponseSchema,
|
|
26
|
+
UserProfileSchema,
|
|
27
|
+
AppSchema,
|
|
28
|
+
NeedsRequestSchema,
|
|
29
|
+
NeedsResponseSchema,
|
|
30
|
+
ImplementationSchema,
|
|
31
|
+
ImplementationsResponseSchema,
|
|
32
|
+
ImplementationMetaSchema,
|
|
33
|
+
ImplementationsMetaResponseSchema,
|
|
34
|
+
ServiceSchema,
|
|
35
|
+
ServicesResponseSchema,
|
|
36
|
+
} from "./schemas";
|
|
37
|
+
|
|
9
38
|
// ============================================================================
|
|
10
39
|
// API Client Infrastructure Types
|
|
11
40
|
// ============================================================================
|
|
@@ -26,11 +55,10 @@ export interface ApiClient {
|
|
|
26
55
|
delete: (path: string, options?: RequestOptions) => Promise<any>;
|
|
27
56
|
poll: (path: string, options?: PollOptions) => Promise<any>;
|
|
28
57
|
fetch: (
|
|
29
|
-
|
|
58
|
+
path: string,
|
|
30
59
|
init?: RequestInit & {
|
|
31
60
|
searchParams?: Record<string, string>;
|
|
32
61
|
authRequired?: boolean;
|
|
33
|
-
customErrorHandler?: (response: Response) => Error | undefined;
|
|
34
62
|
},
|
|
35
63
|
) => Promise<Response>;
|
|
36
64
|
}
|
|
@@ -39,7 +67,11 @@ export interface RequestOptions {
|
|
|
39
67
|
headers?: Record<string, string>;
|
|
40
68
|
searchParams?: Record<string, string>;
|
|
41
69
|
authRequired?: boolean;
|
|
42
|
-
customErrorHandler?: (
|
|
70
|
+
customErrorHandler?: (errorInfo: {
|
|
71
|
+
status: number;
|
|
72
|
+
statusText: string;
|
|
73
|
+
data: any;
|
|
74
|
+
}) => Error | undefined;
|
|
43
75
|
}
|
|
44
76
|
|
|
45
77
|
export interface PollOptions extends RequestOptions {
|
|
@@ -56,140 +88,43 @@ export interface DebugLogger {
|
|
|
56
88
|
}
|
|
57
89
|
|
|
58
90
|
// ============================================================================
|
|
59
|
-
// API Response Models
|
|
91
|
+
// API Response Models (inferred from Zod schemas)
|
|
60
92
|
// ============================================================================
|
|
61
93
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
export interface Field {
|
|
101
|
-
key: string;
|
|
102
|
-
label: string;
|
|
103
|
-
type:
|
|
104
|
-
| "string"
|
|
105
|
-
| "number"
|
|
106
|
-
| "boolean"
|
|
107
|
-
| "datetime"
|
|
108
|
-
| "file"
|
|
109
|
-
| "object"
|
|
110
|
-
| "array";
|
|
111
|
-
required: boolean;
|
|
112
|
-
description?: string;
|
|
113
|
-
choices?: Choice[];
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
export interface Choice {
|
|
117
|
-
value: string | number;
|
|
118
|
-
label: string;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
export interface ActionExecutionResult {
|
|
122
|
-
success: boolean;
|
|
123
|
-
data?: any;
|
|
124
|
-
error?: string;
|
|
125
|
-
metadata?: {
|
|
126
|
-
executionTime?: number;
|
|
127
|
-
requestId?: string;
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
export interface ActionField {
|
|
132
|
-
key: string;
|
|
133
|
-
label?: string;
|
|
134
|
-
required: boolean;
|
|
135
|
-
type?: string;
|
|
136
|
-
helpText?: string;
|
|
137
|
-
helpTextHtml?: string;
|
|
138
|
-
choices?: ActionFieldChoice[];
|
|
139
|
-
default?: string;
|
|
140
|
-
placeholder?: string;
|
|
141
|
-
computed?: boolean;
|
|
142
|
-
customField?: boolean;
|
|
143
|
-
dependsOn?: string[];
|
|
144
|
-
format?: string;
|
|
145
|
-
inputFormat?: string[];
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
export interface ActionFieldChoice {
|
|
149
|
-
value: string | number;
|
|
150
|
-
label: string;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
export interface NeedsRequest {
|
|
154
|
-
selected_api: string;
|
|
155
|
-
action: string;
|
|
156
|
-
type_of: string;
|
|
157
|
-
authentication_id?: number;
|
|
158
|
-
params?: Record<string, any>;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
export interface NeedsResponse {
|
|
162
|
-
success: boolean;
|
|
163
|
-
needs?: ActionField[];
|
|
164
|
-
errors?: string[];
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
export interface Authentication {
|
|
168
|
-
id: number;
|
|
169
|
-
date: string;
|
|
170
|
-
lastchanged?: string;
|
|
171
|
-
account_id: number;
|
|
172
|
-
customuser_id?: number;
|
|
173
|
-
selected_api: string;
|
|
174
|
-
destination_selected_api?: string | null;
|
|
175
|
-
is_invite_only: boolean;
|
|
176
|
-
is_private: boolean;
|
|
177
|
-
shared_with_all: boolean;
|
|
178
|
-
is_stale?: string;
|
|
179
|
-
is_shared?: string;
|
|
180
|
-
marked_stale_at?: string | null;
|
|
181
|
-
label?: string | null;
|
|
182
|
-
identifier?: string | null;
|
|
183
|
-
title?: string | null;
|
|
184
|
-
url?: string;
|
|
185
|
-
groups?: string;
|
|
186
|
-
members?: string;
|
|
187
|
-
permissions?: Record<string, boolean>;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
export interface AuthenticationsResponse {
|
|
191
|
-
count: number;
|
|
192
|
-
next?: string | null;
|
|
193
|
-
previous?: string | null;
|
|
194
|
-
results: Authentication[];
|
|
195
|
-
}
|
|
94
|
+
// Basic building blocks
|
|
95
|
+
export type NeedChoices = z.infer<typeof NeedChoicesSchema>;
|
|
96
|
+
export type Need = z.infer<typeof NeedSchema>;
|
|
97
|
+
export type ActionLinks = z.infer<typeof ActionLinksSchema>;
|
|
98
|
+
export type ActionPermissions = z.infer<typeof ActionPermissionsSchema>;
|
|
99
|
+
export type Action = z.infer<typeof ActionSchema>;
|
|
100
|
+
export type Choice = z.infer<typeof ChoiceSchema>;
|
|
101
|
+
export type Field = z.infer<typeof FieldSchema>;
|
|
102
|
+
export type ActionExecutionResult = z.infer<typeof ActionExecutionResultSchema>;
|
|
103
|
+
export type ActionFieldChoice = z.infer<typeof ActionFieldChoiceSchema>;
|
|
104
|
+
export type ActionField = z.infer<typeof ActionFieldSchema>;
|
|
105
|
+
|
|
106
|
+
// Main API entities
|
|
107
|
+
export type Authentication = z.infer<typeof AuthenticationSchema>;
|
|
108
|
+
export type AuthenticationsResponse = z.infer<
|
|
109
|
+
typeof AuthenticationsResponseSchema
|
|
110
|
+
>;
|
|
111
|
+
export type UserProfile = z.infer<typeof UserProfileSchema>;
|
|
112
|
+
export type App = z.infer<typeof AppSchema>;
|
|
113
|
+
export type Service = z.infer<typeof ServiceSchema>;
|
|
114
|
+
export type ServicesResponse = z.infer<typeof ServicesResponseSchema>;
|
|
115
|
+
|
|
116
|
+
// Request/Response types
|
|
117
|
+
export type NeedsRequest = z.infer<typeof NeedsRequestSchema>;
|
|
118
|
+
export type NeedsResponse = z.infer<typeof NeedsResponseSchema>;
|
|
119
|
+
|
|
120
|
+
// Implementation types
|
|
121
|
+
export type Implementation = z.infer<typeof ImplementationSchema>;
|
|
122
|
+
export type ImplementationsResponse = z.infer<
|
|
123
|
+
typeof ImplementationsResponseSchema
|
|
124
|
+
>;
|
|
125
|
+
|
|
126
|
+
// Implementation Meta types (lightweight)
|
|
127
|
+
export type ImplementationMeta = z.infer<typeof ImplementationMetaSchema>;
|
|
128
|
+
export type ImplementationsMetaResponse = z.infer<
|
|
129
|
+
typeof ImplementationsMetaResponseSchema
|
|
130
|
+
>;
|
package/src/constants.ts
ADDED
package/src/index.ts
CHANGED
|
@@ -1,10 +1,31 @@
|
|
|
1
1
|
// Export everything from types and plugins
|
|
2
2
|
export * from "./types/domain";
|
|
3
|
+
export * from "./types/functions";
|
|
3
4
|
export * from "./types/properties";
|
|
5
|
+
export * from "./types/errors";
|
|
4
6
|
export * from "./plugins/apps";
|
|
7
|
+
export * from "./plugins/fetch";
|
|
8
|
+
|
|
9
|
+
// Export API types directly (no longer re-exported from domain)
|
|
10
|
+
export type {
|
|
11
|
+
Action,
|
|
12
|
+
App,
|
|
13
|
+
Need,
|
|
14
|
+
Field,
|
|
15
|
+
Choice,
|
|
16
|
+
ActionExecutionResult,
|
|
17
|
+
ActionField,
|
|
18
|
+
ActionFieldChoice,
|
|
19
|
+
NeedsRequest,
|
|
20
|
+
NeedsResponse,
|
|
21
|
+
Authentication,
|
|
22
|
+
AuthenticationsResponse,
|
|
23
|
+
UserProfile,
|
|
24
|
+
} from "./api/types";
|
|
5
25
|
|
|
6
26
|
// Export schema utilities for CLI
|
|
7
|
-
export { isPositional } from "./schema-utils";
|
|
27
|
+
export { isPositional } from "./utils/schema-utils";
|
|
28
|
+
export { hasResolver } from "./resolvers";
|
|
8
29
|
|
|
9
30
|
// Export auth utilities for CLI use
|
|
10
31
|
export * from "./auth";
|
|
@@ -14,24 +35,28 @@ export * from "./resolvers";
|
|
|
14
35
|
|
|
15
36
|
// Note: SdkSchemas is now available via SDK.__registry
|
|
16
37
|
|
|
17
|
-
//
|
|
18
|
-
|
|
19
|
-
export {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
export {
|
|
26
|
-
export { runAction } from "./functions/runAction";
|
|
27
|
-
export { listFields } from "./functions/listFields";
|
|
28
|
-
export { generateTypes } from "./functions/generateTypes";
|
|
29
|
-
export { bundleCode } from "./functions/bundleCode";
|
|
30
|
-
export { fetch, relayFetch } from "./functions/fetch";
|
|
31
|
-
export { RelayFetchSchema } from "./functions/fetch/schemas";
|
|
32
|
-
|
|
33
|
-
// Export the main combined SDK
|
|
34
|
-
export { createZapierSdk, ZapierSdkOptions } from "./sdk";
|
|
38
|
+
// All functions now available through the plugin system via createZapierSdk()
|
|
39
|
+
// Export plugin schemas for external use
|
|
40
|
+
export {
|
|
41
|
+
RelayRequestSchema,
|
|
42
|
+
RelayFetchSchema,
|
|
43
|
+
} from "./plugins/request/schemas";
|
|
44
|
+
|
|
45
|
+
// Export the main combined SDK and new flexible SDK creator
|
|
46
|
+
export { createZapierSdk, createSdk, ZapierSdkOptions } from "./sdk";
|
|
35
47
|
|
|
36
48
|
// Export SDK types from types (not sdk.ts to avoid circular imports)
|
|
37
|
-
export type {
|
|
49
|
+
export type { FunctionRegistryEntry } from "./types/sdk";
|
|
50
|
+
|
|
51
|
+
// Export plugin utilities and SDK types
|
|
52
|
+
export type {
|
|
53
|
+
Plugin,
|
|
54
|
+
PluginProvides,
|
|
55
|
+
PluginDependencies,
|
|
56
|
+
PluginOptions,
|
|
57
|
+
GetSdkType,
|
|
58
|
+
Sdk,
|
|
59
|
+
} from "./types/plugin";
|
|
60
|
+
|
|
61
|
+
// Export ZapierSdk from sdk.ts (it's now ReturnType<typeof createZapierSdk>)
|
|
62
|
+
export type { ZapierSdk } from "./types/sdk";
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { createZapierApi } from "../../api";
|
|
2
|
+
import type { ApiClient } from "../../api/types";
|
|
3
|
+
import type { BaseSdkOptions } from "../../types/sdk";
|
|
4
|
+
import type { Plugin } from "../../types/plugin";
|
|
5
|
+
|
|
6
|
+
export interface ApiPluginOptions extends BaseSdkOptions {}
|
|
7
|
+
|
|
8
|
+
// API plugin only provides context, no SDK methods
|
|
9
|
+
export interface ApiPluginProvides {
|
|
10
|
+
context: {
|
|
11
|
+
api: ApiClient;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// API plugin requires no context and provides api in context
|
|
16
|
+
export const apiPlugin: Plugin<
|
|
17
|
+
{}, // no SDK dependencies
|
|
18
|
+
{}, // requires no context
|
|
19
|
+
ApiPluginProvides
|
|
20
|
+
> = (params) => {
|
|
21
|
+
// Extract all options - everything passed to the plugin
|
|
22
|
+
const {
|
|
23
|
+
fetch: customFetch = globalThis.fetch,
|
|
24
|
+
baseUrl = "https://zapier.com",
|
|
25
|
+
token,
|
|
26
|
+
getToken,
|
|
27
|
+
onEvent,
|
|
28
|
+
debug = false,
|
|
29
|
+
} = params as any;
|
|
30
|
+
|
|
31
|
+
// Create the API client - it will handle token resolution internally
|
|
32
|
+
const api = createZapierApi({
|
|
33
|
+
baseUrl,
|
|
34
|
+
token,
|
|
35
|
+
getToken,
|
|
36
|
+
debug,
|
|
37
|
+
fetch: customFetch,
|
|
38
|
+
onEvent,
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
// Return flat structure with context only
|
|
42
|
+
return {
|
|
43
|
+
context: {
|
|
44
|
+
api, // Provide API client in context for other plugins to use
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
};
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ActionExecutionOptions,
|
|
3
|
-
ActionExecutionResult,
|
|
4
|
-
} from "../../types/domain";
|
|
1
|
+
import { ActionExecutionOptions } from "./types";
|
|
5
2
|
import type { ActionProxy } from "./types";
|
|
6
|
-
import
|
|
3
|
+
import { ZapierValidationError } from "../../types/errors";
|
|
4
|
+
import type { Plugin, GetSdkType } from "../../types/plugin";
|
|
5
|
+
import type { FetchPluginProvides } from "../fetch/index";
|
|
6
|
+
import type { RunActionPluginProvides } from "../runAction/index";
|
|
7
7
|
|
|
8
|
-
export interface
|
|
9
|
-
|
|
8
|
+
export interface AppsPluginProvides {
|
|
9
|
+
apps: ActionProxy;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
interface AppsPluginOptions {
|
|
13
|
+
sdk: GetSdkType<FetchPluginProvides & RunActionPluginProvides>;
|
|
10
14
|
}
|
|
11
15
|
|
|
12
16
|
interface AppFactoryOptions {
|
|
@@ -20,9 +24,7 @@ function createActionFunction(
|
|
|
20
24
|
options: AppsPluginOptions,
|
|
21
25
|
pinnedAuthId?: number,
|
|
22
26
|
) {
|
|
23
|
-
return
|
|
24
|
-
actionOptions: ActionExecutionOptions = {},
|
|
25
|
-
): Promise<ActionExecutionResult> => {
|
|
27
|
+
return (actionOptions: ActionExecutionOptions = {}): any => {
|
|
26
28
|
const { sdk } = options;
|
|
27
29
|
const { inputs, authenticationId: providedAuthenticationId } =
|
|
28
30
|
actionOptions;
|
|
@@ -31,7 +33,7 @@ function createActionFunction(
|
|
|
31
33
|
const authenticationId = pinnedAuthId || providedAuthenticationId;
|
|
32
34
|
|
|
33
35
|
if (!authenticationId) {
|
|
34
|
-
throw new
|
|
36
|
+
throw new ZapierValidationError(
|
|
35
37
|
`Authentication ID is required. Either use the factory pattern: sdk.apps.${appKey}({ authenticationId }) or provide authenticationId in the action call.`,
|
|
36
38
|
);
|
|
37
39
|
}
|
|
@@ -55,29 +57,28 @@ function createActionTypeProxy(
|
|
|
55
57
|
) {
|
|
56
58
|
// Special handling for "fetch" action type
|
|
57
59
|
if (actionType === "fetch") {
|
|
58
|
-
return async (
|
|
59
|
-
url: string
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}) => {
|
|
60
|
+
return async (
|
|
61
|
+
url: string | URL,
|
|
62
|
+
init?: RequestInit & {
|
|
63
|
+
authenticationId?: number;
|
|
64
|
+
callbackUrl?: string;
|
|
65
|
+
authenticationTemplate?: string;
|
|
66
|
+
},
|
|
67
|
+
) => {
|
|
67
68
|
const { sdk } = options;
|
|
68
69
|
|
|
69
70
|
// Use pinned auth ID first, then provided auth ID
|
|
70
|
-
const authenticationId = pinnedAuthId ||
|
|
71
|
+
const authenticationId = pinnedAuthId || init?.authenticationId;
|
|
71
72
|
|
|
72
73
|
if (!authenticationId) {
|
|
73
|
-
throw new
|
|
74
|
+
throw new ZapierValidationError(
|
|
74
75
|
`Authentication ID is required for fetch. Either use the factory pattern: sdk.apps.${appKey}({ authenticationId }).fetch(...) or provide authenticationId in the fetch call.`,
|
|
75
76
|
);
|
|
76
77
|
}
|
|
77
78
|
|
|
78
79
|
// Call sdk.fetch with the resolved authenticationId
|
|
79
|
-
return sdk.fetch({
|
|
80
|
-
...
|
|
80
|
+
return sdk.fetch(url, {
|
|
81
|
+
...init,
|
|
81
82
|
authenticationId,
|
|
82
83
|
});
|
|
83
84
|
};
|
|
@@ -161,10 +162,14 @@ function createAppsProxy(options: AppsPluginOptions): ActionProxy {
|
|
|
161
162
|
return appsProxy;
|
|
162
163
|
}
|
|
163
164
|
|
|
164
|
-
//
|
|
165
|
-
export
|
|
166
|
-
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
165
|
+
// Direct plugin function - takes options + sdk + context in one object
|
|
166
|
+
export const appsPlugin: Plugin<
|
|
167
|
+
GetSdkType<FetchPluginProvides & RunActionPluginProvides>, // requires fetch + runAction in SDK
|
|
168
|
+
{}, // no context requirements
|
|
169
|
+
AppsPluginProvides
|
|
170
|
+
> = ({ sdk }) => {
|
|
171
|
+
// Return flat structure - apps goes directly to SDK
|
|
172
|
+
return {
|
|
173
|
+
apps: createAppsProxy({ sdk }),
|
|
174
|
+
};
|
|
175
|
+
};
|
|
@@ -1,18 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
// Apps plugin-specific execution options
|
|
2
|
+
export interface ActionExecutionOptions {
|
|
3
|
+
inputs?: Record<string, any>;
|
|
4
|
+
authenticationId?: number;
|
|
5
|
+
}
|
|
5
6
|
|
|
6
7
|
interface AppFactoryOptions {
|
|
7
8
|
authenticationId: number;
|
|
8
9
|
}
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
// Base action type proxy for regular actions
|
|
12
|
+
interface BaseActionTypeProxy {
|
|
13
|
+
[action: string]: (options?: ActionExecutionOptions) => any;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// Special fetch function type
|
|
17
|
+
interface FetchActionType {
|
|
18
|
+
fetch: (
|
|
19
|
+
url: string | URL,
|
|
20
|
+
init?: RequestInit & {
|
|
21
|
+
authenticationId?: number;
|
|
22
|
+
callbackUrl?: string;
|
|
23
|
+
authenticationTemplate?: string;
|
|
24
|
+
},
|
|
25
|
+
) => Promise<Response>;
|
|
14
26
|
}
|
|
15
27
|
|
|
28
|
+
// Combined action type proxy
|
|
29
|
+
type ActionTypeProxy = BaseActionTypeProxy & Partial<FetchActionType>;
|
|
30
|
+
|
|
16
31
|
interface AppProxy {
|
|
17
32
|
[type: string]: ActionTypeProxy;
|
|
18
33
|
}
|
|
@@ -28,7 +43,4 @@ export interface ActionProxy {
|
|
|
28
43
|
[app: string]: AppProxyWithFactory;
|
|
29
44
|
}
|
|
30
45
|
|
|
31
|
-
//
|
|
32
|
-
export interface AppsPluginSdkExtension {
|
|
33
|
-
apps: ActionProxy;
|
|
34
|
-
}
|
|
46
|
+
// Note: AppsPluginSdkExtension removed - now using AppsPluginProvides in index.ts
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { RelayRequestOptions } from "../request/schemas";
|
|
2
|
+
import type { Plugin, GetSdkType } from "../../types/plugin";
|
|
3
|
+
import type { RequestPluginProvides } from "../request";
|
|
4
|
+
|
|
5
|
+
export interface FetchPluginProvides {
|
|
6
|
+
fetch: (
|
|
7
|
+
url: string | URL,
|
|
8
|
+
init?: RequestInit & {
|
|
9
|
+
authenticationId?: number;
|
|
10
|
+
callbackUrl?: string;
|
|
11
|
+
authenticationTemplate?: string;
|
|
12
|
+
},
|
|
13
|
+
) => Promise<Response>;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Direct plugin function - takes options + sdk + context in one object
|
|
18
|
+
*/
|
|
19
|
+
export const fetchPlugin: Plugin<
|
|
20
|
+
GetSdkType<RequestPluginProvides>, // requires request in SDK
|
|
21
|
+
{}, // requires no context (uses SDK methods)
|
|
22
|
+
FetchPluginProvides
|
|
23
|
+
> = ({ sdk }) => {
|
|
24
|
+
// Return flat structure - fetch goes directly to SDK
|
|
25
|
+
return {
|
|
26
|
+
fetch: async function fetch(
|
|
27
|
+
url: string | URL,
|
|
28
|
+
init?: RequestInit & {
|
|
29
|
+
authenticationId?: number;
|
|
30
|
+
callbackUrl?: string;
|
|
31
|
+
authenticationTemplate?: string;
|
|
32
|
+
},
|
|
33
|
+
): Promise<Response> {
|
|
34
|
+
const {
|
|
35
|
+
authenticationId,
|
|
36
|
+
callbackUrl,
|
|
37
|
+
authenticationTemplate,
|
|
38
|
+
...fetchInit
|
|
39
|
+
} = init || {};
|
|
40
|
+
|
|
41
|
+
return sdk.request({
|
|
42
|
+
url: url.toString(),
|
|
43
|
+
method: fetchInit.method as RelayRequestOptions["method"],
|
|
44
|
+
body: fetchInit.body,
|
|
45
|
+
headers: fetchInit.headers,
|
|
46
|
+
authenticationId,
|
|
47
|
+
callbackUrl,
|
|
48
|
+
authenticationTemplate,
|
|
49
|
+
});
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export type ZapierFetchInitOptions = RequestInit & {
|
|
55
|
+
authenticationId?: number;
|
|
56
|
+
callbackUrl?: string;
|
|
57
|
+
authenticationTemplate?: string;
|
|
58
|
+
};
|