@zapier/zapier-sdk 0.9.0 → 0.10.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.
Files changed (174) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +7 -7
  3. package/dist/api/client.d.ts.map +1 -1
  4. package/dist/api/client.js +14 -0
  5. package/dist/api/debug.d.ts +1 -0
  6. package/dist/api/debug.d.ts.map +1 -1
  7. package/dist/api/debug.js +42 -1
  8. package/dist/api/debug.test.d.ts +2 -0
  9. package/dist/api/debug.test.d.ts.map +1 -0
  10. package/dist/api/debug.test.js +59 -0
  11. package/dist/api/schemas.d.ts +451 -251
  12. package/dist/api/schemas.d.ts.map +1 -1
  13. package/dist/api/schemas.js +51 -29
  14. package/dist/index.cjs +834 -563
  15. package/dist/index.d.mts +2287 -2085
  16. package/dist/index.d.ts +2 -3
  17. package/dist/index.d.ts.map +1 -1
  18. package/dist/index.js +2 -3
  19. package/dist/index.mjs +832 -557
  20. package/dist/plugins/findFirstAuthentication/index.d.ts +1 -1
  21. package/dist/plugins/findFirstAuthentication/index.d.ts.map +1 -1
  22. package/dist/plugins/findFirstAuthentication/index.js +9 -1
  23. package/dist/plugins/findFirstAuthentication/index.test.js +3 -4
  24. package/dist/plugins/findFirstAuthentication/schemas.d.ts +5 -3
  25. package/dist/plugins/findFirstAuthentication/schemas.d.ts.map +1 -1
  26. package/dist/plugins/findUniqueAuthentication/index.d.ts.map +1 -1
  27. package/dist/plugins/findUniqueAuthentication/index.js +4 -0
  28. package/dist/plugins/findUniqueAuthentication/schemas.d.ts +5 -3
  29. package/dist/plugins/findUniqueAuthentication/schemas.d.ts.map +1 -1
  30. package/dist/plugins/getAction/index.d.ts.map +1 -1
  31. package/dist/plugins/getAction/index.js +10 -0
  32. package/dist/plugins/getAction/schemas.d.ts +5 -3
  33. package/dist/plugins/getAction/schemas.d.ts.map +1 -1
  34. package/dist/plugins/getApp/index.d.ts.map +1 -1
  35. package/dist/plugins/getApp/index.js +8 -0
  36. package/dist/plugins/getApp/index.test.js +2 -2
  37. package/dist/plugins/getApp/schemas.d.ts +3 -1
  38. package/dist/plugins/getApp/schemas.d.ts.map +1 -1
  39. package/dist/plugins/getApp/schemas.js +2 -4
  40. package/dist/plugins/getAuthentication/index.d.ts.map +1 -1
  41. package/dist/plugins/getAuthentication/index.js +8 -0
  42. package/dist/plugins/getProfile/index.d.ts.map +1 -1
  43. package/dist/plugins/getProfile/index.js +4 -0
  44. package/dist/plugins/getProfile/schemas.d.ts.map +1 -1
  45. package/dist/plugins/getProfile/schemas.js +4 -3
  46. package/dist/plugins/listActions/index.d.ts.map +1 -1
  47. package/dist/plugins/listActions/index.js +9 -0
  48. package/dist/plugins/listActions/schemas.d.ts +5 -3
  49. package/dist/plugins/listActions/schemas.d.ts.map +1 -1
  50. package/dist/plugins/listActions/schemas.js +2 -4
  51. package/dist/plugins/listApps/index.d.ts.map +1 -1
  52. package/dist/plugins/listApps/index.js +4 -0
  53. package/dist/plugins/listApps/index.test.js +1 -1
  54. package/dist/plugins/listApps/schemas.d.ts.map +1 -1
  55. package/dist/plugins/listApps/schemas.js +3 -9
  56. package/dist/plugins/listAuthentications/index.d.ts.map +1 -1
  57. package/dist/plugins/listAuthentications/index.js +8 -0
  58. package/dist/plugins/listAuthentications/schemas.d.ts +5 -3
  59. package/dist/plugins/listAuthentications/schemas.d.ts.map +1 -1
  60. package/dist/plugins/listInputFieldChoices/index.d.ts.map +1 -1
  61. package/dist/plugins/listInputFieldChoices/index.js +14 -2
  62. package/dist/plugins/listInputFieldChoices/schemas.d.ts +5 -3
  63. package/dist/plugins/listInputFieldChoices/schemas.d.ts.map +1 -1
  64. package/dist/plugins/listInputFieldChoices/schemas.js +10 -19
  65. package/dist/plugins/listInputFields/index.d.ts.map +1 -1
  66. package/dist/plugins/listInputFields/index.js +14 -2
  67. package/dist/plugins/listInputFields/index.test.js +5 -9
  68. package/dist/plugins/listInputFields/schemas.d.ts +5 -3
  69. package/dist/plugins/listInputFields/schemas.d.ts.map +1 -1
  70. package/dist/plugins/registry/index.d.ts.map +1 -1
  71. package/dist/plugins/registry/index.js +8 -2
  72. package/dist/plugins/request/index.d.ts.map +1 -1
  73. package/dist/plugins/request/index.js +1 -0
  74. package/dist/plugins/runAction/index.d.ts.map +1 -1
  75. package/dist/plugins/runAction/index.js +12 -0
  76. package/dist/plugins/runAction/schemas.d.ts +5 -3
  77. package/dist/plugins/runAction/schemas.d.ts.map +1 -1
  78. package/dist/resolvers/actionKey.d.ts +13 -7
  79. package/dist/resolvers/actionKey.d.ts.map +1 -1
  80. package/dist/resolvers/actionType.d.ts +8 -7
  81. package/dist/resolvers/actionType.d.ts.map +1 -1
  82. package/dist/resolvers/appKey.d.ts +2 -6
  83. package/dist/resolvers/appKey.d.ts.map +1 -1
  84. package/dist/resolvers/authenticationId.d.ts +7 -7
  85. package/dist/resolvers/authenticationId.d.ts.map +1 -1
  86. package/dist/resolvers/authenticationId.js +16 -7
  87. package/dist/resolvers/index.d.ts +3 -35
  88. package/dist/resolvers/index.d.ts.map +1 -1
  89. package/dist/resolvers/index.js +4 -87
  90. package/dist/resolvers/inputFieldKey.d.ts +11 -0
  91. package/dist/resolvers/inputFieldKey.d.ts.map +1 -0
  92. package/dist/resolvers/inputFieldKey.js +23 -0
  93. package/dist/resolvers/inputs.d.ts +11 -6
  94. package/dist/resolvers/inputs.d.ts.map +1 -1
  95. package/dist/resolvers/inputs.js +17 -0
  96. package/dist/schemas/Action.d.ts +8 -8
  97. package/dist/schemas/Action.d.ts.map +1 -1
  98. package/dist/schemas/Action.js +8 -3
  99. package/dist/schemas/App.d.ts +183 -11
  100. package/dist/schemas/App.d.ts.map +1 -1
  101. package/dist/schemas/App.js +7 -9
  102. package/dist/schemas/Auth.d.ts +12 -12
  103. package/dist/schemas/Auth.js +1 -1
  104. package/dist/schemas/Field.d.ts +5 -98
  105. package/dist/schemas/Field.d.ts.map +1 -1
  106. package/dist/schemas/Field.js +24 -52
  107. package/dist/schemas/Run.d.ts +3 -0
  108. package/dist/schemas/Run.d.ts.map +1 -0
  109. package/dist/schemas/Run.js +31 -0
  110. package/dist/schemas/UserProfile.d.ts +11 -11
  111. package/dist/schemas/UserProfile.d.ts.map +1 -1
  112. package/dist/schemas/UserProfile.js +21 -7
  113. package/dist/sdk.d.ts +11 -4
  114. package/dist/sdk.d.ts.map +1 -1
  115. package/dist/types/plugin.d.ts +5 -0
  116. package/dist/types/plugin.d.ts.map +1 -1
  117. package/dist/types/properties.d.ts +3 -1
  118. package/dist/types/properties.d.ts.map +1 -1
  119. package/dist/types/sdk.d.ts +5 -0
  120. package/dist/types/sdk.d.ts.map +1 -1
  121. package/dist/utils/domain-utils.d.ts +1 -16
  122. package/dist/utils/domain-utils.d.ts.map +1 -1
  123. package/dist/utils/domain-utils.js +7 -51
  124. package/dist/utils/schema-utils.d.ts +44 -21
  125. package/dist/utils/schema-utils.d.ts.map +1 -1
  126. package/dist/utils/schema-utils.js +17 -11
  127. package/package.json +1 -1
  128. package/src/api/client.ts +12 -0
  129. package/src/api/debug.test.ts +76 -0
  130. package/src/api/debug.ts +46 -2
  131. package/src/api/schemas.ts +51 -29
  132. package/src/index.ts +4 -5
  133. package/src/plugins/findFirstAuthentication/index.test.ts +8 -5
  134. package/src/plugins/findFirstAuthentication/index.ts +14 -2
  135. package/src/plugins/findUniqueAuthentication/index.ts +4 -0
  136. package/src/plugins/getAction/index.ts +14 -0
  137. package/src/plugins/getApp/index.test.ts +2 -2
  138. package/src/plugins/getApp/index.ts +8 -0
  139. package/src/plugins/getApp/schemas.ts +7 -12
  140. package/src/plugins/getAuthentication/index.ts +8 -0
  141. package/src/plugins/getProfile/index.ts +4 -0
  142. package/src/plugins/getProfile/schemas.ts +4 -6
  143. package/src/plugins/listActions/index.ts +9 -0
  144. package/src/plugins/listActions/schemas.ts +20 -25
  145. package/src/plugins/listApps/index.test.ts +1 -1
  146. package/src/plugins/listApps/index.ts +4 -0
  147. package/src/plugins/listApps/schemas.ts +17 -26
  148. package/src/plugins/listAuthentications/index.ts +8 -0
  149. package/src/plugins/listInputFieldChoices/index.ts +21 -1
  150. package/src/plugins/listInputFieldChoices/schemas.ts +61 -76
  151. package/src/plugins/listInputFields/index.test.ts +5 -9
  152. package/src/plugins/listInputFields/index.ts +20 -2
  153. package/src/plugins/registry/index.ts +8 -2
  154. package/src/plugins/request/index.ts +1 -0
  155. package/src/plugins/runAction/index.ts +18 -0
  156. package/src/resolvers/actionKey.ts +15 -13
  157. package/src/resolvers/actionType.ts +10 -12
  158. package/src/resolvers/appKey.ts +2 -6
  159. package/src/resolvers/authenticationId.ts +25 -19
  160. package/src/resolvers/index.ts +7 -113
  161. package/src/resolvers/inputFieldKey.ts +38 -0
  162. package/src/resolvers/inputs.ts +28 -10
  163. package/src/schemas/Action.ts +8 -3
  164. package/src/schemas/App.ts +7 -9
  165. package/src/schemas/Auth.ts +1 -1
  166. package/src/schemas/Field.ts +24 -57
  167. package/src/schemas/Run.ts +40 -0
  168. package/src/schemas/UserProfile.ts +24 -7
  169. package/src/sdk.ts +17 -7
  170. package/src/types/plugin.ts +5 -0
  171. package/src/types/sdk.ts +5 -0
  172. package/src/utils/domain-utils.ts +9 -67
  173. package/src/utils/schema-utils.ts +96 -44
  174. package/tsconfig.tsbuildinfo +1 -1
