@zapier/zapier-sdk 0.18.3 → 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 +41 -0
- package/README.md +44 -32
- package/dist/index.cjs +658 -693
- package/dist/index.d.mts +272 -138
- package/dist/index.d.ts +2541 -40
- package/dist/index.mjs +638 -692
- 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.integration.test.d.ts +0 -5
- package/dist/api/client.integration.test.d.ts.map +0 -1
- package/dist/api/client.integration.test.js +0 -318
- package/dist/api/client.js +0 -374
- package/dist/api/client.methods.test.d.ts +0 -2
- package/dist/api/client.methods.test.d.ts.map +0 -1
- package/dist/api/client.methods.test.js +0 -158
- 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/router.d.ts +0 -16
- package/dist/api/router.d.ts.map +0 -1
- package/dist/api/router.js +0 -31
- package/dist/api/router.test.d.ts +0 -2
- package/dist/api/router.test.d.ts.map +0 -1
- package/dist/api/router.test.js +0 -103
- package/dist/api/schemas.d.ts +0 -531
- package/dist/api/schemas.d.ts.map +0 -1
- package/dist/api/schemas.js +0 -389
- package/dist/api/types.d.ts +0 -82
- 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 -25
- package/dist/plugins/listApps/index.d.ts.map +0 -1
- package/dist/plugins/listApps/index.js +0 -69
- 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 -141
- package/dist/plugins/listApps/schemas.d.ts +0 -26
- package/dist/plugins/listApps/schemas.d.ts.map +0 -1
- package/dist/plugins/listApps/schemas.js +0 -19
- 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 -832
- 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 -31
- 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 -255
- 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/temporary-internal-core/handlers/listApps.d.ts +0 -67
- package/dist/temporary-internal-core/handlers/listApps.d.ts.map +0 -1
- package/dist/temporary-internal-core/handlers/listApps.js +0 -134
- package/dist/temporary-internal-core/handlers/listApps.test.d.ts +0 -2
- package/dist/temporary-internal-core/handlers/listApps.test.d.ts.map +0 -1
- package/dist/temporary-internal-core/handlers/listApps.test.js +0 -367
- package/dist/temporary-internal-core/index.d.ts +0 -18
- package/dist/temporary-internal-core/index.d.ts.map +0 -1
- package/dist/temporary-internal-core/index.js +0 -18
- package/dist/temporary-internal-core/schemas/apps/index.d.ts +0 -175
- package/dist/temporary-internal-core/schemas/apps/index.d.ts.map +0 -1
- package/dist/temporary-internal-core/schemas/apps/index.js +0 -97
- package/dist/temporary-internal-core/schemas/errors/index.d.ts +0 -139
- package/dist/temporary-internal-core/schemas/errors/index.d.ts.map +0 -1
- package/dist/temporary-internal-core/schemas/errors/index.js +0 -129
- package/dist/temporary-internal-core/schemas/implementations/index.d.ts +0 -127
- package/dist/temporary-internal-core/schemas/implementations/index.d.ts.map +0 -1
- package/dist/temporary-internal-core/schemas/implementations/index.js +0 -79
- package/dist/temporary-internal-core/types/handler.d.ts +0 -51
- package/dist/temporary-internal-core/types/handler.d.ts.map +0 -1
- package/dist/temporary-internal-core/types/handler.js +0 -8
- package/dist/temporary-internal-core/types/index.d.ts +0 -5
- package/dist/temporary-internal-core/types/index.d.ts.map +0 -1
- package/dist/temporary-internal-core/types/index.js +0 -4
- package/dist/temporary-internal-core/utils/app-locators.d.ts +0 -34
- package/dist/temporary-internal-core/utils/app-locators.d.ts.map +0 -1
- package/dist/temporary-internal-core/utils/app-locators.js +0 -39
- package/dist/temporary-internal-core/utils/string-utils.d.ts +0 -28
- package/dist/temporary-internal-core/utils/string-utils.d.ts.map +0 -1
- package/dist/temporary-internal-core/utils/string-utils.js +0 -52
- package/dist/temporary-internal-core/utils/transformations.d.ts +0 -18
- package/dist/temporary-internal-core/utils/transformations.d.ts.map +0 -1
- package/dist/temporary-internal-core/utils/transformations.js +0 -36
- 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,69 +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
|
-
nextCursor: undefined,
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
const implementationIds = appLocators.map((locator) => {
|
|
38
|
-
const version = locator.version || "latest";
|
|
39
|
-
return `${locator.implementationName}@${version}`;
|
|
40
|
-
});
|
|
41
|
-
// Call the API, which will be routed to the handler via handlerOverride in pathConfig.
|
|
42
|
-
// When the handler is migrated to sdkapi, this same API call will go over the network.
|
|
43
|
-
return await api.get("/api/v0/apps", {
|
|
44
|
-
searchParams: {
|
|
45
|
-
implementationIds: implementationIds.join(","),
|
|
46
|
-
...(options.search && { search: options.search }),
|
|
47
|
-
pageSize: options.pageSize.toString(),
|
|
48
|
-
...(options.cursor && { cursor: options.cursor }),
|
|
49
|
-
},
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
const methodName = stripPageSuffix(listAppsPage.name);
|
|
53
|
-
const listAppsDefinition = createPaginatedFunction(listAppsPage, ListAppsSchema, createTelemetryCallback(context.eventEmission.emitMethodCalled, methodName), methodName);
|
|
54
|
-
// Return flat structure - listApps goes directly to SDK
|
|
55
|
-
return {
|
|
56
|
-
listApps: listAppsDefinition,
|
|
57
|
-
context: {
|
|
58
|
-
meta: {
|
|
59
|
-
listApps: {
|
|
60
|
-
categories: ["app"],
|
|
61
|
-
type: "list",
|
|
62
|
-
itemType: "App",
|
|
63
|
-
inputSchema: ListAppsSchema,
|
|
64
|
-
outputSchema: AppItemSchema,
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
},
|
|
68
|
-
};
|
|
69
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../../src/plugins/listApps/index.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,141 +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 { apiPlugin } from "../api/index";
|
|
6
|
-
import { eventEmissionPlugin } from "../eventEmission";
|
|
7
|
-
const mockResolveAppKeys = vi
|
|
8
|
-
.fn()
|
|
9
|
-
.mockImplementation(async ({ appKeys }) => {
|
|
10
|
-
return appKeys.map((appKey) => ({
|
|
11
|
-
lookupAppKey: appKey,
|
|
12
|
-
implementationName: appKey,
|
|
13
|
-
slug: appKey.toLowerCase(),
|
|
14
|
-
version: undefined,
|
|
15
|
-
}));
|
|
16
|
-
});
|
|
17
|
-
function createTestSdk(mockFetch) {
|
|
18
|
-
return createSdk()
|
|
19
|
-
.addPlugin(() => ({
|
|
20
|
-
context: {
|
|
21
|
-
options: {},
|
|
22
|
-
},
|
|
23
|
-
}))
|
|
24
|
-
.addPlugin(apiPlugin, { fetch: mockFetch || global.fetch })
|
|
25
|
-
.addPlugin(eventEmissionPlugin)
|
|
26
|
-
.addPlugin(() => ({
|
|
27
|
-
context: {
|
|
28
|
-
resolveAppKeys: mockResolveAppKeys,
|
|
29
|
-
},
|
|
30
|
-
}))
|
|
31
|
-
.addPlugin(listAppsPlugin);
|
|
32
|
-
}
|
|
33
|
-
function createMockFetch(handlers) {
|
|
34
|
-
return vi.fn().mockImplementation(async (url, _init) => {
|
|
35
|
-
const urlString = typeof url === "string" ? url : url.toString();
|
|
36
|
-
const urlPath = new URL(urlString).pathname;
|
|
37
|
-
for (const [handlerPath, response] of Object.entries(handlers)) {
|
|
38
|
-
if (urlPath === handlerPath) {
|
|
39
|
-
const responseData = typeof response === "function" ? response() : response;
|
|
40
|
-
return {
|
|
41
|
-
ok: true,
|
|
42
|
-
status: 200,
|
|
43
|
-
statusText: "OK",
|
|
44
|
-
json: async () => responseData,
|
|
45
|
-
headers: new Headers({ "content-type": "application/json" }),
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
return {
|
|
50
|
-
ok: false,
|
|
51
|
-
status: 404,
|
|
52
|
-
statusText: "Not Found",
|
|
53
|
-
json: async () => ({ message: `No mock for path: ${urlPath}` }),
|
|
54
|
-
headers: new Headers(),
|
|
55
|
-
};
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
describe("listApps plugin", () => {
|
|
59
|
-
beforeEach(() => {
|
|
60
|
-
vi.clearAllMocks();
|
|
61
|
-
});
|
|
62
|
-
describe("basic functionality", () => {
|
|
63
|
-
it("should provide listApps method that returns apps", async () => {
|
|
64
|
-
const mockFetch = createMockFetch({
|
|
65
|
-
"/api/v0/sdk/zapier/api/v4/implementations-meta/lookup/": {
|
|
66
|
-
count: 2,
|
|
67
|
-
results: [
|
|
68
|
-
{
|
|
69
|
-
id: "SlackCLIAPI@1.0.0",
|
|
70
|
-
name: "Slack",
|
|
71
|
-
description: "Team communication",
|
|
72
|
-
primary_color: "#4A154B",
|
|
73
|
-
categories: ["communication"],
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
id: "GoogleSheetsCLIAPI@1.0.0",
|
|
77
|
-
name: "Google Sheets",
|
|
78
|
-
description: "Online spreadsheets",
|
|
79
|
-
primary_color: "#34A853",
|
|
80
|
-
categories: ["productivity"],
|
|
81
|
-
},
|
|
82
|
-
],
|
|
83
|
-
next: null,
|
|
84
|
-
},
|
|
85
|
-
});
|
|
86
|
-
const sdk = createTestSdk(mockFetch);
|
|
87
|
-
// Provide explicit pageSize to limit results
|
|
88
|
-
const result = await sdk.listApps({ pageSize: 2 });
|
|
89
|
-
// Just verify the structure - handler tests verify correct data
|
|
90
|
-
expect(result.data.length).toBeGreaterThan(0);
|
|
91
|
-
expect(result.data[0]).toHaveProperty("title");
|
|
92
|
-
expect(result.data[0]).toHaveProperty("key");
|
|
93
|
-
expect(result.data[0]).toHaveProperty("implementation_id");
|
|
94
|
-
expect(result.data[0]).toHaveProperty("version");
|
|
95
|
-
});
|
|
96
|
-
});
|
|
97
|
-
describe("plugin integration", () => {
|
|
98
|
-
it("should provide metadata in context for CLI introspection", () => {
|
|
99
|
-
const sdk = createTestSdk();
|
|
100
|
-
const context = sdk.getContext();
|
|
101
|
-
expect(context.meta.listApps).toBeDefined();
|
|
102
|
-
expect(context.meta.listApps.inputSchema).toBeDefined();
|
|
103
|
-
});
|
|
104
|
-
it("should integrate with resolveAppKeys", async () => {
|
|
105
|
-
const mockFetch = createMockFetch({
|
|
106
|
-
"/api/v0/sdk/zapier/api/v4/implementations-meta/lookup/": {
|
|
107
|
-
count: 1,
|
|
108
|
-
results: [
|
|
109
|
-
{
|
|
110
|
-
id: "SlackCLIAPI@1.0.0",
|
|
111
|
-
name: "Slack",
|
|
112
|
-
description: "Team communication",
|
|
113
|
-
primary_color: "#4A154B",
|
|
114
|
-
categories: ["communication"],
|
|
115
|
-
},
|
|
116
|
-
],
|
|
117
|
-
next: null,
|
|
118
|
-
},
|
|
119
|
-
});
|
|
120
|
-
const sdk = createTestSdk(mockFetch);
|
|
121
|
-
await sdk.listApps({ appKeys: ["SlackCLIAPI"] });
|
|
122
|
-
// Verify resolveAppKeys was called with the provided appKeys
|
|
123
|
-
expect(mockResolveAppKeys).toHaveBeenCalledWith(expect.objectContaining({
|
|
124
|
-
appKeys: ["SlackCLIAPI"],
|
|
125
|
-
}));
|
|
126
|
-
});
|
|
127
|
-
});
|
|
128
|
-
describe("validation", () => {
|
|
129
|
-
it("should throw validation error for invalid input", () => {
|
|
130
|
-
const sdk = createTestSdk();
|
|
131
|
-
// Invalid pageSize
|
|
132
|
-
expect(() => {
|
|
133
|
-
sdk.listApps({ pageSize: 0 });
|
|
134
|
-
}).toThrow(ZapierValidationError);
|
|
135
|
-
// Invalid appKeys type
|
|
136
|
-
expect(() => {
|
|
137
|
-
sdk.listApps({ appKeys: 123 });
|
|
138
|
-
}).toThrow(ZapierValidationError);
|
|
139
|
-
});
|
|
140
|
-
});
|
|
141
|
-
});
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Plugin schemas for listApps
|
|
3
|
-
*
|
|
4
|
-
* Re-exports from temporary-internal-core to maintain single source of truth.
|
|
5
|
-
* Plugin-specific types (like PaginatedSdkFunction) remain here.
|
|
6
|
-
*
|
|
7
|
-
* Note: The handler (handleListApps) uses a different request interface (ListAppsHandlerRequest)
|
|
8
|
-
* than the public API (ListAppsOptions). This is because:
|
|
9
|
-
* - ListAppsOptions accepts user-friendly `appKeys` (slugs, implementation names, etc.) and `search`
|
|
10
|
-
* - ListAppsHandlerRequest expects pre-resolved `implementationIds` and `search`
|
|
11
|
-
* - The plugin is responsible for:
|
|
12
|
-
* 1. App key resolution (slugs, implementation names → implementation IDs)
|
|
13
|
-
* 2. Early returns for invalid appKeys (prevents returning all apps)
|
|
14
|
-
* - The handler is responsible for:
|
|
15
|
-
* 1. Search augmentation (merging search results with implementation IDs)
|
|
16
|
-
* 2. Empty search handling (returns empty, not all apps)
|
|
17
|
-
*/
|
|
18
|
-
import type { PaginatedSdkFunction } from "../../types/functions";
|
|
19
|
-
import type { ZapierApiError, ZapierValidationError } from "../../types/errors";
|
|
20
|
-
import type { ListAppsOptions, AppItem } from "../../temporary-internal-core/schemas/apps";
|
|
21
|
-
export { ListAppsOptionsSchema as ListAppsSchema, ListAppsResponseSchema, type ListAppsOptions, type ListAppsResponse as ListAppsPage, type AppItem, } from "../../temporary-internal-core/schemas/apps";
|
|
22
|
-
export type ListAppsError = ZapierApiError | ZapierValidationError;
|
|
23
|
-
export interface ListAppsSdkFunction {
|
|
24
|
-
listApps: PaginatedSdkFunction<ListAppsOptions | undefined, AppItem>;
|
|
25
|
-
}
|
|
26
|
-
//# 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;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,KAAK,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChF,OAAO,KAAK,EACV,eAAe,EACf,OAAO,EACR,MAAM,4CAA4C,CAAC;AAGpD,OAAO,EACL,qBAAqB,IAAI,cAAc,EACvC,sBAAsB,EACtB,KAAK,eAAe,EACpB,KAAK,gBAAgB,IAAI,YAAY,EACrC,KAAK,OAAO,GACb,MAAM,4CAA4C,CAAC;AAGpD,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,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Plugin schemas for listApps
|
|
3
|
-
*
|
|
4
|
-
* Re-exports from temporary-internal-core to maintain single source of truth.
|
|
5
|
-
* Plugin-specific types (like PaginatedSdkFunction) remain here.
|
|
6
|
-
*
|
|
7
|
-
* Note: The handler (handleListApps) uses a different request interface (ListAppsHandlerRequest)
|
|
8
|
-
* than the public API (ListAppsOptions). This is because:
|
|
9
|
-
* - ListAppsOptions accepts user-friendly `appKeys` (slugs, implementation names, etc.) and `search`
|
|
10
|
-
* - ListAppsHandlerRequest expects pre-resolved `implementationIds` and `search`
|
|
11
|
-
* - The plugin is responsible for:
|
|
12
|
-
* 1. App key resolution (slugs, implementation names → implementation IDs)
|
|
13
|
-
* 2. Early returns for invalid appKeys (prevents returning all apps)
|
|
14
|
-
* - The handler is responsible for:
|
|
15
|
-
* 1. Search augmentation (merging search results with implementation IDs)
|
|
16
|
-
* 2. Empty search handling (returns empty, not all apps)
|
|
17
|
-
*/
|
|
18
|
-
// Re-export core schemas and types
|
|
19
|
-
export { ListAppsOptionsSchema as ListAppsSchema, ListAppsResponseSchema, } from "../../temporary-internal-core/schemas/apps";
|
|
@@ -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":""}
|