@zapier/zapier-sdk 0.33.4 → 0.34.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -100,12 +100,14 @@ var ZapierApiError = class extends ZapierError {
100
100
  constructor(message, options = {}) {
101
101
  super(message, options);
102
102
  this.name = "ZapierApiError";
103
+ this.code = "ZAPIER_API_ERROR";
103
104
  }
104
105
  };
105
106
  var ZapierAppNotFoundError = class extends ZapierError {
106
107
  constructor(message, options = {}) {
107
108
  super(message, options);
108
109
  this.name = "ZapierAppNotFoundError";
110
+ this.code = "ZAPIER_APP_NOT_FOUND_ERROR";
109
111
  this.appKey = options.appKey;
110
112
  }
111
113
  };
@@ -113,6 +115,7 @@ var ZapierValidationError = class extends ZapierError {
113
115
  constructor(message, options = {}) {
114
116
  super(message, options);
115
117
  this.name = "ZapierValidationError";
118
+ this.code = "ZAPIER_VALIDATION_ERROR";
116
119
  this.details = options.details;
117
120
  }
118
121
  };
@@ -120,18 +123,21 @@ var ZapierUnknownError = class extends ZapierError {
120
123
  constructor(message, options = {}) {
121
124
  super(message, options);
122
125
  this.name = "ZapierUnknownError";
126
+ this.code = "ZAPIER_UNKNOWN_ERROR";
123
127
  }
124
128
  };
125
129
  var ZapierAuthenticationError = class extends ZapierError {
126
130
  constructor(message, options = {}) {
127
131
  super(message, options);
128
132
  this.name = "ZapierAuthenticationError";
133
+ this.code = "ZAPIER_AUTHENTICATION_ERROR";
129
134
  }
130
135
  };
