@zapier/zapier-sdk 0.13.3 → 0.13.4

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.
Files changed (71) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/api/schemas.d.ts +174 -174
  3. package/dist/constants.d.ts +4 -0
  4. package/dist/constants.d.ts.map +1 -1
  5. package/dist/constants.js +4 -0
  6. package/dist/index.cjs +436 -5
  7. package/dist/index.d.mts +380 -156
  8. package/dist/index.d.ts +3 -0
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/index.js +1 -0
  11. package/dist/index.mjs +407 -9
  12. package/dist/plugins/api/index.d.ts +1 -3
  13. package/dist/plugins/api/index.d.ts.map +1 -1
  14. package/dist/plugins/eventEmission/builders.d.ts +13 -0
  15. package/dist/plugins/eventEmission/builders.d.ts.map +1 -0
  16. package/dist/plugins/eventEmission/builders.js +78 -0
  17. package/dist/plugins/eventEmission/index.d.ts +34 -0
  18. package/dist/plugins/eventEmission/index.d.ts.map +1 -0
  19. package/dist/plugins/eventEmission/index.js +216 -0
  20. package/dist/plugins/eventEmission/index.test.d.ts +5 -0
  21. package/dist/plugins/eventEmission/index.test.d.ts.map +1 -0
  22. package/dist/plugins/eventEmission/index.test.js +143 -0
  23. package/dist/plugins/eventEmission/transport.d.ts +37 -0
  24. package/dist/plugins/eventEmission/transport.d.ts.map +1 -0
  25. package/dist/plugins/eventEmission/transport.js +96 -0
  26. package/dist/plugins/eventEmission/transport.test.d.ts +5 -0
  27. package/dist/plugins/eventEmission/transport.test.d.ts.map +1 -0
  28. package/dist/plugins/eventEmission/transport.test.js +153 -0
  29. package/dist/plugins/eventEmission/types.d.ts +53 -0
  30. package/dist/plugins/eventEmission/types.d.ts.map +1 -0
  31. package/dist/plugins/eventEmission/types.js +1 -0
  32. package/dist/plugins/eventEmission/utils.d.ts +45 -0
  33. package/dist/plugins/eventEmission/utils.d.ts.map +1 -0
  34. package/dist/plugins/eventEmission/utils.js +114 -0
  35. package/dist/plugins/fetch/schemas.d.ts +4 -4
  36. package/dist/plugins/getAction/schemas.d.ts +2 -2
  37. package/dist/plugins/listActions/schemas.d.ts +2 -2
  38. package/dist/plugins/listInputFieldChoices/schemas.d.ts +4 -4
  39. package/dist/plugins/listInputFields/schemas.d.ts +2 -2
  40. package/dist/plugins/request/schemas.d.ts +4 -4
  41. package/dist/plugins/runAction/schemas.d.ts +2 -2
  42. package/dist/resolvers/actionType.d.ts.map +1 -1
  43. package/dist/resolvers/actionType.js +2 -3
  44. package/dist/resolvers/authenticationId.d.ts.map +1 -1
  45. package/dist/schemas/Action.d.ts +2 -2
  46. package/dist/schemas/App.d.ts +30 -30
  47. package/dist/sdk.d.ts +2 -2
  48. package/dist/sdk.d.ts.map +1 -1
  49. package/dist/sdk.js +4 -1
  50. package/dist/types/sdk.d.ts +5 -1
  51. package/dist/types/sdk.d.ts.map +1 -1
  52. package/dist/types/telemetry-events.d.ts +76 -0
  53. package/dist/types/telemetry-events.d.ts.map +1 -0
  54. package/dist/types/telemetry-events.js +8 -0
  55. package/package.json +1 -1
  56. package/src/constants.ts +6 -0
  57. package/src/index.ts +24 -0
  58. package/src/plugins/api/index.ts +1 -5
  59. package/src/plugins/eventEmission/builders.ts +115 -0
  60. package/src/plugins/eventEmission/index.test.ts +169 -0
  61. package/src/plugins/eventEmission/index.ts +294 -0
  62. package/src/plugins/eventEmission/transport.test.ts +214 -0
  63. package/src/plugins/eventEmission/transport.ts +135 -0
  64. package/src/plugins/eventEmission/types.ts +58 -0
  65. package/src/plugins/eventEmission/utils.ts +121 -0
  66. package/src/resolvers/actionType.ts +4 -3
  67. package/src/resolvers/authenticationId.ts +2 -1
  68. package/src/sdk.ts +5 -1
  69. package/src/types/sdk.ts +7 -1
  70. package/src/types/telemetry-events.ts +85 -0
  71. package/tsconfig.tsbuildinfo +1 -1
