@zapier/zapier-sdk 0.97.1 → 0.98.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/CHANGELOG.md +6 -0
- package/README.md +34 -34
- package/dist/{chunk-X7NGRS4I.mjs → chunk-UJLLXQ3L.mjs} +99 -16
- package/dist/{chunk-MAEVVN2L.cjs → chunk-XZU6XQNV.cjs} +99 -16
- package/dist/experimental.cjs +384 -384
- package/dist/experimental.d.mts +31 -12
- package/dist/experimental.d.ts +31 -12
- package/dist/experimental.mjs +2 -2
- package/dist/{index-DsMsmowr.d.mts → index-Cx7Zjn-B.d.mts} +127 -25
- package/dist/{index-DsMsmowr.d.ts → index-Cx7Zjn-B.d.ts} +127 -25
- package/dist/index.cjs +276 -276
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @zapier/zapier-sdk
|
|
2
2
|
|
|
3
|
+
## 0.98.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 9a5ae37: Added `status` to `listConnections`, `findFirstConnection`, and `findUniqueConnection` to filter connections by expiry: `active` (the default, and the existing behaviour), `expired`, or `all` for both. Previously only non-expired connections were returned by default and `expired: true` returned only expired ones, so a single call could never cover both. `expired` and `isExpired` are now deprecated in favour of `status` and still work; combining `status` with either throws a validation error.
|
|
8
|
+
|
|
3
9
|
## 0.97.1
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -2254,16 +2254,16 @@ Find the first connection matching the criteria
|
|
|
2254
2254
|
|
|
2255
2255
|
**Parameters:**
|
|
2256
2256
|
|
|
2257
|
-
| Name | Type | Required | Default | Possible Values
|
|
2258
|
-
| ------------------- | --------- | -------- | ------- |
|
|
2259
|
-
| `options` | `object` | ✅ | — | —
|
|
2260
|
-
| ↳ `search` | `string` | ❌ | — | —
|
|
2261
|
-
| ↳ `title` | `string` | ❌ | — | —
|
|
2262
|
-
| ↳ `owner` | `string` | ❌ | — | —
|
|
2263
|
-
| ↳ `app` | `string` | ❌ | — | —
|
|
2264
|
-
| ↳ `account` | `string` | ❌ | — | —
|
|
2265
|
-
| ↳ `includeShared` | `boolean` | ❌ | — | —
|
|
2266
|
-
| ↳ `
|
|
2257
|
+
| Name | Type | Required | Default | Possible Values | Description |
|
|
2258
|
+
| ------------------- | --------- | -------- | ------- | -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
2259
|
+
| `options` | `object` | ✅ | — | — | |
|
|
2260
|
+
| ↳ `search` | `string` | ❌ | — | — | Search term to filter connections by title |
|
|
2261
|
+
| ↳ `title` | `string` | ❌ | — | — | Filter connections by exact title match (searches first, then filters locally) |
|
|
2262
|
+
| ↳ `owner` | `string` | ❌ | — | — | Filter by owner, 'me' for your own connections or a specific user ID |
|
|
2263
|
+
| ↳ `app` | `string` | ❌ | — | — | App key of connections to list (e.g., 'SlackCLIAPI' or slug like 'github') |
|
|
2264
|
+
| ↳ `account` | `string` | ❌ | — | — | Account to filter by |
|
|
2265
|
+
| ↳ `includeShared` | `boolean` | ❌ | — | — | Include connections shared with you. By default, only your own connections are returned (owner=me). Set to true to also include shared connections. |
|
|
2266
|
+
| ↳ `status` | `string` | ❌ | — | `active`, `expired`, `all` | Filter connections by expiry: 'active' (default) returns only non-expired connections, 'expired' only expired ones, and 'all' returns both. |
|
|
2267
2267
|
|
|
2268
2268
|
**Returns:** `Promise<ConnectionItem>`
|
|
2269
2269
|
|
|
@@ -2311,16 +2311,16 @@ Find a unique connection matching the criteria
|
|
|
2311
2311
|
|
|
2312
2312
|
**Parameters:**
|
|
2313
2313
|
|
|
2314
|
-
| Name | Type | Required | Default | Possible Values
|
|
2315
|
-
| ------------------- | --------- | -------- | ------- |
|
|
2316
|
-
| `options` | `object` | ✅ | — | —
|
|
2317
|
-
| ↳ `search` | `string` | ❌ | — | —
|
|
2318
|
-
| ↳ `title` | `string` | ❌ | — | —
|
|
2319
|
-
| ↳ `owner` | `string` | ❌ | — | —
|
|
2320
|
-
| ↳ `app` | `string` | ❌ | — | —
|
|
2321
|
-
| ↳ `account` | `string` | ❌ | — | —
|
|
2322
|
-
| ↳ `includeShared` | `boolean` | ❌ | — | —
|
|
2323
|
-
| ↳ `
|
|
2314
|
+
| Name | Type | Required | Default | Possible Values | Description |
|
|
2315
|
+
| ------------------- | --------- | -------- | ------- | -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
2316
|
+
| `options` | `object` | ✅ | — | — | |
|
|
2317
|
+
| ↳ `search` | `string` | ❌ | — | — | Search term to filter connections by title |
|
|
2318
|
+
| ↳ `title` | `string` | ❌ | — | — | Filter connections by exact title match (searches first, then filters locally) |
|
|
2319
|
+
| ↳ `owner` | `string` | ❌ | — | — | Filter by owner, 'me' for your own connections or a specific user ID |
|
|
2320
|
+
| ↳ `app` | `string` | ❌ | — | — | App key of connections to list (e.g., 'SlackCLIAPI' or slug like 'github') |
|
|
2321
|
+
| ↳ `account` | `string` | ❌ | — | — | Account to filter by |
|
|
2322
|
+
| ↳ `includeShared` | `boolean` | ❌ | — | — | Include connections shared with you. By default, only your own connections are returned (owner=me). Set to true to also include shared connections. |
|
|
2323
|
+
| ↳ `status` | `string` | ❌ | — | `active`, `expired`, `all` | Filter connections by expiry: 'active' (default) returns only non-expired connections, 'expired' only expired ones, and 'all' returns both. |
|
|
2324
2324
|
|
|
2325
2325
|
**Returns:** `Promise<ConnectionItem>`
|
|
2326
2326
|
|
|
@@ -2462,20 +2462,20 @@ List available connections with optional filtering
|
|
|
2462
2462
|
|
|
2463
2463
|
**Parameters:**
|
|
2464
2464
|
|
|
2465
|
-
| Name | Type | Required | Default | Possible Values
|
|
2466
|
-
| ------------------- | --------- | -------- | ------- |
|
|
2467
|
-
| `options` | `object` | ✅ | — | —
|
|
2468
|
-
| ↳ `search` | `string` | ❌ | — | —
|
|
2469
|
-
| ↳ `title` | `string` | ❌ | — | —
|
|
2470
|
-
| ↳ `owner` | `string` | ❌ | — | —
|
|
2471
|
-
| ↳ `app` | `string` | ❌ | — | —
|
|
2472
|
-
| ↳ `connections` | `array` | ❌ | — | —
|
|
2473
|
-
| ↳ `account` | `string` | ❌ | — | —
|
|
2474
|
-
| ↳ `includeShared` | `boolean` | ❌ | — | —
|
|
2475
|
-
| ↳ `
|
|
2476
|
-
| ↳ `pageSize` | `number` | ❌ | — | —
|
|
2477
|
-
| ↳ `maxItems` | `number` | ❌ | — | —
|
|
2478
|
-
| ↳ `cursor` | `string` | ❌ | — | —
|
|
2465
|
+
| Name | Type | Required | Default | Possible Values | Description |
|
|
2466
|
+
| ------------------- | --------- | -------- | ------- | -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
2467
|
+
| `options` | `object` | ✅ | — | — | |
|
|
2468
|
+
| ↳ `search` | `string` | ❌ | — | — | Search term to filter connections by title |
|
|
2469
|
+
| ↳ `title` | `string` | ❌ | — | — | Filter connections by exact title match (searches first, then filters locally) |
|
|
2470
|
+
| ↳ `owner` | `string` | ❌ | — | — | Filter by owner, 'me' for your own connections or a specific user ID |
|
|
2471
|
+
| ↳ `app` | `string` | ❌ | — | — | App key of connections to list (e.g., 'SlackCLIAPI' or slug like 'github') |
|
|
2472
|
+
| ↳ `connections` | `array` | ❌ | — | — | List of connection IDs to filter by |
|
|
2473
|
+
| ↳ `account` | `string` | ❌ | — | — | Account to filter by |
|
|
2474
|
+
| ↳ `includeShared` | `boolean` | ❌ | — | — | Include connections shared with you. By default, only your own connections are returned (owner=me). Set to true to also include shared connections. |
|
|
2475
|
+
| ↳ `status` | `string` | ❌ | — | `active`, `expired`, `all` | Filter connections by expiry: 'active' (default) returns only non-expired connections, 'expired' only expired ones, and 'all' returns both. |
|
|
2476
|
+
| ↳ `pageSize` | `number` | ❌ | — | — | Number of connections per page |
|
|
2477
|
+
| ↳ `maxItems` | `number` | ❌ | — | — | Maximum total items to return across all pages |
|
|
2478
|
+
| ↳ `cursor` | `string` | ❌ | — | — | Cursor to start from |
|
|
2479
2479
|
|
|
2480
2480
|
**Returns:** `Promise<PaginatedResult<ConnectionItem>>`
|
|
2481
2481
|
|
|
@@ -66,6 +66,13 @@ function getNegatable(schema) {
|
|
|
66
66
|
function openEnum(values, description) {
|
|
67
67
|
return z.union([z.enum(values), z.string()]).describe(description);
|
|
68
68
|
}
|
|
69
|
+
var STABILITY_LEVELS = ["stable", "beta", "experimental"];
|
|
70
|
+
function normalizeStability(meta) {
|
|
71
|
+
if (meta.stability !== void 0) {
|
|
72
|
+
return STABILITY_LEVELS.includes(meta.stability) ? meta.stability : "experimental";
|
|
73
|
+
}
|
|
74
|
+
return meta.experimental ? "experimental" : "stable";
|
|
75
|
+
}
|
|
69
76
|
function resolveCategoryDefinition(ref) {
|
|
70
77
|
const def = typeof ref === "string" ? { key: ref } : ref;
|
|
71
78
|
const title = def.title ?? toTitleCase(def.key);
|
|
@@ -109,6 +116,7 @@ function buildRegistry({
|
|
|
109
116
|
return typeof rootProperty === "object" && rootProperty !== null;
|
|
110
117
|
}).map((key) => {
|
|
111
118
|
const m = meta[key];
|
|
119
|
+
const stability = normalizeStability(m);
|
|
112
120
|
return {
|
|
113
121
|
name: key,
|
|
114
122
|
description: m.description,
|
|
@@ -124,7 +132,11 @@ function buildRegistry({
|
|
|
124
132
|
),
|
|
125
133
|
resolvers: resolvers?.[key],
|
|
126
134
|
formatter: formatters?.[key],
|
|
127
|
-
|
|
135
|
+
stability,
|
|
136
|
+
// Deprecated derived read, literal by name: only the experimental
|
|
137
|
+
// tier reads true. Beta reads false — the "not stable" warning duty
|
|
138
|
+
// lives in `stability` and the runtime notice, not this boolean.
|
|
139
|
+
experimental: stability === "experimental",
|
|
128
140
|
packages: m.packages,
|
|
129
141
|
confirm: m.confirm ?? (m.type === "delete" ? "delete" : void 0),
|
|
130
142
|
deprecation: m.deprecation,
|
|
@@ -209,6 +221,20 @@ function createDeprecationLogger(tag) {
|
|
|
209
221
|
};
|
|
210
222
|
}
|
|
211
223
|
var { logDeprecation} = createDeprecationLogger("core");
|
|
224
|
+
function createStabilityNoticeLogger(tag) {
|
|
225
|
+
const loggedNotices = /* @__PURE__ */ new Set();
|
|
226
|
+
return {
|
|
227
|
+
logStabilityNotice(message) {
|
|
228
|
+
if (loggedNotices.has(message)) return;
|
|
229
|
+
loggedNotices.add(message);
|
|
230
|
+
console.warn(`[${tag}] ${message}`);
|
|
231
|
+
},
|
|
232
|
+
resetStabilityNotices() {
|
|
233
|
+
loggedNotices.clear();
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
var { logStabilityNotice} = createStabilityNoticeLogger("core");
|
|
212
238
|
var CORE_ERROR_SYMBOL = Symbol.for("kitcore.error");
|
|
213
239
|
var CoreErrorCode = {
|
|
214
240
|
Validation: "VALIDATION_ERROR",
|
|
@@ -620,6 +646,19 @@ function defaultLogDeprecation({
|
|
|
620
646
|
}) {
|
|
621
647
|
logDeprecation(`${methodName}() is deprecated. ${deprecation.message}`);
|
|
622
648
|
}
|
|
649
|
+
var STABILITY_NOTICE_DETAILS = {
|
|
650
|
+
beta: "Its API shape is settled, but it is not yet covered by stable-tier guarantees.",
|
|
651
|
+
experimental: "It may change shape or disappear without notice."
|
|
652
|
+
};
|
|
653
|
+
function defaultLogStabilityNotice({
|
|
654
|
+
methodName,
|
|
655
|
+
stability
|
|
656
|
+
}) {
|
|
657
|
+
if (stability === "stable") return;
|
|
658
|
+
logStabilityNotice(
|
|
659
|
+
`${methodName}() is a ${stability} API. ${STABILITY_NOTICE_DETAILS[stability]}`
|
|
660
|
+
);
|
|
661
|
+
}
|
|
623
662
|
var CORE_OPTIONS_ID = "kitcore/coreOptions";
|
|
624
663
|
function resolveCoreOptions(context) {
|
|
625
664
|
const entry = context.plugins?.[CORE_OPTIONS_ID];
|
|
@@ -666,6 +705,18 @@ function signalDeprecation(context, methodName, getDeprecation) {
|
|
|
666
705
|
const handler = resolveCoreOptions(context)?.logDeprecation ?? defaultLogDeprecation;
|
|
667
706
|
runIsolatedObserver(() => handler(warning));
|
|
668
707
|
}
|
|
708
|
+
function signalStability(context, methodName, getStability) {
|
|
709
|
+
if (isInsideObserver()) return;
|
|
710
|
+
const stability = getStability?.();
|
|
711
|
+
if (!stability || stability === "stable") return;
|
|
712
|
+
const notice = {
|
|
713
|
+
type: "stability",
|
|
714
|
+
methodName,
|
|
715
|
+
stability
|
|
716
|
+
};
|
|
717
|
+
const handler = resolveCoreOptions(context)?.logStabilityNotice ?? defaultLogStabilityNotice;
|
|
718
|
+
runIsolatedObserver(() => handler(notice));
|
|
719
|
+
}
|
|
669
720
|
function normalizeError(error, adaptError) {
|
|
670
721
|
if (error instanceof Error) return error;
|
|
671
722
|
const message = typeof error === "object" && error !== null && "message" in error && typeof error.message === "string" ? error.message : String(error);
|
|
@@ -679,7 +730,7 @@ function normalizeError(error, adaptError) {
|
|
|
679
730
|
);
|
|
680
731
|
}
|
|
681
732
|
function createFunction(coreFn, options) {
|
|
682
|
-
const { sdk, schema, name, annotator, getDeprecation } = options;
|
|
733
|
+
const { sdk, schema, name, annotator, getDeprecation, getStability } = options;
|
|
683
734
|
const functionName = name || coreFn.name;
|
|
684
735
|
const namedFunctions = {
|
|
685
736
|
[functionName]: async function(callOptions) {
|
|
@@ -687,6 +738,7 @@ function createFunction(coreFn, options) {
|
|
|
687
738
|
const context = resolveCallContext(internal);
|
|
688
739
|
if (!isCallContext(internal) && internal !== INTERNAL_CALL) {
|
|
689
740
|
signalDeprecation(sdk.context, functionName, getDeprecation);
|
|
741
|
+
signalStability(sdk.context, functionName, getStability);
|
|
690
742
|
}
|
|
691
743
|
return runInMethodScope(async () => {
|
|
692
744
|
const startTime = Date.now();
|
|
@@ -753,12 +805,21 @@ function createFunction(coreFn, options) {
|
|
|
753
805
|
return namedFunctions[functionName];
|
|
754
806
|
}
|
|
755
807
|
function createRawFunction(coreFn, options) {
|
|
756
|
-
const {
|
|
808
|
+
const {
|
|
809
|
+
sdk,
|
|
810
|
+
name,
|
|
811
|
+
schema,
|
|
812
|
+
positional,
|
|
813
|
+
annotator,
|
|
814
|
+
getDeprecation,
|
|
815
|
+
getStability
|
|
816
|
+
} = options;
|
|
757
817
|
return function(rawInput) {
|
|
758
818
|
const internal = arguments[1];
|
|
759
819
|
const context = resolveCallContext(internal);
|
|
760
820
|
if (!isCallContext(internal) && internal !== INTERNAL_CALL) {
|
|
761
821
|
signalDeprecation(sdk.context, name, getDeprecation);
|
|
822
|
+
signalStability(sdk.context, name, getStability);
|
|
762
823
|
}
|
|
763
824
|
return runInMethodScope(() => {
|
|
764
825
|
const startTime = Date.now();
|
|
@@ -864,7 +925,8 @@ function createPaginatedFunction(coreFn, options) {
|
|
|
864
925
|
adaptPage,
|
|
865
926
|
annotator,
|
|
866
927
|
finalizePage,
|
|
867
|
-
getDeprecation
|
|
928
|
+
getDeprecation,
|
|
929
|
+
getStability
|
|
868
930
|
} = options;
|
|
869
931
|
const pageFunction = createPageFunction(coreFn, {
|
|
870
932
|
sdk,
|
|
@@ -878,6 +940,7 @@ function createPaginatedFunction(coreFn, options) {
|
|
|
878
940
|
const context = resolveCallContext(internal);
|
|
879
941
|
if (!isCallContext(internal) && internal !== INTERNAL_CALL) {
|
|
880
942
|
signalDeprecation(sdk.context, functionName, getDeprecation);
|
|
943
|
+
signalStability(sdk.context, functionName, getStability);
|
|
881
944
|
}
|
|
882
945
|
return runInMethodScope(() => {
|
|
883
946
|
const startTime = Date.now();
|
|
@@ -1316,6 +1379,7 @@ var LEAF_META_KEYS = [
|
|
|
1316
1379
|
"returnType",
|
|
1317
1380
|
"outputSchema",
|
|
1318
1381
|
"packages",
|
|
1382
|
+
"stability",
|
|
1319
1383
|
"experimental",
|
|
1320
1384
|
"confirm",
|
|
1321
1385
|
"deprecation",
|
|
@@ -2541,7 +2605,8 @@ function buildMethodEntries(descriptors, context, states) {
|
|
|
2541
2605
|
// (item mode's sibling); dropped paths surface as `[].x` in the page's
|
|
2542
2606
|
// `meta`, unioned across items.
|
|
2543
2607
|
finalizePage: (page) => applyListOutputPolicy(page, outputPolicy()),
|
|
2544
|
-
getDeprecation: () => entry.meta?.deprecation
|
|
2608
|
+
getDeprecation: () => entry.meta?.deprecation,
|
|
2609
|
+
getStability: () => entry.meta ? normalizeStability(entry.meta) : void 0
|
|
2545
2610
|
}
|
|
2546
2611
|
);
|
|
2547
2612
|
} else if (out.type === "item") {
|
|
@@ -2553,7 +2618,8 @@ function buildMethodEntries(descriptors, context, states) {
|
|
|
2553
2618
|
schema: descriptor.inputSchema,
|
|
2554
2619
|
name: descriptor.name,
|
|
2555
2620
|
annotator: boundAnnotator,
|
|
2556
|
-
getDeprecation: () => entry.meta?.deprecation
|
|
2621
|
+
getDeprecation: () => entry.meta?.deprecation,
|
|
2622
|
+
getStability: () => entry.meta ? normalizeStability(entry.meta) : void 0
|
|
2557
2623
|
}
|
|
2558
2624
|
);
|
|
2559
2625
|
} else {
|
|
@@ -2567,8 +2633,10 @@ function buildMethodEntries(descriptors, context, states) {
|
|
|
2567
2633
|
annotator: boundAnnotator,
|
|
2568
2634
|
// The boundary reads the deprecation LIVE off the entry, so a
|
|
2569
2635
|
// deprecation merged after build (defineMethodOverride, addPlugin)
|
|
2570
|
-
// fires too.
|
|
2571
|
-
|
|
2636
|
+
// fires too. Same for the stability level, normalized from the
|
|
2637
|
+
// entry meta (declared level or legacy `experimental` boolean).
|
|
2638
|
+
getDeprecation: () => entry.meta?.deprecation,
|
|
2639
|
+
getStability: () => entry.meta ? normalizeStability(entry.meta) : void 0
|
|
2572
2640
|
}
|
|
2573
2641
|
);
|
|
2574
2642
|
}
|
|
@@ -6512,7 +6580,7 @@ function parseDeprecationDate(value) {
|
|
|
6512
6580
|
}
|
|
6513
6581
|
|
|
6514
6582
|
// src/sdk-version.ts
|
|
6515
|
-
var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.
|
|
6583
|
+
var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.98.0" : void 0) || "unknown";
|
|
6516
6584
|
|
|
6517
6585
|
// src/utils/open-url.ts
|
|
6518
6586
|
var nodePrefix = "node:";
|
|
@@ -11862,14 +11930,24 @@ var ListConnectionsQuerySchema = ListConnectionsQuerySchema$1.omit({
|
|
|
11862
11930
|
includeShared: z.boolean().optional().describe(
|
|
11863
11931
|
"Include connections shared with you. By default, only your own connections are returned (owner=me). Set to true to also include shared connections."
|
|
11864
11932
|
),
|
|
11865
|
-
|
|
11933
|
+
// Filters on connection expiry. Not a mirror of a server-side status
|
|
11934
|
+
// field: the API expresses this as the is_expired filter, which we send as
|
|
11935
|
+
// false for "active", true for "expired", and omit for "all".
|
|
11936
|
+
status: z.enum(["active", "expired", "all"]).optional().describe(
|
|
11937
|
+
"Filter connections by expiry: 'active' (default) returns only non-expired connections, 'expired' only expired ones, and 'all' returns both."
|
|
11938
|
+
),
|
|
11939
|
+
/** @deprecated Use `status` instead */
|
|
11866
11940
|
isExpired: z.boolean().optional().describe("Filter by expired status").meta({
|
|
11867
11941
|
deprecated: true,
|
|
11868
|
-
deprecationMessage: "Use --expired instead to show only expired connections."
|
|
11942
|
+
deprecationMessage: "Use --status expired instead to show only expired connections, or --status all for both."
|
|
11869
11943
|
}),
|
|
11944
|
+
/** @deprecated Use `status` instead */
|
|
11870
11945
|
expired: z.boolean().optional().describe(
|
|
11871
11946
|
"Show only expired connections (default: only non-expired connections are returned)"
|
|
11872
|
-
)
|
|
11947
|
+
).meta({
|
|
11948
|
+
deprecated: true,
|
|
11949
|
+
deprecationMessage: "Use --status expired instead to show only expired connections, or --status all for both."
|
|
11950
|
+
}),
|
|
11873
11951
|
// Override pageSize to make optional
|
|
11874
11952
|
pageSize: z.number().min(1).optional().describe("Number of connections per page"),
|
|
11875
11953
|
// SDK specific property for pagination/iterable helpers
|
|
@@ -11995,10 +12073,15 @@ var listConnectionsPlugin = defineMethod({
|
|
|
11995
12073
|
if (owner) {
|
|
11996
12074
|
searchParams.owner = owner;
|
|
11997
12075
|
}
|
|
11998
|
-
|
|
11999
|
-
|
|
12000
|
-
|
|
12001
|
-
|
|
12076
|
+
const expiredFilter = input.isExpired ?? input.expired;
|
|
12077
|
+
if (input.status !== void 0 && expiredFilter !== void 0) {
|
|
12078
|
+
throw new ZapierValidationError(
|
|
12079
|
+
'The "status" option replaces "expired" and "isExpired", so it cannot be combined with either.'
|
|
12080
|
+
);
|
|
12081
|
+
}
|
|
12082
|
+
const status = input.status ?? (expiredFilter ? "expired" : "active");
|
|
12083
|
+
if (status !== "all") {
|
|
12084
|
+
searchParams.is_expired = (status === "expired").toString();
|
|
12002
12085
|
}
|
|
12003
12086
|
if (input.cursor) {
|
|
12004
12087
|
searchParams.offset = input.cursor;
|
|
@@ -68,6 +68,13 @@ function getNegatable(schema) {
|
|
|
68
68
|
function openEnum(values, description) {
|
|
69
69
|
return zod.z.union([zod.z.enum(values), zod.z.string()]).describe(description);
|
|
70
70
|
}
|
|
71
|
+
var STABILITY_LEVELS = ["stable", "beta", "experimental"];
|
|
72
|
+
function normalizeStability(meta) {
|
|
73
|
+
if (meta.stability !== void 0) {
|
|
74
|
+
return STABILITY_LEVELS.includes(meta.stability) ? meta.stability : "experimental";
|
|
75
|
+
}
|
|
76
|
+
return meta.experimental ? "experimental" : "stable";
|
|
77
|
+
}
|
|
71
78
|
function resolveCategoryDefinition(ref) {
|
|
72
79
|
const def = typeof ref === "string" ? { key: ref } : ref;
|
|
73
80
|
const title = def.title ?? toTitleCase(def.key);
|
|
@@ -111,6 +118,7 @@ function buildRegistry({
|
|
|
111
118
|
return typeof rootProperty === "object" && rootProperty !== null;
|
|
112
119
|
}).map((key) => {
|
|
113
120
|
const m = meta[key];
|
|
121
|
+
const stability = normalizeStability(m);
|
|
114
122
|
return {
|
|
115
123
|
name: key,
|
|
116
124
|
description: m.description,
|
|
@@ -126,7 +134,11 @@ function buildRegistry({
|
|
|
126
134
|
),
|
|
127
135
|
resolvers: resolvers?.[key],
|
|
128
136
|
formatter: formatters?.[key],
|
|
129
|
-
|
|
137
|
+
stability,
|
|
138
|
+
// Deprecated derived read, literal by name: only the experimental
|
|
139
|
+
// tier reads true. Beta reads false — the "not stable" warning duty
|
|
140
|
+
// lives in `stability` and the runtime notice, not this boolean.
|
|
141
|
+
experimental: stability === "experimental",
|
|
130
142
|
packages: m.packages,
|
|
131
143
|
confirm: m.confirm ?? (m.type === "delete" ? "delete" : void 0),
|
|
132
144
|
deprecation: m.deprecation,
|
|
@@ -211,6 +223,20 @@ function createDeprecationLogger(tag) {
|
|
|
211
223
|
};
|
|
212
224
|
}
|
|
213
225
|
var { logDeprecation} = createDeprecationLogger("core");
|
|
226
|
+
function createStabilityNoticeLogger(tag) {
|
|
227
|
+
const loggedNotices = /* @__PURE__ */ new Set();
|
|
228
|
+
return {
|
|
229
|
+
logStabilityNotice(message) {
|
|
230
|
+
if (loggedNotices.has(message)) return;
|
|
231
|
+
loggedNotices.add(message);
|
|
232
|
+
console.warn(`[${tag}] ${message}`);
|
|
233
|
+
},
|
|
234
|
+
resetStabilityNotices() {
|
|
235
|
+
loggedNotices.clear();
|
|
236
|
+
}
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
var { logStabilityNotice} = createStabilityNoticeLogger("core");
|
|
214
240
|
var CORE_ERROR_SYMBOL = Symbol.for("kitcore.error");
|
|
215
241
|
var CoreErrorCode = {
|
|
216
242
|
Validation: "VALIDATION_ERROR",
|
|
@@ -622,6 +648,19 @@ function defaultLogDeprecation({
|
|
|
622
648
|
}) {
|
|
623
649
|
logDeprecation(`${methodName}() is deprecated. ${deprecation.message}`);
|
|
624
650
|
}
|
|
651
|
+
var STABILITY_NOTICE_DETAILS = {
|
|
652
|
+
beta: "Its API shape is settled, but it is not yet covered by stable-tier guarantees.",
|
|
653
|
+
experimental: "It may change shape or disappear without notice."
|
|
654
|
+
};
|
|
655
|
+
function defaultLogStabilityNotice({
|
|
656
|
+
methodName,
|
|
657
|
+
stability
|
|
658
|
+
}) {
|
|
659
|
+
if (stability === "stable") return;
|
|
660
|
+
logStabilityNotice(
|
|
661
|
+
`${methodName}() is a ${stability} API. ${STABILITY_NOTICE_DETAILS[stability]}`
|
|
662
|
+
);
|
|
663
|
+
}
|
|
625
664
|
var CORE_OPTIONS_ID = "kitcore/coreOptions";
|
|
626
665
|
function resolveCoreOptions(context) {
|
|
627
666
|
const entry = context.plugins?.[CORE_OPTIONS_ID];
|
|
@@ -668,6 +707,18 @@ function signalDeprecation(context, methodName, getDeprecation) {
|
|
|
668
707
|
const handler = resolveCoreOptions(context)?.logDeprecation ?? defaultLogDeprecation;
|
|
669
708
|
runIsolatedObserver(() => handler(warning));
|
|
670
709
|
}
|
|
710
|
+
function signalStability(context, methodName, getStability) {
|
|
711
|
+
if (isInsideObserver()) return;
|
|
712
|
+
const stability = getStability?.();
|
|
713
|
+
if (!stability || stability === "stable") return;
|
|
714
|
+
const notice = {
|
|
715
|
+
type: "stability",
|
|
716
|
+
methodName,
|
|
717
|
+
stability
|
|
718
|
+
};
|
|
719
|
+
const handler = resolveCoreOptions(context)?.logStabilityNotice ?? defaultLogStabilityNotice;
|
|
720
|
+
runIsolatedObserver(() => handler(notice));
|
|
721
|
+
}
|
|
671
722
|
function normalizeError(error, adaptError) {
|
|
672
723
|
if (error instanceof Error) return error;
|
|
673
724
|
const message = typeof error === "object" && error !== null && "message" in error && typeof error.message === "string" ? error.message : String(error);
|
|
@@ -681,7 +732,7 @@ function normalizeError(error, adaptError) {
|
|
|
681
732
|
);
|
|
682
733
|
}
|
|
683
734
|
function createFunction(coreFn, options) {
|
|
684
|
-
const { sdk, schema, name, annotator, getDeprecation } = options;
|
|
735
|
+
const { sdk, schema, name, annotator, getDeprecation, getStability } = options;
|
|
685
736
|
const functionName = name || coreFn.name;
|
|
686
737
|
const namedFunctions = {
|
|
687
738
|
[functionName]: async function(callOptions) {
|
|
@@ -689,6 +740,7 @@ function createFunction(coreFn, options) {
|
|
|
689
740
|
const context = resolveCallContext(internal);
|
|
690
741
|
if (!isCallContext(internal) && internal !== INTERNAL_CALL) {
|
|
691
742
|
signalDeprecation(sdk.context, functionName, getDeprecation);
|
|
743
|
+
signalStability(sdk.context, functionName, getStability);
|
|
692
744
|
}
|
|
693
745
|
return runInMethodScope(async () => {
|
|
694
746
|
const startTime = Date.now();
|
|
@@ -755,12 +807,21 @@ function createFunction(coreFn, options) {
|
|
|
755
807
|
return namedFunctions[functionName];
|
|
756
808
|
}
|
|
757
809
|
function createRawFunction(coreFn, options) {
|
|
758
|
-
const {
|
|
810
|
+
const {
|
|
811
|
+
sdk,
|
|
812
|
+
name,
|
|
813
|
+
schema,
|
|
814
|
+
positional,
|
|
815
|
+
annotator,
|
|
816
|
+
getDeprecation,
|
|
817
|
+
getStability
|
|
818
|
+
} = options;
|
|
759
819
|
return function(rawInput) {
|
|
760
820
|
const internal = arguments[1];
|
|
761
821
|
const context = resolveCallContext(internal);
|
|
762
822
|
if (!isCallContext(internal) && internal !== INTERNAL_CALL) {
|
|
763
823
|
signalDeprecation(sdk.context, name, getDeprecation);
|
|
824
|
+
signalStability(sdk.context, name, getStability);
|
|
764
825
|
}
|
|
765
826
|
return runInMethodScope(() => {
|
|
766
827
|
const startTime = Date.now();
|
|
@@ -866,7 +927,8 @@ function createPaginatedFunction(coreFn, options) {
|
|
|
866
927
|
adaptPage,
|
|
867
928
|
annotator,
|
|
868
929
|
finalizePage,
|
|
869
|
-
getDeprecation
|
|
930
|
+
getDeprecation,
|
|
931
|
+
getStability
|
|
870
932
|
} = options;
|
|
871
933
|
const pageFunction = createPageFunction(coreFn, {
|
|
872
934
|
sdk,
|
|
@@ -880,6 +942,7 @@ function createPaginatedFunction(coreFn, options) {
|
|
|
880
942
|
const context = resolveCallContext(internal);
|
|
881
943
|
if (!isCallContext(internal) && internal !== INTERNAL_CALL) {
|
|
882
944
|
signalDeprecation(sdk.context, functionName, getDeprecation);
|
|
945
|
+
signalStability(sdk.context, functionName, getStability);
|
|
883
946
|
}
|
|
884
947
|
return runInMethodScope(() => {
|
|
885
948
|
const startTime = Date.now();
|
|
@@ -1318,6 +1381,7 @@ var LEAF_META_KEYS = [
|
|
|
1318
1381
|
"returnType",
|
|
1319
1382
|
"outputSchema",
|
|
1320
1383
|
"packages",
|
|
1384
|
+
"stability",
|
|
1321
1385
|
"experimental",
|
|
1322
1386
|
"confirm",
|
|
1323
1387
|
"deprecation",
|
|
@@ -2543,7 +2607,8 @@ function buildMethodEntries(descriptors, context, states) {
|
|
|
2543
2607
|
// (item mode's sibling); dropped paths surface as `[].x` in the page's
|
|
2544
2608
|
// `meta`, unioned across items.
|
|
2545
2609
|
finalizePage: (page) => applyListOutputPolicy(page, outputPolicy()),
|
|
2546
|
-
getDeprecation: () => entry.meta?.deprecation
|
|
2610
|
+
getDeprecation: () => entry.meta?.deprecation,
|
|
2611
|
+
getStability: () => entry.meta ? normalizeStability(entry.meta) : void 0
|
|
2547
2612
|
}
|
|
2548
2613
|
);
|
|
2549
2614
|
} else if (out.type === "item") {
|
|
@@ -2555,7 +2620,8 @@ function buildMethodEntries(descriptors, context, states) {
|
|
|
2555
2620
|
schema: descriptor.inputSchema,
|
|
2556
2621
|
name: descriptor.name,
|
|
2557
2622
|
annotator: boundAnnotator,
|
|
2558
|
-
getDeprecation: () => entry.meta?.deprecation
|
|
2623
|
+
getDeprecation: () => entry.meta?.deprecation,
|
|
2624
|
+
getStability: () => entry.meta ? normalizeStability(entry.meta) : void 0
|
|
2559
2625
|
}
|
|
2560
2626
|
);
|
|
2561
2627
|
} else {
|
|
@@ -2569,8 +2635,10 @@ function buildMethodEntries(descriptors, context, states) {
|
|
|
2569
2635
|
annotator: boundAnnotator,
|
|
2570
2636
|
// The boundary reads the deprecation LIVE off the entry, so a
|
|
2571
2637
|
// deprecation merged after build (defineMethodOverride, addPlugin)
|
|
2572
|
-
// fires too.
|
|
2573
|
-
|
|
2638
|
+
// fires too. Same for the stability level, normalized from the
|
|
2639
|
+
// entry meta (declared level or legacy `experimental` boolean).
|
|
2640
|
+
getDeprecation: () => entry.meta?.deprecation,
|
|
2641
|
+
getStability: () => entry.meta ? normalizeStability(entry.meta) : void 0
|
|
2574
2642
|
}
|
|
2575
2643
|
);
|
|
2576
2644
|
}
|
|
@@ -6514,7 +6582,7 @@ function parseDeprecationDate(value) {
|
|
|
6514
6582
|
}
|
|
6515
6583
|
|
|
6516
6584
|
// src/sdk-version.ts
|
|
6517
|
-
var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.
|
|
6585
|
+
var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.98.0" : void 0) || "unknown";
|
|
6518
6586
|
|
|
6519
6587
|
// src/utils/open-url.ts
|
|
6520
6588
|
var nodePrefix = "node:";
|
|
@@ -11864,14 +11932,24 @@ var ListConnectionsQuerySchema = connections.ListConnectionsQuerySchema.omit({
|
|
|
11864
11932
|
includeShared: zod.z.boolean().optional().describe(
|
|
11865
11933
|
"Include connections shared with you. By default, only your own connections are returned (owner=me). Set to true to also include shared connections."
|
|
11866
11934
|
),
|
|
11867
|
-
|
|
11935
|
+
// Filters on connection expiry. Not a mirror of a server-side status
|
|
11936
|
+
// field: the API expresses this as the is_expired filter, which we send as
|
|
11937
|
+
// false for "active", true for "expired", and omit for "all".
|
|
11938
|
+
status: zod.z.enum(["active", "expired", "all"]).optional().describe(
|
|
11939
|
+
"Filter connections by expiry: 'active' (default) returns only non-expired connections, 'expired' only expired ones, and 'all' returns both."
|
|
11940
|
+
),
|
|
11941
|
+
/** @deprecated Use `status` instead */
|
|
11868
11942
|
isExpired: zod.z.boolean().optional().describe("Filter by expired status").meta({
|
|
11869
11943
|
deprecated: true,
|
|
11870
|
-
deprecationMessage: "Use --expired instead to show only expired connections."
|
|
11944
|
+
deprecationMessage: "Use --status expired instead to show only expired connections, or --status all for both."
|
|
11871
11945
|
}),
|
|
11946
|
+
/** @deprecated Use `status` instead */
|
|
11872
11947
|
expired: zod.z.boolean().optional().describe(
|
|
11873
11948
|
"Show only expired connections (default: only non-expired connections are returned)"
|
|
11874
|
-
)
|
|
11949
|
+
).meta({
|
|
11950
|
+
deprecated: true,
|
|
11951
|
+
deprecationMessage: "Use --status expired instead to show only expired connections, or --status all for both."
|
|
11952
|
+
}),
|
|
11875
11953
|
// Override pageSize to make optional
|
|
11876
11954
|
pageSize: zod.z.number().min(1).optional().describe("Number of connections per page"),
|
|
11877
11955
|
// SDK specific property for pagination/iterable helpers
|
|
@@ -11997,10 +12075,15 @@ var listConnectionsPlugin = defineMethod({
|
|
|
11997
12075
|
if (owner) {
|
|
11998
12076
|
searchParams.owner = owner;
|
|
11999
12077
|
}
|
|
12000
|
-
|
|
12001
|
-
|
|
12002
|
-
|
|
12003
|
-
|
|
12078
|
+
const expiredFilter = input.isExpired ?? input.expired;
|
|
12079
|
+
if (input.status !== void 0 && expiredFilter !== void 0) {
|
|
12080
|
+
throw new ZapierValidationError(
|
|
12081
|
+
'The "status" option replaces "expired" and "isExpired", so it cannot be combined with either.'
|
|
12082
|
+
);
|
|
12083
|
+
}
|
|
12084
|
+
const status = input.status ?? (expiredFilter ? "expired" : "active");
|
|
12085
|
+
if (status !== "all") {
|
|
12086
|
+
searchParams.is_expired = (status === "expired").toString();
|
|
12004
12087
|
}
|
|
12005
12088
|
if (input.cursor) {
|
|
12006
12089
|
searchParams.offset = input.cursor;
|