@zapier/zapier-sdk 0.87.0 → 0.87.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @zapier/zapier-sdk
2
2
 
3
+ ## 0.87.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 920d571: _This release contains no user-facing changes._
8
+
3
9
  ## 0.87.0
4
10
 
5
11
  ### Minor Changes
@@ -144,13 +144,34 @@ function buildRegistry({
144
144
  }).filter((category) => category.functions.length > 0);
145
145
  return { functions: filteredFunctions, categories: filteredCategories };
146
146
  }
147
- function composeVoid(existing, added) {
148
- if (!existing) return added;
149
- if (!added) return existing;
150
- return (ctx) => {
151
- existing(ctx);
152
- added(ctx);
147
+ var isolated = /* @__PURE__ */ new WeakSet();
148
+ function isolate(observer) {
149
+ if (!observer) return void 0;
150
+ if (isolated.has(observer)) return observer;
151
+ const wrapped = (ctx) => {
152
+ try {
153
+ observer(ctx);
154
+ } catch (error) {
155
+ console.error(
156
+ "[core] A method-lifecycle observer threw and was ignored. Observers are fire-and-forget and must not throw.",
157
+ error
158
+ );
159
+ }
153
160
  };
161
+ isolated.add(wrapped);
162
+ return wrapped;
163
+ }
164
+ function composeVoid(existing, added) {
165
+ const wrappedExisting = isolate(existing);
166
+ const wrappedAdded = isolate(added);
167
+ if (!wrappedExisting) return wrappedAdded;
168
+ if (!wrappedAdded) return wrappedExisting;
169
+ const composed = (ctx) => {
170
+ wrappedExisting(ctx);
171
+ wrappedAdded(ctx);
172
+ };
173
+ isolated.add(composed);
174
+ return composed;
154
175
  }
155
176
  function buildHooks(existing, added) {
156
177
  const result = {};
@@ -824,24 +845,27 @@ function createPaginatedFunction(coreFn, options) {
824
845
  return result.value;
825
846
  });
826
847
  if (hooks?.onMethodEnd) {
827
- firstPagePromise.then(() => {
828
- hooks.onMethodEnd({
829
- methodName: functionName,
830
- args,
831
- isPaginated: true,
832
- depth,
833
- durationMs: Date.now() - startTime
834
- });
835
- }).catch((error) => {
836
- hooks.onMethodEnd({
837
- methodName: functionName,
838
- args,
839
- isPaginated: true,
840
- depth,
841
- durationMs: Date.now() - startTime,
842
- error: error instanceof Error ? error : new Error(String(error))
843
- });
844
- });
848
+ firstPagePromise.then(
849
+ () => {
850
+ hooks.onMethodEnd({
851
+ methodName: functionName,
852
+ args,
853
+ isPaginated: true,
854
+ depth,
855
+ durationMs: Date.now() - startTime
856
+ });
857
+ },
858
+ (error) => {
859
+ hooks.onMethodEnd({
860
+ methodName: functionName,
861
+ args,
862
+ isPaginated: true,
863
+ depth,
864
+ durationMs: Date.now() - startTime,
865
+ error: error instanceof Error ? error : new Error(String(error))
866
+ });
867
+ }
868
+ );
845
869
  }
846
870
  const pageStream = async function* () {
847
871
  yield await firstPagePromise;
@@ -5791,7 +5815,7 @@ function parseDeprecationDate(value) {
5791
5815
  }
5792
5816
 
5793
5817
  // src/sdk-version.ts
5794
- var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.87.0" : void 0) || "unknown";
5818
+ var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.87.1" : void 0) || "unknown";
5795
5819
 
5796
5820
  // src/utils/open-url.ts
5797
5821
  var nodePrefix = "node:";
@@ -142,13 +142,34 @@ function buildRegistry({
142
142
  }).filter((category) => category.functions.length > 0);
143
143
  return { functions: filteredFunctions, categories: filteredCategories };
144
144
  }
145
- function composeVoid(existing, added) {
146
- if (!existing) return added;
147
- if (!added) return existing;
148
- return (ctx) => {
149
- existing(ctx);
150
- added(ctx);
145
+ var isolated = /* @__PURE__ */ new WeakSet();
146
+ function isolate(observer) {
147
+ if (!observer) return void 0;
148
+ if (isolated.has(observer)) return observer;
149
+ const wrapped = (ctx) => {
150
+ try {
151
+ observer(ctx);
152
+ } catch (error) {
153
+ console.error(
154
+ "[core] A method-lifecycle observer threw and was ignored. Observers are fire-and-forget and must not throw.",
155
+ error
156
+ );
157
+ }
151
158
  };
159
+ isolated.add(wrapped);
160
+ return wrapped;
161
+ }
162
+ function composeVoid(existing, added) {
163
+ const wrappedExisting = isolate(existing);
164
+ const wrappedAdded = isolate(added);
165
+ if (!wrappedExisting) return wrappedAdded;
166
+ if (!wrappedAdded) return wrappedExisting;
167
+ const composed = (ctx) => {
168
+ wrappedExisting(ctx);
169
+ wrappedAdded(ctx);
170
+ };
171
+ isolated.add(composed);
172
+ return composed;
152
173
  }
153
174
  function buildHooks(existing, added) {
154
175
  const result = {};
@@ -822,24 +843,27 @@ function createPaginatedFunction(coreFn, options) {
822
843
  return result.value;
823
844
  });
824
845
  if (hooks?.onMethodEnd) {
825
- firstPagePromise.then(() => {
826
- hooks.onMethodEnd({
827
- methodName: functionName,
828
- args,
829
- isPaginated: true,
830
- depth,
831
- durationMs: Date.now() - startTime
832
- });
833
- }).catch((error) => {
834
- hooks.onMethodEnd({
835
- methodName: functionName,
836
- args,
837
- isPaginated: true,
838
- depth,
839
- durationMs: Date.now() - startTime,
840
- error: error instanceof Error ? error : new Error(String(error))
841
- });
842
- });
846
+ firstPagePromise.then(
847
+ () => {
848
+ hooks.onMethodEnd({
849
+ methodName: functionName,
850
+ args,
851
+ isPaginated: true,
852
+ depth,
853
+ durationMs: Date.now() - startTime
854
+ });
855
+ },
856
+ (error) => {
857
+ hooks.onMethodEnd({
858
+ methodName: functionName,
859
+ args,
860
+ isPaginated: true,
861
+ depth,
862
+ durationMs: Date.now() - startTime,
863
+ error: error instanceof Error ? error : new Error(String(error))
864
+ });
865
+ }
866
+ );
843
867
  }
844
868
  const pageStream = async function* () {
845
869
  yield await firstPagePromise;
@@ -5789,7 +5813,7 @@ function parseDeprecationDate(value) {
5789
5813
  }
5790
5814
 
5791
5815
  // src/sdk-version.ts
5792
- var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.87.0" : void 0) || "unknown";
5816
+ var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.87.1" : void 0) || "unknown";
5793
5817
 
5794
5818
  // src/utils/open-url.ts
5795
5819
  var nodePrefix = "node:";