@zapier/zapier-sdk 0.41.2 → 0.42.1

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 (139) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +1 -0
  3. package/dist/index.cjs +376 -219
  4. package/dist/index.d.mts +174 -424
  5. package/dist/index.d.ts +3 -3
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +1 -1
  8. package/dist/index.mjs +376 -220
  9. package/dist/plugins/api/index.d.ts +5 -1
  10. package/dist/plugins/api/index.d.ts.map +1 -1
  11. package/dist/plugins/api/index.js +2 -3
  12. package/dist/plugins/apps/index.d.ts +2 -3
  13. package/dist/plugins/apps/index.d.ts.map +1 -1
  14. package/dist/plugins/apps/index.js +1 -1
  15. package/dist/plugins/capabilities/index.d.ts +8 -6
  16. package/dist/plugins/capabilities/index.d.ts.map +1 -1
  17. package/dist/plugins/capabilities/index.js +3 -3
  18. package/dist/plugins/connections/index.d.ts +3 -1
  19. package/dist/plugins/connections/index.d.ts.map +1 -1
  20. package/dist/plugins/connections/index.js +2 -3
  21. package/dist/plugins/createClientCredentials/index.d.ts +6 -4
  22. package/dist/plugins/createClientCredentials/index.d.ts.map +1 -1
  23. package/dist/plugins/createClientCredentials/index.js +3 -3
  24. package/dist/plugins/deleteClientCredentials/index.d.ts +6 -4
  25. package/dist/plugins/deleteClientCredentials/index.d.ts.map +1 -1
  26. package/dist/plugins/deleteClientCredentials/index.js +3 -3
  27. package/dist/plugins/deprecated/authentications.d.ts +9 -9
  28. package/dist/plugins/deprecated/authentications.d.ts.map +1 -1
  29. package/dist/plugins/deprecated/authentications.js +4 -4
  30. package/dist/plugins/eventEmission/index.d.ts +4 -5
  31. package/dist/plugins/eventEmission/index.d.ts.map +1 -1
  32. package/dist/plugins/eventEmission/index.js +8 -7
  33. package/dist/plugins/fetch/index.d.ts +18 -23
  34. package/dist/plugins/fetch/index.d.ts.map +1 -1
  35. package/dist/plugins/fetch/index.js +88 -28
  36. package/dist/plugins/fetch/schemas.d.ts +8 -0
  37. package/dist/plugins/fetch/schemas.d.ts.map +1 -1
  38. package/dist/plugins/fetch/schemas.js +21 -12
  39. package/dist/plugins/findFirstConnection/index.d.ts +3 -4
  40. package/dist/plugins/findFirstConnection/index.d.ts.map +1 -1
  41. package/dist/plugins/findFirstConnection/index.js +2 -2
  42. package/dist/plugins/findUniqueConnection/index.d.ts +3 -4
  43. package/dist/plugins/findUniqueConnection/index.d.ts.map +1 -1
  44. package/dist/plugins/findUniqueConnection/index.js +2 -2
  45. package/dist/plugins/getAction/index.d.ts +7 -7
  46. package/dist/plugins/getAction/index.d.ts.map +1 -1
  47. package/dist/plugins/getAction/index.js +2 -2
  48. package/dist/plugins/getApp/index.d.ts +2 -3
  49. package/dist/plugins/getApp/index.d.ts.map +1 -1
  50. package/dist/plugins/getApp/index.js +2 -2
  51. package/dist/plugins/getConnection/index.d.ts +6 -6
  52. package/dist/plugins/getConnection/index.d.ts.map +1 -1
  53. package/dist/plugins/getConnection/index.js +3 -3
  54. package/dist/plugins/getInputFieldsSchema/index.d.ts +8 -6
  55. package/dist/plugins/getInputFieldsSchema/index.d.ts.map +1 -1
  56. package/dist/plugins/getInputFieldsSchema/index.js +4 -4
  57. package/dist/plugins/getProfile/index.d.ts +6 -6
  58. package/dist/plugins/getProfile/index.d.ts.map +1 -1
  59. package/dist/plugins/getProfile/index.js +3 -3
  60. package/dist/plugins/listActions/index.d.ts +8 -6
  61. package/dist/plugins/listActions/index.d.ts.map +1 -1
  62. package/dist/plugins/listActions/index.js +3 -3
  63. package/dist/plugins/listApps/index.d.ts +3 -3
  64. package/dist/plugins/listApps/index.d.ts.map +1 -1
  65. package/dist/plugins/listApps/index.js +3 -3
  66. package/dist/plugins/listClientCredentials/index.d.ts +6 -4
  67. package/dist/plugins/listClientCredentials/index.d.ts.map +1 -1
  68. package/dist/plugins/listClientCredentials/index.js +3 -3
  69. package/dist/plugins/listConnections/index.d.ts +8 -6
  70. package/dist/plugins/listConnections/index.d.ts.map +1 -1
  71. package/dist/plugins/listConnections/index.js +5 -5
  72. package/dist/plugins/listInputFieldChoices/index.d.ts +9 -8
  73. package/dist/plugins/listInputFieldChoices/index.d.ts.map +1 -1
  74. package/dist/plugins/listInputFieldChoices/index.js +4 -4
  75. package/dist/plugins/listInputFields/index.d.ts +8 -8
  76. package/dist/plugins/listInputFields/index.d.ts.map +1 -1
  77. package/dist/plugins/listInputFields/index.js +4 -4
  78. package/dist/plugins/manifest/index.d.ts +8 -3
  79. package/dist/plugins/manifest/index.d.ts.map +1 -1
  80. package/dist/plugins/manifest/index.js +2 -3
  81. package/dist/plugins/registry/index.d.ts +1 -2
  82. package/dist/plugins/registry/index.d.ts.map +1 -1
  83. package/dist/plugins/registry/index.js +3 -3
  84. package/dist/plugins/request/index.d.ts +3 -4
  85. package/dist/plugins/request/index.d.ts.map +1 -1
  86. package/dist/plugins/request/index.js +2 -2
  87. package/dist/plugins/runAction/index.d.ts +8 -8
  88. package/dist/plugins/runAction/index.d.ts.map +1 -1
  89. package/dist/plugins/runAction/index.js +5 -5
  90. package/dist/plugins/tables/createTable/index.d.ts +3 -5
  91. package/dist/plugins/tables/createTable/index.d.ts.map +1 -1
  92. package/dist/plugins/tables/createTable/index.js +3 -3
  93. package/dist/plugins/tables/createTableFields/index.d.ts +3 -5
  94. package/dist/plugins/tables/createTableFields/index.d.ts.map +1 -1
  95. package/dist/plugins/tables/createTableFields/index.js +3 -3
  96. package/dist/plugins/tables/createTableRecords/index.d.ts +3 -5
  97. package/dist/plugins/tables/createTableRecords/index.d.ts.map +1 -1
  98. package/dist/plugins/tables/createTableRecords/index.js +3 -3
  99. package/dist/plugins/tables/deleteTable/index.d.ts +5 -5
  100. package/dist/plugins/tables/deleteTable/index.d.ts.map +1 -1
  101. package/dist/plugins/tables/deleteTable/index.js +4 -4
  102. package/dist/plugins/tables/deleteTableFields/index.d.ts +3 -5
  103. package/dist/plugins/tables/deleteTableFields/index.d.ts.map +1 -1
  104. package/dist/plugins/tables/deleteTableFields/index.js +3 -3
  105. package/dist/plugins/tables/deleteTableRecords/index.d.ts +3 -5
  106. package/dist/plugins/tables/deleteTableRecords/index.d.ts.map +1 -1
  107. package/dist/plugins/tables/deleteTableRecords/index.js +3 -3
  108. package/dist/plugins/tables/getTable/index.d.ts +3 -5
  109. package/dist/plugins/tables/getTable/index.d.ts.map +1 -1
  110. package/dist/plugins/tables/getTable/index.js +3 -3
  111. package/dist/plugins/tables/getTableRecord/index.d.ts +3 -5
  112. package/dist/plugins/tables/getTableRecord/index.d.ts.map +1 -1
  113. package/dist/plugins/tables/getTableRecord/index.js +3 -3
  114. package/dist/plugins/tables/listTableFields/index.d.ts +3 -5
  115. package/dist/plugins/tables/listTableFields/index.d.ts.map +1 -1
  116. package/dist/plugins/tables/listTableFields/index.js +3 -3
  117. package/dist/plugins/tables/listTableRecords/index.d.ts +3 -3
  118. package/dist/plugins/tables/listTableRecords/index.d.ts.map +1 -1
  119. package/dist/plugins/tables/listTableRecords/index.js +3 -3
  120. package/dist/plugins/tables/listTables/index.d.ts +5 -3
  121. package/dist/plugins/tables/listTables/index.d.ts.map +1 -1
  122. package/dist/plugins/tables/listTables/index.js +4 -4
  123. package/dist/plugins/tables/updateTableRecords/index.d.ts +3 -5
  124. package/dist/plugins/tables/updateTableRecords/index.d.ts.map +1 -1
  125. package/dist/plugins/tables/updateTableRecords/index.js +3 -3
  126. package/dist/resolvers/connectionId.js +1 -1
  127. package/dist/resolvers/tableId.js +1 -1
  128. package/dist/sdk.d.ts +29 -257
  129. package/dist/sdk.d.ts.map +1 -1
  130. package/dist/sdk.js +33 -43
  131. package/dist/types/plugin.d.ts +29 -48
  132. package/dist/types/plugin.d.ts.map +1 -1
  133. package/dist/types/plugin.js +7 -3
  134. package/dist/types/sdk.d.ts +2 -3
  135. package/dist/types/sdk.d.ts.map +1 -1
  136. package/dist/utils/abort-utils.d.ts +64 -0
  137. package/dist/utils/abort-utils.d.ts.map +1 -0
  138. package/dist/utils/abort-utils.js +107 -0
  139. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -515,7 +515,7 @@ function createAppsProxy(options) {
515
515
  });
516
516
  return appsProxy;
517
517
  }
