@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
@@ -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
  },
@@ -1,47 +1,6 @@
1
1
  import { z } from "zod";
2
- export declare const InputFieldItemSchema: z.ZodObject<Omit<{
2
+ export declare const InputFieldItemSchema: z.ZodObject<{
3
3
  key: z.ZodString;
4
- alters_custom_fields: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
5
- capabilities: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
6
- choices: z.ZodOptional<z.ZodArray<z.ZodObject<{
7
- key: z.ZodOptional<z.ZodString>;
8
- label: z.ZodOptional<z.ZodString>;
9
- sample: z.ZodOptional<z.ZodString>;
10
- value: z.ZodOptional<z.ZodString>;
11
- }, "strip", z.ZodTypeAny, {
12
- value?: string | undefined;
13
- key?: string | undefined;
14
- label?: string | undefined;
15
- sample?: string | undefined;
16
- }, {
17
- value?: string | undefined;
18
- key?: string | undefined;
19
- label?: string | undefined;
20
- sample?: string | undefined;
21
- }>, "many">>;
22
- computed: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
23
- custom_field: z.ZodOptional<z.ZodBoolean>;
24
- default: z.ZodOptional<z.ZodString>;
25
- depends_on: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
26
- format: z.ZodOptional<z.ZodLiteral<"SELECT">>;
27
- from_search: z.ZodOptional<z.ZodBoolean>;
28
- from_write: z.ZodOptional<z.ZodBoolean>;
29
- help_text: z.ZodOptional<z.ZodString>;
30
- help_text_html: z.ZodOptional<z.ZodString>;
31
- input_format: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
32
- label: z.ZodOptional<z.ZodString>;
33
- language: z.ZodOptional<z.ZodString>;
34
- parent_key: z.ZodOptional<z.ZodString>;
35
- placeholder: z.ZodOptional<z.ZodString>;
36
- prefill: z.ZodOptional<z.ZodString>;
37
- required: z.ZodOptional<z.ZodBoolean>;
38
- searchfill: z.ZodOptional<z.ZodString>;
39
- send_in_json: z.ZodOptional<z.ZodBoolean>;
40
- regex: z.ZodOptional<z.ZodString>;
41
- type: z.ZodOptional<z.ZodEnum<["integer", "string", "text", "datetime", "boolean", "file", "decimal", "copy", "password", "dict", "code", "filter", "json"]>>;
42
- list: z.ZodOptional<z.ZodBoolean>;
43
- }, "depends_on" | "format" | "placeholder" | "required"> & {
44
- id: z.ZodString;
45
4
  default_value: z.ZodString;
46
5
  depends_on: z.ZodArray<z.ZodString, "many">;
47
6
  description: z.ZodString;
@@ -60,81 +19,29 @@ export declare const InputFieldItemSchema: z.ZodObject<Omit<{
60
19
  }>>;
61
20
  }, "strip", z.ZodTypeAny, {
62
21
  key: string;
63
- title: string;
64
- description: string;
65
22
  depends_on: string[];
66
23
  placeholder: string;
67
- id: string;
24
+ description: string;
25
+ title: string;
68
26
  default_value: string;
69
27
  invalidates_input_fields: boolean;
70
28
  is_required: boolean;
71
29
  value_type: string;
72
- default?: string | undefined;
73
- type?: "string" | "boolean" | "text" | "password" | "code" | "filter" | "integer" | "datetime" | "file" | "decimal" | "copy" | "dict" | "json" | undefined;
74
- label?: string | undefined;
75
- alters_custom_fields?: boolean | null | undefined;
76
- capabilities?: string[] | undefined;
77
- choices?: {
78
- value?: string | undefined;
79
- key?: string | undefined;
80
- label?: string | undefined;
81
- sample?: string | undefined;
82
- }[] | undefined;
83
- computed?: boolean | null | undefined;
84
- custom_field?: boolean | undefined;
85
30
  format?: string | undefined;
86
- from_search?: boolean | undefined;
87
- from_write?: boolean | undefined;
88
- help_text?: string | undefined;
89
- help_text_html?: string | undefined;
90
- input_format?: string[] | undefined;
91
- language?: string | undefined;
92
- parent_key?: string | undefined;
93
- prefill?: string | undefined;
94
- searchfill?: string | undefined;
95
- send_in_json?: boolean | undefined;
96
- regex?: string | undefined;
97
- list?: boolean | undefined;
98
31
  items?: {
99
32
  type: string;
100
33
  } | undefined;
101
34
  }, {
102
35
  key: string;
103
- title: string;
104
- description: string;
105
36
  depends_on: string[];
106
37
  placeholder: string;
107
- id: string;
38
+ description: string;
39
+ title: string;
108
40
  default_value: string;
109
41
  invalidates_input_fields: boolean;
110
42
  is_required: boolean;
111
43
  value_type: string;
112
- default?: string | undefined;
113
- type?: "string" | "boolean" | "text" | "password" | "code" | "filter" | "integer" | "datetime" | "file" | "decimal" | "copy" | "dict" | "json" | undefined;
114
- label?: string | undefined;
115
- alters_custom_fields?: boolean | null | undefined;
116
- capabilities?: string[] | undefined;
117
- choices?: {
118
- value?: string | undefined;
119
- key?: string | undefined;
120
- label?: string | undefined;
121
- sample?: string | undefined;
122
- }[] | undefined;
123
- computed?: boolean | null | undefined;
124
- custom_field?: boolean | undefined;
125
44
  format?: string | undefined;
126
- from_search?: boolean | undefined;
127
- from_write?: boolean | undefined;
128
- help_text?: string | undefined;
129
- help_text_html?: string | undefined;
130
- input_format?: string[] | undefined;
131
- language?: string | undefined;
132
- parent_key?: string | undefined;
133
- prefill?: string | undefined;
134
- searchfill?: string | undefined;
135
- send_in_json?: boolean | undefined;
136
- regex?: string | undefined;
137
- list?: boolean | undefined;
138
45
  items?: {
139
46
  type: string;
140
47
  } | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"Field.d.ts","sourceRoot":"","sources":["../../src/schemas/Field.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkHhC,CAAC;AAMF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAGlE,MAAM,MAAM,SAAS,GAAG,cAAc,CAAC"}
1
+ {"version":3,"file":"Field.d.ts","sourceRoot":"","sources":["../../src/schemas/Field.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkFhC,CAAC;AAMF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAGlE,MAAM,MAAM,SAAS,GAAG,cAAc,CAAC"}
@@ -1,47 +1,44 @@
1
1
  import { z } from "zod";
2
2
  import { withFormatter } from "../utils/schema-utils";
3
- import { NeedSchema } from "../api/schemas";
4
3
  // ============================================================================
5
4
  // Input Field Item Schema (extends API Need schema with computed fields and formatting)
6
5
  // ============================================================================
7
- export const InputFieldItemSchema = withFormatter(NeedSchema.omit({
8
- depends_on: true,
9
- placeholder: true,
10
- required: true,
11
- format: true,
12
- }).extend({
13
- id: z.string(), // Mapped from 'key'
6
+ export const InputFieldItemSchema = withFormatter(z.object({
7
+ key: z.string(), // From need.key
14
8
  default_value: z.string(), // Mapped from 'default' with fallback to ""
15
- depends_on: z.array(z.string()), // Override: mapped from 'depends_on' with fallback to []
9
+ depends_on: z.array(z.string()), // Mapped from 'depends_on' with fallback to []
16
10
  description: z.string(), // Mapped from 'help_text' with fallback to ""
17
11
  invalidates_input_fields: z.boolean(), // Mapped from 'alters_custom_fields' with fallback to false
18
- is_required: z.boolean(), // Override: mapped from 'required' with fallback to false
19
- placeholder: z.string(), // Override: mapped from 'placeholder' with fallback to ""
12
+ is_required: z.boolean(), // Mapped from 'required' with fallback to false
13
+ placeholder: z.string(), // Mapped from 'placeholder' with fallback to ""
20
14
  title: z.string(), // Mapped from 'label' with fallback to ""
21
15
  value_type: z.string(), // Computed from InputFieldType enum
22
- format: z.string().optional(), // Override: computed from InputFieldFormat enum (optional)
16
+ format: z.string().optional(), // Computed from InputFieldFormat enum (optional)
23
17
  items: z.object({ type: z.string() }).optional(), // Computed from ItemsType enum (optional, only for arrays)
24
18
  }), {
25
19
  format: (item) => {
26
20
  const details = [];
27
21
  // Type and required status
28
22
  const typeInfo = [
29
- item.type && `Type: ${item.type}`,
30
- `Required: ${item.required ? "Yes" : "No"}`,
23
+ item.value_type && `Type: ${item.value_type}`,
24
+ `Required: ${item.is_required ? "Yes" : "No"}`,
31
25
  ]
32
26
  .filter(Boolean)
33
27
  .join(" | ");
34
28
  if (typeInfo) {
35
29
  details.push({ text: typeInfo, style: "dim" });
36
30
  }
37
- // Help text
38
- if (item.helpText) {
39
- details.push({ text: item.helpText, style: "normal" });
31
+ // Description
32
+ if (item.description) {
33
+ details.push({
34
+ text: item.description,
35
+ style: "normal",
36
+ });
40
37
  }
41
38
  // Default value
42
- if (item.default !== undefined) {
39
+ if (item.default_value) {
43
40
  details.push({
44
- text: `Default: ${item.default}`,
41
+ text: `Default: ${item.default_value}`,
45
42
  style: "accent",
46
43
  });
47
44
  }
@@ -52,20 +49,10 @@ export const InputFieldItemSchema = withFormatter(NeedSchema.omit({
52
49
  style: "dim",
53
50
  });
54
51
  }
55
- // Choices
56
- if (item.choices && item.choices.length > 0) {
57
- const choiceText = item.choices.length <= 3
58
- ? `Choices: ${item.choices.map((c) => c.label || c.value).join(", ")}`
59
- : `Choices: ${item.choices
60
- .slice(0, 3)
61
- .map((c) => c.label || c.value)
62
- .join(", ")} (+${item.choices.length - 3} more)`;
63
- details.push({ text: choiceText, style: "accent" });
64
- }
65
52
  // Dependencies
66
- if (item.dependsOn && item.dependsOn.length > 0) {
53
+ if (item.depends_on && item.depends_on.length > 0) {
67
54
  details.push({
68
- text: `Depends on: ${item.dependsOn.join(", ")}`,
55
+ text: `Depends on: ${item.depends_on.join(", ")}`,
69
56
  style: "warning",
70
57
  });
71
58
  }
@@ -73,32 +60,17 @@ export const InputFieldItemSchema = withFormatter(NeedSchema.omit({
73
60
  if (item.format) {
74
61
  details.push({ text: `Format: ${item.format}`, style: "dim" });
75
62
  }
76
- // Input format
77
- if (item.inputFormat && item.inputFormat.length > 0) {
63
+ // Items type for arrays
64
+ if (item.items) {
78
65
  details.push({
79
- text: `Input formats: ${item.inputFormat.join(", ")}`,
66
+ text: `Items type: ${item.items.type}`,
80
67
  style: "dim",
81
68
  });
82
69
  }
83
- // Special field flags
84
- const flags = [];
85
- if (item.computed)
86
- flags.push("computed");
87
- if (item.customField)
88
- flags.push("custom");
89
- if (flags.length > 0) {
90
- details.push({
91
- text: `Flags: ${flags.join(", ")}`,
92
- style: "success",
93
- });
94
- }
95
- // Backwards compatibility: show description if no helpText
96
- if (item.description && !item.helpText) {
97
- details.push({ text: item.description, style: "normal" });
98
- }
99
70
  return {
100
- title: item.label || item.name || item.key,
101
- subtitle: `(${item.key})`,
71
+ title: item.title || item.key,
72
+ key: item.key,
73
+ description: item.description,
102
74
  details,
103
75
  };
104
76
  },
@@ -0,0 +1,3 @@
1
+ import { z } from "zod";
2
+ export declare const ActionResultItemSchema: z.ZodUnknown;
3
+ //# sourceMappingURL=Run.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Run.d.ts","sourceRoot":"","sources":["../../src/schemas/Run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAoCxB,eAAO,MAAM,sBAAsB,cAGlC,CAAC"}
@@ -0,0 +1,31 @@
1
+ import { z } from "zod";
2
+ import { withFormatter } from "../utils/schema-utils";
3
+ // Type guard to safely access object properties
4
+ function getStringProperty(obj, key) {
5
+ if (typeof obj === "object" && obj !== null && key in obj) {
6
+ const value = obj[key];
7
+ return typeof value === "string" ? value : undefined;
8
+ }
9
+ return undefined;
10
+ }
11
+ // Formatter for action results - handles any data structure
12
+ function formatActionResult(item) {
13
+ // Try to extract common fields for structured display
14
+ const obj = typeof item === "object" && item !== null ? item : {};
15
+ // Try common title fields
16
+ const title = getStringProperty(obj, "title") ||
17
+ getStringProperty(obj, "name") ||
18
+ getStringProperty(obj, "label") ||
19
+ getStringProperty(obj, "subject") ||
20
+ "Action Result";
21
+ return {
22
+ title,
23
+ id: getStringProperty(obj, "id"),
24
+ key: getStringProperty(obj, "key"),
25
+ description: getStringProperty(obj, "description"),
26
+ data: item, // Let formatJsonOutput handle the JSON rendering
27
+ details: [], // Not used when data is provided
28
+ };
29
+ }
30
+ // Flexible schema for action results - can be any object
31
+ export const ActionResultItemSchema = withFormatter(z.unknown().describe("Action execution result"), { format: formatActionResult });