@zapier/zapier-sdk 0.8.3 → 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 (222) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +17 -40
  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 +1149 -751
  15. package/dist/index.d.mts +2359 -2161
  16. package/dist/index.d.ts +3 -5
  17. package/dist/index.d.ts.map +1 -1
  18. package/dist/index.js +2 -4
  19. package/dist/index.mjs +1143 -743
  20. package/dist/plugins/apps/index.d.ts +4 -0
  21. package/dist/plugins/apps/index.d.ts.map +1 -1
  22. package/dist/plugins/findFirstAuthentication/index.d.ts +1 -1
  23. package/dist/plugins/findFirstAuthentication/index.d.ts.map +1 -1
  24. package/dist/plugins/findFirstAuthentication/index.js +9 -1
  25. package/dist/plugins/findFirstAuthentication/index.test.js +3 -4
  26. package/dist/plugins/findFirstAuthentication/schemas.d.ts +5 -3
  27. package/dist/plugins/findFirstAuthentication/schemas.d.ts.map +1 -1
  28. package/dist/plugins/findUniqueAuthentication/index.d.ts.map +1 -1
  29. package/dist/plugins/findUniqueAuthentication/index.js +4 -0
  30. package/dist/plugins/findUniqueAuthentication/schemas.d.ts +5 -3
  31. package/dist/plugins/findUniqueAuthentication/schemas.d.ts.map +1 -1
  32. package/dist/plugins/getAction/index.d.ts.map +1 -1
  33. package/dist/plugins/getAction/index.js +10 -0
  34. package/dist/plugins/getAction/schemas.d.ts +5 -3
  35. package/dist/plugins/getAction/schemas.d.ts.map +1 -1
  36. package/dist/plugins/getApp/index.d.ts +2 -7
  37. package/dist/plugins/getApp/index.d.ts.map +1 -1
  38. package/dist/plugins/getApp/index.js +17 -9
  39. package/dist/plugins/getApp/index.test.js +3 -3
  40. package/dist/plugins/getApp/schemas.d.ts +3 -1
  41. package/dist/plugins/getApp/schemas.d.ts.map +1 -1
  42. package/dist/plugins/getApp/schemas.js +2 -4
  43. package/dist/plugins/getAuthentication/index.d.ts.map +1 -1
  44. package/dist/plugins/getAuthentication/index.js +8 -0
  45. package/dist/plugins/getAuthentication/index.test.js +1 -1
  46. package/dist/plugins/getProfile/index.d.ts.map +1 -1
  47. package/dist/plugins/getProfile/index.js +4 -0
  48. package/dist/plugins/getProfile/schemas.d.ts.map +1 -1
  49. package/dist/plugins/getProfile/schemas.js +4 -3
  50. package/dist/plugins/listActions/index.d.ts +2 -4
  51. package/dist/plugins/listActions/index.d.ts.map +1 -1
  52. package/dist/plugins/listActions/index.js +10 -1
  53. package/dist/plugins/listActions/index.test.js +4 -4
  54. package/dist/plugins/listActions/schemas.d.ts +5 -3
  55. package/dist/plugins/listActions/schemas.d.ts.map +1 -1
  56. package/dist/plugins/listActions/schemas.js +2 -4
  57. package/dist/plugins/listApps/index.d.ts +4 -7
  58. package/dist/plugins/listApps/index.d.ts.map +1 -1
  59. package/dist/plugins/listApps/index.js +37 -17
  60. package/dist/plugins/listApps/index.test.js +23 -3
  61. package/dist/plugins/listApps/schemas.d.ts.map +1 -1
  62. package/dist/plugins/listApps/schemas.js +3 -9
  63. package/dist/plugins/listAuthentications/index.d.ts +2 -4
  64. package/dist/plugins/listAuthentications/index.d.ts.map +1 -1
  65. package/dist/plugins/listAuthentications/index.js +12 -0
  66. package/dist/plugins/listAuthentications/index.test.js +39 -13
  67. package/dist/plugins/listAuthentications/schemas.d.ts +8 -3
  68. package/dist/plugins/listAuthentications/schemas.d.ts.map +1 -1
  69. package/dist/plugins/listAuthentications/schemas.js +4 -0
  70. package/dist/plugins/listInputFieldChoices/index.d.ts.map +1 -1
  71. package/dist/plugins/listInputFieldChoices/index.js +14 -2
  72. package/dist/plugins/listInputFieldChoices/schemas.d.ts +5 -3
  73. package/dist/plugins/listInputFieldChoices/schemas.d.ts.map +1 -1
  74. package/dist/plugins/listInputFieldChoices/schemas.js +10 -19
  75. package/dist/plugins/listInputFields/index.d.ts.map +1 -1
  76. package/dist/plugins/listInputFields/index.js +14 -2
  77. package/dist/plugins/listInputFields/index.test.js +5 -9
  78. package/dist/plugins/listInputFields/schemas.d.ts +5 -3
  79. package/dist/plugins/listInputFields/schemas.d.ts.map +1 -1
  80. package/dist/plugins/manifest/index.d.ts +25 -9
  81. package/dist/plugins/manifest/index.d.ts.map +1 -1
  82. package/dist/plugins/manifest/index.js +239 -67
  83. package/dist/plugins/manifest/index.test.js +426 -171
  84. package/dist/plugins/manifest/schemas.d.ts +5 -1
  85. package/dist/plugins/manifest/schemas.d.ts.map +1 -1
  86. package/dist/plugins/manifest/schemas.js +1 -0
  87. package/dist/plugins/registry/index.d.ts.map +1 -1
  88. package/dist/plugins/registry/index.js +8 -2
  89. package/dist/plugins/request/index.d.ts.map +1 -1
  90. package/dist/plugins/request/index.js +1 -0
  91. package/dist/plugins/runAction/index.d.ts.map +1 -1
  92. package/dist/plugins/runAction/index.js +12 -0
  93. package/dist/plugins/runAction/schemas.d.ts +5 -3
  94. package/dist/plugins/runAction/schemas.d.ts.map +1 -1
  95. package/dist/resolvers/actionKey.d.ts +13 -7
  96. package/dist/resolvers/actionKey.d.ts.map +1 -1
  97. package/dist/resolvers/actionType.d.ts +8 -7
  98. package/dist/resolvers/actionType.d.ts.map +1 -1
  99. package/dist/resolvers/appKey.d.ts +2 -6
  100. package/dist/resolvers/appKey.d.ts.map +1 -1
  101. package/dist/resolvers/authenticationId.d.ts +7 -7
  102. package/dist/resolvers/authenticationId.d.ts.map +1 -1
  103. package/dist/resolvers/authenticationId.js +16 -7
  104. package/dist/resolvers/index.d.ts +3 -35
  105. package/dist/resolvers/index.d.ts.map +1 -1
  106. package/dist/resolvers/index.js +4 -87
  107. package/dist/resolvers/inputFieldKey.d.ts +11 -0
  108. package/dist/resolvers/inputFieldKey.d.ts.map +1 -0
  109. package/dist/resolvers/inputFieldKey.js +23 -0
  110. package/dist/resolvers/inputs.d.ts +11 -6
  111. package/dist/resolvers/inputs.d.ts.map +1 -1
  112. package/dist/resolvers/inputs.js +17 -0
  113. package/dist/schemas/Action.d.ts +8 -8
  114. package/dist/schemas/Action.d.ts.map +1 -1
  115. package/dist/schemas/Action.js +8 -3
  116. package/dist/schemas/App.d.ts +183 -11
  117. package/dist/schemas/App.d.ts.map +1 -1
  118. package/dist/schemas/App.js +7 -9
  119. package/dist/schemas/Auth.d.ts +12 -12
  120. package/dist/schemas/Auth.js +1 -1
  121. package/dist/schemas/Field.d.ts +5 -98
  122. package/dist/schemas/Field.d.ts.map +1 -1
  123. package/dist/schemas/Field.js +24 -52
  124. package/dist/schemas/Run.d.ts +3 -0
  125. package/dist/schemas/Run.d.ts.map +1 -0
  126. package/dist/schemas/Run.js +31 -0
  127. package/dist/schemas/UserProfile.d.ts +11 -11
  128. package/dist/schemas/UserProfile.d.ts.map +1 -1
  129. package/dist/schemas/UserProfile.js +21 -7
  130. package/dist/sdk.d.ts +15 -14
  131. package/dist/sdk.d.ts.map +1 -1
  132. package/dist/sdk.js +1 -4
  133. package/dist/types/plugin.d.ts +6 -0
  134. package/dist/types/plugin.d.ts.map +1 -1
  135. package/dist/types/properties.d.ts +3 -1
  136. package/dist/types/properties.d.ts.map +1 -1
  137. package/dist/types/sdk.d.ts +11 -3
  138. package/dist/types/sdk.d.ts.map +1 -1
  139. package/dist/utils/domain-utils.d.ts +17 -16
  140. package/dist/utils/domain-utils.d.ts.map +1 -1
  141. package/dist/utils/domain-utils.js +53 -78
  142. package/dist/utils/domain-utils.test.js +157 -3
  143. package/dist/utils/file-utils.d.ts +4 -0
  144. package/dist/utils/file-utils.d.ts.map +1 -0
  145. package/dist/utils/file-utils.js +74 -0
  146. package/dist/utils/file-utils.test.d.ts +2 -0
  147. package/dist/utils/file-utils.test.d.ts.map +1 -0
  148. package/dist/utils/file-utils.test.js +51 -0
  149. package/dist/utils/schema-utils.d.ts +44 -21
  150. package/dist/utils/schema-utils.d.ts.map +1 -1
  151. package/dist/utils/schema-utils.js +17 -11
  152. package/package.json +1 -1
  153. package/src/api/client.ts +12 -0
  154. package/src/api/debug.test.ts +76 -0
  155. package/src/api/debug.ts +46 -2
  156. package/src/api/schemas.ts +51 -29
  157. package/src/index.ts +5 -6
  158. package/src/plugins/apps/index.ts +9 -2
  159. package/src/plugins/findFirstAuthentication/index.test.ts +8 -5
  160. package/src/plugins/findFirstAuthentication/index.ts +14 -2
  161. package/src/plugins/findUniqueAuthentication/index.ts +4 -0
  162. package/src/plugins/getAction/index.ts +14 -0
  163. package/src/plugins/getApp/index.test.ts +3 -3
  164. package/src/plugins/getApp/index.ts +20 -14
  165. package/src/plugins/getApp/schemas.ts +7 -12
  166. package/src/plugins/getAuthentication/index.test.ts +1 -1
  167. package/src/plugins/getAuthentication/index.ts +8 -0
  168. package/src/plugins/getProfile/index.ts +4 -0
  169. package/src/plugins/getProfile/schemas.ts +4 -6
  170. package/src/plugins/listActions/index.test.ts +8 -7
  171. package/src/plugins/listActions/index.ts +12 -3
  172. package/src/plugins/listActions/schemas.ts +20 -25
  173. package/src/plugins/listApps/index.test.ts +24 -3
  174. package/src/plugins/listApps/index.ts +50 -25
  175. package/src/plugins/listApps/schemas.ts +17 -26
  176. package/src/plugins/listAuthentications/index.test.ts +52 -15
  177. package/src/plugins/listAuthentications/index.ts +15 -2
  178. package/src/plugins/listAuthentications/schemas.ts +4 -0
  179. package/src/plugins/listInputFieldChoices/index.ts +21 -1
  180. package/src/plugins/listInputFieldChoices/schemas.ts +61 -76
  181. package/src/plugins/listInputFields/index.test.ts +5 -9
  182. package/src/plugins/listInputFields/index.ts +20 -2
  183. package/src/plugins/manifest/index.test.ts +503 -197
  184. package/src/plugins/manifest/index.ts +338 -82
  185. package/src/plugins/manifest/schemas.ts +9 -2
  186. package/src/plugins/registry/index.ts +8 -2
  187. package/src/plugins/request/index.ts +1 -0
  188. package/src/plugins/runAction/index.ts +18 -0
  189. package/src/resolvers/actionKey.ts +15 -13
  190. package/src/resolvers/actionType.ts +10 -12
  191. package/src/resolvers/appKey.ts +2 -6
  192. package/src/resolvers/authenticationId.ts +25 -19
  193. package/src/resolvers/index.ts +7 -113
  194. package/src/resolvers/inputFieldKey.ts +38 -0
  195. package/src/resolvers/inputs.ts +28 -10
  196. package/src/schemas/Action.ts +8 -3
  197. package/src/schemas/App.ts +7 -9
  198. package/src/schemas/Auth.ts +1 -1
  199. package/src/schemas/Field.ts +24 -57
  200. package/src/schemas/Run.ts +40 -0
  201. package/src/schemas/UserProfile.ts +24 -7
  202. package/src/sdk.ts +18 -12
  203. package/src/types/plugin.ts +8 -0
  204. package/src/types/sdk.ts +31 -21
  205. package/src/utils/domain-utils.test.ts +196 -2
  206. package/src/utils/domain-utils.ts +77 -102
  207. package/src/utils/file-utils.test.ts +73 -0
  208. package/src/utils/file-utils.ts +94 -0
  209. package/src/utils/schema-utils.ts +96 -44
  210. package/tsconfig.tsbuildinfo +1 -1
  211. package/dist/plugins/lockVersion/index.d.ts +0 -24
  212. package/dist/plugins/lockVersion/index.d.ts.map +0 -1
  213. package/dist/plugins/lockVersion/index.js +0 -72
  214. package/dist/plugins/lockVersion/index.test.d.ts +0 -2
  215. package/dist/plugins/lockVersion/index.test.d.ts.map +0 -1
  216. package/dist/plugins/lockVersion/index.test.js +0 -129
  217. package/dist/plugins/lockVersion/schemas.d.ts +0 -10
  218. package/dist/plugins/lockVersion/schemas.d.ts.map +0 -1
  219. package/dist/plugins/lockVersion/schemas.js +0 -6
  220. package/src/plugins/lockVersion/index.test.ts +0 -176
  221. package/src/plugins/lockVersion/index.ts +0 -112
  222. package/src/plugins/lockVersion/schemas.ts +0 -9
