@zapier/zapier-sdk 0.15.0 → 0.15.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/README.md +28 -0
- package/dist/api/client.d.ts.map +1 -1
- package/dist/api/client.integration.test.d.ts +5 -0
- package/dist/api/client.integration.test.d.ts.map +1 -0
- package/dist/api/client.integration.test.js +318 -0
- package/dist/api/client.js +31 -1
- package/dist/api/schemas.d.ts +3 -0
- package/dist/api/schemas.d.ts.map +1 -1
- package/dist/api/schemas.js +1 -0
- package/dist/index.cjs +386 -106
- package/dist/index.d.mts +290 -33
- package/dist/index.mjs +386 -106
- package/dist/plugins/getApp/index.test.js +17 -21
- package/dist/plugins/getInputFieldsSchema/index.d.ts +22 -0
- package/dist/plugins/getInputFieldsSchema/index.d.ts.map +1 -0
- package/dist/plugins/getInputFieldsSchema/index.js +51 -0
- package/dist/plugins/getInputFieldsSchema/index.test.d.ts +2 -0
- package/dist/plugins/getInputFieldsSchema/index.test.d.ts.map +1 -0
- package/dist/plugins/getInputFieldsSchema/index.test.js +288 -0
- package/dist/plugins/getInputFieldsSchema/schemas.d.ts +31 -0
- package/dist/plugins/getInputFieldsSchema/schemas.d.ts.map +1 -0
- package/dist/plugins/getInputFieldsSchema/schemas.js +13 -0
- package/dist/plugins/listActions/schemas.d.ts +4 -4
- package/dist/plugins/listApps/index.d.ts +1 -3
- package/dist/plugins/listApps/index.d.ts.map +1 -1
- package/dist/plugins/listApps/index.js +18 -44
- package/dist/plugins/listApps/index.test.js +89 -288
- package/dist/plugins/listApps/schemas.d.ts +19 -26
- package/dist/plugins/listApps/schemas.d.ts.map +1 -1
- package/dist/plugins/listApps/schemas.js +19 -18
- package/dist/plugins/listAuthentications/schemas.d.ts +4 -4
- package/dist/plugins/listInputFieldChoices/schemas.d.ts +4 -4
- package/dist/plugins/listInputFields/index.d.ts.map +1 -1
- package/dist/plugins/listInputFields/index.js +2 -0
- package/dist/plugins/listInputFields/schemas.d.ts +4 -4
- package/dist/plugins/runAction/schemas.d.ts +4 -4
- package/dist/sdk.d.ts +8 -2
- package/dist/sdk.d.ts.map +1 -1
- package/dist/sdk.js +2 -0
- package/dist/temporary-internal-core/handlers/listApps.d.ts +67 -0
- package/dist/temporary-internal-core/handlers/listApps.d.ts.map +1 -0
- package/dist/temporary-internal-core/handlers/listApps.js +121 -0
- package/dist/temporary-internal-core/handlers/listApps.test.d.ts +2 -0
- package/dist/temporary-internal-core/handlers/listApps.test.d.ts.map +1 -0
- package/dist/temporary-internal-core/handlers/listApps.test.js +328 -0
- package/dist/temporary-internal-core/index.d.ts +18 -0
- package/dist/temporary-internal-core/index.d.ts.map +1 -0
- package/dist/temporary-internal-core/index.js +18 -0
- package/dist/temporary-internal-core/schemas/apps/index.d.ts +582 -0
- package/dist/temporary-internal-core/schemas/apps/index.d.ts.map +1 -0
- package/dist/temporary-internal-core/schemas/apps/index.js +95 -0
- package/dist/temporary-internal-core/schemas/implementations/index.d.ts +511 -0
- package/dist/temporary-internal-core/schemas/implementations/index.d.ts.map +1 -0
- package/dist/temporary-internal-core/schemas/implementations/index.js +79 -0
- package/dist/temporary-internal-core/types/handler.d.ts +51 -0
- package/dist/temporary-internal-core/types/handler.d.ts.map +1 -0
- package/dist/temporary-internal-core/types/handler.js +8 -0
- package/dist/temporary-internal-core/types/index.d.ts +5 -0
- package/dist/temporary-internal-core/types/index.d.ts.map +1 -0
- package/dist/temporary-internal-core/types/index.js +4 -0
- package/dist/temporary-internal-core/utils/app-locators.d.ts +54 -0
- package/dist/temporary-internal-core/utils/app-locators.d.ts.map +1 -0
- package/dist/temporary-internal-core/utils/app-locators.js +83 -0
- package/dist/temporary-internal-core/utils/transformations.d.ts +18 -0
- package/dist/temporary-internal-core/utils/transformations.d.ts.map +1 -0
- package/dist/temporary-internal-core/utils/transformations.js +36 -0
- package/dist/types/sdk.d.ts +2 -1
- package/dist/types/sdk.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,582 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* App and Service schemas
|
|
3
|
+
*
|
|
4
|
+
* Covers:
|
|
5
|
+
* - App metadata
|
|
6
|
+
* - Service definitions
|
|
7
|
+
* - App listings and searches
|
|
8
|
+
*/
|
|
9
|
+
import { z } from "zod";
|
|
10
|
+
/**
|
|
11
|
+
* Public API schema for listApps operation
|
|
12
|
+
*
|
|
13
|
+
* This is the user-facing schema that accepts app keys (slugs, implementation names, etc.)
|
|
14
|
+
* The plugin resolves these to implementation IDs before calling the handler.
|
|
15
|
+
*/
|
|
16
|
+
export declare const ListAppsOptionsSchema: z.ZodObject<{
|
|
17
|
+
appKeys: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
18
|
+
search: z.ZodOptional<z.ZodString>;
|
|
19
|
+
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
20
|
+
maxItems: z.ZodOptional<z.ZodNumber>;
|
|
21
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
22
|
+
}, "strip", z.ZodTypeAny, {
|
|
23
|
+
search?: string | undefined;
|
|
24
|
+
appKeys?: string[] | undefined;
|
|
25
|
+
pageSize?: number | undefined;
|
|
26
|
+
maxItems?: number | undefined;
|
|
27
|
+
cursor?: string | undefined;
|
|
28
|
+
}, {
|
|
29
|
+
search?: string | undefined;
|
|
30
|
+
appKeys?: string[] | undefined;
|
|
31
|
+
pageSize?: number | undefined;
|
|
32
|
+
maxItems?: number | undefined;
|
|
33
|
+
cursor?: string | undefined;
|
|
34
|
+
}>;
|
|
35
|
+
export type ListAppsOptions = z.infer<typeof ListAppsOptionsSchema>;
|
|
36
|
+
/**
|
|
37
|
+
* Normalized app item returned by listApps
|
|
38
|
+
* This extends ImplementationMetaSchema with transformed fields (title, key, implementation_id)
|
|
39
|
+
*/
|
|
40
|
+
export declare const AppItemSchema: z.ZodObject<{
|
|
41
|
+
categories: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
42
|
+
id: z.ZodNumber;
|
|
43
|
+
name: z.ZodString;
|
|
44
|
+
slug: z.ZodString;
|
|
45
|
+
}, "strip", z.ZodTypeAny, {
|
|
46
|
+
id: number;
|
|
47
|
+
name: string;
|
|
48
|
+
slug: string;
|
|
49
|
+
}, {
|
|
50
|
+
id: number;
|
|
51
|
+
name: string;
|
|
52
|
+
slug: string;
|
|
53
|
+
}>, "many">>;
|
|
54
|
+
actions: z.ZodOptional<z.ZodObject<{
|
|
55
|
+
read: z.ZodOptional<z.ZodNumber>;
|
|
56
|
+
read_bulk: z.ZodOptional<z.ZodNumber>;
|
|
57
|
+
write: z.ZodOptional<z.ZodNumber>;
|
|
58
|
+
search: z.ZodOptional<z.ZodNumber>;
|
|
59
|
+
search_or_write: z.ZodOptional<z.ZodNumber>;
|
|
60
|
+
search_and_write: z.ZodOptional<z.ZodNumber>;
|
|
61
|
+
filter: z.ZodOptional<z.ZodNumber>;
|
|
62
|
+
}, "strip", z.ZodTypeAny, {
|
|
63
|
+
search?: number | undefined;
|
|
64
|
+
filter?: number | undefined;
|
|
65
|
+
read?: number | undefined;
|
|
66
|
+
read_bulk?: number | undefined;
|
|
67
|
+
search_and_write?: number | undefined;
|
|
68
|
+
search_or_write?: number | undefined;
|
|
69
|
+
write?: number | undefined;
|
|
70
|
+
}, {
|
|
71
|
+
search?: number | undefined;
|
|
72
|
+
filter?: number | undefined;
|
|
73
|
+
read?: number | undefined;
|
|
74
|
+
read_bulk?: number | undefined;
|
|
75
|
+
search_and_write?: number | undefined;
|
|
76
|
+
search_or_write?: number | undefined;
|
|
77
|
+
write?: number | undefined;
|
|
78
|
+
}>>;
|
|
79
|
+
description: z.ZodOptional<z.ZodString>;
|
|
80
|
+
is_hidden: z.ZodOptional<z.ZodBoolean>;
|
|
81
|
+
age_in_days: z.ZodOptional<z.ZodNumber>;
|
|
82
|
+
api_docs_url: z.ZodOptional<z.ZodString>;
|
|
83
|
+
banner: z.ZodOptional<z.ZodString>;
|
|
84
|
+
image: z.ZodOptional<z.ZodString>;
|
|
85
|
+
images: z.ZodOptional<z.ZodObject<{
|
|
86
|
+
url_16x16: z.ZodOptional<z.ZodString>;
|
|
87
|
+
url_32x32: z.ZodOptional<z.ZodString>;
|
|
88
|
+
url_64x64: z.ZodOptional<z.ZodString>;
|
|
89
|
+
url_128x128: z.ZodOptional<z.ZodString>;
|
|
90
|
+
}, "strip", z.ZodTypeAny, {
|
|
91
|
+
url_16x16?: string | undefined;
|
|
92
|
+
url_32x32?: string | undefined;
|
|
93
|
+
url_64x64?: string | undefined;
|
|
94
|
+
url_128x128?: string | undefined;
|
|
95
|
+
}, {
|
|
96
|
+
url_16x16?: string | undefined;
|
|
97
|
+
url_32x32?: string | undefined;
|
|
98
|
+
url_64x64?: string | undefined;
|
|
99
|
+
url_128x128?: string | undefined;
|
|
100
|
+
}>>;
|
|
101
|
+
is_beta: z.ZodOptional<z.ZodBoolean>;
|
|
102
|
+
is_built_in: z.ZodOptional<z.ZodBoolean>;
|
|
103
|
+
is_featured: z.ZodOptional<z.ZodBoolean>;
|
|
104
|
+
is_premium: z.ZodOptional<z.ZodBoolean>;
|
|
105
|
+
is_public: z.ZodOptional<z.ZodBoolean>;
|
|
106
|
+
is_upcoming: z.ZodOptional<z.ZodBoolean>;
|
|
107
|
+
popularity: z.ZodOptional<z.ZodNumber>;
|
|
108
|
+
primary_color: z.ZodOptional<z.ZodString>;
|
|
109
|
+
slug: z.ZodString;
|
|
110
|
+
auth_type: z.ZodOptional<z.ZodString>;
|
|
111
|
+
is_deprecated: z.ZodOptional<z.ZodBoolean>;
|
|
112
|
+
secondary_color: z.ZodOptional<z.ZodString>;
|
|
113
|
+
has_filters: z.ZodOptional<z.ZodBoolean>;
|
|
114
|
+
has_reads: z.ZodOptional<z.ZodBoolean>;
|
|
115
|
+
has_searches: z.ZodOptional<z.ZodBoolean>;
|
|
116
|
+
has_searches_or_writes: z.ZodOptional<z.ZodBoolean>;
|
|
117
|
+
has_upfront_fields: z.ZodOptional<z.ZodBoolean>;
|
|
118
|
+
has_writes: z.ZodOptional<z.ZodBoolean>;
|
|
119
|
+
is_invite: z.ZodOptional<z.ZodBoolean>;
|
|
120
|
+
visibility: z.ZodOptional<z.ZodString>;
|
|
121
|
+
classification: z.ZodOptional<z.ZodString>;
|
|
122
|
+
} & {
|
|
123
|
+
title: z.ZodString;
|
|
124
|
+
key: z.ZodString;
|
|
125
|
+
implementation_id: z.ZodString;
|
|
126
|
+
version: z.ZodOptional<z.ZodString>;
|
|
127
|
+
}, "strip", z.ZodTypeAny, {
|
|
128
|
+
key: string;
|
|
129
|
+
title: string;
|
|
130
|
+
slug: string;
|
|
131
|
+
implementation_id: string;
|
|
132
|
+
categories?: {
|
|
133
|
+
id: number;
|
|
134
|
+
name: string;
|
|
135
|
+
slug: string;
|
|
136
|
+
}[] | undefined;
|
|
137
|
+
actions?: {
|
|
138
|
+
search?: number | undefined;
|
|
139
|
+
filter?: number | undefined;
|
|
140
|
+
read?: number | undefined;
|
|
141
|
+
read_bulk?: number | undefined;
|
|
142
|
+
search_and_write?: number | undefined;
|
|
143
|
+
search_or_write?: number | undefined;
|
|
144
|
+
write?: number | undefined;
|
|
145
|
+
} | undefined;
|
|
146
|
+
description?: string | undefined;
|
|
147
|
+
is_hidden?: boolean | undefined;
|
|
148
|
+
age_in_days?: number | undefined;
|
|
149
|
+
api_docs_url?: string | undefined;
|
|
150
|
+
banner?: string | undefined;
|
|
151
|
+
image?: string | undefined;
|
|
152
|
+
images?: {
|
|
153
|
+
url_16x16?: string | undefined;
|
|
154
|
+
url_32x32?: string | undefined;
|
|
155
|
+
url_64x64?: string | undefined;
|
|
156
|
+
url_128x128?: string | undefined;
|
|
157
|
+
} | undefined;
|
|
158
|
+
is_beta?: boolean | undefined;
|
|
159
|
+
is_built_in?: boolean | undefined;
|
|
160
|
+
is_featured?: boolean | undefined;
|
|
161
|
+
is_premium?: boolean | undefined;
|
|
162
|
+
is_public?: boolean | undefined;
|
|
163
|
+
is_upcoming?: boolean | undefined;
|
|
164
|
+
popularity?: number | undefined;
|
|
165
|
+
primary_color?: string | undefined;
|
|
166
|
+
auth_type?: string | undefined;
|
|
167
|
+
is_deprecated?: boolean | undefined;
|
|
168
|
+
secondary_color?: string | undefined;
|
|
169
|
+
has_filters?: boolean | undefined;
|
|
170
|
+
has_reads?: boolean | undefined;
|
|
171
|
+
has_searches?: boolean | undefined;
|
|
172
|
+
has_searches_or_writes?: boolean | undefined;
|
|
173
|
+
has_upfront_fields?: boolean | undefined;
|
|
174
|
+
has_writes?: boolean | undefined;
|
|
175
|
+
is_invite?: boolean | undefined;
|
|
176
|
+
version?: string | undefined;
|
|
177
|
+
visibility?: string | undefined;
|
|
178
|
+
classification?: string | undefined;
|
|
179
|
+
}, {
|
|
180
|
+
key: string;
|
|
181
|
+
title: string;
|
|
182
|
+
slug: string;
|
|
183
|
+
implementation_id: string;
|
|
184
|
+
categories?: {
|
|
185
|
+
id: number;
|
|
186
|
+
name: string;
|
|
187
|
+
slug: string;
|
|
188
|
+
}[] | undefined;
|
|
189
|
+
actions?: {
|
|
190
|
+
search?: number | undefined;
|
|
191
|
+
filter?: number | undefined;
|
|
192
|
+
read?: number | undefined;
|
|
193
|
+
read_bulk?: number | undefined;
|
|
194
|
+
search_and_write?: number | undefined;
|
|
195
|
+
search_or_write?: number | undefined;
|
|
196
|
+
write?: number | undefined;
|
|
197
|
+
} | undefined;
|
|
198
|
+
description?: string | undefined;
|
|
199
|
+
is_hidden?: boolean | undefined;
|
|
200
|
+
age_in_days?: number | undefined;
|
|
201
|
+
api_docs_url?: string | undefined;
|
|
202
|
+
banner?: string | undefined;
|
|
203
|
+
image?: string | undefined;
|
|
204
|
+
images?: {
|
|
205
|
+
url_16x16?: string | undefined;
|
|
206
|
+
url_32x32?: string | undefined;
|
|
207
|
+
url_64x64?: string | undefined;
|
|
208
|
+
url_128x128?: string | undefined;
|
|
209
|
+
} | undefined;
|
|
210
|
+
is_beta?: boolean | undefined;
|
|
211
|
+
is_built_in?: boolean | undefined;
|
|
212
|
+
is_featured?: boolean | undefined;
|
|
213
|
+
is_premium?: boolean | undefined;
|
|
214
|
+
is_public?: boolean | undefined;
|
|
215
|
+
is_upcoming?: boolean | undefined;
|
|
216
|
+
popularity?: number | undefined;
|
|
217
|
+
primary_color?: string | undefined;
|
|
218
|
+
auth_type?: string | undefined;
|
|
219
|
+
is_deprecated?: boolean | undefined;
|
|
220
|
+
secondary_color?: string | undefined;
|
|
221
|
+
has_filters?: boolean | undefined;
|
|
222
|
+
has_reads?: boolean | undefined;
|
|
223
|
+
has_searches?: boolean | undefined;
|
|
224
|
+
has_searches_or_writes?: boolean | undefined;
|
|
225
|
+
has_upfront_fields?: boolean | undefined;
|
|
226
|
+
has_writes?: boolean | undefined;
|
|
227
|
+
is_invite?: boolean | undefined;
|
|
228
|
+
version?: string | undefined;
|
|
229
|
+
visibility?: string | undefined;
|
|
230
|
+
classification?: string | undefined;
|
|
231
|
+
}>;
|
|
232
|
+
export type AppItem = z.infer<typeof AppItemSchema>;
|
|
233
|
+
/**
|
|
234
|
+
* Response schema for listApps (paginated)
|
|
235
|
+
*/
|
|
236
|
+
export declare const ListAppsResponseSchema: z.ZodObject<{
|
|
237
|
+
data: z.ZodArray<z.ZodObject<{
|
|
238
|
+
categories: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
239
|
+
id: z.ZodNumber;
|
|
240
|
+
name: z.ZodString;
|
|
241
|
+
slug: z.ZodString;
|
|
242
|
+
}, "strip", z.ZodTypeAny, {
|
|
243
|
+
id: number;
|
|
244
|
+
name: string;
|
|
245
|
+
slug: string;
|
|
246
|
+
}, {
|
|
247
|
+
id: number;
|
|
248
|
+
name: string;
|
|
249
|
+
slug: string;
|
|
250
|
+
}>, "many">>;
|
|
251
|
+
actions: z.ZodOptional<z.ZodObject<{
|
|
252
|
+
read: z.ZodOptional<z.ZodNumber>;
|
|
253
|
+
read_bulk: z.ZodOptional<z.ZodNumber>;
|
|
254
|
+
write: z.ZodOptional<z.ZodNumber>;
|
|
255
|
+
search: z.ZodOptional<z.ZodNumber>;
|
|
256
|
+
search_or_write: z.ZodOptional<z.ZodNumber>;
|
|
257
|
+
search_and_write: z.ZodOptional<z.ZodNumber>;
|
|
258
|
+
filter: z.ZodOptional<z.ZodNumber>;
|
|
259
|
+
}, "strip", z.ZodTypeAny, {
|
|
260
|
+
search?: number | undefined;
|
|
261
|
+
filter?: number | undefined;
|
|
262
|
+
read?: number | undefined;
|
|
263
|
+
read_bulk?: number | undefined;
|
|
264
|
+
search_and_write?: number | undefined;
|
|
265
|
+
search_or_write?: number | undefined;
|
|
266
|
+
write?: number | undefined;
|
|
267
|
+
}, {
|
|
268
|
+
search?: number | undefined;
|
|
269
|
+
filter?: number | undefined;
|
|
270
|
+
read?: number | undefined;
|
|
271
|
+
read_bulk?: number | undefined;
|
|
272
|
+
search_and_write?: number | undefined;
|
|
273
|
+
search_or_write?: number | undefined;
|
|
274
|
+
write?: number | undefined;
|
|
275
|
+
}>>;
|
|
276
|
+
description: z.ZodOptional<z.ZodString>;
|
|
277
|
+
is_hidden: z.ZodOptional<z.ZodBoolean>;
|
|
278
|
+
age_in_days: z.ZodOptional<z.ZodNumber>;
|
|
279
|
+
api_docs_url: z.ZodOptional<z.ZodString>;
|
|
280
|
+
banner: z.ZodOptional<z.ZodString>;
|
|
281
|
+
image: z.ZodOptional<z.ZodString>;
|
|
282
|
+
images: z.ZodOptional<z.ZodObject<{
|
|
283
|
+
url_16x16: z.ZodOptional<z.ZodString>;
|
|
284
|
+
url_32x32: z.ZodOptional<z.ZodString>;
|
|
285
|
+
url_64x64: z.ZodOptional<z.ZodString>;
|
|
286
|
+
url_128x128: z.ZodOptional<z.ZodString>;
|
|
287
|
+
}, "strip", z.ZodTypeAny, {
|
|
288
|
+
url_16x16?: string | undefined;
|
|
289
|
+
url_32x32?: string | undefined;
|
|
290
|
+
url_64x64?: string | undefined;
|
|
291
|
+
url_128x128?: string | undefined;
|
|
292
|
+
}, {
|
|
293
|
+
url_16x16?: string | undefined;
|
|
294
|
+
url_32x32?: string | undefined;
|
|
295
|
+
url_64x64?: string | undefined;
|
|
296
|
+
url_128x128?: string | undefined;
|
|
297
|
+
}>>;
|
|
298
|
+
is_beta: z.ZodOptional<z.ZodBoolean>;
|
|
299
|
+
is_built_in: z.ZodOptional<z.ZodBoolean>;
|
|
300
|
+
is_featured: z.ZodOptional<z.ZodBoolean>;
|
|
301
|
+
is_premium: z.ZodOptional<z.ZodBoolean>;
|
|
302
|
+
is_public: z.ZodOptional<z.ZodBoolean>;
|
|
303
|
+
is_upcoming: z.ZodOptional<z.ZodBoolean>;
|
|
304
|
+
popularity: z.ZodOptional<z.ZodNumber>;
|
|
305
|
+
primary_color: z.ZodOptional<z.ZodString>;
|
|
306
|
+
slug: z.ZodString;
|
|
307
|
+
auth_type: z.ZodOptional<z.ZodString>;
|
|
308
|
+
is_deprecated: z.ZodOptional<z.ZodBoolean>;
|
|
309
|
+
secondary_color: z.ZodOptional<z.ZodString>;
|
|
310
|
+
has_filters: z.ZodOptional<z.ZodBoolean>;
|
|
311
|
+
has_reads: z.ZodOptional<z.ZodBoolean>;
|
|
312
|
+
has_searches: z.ZodOptional<z.ZodBoolean>;
|
|
313
|
+
has_searches_or_writes: z.ZodOptional<z.ZodBoolean>;
|
|
314
|
+
has_upfront_fields: z.ZodOptional<z.ZodBoolean>;
|
|
315
|
+
has_writes: z.ZodOptional<z.ZodBoolean>;
|
|
316
|
+
is_invite: z.ZodOptional<z.ZodBoolean>;
|
|
317
|
+
visibility: z.ZodOptional<z.ZodString>;
|
|
318
|
+
classification: z.ZodOptional<z.ZodString>;
|
|
319
|
+
} & {
|
|
320
|
+
title: z.ZodString;
|
|
321
|
+
key: z.ZodString;
|
|
322
|
+
implementation_id: z.ZodString;
|
|
323
|
+
version: z.ZodOptional<z.ZodString>;
|
|
324
|
+
}, "strip", z.ZodTypeAny, {
|
|
325
|
+
key: string;
|
|
326
|
+
title: string;
|
|
327
|
+
slug: string;
|
|
328
|
+
implementation_id: string;
|
|
329
|
+
categories?: {
|
|
330
|
+
id: number;
|
|
331
|
+
name: string;
|
|
332
|
+
slug: string;
|
|
333
|
+
}[] | undefined;
|
|
334
|
+
actions?: {
|
|
335
|
+
search?: number | undefined;
|
|
336
|
+
filter?: number | undefined;
|
|
337
|
+
read?: number | undefined;
|
|
338
|
+
read_bulk?: number | undefined;
|
|
339
|
+
search_and_write?: number | undefined;
|
|
340
|
+
search_or_write?: number | undefined;
|
|
341
|
+
write?: number | undefined;
|
|
342
|
+
} | undefined;
|
|
343
|
+
description?: string | undefined;
|
|
344
|
+
is_hidden?: boolean | undefined;
|
|
345
|
+
age_in_days?: number | undefined;
|
|
346
|
+
api_docs_url?: string | undefined;
|
|
347
|
+
banner?: string | undefined;
|
|
348
|
+
image?: string | undefined;
|
|
349
|
+
images?: {
|
|
350
|
+
url_16x16?: string | undefined;
|
|
351
|
+
url_32x32?: string | undefined;
|
|
352
|
+
url_64x64?: string | undefined;
|
|
353
|
+
url_128x128?: string | undefined;
|
|
354
|
+
} | undefined;
|
|
355
|
+
is_beta?: boolean | undefined;
|
|
356
|
+
is_built_in?: boolean | undefined;
|
|
357
|
+
is_featured?: boolean | undefined;
|
|
358
|
+
is_premium?: boolean | undefined;
|
|
359
|
+
is_public?: boolean | undefined;
|
|
360
|
+
is_upcoming?: boolean | undefined;
|
|
361
|
+
popularity?: number | undefined;
|
|
362
|
+
primary_color?: string | undefined;
|
|
363
|
+
auth_type?: string | undefined;
|
|
364
|
+
is_deprecated?: boolean | undefined;
|
|
365
|
+
secondary_color?: string | undefined;
|
|
366
|
+
has_filters?: boolean | undefined;
|
|
367
|
+
has_reads?: boolean | undefined;
|
|
368
|
+
has_searches?: boolean | undefined;
|
|
369
|
+
has_searches_or_writes?: boolean | undefined;
|
|
370
|
+
has_upfront_fields?: boolean | undefined;
|
|
371
|
+
has_writes?: boolean | undefined;
|
|
372
|
+
is_invite?: boolean | undefined;
|
|
373
|
+
version?: string | undefined;
|
|
374
|
+
visibility?: string | undefined;
|
|
375
|
+
classification?: string | undefined;
|
|
376
|
+
}, {
|
|
377
|
+
key: string;
|
|
378
|
+
title: string;
|
|
379
|
+
slug: string;
|
|
380
|
+
implementation_id: string;
|
|
381
|
+
categories?: {
|
|
382
|
+
id: number;
|
|
383
|
+
name: string;
|
|
384
|
+
slug: string;
|
|
385
|
+
}[] | undefined;
|
|
386
|
+
actions?: {
|
|
387
|
+
search?: number | undefined;
|
|
388
|
+
filter?: number | undefined;
|
|
389
|
+
read?: number | undefined;
|
|
390
|
+
read_bulk?: number | undefined;
|
|
391
|
+
search_and_write?: number | undefined;
|
|
392
|
+
search_or_write?: number | undefined;
|
|
393
|
+
write?: number | undefined;
|
|
394
|
+
} | undefined;
|
|
395
|
+
description?: string | undefined;
|
|
396
|
+
is_hidden?: boolean | undefined;
|
|
397
|
+
age_in_days?: number | undefined;
|
|
398
|
+
api_docs_url?: string | undefined;
|
|
399
|
+
banner?: string | undefined;
|
|
400
|
+
image?: string | undefined;
|
|
401
|
+
images?: {
|
|
402
|
+
url_16x16?: string | undefined;
|
|
403
|
+
url_32x32?: string | undefined;
|
|
404
|
+
url_64x64?: string | undefined;
|
|
405
|
+
url_128x128?: string | undefined;
|
|
406
|
+
} | undefined;
|
|
407
|
+
is_beta?: boolean | undefined;
|
|
408
|
+
is_built_in?: boolean | undefined;
|
|
409
|
+
is_featured?: boolean | undefined;
|
|
410
|
+
is_premium?: boolean | undefined;
|
|
411
|
+
is_public?: boolean | undefined;
|
|
412
|
+
is_upcoming?: boolean | undefined;
|
|
413
|
+
popularity?: number | undefined;
|
|
414
|
+
primary_color?: string | undefined;
|
|
415
|
+
auth_type?: string | undefined;
|
|
416
|
+
is_deprecated?: boolean | undefined;
|
|
417
|
+
secondary_color?: string | undefined;
|
|
418
|
+
has_filters?: boolean | undefined;
|
|
419
|
+
has_reads?: boolean | undefined;
|
|
420
|
+
has_searches?: boolean | undefined;
|
|
421
|
+
has_searches_or_writes?: boolean | undefined;
|
|
422
|
+
has_upfront_fields?: boolean | undefined;
|
|
423
|
+
has_writes?: boolean | undefined;
|
|
424
|
+
is_invite?: boolean | undefined;
|
|
425
|
+
version?: string | undefined;
|
|
426
|
+
visibility?: string | undefined;
|
|
427
|
+
classification?: string | undefined;
|
|
428
|
+
}>, "many">;
|
|
429
|
+
nextCursor: z.ZodOptional<z.ZodString>;
|
|
430
|
+
}, "strip", z.ZodTypeAny, {
|
|
431
|
+
data: {
|
|
432
|
+
key: string;
|
|
433
|
+
title: string;
|
|
434
|
+
slug: string;
|
|
435
|
+
implementation_id: string;
|
|
436
|
+
categories?: {
|
|
437
|
+
id: number;
|
|
438
|
+
name: string;
|
|
439
|
+
slug: string;
|
|
440
|
+
}[] | undefined;
|
|
441
|
+
actions?: {
|
|
442
|
+
search?: number | undefined;
|
|
443
|
+
filter?: number | undefined;
|
|
444
|
+
read?: number | undefined;
|
|
445
|
+
read_bulk?: number | undefined;
|
|
446
|
+
search_and_write?: number | undefined;
|
|
447
|
+
search_or_write?: number | undefined;
|
|
448
|
+
write?: number | undefined;
|
|
449
|
+
} | undefined;
|
|
450
|
+
description?: string | undefined;
|
|
451
|
+
is_hidden?: boolean | undefined;
|
|
452
|
+
age_in_days?: number | undefined;
|
|
453
|
+
api_docs_url?: string | undefined;
|
|
454
|
+
banner?: string | undefined;
|
|
455
|
+
image?: string | undefined;
|
|
456
|
+
images?: {
|
|
457
|
+
url_16x16?: string | undefined;
|
|
458
|
+
url_32x32?: string | undefined;
|
|
459
|
+
url_64x64?: string | undefined;
|
|
460
|
+
url_128x128?: string | undefined;
|
|
461
|
+
} | undefined;
|
|
462
|
+
is_beta?: boolean | undefined;
|
|
463
|
+
is_built_in?: boolean | undefined;
|
|
464
|
+
is_featured?: boolean | undefined;
|
|
465
|
+
is_premium?: boolean | undefined;
|
|
466
|
+
is_public?: boolean | undefined;
|
|
467
|
+
is_upcoming?: boolean | undefined;
|
|
468
|
+
popularity?: number | undefined;
|
|
469
|
+
primary_color?: string | undefined;
|
|
470
|
+
auth_type?: string | undefined;
|
|
471
|
+
is_deprecated?: boolean | undefined;
|
|
472
|
+
secondary_color?: string | undefined;
|
|
473
|
+
has_filters?: boolean | undefined;
|
|
474
|
+
has_reads?: boolean | undefined;
|
|
475
|
+
has_searches?: boolean | undefined;
|
|
476
|
+
has_searches_or_writes?: boolean | undefined;
|
|
477
|
+
has_upfront_fields?: boolean | undefined;
|
|
478
|
+
has_writes?: boolean | undefined;
|
|
479
|
+
is_invite?: boolean | undefined;
|
|
480
|
+
version?: string | undefined;
|
|
481
|
+
visibility?: string | undefined;
|
|
482
|
+
classification?: string | undefined;
|
|
483
|
+
}[];
|
|
484
|
+
nextCursor?: string | undefined;
|
|
485
|
+
}, {
|
|
486
|
+
data: {
|
|
487
|
+
key: string;
|
|
488
|
+
title: string;
|
|
489
|
+
slug: string;
|
|
490
|
+
implementation_id: string;
|
|
491
|
+
categories?: {
|
|
492
|
+
id: number;
|
|
493
|
+
name: string;
|
|
494
|
+
slug: string;
|
|
495
|
+
}[] | undefined;
|
|
496
|
+
actions?: {
|
|
497
|
+
search?: number | undefined;
|
|
498
|
+
filter?: number | undefined;
|
|
499
|
+
read?: number | undefined;
|
|
500
|
+
read_bulk?: number | undefined;
|
|
501
|
+
search_and_write?: number | undefined;
|
|
502
|
+
search_or_write?: number | undefined;
|
|
503
|
+
write?: number | undefined;
|
|
504
|
+
} | undefined;
|
|
505
|
+
description?: string | undefined;
|
|
506
|
+
is_hidden?: boolean | undefined;
|
|
507
|
+
age_in_days?: number | undefined;
|
|
508
|
+
api_docs_url?: string | undefined;
|
|
509
|
+
banner?: string | undefined;
|
|
510
|
+
image?: string | undefined;
|
|
511
|
+
images?: {
|
|
512
|
+
url_16x16?: string | undefined;
|
|
513
|
+
url_32x32?: string | undefined;
|
|
514
|
+
url_64x64?: string | undefined;
|
|
515
|
+
url_128x128?: string | undefined;
|
|
516
|
+
} | undefined;
|
|
517
|
+
is_beta?: boolean | undefined;
|
|
518
|
+
is_built_in?: boolean | undefined;
|
|
519
|
+
is_featured?: boolean | undefined;
|
|
520
|
+
is_premium?: boolean | undefined;
|
|
521
|
+
is_public?: boolean | undefined;
|
|
522
|
+
is_upcoming?: boolean | undefined;
|
|
523
|
+
popularity?: number | undefined;
|
|
524
|
+
primary_color?: string | undefined;
|
|
525
|
+
auth_type?: string | undefined;
|
|
526
|
+
is_deprecated?: boolean | undefined;
|
|
527
|
+
secondary_color?: string | undefined;
|
|
528
|
+
has_filters?: boolean | undefined;
|
|
529
|
+
has_reads?: boolean | undefined;
|
|
530
|
+
has_searches?: boolean | undefined;
|
|
531
|
+
has_searches_or_writes?: boolean | undefined;
|
|
532
|
+
has_upfront_fields?: boolean | undefined;
|
|
533
|
+
has_writes?: boolean | undefined;
|
|
534
|
+
is_invite?: boolean | undefined;
|
|
535
|
+
version?: string | undefined;
|
|
536
|
+
visibility?: string | undefined;
|
|
537
|
+
classification?: string | undefined;
|
|
538
|
+
}[];
|
|
539
|
+
nextCursor?: string | undefined;
|
|
540
|
+
}>;
|
|
541
|
+
export type ListAppsResponse = z.infer<typeof ListAppsResponseSchema>;
|
|
542
|
+
/**
|
|
543
|
+
* Handler request schema for listApps operation
|
|
544
|
+
*
|
|
545
|
+
* This is the internal schema used by the handler. Unlike ListAppsOptionsSchema:
|
|
546
|
+
* - Accepts pre-resolved implementationIds (not user-facing appKeys)
|
|
547
|
+
* - Accepts search term for augmenting results (handler performs search augmentation)
|
|
548
|
+
* - Used for validation at the handler boundary
|
|
549
|
+
* - Will be the HTTP request schema in the SDK API
|
|
550
|
+
*
|
|
551
|
+
* Accepts flexible input types and normalizes them:
|
|
552
|
+
* - implementationIds: string (comma-separated) or string[] → normalized to string[]
|
|
553
|
+
* - pageSize: string or number → normalized to number
|
|
554
|
+
*/
|
|
555
|
+
export declare const ListAppsHandlerRequestSchema: z.ZodEffects<z.ZodObject<{
|
|
556
|
+
implementationIds: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
557
|
+
search: z.ZodOptional<z.ZodString>;
|
|
558
|
+
pageSize: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
559
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
560
|
+
}, "strip", z.ZodTypeAny, {
|
|
561
|
+
search?: string | undefined;
|
|
562
|
+
pageSize?: string | number | undefined;
|
|
563
|
+
cursor?: string | undefined;
|
|
564
|
+
implementationIds?: string | string[] | undefined;
|
|
565
|
+
}, {
|
|
566
|
+
search?: string | undefined;
|
|
567
|
+
pageSize?: string | number | undefined;
|
|
568
|
+
cursor?: string | undefined;
|
|
569
|
+
implementationIds?: string | string[] | undefined;
|
|
570
|
+
}>, {
|
|
571
|
+
implementationIds: string[];
|
|
572
|
+
search: string | undefined;
|
|
573
|
+
pageSize: number | undefined;
|
|
574
|
+
cursor: string | undefined;
|
|
575
|
+
}, {
|
|
576
|
+
search?: string | undefined;
|
|
577
|
+
pageSize?: string | number | undefined;
|
|
578
|
+
cursor?: string | undefined;
|
|
579
|
+
implementationIds?: string | string[] | undefined;
|
|
580
|
+
}>;
|
|
581
|
+
export type ListAppsHandlerRequest = z.infer<typeof ListAppsHandlerRequestSchema>;
|
|
582
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/temporary-internal-core/schemas/apps/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;EAiB4B,CAAC;AAE/D,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE;;;GAGG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQxB,CAAC;AAEH,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAEpD;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGjC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;EAiCpC,CAAC;AAEN,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAC1C,OAAO,4BAA4B,CACpC,CAAC"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* App and Service schemas
|
|
3
|
+
*
|
|
4
|
+
* Covers:
|
|
5
|
+
* - App metadata
|
|
6
|
+
* - Service definitions
|
|
7
|
+
* - App listings and searches
|
|
8
|
+
*/
|
|
9
|
+
import { z } from "zod";
|
|
10
|
+
import { ImplementationMetaSchema } from "../implementations";
|
|
11
|
+
/**
|
|
12
|
+
* Public API schema for listApps operation
|
|
13
|
+
*
|
|
14
|
+
* This is the user-facing schema that accepts app keys (slugs, implementation names, etc.)
|
|
15
|
+
* The plugin resolves these to implementation IDs before calling the handler.
|
|
16
|
+
*/
|
|
17
|
+
export const ListAppsOptionsSchema = z
|
|
18
|
+
.object({
|
|
19
|
+
appKeys: z
|
|
20
|
+
.array(z.string())
|
|
21
|
+
.optional()
|
|
22
|
+
.describe("Filter apps by app keys (e.g., 'SlackCLIAPI' or slug like 'github')"),
|
|
23
|
+
search: z.string().optional().describe("Search for apps by name"),
|
|
24
|
+
pageSize: z.number().min(1).optional().describe("Number of apps per page"),
|
|
25
|
+
maxItems: z
|
|
26
|
+
.number()
|
|
27
|
+
.min(1)
|
|
28
|
+
.optional()
|
|
29
|
+
.describe("Maximum total items to return across all pages"),
|
|
30
|
+
cursor: z.string().optional().describe("Cursor to start from"),
|
|
31
|
+
})
|
|
32
|
+
.describe("List all available apps with optional filtering");
|
|
33
|
+
/**
|
|
34
|
+
* Normalized app item returned by listApps
|
|
35
|
+
* This extends ImplementationMetaSchema with transformed fields (title, key, implementation_id)
|
|
36
|
+
*/
|
|
37
|
+
export const AppItemSchema = ImplementationMetaSchema.omit({
|
|
38
|
+
name: true,
|
|
39
|
+
id: true,
|
|
40
|
+
}).extend({
|
|
41
|
+
title: z.string(),
|
|
42
|
+
key: z.string(),
|
|
43
|
+
implementation_id: z.string(),
|
|
44
|
+
version: z.string().optional(),
|
|
45
|
+
});
|
|
46
|
+
/**
|
|
47
|
+
* Response schema for listApps (paginated)
|
|
48
|
+
*/
|
|
49
|
+
export const ListAppsResponseSchema = z.object({
|
|
50
|
+
data: z.array(AppItemSchema),
|
|
51
|
+
nextCursor: z.string().optional(),
|
|
52
|
+
});
|
|
53
|
+
/**
|
|
54
|
+
* Handler request schema for listApps operation
|
|
55
|
+
*
|
|
56
|
+
* This is the internal schema used by the handler. Unlike ListAppsOptionsSchema:
|
|
57
|
+
* - Accepts pre-resolved implementationIds (not user-facing appKeys)
|
|
58
|
+
* - Accepts search term for augmenting results (handler performs search augmentation)
|
|
59
|
+
* - Used for validation at the handler boundary
|
|
60
|
+
* - Will be the HTTP request schema in the SDK API
|
|
61
|
+
*
|
|
62
|
+
* Accepts flexible input types and normalizes them:
|
|
63
|
+
* - implementationIds: string (comma-separated) or string[] → normalized to string[]
|
|
64
|
+
* - pageSize: string or number → normalized to number
|
|
65
|
+
*/
|
|
66
|
+
export const ListAppsHandlerRequestSchema = z
|
|
67
|
+
.object({
|
|
68
|
+
implementationIds: z
|
|
69
|
+
.union([z.string(), z.array(z.string())])
|
|
70
|
+
.optional()
|
|
71
|
+
.describe("Pre-resolved implementation IDs - array or comma-separated string"),
|
|
72
|
+
search: z
|
|
73
|
+
.string()
|
|
74
|
+
.optional()
|
|
75
|
+
.describe("Optional search term to augment results"),
|
|
76
|
+
pageSize: z
|
|
77
|
+
.union([z.string(), z.number()])
|
|
78
|
+
.optional()
|
|
79
|
+
.describe("Number of apps per page"),
|
|
80
|
+
cursor: z.string().optional().describe("Pagination cursor"),
|
|
81
|
+
})
|
|
82
|
+
.transform((data) => ({
|
|
83
|
+
// Normalize implementationIds to array
|
|
84
|
+
implementationIds: typeof data.implementationIds === "string"
|
|
85
|
+
? data.implementationIds === ""
|
|
86
|
+
? []
|
|
87
|
+
: data.implementationIds.split(",")
|
|
88
|
+
: (data.implementationIds ?? []),
|
|
89
|
+
search: data.search,
|
|
90
|
+
// Normalize pageSize to number
|
|
91
|
+
pageSize: typeof data.pageSize === "string"
|
|
92
|
+
? parseInt(data.pageSize, 10)
|
|
93
|
+
: data.pageSize,
|
|
94
|
+
cursor: data.cursor,
|
|
95
|
+
}));
|