@zapier/zapier-sdk 0.9.0 → 0.11.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 +18 -0
- package/README.md +7 -7
- package/dist/api/client.d.ts.map +1 -1
- package/dist/api/client.js +14 -0
- package/dist/api/debug.d.ts +1 -0
- package/dist/api/debug.d.ts.map +1 -1
- package/dist/api/debug.js +42 -1
- package/dist/api/debug.test.d.ts +2 -0
- package/dist/api/debug.test.d.ts.map +1 -0
- package/dist/api/debug.test.js +59 -0
- package/dist/api/schemas.d.ts +451 -251
- package/dist/api/schemas.d.ts.map +1 -1
- package/dist/api/schemas.js +51 -29
- package/dist/index.cjs +968 -582
- package/dist/index.d.mts +2537 -2229
- package/dist/index.d.ts +2 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -3
- package/dist/index.mjs +966 -576
- package/dist/plugins/findFirstAuthentication/index.d.ts +1 -1
- package/dist/plugins/findFirstAuthentication/index.d.ts.map +1 -1
- package/dist/plugins/findFirstAuthentication/index.js +9 -1
- package/dist/plugins/findFirstAuthentication/index.test.js +3 -4
- package/dist/plugins/findFirstAuthentication/schemas.d.ts +5 -3
- package/dist/plugins/findFirstAuthentication/schemas.d.ts.map +1 -1
- package/dist/plugins/findUniqueAuthentication/index.d.ts.map +1 -1
- package/dist/plugins/findUniqueAuthentication/index.js +4 -0
- package/dist/plugins/findUniqueAuthentication/schemas.d.ts +5 -3
- package/dist/plugins/findUniqueAuthentication/schemas.d.ts.map +1 -1
- package/dist/plugins/getAction/index.d.ts.map +1 -1
- package/dist/plugins/getAction/index.js +10 -0
- package/dist/plugins/getAction/schemas.d.ts +5 -3
- package/dist/plugins/getAction/schemas.d.ts.map +1 -1
- package/dist/plugins/getApp/index.d.ts.map +1 -1
- package/dist/plugins/getApp/index.js +8 -0
- package/dist/plugins/getApp/index.test.js +2 -2
- package/dist/plugins/getApp/schemas.d.ts +3 -1
- package/dist/plugins/getApp/schemas.d.ts.map +1 -1
- package/dist/plugins/getApp/schemas.js +2 -4
- package/dist/plugins/getAuthentication/index.d.ts.map +1 -1
- package/dist/plugins/getAuthentication/index.js +8 -0
- package/dist/plugins/getProfile/index.d.ts.map +1 -1
- package/dist/plugins/getProfile/index.js +4 -0
- package/dist/plugins/getProfile/schemas.d.ts.map +1 -1
- package/dist/plugins/getProfile/schemas.js +4 -3
- package/dist/plugins/listActions/index.d.ts.map +1 -1
- package/dist/plugins/listActions/index.js +9 -0
- package/dist/plugins/listActions/schemas.d.ts +5 -3
- package/dist/plugins/listActions/schemas.d.ts.map +1 -1
- package/dist/plugins/listActions/schemas.js +2 -4
- package/dist/plugins/listApps/index.d.ts.map +1 -1
- package/dist/plugins/listApps/index.js +4 -0
- package/dist/plugins/listApps/index.test.js +1 -1
- package/dist/plugins/listApps/schemas.d.ts.map +1 -1
- package/dist/plugins/listApps/schemas.js +3 -9
- package/dist/plugins/listAuthentications/index.d.ts.map +1 -1
- package/dist/plugins/listAuthentications/index.js +8 -0
- package/dist/plugins/listAuthentications/schemas.d.ts +5 -3
- package/dist/plugins/listAuthentications/schemas.d.ts.map +1 -1
- package/dist/plugins/listInputFieldChoices/index.d.ts.map +1 -1
- package/dist/plugins/listInputFieldChoices/index.js +14 -2
- package/dist/plugins/listInputFieldChoices/schemas.d.ts +5 -3
- package/dist/plugins/listInputFieldChoices/schemas.d.ts.map +1 -1
- package/dist/plugins/listInputFieldChoices/schemas.js +10 -19
- package/dist/plugins/listInputFields/index.d.ts +4 -4
- package/dist/plugins/listInputFields/index.d.ts.map +1 -1
- package/dist/plugins/listInputFields/index.js +71 -5
- package/dist/plugins/listInputFields/index.test.js +5 -9
- package/dist/plugins/listInputFields/schemas.d.ts +8 -6
- package/dist/plugins/listInputFields/schemas.d.ts.map +1 -1
- package/dist/plugins/registry/index.d.ts.map +1 -1
- package/dist/plugins/registry/index.js +8 -2
- package/dist/plugins/request/index.d.ts.map +1 -1
- package/dist/plugins/request/index.js +1 -0
- package/dist/plugins/runAction/index.d.ts.map +1 -1
- package/dist/plugins/runAction/index.js +12 -0
- package/dist/plugins/runAction/schemas.d.ts +5 -3
- package/dist/plugins/runAction/schemas.d.ts.map +1 -1
- package/dist/resolvers/actionKey.d.ts +13 -7
- package/dist/resolvers/actionKey.d.ts.map +1 -1
- package/dist/resolvers/actionType.d.ts +8 -7
- package/dist/resolvers/actionType.d.ts.map +1 -1
- package/dist/resolvers/appKey.d.ts +2 -6
- package/dist/resolvers/appKey.d.ts.map +1 -1
- package/dist/resolvers/authenticationId.d.ts +7 -7
- package/dist/resolvers/authenticationId.d.ts.map +1 -1
- package/dist/resolvers/authenticationId.js +16 -7
- package/dist/resolvers/index.d.ts +3 -35
- package/dist/resolvers/index.d.ts.map +1 -1
- package/dist/resolvers/index.js +4 -87
- package/dist/resolvers/inputFieldKey.d.ts +11 -0
- package/dist/resolvers/inputFieldKey.d.ts.map +1 -0
- package/dist/resolvers/inputFieldKey.js +47 -0
- package/dist/resolvers/inputs.d.ts +13 -4
- package/dist/resolvers/inputs.d.ts.map +1 -1
- package/dist/resolvers/inputs.js +36 -0
- package/dist/schemas/Action.d.ts +8 -8
- package/dist/schemas/Action.d.ts.map +1 -1
- package/dist/schemas/Action.js +8 -3
- package/dist/schemas/App.d.ts +183 -11
- package/dist/schemas/App.d.ts.map +1 -1
- package/dist/schemas/App.js +7 -9
- package/dist/schemas/Auth.d.ts +12 -12
- package/dist/schemas/Auth.js +1 -1
- package/dist/schemas/Field.d.ts +112 -97
- package/dist/schemas/Field.d.ts.map +1 -1
- package/dist/schemas/Field.js +63 -52
- package/dist/schemas/Run.d.ts +3 -0
- package/dist/schemas/Run.d.ts.map +1 -0
- package/dist/schemas/Run.js +31 -0
- package/dist/schemas/UserProfile.d.ts +11 -11
- package/dist/schemas/UserProfile.d.ts.map +1 -1
- package/dist/schemas/UserProfile.js +21 -7
- package/dist/sdk.d.ts +11 -4
- package/dist/sdk.d.ts.map +1 -1
- package/dist/types/domain.d.ts +17 -1
- package/dist/types/domain.d.ts.map +1 -1
- package/dist/types/plugin.d.ts +5 -0
- package/dist/types/plugin.d.ts.map +1 -1
- package/dist/types/properties.d.ts +3 -1
- package/dist/types/properties.d.ts.map +1 -1
- package/dist/types/sdk.d.ts +5 -0
- package/dist/types/sdk.d.ts.map +1 -1
- package/dist/utils/domain-utils.d.ts +1 -16
- package/dist/utils/domain-utils.d.ts.map +1 -1
- package/dist/utils/domain-utils.js +7 -51
- package/dist/utils/schema-utils.d.ts +44 -21
- package/dist/utils/schema-utils.d.ts.map +1 -1
- package/dist/utils/schema-utils.js +17 -11
- package/dist/utils/string-utils.d.ts +12 -0
- package/dist/utils/string-utils.d.ts.map +1 -0
- package/dist/utils/string-utils.js +23 -0
- package/dist/utils/string-utils.test.d.ts +2 -0
- package/dist/utils/string-utils.test.d.ts.map +1 -0
- package/dist/utils/string-utils.test.js +36 -0
- package/package.json +1 -1
- package/src/api/client.ts +12 -0
- package/src/api/debug.test.ts +76 -0
- package/src/api/debug.ts +46 -2
- package/src/api/schemas.ts +51 -29
- package/src/index.ts +4 -5
- package/src/plugins/findFirstAuthentication/index.test.ts +8 -5
- package/src/plugins/findFirstAuthentication/index.ts +14 -2
- package/src/plugins/findUniqueAuthentication/index.ts +4 -0
- package/src/plugins/getAction/index.ts +14 -0
- package/src/plugins/getApp/index.test.ts +2 -2
- package/src/plugins/getApp/index.ts +8 -0
- package/src/plugins/getApp/schemas.ts +7 -12
- package/src/plugins/getAuthentication/index.ts +8 -0
- package/src/plugins/getProfile/index.ts +4 -0
- package/src/plugins/getProfile/schemas.ts +4 -6
- package/src/plugins/listActions/index.ts +9 -0
- package/src/plugins/listActions/schemas.ts +20 -25
- package/src/plugins/listApps/index.test.ts +1 -1
- package/src/plugins/listApps/index.ts +4 -0
- package/src/plugins/listApps/schemas.ts +17 -26
- package/src/plugins/listAuthentications/index.ts +8 -0
- package/src/plugins/listInputFieldChoices/index.ts +21 -1
- package/src/plugins/listInputFieldChoices/schemas.ts +61 -76
- package/src/plugins/listInputFields/index.test.ts +5 -9
- package/src/plugins/listInputFields/index.ts +89 -11
- package/src/plugins/listInputFields/schemas.ts +6 -3
- package/src/plugins/registry/index.ts +8 -2
- package/src/plugins/request/index.ts +1 -0
- package/src/plugins/runAction/index.ts +18 -0
- package/src/resolvers/actionKey.ts +15 -13
- package/src/resolvers/actionType.ts +10 -12
- package/src/resolvers/appKey.ts +2 -6
- package/src/resolvers/authenticationId.ts +25 -19
- package/src/resolvers/index.ts +7 -113
- package/src/resolvers/inputFieldKey.ts +70 -0
- package/src/resolvers/inputs.ts +51 -7
- package/src/schemas/Action.ts +8 -3
- package/src/schemas/App.ts +7 -9
- package/src/schemas/Auth.ts +1 -1
- package/src/schemas/Field.ts +97 -60
- package/src/schemas/Run.ts +40 -0
- package/src/schemas/UserProfile.ts +24 -7
- package/src/sdk.ts +17 -7
- package/src/types/domain.ts +24 -1
- package/src/types/plugin.ts +5 -0
- package/src/types/sdk.ts +5 -0
- package/src/utils/domain-utils.ts +9 -67
- package/src/utils/schema-utils.ts +96 -44
- package/src/utils/string-utils.test.ts +45 -0
- package/src/utils/string-utils.ts +26 -0
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -2,15 +2,17 @@ export const authenticationIdResolver = {
|
|
|
2
2
|
type: "dynamic",
|
|
3
3
|
depends: ["appKey"],
|
|
4
4
|
fetch: async (sdk, resolvedParams) => {
|
|
5
|
-
const
|
|
6
|
-
appKey: resolvedParams.appKey,
|
|
5
|
+
const listOptions = {
|
|
7
6
|
maxItems: 1000,
|
|
7
|
+
};
|
|
8
|
+
if (resolvedParams.appKey) {
|
|
9
|
+
listOptions.appKey = resolvedParams.appKey;
|
|
10
|
+
}
|
|
11
|
+
const myAuths = await sdk.listAuthentications({
|
|
12
|
+
...listOptions,
|
|
8
13
|
owner: "me",
|
|
9
14
|
});
|
|
10
|
-
const allAuths = await sdk.listAuthentications(
|
|
11
|
-
appKey: resolvedParams.appKey,
|
|
12
|
-
maxItems: 1000,
|
|
13
|
-
});
|
|
15
|
+
const allAuths = await sdk.listAuthentications(listOptions);
|
|
14
16
|
// Filter out myAuths from allAuths
|
|
15
17
|
const otherAuths = allAuths.data.filter((auth) => !myAuths.data.some((myAuth) => myAuth.id === auth.id));
|
|
16
18
|
return [...myAuths.data, ...otherAuths];
|
|
@@ -18,7 +20,9 @@ export const authenticationIdResolver = {
|
|
|
18
20
|
prompt: (auths, params) => ({
|
|
19
21
|
type: "list",
|
|
20
22
|
name: "authenticationId",
|
|
21
|
-
message:
|
|
23
|
+
message: params.appKey
|
|
24
|
+
? `Select authentication for ${params.appKey}:`
|
|
25
|
+
: "Select authentication:",
|
|
22
26
|
choices: [
|
|
23
27
|
...auths.map((auth) => ({
|
|
24
28
|
name: `${auth.title || auth.label || "Authentication"} (ID: ${auth.id})`,
|
|
@@ -31,3 +35,8 @@ export const authenticationIdResolver = {
|
|
|
31
35
|
],
|
|
32
36
|
}),
|
|
33
37
|
};
|
|
38
|
+
// Generic version without appKey dependency
|
|
39
|
+
export const authenticationIdGenericResolver = {
|
|
40
|
+
...authenticationIdResolver,
|
|
41
|
+
depends: [],
|
|
42
|
+
};
|
|
@@ -1,40 +1,8 @@
|
|
|
1
|
-
export declare const resolverRegistry: {
|
|
2
|
-
readonly appKey: import("./appKey").AppKeyResolver;
|
|
3
|
-
readonly actionType: import("./actionType").ActionTypeResolver;
|
|
4
|
-
readonly actionKey: import("./actionKey").ActionKeyResolver;
|
|
5
|
-
readonly authenticationId: import("./authenticationId").AuthenticationIdResolver;
|
|
6
|
-
readonly inputs: import("./inputs").InputsResolver;
|
|
7
|
-
};
|
|
8
|
-
export type ResolverName = keyof typeof resolverRegistry;
|
|
9
|
-
export type ResolverType = (typeof resolverRegistry)[ResolverName];
|
|
10
|
-
/**
|
|
11
|
-
* Get a resolver by name
|
|
12
|
-
*/
|
|
13
|
-
export declare function getResolver(name: string): ResolverType | undefined;
|
|
14
|
-
/**
|
|
15
|
-
* Get all resolvers for a list of missing parameters
|
|
16
|
-
*/
|
|
17
|
-
export declare function getResolversForMissingParams(missingParams: string[]): Record<string, ResolverType>;
|
|
18
|
-
/**
|
|
19
|
-
* Check if a parameter has a resolver
|
|
20
|
-
*/
|
|
21
|
-
export declare function hasResolver(paramName: string): boolean;
|
|
22
|
-
/**
|
|
23
|
-
* Get all parameter names that have resolvers
|
|
24
|
-
*/
|
|
25
|
-
export declare function getResolvableParams(): string[];
|
|
26
|
-
/**
|
|
27
|
-
* Resolve dependency chain for a parameter
|
|
28
|
-
* Returns parameters in the order they need to be resolved
|
|
29
|
-
*/
|
|
30
|
-
export declare function getResolutionOrder(paramName: string, resolved?: Set<string>): string[];
|
|
31
|
-
/**
|
|
32
|
-
* Get resolution order for multiple parameters
|
|
33
|
-
*/
|
|
34
|
-
export declare function getResolutionOrderForParams(paramNames: string[]): string[];
|
|
35
1
|
export { appKeyResolver } from "./appKey";
|
|
36
2
|
export { actionTypeResolver } from "./actionType";
|
|
37
3
|
export { actionKeyResolver } from "./actionKey";
|
|
38
|
-
export { authenticationIdResolver } from "./authenticationId";
|
|
4
|
+
export { authenticationIdResolver, authenticationIdGenericResolver, } from "./authenticationId";
|
|
39
5
|
export { inputsResolver } from "./inputs";
|
|
6
|
+
export { inputFieldKeyResolver } from "./inputFieldKey";
|
|
7
|
+
export { inputsAllOptionalResolver } from "./inputs";
|
|
40
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resolvers/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resolvers/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EACL,wBAAwB,EACxB,+BAA+B,GAChC,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC"}
|
package/dist/resolvers/index.js
CHANGED
|
@@ -1,91 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
import { actionTypeResolver } from "./actionType";
|
|
3
|
-
import { actionKeyResolver } from "./actionKey";
|
|
4
|
-
import { authenticationIdResolver } from "./authenticationId";
|
|
5
|
-
import { inputsResolver } from "./inputs";
|
|
6
|
-
// Centralized resolver registry
|
|
7
|
-
export const resolverRegistry = {
|
|
8
|
-
appKey: appKeyResolver,
|
|
9
|
-
actionType: actionTypeResolver,
|
|
10
|
-
actionKey: actionKeyResolver,
|
|
11
|
-
authenticationId: authenticationIdResolver,
|
|
12
|
-
inputs: inputsResolver,
|
|
13
|
-
};
|
|
14
|
-
// Utility functions for working with resolvers
|
|
15
|
-
/**
|
|
16
|
-
* Get a resolver by name
|
|
17
|
-
*/
|
|
18
|
-
export function getResolver(name) {
|
|
19
|
-
return resolverRegistry[name];
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Get all resolvers for a list of missing parameters
|
|
23
|
-
*/
|
|
24
|
-
export function getResolversForMissingParams(missingParams) {
|
|
25
|
-
const resolvers = {};
|
|
26
|
-
for (const param of missingParams) {
|
|
27
|
-
const resolver = resolverRegistry[param];
|
|
28
|
-
if (resolver) {
|
|
29
|
-
resolvers[param] = resolver;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
return resolvers;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Check if a parameter has a resolver
|
|
36
|
-
*/
|
|
37
|
-
export function hasResolver(paramName) {
|
|
38
|
-
return paramName in resolverRegistry;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Get all parameter names that have resolvers
|
|
42
|
-
*/
|
|
43
|
-
export function getResolvableParams() {
|
|
44
|
-
return Object.keys(resolverRegistry);
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Resolve dependency chain for a parameter
|
|
48
|
-
* Returns parameters in the order they need to be resolved
|
|
49
|
-
*/
|
|
50
|
-
export function getResolutionOrder(paramName, resolved = new Set()) {
|
|
51
|
-
const resolver = getResolver(paramName);
|
|
52
|
-
if (!resolver || resolver.type === "static") {
|
|
53
|
-
return [paramName];
|
|
54
|
-
}
|
|
55
|
-
const order = [];
|
|
56
|
-
if ("depends" in resolver && resolver.depends) {
|
|
57
|
-
for (const dependency of resolver.depends) {
|
|
58
|
-
if (!resolved.has(dependency)) {
|
|
59
|
-
order.push(...getResolutionOrder(dependency, resolved));
|
|
60
|
-
resolved.add(dependency);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
if (!resolved.has(paramName)) {
|
|
65
|
-
order.push(paramName);
|
|
66
|
-
resolved.add(paramName);
|
|
67
|
-
}
|
|
68
|
-
return order;
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Get resolution order for multiple parameters
|
|
72
|
-
*/
|
|
73
|
-
export function getResolutionOrderForParams(paramNames) {
|
|
74
|
-
const resolved = new Set();
|
|
75
|
-
const order = [];
|
|
76
|
-
for (const paramName of paramNames) {
|
|
77
|
-
const paramOrder = getResolutionOrder(paramName, resolved);
|
|
78
|
-
for (const param of paramOrder) {
|
|
79
|
-
if (!order.includes(param)) {
|
|
80
|
-
order.push(param);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
return order;
|
|
85
|
-
}
|
|
86
|
-
// Re-export individual resolvers for direct access if needed
|
|
1
|
+
// Re-export individual resolvers for plugin use
|
|
87
2
|
export { appKeyResolver } from "./appKey";
|
|
88
3
|
export { actionTypeResolver } from "./actionType";
|
|
89
4
|
export { actionKeyResolver } from "./actionKey";
|
|
90
|
-
export { authenticationIdResolver } from "./authenticationId";
|
|
5
|
+
export { authenticationIdResolver, authenticationIdGenericResolver, } from "./authenticationId";
|
|
91
6
|
export { inputsResolver } from "./inputs";
|
|
7
|
+
export { inputFieldKeyResolver } from "./inputFieldKey";
|
|
8
|
+
export { inputsAllOptionalResolver } from "./inputs";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { DynamicResolver } from "../utils/schema-utils";
|
|
2
|
+
import type { InputFieldItem } from "../schemas/Field";
|
|
3
|
+
import type { ActionTypeProperty } from "../types/properties";
|
|
4
|
+
export declare const inputFieldKeyResolver: DynamicResolver<InputFieldItem, {
|
|
5
|
+
appKey: string;
|
|
6
|
+
actionKey: string;
|
|
7
|
+
actionType: ActionTypeProperty;
|
|
8
|
+
authenticationId: number;
|
|
9
|
+
inputs?: Record<string, unknown>;
|
|
10
|
+
}>;
|
|
11
|
+
//# sourceMappingURL=inputFieldKey.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inputFieldKey.d.ts","sourceRoot":"","sources":["../../src/resolvers/inputFieldKey.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAiC9D,eAAO,MAAM,qBAAqB,EAAE,eAAe,CACjD,cAAc,EACd;IACE,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,kBAAkB,CAAC;IAC/B,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC,CA0BF,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helper function to flatten fieldsets into a flat array of input fields.
|
|
3
|
+
* Used to extract all input fields from nested fieldset structure for field selection.
|
|
4
|
+
*/
|
|
5
|
+
function flattenRootFieldset(rootFieldset) {
|
|
6
|
+
const result = [];
|
|
7
|
+
function processItem(item) {
|
|
8
|
+
if (item.type === "input_field") {
|
|
9
|
+
result.push(item);
|
|
10
|
+
}
|
|
11
|
+
else if (item.type === "fieldset") {
|
|
12
|
+
// Recursively process fields in the fieldset
|
|
13
|
+
for (const field of item.fields) {
|
|
14
|
+
processItem(field);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
// Skip info fields as they're not input fields
|
|
18
|
+
}
|
|
19
|
+
for (const item of rootFieldset) {
|
|
20
|
+
processItem(item);
|
|
21
|
+
}
|
|
22
|
+
return result;
|
|
23
|
+
}
|
|
24
|
+
export const inputFieldKeyResolver = {
|
|
25
|
+
type: "dynamic",
|
|
26
|
+
depends: ["appKey", "actionKey", "actionType", "authenticationId"],
|
|
27
|
+
fetch: async (sdk, resolvedParams) => {
|
|
28
|
+
const fieldsResponse = await sdk.listInputFields({
|
|
29
|
+
appKey: resolvedParams.appKey,
|
|
30
|
+
actionKey: resolvedParams.actionKey,
|
|
31
|
+
actionType: resolvedParams.actionType,
|
|
32
|
+
authenticationId: resolvedParams.authenticationId,
|
|
33
|
+
inputs: resolvedParams.inputs, // Pass along currently resolved inputs
|
|
34
|
+
});
|
|
35
|
+
// Flatten the fieldset structure for field selection
|
|
36
|
+
return flattenRootFieldset(fieldsResponse.data);
|
|
37
|
+
},
|
|
38
|
+
prompt: (fields) => ({
|
|
39
|
+
type: "list",
|
|
40
|
+
name: "inputFieldKey",
|
|
41
|
+
message: "Select input field:",
|
|
42
|
+
choices: fields.map((field) => ({
|
|
43
|
+
name: `${field.title || field.key} - ${field.value_type || "No type"} ${field.is_required ? "(required)" : "(optional)"}`,
|
|
44
|
+
value: field.key,
|
|
45
|
+
})),
|
|
46
|
+
}),
|
|
47
|
+
};
|
|
@@ -1,8 +1,17 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type { ActionTypeProperty } from "../types/properties";
|
|
2
|
+
import type { RootFieldItem } from "../types/domain";
|
|
3
|
+
type InputsResolver = {
|
|
3
4
|
type: "fields";
|
|
4
5
|
depends: readonly string[];
|
|
5
|
-
fetch: (sdk:
|
|
6
|
-
|
|
6
|
+
fetch: (sdk: any, resolvedParams: {
|
|
7
|
+
appKey: string;
|
|
8
|
+
actionKey: string;
|
|
9
|
+
actionType: ActionTypeProperty;
|
|
10
|
+
authenticationId: number;
|
|
11
|
+
inputs?: Record<string, unknown>;
|
|
12
|
+
}) => Promise<RootFieldItem[]>;
|
|
13
|
+
};
|
|
7
14
|
export declare const inputsResolver: InputsResolver;
|
|
15
|
+
export declare const inputsAllOptionalResolver: InputsResolver;
|
|
16
|
+
export {};
|
|
8
17
|
//# sourceMappingURL=inputs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inputs.d.ts","sourceRoot":"","sources":["../../src/resolvers/inputs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"inputs.d.ts","sourceRoot":"","sources":["../../src/resolvers/inputs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAuBrD,KAAK,cAAc,GAAG;IACpB,IAAI,EAAE,QAAQ,CAAC;IACf,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B,KAAK,EAAE,CACL,GAAG,EAAE,GAAG,EACR,cAAc,EAAE;QACd,MAAM,EAAE,MAAM,CAAC;QACf,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,kBAAkB,CAAC;QAC/B,gBAAgB,EAAE,MAAM,CAAC;QACzB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAClC,KACE,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC;CAC/B,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,cAa5B,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,cAcvC,CAAC"}
|
package/dist/resolvers/inputs.js
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
// Helper function to recursively make all input fields optional while preserving structure
|
|
2
|
+
function makeFieldsOptional(fields) {
|
|
3
|
+
return fields.map((field) => {
|
|
4
|
+
if (field.type === "input_field") {
|
|
5
|
+
return {
|
|
6
|
+
...field,
|
|
7
|
+
is_required: false,
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
else if (field.type === "fieldset") {
|
|
11
|
+
return {
|
|
12
|
+
...field,
|
|
13
|
+
fields: makeFieldsOptional(field.fields),
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
// Info fields remain unchanged
|
|
18
|
+
return field;
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
1
22
|
export const inputsResolver = {
|
|
2
23
|
type: "fields",
|
|
3
24
|
depends: ["appKey", "actionKey", "actionType", "authenticationId"],
|
|
@@ -12,3 +33,18 @@ export const inputsResolver = {
|
|
|
12
33
|
return fieldsResponse.data;
|
|
13
34
|
},
|
|
14
35
|
};
|
|
36
|
+
export const inputsAllOptionalResolver = {
|
|
37
|
+
type: "fields",
|
|
38
|
+
depends: ["appKey", "actionKey", "actionType", "authenticationId"],
|
|
39
|
+
fetch: async (sdk, resolvedParams) => {
|
|
40
|
+
const fieldsResponse = await sdk.listInputFields({
|
|
41
|
+
appKey: resolvedParams.appKey,
|
|
42
|
+
actionKey: resolvedParams.actionKey,
|
|
43
|
+
actionType: resolvedParams.actionType,
|
|
44
|
+
authenticationId: resolvedParams.authenticationId,
|
|
45
|
+
inputs: resolvedParams.inputs, // Pass along currently resolved inputs
|
|
46
|
+
});
|
|
47
|
+
// Return nested structure with all fields marked as optional.
|
|
48
|
+
return makeFieldsOptional(fieldsResponse.data);
|
|
49
|
+
},
|
|
50
|
+
};
|
package/dist/schemas/Action.d.ts
CHANGED
|
@@ -53,7 +53,7 @@ export declare const ActionItemSchema: z.ZodObject<Omit<{
|
|
|
53
53
|
}, "strip", z.ZodTypeAny, {
|
|
54
54
|
key: string;
|
|
55
55
|
default?: string | undefined;
|
|
56
|
-
type?: "string" | "boolean" | "
|
|
56
|
+
type?: "string" | "boolean" | "filter" | "code" | "integer" | "text" | "datetime" | "file" | "decimal" | "copy" | "password" | "dict" | "json" | undefined;
|
|
57
57
|
label?: string | undefined;
|
|
58
58
|
alters_custom_fields?: boolean | null | undefined;
|
|
59
59
|
capabilities?: string[] | undefined;
|
|
@@ -84,7 +84,7 @@ export declare const ActionItemSchema: z.ZodObject<Omit<{
|
|
|
84
84
|
}, {
|
|
85
85
|
key: string;
|
|
86
86
|
default?: string | undefined;
|
|
87
|
-
type?: "string" | "boolean" | "
|
|
87
|
+
type?: "string" | "boolean" | "filter" | "code" | "integer" | "text" | "datetime" | "file" | "decimal" | "copy" | "password" | "dict" | "json" | undefined;
|
|
88
88
|
label?: string | undefined;
|
|
89
89
|
alters_custom_fields?: boolean | null | undefined;
|
|
90
90
|
capabilities?: string[] | undefined;
|
|
@@ -137,10 +137,10 @@ export declare const ActionItemSchema: z.ZodObject<Omit<{
|
|
|
137
137
|
}, "strip", z.ZodTypeAny, {
|
|
138
138
|
type: "action";
|
|
139
139
|
key: string;
|
|
140
|
-
title: string;
|
|
141
140
|
description: string;
|
|
141
|
+
title: string;
|
|
142
142
|
app_key: string;
|
|
143
|
-
action_type: "filter" | "read" | "read_bulk" | "
|
|
143
|
+
action_type: "filter" | "read" | "read_bulk" | "write" | "run" | "search" | "search_or_write" | "search_and_write";
|
|
144
144
|
id?: string | undefined;
|
|
145
145
|
noun?: string | undefined;
|
|
146
146
|
description_html?: string | undefined;
|
|
@@ -149,7 +149,7 @@ export declare const ActionItemSchema: z.ZodObject<Omit<{
|
|
|
149
149
|
needs?: {
|
|
150
150
|
key: string;
|
|
151
151
|
default?: string | undefined;
|
|
152
|
-
type?: "string" | "boolean" | "
|
|
152
|
+
type?: "string" | "boolean" | "filter" | "code" | "integer" | "text" | "datetime" | "file" | "decimal" | "copy" | "password" | "dict" | "json" | undefined;
|
|
153
153
|
label?: string | undefined;
|
|
154
154
|
alters_custom_fields?: boolean | null | undefined;
|
|
155
155
|
capabilities?: string[] | undefined;
|
|
@@ -189,10 +189,10 @@ export declare const ActionItemSchema: z.ZodObject<Omit<{
|
|
|
189
189
|
}, {
|
|
190
190
|
type: "action";
|
|
191
191
|
key: string;
|
|
192
|
-
title: string;
|
|
193
192
|
description: string;
|
|
193
|
+
title: string;
|
|
194
194
|
app_key: string;
|
|
195
|
-
action_type: "filter" | "read" | "read_bulk" | "
|
|
195
|
+
action_type: "filter" | "read" | "read_bulk" | "write" | "run" | "search" | "search_or_write" | "search_and_write";
|
|
196
196
|
id?: string | undefined;
|
|
197
197
|
noun?: string | undefined;
|
|
198
198
|
description_html?: string | undefined;
|
|
@@ -201,7 +201,7 @@ export declare const ActionItemSchema: z.ZodObject<Omit<{
|
|
|
201
201
|
needs?: {
|
|
202
202
|
key: string;
|
|
203
203
|
default?: string | undefined;
|
|
204
|
-
type?: "string" | "boolean" | "
|
|
204
|
+
type?: "string" | "boolean" | "filter" | "code" | "integer" | "text" | "datetime" | "file" | "decimal" | "copy" | "password" | "dict" | "json" | undefined;
|
|
205
205
|
label?: string | undefined;
|
|
206
206
|
alters_custom_fields?: boolean | null | undefined;
|
|
207
207
|
capabilities?: string[] | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Action.d.ts","sourceRoot":"","sources":["../../src/schemas/Action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"Action.d.ts","sourceRoot":"","sources":["../../src/schemas/Action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoC5B,CAAC;AAMF,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
|
package/dist/schemas/Action.js
CHANGED
|
@@ -23,11 +23,16 @@ export const ActionItemSchema = withFormatter(ActionSchema.omit({ type: true, na
|
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
if (item.description) {
|
|
26
|
-
details.push({
|
|
26
|
+
details.push({
|
|
27
|
+
text: item.description,
|
|
28
|
+
style: "dim",
|
|
29
|
+
});
|
|
27
30
|
}
|
|
28
31
|
return {
|
|
29
|
-
title: item.title || item.
|
|
30
|
-
|
|
32
|
+
title: item.title || item.key,
|
|
33
|
+
id: item.id,
|
|
34
|
+
key: item.key,
|
|
35
|
+
description: item.description,
|
|
31
36
|
details,
|
|
32
37
|
};
|
|
33
38
|
},
|
package/dist/schemas/App.d.ts
CHANGED
|
@@ -1,26 +1,198 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export { FormattedItem, FormatMetadata } from "../utils/schema-utils";
|
|
3
|
-
export declare const AppItemSchema: z.ZodObject<{
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
export declare const AppItemSchema: z.ZodObject<Omit<{
|
|
4
|
+
id: z.ZodString;
|
|
5
|
+
name: z.ZodString;
|
|
6
|
+
slug: z.ZodString;
|
|
7
|
+
age_in_days: z.ZodOptional<z.ZodNumber>;
|
|
8
|
+
auth_type: z.ZodOptional<z.ZodString>;
|
|
9
|
+
banner: z.ZodOptional<z.ZodString>;
|
|
10
|
+
categories: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
11
|
+
id: z.ZodNumber;
|
|
12
|
+
name: z.ZodString;
|
|
13
|
+
slug: z.ZodString;
|
|
14
|
+
}, "strip", z.ZodTypeAny, {
|
|
15
|
+
id: number;
|
|
16
|
+
name: string;
|
|
17
|
+
slug: string;
|
|
18
|
+
}, {
|
|
19
|
+
id: number;
|
|
20
|
+
name: string;
|
|
21
|
+
slug: string;
|
|
22
|
+
}>, "many">>;
|
|
23
|
+
images: z.ZodOptional<z.ZodObject<{
|
|
24
|
+
url_16x16: z.ZodOptional<z.ZodString>;
|
|
25
|
+
url_32x32: z.ZodOptional<z.ZodString>;
|
|
26
|
+
url_64x64: z.ZodOptional<z.ZodString>;
|
|
27
|
+
url_128x128: z.ZodOptional<z.ZodString>;
|
|
28
|
+
}, "strip", z.ZodTypeAny, {
|
|
29
|
+
url_16x16?: string | undefined;
|
|
30
|
+
url_32x32?: string | undefined;
|
|
31
|
+
url_64x64?: string | undefined;
|
|
32
|
+
url_128x128?: string | undefined;
|
|
33
|
+
}, {
|
|
34
|
+
url_16x16?: string | undefined;
|
|
35
|
+
url_32x32?: string | undefined;
|
|
36
|
+
url_64x64?: string | undefined;
|
|
37
|
+
url_128x128?: string | undefined;
|
|
38
|
+
}>>;
|
|
39
|
+
popularity: z.ZodOptional<z.ZodNumber>;
|
|
40
|
+
has_filters: z.ZodOptional<z.ZodBoolean>;
|
|
41
|
+
has_reads: z.ZodOptional<z.ZodBoolean>;
|
|
42
|
+
has_searches: z.ZodOptional<z.ZodBoolean>;
|
|
43
|
+
has_searches_or_writes: z.ZodOptional<z.ZodBoolean>;
|
|
44
|
+
has_upfront_fields: z.ZodOptional<z.ZodBoolean>;
|
|
45
|
+
has_writes: z.ZodOptional<z.ZodBoolean>;
|
|
46
|
+
is_beta: z.ZodOptional<z.ZodBoolean>;
|
|
47
|
+
is_built_in: z.ZodOptional<z.ZodBoolean>;
|
|
48
|
+
is_deprecated: z.ZodOptional<z.ZodBoolean>;
|
|
49
|
+
is_featured: z.ZodOptional<z.ZodBoolean>;
|
|
50
|
+
is_hidden: z.ZodOptional<z.ZodBoolean>;
|
|
51
|
+
is_invite: z.ZodOptional<z.ZodBoolean>;
|
|
52
|
+
is_premium: z.ZodOptional<z.ZodBoolean>;
|
|
53
|
+
is_public: z.ZodOptional<z.ZodBoolean>;
|
|
54
|
+
is_upcoming: z.ZodOptional<z.ZodBoolean>;
|
|
7
55
|
version: z.ZodOptional<z.ZodString>;
|
|
56
|
+
visibility: z.ZodOptional<z.ZodString>;
|
|
57
|
+
actions: z.ZodOptional<z.ZodObject<{
|
|
58
|
+
read: z.ZodOptional<z.ZodNumber>;
|
|
59
|
+
read_bulk: z.ZodOptional<z.ZodNumber>;
|
|
60
|
+
write: z.ZodOptional<z.ZodNumber>;
|
|
61
|
+
search: z.ZodOptional<z.ZodNumber>;
|
|
62
|
+
search_or_write: z.ZodOptional<z.ZodNumber>;
|
|
63
|
+
search_and_write: z.ZodOptional<z.ZodNumber>;
|
|
64
|
+
filter: z.ZodOptional<z.ZodNumber>;
|
|
65
|
+
}, "strip", z.ZodTypeAny, {
|
|
66
|
+
filter?: number | undefined;
|
|
67
|
+
read?: number | undefined;
|
|
68
|
+
read_bulk?: number | undefined;
|
|
69
|
+
write?: number | undefined;
|
|
70
|
+
search?: number | undefined;
|
|
71
|
+
search_or_write?: number | undefined;
|
|
72
|
+
search_and_write?: number | undefined;
|
|
73
|
+
}, {
|
|
74
|
+
filter?: number | undefined;
|
|
75
|
+
read?: number | undefined;
|
|
76
|
+
read_bulk?: number | undefined;
|
|
77
|
+
write?: number | undefined;
|
|
78
|
+
search?: number | undefined;
|
|
79
|
+
search_or_write?: number | undefined;
|
|
80
|
+
search_and_write?: number | undefined;
|
|
81
|
+
}>>;
|
|
8
82
|
description: z.ZodOptional<z.ZodString>;
|
|
9
|
-
|
|
83
|
+
primary_color: z.ZodOptional<z.ZodString>;
|
|
84
|
+
secondary_color: z.ZodOptional<z.ZodString>;
|
|
85
|
+
classification: z.ZodOptional<z.ZodString>;
|
|
86
|
+
api_docs_url: z.ZodOptional<z.ZodString>;
|
|
87
|
+
image: z.ZodOptional<z.ZodString>;
|
|
88
|
+
}, "id" | "name"> & {
|
|
89
|
+
title: z.ZodString;
|
|
90
|
+
key: z.ZodString;
|
|
91
|
+
implementation_id: z.ZodString;
|
|
10
92
|
}, "strip", z.ZodTypeAny, {
|
|
11
93
|
key: string;
|
|
12
94
|
title: string;
|
|
13
|
-
|
|
14
|
-
|
|
95
|
+
slug: string;
|
|
96
|
+
implementation_id: string;
|
|
15
97
|
description?: string | undefined;
|
|
16
|
-
|
|
98
|
+
is_hidden?: boolean | undefined;
|
|
99
|
+
age_in_days?: number | undefined;
|
|
100
|
+
api_docs_url?: string | undefined;
|
|
101
|
+
banner?: string | undefined;
|
|
102
|
+
categories?: {
|
|
103
|
+
id: number;
|
|
104
|
+
name: string;
|
|
105
|
+
slug: string;
|
|
106
|
+
}[] | undefined;
|
|
107
|
+
image?: string | undefined;
|
|
108
|
+
images?: {
|
|
109
|
+
url_16x16?: string | undefined;
|
|
110
|
+
url_32x32?: string | undefined;
|
|
111
|
+
url_64x64?: string | undefined;
|
|
112
|
+
url_128x128?: string | undefined;
|
|
113
|
+
} | undefined;
|
|
114
|
+
is_beta?: boolean | undefined;
|
|
115
|
+
is_built_in?: boolean | undefined;
|
|
116
|
+
is_featured?: boolean | undefined;
|
|
117
|
+
is_premium?: boolean | undefined;
|
|
118
|
+
is_public?: boolean | undefined;
|
|
119
|
+
is_upcoming?: boolean | undefined;
|
|
120
|
+
popularity?: number | undefined;
|
|
121
|
+
primary_color?: string | undefined;
|
|
122
|
+
auth_type?: string | undefined;
|
|
123
|
+
actions?: {
|
|
124
|
+
filter?: number | undefined;
|
|
125
|
+
read?: number | undefined;
|
|
126
|
+
read_bulk?: number | undefined;
|
|
127
|
+
write?: number | undefined;
|
|
128
|
+
search?: number | undefined;
|
|
129
|
+
search_or_write?: number | undefined;
|
|
130
|
+
search_and_write?: number | undefined;
|
|
131
|
+
} | undefined;
|
|
132
|
+
is_deprecated?: boolean | undefined;
|
|
133
|
+
secondary_color?: string | undefined;
|
|
134
|
+
has_filters?: boolean | undefined;
|
|
135
|
+
has_reads?: boolean | undefined;
|
|
136
|
+
has_searches?: boolean | undefined;
|
|
137
|
+
has_searches_or_writes?: boolean | undefined;
|
|
138
|
+
has_upfront_fields?: boolean | undefined;
|
|
139
|
+
has_writes?: boolean | undefined;
|
|
140
|
+
is_invite?: boolean | undefined;
|
|
141
|
+
version?: string | undefined;
|
|
142
|
+
visibility?: string | undefined;
|
|
143
|
+
classification?: string | undefined;
|
|
17
144
|
}, {
|
|
18
145
|
key: string;
|
|
19
146
|
title: string;
|
|
20
|
-
|
|
21
|
-
|
|
147
|
+
slug: string;
|
|
148
|
+
implementation_id: string;
|
|
22
149
|
description?: string | undefined;
|
|
23
|
-
|
|
150
|
+
is_hidden?: boolean | undefined;
|
|
151
|
+
age_in_days?: number | undefined;
|
|
152
|
+
api_docs_url?: string | undefined;
|
|
153
|
+
banner?: string | undefined;
|
|
154
|
+
categories?: {
|
|
155
|
+
id: number;
|
|
156
|
+
name: string;
|
|
157
|
+
slug: string;
|
|
158
|
+
}[] | undefined;
|
|
159
|
+
image?: string | undefined;
|
|
160
|
+
images?: {
|
|
161
|
+
url_16x16?: string | undefined;
|
|
162
|
+
url_32x32?: string | undefined;
|
|
163
|
+
url_64x64?: string | undefined;
|
|
164
|
+
url_128x128?: string | undefined;
|
|
165
|
+
} | undefined;
|
|
166
|
+
is_beta?: boolean | undefined;
|
|
167
|
+
is_built_in?: boolean | undefined;
|
|
168
|
+
is_featured?: boolean | undefined;
|
|
169
|
+
is_premium?: boolean | undefined;
|
|
170
|
+
is_public?: boolean | undefined;
|
|
171
|
+
is_upcoming?: boolean | undefined;
|
|
172
|
+
popularity?: number | undefined;
|
|
173
|
+
primary_color?: string | undefined;
|
|
174
|
+
auth_type?: string | undefined;
|
|
175
|
+
actions?: {
|
|
176
|
+
filter?: number | undefined;
|
|
177
|
+
read?: number | undefined;
|
|
178
|
+
read_bulk?: number | undefined;
|
|
179
|
+
write?: number | undefined;
|
|
180
|
+
search?: number | undefined;
|
|
181
|
+
search_or_write?: number | undefined;
|
|
182
|
+
search_and_write?: number | undefined;
|
|
183
|
+
} | undefined;
|
|
184
|
+
is_deprecated?: boolean | undefined;
|
|
185
|
+
secondary_color?: string | undefined;
|
|
186
|
+
has_filters?: boolean | undefined;
|
|
187
|
+
has_reads?: boolean | undefined;
|
|
188
|
+
has_searches?: boolean | undefined;
|
|
189
|
+
has_searches_or_writes?: boolean | undefined;
|
|
190
|
+
has_upfront_fields?: boolean | undefined;
|
|
191
|
+
has_writes?: boolean | undefined;
|
|
192
|
+
is_invite?: boolean | undefined;
|
|
193
|
+
version?: string | undefined;
|
|
194
|
+
visibility?: string | undefined;
|
|
195
|
+
classification?: string | undefined;
|
|
24
196
|
}>;
|
|
25
197
|
export type AppItem = z.infer<typeof AppItemSchema>;
|
|
26
198
|
//# sourceMappingURL=App.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../src/schemas/App.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../src/schemas/App.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAMtE,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgBzB,CAAC;AAMF,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC"}
|
package/dist/schemas/App.js
CHANGED
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { withFormatter } from "../utils/schema-utils";
|
|
3
|
+
import { ImplementationMetaSchema } from "../api/schemas";
|
|
3
4
|
// ============================================================================
|
|
4
|
-
// App Item Schema (extends
|
|
5
|
+
// App Item Schema (extends ImplementationMetaSchema with transformed fields)
|
|
5
6
|
// ============================================================================
|
|
6
|
-
export const AppItemSchema = withFormatter(
|
|
7
|
-
// Essential properties only
|
|
7
|
+
export const AppItemSchema = withFormatter(ImplementationMetaSchema.omit({ name: true, id: true }).extend({
|
|
8
8
|
title: z.string(), // Mapped from name
|
|
9
|
-
key: z.string(), //
|
|
10
|
-
|
|
11
|
-
version: z.string().optional(), // Extracted from implementation ID
|
|
12
|
-
description: z.string().optional(),
|
|
13
|
-
slug: z.string().optional(),
|
|
9
|
+
key: z.string(), // Extracted from id (base part without version)
|
|
10
|
+
implementation_id: z.string(), // Mapped from id (full versioned ID)
|
|
14
11
|
}), {
|
|
15
12
|
format: (item) => {
|
|
16
13
|
return {
|
|
17
14
|
title: item.title,
|
|
18
|
-
|
|
15
|
+
key: item.key,
|
|
16
|
+
description: item.description,
|
|
19
17
|
details: [],
|
|
20
18
|
};
|
|
21
19
|
},
|