@zapier/zapier-sdk 0.73.1 → 0.74.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 +12 -0
- package/README.md +33 -29
- package/dist/api/client.d.ts.map +1 -1
- package/dist/api/client.js +5 -0
- package/dist/experimental.cjs +71 -16
- package/dist/experimental.d.mts +10 -2
- package/dist/experimental.d.ts +8 -0
- package/dist/experimental.d.ts.map +1 -1
- package/dist/experimental.mjs +70 -17
- package/dist/{index-D1O7Pcex.d.mts → index-B_Fr4RAt.d.mts} +32 -1
- package/dist/{index-D1O7Pcex.d.ts → index-B_Fr4RAt.d.ts} +32 -1
- package/dist/index.cjs +53 -16
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.mjs +52 -17
- package/dist/plugins/codeSubstrate/deleteWorkflow/index.d.ts +2 -0
- package/dist/plugins/codeSubstrate/deleteWorkflow/index.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/disableWorkflow/index.d.ts +2 -0
- package/dist/plugins/codeSubstrate/disableWorkflow/index.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/enableWorkflow/index.d.ts +2 -0
- package/dist/plugins/codeSubstrate/enableWorkflow/index.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/getWorkflow/index.d.ts +4 -0
- package/dist/plugins/codeSubstrate/getWorkflow/index.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/getWorkflow/schemas.d.ts +4 -0
- package/dist/plugins/codeSubstrate/getWorkflow/schemas.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/getWorkflow/schemas.js +7 -1
- package/dist/plugins/codeSubstrate/getWorkflowRun/index.d.ts +2 -0
- package/dist/plugins/codeSubstrate/getWorkflowRun/index.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/getWorkflowVersion/index.d.ts +2 -0
- package/dist/plugins/codeSubstrate/getWorkflowVersion/index.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/listWorkflowRuns/index.d.ts +2 -0
- package/dist/plugins/codeSubstrate/listWorkflowRuns/index.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/listWorkflowVersions/index.d.ts +2 -0
- package/dist/plugins/codeSubstrate/listWorkflowVersions/index.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/listWorkflows/index.d.ts +2 -0
- package/dist/plugins/codeSubstrate/listWorkflows/index.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/listWorkflows/schemas.d.ts +8 -0
- package/dist/plugins/codeSubstrate/listWorkflows/schemas.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/listWorkflows/schemas.js +6 -1
- package/dist/plugins/codeSubstrate/publishWorkflowVersion/index.d.ts +2 -0
- package/dist/plugins/codeSubstrate/publishWorkflowVersion/index.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/shared-schemas.d.ts +4 -0
- package/dist/plugins/codeSubstrate/shared-schemas.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/shared-schemas.js +14 -0
- package/dist/plugins/codeSubstrate/triggerWorkflow/index.d.ts +2 -0
- package/dist/plugins/codeSubstrate/triggerWorkflow/index.d.ts.map +1 -1
- package/dist/plugins/codeSubstrate/updateWorkflow/index.d.ts +2 -0
- package/dist/plugins/codeSubstrate/updateWorkflow/index.d.ts.map +1 -1
- package/dist/utils/caller-context.d.ts +21 -0
- package/dist/utils/caller-context.d.ts.map +1 -0
- package/dist/utils/caller-context.js +35 -0
- package/package.json +2 -2
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { createAsyncContext } from "kitcore";
|
|
2
|
+
const callerContext = createAsyncContext();
|
|
3
|
+
/**
|
|
4
|
+
* Run `fn` with the given caller context merged onto any parent context, so
|
|
5
|
+
* the operation that initiated the call (e.g. a CLI command or MCP tool) stays
|
|
6
|
+
* observable through every SDK call it makes.
|
|
7
|
+
*
|
|
8
|
+
* Caller context is telemetry-only: reading the parent scope is wrapped so a
|
|
9
|
+
* broken ALS store can never crash the wrapped command. Errors thrown by `fn`
|
|
10
|
+
* itself are intentionally NOT caught — they propagate.
|
|
11
|
+
*/
|
|
12
|
+
export function runWithCallerContext(context, fn) {
|
|
13
|
+
let parent;
|
|
14
|
+
try {
|
|
15
|
+
parent = callerContext.get() ?? {};
|
|
16
|
+
}
|
|
17
|
+
catch {
|
|
18
|
+
return fn();
|
|
19
|
+
}
|
|
20
|
+
return callerContext.run({ ...parent, ...context }, fn);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Read the active caller context, or an empty object outside any caller scope.
|
|
24
|
+
*
|
|
25
|
+
* Read on the outbound HTTP path to set a telemetry header, so a failure here
|
|
26
|
+
* must never break the request — it falls back to an empty context.
|
|
27
|
+
*/
|
|
28
|
+
export function getCallerContext() {
|
|
29
|
+
try {
|
|
30
|
+
return callerContext.get() ?? {};
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
return {};
|
|
34
|
+
}
|
|
35
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zapier/zapier-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.74.1",
|
|
4
4
|
"description": "Complete Zapier SDK - combines all Zapier SDK packages",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
"tsup": "^8.5.0",
|
|
96
96
|
"typescript": "^5.8.3",
|
|
97
97
|
"vitest": "^4.1.4",
|
|
98
|
-
"kitcore": "0.0
|
|
98
|
+
"kitcore": "0.1.0"
|
|
99
99
|
},
|
|
100
100
|
"scripts": {
|
|
101
101
|
"build": "tsup",
|