518
- var appsPlugin = ({ sdk }) => {
518
+ var appsPlugin = (sdk) => {
519
519
  return {
520
520
  apps: createAppsProxy({ sdk }),
521
521
  context: {
@@ -542,6 +542,20 @@ var appsPlugin = ({ sdk }) => {
542
542
  var FetchUrlSchema = z.union([z.string(), z.instanceof(URL)]).describe(
543
543
  "The full URL of the API endpoint to call (proxied through Zapier's Relay service)"
544
544
  );
545
+ var FetchInitZapierFieldsSchema = z.object({
546
+ connectionId: ConnectionIdPropertySchema.optional().meta({
547
+ deprecated: true
548
+ }),
549
+ connection: ConnectionPropertySchema.optional(),
550
+ /** @deprecated Use connection instead */
551
+ authenticationId: AuthenticationIdPropertySchema.optional().meta({
552
+ deprecated: true
553
+ }),
554
+ callbackUrl: z.string().optional().describe("URL to send async response to (makes request async)"),
555
+ maxTime: z.number().int().positive().optional().describe(
556
+ "Maximum seconds to wait for a response. Honored on a best-effort basis; the server may silently enforce a lower ceiling."
557
+ )
558
+ });
545
559
  var FetchInitSchema = z.object({
546
560
  method: z.enum(["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"]).optional().describe("HTTP method for the request (defaults to GET)"),
547
561
  headers: z.record(z.string(), z.string()).optional().describe("HTTP headers to include in the request"),
@@ -552,17 +566,8 @@ var FetchInitSchema = z.object({
552
566
  z.record(z.string(), z.unknown())
553
567
  ]).optional().describe(
554
568
  "Request body \u2014 plain objects and JSON strings are auto-detected and Content-Type is set accordingly"
555
- ),
556
- connectionId: ConnectionIdPropertySchema.optional().meta({
557
- deprecated: true
558
- }),
559
- connection: ConnectionPropertySchema.optional(),
560
- /** @deprecated Use connection instead */
561
- authenticationId: AuthenticationIdPropertySchema.optional().meta({
562
- deprecated: true
563
- }),
564
- callbackUrl: z.string().optional().describe("URL to send async response to (makes request async)")
565
- }).optional().describe(
569
+ )
570
+ }).extend(FetchInitZapierFieldsSchema.shape).optional().describe(
566
571
  "Request options including method, headers, body, and authentication"
567
572
  ).meta({
568
573
  aliases: { connectionId: "connection", authenticationId: "connection" }
@@ -715,6 +720,82 @@ function isResolvedAppLocator(appLocator) {
715
720
  return !!appLocator.implementationName;
716
721
  }
717
722
 
723
+ // src/utils/abort-utils.ts
724
+ function getAbortSignalApi() {
725
+ const api = AbortSignal;
726
+ return { any: api.any };
727
+ }
728
+ function createTimeoutError(timeoutMs) {
729
+ if (typeof DOMException !== "undefined") {
730
+ return new DOMException(
731
+ `The operation timed out after ${timeoutMs}ms`,
732
+ "TimeoutError"
733
+ );
734
+ }
735
+ const error = new Error(`The operation timed out after ${timeoutMs}ms`);
736
+ error.name = "TimeoutError";
737
+ return error;
738
+ }
739
+ function createTimeoutAbortSignal({
740
+ timeoutMs
741
+ }) {
742
+ const controller = new AbortController();
743
+ let timer = setTimeout(() => {
744
+ timer = void 0;
745
+ controller.abort(createTimeoutError(timeoutMs));
746
+ }, timeoutMs);
747
+ const maybeUnref = timer.unref;
748
+ if (typeof maybeUnref === "function") {
749
+ maybeUnref.call(timer);
750
+ }
751
+ return {
752
+ signal: controller.signal,
753
+ dispose: () => {
754
+ if (timer !== void 0) {
755
+ clearTimeout(timer);
756
+ timer = void 0;
757
+ }
758
+ }
759
+ };
760
+ }
761
+ function combineAbortSignals({
762
+ handles,
763
+ abortSignalApi = getAbortSignalApi()
764
+ }) {
765
+ if (handles.length === 0) return void 0;
766
+ if (handles.length === 1) return handles[0];
767
+ const disposeInputs = () => {
768
+ for (const handle of handles) handle.dispose();
769
+ };
770
+ if (abortSignalApi.any) {
771
+ return {
772
+ signal: abortSignalApi.any(handles.map((h) => h.signal)),
773
+ dispose: disposeInputs
774
+ };
775
+ }
776
+ const controller = new AbortController();
777
+ const listeners = [];
778
+ for (const { signal: source } of handles) {
779
+ if (source.aborted) {
780
+ controller.abort(source.reason);
781
+ return { signal: controller.signal, dispose: disposeInputs };
782
+ }
783
+ const handler = () => controller.abort(source.reason);
784
+ source.addEventListener("abort", handler, { once: true });
785
+ listeners.push({ source, handler });
786
+ }
787
+ return {
788
+ signal: controller.signal,
789
+ dispose: () => {
790
+ for (const { source, handler } of listeners) {
791
+ source.removeEventListener("abort", handler);
792
+ }
793
+ listeners.length = 0;
794
+ disposeInputs();
795
+ }
796
+ };
797
+ }
798
+
718
799
  // src/utils/type-guard-utils.ts
719
800
  function isPlainObject(value) {
720
801
  if (typeof value !== "object" || value === null) return false;
@@ -750,6 +831,34 @@ function getMethodMetadata() {
750
831
  return telemetryStore.getStore()?.methodMetadata;
751
832
  }
752
833
 
834
+ // src/utils/validation.ts
835
+ var validate = (schema, input) => {
836
+ const result = schema.safeParse(input);
837
+ if (!result.success) {
838
+ const errorMessages = result.error.issues.map((error) => {
839
+ const path = error.path.length > 0 ? error.path.join(".") : "input";
840
+ return `${path}: ${error.message}`;
841
+ });
842
+ const message = `Validation failed:
843
+ ${errorMessages.join("\n ")}`;
844
+ throw new ZapierValidationError(message, {
845
+ details: {
846
+ zodErrors: result.error.issues,
847
+ input
848
+ }
849
+ });
850
+ }
851
+ return result.data;
852
+ };
853
+ function createValidator(schema) {
854
+ return function validateFn(input) {
855
+ return validate(schema, input);
856
+ };
857
+ }
858
+ var validateOptions = (schema, options) => {
859
+ return validate(schema, options);
860
+ };
861
+
753
862
  // src/plugins/fetch/index.ts
754
863
  function transformUrlToRelayPath(url) {
755
864
  const targetUrl = new URL(url);
@@ -787,26 +896,59 @@ function inferContentType(body) {
787
896
  }
788
897
  return void 0;
789
898
  }
790
- var fetchPlugin = ({ context }) => {
899
+ function rewrapIfMaxTimeTimeout({
900
+ error,
901
+ abortSignal,
902
+ maxTimeSeconds
903
+ }) {
904
+ if (maxTimeSeconds === void 0 || !abortSignal?.aborted) return error;
905
+ const reason = abortSignal.reason;
906
+ if (!reason || reason.name !== "TimeoutError") return error;
907
+ return new ZapierTimeoutError(
908
+ `fetch timed out after ${maxTimeSeconds}s (maxTime)`,
909
+ { cause: error }
910
+ );
911
+ }
912
+ function buildAbortHandle({
913
+ maxTimeSeconds,
914
+ callerSignal
915
+ }) {
916
+ const handles = [];
917
+ if (callerSignal) handles.push({ signal: callerSignal, dispose: () => {
918
+ } });
919
+ if (maxTimeSeconds !== void 0) {
920
+ handles.push(
921
+ createTimeoutAbortSignal({ timeoutMs: maxTimeSeconds * 1e3 })
922
+ );
923
+ }
924
+ return combineAbortSignals({ handles });
925
+ }
926
+ var FetchInitSdkValidationSchema = z.looseObject(FetchInitZapierFieldsSchema.shape).optional();
927
+ var validateFetchInit = createValidator(FetchInitSdkValidationSchema);
928
+ var fetchPlugin = (sdk) => {
791
929
  return {
792
930
  fetch: async function fetch2(url, init) {
793
931
  return runWithTelemetryContext(async () => {
794
- const { api } = context;
932
+ const { api } = sdk.context;
795
933
  const startTime = Date.now();
796
934
  const isNested = isTelemetryNested();
797
935
  try {
936
+ if (init) {
937
+ validateFetchInit(init);
938
+ }
798
939
  const {
799
940
  connectionId,
800
941
  connection,
801
942
  authenticationId,
802
943
  callbackUrl,
944
+ maxTime,
803
945
  ...fetchInit
804
946
  } = init || {};
805
947
  const resolvedConnectionId = await resolveConnectionId({
806
948
  connectionId,
807
949
  connection,
808
950
  authenticationId,
809
- resolveConnection: context.resolveConnection,
951
+ resolveConnection: sdk.context.resolveConnection,
810
952
  label: "fetch"
811
953
  });
812
954
  const relayPath = transformUrlToRelayPath(url);
@@ -830,35 +972,52 @@ var fetchPlugin = ({ context }) => {
830
972
  if (callbackUrl) {
831
973
  headers["X-Relay-Callback-Url"] = callbackUrl;
832
974
  }
833
- const result = await api.fetch(relayPath, {
834
- method: fetchInit.method ?? "GET",
835
- body: fetchInit.body,
836
- headers,
837
- redirect: fetchInit.redirect,
838
- signal: fetchInit.signal,
839
- authRequired: true
975
+ if (maxTime !== void 0) {
976
+ headers["X-Zapier-Sdk-Max-Time"] = String(maxTime);
977
+ }
978
+ const abortHandle = buildAbortHandle({
979
+ maxTimeSeconds: maxTime,
980
+ callerSignal: fetchInit.signal
840
981
  });
841
- const relayError = result.headers.get("x-relay-error");
842
- if (relayError) {
843
- throw new ZapierRelayError(relayError, {
844
- statusCode: result.status
982
+ try {
983
+ const result = await api.fetch(relayPath, {
984
+ method: fetchInit.method ?? "GET",
985
+ body: fetchInit.body,
986
+ headers,
987
+ redirect: fetchInit.redirect,
988
+ signal: abortHandle?.signal,
989
+ authRequired: true
845
990
  });
846
- }
847
- if (!isNested) {
848
- context.eventEmission.emitMethodCalled({
849
- method_name: "fetch",
850
- execution_duration_ms: Date.now() - startTime,
851
- success_flag: true,
852
- error_message: null,
853
- error_type: null,
854
- argument_count: init ? 2 : 1,
855
- is_paginated: false
991
+ const relayError = result.headers.get("x-relay-error");
992
+ if (relayError) {
993
+ throw new ZapierRelayError(relayError, {
994
+ statusCode: result.status
995
+ });
996
+ }
997
+ if (!isNested) {
998
+ sdk.context.eventEmission.emitMethodCalled({
999
+ method_name: "fetch",
1000
+ execution_duration_ms: Date.now() - startTime,
1001
+ success_flag: true,
1002
+ error_message: null,
1003
+ error_type: null,
1004
+ argument_count: init ? 2 : 1,
1005
+ is_paginated: false
1006
+ });
1007
+ }
1008
+ return result;
1009
+ } catch (error) {
1010
+ throw rewrapIfMaxTimeTimeout({
1011
+ error,
1012
+ abortSignal: abortHandle?.signal,
1013
+ maxTimeSeconds: maxTime
856
1014
  });
1015
+ } finally {
1016
+ abortHandle?.dispose();
857
1017
  }
858
- return result;
859
1018
  } catch (error) {
860
1019
  if (!isNested) {
861
- context.eventEmission.emitMethodCalled({
1020
+ sdk.context.eventEmission.emitMethodCalled({
862
1021
  method_name: "fetch",
863
1022
  execution_duration_ms: Date.now() - startTime,
864
1023
  success_flag: false,
@@ -1143,34 +1302,6 @@ function toIterable(source) {
1143
1302
  return { [Symbol.asyncIterator]: () => source[Symbol.asyncIterator]() };
1144
1303
  }
1145
1304
 
1146
- // src/utils/validation.ts
1147
- var validate = (schema, input) => {
1148
- const result = schema.safeParse(input);
1149
- if (!result.success) {
1150
- const errorMessages = result.error.issues.map((error) => {
1151
- const path = error.path.length > 0 ? error.path.join(".") : "input";
1152
- return `${path}: ${error.message}`;
1153
- });
1154
- const message = `Validation failed:
1155
- ${errorMessages.join("\n ")}`;
1156
- throw new ZapierValidationError(message, {
1157
- details: {
1158
- zodErrors: result.error.issues,
1159
- input
1160
- }
1161
- });
1162
- }
1163
- return result.data;
1164
- };
1165
- function createValidator(schema) {
1166
- return function validateFn(input) {
1167
- return validate(schema, input);
1168
- };
1169
- }
1170
- var validateOptions = (schema, options) => {
1171
- return validate(schema, options);
1172
- };
1173
-
1174
1305
  // src/utils/function-utils.ts
1175
1306
  function extractCursor(data) {
1176
1307
  if (!data?.next) {
@@ -1450,9 +1581,9 @@ function createTelemetryCallback(emitMethodCalled, methodName) {
1450
1581
  }
1451
1582
 
1452
1583
  // src/plugins/listApps/index.ts
1453
- var listAppsPlugin = ({ context }) => {
1584
+ var listAppsPlugin = (sdk) => {
1454
1585
  async function listAppsPage(options) {
1455
- const { api, resolveAppKeys: resolveAppKeys2 } = context;
1586
+ const { api, resolveAppKeys: resolveAppKeys2 } = sdk.context;
1456
1587
  const appKeys = options.apps ?? options.appKeys ?? [];
1457
1588
  const appLocators = await resolveAppKeys2({
1458
1589
  appKeys: [...appKeys]
@@ -1496,7 +1627,10 @@ var listAppsPlugin = ({ context }) => {
1496
1627
  const listAppsDefinition = createPaginatedFunction(
1497
1628
  listAppsPage,
1498
1629
  ListAppsSchema,
1499
- createTelemetryCallback(context.eventEmission.emitMethodCalled, methodName),
1630
+ createTelemetryCallback(
1631
+ sdk.context.eventEmission.emitMethodCalled,
1632
+ methodName
1633
+ ),
1500
1634
  methodName,
1501
1635
  DEFAULT_PAGE_SIZE
1502
1636
  );
@@ -1937,7 +2071,7 @@ var actionKeyResolver = {
1937
2071
 
1938
2072
  // src/resolvers/connectionId.ts
1939
2073
  async function fetchConnections(sdk, resolvedParams) {
1940
- const context = sdk.getContext();
2074
+ const context = sdk.context;
1941
2075
  const includeShared = await context.hasCapability?.(
1942
2076
  "canIncludeSharedConnections"
1943
2077
  );
@@ -2105,7 +2239,7 @@ var tableIdResolver = {
2105
2239
  type: "dynamic",
2106
2240
  requireCapabilities: ["canIncludeSharedTables"],
2107
2241
  fetch: async (sdk) => {
2108
- const context = sdk.getContext();
2242
+ const context = sdk.context;
2109
2243
  const includeShared = await context.hasCapability?.(
2110
2244
  "canIncludeSharedTables"
2111
2245
  );
@@ -2745,7 +2879,7 @@ var tableSortResolver = {
2745
2879
  };
2746
2880
 
2747
2881
  // src/plugins/listActions/index.ts
2748
- var listActionsPlugin = ({ context }) => {
2882
+ var listActionsPlugin = (sdk) => {
2749
2883
  const methodMeta = {
2750
2884
  categories: ["action"],
2751
2885
  type: "list",
@@ -2758,7 +2892,7 @@ var listActionsPlugin = ({ context }) => {
2758
2892
  }
2759
2893
  };
2760
2894
  async function listActionsPage(options) {
2761
- const { api, getVersionedImplementationId } = context;
2895
+ const { api, getVersionedImplementationId } = sdk.context;
2762
2896
  const appKey = "app" in options ? options.app : options.appKey;
2763
2897
  const selectedApi = await getVersionedImplementationId(appKey);
2764
2898
  if (!selectedApi) {
@@ -2823,7 +2957,10 @@ var listActionsPlugin = ({ context }) => {
2823
2957
  const listActionsDefinition = createPaginatedFunction(
2824
2958
  listActionsPage,
2825
2959
  ListActionsInputSchema,
2826
- createTelemetryCallback(context.eventEmission.emitMethodCalled, methodName),
2960
+ createTelemetryCallback(
2961
+ sdk.context.eventEmission.emitMethodCalled,
2962
+ methodName
2963
+ ),
2827
2964
  methodName,
2828
2965
  DEFAULT_PAGE_SIZE
2829
2966
  );
@@ -3146,9 +3283,9 @@ function transformNeedsToFields(needs) {
3146
3283
  }
3147
3284
  return rootFields;
3148
3285
  }
3149
- var listInputFieldsPlugin = ({ sdk, context }) => {
3286
+ var listInputFieldsPlugin = (sdk) => {
3150
3287
  async function listInputFieldsPage(options) {
3151
- const { api, getVersionedImplementationId } = context;
3288
+ const { api, getVersionedImplementationId } = sdk.context;
3152
3289
  const appKey = "app" in options ? options.app : options.appKey;
3153
3290
  const actionKey = "action" in options ? options.action : options.actionKey;
3154
3291
  const { actionType, connection, connectionId, authenticationId, inputs } = options;
@@ -3156,7 +3293,7 @@ var listInputFieldsPlugin = ({ sdk, context }) => {
3156
3293
  connection,
3157
3294
  connectionId,
3158
3295
  authenticationId,
3159
- resolveConnection: context.resolveConnection
3296
+ resolveConnection: sdk.context.resolveConnection
3160
3297
  });
3161
3298
  const selectedApi = await getVersionedImplementationId(appKey);
3162
3299
  if (!selectedApi) {
@@ -3194,7 +3331,10 @@ var listInputFieldsPlugin = ({ sdk, context }) => {
3194
3331
  const listInputFieldsDefinition = createPaginatedFunction(
3195
3332
  listInputFieldsPage,
3196
3333
  ListInputFieldsInputSchema,
3197
- createTelemetryCallback(context.eventEmission.emitMethodCalled, methodName),
3334
+ createTelemetryCallback(
3335
+ sdk.context.eventEmission.emitMethodCalled,
3336
+ methodName
3337
+ ),
3198
3338
  methodName,
3199
3339
  DEFAULT_PAGE_SIZE
3200
3340
  );
@@ -3297,12 +3437,12 @@ var ConnectionItemSchema = withFormatter(ConnectionItemSchema$1, {
3297
3437
  });
3298
3438
 
3299
3439
  // src/plugins/listConnections/index.ts
3300
- var listConnectionsPlugin = ({ context }) => {
3440
+ var listConnectionsPlugin = (sdk) => {
3301
3441
  async function listConnectionsPage(options) {
3302
3442
  if (options.includeShared) {
3303
- await context.checkCapability("canIncludeSharedConnections");
3443
+ await sdk.context.checkCapability("canIncludeSharedConnections");
3304
3444
  }
3305
- const { api, getVersionedImplementationId } = context;
3445
+ const { api, getVersionedImplementationId } = sdk.context;
3306
3446
  const searchParams = {};
3307
3447
  if (options.pageSize !== void 0) {
3308
3448
  searchParams.page_size = options.pageSize.toString();
@@ -3325,7 +3465,7 @@ var listConnectionsPlugin = ({ context }) => {
3325
3465
  connectionRefs.map(
3326
3466
  (ref) => resolveConnectionId({
3327
3467
  connection: ref,
3328
- resolveConnection: context.resolveConnection
3468
+ resolveConnection: sdk.context.resolveConnection
3329
3469
  })
3330
3470
  )
3331
3471
  );
@@ -3391,7 +3531,10 @@ var listConnectionsPlugin = ({ context }) => {
3391
3531
  const listConnectionsDefinition = createPaginatedFunction(
3392
3532
  listConnectionsPage,
3393
3533
  ListConnectionsQuerySchema,
3394
- createTelemetryCallback(context.eventEmission.emitMethodCalled, methodName),
3534
+ createTelemetryCallback(
3535
+ sdk.context.eventEmission.emitMethodCalled,
3536
+ methodName
3537
+ ),
3395
3538
  methodName,
3396
3539
  DEFAULT_PAGE_SIZE
3397
3540
  );
@@ -3467,9 +3610,9 @@ var ClientCredentialsCreatedItemSchema = withFormatter(
3467
3610
  );
3468
3611
 
3469
3612
  // src/plugins/listClientCredentials/index.ts
3470
- var listClientCredentialsPlugin = ({ context }) => {
3613
+ var listClientCredentialsPlugin = (sdk) => {
3471
3614
  async function listClientCredentialsPage(options) {
3472
- const { api } = context;
3615
+ const { api } = sdk.context;
3473
3616
  const searchParams = {};
3474
3617
  if (options.pageSize !== void 0) {
3475
3618
  searchParams.pageSize = options.pageSize.toString();
@@ -3506,7 +3649,10 @@ var listClientCredentialsPlugin = ({ context }) => {
3506
3649
  const listClientCredentialsDefinition = createPaginatedFunction(
3507
3650
  listClientCredentialsPage,
3508
3651
  ListClientCredentialsQuerySchema,
3509
- createTelemetryCallback(context.eventEmission.emitMethodCalled, methodName),
3652
+ createTelemetryCallback(
3653
+ sdk.context.eventEmission.emitMethodCalled,
3654
+ methodName
3655
+ ),
3510
3656
  methodName,
3511
3657
  DEFAULT_PAGE_SIZE
3512
3658
  );
@@ -3530,9 +3676,9 @@ var CreateClientCredentialsSchema = CreateClientCredentialsRequestSchema.omit({
3530
3676
  }).describe("Create new client credentials for the authenticated user");
3531
3677
 
3532
3678
  // src/plugins/createClientCredentials/index.ts
3533
- var createClientCredentialsPlugin = ({ context }) => {
3679
+ var createClientCredentialsPlugin = (sdk) => {
3534
3680
  async function createClientCredentials(options) {
3535
- const { api } = context;
3681
+ const { api } = sdk.context;
3536
3682
  const response = await api.post(
3537
3683
  "/api/v0/client-credentials",
3538
3684
  {
@@ -3567,7 +3713,7 @@ var createClientCredentialsPlugin = ({ context }) => {
3567
3713
  createClientCredentials,
3568
3714
  CreateClientCredentialsSchema,
3569
3715
  createTelemetryCallback(
3570
- context.eventEmission.emitMethodCalled,
3716
+ sdk.context.eventEmission.emitMethodCalled,
3571
3717
  createClientCredentials.name
3572
3718
  )
3573
3719
  );
@@ -3595,9 +3741,9 @@ var DeleteClientCredentialsSchema = z.object({
3595
3741
  }).describe("Delete client credentials by client ID");
3596
3742
 
3597
3743
  // src/plugins/deleteClientCredentials/index.ts
3598
- var deleteClientCredentialsPlugin = ({ context }) => {
3744
+ var deleteClientCredentialsPlugin = (sdk) => {
3599
3745
  async function deleteClientCredentials(options) {
3600
- const { api } = context;
3746
+ const { api } = sdk.context;
3601
3747
  await api.delete(
3602
3748
  `/api/v0/client-credentials/${options.clientId}`,
3603
3749
  void 0,
@@ -3629,7 +3775,7 @@ var deleteClientCredentialsPlugin = ({ context }) => {
3629
3775
  deleteClientCredentials,
3630
3776
  DeleteClientCredentialsSchema,
3631
3777
  createTelemetryCallback(
3632
- context.eventEmission.emitMethodCalled,
3778
+ sdk.context.eventEmission.emitMethodCalled,
3633
3779
  deleteClientCredentials.name
3634
3780
  )
3635
3781
  );
@@ -3660,7 +3806,7 @@ var GetAppSchemaDeprecated = z.object({
3660
3806
  var GetAppInputSchema = z.union([GetAppSchema, GetAppSchemaDeprecated]).describe(GetAppDescription);
3661
3807
 
3662
3808
  // src/plugins/getApp/index.ts
3663
- var getAppPlugin = ({ sdk, context }) => {
3809
+ var getAppPlugin = (sdk) => {
3664
3810
  async function getApp(options) {
3665
3811
  const appKey = "app" in options ? options.app : options.appKey;
3666
3812
  const appsIterable = sdk.listApps({
@@ -3679,7 +3825,7 @@ var getAppPlugin = ({ sdk, context }) => {
3679
3825
  getApp,
3680
3826
  GetAppInputSchema,
3681
3827
  createTelemetryCallback(
3682
- context.eventEmission.emitMethodCalled,
3828
+ sdk.context.eventEmission.emitMethodCalled,
3683
3829
  getApp.name
3684
3830
  )
3685
3831
  );
@@ -3715,7 +3861,7 @@ var GetActionSchemaDeprecated = z.object({
3715
3861
  var GetActionInputSchema = z.union([GetActionSchema, GetActionSchemaDeprecated]).describe(GetActionDescription);
3716
3862
 
3717
3863
  // src/plugins/getAction/index.ts
3718
- var getActionPlugin = ({ sdk, context }) => {
3864
+ var getActionPlugin = (sdk) => {
3719
3865
  async function getAction(options) {
3720
3866
  const appKey = "app" in options ? options.app : options.appKey;
3721
3867
  const actionKey = "action" in options ? options.action : options.actionKey;
@@ -3738,7 +3884,7 @@ var getActionPlugin = ({ sdk, context }) => {
3738
3884
  getAction,
3739
3885
  GetActionInputSchema,
3740
3886
  createTelemetryCallback(
3741
- context.eventEmission.emitMethodCalled,
3887
+ sdk.context.eventEmission.emitMethodCalled,
3742
3888
  getAction.name
3743
3889
  )
3744
3890
  );
@@ -3775,9 +3921,9 @@ var GetConnectionParamSchema = z.object({
3775
3921
  });
3776
3922
 
3777
3923
  // src/plugins/getConnection/index.ts
3778
- var getConnectionPlugin = ({ context }) => {
3924
+ var getConnectionPlugin = (sdk) => {
3779
3925
  async function getConnection(options) {
3780
- const { api } = context;
3926
+ const { api } = sdk.context;
3781
3927
  const resolvedConnectionId = options.connection ?? options.connectionId ?? options.authenticationId;
3782
3928
  if (!resolvedConnectionId) {
3783
3929
  throw new Error("connection is required");
@@ -3794,7 +3940,7 @@ var getConnectionPlugin = ({ context }) => {
3794
3940
  getConnection,
3795
3941
  GetConnectionParamSchema,
3796
3942
  createTelemetryCallback(
3797
- context.eventEmission.emitMethodCalled,
3943
+ sdk.context.eventEmission.emitMethodCalled,
3798
3944
  getConnection.name
3799
3945
  )
3800
3946
  );
@@ -3828,7 +3974,7 @@ var FindFirstConnectionSchema = ListConnectionsQuerySchema.omit({
3828
3974
  }).describe("Find the first connection matching the criteria");
3829
3975
 
3830
3976
  // src/plugins/findFirstConnection/index.ts
3831
- var findFirstConnectionPlugin = ({ sdk, context }) => {
3977
+ var findFirstConnectionPlugin = (sdk) => {
3832
3978
  async function findFirstConnection(options = {}) {
3833
3979
  const connectionsResponse = await sdk.listConnections({
3834
3980
  ...options,
@@ -3848,7 +3994,7 @@ var findFirstConnectionPlugin = ({ sdk, context }) => {
3848
3994
  findFirstConnection,
3849
3995
  FindFirstConnectionSchema,
3850
3996
  createTelemetryCallback(
3851
- context.eventEmission.emitMethodCalled,
3997
+ sdk.context.eventEmission.emitMethodCalled,
3852
3998
  findFirstConnection.name
3853
3999
  )
3854
4000
  );
@@ -3879,7 +4025,7 @@ var FindUniqueConnectionSchema = ListConnectionsQuerySchema.omit({
3879
4025
  }).describe("Find a unique connection matching the criteria");
3880
4026
 
3881
4027
  // src/plugins/findUniqueConnection/index.ts
3882
- var findUniqueConnectionPlugin = ({ sdk, context }) => {
4028
+ var findUniqueConnectionPlugin = (sdk) => {
3883
4029
  async function findUniqueConnection(options = {}) {
3884
4030
  const connectionsResponse = await sdk.listConnections({
3885
4031
  ...options,
@@ -3905,7 +4051,7 @@ var findUniqueConnectionPlugin = ({ sdk, context }) => {
3905
4051
  findUniqueConnection,
3906
4052
  FindUniqueConnectionSchema,
3907
4053
  createTelemetryCallback(
3908
- context.eventEmission.emitMethodCalled,
4054
+ sdk.context.eventEmission.emitMethodCalled,
3909
4055
  findUniqueConnection.name
3910
4056
  )
3911
4057
  );
@@ -4008,7 +4154,7 @@ async function executeAction(actionOptions) {
4008
4154
  }
4009
4155
  var CONTEXT_CACHE_TTL_MS = 6e4;
4010
4156
  var CONTEXT_CACHE_MAX_SIZE = 500;
4011
- var runActionPlugin = ({ sdk, context }) => {
4157
+ var runActionPlugin = (sdk) => {
4012
4158
  const runActionContextCache = /* @__PURE__ */ new Map();
4013
4159
  function evictIfNeeded() {
4014
4160
  if (runActionContextCache.size < CONTEXT_CACHE_MAX_SIZE) return;
@@ -4052,7 +4198,7 @@ var runActionPlugin = ({ sdk, context }) => {
4052
4198
  }
4053
4199
  async function resolveRunActionContext(options) {
4054
4200
  const { appKey, actionKey, actionType } = options;
4055
- const selectedApi = await context.getVersionedImplementationId(appKey);
4201
+ const selectedApi = await sdk.context.getVersionedImplementationId(appKey);
4056
4202
  if (!selectedApi) {
4057
4203
  throw new ZapierConfigurationError(
4058
4204
  "No current_implementation_id found for app",
@@ -4072,7 +4218,7 @@ var runActionPlugin = ({ sdk, context }) => {
4072
4218
  return { selectedApi, actionId: actionData.data.id };
4073
4219
  }
4074
4220
  async function runActionPage(options) {
4075
- const { api } = context;
4221
+ const { api } = sdk.context;
4076
4222
  const appKey = "app" in options ? options.app : options.appKey;
4077
4223
  const actionKey = "action" in options ? options.action : options.actionKey;
4078
4224
  const {
@@ -4088,7 +4234,7 @@ var runActionPlugin = ({ sdk, context }) => {
4088
4234
  connectionId,
4089
4235
  connection,
4090
4236
  authenticationId,
4091
- resolveConnection: context.resolveConnection
4237
+ resolveConnection: sdk.context.resolveConnection
4092
4238
  });
4093
4239
  const { selectedApi, actionId } = await getRunActionContext({
4094
4240
  appKey,
@@ -4131,7 +4277,10 @@ var runActionPlugin = ({ sdk, context }) => {
4131
4277
  const runActionDefinition = createPaginatedFunction(
4132
4278
  runActionPage,
4133
4279
  RunActionInputSchema,
4134
- createTelemetryCallback(context.eventEmission.emitMethodCalled, methodName),
4280
+ createTelemetryCallback(
4281
+ sdk.context.eventEmission.emitMethodCalled,
4282
+ methodName
4283
+ ),
4135
4284
  methodName
4136
4285
  );
4137
4286
  return {
@@ -4191,7 +4340,7 @@ function resetDeprecationWarnings() {
4191
4340
  }
4192
4341
 
4193
4342
  // src/plugins/request/index.ts
4194
- var requestPlugin = ({ sdk, context }) => {
4343
+ var requestPlugin = (sdk) => {
4195
4344
  async function request(options) {
4196
4345
  logDeprecation("request() is deprecated. Use fetch() instead.");
4197
4346
  const {
@@ -4216,7 +4365,7 @@ var requestPlugin = ({ sdk, context }) => {
4216
4365
  request,
4217
4366
  RelayRequestSchema,
4218
4367
  createTelemetryCallback(
4219
- context.eventEmission.emitMethodCalled,
4368
+ sdk.context.eventEmission.emitMethodCalled,
4220
4369
  request.name
4221
4370
  )
4222
4371
  );
@@ -4525,9 +4674,8 @@ async function resolveAppKeys({
4525
4674
  });
4526
4675
  return slugResolvedLocators.filter(isResolvedAppLocator);
4527
4676
  }
4528
- var manifestPlugin = (params) => {
4529
- const { context } = params;
4530
- const { api, options } = context;
4677
+ var manifestPlugin = (sdk) => {
4678
+ const { api, options } = sdk.context;
4531
4679
  const { manifestPath = DEFAULT_CONFIG_PATH, manifest } = options || {};
4532
4680
  let resolvedManifest;
4533
4681
  async function resolveManifest() {
@@ -4738,9 +4886,9 @@ var UserProfileItemSchema = withFormatter(
4738
4886
  );
4739
4887
 
4740
4888
  // src/plugins/getProfile/index.ts
4741
- var getProfilePlugin = ({ context }) => {
4889
+ var getProfilePlugin = (sdk) => {
4742
4890
  async function getProfile() {
4743
- const profile = await context.api.get(
4891
+ const profile = await sdk.context.api.get(
4744
4892
  "/zapier/api/v4/profile/",
4745
4893
  {
4746
4894
  authRequired: true
@@ -4762,7 +4910,7 @@ var getProfilePlugin = ({ context }) => {
4762
4910
  getProfile,
4763
4911
  GetProfileSchema,
4764
4912
  createTelemetryCallback(
4765
- context.eventEmission.emitMethodCalled,
4913
+ sdk.context.eventEmission.emitMethodCalled,
4766
4914
  getProfile.name
4767
4915
  )
4768
4916
  );
@@ -5949,7 +6097,7 @@ var createZapierApi = (options) => {
5949
6097
  };
5950
6098
 
5951
6099
  // src/plugins/api/index.ts
5952
- var apiPlugin = (params) => {
6100
+ var apiPlugin = (sdk) => {
5953
6101
  const {
5954
6102
  fetch: customFetch = globalThis.fetch,
5955
6103
  baseUrl = ZAPIER_BASE_URL,
@@ -5959,7 +6107,7 @@ var apiPlugin = (params) => {
5959
6107
  debug = false,
5960
6108
  maxNetworkRetries = ZAPIER_MAX_NETWORK_RETRIES,
5961
6109
  maxNetworkRetryDelayMs = ZAPIER_MAX_NETWORK_RETRY_DELAY_MS
5962
- } = params.context.options;
6110
+ } = sdk.context.options;
5963
6111
  const api = createZapierApi({
5964
6112
  baseUrl,
5965
6113
  credentials,
@@ -6074,12 +6222,11 @@ async function batch(tasks, options = {}) {
6074
6222
  }
6075
6223
 
6076
6224
  // src/plugins/connections/index.ts
6077
- var connectionsPlugin = (params) => {
6078
- const { context } = params;
6225
+ var connectionsPlugin = (sdk) => {
6079
6226
  let cachedMap;
6080
6227
  async function loadConnectionsMap() {
6081
6228
  if (cachedMap === void 0) {
6082
- cachedMap = await context.getManifestConnections() ?? null;
6229
+ cachedMap = await sdk.context.getManifestConnections() ?? null;
6083
6230
  }
6084
6231
  return cachedMap;
6085
6232
  }
@@ -6126,12 +6273,12 @@ function isEnabledByEnv(key) {
6126
6273
  if (value === "false" || value === "0") return false;
6127
6274
  return void 0;
6128
6275
  }
6129
- var capabilitiesPlugin = ({ context }) => {
6130
- const options = context.options ?? {};
6276
+ var capabilitiesPlugin = (sdk) => {
6277
+ const options = sdk.context.options ?? {};
6131
6278
  let cached;
6132
6279
  async function resolveFlags() {
6133
6280
  if (cached) return cached;
6134
- const manifest = await context.getResolvedManifest();
6281
+ const manifest = await sdk.context.getResolvedManifest();
6135
6282
  cached = {};
6136
6283
  for (const flag of GATED_FLAGS) {
6137
6284
  cached[flag] = Boolean(
@@ -6217,12 +6364,12 @@ function extractNextCursor(links) {
6217
6364
  return void 0;
6218
6365
  }
6219
6366
  }
6220
- var listTablesPlugin = ({ context }) => {
6367
+ var listTablesPlugin = (sdk) => {
6221
6368
  async function listTablesPage(options) {
6222
6369
  if (options.includeShared) {
6223
- await context.checkCapability("canIncludeSharedTables");
6370
+ await sdk.context.checkCapability("canIncludeSharedTables");
6224
6371
  }
6225
- const { api } = context;
6372
+ const { api } = sdk.context;
6226
6373
  const searchParams = {};
6227
6374
  if (options.pageSize !== void 0) {
6228
6375
  searchParams.limit = options.pageSize.toString();
@@ -6287,7 +6434,10 @@ var listTablesPlugin = ({ context }) => {
6287
6434
  const listTablesDefinition = createPaginatedFunction(
6288
6435
  listTablesPage,
6289
6436
  ListTablesOptionsSchema,
6290
- createTelemetryCallback(context.eventEmission.emitMethodCalled, methodName),
6437
+ createTelemetryCallback(
6438
+ sdk.context.eventEmission.emitMethodCalled,
6439
+ methodName
6440
+ ),
6291
6441
  methodName,
6292
6442
  DEFAULT_PAGE_SIZE
6293
6443
  );
@@ -6319,9 +6469,9 @@ var GetTableOptionsSchemaDeprecated = z.object({
6319
6469
  var GetTableOptionsInputSchema = z.union([GetTableOptionsSchema, GetTableOptionsSchemaDeprecated]).describe(GetTableDescription);
6320
6470
 
6321
6471
  // src/plugins/tables/getTable/index.ts
6322
- var getTablePlugin = ({ context }) => {
6472
+ var getTablePlugin = (sdk) => {
6323
6473
  async function getTable(options) {
6324
- const { api } = context;
6474
+ const { api } = sdk.context;
6325
6475
  const tableId = "table" in options ? options.table : options.tableId;
6326
6476
  const rawResponse = await api.get(`/tables/api/v1/tables/${tableId}`, {
6327
6477
  customErrorHandler: ({ status }) => {
@@ -6353,7 +6503,7 @@ var getTablePlugin = ({ context }) => {
6353
6503
  getTable,
6354
6504
  GetTableOptionsInputSchema,
6355
6505
  createTelemetryCallback(
6356
- context.eventEmission.emitMethodCalled,
6506
+ sdk.context.eventEmission.emitMethodCalled,
6357
6507
  getTable.name
6358
6508
  )
6359
6509
  );
@@ -6384,9 +6534,9 @@ var CreateTableOptionsSchema = z.object({
6384
6534
  }).describe("Create a new table");
6385
6535
 
6386
6536
  // src/plugins/tables/createTable/index.ts
6387
- var createTablePlugin = ({ context }) => {
6537
+ var createTablePlugin = (sdk) => {
6388
6538
  async function createTable(options) {
6389
- const { api } = context;
6539
+ const { api } = sdk.context;
6390
6540
  const rawResponse = await api.post(
6391
6541
  "/tables/api/v1/tables",
6392
6542
  {
@@ -6421,7 +6571,7 @@ var createTablePlugin = ({ context }) => {
6421
6571
  createTable,
6422
6572
  CreateTableOptionsSchema,
6423
6573
  createTelemetryCallback(
6424
- context.eventEmission.emitMethodCalled,
6574
+ sdk.context.eventEmission.emitMethodCalled,
6425
6575
  createTable.name
6426
6576
  )
6427
6577
  );
@@ -6453,10 +6603,10 @@ var DeleteTableOptionsSchemaDeprecated = z.object({
6453
6603
  var DeleteTableOptionsInputSchema = z.union([DeleteTableOptionsSchema, DeleteTableOptionsSchemaDeprecated]).describe(DeleteTableDescription);
6454
6604
 
6455
6605
  // src/plugins/tables/deleteTable/index.ts
6456
- var deleteTablePlugin = ({ context }) => {
6606
+ var deleteTablePlugin = (sdk) => {
6457
6607
  async function deleteTable(options) {
6458
- await context.checkCapability("canDeleteTables");
6459
- const { api } = context;
6608
+ await sdk.context.checkCapability("canDeleteTables");
6609
+ const { api } = sdk.context;
6460
6610
  const tableId = "table" in options ? options.table : options.tableId;
6461
6611
  await api.delete(`/tables/api/v1/tables/${tableId}`, void 0, {
6462
6612
  customErrorHandler: ({ status }) => {
@@ -6484,7 +6634,7 @@ var deleteTablePlugin = ({ context }) => {
6484
6634
  deleteTable,
6485
6635
  DeleteTableOptionsInputSchema,
6486
6636
  createTelemetryCallback(
6487
- context.eventEmission.emitMethodCalled,
6637
+ sdk.context.eventEmission.emitMethodCalled,
6488
6638
  deleteTable.name
6489
6639
  )
6490
6640
  );
@@ -6508,9 +6658,9 @@ var deleteTablePlugin = ({ context }) => {
6508
6658
  };
6509
6659
 
6510
6660
  // src/plugins/tables/listTableFields/index.ts
6511
- var listTableFieldsPlugin = ({ context }) => {
6661
+ var listTableFieldsPlugin = (sdk) => {
6512
6662
  async function listTableFields(options) {
6513
- const { api } = context;
6663
+ const { api } = sdk.context;
6514
6664
  const tableId = "table" in options ? options.table : options.tableId;
6515
6665
  const fieldKeys = "fields" in options ? options.fields : options.fieldKeys;
6516
6666
  const searchParams = {};
@@ -6556,7 +6706,7 @@ var listTableFieldsPlugin = ({ context }) => {
6556
6706
  listTableFields,
6557
6707
  ListTableFieldsOptionsInputSchema,
6558
6708
  createTelemetryCallback(
6559
- context.eventEmission.emitMethodCalled,
6709
+ sdk.context.eventEmission.emitMethodCalled,
6560
6710
  listTableFields.name
6561
6711
  )
6562
6712
  );
@@ -6611,9 +6761,9 @@ var CreateTableFieldsOptionsInputSchema = z.union([
6611
6761
  ]).describe(CreateTableFieldsDescription);
6612
6762
 
6613
6763
  // src/plugins/tables/createTableFields/index.ts
6614
- var createTableFieldsPlugin = ({ context }) => {
6764
+ var createTableFieldsPlugin = (sdk) => {
6615
6765
  async function createTableFields(options) {
6616
- const { api } = context;
6766
+ const { api } = sdk.context;
6617
6767
  const tableId = "table" in options ? options.table : options.tableId;
6618
6768
  const rawResponse = await api.post(
6619
6769
  `/tables/api/v1/tables/${tableId}/fields`,
@@ -6648,7 +6798,7 @@ var createTableFieldsPlugin = ({ context }) => {
6648
6798
  createTableFields,
6649
6799
  CreateTableFieldsOptionsInputSchema,
6650
6800
  createTelemetryCallback(
6651
- context.eventEmission.emitMethodCalled,
6801
+ sdk.context.eventEmission.emitMethodCalled,
6652
6802
  createTableFields.name
6653
6803
  )
6654
6804
  );
@@ -6688,9 +6838,9 @@ var DeleteTableFieldsOptionsInputSchema = z.union([
6688
6838
  ]).describe(DeleteTableFieldsDescription);
6689
6839
 
6690
6840
  // src/plugins/tables/deleteTableFields/index.ts
6691
- var deleteTableFieldsPlugin = ({ context }) => {
6841
+ var deleteTableFieldsPlugin = (sdk) => {
6692
6842
  async function deleteTableFields(options) {
6693
- const { api } = context;
6843
+ const { api } = sdk.context;
6694
6844
  const tableId = "table" in options ? options.table : options.tableId;
6695
6845
  const fieldKeys = "fields" in options ? options.fields : options.fieldKeys;
6696
6846
  const numericFieldIds = await resolveFieldKeys({
@@ -6728,7 +6878,7 @@ var deleteTableFieldsPlugin = ({ context }) => {
6728
6878
  deleteTableFields,
6729
6879
  DeleteTableFieldsOptionsInputSchema,
6730
6880
  createTelemetryCallback(
6731
- context.eventEmission.emitMethodCalled,
6881
+ sdk.context.eventEmission.emitMethodCalled,
6732
6882
  deleteTableFields.name
6733
6883
  )
6734
6884
  );
@@ -6815,9 +6965,9 @@ var tableRecordFormatter = {
6815
6965
  };
6816
6966
 
6817
6967
  // src/plugins/tables/getTableRecord/index.ts
6818
- var getTableRecordPlugin = ({ context }) => {
6968
+ var getTableRecordPlugin = (sdk) => {
6819
6969
  async function getTableRecord(options) {
6820
- const { api } = context;
6970
+ const { api } = sdk.context;
6821
6971
  const tableId = "table" in options ? options.table : options.tableId;
6822
6972
  const recordId = "record" in options ? options.record : options.recordId;
6823
6973
  const rawResponse = await api.get(
@@ -6861,7 +7011,7 @@ var getTableRecordPlugin = ({ context }) => {
6861
7011
  getTableRecord,
6862
7012
  GetTableRecordOptionsInputSchema,
6863
7013
  createTelemetryCallback(
6864
- context.eventEmission.emitMethodCalled,
7014
+ sdk.context.eventEmission.emitMethodCalled,
6865
7015
  getTableRecord.name
6866
7016
  )
6867
7017
  );
@@ -6949,9 +7099,9 @@ function extractNextCursor2(meta) {
6949
7099
  }
6950
7100
  return meta.pagination.end_cursor;
6951
7101
  }
6952
- var listTableRecordsPlugin = ({ context }) => {
7102
+ var listTableRecordsPlugin = (sdk) => {
6953
7103
  async function listTableRecordsPage(options) {
6954
- const { api } = context;
7104
+ const { api } = sdk.context;
6955
7105
  const tableId = "table" in options ? options.table : options.tableId;
6956
7106
  const translator = await createFieldKeyTranslator({
6957
7107
  api,
@@ -7023,7 +7173,10 @@ var listTableRecordsPlugin = ({ context }) => {
7023
7173
  const listTableRecordsDefinition = createPaginatedFunction(
7024
7174
  listTableRecordsPage,
7025
7175
  ListTableRecordsOptionsInputSchema,
7026
- createTelemetryCallback(context.eventEmission.emitMethodCalled, methodName),
7176
+ createTelemetryCallback(
7177
+ sdk.context.eventEmission.emitMethodCalled,
7178
+ methodName
7179
+ ),
7027
7180
  methodName,
7028
7181
  DEFAULT_PAGE_SIZE
7029
7182
  );
@@ -7078,9 +7231,9 @@ var CreateTableRecordsOptionsInputSchema = z.union([
7078
7231
  ]).describe(CreateTableRecordsDescription);
7079
7232
 
7080
7233
  // src/plugins/tables/createTableRecords/index.ts
7081
- var createTableRecordsPlugin = ({ context }) => {
7234
+ var createTableRecordsPlugin = (sdk) => {
7082
7235
  async function createTableRecords(options) {
7083
- const { api } = context;
7236
+ const { api } = sdk.context;
7084
7237
  const tableId = "table" in options ? options.table : options.tableId;
7085
7238
  const translator = await createFieldKeyTranslator({
7086
7239
  api,
@@ -7132,7 +7285,7 @@ var createTableRecordsPlugin = ({ context }) => {
7132
7285
  createTableRecords,
7133
7286
  CreateTableRecordsOptionsInputSchema,
7134
7287
  createTelemetryCallback(
7135
- context.eventEmission.emitMethodCalled,
7288
+ sdk.context.eventEmission.emitMethodCalled,
7136
7289
  createTableRecords.name
7137
7290
  )
7138
7291
  );
@@ -7171,9 +7324,9 @@ var DeleteTableRecordsOptionsInputSchema = z.union([
7171
7324
  ]).describe(DeleteTableRecordsDescription);
7172
7325
 
7173
7326
  // src/plugins/tables/deleteTableRecords/index.ts
7174
- var deleteTableRecordsPlugin = ({ context }) => {
7327
+ var deleteTableRecordsPlugin = (sdk) => {
7175
7328
  async function deleteTableRecords(options) {
7176
- const { api } = context;
7329
+ const { api } = sdk.context;
7177
7330
  const tableId = "table" in options ? options.table : options.tableId;
7178
7331
  const recordIds = "records" in options ? options.records : options.recordIds;
7179
7332
  await api.delete(
@@ -7206,7 +7359,7 @@ var deleteTableRecordsPlugin = ({ context }) => {
7206
7359
  deleteTableRecords,
7207
7360
  DeleteTableRecordsOptionsInputSchema,
7208
7361
  createTelemetryCallback(
7209
- context.eventEmission.emitMethodCalled,
7362
+ sdk.context.eventEmission.emitMethodCalled,
7210
7363
  deleteTableRecords.name
7211
7364
  )
7212
7365
  );
@@ -7260,9 +7413,9 @@ var UpdateTableRecordsOptionsInputSchema = z.union([
7260
7413
  ]).describe(UpdateTableRecordsDescription);
7261
7414
 
7262
7415
  // src/plugins/tables/updateTableRecords/index.ts
7263
- var updateTableRecordsPlugin = ({ context }) => {
7416
+ var updateTableRecordsPlugin = (sdk) => {
7264
7417
  async function updateTableRecords(options) {
7265
- const { api } = context;
7418
+ const { api } = sdk.context;
7266
7419
  const tableId = "table" in options ? options.table : options.tableId;
7267
7420
  const translator = await createFieldKeyTranslator({
7268
7421
  api,
@@ -7315,7 +7468,7 @@ var updateTableRecordsPlugin = ({ context }) => {
7315
7468
  updateTableRecords,
7316
7469
  UpdateTableRecordsOptionsInputSchema,
7317
7470
  createTelemetryCallback(
7318
- context.eventEmission.emitMethodCalled,
7471
+ sdk.context.eventEmission.emitMethodCalled,
7319
7472
  updateTableRecords.name
7320
7473
  )
7321
7474
  );
@@ -7341,8 +7494,8 @@ var updateTableRecordsPlugin = ({ context }) => {
7341
7494
  };
7342
7495
 
7343
7496
  // src/plugins/registry/index.ts
7344
- var registryPlugin = ({ sdk, context }) => {
7345
- const metaKeys = Object.keys(context.meta || {});
7497
+ var registryPlugin = (sdk) => {
7498
+ const metaKeys = Object.keys(sdk.context.meta || {});
7346
7499
  const categoryDefinitions = {
7347
7500
  account: {
7348
7501
  title: "Account"
@@ -7387,7 +7540,7 @@ var registryPlugin = ({ sdk, context }) => {
7387
7540
  }
7388
7541
  return false;
7389
7542
  }).map((key) => {
7390
- const meta = context.meta[key];
7543
+ const meta = sdk.context.meta[key];
7391
7544
  return {
7392
7545
  name: key,
7393
7546
  description: meta.description,
@@ -7455,7 +7608,7 @@ var registryPlugin = ({ sdk, context }) => {
7455
7608
  };
7456
7609
 
7457
7610
  // src/plugins/deprecated/authentications.ts
7458
- var listAuthenticationsPlugin = ({ sdk }) => ({
7611
+ var listAuthenticationsPlugin = (sdk) => ({
7459
7612
  listAuthentications: sdk.listConnections,
7460
7613
  context: {
7461
7614
  meta: {
@@ -7470,7 +7623,7 @@ var listAuthenticationsPlugin = ({ sdk }) => ({
7470
7623
  }
7471
7624
  }
7472
7625
  });
7473
- var getAuthenticationPlugin = ({ sdk }) => ({
7626
+ var getAuthenticationPlugin = (sdk) => ({
7474
7627
  getAuthentication: sdk.getConnection,
7475
7628
  context: {
7476
7629
  meta: {
@@ -7485,7 +7638,7 @@ var getAuthenticationPlugin = ({ sdk }) => ({
7485
7638
  }
7486
7639
  }
7487
7640
  });
7488
- var findFirstAuthenticationPlugin = ({ sdk }) => ({
7641
+ var findFirstAuthenticationPlugin = (sdk) => ({
7489
7642
  findFirstAuthentication: sdk.findFirstConnection,
7490
7643
  context: {
7491
7644
  meta: {
@@ -7500,7 +7653,7 @@ var findFirstAuthenticationPlugin = ({ sdk }) => ({
7500
7653
  }
7501
7654
  }
7502
7655
  });
7503
- var findUniqueAuthenticationPlugin = ({ sdk }) => ({
7656
+ var findUniqueAuthenticationPlugin = (sdk) => ({
7504
7657
  findUniqueAuthentication: sdk.findUniqueConnection,
7505
7658
  context: {
7506
7659
  meta: {
@@ -7563,9 +7716,9 @@ var GetInputFieldsSchemaSchemaDeprecated = z.object({
7563
7716
  var GetInputFieldsSchemaInputSchema = z.union([GetInputFieldsSchemaSchema, GetInputFieldsSchemaSchemaDeprecated]).describe(GetInputFieldsSchemaDescription);
7564
7717
 
7565
7718
  // src/plugins/getInputFieldsSchema/index.ts
7566
- var getInputFieldsSchemaPlugin = ({ sdk, context }) => {
7719
+ var getInputFieldsSchemaPlugin = (sdk) => {
7567
7720
  async function getInputFieldsSchema(options) {
7568
- const { api, getVersionedImplementationId } = context;
7721
+ const { api, getVersionedImplementationId } = sdk.context;
7569
7722
  const appKey = "app" in options ? options.app : options.appKey;
7570
7723
  const actionKey = "action" in options ? options.action : options.actionKey;
7571
7724
  const { actionType, connection, connectionId, authenticationId, inputs } = options;
@@ -7573,7 +7726,7 @@ var getInputFieldsSchemaPlugin = ({ sdk, context }) => {
7573
7726
  connection,
7574
7727
  connectionId,
7575
7728
  authenticationId,
7576
- resolveConnection: context.resolveConnection
7729
+ resolveConnection: sdk.context.resolveConnection
7577
7730
  });
7578
7731
  const selectedApi = await getVersionedImplementationId(appKey);
7579
7732
  if (!selectedApi) {
@@ -7608,7 +7761,7 @@ var getInputFieldsSchemaPlugin = ({ sdk, context }) => {
7608
7761
  getInputFieldsSchema,
7609
7762
  GetInputFieldsSchemaInputSchema,
7610
7763
  createTelemetryCallback(
7611
- context.eventEmission.emitMethodCalled,
7764
+ sdk.context.eventEmission.emitMethodCalled,
7612
7765
  getInputFieldsSchema.name
7613
7766
  )
7614
7767
  );
@@ -7702,9 +7855,9 @@ function transformNeedChoicesToInputFieldChoiceItem(choice) {
7702
7855
  value: choice.value
7703
7856
  };
7704
7857
  }
7705
- var listInputFieldChoicesPlugin = ({ context, sdk }) => {
7858
+ var listInputFieldChoicesPlugin = (sdk) => {
7706
7859
  async function listInputFieldChoicesPage(options) {
7707
- const { api, getVersionedImplementationId } = context;
7860
+ const { api, getVersionedImplementationId } = sdk.context;
7708
7861
  const appKey = "app" in options ? options.app : options.appKey;
7709
7862
  const actionKey = "action" in options ? options.action : options.actionKey;
7710
7863
  const inputFieldKey = "inputField" in options ? options.inputField : options.inputFieldKey;
@@ -7721,7 +7874,7 @@ var listInputFieldChoicesPlugin = ({ context, sdk }) => {
7721
7874
  connection,
7722
7875
  connectionId,
7723
7876
  authenticationId,
7724
- resolveConnection: context.resolveConnection
7877
+ resolveConnection: sdk.context.resolveConnection
7725
7878
  });
7726
7879
  const selectedApi = await getVersionedImplementationId(appKey);
7727
7880
  if (!selectedApi) {
@@ -7799,7 +7952,10 @@ var listInputFieldChoicesPlugin = ({ context, sdk }) => {
7799
7952
  const listInputFieldChoicesDefinition = createPaginatedFunction(
7800
7953
  listInputFieldChoicesPage,
7801
7954
  ListInputFieldChoicesInputSchema,
7802
- createTelemetryCallback(context.eventEmission.emitMethodCalled, methodName),
7955
+ createTelemetryCallback(
7956
+ sdk.context.eventEmission.emitMethodCalled,
7957
+ methodName
7958
+ ),
7803
7959
  methodName,
7804
7960
  DEFAULT_PAGE_SIZE
7805
7961
  );
@@ -8171,19 +8327,20 @@ function getTransportConfig(options) {
8171
8327
  endpoint
8172
8328
  };
8173
8329
  }
8174
- var eventEmissionPlugin = ({ context }) => {
8330
+ var eventEmissionPlugin = (sdk) => {
8331
+ const options = sdk.context.options ?? {};
8175
8332
  const defaultTransport = getTransportConfig({
8176
- trackingBaseUrl: context.options.trackingBaseUrl,
8177
- baseUrl: context.options.baseUrl
8333
+ trackingBaseUrl: options.trackingBaseUrl,
8334
+ baseUrl: options.baseUrl
8178
8335
  });
8179
8336
  const config = {
8180
- enabled: context.options.eventEmission?.enabled ?? true,
8181
- callContext: context.options.eventEmission?.callContext,
8337
+ enabled: options.eventEmission?.enabled ?? true,
8338
+ callContext: options.eventEmission?.callContext,
8182
8339
  transport: (
8183
8340
  // If env var is set, use it (defaultTransport will be from env)
8184
8341
  globalThis.process?.env?.ZAPIER_SDK_TELEMETRY_TRANSPORT ? defaultTransport : (
8185
8342
  // Otherwise, use option transport or default
8186
- context.options.eventEmission?.transport ?? defaultTransport
8343
+ options.eventEmission?.transport ?? defaultTransport
8187
8344
  )
8188
8345
  )
8189
8346
  };
@@ -8191,7 +8348,7 @@ var eventEmissionPlugin = ({ context }) => {
8191
8348
  if (config.enabled) {
8192
8349
  try {
8193
8350
  const token = await resolveAuthToken({
8194
- ...context.options
8351
+ ...options
8195
8352
  });
8196
8353
  if (token) {
8197
8354
  return extractUserIdsFromJwt(token);
@@ -8441,55 +8598,54 @@ var eventEmissionPlugin = ({ context }) => {
8441
8598
  };
8442
8599
 
8443
8600
  // src/sdk.ts
8444
- function createSdk(options = {}, initialSdk = {}, initialContext = { meta: {} }) {
8601
+ function createOptionsPlugin(options) {
8602
+ return () => ({ context: { options } });
8603
+ }
8604
+ function createSdk() {
8605
+ return buildSdk({}, { meta: {} });
8606
+ }
8607
+ function buildSdk(properties, context) {
8608
+ const frozenContext = Object.freeze(context);
8445
8609
  return {
8446
- ...initialSdk,
8447
- getContext: () => initialContext,
8448
- addPlugin(plugin, addPluginOptions = {}) {
8449
- const currentSdkWithContext = {
8450
- ...initialSdk,
8451
- getContext: () => initialContext
8452
- };
8610
+ ...properties,
8611
+ get context() {
8612
+ return frozenContext;
8613
+ },
8614
+ getContext: () => frozenContext,
8615
+ // runtime compat shim, not in types
8616
+ addPlugin(plugin) {
8453
8617
  const pluginResult = plugin({
8454
- sdk: currentSdkWithContext,
8455
- context: {
8456
- ...initialContext,
8457
- // Add the options that createSdk was called with to context
8458
- options
8459
- },
8460
- ...addPluginOptions
8618
+ ...properties,
8619
+ context: frozenContext
8461
8620
  });
8462
- const { context: pluginContext, ...sdkProperties } = pluginResult;
8463
- const newSdk = { ...initialSdk, ...sdkProperties };
8464
- let newContext = {
8465
- ...initialContext,
8466
- ...addPluginOptions,
8467
- meta: initialContext.meta || {}
8621
+ const { context: pluginContext, ...pluginProperties } = pluginResult;
8622
+ const mergedProperties = { ...properties, ...pluginProperties };
8623
+ let mergedContext = {
8624
+ ...context,
8625
+ meta: context.meta || {}
8468
8626
  };
8469
8627
  if (pluginContext) {
8470
- const { meta: pluginMeta, ...otherPluginContext } = pluginContext;
8471
- newContext = {
8472
- ...newContext,
8473
- ...otherPluginContext
8628
+ const { meta: pluginMeta, ...pluginContextRest } = pluginContext;
8629
+ mergedContext = {
8630
+ ...mergedContext,
8631
+ ...pluginContextRest
8474
8632
  };
8475
8633
  if (pluginMeta) {
8476
- newContext = {
8477
- ...newContext,
8478
- meta: {
8479
- ...newContext.meta,
8480
- // Existing meta (now guaranteed to exist)
8481
- ...pluginMeta
8482
- // New meta from plugin
8483
- }
8634
+ mergedContext = {
8635
+ ...mergedContext,
8636
+ meta: { ...mergedContext.meta, ...pluginMeta }
8484
8637
  };
8485
8638
  }
8486
8639
  }
8487
- return createSdk(options, newSdk, newContext);
8640
+ return buildSdk(
8641
+ mergedProperties,
8642
+ mergedContext
8643
+ );
8488
8644
  }
8489
8645
  };
8490
8646
  }
8491
8647
  function createZapierSdkWithoutRegistry(options = {}) {
8492
- return createSdk(options).addPlugin(eventEmissionPlugin).addPlugin(apiPlugin).addPlugin(manifestPlugin).addPlugin(capabilitiesPlugin).addPlugin(connectionsPlugin).addPlugin(listAppsPlugin).addPlugin(getAppPlugin).addPlugin(listActionsPlugin).addPlugin(getActionPlugin).addPlugin(listInputFieldsPlugin).addPlugin(getInputFieldsSchemaPlugin).addPlugin(listInputFieldChoicesPlugin).addPlugin(runActionPlugin).addPlugin(listConnectionsPlugin).addPlugin(getConnectionPlugin).addPlugin(findFirstConnectionPlugin).addPlugin(findUniqueConnectionPlugin).addPlugin(listAuthenticationsPlugin).addPlugin(getAuthenticationPlugin).addPlugin(findFirstAuthenticationPlugin).addPlugin(findUniqueAuthenticationPlugin).addPlugin(listClientCredentialsPlugin).addPlugin(createClientCredentialsPlugin).addPlugin(deleteClientCredentialsPlugin).addPlugin(fetchPlugin).addPlugin(requestPlugin).addPlugin(listTablesPlugin).addPlugin(getTablePlugin).addPlugin(deleteTablePlugin).addPlugin(createTablePlugin).addPlugin(listTableFieldsPlugin).addPlugin(createTableFieldsPlugin).addPlugin(deleteTableFieldsPlugin).addPlugin(getTableRecordPlugin).addPlugin(listTableRecordsPlugin).addPlugin(createTableRecordsPlugin).addPlugin(deleteTableRecordsPlugin).addPlugin(updateTableRecordsPlugin).addPlugin(appsPlugin).addPlugin(getProfilePlugin);
8648
+ return createSdk().addPlugin(createOptionsPlugin(options)).addPlugin(eventEmissionPlugin).addPlugin(apiPlugin).addPlugin(manifestPlugin).addPlugin(capabilitiesPlugin).addPlugin(connectionsPlugin).addPlugin(listAppsPlugin).addPlugin(getAppPlugin).addPlugin(listActionsPlugin).addPlugin(getActionPlugin).addPlugin(listInputFieldsPlugin).addPlugin(getInputFieldsSchemaPlugin).addPlugin(listInputFieldChoicesPlugin).addPlugin(runActionPlugin).addPlugin(listConnectionsPlugin).addPlugin(getConnectionPlugin).addPlugin(findFirstConnectionPlugin).addPlugin(findUniqueConnectionPlugin).addPlugin(listAuthenticationsPlugin).addPlugin(getAuthenticationPlugin).addPlugin(findFirstAuthenticationPlugin).addPlugin(findUniqueAuthenticationPlugin).addPlugin(listClientCredentialsPlugin).addPlugin(createClientCredentialsPlugin).addPlugin(deleteClientCredentialsPlugin).addPlugin(fetchPlugin).addPlugin(requestPlugin).addPlugin(listTablesPlugin).addPlugin(getTablePlugin).addPlugin(deleteTablePlugin).addPlugin(createTablePlugin).addPlugin(listTableFieldsPlugin).addPlugin(createTableFieldsPlugin).addPlugin(deleteTableFieldsPlugin).addPlugin(getTableRecordPlugin).addPlugin(listTableRecordsPlugin).addPlugin(createTableRecordsPlugin).addPlugin(deleteTableRecordsPlugin).addPlugin(updateTableRecordsPlugin).addPlugin(appsPlugin).addPlugin(getProfilePlugin);
8493
8649
  }
8494
8650
  function createZapierSdk(options = {}) {
8495
8651
  return createZapierSdkWithoutRegistry(options).addPlugin(registryPlugin);
@@ -8526,4 +8682,4 @@ var BaseSdkOptionsSchema = z.object({
8526
8682
  // Use credentials instead
8527
8683
  });
8528
8684
 
8529
- export { ActionKeyPropertySchema, ActionPropertySchema, ActionTimeoutMsPropertySchema, ActionTypePropertySchema, AppKeyPropertySchema, AppPropertySchema, AppsPropertySchema, AuthenticationIdPropertySchema, BaseSdkOptionsSchema, CONTEXT_CACHE_MAX_SIZE, CONTEXT_CACHE_TTL_MS, ClientCredentialsObjectSchema, ConnectionEntrySchema, ConnectionIdPropertySchema, ConnectionPropertySchema, ConnectionsMapSchema, ConnectionsPropertySchema, CredentialsFunctionSchema, CredentialsObjectSchema, CredentialsSchema, DEFAULT_ACTION_TIMEOUT_MS, DEFAULT_CONFIG_PATH, DEFAULT_PAGE_SIZE, DebugPropertySchema, FieldsPropertySchema, InputFieldPropertySchema, InputsPropertySchema, LimitPropertySchema, MAX_PAGE_LIMIT, OffsetPropertySchema, OutputPropertySchema, ParamsPropertySchema, PkceCredentialsObjectSchema, RecordPropertySchema, RecordsPropertySchema, RelayFetchSchema, RelayRequestSchema, ResolvedCredentialsSchema, TablePropertySchema, TablesPropertySchema, ZAPIER_BASE_URL, ZAPIER_MAX_NETWORK_RETRIES, ZAPIER_MAX_NETWORK_RETRY_DELAY_MS, ZapierActionError, ZapierApiError, ZapierAppNotFoundError, ZapierAuthenticationError, ZapierBundleError, ZapierConfigurationError, ZapierError, ZapierNotFoundError, ZapierRateLimitError, ZapierRelayError, ZapierResourceNotFoundError, ZapierTimeoutError, ZapierUnknownError, ZapierValidationError, actionKeyResolver, actionTypeResolver, apiPlugin, appKeyResolver, appsPlugin, connectionIdGenericResolver as authenticationIdGenericResolver, connectionIdResolver as authenticationIdResolver, batch, buildApplicationLifecycleEvent, buildCapabilityMessage, buildErrorEvent, buildErrorEventWithContext, buildMethodCalledEvent, clearTokenCache, clientCredentialsNameResolver, clientIdResolver, connectionIdGenericResolver, connectionIdResolver, connectionsPlugin, createBaseEvent, createClientCredentialsPlugin, createFunction, createSdk, createTableFieldsPlugin, createTablePlugin, createTableRecordsPlugin, createZapierSdk, createZapierSdkWithoutRegistry, deleteClientCredentialsPlugin, deleteTableFieldsPlugin, deleteTablePlugin, deleteTableRecordsPlugin, fetchPlugin, findFirstConnectionPlugin, findManifestEntry, findUniqueConnectionPlugin, formatErrorMessage, generateEventId, getActionPlugin, getAppPlugin, getBaseUrlFromCredentials, getCiPlatform, getClientIdFromCredentials, getConnectionPlugin, getCpuTime, getCurrentTimestamp, getMemoryUsage, getOsInfo, getPlatformVersions, getPreferredManifestEntryKey, getProfilePlugin, getReleaseId, getTablePlugin, getTableRecordPlugin, getTokenFromCliLogin, injectCliLogin, inputFieldKeyResolver, inputsAllOptionalResolver, inputsResolver, invalidateCachedToken, invalidateCredentialsToken, isCi, isCliLoginAvailable, isClientCredentials, isCredentialsFunction, isCredentialsObject, isPkceCredentials, isPositional, listActionsPlugin, listAppsPlugin, listClientCredentialsPlugin, listConnectionsPlugin, listInputFieldsPlugin, listTableFieldsPlugin, listTableRecordsPlugin, listTablesPlugin, logDeprecation, manifestPlugin, readManifestFromFile, registryPlugin, requestPlugin, resetDeprecationWarnings, resolveAuthToken, resolveCredentials, resolveCredentialsFromEnv, runActionPlugin, runWithTelemetryContext, tableFieldIdsResolver, tableFieldsResolver, tableFiltersResolver, tableIdResolver, tableNameResolver, tableRecordIdResolver, tableRecordIdsResolver, tableRecordsResolver, tableSortResolver, tableUpdateRecordsResolver, toSnakeCase, toTitleCase, updateTableRecordsPlugin };
8685
+ export { ActionKeyPropertySchema, ActionPropertySchema, ActionTimeoutMsPropertySchema, ActionTypePropertySchema, AppKeyPropertySchema, AppPropertySchema, AppsPropertySchema, AuthenticationIdPropertySchema, BaseSdkOptionsSchema, CONTEXT_CACHE_MAX_SIZE, CONTEXT_CACHE_TTL_MS, ClientCredentialsObjectSchema, ConnectionEntrySchema, ConnectionIdPropertySchema, ConnectionPropertySchema, ConnectionsMapSchema, ConnectionsPropertySchema, CredentialsFunctionSchema, CredentialsObjectSchema, CredentialsSchema, DEFAULT_ACTION_TIMEOUT_MS, DEFAULT_CONFIG_PATH, DEFAULT_PAGE_SIZE, DebugPropertySchema, FieldsPropertySchema, InputFieldPropertySchema, InputsPropertySchema, LimitPropertySchema, MAX_PAGE_LIMIT, OffsetPropertySchema, OutputPropertySchema, ParamsPropertySchema, PkceCredentialsObjectSchema, RecordPropertySchema, RecordsPropertySchema, RelayFetchSchema, RelayRequestSchema, ResolvedCredentialsSchema, TablePropertySchema, TablesPropertySchema, ZAPIER_BASE_URL, ZAPIER_MAX_NETWORK_RETRIES, ZAPIER_MAX_NETWORK_RETRY_DELAY_MS, ZapierActionError, ZapierApiError, ZapierAppNotFoundError, ZapierAuthenticationError, ZapierBundleError, ZapierConfigurationError, ZapierError, ZapierNotFoundError, ZapierRateLimitError, ZapierRelayError, ZapierResourceNotFoundError, ZapierTimeoutError, ZapierUnknownError, ZapierValidationError, actionKeyResolver, actionTypeResolver, apiPlugin, appKeyResolver, appsPlugin, connectionIdGenericResolver as authenticationIdGenericResolver, connectionIdResolver as authenticationIdResolver, batch, buildApplicationLifecycleEvent, buildCapabilityMessage, buildErrorEvent, buildErrorEventWithContext, buildMethodCalledEvent, clearTokenCache, clientCredentialsNameResolver, clientIdResolver, connectionIdGenericResolver, connectionIdResolver, connectionsPlugin, createBaseEvent, createClientCredentialsPlugin, createFunction, createOptionsPlugin, createSdk, createTableFieldsPlugin, createTablePlugin, createTableRecordsPlugin, createZapierSdk, createZapierSdkWithoutRegistry, deleteClientCredentialsPlugin, deleteTableFieldsPlugin, deleteTablePlugin, deleteTableRecordsPlugin, fetchPlugin, findFirstConnectionPlugin, findManifestEntry, findUniqueConnectionPlugin, formatErrorMessage, generateEventId, getActionPlugin, getAppPlugin, getBaseUrlFromCredentials, getCiPlatform, getClientIdFromCredentials, getConnectionPlugin, getCpuTime, getCurrentTimestamp, getMemoryUsage, getOsInfo, getPlatformVersions, getPreferredManifestEntryKey, getProfilePlugin, getReleaseId, getTablePlugin, getTableRecordPlugin, getTokenFromCliLogin, injectCliLogin, inputFieldKeyResolver, inputsAllOptionalResolver, inputsResolver, invalidateCachedToken, invalidateCredentialsToken, isCi, isCliLoginAvailable, isClientCredentials, isCredentialsFunction, isCredentialsObject, isPkceCredentials, isPositional, listActionsPlugin, listAppsPlugin, listClientCredentialsPlugin, listConnectionsPlugin, listInputFieldsPlugin, listTableFieldsPlugin, listTableRecordsPlugin, listTablesPlugin, logDeprecation, manifestPlugin, readManifestFromFile, registryPlugin, requestPlugin, resetDeprecationWarnings, resolveAuthToken, resolveCredentials, resolveCredentialsFromEnv, runActionPlugin, runWithTelemetryContext, tableFieldIdsResolver, tableFieldsResolver, tableFiltersResolver, tableIdResolver, tableNameResolver, tableRecordIdResolver, tableRecordIdsResolver, tableRecordsResolver, tableSortResolver, tableUpdateRecordsResolver, toSnakeCase, toTitleCase, updateTableRecordsPlugin };