@zapier/zapier-sdk 0.42.0 → 0.42.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/index.cjs +185 -159
- package/dist/index.d.mts +163 -408
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +185 -160
- package/dist/plugins/api/index.d.ts +5 -1
- package/dist/plugins/api/index.d.ts.map +1 -1
- package/dist/plugins/api/index.js +2 -3
- package/dist/plugins/apps/index.d.ts +2 -3
- package/dist/plugins/apps/index.d.ts.map +1 -1
- package/dist/plugins/apps/index.js +1 -1
- package/dist/plugins/capabilities/index.d.ts +8 -6
- package/dist/plugins/capabilities/index.d.ts.map +1 -1
- package/dist/plugins/capabilities/index.js +3 -3
- package/dist/plugins/connections/index.d.ts +3 -1
- package/dist/plugins/connections/index.d.ts.map +1 -1
- package/dist/plugins/connections/index.js +2 -3
- package/dist/plugins/createClientCredentials/index.d.ts +6 -4
- package/dist/plugins/createClientCredentials/index.d.ts.map +1 -1
- package/dist/plugins/createClientCredentials/index.js +3 -3
- package/dist/plugins/deleteClientCredentials/index.d.ts +6 -4
- package/dist/plugins/deleteClientCredentials/index.d.ts.map +1 -1
- package/dist/plugins/deleteClientCredentials/index.js +3 -3
- package/dist/plugins/deprecated/authentications.d.ts +9 -9
- package/dist/plugins/deprecated/authentications.d.ts.map +1 -1
- package/dist/plugins/deprecated/authentications.js +4 -4
- package/dist/plugins/eventEmission/index.d.ts +4 -5
- package/dist/plugins/eventEmission/index.d.ts.map +1 -1
- package/dist/plugins/eventEmission/index.js +8 -7
- package/dist/plugins/fetch/index.d.ts +6 -6
- package/dist/plugins/fetch/index.d.ts.map +1 -1
- package/dist/plugins/fetch/index.js +5 -5
- package/dist/plugins/findFirstConnection/index.d.ts +3 -4
- package/dist/plugins/findFirstConnection/index.d.ts.map +1 -1
- package/dist/plugins/findFirstConnection/index.js +2 -2
- package/dist/plugins/findUniqueConnection/index.d.ts +3 -4
- package/dist/plugins/findUniqueConnection/index.d.ts.map +1 -1
- package/dist/plugins/findUniqueConnection/index.js +2 -2
- package/dist/plugins/getAction/index.d.ts +7 -7
- package/dist/plugins/getAction/index.d.ts.map +1 -1
- package/dist/plugins/getAction/index.js +2 -2
- package/dist/plugins/getApp/index.d.ts +2 -3
- package/dist/plugins/getApp/index.d.ts.map +1 -1
- package/dist/plugins/getApp/index.js +2 -2
- package/dist/plugins/getConnection/index.d.ts +6 -6
- package/dist/plugins/getConnection/index.d.ts.map +1 -1
- package/dist/plugins/getConnection/index.js +3 -3
- package/dist/plugins/getInputFieldsSchema/index.d.ts +8 -6
- package/dist/plugins/getInputFieldsSchema/index.d.ts.map +1 -1
- package/dist/plugins/getInputFieldsSchema/index.js +4 -4
- package/dist/plugins/getProfile/index.d.ts +6 -6
- package/dist/plugins/getProfile/index.d.ts.map +1 -1
- package/dist/plugins/getProfile/index.js +3 -3
- package/dist/plugins/listActions/index.d.ts +8 -6
- package/dist/plugins/listActions/index.d.ts.map +1 -1
- package/dist/plugins/listActions/index.js +3 -3
- package/dist/plugins/listApps/index.d.ts +3 -3
- package/dist/plugins/listApps/index.d.ts.map +1 -1
- package/dist/plugins/listApps/index.js +3 -3
- package/dist/plugins/listClientCredentials/index.d.ts +6 -4
- package/dist/plugins/listClientCredentials/index.d.ts.map +1 -1
- package/dist/plugins/listClientCredentials/index.js +3 -3
- package/dist/plugins/listConnections/index.d.ts +8 -6
- package/dist/plugins/listConnections/index.d.ts.map +1 -1
- package/dist/plugins/listConnections/index.js +5 -5
- package/dist/plugins/listInputFieldChoices/index.d.ts +9 -8
- package/dist/plugins/listInputFieldChoices/index.d.ts.map +1 -1
- package/dist/plugins/listInputFieldChoices/index.js +4 -4
- package/dist/plugins/listInputFields/index.d.ts +8 -8
- package/dist/plugins/listInputFields/index.d.ts.map +1 -1
- package/dist/plugins/listInputFields/index.js +4 -4
- package/dist/plugins/manifest/index.d.ts +8 -3
- package/dist/plugins/manifest/index.d.ts.map +1 -1
- package/dist/plugins/manifest/index.js +2 -3
- package/dist/plugins/registry/index.d.ts +1 -2
- package/dist/plugins/registry/index.d.ts.map +1 -1
- package/dist/plugins/registry/index.js +3 -3
- package/dist/plugins/request/index.d.ts +3 -4
- package/dist/plugins/request/index.d.ts.map +1 -1
- package/dist/plugins/request/index.js +2 -2
- package/dist/plugins/runAction/index.d.ts +8 -8
- package/dist/plugins/runAction/index.d.ts.map +1 -1
- package/dist/plugins/runAction/index.js +5 -5
- package/dist/plugins/tables/createTable/index.d.ts +3 -5
- package/dist/plugins/tables/createTable/index.d.ts.map +1 -1
- package/dist/plugins/tables/createTable/index.js +3 -3
- package/dist/plugins/tables/createTableFields/index.d.ts +3 -5
- package/dist/plugins/tables/createTableFields/index.d.ts.map +1 -1
- package/dist/plugins/tables/createTableFields/index.js +3 -3
- package/dist/plugins/tables/createTableRecords/index.d.ts +3 -5
- package/dist/plugins/tables/createTableRecords/index.d.ts.map +1 -1
- package/dist/plugins/tables/createTableRecords/index.js +3 -3
- package/dist/plugins/tables/deleteTable/index.d.ts +5 -5
- package/dist/plugins/tables/deleteTable/index.d.ts.map +1 -1
- package/dist/plugins/tables/deleteTable/index.js +4 -4
- package/dist/plugins/tables/deleteTableFields/index.d.ts +3 -5
- package/dist/plugins/tables/deleteTableFields/index.d.ts.map +1 -1
- package/dist/plugins/tables/deleteTableFields/index.js +3 -3
- package/dist/plugins/tables/deleteTableRecords/index.d.ts +3 -5
- package/dist/plugins/tables/deleteTableRecords/index.d.ts.map +1 -1
- package/dist/plugins/tables/deleteTableRecords/index.js +3 -3
- package/dist/plugins/tables/getTable/index.d.ts +3 -5
- package/dist/plugins/tables/getTable/index.d.ts.map +1 -1
- package/dist/plugins/tables/getTable/index.js +3 -3
- package/dist/plugins/tables/getTableRecord/index.d.ts +3 -5
- package/dist/plugins/tables/getTableRecord/index.d.ts.map +1 -1
- package/dist/plugins/tables/getTableRecord/index.js +3 -3
- package/dist/plugins/tables/listTableFields/index.d.ts +3 -5
- package/dist/plugins/tables/listTableFields/index.d.ts.map +1 -1
- package/dist/plugins/tables/listTableFields/index.js +3 -3
- package/dist/plugins/tables/listTableRecords/index.d.ts +3 -3
- package/dist/plugins/tables/listTableRecords/index.d.ts.map +1 -1
- package/dist/plugins/tables/listTableRecords/index.js +3 -3
- package/dist/plugins/tables/listTables/index.d.ts +5 -3
- package/dist/plugins/tables/listTables/index.d.ts.map +1 -1
- package/dist/plugins/tables/listTables/index.js +4 -4
- package/dist/plugins/tables/updateTableRecords/index.d.ts +3 -5
- package/dist/plugins/tables/updateTableRecords/index.d.ts.map +1 -1
- package/dist/plugins/tables/updateTableRecords/index.js +3 -3
- package/dist/resolvers/connectionId.js +1 -1
- package/dist/resolvers/tableId.js +1 -1
- package/dist/sdk.d.ts +29 -257
- package/dist/sdk.d.ts.map +1 -1
- package/dist/sdk.js +33 -43
- package/dist/types/plugin.d.ts +29 -48
- package/dist/types/plugin.d.ts.map +1 -1
- package/dist/types/plugin.js +7 -3
- package/dist/types/sdk.d.ts +2 -3
- package/dist/types/sdk.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { Plugin
|
|
1
|
+
import type { Plugin } from "../../types/plugin";
|
|
2
2
|
import type { ApiClient } from "../../api";
|
|
3
3
|
import type { ActionItem } from "../../types/domain";
|
|
4
4
|
import { GetActionSchema, type GetActionOptions } from "./schemas";
|
|
5
5
|
import type { ListActionsPluginProvides } from "../listActions";
|
|
6
|
-
import type {
|
|
6
|
+
import type { EventEmissionProvides } from "../eventEmission";
|
|
7
7
|
export interface GetActionPluginProvides {
|
|
8
8
|
getAction: (options: GetActionOptions) => Promise<{
|
|
9
9
|
data: ActionItem;
|
|
@@ -16,10 +16,10 @@ export interface GetActionPluginProvides {
|
|
|
16
16
|
};
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
|
-
export declare const getActionPlugin: Plugin<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
} &
|
|
19
|
+
export declare const getActionPlugin: Plugin<ListActionsPluginProvides & {
|
|
20
|
+
context: {
|
|
21
|
+
api: ApiClient;
|
|
22
|
+
};
|
|
23
|
+
} & EventEmissionProvides, // requires listActions in SDK, api and eventEmission in context
|
|
24
24
|
GetActionPluginProvides>;
|
|
25
25
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/getAction/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/getAction/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EACL,eAAe,EAEf,KAAK,gBAAgB,EACtB,MAAM,WAAW,CAAC;AAGnB,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAOhE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAI9D,MAAM,WAAW,uBAAuB;IACtC,SAAS,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,OAAO,CAAC;QAAE,IAAI,EAAE,UAAU,CAAA;KAAE,CAAC,CAAC;IACxE,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,SAAS,EAAE;gBACT,WAAW,EAAE,OAAO,eAAe,CAAC;aACrC,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,eAAe,EAAE,MAAM,CAClC,yBAAyB,GAAG;IAC1B,OAAO,EAAE;QAAE,GAAG,EAAE,SAAS,CAAA;KAAE,CAAC;CAC7B,GAAG,qBAAqB,EAAE,gEAAgE;AAC3F,uBAAuB,CA2DxB,CAAC"}
|
|
@@ -5,7 +5,7 @@ import { appKeyResolver, actionTypeResolver, actionKeyResolver, } from "../../re
|
|
|
5
5
|
import { ActionItemSchema } from "../../schemas/Action";
|
|
6
6
|
import { createTelemetryCallback } from "../../utils/telemetry-utils";
|
|
7
7
|
import { setMethodMetadata } from "../../utils/telemetry-context";
|
|
8
|
-
export const getActionPlugin = (
|
|
8
|
+
export const getActionPlugin = (sdk) => {
|
|
9
9
|
async function getAction(options) {
|
|
10
10
|
const appKey = "app" in options ? options.app : options.appKey;
|
|
11
11
|
const actionKey = "action" in options ? options.action : options.actionKey;
|
|
@@ -26,7 +26,7 @@ export const getActionPlugin = ({ sdk, context }) => {
|
|
|
26
26
|
// If we get here, action was not found
|
|
27
27
|
throw new ZapierResourceNotFoundError(`Action not found: ${actionKey} with type ${actionType}`, { resourceType: "Action", resourceId: `${actionKey} (${actionType})` });
|
|
28
28
|
}
|
|
29
|
-
const getActionDefinition = createFunction(getAction, GetActionInputSchema, createTelemetryCallback(context.eventEmission.emitMethodCalled, getAction.name));
|
|
29
|
+
const getActionDefinition = createFunction(getAction, GetActionInputSchema, createTelemetryCallback(sdk.context.eventEmission.emitMethodCalled, getAction.name));
|
|
30
30
|
return {
|
|
31
31
|
getAction: getActionDefinition,
|
|
32
32
|
context: {
|
|
@@ -2,9 +2,8 @@ import type { Plugin } from "../../types/plugin";
|
|
|
2
2
|
import { GetAppSchema } from "./schemas";
|
|
3
3
|
import type { GetAppOptions } from "./schemas";
|
|
4
4
|
import type { AppItem } from "../../types/domain";
|
|
5
|
-
import type { GetSdkType } from "../../types/plugin";
|
|
6
5
|
import type { ListAppsPluginProvides } from "../listApps";
|
|
7
|
-
import type {
|
|
6
|
+
import type { EventEmissionProvides } from "../eventEmission";
|
|
8
7
|
export interface GetAppPluginProvides {
|
|
9
8
|
getApp: (options: GetAppOptions) => Promise<{
|
|
10
9
|
data: AppItem;
|
|
@@ -17,5 +16,5 @@ export interface GetAppPluginProvides {
|
|
|
17
16
|
};
|
|
18
17
|
};
|
|
19
18
|
}
|
|
20
|
-
export declare const getAppPlugin: Plugin<
|
|
19
|
+
export declare const getAppPlugin: Plugin<ListAppsPluginProvides & EventEmissionProvides, GetAppPluginProvides>;
|
|
21
20
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/getApp/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAqB,MAAM,WAAW,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAGlD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/getApp/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAqB,MAAM,WAAW,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAGlD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAE1D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAI9D,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,OAAO,CAAC;QAAE,IAAI,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IAC/D,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,WAAW,EAAE,OAAO,YAAY,CAAC;aAClC,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAGD,eAAO,MAAM,YAAY,EAAE,MAAM,CAC/B,sBAAsB,GAAG,qBAAqB,EAC9C,oBAAoB,CA+CrB,CAAC"}
|
|
@@ -5,7 +5,7 @@ import { ZapierAppNotFoundError } from "../../types/errors";
|
|
|
5
5
|
import { appKeyResolver } from "../../resolvers";
|
|
6
6
|
import { createTelemetryCallback } from "../../utils/telemetry-utils";
|
|
7
7
|
// GetApp plugin depends on listApps SDK function
|
|
8
|
-
export const getAppPlugin = (
|
|
8
|
+
export const getAppPlugin = (sdk) => {
|
|
9
9
|
async function getApp(options) {
|
|
10
10
|
const appKey = "app" in options ? options.app : options.appKey;
|
|
11
11
|
const appsIterable = sdk
|
|
@@ -22,7 +22,7 @@ export const getAppPlugin = ({ sdk, context }) => {
|
|
|
22
22
|
appKey,
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
|
-
const getAppDefinition = createFunction(getApp, GetAppInputSchema, createTelemetryCallback(context.eventEmission.emitMethodCalled, getApp.name));
|
|
25
|
+
const getAppDefinition = createFunction(getApp, GetAppInputSchema, createTelemetryCallback(sdk.context.eventEmission.emitMethodCalled, getApp.name));
|
|
26
26
|
// Return flat structure - getApp goes directly to SDK
|
|
27
27
|
return {
|
|
28
28
|
getApp: getAppDefinition,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Plugin } from "../../types/plugin";
|
|
2
2
|
import type { ApiClient } from "../../api";
|
|
3
|
-
import type {
|
|
3
|
+
import type { EventEmissionProvides } from "../eventEmission";
|
|
4
4
|
import type { GetConnectionResponse } from "@zapier/zapier-sdk-core/v0/schemas/connections";
|
|
5
5
|
import { GetConnectionParamSchema, type GetConnectionParam } from "./schemas";
|
|
6
6
|
export interface GetConnectionPluginProvides {
|
|
@@ -13,10 +13,10 @@ export interface GetConnectionPluginProvides {
|
|
|
13
13
|
};
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
|
-
export declare const getConnectionPlugin: Plugin<{
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
} &
|
|
16
|
+
export declare const getConnectionPlugin: Plugin<{
|
|
17
|
+
context: {
|
|
18
|
+
api: ApiClient;
|
|
19
|
+
};
|
|
20
|
+
} & EventEmissionProvides, // no SDK dependencies, requires api and eventEmission in context
|
|
21
21
|
GetConnectionPluginProvides>;
|
|
22
22
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/getConnection/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAK3C,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/getConnection/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAK3C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAE9D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gDAAgD,CAAC;AAC5F,OAAO,EAAE,wBAAwB,EAAE,KAAK,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAE9E,MAAM,WAAW,2BAA2B;IAC1C,aAAa,EAAE,CACb,OAAO,EAAE,kBAAkB,KACxB,OAAO,CAAC,qBAAqB,CAAC,CAAC;IACpC,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,aAAa,EAAE;gBACb,WAAW,EAAE,OAAO,wBAAwB,CAAC;aAC9C,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,mBAAmB,EAAE,MAAM,CACtC;IAAE,OAAO,EAAE;QAAE,GAAG,EAAE,SAAS,CAAA;KAAE,CAAA;CAAE,GAAG,qBAAqB,EAAE,iEAAiE;AAC1H,2BAA2B,CAgD5B,CAAC"}
|
|
@@ -4,9 +4,9 @@ import { transformConnectionItem } from "../../utils/domain-utils";
|
|
|
4
4
|
import { ConnectionItemSchema } from "../../schemas/Connection";
|
|
5
5
|
import { createTelemetryCallback } from "../../utils/telemetry-utils";
|
|
6
6
|
import { GetConnectionParamSchema } from "./schemas";
|
|
7
|
-
export const getConnectionPlugin = (
|
|
7
|
+
export const getConnectionPlugin = (sdk) => {
|
|
8
8
|
async function getConnection(options) {
|
|
9
|
-
const { api } = context;
|
|
9
|
+
const { api } = sdk.context;
|
|
10
10
|
const resolvedConnectionId = options.connection ?? options.connectionId ?? options.authenticationId;
|
|
11
11
|
if (!resolvedConnectionId) {
|
|
12
12
|
throw new Error("connection is required");
|
|
@@ -17,7 +17,7 @@ export const getConnectionPlugin = ({ context }) => {
|
|
|
17
17
|
data: transformConnectionItem(response.data),
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
|
-
const getConnectionDefinition = createFunction(getConnection, GetConnectionParamSchema, createTelemetryCallback(context.eventEmission.emitMethodCalled, getConnection.name));
|
|
20
|
+
const getConnectionDefinition = createFunction(getConnection, GetConnectionParamSchema, createTelemetryCallback(sdk.context.eventEmission.emitMethodCalled, getConnection.name));
|
|
21
21
|
return {
|
|
22
22
|
getConnection: getConnectionDefinition,
|
|
23
23
|
context: {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { Plugin
|
|
1
|
+
import type { Plugin } from "../../types/plugin";
|
|
2
2
|
import type { ApiClient } from "../../api";
|
|
3
3
|
import { GetInputFieldsSchemaSchema, type GetInputFieldsSchemaOptions as GetInputFieldsSchemaOptions } from "./schemas";
|
|
4
4
|
import type { GetActionPluginProvides } from "../getAction";
|
|
5
5
|
import type { GetVersionedImplementationId } from "../manifest/schemas";
|
|
6
|
-
import type {
|
|
6
|
+
import type { EventEmissionProvides } from "../eventEmission";
|
|
7
7
|
import type { ConnectionsPluginProvides } from "../connections";
|
|
8
8
|
export interface GetInputFieldsSchemaPluginProvides {
|
|
9
9
|
getInputFieldsSchema: (options: GetInputFieldsSchemaOptions) => Promise<{
|
|
@@ -17,8 +17,10 @@ export interface GetInputFieldsSchemaPluginProvides {
|
|
|
17
17
|
};
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
|
-
export declare const getInputFieldsSchemaPlugin: Plugin<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
export declare const getInputFieldsSchemaPlugin: Plugin<GetActionPluginProvides & {
|
|
21
|
+
context: {
|
|
22
|
+
api: ApiClient;
|
|
23
|
+
getVersionedImplementationId: GetVersionedImplementationId;
|
|
24
|
+
} & ConnectionsPluginProvides["context"];
|
|
25
|
+
} & EventEmissionProvides, GetInputFieldsSchemaPluginProvides>;
|
|
24
26
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/getInputFieldsSchema/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/getInputFieldsSchema/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EACL,0BAA0B,EAE1B,KAAK,2BAA2B,IAAI,2BAA2B,EAChE,MAAM,WAAW,CAAC;AAGnB,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AAUxE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAIhE,MAAM,WAAW,kCAAkC;IACjD,oBAAoB,EAAE,CACpB,OAAO,EAAE,2BAA2B,KACjC,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,CAAC,CAAC;IAChD,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,oBAAoB,EAAE;gBACpB,WAAW,EAAE,OAAO,0BAA0B,CAAC;aAChD,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,0BAA0B,EAAE,MAAM,CAC7C,uBAAuB,GAAG;IACxB,OAAO,EAAE;QACP,GAAG,EAAE,SAAS,CAAC;QACf,4BAA4B,EAAE,4BAA4B,CAAC;KAC5D,GAAG,yBAAyB,CAAC,SAAS,CAAC,CAAC;CAC1C,GAAG,qBAAqB,EACzB,kCAAkC,CAmFnC,CAAC"}
|
|
@@ -6,9 +6,9 @@ import { fetchImplementationNeeds } from "../../services/implementations";
|
|
|
6
6
|
import { createTelemetryCallback } from "../../utils/telemetry-utils";
|
|
7
7
|
import { resolveConnectionId } from "../../utils/domain-utils";
|
|
8
8
|
import { setMethodMetadata } from "../../utils/telemetry-context";
|
|
9
|
-
export const getInputFieldsSchemaPlugin = (
|
|
9
|
+
export const getInputFieldsSchemaPlugin = (sdk) => {
|
|
10
10
|
async function getInputFieldsSchema(options) {
|
|
11
|
-
const { api, getVersionedImplementationId } = context;
|
|
11
|
+
const { api, getVersionedImplementationId } = sdk.context;
|
|
12
12
|
const appKey = "app" in options ? options.app : options.appKey;
|
|
13
13
|
const actionKey = "action" in options ? options.action : options.actionKey;
|
|
14
14
|
const { actionType, connection, connectionId, authenticationId, inputs } = options;
|
|
@@ -16,7 +16,7 @@ export const getInputFieldsSchemaPlugin = ({ sdk, context }) => {
|
|
|
16
16
|
connection,
|
|
17
17
|
connectionId,
|
|
18
18
|
authenticationId,
|
|
19
|
-
resolveConnection: context.resolveConnection,
|
|
19
|
+
resolveConnection: sdk.context.resolveConnection,
|
|
20
20
|
});
|
|
21
21
|
const selectedApi = await getVersionedImplementationId(appKey);
|
|
22
22
|
if (!selectedApi) {
|
|
@@ -44,7 +44,7 @@ export const getInputFieldsSchemaPlugin = ({ sdk, context }) => {
|
|
|
44
44
|
data: needsData.schema || {},
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
|
-
const getInputFieldsSchemaDefinition = createFunction(getInputFieldsSchema, GetInputFieldsSchemaInputSchema, createTelemetryCallback(context.eventEmission.emitMethodCalled, getInputFieldsSchema.name));
|
|
47
|
+
const getInputFieldsSchemaDefinition = createFunction(getInputFieldsSchema, GetInputFieldsSchemaInputSchema, createTelemetryCallback(sdk.context.eventEmission.emitMethodCalled, getInputFieldsSchema.name));
|
|
48
48
|
return {
|
|
49
49
|
getInputFieldsSchema: getInputFieldsSchemaDefinition,
|
|
50
50
|
context: {
|
|
@@ -3,7 +3,7 @@ import type { ApiClient } from "../../api/types";
|
|
|
3
3
|
import type { Plugin } from "../../types/plugin";
|
|
4
4
|
import type { UserProfileItem } from "../../types/domain";
|
|
5
5
|
import { GetProfileSchema } from "./schemas";
|
|
6
|
-
import type {
|
|
6
|
+
import type { EventEmissionProvides } from "../eventEmission";
|
|
7
7
|
export interface GetProfilePluginProvides {
|
|
8
8
|
getProfile: (options?: GetProfileOptions) => Promise<{
|
|
9
9
|
data: UserProfileItem;
|
|
@@ -16,10 +16,10 @@ export interface GetProfilePluginProvides {
|
|
|
16
16
|
};
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
|
-
export declare const getProfilePlugin: Plugin<{
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
} &
|
|
19
|
+
export declare const getProfilePlugin: Plugin<{
|
|
20
|
+
context: {
|
|
21
|
+
api: ApiClient;
|
|
22
|
+
};
|
|
23
|
+
} & EventEmissionProvides, // no SDK dependencies, requires api and eventEmission in context
|
|
24
24
|
GetProfilePluginProvides>;
|
|
25
25
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/getProfile/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,KAAK,EAAe,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE9D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAG7C,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/getProfile/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,KAAK,EAAe,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE9D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAG7C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAG9D,MAAM,WAAW,wBAAwB;IACvC,UAAU,EAAE,CACV,OAAO,CAAC,EAAE,iBAAiB,KACxB,OAAO,CAAC;QAAE,IAAI,EAAE,eAAe,CAAA;KAAE,CAAC,CAAC;IACxC,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,UAAU,EAAE;gBACV,WAAW,EAAE,OAAO,gBAAgB,CAAC;aACtC,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAGD,eAAO,MAAM,gBAAgB,EAAE,MAAM,CACnC;IAAE,OAAO,EAAE;QAAE,GAAG,EAAE,SAAS,CAAA;KAAE,CAAA;CAAE,GAAG,qBAAqB,EAAE,iEAAiE;AAC1H,wBAAwB,CA+CzB,CAAC"}
|
|
@@ -3,9 +3,9 @@ import { GetProfileSchema } from "./schemas";
|
|
|
3
3
|
import { UserProfileItemSchema } from "../../schemas/UserProfile";
|
|
4
4
|
import { createTelemetryCallback } from "../../utils/telemetry-utils";
|
|
5
5
|
// Direct plugin function - takes options + sdk + context in one object
|
|
6
|
-
export const getProfilePlugin = (
|
|
6
|
+
export const getProfilePlugin = (sdk) => {
|
|
7
7
|
async function getProfile() {
|
|
8
|
-
const profile = await context.api.get("/zapier/api/v4/profile/", {
|
|
8
|
+
const profile = await sdk.context.api.get("/zapier/api/v4/profile/", {
|
|
9
9
|
authRequired: true,
|
|
10
10
|
});
|
|
11
11
|
return {
|
|
@@ -20,7 +20,7 @@ export const getProfilePlugin = ({ context }) => {
|
|
|
20
20
|
},
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
-
const getProfileDefinition = createFunction(getProfile, GetProfileSchema, createTelemetryCallback(context.eventEmission.emitMethodCalled, getProfile.name));
|
|
23
|
+
const getProfileDefinition = createFunction(getProfile, GetProfileSchema, createTelemetryCallback(sdk.context.eventEmission.emitMethodCalled, getProfile.name));
|
|
24
24
|
// Return flat structure - getProfile goes directly to SDK
|
|
25
25
|
return {
|
|
26
26
|
getProfile: getProfileDefinition,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { Plugin
|
|
1
|
+
import type { Plugin } from "../../types/plugin";
|
|
2
2
|
import type { ApiClient } from "../../api";
|
|
3
3
|
import type { ActionItem } from "../../types/domain";
|
|
4
4
|
import { ListActionsSchema, type ListActionsOptions } from "./schemas";
|
|
5
5
|
import type { ManifestPluginProvides } from "../manifest";
|
|
6
6
|
import type { GetVersionedImplementationId } from "../manifest/schemas";
|
|
7
|
-
import type {
|
|
7
|
+
import type { EventEmissionProvides } from "../eventEmission";
|
|
8
8
|
export interface ListActionsPluginProvides {
|
|
9
9
|
listActions: (options?: ListActionsOptions) => Promise<{
|
|
10
10
|
data: ActionItem[];
|
|
@@ -23,8 +23,10 @@ export interface ListActionsPluginProvides {
|
|
|
23
23
|
};
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
|
-
export declare const listActionsPlugin: Plugin<
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
export declare const listActionsPlugin: Plugin<ManifestPluginProvides & {
|
|
27
|
+
context: {
|
|
28
|
+
api: ApiClient;
|
|
29
|
+
getVersionedImplementationId: GetVersionedImplementationId;
|
|
30
|
+
};
|
|
31
|
+
} & EventEmissionProvides, ListActionsPluginProvides>;
|
|
30
32
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/listActions/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/listActions/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAkB,MAAM,WAAW,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,EACL,iBAAiB,EAEjB,KAAK,kBAAkB,EAExB,MAAM,WAAW,CAAC;AAQnB,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AAExE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAK9D,MAAM,WAAW,yBAAyB;IACxC,WAAW,EAAE,CAAC,OAAO,CAAC,EAAE,kBAAkB,KAAK,OAAO,CAAC;QACrD,IAAI,EAAE,UAAU,EAAE,CAAC;QACnB,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC,GACA,aAAa,CAAC;QAAE,IAAI,EAAE,UAAU,EAAE,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,GAAG;QAC3D,KAAK,IAAI,aAAa,CAAC,UAAU,CAAC,CAAC;KACpC,CAAC;IACJ,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,WAAW,EAAE;gBACX,WAAW,EAAE,OAAO,iBAAiB,CAAC;aACvC,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,iBAAiB,EAAE,MAAM,CACpC,sBAAsB,GAAG;IACvB,OAAO,EAAE;QACP,GAAG,EAAE,SAAS,CAAC;QACf,4BAA4B,EAAE,4BAA4B,CAAC;KAC5D,CAAC;CACH,GAAG,qBAAqB,EACzB,yBAAyB,CAgH1B,CAAC"}
|
|
@@ -8,7 +8,7 @@ import { appKeyResolver, actionTypeResolver } from "../../resolvers";
|
|
|
8
8
|
import { createTelemetryCallback } from "../../utils/telemetry-utils";
|
|
9
9
|
import { stripPageSuffix } from "../../utils/string-utils";
|
|
10
10
|
import { setMethodMetadata } from "../../utils/telemetry-context";
|
|
11
|
-
export const listActionsPlugin = (
|
|
11
|
+
export const listActionsPlugin = (sdk) => {
|
|
12
12
|
const methodMeta = {
|
|
13
13
|
categories: ["action"],
|
|
14
14
|
type: "list",
|
|
@@ -21,7 +21,7 @@ export const listActionsPlugin = ({ context }) => {
|
|
|
21
21
|
},
|
|
22
22
|
};
|
|
23
23
|
async function listActionsPage(options) {
|
|
24
|
-
const { api, getVersionedImplementationId } = context;
|
|
24
|
+
const { api, getVersionedImplementationId } = sdk.context;
|
|
25
25
|
const appKey = "app" in options ? options.app : options.appKey;
|
|
26
26
|
// Use getVersionedImplementationId (optimized to check manifest first)
|
|
27
27
|
const selectedApi = await getVersionedImplementationId(appKey);
|
|
@@ -71,7 +71,7 @@ export const listActionsPlugin = ({ context }) => {
|
|
|
71
71
|
};
|
|
72
72
|
}
|
|
73
73
|
const methodName = stripPageSuffix(listActionsPage.name);
|
|
74
|
-
const listActionsDefinition = createPaginatedFunction(listActionsPage, ListActionsInputSchema, createTelemetryCallback(context.eventEmission.emitMethodCalled, methodName), methodName, DEFAULT_PAGE_SIZE);
|
|
74
|
+
const listActionsDefinition = createPaginatedFunction(listActionsPage, ListActionsInputSchema, createTelemetryCallback(sdk.context.eventEmission.emitMethodCalled, methodName), methodName, DEFAULT_PAGE_SIZE);
|
|
75
75
|
return {
|
|
76
76
|
listActions: listActionsDefinition,
|
|
77
77
|
context: {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Plugin } from "../../types/plugin";
|
|
2
2
|
import { ListAppsSchema, type ListAppsOptions, type ListAppsPage, type AppItem } from "./schemas";
|
|
3
3
|
import type { ManifestPluginProvides } from "../manifest";
|
|
4
4
|
import type { ApiPluginProvides } from "../api";
|
|
5
|
-
import type {
|
|
5
|
+
import type { EventEmissionProvides } from "../eventEmission";
|
|
6
6
|
export interface ListAppsPluginProvides {
|
|
7
7
|
listApps: (options?: ListAppsOptions) => Promise<ListAppsPage> & AsyncIterable<ListAppsPage> & {
|
|
8
8
|
items(): AsyncIterable<AppItem>;
|
|
@@ -15,5 +15,5 @@ export interface ListAppsPluginProvides {
|
|
|
15
15
|
};
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
|
-
export declare const listAppsPlugin: Plugin<
|
|
18
|
+
export declare const listAppsPlugin: Plugin<ApiPluginProvides & ManifestPluginProvides & EventEmissionProvides, ListAppsPluginProvides>;
|
|
19
19
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/listApps/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/listApps/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAGjD,OAAO,EACL,cAAc,EACd,KAAK,eAAe,EAEpB,KAAK,YAAY,EACjB,KAAK,OAAO,EACb,MAAM,WAAW,CAAC;AAEnB,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAI9D,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,eAAe,KAAK,OAAO,CAAC,YAAY,CAAC,GAC5D,aAAa,CAAC,YAAY,CAAC,GAAG;QAC5B,KAAK,IAAI,aAAa,CAAC,OAAO,CAAC,CAAC;KACjC,CAAC;IACJ,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,QAAQ,EAAE;gBACR,WAAW,EAAE,OAAO,cAAc,CAAC;aACpC,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,cAAc,EAAE,MAAM,CACjC,iBAAiB,GAAG,sBAAsB,GAAG,qBAAqB,EAClE,sBAAsB,CAqFvB,CAAC"}
|
|
@@ -4,9 +4,9 @@ import { ListAppsSchema, } from "./schemas";
|
|
|
4
4
|
import { AppItemSchema } from "../../schemas/App";
|
|
5
5
|
import { createTelemetryCallback } from "../../utils/telemetry-utils";
|
|
6
6
|
import { stripPageSuffix } from "../../utils/string-utils";
|
|
7
|
-
export const listAppsPlugin = (
|
|
7
|
+
export const listAppsPlugin = (sdk) => {
|
|
8
8
|
async function listAppsPage(options) {
|
|
9
|
-
const { api, resolveAppKeys } = context;
|
|
9
|
+
const { api, resolveAppKeys } = sdk.context;
|
|
10
10
|
const appKeys = options.apps ?? options.appKeys ?? [];
|
|
11
11
|
const appLocators = await resolveAppKeys({
|
|
12
12
|
appKeys: [...appKeys],
|
|
@@ -52,7 +52,7 @@ export const listAppsPlugin = ({ context }) => {
|
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
54
|
const methodName = stripPageSuffix(listAppsPage.name);
|
|
55
|
-
const listAppsDefinition = createPaginatedFunction(listAppsPage, ListAppsSchema, createTelemetryCallback(context.eventEmission.emitMethodCalled, methodName), methodName, DEFAULT_PAGE_SIZE);
|
|
55
|
+
const listAppsDefinition = createPaginatedFunction(listAppsPage, ListAppsSchema, createTelemetryCallback(sdk.context.eventEmission.emitMethodCalled, methodName), methodName, DEFAULT_PAGE_SIZE);
|
|
56
56
|
return {
|
|
57
57
|
listApps: listAppsDefinition,
|
|
58
58
|
context: {
|
|
@@ -2,7 +2,7 @@ import type { Plugin } from "../../types/plugin";
|
|
|
2
2
|
import type { ApiClient } from "../../api";
|
|
3
3
|
import type { ClientCredentialsItem } from "@zapier/zapier-sdk-core/v0/schemas/client-credentials";
|
|
4
4
|
import { ListClientCredentialsQuerySchema, type ListClientCredentialsOptions, type ListClientCredentialsPage } from "./schemas";
|
|
5
|
-
import type {
|
|
5
|
+
import type { EventEmissionProvides } from "../eventEmission";
|
|
6
6
|
export interface ListClientCredentialsPluginProvides {
|
|
7
7
|
listClientCredentials: (options?: ListClientCredentialsOptions) => Promise<ListClientCredentialsPage> & AsyncIterable<ListClientCredentialsPage> & {
|
|
8
8
|
items(): AsyncIterable<ClientCredentialsItem>;
|
|
@@ -15,7 +15,9 @@ export interface ListClientCredentialsPluginProvides {
|
|
|
15
15
|
};
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
|
-
export declare const listClientCredentialsPlugin: Plugin<{
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
export declare const listClientCredentialsPlugin: Plugin<{
|
|
19
|
+
context: {
|
|
20
|
+
api: ApiClient;
|
|
21
|
+
};
|
|
22
|
+
} & EventEmissionProvides, ListClientCredentialsPluginProvides>;
|
|
21
23
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/listClientCredentials/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uDAAuD,CAAC;AACnG,OAAO,EACL,gCAAgC,EAChC,KAAK,4BAA4B,EACjC,KAAK,yBAAyB,EAC/B,MAAM,WAAW,CAAC;AAKnB,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/listClientCredentials/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uDAAuD,CAAC;AACnG,OAAO,EACL,gCAAgC,EAChC,KAAK,4BAA4B,EACjC,KAAK,yBAAyB,EAC/B,MAAM,WAAW,CAAC;AAKnB,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAK9D,MAAM,WAAW,mCAAmC;IAClD,qBAAqB,EAAE,CACrB,OAAO,CAAC,EAAE,4BAA4B,KACnC,OAAO,CAAC,yBAAyB,CAAC,GACrC,aAAa,CAAC,yBAAyB,CAAC,GAAG;QACzC,KAAK,IAAI,aAAa,CAAC,qBAAqB,CAAC,CAAC;KAC/C,CAAC;IACJ,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,qBAAqB,EAAE;gBACrB,WAAW,EAAE,OAAO,gCAAgC,CAAC;aACtD,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,2BAA2B,EAAE,MAAM,CAC9C;IACE,OAAO,EAAE;QACP,GAAG,EAAE,SAAS,CAAC;KAChB,CAAC;CACH,GAAG,qBAAqB,EACzB,mCAAmC,CAyEpC,CAAC"}
|
|
@@ -5,9 +5,9 @@ import { ClientCredentialsItemSchema } from "../../schemas/ClientCredentials";
|
|
|
5
5
|
import { createTelemetryCallback } from "../../utils/telemetry-utils";
|
|
6
6
|
import { stripPageSuffix } from "../../utils/string-utils";
|
|
7
7
|
import { ZapierAuthenticationError } from "../../types/errors";
|
|
8
|
-
export const listClientCredentialsPlugin = (
|
|
8
|
+
export const listClientCredentialsPlugin = (sdk) => {
|
|
9
9
|
async function listClientCredentialsPage(options) {
|
|
10
|
-
const { api } = context;
|
|
10
|
+
const { api } = sdk.context;
|
|
11
11
|
const searchParams = {};
|
|
12
12
|
if (options.pageSize !== undefined) {
|
|
13
13
|
searchParams.pageSize = options.pageSize.toString();
|
|
@@ -32,7 +32,7 @@ export const listClientCredentialsPlugin = ({ context }) => {
|
|
|
32
32
|
return response;
|
|
33
33
|
}
|
|
34
34
|
const methodName = stripPageSuffix(listClientCredentialsPage.name);
|
|
35
|
-
const listClientCredentialsDefinition = createPaginatedFunction(listClientCredentialsPage, ListClientCredentialsQuerySchema, createTelemetryCallback(context.eventEmission.emitMethodCalled, methodName), methodName, DEFAULT_PAGE_SIZE);
|
|
35
|
+
const listClientCredentialsDefinition = createPaginatedFunction(listClientCredentialsPage, ListClientCredentialsQuerySchema, createTelemetryCallback(sdk.context.eventEmission.emitMethodCalled, methodName), methodName, DEFAULT_PAGE_SIZE);
|
|
36
36
|
return {
|
|
37
37
|
listClientCredentials: listClientCredentialsDefinition,
|
|
38
38
|
context: {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { Plugin
|
|
1
|
+
import type { Plugin } from "../../types/plugin";
|
|
2
2
|
import type { ApiClient } from "../../api";
|
|
3
3
|
import type { ConnectionItem } from "@zapier/zapier-sdk-core/v0/schemas/connections";
|
|
4
4
|
import { ListConnectionsQuerySchema, type ListConnectionsOptions, type ListConnectionsPage } from "./schemas";
|
|
5
5
|
import type { GetVersionedImplementationId } from "../manifest/schemas";
|
|
6
6
|
import type { ManifestPluginProvides } from "../manifest";
|
|
7
|
-
import type {
|
|
7
|
+
import type { EventEmissionProvides } from "../eventEmission";
|
|
8
8
|
import type { CapabilitiesContext } from "../capabilities";
|
|
9
9
|
import type { ConnectionsPluginProvides } from "../connections";
|
|
10
10
|
export interface ListConnectionsPluginProvides {
|
|
@@ -19,8 +19,10 @@ export interface ListConnectionsPluginProvides {
|
|
|
19
19
|
};
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
-
export declare const listConnectionsPlugin: Plugin<
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
export declare const listConnectionsPlugin: Plugin<ManifestPluginProvides & {
|
|
23
|
+
context: {
|
|
24
|
+
api: ApiClient;
|
|
25
|
+
getVersionedImplementationId: GetVersionedImplementationId;
|
|
26
|
+
} & CapabilitiesContext & ConnectionsPluginProvides["context"];
|
|
27
|
+
} & EventEmissionProvides, ListConnectionsPluginProvides>;
|
|
26
28
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/listConnections/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/listConnections/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gDAAgD,CAAC;AACrF,OAAO,EACL,0BAA0B,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACzB,MAAM,WAAW,CAAC;AASnB,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAG1D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAQ9D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAEhE,MAAM,WAAW,6BAA6B;IAC5C,eAAe,EAAE,CACf,OAAO,CAAC,EAAE,sBAAsB,KAC7B,OAAO,CAAC,mBAAmB,CAAC,GAC/B,aAAa,CAAC,mBAAmB,CAAC,GAAG;QACnC,KAAK,IAAI,aAAa,CAAC,cAAc,CAAC,CAAC;KACxC,CAAC;IACJ,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,eAAe,EAAE;gBACf,WAAW,EAAE,OAAO,0BAA0B,CAAC;aAChD,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,qBAAqB,EAAE,MAAM,CACxC,sBAAsB,GAAG;IACvB,OAAO,EAAE;QACP,GAAG,EAAE,SAAS,CAAC;QACf,4BAA4B,EAAE,4BAA4B,CAAC;KAC5D,GAAG,mBAAmB,GACrB,yBAAyB,CAAC,SAAS,CAAC,CAAC;CACxC,GAAG,qBAAqB,EACzB,6BAA6B,CAgJ9B,CAAC"}
|
|
@@ -8,12 +8,12 @@ import { createTelemetryCallback } from "../../utils/telemetry-utils";
|
|
|
8
8
|
import { stripPageSuffix } from "../../utils/string-utils";
|
|
9
9
|
import { ZapierAuthenticationError, ZapierValidationError, } from "../../types/errors";
|
|
10
10
|
import { setMethodMetadata } from "../../utils/telemetry-context";
|
|
11
|
-
export const listConnectionsPlugin = (
|
|
11
|
+
export const listConnectionsPlugin = (sdk) => {
|
|
12
12
|
async function listConnectionsPage(options) {
|
|
13
13
|
if (options.includeShared) {
|
|
14
|
-
await context.checkCapability("canIncludeSharedConnections");
|
|
14
|
+
await sdk.context.checkCapability("canIncludeSharedConnections");
|
|
15
15
|
}
|
|
16
|
-
const { api, getVersionedImplementationId } = context;
|
|
16
|
+
const { api, getVersionedImplementationId } = sdk.context;
|
|
17
17
|
const searchParams = {};
|
|
18
18
|
if (options.pageSize !== undefined) {
|
|
19
19
|
searchParams.page_size = options.pageSize.toString();
|
|
@@ -42,7 +42,7 @@ export const listConnectionsPlugin = ({ context }) => {
|
|
|
42
42
|
if (connectionRefs && connectionRefs.length > 0) {
|
|
43
43
|
const resolvedIds = await Promise.all(connectionRefs.map((ref) => resolveConnectionId({
|
|
44
44
|
connection: ref,
|
|
45
|
-
resolveConnection: context.resolveConnection,
|
|
45
|
+
resolveConnection: sdk.context.resolveConnection,
|
|
46
46
|
})));
|
|
47
47
|
searchParams.connection_ids = resolvedIds
|
|
48
48
|
.filter((id) => id != null)
|
|
@@ -98,7 +98,7 @@ export const listConnectionsPlugin = ({ context }) => {
|
|
|
98
98
|
};
|
|
99
99
|
}
|
|
100
100
|
const methodName = stripPageSuffix(listConnectionsPage.name);
|
|
101
|
-
const listConnectionsDefinition = createPaginatedFunction(listConnectionsPage, ListConnectionsQuerySchema, createTelemetryCallback(context.eventEmission.emitMethodCalled, methodName), methodName, DEFAULT_PAGE_SIZE);
|
|
101
|
+
const listConnectionsDefinition = createPaginatedFunction(listConnectionsPage, ListConnectionsQuerySchema, createTelemetryCallback(sdk.context.eventEmission.emitMethodCalled, methodName), methodName, DEFAULT_PAGE_SIZE);
|
|
102
102
|
return {
|
|
103
103
|
listConnections: listConnectionsDefinition,
|
|
104
104
|
context: {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { Plugin
|
|
1
|
+
import type { Plugin } from "../../types/plugin";
|
|
2
2
|
import type { ApiClient } from "../../api";
|
|
3
3
|
import type { InputFieldChoiceItem } from "./schemas";
|
|
4
4
|
import { ListInputFieldChoicesSchema, type ListInputFieldChoicesOptions } from "./schemas";
|
|
5
5
|
import type { GetActionPluginProvides } from "../getAction";
|
|
6
6
|
import type { GetVersionedImplementationId } from "../manifest/schemas";
|
|
7
|
-
import type {
|
|
7
|
+
import type { EventEmissionProvides } from "../eventEmission";
|
|
8
8
|
import type { ConnectionsPluginProvides } from "../connections";
|
|
9
9
|
export interface ListInputFieldChoicesPluginProvides {
|
|
10
10
|
listInputFieldChoices: (options: ListInputFieldChoicesOptions) => Promise<{
|
|
@@ -24,10 +24,11 @@ export interface ListInputFieldChoicesPluginProvides {
|
|
|
24
24
|
};
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
-
export declare const listInputFieldChoicesPlugin: Plugin<
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
} &
|
|
27
|
+
export declare const listInputFieldChoicesPlugin: Plugin<GetActionPluginProvides & {
|
|
28
|
+
context: {
|
|
29
|
+
api: ApiClient;
|
|
30
|
+
getVersionedImplementationId: GetVersionedImplementationId;
|
|
31
|
+
} & ConnectionsPluginProvides["context"];
|
|
32
|
+
} & EventEmissionProvides, // requires getAction in SDK
|
|
33
|
+
ListInputFieldChoicesPluginProvides>;
|
|
33
34
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/listInputFieldChoices/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/listInputFieldChoices/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EACL,2BAA2B,EAE3B,KAAK,4BAA4B,EAGlC,MAAM,WAAW,CAAC;AAInB,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AAcxE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAiBhE,MAAM,WAAW,mCAAmC;IAClD,qBAAqB,EAAE,CAAC,OAAO,EAAE,4BAA4B,KAAK,OAAO,CAAC;QACxE,IAAI,EAAE,oBAAoB,EAAE,CAAC;QAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC,GACA,aAAa,CAAC;QAAE,IAAI,EAAE,oBAAoB,EAAE,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,GAAG;QACrE,KAAK,IAAI,aAAa,CAAC,oBAAoB,CAAC,CAAC;KAC9C,CAAC;IACJ,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,qBAAqB,EAAE;gBACrB,WAAW,EAAE,OAAO,2BAA2B,CAAC;aACjD,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,2BAA2B,EAAE,MAAM,CAC9C,uBAAuB,GAAG;IACxB,OAAO,EAAE;QACP,GAAG,EAAE,SAAS,CAAC;QACf,4BAA4B,EAAE,4BAA4B,CAAC;KAC5D,GAAG,yBAAyB,CAAC,SAAS,CAAC,CAAC;CAC1C,GAAG,qBAAqB,EAAE,4BAA4B;AACvD,mCAAmC,CAqKpC,CAAC"}
|
|
@@ -17,9 +17,9 @@ function transformNeedChoicesToInputFieldChoiceItem(choice) {
|
|
|
17
17
|
value: choice.value,
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
|
-
export const listInputFieldChoicesPlugin = (
|
|
20
|
+
export const listInputFieldChoicesPlugin = (sdk) => {
|
|
21
21
|
async function listInputFieldChoicesPage(options) {
|
|
22
|
-
const { api, getVersionedImplementationId } = context;
|
|
22
|
+
const { api, getVersionedImplementationId } = sdk.context;
|
|
23
23
|
const appKey = "app" in options ? options.app : options.appKey;
|
|
24
24
|
const actionKey = "action" in options ? options.action : options.actionKey;
|
|
25
25
|
const inputFieldKey = "inputField" in options ? options.inputField : options.inputFieldKey;
|
|
@@ -28,7 +28,7 @@ export const listInputFieldChoicesPlugin = ({ context, sdk }) => {
|
|
|
28
28
|
connection,
|
|
29
29
|
connectionId,
|
|
30
30
|
authenticationId,
|
|
31
|
-
resolveConnection: context.resolveConnection,
|
|
31
|
+
resolveConnection: sdk.context.resolveConnection,
|
|
32
32
|
});
|
|
33
33
|
// Get versioned implementation ID for the app
|
|
34
34
|
const selectedApi = await getVersionedImplementationId(appKey);
|
|
@@ -105,7 +105,7 @@ export const listInputFieldChoicesPlugin = ({ context, sdk }) => {
|
|
|
105
105
|
};
|
|
106
106
|
}
|
|
107
107
|
const methodName = stripPageSuffix(listInputFieldChoicesPage.name);
|
|
108
|
-
const listInputFieldChoicesDefinition = createPaginatedFunction(listInputFieldChoicesPage, ListInputFieldChoicesInputSchema, createTelemetryCallback(context.eventEmission.emitMethodCalled, methodName), methodName, DEFAULT_PAGE_SIZE);
|
|
108
|
+
const listInputFieldChoicesDefinition = createPaginatedFunction(listInputFieldChoicesPage, ListInputFieldChoicesInputSchema, createTelemetryCallback(sdk.context.eventEmission.emitMethodCalled, methodName), methodName, DEFAULT_PAGE_SIZE);
|
|
109
109
|
return {
|
|
110
110
|
listInputFieldChoices: listInputFieldChoicesDefinition,
|
|
111
111
|
context: {
|