@zapier/zapier-sdk 0.5.2 → 0.6.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 +11 -0
- package/README.md +107 -83
- package/dist/index.cjs +320 -50
- package/dist/index.d.mts +409 -340
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.mjs +320 -50
- package/dist/plugins/api/index.js +1 -1
- package/dist/plugins/findFirstAuthentication/index.d.ts.map +1 -1
- package/dist/plugins/findFirstAuthentication/index.js +1 -0
- package/dist/plugins/findUniqueAuthentication/index.d.ts.map +1 -1
- package/dist/plugins/findUniqueAuthentication/index.js +1 -0
- package/dist/plugins/getAction/index.d.ts.map +1 -1
- package/dist/plugins/getAction/index.js +1 -0
- package/dist/plugins/getAction/index.test.js +1 -1
- package/dist/plugins/getApp/index.d.ts +6 -3
- package/dist/plugins/getApp/index.d.ts.map +1 -1
- package/dist/plugins/getApp/index.js +8 -18
- package/dist/plugins/getApp/index.test.js +2 -0
- package/dist/plugins/getAuthentication/index.d.ts.map +1 -1
- package/dist/plugins/getAuthentication/index.js +1 -0
- package/dist/plugins/getAuthentication/index.test.js +12 -1
- package/dist/plugins/getProfile/index.d.ts.map +1 -1
- package/dist/plugins/getProfile/index.js +1 -0
- package/dist/plugins/listActions/index.d.ts +5 -3
- package/dist/plugins/listActions/index.d.ts.map +1 -1
- package/dist/plugins/listActions/index.js +6 -6
- package/dist/plugins/listActions/index.test.js +26 -74
- package/dist/plugins/listActions/schemas.d.ts +4 -4
- package/dist/plugins/listApps/index.d.ts.map +1 -1
- package/dist/plugins/listApps/index.js +1 -0
- package/dist/plugins/listApps/schemas.d.ts +2 -2
- package/dist/plugins/listAuthentications/index.d.ts +4 -2
- package/dist/plugins/listAuthentications/index.d.ts.map +1 -1
- package/dist/plugins/listAuthentications/index.js +9 -12
- package/dist/plugins/listAuthentications/index.test.js +33 -40
- package/dist/plugins/listAuthentications/schemas.d.ts +4 -4
- package/dist/plugins/listInputFields/index.d.ts +3 -1
- package/dist/plugins/listInputFields/index.d.ts.map +1 -1
- package/dist/plugins/listInputFields/index.js +5 -5
- package/dist/plugins/listInputFields/index.test.js +10 -8
- package/dist/plugins/listInputFields/schemas.d.ts +4 -4
- package/dist/plugins/lockVersion/index.d.ts +24 -0
- package/dist/plugins/lockVersion/index.d.ts.map +1 -0
- package/dist/plugins/lockVersion/index.js +72 -0
- package/dist/plugins/lockVersion/index.test.d.ts +2 -0
- package/dist/plugins/lockVersion/index.test.d.ts.map +1 -0
- package/dist/plugins/lockVersion/index.test.js +129 -0
- package/dist/plugins/lockVersion/schemas.d.ts +10 -0
- package/dist/plugins/lockVersion/schemas.d.ts.map +1 -0
- package/dist/plugins/lockVersion/schemas.js +6 -0
- package/dist/plugins/manifest/index.d.ts +24 -0
- package/dist/plugins/manifest/index.d.ts.map +1 -0
- package/dist/plugins/manifest/index.js +119 -0
- package/dist/plugins/manifest/index.test.d.ts +2 -0
- package/dist/plugins/manifest/index.test.d.ts.map +1 -0
- package/dist/plugins/manifest/index.test.js +331 -0
- package/dist/plugins/manifest/schemas.d.ts +64 -0
- package/dist/plugins/manifest/schemas.d.ts.map +1 -0
- package/dist/plugins/manifest/schemas.js +25 -0
- package/dist/plugins/registry/index.d.ts +9 -1
- package/dist/plugins/registry/index.d.ts.map +1 -1
- package/dist/plugins/registry/index.js +68 -3
- package/dist/plugins/request/index.d.ts.map +1 -1
- package/dist/plugins/request/index.js +1 -0
- package/dist/plugins/request/index.test.js +6 -1
- package/dist/plugins/request/schemas.d.ts +4 -4
- package/dist/plugins/runAction/index.d.ts +2 -0
- package/dist/plugins/runAction/index.d.ts.map +1 -1
- package/dist/plugins/runAction/index.js +5 -5
- package/dist/plugins/runAction/index.test.js +9 -8
- package/dist/plugins/runAction/schemas.d.ts +4 -4
- package/dist/sdk.d.ts +3 -3
- package/dist/sdk.d.ts.map +1 -1
- package/dist/sdk.js +18 -7
- package/dist/sdk.test.js +1 -1
- package/dist/types/plugin.d.ts +10 -2
- package/dist/types/plugin.d.ts.map +1 -1
- package/dist/types/sdk.d.ts +13 -2
- package/dist/types/sdk.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +0 -2
- package/src/plugins/api/index.ts +1 -1
- package/src/plugins/findFirstAuthentication/index.ts +1 -0
- package/src/plugins/findUniqueAuthentication/index.ts +1 -0
- package/src/plugins/getAction/index.test.ts +1 -1
- package/src/plugins/getAction/index.ts +1 -0
- package/src/plugins/getApp/index.test.ts +2 -0
- package/src/plugins/getApp/index.ts +12 -24
- package/src/plugins/getAuthentication/index.test.ts +13 -3
- package/src/plugins/getAuthentication/index.ts +1 -0
- package/src/plugins/getProfile/index.ts +1 -0
- package/src/plugins/listActions/index.test.ts +30 -89
- package/src/plugins/listActions/index.ts +13 -9
- package/src/plugins/listApps/index.ts +1 -0
- package/src/plugins/listAuthentications/index.test.ts +38 -47
- package/src/plugins/listAuthentications/index.ts +21 -18
- package/src/plugins/listInputFields/index.test.ts +12 -9
- package/src/plugins/listInputFields/index.ts +10 -6
- package/src/plugins/lockVersion/index.test.ts +176 -0
- package/src/plugins/lockVersion/index.ts +112 -0
- package/src/plugins/lockVersion/schemas.ts +9 -0
- package/src/plugins/manifest/index.test.ts +439 -0
- package/src/plugins/manifest/index.ts +171 -0
- package/src/plugins/manifest/schemas.ts +53 -0
- package/src/plugins/registry/index.ts +89 -8
- package/src/plugins/request/index.test.ts +8 -4
- package/src/plugins/request/index.ts +1 -0
- package/src/plugins/runAction/index.test.ts +9 -8
- package/src/plugins/runAction/index.ts +13 -7
- package/src/sdk.test.ts +1 -1
- package/src/sdk.ts +22 -7
- package/src/types/plugin.ts +14 -2
- package/src/types/sdk.ts +15 -1
- package/tsconfig.tsbuildinfo +1 -1
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAGhC,YAAY,EACV,MAAM,EACN,GAAG,EACH,IAAI,EACJ,KAAK,EACL,MAAM,EACN,qBAAqB,EACrB,WAAW,EACX,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,cAAc,EACd,uBAAuB,EACvB,WAAW,GACZ,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG1C,cAAc,QAAQ,CAAC;AAGvB,cAAc,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAGhC,YAAY,EACV,MAAM,EACN,GAAG,EACH,IAAI,EACJ,KAAK,EACL,MAAM,EACN,qBAAqB,EACrB,WAAW,EACX,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,cAAc,EACd,uBAAuB,EACvB,WAAW,GACZ,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG1C,cAAc,QAAQ,CAAC;AAGvB,cAAc,aAAa,CAAC;AAI5B,OAAO,EACL,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAGrE,YAAY,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAGzD,YAAY,EACV,MAAM,EACN,cAAc,EACd,kBAAkB,EAClB,aAAa,EACb,UAAU,EACV,GAAG,GACJ,MAAM,gBAAgB,CAAC;AAGxB,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -12,7 +12,6 @@ export { hasResolver } from "./resolvers";
|
|
|
12
12
|
export * from "./auth";
|
|
13
13
|
// Export resolvers for CLI use
|
|
14
14
|
export * from "./resolvers";
|
|
15
|
-
// Note: SdkSchemas is now available via SDK.__registry
|
|
16
15
|
// All functions now available through the plugin system via createZapierSdk()
|
|
17
16
|
// Export plugin schemas for external use
|
|
18
17
|
export { RelayRequestSchema, RelayFetchSchema, } from "./plugins/request/schemas";
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { existsSync, readFileSync, writeFileSync } from 'fs';
|
|
3
|
+
import { resolve } from 'path';
|
|
2
4
|
|
|
3
5
|
// src/types/properties.ts
|
|
4
6
|
function withFormatter(schema, formatMeta) {
|
|
@@ -525,15 +527,67 @@ var RelayFetchSchema = RelayRequestSchema;
|
|
|
525
527
|
// src/plugins/registry/index.ts
|
|
526
528
|
var registryPlugin = ({ sdk, context }) => {
|
|
527
529
|
const metaKeys = Object.keys(context.meta || {});
|
|
528
|
-
const
|
|
530
|
+
const categoryDefinitions = {
|
|
531
|
+
app: {
|
|
532
|
+
title: "App",
|
|
533
|
+
titlePlural: "Apps"
|
|
534
|
+
},
|
|
535
|
+
authentication: {
|
|
536
|
+
title: "Authentication"
|
|
537
|
+
},
|
|
538
|
+
action: {
|
|
539
|
+
title: "Action"
|
|
540
|
+
},
|
|
541
|
+
http: {
|
|
542
|
+
title: "HTTP Request"
|
|
543
|
+
},
|
|
544
|
+
user: {
|
|
545
|
+
title: "User"
|
|
546
|
+
},
|
|
547
|
+
utility: {
|
|
548
|
+
title: "Utility",
|
|
549
|
+
titlePlural: "Utilities"
|
|
550
|
+
},
|
|
551
|
+
other: {
|
|
552
|
+
title: "Other"
|
|
553
|
+
}
|
|
554
|
+
};
|
|
555
|
+
const functions = metaKeys.filter((key) => typeof sdk[key] === "function").map((key) => {
|
|
529
556
|
return {
|
|
530
557
|
...context.meta[key],
|
|
531
|
-
|
|
532
|
-
|
|
558
|
+
categories: context.meta[key].categories || [],
|
|
559
|
+
name: key
|
|
560
|
+
};
|
|
561
|
+
}).sort((a, b) => a.name.localeCompare(b.name));
|
|
562
|
+
const knownCategories = Object.keys(categoryDefinitions);
|
|
563
|
+
const categories = knownCategories.sort((a, b) => {
|
|
564
|
+
if (a === "other") return 1;
|
|
565
|
+
if (b === "other") return -1;
|
|
566
|
+
const titleA = categoryDefinitions[a].title;
|
|
567
|
+
const titleB = categoryDefinitions[b].title;
|
|
568
|
+
return titleA.localeCompare(titleB);
|
|
569
|
+
}).map((categoryKey) => {
|
|
570
|
+
const categoryFunctions = functions.filter(
|
|
571
|
+
(f) => f.categories.includes(categoryKey) || // If the category is "other" and the function is not in any other category, include it
|
|
572
|
+
categoryKey === "other" && !f.categories.some((c) => knownCategories.includes(c))
|
|
573
|
+
).map((f) => f.name).sort();
|
|
574
|
+
const definition = categoryDefinitions[categoryKey];
|
|
575
|
+
const title = definition.title;
|
|
576
|
+
return {
|
|
577
|
+
key: categoryKey,
|
|
578
|
+
title,
|
|
579
|
+
titlePlural: definition.titlePlural ?? `${title}s`,
|
|
580
|
+
functions: categoryFunctions
|
|
533
581
|
};
|
|
534
582
|
});
|
|
583
|
+
function getRegistry() {
|
|
584
|
+
return {
|
|
585
|
+
functions,
|
|
586
|
+
categories
|
|
587
|
+
};
|
|
588
|
+
}
|
|
535
589
|
return {
|
|
536
|
-
|
|
590
|
+
getRegistry
|
|
537
591
|
};
|
|
538
592
|
};
|
|
539
593
|
|
|
@@ -622,7 +676,7 @@ async function pollUntilComplete(options) {
|
|
|
622
676
|
} else if (response.status === pendingStatus) {
|
|
623
677
|
errorCount = 0;
|
|
624
678
|
if (attempt < maxAttempts - 1) {
|
|
625
|
-
await new Promise((
|
|
679
|
+
await new Promise((resolve3) => setTimeout(resolve3, delay));
|
|
626
680
|
delay = Math.min(delay * 2, maxDelay);
|
|
627
681
|
continue;
|
|
628
682
|
}
|
|
@@ -635,7 +689,7 @@ async function pollUntilComplete(options) {
|
|
|
635
689
|
);
|
|
636
690
|
}
|
|
637
691
|
if (attempt < maxAttempts - 1) {
|
|
638
|
-
await new Promise((
|
|
692
|
+
await new Promise((resolve3) => setTimeout(resolve3, delay));
|
|
639
693
|
delay = Math.min(delay * 2, maxDelay);
|
|
640
694
|
continue;
|
|
641
695
|
}
|
|
@@ -959,7 +1013,7 @@ var apiPlugin = (params) => {
|
|
|
959
1013
|
getToken,
|
|
960
1014
|
onEvent,
|
|
961
1015
|
debug = false
|
|
962
|
-
} = params;
|
|
1016
|
+
} = params.context.options;
|
|
963
1017
|
const api = createZapierApi({
|
|
964
1018
|
baseUrl,
|
|
965
1019
|
token,
|
|
@@ -1652,6 +1706,7 @@ var getProfilePlugin = ({ context }) => {
|
|
|
1652
1706
|
context: {
|
|
1653
1707
|
meta: {
|
|
1654
1708
|
getProfile: {
|
|
1709
|
+
categories: ["user"],
|
|
1655
1710
|
inputSchema: GetProfileSchema
|
|
1656
1711
|
}
|
|
1657
1712
|
}
|
|
@@ -1706,6 +1761,16 @@ function splitVersionedKey(versionedKey) {
|
|
|
1706
1761
|
}
|
|
1707
1762
|
return [versionedKey, void 0];
|
|
1708
1763
|
}
|
|
1764
|
+
function normalizeImplementationToAppItem(implementation) {
|
|
1765
|
+
const [selectedApi, appVersion] = implementation.selected_api ? splitVersionedKey(implementation.selected_api) : [implementation.selected_api || "", void 0];
|
|
1766
|
+
return {
|
|
1767
|
+
title: implementation.name || selectedApi,
|
|
1768
|
+
key: selectedApi,
|
|
1769
|
+
current_implementation_id: implementation.selected_api || "",
|
|
1770
|
+
version: appVersion
|
|
1771
|
+
// Extract version separately
|
|
1772
|
+
};
|
|
1773
|
+
}
|
|
1709
1774
|
function normalizeImplementationMetaToAppItem(implementationMeta) {
|
|
1710
1775
|
const [selectedApi, appVersion] = splitVersionedKey(implementationMeta.id);
|
|
1711
1776
|
return {
|
|
@@ -1891,6 +1956,7 @@ var listAppsPlugin = ({ context }) => {
|
|
|
1891
1956
|
context: {
|
|
1892
1957
|
meta: {
|
|
1893
1958
|
listApps: {
|
|
1959
|
+
categories: ["app"],
|
|
1894
1960
|
inputSchema: ListAppsSchema
|
|
1895
1961
|
}
|
|
1896
1962
|
}
|
|
@@ -1907,23 +1973,16 @@ var GetAppSchema = withOutputSchema(
|
|
|
1907
1973
|
);
|
|
1908
1974
|
|
|
1909
1975
|
// src/plugins/getApp/index.ts
|
|
1910
|
-
var getAppPlugin = ({
|
|
1976
|
+
var getAppPlugin = ({ context }) => {
|
|
1911
1977
|
const getApp = createFunction(async function getApp2(options) {
|
|
1912
|
-
const
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
const apps = [];
|
|
1918
|
-
for await (const app of appsIterator) {
|
|
1919
|
-
apps.push(app);
|
|
1920
|
-
break;
|
|
1921
|
-
}
|
|
1922
|
-
if (apps.length === 0) {
|
|
1923
|
-
throw new ZapierAppNotFoundError(appKey);
|
|
1978
|
+
const app = await context.getImplementation(options.appKey);
|
|
1979
|
+
if (!app) {
|
|
1980
|
+
throw new ZapierAppNotFoundError("App not found", {
|
|
1981
|
+
appKey: options.appKey
|
|
1982
|
+
});
|
|
1924
1983
|
}
|
|
1925
1984
|
return {
|
|
1926
|
-
data:
|
|
1985
|
+
data: app
|
|
1927
1986
|
};
|
|
1928
1987
|
}, GetAppSchema);
|
|
1929
1988
|
return {
|
|
@@ -1931,6 +1990,7 @@ var getAppPlugin = ({ sdk }) => {
|
|
|
1931
1990
|
context: {
|
|
1932
1991
|
meta: {
|
|
1933
1992
|
getApp: {
|
|
1993
|
+
categories: ["app"],
|
|
1934
1994
|
inputSchema: GetAppSchema
|
|
1935
1995
|
}
|
|
1936
1996
|
}
|
|
@@ -1989,12 +2049,11 @@ var ListActionsSchema = withOutputSchema(
|
|
|
1989
2049
|
);
|
|
1990
2050
|
|
|
1991
2051
|
// src/plugins/listActions/index.ts
|
|
1992
|
-
var listActionsPlugin = ({
|
|
2052
|
+
var listActionsPlugin = ({ context }) => {
|
|
1993
2053
|
const listActions = createPaginatedFunction(async function listActionsPage(options) {
|
|
1994
|
-
const { api } = context;
|
|
1995
|
-
const
|
|
1996
|
-
|
|
1997
|
-
if (!implementationId) {
|
|
2054
|
+
const { api, getVersionedImplementationId } = context;
|
|
2055
|
+
const selectedApi = await getVersionedImplementationId(options.appKey);
|
|
2056
|
+
if (!selectedApi) {
|
|
1998
2057
|
throw new ZapierConfigurationError(
|
|
1999
2058
|
"No current_implementation_id found for app",
|
|
2000
2059
|
{ configType: "current_implementation_id" }
|
|
@@ -2003,7 +2062,7 @@ var listActionsPlugin = ({ sdk, context }) => {
|
|
|
2003
2062
|
const searchParams = {
|
|
2004
2063
|
global: "true",
|
|
2005
2064
|
public_only: "true",
|
|
2006
|
-
selected_apis:
|
|
2065
|
+
selected_apis: selectedApi
|
|
2007
2066
|
};
|
|
2008
2067
|
const data = await api.get(
|
|
2009
2068
|
"/api/v4/implementations/",
|
|
@@ -2053,6 +2112,7 @@ var listActionsPlugin = ({ sdk, context }) => {
|
|
|
2053
2112
|
context: {
|
|
2054
2113
|
meta: {
|
|
2055
2114
|
listActions: {
|
|
2115
|
+
categories: ["action"],
|
|
2056
2116
|
inputSchema: ListActionsSchema
|
|
2057
2117
|
}
|
|
2058
2118
|
}
|
|
@@ -2085,6 +2145,7 @@ var getActionPlugin = ({ sdk }) => {
|
|
|
2085
2145
|
context: {
|
|
2086
2146
|
meta: {
|
|
2087
2147
|
getAction: {
|
|
2148
|
+
categories: ["action"],
|
|
2088
2149
|
inputSchema: GetActionSchema
|
|
2089
2150
|
}
|
|
2090
2151
|
}
|
|
@@ -2107,15 +2168,14 @@ var RunActionSchema = z.object({
|
|
|
2107
2168
|
async function executeAction(actionOptions) {
|
|
2108
2169
|
const {
|
|
2109
2170
|
api,
|
|
2110
|
-
|
|
2171
|
+
context,
|
|
2111
2172
|
appKey,
|
|
2112
2173
|
actionKey,
|
|
2113
2174
|
actionType,
|
|
2114
2175
|
executionOptions,
|
|
2115
2176
|
authenticationId
|
|
2116
2177
|
} = actionOptions;
|
|
2117
|
-
const
|
|
2118
|
-
const selectedApi = appData.data.current_implementation_id;
|
|
2178
|
+
const selectedApi = await context.getVersionedImplementationId(appKey);
|
|
2119
2179
|
if (!selectedApi) {
|
|
2120
2180
|
throw new ZapierConfigurationError(
|
|
2121
2181
|
"No current_implementation_id found for app",
|
|
@@ -2167,7 +2227,7 @@ var runActionPlugin = ({ sdk, context }) => {
|
|
|
2167
2227
|
}
|
|
2168
2228
|
const result = await executeAction({
|
|
2169
2229
|
api,
|
|
2170
|
-
|
|
2230
|
+
context,
|
|
2171
2231
|
appKey,
|
|
2172
2232
|
actionKey,
|
|
2173
2233
|
actionType,
|
|
@@ -2193,6 +2253,7 @@ var runActionPlugin = ({ sdk, context }) => {
|
|
|
2193
2253
|
context: {
|
|
2194
2254
|
meta: {
|
|
2195
2255
|
runAction: {
|
|
2256
|
+
categories: ["action"],
|
|
2196
2257
|
inputSchema: RunActionSchema
|
|
2197
2258
|
}
|
|
2198
2259
|
}
|
|
@@ -2212,19 +2273,18 @@ var ListAuthenticationsSchema = z.object({
|
|
|
2212
2273
|
}).describe("List available authentications with optional filtering");
|
|
2213
2274
|
|
|
2214
2275
|
// src/plugins/listAuthentications/index.ts
|
|
2215
|
-
var listAuthenticationsPlugin = ({
|
|
2276
|
+
var listAuthenticationsPlugin = ({ context }) => {
|
|
2216
2277
|
const listAuthentications = createPaginatedFunction(
|
|
2217
2278
|
async function listAuthenticationsPage(options) {
|
|
2218
|
-
const { api } = context;
|
|
2279
|
+
const { api, getVersionedImplementationId } = context;
|
|
2219
2280
|
const searchParams = {};
|
|
2220
2281
|
if (options.appKey) {
|
|
2221
|
-
const
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
searchParams.versionless_selected_api = versionlessApi;
|
|
2282
|
+
const implementationId = await getVersionedImplementationId(
|
|
2283
|
+
options.appKey
|
|
2284
|
+
);
|
|
2285
|
+
if (implementationId) {
|
|
2286
|
+
const [versionlessSelectedApi] = splitVersionedKey(implementationId);
|
|
2287
|
+
searchParams.versionless_selected_api = versionlessSelectedApi;
|
|
2228
2288
|
}
|
|
2229
2289
|
}
|
|
2230
2290
|
if (options.search) {
|
|
@@ -2242,6 +2302,7 @@ var listAuthenticationsPlugin = ({ sdk, context }) => {
|
|
|
2242
2302
|
if (options.cursor) {
|
|
2243
2303
|
searchParams.offset = options.cursor;
|
|
2244
2304
|
}
|
|
2305
|
+
console.log({ searchParams });
|
|
2245
2306
|
const data = await api.get(
|
|
2246
2307
|
"/api/v4/authentications/",
|
|
2247
2308
|
{
|
|
@@ -2282,6 +2343,7 @@ var listAuthenticationsPlugin = ({ sdk, context }) => {
|
|
|
2282
2343
|
context: {
|
|
2283
2344
|
meta: {
|
|
2284
2345
|
listAuthentications: {
|
|
2346
|
+
categories: ["authentication"],
|
|
2285
2347
|
inputSchema: ListAuthenticationsSchema
|
|
2286
2348
|
}
|
|
2287
2349
|
}
|
|
@@ -2336,6 +2398,7 @@ var getAuthenticationPlugin = ({ context }) => {
|
|
|
2336
2398
|
context: {
|
|
2337
2399
|
meta: {
|
|
2338
2400
|
getAuthentication: {
|
|
2401
|
+
categories: ["authentication"],
|
|
2339
2402
|
inputSchema: GetAuthenticationSchema
|
|
2340
2403
|
}
|
|
2341
2404
|
}
|
|
@@ -2371,6 +2434,7 @@ var findFirstAuthenticationPlugin = ({ sdk }) => {
|
|
|
2371
2434
|
context: {
|
|
2372
2435
|
meta: {
|
|
2373
2436
|
findFirstAuthentication: {
|
|
2437
|
+
categories: ["authentication"],
|
|
2374
2438
|
inputSchema: FindFirstAuthenticationSchema
|
|
2375
2439
|
}
|
|
2376
2440
|
}
|
|
@@ -2418,6 +2482,7 @@ var findUniqueAuthenticationPlugin = ({ sdk }) => {
|
|
|
2418
2482
|
context: {
|
|
2419
2483
|
meta: {
|
|
2420
2484
|
findUniqueAuthentication: {
|
|
2485
|
+
categories: ["authentication"],
|
|
2421
2486
|
inputSchema: FindUniqueAuthenticationSchema
|
|
2422
2487
|
}
|
|
2423
2488
|
}
|
|
@@ -2494,13 +2559,12 @@ function transformNeedToInputFieldItem(need) {
|
|
|
2494
2559
|
items: itemsType ? { type: itemsType } : void 0
|
|
2495
2560
|
};
|
|
2496
2561
|
}
|
|
2497
|
-
var listInputFieldsPlugin = ({
|
|
2562
|
+
var listInputFieldsPlugin = ({ context }) => {
|
|
2498
2563
|
const listInputFields = createPaginatedFunction(
|
|
2499
2564
|
async function listInputFieldsPage(options) {
|
|
2500
|
-
const { api } = context;
|
|
2565
|
+
const { api, getVersionedImplementationId } = context;
|
|
2501
2566
|
const { appKey, actionKey, actionType, authenticationId, inputs } = options;
|
|
2502
|
-
const
|
|
2503
|
-
const selectedApi = appData.data.current_implementation_id;
|
|
2567
|
+
const selectedApi = await getVersionedImplementationId(appKey);
|
|
2504
2568
|
if (!selectedApi) {
|
|
2505
2569
|
throw new ZapierConfigurationError(
|
|
2506
2570
|
"No current_implementation_id found for app",
|
|
@@ -2541,6 +2605,7 @@ var listInputFieldsPlugin = ({ sdk, context }) => {
|
|
|
2541
2605
|
context: {
|
|
2542
2606
|
meta: {
|
|
2543
2607
|
listInputFields: {
|
|
2608
|
+
categories: ["action"],
|
|
2544
2609
|
inputSchema: ListInputFieldsSchema
|
|
2545
2610
|
}
|
|
2546
2611
|
}
|
|
@@ -2594,32 +2659,237 @@ var requestPlugin = ({ context }) => {
|
|
|
2594
2659
|
context: {
|
|
2595
2660
|
meta: {
|
|
2596
2661
|
request: {
|
|
2662
|
+
categories: ["http"],
|
|
2597
2663
|
inputSchema: RelayRequestSchema
|
|
2598
2664
|
}
|
|
2599
2665
|
}
|
|
2600
2666
|
}
|
|
2601
2667
|
};
|
|
2602
2668
|
};
|
|
2669
|
+
var ManifestSchema = z.object({
|
|
2670
|
+
apps: z.record(
|
|
2671
|
+
z.string(),
|
|
2672
|
+
z.object({
|
|
2673
|
+
implementationName: z.string().describe(
|
|
2674
|
+
"Base implementation name without version (e.g., 'SlackCLIAPI')"
|
|
2675
|
+
),
|
|
2676
|
+
version: z.string().describe("Version string (e.g., '1.21.1')")
|
|
2677
|
+
})
|
|
2678
|
+
)
|
|
2679
|
+
}).describe("Manifest mapping app keys to version information");
|
|
2680
|
+
z.object({
|
|
2681
|
+
manifestPath: z.string().optional().describe("Path to manifest file"),
|
|
2682
|
+
manifest: z.record(
|
|
2683
|
+
z.string(),
|
|
2684
|
+
z.object({
|
|
2685
|
+
implementationName: z.string(),
|
|
2686
|
+
version: z.string().optional()
|
|
2687
|
+
})
|
|
2688
|
+
).optional().describe("Direct manifest object")
|
|
2689
|
+
});
|
|
2690
|
+
|
|
2691
|
+
// src/plugins/manifest/index.ts
|
|
2692
|
+
function parseManifestContent(content, source) {
|
|
2693
|
+
try {
|
|
2694
|
+
const parsed = JSON.parse(content);
|
|
2695
|
+
if (parsed?.apps && typeof parsed?.apps === "object") {
|
|
2696
|
+
const result = ManifestSchema.safeParse(parsed);
|
|
2697
|
+
if (result.success) {
|
|
2698
|
+
return result.data;
|
|
2699
|
+
}
|
|
2700
|
+
console.warn(`\u26A0\uFE0F Invalid manifest format in ${source}: ${result.error}`);
|
|
2701
|
+
}
|
|
2702
|
+
return null;
|
|
2703
|
+
} catch (error) {
|
|
2704
|
+
console.warn(`\u26A0\uFE0F Failed to parse manifest from ${source}:`, error);
|
|
2705
|
+
return null;
|
|
2706
|
+
}
|
|
2707
|
+
}
|
|
2708
|
+
function loadManifestFromFile(filePath) {
|
|
2709
|
+
try {
|
|
2710
|
+
const resolvedPath = resolve(filePath);
|
|
2711
|
+
const content = readFileSync(resolvedPath, "utf8");
|
|
2712
|
+
return parseManifestContent(content, resolvedPath);
|
|
2713
|
+
} catch (error) {
|
|
2714
|
+
console.warn(`\u26A0\uFE0F Failed to load manifest from ${filePath}:`, error);
|
|
2715
|
+
return null;
|
|
2716
|
+
}
|
|
2717
|
+
}
|
|
2718
|
+
var emitWarning = (appKey) => {
|
|
2719
|
+
console.warn(
|
|
2720
|
+
`
|
|
2721
|
+
${"\u26A0\uFE0F".padEnd(3)} ${"WARNING".padEnd(8)} No manifest version found for '${appKey}'`
|
|
2722
|
+
);
|
|
2723
|
+
console.warn(
|
|
2724
|
+
` ${"\u21B3".padEnd(3)} Using a manifest ensures version locking and prevents unexpected behavior due to version changes.`
|
|
2725
|
+
);
|
|
2726
|
+
console.warn(
|
|
2727
|
+
` ${"\u21B3".padEnd(3)} Generate/update the manifest with: \`zapier-sdk update-manifest ${appKey}\`
|
|
2728
|
+
`
|
|
2729
|
+
);
|
|
2730
|
+
};
|
|
2731
|
+
var manifestPlugin = (params) => {
|
|
2732
|
+
const { sdk, context } = params;
|
|
2733
|
+
const { api, options } = context;
|
|
2734
|
+
const { manifestPath = ".zapierrc", manifest } = options || {};
|
|
2735
|
+
const resolvedManifest = (() => {
|
|
2736
|
+
if (manifest) {
|
|
2737
|
+
return manifest;
|
|
2738
|
+
}
|
|
2739
|
+
if (manifestPath) {
|
|
2740
|
+
return loadManifestFromFile(manifestPath);
|
|
2741
|
+
}
|
|
2742
|
+
return null;
|
|
2743
|
+
})();
|
|
2744
|
+
const getManifestEntry = (appKey) => {
|
|
2745
|
+
return resolvedManifest?.apps?.[appKey] || null;
|
|
2746
|
+
};
|
|
2747
|
+
const getImplementation = async (appKey) => {
|
|
2748
|
+
let selectedApi = null;
|
|
2749
|
+
const manifestImplementation = resolvedManifest?.apps?.[appKey];
|
|
2750
|
+
const [versionlessAppKey, version] = splitVersionedKey(appKey);
|
|
2751
|
+
if (version) {
|
|
2752
|
+
selectedApi = `${versionlessAppKey}@${version}`;
|
|
2753
|
+
} else if (manifestImplementation) {
|
|
2754
|
+
selectedApi = `${manifestImplementation.implementationName}@${manifestImplementation.version || "latest"}`;
|
|
2755
|
+
}
|
|
2756
|
+
if (selectedApi) {
|
|
2757
|
+
const searchParams = {
|
|
2758
|
+
selected_apis: selectedApi
|
|
2759
|
+
};
|
|
2760
|
+
const implementationData = await api.get(
|
|
2761
|
+
"/api/v4/implementations/",
|
|
2762
|
+
{
|
|
2763
|
+
searchParams
|
|
2764
|
+
}
|
|
2765
|
+
);
|
|
2766
|
+
const implementationResults = implementationData.results[0];
|
|
2767
|
+
if (!implementationResults) return null;
|
|
2768
|
+
return normalizeImplementationToAppItem(implementationResults);
|
|
2769
|
+
}
|
|
2770
|
+
emitWarning(appKey);
|
|
2771
|
+
const appsIterator = sdk.listApps({ appKeys: [appKey] }).items();
|
|
2772
|
+
const apps = [];
|
|
2773
|
+
for await (const app2 of appsIterator) {
|
|
2774
|
+
apps.push(app2);
|
|
2775
|
+
break;
|
|
2776
|
+
}
|
|
2777
|
+
if (apps.length === 0) {
|
|
2778
|
+
return null;
|
|
2779
|
+
}
|
|
2780
|
+
const app = apps[0];
|
|
2781
|
+
return app;
|
|
2782
|
+
};
|
|
2783
|
+
const getVersionedImplementationId = async (appKey) => {
|
|
2784
|
+
const manifestEntry = getManifestEntry(appKey);
|
|
2785
|
+
if (manifestEntry) {
|
|
2786
|
+
return `${manifestEntry.implementationName}@${manifestEntry.version || "latest"}`;
|
|
2787
|
+
}
|
|
2788
|
+
const implementation = await getImplementation(appKey);
|
|
2789
|
+
if (!implementation) return null;
|
|
2790
|
+
return implementation.current_implementation_id;
|
|
2791
|
+
};
|
|
2792
|
+
return {
|
|
2793
|
+
context: {
|
|
2794
|
+
manifest: resolvedManifest,
|
|
2795
|
+
getVersionedImplementationId,
|
|
2796
|
+
getManifestEntry,
|
|
2797
|
+
getImplementation
|
|
2798
|
+
}
|
|
2799
|
+
};
|
|
2800
|
+
};
|
|
2801
|
+
var LockVersionSchema = z.object({
|
|
2802
|
+
appKey: z.string().describe("The app key to lock version for (e.g., 'slack', 'gmail')")
|
|
2803
|
+
});
|
|
2804
|
+
var lockVersionPlugin = ({ sdk }) => {
|
|
2805
|
+
const lockVersion = createFunction(
|
|
2806
|
+
async function lockVersion2(options) {
|
|
2807
|
+
const { appKey, configPath = ".zapierrc" } = options;
|
|
2808
|
+
const resolvedPath = resolve(configPath);
|
|
2809
|
+
const appsIterator = sdk.listApps({ appKeys: [appKey] }).items();
|
|
2810
|
+
const apps = [];
|
|
2811
|
+
for await (const app2 of appsIterator) {
|
|
2812
|
+
apps.push(app2);
|
|
2813
|
+
break;
|
|
2814
|
+
}
|
|
2815
|
+
const app = apps[0];
|
|
2816
|
+
const currentImplementationId = app.current_implementation_id;
|
|
2817
|
+
const [implementationName, version] = currentImplementationId.split("@");
|
|
2818
|
+
if (!implementationName || !version) {
|
|
2819
|
+
throw new Error(
|
|
2820
|
+
`Invalid implementation ID format: ${currentImplementationId}. Expected format: <implementationName>@<version>`
|
|
2821
|
+
);
|
|
2822
|
+
}
|
|
2823
|
+
let config = { apps: {} };
|
|
2824
|
+
if (existsSync(resolvedPath)) {
|
|
2825
|
+
try {
|
|
2826
|
+
const configContent = readFileSync(resolvedPath, "utf8");
|
|
2827
|
+
config = JSON.parse(configContent);
|
|
2828
|
+
if (!config.apps) {
|
|
2829
|
+
config.apps = {};
|
|
2830
|
+
}
|
|
2831
|
+
} catch (error) {
|
|
2832
|
+
console.warn(
|
|
2833
|
+
`\u26A0\uFE0F Failed to parse existing config file, creating new one: ${error}`
|
|
2834
|
+
);
|
|
2835
|
+
config = { apps: {} };
|
|
2836
|
+
}
|
|
2837
|
+
}
|
|
2838
|
+
config.apps[appKey] = {
|
|
2839
|
+
implementationName,
|
|
2840
|
+
version
|
|
2841
|
+
};
|
|
2842
|
+
writeFileSync(resolvedPath, JSON.stringify(config, null, 2));
|
|
2843
|
+
return {
|
|
2844
|
+
data: {
|
|
2845
|
+
...app,
|
|
2846
|
+
implementationName,
|
|
2847
|
+
version
|
|
2848
|
+
},
|
|
2849
|
+
configPath: resolvedPath
|
|
2850
|
+
};
|
|
2851
|
+
},
|
|
2852
|
+
LockVersionSchema.extend({
|
|
2853
|
+
configPath: z.string().optional().describe("Path to .zapierrc file (defaults to '.zapierrc')")
|
|
2854
|
+
})
|
|
2855
|
+
);
|
|
2856
|
+
return {
|
|
2857
|
+
lockVersion,
|
|
2858
|
+
context: {
|
|
2859
|
+
meta: {
|
|
2860
|
+
lockVersion: {
|
|
2861
|
+
categories: ["utility"],
|
|
2862
|
+
inputSchema: LockVersionSchema
|
|
2863
|
+
}
|
|
2864
|
+
}
|
|
2865
|
+
}
|
|
2866
|
+
};
|
|
2867
|
+
};
|
|
2603
2868
|
|
|
2604
2869
|
// src/sdk.ts
|
|
2605
|
-
function createSdk(initialSdk = {}, initialContext = { meta: {} }) {
|
|
2870
|
+
function createSdk(options = {}, initialSdk = {}, initialContext = { meta: {} }) {
|
|
2606
2871
|
return {
|
|
2607
2872
|
...initialSdk,
|
|
2608
2873
|
getContext: () => initialContext,
|
|
2609
|
-
addPlugin(plugin,
|
|
2874
|
+
addPlugin(plugin, addPluginOptions = {}) {
|
|
2610
2875
|
const currentSdkWithContext = {
|
|
2611
2876
|
...initialSdk,
|
|
2612
2877
|
getContext: () => initialContext
|
|
2613
2878
|
};
|
|
2614
2879
|
const pluginResult = plugin({
|
|
2615
2880
|
sdk: currentSdkWithContext,
|
|
2616
|
-
context:
|
|
2617
|
-
|
|
2881
|
+
context: {
|
|
2882
|
+
...initialContext,
|
|
2883
|
+
// Add the options that createSdk was called with to context
|
|
2884
|
+
options
|
|
2885
|
+
},
|
|
2886
|
+
...addPluginOptions
|
|
2618
2887
|
});
|
|
2619
2888
|
const { context: pluginContext, ...sdkProperties } = pluginResult;
|
|
2620
2889
|
const newSdk = { ...initialSdk, ...sdkProperties };
|
|
2621
2890
|
let newContext = {
|
|
2622
2891
|
...initialContext,
|
|
2892
|
+
...addPluginOptions,
|
|
2623
2893
|
meta: initialContext.meta || {}
|
|
2624
2894
|
};
|
|
2625
2895
|
if (pluginContext) {
|
|
@@ -2640,12 +2910,12 @@ function createSdk(initialSdk = {}, initialContext = { meta: {} }) {
|
|
|
2640
2910
|
};
|
|
2641
2911
|
}
|
|
2642
2912
|
}
|
|
2643
|
-
return createSdk(newSdk, newContext);
|
|
2913
|
+
return createSdk(options, newSdk, newContext);
|
|
2644
2914
|
}
|
|
2645
2915
|
};
|
|
2646
2916
|
}
|
|
2647
2917
|
function createZapierSdk(options = {}) {
|
|
2648
|
-
return createSdk().addPlugin(apiPlugin
|
|
2918
|
+
return createSdk(options).addPlugin(apiPlugin).addPlugin(listAppsPlugin).addPlugin(manifestPlugin).addPlugin(getAppPlugin).addPlugin(listActionsPlugin).addPlugin(getActionPlugin).addPlugin(listInputFieldsPlugin).addPlugin(runActionPlugin).addPlugin(lockVersionPlugin).addPlugin(listAuthenticationsPlugin).addPlugin(getAuthenticationPlugin).addPlugin(findFirstAuthenticationPlugin).addPlugin(findUniqueAuthenticationPlugin).addPlugin(requestPlugin).addPlugin(fetchPlugin).addPlugin(appsPlugin).addPlugin(getProfilePlugin).addPlugin(registryPlugin);
|
|
2649
2919
|
}
|
|
2650
2920
|
|
|
2651
2921
|
export { ActionKeyPropertySchema, ActionTypePropertySchema, AppKeyPropertySchema, AuthenticationIdPropertySchema, DebugPropertySchema, InputsPropertySchema, LimitPropertySchema, OffsetPropertySchema, OutputPropertySchema, ParamsPropertySchema, RelayFetchSchema, RelayRequestSchema, ZapierActionError, ZapierApiError, ZapierAppNotFoundError, ZapierAuthenticationError, ZapierBundleError, ZapierConfigurationError, ZapierError, ZapierNotFoundError, ZapierResourceNotFoundError, ZapierTimeoutError, ZapierUnknownError, ZapierValidationError, actionKeyResolver, actionTypeResolver, appKeyResolver, appsPlugin, authenticationIdResolver, createSdk, createZapierSdk, fetchPlugin, formatErrorMessage, getResolutionOrder, getResolutionOrderForParams, getResolvableParams, getResolver, getResolversForMissingParams, getTokenFromCliLogin, getTokenFromEnv, getTokenFromEnvOrConfig, hasResolver, inputsResolver, isPositional, resolverRegistry };
|
|
@@ -2,7 +2,7 @@ import { createZapierApi } from "../../api";
|
|
|
2
2
|
// API plugin requires no context and provides api in context
|
|
3
3
|
export const apiPlugin = (params) => {
|
|
4
4
|
// Extract all options - everything passed to the plugin
|
|
5
|
-
const { fetch: customFetch = globalThis.fetch, baseUrl = "https://zapier.com", token, getToken, onEvent, debug = false, } = params;
|
|
5
|
+
const { fetch: customFetch = globalThis.fetch, baseUrl = "https://zapier.com", token, getToken, onEvent, debug = false, } = params.context.options;
|
|
6
6
|
// Create the API client - it will handle token resolution internally
|
|
7
7
|
const api = createZapierApi({
|
|
8
8
|
baseUrl,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/findFirstAuthentication/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EACL,6BAA6B,EAC7B,KAAK,8BAA8B,EACpC,MAAM,WAAW,CAAC;AAEnB,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,wBAAwB,CAAC;AAEhF,MAAM,WAAW,qCAAqC;IACpD,uBAAuB,EAAE,CACvB,OAAO,CAAC,EAAE,8BAA8B,KACrC,OAAO,CAAC;QAAE,IAAI,EAAE,kBAAkB,GAAG,IAAI,CAAA;KAAE,CAAC,CAAC;IAClD,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,uBAAuB,EAAE;gBACvB,WAAW,EAAE,OAAO,6BAA6B,CAAC;aACnD,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,6BAA6B,EAAE,MAAM,CAChD,UAAU,CAAC,iCAAiC,CAAC,EAAE,sCAAsC;AACrF,EAAE,EAAE,0BAA0B;AAC9B,qCAAqC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/findFirstAuthentication/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EACL,6BAA6B,EAC7B,KAAK,8BAA8B,EACpC,MAAM,WAAW,CAAC;AAEnB,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,wBAAwB,CAAC;AAEhF,MAAM,WAAW,qCAAqC;IACpD,uBAAuB,EAAE,CACvB,OAAO,CAAC,EAAE,8BAA8B,KACrC,OAAO,CAAC;QAAE,IAAI,EAAE,kBAAkB,GAAG,IAAI,CAAA;KAAE,CAAC,CAAC;IAClD,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,uBAAuB,EAAE;gBACvB,WAAW,EAAE,OAAO,6BAA6B,CAAC;aACnD,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,6BAA6B,EAAE,MAAM,CAChD,UAAU,CAAC,iCAAiC,CAAC,EAAE,sCAAsC;AACrF,EAAE,EAAE,0BAA0B;AAC9B,qCAAqC,CA8BtC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/findUniqueAuthentication/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EACL,8BAA8B,EAC9B,KAAK,+BAA+B,EACrC,MAAM,WAAW,CAAC;AAMnB,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,wBAAwB,CAAC;AAEhF,MAAM,WAAW,sCAAsC;IACrD,wBAAwB,EAAE,CACxB,OAAO,CAAC,EAAE,+BAA+B,KACtC,OAAO,CAAC;QAAE,IAAI,EAAE,kBAAkB,CAAA;KAAE,CAAC,CAAC;IAC3C,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,wBAAwB,EAAE;gBACxB,WAAW,EAAE,OAAO,8BAA8B,CAAC;aACpD,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,8BAA8B,EAAE,MAAM,CACjD,UAAU,CAAC,iCAAiC,CAAC,EAAE,sCAAsC;AACrF,EAAE,EAAE,0BAA0B;AAC9B,sCAAsC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/findUniqueAuthentication/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EACL,8BAA8B,EAC9B,KAAK,+BAA+B,EACrC,MAAM,WAAW,CAAC;AAMnB,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,wBAAwB,CAAC;AAEhF,MAAM,WAAW,sCAAsC;IACrD,wBAAwB,EAAE,CACxB,OAAO,CAAC,EAAE,+BAA+B,KACtC,OAAO,CAAC;QAAE,IAAI,EAAE,kBAAkB,CAAA;KAAE,CAAC,CAAC;IAC3C,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,wBAAwB,EAAE;gBACxB,WAAW,EAAE,OAAO,8BAA8B,CAAC;aACpD,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,8BAA8B,EAAE,MAAM,CACjD,UAAU,CAAC,iCAAiC,CAAC,EAAE,sCAAsC;AACrF,EAAE,EAAE,0BAA0B;AAC9B,sCAAsC,CA2CvC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/getAction/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,KAAK,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAGnE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAEhE,MAAM,WAAW,uBAAuB;IACtC,SAAS,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,OAAO,CAAC;QAAE,IAAI,EAAE,UAAU,CAAA;KAAE,CAAC,CAAC;IACxE,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,SAAS,EAAE;gBACT,WAAW,EAAE,OAAO,eAAe,CAAC;aACrC,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,eAAe,EAAE,MAAM,CAClC,UAAU,CAAC,yBAAyB,CAAC,EAAE,8BAA8B;AACrE;IAAE,GAAG,EAAE,SAAS,CAAA;CAAE,EAAE,0BAA0B;AAC9C,uBAAuB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/getAction/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,KAAK,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAGnE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAEhE,MAAM,WAAW,uBAAuB;IACtC,SAAS,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,OAAO,CAAC;QAAE,IAAI,EAAE,UAAU,CAAA;KAAE,CAAC,CAAC;IACxE,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,SAAS,EAAE;gBACT,WAAW,EAAE,OAAO,eAAe,CAAC;aACrC,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,eAAe,EAAE,MAAM,CAClC,UAAU,CAAC,yBAAyB,CAAC,EAAE,8BAA8B;AACrE;IAAE,GAAG,EAAE,SAAS,CAAA;CAAE,EAAE,0BAA0B;AAC9C,uBAAuB,CAmCxB,CAAC"}
|
|
@@ -52,7 +52,7 @@ describe("getAction plugin", () => {
|
|
|
52
52
|
},
|
|
53
53
|
});
|
|
54
54
|
// Build SDK with proper plugin composition, providing API in initial context
|
|
55
|
-
return createSdk({}, { api: mockApiClient, meta: {} })
|
|
55
|
+
return createSdk({}, {}, { api: mockApiClient, meta: {} })
|
|
56
56
|
.addPlugin(mockListActionsPlugin)
|
|
57
57
|
.addPlugin(getActionPlugin);
|
|
58
58
|
}
|