@zapier/zapier-sdk 0.18.4 → 0.19.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 +35 -0
- package/README.md +43 -31
- package/dist/index.cjs +365 -64
- package/dist/index.d.mts +220 -33
- package/dist/index.d.ts +2541 -40
- package/dist/index.mjs +345 -63
- package/package.json +14 -13
- package/dist/api/auth.d.ts +0 -19
- package/dist/api/auth.d.ts.map +0 -1
- package/dist/api/auth.js +0 -70
- package/dist/api/auth.test.d.ts +0 -2
- package/dist/api/auth.test.d.ts.map +0 -1
- package/dist/api/auth.test.js +0 -220
- package/dist/api/client.d.ts +0 -9
- package/dist/api/client.d.ts.map +0 -1
- package/dist/api/client.js +0 -356
- package/dist/api/client.test.d.ts +0 -2
- package/dist/api/client.test.d.ts.map +0 -1
- package/dist/api/client.test.js +0 -96
- package/dist/api/debug.d.ts +0 -14
- package/dist/api/debug.d.ts.map +0 -1
- package/dist/api/debug.js +0 -131
- package/dist/api/debug.test.d.ts +0 -2
- package/dist/api/debug.test.d.ts.map +0 -1
- package/dist/api/debug.test.js +0 -59
- package/dist/api/index.d.ts +0 -30
- package/dist/api/index.d.ts.map +0 -1
- package/dist/api/index.js +0 -43
- package/dist/api/polling.d.ts +0 -46
- package/dist/api/polling.d.ts.map +0 -1
- package/dist/api/polling.js +0 -139
- package/dist/api/polling.test.d.ts +0 -2
- package/dist/api/polling.test.d.ts.map +0 -1
- package/dist/api/polling.test.js +0 -318
- package/dist/api/schemas.d.ts +0 -422
- package/dist/api/schemas.d.ts.map +0 -1
- package/dist/api/schemas.js +0 -322
- package/dist/api/types.d.ts +0 -83
- package/dist/api/types.d.ts.map +0 -1
- package/dist/api/types.js +0 -1
- package/dist/auth.d.ts +0 -52
- package/dist/auth.d.ts.map +0 -1
- package/dist/auth.js +0 -72
- package/dist/auth.test.d.ts +0 -2
- package/dist/auth.test.d.ts.map +0 -1
- package/dist/auth.test.js +0 -102
- package/dist/constants.d.ts +0 -14
- package/dist/constants.d.ts.map +0 -1
- package/dist/constants.js +0 -13
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -42
- package/dist/plugins/api/index.d.ts +0 -12
- package/dist/plugins/api/index.d.ts.map +0 -1
- package/dist/plugins/api/index.js +0 -24
- package/dist/plugins/apps/index.d.ts +0 -15
- package/dist/plugins/apps/index.d.ts.map +0 -1
- package/dist/plugins/apps/index.js +0 -112
- package/dist/plugins/apps/schemas.d.ts +0 -42
- package/dist/plugins/apps/schemas.d.ts.map +0 -1
- package/dist/plugins/apps/schemas.js +0 -14
- package/dist/plugins/eventEmission/builders.d.ts +0 -14
- package/dist/plugins/eventEmission/builders.d.ts.map +0 -1
- package/dist/plugins/eventEmission/builders.js +0 -109
- package/dist/plugins/eventEmission/index.d.ts +0 -38
- package/dist/plugins/eventEmission/index.d.ts.map +0 -1
- package/dist/plugins/eventEmission/index.js +0 -336
- package/dist/plugins/eventEmission/index.test.d.ts +0 -5
- package/dist/plugins/eventEmission/index.test.d.ts.map +0 -1
- package/dist/plugins/eventEmission/index.test.js +0 -581
- package/dist/plugins/eventEmission/transport.d.ts +0 -27
- package/dist/plugins/eventEmission/transport.d.ts.map +0 -1
- package/dist/plugins/eventEmission/transport.js +0 -104
- package/dist/plugins/eventEmission/transport.test.d.ts +0 -5
- package/dist/plugins/eventEmission/transport.test.d.ts.map +0 -1
- package/dist/plugins/eventEmission/transport.test.js +0 -164
- package/dist/plugins/eventEmission/types.d.ts +0 -63
- package/dist/plugins/eventEmission/types.d.ts.map +0 -1
- package/dist/plugins/eventEmission/types.js +0 -1
- package/dist/plugins/eventEmission/utils.d.ts +0 -45
- package/dist/plugins/eventEmission/utils.d.ts.map +0 -1
- package/dist/plugins/eventEmission/utils.js +0 -114
- package/dist/plugins/fetch/index.d.ts +0 -36
- package/dist/plugins/fetch/index.d.ts.map +0 -1
- package/dist/plugins/fetch/index.js +0 -62
- package/dist/plugins/fetch/schemas.d.ts +0 -19
- package/dist/plugins/fetch/schemas.d.ts.map +0 -1
- package/dist/plugins/fetch/schemas.js +0 -31
- package/dist/plugins/findFirstAuthentication/index.d.ts +0 -21
- package/dist/plugins/findFirstAuthentication/index.d.ts.map +0 -1
- package/dist/plugins/findFirstAuthentication/index.js +0 -36
- package/dist/plugins/findFirstAuthentication/index.test.d.ts +0 -2
- package/dist/plugins/findFirstAuthentication/index.test.d.ts.map +0 -1
- package/dist/plugins/findFirstAuthentication/index.test.js +0 -177
- package/dist/plugins/findFirstAuthentication/schemas.d.ts +0 -20
- package/dist/plugins/findFirstAuthentication/schemas.d.ts.map +0 -1
- package/dist/plugins/findFirstAuthentication/schemas.js +0 -18
- package/dist/plugins/findUniqueAuthentication/index.d.ts +0 -21
- package/dist/plugins/findUniqueAuthentication/index.d.ts.map +0 -1
- package/dist/plugins/findUniqueAuthentication/index.js +0 -39
- package/dist/plugins/findUniqueAuthentication/index.test.d.ts +0 -2
- package/dist/plugins/findUniqueAuthentication/index.test.d.ts.map +0 -1
- package/dist/plugins/findUniqueAuthentication/index.test.js +0 -159
- package/dist/plugins/findUniqueAuthentication/schemas.d.ts +0 -20
- package/dist/plugins/findUniqueAuthentication/schemas.d.ts.map +0 -1
- package/dist/plugins/findUniqueAuthentication/schemas.js +0 -18
- package/dist/plugins/getAction/index.d.ts +0 -25
- package/dist/plugins/getAction/index.d.ts.map +0 -1
- package/dist/plugins/getAction/index.js +0 -42
- package/dist/plugins/getAction/index.test.d.ts +0 -2
- package/dist/plugins/getAction/index.test.d.ts.map +0 -1
- package/dist/plugins/getAction/index.test.js +0 -211
- package/dist/plugins/getAction/schemas.d.ts +0 -30
- package/dist/plugins/getAction/schemas.d.ts.map +0 -1
- package/dist/plugins/getAction/schemas.js +0 -12
- package/dist/plugins/getApp/index.d.ts +0 -21
- package/dist/plugins/getApp/index.d.ts.map +0 -1
- package/dist/plugins/getApp/index.js +0 -44
- package/dist/plugins/getApp/index.test.d.ts +0 -2
- package/dist/plugins/getApp/index.test.d.ts.map +0 -1
- package/dist/plugins/getApp/index.test.js +0 -157
- package/dist/plugins/getApp/schemas.d.ts +0 -16
- package/dist/plugins/getApp/schemas.d.ts.map +0 -1
- package/dist/plugins/getApp/schemas.js +0 -8
- package/dist/plugins/getAuthentication/index.d.ts +0 -21
- package/dist/plugins/getAuthentication/index.d.ts.map +0 -1
- package/dist/plugins/getAuthentication/index.js +0 -29
- package/dist/plugins/getAuthentication/index.test.d.ts +0 -2
- package/dist/plugins/getAuthentication/index.test.d.ts.map +0 -1
- package/dist/plugins/getAuthentication/index.test.js +0 -106
- package/dist/plugins/getAuthentication/schemas.d.ts +0 -7
- package/dist/plugins/getAuthentication/schemas.d.ts.map +0 -1
- package/dist/plugins/getAuthentication/schemas.js +0 -1
- package/dist/plugins/getInputFieldsSchema/index.d.ts +0 -23
- package/dist/plugins/getInputFieldsSchema/index.d.ts.map +0 -1
- package/dist/plugins/getInputFieldsSchema/index.js +0 -53
- package/dist/plugins/getInputFieldsSchema/index.test.d.ts +0 -2
- package/dist/plugins/getInputFieldsSchema/index.test.d.ts.map +0 -1
- package/dist/plugins/getInputFieldsSchema/index.test.js +0 -291
- package/dist/plugins/getInputFieldsSchema/schemas.d.ts +0 -28
- package/dist/plugins/getInputFieldsSchema/schemas.d.ts.map +0 -1
- package/dist/plugins/getInputFieldsSchema/schemas.js +0 -13
- package/dist/plugins/getProfile/index.d.ts +0 -25
- package/dist/plugins/getProfile/index.d.ts.map +0 -1
- package/dist/plugins/getProfile/index.js +0 -39
- package/dist/plugins/getProfile/schemas.d.ts +0 -13
- package/dist/plugins/getProfile/schemas.d.ts.map +0 -1
- package/dist/plugins/getProfile/schemas.js +0 -6
- package/dist/plugins/listActions/index.d.ts +0 -30
- package/dist/plugins/listActions/index.d.ts.map +0 -1
- package/dist/plugins/listActions/index.js +0 -75
- package/dist/plugins/listActions/index.test.d.ts +0 -2
- package/dist/plugins/listActions/index.test.d.ts.map +0 -1
- package/dist/plugins/listActions/index.test.js +0 -453
- package/dist/plugins/listActions/schemas.d.ts +0 -35
- package/dist/plugins/listActions/schemas.d.ts.map +0 -1
- package/dist/plugins/listActions/schemas.js +0 -22
- package/dist/plugins/listApps/index.d.ts +0 -19
- package/dist/plugins/listApps/index.d.ts.map +0 -1
- package/dist/plugins/listApps/index.js +0 -67
- package/dist/plugins/listApps/index.test.d.ts +0 -2
- package/dist/plugins/listApps/index.test.d.ts.map +0 -1
- package/dist/plugins/listApps/index.test.js +0 -121
- package/dist/plugins/listApps/schemas.d.ts +0 -47
- package/dist/plugins/listApps/schemas.d.ts.map +0 -1
- package/dist/plugins/listApps/schemas.js +0 -49
- package/dist/plugins/listAuthentications/index.d.ts +0 -24
- package/dist/plugins/listAuthentications/index.d.ts.map +0 -1
- package/dist/plugins/listAuthentications/index.js +0 -77
- package/dist/plugins/listAuthentications/index.test.d.ts +0 -2
- package/dist/plugins/listAuthentications/index.test.d.ts.map +0 -1
- package/dist/plugins/listAuthentications/index.test.js +0 -848
- package/dist/plugins/listAuthentications/schemas.d.ts +0 -30
- package/dist/plugins/listAuthentications/schemas.d.ts.map +0 -1
- package/dist/plugins/listAuthentications/schemas.js +0 -32
- package/dist/plugins/listInputFieldChoices/index.d.ts +0 -33
- package/dist/plugins/listInputFieldChoices/index.d.ts.map +0 -1
- package/dist/plugins/listInputFieldChoices/index.js +0 -115
- package/dist/plugins/listInputFieldChoices/index.test.d.ts +0 -2
- package/dist/plugins/listInputFieldChoices/index.test.d.ts.map +0 -1
- package/dist/plugins/listInputFieldChoices/index.test.js +0 -717
- package/dist/plugins/listInputFieldChoices/schemas.d.ts +0 -43
- package/dist/plugins/listInputFieldChoices/schemas.d.ts.map +0 -1
- package/dist/plugins/listInputFieldChoices/schemas.js +0 -65
- package/dist/plugins/listInputFields/index.d.ts +0 -34
- package/dist/plugins/listInputFields/index.d.ts.map +0 -1
- package/dist/plugins/listInputFields/index.js +0 -204
- package/dist/plugins/listInputFields/index.test.d.ts +0 -2
- package/dist/plugins/listInputFields/index.test.d.ts.map +0 -1
- package/dist/plugins/listInputFields/index.test.js +0 -359
- package/dist/plugins/listInputFields/schemas.d.ts +0 -35
- package/dist/plugins/listInputFields/schemas.d.ts.map +0 -1
- package/dist/plugins/listInputFields/schemas.js +0 -23
- package/dist/plugins/manifest/index.d.ts +0 -85
- package/dist/plugins/manifest/index.d.ts.map +0 -1
- package/dist/plugins/manifest/index.js +0 -376
- package/dist/plugins/manifest/index.test.d.ts +0 -2
- package/dist/plugins/manifest/index.test.d.ts.map +0 -1
- package/dist/plugins/manifest/index.test.js +0 -1139
- package/dist/plugins/manifest/schemas.d.ts +0 -57
- package/dist/plugins/manifest/schemas.d.ts.map +0 -1
- package/dist/plugins/manifest/schemas.js +0 -50
- package/dist/plugins/registry/index.d.ts +0 -21
- package/dist/plugins/registry/index.d.ts.map +0 -1
- package/dist/plugins/registry/index.js +0 -117
- package/dist/plugins/request/index.d.ts +0 -21
- package/dist/plugins/request/index.d.ts.map +0 -1
- package/dist/plugins/request/index.js +0 -76
- package/dist/plugins/request/index.test.d.ts +0 -2
- package/dist/plugins/request/index.test.d.ts.map +0 -1
- package/dist/plugins/request/index.test.js +0 -337
- package/dist/plugins/request/schemas.d.ts +0 -54
- package/dist/plugins/request/schemas.d.ts.map +0 -1
- package/dist/plugins/request/schemas.js +0 -41
- package/dist/plugins/runAction/index.d.ts +0 -33
- package/dist/plugins/runAction/index.d.ts.map +0 -1
- package/dist/plugins/runAction/index.js +0 -108
- package/dist/plugins/runAction/index.test.d.ts +0 -2
- package/dist/plugins/runAction/index.test.d.ts.map +0 -1
- package/dist/plugins/runAction/index.test.js +0 -333
- package/dist/plugins/runAction/schemas.d.ts +0 -34
- package/dist/plugins/runAction/schemas.d.ts.map +0 -1
- package/dist/plugins/runAction/schemas.js +0 -23
- package/dist/resolvers/actionKey.d.ts +0 -15
- package/dist/resolvers/actionKey.d.ts.map +0 -1
- package/dist/resolvers/actionKey.js +0 -19
- package/dist/resolvers/actionType.d.ts +0 -10
- package/dist/resolvers/actionType.d.ts.map +0 -1
- package/dist/resolvers/actionType.js +0 -21
- package/dist/resolvers/appKey.d.ts +0 -3
- package/dist/resolvers/appKey.d.ts.map +0 -1
- package/dist/resolvers/appKey.js +0 -5
- package/dist/resolvers/authenticationId.d.ts +0 -9
- package/dist/resolvers/authenticationId.d.ts.map +0 -1
- package/dist/resolvers/authenticationId.js +0 -42
- package/dist/resolvers/index.d.ts +0 -8
- package/dist/resolvers/index.d.ts.map +0 -1
- package/dist/resolvers/index.js +0 -8
- package/dist/resolvers/inputFieldKey.d.ts +0 -11
- package/dist/resolvers/inputFieldKey.d.ts.map +0 -1
- package/dist/resolvers/inputFieldKey.js +0 -47
- package/dist/resolvers/inputs.d.ts +0 -17
- package/dist/resolvers/inputs.d.ts.map +0 -1
- package/dist/resolvers/inputs.js +0 -50
- package/dist/schemas/Action.d.ts +0 -24
- package/dist/schemas/Action.d.ts.map +0 -1
- package/dist/schemas/Action.js +0 -40
- package/dist/schemas/App.d.ts +0 -57
- package/dist/schemas/App.d.ts.map +0 -1
- package/dist/schemas/App.js +0 -26
- package/dist/schemas/Auth.d.ts +0 -55
- package/dist/schemas/Auth.d.ts.map +0 -1
- package/dist/schemas/Auth.js +0 -33
- package/dist/schemas/Field.d.ts +0 -61
- package/dist/schemas/Field.d.ts.map +0 -1
- package/dist/schemas/Field.js +0 -116
- package/dist/schemas/Run.d.ts +0 -3
- package/dist/schemas/Run.d.ts.map +0 -1
- package/dist/schemas/Run.js +0 -31
- package/dist/schemas/UserProfile.d.ts +0 -13
- package/dist/schemas/UserProfile.d.ts.map +0 -1
- package/dist/schemas/UserProfile.js +0 -32
- package/dist/sdk.d.ts +0 -146
- package/dist/sdk.d.ts.map +0 -1
- package/dist/sdk.js +0 -112
- package/dist/sdk.test.d.ts +0 -2
- package/dist/sdk.test.d.ts.map +0 -1
- package/dist/sdk.test.js +0 -258
- package/dist/services/implementations.d.ts +0 -63
- package/dist/services/implementations.d.ts.map +0 -1
- package/dist/services/implementations.js +0 -80
- package/dist/types/domain.d.ts +0 -52
- package/dist/types/domain.d.ts.map +0 -1
- package/dist/types/domain.js +0 -1
- package/dist/types/domain.test.d.ts +0 -2
- package/dist/types/domain.test.d.ts.map +0 -1
- package/dist/types/domain.test.js +0 -39
- package/dist/types/errors.d.ts +0 -143
- package/dist/types/errors.d.ts.map +0 -1
- package/dist/types/errors.js +0 -187
- package/dist/types/events.d.ts +0 -38
- package/dist/types/events.d.ts.map +0 -1
- package/dist/types/events.js +0 -7
- package/dist/types/functions.d.ts +0 -27
- package/dist/types/functions.d.ts.map +0 -1
- package/dist/types/functions.js +0 -1
- package/dist/types/plugin.d.ts +0 -75
- package/dist/types/plugin.d.ts.map +0 -1
- package/dist/types/plugin.js +0 -9
- package/dist/types/properties.d.ts +0 -33
- package/dist/types/properties.d.ts.map +0 -1
- package/dist/types/properties.js +0 -52
- package/dist/types/sdk.d.ts +0 -69
- package/dist/types/sdk.d.ts.map +0 -1
- package/dist/types/sdk.js +0 -4
- package/dist/types/telemetry-events.d.ts +0 -105
- package/dist/types/telemetry-events.d.ts.map +0 -1
- package/dist/types/telemetry-events.js +0 -8
- package/dist/utils/array-utils.d.ts +0 -31
- package/dist/utils/array-utils.d.ts.map +0 -1
- package/dist/utils/array-utils.js +0 -36
- package/dist/utils/array-utils.test.d.ts +0 -2
- package/dist/utils/array-utils.test.d.ts.map +0 -1
- package/dist/utils/array-utils.test.js +0 -107
- package/dist/utils/batch-utils.d.ts +0 -72
- package/dist/utils/batch-utils.d.ts.map +0 -1
- package/dist/utils/batch-utils.js +0 -162
- package/dist/utils/batch-utils.test.d.ts +0 -2
- package/dist/utils/batch-utils.test.d.ts.map +0 -1
- package/dist/utils/batch-utils.test.js +0 -476
- package/dist/utils/domain-utils.d.ts +0 -66
- package/dist/utils/domain-utils.d.ts.map +0 -1
- package/dist/utils/domain-utils.js +0 -164
- package/dist/utils/domain-utils.test.d.ts +0 -2
- package/dist/utils/domain-utils.test.d.ts.map +0 -1
- package/dist/utils/domain-utils.test.js +0 -346
- package/dist/utils/file-utils.d.ts +0 -4
- package/dist/utils/file-utils.d.ts.map +0 -1
- package/dist/utils/file-utils.js +0 -74
- package/dist/utils/file-utils.test.d.ts +0 -2
- package/dist/utils/file-utils.test.d.ts.map +0 -1
- package/dist/utils/file-utils.test.js +0 -51
- package/dist/utils/function-utils.d.ts +0 -73
- package/dist/utils/function-utils.d.ts.map +0 -1
- package/dist/utils/function-utils.js +0 -245
- package/dist/utils/function-utils.test.d.ts +0 -2
- package/dist/utils/function-utils.test.d.ts.map +0 -1
- package/dist/utils/function-utils.test.js +0 -110
- package/dist/utils/id-utils.d.ts +0 -13
- package/dist/utils/id-utils.d.ts.map +0 -1
- package/dist/utils/id-utils.js +0 -22
- package/dist/utils/id-utils.test.d.ts +0 -2
- package/dist/utils/id-utils.test.d.ts.map +0 -1
- package/dist/utils/id-utils.test.js +0 -22
- package/dist/utils/pagination-utils.d.ts +0 -37
- package/dist/utils/pagination-utils.d.ts.map +0 -1
- package/dist/utils/pagination-utils.js +0 -165
- package/dist/utils/pagination-utils.test.d.ts +0 -17
- package/dist/utils/pagination-utils.test.d.ts.map +0 -1
- package/dist/utils/pagination-utils.test.js +0 -461
- package/dist/utils/retry-utils.d.ts +0 -45
- package/dist/utils/retry-utils.d.ts.map +0 -1
- package/dist/utils/retry-utils.js +0 -51
- package/dist/utils/retry-utils.test.d.ts +0 -2
- package/dist/utils/retry-utils.test.d.ts.map +0 -1
- package/dist/utils/retry-utils.test.js +0 -90
- package/dist/utils/schema-utils.d.ts +0 -69
- package/dist/utils/schema-utils.d.ts.map +0 -1
- package/dist/utils/schema-utils.js +0 -72
- package/dist/utils/string-utils.d.ts +0 -40
- package/dist/utils/string-utils.d.ts.map +0 -1
- package/dist/utils/string-utils.js +0 -69
- package/dist/utils/string-utils.test.d.ts +0 -2
- package/dist/utils/string-utils.test.d.ts.map +0 -1
- package/dist/utils/string-utils.test.js +0 -59
- package/dist/utils/telemetry-utils.d.ts +0 -44
- package/dist/utils/telemetry-utils.d.ts.map +0 -1
- package/dist/utils/telemetry-utils.js +0 -55
- package/dist/utils/telemetry-utils.test.d.ts +0 -2
- package/dist/utils/telemetry-utils.test.d.ts.map +0 -1
- package/dist/utils/telemetry-utils.test.js +0 -94
- package/dist/utils/url-utils.d.ts +0 -19
- package/dist/utils/url-utils.d.ts.map +0 -1
- package/dist/utils/url-utils.js +0 -62
- package/dist/utils/url-utils.test.d.ts +0 -2
- package/dist/utils/url-utils.test.d.ts.map +0 -1
- package/dist/utils/url-utils.test.js +0 -103
- package/dist/utils/validation.d.ts +0 -4
- package/dist/utils/validation.d.ts.map +0 -1
- package/dist/utils/validation.js +0 -30
- package/dist/utils/validation.test.d.ts +0 -2
- package/dist/utils/validation.test.d.ts.map +0 -1
- package/dist/utils/validation.test.js +0 -44
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { createPaginatedFunction } from "../../utils/function-utils";
|
|
2
|
-
import { ListAppsSchema, } from "./schemas";
|
|
3
|
-
import { AppItemSchema } from "../../schemas/App";
|
|
4
|
-
import { createTelemetryCallback } from "../../utils/telemetry-utils";
|
|
5
|
-
import { stripPageSuffix } from "../../utils/string-utils";
|
|
6
|
-
export const listAppsPlugin = ({ context }) => {
|
|
7
|
-
async function listAppsPage(options) {
|
|
8
|
-
const { api, resolveAppKeys } = context;
|
|
9
|
-
const appKeys = options.appKeys ?? [];
|
|
10
|
-
const appLocators = await resolveAppKeys({
|
|
11
|
-
appKeys: [...appKeys],
|
|
12
|
-
});
|
|
13
|
-
const implementationNameToLocator = {};
|
|
14
|
-
for (const locator of appLocators) {
|
|
15
|
-
implementationNameToLocator[locator.implementationName] = [
|
|
16
|
-
...(implementationNameToLocator[locator.implementationName] ?? []),
|
|
17
|
-
locator,
|
|
18
|
-
];
|
|
19
|
-
}
|
|
20
|
-
const duplicatedLookupAppKeys = Object.keys(implementationNameToLocator)
|
|
21
|
-
.filter((key) => implementationNameToLocator[key].length > 1)
|
|
22
|
-
.map((key) => implementationNameToLocator[key])
|
|
23
|
-
.flat()
|
|
24
|
-
.map((locator) => locator.lookupAppKey);
|
|
25
|
-
if (duplicatedLookupAppKeys.length > 0) {
|
|
26
|
-
throw new Error(`Duplicate lookup app keys found: ${duplicatedLookupAppKeys.join(", ")}`);
|
|
27
|
-
}
|
|
28
|
-
// Step 2: Early return if user provided appKeys but they resolved to nothing AND no search
|
|
29
|
-
// This prevents the handler from returning all apps when the user explicitly filtered
|
|
30
|
-
// If search is provided, let the handler augment with search results
|
|
31
|
-
if (appKeys.length > 0 && appLocators.length === 0 && !options.search) {
|
|
32
|
-
return {
|
|
33
|
-
data: [],
|
|
34
|
-
links: { next: null },
|
|
35
|
-
meta: { count: 0, limit: 0, offset: 0 },
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
const implementationIds = appLocators.map((locator) => {
|
|
39
|
-
const version = locator.version || "latest";
|
|
40
|
-
return `${locator.implementationName}@${version}`;
|
|
41
|
-
});
|
|
42
|
-
return await api.get("/api/v0/apps", {
|
|
43
|
-
searchParams: {
|
|
44
|
-
appKeys: implementationIds.join(","),
|
|
45
|
-
...(options.search && { search: options.search }),
|
|
46
|
-
pageSize: options.pageSize.toString(),
|
|
47
|
-
...(options.cursor && { offset: options.cursor }),
|
|
48
|
-
},
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
const methodName = stripPageSuffix(listAppsPage.name);
|
|
52
|
-
const listAppsDefinition = createPaginatedFunction(listAppsPage, ListAppsSchema, createTelemetryCallback(context.eventEmission.emitMethodCalled, methodName), methodName);
|
|
53
|
-
return {
|
|
54
|
-
listApps: listAppsDefinition,
|
|
55
|
-
context: {
|
|
56
|
-
meta: {
|
|
57
|
-
listApps: {
|
|
58
|
-
categories: ["app"],
|
|
59
|
-
type: "list",
|
|
60
|
-
itemType: "App",
|
|
61
|
-
inputSchema: ListAppsSchema,
|
|
62
|
-
outputSchema: AppItemSchema,
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
};
|
|
67
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../../src/plugins/listApps/index.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, vi, beforeEach } from "vitest";
|
|
2
|
-
import { ZapierValidationError } from "../../types/errors";
|
|
3
|
-
import { listAppsPlugin } from "./index";
|
|
4
|
-
import { createSdk } from "../../sdk";
|
|
5
|
-
import { eventEmissionPlugin } from "../eventEmission";
|
|
6
|
-
// Mock transport for testing - prevents real HTTP telemetry requests
|
|
7
|
-
const mockTransport = {
|
|
8
|
-
emit: vi.fn().mockResolvedValue(undefined),
|
|
9
|
-
close: vi.fn().mockResolvedValue(undefined),
|
|
10
|
-
};
|
|
11
|
-
vi.mock("../eventEmission/transport", () => ({
|
|
12
|
-
createTransport: vi.fn(() => mockTransport),
|
|
13
|
-
}));
|
|
14
|
-
// Mock CLI login package - prevents real token resolution requests
|
|
15
|
-
vi.mock("@zapier/zapier-sdk-cli-login", () => ({
|
|
16
|
-
getToken: vi.fn().mockResolvedValue(undefined),
|
|
17
|
-
}));
|
|
18
|
-
const mockResolveAppKeys = vi
|
|
19
|
-
.fn()
|
|
20
|
-
.mockImplementation(async ({ appKeys }) => {
|
|
21
|
-
return appKeys.map((appKey) => ({
|
|
22
|
-
lookupAppKey: appKey,
|
|
23
|
-
implementationName: appKey,
|
|
24
|
-
slug: appKey.toLowerCase(),
|
|
25
|
-
version: undefined,
|
|
26
|
-
}));
|
|
27
|
-
});
|
|
28
|
-
describe("listApps plugin", () => {
|
|
29
|
-
let mockApiClient;
|
|
30
|
-
beforeEach(() => {
|
|
31
|
-
vi.clearAllMocks();
|
|
32
|
-
mockApiClient = {
|
|
33
|
-
get: vi.fn().mockResolvedValue({
|
|
34
|
-
data: [
|
|
35
|
-
{
|
|
36
|
-
title: "Slack",
|
|
37
|
-
key: "SlackCLIAPI",
|
|
38
|
-
implementation_id: "SlackCLIAPI@1.0.0",
|
|
39
|
-
version: "1.0.0",
|
|
40
|
-
slug: "slack",
|
|
41
|
-
description: "Team communication",
|
|
42
|
-
primary_color: "#4A154B",
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
title: "Google Sheets",
|
|
46
|
-
key: "GoogleSheetsCLIAPI",
|
|
47
|
-
implementation_id: "GoogleSheetsCLIAPI@1.0.0",
|
|
48
|
-
version: "1.0.0",
|
|
49
|
-
slug: "google-sheets",
|
|
50
|
-
description: "Online spreadsheets",
|
|
51
|
-
primary_color: "#34A853",
|
|
52
|
-
},
|
|
53
|
-
],
|
|
54
|
-
links: { next: null },
|
|
55
|
-
meta: { count: 2, limit: 100, offset: 0 },
|
|
56
|
-
}),
|
|
57
|
-
};
|
|
58
|
-
});
|
|
59
|
-
const apiPlugin = () => ({
|
|
60
|
-
context: {
|
|
61
|
-
api: mockApiClient,
|
|
62
|
-
},
|
|
63
|
-
});
|
|
64
|
-
function createTestSdk() {
|
|
65
|
-
return createSdk()
|
|
66
|
-
.addPlugin(() => ({
|
|
67
|
-
context: {
|
|
68
|
-
options: {},
|
|
69
|
-
},
|
|
70
|
-
}))
|
|
71
|
-
.addPlugin(apiPlugin)
|
|
72
|
-
.addPlugin(eventEmissionPlugin)
|
|
73
|
-
.addPlugin(() => ({
|
|
74
|
-
context: {
|
|
75
|
-
resolveAppKeys: mockResolveAppKeys,
|
|
76
|
-
},
|
|
77
|
-
}))
|
|
78
|
-
.addPlugin(listAppsPlugin);
|
|
79
|
-
}
|
|
80
|
-
describe("basic functionality", () => {
|
|
81
|
-
it("should provide listApps method that returns apps", async () => {
|
|
82
|
-
const sdk = createTestSdk();
|
|
83
|
-
const result = await sdk.listApps({ pageSize: 2 });
|
|
84
|
-
// Just verify the structure - handler tests verify correct data
|
|
85
|
-
expect(result.data.length).toBeGreaterThan(0);
|
|
86
|
-
expect(result.data[0]).toHaveProperty("title");
|
|
87
|
-
expect(result.data[0]).toHaveProperty("key");
|
|
88
|
-
expect(result.data[0]).toHaveProperty("implementation_id");
|
|
89
|
-
expect(result.data[0]).toHaveProperty("version");
|
|
90
|
-
});
|
|
91
|
-
});
|
|
92
|
-
describe("plugin integration", () => {
|
|
93
|
-
it("should provide metadata in context for CLI introspection", () => {
|
|
94
|
-
const sdk = createTestSdk();
|
|
95
|
-
const context = sdk.getContext();
|
|
96
|
-
expect(context.meta.listApps).toBeDefined();
|
|
97
|
-
expect(context.meta.listApps.inputSchema).toBeDefined();
|
|
98
|
-
});
|
|
99
|
-
it("should integrate with resolveAppKeys", async () => {
|
|
100
|
-
const sdk = createTestSdk();
|
|
101
|
-
await sdk.listApps({ appKeys: ["SlackCLIAPI"] });
|
|
102
|
-
// Verify resolveAppKeys was called with the provided appKeys
|
|
103
|
-
expect(mockResolveAppKeys).toHaveBeenCalledWith(expect.objectContaining({
|
|
104
|
-
appKeys: ["SlackCLIAPI"],
|
|
105
|
-
}));
|
|
106
|
-
});
|
|
107
|
-
});
|
|
108
|
-
describe("validation", () => {
|
|
109
|
-
it("should throw validation error for invalid input", () => {
|
|
110
|
-
const sdk = createTestSdk();
|
|
111
|
-
// Invalid pageSize
|
|
112
|
-
expect(() => {
|
|
113
|
-
sdk.listApps({ pageSize: 0 });
|
|
114
|
-
}).toThrow(ZapierValidationError);
|
|
115
|
-
// Invalid appKeys type
|
|
116
|
-
expect(() => {
|
|
117
|
-
sdk.listApps({ appKeys: 123 });
|
|
118
|
-
}).toThrow(ZapierValidationError);
|
|
119
|
-
});
|
|
120
|
-
});
|
|
121
|
-
});
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Plugin schemas for listApps
|
|
3
|
-
*
|
|
4
|
-
* Imports base query schema from @zapier/zapier-sdk-core (sdkapi) and extends
|
|
5
|
-
* with SDK-specific options.
|
|
6
|
-
*
|
|
7
|
-
* Note: The sdkapi endpoint uses ListAppsQuerySchema (HTTP query params),
|
|
8
|
-
* but the SDK exposes ListAppsSchema (user-friendly options):
|
|
9
|
-
* - ListAppsOptions accepts `appKeys` as array, `cursor`, `maxItems`
|
|
10
|
-
* - ListAppsQuery accepts `appKeys` as comma-separated string, `offset`
|
|
11
|
-
* - The plugin transforms between these formats
|
|
12
|
-
*/
|
|
13
|
-
import { z } from "zod";
|
|
14
|
-
import type { PaginatedSdkFunction } from "../../types/functions";
|
|
15
|
-
import type { ZapierApiError, ZapierValidationError } from "../../types/errors";
|
|
16
|
-
import { AppItemSchema as AppItemSchemaBase, ListAppsResponseSchema as ListAppsResponseSchemaBase, type AppItem, type ListAppsResponse } from "@zapier/zapier-sdk-core/v0/schemas/apps";
|
|
17
|
-
export { AppItemSchemaBase as AppItemSchema };
|
|
18
|
-
export { ListAppsResponseSchemaBase as ListAppsResponseSchema };
|
|
19
|
-
export type { AppItem, ListAppsResponse };
|
|
20
|
-
/**
|
|
21
|
-
* SDK user-facing options for listApps
|
|
22
|
-
*
|
|
23
|
-
* Extends ListAppsQuerySchema from zapier-sdk-core with SDK-specific options:
|
|
24
|
-
* - appKeys: array (not comma-separated string)
|
|
25
|
-
* - cursor: pagination cursor (not offset)
|
|
26
|
-
* - maxItems: SDK-specific pagination limit
|
|
27
|
-
*/
|
|
28
|
-
export declare const ListAppsSchema: z.ZodObject<{
|
|
29
|
-
search: z.ZodOptional<z.ZodString>;
|
|
30
|
-
appKeys: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
31
|
-
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
32
|
-
maxItems: z.ZodOptional<z.ZodNumber>;
|
|
33
|
-
cursor: z.ZodOptional<z.ZodString>;
|
|
34
|
-
_telemetry: z.ZodOptional<z.ZodObject<{
|
|
35
|
-
isNested: z.ZodOptional<z.ZodBoolean>;
|
|
36
|
-
}, z.core.$strip>>;
|
|
37
|
-
}, z.core.$strip>;
|
|
38
|
-
export type ListAppsOptions = z.infer<typeof ListAppsSchema>;
|
|
39
|
-
export interface ListAppsPage {
|
|
40
|
-
data: AppItem[];
|
|
41
|
-
nextCursor?: string;
|
|
42
|
-
}
|
|
43
|
-
export type ListAppsError = ZapierApiError | ZapierValidationError;
|
|
44
|
-
export interface ListAppsSdkFunction {
|
|
45
|
-
listApps: PaginatedSdkFunction<ListAppsOptions | undefined, AppItem>;
|
|
46
|
-
}
|
|
47
|
-
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/listApps/schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,KAAK,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAIhF,OAAO,EACL,aAAa,IAAI,iBAAiB,EAClC,sBAAsB,IAAI,0BAA0B,EAEpD,KAAK,OAAO,EACZ,KAAK,gBAAgB,EACtB,MAAM,yCAAyC,CAAC;AAGjD,OAAO,EAAE,iBAAiB,IAAI,aAAa,EAAE,CAAC;AAC9C,OAAO,EAAE,0BAA0B,IAAI,sBAAsB,EAAE,CAAC;AAChE,YAAY,EAAE,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAE1C;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc;;;;;;;;;iBAuBmC,CAAC;AAE/D,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAG7D,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,OAAO,EAAE,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAGD,MAAM,MAAM,aAAa,GAAG,cAAc,GAAG,qBAAqB,CAAC;AAGnE,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,oBAAoB,CAAC,eAAe,GAAG,SAAS,EAAE,OAAO,CAAC,CAAC;CACtE"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Plugin schemas for listApps
|
|
3
|
-
*
|
|
4
|
-
* Imports base query schema from @zapier/zapier-sdk-core (sdkapi) and extends
|
|
5
|
-
* with SDK-specific options.
|
|
6
|
-
*
|
|
7
|
-
* Note: The sdkapi endpoint uses ListAppsQuerySchema (HTTP query params),
|
|
8
|
-
* but the SDK exposes ListAppsSchema (user-friendly options):
|
|
9
|
-
* - ListAppsOptions accepts `appKeys` as array, `cursor`, `maxItems`
|
|
10
|
-
* - ListAppsQuery accepts `appKeys` as comma-separated string, `offset`
|
|
11
|
-
* - The plugin transforms between these formats
|
|
12
|
-
*/
|
|
13
|
-
import { z } from "zod";
|
|
14
|
-
import { TelemetryMarkerSchema } from "../../utils/function-utils";
|
|
15
|
-
// Import schemas and types from @zapier/zapier-sdk-core (sdkapi)
|
|
16
|
-
import { AppItemSchema as AppItemSchemaBase, ListAppsResponseSchema as ListAppsResponseSchemaBase, ListAppsQuerySchema as ListAppsQueryBase, } from "@zapier/zapier-sdk-core/v0/schemas/apps";
|
|
17
|
-
// Re-export for consumers
|
|
18
|
-
export { AppItemSchemaBase as AppItemSchema };
|
|
19
|
-
export { ListAppsResponseSchemaBase as ListAppsResponseSchema };
|
|
20
|
-
/**
|
|
21
|
-
* SDK user-facing options for listApps
|
|
22
|
-
*
|
|
23
|
-
* Extends ListAppsQuerySchema from zapier-sdk-core with SDK-specific options:
|
|
24
|
-
* - appKeys: array (not comma-separated string)
|
|
25
|
-
* - cursor: pagination cursor (not offset)
|
|
26
|
-
* - maxItems: SDK-specific pagination limit
|
|
27
|
-
*/
|
|
28
|
-
export const ListAppsSchema = ListAppsQueryBase.omit({
|
|
29
|
-
offset: true,
|
|
30
|
-
})
|
|
31
|
-
.extend({
|
|
32
|
-
// Override appKeys to be an array instead of comma-separated string
|
|
33
|
-
appKeys: z
|
|
34
|
-
.array(z.string())
|
|
35
|
-
.optional()
|
|
36
|
-
.describe("Filter apps by app keys (e.g., 'SlackCLIAPI' or slug like 'github')"),
|
|
37
|
-
// Override pageSize to make optional (base has default value)
|
|
38
|
-
pageSize: z.number().min(1).optional().describe("Number of apps per page"),
|
|
39
|
-
// SDK specific property for pagination/iterator helpers
|
|
40
|
-
maxItems: z
|
|
41
|
-
.number()
|
|
42
|
-
.min(1)
|
|
43
|
-
.optional()
|
|
44
|
-
.describe("Maximum total items to return across all pages"),
|
|
45
|
-
// SDK specific property for pagination/iterator helpers
|
|
46
|
-
cursor: z.string().optional().describe("Cursor to start from"),
|
|
47
|
-
})
|
|
48
|
-
.merge(TelemetryMarkerSchema)
|
|
49
|
-
.describe("List all available apps with optional filtering");
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { Plugin, GetSdkType } from "../../types/plugin";
|
|
2
|
-
import type { ApiClient } from "../../api";
|
|
3
|
-
import type { AuthenticationItem } from "@zapier/zapier-sdk-core/v0/schemas/authentications";
|
|
4
|
-
import { ListAuthenticationsQuerySchema, type ListAuthenticationsOptions, type ListAuthenticationsPage } from "./schemas";
|
|
5
|
-
import type { GetVersionedImplementationId } from "../manifest/schemas";
|
|
6
|
-
import type { ManifestPluginProvides } from "../manifest";
|
|
7
|
-
import type { EventEmissionContext } from "../eventEmission";
|
|
8
|
-
export interface ListAuthenticationsPluginProvides {
|
|
9
|
-
listAuthentications: (options?: ListAuthenticationsOptions) => Promise<ListAuthenticationsPage> & AsyncIterable<ListAuthenticationsPage> & {
|
|
10
|
-
items(): AsyncIterable<AuthenticationItem>;
|
|
11
|
-
};
|
|
12
|
-
context: {
|
|
13
|
-
meta: {
|
|
14
|
-
listAuthentications: {
|
|
15
|
-
inputSchema: typeof ListAuthenticationsQuerySchema;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
export declare const listAuthenticationsPlugin: Plugin<GetSdkType<ManifestPluginProvides>, {
|
|
21
|
-
api: ApiClient;
|
|
22
|
-
getVersionedImplementationId: GetVersionedImplementationId;
|
|
23
|
-
} & EventEmissionContext, ListAuthenticationsPluginProvides>;
|
|
24
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/listAuthentications/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oDAAoD,CAAC;AAC7F,OAAO,EACL,8BAA8B,EAC9B,KAAK,0BAA0B,EAC/B,KAAK,uBAAuB,EAC7B,MAAM,WAAW,CAAC;AAInB,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAG1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAK7D,MAAM,WAAW,iCAAiC;IAChD,mBAAmB,EAAE,CACnB,OAAO,CAAC,EAAE,0BAA0B,KACjC,OAAO,CAAC,uBAAuB,CAAC,GACnC,aAAa,CAAC,uBAAuB,CAAC,GAAG;QACvC,KAAK,IAAI,aAAa,CAAC,kBAAkB,CAAC,CAAC;KAC5C,CAAC;IACJ,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,mBAAmB,EAAE;gBACnB,WAAW,EAAE,OAAO,8BAA8B,CAAC;aACpD,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,yBAAyB,EAAE,MAAM,CAC5C,UAAU,CAAC,sBAAsB,CAAC,EAClC;IACE,GAAG,EAAE,SAAS,CAAC;IACf,4BAA4B,EAAE,4BAA4B,CAAC;CAC5D,GAAG,oBAAoB,EACxB,iCAAiC,CAiGlC,CAAC"}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { ListAuthenticationsQuerySchema, } from "./schemas";
|
|
2
|
-
import { splitVersionedKey } from "../../utils/domain-utils";
|
|
3
|
-
import { createPaginatedFunction } from "../../utils/function-utils";
|
|
4
|
-
import { appKeyResolver } from "../../resolvers";
|
|
5
|
-
import { AuthenticationItemSchema } from "../../schemas/Auth";
|
|
6
|
-
import { createTelemetryCallback } from "../../utils/telemetry-utils";
|
|
7
|
-
import { stripPageSuffix } from "../../utils/string-utils";
|
|
8
|
-
import { ZapierAuthenticationError } from "../../types/errors";
|
|
9
|
-
export const listAuthenticationsPlugin = ({ context }) => {
|
|
10
|
-
async function listAuthenticationsPage(options) {
|
|
11
|
-
const { api, getVersionedImplementationId } = context;
|
|
12
|
-
const searchParams = {
|
|
13
|
-
pageSize: options.pageSize.toString(),
|
|
14
|
-
};
|
|
15
|
-
// Resolve appKey to implementationId if provided
|
|
16
|
-
if (options.appKey) {
|
|
17
|
-
const implementationId = await getVersionedImplementationId(options.appKey);
|
|
18
|
-
if (implementationId) {
|
|
19
|
-
// Extract versionless app key to pass to handler
|
|
20
|
-
const [versionlessSelectedApi] = splitVersionedKey(implementationId);
|
|
21
|
-
searchParams.appKey = versionlessSelectedApi;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
// Pass other filter options as searchParams
|
|
25
|
-
if (options.authenticationIds && options.authenticationIds.length > 0) {
|
|
26
|
-
searchParams.authenticationIds = options.authenticationIds.join(",");
|
|
27
|
-
}
|
|
28
|
-
if (options.search) {
|
|
29
|
-
searchParams.search = options.search;
|
|
30
|
-
}
|
|
31
|
-
if (options.title) {
|
|
32
|
-
searchParams.title = options.title;
|
|
33
|
-
}
|
|
34
|
-
if (options.accountId) {
|
|
35
|
-
searchParams.accountId = options.accountId;
|
|
36
|
-
}
|
|
37
|
-
if (options.owner) {
|
|
38
|
-
searchParams.owner = options.owner;
|
|
39
|
-
}
|
|
40
|
-
if (options.cursor) {
|
|
41
|
-
searchParams.offset = options.cursor;
|
|
42
|
-
}
|
|
43
|
-
const response = await api.get("/api/v0/authentications", {
|
|
44
|
-
searchParams,
|
|
45
|
-
customErrorHandler: ({ status }) => {
|
|
46
|
-
if (status === 401) {
|
|
47
|
-
return new ZapierAuthenticationError(`Authentication failed. Your token may not have permission to access authentications or may be expired. (HTTP ${status})`, { statusCode: status });
|
|
48
|
-
}
|
|
49
|
-
if (status === 403) {
|
|
50
|
-
return new ZapierAuthenticationError(`Access forbidden. Your token may not have the required scopes to list authentications. (HTTP ${status})`, { statusCode: status });
|
|
51
|
-
}
|
|
52
|
-
return undefined;
|
|
53
|
-
},
|
|
54
|
-
authRequired: true,
|
|
55
|
-
});
|
|
56
|
-
return response;
|
|
57
|
-
}
|
|
58
|
-
const methodName = stripPageSuffix(listAuthenticationsPage.name);
|
|
59
|
-
const listAuthenticationsDefinition = createPaginatedFunction(listAuthenticationsPage, ListAuthenticationsQuerySchema, createTelemetryCallback(context.eventEmission.emitMethodCalled, methodName), methodName);
|
|
60
|
-
return {
|
|
61
|
-
listAuthentications: listAuthenticationsDefinition,
|
|
62
|
-
context: {
|
|
63
|
-
meta: {
|
|
64
|
-
listAuthentications: {
|
|
65
|
-
categories: ["authentication"],
|
|
66
|
-
type: "list",
|
|
67
|
-
itemType: "Authentication",
|
|
68
|
-
inputSchema: ListAuthenticationsQuerySchema,
|
|
69
|
-
outputSchema: AuthenticationItemSchema,
|
|
70
|
-
resolvers: {
|
|
71
|
-
appKey: appKeyResolver,
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
},
|
|
75
|
-
},
|
|
76
|
-
};
|
|
77
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../../src/plugins/listAuthentications/index.test.ts"],"names":[],"mappings":""}
|