@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,211 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, vi, beforeEach } from "vitest";
|
|
2
|
-
import { ZapierValidationError, ZapierResourceNotFoundError, } from "../../types/errors";
|
|
3
|
-
import { getActionPlugin } from "./index";
|
|
4
|
-
import { createSdk } from "../../sdk";
|
|
5
|
-
import { ListActionsSchema } from "../listActions/schemas";
|
|
6
|
-
import { eventEmissionPlugin } from "../eventEmission";
|
|
7
|
-
const mockActions = [
|
|
8
|
-
{
|
|
9
|
-
type: "action",
|
|
10
|
-
key: "user_by_email",
|
|
11
|
-
title: "Search User by Email",
|
|
12
|
-
description: "Find a user by email address",
|
|
13
|
-
app_key: "slack",
|
|
14
|
-
action_type: "search",
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
type: "action",
|
|
18
|
-
key: "search_messages",
|
|
19
|
-
title: "Search Messages",
|
|
20
|
-
description: "Search for messages in channels",
|
|
21
|
-
app_key: "slack",
|
|
22
|
-
action_type: "search",
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
type: "action",
|
|
26
|
-
key: "user_by_email",
|
|
27
|
-
title: "Search User by Email",
|
|
28
|
-
description: "Find a user by email address",
|
|
29
|
-
app_key: "slack",
|
|
30
|
-
action_type: "write", // Different action type for testing mismatch
|
|
31
|
-
},
|
|
32
|
-
];
|
|
33
|
-
describe("getAction plugin", () => {
|
|
34
|
-
let mockListActions;
|
|
35
|
-
let mockApiClient;
|
|
36
|
-
beforeEach(() => {
|
|
37
|
-
vi.clearAllMocks();
|
|
38
|
-
// Mock listActions to return a promise with .items() method
|
|
39
|
-
mockListActions = vi.fn().mockImplementation(() => {
|
|
40
|
-
const promise = Promise.resolve({
|
|
41
|
-
data: mockActions,
|
|
42
|
-
});
|
|
43
|
-
// Add .items() method that returns an async iterable
|
|
44
|
-
return Object.assign(promise, {
|
|
45
|
-
items: () => ({
|
|
46
|
-
async *[Symbol.asyncIterator]() {
|
|
47
|
-
for (const action of mockActions) {
|
|
48
|
-
yield action;
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
}),
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
mockApiClient = {};
|
|
55
|
-
});
|
|
56
|
-
function createTestSdk() {
|
|
57
|
-
// Create a proper plugin chain with context dependencies
|
|
58
|
-
const mockListActionsPlugin = () => ({
|
|
59
|
-
listActions: mockListActions,
|
|
60
|
-
context: {
|
|
61
|
-
meta: {
|
|
62
|
-
listActions: {
|
|
63
|
-
inputSchema: ListActionsSchema,
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
});
|
|
68
|
-
// Build SDK with proper plugin composition, providing API in initial context
|
|
69
|
-
return createSdk({}, {}, { api: mockApiClient, meta: {}, options: {} })
|
|
70
|
-
.addPlugin(eventEmissionPlugin)
|
|
71
|
-
.addPlugin(mockListActionsPlugin)
|
|
72
|
-
.addPlugin(getActionPlugin);
|
|
73
|
-
}
|
|
74
|
-
describe("schema validation", () => {
|
|
75
|
-
it("should throw validation error for missing appKey", async () => {
|
|
76
|
-
const sdk = createTestSdk();
|
|
77
|
-
await expect(sdk.getAction({
|
|
78
|
-
actionType: "search",
|
|
79
|
-
actionKey: "user_by_email",
|
|
80
|
-
})).rejects.toThrow(ZapierValidationError);
|
|
81
|
-
});
|
|
82
|
-
it("should throw validation error for missing actionType", async () => {
|
|
83
|
-
const sdk = createTestSdk();
|
|
84
|
-
await expect(sdk.getAction({
|
|
85
|
-
appKey: "slack",
|
|
86
|
-
actionKey: "user_by_email",
|
|
87
|
-
})).rejects.toThrow(ZapierValidationError);
|
|
88
|
-
});
|
|
89
|
-
it("should throw validation error for missing actionKey", async () => {
|
|
90
|
-
const sdk = createTestSdk();
|
|
91
|
-
await expect(sdk.getAction({
|
|
92
|
-
appKey: "slack",
|
|
93
|
-
actionType: "search",
|
|
94
|
-
})).rejects.toThrow(ZapierValidationError);
|
|
95
|
-
});
|
|
96
|
-
it("should throw validation error for invalid appKey type", async () => {
|
|
97
|
-
const sdk = createTestSdk();
|
|
98
|
-
await expect(sdk.getAction({
|
|
99
|
-
appKey: 123,
|
|
100
|
-
actionType: "search",
|
|
101
|
-
actionKey: "user_by_email",
|
|
102
|
-
})).rejects.toThrow(ZapierValidationError);
|
|
103
|
-
});
|
|
104
|
-
it("should throw validation error for invalid actionType", async () => {
|
|
105
|
-
const sdk = createTestSdk();
|
|
106
|
-
await expect(sdk.getAction({
|
|
107
|
-
appKey: "slack",
|
|
108
|
-
actionType: "invalid-type",
|
|
109
|
-
actionKey: "user_by_email",
|
|
110
|
-
})).rejects.toThrow(ZapierValidationError);
|
|
111
|
-
});
|
|
112
|
-
it("should throw validation error for invalid actionKey type", async () => {
|
|
113
|
-
const sdk = createTestSdk();
|
|
114
|
-
await expect(sdk.getAction({
|
|
115
|
-
appKey: "slack",
|
|
116
|
-
actionType: "search",
|
|
117
|
-
actionKey: 123,
|
|
118
|
-
})).rejects.toThrow(ZapierValidationError);
|
|
119
|
-
});
|
|
120
|
-
it("should throw validation error for empty appKey", async () => {
|
|
121
|
-
const sdk = createTestSdk();
|
|
122
|
-
await expect(sdk.getAction({
|
|
123
|
-
appKey: "",
|
|
124
|
-
actionType: "search",
|
|
125
|
-
actionKey: "user_by_email",
|
|
126
|
-
})).rejects.toThrow(ZapierValidationError);
|
|
127
|
-
});
|
|
128
|
-
it("should throw validation error for empty actionKey", async () => {
|
|
129
|
-
const sdk = createTestSdk();
|
|
130
|
-
await expect(sdk.getAction({
|
|
131
|
-
appKey: "slack",
|
|
132
|
-
actionType: "search",
|
|
133
|
-
actionKey: "",
|
|
134
|
-
})).rejects.toThrow(ZapierValidationError);
|
|
135
|
-
});
|
|
136
|
-
it("should pass validation with all required fields", async () => {
|
|
137
|
-
const sdk = createTestSdk();
|
|
138
|
-
const result = await sdk.getAction({
|
|
139
|
-
appKey: "slack",
|
|
140
|
-
actionType: "search",
|
|
141
|
-
actionKey: "user_by_email",
|
|
142
|
-
});
|
|
143
|
-
expect(result.data).toEqual(mockActions[0]);
|
|
144
|
-
});
|
|
145
|
-
});
|
|
146
|
-
describe("action lookup", () => {
|
|
147
|
-
it("should call listActions with correct parameters", async () => {
|
|
148
|
-
const sdk = createTestSdk();
|
|
149
|
-
await sdk.getAction({
|
|
150
|
-
appKey: "slack",
|
|
151
|
-
actionType: "search",
|
|
152
|
-
actionKey: "user_by_email",
|
|
153
|
-
});
|
|
154
|
-
expect(mockListActions).toHaveBeenCalledWith(expect.objectContaining({
|
|
155
|
-
appKey: "slack",
|
|
156
|
-
}));
|
|
157
|
-
});
|
|
158
|
-
it("should return the correct action when found", async () => {
|
|
159
|
-
const sdk = createTestSdk();
|
|
160
|
-
const result = await sdk.getAction({
|
|
161
|
-
appKey: "slack",
|
|
162
|
-
actionType: "search",
|
|
163
|
-
actionKey: "user_by_email",
|
|
164
|
-
});
|
|
165
|
-
expect(result.data).toEqual(mockActions[0]);
|
|
166
|
-
});
|
|
167
|
-
it("should throw error when action key not found", async () => {
|
|
168
|
-
const sdk = createTestSdk();
|
|
169
|
-
await expect(sdk.getAction({
|
|
170
|
-
appKey: "slack",
|
|
171
|
-
actionType: "search",
|
|
172
|
-
actionKey: "nonexistent_action",
|
|
173
|
-
})).rejects.toThrow(ZapierResourceNotFoundError);
|
|
174
|
-
});
|
|
175
|
-
it("should throw error when action type doesn't match", async () => {
|
|
176
|
-
const sdk = createTestSdk();
|
|
177
|
-
await expect(sdk.getAction({
|
|
178
|
-
appKey: "slack",
|
|
179
|
-
actionType: "write",
|
|
180
|
-
actionKey: "search_messages", // This action is type "search" in mock
|
|
181
|
-
})).rejects.toThrow(ZapierResourceNotFoundError);
|
|
182
|
-
});
|
|
183
|
-
it("should handle listActions errors", async () => {
|
|
184
|
-
mockListActions.mockImplementation(() => {
|
|
185
|
-
const promise = Promise.reject(new Error("API Error"));
|
|
186
|
-
// Add .items() method that also rejects
|
|
187
|
-
return Object.assign(promise, {
|
|
188
|
-
items: () => ({
|
|
189
|
-
async *[Symbol.asyncIterator]() {
|
|
190
|
-
throw new Error("API Error");
|
|
191
|
-
},
|
|
192
|
-
}),
|
|
193
|
-
});
|
|
194
|
-
});
|
|
195
|
-
const sdk = createTestSdk();
|
|
196
|
-
await expect(sdk.getAction({
|
|
197
|
-
appKey: "slack",
|
|
198
|
-
actionType: "search",
|
|
199
|
-
actionKey: "user_by_email",
|
|
200
|
-
})).rejects.toThrow("API Error");
|
|
201
|
-
});
|
|
202
|
-
});
|
|
203
|
-
describe("plugin integration", () => {
|
|
204
|
-
it("should provide metadata in context", () => {
|
|
205
|
-
const sdk = createTestSdk();
|
|
206
|
-
const context = sdk.getContext();
|
|
207
|
-
expect(context.meta.getAction).toBeDefined();
|
|
208
|
-
expect(context.meta.getAction.inputSchema).toBeDefined();
|
|
209
|
-
});
|
|
210
|
-
});
|
|
211
|
-
});
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import type { ActionItem } from "../../types/domain";
|
|
3
|
-
import type { ZapierAuthenticationError, ZapierApiError, ZapierAppNotFoundError, ZapierValidationError, ZapierResourceNotFoundError, ZapierUnknownError } from "../../types/errors";
|
|
4
|
-
export declare const GetActionSchema: z.ZodObject<{
|
|
5
|
-
appKey: z.ZodString & {
|
|
6
|
-
_def: z.core.$ZodStringDef & import("../..").PositionalMetadata;
|
|
7
|
-
};
|
|
8
|
-
actionType: z.ZodEnum<{
|
|
9
|
-
search: "search";
|
|
10
|
-
filter: "filter";
|
|
11
|
-
read: "read";
|
|
12
|
-
read_bulk: "read_bulk";
|
|
13
|
-
run: "run";
|
|
14
|
-
search_and_write: "search_and_write";
|
|
15
|
-
search_or_write: "search_or_write";
|
|
16
|
-
write: "write";
|
|
17
|
-
}>;
|
|
18
|
-
actionKey: z.ZodString;
|
|
19
|
-
_telemetry: z.ZodOptional<z.ZodObject<{
|
|
20
|
-
isNested: z.ZodOptional<z.ZodBoolean>;
|
|
21
|
-
}, z.core.$strip>>;
|
|
22
|
-
}, z.core.$strip>;
|
|
23
|
-
export type GetActionOptions = z.infer<typeof GetActionSchema>;
|
|
24
|
-
export type GetActionError = ZapierAuthenticationError | ZapierApiError | ZapierAppNotFoundError | ZapierValidationError | ZapierResourceNotFoundError | ZapierUnknownError;
|
|
25
|
-
export interface GetActionSdkFunction {
|
|
26
|
-
getAction: (options: GetActionOptions) => Promise<{
|
|
27
|
-
data: ActionItem;
|
|
28
|
-
}>;
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/getAction/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EACV,yBAAyB,EACzB,cAAc,EACd,sBAAsB,EACtB,qBAAqB,EACrB,2BAA2B,EAC3B,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAI5B,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;iBAOmC,CAAC;AAGhE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAG/D,MAAM,MAAM,cAAc,GACtB,yBAAyB,GACzB,cAAc,GACd,sBAAsB,GACtB,qBAAqB,GACrB,2BAA2B,GAC3B,kBAAkB,CAAC;AAGvB,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,OAAO,CAAC;QAAE,IAAI,EAAE,UAAU,CAAA;KAAE,CAAC,CAAC;CACzE"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { AppKeyPropertySchema, ActionTypePropertySchema, ActionKeyPropertySchema, } from "../../types/properties";
|
|
3
|
-
import { TelemetryMarkerSchema } from "../../utils/function-utils";
|
|
4
|
-
// Pure Zod schema - no resolver metadata!
|
|
5
|
-
export const GetActionSchema = z
|
|
6
|
-
.object({
|
|
7
|
-
appKey: AppKeyPropertySchema,
|
|
8
|
-
actionType: ActionTypePropertySchema,
|
|
9
|
-
actionKey: ActionKeyPropertySchema,
|
|
10
|
-
})
|
|
11
|
-
.merge(TelemetryMarkerSchema)
|
|
12
|
-
.describe("Get detailed information about a specific action");
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { Plugin } from "../../types/plugin";
|
|
2
|
-
import { GetAppSchema } from "./schemas";
|
|
3
|
-
import type { GetAppOptions } from "./schemas";
|
|
4
|
-
import type { AppItem } from "../../types/domain";
|
|
5
|
-
import type { GetSdkType } from "../../types/plugin";
|
|
6
|
-
import type { ListAppsPluginProvides } from "../listApps";
|
|
7
|
-
import type { EventEmissionContext } from "../eventEmission";
|
|
8
|
-
export interface GetAppPluginProvides {
|
|
9
|
-
getApp: (options: GetAppOptions) => Promise<{
|
|
10
|
-
data: AppItem;
|
|
11
|
-
}>;
|
|
12
|
-
context: {
|
|
13
|
-
meta: {
|
|
14
|
-
getApp: {
|
|
15
|
-
inputSchema: typeof GetAppSchema;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
export declare const getAppPlugin: Plugin<GetSdkType<ListAppsPluginProvides>, EventEmissionContext, GetAppPluginProvides>;
|
|
21
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/getApp/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAGlD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAE1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAI7D,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,OAAO,CAAC;QAAE,IAAI,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IAC/D,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,WAAW,EAAE,OAAO,YAAY,CAAC;aAClC,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAGD,eAAO,MAAM,YAAY,EAAE,MAAM,CAC/B,UAAU,CAAC,sBAAsB,CAAC,EAClC,oBAAoB,EACpB,oBAAoB,CA8CrB,CAAC"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { createFunction } from "../../utils/function-utils";
|
|
2
|
-
import { GetAppSchema } from "./schemas";
|
|
3
|
-
import { AppItemSchema } from "../../schemas/App";
|
|
4
|
-
import { ZapierAppNotFoundError } from "../../types/errors";
|
|
5
|
-
import { appKeyResolver } from "../../resolvers";
|
|
6
|
-
import { createTelemetryCallback } from "../../utils/telemetry-utils";
|
|
7
|
-
// GetApp plugin depends on listApps SDK function
|
|
8
|
-
export const getAppPlugin = ({ sdk, context }) => {
|
|
9
|
-
async function getApp(options) {
|
|
10
|
-
const appsIterator = sdk
|
|
11
|
-
.listApps({
|
|
12
|
-
appKeys: [options.appKey],
|
|
13
|
-
_telemetry: { isNested: true },
|
|
14
|
-
})
|
|
15
|
-
.items();
|
|
16
|
-
for await (const app of appsIterator) {
|
|
17
|
-
return {
|
|
18
|
-
data: app,
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
throw new ZapierAppNotFoundError("App not found", {
|
|
22
|
-
appKey: options.appKey,
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
const getAppDefinition = createFunction(getApp, GetAppSchema, createTelemetryCallback(context.eventEmission.emitMethodCalled, getApp.name));
|
|
26
|
-
// Return flat structure - getApp goes directly to SDK
|
|
27
|
-
return {
|
|
28
|
-
getApp: getAppDefinition,
|
|
29
|
-
context: {
|
|
30
|
-
meta: {
|
|
31
|
-
getApp: {
|
|
32
|
-
categories: ["app"],
|
|
33
|
-
type: "item",
|
|
34
|
-
itemType: "App",
|
|
35
|
-
inputSchema: GetAppSchema,
|
|
36
|
-
outputSchema: AppItemSchema,
|
|
37
|
-
resolvers: {
|
|
38
|
-
appKey: appKeyResolver,
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
};
|
|
44
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../../src/plugins/getApp/index.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, vi, beforeEach } from "vitest";
|
|
2
|
-
import { ZapierValidationError, ZapierAppNotFoundError, } from "../../types/errors";
|
|
3
|
-
import { getAppPlugin } from "./index";
|
|
4
|
-
import { createSdk } from "../../sdk";
|
|
5
|
-
import { apiPlugin } from "../api/index";
|
|
6
|
-
import { listAppsPlugin } from "../listApps";
|
|
7
|
-
import { manifestPlugin } from "../manifest";
|
|
8
|
-
import { eventEmissionPlugin } from "../eventEmission";
|
|
9
|
-
function createTestSdk() {
|
|
10
|
-
return createSdk()
|
|
11
|
-
.addPlugin(() => ({
|
|
12
|
-
context: {
|
|
13
|
-
options: {},
|
|
14
|
-
},
|
|
15
|
-
}))
|
|
16
|
-
.addPlugin(apiPlugin, { fetch: global.fetch })
|
|
17
|
-
.addPlugin(eventEmissionPlugin)
|
|
18
|
-
.addPlugin(manifestPlugin)
|
|
19
|
-
.addPlugin(listAppsPlugin)
|
|
20
|
-
.addPlugin(getAppPlugin);
|
|
21
|
-
}
|
|
22
|
-
describe("getApp plugin", () => {
|
|
23
|
-
beforeEach(() => {
|
|
24
|
-
vi.clearAllMocks();
|
|
25
|
-
});
|
|
26
|
-
describe("schema validation", () => {
|
|
27
|
-
it("should throw validation error for missing appKey", async () => {
|
|
28
|
-
const sdk = createTestSdk();
|
|
29
|
-
await expect(sdk.getApp({})).rejects.toThrow(ZapierValidationError);
|
|
30
|
-
});
|
|
31
|
-
it("should throw validation error for invalid appKey type", async () => {
|
|
32
|
-
const sdk = createTestSdk();
|
|
33
|
-
await expect(sdk.getApp({
|
|
34
|
-
appKey: 123,
|
|
35
|
-
})).rejects.toThrow(ZapierValidationError);
|
|
36
|
-
});
|
|
37
|
-
it("should throw validation error for empty string appKey", async () => {
|
|
38
|
-
const sdk = createTestSdk();
|
|
39
|
-
await expect(sdk.getApp({
|
|
40
|
-
appKey: "",
|
|
41
|
-
})).rejects.toThrow(ZapierValidationError);
|
|
42
|
-
});
|
|
43
|
-
it("should pass validation with valid appKey", async () => {
|
|
44
|
-
const sdk = createTestSdk();
|
|
45
|
-
const context = sdk.getContext();
|
|
46
|
-
// Mock the API client to handle both resolveAppKeys and listApps calls
|
|
47
|
-
context.api.get = vi
|
|
48
|
-
.fn()
|
|
49
|
-
// First call: resolveAppKeys calls listAppsForSlugsPage which expects raw API format
|
|
50
|
-
.mockResolvedValueOnce({
|
|
51
|
-
results: [
|
|
52
|
-
{
|
|
53
|
-
id: "SlackCLIAPI@1.0.0",
|
|
54
|
-
name: "Slack",
|
|
55
|
-
description: "Team communication",
|
|
56
|
-
primary_color: "#4A154B",
|
|
57
|
-
categories: ["communication"],
|
|
58
|
-
slug: "slack",
|
|
59
|
-
},
|
|
60
|
-
],
|
|
61
|
-
next: null,
|
|
62
|
-
})
|
|
63
|
-
// Second call: listApps goes through handler which returns transformed format
|
|
64
|
-
.mockResolvedValueOnce({
|
|
65
|
-
data: [
|
|
66
|
-
{
|
|
67
|
-
title: "Slack",
|
|
68
|
-
key: "SlackCLIAPI",
|
|
69
|
-
implementation_id: "SlackCLIAPI@1.0.0",
|
|
70
|
-
description: "Team communication",
|
|
71
|
-
primary_color: "#4A154B",
|
|
72
|
-
categories: ["communication"],
|
|
73
|
-
slug: "slack",
|
|
74
|
-
version: "1.0.0",
|
|
75
|
-
},
|
|
76
|
-
],
|
|
77
|
-
nextCursor: undefined,
|
|
78
|
-
});
|
|
79
|
-
const result = await sdk.getApp({
|
|
80
|
-
appKey: "slack",
|
|
81
|
-
});
|
|
82
|
-
expect(result.data.title).toBe("Slack");
|
|
83
|
-
expect(result.data.key).toBe("SlackCLIAPI");
|
|
84
|
-
expect(result.data.implementation_id).toBe("SlackCLIAPI@1.0.0");
|
|
85
|
-
expect(result.data.version).toBe("1.0.0");
|
|
86
|
-
});
|
|
87
|
-
});
|
|
88
|
-
describe("error handling", () => {
|
|
89
|
-
it("should throw ZapierAppNotFoundError when app does not exist", async () => {
|
|
90
|
-
const sdk = createTestSdk();
|
|
91
|
-
const context = sdk.getContext();
|
|
92
|
-
// Mock API to return empty results for both potential calls
|
|
93
|
-
context.api.get = vi
|
|
94
|
-
.fn()
|
|
95
|
-
// First call: resolveAppKeys may call to resolve slug
|
|
96
|
-
.mockResolvedValueOnce({
|
|
97
|
-
results: [],
|
|
98
|
-
next: null,
|
|
99
|
-
})
|
|
100
|
-
// Second call: listApps main API call (returns transformed format)
|
|
101
|
-
.mockResolvedValueOnce({
|
|
102
|
-
data: [],
|
|
103
|
-
nextCursor: undefined,
|
|
104
|
-
});
|
|
105
|
-
await expect(sdk.getApp({
|
|
106
|
-
appKey: "nonexistent-app",
|
|
107
|
-
})).rejects.toThrow(ZapierAppNotFoundError);
|
|
108
|
-
});
|
|
109
|
-
});
|
|
110
|
-
describe("data mapping", () => {
|
|
111
|
-
it("should return essential app properties", async () => {
|
|
112
|
-
const sdk = createTestSdk();
|
|
113
|
-
const context = sdk.getContext();
|
|
114
|
-
// Mock the API client to handle both resolveAppKeys and listApps calls
|
|
115
|
-
context.api.get = vi
|
|
116
|
-
.fn()
|
|
117
|
-
// First call: resolveAppKeys calls listAppsForSlugsPage which expects raw API format
|
|
118
|
-
.mockResolvedValueOnce({
|
|
119
|
-
results: [
|
|
120
|
-
{
|
|
121
|
-
id: "TestCLIAPI@1.0.0",
|
|
122
|
-
name: "Test App",
|
|
123
|
-
description: "Test description",
|
|
124
|
-
primary_color: "#FF0000",
|
|
125
|
-
categories: ["testing"],
|
|
126
|
-
slug: "test",
|
|
127
|
-
},
|
|
128
|
-
],
|
|
129
|
-
next: null,
|
|
130
|
-
})
|
|
131
|
-
// Second call: listApps goes through handler which returns transformed format
|
|
132
|
-
.mockResolvedValueOnce({
|
|
133
|
-
data: [
|
|
134
|
-
{
|
|
135
|
-
title: "Test App",
|
|
136
|
-
key: "TestCLIAPI",
|
|
137
|
-
implementation_id: "TestCLIAPI@1.0.0",
|
|
138
|
-
description: "Test description",
|
|
139
|
-
primary_color: "#FF0000",
|
|
140
|
-
categories: ["testing"],
|
|
141
|
-
slug: "test",
|
|
142
|
-
version: "1.0.0",
|
|
143
|
-
},
|
|
144
|
-
],
|
|
145
|
-
nextCursor: undefined,
|
|
146
|
-
});
|
|
147
|
-
const result = await sdk.getApp({
|
|
148
|
-
appKey: "test",
|
|
149
|
-
});
|
|
150
|
-
expect(result.data.title).toBeDefined();
|
|
151
|
-
expect(result.data.key).toBeDefined();
|
|
152
|
-
expect(result.data.implementation_id).toBeDefined();
|
|
153
|
-
expect(result.data.title).toBe("Test App");
|
|
154
|
-
expect(result.data.key).toBe("TestCLIAPI");
|
|
155
|
-
});
|
|
156
|
-
});
|
|
157
|
-
});
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import type { AppItem } from "../../types/domain";
|
|
3
|
-
import type { ZapierApiError, ZapierAppNotFoundError, ZapierValidationError } from "../../types/errors";
|
|
4
|
-
export type GetAppError = ZapierAppNotFoundError | ZapierApiError | ZapierValidationError;
|
|
5
|
-
export declare const GetAppSchema: z.ZodObject<{
|
|
6
|
-
appKey: z.ZodString & {
|
|
7
|
-
_def: z.core.$ZodStringDef & import("../..").PositionalMetadata;
|
|
8
|
-
};
|
|
9
|
-
}, z.core.$strip>;
|
|
10
|
-
export type GetAppOptions = z.infer<typeof GetAppSchema>;
|
|
11
|
-
export interface GetAppSdkFunction {
|
|
12
|
-
getApp: (options: GetAppOptions) => Promise<{
|
|
13
|
-
data: AppItem;
|
|
14
|
-
}>;
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/getApp/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EACV,cAAc,EACd,sBAAsB,EACtB,qBAAqB,EACtB,MAAM,oBAAoB,CAAC;AAK5B,MAAM,MAAM,WAAW,GACnB,sBAAsB,GACtB,cAAc,GACd,qBAAqB,CAAC;AAG1B,eAAO,MAAM,YAAY;;;;iBAMmC,CAAC;AAG7D,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAGzD,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,OAAO,CAAC;QAAE,IAAI,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;CAChE"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { AppKeyPropertySchema } from "../../types/properties";
|
|
3
|
-
// Pure Zod schema - no resolver metadata!
|
|
4
|
-
export const GetAppSchema = z
|
|
5
|
-
.object({
|
|
6
|
-
appKey: AppKeyPropertySchema.describe("App key of app to fetch (e.g., 'SlackCLIAPI' or slug like 'github')"),
|
|
7
|
-
})
|
|
8
|
-
.describe("Get detailed information about a specific app");
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { Plugin } from "../../types/plugin";
|
|
2
|
-
import type { ApiClient } from "../../api";
|
|
3
|
-
import type { EventEmissionContext } from "../eventEmission";
|
|
4
|
-
import { GetAuthenticationParamSchema, type GetAuthenticationParam, type GetAuthenticationResponse } from "@zapier/zapier-sdk-core/v0/schemas/authentications";
|
|
5
|
-
export interface GetAuthenticationPluginProvides {
|
|
6
|
-
getAuthentication: (options: GetAuthenticationParam) => Promise<GetAuthenticationResponse>;
|
|
7
|
-
context: {
|
|
8
|
-
meta: {
|
|
9
|
-
getAuthentication: {
|
|
10
|
-
inputSchema: typeof GetAuthenticationParamSchema;
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
export declare const getAuthenticationPlugin: Plugin<{}, // no SDK dependencies
|
|
16
|
-
// no SDK dependencies
|
|
17
|
-
{
|
|
18
|
-
api: ApiClient;
|
|
19
|
-
} & EventEmissionContext, // requires api in context
|
|
20
|
-
GetAuthenticationPluginProvides>;
|
|
21
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/getAuthentication/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAI3C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAE7D,OAAO,EACL,4BAA4B,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EAC/B,MAAM,oDAAoD,CAAC;AAE5D,MAAM,WAAW,+BAA+B;IAC9C,iBAAiB,EAAE,CACjB,OAAO,EAAE,sBAAsB,KAC5B,OAAO,CAAC,yBAAyB,CAAC,CAAC;IACxC,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,iBAAiB,EAAE;gBACjB,WAAW,EAAE,OAAO,4BAA4B,CAAC;aAClD,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAC1C,EAAE,EAAE,sBAAsB;AAC1B,AADI,sBAAsB;AAC1B;IAAE,GAAG,EAAE,SAAS,CAAA;CAAE,GAAG,oBAAoB,EAAE,0BAA0B;AACrE,+BAA+B,CAoChC,CAAC"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { createFunction } from "../../utils/function-utils";
|
|
2
|
-
import { authenticationIdGenericResolver } from "../../resolvers";
|
|
3
|
-
import { AuthenticationItemSchema } from "../../schemas/Auth";
|
|
4
|
-
import { createTelemetryCallback } from "../../utils/telemetry-utils";
|
|
5
|
-
import { GetAuthenticationParamSchema, } from "@zapier/zapier-sdk-core/v0/schemas/authentications";
|
|
6
|
-
export const getAuthenticationPlugin = ({ context }) => {
|
|
7
|
-
async function getAuthentication(options) {
|
|
8
|
-
const { api } = context;
|
|
9
|
-
return await api.get(`/api/v0/authentications/${encodeURIComponent(options.authenticationId)}`);
|
|
10
|
-
}
|
|
11
|
-
const getAuthenticationDefinition = createFunction(getAuthentication, GetAuthenticationParamSchema, createTelemetryCallback(context.eventEmission.emitMethodCalled, getAuthentication.name));
|
|
12
|
-
return {
|
|
13
|
-
getAuthentication: getAuthenticationDefinition,
|
|
14
|
-
context: {
|
|
15
|
-
meta: {
|
|
16
|
-
getAuthentication: {
|
|
17
|
-
categories: ["authentication"],
|
|
18
|
-
type: "item",
|
|
19
|
-
itemType: "Authentication",
|
|
20
|
-
inputSchema: GetAuthenticationParamSchema,
|
|
21
|
-
outputSchema: AuthenticationItemSchema,
|
|
22
|
-
resolvers: {
|
|
23
|
-
authenticationId: authenticationIdGenericResolver,
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
};
|
|
29
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../../src/plugins/getAuthentication/index.test.ts"],"names":[],"mappings":""}
|