@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,30 +0,0 @@
|
|
|
1
|
-
import type { Plugin, GetSdkType } from "../../types/plugin";
|
|
2
|
-
import type { ApiClient } from "../../api";
|
|
3
|
-
import type { ActionItem } from "../../types/domain";
|
|
4
|
-
import { ListActionsSchema, type ListActionsOptions } from "./schemas";
|
|
5
|
-
import type { ManifestPluginProvides } from "../manifest";
|
|
6
|
-
import type { GetVersionedImplementationId } from "../manifest/schemas";
|
|
7
|
-
import type { EventEmissionContext } from "../eventEmission";
|
|
8
|
-
export interface ListActionsPluginProvides {
|
|
9
|
-
listActions: (options?: ListActionsOptions) => Promise<{
|
|
10
|
-
data: ActionItem[];
|
|
11
|
-
nextCursor?: string;
|
|
12
|
-
}> & AsyncIterable<{
|
|
13
|
-
data: ActionItem[];
|
|
14
|
-
nextCursor?: string;
|
|
15
|
-
}> & {
|
|
16
|
-
items(): AsyncIterable<ActionItem>;
|
|
17
|
-
};
|
|
18
|
-
context: {
|
|
19
|
-
meta: {
|
|
20
|
-
listActions: {
|
|
21
|
-
inputSchema: typeof ListActionsSchema;
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
export declare const listActionsPlugin: Plugin<GetSdkType<ManifestPluginProvides>, {
|
|
27
|
-
api: ApiClient;
|
|
28
|
-
getVersionedImplementationId: GetVersionedImplementationId;
|
|
29
|
-
} & EventEmissionContext, ListActionsPluginProvides>;
|
|
30
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/listActions/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAkB,MAAM,WAAW,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,EACL,iBAAiB,EACjB,KAAK,kBAAkB,EAExB,MAAM,WAAW,CAAC;AAOnB,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AAExE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAI7D,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,UAAU,CAAC,sBAAsB,CAAC,EAClC;IACE,GAAG,EAAE,SAAS,CAAC;IACf,4BAA4B,EAAE,4BAA4B,CAAC;CAC5D,GAAG,oBAAoB,EACxB,yBAAyB,CAoG1B,CAAC"}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { normalizeActionItem } from "../../utils/domain-utils";
|
|
2
|
-
import { ListActionsSchema, } from "./schemas";
|
|
3
|
-
import { ActionItemSchema } from "../../schemas/Action";
|
|
4
|
-
import { ZapierConfigurationError, ZapierAuthenticationError, } from "../../types/errors";
|
|
5
|
-
import { createPaginatedFunction } from "../../utils/function-utils";
|
|
6
|
-
import { appKeyResolver, actionTypeResolver } from "../../resolvers";
|
|
7
|
-
import { createTelemetryCallback } from "../../utils/telemetry-utils";
|
|
8
|
-
import { stripPageSuffix } from "../../utils/string-utils";
|
|
9
|
-
export const listActionsPlugin = ({ context }) => {
|
|
10
|
-
const methodMeta = {
|
|
11
|
-
categories: ["action"],
|
|
12
|
-
type: "list",
|
|
13
|
-
itemType: "Action",
|
|
14
|
-
inputSchema: ListActionsSchema,
|
|
15
|
-
outputSchema: ActionItemSchema,
|
|
16
|
-
resolvers: {
|
|
17
|
-
appKey: appKeyResolver,
|
|
18
|
-
actionType: actionTypeResolver,
|
|
19
|
-
},
|
|
20
|
-
};
|
|
21
|
-
async function listActionsPage(options) {
|
|
22
|
-
const { api, getVersionedImplementationId } = context;
|
|
23
|
-
// Use getVersionedImplementationId (optimized to check manifest first)
|
|
24
|
-
const selectedApi = await getVersionedImplementationId(options.appKey);
|
|
25
|
-
if (!selectedApi) {
|
|
26
|
-
throw new ZapierConfigurationError("No current_implementation_id found for app", { configType: "current_implementation_id" });
|
|
27
|
-
}
|
|
28
|
-
const searchParams = {
|
|
29
|
-
global: "true",
|
|
30
|
-
public_only: "true",
|
|
31
|
-
selected_apis: selectedApi,
|
|
32
|
-
};
|
|
33
|
-
const data = await api.get("/zapier/api/v4/implementations/", {
|
|
34
|
-
searchParams,
|
|
35
|
-
customErrorHandler: ({ status }) => {
|
|
36
|
-
if (status === 401) {
|
|
37
|
-
return new ZapierAuthenticationError(`Authentication failed. Your token may not have permission to access implementations or may be expired. (HTTP ${status})`, { statusCode: status });
|
|
38
|
-
}
|
|
39
|
-
if (status === 403) {
|
|
40
|
-
return new ZapierAuthenticationError(`Access forbidden. Your token may not have the required scopes to list implementations. (HTTP ${status})`, { statusCode: status });
|
|
41
|
-
}
|
|
42
|
-
return undefined;
|
|
43
|
-
},
|
|
44
|
-
});
|
|
45
|
-
let allActions = [];
|
|
46
|
-
for (const implementation of data.results || []) {
|
|
47
|
-
if (implementation.actions) {
|
|
48
|
-
for (const action of implementation.actions) {
|
|
49
|
-
const actionWithContext = {
|
|
50
|
-
...action,
|
|
51
|
-
selected_api: action.selected_api || implementation.selected_api,
|
|
52
|
-
};
|
|
53
|
-
allActions.push(normalizeActionItem(actionWithContext));
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
if (options.actionType) {
|
|
58
|
-
allActions = allActions.filter((action) => action.action_type === options.actionType);
|
|
59
|
-
}
|
|
60
|
-
return {
|
|
61
|
-
data: allActions,
|
|
62
|
-
nextCursor: undefined,
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
const methodName = stripPageSuffix(listActionsPage.name);
|
|
66
|
-
const listActionsDefinition = createPaginatedFunction(listActionsPage, ListActionsSchema, createTelemetryCallback(context.eventEmission.emitMethodCalled, methodName), methodName);
|
|
67
|
-
return {
|
|
68
|
-
listActions: listActionsDefinition,
|
|
69
|
-
context: {
|
|
70
|
-
meta: {
|
|
71
|
-
listActions: methodMeta,
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
};
|
|
75
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../../src/plugins/listActions/index.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,453 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, vi, beforeEach } from "vitest";
|
|
2
|
-
import { ZapierValidationError, ZapierAuthenticationError, ZapierConfigurationError, } from "../../types/errors";
|
|
3
|
-
import { listActionsPlugin } from "./index";
|
|
4
|
-
import { createSdk } from "../../sdk";
|
|
5
|
-
import { listAppsPlugin } from "../listApps";
|
|
6
|
-
import { eventEmissionPlugin } from "../eventEmission";
|
|
7
|
-
const mockImplementationsResponse = {
|
|
8
|
-
results: [
|
|
9
|
-
{
|
|
10
|
-
slug: "slack",
|
|
11
|
-
selected_api: "slack",
|
|
12
|
-
actions: [
|
|
13
|
-
{
|
|
14
|
-
key: "user_by_email",
|
|
15
|
-
name: "Search User by Email",
|
|
16
|
-
description: "Find a user by email address",
|
|
17
|
-
type_of: "search",
|
|
18
|
-
type: "search",
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
key: "send_message",
|
|
22
|
-
name: "Send Message",
|
|
23
|
-
description: "Send a message to a channel",
|
|
24
|
-
type_of: "write",
|
|
25
|
-
type: "write",
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
key: "create_channel",
|
|
29
|
-
name: "Create Channel",
|
|
30
|
-
description: "Create a new channel",
|
|
31
|
-
type_of: "write",
|
|
32
|
-
type: "write",
|
|
33
|
-
},
|
|
34
|
-
],
|
|
35
|
-
},
|
|
36
|
-
],
|
|
37
|
-
meta: {
|
|
38
|
-
next_cursor: null,
|
|
39
|
-
},
|
|
40
|
-
};
|
|
41
|
-
const mockEmptyImplementationsResponse = {
|
|
42
|
-
results: [],
|
|
43
|
-
meta: {
|
|
44
|
-
next_cursor: null,
|
|
45
|
-
},
|
|
46
|
-
};
|
|
47
|
-
describe("listActions plugin", () => {
|
|
48
|
-
let mockApiClient;
|
|
49
|
-
let mockGetVersionedImplementationId;
|
|
50
|
-
beforeEach(() => {
|
|
51
|
-
vi.clearAllMocks();
|
|
52
|
-
mockApiClient = {
|
|
53
|
-
get: vi.fn().mockResolvedValue(mockImplementationsResponse),
|
|
54
|
-
};
|
|
55
|
-
mockGetVersionedImplementationId = vi
|
|
56
|
-
.fn()
|
|
57
|
-
.mockResolvedValue("SlackCLIAPI@1.21.1");
|
|
58
|
-
});
|
|
59
|
-
const mockResolveAppKeys = vi.fn().mockResolvedValue([]);
|
|
60
|
-
function createTestSdk() {
|
|
61
|
-
// Create a proper plugin chain with context dependencies
|
|
62
|
-
// Build SDK with proper plugin composition, providing API in initial context
|
|
63
|
-
return createSdk()
|
|
64
|
-
.addPlugin(() => ({
|
|
65
|
-
context: {
|
|
66
|
-
options: {},
|
|
67
|
-
},
|
|
68
|
-
}))
|
|
69
|
-
.addPlugin(() => ({
|
|
70
|
-
context: {
|
|
71
|
-
api: mockApiClient,
|
|
72
|
-
},
|
|
73
|
-
}))
|
|
74
|
-
.addPlugin(eventEmissionPlugin)
|
|
75
|
-
.addPlugin(() => ({
|
|
76
|
-
context: {
|
|
77
|
-
manifest: null,
|
|
78
|
-
getVersionedImplementationId: mockGetVersionedImplementationId,
|
|
79
|
-
resolveAppKeys: mockResolveAppKeys,
|
|
80
|
-
updateManifestEntry: vi
|
|
81
|
-
.fn()
|
|
82
|
-
.mockResolvedValue(["test-key", {}, { apps: {} }]),
|
|
83
|
-
addActionEntry: vi
|
|
84
|
-
.fn()
|
|
85
|
-
.mockResolvedValue(["test-key", {}, { apps: {} }]),
|
|
86
|
-
findActionEntry: vi.fn().mockResolvedValue({
|
|
87
|
-
key: "test-key",
|
|
88
|
-
entry: {},
|
|
89
|
-
manifest: { apps: {} },
|
|
90
|
-
}),
|
|
91
|
-
hasActionEntry: vi.fn().mockResolvedValue(true),
|
|
92
|
-
listActionEntries: vi
|
|
93
|
-
.fn()
|
|
94
|
-
.mockResolvedValue([
|
|
95
|
-
[
|
|
96
|
-
"test-key",
|
|
97
|
-
{ key: "test-key", entry: {}, manifest: { apps: {} } },
|
|
98
|
-
],
|
|
99
|
-
]),
|
|
100
|
-
deleteActionEntry: vi.fn().mockResolvedValue({ apps: {} }),
|
|
101
|
-
findManifestEntry: vi
|
|
102
|
-
.fn()
|
|
103
|
-
.mockResolvedValue([
|
|
104
|
-
"test-key",
|
|
105
|
-
{ key: "test-key", entry: {}, manifest: { apps: {} } },
|
|
106
|
-
]),
|
|
107
|
-
readManifestFromFile: vi.fn().mockResolvedValue({ apps: {} }),
|
|
108
|
-
},
|
|
109
|
-
}))
|
|
110
|
-
.addPlugin(listAppsPlugin)
|
|
111
|
-
.addPlugin(listActionsPlugin);
|
|
112
|
-
}
|
|
113
|
-
describe("schema validation", () => {
|
|
114
|
-
it("should pass validation with valid appKey", async () => {
|
|
115
|
-
const sdk = createTestSdk();
|
|
116
|
-
const result = await sdk.listActions({ appKey: "slack" });
|
|
117
|
-
expect(result.data).toHaveLength(3);
|
|
118
|
-
});
|
|
119
|
-
it("should throw validation error for missing appKey", () => {
|
|
120
|
-
const sdk = createTestSdk();
|
|
121
|
-
expect(() => {
|
|
122
|
-
sdk.listActions({});
|
|
123
|
-
}).toThrow(ZapierValidationError);
|
|
124
|
-
});
|
|
125
|
-
it("should throw validation error for invalid appKey type", () => {
|
|
126
|
-
const sdk = createTestSdk();
|
|
127
|
-
expect(() => {
|
|
128
|
-
sdk.listActions({
|
|
129
|
-
appKey: 123,
|
|
130
|
-
});
|
|
131
|
-
}).toThrow(ZapierValidationError);
|
|
132
|
-
});
|
|
133
|
-
it("should throw validation error for empty appKey", () => {
|
|
134
|
-
const sdk = createTestSdk();
|
|
135
|
-
expect(() => {
|
|
136
|
-
sdk.listActions({ appKey: "" });
|
|
137
|
-
}).toThrow(ZapierValidationError);
|
|
138
|
-
});
|
|
139
|
-
it("should throw validation error for invalid pageSize", () => {
|
|
140
|
-
const sdk = createTestSdk();
|
|
141
|
-
expect(() => {
|
|
142
|
-
sdk.listActions({ appKey: "slack", pageSize: 0 });
|
|
143
|
-
}).toThrow(ZapierValidationError);
|
|
144
|
-
expect(() => {
|
|
145
|
-
sdk.listActions({ appKey: "slack", pageSize: -5 });
|
|
146
|
-
}).toThrow(ZapierValidationError);
|
|
147
|
-
});
|
|
148
|
-
it("should throw validation error for invalid maxItems", () => {
|
|
149
|
-
const sdk = createTestSdk();
|
|
150
|
-
expect(() => {
|
|
151
|
-
sdk.listActions({ appKey: "slack", maxItems: 0 });
|
|
152
|
-
}).toThrow(ZapierValidationError);
|
|
153
|
-
expect(() => {
|
|
154
|
-
sdk.listActions({ appKey: "slack", maxItems: -10 });
|
|
155
|
-
}).toThrow(ZapierValidationError);
|
|
156
|
-
});
|
|
157
|
-
it("should throw validation error for invalid actionType", () => {
|
|
158
|
-
const sdk = createTestSdk();
|
|
159
|
-
expect(() => {
|
|
160
|
-
sdk.listActions({
|
|
161
|
-
appKey: "slack",
|
|
162
|
-
actionType: "invalid-type",
|
|
163
|
-
});
|
|
164
|
-
}).toThrow(ZapierValidationError);
|
|
165
|
-
});
|
|
166
|
-
it("should pass validation with all valid fields", async () => {
|
|
167
|
-
const sdk = createTestSdk();
|
|
168
|
-
const result = await sdk.listActions({
|
|
169
|
-
appKey: "slack",
|
|
170
|
-
actionType: "write",
|
|
171
|
-
pageSize: 10,
|
|
172
|
-
maxItems: 50,
|
|
173
|
-
});
|
|
174
|
-
expect(result.data).toHaveLength(2); // Only write actions
|
|
175
|
-
expect(result.data.every((action) => action.action_type === "write")).toBe(true);
|
|
176
|
-
});
|
|
177
|
-
});
|
|
178
|
-
describe("actionType enum validation", () => {
|
|
179
|
-
const validActionTypes = [
|
|
180
|
-
"read",
|
|
181
|
-
"read_bulk",
|
|
182
|
-
"write",
|
|
183
|
-
"run",
|
|
184
|
-
"search",
|
|
185
|
-
"search_or_write",
|
|
186
|
-
"search_and_write",
|
|
187
|
-
"filter",
|
|
188
|
-
];
|
|
189
|
-
validActionTypes.forEach((actionType) => {
|
|
190
|
-
it(`should accept valid actionType: ${actionType}`, async () => {
|
|
191
|
-
const mockResponse = {
|
|
192
|
-
results: [
|
|
193
|
-
{
|
|
194
|
-
slug: "slack",
|
|
195
|
-
actions: [
|
|
196
|
-
{
|
|
197
|
-
key: "test_action",
|
|
198
|
-
name: "Test Action",
|
|
199
|
-
description: "Test description",
|
|
200
|
-
type_of: actionType,
|
|
201
|
-
type: actionType,
|
|
202
|
-
},
|
|
203
|
-
],
|
|
204
|
-
},
|
|
205
|
-
],
|
|
206
|
-
meta: { next_cursor: null },
|
|
207
|
-
};
|
|
208
|
-
mockApiClient.get = vi.fn().mockResolvedValue(mockResponse);
|
|
209
|
-
const sdk = createTestSdk();
|
|
210
|
-
const result = await sdk.listActions({
|
|
211
|
-
appKey: "slack",
|
|
212
|
-
actionType: actionType,
|
|
213
|
-
});
|
|
214
|
-
expect(result.data).toHaveLength(1);
|
|
215
|
-
expect(result.data[0].action_type).toBe(actionType);
|
|
216
|
-
});
|
|
217
|
-
});
|
|
218
|
-
});
|
|
219
|
-
describe("data transformation", () => {
|
|
220
|
-
it("should transform implementation actions to ActionItem format", async () => {
|
|
221
|
-
const sdk = createTestSdk();
|
|
222
|
-
const result = await sdk.listActions({ appKey: "slack" });
|
|
223
|
-
const firstAction = result.data[0];
|
|
224
|
-
// Check all required ActionItem fields are present
|
|
225
|
-
expect(firstAction).toHaveProperty("key");
|
|
226
|
-
expect(firstAction).toHaveProperty("type", "action");
|
|
227
|
-
expect(firstAction).toHaveProperty("action_type");
|
|
228
|
-
expect(firstAction).toHaveProperty("title");
|
|
229
|
-
expect(firstAction).toHaveProperty("app_key", "slack");
|
|
230
|
-
expect(firstAction).toHaveProperty("description");
|
|
231
|
-
// Check that title is mapped from API name field
|
|
232
|
-
expect(firstAction.title).toBe("Search User by Email");
|
|
233
|
-
expect(firstAction.app_key).toBe("slack");
|
|
234
|
-
expect(firstAction.type).toBe("action");
|
|
235
|
-
});
|
|
236
|
-
it("should map type_of to action_type", async () => {
|
|
237
|
-
const sdk = createTestSdk();
|
|
238
|
-
const result = await sdk.listActions({ appKey: "slack" });
|
|
239
|
-
expect(result.data[0].action_type).toBe("search"); // From type_of field
|
|
240
|
-
expect(result.data[1].action_type).toBe("write"); // From type_of field
|
|
241
|
-
});
|
|
242
|
-
it("should fall back to type field if type_of is missing", async () => {
|
|
243
|
-
const mockResponseWithoutTypeOf = {
|
|
244
|
-
results: [
|
|
245
|
-
{
|
|
246
|
-
slug: "slack",
|
|
247
|
-
actions: [
|
|
248
|
-
{
|
|
249
|
-
key: "test_action",
|
|
250
|
-
name: "Test Action",
|
|
251
|
-
description: "Test description",
|
|
252
|
-
type: "read", // Only type field, no type_of
|
|
253
|
-
},
|
|
254
|
-
],
|
|
255
|
-
},
|
|
256
|
-
],
|
|
257
|
-
meta: { next_cursor: null },
|
|
258
|
-
};
|
|
259
|
-
mockApiClient.get = vi.fn().mockResolvedValue(mockResponseWithoutTypeOf);
|
|
260
|
-
const sdk = createTestSdk();
|
|
261
|
-
const result = await sdk.listActions({ appKey: "slack" });
|
|
262
|
-
expect(result.data[0].action_type).toBe("read"); // Falls back to type field
|
|
263
|
-
});
|
|
264
|
-
it("should handle actions with read type", async () => {
|
|
265
|
-
const mockResponseWithoutType = {
|
|
266
|
-
results: [
|
|
267
|
-
{
|
|
268
|
-
slug: "slack",
|
|
269
|
-
actions: [
|
|
270
|
-
{
|
|
271
|
-
key: "test_action",
|
|
272
|
-
name: "Test Action",
|
|
273
|
-
description: "Test description",
|
|
274
|
-
type: "read", // Provide the required type field
|
|
275
|
-
},
|
|
276
|
-
],
|
|
277
|
-
},
|
|
278
|
-
],
|
|
279
|
-
meta: { next_cursor: null },
|
|
280
|
-
};
|
|
281
|
-
mockApiClient.get = vi.fn().mockResolvedValue(mockResponseWithoutType);
|
|
282
|
-
const sdk = createTestSdk();
|
|
283
|
-
const result = await sdk.listActions({ appKey: "slack" });
|
|
284
|
-
expect(result.data[0].action_type).toBe("read"); // Should match provided type
|
|
285
|
-
});
|
|
286
|
-
});
|
|
287
|
-
describe("filtering", () => {
|
|
288
|
-
it("should filter actions by actionType", async () => {
|
|
289
|
-
const sdk = createTestSdk();
|
|
290
|
-
const result = await sdk.listActions({
|
|
291
|
-
appKey: "slack",
|
|
292
|
-
actionType: "write",
|
|
293
|
-
});
|
|
294
|
-
expect(result.data).toHaveLength(2);
|
|
295
|
-
expect(result.data.every((action) => action.action_type === "write")).toBe(true);
|
|
296
|
-
expect(result.data.map((action) => action.key)).toEqual([
|
|
297
|
-
"send_message",
|
|
298
|
-
"create_channel",
|
|
299
|
-
]);
|
|
300
|
-
});
|
|
301
|
-
it("should return empty array when no actions match filter", async () => {
|
|
302
|
-
const sdk = createTestSdk();
|
|
303
|
-
const result = await sdk.listActions({
|
|
304
|
-
appKey: "slack",
|
|
305
|
-
actionType: "filter", // No actions of this type in mock data
|
|
306
|
-
});
|
|
307
|
-
expect(result.data).toHaveLength(0);
|
|
308
|
-
});
|
|
309
|
-
it("should return all actions when no actionType filter provided", async () => {
|
|
310
|
-
const sdk = createTestSdk();
|
|
311
|
-
const result = await sdk.listActions({ appKey: "slack" });
|
|
312
|
-
expect(result.data).toHaveLength(3); // All actions
|
|
313
|
-
});
|
|
314
|
-
});
|
|
315
|
-
describe("pagination", () => {
|
|
316
|
-
it("should handle maxItems limit", async () => {
|
|
317
|
-
const sdk = createTestSdk();
|
|
318
|
-
const result = await sdk.listActions({
|
|
319
|
-
appKey: "slack",
|
|
320
|
-
maxItems: 2,
|
|
321
|
-
});
|
|
322
|
-
expect(result.data).toHaveLength(2); // Limited to maxItems
|
|
323
|
-
});
|
|
324
|
-
it("should support async iteration over pages", async () => {
|
|
325
|
-
const sdk = createTestSdk();
|
|
326
|
-
const listActions = sdk.listActions({ appKey: "slack" });
|
|
327
|
-
const pages = [];
|
|
328
|
-
for await (const page of listActions) {
|
|
329
|
-
pages.push(page);
|
|
330
|
-
break; // Just get first page for testing
|
|
331
|
-
}
|
|
332
|
-
expect(pages).toHaveLength(1);
|
|
333
|
-
expect(pages[0].data).toHaveLength(3);
|
|
334
|
-
expect(pages[0].data[0].key).toBe("user_by_email");
|
|
335
|
-
});
|
|
336
|
-
it("should support async iteration over individual items", async () => {
|
|
337
|
-
const sdk = createTestSdk();
|
|
338
|
-
const listActions = sdk.listActions({
|
|
339
|
-
appKey: "slack",
|
|
340
|
-
maxItems: 2,
|
|
341
|
-
});
|
|
342
|
-
const items = [];
|
|
343
|
-
for await (const item of listActions.items()) {
|
|
344
|
-
items.push(item);
|
|
345
|
-
}
|
|
346
|
-
expect(items).toHaveLength(2);
|
|
347
|
-
expect(items[0].key).toBe("user_by_email");
|
|
348
|
-
expect(items[1].key).toBe("send_message");
|
|
349
|
-
});
|
|
350
|
-
it("should respect pageSize parameter", async () => {
|
|
351
|
-
const sdk = createTestSdk();
|
|
352
|
-
await sdk.listActions({
|
|
353
|
-
appKey: "slack",
|
|
354
|
-
pageSize: 10,
|
|
355
|
-
});
|
|
356
|
-
// Note: Since listActions doesn't actually use pagination internally,
|
|
357
|
-
// we just verify it accepts the parameter without error
|
|
358
|
-
expect(mockApiClient.get).toHaveBeenCalled();
|
|
359
|
-
});
|
|
360
|
-
});
|
|
361
|
-
describe("API integration", () => {
|
|
362
|
-
it("should call getApp to get implementation ID", async () => {
|
|
363
|
-
const sdk = createTestSdk();
|
|
364
|
-
await sdk.listActions({ appKey: "slack" });
|
|
365
|
-
expect(mockGetVersionedImplementationId).toHaveBeenCalledWith("slack");
|
|
366
|
-
});
|
|
367
|
-
it("should pass correct search parameters to implementations API", async () => {
|
|
368
|
-
const sdk = createTestSdk();
|
|
369
|
-
await sdk.listActions({ appKey: "slack" });
|
|
370
|
-
expect(mockApiClient.get).toHaveBeenCalledWith("/zapier/api/v4/implementations/", expect.objectContaining({
|
|
371
|
-
searchParams: expect.objectContaining({
|
|
372
|
-
global: "true",
|
|
373
|
-
public_only: "true",
|
|
374
|
-
selected_apis: "SlackCLIAPI@1.21.1",
|
|
375
|
-
}),
|
|
376
|
-
}));
|
|
377
|
-
});
|
|
378
|
-
});
|
|
379
|
-
describe("error handling", () => {
|
|
380
|
-
it("should throw ZapierConfigurationError when app has no current_implementation_id", async () => {
|
|
381
|
-
mockGetVersionedImplementationId.mockResolvedValue(null);
|
|
382
|
-
const sdk = createTestSdk();
|
|
383
|
-
await expect(sdk.listActions({ appKey: "slack" })).rejects.toThrow(ZapierConfigurationError);
|
|
384
|
-
});
|
|
385
|
-
it("should throw ZapierConfigurationError when current_implementation_id is empty", async () => {
|
|
386
|
-
mockGetVersionedImplementationId.mockResolvedValue("");
|
|
387
|
-
const sdk = createTestSdk();
|
|
388
|
-
await expect(sdk.listActions({ appKey: "slack" })).rejects.toThrow(ZapierConfigurationError);
|
|
389
|
-
});
|
|
390
|
-
it("should handle authentication error (401)", async () => {
|
|
391
|
-
mockApiClient.get = vi.fn().mockImplementation((_url, options) => {
|
|
392
|
-
if (options.customErrorHandler) {
|
|
393
|
-
const error = options.customErrorHandler({ status: 401 });
|
|
394
|
-
if (error) {
|
|
395
|
-
throw error;
|
|
396
|
-
}
|
|
397
|
-
}
|
|
398
|
-
throw new Error("Unauthorized");
|
|
399
|
-
});
|
|
400
|
-
const sdk = createTestSdk();
|
|
401
|
-
await expect(sdk.listActions({ appKey: "slack" })).rejects.toThrow(ZapierAuthenticationError);
|
|
402
|
-
});
|
|
403
|
-
it("should handle forbidden error (403)", async () => {
|
|
404
|
-
mockApiClient.get = vi.fn().mockImplementation((_url, options) => {
|
|
405
|
-
if (options.customErrorHandler) {
|
|
406
|
-
const error = options.customErrorHandler({ status: 403 });
|
|
407
|
-
if (error) {
|
|
408
|
-
throw error;
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
throw new Error("Forbidden");
|
|
412
|
-
});
|
|
413
|
-
const sdk = createTestSdk();
|
|
414
|
-
await expect(sdk.listActions({ appKey: "slack" })).rejects.toThrow(ZapierAuthenticationError);
|
|
415
|
-
});
|
|
416
|
-
it("should return empty array when implementations API returns no results", async () => {
|
|
417
|
-
mockApiClient.get = vi
|
|
418
|
-
.fn()
|
|
419
|
-
.mockResolvedValue(mockEmptyImplementationsResponse);
|
|
420
|
-
const sdk = createTestSdk();
|
|
421
|
-
const result = await sdk.listActions({ appKey: "slack" });
|
|
422
|
-
expect(result.data).toHaveLength(0);
|
|
423
|
-
});
|
|
424
|
-
it("should handle implementation without actions", async () => {
|
|
425
|
-
const mockResponseWithoutActions = {
|
|
426
|
-
results: [
|
|
427
|
-
{
|
|
428
|
-
slug: "slack",
|
|
429
|
-
// No actions property
|
|
430
|
-
},
|
|
431
|
-
],
|
|
432
|
-
meta: { next_cursor: null },
|
|
433
|
-
};
|
|
434
|
-
mockApiClient.get = vi.fn().mockResolvedValue(mockResponseWithoutActions);
|
|
435
|
-
const sdk = createTestSdk();
|
|
436
|
-
const result = await sdk.listActions({ appKey: "slack" });
|
|
437
|
-
expect(result.data).toHaveLength(0);
|
|
438
|
-
});
|
|
439
|
-
it("should propagate getVersionedImplementationId errors", async () => {
|
|
440
|
-
mockGetVersionedImplementationId.mockRejectedValue(new Error("App not found"));
|
|
441
|
-
const sdk = createTestSdk();
|
|
442
|
-
await expect(sdk.listActions({ appKey: "nonexistent" })).rejects.toThrow("App not found");
|
|
443
|
-
});
|
|
444
|
-
});
|
|
445
|
-
describe("context and metadata", () => {
|
|
446
|
-
it("should provide context with meta information", () => {
|
|
447
|
-
const sdk = createTestSdk();
|
|
448
|
-
const context = sdk.getContext();
|
|
449
|
-
expect(context.meta.listActions).toBeDefined();
|
|
450
|
-
expect(context.meta.listActions.inputSchema).toBeDefined();
|
|
451
|
-
});
|
|
452
|
-
});
|
|
453
|
-
});
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import type { ActionItem } from "../../types/domain";
|
|
3
|
-
import type { PaginatedSdkFunction } from "../../types/functions";
|
|
4
|
-
import type { ZapierAuthenticationError, ZapierValidationError, ZapierUnknownError } from "../../types/errors";
|
|
5
|
-
export declare const ListActionsSchema: z.ZodObject<{
|
|
6
|
-
appKey: z.ZodString & {
|
|
7
|
-
_def: z.core.$ZodStringDef & import("../..").PositionalMetadata;
|
|
8
|
-
};
|
|
9
|
-
actionType: z.ZodOptional<z.ZodEnum<{
|
|
10
|
-
search: "search";
|
|
11
|
-
filter: "filter";
|
|
12
|
-
read: "read";
|
|
13
|
-
read_bulk: "read_bulk";
|
|
14
|
-
run: "run";
|
|
15
|
-
search_and_write: "search_and_write";
|
|
16
|
-
search_or_write: "search_or_write";
|
|
17
|
-
write: "write";
|
|
18
|
-
}>>;
|
|
19
|
-
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
20
|
-
maxItems: z.ZodOptional<z.ZodNumber>;
|
|
21
|
-
cursor: z.ZodOptional<z.ZodString>;
|
|
22
|
-
_telemetry: z.ZodOptional<z.ZodObject<{
|
|
23
|
-
isNested: z.ZodOptional<z.ZodBoolean>;
|
|
24
|
-
}, z.core.$strip>>;
|
|
25
|
-
}, z.core.$strip>;
|
|
26
|
-
export type ListActionsOptions = z.infer<typeof ListActionsSchema>;
|
|
27
|
-
export interface ListActionsPage {
|
|
28
|
-
data: ActionItem[];
|
|
29
|
-
nextCursor?: string;
|
|
30
|
-
}
|
|
31
|
-
export type ListActionsError = ZapierAuthenticationError | ZapierValidationError | ZapierUnknownError;
|
|
32
|
-
export interface ListActionsSdkFunction {
|
|
33
|
-
listActions: PaginatedSdkFunction<ListActionsOptions, ActionItem>;
|
|
34
|
-
}
|
|
35
|
-
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/listActions/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,KAAK,EACV,yBAAyB,EACzB,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAI5B,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;iBAqBoB,CAAC;AAGnD,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAGnE,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,UAAU,EAAE,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAGD,MAAM,MAAM,gBAAgB,GACxB,yBAAyB,GACzB,qBAAqB,GACrB,kBAAkB,CAAC;AAGvB,MAAM,WAAW,sBAAsB;IACrC,WAAW,EAAE,oBAAoB,CAAC,kBAAkB,EAAE,UAAU,CAAC,CAAC;CACnE"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { AppKeyPropertySchema, ActionTypePropertySchema, } from "../../types/properties";
|
|
3
|
-
import { TelemetryMarkerSchema } from "../../utils/function-utils";
|
|
4
|
-
// Pure Zod schema - no resolver metadata!
|
|
5
|
-
export const ListActionsSchema = z
|
|
6
|
-
.object({
|
|
7
|
-
appKey: AppKeyPropertySchema.describe("App key of actions to list (e.g., 'SlackCLIAPI' or slug like 'github')"),
|
|
8
|
-
actionType: ActionTypePropertySchema.optional().describe("Filter actions by type"),
|
|
9
|
-
pageSize: z
|
|
10
|
-
.number()
|
|
11
|
-
.min(1)
|
|
12
|
-
.optional()
|
|
13
|
-
.describe("Number of actions per page"),
|
|
14
|
-
maxItems: z
|
|
15
|
-
.number()
|
|
16
|
-
.min(1)
|
|
17
|
-
.optional()
|
|
18
|
-
.describe("Maximum total items to return across all pages"),
|
|
19
|
-
cursor: z.string().optional().describe("Cursor to start from"),
|
|
20
|
-
})
|
|
21
|
-
.merge(TelemetryMarkerSchema)
|
|
22
|
-
.describe("List all actions for a specific app");
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { GetContextType, Plugin } from "../../types/plugin";
|
|
2
|
-
import { ListAppsSchema, type ListAppsOptions, type AppItem } from "./schemas";
|
|
3
|
-
import type { ManifestPluginProvides } from "../manifest";
|
|
4
|
-
import type { ApiPluginProvides } from "../api";
|
|
5
|
-
import type { EventEmissionContext } from "../eventEmission";
|
|
6
|
-
export interface ListAppsPluginProvides {
|
|
7
|
-
listApps: (options?: ListAppsOptions) => Promise<{
|
|
8
|
-
data: AppItem[];
|
|
9
|
-
nextCursor?: string;
|
|
10
|
-
}> & AsyncIterable<{
|
|
11
|
-
data: AppItem[];
|
|
12
|
-
nextCursor?: string;
|
|
13
|
-
}> & {
|
|
14
|
-
items(): AsyncIterable<AppItem>;
|
|
15
|
-
};
|
|
16
|
-
context: {
|
|
17
|
-
meta: {
|
|
18
|
-
listApps: {
|
|
19
|
-
inputSchema: typeof ListAppsSchema;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
export declare const listAppsPlugin: Plugin<{}, GetContextType<ApiPluginProvides & ManifestPluginProvides> & EventEmissionContext, ListAppsPluginProvides>;
|
|
25
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/listApps/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjE,OAAO,EACL,cAAc,EACd,KAAK,eAAe,EAEpB,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,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAI7D,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,eAAe,KAAK,OAAO,CAAC;QAC/C,IAAI,EAAE,OAAO,EAAE,CAAC;QAChB,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC,GACA,aAAa,CAAC;QAAE,IAAI,EAAE,OAAO,EAAE,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,GAAG;QACxD,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,EAAE,EACF,cAAc,CAAC,iBAAiB,GAAG,sBAAsB,CAAC,GACxD,oBAAoB,EACtB,sBAAsB,CAiFvB,CAAC"}
|