@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,336 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Event Emission Plugin for Zapier SDK
|
|
3
|
-
*
|
|
4
|
-
* Provides silent telemetry event emission capability to the SDK.
|
|
5
|
-
* All events are emitted asynchronously and failures are silently handled.
|
|
6
|
-
*/
|
|
7
|
-
import { createTransport } from "./transport";
|
|
8
|
-
import { generateEventId, getCurrentTimestamp, getReleaseId } from "./utils";
|
|
9
|
-
import { extractUserIdsFromJwt } from "../../api/auth";
|
|
10
|
-
import { resolveAuthToken } from "../../auth";
|
|
11
|
-
import { buildApplicationLifecycleEvent, buildErrorEventWithContext, buildMethodCalledEvent, } from "./builders";
|
|
12
|
-
import { getTrackingBaseUrl } from "../../utils/url-utils";
|
|
13
|
-
// Maximum time to wait for telemetry emission before allowing process to exit
|
|
14
|
-
const TELEMETRY_EMIT_TIMEOUT_MS = 300;
|
|
15
|
-
const APPLICATION_LIFECYCLE_EVENT_SUBJECT = "platform.sdk.ApplicationLifecycleEvent";
|
|
16
|
-
const ERROR_OCCURRED_EVENT_SUBJECT = "platform.sdk.ErrorOccurredEvent";
|
|
17
|
-
const METHOD_CALLED_EVENT_SUBJECT = "platform.sdk.MethodCalledEvent";
|
|
18
|
-
// Track transport success/failure so we only log failure once.
|
|
19
|
-
const transportStates = new WeakMap();
|
|
20
|
-
// Silent emission wrapper with smart first-failure logging
|
|
21
|
-
async function silentEmit(transport, subject, event, userContextPromise) {
|
|
22
|
-
try {
|
|
23
|
-
// Get or initialize state for this transport
|
|
24
|
-
let state = transportStates.get(transport);
|
|
25
|
-
if (!state) {
|
|
26
|
-
state = { hasWorked: false, hasLoggedFailure: false };
|
|
27
|
-
transportStates.set(transport, state);
|
|
28
|
-
}
|
|
29
|
-
// Resolve user context and merge into event
|
|
30
|
-
let enrichedEvent = event;
|
|
31
|
-
if (userContextPromise) {
|
|
32
|
-
try {
|
|
33
|
-
const userContext = await userContextPromise;
|
|
34
|
-
// Use Object.assign to safely merge user context into event
|
|
35
|
-
enrichedEvent = Object.assign({}, event, userContext);
|
|
36
|
-
}
|
|
37
|
-
catch {
|
|
38
|
-
// If user context promise fails, continue with original event
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
// Fire and forget - don't await the transport
|
|
42
|
-
transport
|
|
43
|
-
.emit(subject, enrichedEvent)
|
|
44
|
-
.then(() => {
|
|
45
|
-
// Mark as working if any emit succeeds
|
|
46
|
-
state.hasWorked = true;
|
|
47
|
-
})
|
|
48
|
-
.catch((error) => {
|
|
49
|
-
// Only log if we haven't seen it work and haven't logged yet
|
|
50
|
-
if (!state.hasWorked && !state.hasLoggedFailure) {
|
|
51
|
-
state.hasLoggedFailure = true;
|
|
52
|
-
console.warn(`[zapier-sdk] Tracking failed: ${error.message || "Unknown error"}`);
|
|
53
|
-
console.warn(`[zapier-sdk] Hint: Set trackingBaseUrl parameter or ZAPIER_TRACKING_BASE_URL environment variable if using custom domains`);
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
catch {
|
|
58
|
-
// Silently ignore all errors
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
// Helper to get transport config from environment or options
|
|
62
|
-
function getTransportConfig(options) {
|
|
63
|
-
const envTransport = process?.env?.ZAPIER_SDK_TELEMETRY_TRANSPORT;
|
|
64
|
-
if (envTransport === "noop" || envTransport === "disabled") {
|
|
65
|
-
return { type: "noop" };
|
|
66
|
-
}
|
|
67
|
-
if (envTransport === "console") {
|
|
68
|
-
return { type: "console" };
|
|
69
|
-
}
|
|
70
|
-
// Default to HTTP transport with resolved tracking URL
|
|
71
|
-
const endpoint = process?.env?.ZAPIER_SDK_TELEMETRY_ENDPOINT ||
|
|
72
|
-
`${getTrackingBaseUrl({
|
|
73
|
-
trackingBaseUrl: options?.trackingBaseUrl,
|
|
74
|
-
baseUrl: options?.baseUrl,
|
|
75
|
-
})}/api/v4/tracking/event/`;
|
|
76
|
-
return {
|
|
77
|
-
type: "http",
|
|
78
|
-
endpoint,
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
export const eventEmissionPlugin = ({ context }) => {
|
|
82
|
-
const defaultTransport = getTransportConfig({
|
|
83
|
-
trackingBaseUrl: context.options.trackingBaseUrl,
|
|
84
|
-
baseUrl: context.options.baseUrl,
|
|
85
|
-
});
|
|
86
|
-
// Merge config: env var takes precedence over options, options take precedence over defaults
|
|
87
|
-
const config = {
|
|
88
|
-
enabled: context.options.eventEmission?.enabled ?? true,
|
|
89
|
-
transport:
|
|
90
|
-
// If env var is set, use it (defaultTransport will be from env)
|
|
91
|
-
process?.env?.ZAPIER_SDK_TELEMETRY_TRANSPORT
|
|
92
|
-
? defaultTransport
|
|
93
|
-
: // Otherwise, use option transport or default
|
|
94
|
-
(context.options.eventEmission?.transport ?? defaultTransport),
|
|
95
|
-
};
|
|
96
|
-
// Create getUserContext promise for dynamic user context injection
|
|
97
|
-
const getUserContext = (async () => {
|
|
98
|
-
try {
|
|
99
|
-
const token = await resolveAuthToken({
|
|
100
|
-
token: context.options.token,
|
|
101
|
-
getToken: context.options.getToken,
|
|
102
|
-
baseUrl: context.options.baseUrl,
|
|
103
|
-
authBaseUrl: context.options.authBaseUrl,
|
|
104
|
-
authClientId: context.options.authClientId,
|
|
105
|
-
onEvent: context.options.onEvent,
|
|
106
|
-
fetch: context.options.fetch,
|
|
107
|
-
});
|
|
108
|
-
if (token) {
|
|
109
|
-
return extractUserIdsFromJwt(token);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
catch {
|
|
113
|
-
// Fall back to null context on any error
|
|
114
|
-
}
|
|
115
|
-
return { customuser_id: null, account_id: null };
|
|
116
|
-
})();
|
|
117
|
-
const startupTime = Date.now();
|
|
118
|
-
let shutdownStartTime = null;
|
|
119
|
-
// If disabled, return noop implementations
|
|
120
|
-
if (!config.enabled) {
|
|
121
|
-
return {
|
|
122
|
-
context: {
|
|
123
|
-
eventEmission: {
|
|
124
|
-
transport: createTransport({ type: "noop" }),
|
|
125
|
-
config,
|
|
126
|
-
emit: () => { },
|
|
127
|
-
createBaseEvent: async () => ({
|
|
128
|
-
event_id: generateEventId(),
|
|
129
|
-
timestamp_ms: getCurrentTimestamp(),
|
|
130
|
-
release_id: getReleaseId(),
|
|
131
|
-
customuser_id: null,
|
|
132
|
-
account_id: null,
|
|
133
|
-
identity_id: null,
|
|
134
|
-
visitor_id: null,
|
|
135
|
-
correlation_id: null,
|
|
136
|
-
}),
|
|
137
|
-
emitMethodCalled: () => { },
|
|
138
|
-
},
|
|
139
|
-
},
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
|
-
let transport;
|
|
143
|
-
try {
|
|
144
|
-
transport = createTransport(config.transport || { type: "noop" });
|
|
145
|
-
}
|
|
146
|
-
catch {
|
|
147
|
-
// If transport creation fails, fallback to noop to maintain silent operation
|
|
148
|
-
transport = createTransport({ type: "noop" });
|
|
149
|
-
}
|
|
150
|
-
// Helper to create base event
|
|
151
|
-
const createBaseEventHelper = async () => {
|
|
152
|
-
const baseEvent = {
|
|
153
|
-
event_id: generateEventId(),
|
|
154
|
-
timestamp_ms: getCurrentTimestamp(),
|
|
155
|
-
release_id: getReleaseId(),
|
|
156
|
-
customuser_id: null,
|
|
157
|
-
account_id: null,
|
|
158
|
-
identity_id: null,
|
|
159
|
-
visitor_id: null,
|
|
160
|
-
correlation_id: null,
|
|
161
|
-
};
|
|
162
|
-
// Enrich with user context if available
|
|
163
|
-
try {
|
|
164
|
-
const userContext = await getUserContext;
|
|
165
|
-
return { ...baseEvent, ...userContext };
|
|
166
|
-
}
|
|
167
|
-
catch {
|
|
168
|
-
// Return base event if user context fails
|
|
169
|
-
return baseEvent;
|
|
170
|
-
}
|
|
171
|
-
};
|
|
172
|
-
// Register lifecycle event handlers if enabled
|
|
173
|
-
if (config.enabled) {
|
|
174
|
-
// Emit startup event
|
|
175
|
-
const startupEvent = buildApplicationLifecycleEvent({
|
|
176
|
-
lifecycle_event_type: "startup",
|
|
177
|
-
});
|
|
178
|
-
silentEmit(transport, APPLICATION_LIFECYCLE_EVENT_SUBJECT, startupEvent, getUserContext);
|
|
179
|
-
// Register process event handlers (Node.js only)
|
|
180
|
-
if (typeof process?.on === "function") {
|
|
181
|
-
// Handle normal process exit
|
|
182
|
-
process.on("exit", (code) => {
|
|
183
|
-
const uptime = Date.now() - startupTime;
|
|
184
|
-
const shutdownDuration = shutdownStartTime
|
|
185
|
-
? Date.now() - shutdownStartTime
|
|
186
|
-
: null;
|
|
187
|
-
const exitEvent = buildApplicationLifecycleEvent({
|
|
188
|
-
lifecycle_event_type: "exit",
|
|
189
|
-
exit_code: code,
|
|
190
|
-
uptime_ms: uptime,
|
|
191
|
-
is_graceful_shutdown: code === 0,
|
|
192
|
-
shutdown_duration_ms: shutdownDuration,
|
|
193
|
-
});
|
|
194
|
-
silentEmit(transport, APPLICATION_LIFECYCLE_EVENT_SUBJECT, exitEvent, getUserContext);
|
|
195
|
-
});
|
|
196
|
-
// Handle uncaught exceptions
|
|
197
|
-
process.on("uncaughtException", async (error) => {
|
|
198
|
-
let errorEvent = buildErrorEventWithContext({
|
|
199
|
-
error_message: error.message || "Unknown error",
|
|
200
|
-
error_type: "UncaughtException",
|
|
201
|
-
error_stack_trace: error.stack || null,
|
|
202
|
-
error_severity: "critical",
|
|
203
|
-
is_user_facing: false,
|
|
204
|
-
is_recoverable: false,
|
|
205
|
-
execution_start_time: startupTime,
|
|
206
|
-
});
|
|
207
|
-
// Enrich with user context if available
|
|
208
|
-
try {
|
|
209
|
-
const userContext = await getUserContext;
|
|
210
|
-
errorEvent = { ...errorEvent, ...userContext };
|
|
211
|
-
}
|
|
212
|
-
catch {
|
|
213
|
-
// Continue with original event if user context fails
|
|
214
|
-
}
|
|
215
|
-
// Wait up to 300ms for telemetry to send before allowing process to exit
|
|
216
|
-
try {
|
|
217
|
-
await Promise.race([
|
|
218
|
-
transport.emit(ERROR_OCCURRED_EVENT_SUBJECT, errorEvent),
|
|
219
|
-
new Promise((resolve) => {
|
|
220
|
-
const timer = setTimeout(resolve, TELEMETRY_EMIT_TIMEOUT_MS);
|
|
221
|
-
if (typeof timer.unref === "function") {
|
|
222
|
-
timer.unref();
|
|
223
|
-
}
|
|
224
|
-
}),
|
|
225
|
-
]);
|
|
226
|
-
}
|
|
227
|
-
catch {
|
|
228
|
-
// Silently ignore telemetry failures
|
|
229
|
-
}
|
|
230
|
-
});
|
|
231
|
-
// Handle unhandled promise rejections
|
|
232
|
-
process.on("unhandledRejection", async (reason, promise) => {
|
|
233
|
-
const errorMessage = reason instanceof Error
|
|
234
|
-
? reason.message
|
|
235
|
-
: typeof reason === "string"
|
|
236
|
-
? reason
|
|
237
|
-
: "Unhandled promise rejection";
|
|
238
|
-
const errorStack = reason instanceof Error ? reason.stack : null;
|
|
239
|
-
let errorEvent = buildErrorEventWithContext({
|
|
240
|
-
error_message: errorMessage,
|
|
241
|
-
error_type: "UnhandledRejection",
|
|
242
|
-
error_stack_trace: errorStack,
|
|
243
|
-
error_severity: "critical",
|
|
244
|
-
is_user_facing: false,
|
|
245
|
-
is_recoverable: false,
|
|
246
|
-
execution_start_time: startupTime,
|
|
247
|
-
error_metadata: {
|
|
248
|
-
promise: String(promise),
|
|
249
|
-
},
|
|
250
|
-
});
|
|
251
|
-
// Enrich with user context if available
|
|
252
|
-
try {
|
|
253
|
-
const userContext = await getUserContext;
|
|
254
|
-
errorEvent = { ...errorEvent, ...userContext };
|
|
255
|
-
}
|
|
256
|
-
catch {
|
|
257
|
-
// Continue with original event if user context fails
|
|
258
|
-
}
|
|
259
|
-
// Wait up to 300ms for telemetry to send
|
|
260
|
-
try {
|
|
261
|
-
await Promise.race([
|
|
262
|
-
transport.emit(ERROR_OCCURRED_EVENT_SUBJECT, errorEvent),
|
|
263
|
-
new Promise((resolve) => {
|
|
264
|
-
const timer = setTimeout(resolve, TELEMETRY_EMIT_TIMEOUT_MS);
|
|
265
|
-
if (typeof timer.unref === "function") {
|
|
266
|
-
timer.unref();
|
|
267
|
-
}
|
|
268
|
-
}),
|
|
269
|
-
]);
|
|
270
|
-
}
|
|
271
|
-
catch {
|
|
272
|
-
// Silently ignore telemetry failures
|
|
273
|
-
}
|
|
274
|
-
});
|
|
275
|
-
// Handle termination signals
|
|
276
|
-
const handleSignal = async (signal) => {
|
|
277
|
-
shutdownStartTime = Date.now();
|
|
278
|
-
const uptime = Date.now() - startupTime;
|
|
279
|
-
let signalEvent = buildApplicationLifecycleEvent({
|
|
280
|
-
lifecycle_event_type: "signal_termination",
|
|
281
|
-
signal_name: signal,
|
|
282
|
-
uptime_ms: uptime,
|
|
283
|
-
is_graceful_shutdown: true,
|
|
284
|
-
});
|
|
285
|
-
// Enrich with user context if available
|
|
286
|
-
try {
|
|
287
|
-
const userContext = await getUserContext;
|
|
288
|
-
signalEvent = { ...signalEvent, ...userContext };
|
|
289
|
-
}
|
|
290
|
-
catch {
|
|
291
|
-
// Continue with original event if user context fails
|
|
292
|
-
}
|
|
293
|
-
// Wait up to 300ms for telemetry to send
|
|
294
|
-
try {
|
|
295
|
-
await Promise.race([
|
|
296
|
-
transport.emit(APPLICATION_LIFECYCLE_EVENT_SUBJECT, signalEvent),
|
|
297
|
-
new Promise((resolve) => {
|
|
298
|
-
const timer = setTimeout(resolve, TELEMETRY_EMIT_TIMEOUT_MS);
|
|
299
|
-
if (typeof timer.unref === "function") {
|
|
300
|
-
timer.unref();
|
|
301
|
-
}
|
|
302
|
-
}),
|
|
303
|
-
]);
|
|
304
|
-
}
|
|
305
|
-
catch {
|
|
306
|
-
// Silently ignore telemetry failures
|
|
307
|
-
}
|
|
308
|
-
// Exit with appropriate code (128 + signal number)
|
|
309
|
-
const exitCode = signal === "SIGINT" ? 130 : 143;
|
|
310
|
-
process.exit(exitCode);
|
|
311
|
-
};
|
|
312
|
-
// Register signal handlers
|
|
313
|
-
["SIGINT", "SIGTERM"].forEach((signal) => {
|
|
314
|
-
process.on(signal, () => handleSignal(signal));
|
|
315
|
-
});
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
return {
|
|
319
|
-
context: {
|
|
320
|
-
eventEmission: {
|
|
321
|
-
transport,
|
|
322
|
-
config,
|
|
323
|
-
emit: (subject, event) => {
|
|
324
|
-
silentEmit(transport, subject, event, getUserContext);
|
|
325
|
-
},
|
|
326
|
-
createBaseEvent: createBaseEventHelper,
|
|
327
|
-
emitMethodCalled: (data) => {
|
|
328
|
-
const event = buildMethodCalledEvent(data);
|
|
329
|
-
silentEmit(transport, METHOD_CALLED_EVENT_SUBJECT, event, getUserContext);
|
|
330
|
-
},
|
|
331
|
-
},
|
|
332
|
-
},
|
|
333
|
-
};
|
|
334
|
-
};
|
|
335
|
-
export { buildApplicationLifecycleEvent, buildErrorEventWithContext, buildErrorEvent, createBaseEvent, buildMethodCalledEvent, } from "./builders";
|
|
336
|
-
export * from "./utils";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../../src/plugins/eventEmission/index.test.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|