@@ -1,91 +1,8 @@
1
- import { appKeyResolver } from "./appKey";
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;AAE9D,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,CAyBF,CAAC"}
@@ -0,0 +1,23 @@
1
+ export const inputFieldKeyResolver = {
2
+ type: "dynamic",
3
+ depends: ["appKey", "actionKey", "actionType", "authenticationId"],
4
+ fetch: async (sdk, resolvedParams) => {
5
+ const fieldsResponse = await sdk.listInputFields({
6
+ appKey: resolvedParams.appKey,
7
+ actionKey: resolvedParams.actionKey,
8
+ actionType: resolvedParams.actionType,
9
+ authenticationId: resolvedParams.authenticationId,
10
+ inputs: resolvedParams.inputs, // Pass along currently resolved inputs
11
+ });
12
+ return fieldsResponse.data;
13
+ },
14
+ prompt: (fields) => ({
15
+ type: "list",
16
+ name: "inputFieldKey",
17
+ message: "Select input field:",
18
+ choices: fields.map((field) => ({
19
+ name: `${field.title || field.key} - ${field.value_type || "No type"} ${field.is_required ? "(required)" : "(optional)"}`,
20
+ value: field.key,
21
+ })),
22
+ }),
23
+ };
@@ -1,8 +1,13 @@
1
- import type { ZapierSdk } from "../types/sdk";
2
- export interface InputsResolver {
3
- type: "fields";
4
- depends: readonly string[];
5
- fetch: (sdk: ZapierSdk, resolvedParams: Record<string, any>) => Promise<any[]>;
6
- }
1
+ import type { FieldsResolver } from "../utils/schema-utils";
2
+ import type { ActionTypeProperty } from "../types/properties";
3
+ type InputsResolver = FieldsResolver<{
4
+ appKey: string;
5
+ actionKey: string;
6
+ actionType: ActionTypeProperty;
7
+ authenticationId: number;
8
+ inputs?: Record<string, unknown>;
9
+ }>;
7
10
  export declare const inputsResolver: InputsResolver;