@@ -8,4 +8,8 @@ export interface AppsPluginProvides {
8
8
  export declare const appsPlugin: Plugin<GetSdkType<FetchPluginProvides & RunActionPluginProvides>, // requires fetch + runAction in SDK
9
9
  {}, // no context requirements
10
10
  AppsPluginProvides>;
11
+ export type { ActionExecutionOptions } from "./types";
12
+ export type { ActionExecutionResult } from "../../api/types";
13
+ export interface ZapierSdkApps {
14
+ }
11
15
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/apps/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAElE,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,WAAW,CAAC;CACnB;AA4JD,eAAO,MAAM,UAAU,EAAE,MAAM,CAC7B,UAAU,CAAC,mBAAmB,GAAG,uBAAuB,CAAC,EAAE,oCAAoC;AAC/F,EAAE,EAAE,0BAA0B;AAC9B,kBAAkB,CAMnB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/apps/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA0B,WAAW,EAAE,MAAM,SAAS,CAAC;AAEnE,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAElE,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,WAAW,CAAC;CACnB;AA4JD,eAAO,MAAM,UAAU,EAAE,MAAM,CAC7B,UAAU,CAAC,mBAAmB,GAAG,uBAAuB,CAAC,EAAE,oCAAoC;AAC/F,EAAE,EAAE,0BAA0B;AAC9B,kBAAkB,CAMnB,CAAC;AAGF,YAAY,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AACtD,YAAY,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAI7D,MAAM,WAAW,aAAa;CAAG"}
@@ -4,7 +4,7 @@ import { FindFirstAuthenticationSchema, type FindFirstAuthenticationOptions } fr
4
4
  import type { ListAuthenticationsPluginProvides } from "../listAuthentications";
5
5
  export interface FindFirstAuthenticationPluginProvides {
6
6
  findFirstAuthentication: (options?: FindFirstAuthenticationOptions) => Promise<{
7
- data: AuthenticationItem | null;
7
+ data: AuthenticationItem;
8
8
  }>;
9
9
  context: {
10
10
  meta: {
@@ -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,CA8BtC,CAAC"}
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;AAIhF,MAAM,WAAW,qCAAqC;IACpD,uBAAuB,EAAE,CACvB,OAAO,CAAC,EAAE,8BAA8B,KACrC,OAAO,CAAC;QAAE,IAAI,EAAE,kBAAkB,CAAA;KAAE,CAAC,CAAC;IAC3C,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,CAwCtC,CAAC"}
@@ -1,5 +1,7 @@
1
1
  import { FindFirstAuthenticationSchema, } from "./schemas";
2
2
  import { createFunction } from "../../utils/function-utils";
3
+ import { AuthenticationItemSchema } from "../../schemas/Auth";
4
+ import { ZapierResourceNotFoundError } from "../../types/errors";
3
5
  export const findFirstAuthenticationPlugin = ({ sdk }) => {
4
6
  const findFirstAuthentication = createFunction(async function findFirstAuthentication(options = {}) {
5
7
  // Use listAuthentications with maxItems 1 to get the first result
@@ -7,8 +9,11 @@ export const findFirstAuthenticationPlugin = ({ sdk }) => {
7
9
  ...options,
8
10
  maxItems: 1,
9
11
  });
12
+ if (authsResponse.data.length === 0) {
13
+ throw new ZapierResourceNotFoundError("No authentication found matching the specified criteria", { resourceType: "Authentication" });
14
+ }
10
15
  return {
11
- data: authsResponse.data.length > 0 ? authsResponse.data[0] : null,
16
+ data: authsResponse.data[0],
12
17
  };
13
18
  }, FindFirstAuthenticationSchema);
14
19
  return {
@@ -17,7 +22,10 @@ export const findFirstAuthenticationPlugin = ({ sdk }) => {
17
22
  meta: {
18
23
  findFirstAuthentication: {
19
24
  categories: ["authentication"],
25
+ type: "item",
26
+ itemType: "Authentication",
20
27
  inputSchema: FindFirstAuthenticationSchema,
28
+ outputSchema: AuthenticationItemSchema,
21
29
  },
22
30
  },
23
31
  },
@@ -109,15 +109,14 @@ describe("findFirstAuthentication plugin", () => {
109
109
  });
110
110
  expect(result.data).toEqual(mockAuth);
111
111
  });
112
- it("should return null when no authentications found", async () => {
112
+ it("should throw error when no authentications found", async () => {
113
113
  mockListAuthentications.mockResolvedValue({
114
114
  data: [],
115
115
  });
116
116
  const sdk = createTestSdk();
117
- const result = await sdk.findFirstAuthentication({
117
+ await expect(sdk.findFirstAuthentication({
118
118
  appKey: "nonexistent",
119
- });
120
- expect(result.data).toBeNull();
119
+ })).rejects.toThrow("No authentication found matching the specified criteria");
121
120
  });
122
121
  it("should return first authentication when multiple found", async () => {
123
122
  const mockAuth = mockAuthentications[0];
@@ -2,20 +2,22 @@ import { z } from "zod";
2
2
  import type { AuthenticationItem } from "../../types/domain";
3
3
  import type { ZapierAuthenticationError, ZapierApiError, ZapierValidationError, ZapierUnknownError } from "../../types/errors";
4
4
  export declare const FindFirstAuthenticationSchema: z.ZodObject<{
5
- appKey: z.ZodOptional<z.ZodString>;
5
+ appKey: z.ZodOptional<z.ZodString & {
6
+ _def: z.ZodStringDef & import("../..").PositionalMetadata;
7
+ }>;
6
8
  search: z.ZodOptional<z.ZodString>;
7
9
  title: z.ZodOptional<z.ZodString>;
8
10
  accountId: z.ZodOptional<z.ZodString>;
9
11
  owner: z.ZodOptional<z.ZodString>;
10
12
  }, "strip", z.ZodTypeAny, {
11
- title?: string | undefined;
12
13
  search?: string | undefined;
14
+ title?: string | undefined;
13
15
  appKey?: string | undefined;
14
16
  accountId?: string | undefined;
15
17
  owner?: string | undefined;
16
18
  }, {
17
- title?: string | undefined;
18
19
  search?: string | undefined;
20
+ title?: string | undefined;
19
21
  appKey?: string | undefined;
20
22
  accountId?: string | undefined;
21
23
  owner?: string | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/findFirstAuthentication/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EACV,yBAAyB,EACzB,cAAc,EACd,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAG5B,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;EAgBwB,CAAC;AAGnE,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAClD,OAAO,6BAA6B,CACrC,CAAC;AAGF,MAAM,MAAM,4BAA4B,GACpC,yBAAyB,GACzB,cAAc,GACd,qBAAqB,GACrB,kBAAkB,CAAC;AAGvB,MAAM,WAAW,kCAAkC;IACjD,uBAAuB,EAAE,CACvB,OAAO,CAAC,EAAE,8BAA8B,KACrC,OAAO,CAAC;QAAE,IAAI,EAAE,kBAAkB,GAAG,IAAI,CAAA;KAAE,CAAC,CAAC;CACnD"}
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/findFirstAuthentication/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EACV,yBAAyB,EACzB,cAAc,EACd,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAG5B,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;EAgBwB,CAAC;AAGnE,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAClD,OAAO,6BAA6B,CACrC,CAAC;AAGF,MAAM,MAAM,4BAA4B,GACpC,yBAAyB,GACzB,cAAc,GACd,qBAAqB,GACrB,kBAAkB,CAAC;AAGvB,MAAM,WAAW,kCAAkC;IACjD,uBAAuB,EAAE,CACvB,OAAO,CAAC,EAAE,8BAA8B,KACrC,OAAO,CAAC;QAAE,IAAI,EAAE,kBAAkB,GAAG,IAAI,CAAA;KAAE,CAAC,CAAC;CACnD"}
@@ -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,CA2CvC,CAAC"}
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;AAGhF,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,CA8CvC,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import { FindUniqueAuthenticationSchema, } from "./schemas";
2
2
  import { ZapierResourceNotFoundError, ZapierValidationError, } from "../../types/errors";
3
3
  import { createFunction } from "../../utils/function-utils";
4
+ import { AuthenticationItemSchema } from "../../schemas/Auth";
4
5
  export const findUniqueAuthenticationPlugin = ({ sdk }) => {
5
6
  const findUniqueAuthentication = createFunction(async function findUniqueAuthentication(options = {}) {
6
7
  // Use listAuthentications with maxItems 2 to check for uniqueness
@@ -24,7 +25,10 @@ export const findUniqueAuthenticationPlugin = ({ sdk }) => {
24
25
  meta: {
25
26
  findUniqueAuthentication: {
26
27
  categories: ["authentication"],
28
+ type: "item",
29
+ itemType: "Authentication",
27
30
  inputSchema: FindUniqueAuthenticationSchema,
31
+ outputSchema: AuthenticationItemSchema,
28
32
  },
29
33
  },
30
34
  },
@@ -2,20 +2,22 @@ import { z } from "zod";
2
2
  import type { AuthenticationItem } from "../../types/domain";
3
3
  import type { ZapierAuthenticationError, ZapierApiError, ZapierResourceNotFoundError, ZapierValidationError, ZapierUnknownError } from "../../types/errors";
4
4
  export declare const FindUniqueAuthenticationSchema: z.ZodObject<{
5
- appKey: z.ZodOptional<z.ZodString>;
5
+ appKey: z.ZodOptional<z.ZodString & {
6
+ _def: z.ZodStringDef & import("../..").PositionalMetadata;
7
+ }>;
6
8
  search: z.ZodOptional<z.ZodString>;
7
9
  title: z.ZodOptional<z.ZodString>;
8
10
  accountId: z.ZodOptional<z.ZodString>;
9
11
  owner: z.ZodOptional<z.ZodString>;
10
12
  }, "strip", z.ZodTypeAny, {
11
- title?: string | undefined;
12
13
  search?: string | undefined;
14
+ title?: string | undefined;
13
15
  appKey?: string | undefined;
14
16
  accountId?: string | undefined;
15
17
  owner?: string | undefined;
16
18
  }, {
17
- title?: string | undefined;
18
19
  search?: string | undefined;
20
+ title?: string | undefined;
19
21
  appKey?: string | undefined;
20
22
  accountId?: string | undefined;
21
23
  owner?: string | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/findUniqueAuthentication/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EACV,yBAAyB,EACzB,cAAc,EACd,2BAA2B,EAC3B,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAG5B,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;EAgBsB,CAAC;AAGlE,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CACnD,OAAO,8BAA8B,CACtC,CAAC;AAGF,MAAM,MAAM,6BAA6B,GACrC,yBAAyB,GACzB,cAAc,GACd,2BAA2B,GAC3B,qBAAqB,GACrB,kBAAkB,CAAC;AAGvB,MAAM,WAAW,mCAAmC;IAClD,wBAAwB,EAAE,CACxB,OAAO,CAAC,EAAE,+BAA+B,KACtC,OAAO,CAAC;QAAE,IAAI,EAAE,kBAAkB,CAAA;KAAE,CAAC,CAAC;CAC5C"}
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/findUniqueAuthentication/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EACV,yBAAyB,EACzB,cAAc,EACd,2BAA2B,EAC3B,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAG5B,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;EAgBsB,CAAC;AAGlE,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CACnD,OAAO,8BAA8B,CACtC,CAAC;AAGF,MAAM,MAAM,6BAA6B,GACrC,yBAAyB,GACzB,cAAc,GACd,2BAA2B,GAC3B,qBAAqB,GACrB,kBAAkB,CAAC;AAGvB,MAAM,WAAW,mCAAmC;IAClD,wBAAwB,EAAE,CACxB,OAAO,CAAC,EAAE,+BAA+B,KACtC,OAAO,CAAC;QAAE,IAAI,EAAE,kBAAkB,CAAA;KAAE,CAAC,CAAC;CAC5C"}
@@ -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,CAmCxB,CAAC"}
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;AAQhE,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,CA2CxB,CAAC"}
@@ -1,6 +1,8 @@
1
1
  import { GetActionSchema } from "./schemas";
2
2
  import { ZapierResourceNotFoundError } from "../../types/errors";
3
3
  import { createFunction } from "../../utils/function-utils";
4
+ import { appKeyResolver, actionTypeResolver, actionKeyResolver, } from "../../resolvers";
5
+ import { ActionItemSchema } from "../../schemas/Action";
4
6
  export const getActionPlugin = ({ sdk }) => {
5
7
  const getAction = createFunction(async function getAction(options) {
6
8
  const { actionKey, actionType, appKey } = options;
@@ -21,7 +23,15 @@ export const getActionPlugin = ({ sdk }) => {
21
23
  meta: {
22
24
  getAction: {
23
25
  categories: ["action"],
26
+ type: "item",
27
+ itemType: "Action",
24
28
  inputSchema: GetActionSchema,
29
+ outputSchema: ActionItemSchema,
30
+ resolvers: {
31
+ appKey: appKeyResolver,
32
+ actionType: actionTypeResolver,
33
+ actionKey: actionKeyResolver,
34
+ },
25
35
  },
26
36
  },
27
37
  },
@@ -2,16 +2,18 @@ import { z } from "zod";
2
2
  import type { ActionItem } from "../../types/domain";
3
3
  import type { ZapierAuthenticationError, ZapierApiError, ZapierAppNotFoundError, ZapierValidationError, ZapierResourceNotFoundError, ZapierUnknownError } from "../../types/errors";
4
4
  export declare const GetActionSchema: z.ZodObject<{
5
- appKey: z.ZodString;
5
+ appKey: z.ZodString & {
6
+ _def: z.ZodStringDef & import("../..").PositionalMetadata;
7
+ };
6
8
  actionType: z.ZodEnum<["read", "read_bulk", "write", "run", "search", "search_or_write", "search_and_write", "filter"]>;
7
9
  actionKey: z.ZodString;
8
10
  }, "strip", z.ZodTypeAny, {
9
11
  appKey: string;
10
- actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write";
12
+ actionType: "filter" | "read" | "read_bulk" | "write" | "run" | "search" | "search_or_write" | "search_and_write";
11
13
  actionKey: string;
12
14
  }, {
13
15
  appKey: string;
14
- actionType: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write";
16
+ actionType: "filter" | "read" | "read_bulk" | "write" | "run" | "search" | "search_or_write" | "search_and_write";
15
17
  actionKey: string;
16
18
  }>;
17
19
  export type GetActionOptions = z.infer<typeof GetActionSchema>;
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/getAction/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EACV,yBAAyB,EACzB,cAAc,EACd,sBAAsB,EACtB,qBAAqB,EACrB,2BAA2B,EAC3B,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAG5B,eAAO,MAAM,eAAe;;;;;;;;;;;;EAMmC,CAAC;AAGhE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAG/D,MAAM,MAAM,cAAc,GACtB,yBAAyB,GACzB,cAAc,GACd,sBAAsB,GACtB,qBAAqB,GACrB,2BAA2B,GAC3B,kBAAkB,CAAC;AAGvB,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,OAAO,CAAC;QAAE,IAAI,EAAE,UAAU,CAAA;KAAE,CAAC,CAAC;CACzE"}
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/getAction/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EACV,yBAAyB,EACzB,cAAc,EACd,sBAAsB,EACtB,qBAAqB,EACrB,2BAA2B,EAC3B,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAG5B,eAAO,MAAM,eAAe;;;;;;;;;;;;;;EAMmC,CAAC;AAGhE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAG/D,MAAM,MAAM,cAAc,GACtB,yBAAyB,GACzB,cAAc,GACd,sBAAsB,GACtB,qBAAqB,GACrB,2BAA2B,GAC3B,kBAAkB,CAAC;AAGvB,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,OAAO,CAAC;QAAE,IAAI,EAAE,UAAU,CAAA;KAAE,CAAC,CAAC;CACzE"}
@@ -3,8 +3,7 @@ import { GetAppSchema } from "./schemas";
3
3
  import type { GetAppOptions } from "./schemas";
4
4
  import type { AppItem } from "../../types/domain";
5
5
  import type { GetSdkType } from "../../types/plugin";
6
- import type { GetImplementation } from "../manifest/schemas";
7
- import type { ManifestPluginProvides } from "../manifest";
6
+ import type { ListAppsPluginProvides } from "../listApps";
8
7
  export interface GetAppPluginProvides {
9
8
  getApp: (options: GetAppOptions) => Promise<{
10
9
  data: AppItem;
@@ -17,9 +16,5 @@ export interface GetAppPluginProvides {
17
16
  };
18
17
  };
19
18
  }
20
- export declare const getAppPlugin: Plugin<GetSdkType<ManifestPluginProvides>, // depends on manifest plugin with getImplementation in context
21
- {
22
- getImplementation: GetImplementation;
23
- }, //
24
- GetAppPluginProvides>;
19
+ export declare const getAppPlugin: Plugin<GetSdkType<ListAppsPluginProvides>, {}, GetAppPluginProvides>;
25
20
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/getApp/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAG1D,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,OAAO,CAAC;QAAE,IAAI,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IAC/D,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,WAAW,EAAE,OAAO,YAAY,CAAC;aAClC,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAGD,eAAO,MAAM,YAAY,EAAE,MAAM,CAC/B,UAAU,CAAC,sBAAsB,CAAC,EAAE,+DAA+D;AACnG;IAAE,iBAAiB,EAAE,iBAAiB,CAAA;CAAE,EAAE,EAAE;AAC5C,oBAAoB,CA2BrB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/getApp/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAGlD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAI1D,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,OAAO,CAAC;QAAE,IAAI,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IAC/D,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,WAAW,EAAE,OAAO,YAAY,CAAC;aAClC,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAGD,eAAO,MAAM,YAAY,EAAE,MAAM,CAC/B,UAAU,CAAC,sBAAsB,CAAC,EAClC,EAAE,EACF,oBAAoB,CAgCrB,CAAC"}
@@ -1,18 +1,20 @@
1
1
  import { createFunction } from "../../utils/function-utils";
2
2
  import { GetAppSchema } from "./schemas";
3
+ import { AppItemSchema } from "../../schemas/App";
3
4
  import { ZapierAppNotFoundError } from "../../types/errors";
5
+ import { appKeyResolver } from "../../resolvers";
4
6
  // GetApp plugin depends on listApps SDK function
5
- export const getAppPlugin = ({ context }) => {
7
+ export const getAppPlugin = ({ sdk }) => {
6
8
  const getApp = createFunction(async function getApp(options) {
7
- const app = await context.getImplementation(options.appKey);
8
- if (!app) {
9
- throw new ZapierAppNotFoundError("App not found", {
10
- appKey: options.appKey,
11
- });
9
+ const appsIterator = sdk.listApps({ appKeys: [options.appKey] }).items();
10
+ for await (const app of appsIterator) {
11
+ return {
12
+ data: app,
13
+ };
12
14
  }
13
- return {
14
- data: app,
15
- };
15
+ throw new ZapierAppNotFoundError("App not found", {
16
+ appKey: options.appKey,
17
+ });
16
18
  }, GetAppSchema);
17
19
  // Return flat structure - getApp goes directly to SDK
18
20
  return {
@@ -21,7 +23,13 @@ export const getAppPlugin = ({ context }) => {
21
23
  meta: {
22
24
  getApp: {
23
25
  categories: ["app"],
26
+ type: "item",
27
+ itemType: "App",
24
28
  inputSchema: GetAppSchema,
29
+ outputSchema: AppItemSchema,
30
+ resolvers: {
31
+ appKey: appKeyResolver,
32
+ },
25
33
  },
26
34
  },
27
35
  },
@@ -8,8 +8,8 @@ import { manifestPlugin } from "../manifest";
8
8
  function createTestSdk() {
9
9
  return createSdk()
10
10
  .addPlugin(apiPlugin, { fetch: global.fetch })
11
- .addPlugin(listAppsPlugin)
12
11
  .addPlugin(manifestPlugin)
12
+ .addPlugin(listAppsPlugin)
13
13
  .addPlugin(getAppPlugin);
14
14
  }
15
15
  describe("getApp plugin", () => {
@@ -54,7 +54,7 @@ describe("getApp plugin", () => {
54
54
  });
55
55
  expect(result.data.title).toBe("Slack");
56
56
  expect(result.data.key).toBe("SlackCLIAPI");
57
- expect(result.data.current_implementation_id).toBe("SlackCLIAPI@1.0.0");
57
+ expect(result.data.implementation_id).toBe("SlackCLIAPI@1.0.0");
58
58
  expect(result.data.version).toBe("1.0.0");
59
59
  });
60
60
  });
@@ -94,7 +94,7 @@ describe("getApp plugin", () => {
94
94
  });
95
95
  expect(result.data.title).toBeDefined();
96
96
  expect(result.data.key).toBeDefined();
97
- expect(result.data.current_implementation_id).toBeDefined();
97
+ expect(result.data.implementation_id).toBeDefined();
98
98
  expect(result.data.title).toBe("Test App");
99
99
  expect(result.data.key).toBe("TestCLIAPI");
100
100
  });
@@ -3,7 +3,9 @@ import type { AppItem } from "../../types/domain";
3
3
  import type { ZapierApiError, ZapierAppNotFoundError, ZapierValidationError } from "../../types/errors";
4
4
  export type GetAppError = ZapierAppNotFoundError | ZapierApiError | ZapierValidationError;
5
5
  export declare const GetAppSchema: z.ZodObject<{
6
- appKey: z.ZodString;
6
+ appKey: z.ZodString & {
7
+ _def: z.ZodStringDef & import("../..").PositionalMetadata;
8
+ };
7
9
  }, "strip", z.ZodTypeAny, {
8
10
  appKey: string;
9
11
  }, {
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/getApp/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EACV,cAAc,EACd,sBAAsB,EACtB,qBAAqB,EACtB,MAAM,oBAAoB,CAAC;AAK5B,MAAM,MAAM,WAAW,GACnB,sBAAsB,GACtB,cAAc,GACd,qBAAqB,CAAC;AAG1B,eAAO,MAAM,YAAY;;;;;;EASxB,CAAC;AAGF,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAGzD,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,OAAO,CAAC;QAAE,IAAI,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;CAChE"}
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/getApp/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EACV,cAAc,EACd,sBAAsB,EACtB,qBAAqB,EACtB,MAAM,oBAAoB,CAAC;AAK5B,MAAM,MAAM,WAAW,GACnB,sBAAsB,GACtB,cAAc,GACd,qBAAqB,CAAC;AAG1B,eAAO,MAAM,YAAY;;;;;;;;EAMmC,CAAC;AAG7D,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAGzD,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,OAAO,CAAC;QAAE,IAAI,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;CAChE"}
@@ -1,10 +1,8 @@
1
1
  import { z } from "zod";
2
2
  import { AppKeyPropertySchema } from "../../types/properties";
3
- import { withOutputSchema } from "../../utils/schema-utils";
4
- import { AppItemSchema } from "../../schemas/App";
5
3
  // Pure Zod schema - no resolver metadata!
6
- export const GetAppSchema = withOutputSchema(z
4
+ export const GetAppSchema = z
7
5
  .object({
8
6
  appKey: AppKeyPropertySchema.describe("App key of app to fetch (e.g., 'SlackCLIAPI')"),
9
7
  })
10
- .describe("Get detailed information about a specific app"), AppItemSchema);
8
+ .describe("Get detailed information about a specific app");
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/getAuthentication/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EACL,uBAAuB,EACvB,KAAK,wBAAwB,EAC9B,MAAM,WAAW,CAAC;AAQnB,MAAM,WAAW,+BAA+B;IAC9C,iBAAiB,EAAE,CACjB,OAAO,EAAE,wBAAwB,KAC9B,OAAO,CAAC;QAAE,IAAI,EAAE,kBAAkB,CAAA;KAAE,CAAC,CAAC;IAC3C,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,iBAAiB,EAAE;gBACjB,WAAW,EAAE,OAAO,uBAAuB,CAAC;aAC7C,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAC1C,EAAE,EAAE,sBAAsB;AAC1B;IAAE,GAAG,EAAE,SAAS,CAAA;CAAE,EAAE,0BAA0B;AAC9C,+BAA+B,CAuDhC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/getAuthentication/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EACL,uBAAuB,EACvB,KAAK,wBAAwB,EAC9B,MAAM,WAAW,CAAC;AAUnB,MAAM,WAAW,+BAA+B;IAC9C,iBAAiB,EAAE,CACjB,OAAO,EAAE,wBAAwB,KAC9B,OAAO,CAAC;QAAE,IAAI,EAAE,kBAAkB,CAAA;KAAE,CAAC,CAAC;IAC3C,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,iBAAiB,EAAE;gBACjB,WAAW,EAAE,OAAO,uBAAuB,CAAC;aAC7C,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAC1C,EAAE,EAAE,sBAAsB;AAC1B;IAAE,GAAG,EAAE,SAAS,CAAA;CAAE,EAAE,0BAA0B;AAC9C,+BAA+B,CA6DhC,CAAC"}
@@ -2,6 +2,8 @@ import { GetAuthenticationSchema, } from "./schemas";
2
2
  import { ZapierAuthenticationError, ZapierResourceNotFoundError, } from "../../types/errors";
3
3
  import { createFunction } from "../../utils/function-utils";
4
4
  import { normalizeAuthenticationItem } from "../../utils/domain-utils";
5
+ import { authenticationIdGenericResolver } from "../../resolvers";
6
+ import { AuthenticationItemSchema } from "../../schemas/Auth";
5
7
  export const getAuthenticationPlugin = ({ context }) => {
6
8
  const getAuthentication = createFunction(async function getAuthentication(options) {
7
9
  const { api } = context;
@@ -34,7 +36,13 @@ export const getAuthenticationPlugin = ({ context }) => {
34
36
  meta: {
35
37
  getAuthentication: {
36
38
  categories: ["authentication"],
39
+ type: "item",
40
+ itemType: "Authentication",
37
41
  inputSchema: GetAuthenticationSchema,
42
+ outputSchema: AuthenticationItemSchema,
43
+ resolvers: {
44
+ authenticationId: authenticationIdGenericResolver,
45
+ },
38
46
  },
39
47
  },
40
48
  },
@@ -33,8 +33,8 @@ describe("getAuthentication plugin", () => {
33
33
  function createTestSdk() {
34
34
  return createSdk()
35
35
  .addPlugin(apiPlugin)
36
- .addPlugin(listAppsPlugin)
37
36
  .addPlugin(manifestPlugin)
37
+ .addPlugin(listAppsPlugin)
38
38
  .addPlugin(getAuthenticationPlugin);
39
39
  }
40
40
  describe("schema validation", () => {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/getProfile/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,KAAK,EAAe,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE9D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAG7C,MAAM,WAAW,wBAAwB;IACvC,UAAU,EAAE,CACV,OAAO,CAAC,EAAE,iBAAiB,KACxB,OAAO,CAAC;QAAE,IAAI,EAAE,eAAe,CAAA;KAAE,CAAC,CAAC;IACxC,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,UAAU,EAAE;gBACV,WAAW,EAAE,OAAO,gBAAgB,CAAC;aACtC,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAGD,eAAO,MAAM,gBAAgB,EAAE,MAAM,CACnC,EAAE,EAAE,sBAAsB;AAC1B;IAAE,GAAG,EAAE,SAAS,CAAA;CAAE,EAAE,0BAA0B;AAC9C,wBAAwB,CA8BzB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/getProfile/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,KAAK,EAAe,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE9D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAI7C,MAAM,WAAW,wBAAwB;IACvC,UAAU,EAAE,CACV,OAAO,CAAC,EAAE,iBAAiB,KACxB,OAAO,CAAC;QAAE,IAAI,EAAE,eAAe,CAAA;KAAE,CAAC,CAAC;IACxC,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,UAAU,EAAE;gBACV,WAAW,EAAE,OAAO,gBAAgB,CAAC;aACtC,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAGD,eAAO,MAAM,gBAAgB,EAAE,MAAM,CACnC,EAAE,EAAE,sBAAsB;AAC1B;IAAE,GAAG,EAAE,SAAS,CAAA;CAAE,EAAE,0BAA0B;AAC9C,wBAAwB,CAiCzB,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { createFunction } from "../../utils/function-utils";
2
2
  import { GetProfileSchema } from "./schemas";
3
+ import { UserProfileItemSchema } from "../../schemas/UserProfile";
3
4
  // Direct plugin function - takes options + sdk + context in one object
4
5
  export const getProfilePlugin = ({ context }) => {
5
6
  const getProfile = createFunction(async function getProfile() {
@@ -22,7 +23,10 @@ export const getProfilePlugin = ({ context }) => {
22
23
  meta: {
23
24
  getProfile: {
24
25
  categories: ["account"],
26
+ type: "item",
27
+ itemType: "Profile",
25
28
  inputSchema: GetProfileSchema,
29
+ outputSchema: UserProfileItemSchema,
26
30
  },
27
31
  },
28
32
  },
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/getProfile/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAGhF,MAAM,MAAM,eAAe,GAAG,cAAc,GAAG,qBAAqB,CAAC;AAGrE,eAAO,MAAM,gBAAgB,+DAG5B,CAAC;AAGF,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,GAC9D,eAAe,CAAC;AAGlB,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,CACV,OAAO,CAAC,EAAE,iBAAiB,KACxB,OAAO,CAAC;QAAE,IAAI,EAAE,eAAe,CAAA;KAAE,CAAC,CAAC;CACzC"}
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/getProfile/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAGhF,MAAM,MAAM,eAAe,GAAG,cAAc,GAAG,qBAAqB,CAAC;AAGrE,eAAO,MAAM,gBAAgB,+DAGwB,CAAC;AAGtD,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,GAC9D,eAAe,CAAC;AAGlB,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,CACV,OAAO,CAAC,EAAE,iBAAiB,KACxB,OAAO,CAAC;QAAE,IAAI,EAAE,eAAe,CAAA;KAAE,CAAC,CAAC;CACzC"}
@@ -1,5 +1,6 @@
1
1
  import { z } from "zod";
2
- import { withOutputSchema } from "../../utils/schema-utils";
3
- import { UserProfileItemSchema } from "../../schemas/UserProfile";
4
2
  // Pure Zod schema - no resolver metadata!
5
- export const GetProfileSchema = withOutputSchema(z.object({}).optional().describe("Get current user's profile information"), UserProfileItemSchema);
3
+ export const GetProfileSchema = z
4
+ .object({})
5
+ .optional()
6
+ .describe("Get current user's profile information");
@@ -21,10 +21,8 @@ export interface ListActionsPluginProvides {
21
21
  };
22
22
  };
23
23
  }
24
- export declare const listActionsPlugin: Plugin<GetSdkType<ManifestPluginProvides>, // requires getApp in SDK
25
- {
24
+ export declare const listActionsPlugin: Plugin<GetSdkType<ManifestPluginProvides>, {
26
25
  api: ApiClient;
27
26
  getVersionedImplementationId: GetVersionedImplementationId;
28
- }, // requires api and getVersionedImplementationId in context
29
- ListActionsPluginProvides>;
27
+ }, ListActionsPluginProvides>;
30
28
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/listActions/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAkB,MAAM,WAAW,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,EACL,iBAAiB,EACjB,KAAK,kBAAkB,EAExB,MAAM,WAAW,CAAC;AAMnB,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AAExE,MAAM,WAAW,yBAAyB;IACxC,WAAW,EAAE,CAAC,OAAO,CAAC,EAAE,kBAAkB,KAAK,OAAO,CAAC;QACrD,IAAI,EAAE,UAAU,EAAE,CAAC;KACpB,CAAC,GACA,aAAa,CAAC;QAAE,IAAI,EAAE,UAAU,EAAE,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,GAAG;QAC3D,KAAK,IAAI,aAAa,CAAC,UAAU,CAAC,CAAC;KACpC,CAAC;IACJ,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,WAAW,EAAE;gBACX,WAAW,EAAE,OAAO,iBAAiB,CAAC;aACvC,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,iBAAiB,EAAE,MAAM,CACpC,UAAU,CAAC,sBAAsB,CAAC,EAAE,yBAAyB;AAC7D;IACE,GAAG,EAAE,SAAS,CAAC;IACf,4BAA4B,EAAE,4BAA4B,CAAC;CAC5D,EAAE,2DAA2D;AAC9D,yBAAyB,CAkF1B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/listActions/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAkB,MAAM,WAAW,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,EACL,iBAAiB,EACjB,KAAK,kBAAkB,EAExB,MAAM,WAAW,CAAC;AAOnB,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AAGxE,MAAM,WAAW,yBAAyB;IACxC,WAAW,EAAE,CAAC,OAAO,CAAC,EAAE,kBAAkB,KAAK,OAAO,CAAC;QACrD,IAAI,EAAE,UAAU,EAAE,CAAC;KACpB,CAAC,GACA,aAAa,CAAC;QAAE,IAAI,EAAE,UAAU,EAAE,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,GAAG;QAC3D,KAAK,IAAI,aAAa,CAAC,UAAU,CAAC,CAAC;KACpC,CAAC;IACJ,OAAO,EAAE;QACP,IAAI,EAAE;YACJ,WAAW,EAAE;gBACX,WAAW,EAAE,OAAO,iBAAiB,CAAC;aACvC,CAAC;SACH,CAAC;KACH,CAAC;CACH;AAED,eAAO,MAAM,iBAAiB,EAAE,MAAM,CACpC,UAAU,CAAC,sBAAsB,CAAC,EAClC;IACE,GAAG,EAAE,SAAS,CAAC;IACf,4BAA4B,EAAE,4BAA4B,CAAC;CAC5D,EACD,yBAAyB,CAyF1B,CAAC"}
@@ -1,11 +1,13 @@
1
1
  import { normalizeActionItem } from "../../utils/domain-utils";
2
2
  import { ListActionsSchema, } from "./schemas";
3
+ import { ActionItemSchema } from "../../schemas/Action";
3
4
  import { ZapierConfigurationError, ZapierAuthenticationError, } from "../../types/errors";
4
5
  import { createPaginatedFunction } from "../../utils/function-utils";
6
+ import { appKeyResolver, actionTypeResolver } from "../../resolvers";
5
7
  export const listActionsPlugin = ({ context }) => {
6
8
  const listActions = createPaginatedFunction(async function listActionsPage(options) {
7
9
  const { api, getVersionedImplementationId } = context;
8
- // Use the getApp function from the SDK (dependency injection)
10
+ // Use getVersionedImplementationId (optimized to check manifest first)
9
11
  const selectedApi = await getVersionedImplementationId(options.appKey);
10
12
  if (!selectedApi) {
11
13
  throw new ZapierConfigurationError("No current_implementation_id found for app", { configType: "current_implementation_id" });
@@ -53,7 +55,14 @@ export const listActionsPlugin = ({ context }) => {
53
55
  meta: {
54
56
  listActions: {
55
57
  categories: ["action"],
58
+ type: "list",
59
+ itemType: "Action",
56
60
  inputSchema: ListActionsSchema,
61
+ outputSchema: ActionItemSchema,
62
+ resolvers: {
63
+ appKey: appKeyResolver,
64
+ actionType: actionTypeResolver,
65
+ },
57
66
  },
58
67
  },
59
68
  },
@@ -55,6 +55,7 @@ describe("listActions plugin", () => {
55
55
  .fn()
56
56
  .mockResolvedValue("SlackCLIAPI@1.21.1");
57
57
  });
58
+ const mockResolveAppKeys = vi.fn().mockResolvedValue([]);
58
59
  function createTestSdk() {
59
60
  // Create a proper plugin chain with context dependencies
60
61
  // Build SDK with proper plugin composition, providing API in initial context
@@ -62,18 +63,17 @@ describe("listActions plugin", () => {
62
63
  .addPlugin(() => ({
63
64
  context: {
64
65
  api: mockApiClient,
65
- getVersionedImplementationId: mockGetVersionedImplementationId,
66
66
  },
67
67
  }))
68
- .addPlugin(listAppsPlugin)
69
68
  .addPlugin(() => ({
70
69
  context: {
71
70
  manifest: null,
72
- getManifestEntry: () => null,
73
71
  getVersionedImplementationId: mockGetVersionedImplementationId,
74
- getImplementation: () => Promise.resolve(null),
72
+ resolveAppKeys: mockResolveAppKeys,
73
+ updateManifestEntry: vi.fn().mockResolvedValue(["test-key", {}]),
75
74
  },
76
75
  }))
76
+ .addPlugin(listAppsPlugin)
77
77
  .addPlugin(listActionsPlugin);
78
78
  }
79
79
  describe("schema validation", () => {
@@ -3,18 +3,20 @@ import type { ActionItem } from "../../types/domain";
3
3
  import type { PaginatedSdkFunction } from "../../types/functions";
4
4
  import type { ZapierAuthenticationError, ZapierValidationError, ZapierUnknownError } from "../../types/errors";
5
5
  export declare const ListActionsSchema: z.ZodObject<{
6
- appKey: z.ZodString;
6
+ appKey: z.ZodString & {
7
+ _def: z.ZodStringDef & import("../..").PositionalMetadata;
8
+ };
7
9
  actionType: z.ZodOptional<z.ZodEnum<["read", "read_bulk", "write", "run", "search", "search_or_write", "search_and_write", "filter"]>>;
8
10
  pageSize: z.ZodOptional<z.ZodNumber>;
9
11
  maxItems: z.ZodOptional<z.ZodNumber>;
10
12
  }, "strip", z.ZodTypeAny, {
11
13
  appKey: string;
12
- actionType?: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write" | undefined;
14
+ actionType?: "filter" | "read" | "read_bulk" | "write" | "run" | "search" | "search_or_write" | "search_and_write" | undefined;
13
15
  pageSize?: number | undefined;
14
16
  maxItems?: number | undefined;
15
17
  }, {
16
18
  appKey: string;
17
- actionType?: "filter" | "read" | "read_bulk" | "run" | "search" | "search_and_write" | "search_or_write" | "write" | undefined;
19
+ actionType?: "filter" | "read" | "read_bulk" | "write" | "run" | "search" | "search_or_write" | "search_and_write" | undefined;
18
20
  pageSize?: number | undefined;
19
21
  maxItems?: number | undefined;
20
22
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/listActions/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,KAAK,EACV,yBAAyB,EACzB,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAG5B,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;EAsB7B,CAAC;AAGF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAGnE,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,UAAU,EAAE,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAGD,MAAM,MAAM,gBAAgB,GACxB,yBAAyB,GACzB,qBAAqB,GACrB,kBAAkB,CAAC;AAGvB,MAAM,WAAW,sBAAsB;IACrC,WAAW,EAAE,oBAAoB,CAAC,kBAAkB,EAAE,UAAU,CAAC,CAAC;CACnE"}
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/plugins/listActions/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,KAAK,EACV,yBAAyB,EACzB,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAG5B,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;EAmBoB,CAAC;AAGnD,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAGnE,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,UAAU,EAAE,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAGD,MAAM,MAAM,gBAAgB,GACxB,yBAAyB,GACzB,qBAAqB,GACrB,kBAAkB,CAAC;AAGvB,MAAM,WAAW,sBAAsB;IACrC,WAAW,EAAE,oBAAoB,CAAC,kBAAkB,EAAE,UAAU,CAAC,CAAC;CACnE"}
@@ -1,9 +1,7 @@
1
1
  import { z } from "zod";
2
2
  import { AppKeyPropertySchema, ActionTypePropertySchema, } from "../../types/properties";
3
- import { withOutputSchema } from "../../utils/schema-utils";
4
- import { ActionItemSchema } from "../../schemas/Action";
5
3
  // Pure Zod schema - no resolver metadata!
6
- export const ListActionsSchema = withOutputSchema(z
4
+ export const ListActionsSchema = z
7
5
  .object({
8
6
  appKey: AppKeyPropertySchema.describe("App key of actions to list (e.g., 'SlackCLIAPI')"),
9
7
  actionType: ActionTypePropertySchema.optional().describe("Filter actions by type"),
@@ -18,4 +16,4 @@ export const ListActionsSchema = withOutputSchema(z
18
16
  .optional()
19
17
  .describe("Maximum total items to return across all pages"),
20
18
  })
21
- .describe("List all actions for a specific app"), ActionItemSchema);
19
+ .describe("List all actions for a specific app");