@@ -7,4 +7,8 @@
7
7
  * Maximum number of items that can be requested per page across all paginated functions
8
8
  */
9
9
  export declare const MAX_PAGE_LIMIT = 10000;
10
+ /**
11
+ * Default telemetry endpoint for the Tracking API
12
+ */
13
+ export declare const TRACKING_API_ENDPOINT = "https://zapier.com/api/v4/tracking/event/";
10
14
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,eAAO,MAAM,cAAc,QAAQ,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,eAAO,MAAM,cAAc,QAAQ,CAAC;AAEpC;;GAEG;AACH,eAAO,MAAM,qBAAqB,8CACW,CAAC"}
package/dist/constants.js CHANGED
@@ -7,3 +7,7 @@
7
7
  * Maximum number of items that can be requested per page across all paginated functions
8
8
  */
9
9
  export const MAX_PAGE_LIMIT = 10000;
10
+ /**
11
+ * Default telemetry endpoint for the Tracking API
12
+ */
13
+ export const TRACKING_API_ENDPOINT = "https://zapier.com/api/v4/tracking/event/";
package/dist/index.cjs CHANGED
@@ -2,6 +2,27 @@
2
2
 
3
3
  var zod = require('zod');
4
4
  var promises = require('timers/promises');
5
+ var os = require('os');
6
+
7
+ function _interopNamespace(e) {
8
+ if (e && e.__esModule) return e;
9
+ var n = Object.create(null);
10
+ if (e) {
11
+ Object.keys(e).forEach(function (k) {
12
+ if (k !== 'default') {
13
+ var d = Object.getOwnPropertyDescriptor(e, k);
14
+ Object.defineProperty(n, k, d.get ? d : {
15
+ enumerable: true,
16
+ get: function () { return e[k]; }
17
+ });
18
+ }
19
+ });
20
+ }
21
+ n.default = e;
22
+ return Object.freeze(n);
23
+ }
24
+
25
+ var os__namespace = /*#__PURE__*/_interopNamespace(os);
5
26
 
6
27
  // src/types/properties.ts