11
+ export declare const inputsAllOptionalResolver: InputsResolver;
12
+ export {};
8
13
  //# 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,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,QAAQ,CAAC;IACf,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B,KAAK,EAAE,CACL,GAAG,EAAE,SAAS,EACd,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAChC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;CACrB;AAED,eAAO,MAAM,cAAc,EAAE,cAa5B,CAAC"}
1
+ {"version":3,"file":"inputs.d.ts","sourceRoot":"","sources":["../../src/resolvers/inputs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAE9D,KAAK,cAAc,GAAG,cAAc,CAAC;IACnC,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,CAAC,CAAC;AAEH,eAAO,MAAM,cAAc,EAAE,cAa5B,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,cAgBvC,CAAC"}
@@ -12,3 +12,20 @@ export const inputsResolver = {
12
12
  return fieldsResponse.data;
13
13
  },
14
14
  };
15
+ export const inputsAllOptionalResolver = {
16
+ type: "fields",
17
+ depends: ["appKey", "actionKey", "actionType", "authenticationId"],
18
+ fetch: async (sdk, resolvedParams) => {
19
+ const fieldsResponse = await sdk.listInputFields({
20
+ appKey: resolvedParams.appKey,
21
+ actionKey: resolvedParams.actionKey,
22
+ actionType: resolvedParams.actionType,
23
+ authenticationId: resolvedParams.authenticationId,
24
+ inputs: resolvedParams.inputs, // Pass along currently resolved inputs
25
+ });
26
+ return fieldsResponse.data.map((field) => ({
27
+ ...field,
28
+ is_required: false,
29
+ }));
30
+ },
31
+ };
@@ -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" | "text" | "password" | "code" | "filter" | "integer" | "datetime" | "file" | "decimal" | "copy" | "dict" | "json" | undefined;
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" | "text" | "password" | "code" | "filter" | "integer" | "datetime" | "file" | "decimal" | "copy" | "dict" | "json" | undefined;
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" | "run" | "search" | "search_and_write" | "search_or_write" | "write";
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" | "text" | "password" | "code" | "filter" | "integer" | "datetime" | "file" | "decimal" | "copy" | "dict" | "json" | undefined;
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" | "run" | "search" | "search_and_write" | "search_or_write" | "write";
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" | "text" | "password" | "code" | "filter" | "integer" | "datetime" | "file" | "decimal" | "copy" | "dict" | "json" | undefined;
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+B5B,CAAC;AAMF,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
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"}
@@ -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({ text: item.description, style: "dim" });
26
+ details.push({
27
+ text: item.description,
28
+ style: "dim",
29
+ });
27
30
  }
