@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,94 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, vi } from "vitest";
|
|
2
|
-
import { createTelemetryCallback } from "./telemetry-utils";
|
|
3
|
-
describe("createTelemetryCallback", () => {
|
|
4
|
-
it("should create callback that emits telemetry with explicit method name", () => {
|
|
5
|
-
const mockEmit = vi.fn();
|
|
6
|
-
const callback = createTelemetryCallback(mockEmit, "testMethod");
|
|
7
|
-
callback.onMethodCalled({
|
|
8
|
-
methodName: "ignoredName",
|
|
9
|
-
durationMs: 123,
|
|
10
|
-
success: true,
|
|
11
|
-
argumentCount: 2,
|
|
12
|
-
isPaginated: false,
|
|
13
|
-
});
|
|
14
|
-
expect(mockEmit).toHaveBeenCalledWith({
|
|
15
|
-
method_name: "testMethod",
|
|
16
|
-
execution_duration_ms: 123,
|
|
17
|
-
success_flag: true,
|
|
18
|
-
error_message: null,
|
|
19
|
-
error_type: null,
|
|
20
|
-
argument_count: 2,
|
|
21
|
-
is_paginated: false,
|
|
22
|
-
});
|
|
23
|
-
});
|
|
24
|
-
it("should include error details when method fails", () => {
|
|
25
|
-
const mockEmit = vi.fn();
|
|
26
|
-
const callback = createTelemetryCallback(mockEmit, "failingMethod");
|
|
27
|
-
const testError = new Error("Test failure");
|
|
28
|
-
callback.onMethodCalled({
|
|
29
|
-
methodName: "ignoredName",
|
|
30
|
-
durationMs: 50,
|
|
31
|
-
success: false,
|
|
32
|
-
error: testError,
|
|
33
|
-
argumentCount: 1,
|
|
34
|
-
isPaginated: false,
|
|
35
|
-
});
|
|
36
|
-
expect(mockEmit).toHaveBeenCalledWith({
|
|
37
|
-
method_name: "failingMethod",
|
|
38
|
-
execution_duration_ms: 50,
|
|
39
|
-
success_flag: false,
|
|
40
|
-
error_message: "Test failure",
|
|
41
|
-
error_type: "Error",
|
|
42
|
-
argument_count: 1,
|
|
43
|
-
is_paginated: false,
|
|
44
|
-
});
|
|
45
|
-
});
|
|
46
|
-
it("should handle paginated method calls", () => {
|
|
47
|
-
const mockEmit = vi.fn();
|
|
48
|
-
const callback = createTelemetryCallback(mockEmit, "listItems");
|
|
49
|
-
callback.onMethodCalled({
|
|
50
|
-
methodName: "ignoredName",
|
|
51
|
-
durationMs: 200,
|
|
52
|
-
success: true,
|
|
53
|
-
argumentCount: 1,
|
|
54
|
-
isPaginated: true,
|
|
55
|
-
});
|
|
56
|
-
expect(mockEmit).toHaveBeenCalledWith({
|
|
57
|
-
method_name: "listItems",
|
|
58
|
-
execution_duration_ms: 200,
|
|
59
|
-
success_flag: true,
|
|
60
|
-
error_message: null,
|
|
61
|
-
error_type: null,
|
|
62
|
-
argument_count: 1,
|
|
63
|
-
is_paginated: true,
|
|
64
|
-
});
|
|
65
|
-
});
|
|
66
|
-
it("should handle custom error types", () => {
|
|
67
|
-
const mockEmit = vi.fn();
|
|
68
|
-
const callback = createTelemetryCallback(mockEmit, "customFailMethod");
|
|
69
|
-
class CustomError extends Error {
|
|
70
|
-
constructor(message) {
|
|
71
|
-
super(message);
|
|
72
|
-
this.name = "CustomError";
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
const customError = new CustomError("Custom failure");
|
|
76
|
-
callback.onMethodCalled({
|
|
77
|
-
methodName: "ignoredName",
|
|
78
|
-
durationMs: 75,
|
|
79
|
-
success: false,
|
|
80
|
-
error: customError,
|
|
81
|
-
argumentCount: 3,
|
|
82
|
-
isPaginated: false,
|
|
83
|
-
});
|
|
84
|
-
expect(mockEmit).toHaveBeenCalledWith({
|
|
85
|
-
method_name: "customFailMethod",
|
|
86
|
-
execution_duration_ms: 75,
|
|
87
|
-
success_flag: false,
|
|
88
|
-
error_message: "Custom failure",
|
|
89
|
-
error_type: "CustomError",
|
|
90
|
-
argument_count: 3,
|
|
91
|
-
is_paginated: false,
|
|
92
|
-
});
|
|
93
|
-
});
|
|
94
|
-
});
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Gets the Zapier base URL from a baseUrl if it matches Zapier hosting patterns.
|
|
3
|
-
* Returns the root domain URL or undefined if not a Zapier domain.
|
|
4
|
-
* This combines domain checking and URL extraction logic.
|
|
5
|
-
*/
|
|
6
|
-
export declare function getZapierBaseUrl(baseUrl?: string): string | undefined;
|
|
7
|
-
/**
|
|
8
|
-
* Gets tracking base URL with the following precedence:
|
|
9
|
-
* 1. Explicit trackingBaseUrl parameter
|
|
10
|
-
* 2. ZAPIER_TRACKING_BASE_URL environment variable
|
|
11
|
-
* 3. Derive from baseUrl if it's a Zapier domain
|
|
12
|
-
* 4. Use baseUrl directly (whether Zapier-hosted or not)
|
|
13
|
-
* 5. Default to ZAPIER_BASE_URL constant
|
|
14
|
-
*/
|
|
15
|
-
export declare function getTrackingBaseUrl({ trackingBaseUrl, baseUrl, }: {
|
|
16
|
-
trackingBaseUrl?: string;
|
|
17
|
-
baseUrl?: string;
|
|
18
|
-
}): string;
|
|
19
|
-
//# sourceMappingURL=url-utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"url-utils.d.ts","sourceRoot":"","sources":["../../src/utils/url-utils.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CA+BrE;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,eAAe,EACf,OAAO,GACR,EAAE;IACD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,GAAG,MAAM,CA0BT"}
|
package/dist/utils/url-utils.js
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { ZAPIER_BASE_URL } from "../constants";
|
|
2
|
-
/**
|
|
3
|
-
* Gets the Zapier base URL from a baseUrl if it matches Zapier hosting patterns.
|
|
4
|
-
* Returns the root domain URL or undefined if not a Zapier domain.
|
|
5
|
-
* This combines domain checking and URL extraction logic.
|
|
6
|
-
*/
|
|
7
|
-
export function getZapierBaseUrl(baseUrl) {
|
|
8
|
-
if (!baseUrl) {
|
|
9
|
-
return undefined;
|
|
10
|
-
}
|
|
11
|
-
try {
|
|
12
|
-
const url = new URL(baseUrl);
|
|
13
|
-
const hostname = url.hostname;
|
|
14
|
-
// Check if it matches Zapier hosting patterns by examining the last two parts
|
|
15
|
-
const hostParts = hostname.split(".");
|
|
16
|
-
if (hostParts.length < 2) {
|
|
17
|
-
return undefined;
|
|
18
|
-
}
|
|
19
|
-
// Check if any part is "zapier" or starts with "zapier-"
|
|
20
|
-
const hasZapierPart = hostParts.some((part) => part === "zapier" || part.startsWith("zapier-"));
|
|
21
|
-
if (!hasZapierPart) {
|
|
22
|
-
return undefined;
|
|
23
|
-
}
|
|
24
|
-
// Extract root domain using the last two parts
|
|
25
|
-
const rootDomain = hostParts.slice(-2).join(".");
|
|
26
|
-
return `${url.protocol}//${rootDomain}`;
|
|
27
|
-
}
|
|
28
|
-
catch {
|
|
29
|
-
return undefined;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Gets tracking base URL with the following precedence:
|
|
34
|
-
* 1. Explicit trackingBaseUrl parameter
|
|
35
|
-
* 2. ZAPIER_TRACKING_BASE_URL environment variable
|
|
36
|
-
* 3. Derive from baseUrl if it's a Zapier domain
|
|
37
|
-
* 4. Use baseUrl directly (whether Zapier-hosted or not)
|
|
38
|
-
* 5. Default to ZAPIER_BASE_URL constant
|
|
39
|
-
*/
|
|
40
|
-
export function getTrackingBaseUrl({ trackingBaseUrl, baseUrl, }) {
|
|
41
|
-
// 1. Explicit parameter takes highest precedence
|
|
42
|
-
if (trackingBaseUrl) {
|
|
43
|
-
return trackingBaseUrl;
|
|
44
|
-
}
|
|
45
|
-
// 2. Environment variable override
|
|
46
|
-
if (process.env.ZAPIER_TRACKING_BASE_URL) {
|
|
47
|
-
return process.env.ZAPIER_TRACKING_BASE_URL;
|
|
48
|
-
}
|
|
49
|
-
// 3. Try to derive from baseUrl if it's a Zapier domain
|
|
50
|
-
if (baseUrl) {
|
|
51
|
-
const zapierBaseUrl = getZapierBaseUrl(baseUrl);
|
|
52
|
-
if (zapierBaseUrl) {
|
|
53
|
-
return zapierBaseUrl;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
// 4. Use baseUrl directly for tracking (whether Zapier-hosted or not)
|
|
57
|
-
if (baseUrl) {
|
|
58
|
-
return baseUrl;
|
|
59
|
-
}
|
|
60
|
-
// 5. Default to ZAPIER_BASE_URL constant
|
|
61
|
-
return ZAPIER_BASE_URL;
|
|
62
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"url-utils.test.d.ts","sourceRoot":"","sources":["../../src/utils/url-utils.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, beforeEach, afterEach, vi } from "vitest";
|
|
2
|
-
import { getZapierBaseUrl, getTrackingBaseUrl } from "./url-utils";
|
|
3
|
-
describe("getZapierBaseUrl", () => {
|
|
4
|
-
describe("with valid Zapier domains", () => {
|
|
5
|
-
it("should return root domain for zapier.* patterns", () => {
|
|
6
|
-
expect(getZapierBaseUrl("https://zapier.com")).toBe("https://zapier.com");
|
|
7
|
-
expect(getZapierBaseUrl("https://api.zapier.com")).toBe("https://zapier.com");
|
|
8
|
-
expect(getZapierBaseUrl("https://staging.zapier.com")).toBe("https://zapier.com");
|
|
9
|
-
expect(getZapierBaseUrl("https://custom.zapier.dev:8080")).toBe("https://zapier.dev");
|
|
10
|
-
});
|
|
11
|
-
it("should return root domain for zapier-*.* patterns", () => {
|
|
12
|
-
expect(getZapierBaseUrl("https://zapier-staging.dev")).toBe("https://zapier-staging.dev");
|
|
13
|
-
expect(getZapierBaseUrl("https://zapier-production.example.com")).toBe("https://example.com");
|
|
14
|
-
expect(getZapierBaseUrl("http://zapier-custom.local")).toBe("http://zapier-custom.local");
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
|
-
describe("with non-Zapier domains", () => {
|
|
18
|
-
it("should return undefined for non-Zapier domains", () => {
|
|
19
|
-
expect(getZapierBaseUrl("https://example.com")).toBe(undefined);
|
|
20
|
-
expect(getZapierBaseUrl("https://api.example.com")).toBe(undefined);
|
|
21
|
-
expect(getZapierBaseUrl("http://localhost")).toBe(undefined);
|
|
22
|
-
expect(getZapierBaseUrl("http://127.0.0.1")).toBe(undefined);
|
|
23
|
-
expect(getZapierBaseUrl("https://my-zapier.com")).toBe(undefined);
|
|
24
|
-
});
|
|
25
|
-
});
|
|
26
|
-
describe("with invalid inputs", () => {
|
|
27
|
-
it("should return undefined for invalid or missing URLs", () => {
|
|
28
|
-
expect(getZapierBaseUrl()).toBe(undefined);
|
|
29
|
-
expect(getZapierBaseUrl(undefined)).toBe(undefined);
|
|
30
|
-
expect(getZapierBaseUrl("")).toBe(undefined);
|
|
31
|
-
expect(getZapierBaseUrl("invalid-url")).toBe(undefined);
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
describe("getTrackingBaseUrl", () => {
|
|
36
|
-
let originalEnv;
|
|
37
|
-
beforeEach(() => {
|
|
38
|
-
originalEnv = {
|
|
39
|
-
ZAPIER_TRACKING_BASE_URL: process.env.ZAPIER_TRACKING_BASE_URL,
|
|
40
|
-
ZAPIER_BASE_URL: process.env.ZAPIER_BASE_URL,
|
|
41
|
-
};
|
|
42
|
-
});
|
|
43
|
-
afterEach(() => {
|
|
44
|
-
if (originalEnv.ZAPIER_TRACKING_BASE_URL !== undefined) {
|
|
45
|
-
process.env.ZAPIER_TRACKING_BASE_URL =
|
|
46
|
-
originalEnv.ZAPIER_TRACKING_BASE_URL;
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
delete process.env.ZAPIER_TRACKING_BASE_URL;
|
|
50
|
-
}
|
|
51
|
-
if (originalEnv.ZAPIER_BASE_URL !== undefined) {
|
|
52
|
-
process.env.ZAPIER_BASE_URL = originalEnv.ZAPIER_BASE_URL;
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
delete process.env.ZAPIER_BASE_URL;
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
describe("precedence rules", () => {
|
|
59
|
-
it("should prioritize trackingBaseUrl parameter", () => {
|
|
60
|
-
process.env.ZAPIER_TRACKING_BASE_URL = "https://env-tracking.zapier.com";
|
|
61
|
-
expect(getTrackingBaseUrl({
|
|
62
|
-
trackingBaseUrl: "https://param-tracking.zapier.com",
|
|
63
|
-
baseUrl: "https://api.example.com",
|
|
64
|
-
})).toBe("https://param-tracking.zapier.com");
|
|
65
|
-
});
|
|
66
|
-
it("should use ZAPIER_TRACKING_BASE_URL environment variable", () => {
|
|
67
|
-
process.env.ZAPIER_TRACKING_BASE_URL = "https://env-tracking.zapier.com";
|
|
68
|
-
expect(getTrackingBaseUrl({
|
|
69
|
-
baseUrl: "https://api.example.com",
|
|
70
|
-
})).toBe("https://env-tracking.zapier.com");
|
|
71
|
-
});
|
|
72
|
-
it("should derive from baseUrl if it's a Zapier domain", () => {
|
|
73
|
-
delete process.env.ZAPIER_TRACKING_BASE_URL;
|
|
74
|
-
expect(getTrackingBaseUrl({
|
|
75
|
-
baseUrl: "https://api.zapier.com",
|
|
76
|
-
})).toBe("https://zapier.com");
|
|
77
|
-
expect(getTrackingBaseUrl({
|
|
78
|
-
baseUrl: "https://custom.zapier.dev:8080",
|
|
79
|
-
})).toBe("https://zapier.dev");
|
|
80
|
-
});
|
|
81
|
-
it("should use baseUrl directly for non-Zapier domains", () => {
|
|
82
|
-
delete process.env.ZAPIER_TRACKING_BASE_URL;
|
|
83
|
-
expect(getTrackingBaseUrl({
|
|
84
|
-
baseUrl: "https://api.example.com",
|
|
85
|
-
})).toBe("https://api.example.com");
|
|
86
|
-
expect(getTrackingBaseUrl({
|
|
87
|
-
baseUrl: "http://localhost:3000",
|
|
88
|
-
})).toBe("http://localhost:3000");
|
|
89
|
-
});
|
|
90
|
-
it("should fallback to ZAPIER_BASE_URL constant", async () => {
|
|
91
|
-
delete process.env.ZAPIER_TRACKING_BASE_URL;
|
|
92
|
-
process.env.ZAPIER_BASE_URL = "https://custom.zapier.com";
|
|
93
|
-
// Clear module cache and re-import to get fresh constants
|
|
94
|
-
vi.resetModules();
|
|
95
|
-
const { getTrackingBaseUrl: freshGetTrackingBaseUrl } = await import("./url-utils");
|
|
96
|
-
expect(freshGetTrackingBaseUrl({})).toBe("https://custom.zapier.com");
|
|
97
|
-
delete process.env.ZAPIER_BASE_URL;
|
|
98
|
-
vi.resetModules();
|
|
99
|
-
const { getTrackingBaseUrl: defaultGetTrackingBaseUrl } = await import("./url-utils");
|
|
100
|
-
expect(defaultGetTrackingBaseUrl({})).toBe("https://zapier.com");
|
|
101
|
-
});
|
|
102
|
-
});
|
|
103
|
-
});
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { z } from "zod";
|
|
2
|
-
export declare function createValidator<TSchema extends z.ZodSchema>(schema: TSchema): (input: unknown) => z.infer<TSchema>;
|
|
3
|
-
export declare const validateOptions: <TOptions, TSchemaOptions extends TOptions>(schema: z.ZodSchema<TSchemaOptions>, options: TOptions) => TSchemaOptions;
|
|
4
|
-
//# sourceMappingURL=validation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/utils/validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAgC7B,wBAAgB,eAAe,CAAC,OAAO,SAAS,CAAC,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,IAC/C,OAAO,OAAO,KAAG,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAG7D;AAED,eAAO,MAAM,eAAe,GAAI,QAAQ,EAAE,cAAc,SAAS,QAAQ,EACvE,QAAQ,CAAC,CAAC,SAAS,CAAC,cAAc,CAAC,EACnC,SAAS,QAAQ,mBAGlB,CAAC"}
|
package/dist/utils/validation.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { ZapierValidationError } from "../types/errors";
|
|
2
|
-
/**
|
|
3
|
-
* Throws clean ZapierValidationError on validation failures
|
|
4
|
-
*/
|
|
5
|
-
const validate = (schema, input) => {
|
|
6
|
-
const result = schema.safeParse(input);
|
|
7
|
-
if (!result.success) {
|
|
8
|
-
// Format Zod errors into a clean, user-friendly message
|
|
9
|
-
const errorMessages = result.error.issues.map((error) => {
|
|
10
|
-
const path = error.path.length > 0 ? error.path.join(".") : "input";
|
|
11
|
-
return `${path}: ${error.message}`;
|
|
12
|
-
});
|
|
13
|
-
const message = `Validation failed:\n ${errorMessages.join("\n ")}`;
|
|
14
|
-
throw new ZapierValidationError(message, {
|
|
15
|
-
details: {
|
|
16
|
-
zodErrors: result.error.issues,
|
|
17
|
-
input,
|
|
18
|
-
},
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
return result.data;
|
|
22
|
-
};
|
|
23
|
-
export function createValidator(schema) {
|
|
24
|
-
return function validateFn(input) {
|
|
25
|
-
return validate(schema, input);
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
export const validateOptions = (schema, options) => {
|
|
29
|
-
return validate(schema, options);
|
|
30
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validation.test.d.ts","sourceRoot":"","sources":["../../src/utils/validation.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from "vitest";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
import { createValidator } from "./validation";
|
|
4
|
-
import { ZapierValidationError } from "../types/errors";
|
|
5
|
-
describe("validation utilities", () => {
|
|
6
|
-
describe("createValidator", () => {
|
|
7
|
-
it("should validate valid input", () => {
|
|
8
|
-
const schema = z.object({
|
|
9
|
-
name: z.string(),
|
|
10
|
-
age: z.number(),
|
|
11
|
-
});
|
|
12
|
-
const validator = createValidator(schema);
|
|
13
|
-
const result = validator({ name: "John", age: 30 });
|
|
14
|
-
expect(result).toEqual({ name: "John", age: 30 });
|
|
15
|
-
});
|
|
16
|
-
it("should throw ZapierValidationError for invalid input", () => {
|
|
17
|
-
const schema = z.object({
|
|
18
|
-
name: z.string(),
|
|
19
|
-
age: z.number(),
|
|
20
|
-
});
|
|
21
|
-
const validator = createValidator(schema);
|
|
22
|
-
expect(() => {
|
|
23
|
-
validator({ name: "John", age: "not-a-number" });
|
|
24
|
-
}).toThrow(ZapierValidationError);
|
|
25
|
-
});
|
|
26
|
-
it("should include helpful error messages", () => {
|
|
27
|
-
const schema = z.object({
|
|
28
|
-
name: z.string(),
|
|
29
|
-
age: z.number().min(0),
|
|
30
|
-
});
|
|
31
|
-
const validator = createValidator(schema);
|
|
32
|
-
try {
|
|
33
|
-
validator({ name: 123, age: -5 });
|
|
34
|
-
}
|
|
35
|
-
catch (error) {
|
|
36
|
-
expect(error).toBeInstanceOf(ZapierValidationError);
|
|
37
|
-
expect(error.message).toContain("name:");
|
|
38
|
-
expect(error.message).toContain("age:");
|
|
39
|
-
expect(error.details
|
|
40
|
-
?.zodErrors).toBeDefined();
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
});
|