@zapier/zapier-sdk 0.46.0 → 0.46.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/api/client.d.ts.map +1 -1
- package/dist/api/client.js +17 -6
- package/dist/api/types.d.ts +11 -0
- package/dist/api/types.d.ts.map +1 -1
- package/dist/index.cjs +2994 -3633
- package/dist/index.d.mts +6532 -2055
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.mjs +2992 -3634
- package/dist/plugins/api/index.d.ts +22 -10
- package/dist/plugins/api/index.d.ts.map +1 -1
- package/dist/plugins/api/index.js +4 -4
- package/dist/plugins/apps/index.d.ts +108 -7
- package/dist/plugins/apps/index.d.ts.map +1 -1
- package/dist/plugins/apps/index.js +3 -4
- package/dist/plugins/capabilities/index.d.ts +9 -6
- package/dist/plugins/capabilities/index.d.ts.map +1 -1
- package/dist/plugins/capabilities/index.js +3 -2
- package/dist/plugins/connections/index.d.ts +15 -9
- package/dist/plugins/connections/index.d.ts.map +1 -1
- package/dist/plugins/connections/index.js +3 -2
- package/dist/plugins/createClientCredentials/index.d.ts +26 -14
- package/dist/plugins/createClientCredentials/index.d.ts.map +1 -1
- package/dist/plugins/createClientCredentials/index.js +16 -39
- package/dist/plugins/createClientCredentials/schemas.d.ts +0 -2
- package/dist/plugins/createClientCredentials/schemas.d.ts.map +1 -1
- package/dist/plugins/deleteClientCredentials/index.d.ts +20 -14
- package/dist/plugins/deleteClientCredentials/index.d.ts.map +1 -1
- package/dist/plugins/deleteClientCredentials/index.js +18 -37
- package/dist/plugins/deleteClientCredentials/schemas.d.ts +0 -2
- package/dist/plugins/deleteClientCredentials/schemas.d.ts.map +1 -1
- package/dist/plugins/deprecated/authentications.d.ts +597 -41
- package/dist/plugins/deprecated/authentications.d.ts.map +1 -1
- package/dist/plugins/deprecated/authentications.js +9 -8
- package/dist/plugins/eventEmission/index.d.ts +9 -6
- package/dist/plugins/eventEmission/index.d.ts.map +1 -1
- package/dist/plugins/eventEmission/index.js +3 -2
- package/dist/plugins/fetch/index.d.ts +40 -17
- package/dist/plugins/fetch/index.d.ts.map +1 -1
- package/dist/plugins/fetch/index.js +6 -4
- package/dist/plugins/findFirstConnection/index.d.ts +109 -14
- package/dist/plugins/findFirstConnection/index.d.ts.map +1 -1
- package/dist/plugins/findFirstConnection/index.js +14 -26
- package/dist/plugins/findFirstConnection/schemas.d.ts +0 -2
- package/dist/plugins/findFirstConnection/schemas.d.ts.map +1 -1
- package/dist/plugins/findUniqueConnection/index.d.ts +109 -14
- package/dist/plugins/findUniqueConnection/index.d.ts.map +1 -1
- package/dist/plugins/findUniqueConnection/index.js +14 -26
- package/dist/plugins/findUniqueConnection/schemas.d.ts +0 -2
- package/dist/plugins/findUniqueConnection/schemas.d.ts.map +1 -1
- package/dist/plugins/getAction/index.d.ts +68 -15
- package/dist/plugins/getAction/index.d.ts.map +1 -1
- package/dist/plugins/getAction/index.js +21 -31
- package/dist/plugins/getAction/schemas.d.ts +0 -2
- package/dist/plugins/getAction/schemas.d.ts.map +1 -1
- package/dist/plugins/getApp/index.d.ts +140 -14
- package/dist/plugins/getApp/index.d.ts.map +1 -1
- package/dist/plugins/getApp/index.js +16 -38
- package/dist/plugins/getApp/schemas.d.ts +0 -2
- package/dist/plugins/getApp/schemas.d.ts.map +1 -1
- package/dist/plugins/getConnection/index.d.ts +50 -16
- package/dist/plugins/getConnection/index.d.ts.map +1 -1
- package/dist/plugins/getConnection/index.js +22 -29
- package/dist/plugins/getConnection/schemas.d.ts +0 -2
- package/dist/plugins/getConnection/schemas.d.ts.map +1 -1
- package/dist/plugins/getInputFieldsSchema/index.d.ts +59 -13
- package/dist/plugins/getInputFieldsSchema/index.d.ts.map +1 -1
- package/dist/plugins/getInputFieldsSchema/index.js +21 -32
- package/dist/plugins/getInputFieldsSchema/schemas.d.ts +0 -2
- package/dist/plugins/getInputFieldsSchema/schemas.d.ts.map +1 -1
- package/dist/plugins/getProfile/index.d.ts +25 -18
- package/dist/plugins/getProfile/index.d.ts.map +1 -1
- package/dist/plugins/getProfile/index.js +13 -26
- package/dist/plugins/getProfile/schemas.d.ts +0 -8
- package/dist/plugins/getProfile/schemas.d.ts.map +1 -1
- package/dist/plugins/getProfile/schemas.js +0 -1
- package/dist/plugins/listActions/index.d.ts +73 -23
- package/dist/plugins/listActions/index.d.ts.map +1 -1
- package/dist/plugins/listActions/index.js +25 -53
- package/dist/plugins/listActions/schemas.d.ts +0 -11
- package/dist/plugins/listActions/schemas.d.ts.map +1 -1
- package/dist/plugins/listApps/index.d.ts +121 -13
- package/dist/plugins/listApps/index.d.ts.map +1 -1
- package/dist/plugins/listApps/index.js +22 -31
- package/dist/plugins/listApps/schemas.d.ts +0 -2
- package/dist/plugins/listApps/schemas.d.ts.map +1 -1
- package/dist/plugins/listClientCredentials/index.d.ts +29 -16
- package/dist/plugins/listClientCredentials/index.d.ts.map +1 -1
- package/dist/plugins/listClientCredentials/index.js +17 -37
- package/dist/plugins/listClientCredentials/schemas.d.ts +0 -2
- package/dist/plugins/listClientCredentials/schemas.d.ts.map +1 -1
- package/dist/plugins/listConnections/index.d.ts +95 -17
- package/dist/plugins/listConnections/index.d.ts.map +1 -1
- package/dist/plugins/listConnections/index.js +25 -49
- package/dist/plugins/listConnections/schemas.d.ts +0 -2
- package/dist/plugins/listConnections/schemas.d.ts.map +1 -1
- package/dist/plugins/listInputFieldChoices/index.d.ts +77 -22
- package/dist/plugins/listInputFieldChoices/index.d.ts.map +1 -1
- package/dist/plugins/listInputFieldChoices/index.js +27 -50
- package/dist/plugins/listInputFieldChoices/schemas.d.ts +0 -2
- package/dist/plugins/listInputFieldChoices/schemas.d.ts.map +1 -1
- package/dist/plugins/listInputFields/index.d.ts +154 -22
- package/dist/plugins/listInputFields/index.d.ts.map +1 -1
- package/dist/plugins/listInputFields/index.js +28 -41
- package/dist/plugins/listInputFields/schemas.d.ts +0 -2
- package/dist/plugins/listInputFields/schemas.d.ts.map +1 -1
- package/dist/plugins/manifest/index.d.ts +40 -36
- package/dist/plugins/manifest/index.d.ts.map +1 -1
- package/dist/plugins/manifest/index.js +3 -2
- package/dist/plugins/registry/index.d.ts +11 -9
- package/dist/plugins/registry/index.d.ts.map +1 -1
- package/dist/plugins/registry/index.js +3 -2
- package/dist/plugins/request/index.d.ts +61 -15
- package/dist/plugins/request/index.d.ts.map +1 -1
- package/dist/plugins/request/index.js +14 -22
- package/dist/plugins/request/schemas.d.ts +0 -2
- package/dist/plugins/request/schemas.d.ts.map +1 -1
- package/dist/plugins/runAction/index.d.ts +137 -23
- package/dist/plugins/runAction/index.d.ts.map +1 -1
- package/dist/plugins/runAction/index.js +65 -78
- package/dist/plugins/runAction/schemas.d.ts +0 -10
- package/dist/plugins/runAction/schemas.d.ts.map +1 -1
- package/dist/plugins/tables/createTable/index.d.ts +43 -11
- package/dist/plugins/tables/createTable/index.d.ts.map +1 -1
- package/dist/plugins/tables/createTable/index.js +16 -44
- package/dist/plugins/tables/createTable/schemas.d.ts +0 -2
- package/dist/plugins/tables/createTable/schemas.d.ts.map +1 -1
- package/dist/plugins/tables/createTableFields/index.d.ts +54 -11
- package/dist/plugins/tables/createTableFields/index.d.ts.map +1 -1
- package/dist/plugins/tables/createTableFields/index.js +17 -41
- package/dist/plugins/tables/createTableFields/schemas.d.ts +0 -2
- package/dist/plugins/tables/createTableFields/schemas.d.ts.map +1 -1
- package/dist/plugins/tables/createTableRecords/index.d.ts +47 -11
- package/dist/plugins/tables/createTableRecords/index.d.ts.map +1 -1
- package/dist/plugins/tables/createTableRecords/index.js +17 -43
- package/dist/plugins/tables/createTableRecords/schemas.d.ts +0 -2
- package/dist/plugins/tables/createTableRecords/schemas.d.ts.map +1 -1
- package/dist/plugins/tables/deleteTable/index.d.ts +36 -13
- package/dist/plugins/tables/deleteTable/index.d.ts.map +1 -1
- package/dist/plugins/tables/deleteTable/index.js +18 -40
- package/dist/plugins/tables/deleteTable/schemas.d.ts +0 -2
- package/dist/plugins/tables/deleteTable/schemas.d.ts.map +1 -1
- package/dist/plugins/tables/deleteTableFields/index.d.ts +36 -11
- package/dist/plugins/tables/deleteTableFields/index.d.ts.map +1 -1
- package/dist/plugins/tables/deleteTableFields/index.js +17 -39
- package/dist/plugins/tables/deleteTableFields/schemas.d.ts +0 -2
- package/dist/plugins/tables/deleteTableFields/schemas.d.ts.map +1 -1
- package/dist/plugins/tables/deleteTableRecords/index.d.ts +36 -11
- package/dist/plugins/tables/deleteTableRecords/index.d.ts.map +1 -1
- package/dist/plugins/tables/deleteTableRecords/index.js +18 -41
- package/dist/plugins/tables/deleteTableRecords/schemas.d.ts +0 -2
- package/dist/plugins/tables/deleteTableRecords/schemas.d.ts.map +1 -1
- package/dist/plugins/tables/getTable/index.d.ts +43 -12
- package/dist/plugins/tables/getTable/index.d.ts.map +1 -1
- package/dist/plugins/tables/getTable/index.js +18 -43
- package/dist/plugins/tables/getTable/schemas.d.ts +0 -2
- package/dist/plugins/tables/getTable/schemas.d.ts.map +1 -1
- package/dist/plugins/tables/getTableRecord/index.d.ts +43 -11
- package/dist/plugins/tables/getTableRecord/index.d.ts.map +1 -1
- package/dist/plugins/tables/getTableRecord/index.js +18 -42
- package/dist/plugins/tables/getTableRecord/schemas.d.ts +0 -2
- package/dist/plugins/tables/getTableRecord/schemas.d.ts.map +1 -1
- package/dist/plugins/tables/listTableFields/index.d.ts +46 -11
- package/dist/plugins/tables/listTableFields/index.d.ts.map +1 -1
- package/dist/plugins/tables/listTableFields/index.js +17 -41
- package/dist/plugins/tables/listTableFields/schemas.d.ts +0 -2
- package/dist/plugins/tables/listTableFields/schemas.d.ts.map +1 -1
- package/dist/plugins/tables/listTableRecords/index.d.ts +66 -18
- package/dist/plugins/tables/listTableRecords/index.d.ts.map +1 -1
- package/dist/plugins/tables/listTableRecords/index.js +27 -50
- package/dist/plugins/tables/listTableRecords/schemas.d.ts +0 -2
- package/dist/plugins/tables/listTableRecords/schemas.d.ts.map +1 -1
- package/dist/plugins/tables/listTables/index.d.ts +53 -20
- package/dist/plugins/tables/listTables/index.d.ts.map +1 -1
- package/dist/plugins/tables/listTables/index.js +24 -51
- package/dist/plugins/tables/listTables/schemas.d.ts +0 -2
- package/dist/plugins/tables/listTables/schemas.d.ts.map +1 -1
- package/dist/plugins/tables/shared.d.ts +10 -0
- package/dist/plugins/tables/shared.d.ts.map +1 -0
- package/dist/plugins/tables/shared.js +9 -0
- package/dist/plugins/tables/updateTableRecords/index.d.ts +49 -11
- package/dist/plugins/tables/updateTableRecords/index.d.ts.map +1 -1
- package/dist/plugins/tables/updateTableRecords/index.js +20 -43
- package/dist/plugins/tables/updateTableRecords/schemas.d.ts +0 -2
- package/dist/plugins/tables/updateTableRecords/schemas.d.ts.map +1 -1
- package/dist/plugins/tables/utils.d.ts.map +1 -1
- package/dist/plugins/tables/utils.js +1 -0
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +21 -1
- package/dist/resolvers/actionKey.d.ts +1 -2
- package/dist/resolvers/actionKey.d.ts.map +1 -1
- package/dist/resolvers/actionType.d.ts +1 -2
- package/dist/resolvers/actionType.d.ts.map +1 -1
- package/dist/sdk.d.ts +2942 -2
- package/dist/sdk.d.ts.map +1 -1
- package/dist/types/errors.d.ts +13 -10
- package/dist/types/errors.d.ts.map +1 -1
- package/dist/types/errors.js +15 -12
- package/dist/types/functions.d.ts +18 -2
- package/dist/types/functions.d.ts.map +1 -1
- package/dist/types/plugin.d.ts +1 -1
- package/dist/types/plugin.d.ts.map +1 -1
- package/dist/types/registry.d.ts +1 -1
- package/dist/types/registry.d.ts.map +1 -1
- package/dist/utils/function-utils.d.ts +11 -12
- package/dist/utils/function-utils.d.ts.map +1 -1
- package/dist/utils/plugin-utils.d.ts +168 -0
- package/dist/utils/plugin-utils.d.ts.map +1 -0
- package/dist/utils/plugin-utils.js +132 -0
- package/package.json +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { definePlugin } from "../../utils/plugin-utils";
|
|
2
|
+
import { createPaginatedPluginMethod } from "../../utils/plugin-utils";
|
|
3
|
+
import { ListInputFieldsInputSchema } from "./schemas";
|
|
2
4
|
import { ZapierConfigurationError } from "../../types/errors";
|
|
3
|
-
import { createPaginatedFunction } from "../../utils/function-utils";
|
|
4
5
|
import { DEFAULT_PAGE_SIZE } from "../../constants";
|
|
5
6
|
import { appKeyResolver, actionTypeResolver, actionKeyResolver, connectionIdResolver, inputsAllOptionalResolver, } from "../../resolvers";
|
|
6
7
|
import { RootFieldItemSchema } from "../../schemas/Field";
|
|
7
|
-
import { toTitleCase
|
|
8
|
+
import { toTitleCase } from "../../utils/string-utils";
|
|
8
9
|
import { fetchImplementationNeeds } from "../../services/implementations";
|
|
9
|
-
import { createTelemetryCallback } from "../../utils/telemetry-utils";
|
|
10
10
|
import { resolveConnectionId } from "../../utils/domain-utils";
|
|
11
11
|
import { setMethodMetadata } from "../../utils/telemetry-context";
|
|
12
12
|
// Enums for input field transformation
|
|
@@ -147,20 +147,34 @@ function transformNeedsToFields(needs) {
|
|
|
147
147
|
}
|
|
148
148
|
return rootFields;
|
|
149
149
|
}
|
|
150
|
-
export const listInputFieldsPlugin = (sdk) => {
|
|
151
|
-
|
|
152
|
-
|
|
150
|
+
export const listInputFieldsPlugin = definePlugin((sdk) => createPaginatedPluginMethod(sdk, {
|
|
151
|
+
name: "listInputFields",
|
|
152
|
+
categories: ["action"],
|
|
153
|
+
type: "list",
|
|
154
|
+
itemType: "RootFieldItem",
|
|
155
|
+
inputSchema: ListInputFieldsInputSchema,
|
|
156
|
+
outputSchema: RootFieldItemSchema,
|
|
157
|
+
defaultPageSize: DEFAULT_PAGE_SIZE,
|
|
158
|
+
resolvers: {
|
|
159
|
+
app: appKeyResolver,
|
|
160
|
+
actionType: actionTypeResolver,
|
|
161
|
+
action: actionKeyResolver,
|
|
162
|
+
connection: connectionIdResolver,
|
|
163
|
+
inputs: inputsAllOptionalResolver,
|
|
164
|
+
},
|
|
165
|
+
handler: async ({ sdk, options, }) => {
|
|
166
|
+
// pageSize/cursor ignored — this endpoint is single-page; pagination
|
|
167
|
+
// helpers around it just yield the one page.
|
|
153
168
|
const { api, getVersionedImplementationId } = sdk.context;
|
|
154
169
|
const appKey = "app" in options ? options.app : options.appKey;
|
|
155
170
|
const actionKey = "action" in options ? options.action : options.actionKey;
|
|
156
|
-
const { actionType, connection, connectionId, authenticationId, inputs } = options;
|
|
171
|
+
const { actionType, connection, connectionId, authenticationId, inputs, } = options;
|
|
157
172
|
const resolvedConnectionId = await resolveConnectionId({
|
|
158
173
|
connection,
|
|
159
174
|
connectionId,
|
|
160
175
|
authenticationId,
|
|
161
176
|
resolveConnection: sdk.context.resolveConnection,
|
|
162
177
|
});
|
|
163
|
-
// Use the manifest plugin
|
|
164
178
|
const selectedApi = await getVersionedImplementationId(appKey);
|
|
165
179
|
if (!selectedApi) {
|
|
166
180
|
throw new ZapierConfigurationError("No current_implementation_id found for app", { configType: "current_implementation_id" });
|
|
@@ -170,14 +184,13 @@ export const listInputFieldsPlugin = (sdk) => {
|
|
|
170
184
|
operationType: actionType,
|
|
171
185
|
operationKey: actionKey,
|
|
172
186
|
});
|
|
173
|
-
//
|
|
174
|
-
//
|
|
187
|
+
// getAction resolves both action.key AND action.id (e.g.
|
|
188
|
+
// `create_report` vs `core:39487493`).
|
|
175
189
|
const { data: action } = await sdk.getAction({
|
|
176
190
|
app: appKey,
|
|
177
191
|
actionType,
|
|
178
192
|
action: actionKey,
|
|
179
193
|
});
|
|
180
|
-
// Use service layer to fetch implementation needs
|
|
181
194
|
const needsData = await fetchImplementationNeeds({
|
|
182
195
|
api,
|
|
183
196
|
selectedApi,
|
|
@@ -186,34 +199,8 @@ export const listInputFieldsPlugin = (sdk) => {
|
|
|
186
199
|
connectionId: resolvedConnectionId ?? null,
|
|
187
200
|
inputs,
|
|
188
201
|
});
|
|
189
|
-
// Transform Need objects to Root Fieldset with proper nesting
|
|
190
|
-
const rootFieldset = transformNeedsToFields(needsData.needs || []);
|
|
191
202
|
return {
|
|
192
|
-
data:
|
|
193
|
-
nextCursor: undefined, // No pagination needed since we return all input fields
|
|
203
|
+
data: transformNeedsToFields(needsData.needs || []),
|
|
194
204
|
};
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
const listInputFieldsDefinition = createPaginatedFunction(listInputFieldsPage, ListInputFieldsInputSchema, createTelemetryCallback(sdk.context.eventEmission.emitMethodCalled, methodName), methodName, DEFAULT_PAGE_SIZE);
|
|
198
|
-
return {
|
|
199
|
-
listInputFields: listInputFieldsDefinition,
|
|
200
|
-
context: {
|
|
201
|
-
meta: {
|
|
202
|
-
listInputFields: {
|
|
203
|
-
categories: ["action"],
|
|
204
|
-
type: "list",
|
|
205
|
-
itemType: "RootFieldItem",
|
|
206
|
-
inputSchema: ListInputFieldsSchema,
|
|
207
|
-
outputSchema: RootFieldItemSchema,
|
|
208
|
-
resolvers: {
|
|
209
|
-
app: appKeyResolver,
|
|
210
|
-
actionType: actionTypeResolver,
|
|
211
|
-
action: actionKeyResolver,
|
|
212
|
-
connection: connectionIdResolver,
|
|
213
|
-
inputs: inputsAllOptionalResolver,
|
|
214
|
-
},
|
|
215
|
-
},
|
|
216
|
-
},
|
|
217
|
-
},
|
|
218
|
-
};
|
|
219
|
-
};
|
|
205
|
+
},
|
|
206
|
+
}));
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import type { RootFieldItem } from "../../types/domain";
|
|
3
3
|
import type { PaginatedSdkFunction } from "../../types/functions";
|
|
4
|
-
import type { ZapierConfigurationError, ZapierApiError, ZapierAuthenticationError, ZapierAppNotFoundError, ZapierValidationError, ZapierUnknownError } from "../../types/errors";
|
|
5
4
|
export declare const ListInputFieldsSchema: z.ZodObject<{
|
|
6
5
|
app: z.ZodString & {
|
|
7
6
|
_def: z.core.$ZodStringDef & import("../..").PositionalMetadata;
|
|
@@ -103,7 +102,6 @@ export type ListInputFieldsOptions = z.infer<typeof ListInputFieldsSchema> | (Om
|
|
|
103
102
|
/** @deprecated Use `action` instead. */
|
|
104
103
|
actionKey: z.infer<typeof ListInputFieldsSchemaDeprecated>["actionKey"];
|
|
105
104
|
});
|
|
106
|
-
export type ListInputFieldsError = ZapierConfigurationError | ZapierApiError | ZapierAuthenticationError | ZapierAppNotFoundError | ZapierValidationError | ZapierUnknownError;
|
|
107
105
|
export interface ListInputFieldsPage {
|
|
108
106
|
data: RootFieldItem[];
|
|
109
107
|
nextCursor?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/listInputFields/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/listInputFields/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAqClE,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;iBAe9B,CAAC;AAGL,QAAA,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;iBAMF,CAAC;AAGpC,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAEA,CAAC;AAGxC,MAAM,MAAM,sBAAsB,GAC9B,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,GACrC,CAAC,IAAI,CACH,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,EAC/C,QAAQ,GAAG,WAAW,CACvB,GAAG;IACF,qCAAqC;IACrC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC,QAAQ,CAAC,CAAC;IAClE,wCAAwC;IACxC,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC,WAAW,CAAC,CAAC;CACzE,CAAC,CAAC;AAGP,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,aAAa,EAAE,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAGD,MAAM,WAAW,0BAA0B;IACzC,eAAe,EAAE,oBAAoB,CACnC,sBAAsB,EACtB,aAAa,EAAE,CAChB,CAAC;CACH"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { ConnectionsMap } from "../../types/connections";
|
|
3
|
-
import type { Plugin } from "../../types/plugin";
|
|
1
|
+
import type { Manifest, ManifestEntry, ManifestPluginOptionsSchema, ActionEntry } from "./schemas";
|
|
4
2
|
import type { z } from "zod";
|
|
5
3
|
import type { ApiClient } from "../../api";
|
|
4
|
+
import { type ResolvedAppLocator } from "../../utils/domain-utils";
|
|
6
5
|
export type ManifestPluginOptions = z.infer<typeof ManifestPluginOptionsSchema>;
|
|
7
6
|
export interface UpdateManifestEntryOptions {
|
|
8
7
|
appKey: string;
|
|
@@ -28,37 +27,6 @@ export interface AddActionEntryResult {
|
|
|
28
27
|
entry: ActionEntry;
|
|
29
28
|
manifest: Manifest;
|
|
30
29
|
}
|
|
31
|
-
export interface ManifestPluginProvides {
|
|
32
|
-
context: {
|
|
33
|
-
getResolvedManifest: () => Promise<Manifest | null>;
|
|
34
|
-
getVersionedImplementationId: GetVersionedImplementationId;
|
|
35
|
-
resolveAppKeys: ResolveAppKeys;
|
|
36
|
-
getManifestConnections: () => Promise<ConnectionsMap | null>;
|
|
37
|
-
updateManifestEntry: (options: UpdateManifestEntryOptions) => Promise<UpdateManifestEntryResult>;
|
|
38
|
-
addActionEntry: (options: AddActionEntryOptions) => Promise<AddActionEntryResult>;
|
|
39
|
-
findActionEntry: (options: {
|
|
40
|
-
name: string;
|
|
41
|
-
manifest: Manifest;
|
|
42
|
-
}) => ActionEntry | null;
|
|
43
|
-
listActionEntries: (options?: {
|
|
44
|
-
configPath?: string;
|
|
45
|
-
}) => Promise<Array<[string, ActionEntry]>>;
|
|
46
|
-
deleteActionEntry: (options: {
|
|
47
|
-
name: string;
|
|
48
|
-
configPath?: string;
|
|
49
|
-
skipWrite?: boolean;
|
|
50
|
-
}) => Promise<Manifest>;
|
|
51
|
-
hasActionEntry: (options: {
|
|
52
|
-
name: string;
|
|
53
|
-
manifest: Manifest;
|
|
54
|
-
}) => boolean;
|
|
55
|
-
findManifestEntry: (options: {
|
|
56
|
-
appKey: string;
|
|
57
|
-
manifest: Manifest;
|
|
58
|
-
}) => [string, ManifestEntry] | null;
|
|
59
|
-
readManifestFromFile: (filePath: string) => Promise<Manifest | null>;
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
30
|
/**
|
|
63
31
|
* Read manifest from a file path asynchronously
|
|
64
32
|
* Supports local files (Node.js) and browser environments (fallback to global filesystem)
|
|
@@ -81,7 +49,7 @@ export declare function findManifestEntry({ appKey, manifest, }: {
|
|
|
81
49
|
}): [string, ManifestEntry] | null;
|
|
82
50
|
export { DEFAULT_CONFIG_PATH } from "./schemas";
|
|
83
51
|
export type { ManifestEntry, Manifest, ActionEntry } from "./schemas";
|
|
84
|
-
export declare const manifestPlugin:
|
|
52
|
+
export declare const manifestPlugin: (sdk: {
|
|
85
53
|
context: {
|
|
86
54
|
api: ApiClient;
|
|
87
55
|
options?: {
|
|
@@ -89,5 +57,41 @@ export declare const manifestPlugin: Plugin<{
|
|
|
89
57
|
manifest?: Manifest;
|
|
90
58
|
};
|
|
91
59
|
};
|
|
92
|
-
}
|
|
60
|
+
} & {
|
|
61
|
+
context: {
|
|
62
|
+
meta: Record<string, import("../..").PluginMeta>;
|
|
63
|
+
};
|
|
64
|
+
}) => {
|
|
65
|
+
context: {
|
|
66
|
+
getResolvedManifest: () => Promise<Manifest | null>;
|
|
67
|
+
getVersionedImplementationId: (appKey: string) => Promise<string | null>;
|
|
68
|
+
resolveAppKeys: ({ appKeys }: {
|
|
69
|
+
appKeys: string[];
|
|
70
|
+
}) => Promise<ResolvedAppLocator[]>;
|
|
71
|
+
updateManifestEntry: (options: UpdateManifestEntryOptions) => Promise<UpdateManifestEntryResult>;
|
|
72
|
+
addActionEntry: (options: AddActionEntryOptions) => Promise<AddActionEntryResult>;
|
|
73
|
+
findActionEntry: ({ name, manifest, }: {
|
|
74
|
+
name: string;
|
|
75
|
+
manifest: Manifest;
|
|
76
|
+
}) => ActionEntry | null;
|
|
77
|
+
listActionEntries: ({ configPath, }?: {
|
|
78
|
+
configPath?: string;
|
|
79
|
+
}) => Promise<Array<[string, ActionEntry]>>;
|
|
80
|
+
deleteActionEntry: ({ name, configPath, skipWrite, }: {
|
|
81
|
+
name: string;
|
|
82
|
+
configPath?: string;
|
|
83
|
+
skipWrite?: boolean;
|
|
84
|
+
}) => Promise<Manifest>;
|
|
85
|
+
hasActionEntry: ({ name, manifest, }: {
|
|
86
|
+
name: string;
|
|
87
|
+
manifest: Manifest;
|
|
88
|
+
}) => boolean;
|
|
89
|
+
findManifestEntry: typeof findManifestEntry;
|
|
90
|
+
readManifestFromFile: typeof readManifestFromFile;
|
|
91
|
+
getManifestConnections: () => Promise<Record<string, {
|
|
92
|
+
connectionId: string | number;
|
|
93
|
+
}> | null>;
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
export type ManifestPluginProvides = ReturnType<typeof manifestPlugin>;
|
|
93
97
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/manifest/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/manifest/index.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { readFile, writeFile, resolve } from "../../utils/file-utils";
|
|
2
2
|
import { ManifestSchema, DEFAULT_CONFIG_PATH } from "./schemas";
|
|
3
|
+
import { definePlugin } from "../../utils/plugin-utils";
|
|
3
4
|
import { normalizeImplementationMetaToAppItem, splitVersionedKey, isSnakeCasedSlug, dashifySnakeCasedSlug, toAppLocator, isResolvedAppLocator, } from "../../utils/domain-utils";
|
|
4
5
|
import { extractCursor } from "../../utils/function-utils";
|
|
5
6
|
import { paginate } from "../../utils/pagination-utils";
|
|
@@ -216,7 +217,7 @@ async function resolveAppKeys({ appKeys, api, manifest, }) {
|
|
|
216
217
|
return slugResolvedLocators.filter(isResolvedAppLocator);
|
|
217
218
|
}
|
|
218
219
|
export { DEFAULT_CONFIG_PATH } from "./schemas";
|
|
219
|
-
export const manifestPlugin = (sdk) => {
|
|
220
|
+
export const manifestPlugin = definePlugin((sdk) => {
|
|
220
221
|
const { api, options } = sdk.context;
|
|
221
222
|
const { manifestPath = DEFAULT_CONFIG_PATH, manifest } = options || {};
|
|
222
223
|
let resolvedManifest;
|
|
@@ -389,4 +390,4 @@ export const manifestPlugin = (sdk) => {
|
|
|
389
390
|
},
|
|
390
391
|
},
|
|
391
392
|
};
|
|
392
|
-
};
|
|
393
|
+
});
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import type { Plugin } from "../../types/plugin";
|
|
2
|
-
/**
|
|
3
|
-
* @deprecated Empty since the plugin no longer provides anything; the
|
|
4
|
-
* `getRegistry` method is now built into every sdk via `WithAddPlugin`.
|
|
5
|
-
* Kept as an export for any code that still references the type.
|
|
6
|
-
*/
|
|
7
|
-
export interface RegistryPluginProvides {
|
|
8
|
-
}
|
|
9
1
|
/**
|
|
10
2
|
* @deprecated `getRegistry` is now built into every sdk produced by
|
|
11
3
|
* `buildSdk`. Adding this plugin is a no-op. Remove the
|
|
12
4
|
* `.addPlugin(registryPlugin)` call.
|
|
13
5
|
*/
|
|
14
|
-
export declare const registryPlugin:
|
|
6
|
+
export declare const registryPlugin: (sdk: {
|
|
7
|
+
context: {
|
|
8
|
+
meta: Record<string, import("../..").PluginMeta>;
|
|
9
|
+
};
|
|
10
|
+
}) => {};
|
|
11
|
+
/**
|
|
12
|
+
* @deprecated Empty since the plugin no longer provides anything; the
|
|
13
|
+
* `getRegistry` method is now built into every sdk via `WithAddPlugin`.
|
|
14
|
+
* Kept as an export for any code that still references the type.
|
|
15
|
+
*/
|
|
16
|
+
export type RegistryPluginProvides = ReturnType<typeof registryPlugin>;
|
|
15
17
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/registry/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/registry/index.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,eAAO,MAAM,cAAc;;;;QAKzB,CAAC;AAEH;;;;GAIG;AACH,MAAM,MAAM,sBAAsB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { definePlugin } from "../../utils/plugin-utils";
|
|
1
2
|
import { logDeprecation } from "../../utils/logging";
|
|
2
3
|
/**
|
|
3
4
|
* @deprecated `getRegistry` is now built into every sdk produced by
|
|
4
5
|
* `buildSdk`. Adding this plugin is a no-op. Remove the
|
|
5
6
|
* `.addPlugin(registryPlugin)` call.
|
|
6
7
|
*/
|
|
7
|
-
export const registryPlugin = () => {
|
|
8
|
+
export const registryPlugin = definePlugin((_sdk) => {
|
|
8
9
|
logDeprecation("registryPlugin is deprecated and a no-op; getRegistry is now built into every sdk. Remove .addPlugin(registryPlugin).");
|
|
9
10
|
return {};
|
|
10
|
-
};
|
|
11
|
+
});
|
|
@@ -1,21 +1,67 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated Use `sdk.fetch(url, init?)` instead. This plugin now delegates
|
|
3
|
+
* to the fetch plugin and is kept only for backward compatibility. It is
|
|
4
|
+
* hidden from the CLI/MCP registries.
|
|
5
|
+
*/
|
|
6
|
+
export declare const requestPlugin: (sdk: {
|
|
7
|
+
fetch: (url: string | URL, init?: import("../fetch").ZapierFetchInitOptions) => Promise<Response>;
|
|
7
8
|
context: {
|
|
8
9
|
meta: {
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
fetch: {
|
|
11
|
+
description: string;
|
|
12
|
+
packages: string[];
|
|
13
|
+
categories: string[];
|
|
14
|
+
returnType: string;
|
|
15
|
+
inputParameters: ({
|
|
16
|
+
name: string;
|
|
17
|
+
schema: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodCustom<URL, URL>]>;
|
|
18
|
+
} | {
|
|
19
|
+
name: string;
|
|
20
|
+
schema: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
21
|
+
method: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
22
|
+
POST: "POST";
|
|
23
|
+
GET: "GET";
|
|
24
|
+
DELETE: "DELETE";
|
|
25
|
+
PUT: "PUT";
|
|
26
|
+
PATCH: "PATCH";
|
|
27
|
+
HEAD: "HEAD";
|
|
28
|
+
OPTIONS: "OPTIONS";
|
|
29
|
+
}>>;
|
|
30
|
+
headers: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodString>>;
|
|
31
|
+
body: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodCustom<FormData, FormData>, import("zod").ZodCustom<URLSearchParams, URLSearchParams>, import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>]>>;
|
|
32
|
+
connectionId: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodNumber]>>;
|
|
33
|
+
connection: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodNumber]>>;
|
|
34
|
+
authenticationId: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodNumber]>>;
|
|
35
|
+
callbackUrl: import("zod").ZodOptional<import("zod").ZodString>;
|
|
36
|
+
maxTime: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
37
|
+
}, import("zod/v4/core").$strip>>;
|
|
38
|
+
})[];
|
|
11
39
|
};
|
|
12
40
|
};
|
|
13
41
|
};
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
42
|
+
} & {
|
|
43
|
+
context: import("../eventEmission").EventEmissionContext;
|
|
44
|
+
} & {
|
|
45
|
+
context: {
|
|
46
|
+
meta: Record<string, import("../..").PluginMeta>;
|
|
47
|
+
};
|
|
48
|
+
}) => {
|
|
49
|
+
request: (options?: {
|
|
50
|
+
url: string;
|
|
51
|
+
method?: "POST" | "GET" | "DELETE" | "PUT" | "PATCH" | "HEAD" | "OPTIONS" | undefined;
|
|
52
|
+
body?: any;
|
|
53
|
+
connection?: string | number | undefined;
|
|
54
|
+
connectionId?: string | number | undefined;
|
|
55
|
+
authenticationId?: string | number | undefined;
|
|
56
|
+
callbackUrl?: string | undefined;
|
|
57
|
+
headers?: [string, string][] | Record<string, string> | Headers | undefined;
|
|
58
|
+
} | undefined) => Promise<Response>;
|
|
59
|
+
} & {
|
|
60
|
+
context: {
|
|
61
|
+
meta: {
|
|
62
|
+
request: import("../..").PluginMeta;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
export type RequestPluginProvides = ReturnType<typeof requestPlugin>;
|
|
21
67
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/request/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/request/index.ts"],"names":[],"mappings":"AAOA;;;;GAIG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+BzB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC"}
|
|
@@ -1,13 +1,19 @@
|
|
|
1
|
+
import { definePlugin } from "../../utils/plugin-utils";
|
|
2
|
+
import { createPluginMethod } from "../../utils/plugin-utils";
|
|
1
3
|
import { RelayRequestSchema } from "./schemas";
|
|
2
|
-
import { createFunction } from "../../utils/function-utils";
|
|
3
|
-
import { createTelemetryCallback } from "../../utils/telemetry-utils";
|
|
4
4
|
import { logDeprecation } from "../../utils/logging";
|
|
5
5
|
/**
|
|
6
|
-
* @deprecated Use `sdk.fetch(url, init?)` instead. This plugin now delegates
|
|
7
|
-
* and is kept only for backward compatibility. It is
|
|
6
|
+
* @deprecated Use `sdk.fetch(url, init?)` instead. This plugin now delegates
|
|
7
|
+
* to the fetch plugin and is kept only for backward compatibility. It is
|
|
8
|
+
* hidden from the CLI/MCP registries.
|
|
8
9
|
*/
|
|
9
|
-
export const requestPlugin = (sdk) => {
|
|
10
|
-
|
|
10
|
+
export const requestPlugin = definePlugin((sdk) => createPluginMethod(sdk, {
|
|
11
|
+
name: "request",
|
|
12
|
+
packages: ["cli", "mcp"],
|
|
13
|
+
categories: ["http", "deprecated"],
|
|
14
|
+
returnType: "Response",
|
|
15
|
+
inputSchema: RelayRequestSchema,
|
|
16
|
+
handler: async ({ sdk, options }) => {
|
|
11
17
|
logDeprecation("request() is deprecated. Use fetch() instead.");
|
|
12
18
|
const { url, method, body, headers, connection, connectionId, authenticationId, callbackUrl, } = options;
|
|
13
19
|
return sdk.fetch(url, {
|
|
@@ -17,19 +23,5 @@ export const requestPlugin = (sdk) => {
|
|
|
17
23
|
connection: connection ?? connectionId ?? authenticationId,
|
|
18
24
|
callbackUrl,
|
|
19
25
|
});
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
return {
|
|
23
|
-
request: requestDefinition,
|
|
24
|
-
context: {
|
|
25
|
-
meta: {
|
|
26
|
-
request: {
|
|
27
|
-
packages: ["cli", "mcp"],
|
|
28
|
-
categories: ["http", "deprecated"],
|
|
29
|
-
returnType: "Response",
|
|
30
|
-
inputSchema: RelayRequestSchema,
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
};
|
|
35
|
-
};
|
|
26
|
+
},
|
|
27
|
+
}));
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import type { ZapierApiError, ZapierValidationError, ZapierUnknownError } from "../../types/errors";
|
|
3
2
|
export declare const RelayRequestSchema: z.ZodObject<{
|
|
4
3
|
url: z.ZodString;
|
|
5
4
|
method: z.ZodOptional<z.ZodEnum<{
|
|
@@ -19,7 +18,6 @@ export declare const RelayRequestSchema: z.ZodObject<{
|
|
|
19
18
|
headers: z.ZodOptional<z.ZodUnion<readonly [z.ZodRecord<z.ZodString, z.ZodString>, z.ZodCustom<Headers, Headers>, z.ZodArray<z.ZodTuple<[z.ZodString, z.ZodString], null>>]>>;
|
|
20
19
|
}, z.core.$strip>;
|
|
21
20
|
export type RelayRequestOptions = z.infer<typeof RelayRequestSchema>;
|
|
22
|
-
export type RelayRequestError = ZapierApiError | ZapierValidationError | ZapierUnknownError;
|
|
23
21
|
export interface RelayRequestSdkFunction {
|
|
24
22
|
request: (options: RelayRequestOptions) => Promise<Response>;
|
|
25
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/request/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/request/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;iBAoC3B,CAAC;AAGL,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAGrE,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,CAAC,OAAO,EAAE,mBAAmB,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;CAC9D;AAGD,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;iBAAqB,CAAC;AACnD,MAAM,MAAM,iBAAiB,GAAG,mBAAmB,CAAC;AACpD,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;CAC1D"}
|