28
31
  return {
29
- title: item.title || item.name || item.key,
30
- subtitle: `(${item.key})`,
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
  },
@@ -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
- title: z.ZodString;
5
- key: z.ZodString;
6
- current_implementation_id: z.ZodString;
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
- slug: z.ZodOptional<z.ZodString>;
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
- current_implementation_id: string;
14
- version?: string | undefined;
95
+ slug: string;
96
+ implementation_id: string;
15
97
  description?: string | undefined;
16
- slug?: string | undefined;
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
- current_implementation_id: string;
21
- version?: string | undefined;
147
+ slug: string;
148
+ implementation_id: string;
22
149
  description?: string | undefined;
23
- slug?: string | undefined;
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;AAGxB,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAMtE,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;EAmBzB,CAAC;AAMF,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,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"}
@@ -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 API schema with computed fields and formatting)
5
+ // App Item Schema (extends ImplementationMetaSchema with transformed fields)
5
6
  // ============================================================================
6
- export const AppItemSchema = withFormatter(z.object({
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(), // Mapped from selected_api
10
- current_implementation_id: z.string(), // From id, keeps the full version
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
- subtitle: `(${item.key})`,
15
+ key: item.key,
16
+ description: item.description,
19
17
  details: [],
20
18
  };
21
19
  },
@@ -28,15 +28,13 @@ export declare const AuthenticationItemSchema: z.ZodObject<Omit<{
28
28
  version: z.ZodOptional<z.ZodString>;
29
29
  user_id: z.ZodOptional<z.ZodNumber>;
30
30
  }, "strip", z.ZodTypeAny, {
31
- date: string;
32
31
  id: number;
32
+ date: string;
33
33
  account_id: number;
34
34
  is_invite_only: boolean;
35
35
  is_private: boolean;
36
36
  shared_with_all: boolean;
37
37
  url?: string | undefined;
38
- title?: string | null | undefined;
39
- version?: string | undefined;
40
38
  label?: string | null | undefined;
41
39
  permissions?: Record<string, boolean> | undefined;
42
40
  lastchanged?: string | undefined;
@@ -45,23 +43,23 @@ export declare const AuthenticationItemSchema: z.ZodObject<Omit<{
45
43
  is_shared?: string | undefined;
46
44
  marked_stale_at?: string | null | undefined;
47
45
  identifier?: string | null | undefined;
46
+ title?: string | null | undefined;
48
47
  groups?: string | undefined;
49
48
  members?: string | undefined;
50
49
  user_id?: number | undefined;
50
+ version?: string | undefined;
51
51
  implementation_id?: string | undefined;
52
52
  is_expired?: string | undefined;
53
53
  expired_at?: string | null | undefined;
54
54
  app_key?: string | undefined;
55
55
  }, {
56
- date: string;
57
56
  id: number;
57
+ date: string;
58
58
  account_id: number;
59
59
  is_invite_only: boolean;
60
60
  is_private: boolean;
61
61
  shared_with_all: boolean;
62
62
  url?: string | undefined;
63
- title?: string | null | undefined;
64
- version?: string | undefined;
65
63
  label?: string | null | undefined;
66
64
  permissions?: Record<string, boolean> | undefined;
67
65
  lastchanged?: string | undefined;
@@ -70,9 +68,11 @@ export declare const AuthenticationItemSchema: z.ZodObject<Omit<{
70
68
  is_shared?: string | undefined;
71
69
  marked_stale_at?: string | null | undefined;
72
70
  identifier?: string | null | undefined;
71
+ title?: string | null | undefined;
73
72
  groups?: string | undefined;
74
73
  members?: string | undefined;
75
74
  user_id?: number | undefined;
75
+ version?: string | undefined;
76
76
  implementation_id?: string | undefined;
77
77
  is_expired?: string | undefined;
78
78
  expired_at?: string | null | undefined;
@@ -107,15 +107,13 @@ export declare const AuthItemSchema: z.ZodObject<Omit<{
107
107
  version: z.ZodOptional<z.ZodString>;
108
108
  user_id: z.ZodOptional<z.ZodNumber>;
109
109
  }, "strip", z.ZodTypeAny, {
110
- date: string;
111
110
  id: number;
111
+ date: string;
112
112
  account_id: number;
113
113
  is_invite_only: boolean;
114
114
  is_private: boolean;
115
115
  shared_with_all: boolean;
116
116
  url?: string | undefined;
117
- title?: string | null | undefined;
118
- version?: string | undefined;
119
117
  label?: string | null | undefined;
120
118
  permissions?: Record<string, boolean> | undefined;
121
119
  lastchanged?: string | undefined;
@@ -124,23 +122,23 @@ export declare const AuthItemSchema: z.ZodObject<Omit<{
124
122
  is_shared?: string | undefined;
125
123
  marked_stale_at?: string | null | undefined;
126
124
  identifier?: string | null | undefined;
125
+ title?: string | null | undefined;
127
126
  groups?: string | undefined;
128
127
  members?: string | undefined;
129
128
  user_id?: number | undefined;
129
+ version?: string | undefined;
130
130
  implementation_id?: string | undefined;
131
131
  is_expired?: string | undefined;
132
132
  expired_at?: string | null | undefined;
133
133
  app_key?: string | undefined;
134
134
  }, {
135
- date: string;
136
135
  id: number;
136
+ date: string;
137
137
  account_id: number;
138
138
  is_invite_only: boolean;
139
139
  is_private: boolean;
140
140
  shared_with_all: boolean;
141
141
  url?: string | undefined;
142
- title?: string | null | undefined;
143
- version?: string | undefined;
144
142
  label?: string | null | undefined;
145
143
  permissions?: Record<string, boolean> | undefined;
146
144
  lastchanged?: string | undefined;
@@ -149,9 +147,11 @@ export declare const AuthItemSchema: z.ZodObject<Omit<{
149
147
  is_shared?: string | undefined;
150
148
  marked_stale_at?: string | null | undefined;
151
149
  identifier?: string | null | undefined;
150
+ title?: string | null | undefined;
152
151
  groups?: string | undefined;
153
152
  members?: string | undefined;
154
153
  user_id?: number | undefined;
154
+ version?: string | undefined;
155
155
  implementation_id?: string | undefined;
156
156
  is_expired?: string | undefined;
157
157
  expired_at?: string | null | undefined;
@@ -32,7 +32,7 @@ export const AuthenticationItemSchema = withFormatter(AuthenticationSchema.omit(
32
32
  }
33
33
  return {
34
34
  title: item.title || `Authentication ${item.id}`,
35
- subtitle: `(ID: ${item.id})`,
35
+ id: item.id?.toString(),
36
36
  details,
37
37
  };
38
38
  },