7
28
  function withFormatter(schema, formatMeta) {
@@ -34,6 +55,7 @@ function isPositional(schema) {
34
55
 
35
56
  // src/constants.ts
36
57
  var MAX_PAGE_LIMIT = 1e4;
58
+ var TRACKING_API_ENDPOINT = "https://zapier.com/api/v4/tracking/event/";
37
59
 
38
60
  // src/types/properties.ts
39
61
  var AppKeyPropertySchema = withPositional(
@@ -370,7 +392,7 @@ var FetchInitSchema = zod.z.object({
370
392
  // src/plugins/fetch/index.ts
371
393
  var fetchPlugin = ({ sdk }) => {
372
394
  return {
373
- fetch: async function fetch(url, init) {
395
+ fetch: async function fetch2(url, init) {
374
396
  const {
375
397
  authenticationId,
376
398
  callbackUrl,
@@ -1409,9 +1431,10 @@ var actionTypeResolver = {
1409
1431
  const actionsResponse = await sdk.listActions({
1410
1432
  appKey: resolvedParams.appKey
1411
1433
  });
1412
- const types = [
1413
- ...new Set(actionsResponse.data.map((action) => action.action_type))
1414
- ];
1434
+ const actionTypes = actionsResponse.data.map(
1435
+ (action) => action.action_type
1436
+ );
1437
+ const types = [...new Set(actionTypes)];
1415
1438
  return types.map((type) => ({ key: type, name: type }));
1416
1439
  },
1417
1440
  prompt: (types) => ({
@@ -3811,6 +3834,401 @@ var listInputFieldChoicesPlugin = ({ context, sdk }) => {
3811
3834
  };
3812
3835
  };
3813
3836
 
3837
+ // src/plugins/eventEmission/transport.ts
3838
+ var DEFAULT_RETRY_ATTEMPTS = 2;
3839
+ var DEFAULT_RETRY_DELAY_MS = 300;
3840
+ var HttpTransport = class {
3841
+ constructor(config) {
3842
+ this.config = config;
3843
+ }
3844
+ async emit(subject, event) {
3845
+ try {
3846
+ await this.emitWithRetry(
3847
+ subject,
3848
+ event,
3849
+ this.config.retryAttempts || DEFAULT_RETRY_ATTEMPTS
3850
+ );
3851
+ } catch {
3852
+ }
3853
+ }
3854
+ async emitWithRetry(subject, event, attemptsLeft) {
3855
+ try {
3856
+ const payload = {
3857
+ subject,
3858
+ properties: event
3859
+ };
3860
+ const response = await fetch(this.config.endpoint, {
3861
+ method: "POST",
3862
+ headers: {
3863
+ "Content-Type": "application/json",
3864
+ ...this.config.headers
3865
+ },
3866
+ body: JSON.stringify(payload)
3867
+ });
3868
+ if (!response.ok && attemptsLeft > 1) {
3869
+ await this.delay(this.config.retryDelayMs || DEFAULT_RETRY_DELAY_MS);
3870
+ return this.emitWithRetry(subject, event, attemptsLeft - 1);
3871
+ }
3872
+ } catch (error) {
3873
+ if (attemptsLeft > 1) {
3874
+ await this.delay(this.config.retryDelayMs || DEFAULT_RETRY_DELAY_MS);
3875
+ return this.emitWithRetry(subject, event, attemptsLeft - 1);
3876
+ }
3877
+ throw error;
3878
+ }
3879
+ }
3880
+ async delay(ms) {
3881
+ return new Promise((resolve2) => setTimeout(resolve2, ms));
3882
+ }
3883
+ };
3884
+ var ConsoleTransport = class {
3885
+ async emit(subject, event) {
3886
+ try {
3887
+ console.log(
3888
+ "[SDK Telemetry]",
3889
+ JSON.stringify({ subject, properties: event }, null, 2)
3890
+ );
3891
+ } catch {
3892
+ }
3893
+ }
3894
+ };
3895
+ var NoopTransport = class {
3896
+ async emit(_subject, _event) {
3897
+ }
3898
+ };
3899
+ function createTransport(config) {
3900
+ try {
3901
+ switch (config.type) {
3902
+ case "http":
3903
+ if (!config.endpoint) {
3904
+ throw new Error("HTTP transport requires endpoint");
3905
+ }
3906
+ return new HttpTransport({
3907
+ endpoint: config.endpoint,
3908
+ headers: config.headers,
3909
+ retryAttempts: config.retryAttempts,
3910
+ retryDelayMs: config.retryDelayMs
3911
+ });
3912
+ case "console":
3913
+ return new ConsoleTransport();
3914
+ case "noop":
3915
+ default:
3916
+ return new NoopTransport();
3917
+ }
3918
+ } catch {
3919
+ return new NoopTransport();
3920
+ }
3921
+ }
3922
+ function generateEventId() {
3923
+ return crypto.randomUUID();
3924
+ }
3925
+ function getCurrentTimestamp() {
3926
+ return Date.now();
3927
+ }
3928
+ function getReleaseId() {
3929
+ return process?.env?.SDK_RELEASE_ID || "development";
3930
+ }
3931
+ function getOsInfo() {
3932
+ try {
3933
+ return {
3934
+ platform: os__namespace.platform() || null,
3935
+ release: os__namespace.release() || null,
3936
+ architecture: os__namespace.arch() || null
3937
+ };
3938
+ } catch {
3939
+ return {
3940
+ platform: null,
3941
+ release: null,
3942
+ architecture: null
3943
+ };
3944
+ }
3945
+ }
3946
+ function getPlatformVersions() {
3947
+ const versions = {};
3948
+ if (typeof process?.versions === "object") {
3949
+ for (const [key, value] of Object.entries(process.versions)) {
3950
+ versions[key] = value || null;
3951
+ }
3952
+ }
3953
+ return versions;
3954
+ }
3955
+ function isCi() {
3956
+ return !!(process?.env?.CI || process?.env?.CONTINUOUS_INTEGRATION || process?.env?.GITHUB_ACTIONS || process?.env?.JENKINS_URL || process?.env?.GITLAB_CI || process?.env?.CIRCLECI || process?.env?.TRAVIS || process?.env?.BUILDKITE || process?.env?.DRONE || process?.env?.BITBUCKET_PIPELINES_UUID);
3957
+ }
3958
+ function getCiPlatform() {
3959
+ if (process?.env?.GITHUB_ACTIONS) return "github-actions";
3960
+ if (process?.env?.JENKINS_URL) return "jenkins";
3961
+ if (process?.env?.GITLAB_CI) return "gitlab-ci";
3962
+ if (process?.env?.CIRCLECI) return "circleci";
3963
+ if (process?.env?.TRAVIS) return "travis";
3964
+ if (process?.env?.BUILDKITE) return "buildkite";
3965
+ if (process?.env?.DRONE) return "drone";
3966
+ if (process?.env?.BITBUCKET_PIPELINES_UUID) return "bitbucket-pipelines";
3967
+ if (process?.env?.CI || process?.env?.CONTINUOUS_INTEGRATION)
3968
+ return "unknown-ci";
3969
+ return null;
3970
+ }
3971
+ function getMemoryUsage() {
3972
+ if (process?.memoryUsage) {
3973
+ const usage = process.memoryUsage();
3974
+ return usage.rss || null;
3975
+ }
3976
+ return null;
3977
+ }
3978
+ function getCpuTime() {
3979
+ if (process?.cpuUsage) {
3980
+ const usage = process.cpuUsage();
3981
+ return Math.round((usage.user + usage.system) / 1e3);
3982
+ }
3983
+ return null;
3984
+ }
3985
+
3986
+ // package.json
3987
+ var package_default = {
3988
+ version: "0.13.4"};
3989
+
3990
+ // src/plugins/eventEmission/builders.ts
3991
+ function createBaseEvent(context = {}) {
3992
+ return {
3993
+ event_id: generateEventId(),
3994
+ timestamp_ms: getCurrentTimestamp(),
3995
+ release_id: getReleaseId(),
3996
+ customuser_id: context.customuser_id,
3997
+ account_id: context.account_id,
3998
+ identity_id: context.identity_id,
3999
+ visitor_id: context.visitor_id,
4000
+ correlation_id: context.correlation_id
4001
+ };
4002
+ }
4003
+ function buildErrorEvent(data, context = {}) {
4004
+ return {
4005
+ ...createBaseEvent(context),
4006
+ zap_id: context.zap_id,
4007
+ node_id: context.node_id,
4008
+ selected_api: context.selected_api,
4009
+ app_id: context.app_id,
4010
+ app_version_id: context.app_version_id,
4011
+ environment: context.environment,
4012
+ sdk_version: package_default.version,
4013
+ ...data
4014
+ };
4015
+ }
4016
+ function buildApplicationLifecycleEvent(data, context = {}) {
4017
+ const osInfo = getOsInfo();
4018
+ const platformVersions = getPlatformVersions();
4019
+ return {
4020
+ ...createBaseEvent(context),
4021
+ selected_api: context.selected_api,
4022
+ app_id: context.app_id,
4023
+ app_version_id: context.app_version_id,
4024
+ sdk_version: package_default.version,
4025
+ cli_version: null,
4026
+ memory_usage_bytes: data.memory_usage_bytes ?? getMemoryUsage(),
4027
+ peak_memory_usage_bytes: data.peak_memory_usage_bytes ?? getMemoryUsage(),
4028
+ cpu_time_ms: data.cpu_time_ms ?? getCpuTime(),
4029
+ os_platform: osInfo.platform,
4030
+ os_release: osInfo.release,
4031
+ os_architecture: osInfo.architecture,
4032
+ platform_versions: platformVersions,
4033
+ environment: context.environment ?? (process.env.NODE_ENV || null),
4034
+ is_ci_environment: isCi(),
4035
+ ci_platform: getCiPlatform(),
4036
+ session_id: null,
4037
+ metadata: null,
4038
+ process_argv: process.argv || null,
4039
+ ...data
4040
+ };
4041
+ }
4042
+ function buildErrorEventWithContext(data, context = {}) {
4043
+ const executionTime = data.execution_start_time ? Date.now() - data.execution_start_time : null;
4044
+ return {
4045
+ ...createBaseEvent(context),
4046
+ zap_id: context.zap_id,
4047
+ node_id: context.node_id,
4048
+ selected_api: context.selected_api,
4049
+ app_id: context.app_id,
4050
+ app_version_id: context.app_version_id,
4051
+ environment: context.environment ?? (process.env.NODE_ENV || null),
4052
+ sdk_version: package_default.version,
4053
+ execution_time_before_error_ms: executionTime,
4054
+ ...data
4055
+ };
4056
+ }
4057
+
4058
+ // src/plugins/eventEmission/index.ts
4059
+ var APPLICATION_LIFECYCLE_EVENT_SUBJECT = "platform.sdk.ApplicationLifecycleEvent";
4060
+ var ERROR_OCCURRED_EVENT_SUBJECT = "platform.sdk.ErrorOccurredEvent";
4061
+ async function silentEmit(transport, subject, event) {
4062
+ try {
4063
+ transport.emit(subject, event).catch(() => {
4064
+ });
4065
+ } catch {
4066
+ }
4067
+ }
4068
+ function getTransportConfig() {
4069
+ const envTransport = process?.env?.ZAPIER_SDK_TELEMETRY_TRANSPORT;
4070
+ if (envTransport === "noop" || envTransport === "disabled") {
4071
+ return { type: "noop" };
4072
+ }
4073
+ if (envTransport === "console") {
4074
+ return { type: "console" };
4075
+ }
4076
+ const endpoint = process?.env?.ZAPIER_SDK_TELEMETRY_ENDPOINT || TRACKING_API_ENDPOINT;
4077
+ return {
4078
+ type: "http",
4079
+ endpoint
4080
+ };
4081
+ }
4082
+ var eventEmissionPlugin = ({ context }) => {
4083
+ const defaultTransport = getTransportConfig();
4084
+ const config = {
4085
+ enabled: context.options.eventEmission?.enabled ?? true,
4086
+ transport: (
4087
+ // If env var is set, use it (defaultTransport will be from env)
4088
+ process?.env?.ZAPIER_SDK_TELEMETRY_TRANSPORT ? defaultTransport : (
4089
+ // Otherwise, use option transport or default
4090
+ context.options.eventEmission?.transport ?? defaultTransport
4091
+ )
4092
+ )
4093
+ };
4094
+ const startupTime = Date.now();
4095
+ let shutdownStartTime = null;
4096
+ if (!config.enabled) {
4097
+ return {
4098
+ context: {
4099
+ eventEmission: {
4100
+ transport: createTransport({ type: "noop" }),
4101
+ config,
4102
+ emit: () => {
4103
+ },
4104
+ createBaseEvent: () => ({
4105
+ event_id: generateEventId(),
4106
+ timestamp_ms: getCurrentTimestamp(),
4107
+ release_id: getReleaseId(),
4108
+ customuser_id: null,
4109
+ account_id: null,
4110
+ identity_id: null,
4111
+ visitor_id: null,
4112
+ correlation_id: null
4113
+ })
4114
+ }
4115
+ }
4116
+ };
4117
+ }
4118
+ let transport;
4119
+ try {
4120
+ transport = createTransport(config.transport || { type: "noop" });
4121
+ } catch {
4122
+ transport = createTransport({ type: "noop" });
4123
+ }
4124
+ const createBaseEventHelper = () => ({
4125
+ event_id: generateEventId(),
4126
+ timestamp_ms: getCurrentTimestamp(),
4127
+ release_id: getReleaseId(),
4128
+ customuser_id: null,
4129
+ account_id: null,
4130
+ identity_id: null,
4131
+ visitor_id: null,
4132
+ correlation_id: null
4133
+ });
4134
+ if (config.enabled) {
4135
+ const startupEvent = buildApplicationLifecycleEvent({
4136
+ lifecycle_event_type: "startup"
4137
+ });
4138
+ silentEmit(transport, APPLICATION_LIFECYCLE_EVENT_SUBJECT, startupEvent);
4139
+ if (typeof process?.on === "function") {
4140
+ process.on("exit", (code) => {
4141
+ const uptime = Date.now() - startupTime;
4142
+ const shutdownDuration = shutdownStartTime ? Date.now() - shutdownStartTime : null;
4143
+ const exitEvent = buildApplicationLifecycleEvent({
4144
+ lifecycle_event_type: "exit",
4145
+ exit_code: code,
4146
+ uptime_ms: uptime,
4147
+ is_graceful_shutdown: code === 0,
4148
+ shutdown_duration_ms: shutdownDuration
4149
+ });
4150
+ silentEmit(transport, APPLICATION_LIFECYCLE_EVENT_SUBJECT, exitEvent);
4151
+ });
4152
+ process.on("uncaughtException", async (error) => {
4153
+ const errorEvent = buildErrorEventWithContext({
4154
+ error_message: error.message || "Unknown error",
4155
+ error_type: "UncaughtException",
4156
+ error_stack_trace: error.stack || null,
4157
+ error_severity: "critical",
4158
+ is_user_facing: false,
4159
+ is_recoverable: false,
4160
+ execution_start_time: startupTime
4161
+ });
4162
+ try {
4163
+ await Promise.race([
4164
+ transport.emit(ERROR_OCCURRED_EVENT_SUBJECT, errorEvent),
4165
+ new Promise((resolve2) => setTimeout(resolve2, 300))
4166
+ ]);
4167
+ } catch {
4168
+ }
4169
+ });
4170
+ process.on(
4171
+ "unhandledRejection",
4172
+ async (reason, promise) => {
4173
+ const errorMessage = reason instanceof Error ? reason.message : typeof reason === "string" ? reason : "Unhandled promise rejection";
4174
+ const errorStack = reason instanceof Error ? reason.stack : null;
4175
+ const errorEvent = buildErrorEventWithContext({
4176
+ error_message: errorMessage,
4177
+ error_type: "UnhandledRejection",
4178
+ error_stack_trace: errorStack,
4179
+ error_severity: "critical",
4180
+ is_user_facing: false,
4181
+ is_recoverable: false,
4182
+ execution_start_time: startupTime,
4183
+ error_metadata: {
4184
+ promise: String(promise)
4185
+ }
4186
+ });
4187
+ try {
4188
+ await Promise.race([
4189
+ transport.emit(ERROR_OCCURRED_EVENT_SUBJECT, errorEvent),
4190
+ new Promise((resolve2) => setTimeout(resolve2, 300))
4191
+ ]);
4192
+ } catch {
4193
+ }
4194
+ }
4195
+ );
4196
+ const handleSignal = async (signal) => {
4197
+ shutdownStartTime = Date.now();
4198
+ const uptime = Date.now() - startupTime;
4199
+ const signalEvent = buildApplicationLifecycleEvent({
4200
+ lifecycle_event_type: "signal_termination",
4201
+ signal_name: signal,
4202
+ uptime_ms: uptime,
4203
+ is_graceful_shutdown: true
4204
+ });
4205
+ try {
4206
+ await Promise.race([
4207
+ transport.emit(APPLICATION_LIFECYCLE_EVENT_SUBJECT, signalEvent),
4208
+ new Promise((resolve2) => setTimeout(resolve2, 300))
4209
+ ]);
4210
+ } catch {
4211
+ }
4212
+ };
4213
+ ["SIGINT", "SIGTERM"].forEach((signal) => {
4214
+ process.on(signal, () => handleSignal(signal));
4215
+ });
4216
+ }
4217
+ }
4218
+ return {
4219
+ context: {
4220
+ eventEmission: {
4221
+ transport,
4222
+ config,
4223
+ emit: (subject, event) => {
4224
+ silentEmit(transport, subject, event);
4225
+ },
4226
+ createBaseEvent: createBaseEventHelper
4227
+ }
4228
+ }
4229
+ };
4230
+ };
4231
+
3814
4232
  // src/sdk.ts
3815
4233
  function createSdk(options = {}, initialSdk = {}, initialContext = { meta: {} }) {
3816
4234
  return {
@@ -3860,7 +4278,7 @@ function createSdk(options = {}, initialSdk = {}, initialContext = { meta: {} })
3860
4278
  };
3861
4279
  }
3862
4280
  function createZapierSdkWithoutRegistry(options = {}) {
3863
- return createSdk(options).addPlugin(apiPlugin).addPlugin(manifestPlugin).addPlugin(listAppsPlugin).addPlugin(getAppPlugin).addPlugin(listActionsPlugin).addPlugin(getActionPlugin).addPlugin(listInputFieldsPlugin).addPlugin(listInputFieldChoicesPlugin).addPlugin(runActionPlugin).addPlugin(listAuthenticationsPlugin).addPlugin(getAuthenticationPlugin).addPlugin(findFirstAuthenticationPlugin).addPlugin(findUniqueAuthenticationPlugin).addPlugin(requestPlugin).addPlugin(fetchPlugin).addPlugin(appsPlugin).addPlugin(getProfilePlugin);
4281
+ return createSdk(options).addPlugin(eventEmissionPlugin).addPlugin(apiPlugin).addPlugin(manifestPlugin).addPlugin(listAppsPlugin).addPlugin(getAppPlugin).addPlugin(listActionsPlugin).addPlugin(getActionPlugin).addPlugin(listInputFieldsPlugin).addPlugin(listInputFieldChoicesPlugin).addPlugin(runActionPlugin).addPlugin(listAuthenticationsPlugin).addPlugin(getAuthenticationPlugin).addPlugin(findFirstAuthenticationPlugin).addPlugin(findUniqueAuthenticationPlugin).addPlugin(requestPlugin).addPlugin(fetchPlugin).addPlugin(appsPlugin).addPlugin(getProfilePlugin);
3864
4282
  }
3865
4283
  function createZapierSdk(options = {}) {
3866
4284
  return createZapierSdkWithoutRegistry(options).addPlugin(registryPlugin);
@@ -3898,6 +4316,10 @@ exports.appKeyResolver = appKeyResolver;
3898
4316
  exports.appsPlugin = appsPlugin;
3899
4317
  exports.authenticationIdGenericResolver = authenticationIdGenericResolver;
3900
4318
  exports.authenticationIdResolver = authenticationIdResolver;
4319
+ exports.buildApplicationLifecycleEvent = buildApplicationLifecycleEvent;
4320
+ exports.buildErrorEvent = buildErrorEvent;
4321
+ exports.buildErrorEventWithContext = buildErrorEventWithContext;
4322
+ exports.createBaseEvent = createBaseEvent;
3901
4323
  exports.createFunction = createFunction;
3902
4324
  exports.createSdk = createSdk;
3903
4325
  exports.createZapierSdk = createZapierSdk;
@@ -3907,17 +4329,26 @@ exports.findFirstAuthenticationPlugin = findFirstAuthenticationPlugin;
3907
4329
  exports.findManifestEntry = findManifestEntry;
3908
4330
  exports.findUniqueAuthenticationPlugin = findUniqueAuthenticationPlugin;
3909
4331
  exports.formatErrorMessage = formatErrorMessage;
4332
+ exports.generateEventId = generateEventId;
3910
4333
  exports.getActionPlugin = getActionPlugin;
3911
4334
  exports.getAppPlugin = getAppPlugin;
3912
4335
  exports.getAuthenticationPlugin = getAuthenticationPlugin;
4336
+ exports.getCiPlatform = getCiPlatform;
4337
+ exports.getCpuTime = getCpuTime;
4338
+ exports.getCurrentTimestamp = getCurrentTimestamp;
4339
+ exports.getMemoryUsage = getMemoryUsage;
4340
+ exports.getOsInfo = getOsInfo;
4341
+ exports.getPlatformVersions = getPlatformVersions;
3913
4342
  exports.getPreferredManifestEntryKey = getPreferredManifestEntryKey;
3914
4343
  exports.getProfilePlugin = getProfilePlugin;
4344
+ exports.getReleaseId = getReleaseId;
3915
4345
  exports.getTokenFromCliLogin = getTokenFromCliLogin;
3916
4346
  exports.getTokenFromEnv = getTokenFromEnv;
3917
4347
  exports.getTokenFromEnvOrConfig = getTokenFromEnvOrConfig;
3918
4348
  exports.inputFieldKeyResolver = inputFieldKeyResolver;
3919
4349
  exports.inputsAllOptionalResolver = inputsAllOptionalResolver;
3920
4350
  exports.inputsResolver = inputsResolver;
4351
+ exports.isCi = isCi;
3921
4352
  exports.isPositional = isPositional;
3922
4353
  exports.listActionsPlugin = listActionsPlugin;
3923
4354
  exports.listAppsPlugin = listAppsPlugin;