@zapier/zapier-sdk 0.119.5 → 0.120.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.
@@ -2843,7 +2843,7 @@ function logRouteOverride({
2843
2843
  }
2844
2844
 
2845
2845
  // src/sdk-version.ts
2846
- var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.119.5" : void 0) || "unknown";
2846
+ var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.120.0" : void 0) || "unknown";
2847
2847
 
2848
2848
  // src/utils/open-url.ts
2849
2849
  var nodePrefix = "node:";
@@ -5187,6 +5187,20 @@ var connectionsPlugin = kitcore.defineProperty({
5187
5187
  },
5188
5188
  get: ({ state }) => state
5189
5189
  });
5190
+
5191
+ // src/utils/global-class.ts
5192
+ function deferGlobalClass(name) {
5193
+ const standIn = class {
5194
+ static [Symbol.hasInstance](value) {
5195
+ const RealClass = globalThis[name];
5196
+ return typeof RealClass === "function" && value instanceof RealClass;
5197
+ }
5198
+ };
5199
+ Object.defineProperty(standIn, "name", { value: name });
5200
+ return standIn;
5201
+ }
5202
+
5203
+ // src/plugins/fetch/schemas.ts
5190
5204
  var FetchUrlSchema = zod.z.union([zod.z.string(), zod.z.instanceof(URL)]).describe(
5191
5205
  "The full URL of the API endpoint to call (proxied through Zapier's API Proxy)"
5192
5206
  );
@@ -5216,7 +5230,7 @@ var FetchInitSchema = zod.z.object({
5216
5230
  headers: zod.z.record(zod.z.string(), zod.z.string()).optional().describe("HTTP headers to include in the request"),
5217
5231
  body: zod.z.union([
5218
5232
  zod.z.string(),
5219
- zod.z.instanceof(FormData),
5233
+ zod.z.instanceof(deferGlobalClass("FormData")),
5220
5234
  zod.z.instanceof(URLSearchParams),
5221
5235
  zod.z.record(zod.z.string(), zod.z.unknown())
5222
5236
  ]).optional().describe(
@@ -7910,7 +7924,10 @@ function rankApp(app, term) {
7910
7924
  rankedValue: bestRankedValue
7911
7925
  };
7912
7926
  }
7913
- var TIE_BREAK_COLLATOR = new Intl.Collator("en-US");
7927
+ var tieBreakCollator;
7928
+ function getTieBreakCollator() {
7929
+ return tieBreakCollator ?? (tieBreakCollator = new Intl.Collator("en-US"));
7930
+ }
7914
7931
  function compareRanked(a, b) {
7915
7932
  if (a.rank !== b.rank) {
7916
7933
  return b.rank - a.rank;
@@ -7918,7 +7935,7 @@ function compareRanked(a, b) {
7918
7935
  if (a.fieldPriority !== b.fieldPriority) {
7919
7936
  return a.fieldPriority - b.fieldPriority;
7920
7937
  }
7921
- return TIE_BREAK_COLLATOR.compare(a.rankedValue, b.rankedValue);
7938
+ return getTieBreakCollator().compare(a.rankedValue, b.rankedValue);
7922
7939
  }
7923
7940
  function prioritizeSearchResults({
7924
7941
  apps,
@@ -9337,7 +9354,7 @@ var RelayRequestSchema = zod.z.object({
9337
9354
  callbackUrl: zod.z.string().url().optional().describe("URL to send async response to (makes request async)"),
9338
9355
  headers: zod.z.union([
9339
9356
  zod.z.record(zod.z.string(), zod.z.string()),
9340
- zod.z.instanceof(Headers),
9357
+ zod.z.instanceof(deferGlobalClass("Headers")),
9341
9358
  zod.z.array(zod.z.tuple([zod.z.string(), zod.z.string()]))
9342
9359
  ]).optional().describe("Request headers")
9343
9360
  }).describe("Make authenticated HTTP requests through Zapier's Relay service").meta({
@@ -2842,7 +2842,7 @@ function logRouteOverride({
2842
2842
  }
2843
2843
 
2844
2844
  // src/sdk-version.ts
2845
- var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.119.5" : void 0) || "unknown";
2845
+ var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.120.0" : void 0) || "unknown";
2846
2846
 
2847
2847
  // src/utils/open-url.ts
2848
2848
  var nodePrefix = "node:";
@@ -5186,6 +5186,20 @@ var connectionsPlugin = defineProperty({
5186
5186
  },
5187
5187
  get: ({ state }) => state
5188
5188
  });
5189
+
5190
+ // src/utils/global-class.ts
5191
+ function deferGlobalClass(name) {
5192
+ const standIn = class {
5193
+ static [Symbol.hasInstance](value) {
5194
+ const RealClass = globalThis[name];
5195
+ return typeof RealClass === "function" && value instanceof RealClass;
5196
+ }
5197
+ };
5198
+ Object.defineProperty(standIn, "name", { value: name });
5199
+ return standIn;
5200
+ }
5201
+
5202
+ // src/plugins/fetch/schemas.ts
5189
5203
  var FetchUrlSchema = z.union([z.string(), z.instanceof(URL)]).describe(
5190
5204
  "The full URL of the API endpoint to call (proxied through Zapier's API Proxy)"
5191
5205
  );
@@ -5215,7 +5229,7 @@ var FetchInitSchema = z.object({
5215
5229
  headers: z.record(z.string(), z.string()).optional().describe("HTTP headers to include in the request"),
5216
5230
  body: z.union([
5217
5231
  z.string(),
5218
- z.instanceof(FormData),
5232
+ z.instanceof(deferGlobalClass("FormData")),
5219
5233
  z.instanceof(URLSearchParams),
5220
5234
  z.record(z.string(), z.unknown())
5221
5235
  ]).optional().describe(
@@ -7909,7 +7923,10 @@ function rankApp(app, term) {
7909
7923
  rankedValue: bestRankedValue
7910
7924
  };
7911
7925
  }
7912
- var TIE_BREAK_COLLATOR = new Intl.Collator("en-US");
7926
+ var tieBreakCollator;
7927
+ function getTieBreakCollator() {
7928
+ return tieBreakCollator ?? (tieBreakCollator = new Intl.Collator("en-US"));
7929
+ }
7913
7930
  function compareRanked(a, b) {
7914
7931
  if (a.rank !== b.rank) {
7915
7932
  return b.rank - a.rank;
@@ -7917,7 +7934,7 @@ function compareRanked(a, b) {
7917
7934
  if (a.fieldPriority !== b.fieldPriority) {
7918
7935
  return a.fieldPriority - b.fieldPriority;
7919
7936
  }
7920
- return TIE_BREAK_COLLATOR.compare(a.rankedValue, b.rankedValue);
7937
+ return getTieBreakCollator().compare(a.rankedValue, b.rankedValue);
7921
7938
  }
7922
7939
  function prioritizeSearchResults({
7923
7940
  apps,
@@ -9336,7 +9353,7 @@ var RelayRequestSchema = z.object({
9336
9353
  callbackUrl: z.string().url().optional().describe("URL to send async response to (makes request async)"),
9337
9354
  headers: z.union([
9338
9355
  z.record(z.string(), z.string()),
9339
- z.instanceof(Headers),
9356
+ z.instanceof(deferGlobalClass("Headers")),
9340
9357
  z.array(z.tuple([z.string(), z.string()]))
9341
9358
  ]).optional().describe("Request headers")
9342
9359
  }).describe("Make authenticated HTTP requests through Zapier's Relay service").meta({