@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,333 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, vi, beforeEach } from "vitest";
|
|
2
|
-
import { ZapierValidationError, ZapierActionError } from "../../types/errors";
|
|
3
|
-
import { runActionPlugin } from "./index";
|
|
4
|
-
import { createSdk } from "../../sdk";
|
|
5
|
-
const mockAction = {
|
|
6
|
-
type: "action",
|
|
7
|
-
key: "send_message",
|
|
8
|
-
title: "Send Message",
|
|
9
|
-
description: "Send a message to a channel",
|
|
10
|
-
app_key: "slack",
|
|
11
|
-
action_type: "write",
|
|
12
|
-
};
|
|
13
|
-
const mockActionResponse = {
|
|
14
|
-
results: [
|
|
15
|
-
{
|
|
16
|
-
id: "msg_123",
|
|
17
|
-
text: "Hello, world!",
|
|
18
|
-
channel: "#general",
|
|
19
|
-
user: "user_456",
|
|
20
|
-
},
|
|
21
|
-
],
|
|
22
|
-
meta: {
|
|
23
|
-
next_cursor: null,
|
|
24
|
-
},
|
|
25
|
-
};
|
|
26
|
-
describe("runAction plugin", () => {
|
|
27
|
-
let mockApiClient;
|
|
28
|
-
let mockGetAction;
|
|
29
|
-
let mockGetApp;
|
|
30
|
-
beforeEach(() => {
|
|
31
|
-
vi.clearAllMocks();
|
|
32
|
-
mockApiClient = {
|
|
33
|
-
post: vi.fn().mockResolvedValue({ data: { id: "run_123" } }),
|
|
34
|
-
poll: vi.fn().mockResolvedValue({ results: mockActionResponse.results }),
|
|
35
|
-
};
|
|
36
|
-
mockGetAction = vi.fn().mockResolvedValue({
|
|
37
|
-
data: mockAction,
|
|
38
|
-
});
|
|
39
|
-
});
|
|
40
|
-
function createTestSdk() {
|
|
41
|
-
return createSdk()
|
|
42
|
-
.addPlugin(() => ({
|
|
43
|
-
context: {
|
|
44
|
-
options: {},
|
|
45
|
-
},
|
|
46
|
-
}))
|
|
47
|
-
.addPlugin(() => ({
|
|
48
|
-
getAction: mockGetAction,
|
|
49
|
-
getApp: mockGetApp,
|
|
50
|
-
context: {
|
|
51
|
-
api: mockApiClient,
|
|
52
|
-
getVersionedImplementationId: () => "SlackCLIAPI@1.21.1",
|
|
53
|
-
eventEmission: {
|
|
54
|
-
emitMethodCalled: vi.fn(),
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
}))
|
|
58
|
-
.addPlugin(runActionPlugin);
|
|
59
|
-
}
|
|
60
|
-
describe("schema validation", () => {
|
|
61
|
-
it("should throw validation error for missing appKey", () => {
|
|
62
|
-
const sdk = createTestSdk();
|
|
63
|
-
expect(() => {
|
|
64
|
-
sdk.runAction({
|
|
65
|
-
actionType: "write",
|
|
66
|
-
actionKey: "send_message",
|
|
67
|
-
inputs: { message: "Hello" },
|
|
68
|
-
});
|
|
69
|
-
}).toThrow(ZapierValidationError);
|
|
70
|
-
});
|
|
71
|
-
it("should throw validation error for missing actionType", () => {
|
|
72
|
-
const sdk = createTestSdk();
|
|
73
|
-
expect(() => {
|
|
74
|
-
sdk.runAction({
|
|
75
|
-
appKey: "slack",
|
|
76
|
-
actionKey: "send_message",
|
|
77
|
-
inputs: { message: "Hello" },
|
|
78
|
-
});
|
|
79
|
-
}).toThrow(ZapierValidationError);
|
|
80
|
-
});
|
|
81
|
-
it("should throw validation error for missing actionKey", () => {
|
|
82
|
-
const sdk = createTestSdk();
|
|
83
|
-
expect(() => {
|
|
84
|
-
sdk.runAction({
|
|
85
|
-
appKey: "slack",
|
|
86
|
-
actionType: "write",
|
|
87
|
-
inputs: { message: "Hello" },
|
|
88
|
-
});
|
|
89
|
-
}).toThrow(ZapierValidationError);
|
|
90
|
-
});
|
|
91
|
-
it("should pass validation with all required fields", async () => {
|
|
92
|
-
const sdk = createTestSdk();
|
|
93
|
-
const result = await sdk.runAction({
|
|
94
|
-
appKey: "slack",
|
|
95
|
-
actionType: "write",
|
|
96
|
-
actionKey: "send_message",
|
|
97
|
-
inputs: { message: "Hello" },
|
|
98
|
-
});
|
|
99
|
-
expect(result.data).toHaveLength(1);
|
|
100
|
-
expect(result.data[0]).toEqual(mockActionResponse.results[0]);
|
|
101
|
-
});
|
|
102
|
-
});
|
|
103
|
-
describe("action execution", () => {
|
|
104
|
-
it("should validate action exists using getAction", async () => {
|
|
105
|
-
const sdk = createTestSdk();
|
|
106
|
-
await sdk.runAction({
|
|
107
|
-
appKey: "slack",
|
|
108
|
-
actionType: "write",
|
|
109
|
-
actionKey: "send_message",
|
|
110
|
-
inputs: { message: "Hello" },
|
|
111
|
-
});
|
|
112
|
-
expect(mockGetAction).toHaveBeenCalledWith(expect.objectContaining({
|
|
113
|
-
appKey: "slack",
|
|
114
|
-
actionKey: "send_message",
|
|
115
|
-
actionType: "write",
|
|
116
|
-
}));
|
|
117
|
-
});
|
|
118
|
-
it("should throw error when action type doesn't match", async () => {
|
|
119
|
-
// Mock getAction to return an action with different type
|
|
120
|
-
mockGetAction.mockResolvedValue({
|
|
121
|
-
data: { ...mockAction, action_type: "read" },
|
|
122
|
-
});
|
|
123
|
-
const sdk = createTestSdk();
|
|
124
|
-
await expect(sdk.runAction({
|
|
125
|
-
appKey: "slack",
|
|
126
|
-
actionType: "write", // Different from mocked action type
|
|
127
|
-
actionKey: "send_message",
|
|
128
|
-
inputs: { message: "Hello" },
|
|
129
|
-
})).rejects.toThrow(ZapierValidationError);
|
|
130
|
-
});
|
|
131
|
-
it("should execute action with correct API call", async () => {
|
|
132
|
-
const sdk = createTestSdk();
|
|
133
|
-
await sdk.runAction({
|
|
134
|
-
appKey: "slack",
|
|
135
|
-
actionType: "write",
|
|
136
|
-
actionKey: "send_message",
|
|
137
|
-
inputs: { message: "Hello", channel: "#general" },
|
|
138
|
-
authenticationId: 12345,
|
|
139
|
-
});
|
|
140
|
-
expect(mockApiClient.post).toHaveBeenCalledWith("/zapier/api/actions/v1/runs", {
|
|
141
|
-
data: {
|
|
142
|
-
selected_api: "SlackCLIAPI@1.21.1",
|
|
143
|
-
action_key: "send_message",
|
|
144
|
-
action_type: "write",
|
|
145
|
-
inputs: { message: "Hello", channel: "#general" },
|
|
146
|
-
authentication_id: 12345,
|
|
147
|
-
},
|
|
148
|
-
});
|
|
149
|
-
expect(mockApiClient.poll).toHaveBeenCalledWith("/zapier/api/actions/v1/runs/run_123", {
|
|
150
|
-
successStatus: 200,
|
|
151
|
-
pendingStatus: 202,
|
|
152
|
-
resultExtractor: expect.any(Function),
|
|
153
|
-
});
|
|
154
|
-
});
|
|
155
|
-
it("should execute action without authentication ID", async () => {
|
|
156
|
-
const sdk = createTestSdk();
|
|
157
|
-
await sdk.runAction({
|
|
158
|
-
appKey: "slack",
|
|
159
|
-
actionType: "write",
|
|
160
|
-
actionKey: "send_message",
|
|
161
|
-
inputs: { message: "Hello" },
|
|
162
|
-
});
|
|
163
|
-
expect(mockApiClient.post).toHaveBeenCalledWith("/zapier/api/actions/v1/runs", {
|
|
164
|
-
data: {
|
|
165
|
-
selected_api: "SlackCLIAPI@1.21.1",
|
|
166
|
-
action_key: "send_message",
|
|
167
|
-
action_type: "write",
|
|
168
|
-
inputs: { message: "Hello" },
|
|
169
|
-
},
|
|
170
|
-
});
|
|
171
|
-
});
|
|
172
|
-
it("should handle pagination cursor", async () => {
|
|
173
|
-
const sdk = createTestSdk();
|
|
174
|
-
const runActionResult = sdk.runAction({
|
|
175
|
-
appKey: "slack",
|
|
176
|
-
actionType: "write",
|
|
177
|
-
actionKey: "send_message",
|
|
178
|
-
inputs: { message: "Hello" },
|
|
179
|
-
});
|
|
180
|
-
// Simulate pagination by getting an iterator
|
|
181
|
-
const iterator = runActionResult[Symbol.asyncIterator]();
|
|
182
|
-
await iterator.next();
|
|
183
|
-
expect(mockApiClient.post).toHaveBeenCalledWith("/zapier/api/actions/v1/runs", expect.objectContaining({
|
|
184
|
-
data: expect.objectContaining({
|
|
185
|
-
inputs: { message: "Hello" },
|
|
186
|
-
selected_api: "SlackCLIAPI@1.21.1",
|
|
187
|
-
action_key: "send_message",
|
|
188
|
-
action_type: "write",
|
|
189
|
-
}),
|
|
190
|
-
}));
|
|
191
|
-
});
|
|
192
|
-
it("should return results in correct format", async () => {
|
|
193
|
-
const sdk = createTestSdk();
|
|
194
|
-
const result = await sdk.runAction({
|
|
195
|
-
appKey: "slack",
|
|
196
|
-
actionType: "write",
|
|
197
|
-
actionKey: "send_message",
|
|
198
|
-
inputs: { message: "Hello" },
|
|
199
|
-
});
|
|
200
|
-
expect(result.data).toEqual(mockActionResponse.results);
|
|
201
|
-
});
|
|
202
|
-
it("should handle single result (not array)", async () => {
|
|
203
|
-
const singleResult = { id: "msg_123", text: "Hello" };
|
|
204
|
-
mockApiClient.post = vi
|
|
205
|
-
.fn()
|
|
206
|
-
.mockResolvedValue({ data: { id: "run_123" } });
|
|
207
|
-
mockApiClient.poll = vi.fn().mockResolvedValue({
|
|
208
|
-
results: [singleResult], // Poll returns the actual results
|
|
209
|
-
});
|
|
210
|
-
const sdk = createTestSdk();
|
|
211
|
-
const result = await sdk.runAction({
|
|
212
|
-
appKey: "slack",
|
|
213
|
-
actionType: "write",
|
|
214
|
-
actionKey: "send_message",
|
|
215
|
-
inputs: { message: "Hello" },
|
|
216
|
-
});
|
|
217
|
-
expect(result.data).toEqual([singleResult]); // Should be wrapped in array
|
|
218
|
-
});
|
|
219
|
-
});
|
|
220
|
-
describe("error handling", () => {
|
|
221
|
-
it("should handle action execution errors", async () => {
|
|
222
|
-
mockApiClient.post = vi
|
|
223
|
-
.fn()
|
|
224
|
-
.mockResolvedValue({ data: { id: "run_123" } });
|
|
225
|
-
mockApiClient.poll = vi.fn().mockResolvedValue({
|
|
226
|
-
results: [],
|
|
227
|
-
errors: [
|
|
228
|
-
{ title: "Invalid inputs", detail: "Message cannot be empty" },
|
|
229
|
-
],
|
|
230
|
-
});
|
|
231
|
-
const sdk = createTestSdk();
|
|
232
|
-
await expect(sdk.runAction({
|
|
233
|
-
appKey: "slack",
|
|
234
|
-
actionType: "write",
|
|
235
|
-
actionKey: "send_message",
|
|
236
|
-
inputs: { message: "" }, // Invalid input
|
|
237
|
-
})).rejects.toThrow(ZapierActionError);
|
|
238
|
-
});
|
|
239
|
-
it("should handle server errors", async () => {
|
|
240
|
-
mockApiClient.post = vi.fn().mockImplementation((_url, options) => {
|
|
241
|
-
const error = options.customErrorHandler?.({
|
|
242
|
-
status: 500,
|
|
243
|
-
data: { message: "Internal server error" },
|
|
244
|
-
});
|
|
245
|
-
if (error)
|
|
246
|
-
throw error;
|
|
247
|
-
throw new Error("Server Error");
|
|
248
|
-
});
|
|
249
|
-
const sdk = createTestSdk();
|
|
250
|
-
await expect(sdk.runAction({
|
|
251
|
-
appKey: "slack",
|
|
252
|
-
actionType: "write",
|
|
253
|
-
actionKey: "send_message",
|
|
254
|
-
inputs: { message: "Hello" },
|
|
255
|
-
})).rejects.toThrow();
|
|
256
|
-
});
|
|
257
|
-
it("should propagate getAction errors", async () => {
|
|
258
|
-
mockGetAction.mockRejectedValue(new Error("Action not found"));
|
|
259
|
-
const sdk = createTestSdk();
|
|
260
|
-
await expect(sdk.runAction({
|
|
261
|
-
appKey: "slack",
|
|
262
|
-
actionType: "write",
|
|
263
|
-
actionKey: "nonexistent",
|
|
264
|
-
inputs: { message: "Hello" },
|
|
265
|
-
})).rejects.toThrow("Action not found");
|
|
266
|
-
});
|
|
267
|
-
it("should handle unexpected errors during execution", async () => {
|
|
268
|
-
mockApiClient.post = vi
|
|
269
|
-
.fn()
|
|
270
|
-
.mockRejectedValue(new Error("Network error"));
|
|
271
|
-
const sdk = createTestSdk();
|
|
272
|
-
await expect(sdk.runAction({
|
|
273
|
-
appKey: "slack",
|
|
274
|
-
actionType: "write",
|
|
275
|
-
actionKey: "send_message",
|
|
276
|
-
inputs: { message: "Hello" },
|
|
277
|
-
})).rejects.toThrow("Network error");
|
|
278
|
-
});
|
|
279
|
-
});
|
|
280
|
-
describe("pagination", () => {
|
|
281
|
-
it("should support maxItems limit", async () => {
|
|
282
|
-
const sdk = createTestSdk();
|
|
283
|
-
const result = await sdk.runAction({
|
|
284
|
-
appKey: "slack",
|
|
285
|
-
actionType: "write",
|
|
286
|
-
actionKey: "send_message",
|
|
287
|
-
inputs: { message: "Hello" },
|
|
288
|
-
maxItems: 1,
|
|
289
|
-
});
|
|
290
|
-
expect(result.data).toHaveLength(1);
|
|
291
|
-
});
|
|
292
|
-
it("should support async iteration over pages", async () => {
|
|
293
|
-
const sdk = createTestSdk();
|
|
294
|
-
const runActionResult = sdk.runAction({
|
|
295
|
-
appKey: "slack",
|
|
296
|
-
actionType: "write",
|
|
297
|
-
actionKey: "send_message",
|
|
298
|
-
inputs: { message: "Hello" },
|
|
299
|
-
});
|
|
300
|
-
const pages = [];
|
|
301
|
-
for await (const page of runActionResult) {
|
|
302
|
-
pages.push(page);
|
|
303
|
-
break; // Just get first page for testing
|
|
304
|
-
}
|
|
305
|
-
expect(pages).toHaveLength(1);
|
|
306
|
-
expect(pages[0].data).toEqual(mockActionResponse.results);
|
|
307
|
-
});
|
|
308
|
-
it("should support async iteration over individual items", async () => {
|
|
309
|
-
const sdk = createTestSdk();
|
|
310
|
-
const runActionResult = sdk.runAction({
|
|
311
|
-
appKey: "slack",
|
|
312
|
-
actionType: "write",
|
|
313
|
-
actionKey: "send_message",
|
|
314
|
-
inputs: { message: "Hello" },
|
|
315
|
-
maxItems: 1,
|
|
316
|
-
});
|
|
317
|
-
const items = [];
|
|
318
|
-
for await (const item of runActionResult.items()) {
|
|
319
|
-
items.push(item);
|
|
320
|
-
}
|
|
321
|
-
expect(items).toHaveLength(1);
|
|
322
|
-
expect(items[0]).toEqual(mockActionResponse.results[0]);
|
|
323
|
-
});
|
|
324
|
-
});
|
|
325
|
-
describe("context and metadata", () => {
|
|
326
|
-
it("should provide context with meta information", () => {
|
|
327
|
-
const sdk = createTestSdk();
|
|
328
|
-
const context = sdk.getContext();
|
|
329
|
-
expect(context.meta.runAction).toBeDefined();
|
|
330
|
-
expect(context.meta.runAction.inputSchema).toBeDefined();
|
|
331
|
-
});
|
|
332
|
-
});
|
|
333
|
-
});
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import type { PaginatedSdkFunction } from "../../types/functions";
|
|
3
|
-
import type { ZapierActionError, ZapierValidationError, ZapierConfigurationError, ZapierUnknownError } from "../../types/errors";
|
|
4
|
-
export declare const RunActionSchema: 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
|
-
authenticationId: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
|
|
20
|
-
inputs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
21
|
-
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
22
|
-
maxItems: z.ZodOptional<z.ZodNumber>;
|
|
23
|
-
cursor: z.ZodOptional<z.ZodString>;
|
|
24
|
-
}, z.core.$strip>;
|
|
25
|
-
export type RunActionOptions = z.infer<typeof RunActionSchema>;
|
|
26
|
-
export interface RunActionPage {
|
|
27
|
-
data: unknown[];
|
|
28
|
-
nextCursor?: string;
|
|
29
|
-
}
|
|
30
|
-
export type RunActionError = ZapierActionError | ZapierValidationError | ZapierConfigurationError | ZapierUnknownError;
|
|
31
|
-
export interface RunActionSdkFunction {
|
|
32
|
-
runAction: PaginatedSdkFunction<RunActionOptions, unknown>;
|
|
33
|
-
}
|
|
34
|
-
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/runAction/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,KAAK,EACV,iBAAiB,EACjB,qBAAqB,EACrB,wBAAwB,EACxB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAG5B,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;iBAqB0B,CAAC;AAGvD,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAG/D,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,OAAO,EAAE,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAGD,MAAM,MAAM,cAAc,GACtB,iBAAiB,GACjB,qBAAqB,GACrB,wBAAwB,GACxB,kBAAkB,CAAC;AAGvB,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,oBAAoB,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;CAC5D"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { AppKeyPropertySchema, ActionTypePropertySchema, ActionKeyPropertySchema, AuthenticationIdPropertySchema, InputsPropertySchema, } from "../../types/properties";
|
|
3
|
-
// Pure Zod schema - no resolver metadata!
|
|
4
|
-
export const RunActionSchema = z
|
|
5
|
-
.object({
|
|
6
|
-
appKey: AppKeyPropertySchema,
|
|
7
|
-
actionType: ActionTypePropertySchema,
|
|
8
|
-
actionKey: ActionKeyPropertySchema,
|
|
9
|
-
authenticationId: AuthenticationIdPropertySchema.nullable().optional(),
|
|
10
|
-
inputs: InputsPropertySchema.optional().describe("Input parameters for the action"),
|
|
11
|
-
pageSize: z
|
|
12
|
-
.number()
|
|
13
|
-
.min(1)
|
|
14
|
-
.optional()
|
|
15
|
-
.describe("Number of results per page"),
|
|
16
|
-
maxItems: z
|
|
17
|
-
.number()
|
|
18
|
-
.min(1)
|
|
19
|
-
.optional()
|
|
20
|
-
.describe("Maximum total items to return across all pages"),
|
|
21
|
-
cursor: z.string().optional().describe("Cursor to start from"),
|
|
22
|
-
})
|
|
23
|
-
.describe("Execute an action with the given inputs");
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { DynamicResolver } from "../utils/schema-utils";
|
|
2
|
-
import type { ActionTypeProperty } from "../types/properties";
|
|
3
|
-
interface ActionItem {
|
|
4
|
-
key: string;
|
|
5
|
-
title?: string;
|
|
6
|
-
name?: string;
|
|
7
|
-
description?: string;
|
|
8
|
-
action_type: string;
|
|
9
|
-
}
|
|
10
|
-
export declare const actionKeyResolver: DynamicResolver<ActionItem, {
|
|
11
|
-
appKey: string;
|
|
12
|
-
actionType: ActionTypeProperty;
|
|
13
|
-
}>;
|
|
14
|
-
export {};
|
|
15
|
-
//# sourceMappingURL=actionKey.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"actionKey.d.ts","sourceRoot":"","sources":["../../src/resolvers/actionKey.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAE9D,UAAU,UAAU;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,iBAAiB,EAAE,eAAe,CAC7C,UAAU,EACV;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,kBAAkB,CAAA;CAAE,CAuBnD,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export const actionKeyResolver = {
|
|
2
|
-
type: "dynamic",
|
|
3
|
-
depends: ["appKey", "actionType"],
|
|
4
|
-
fetch: async (sdk, resolvedParams) => {
|
|
5
|
-
const actionsResponse = await sdk.listActions({
|
|
6
|
-
appKey: resolvedParams.appKey,
|
|
7
|
-
});
|
|
8
|
-
return actionsResponse.data.filter((action) => action.action_type === resolvedParams.actionType);
|
|
9
|
-
},
|
|
10
|
-
prompt: (actions) => ({
|
|
11
|
-
type: "list",
|
|
12
|
-
name: "actionKey",
|
|
13
|
-
message: "Select action:",
|
|
14
|
-
choices: actions.map((action) => ({
|
|
15
|
-
name: `${action.title || action.name || action.key} - ${action.description || "No description"}`,
|
|
16
|
-
value: action.key,
|
|
17
|
-
})),
|
|
18
|
-
}),
|
|
19
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { DynamicResolver } from "../utils/schema-utils";
|
|
2
|
-
interface ActionTypeItem {
|
|
3
|
-
key: string;
|
|
4
|
-
name: string;
|
|
5
|
-
}
|
|
6
|
-
export declare const actionTypeResolver: DynamicResolver<ActionTypeItem, {
|
|
7
|
-
appKey: string;
|
|
8
|
-
}>;
|
|
9
|
-
export {};
|
|
10
|
-
//# sourceMappingURL=actionType.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"actionType.d.ts","sourceRoot":"","sources":["../../src/resolvers/actionType.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,UAAU,cAAc;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CACd;AAED,eAAO,MAAM,kBAAkB,EAAE,eAAe,CAC9C,cAAc,EACd;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAwBnB,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export const actionTypeResolver = {
|
|
2
|
-
type: "dynamic",
|
|
3
|
-
depends: ["appKey"],
|
|
4
|
-
fetch: async (sdk, resolvedParams) => {
|
|
5
|
-
const actionsResponse = await sdk.listActions({
|
|
6
|
-
appKey: resolvedParams.appKey,
|
|
7
|
-
});
|
|
8
|
-
const actionTypes = actionsResponse.data.map((action) => action.action_type);
|
|
9
|
-
const types = [...new Set(actionTypes)];
|
|
10
|
-
return types.map((type) => ({ key: type, name: type }));
|
|
11
|
-
},
|
|
12
|
-
prompt: (types) => ({
|
|
13
|
-
type: "list",
|
|
14
|
-
name: "actionType",
|
|
15
|
-
message: "Select action type:",
|
|
16
|
-
choices: types.map((type) => ({
|
|
17
|
-
name: type.name,
|
|
18
|
-
value: type.key,
|
|
19
|
-
})),
|
|
20
|
-
}),
|
|
21
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"appKey.d.ts","sourceRoot":"","sources":["../../src/resolvers/appKey.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D,eAAO,MAAM,cAAc,EAAE,cAI5B,CAAC"}
|
package/dist/resolvers/appKey.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { DynamicResolver } from "../utils/schema-utils";
|
|
2
|
-
import type { AuthItem } from "../schemas/Auth";
|
|
3
|
-
type AuthenticationIdResolver = DynamicResolver<AuthItem, {
|
|
4
|
-
appKey?: string;
|
|
5
|
-
}>;
|
|
6
|
-
export declare const authenticationIdResolver: AuthenticationIdResolver;
|
|
7
|
-
export declare const authenticationIdGenericResolver: AuthenticationIdResolver;
|
|
8
|
-
export {};
|
|
9
|
-
//# sourceMappingURL=authenticationId.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"authenticationId.d.ts","sourceRoot":"","sources":["../../src/resolvers/authenticationId.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEhD,KAAK,wBAAwB,GAAG,eAAe,CAAC,QAAQ,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAE/E,eAAO,MAAM,wBAAwB,EAAE,wBA0CtC,CAAC;AAGF,eAAO,MAAM,+BAA+B,EAAE,wBAG7C,CAAC"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
export const authenticationIdResolver = {
|
|
2
|
-
type: "dynamic",
|
|
3
|
-
depends: ["appKey"],
|
|
4
|
-
fetch: async (sdk, resolvedParams) => {
|
|
5
|
-
const listOptions = {
|
|
6
|
-
maxItems: 1000,
|
|
7
|
-
};
|
|
8
|
-
if (resolvedParams.appKey) {
|
|
9
|
-
listOptions.appKey = resolvedParams.appKey;
|
|
10
|
-
}
|
|
11
|
-
const myAuths = await sdk.listAuthentications({
|
|
12
|
-
...listOptions,
|
|
13
|
-
owner: "me",
|
|
14
|
-
});
|
|
15
|
-
const allAuths = await sdk.listAuthentications(listOptions);
|
|
16
|
-
// Filter out myAuths from allAuths
|
|
17
|
-
const otherAuths = allAuths.data.filter((auth) => !myAuths.data.some((myAuth) => myAuth.id === auth.id));
|
|
18
|
-
return [...myAuths.data, ...otherAuths];
|
|
19
|
-
},
|
|
20
|
-
prompt: (auths, params) => ({
|
|
21
|
-
type: "list",
|
|
22
|
-
name: "authenticationId",
|
|
23
|
-
message: params.appKey
|
|
24
|
-
? `Select authentication for ${params.appKey}:`
|
|
25
|
-
: "Select authentication:",
|
|
26
|
-
choices: [
|
|
27
|
-
...auths.map((auth) => ({
|
|
28
|
-
name: `${auth.title || auth.label || "Authentication"} (ID: ${auth.id})`,
|
|
29
|
-
value: auth.id,
|
|
30
|
-
})),
|
|
31
|
-
{
|
|
32
|
-
name: "↗ Skip authentication (may fail)",
|
|
33
|
-
value: null,
|
|
34
|
-
},
|
|
35
|
-
],
|
|
36
|
-
}),
|
|
37
|
-
};
|
|
38
|
-
// Generic version without appKey dependency
|
|
39
|
-
export const authenticationIdGenericResolver = {
|
|
40
|
-
...authenticationIdResolver,
|
|
41
|
-
depends: [],
|
|
42
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export { appKeyResolver } from "./appKey";
|
|
2
|
-
export { actionTypeResolver } from "./actionType";
|
|
3
|
-
export { actionKeyResolver } from "./actionKey";
|
|
4
|
-
export { authenticationIdResolver, authenticationIdGenericResolver, } from "./authenticationId";
|
|
5
|
-
export { inputsResolver } from "./inputs";
|
|
6
|
-
export { inputFieldKeyResolver } from "./inputFieldKey";
|
|
7
|
-
export { inputsAllOptionalResolver } from "./inputs";
|
|
8
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resolvers/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EACL,wBAAwB,EACxB,+BAA+B,GAChC,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC"}
|
package/dist/resolvers/index.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
// Re-export individual resolvers for plugin use
|
|
2
|
-
export { appKeyResolver } from "./appKey";
|
|
3
|
-
export { actionTypeResolver } from "./actionType";
|
|
4
|
-
export { actionKeyResolver } from "./actionKey";
|
|
5
|
-
export { authenticationIdResolver, authenticationIdGenericResolver, } from "./authenticationId";
|
|
6
|
-
export { inputsResolver } from "./inputs";
|
|
7
|
-
export { inputFieldKeyResolver } from "./inputFieldKey";
|
|
8
|
-
export { inputsAllOptionalResolver } from "./inputs";
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { DynamicResolver } from "../utils/schema-utils";
|
|
2
|
-
import type { InputFieldItem } from "../schemas/Field";
|
|
3
|
-
import type { ActionTypeProperty } from "../types/properties";
|
|
4
|
-
export declare const inputFieldKeyResolver: DynamicResolver<InputFieldItem, {
|
|
5
|
-
appKey: string;
|
|
6
|
-
actionKey: string;
|
|
7
|
-
actionType: ActionTypeProperty;
|
|
8
|
-
authenticationId: string | number;
|
|
9
|
-
inputs?: Record<string, unknown>;
|
|
10
|
-
}>;
|
|
11
|
-
//# sourceMappingURL=inputFieldKey.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"inputFieldKey.d.ts","sourceRoot":"","sources":["../../src/resolvers/inputFieldKey.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAiC9D,eAAO,MAAM,qBAAqB,EAAE,eAAe,CACjD,cAAc,EACd;IACE,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,kBAAkB,CAAC;IAC/B,gBAAgB,EAAE,MAAM,GAAG,MAAM,CAAC;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC,CA0BF,CAAC"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Helper function to flatten fieldsets into a flat array of input fields.
|
|
3
|
-
* Used to extract all input fields from nested fieldset structure for field selection.
|
|
4
|
-
*/
|
|
5
|
-
function flattenRootFieldset(rootFieldset) {
|
|
6
|
-
const result = [];
|
|
7
|
-
function processItem(item) {
|
|
8
|
-
if (item.type === "input_field") {
|
|
9
|
-
result.push(item);
|
|
10
|
-
}
|
|
11
|
-
else if (item.type === "fieldset") {
|
|
12
|
-
// Recursively process fields in the fieldset
|
|
13
|
-
for (const field of item.fields) {
|
|
14
|
-
processItem(field);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
// Skip info fields as they're not input fields
|
|
18
|
-
}
|
|
19
|
-
for (const item of rootFieldset) {
|
|
20
|
-
processItem(item);
|
|
21
|
-
}
|
|
22
|
-
return result;
|
|
23
|
-
}
|
|
24
|
-
export const inputFieldKeyResolver = {
|
|
25
|
-
type: "dynamic",
|
|
26
|
-
depends: ["appKey", "actionKey", "actionType", "authenticationId"],
|
|
27
|
-
fetch: async (sdk, resolvedParams) => {
|
|
28
|
-
const fieldsResponse = await sdk.listInputFields({
|
|
29
|
-
appKey: resolvedParams.appKey,
|
|
30
|
-
actionKey: resolvedParams.actionKey,
|
|
31
|
-
actionType: resolvedParams.actionType,
|
|
32
|
-
authenticationId: resolvedParams.authenticationId,
|
|
33
|
-
inputs: resolvedParams.inputs, // Pass along currently resolved inputs
|
|
34
|
-
});
|
|
35
|
-
// Flatten the fieldset structure for field selection
|
|
36
|
-
return flattenRootFieldset(fieldsResponse.data);
|
|
37
|
-
},
|
|
38
|
-
prompt: (fields) => ({
|
|
39
|
-
type: "list",
|
|
40
|
-
name: "inputFieldKey",
|
|
41
|
-
message: "Select input field:",
|
|
42
|
-
choices: fields.map((field) => ({
|
|
43
|
-
name: `${field.title || field.key} - ${field.value_type || "No type"} ${field.is_required ? "(required)" : "(optional)"}`,
|
|
44
|
-
value: field.key,
|
|
45
|
-
})),
|
|
46
|
-
}),
|
|
47
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { ActionTypeProperty } from "../types/properties";
|
|
2
|
-
import type { RootFieldItem } from "../types/domain";
|
|
3
|
-
type InputsResolver = {
|
|
4
|
-
type: "fields";
|
|
5
|
-
depends: readonly string[];
|
|
6
|
-
fetch: (sdk: any, resolvedParams: {
|
|
7
|
-
appKey: string;
|
|
8
|
-
actionKey: string;
|
|
9
|
-
actionType: ActionTypeProperty;
|
|
10
|
-
authenticationId: string | number;
|
|
11
|
-
inputs?: Record<string, unknown>;
|
|
12
|
-
}) => Promise<RootFieldItem[]>;
|
|
13
|
-
};
|
|
14
|
-
export declare const inputsResolver: InputsResolver;
|
|
15
|
-
export declare const inputsAllOptionalResolver: InputsResolver;
|
|
16
|
-
export {};
|
|
17
|
-
//# sourceMappingURL=inputs.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"inputs.d.ts","sourceRoot":"","sources":["../../src/resolvers/inputs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAuBrD,KAAK,cAAc,GAAG;IACpB,IAAI,EAAE,QAAQ,CAAC;IACf,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B,KAAK,EAAE,CACL,GAAG,EAAE,GAAG,EACR,cAAc,EAAE;QACd,MAAM,EAAE,MAAM,CAAC;QACf,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,kBAAkB,CAAC;QAC/B,gBAAgB,EAAE,MAAM,GAAG,MAAM,CAAC;QAClC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAClC,KACE,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC;CAC/B,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,cAa5B,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,cAcvC,CAAC"}
|