131
136
  var ZapierResourceNotFoundError = class extends ZapierError {
132
137
  constructor(message, options = {}) {
133
138
  super(message, options);
134
139
  this.name = "ZapierResourceNotFoundError";
140
+ this.code = "ZAPIER_RESOURCE_NOT_FOUND_ERROR";
135
141
  this.resourceType = options.resourceType;
136
142
  this.resourceId = options.resourceId;
137
143
  }
@@ -140,6 +146,7 @@ var ZapierConfigurationError = class extends ZapierError {
140
146
  constructor(message, options = {}) {
141
147
  super(message, options);
142
148
  this.name = "ZapierConfigurationError";
149
+ this.code = "ZAPIER_CONFIGURATION_ERROR";
143
150
  this.configType = options.configType;
144
151
  }
145
152
  };
@@ -147,6 +154,7 @@ var ZapierBundleError = class extends ZapierError {
147
154
  constructor(message, options = {}) {
148
155
  super(message, options);
149
156
  this.name = "ZapierBundleError";
157
+ this.code = "ZAPIER_BUNDLE_ERROR";
150
158
  this.buildErrors = options.buildErrors;
151
159
  }
152
160
  };
@@ -154,6 +162,7 @@ var ZapierTimeoutError = class extends ZapierError {
154
162
  constructor(message, options = {}) {
155
163
  super(message, options);
156
164
  this.name = "ZapierTimeoutError";
165
+ this.code = "ZAPIER_TIMEOUT_ERROR";
157
166
  this.attempts = options.attempts;
158
167
  this.maxAttempts = options.maxAttempts;
159
168
  }
@@ -162,6 +171,7 @@ var ZapierActionError = class extends ZapierError {
162
171
  constructor(message, options = {}) {
163
172
  super(message, options);
164
173
  this.name = "ZapierActionError";
174
+ this.code = "ZAPIER_ACTION_ERROR";
165
175
  this.appKey = options.appKey;
166
176
  this.actionKey = options.actionKey;
167
177
  }
@@ -174,12 +184,14 @@ var ZapierNotFoundError = class extends ZapierError {
174
184
  constructor(message, options = {}) {
175
185
  super(message, options);
176
186
  this.name = "ZapierNotFoundError";
187
+ this.code = "ZAPIER_NOT_FOUND_ERROR";
177
188
  }
178
189
  };
179
190
  var ZapierRateLimitError = class extends ZapierError {
180
191
  constructor(message, options = {}) {
181
192
  super(message, options);
182
193
  this.name = "ZapierRateLimitError";
194
+ this.code = "ZAPIER_RATE_LIMIT_ERROR";
183
195
  this.rateLimit = options.rateLimit ?? {};
184
196
  this.retries = options.retries ?? 0;
185
197
  }
@@ -188,6 +200,7 @@ var ZapierRelayError = class extends ZapierError {
188
200
  constructor(message, options = {}) {
189
201
  super(message, options);
190
202
  this.name = "ZapierRelayError";
203
+ this.code = "ZAPIER_RELAY_ERROR";
191
204
  }
192
205
  };
193
206
  function formatErrorMessage(error) {
@@ -610,32 +623,63 @@ var fetchPlugin = ({ context }) => {
610
623
  };
611
624
 
612
625
  // src/utils/pagination-utils.ts
613
- var offsetCursorMarker = "$$offset$$";
614
- function splitOffsetCursor(cursor) {
615
- if (!cursor) {
616
- return [0, cursor];
626
+ var CURSOR_VERSION = 1;
627
+ var CURSOR_SOURCE = {
628
+ API: "api",
629
+ SDK: "sdk"
630
+ };
631
+ function encodeBase64(str) {
632
+ return btoa(
633
+ Array.from(
634
+ new TextEncoder().encode(str),
635
+ (b) => String.fromCharCode(b)
636
+ ).join("")
637
+ );
638
+ }
639
+ function decodeBase64(str) {
640
+ return new TextDecoder().decode(
641
+ Uint8Array.from(atob(str), (c) => c.charCodeAt(0))
642
+ );
643
+ }
644
+ function encodeApiCursor(cursor) {
645
+ const envelope = {
646
+ v: CURSOR_VERSION,
647
+ source: CURSOR_SOURCE.API,
648
+ cursor
649
+ };
650
+ return encodeBase64(JSON.stringify(envelope));
651
+ }
652
+ function encodeSdkCursor(offset, cursor) {
653
+ const envelope = {
654
+ v: CURSOR_VERSION,
655
+ source: CURSOR_SOURCE.SDK,
656
+ cursor,
657
+ offset
658
+ };
659
+ return encodeBase64(JSON.stringify(envelope));
660
+ }
661
+ function decodeIncomingCursor(incoming) {
662
+ if (!incoming) {
663
+ return { offset: 0, cursor: void 0 };
617
664
  }
618
665
  try {
619
- const parsedCursor = JSON.parse(cursor);
620
- if (!Array.isArray(parsedCursor)) {
621
- return [0, cursor];
666
+ const decoded = decodeBase64(incoming);
667
+ const envelope = JSON.parse(decoded);
668
+ if (envelope.v !== CURSOR_VERSION) {
669
+ return { offset: 0, cursor: incoming };
622
670
  }
623
- const [marker, offset, currentCursor] = parsedCursor;
624
- if (marker !== offsetCursorMarker) {
625
- return [0, cursor];
671
+ if (envelope.source === CURSOR_SOURCE.SDK) {
672
+ return { offset: envelope.offset ?? 0, cursor: envelope.cursor };
626
673
  }
627
- if (typeof offset !== "number") {
628
- return [0, cursor];
674
+ if (envelope.source === CURSOR_SOURCE.API) {
675
+ return { offset: 0, cursor: envelope.cursor };
629
676
  }
630
- return [offset, currentCursor];
677
+ return { offset: 0, cursor: incoming };
631
678
  } catch {
632
- return [0, cursor];
679
+ return { offset: 0, cursor: incoming };
633
680
  }
634
681
  }
635
- function createOffsetCursor(offset, currentCursor) {
636
- return JSON.stringify([offsetCursorMarker, offset, currentCursor]);
637
- }
638
- async function* paginateMaxItems(pageFunction, pageOptions) {
682
+ async function* paginateMaxItemsWithUnencodedCursor(pageFunction, pageOptions) {
639
683
  let cursor = pageOptions?.cursor;
640
684
  let totalItemsYielded = 0;
641
685
  const maxItems = pageOptions?.maxItems;
@@ -650,12 +694,11 @@ async function* paginateMaxItems(pageFunction, pageOptions) {
650
694
  if (maxItems !== void 0) {
651
695
  const remainingItems = maxItems - totalItemsYielded;
652
696
  if (page.data.length >= remainingItems) {
653
- const yieldedPage = {
697
+ yield {
654
698
  ...page,
655
699
  data: page.data.slice(0, remainingItems),
656
700
  nextCursor: void 0
657
701
  };
658
- yield yieldedPage;
659
702
  break;
660
703
  }
661
704
  }
@@ -666,16 +709,38 @@ async function* paginateMaxItems(pageFunction, pageOptions) {
666
709
  }
667
710
  async function* paginateBuffered(pageFunction, pageOptions) {
668
711
  const pageSize = pageOptions?.pageSize;
669
- const [cursorOffset, currentCursor] = splitOffsetCursor(pageOptions?.cursor);
712
+ const { offset: cursorOffset, cursor: initialCursor } = decodeIncomingCursor(
713
+ pageOptions?.cursor
714
+ );
715
+ const requestedMaxItems = pageOptions?.maxItems;
670
716
  const options = {
671
717
  ...pageOptions || {},
672
- cursor: currentCursor
718
+ cursor: initialCursor,
719
+ // SDK cursors can carry an offset into a raw backend page. Since maxItems
720
+ // is expected to be relative to the resumed position, we add that offset
721
+ // so raw pagination still yields enough items after offset slicing.
722
+ maxItems: requestedMaxItems !== void 0 && cursorOffset > 0 ? requestedMaxItems + cursorOffset : requestedMaxItems
673
723
  };
674
- const iterator = paginateMaxItems(pageFunction, options);
724
+ if (!pageSize) {
725
+ for await (const page of paginateMaxItemsWithUnencodedCursor(
726
+ pageFunction,
727
+ options
728
+ )) {
729
+ yield {
730
+ ...page,
731
+ nextCursor: page.nextCursor ? encodeApiCursor(page.nextCursor) : void 0
732
+ };
733
+ }
734
+ return;
735
+ }
675
736
  let bufferedPages = [];
676
737
  let isFirstPage = true;
677
- let cursor;
678
- for await (let page of iterator) {
738
+ let rawCursor;
739
+ for await (let page of paginateMaxItemsWithUnencodedCursor(
740
+ pageFunction,
741
+ options
742
+ )) {
743
+ const nextRawCursor = page.nextCursor;
679
744
  if (isFirstPage) {
680
745
  isFirstPage = false;
681
746
  if (cursorOffset) {
@@ -685,18 +750,13 @@ async function* paginateBuffered(pageFunction, pageOptions) {
685
750
  };
686
751
  }
687
752
  }
688
- if (!pageSize) {
689
- yield page;
690
- cursor = page.nextCursor;
691
- continue;
692
- }
693
753
  const bufferedLength = bufferedPages.reduce(
694
- (acc, page2) => acc + page2.data.length,
754
+ (acc, p) => acc + p.data.length,
695
755
  0
696
756
  );
697
757
  if (bufferedLength + page.data.length < pageSize) {
698
758
  bufferedPages.push(page);
699
- cursor = page.nextCursor;
759
+ rawCursor = nextRawCursor;
700
760
  continue;
701
761
  }
702
762
  const bufferedItems = bufferedPages.map((p) => p.data).flat();
@@ -707,28 +767,28 @@ async function* paginateBuffered(pageFunction, pageOptions) {
707
767
  yield {
708
768
  ...page,
709
769
  data: pageItems,
710
- nextCursor: page.nextCursor
770
+ nextCursor: nextRawCursor ? encodeApiCursor(nextRawCursor) : void 0
711
771
  };
712
772
  bufferedPages = [];
713
- cursor = page.nextCursor;
773
+ rawCursor = nextRawCursor;
714
774
  continue;
715
775
  }
716
776
  yield {
717
777
  ...page,
718
778
  data: pageItems,
719
- nextCursor: createOffsetCursor(
779
+ nextCursor: encodeSdkCursor(
720
780
  page.data.length - remainingItems.length,
721
- cursor
781
+ rawCursor
722
782
  )
723
783
  };
724
784
  while (remainingItems.length > pageSize) {
725
- const pageItems2 = remainingItems.splice(0, pageSize);
785
+ const chunkItems = remainingItems.splice(0, pageSize);
726
786
  yield {
727
787
  ...page,
728
- data: pageItems2,
729
- nextCursor: createOffsetCursor(
788
+ data: chunkItems,
789
+ nextCursor: encodeSdkCursor(
730
790
  page.data.length - remainingItems.length,
731
- cursor
791
+ rawCursor
732
792
  )
733
793
  };
734
794
  }
@@ -738,7 +798,7 @@ async function* paginateBuffered(pageFunction, pageOptions) {
738
798
  data: remainingItems
739
799
  }
740
800
  ];
741
- cursor = page.nextCursor;
801
+ rawCursor = nextRawCursor;
742
802
  }
743
803
  if (bufferedPages.length > 0) {
744
804
  const lastBufferedPage = bufferedPages.slice(-1)[0];
@@ -1875,7 +1935,9 @@ var ListInputFieldsSchema = z.object({
1875
1935
  appKey: AppKeyPropertySchema,
1876
1936
  actionType: ActionTypePropertySchema,
1877
1937
  actionKey: ActionKeyPropertySchema,
1878
- connectionId: ConnectionIdPropertySchema.nullable().optional(),
1938
+ connectionId: ConnectionIdPropertySchema.nullable().optional().describe(
1939
+ "Connection ID to use when listing input fields. Required if the action needs a connection to determine available fields."
1940
+ ),
1879
1941
  /** @deprecated Use connectionId instead */
1880
1942
  authenticationId: AuthenticationIdPropertySchema.nullable().optional(),
1881
1943
  inputs: InputsPropertySchema.optional().describe(
@@ -2873,7 +2935,9 @@ var RunActionSchema = z.object({
2873
2935
  appKey: AppKeyPropertySchema,
2874
2936
  actionType: ActionTypePropertySchema,
2875
2937
  actionKey: ActionKeyPropertySchema,
2876
- connectionId: ConnectionIdPropertySchema.nullable().optional(),
2938
+ connectionId: ConnectionIdPropertySchema.nullable().optional().describe(
2939
+ "Connection ID to use when running the action. Required if the action needs a connection to authenticate and interact with the service."
2940
+ ),
2877
2941
  /** @deprecated Use connectionId instead */
2878
2942
  authenticationId: ConnectionIdPropertySchema.nullable().optional(),
2879
2943
  inputs: InputsPropertySchema.optional().describe(
@@ -4958,7 +5022,8 @@ var registryPlugin = ({ sdk, context }) => {
4958
5022
  confirm: meta.confirm ?? (meta.type === "delete" ? "delete" : void 0),
4959
5023
  deprecation: meta.deprecation,
4960
5024
  deprecatedParameters: meta.deprecatedParameters,
4961
- aliases: meta.aliases
5025
+ aliases: meta.aliases,
5026
+ supportsJsonOutput: meta.supportsJsonOutput ?? true
4962
5027
  };
4963
5028
  }).sort((a, b) => a.name.localeCompare(b.name));
4964
5029
  const knownCategories = Object.keys(categoryDefinitions);
@@ -5192,7 +5257,9 @@ var ListInputFieldChoicesSchema = z.object({
5192
5257
  // Input field specification
5193
5258
  inputFieldKey: z.string().min(1).describe("Input field key to get choices for."),
5194
5259
  // Common parameters
5195
- connectionId: ConnectionIdPropertySchema.nullable().optional(),
5260
+ connectionId: ConnectionIdPropertySchema.nullable().optional().describe(
5261
+ "Connection ID to use when listing available field choices. Required if the action needs a connection to populate dynamic dropdown options."
5262
+ ),
5196
5263
  /** @deprecated Use connectionId instead */
5197
5264
  authenticationId: AuthenticationIdPropertySchema.nullable().optional(),
5198
5265
  inputs: InputsPropertySchema.optional().describe(
@@ -5491,7 +5558,7 @@ function getCpuTime() {
5491
5558
  }
5492
5559
 
5493
5560
  // src/plugins/eventEmission/builders.ts
5494
- var SDK_VERSION = "0.33.4";
5561
+ var SDK_VERSION = "0.34.0";
5495
5562
  function createBaseEvent(context = {}) {
5496
5563
  return {
5497
5564
  event_id: generateEventId(),
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/listInputFieldChoices/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAWxB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,KAAK,EACV,wBAAwB,EACxB,cAAc,EACd,yBAAyB,EACzB,sBAAsB,EACtB,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAM5B,eAAO,MAAM,0BAA0B;;;;;iBA0BrC,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,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,GACrB,kBAAkB,CAAC;AAGvB,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,oBAAoB,EAAE,CAAC;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAGD,MAAM,WAAW,gCAAgC;IAC/C,qBAAqB,EAAE,oBAAoB,CACzC,4BAA4B,EAC5B,oBAAoB,CACrB,CAAC;CACH"}
@@ -41,7 +41,9 @@ export const ListInputFieldChoicesSchema = z
41
41
  .min(1)
42
42
  .describe("Input field key to get choices for."),
43
43
  // Common parameters
44
- connectionId: ConnectionIdPropertySchema.nullable().optional(),
44
+ connectionId: ConnectionIdPropertySchema.nullable()
45
+ .optional()
46
+ .describe("Connection ID to use when listing available field choices. Required if the action needs a connection to populate dynamic dropdown options."),
45
47
  /** @deprecated Use connectionId instead */
46
48
  authenticationId: AuthenticationIdPropertySchema.nullable().optional(),
47
49
  inputs: InputsPropertySchema.optional().describe("Current input values that may affect available choices"),
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/listInputFields/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,KAAK,EACV,wBAAwB,EACxB,cAAc,EACd,yBAAyB,EACzB,sBAAsB,EACtB,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAG5B,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;iBAuBgC,CAAC;AAGnE,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAG3E,MAAM,MAAM,oBAAoB,GAC5B,wBAAwB,GACxB,cAAc,GACd,yBAAyB,GACzB,sBAAsB,GACtB,qBAAqB,GACrB,kBAAkB,CAAC;AAGvB,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,aAAa,EAAE,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAGD,MAAM,WAAW,0BAA0B;IACzC,eAAe,EAAE,oBAAoB,CACnC,sBAAsB,EACtB,aAAa,EAAE,CAChB,CAAC;CACH"}
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/listInputFields/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,KAAK,EACV,wBAAwB,EACxB,cAAc,EACd,yBAAyB,EACzB,sBAAsB,EACtB,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAG5B,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;iBA2BgC,CAAC;AAGnE,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAG3E,MAAM,MAAM,oBAAoB,GAC5B,wBAAwB,GACxB,cAAc,GACd,yBAAyB,GACzB,sBAAsB,GACtB,qBAAqB,GACrB,kBAAkB,CAAC;AAGvB,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,aAAa,EAAE,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAGD,MAAM,WAAW,0BAA0B;IACzC,eAAe,EAAE,oBAAoB,CACnC,sBAAsB,EACtB,aAAa,EAAE,CAChB,CAAC;CACH"}
@@ -6,7 +6,9 @@ export const ListInputFieldsSchema = z
6
6
  appKey: AppKeyPropertySchema,
7
7
  actionType: ActionTypePropertySchema,
8
8
  actionKey: ActionKeyPropertySchema,
9
- connectionId: ConnectionIdPropertySchema.nullable().optional(),
9
+ connectionId: ConnectionIdPropertySchema.nullable()
10
+ .optional()
11
+ .describe("Connection ID to use when listing input fields. Required if the action needs a connection to determine available fields."),
10
12
  /** @deprecated Use connectionId instead */
11
13
  authenticationId: AuthenticationIdPropertySchema.nullable().optional(),
12
14
  inputs: InputsPropertySchema.optional().describe("Current input values that may affect available fields"),
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/registry/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAE7D,MAAM,WAAW,6BAA6B;CAAG;AAEjD,MAAM,WAAW,sBAAsB;IACrC,WAAW,EAAE,CAAC,OAAO,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK;QAC/C,SAAS,EAAE,qBAAqB,EAAE,CAAC;QACnC,UAAU,EAAE;YACV,GAAG,EAAE,MAAM,CAAC;YACZ,KAAK,EAAE,MAAM,CAAC;YACd,WAAW,EAAE,MAAM,CAAC;YACpB,SAAS,EAAE,MAAM,EAAE,CAAC;SACrB,EAAE,CAAC;KACL,CAAC;CACH;AAGD,eAAO,MAAM,cAAc,EAAE,MAAM,CACjC,EAAE,EAAE,wBAAwB;AAC5B,EAAE,EAAE,sBAAsB;AAC1B,sBAAsB,CAqJvB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/registry/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAE7D,MAAM,WAAW,6BAA6B;CAAG;AAEjD,MAAM,WAAW,sBAAsB;IACrC,WAAW,EAAE,CAAC,OAAO,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK;QAC/C,SAAS,EAAE,qBAAqB,EAAE,CAAC;QACnC,UAAU,EAAE;YACV,GAAG,EAAE,MAAM,CAAC;YACZ,KAAK,EAAE,MAAM,CAAC;YACd,WAAW,EAAE,MAAM,CAAC;YACpB,SAAS,EAAE,MAAM,EAAE,CAAC;SACrB,EAAE,CAAC;KACL,CAAC;CACH;AAGD,eAAO,MAAM,cAAc,EAAE,MAAM,CACjC,EAAE,EAAE,wBAAwB;AAC5B,EAAE,EAAE,sBAAsB;AAC1B,sBAAsB,CAsJvB,CAAC"}
@@ -62,6 +62,7 @@ export const registryPlugin = ({ sdk, context }) => {
62
62
  deprecation: meta.deprecation,
63
63
  deprecatedParameters: meta.deprecatedParameters,
64
64
  aliases: meta.aliases,
65
+ supportsJsonOutput: meta.supportsJsonOutput ?? true,
65
66
  };
66
67
  })
67
68
  .sort((a, b) => a.name.localeCompare(b.name));
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/runAction/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,KAAK,EACV,iBAAiB,EACjB,qBAAqB,EACrB,wBAAwB,EACxB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAG5B,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;iBAwB0B,CAAC;AAGvD,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAG/D,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,OAAO,EAAE,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAGD,MAAM,MAAM,cAAc,GACtB,iBAAiB,GACjB,qBAAqB,GACrB,wBAAwB,GACxB,kBAAkB,CAAC;AAGvB,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,oBAAoB,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;CAC5D"}
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/runAction/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,KAAK,EACV,iBAAiB,EACjB,qBAAqB,EACrB,wBAAwB,EACxB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAG5B,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;iBA4B0B,CAAC;AAGvD,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAG/D,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,OAAO,EAAE,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAGD,MAAM,MAAM,cAAc,GACtB,iBAAiB,GACjB,qBAAqB,GACrB,wBAAwB,GACxB,kBAAkB,CAAC;AAGvB,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,oBAAoB,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;CAC5D"}
@@ -6,7 +6,9 @@ export const RunActionSchema = z
6
6
  appKey: AppKeyPropertySchema,
7
7
  actionType: ActionTypePropertySchema,
8
8
  actionKey: ActionKeyPropertySchema,
9
- connectionId: ConnectionIdPropertySchema.nullable().optional(),
9
+ connectionId: ConnectionIdPropertySchema.nullable()
10
+ .optional()
11
+ .describe("Connection ID to use when running the action. Required if the action needs a connection to authenticate and interact with the service."),
10
12
  /** @deprecated Use connectionId instead */
11
13
  authenticationId: ConnectionIdPropertySchema.nullable().optional(),
12
14
  inputs: InputsPropertySchema.optional().describe("Input parameters for the action"),
@@ -24,6 +24,7 @@ export interface ErrorOptions {
24
24
  */
25
25
  export declare abstract class ZapierError extends Error {
26
26
  abstract readonly name: string;
27
+ abstract readonly code: string;
27
28
  statusCode?: number;
28
29
  errors?: ApiError[];
29
30
  cause?: unknown;
@@ -35,6 +36,7 @@ export declare abstract class ZapierError extends Error {
35
36
  */
36
37
  export declare class ZapierApiError extends ZapierError {
37
38
  readonly name = "ZapierApiError";
39
+ readonly code: "ZAPIER_API_ERROR";
38
40
  constructor(message: string, options?: ErrorOptions);
39
41
  }
40
42
  /**
@@ -42,6 +44,7 @@ export declare class ZapierApiError extends ZapierError {
42
44
  */
43
45
  export declare class ZapierAppNotFoundError extends ZapierError {
44
46
  readonly name = "ZapierAppNotFoundError";
47
+ readonly code: "ZAPIER_APP_NOT_FOUND_ERROR";
45
48
  appKey?: string;
46
49
  constructor(message: string, options?: ErrorOptions & {
47
50
  appKey?: string;
@@ -52,6 +55,7 @@ export declare class ZapierAppNotFoundError extends ZapierError {
52
55
  */
53
56
  export declare class ZapierValidationError extends ZapierError {
54
57
  readonly name = "ZapierValidationError";
58
+ readonly code: "ZAPIER_VALIDATION_ERROR";
55
59
  details?: unknown;
56
60
  constructor(message: string, options?: ErrorOptions & {
57
61
  details?: unknown;
@@ -62,6 +66,7 @@ export declare class ZapierValidationError extends ZapierError {
62
66
  */
63
67
  export declare class ZapierUnknownError extends ZapierError {
64
68
  readonly name = "ZapierUnknownError";
69
+ readonly code: "ZAPIER_UNKNOWN_ERROR";
65
70
  constructor(message: string, options?: ErrorOptions);
66
71
  }
67
72
  /**
@@ -69,6 +74,7 @@ export declare class ZapierUnknownError extends ZapierError {
69
74
  */
70
75
  export declare class ZapierAuthenticationError extends ZapierError {
71
76
  readonly name = "ZapierAuthenticationError";
77
+ readonly code: "ZAPIER_AUTHENTICATION_ERROR";
72
78
  constructor(message: string, options?: ErrorOptions);
73
79
  }
74
80
  /**
@@ -76,6 +82,7 @@ export declare class ZapierAuthenticationError extends ZapierError {
76
82
  */
77
83
  export declare class ZapierResourceNotFoundError extends ZapierError {
78
84
  readonly name = "ZapierResourceNotFoundError";
85
+ readonly code: "ZAPIER_RESOURCE_NOT_FOUND_ERROR";
79
86
  resourceType?: string;
80
87
  resourceId?: string;
81
88
  constructor(message: string, options?: ErrorOptions & {
@@ -88,6 +95,7 @@ export declare class ZapierResourceNotFoundError extends ZapierError {
88
95
  */
89
96
  export declare class ZapierConfigurationError extends ZapierError {
90
97
  readonly name = "ZapierConfigurationError";
98
+ readonly code: "ZAPIER_CONFIGURATION_ERROR";
91
99
  configType?: string;
92
100
  constructor(message: string, options?: ErrorOptions & {
93
101
  configType?: string;
@@ -98,6 +106,7 @@ export declare class ZapierConfigurationError extends ZapierError {
98
106
  */
99
107
  export declare class ZapierBundleError extends ZapierError {
100
108
  readonly name = "ZapierBundleError";
109
+ readonly code: "ZAPIER_BUNDLE_ERROR";
101
110
  buildErrors?: string[];
102
111
  constructor(message: string, options?: ErrorOptions & {
103
112
  buildErrors?: string[];
@@ -108,6 +117,7 @@ export declare class ZapierBundleError extends ZapierError {
108
117
  */
109
118
  export declare class ZapierTimeoutError extends ZapierError {
110
119
  readonly name = "ZapierTimeoutError";
120
+ readonly code: "ZAPIER_TIMEOUT_ERROR";
111
121
  attempts?: number;
112
122
  maxAttempts?: number;
113
123
  constructor(message: string, options?: ErrorOptions & {
@@ -121,6 +131,7 @@ export declare class ZapierTimeoutError extends ZapierError {
121
131
  */
122
132
  export declare class ZapierActionError extends ZapierError {
123
133
  readonly name = "ZapierActionError";
134
+ readonly code: "ZAPIER_ACTION_ERROR";
124
135
  appKey?: string;
125
136
  actionKey?: string;
126
137
  constructor(message: string, options?: ErrorOptions & {
@@ -134,6 +145,7 @@ export declare class ZapierActionError extends ZapierError {
134
145
  */
135
146
  export declare class ZapierNotFoundError extends ZapierError {
136
147
  readonly name = "ZapierNotFoundError";
148
+ readonly code: "ZAPIER_NOT_FOUND_ERROR";
137
149
  constructor(message: string, options?: ErrorOptions);
138
150
  }
139
151
  /**
@@ -154,6 +166,7 @@ export interface RateLimitInfo {
154
166
  */
155
167
  export declare class ZapierRateLimitError extends ZapierError {
156
168
  readonly name = "ZapierRateLimitError";
169
+ readonly code: "ZAPIER_RATE_LIMIT_ERROR";
157
170
  rateLimit: RateLimitInfo;
158
171
  retries: number;
159
172
  constructor(message: string, options?: ErrorOptions & {
@@ -167,6 +180,7 @@ export declare class ZapierRateLimitError extends ZapierError {
167
180
  */
168
181
  export declare class ZapierRelayError extends ZapierError {
169
182
  readonly name = "ZapierRelayError";
183
+ readonly code: "ZAPIER_RELAY_ERROR";
170
184
  constructor(message: string, options?: ErrorOptions);
171
185
  }
172
186
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/types/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,QAAQ,EAAE,CAAC;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;GAGG;AACH,8BAAsB,WAAY,SAAQ,KAAK;IAC7C,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,QAAQ,EAAE,CAAC;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;gBAEd,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,YAAiB;CASxD;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,WAAW;I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Q,WAAW;IAC/C,QAAQ,CAAC,IAAI,sBAAsB;IACnC,QAAQ,CAAC,IAAI,EAAG,oBAAoB,CAAU;gBAElC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,YAAiB;CAGxD;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CA8D7D"}
@@ -20,6 +20,7 @@ export class ZapierApiError extends ZapierError {
20
20
  constructor(message, options = {}) {
21
21
  super(message, options);
22
22
  this.name = "ZapierApiError";
23
+ this.code = "ZAPIER_API_ERROR";
23
24
  }
24
25
  }
25
26
  /**
@@ -29,6 +30,7 @@ export class ZapierAppNotFoundError extends ZapierError {
29
30
  constructor(message, options = {}) {
30
31
  super(message, options);
31
32
  this.name = "ZapierAppNotFoundError";
33
+ this.code = "ZAPIER_APP_NOT_FOUND_ERROR";
32
34
  this.appKey = options.appKey;
33
35
  }
34
36
  }
@@ -39,6 +41,7 @@ export class ZapierValidationError extends ZapierError {
39
41
  constructor(message, options = {}) {
40
42
  super(message, options);
41
43
  this.name = "ZapierValidationError";
44
+ this.code = "ZAPIER_VALIDATION_ERROR";
42
45
  this.details = options.details;
43
46
  }
44
47
  }
@@ -49,6 +52,7 @@ export class ZapierUnknownError extends ZapierError {
49
52
  constructor(message, options = {}) {
50
53
  super(message, options);
51
54
  this.name = "ZapierUnknownError";
55
+ this.code = "ZAPIER_UNKNOWN_ERROR";
52
56
  }
53
57
  }
54
58
  /**
@@ -58,6 +62,7 @@ export class ZapierAuthenticationError extends ZapierError {
58
62
  constructor(message, options = {}) {
59
63
  super(message, options);
60
64
  this.name = "ZapierAuthenticationError";
65
+ this.code = "ZAPIER_AUTHENTICATION_ERROR";
61
66
  }
62
67
  }
63
68
  /**
@@ -67,6 +72,7 @@ export class ZapierResourceNotFoundError extends ZapierError {
67
72
  constructor(message, options = {}) {
68
73
  super(message, options);
69
74
  this.name = "ZapierResourceNotFoundError";
75
+ this.code = "ZAPIER_RESOURCE_NOT_FOUND_ERROR";
70
76
  this.resourceType = options.resourceType;
71
77
  this.resourceId = options.resourceId;
72
78
  }
@@ -78,6 +84,7 @@ export class ZapierConfigurationError extends ZapierError {
78
84
  constructor(message, options = {}) {
79
85
  super(message, options);
80
86
  this.name = "ZapierConfigurationError";
87
+ this.code = "ZAPIER_CONFIGURATION_ERROR";
81
88
  this.configType = options.configType;
82
89
  }
83
90
  }
@@ -88,6 +95,7 @@ export class ZapierBundleError extends ZapierError {
88
95
  constructor(message, options = {}) {
89
96
  super(message, options);
90
97
  this.name = "ZapierBundleError";
98
+ this.code = "ZAPIER_BUNDLE_ERROR";
91
99
  this.buildErrors = options.buildErrors;
92
100
  }
93
101
  }
@@ -98,6 +106,7 @@ export class ZapierTimeoutError extends ZapierError {
98
106
  constructor(message, options = {}) {
99
107
  super(message, options);
100
108
  this.name = "ZapierTimeoutError";
109
+ this.code = "ZAPIER_TIMEOUT_ERROR";
101
110
  this.attempts = options.attempts;
102
111
  this.maxAttempts = options.maxAttempts;
103
112
  }
@@ -110,6 +119,7 @@ export class ZapierActionError extends ZapierError {
110
119
  constructor(message, options = {}) {
111
120
  super(message, options);
112
121
  this.name = "ZapierActionError";
122
+ this.code = "ZAPIER_ACTION_ERROR";
113
123
  this.appKey = options.appKey;
114
124
  this.actionKey = options.actionKey;
115
125
  }
@@ -125,6 +135,7 @@ export class ZapierNotFoundError extends ZapierError {
125
135
  constructor(message, options = {}) {
126
136
  super(message, options);
127
137
  this.name = "ZapierNotFoundError";
138
+ this.code = "ZAPIER_NOT_FOUND_ERROR";
128
139
  }
129
140
  }
130
141
  /**
@@ -134,6 +145,7 @@ export class ZapierRateLimitError extends ZapierError {
134
145
  constructor(message, options = {}) {
135
146
  super(message, options);
136
147
  this.name = "ZapierRateLimitError";
148
+ this.code = "ZAPIER_RATE_LIMIT_ERROR";
137
149
  this.rateLimit = options.rateLimit ?? {};
138
150
  this.retries = options.retries ?? 0;
139
151
  }
@@ -146,6 +158,7 @@ export class ZapierRelayError extends ZapierError {
146
158
  constructor(message, options = {}) {
147
159
  super(message, options);
148
160
  this.name = "ZapierRelayError";
161
+ this.code = "ZAPIER_RELAY_ERROR";
149
162
  }
150
163
  }
151
164
  /**
@@ -16,12 +16,11 @@ export interface FunctionOptions {
16
16
  /** Custom fetch implementation */
17
17
  fetch?: typeof globalThis.fetch;
18
18
  }
19
- export type PaginatedSdkFunction<TOptions, TItem> = (options: TOptions) => Promise<{
20
- data: TItem[];
21
- }> & AsyncIterable<{
22
- data: TItem[];
19
+ export interface SdkPage<T = unknown> {
20
+ data: T[];
23
21
  nextCursor?: string;
24
- }> & {
22
+ }
23
+ export type PaginatedSdkFunction<TOptions, TItem> = (options: TOptions) => Promise<SdkPage<TItem>> & AsyncIterable<SdkPage<TItem>> & {
25
24
  items(): AsyncIterable<TItem>;
26
25
  };
27
26
  //# sourceMappingURL=functions.d.ts.map