@directus/extensions-registry 3.0.9 → 3.0.11
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/dist/index.d.ts +227 -215
- package/dist/index.js +319 -222
- package/package.json +8 -8
package/dist/index.d.ts
CHANGED
|
@@ -1,27 +1,30 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import * as stream_web0 from "stream/web";
|
|
3
|
+
import { ExtensionType } from "@directus/types";
|
|
4
4
|
|
|
5
|
+
//#region src/modules/account/types/account-options.d.ts
|
|
5
6
|
interface AccountOptions {
|
|
6
|
-
|
|
7
|
+
registry?: string;
|
|
7
8
|
}
|
|
8
|
-
|
|
9
|
+
//#endregion
|
|
10
|
+
//#region src/modules/account/schemas/registry-account-response.d.ts
|
|
9
11
|
declare const RegistryAccountResponse: z.ZodObject<{
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
12
|
+
data: z.ZodObject<{
|
|
13
|
+
id: z.ZodString;
|
|
14
|
+
username: z.ZodString;
|
|
15
|
+
verified: z.ZodBoolean;
|
|
16
|
+
github_username: z.ZodNullable<z.ZodString>;
|
|
17
|
+
github_avatar_url: z.ZodNullable<z.ZodString>;
|
|
18
|
+
github_name: z.ZodNullable<z.ZodString>;
|
|
19
|
+
github_company: z.ZodNullable<z.ZodString>;
|
|
20
|
+
github_blog: z.ZodNullable<z.ZodString>;
|
|
21
|
+
github_location: z.ZodNullable<z.ZodString>;
|
|
22
|
+
github_bio: z.ZodNullable<z.ZodString>;
|
|
23
|
+
}, z.core.$strip>;
|
|
22
24
|
}, z.core.$strip>;
|
|
23
25
|
type RegistryAccountResponse = z.infer<typeof RegistryAccountResponse>;
|
|
24
|
-
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region src/modules/account/account.d.ts
|
|
25
28
|
/**
|
|
26
29
|
* Retrieves account information from the extensions registry.
|
|
27
30
|
*
|
|
@@ -61,153 +64,158 @@ type RegistryAccountResponse = z.infer<typeof RegistryAccountResponse>;
|
|
|
61
64
|
* ```
|
|
62
65
|
*/
|
|
63
66
|
declare const account: (id: string, options?: AccountOptions) => Promise<{
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
67
|
+
data: {
|
|
68
|
+
id: string;
|
|
69
|
+
username: string;
|
|
70
|
+
verified: boolean;
|
|
71
|
+
github_username: string | null;
|
|
72
|
+
github_avatar_url: string | null;
|
|
73
|
+
github_name: string | null;
|
|
74
|
+
github_company: string | null;
|
|
75
|
+
github_blog: string | null;
|
|
76
|
+
github_location: string | null;
|
|
77
|
+
github_bio: string | null;
|
|
78
|
+
};
|
|
76
79
|
}>;
|
|
77
|
-
|
|
80
|
+
//#endregion
|
|
81
|
+
//#region src/modules/describe/types/describe-options.d.ts
|
|
78
82
|
interface DescribeOptions {
|
|
79
|
-
|
|
83
|
+
registry?: string;
|
|
80
84
|
}
|
|
81
|
-
|
|
85
|
+
//#endregion
|
|
86
|
+
//#region src/modules/describe/schemas/registry-describe-response.d.ts
|
|
82
87
|
declare const RegistryDescribeResponse: z.ZodObject<{
|
|
83
|
-
|
|
88
|
+
data: z.ZodObject<{
|
|
89
|
+
id: z.ZodString;
|
|
90
|
+
name: z.ZodString;
|
|
91
|
+
description: z.ZodUnion<readonly [z.ZodNull, z.ZodString]>;
|
|
92
|
+
total_downloads: z.ZodNumber;
|
|
93
|
+
downloads: z.ZodUnion<readonly [z.ZodNull, z.ZodArray<z.ZodObject<{
|
|
94
|
+
date: z.ZodString;
|
|
95
|
+
count: z.ZodNumber;
|
|
96
|
+
}, z.core.$strip>>]>;
|
|
97
|
+
verified: z.ZodBoolean;
|
|
98
|
+
readme: z.ZodUnion<readonly [z.ZodNull, z.ZodString]>;
|
|
99
|
+
type: z.ZodEnum<{
|
|
100
|
+
interface: "interface";
|
|
101
|
+
display: "display";
|
|
102
|
+
layout: "layout";
|
|
103
|
+
module: "module";
|
|
104
|
+
panel: "panel";
|
|
105
|
+
theme: "theme";
|
|
106
|
+
hook: "hook";
|
|
107
|
+
endpoint: "endpoint";
|
|
108
|
+
operation: "operation";
|
|
109
|
+
bundle: "bundle";
|
|
110
|
+
}>;
|
|
111
|
+
license: z.ZodNullable<z.ZodString>;
|
|
112
|
+
versions: z.ZodArray<z.ZodObject<{
|
|
113
|
+
id: z.ZodString;
|
|
114
|
+
version: z.ZodString;
|
|
115
|
+
verified: z.ZodBoolean;
|
|
116
|
+
type: z.ZodEnum<{
|
|
117
|
+
interface: "interface";
|
|
118
|
+
display: "display";
|
|
119
|
+
layout: "layout";
|
|
120
|
+
module: "module";
|
|
121
|
+
panel: "panel";
|
|
122
|
+
theme: "theme";
|
|
123
|
+
hook: "hook";
|
|
124
|
+
endpoint: "endpoint";
|
|
125
|
+
operation: "operation";
|
|
126
|
+
bundle: "bundle";
|
|
127
|
+
}>;
|
|
128
|
+
host_version: z.ZodString;
|
|
129
|
+
publish_date: z.ZodString;
|
|
130
|
+
unpacked_size: z.ZodNumber;
|
|
131
|
+
file_count: z.ZodNumber;
|
|
132
|
+
url_bugs: z.ZodUnion<readonly [z.ZodNull, z.ZodString]>;
|
|
133
|
+
url_homepage: z.ZodUnion<readonly [z.ZodNull, z.ZodString]>;
|
|
134
|
+
url_repository: z.ZodUnion<readonly [z.ZodNull, z.ZodString]>;
|
|
135
|
+
license: z.ZodNullable<z.ZodString>;
|
|
136
|
+
publisher: z.ZodObject<{
|
|
84
137
|
id: z.ZodString;
|
|
85
|
-
|
|
86
|
-
description: z.ZodUnion<readonly [z.ZodNull, z.ZodString]>;
|
|
87
|
-
total_downloads: z.ZodNumber;
|
|
88
|
-
downloads: z.ZodUnion<readonly [z.ZodNull, z.ZodArray<z.ZodObject<{
|
|
89
|
-
date: z.ZodString;
|
|
90
|
-
count: z.ZodNumber;
|
|
91
|
-
}, z.core.$strip>>]>;
|
|
138
|
+
username: z.ZodString;
|
|
92
139
|
verified: z.ZodBoolean;
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
type: z.ZodEnum<{
|
|
112
|
-
interface: "interface";
|
|
113
|
-
display: "display";
|
|
114
|
-
layout: "layout";
|
|
115
|
-
module: "module";
|
|
116
|
-
panel: "panel";
|
|
117
|
-
theme: "theme";
|
|
118
|
-
hook: "hook";
|
|
119
|
-
endpoint: "endpoint";
|
|
120
|
-
operation: "operation";
|
|
121
|
-
bundle: "bundle";
|
|
122
|
-
}>;
|
|
123
|
-
host_version: z.ZodString;
|
|
124
|
-
publish_date: z.ZodString;
|
|
125
|
-
unpacked_size: z.ZodNumber;
|
|
126
|
-
file_count: z.ZodNumber;
|
|
127
|
-
url_bugs: z.ZodUnion<readonly [z.ZodNull, z.ZodString]>;
|
|
128
|
-
url_homepage: z.ZodUnion<readonly [z.ZodNull, z.ZodString]>;
|
|
129
|
-
url_repository: z.ZodUnion<readonly [z.ZodNull, z.ZodString]>;
|
|
130
|
-
license: z.ZodNullable<z.ZodString>;
|
|
131
|
-
publisher: z.ZodObject<{
|
|
132
|
-
id: z.ZodString;
|
|
133
|
-
username: z.ZodString;
|
|
134
|
-
verified: z.ZodBoolean;
|
|
135
|
-
github_name: z.ZodNullable<z.ZodString>;
|
|
136
|
-
github_avatar_url: z.ZodNullable<z.ZodString>;
|
|
137
|
-
}, z.core.$strip>;
|
|
138
|
-
bundled: z.ZodArray<z.ZodObject<{
|
|
139
|
-
name: z.ZodString;
|
|
140
|
-
type: z.ZodString;
|
|
141
|
-
}, z.core.$strip>>;
|
|
142
|
-
maintainers: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
143
|
-
accounts_id: z.ZodObject<{
|
|
144
|
-
id: z.ZodString;
|
|
145
|
-
username: z.ZodString;
|
|
146
|
-
verified: z.ZodBoolean;
|
|
147
|
-
github_name: z.ZodNullable<z.ZodString>;
|
|
148
|
-
github_avatar_url: z.ZodNullable<z.ZodString>;
|
|
149
|
-
}, z.core.$strip>;
|
|
150
|
-
}, z.core.$strip>>>;
|
|
151
|
-
}, z.core.$strip>>;
|
|
152
|
-
}, z.core.$strip>;
|
|
140
|
+
github_name: z.ZodNullable<z.ZodString>;
|
|
141
|
+
github_avatar_url: z.ZodNullable<z.ZodString>;
|
|
142
|
+
}, z.core.$strip>;
|
|
143
|
+
bundled: z.ZodArray<z.ZodObject<{
|
|
144
|
+
name: z.ZodString;
|
|
145
|
+
type: z.ZodString;
|
|
146
|
+
}, z.core.$strip>>;
|
|
147
|
+
maintainers: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
148
|
+
accounts_id: z.ZodObject<{
|
|
149
|
+
id: z.ZodString;
|
|
150
|
+
username: z.ZodString;
|
|
151
|
+
verified: z.ZodBoolean;
|
|
152
|
+
github_name: z.ZodNullable<z.ZodString>;
|
|
153
|
+
github_avatar_url: z.ZodNullable<z.ZodString>;
|
|
154
|
+
}, z.core.$strip>;
|
|
155
|
+
}, z.core.$strip>>>;
|
|
156
|
+
}, z.core.$strip>>;
|
|
157
|
+
}, z.core.$strip>;
|
|
153
158
|
}, z.core.$strip>;
|
|
154
159
|
type RegistryDescribeResponse = z.infer<typeof RegistryDescribeResponse>;
|
|
155
|
-
|
|
160
|
+
//#endregion
|
|
161
|
+
//#region src/modules/describe/describe.d.ts
|
|
156
162
|
declare const describe: (id: string, options?: DescribeOptions) => Promise<{
|
|
157
|
-
|
|
163
|
+
data: {
|
|
164
|
+
id: string;
|
|
165
|
+
name: string;
|
|
166
|
+
description: string | null;
|
|
167
|
+
total_downloads: number;
|
|
168
|
+
downloads: {
|
|
169
|
+
date: string;
|
|
170
|
+
count: number;
|
|
171
|
+
}[] | null;
|
|
172
|
+
verified: boolean;
|
|
173
|
+
readme: string | null;
|
|
174
|
+
type: "interface" | "display" | "layout" | "module" | "panel" | "theme" | "hook" | "endpoint" | "operation" | "bundle";
|
|
175
|
+
license: string | null;
|
|
176
|
+
versions: {
|
|
177
|
+
id: string;
|
|
178
|
+
version: string;
|
|
179
|
+
verified: boolean;
|
|
180
|
+
type: "interface" | "display" | "layout" | "module" | "panel" | "theme" | "hook" | "endpoint" | "operation" | "bundle";
|
|
181
|
+
host_version: string;
|
|
182
|
+
publish_date: string;
|
|
183
|
+
unpacked_size: number;
|
|
184
|
+
file_count: number;
|
|
185
|
+
url_bugs: string | null;
|
|
186
|
+
url_homepage: string | null;
|
|
187
|
+
url_repository: string | null;
|
|
188
|
+
license: string | null;
|
|
189
|
+
publisher: {
|
|
158
190
|
id: string;
|
|
159
|
-
|
|
160
|
-
description: string | null;
|
|
161
|
-
total_downloads: number;
|
|
162
|
-
downloads: {
|
|
163
|
-
date: string;
|
|
164
|
-
count: number;
|
|
165
|
-
}[] | null;
|
|
191
|
+
username: string;
|
|
166
192
|
verified: boolean;
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
username: string;
|
|
186
|
-
verified: boolean;
|
|
187
|
-
github_name: string | null;
|
|
188
|
-
github_avatar_url: string | null;
|
|
189
|
-
};
|
|
190
|
-
bundled: {
|
|
191
|
-
name: string;
|
|
192
|
-
type: string;
|
|
193
|
-
}[];
|
|
194
|
-
maintainers: {
|
|
195
|
-
accounts_id: {
|
|
196
|
-
id: string;
|
|
197
|
-
username: string;
|
|
198
|
-
verified: boolean;
|
|
199
|
-
github_name: string | null;
|
|
200
|
-
github_avatar_url: string | null;
|
|
201
|
-
};
|
|
202
|
-
}[] | null;
|
|
203
|
-
}[];
|
|
204
|
-
};
|
|
193
|
+
github_name: string | null;
|
|
194
|
+
github_avatar_url: string | null;
|
|
195
|
+
};
|
|
196
|
+
bundled: {
|
|
197
|
+
name: string;
|
|
198
|
+
type: string;
|
|
199
|
+
}[];
|
|
200
|
+
maintainers: {
|
|
201
|
+
accounts_id: {
|
|
202
|
+
id: string;
|
|
203
|
+
username: string;
|
|
204
|
+
verified: boolean;
|
|
205
|
+
github_name: string | null;
|
|
206
|
+
github_avatar_url: string | null;
|
|
207
|
+
};
|
|
208
|
+
}[] | null;
|
|
209
|
+
}[];
|
|
210
|
+
};
|
|
205
211
|
}>;
|
|
206
|
-
|
|
212
|
+
//#endregion
|
|
213
|
+
//#region src/modules/download/types/download-options.d.ts
|
|
207
214
|
interface DownloadOptions {
|
|
208
|
-
|
|
215
|
+
registry?: string;
|
|
209
216
|
}
|
|
210
|
-
|
|
217
|
+
//#endregion
|
|
218
|
+
//#region src/modules/download/download.d.ts
|
|
211
219
|
/**
|
|
212
220
|
* Downloads an extension version from the registry as a stream.
|
|
213
221
|
*
|
|
@@ -260,78 +268,82 @@ interface DownloadOptions {
|
|
|
260
268
|
* }
|
|
261
269
|
* ```
|
|
262
270
|
*/
|
|
263
|
-
declare const download: (versionId: string, requireSandbox?: boolean, options?: DownloadOptions) => Promise<
|
|
264
|
-
|
|
271
|
+
declare const download: (versionId: string, requireSandbox?: boolean, options?: DownloadOptions) => Promise<stream_web0.ReadableStream<any> | null>;
|
|
272
|
+
//#endregion
|
|
273
|
+
//#region src/modules/list/types/list-options.d.ts
|
|
265
274
|
interface ListOptions {
|
|
266
|
-
|
|
275
|
+
registry?: string;
|
|
267
276
|
}
|
|
268
|
-
|
|
277
|
+
//#endregion
|
|
278
|
+
//#region src/modules/list/types/list-query.d.ts
|
|
269
279
|
interface ListQuery {
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
280
|
+
type?: ExtensionType;
|
|
281
|
+
search?: string;
|
|
282
|
+
limit?: number;
|
|
283
|
+
offset?: number;
|
|
284
|
+
by?: string;
|
|
285
|
+
sort?: 'popular' | 'recent' | 'downloads';
|
|
286
|
+
sandbox?: boolean;
|
|
277
287
|
}
|
|
278
|
-
|
|
288
|
+
//#endregion
|
|
289
|
+
//#region src/modules/list/schemas/registry-list-response.d.ts
|
|
279
290
|
declare const RegistryListResponse: z.ZodObject<{
|
|
280
|
-
|
|
281
|
-
|
|
291
|
+
meta: z.ZodObject<{
|
|
292
|
+
filter_count: z.ZodNumber;
|
|
293
|
+
}, z.core.$strip>;
|
|
294
|
+
data: z.ZodArray<z.ZodObject<{
|
|
295
|
+
id: z.ZodString;
|
|
296
|
+
name: z.ZodString;
|
|
297
|
+
description: z.ZodUnion<readonly [z.ZodNull, z.ZodString]>;
|
|
298
|
+
total_downloads: z.ZodNumber;
|
|
299
|
+
verified: z.ZodBoolean;
|
|
300
|
+
type: z.ZodEnum<{
|
|
301
|
+
interface: "interface";
|
|
302
|
+
display: "display";
|
|
303
|
+
layout: "layout";
|
|
304
|
+
module: "module";
|
|
305
|
+
panel: "panel";
|
|
306
|
+
theme: "theme";
|
|
307
|
+
hook: "hook";
|
|
308
|
+
endpoint: "endpoint";
|
|
309
|
+
operation: "operation";
|
|
310
|
+
bundle: "bundle";
|
|
311
|
+
}>;
|
|
312
|
+
last_updated: z.ZodString;
|
|
313
|
+
host_version: z.ZodString;
|
|
314
|
+
sandbox: z.ZodBoolean;
|
|
315
|
+
license: z.ZodNullable<z.ZodString>;
|
|
316
|
+
publisher: z.ZodObject<{
|
|
317
|
+
username: z.ZodString;
|
|
318
|
+
verified: z.ZodBoolean;
|
|
319
|
+
github_name: z.ZodNullable<z.ZodString>;
|
|
282
320
|
}, z.core.$strip>;
|
|
283
|
-
|
|
284
|
-
id: z.ZodString;
|
|
285
|
-
name: z.ZodString;
|
|
286
|
-
description: z.ZodUnion<readonly [z.ZodNull, z.ZodString]>;
|
|
287
|
-
total_downloads: z.ZodNumber;
|
|
288
|
-
verified: z.ZodBoolean;
|
|
289
|
-
type: z.ZodEnum<{
|
|
290
|
-
interface: "interface";
|
|
291
|
-
display: "display";
|
|
292
|
-
layout: "layout";
|
|
293
|
-
module: "module";
|
|
294
|
-
panel: "panel";
|
|
295
|
-
theme: "theme";
|
|
296
|
-
hook: "hook";
|
|
297
|
-
endpoint: "endpoint";
|
|
298
|
-
operation: "operation";
|
|
299
|
-
bundle: "bundle";
|
|
300
|
-
}>;
|
|
301
|
-
last_updated: z.ZodString;
|
|
302
|
-
host_version: z.ZodString;
|
|
303
|
-
sandbox: z.ZodBoolean;
|
|
304
|
-
license: z.ZodNullable<z.ZodString>;
|
|
305
|
-
publisher: z.ZodObject<{
|
|
306
|
-
username: z.ZodString;
|
|
307
|
-
verified: z.ZodBoolean;
|
|
308
|
-
github_name: z.ZodNullable<z.ZodString>;
|
|
309
|
-
}, z.core.$strip>;
|
|
310
|
-
}, z.core.$strip>>;
|
|
321
|
+
}, z.core.$strip>>;
|
|
311
322
|
}, z.core.$strip>;
|
|
312
323
|
type RegistryListResponse = z.infer<typeof RegistryListResponse>;
|
|
313
|
-
|
|
324
|
+
//#endregion
|
|
325
|
+
//#region src/modules/list/list.d.ts
|
|
314
326
|
declare const list: (query: ListQuery, options?: ListOptions) => Promise<{
|
|
315
|
-
|
|
316
|
-
|
|
327
|
+
meta: {
|
|
328
|
+
filter_count: number;
|
|
329
|
+
};
|
|
330
|
+
data: {
|
|
331
|
+
id: string;
|
|
332
|
+
name: string;
|
|
333
|
+
description: string | null;
|
|
334
|
+
total_downloads: number;
|
|
335
|
+
verified: boolean;
|
|
336
|
+
type: "interface" | "display" | "layout" | "module" | "panel" | "theme" | "hook" | "endpoint" | "operation" | "bundle";
|
|
337
|
+
last_updated: string;
|
|
338
|
+
host_version: string;
|
|
339
|
+
sandbox: boolean;
|
|
340
|
+
license: string | null;
|
|
341
|
+
publisher: {
|
|
342
|
+
username: string;
|
|
343
|
+
verified: boolean;
|
|
344
|
+
github_name: string | null;
|
|
317
345
|
};
|
|
318
|
-
|
|
319
|
-
id: string;
|
|
320
|
-
name: string;
|
|
321
|
-
description: string | null;
|
|
322
|
-
total_downloads: number;
|
|
323
|
-
verified: boolean;
|
|
324
|
-
type: "interface" | "display" | "layout" | "module" | "panel" | "theme" | "hook" | "endpoint" | "operation" | "bundle";
|
|
325
|
-
last_updated: string;
|
|
326
|
-
host_version: string;
|
|
327
|
-
sandbox: boolean;
|
|
328
|
-
license: string | null;
|
|
329
|
-
publisher: {
|
|
330
|
-
username: string;
|
|
331
|
-
verified: boolean;
|
|
332
|
-
github_name: string | null;
|
|
333
|
-
};
|
|
334
|
-
}[];
|
|
346
|
+
}[];
|
|
335
347
|
}>;
|
|
336
|
-
|
|
337
|
-
export { type AccountOptions, type DescribeOptions, type DownloadOptions, type ListOptions, type ListQuery, RegistryAccountResponse, RegistryDescribeResponse, RegistryListResponse, account, describe, download, list };
|
|
348
|
+
//#endregion
|
|
349
|
+
export { type AccountOptions, type DescribeOptions, type DownloadOptions, type ListOptions, type ListQuery, type RegistryAccountResponse, type RegistryDescribeResponse, type RegistryListResponse, account, describe, download, list };
|
package/dist/index.js
CHANGED
|
@@ -1,249 +1,346 @@
|
|
|
1
|
-
|
|
2
|
-
import ky2 from "ky";
|
|
3
|
-
|
|
4
|
-
// src/utils/assert-version-compatibility.ts
|
|
1
|
+
import ky from "ky";
|
|
5
2
|
import { OutOfDateError } from "@directus/errors";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { EXTENSION_TYPES } from "@directus/constants";
|
|
6
5
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
// src/utils/get-api-version.ts
|
|
12
|
-
import ky from "ky";
|
|
6
|
+
//#region src/constants.ts
|
|
7
|
+
const DEFAULT_REGISTRY = "https://registry.directus.io";
|
|
8
|
+
const SUPPORTED_VERSION = "2024-01-29";
|
|
13
9
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
version: z.string()
|
|
18
|
-
});
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region src/schemas/registry-version-response.ts
|
|
12
|
+
const RegistryVersionResponse = z.object({ version: z.string() });
|
|
19
13
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return _cache.get(registry);
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region src/utils/get-api-version.ts
|
|
16
|
+
const _cache = /* @__PURE__ */ new Map();
|
|
17
|
+
const getApiVersion = async (options) => {
|
|
18
|
+
const registry = options?.registry ?? DEFAULT_REGISTRY;
|
|
19
|
+
if (_cache.has(registry)) return _cache.get(registry);
|
|
20
|
+
const response = await ky.get(new URL("/version", registry)).json();
|
|
21
|
+
const { version } = await RegistryVersionResponse.parseAsync(response);
|
|
22
|
+
_cache.set(registry, version);
|
|
23
|
+
setTimeout(() => _cache.delete(registry), 360 * 60 * 1e3);
|
|
24
|
+
return _cache.get(registry);
|
|
32
25
|
};
|
|
33
26
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
27
|
+
//#endregion
|
|
28
|
+
//#region src/utils/assert-version-compatibility.ts
|
|
29
|
+
const assertVersionCompatibility = async (options) => {
|
|
30
|
+
/**
|
|
31
|
+
* The Registry API always targets the latest release of Directus. If the current installation is
|
|
32
|
+
* out of date, the registry operations should fail with an instance out-of-date error.
|
|
33
|
+
*/
|
|
34
|
+
if (await getApiVersion(options) !== SUPPORTED_VERSION) throw new OutOfDateError();
|
|
40
35
|
};
|
|
41
36
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region src/modules/account/lib/construct-url.ts
|
|
39
|
+
/**
|
|
40
|
+
* Constructs a URL for accessing account information in the extensions registry.
|
|
41
|
+
*
|
|
42
|
+
* @param id - The unique identifier of the account to access
|
|
43
|
+
* @param options - Optional configuration object for URL construction
|
|
44
|
+
* @param options.registry - The registry base URL to use (defaults to DEFAULT_REGISTRY if not provided)
|
|
45
|
+
* @returns A URL object pointing to the specified account endpoint
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```typescript
|
|
49
|
+
* // Using default registry
|
|
50
|
+
* const url = constructUrl('user123');
|
|
51
|
+
* console.log(url.toString()); // "https://registry.directus.io/accounts/user123"
|
|
52
|
+
*
|
|
53
|
+
* // Using custom registry
|
|
54
|
+
* const customUrl = constructUrl('user456', {
|
|
55
|
+
* registry: 'https://custom-registry.example.com'
|
|
56
|
+
* });
|
|
57
|
+
* console.log(customUrl.toString()); // "https://custom-registry.example.com/accounts/user456"
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
const constructUrl$3 = (id, options) => {
|
|
61
|
+
const registry = options?.registry ?? DEFAULT_REGISTRY;
|
|
62
|
+
return new URL(`/accounts/${id}`, registry);
|
|
47
63
|
};
|
|
48
64
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
})
|
|
64
|
-
});
|
|
65
|
+
//#endregion
|
|
66
|
+
//#region src/modules/account/schemas/registry-account-response.ts
|
|
67
|
+
const RegistryAccountResponse = z.object({ data: z.object({
|
|
68
|
+
id: z.string(),
|
|
69
|
+
username: z.string(),
|
|
70
|
+
verified: z.boolean(),
|
|
71
|
+
github_username: z.string().nullable(),
|
|
72
|
+
github_avatar_url: z.string().nullable(),
|
|
73
|
+
github_name: z.string().nullable(),
|
|
74
|
+
github_company: z.string().nullable(),
|
|
75
|
+
github_blog: z.string().nullable(),
|
|
76
|
+
github_location: z.string().nullable(),
|
|
77
|
+
github_bio: z.string().nullable()
|
|
78
|
+
}) });
|
|
65
79
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
80
|
+
//#endregion
|
|
81
|
+
//#region src/modules/account/account.ts
|
|
82
|
+
/**
|
|
83
|
+
* Retrieves account information from the extensions registry.
|
|
84
|
+
*
|
|
85
|
+
* This function fetches detailed account data for a specified user or organization
|
|
86
|
+
* from the Directus extensions registry. It validates API version compatibility
|
|
87
|
+
* and returns structured account information including profile details, published
|
|
88
|
+
* extensions, and other relevant metadata.
|
|
89
|
+
*
|
|
90
|
+
* @param id - The unique identifier of the account to retrieve (username or organization name)
|
|
91
|
+
* @param options - Optional configuration for the request
|
|
92
|
+
* @param options.registry - Custom registry URL to use instead of the default registry
|
|
93
|
+
* @returns Promise that resolves to validated account data from the registry
|
|
94
|
+
*
|
|
95
|
+
* @throws {Error} When API version compatibility check fails
|
|
96
|
+
* @throws {Error} When the account ID is not found in the registry
|
|
97
|
+
* @throws {Error} When network request fails or registry is unreachable
|
|
98
|
+
* @throws {Error} When response data fails validation against the expected schema
|
|
99
|
+
*
|
|
100
|
+
* @example
|
|
101
|
+
* ```typescript
|
|
102
|
+
* // Get account information using default registry
|
|
103
|
+
* const accountData = await account('directus');
|
|
104
|
+
* console.log(accountData.name); // Account name
|
|
105
|
+
* console.log(accountData.extensions); // Published extensions
|
|
106
|
+
*
|
|
107
|
+
* // Get account information from custom registry
|
|
108
|
+
* const customAccountData = await account('my-org', {
|
|
109
|
+
* registry: 'https://custom-registry.example.com'
|
|
110
|
+
* });
|
|
111
|
+
*
|
|
112
|
+
* // Handle errors
|
|
113
|
+
* try {
|
|
114
|
+
* const accountData = await account('non-existent-user');
|
|
115
|
+
* } catch (error) {
|
|
116
|
+
* console.error('Failed to fetch account:', error.message);
|
|
117
|
+
* }
|
|
118
|
+
* ```
|
|
119
|
+
*/
|
|
120
|
+
const account = async (id, options) => {
|
|
121
|
+
await assertVersionCompatibility(options);
|
|
122
|
+
const url = constructUrl$3(id, options);
|
|
123
|
+
const response = await ky.get(url).json();
|
|
124
|
+
return await RegistryAccountResponse.parseAsync(response);
|
|
72
125
|
};
|
|
73
126
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
const registry = options?.registry ?? DEFAULT_REGISTRY;
|
|
80
|
-
const url = new URL(`/extensions/${id}`, registry);
|
|
81
|
-
return url;
|
|
127
|
+
//#endregion
|
|
128
|
+
//#region src/modules/describe/lib/construct-url.ts
|
|
129
|
+
const constructUrl$2 = (id, options) => {
|
|
130
|
+
const registry = options?.registry ?? DEFAULT_REGISTRY;
|
|
131
|
+
return new URL(`/extensions/${id}`, registry);
|
|
82
132
|
};
|
|
83
133
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
),
|
|
133
|
-
maintainers: z3.array(
|
|
134
|
-
z3.object({
|
|
135
|
-
accounts_id: z3.object({
|
|
136
|
-
id: z3.string(),
|
|
137
|
-
username: z3.string(),
|
|
138
|
-
verified: z3.boolean(),
|
|
139
|
-
github_name: z3.string().nullable(),
|
|
140
|
-
github_avatar_url: z3.string().nullable()
|
|
141
|
-
})
|
|
142
|
-
})
|
|
143
|
-
).nullable()
|
|
144
|
-
})
|
|
145
|
-
)
|
|
146
|
-
})
|
|
147
|
-
});
|
|
134
|
+
//#endregion
|
|
135
|
+
//#region src/modules/describe/schemas/registry-describe-response.ts
|
|
136
|
+
const RegistryDescribeResponse = z.object({ data: z.object({
|
|
137
|
+
id: z.string(),
|
|
138
|
+
name: z.string(),
|
|
139
|
+
description: z.union([z.null(), z.string()]),
|
|
140
|
+
total_downloads: z.number(),
|
|
141
|
+
downloads: z.union([z.null(), z.array(z.object({
|
|
142
|
+
date: z.string(),
|
|
143
|
+
count: z.number()
|
|
144
|
+
}))]),
|
|
145
|
+
verified: z.boolean(),
|
|
146
|
+
readme: z.union([z.null(), z.string()]),
|
|
147
|
+
type: z.enum(EXTENSION_TYPES),
|
|
148
|
+
license: z.string().nullable(),
|
|
149
|
+
versions: z.array(z.object({
|
|
150
|
+
id: z.string(),
|
|
151
|
+
version: z.string(),
|
|
152
|
+
verified: z.boolean(),
|
|
153
|
+
type: z.enum(EXTENSION_TYPES),
|
|
154
|
+
host_version: z.string(),
|
|
155
|
+
publish_date: z.string(),
|
|
156
|
+
unpacked_size: z.number(),
|
|
157
|
+
file_count: z.number(),
|
|
158
|
+
url_bugs: z.union([z.null(), z.string()]),
|
|
159
|
+
url_homepage: z.union([z.null(), z.string()]),
|
|
160
|
+
url_repository: z.union([z.null(), z.string()]),
|
|
161
|
+
license: z.string().nullable(),
|
|
162
|
+
publisher: z.object({
|
|
163
|
+
id: z.string(),
|
|
164
|
+
username: z.string(),
|
|
165
|
+
verified: z.boolean(),
|
|
166
|
+
github_name: z.string().nullable(),
|
|
167
|
+
github_avatar_url: z.string().nullable()
|
|
168
|
+
}),
|
|
169
|
+
bundled: z.array(z.object({
|
|
170
|
+
name: z.string(),
|
|
171
|
+
type: z.string()
|
|
172
|
+
})),
|
|
173
|
+
maintainers: z.array(z.object({ accounts_id: z.object({
|
|
174
|
+
id: z.string(),
|
|
175
|
+
username: z.string(),
|
|
176
|
+
verified: z.boolean(),
|
|
177
|
+
github_name: z.string().nullable(),
|
|
178
|
+
github_avatar_url: z.string().nullable()
|
|
179
|
+
}) })).nullable()
|
|
180
|
+
}))
|
|
181
|
+
}) });
|
|
148
182
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
183
|
+
//#endregion
|
|
184
|
+
//#region src/modules/describe/describe.ts
|
|
185
|
+
const describe = async (id, options) => {
|
|
186
|
+
await assertVersionCompatibility(options);
|
|
187
|
+
const url = constructUrl$2(id, options);
|
|
188
|
+
const response = await ky.get(url).json();
|
|
189
|
+
return await RegistryDescribeResponse.parseAsync(response);
|
|
155
190
|
};
|
|
156
191
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
192
|
+
//#endregion
|
|
193
|
+
//#region src/modules/download/lib/construct-url.ts
|
|
194
|
+
/**
|
|
195
|
+
* Constructs a download URL for an extension version from the registry.
|
|
196
|
+
*
|
|
197
|
+
* This function creates a properly formatted URL for downloading a specific
|
|
198
|
+
* extension version from the Directus extensions registry. It supports both
|
|
199
|
+
* production downloads and sandbox mode downloads for testing purposes.
|
|
200
|
+
*
|
|
201
|
+
* @param versionId - The unique identifier of the extension version to download
|
|
202
|
+
* @param requireSandbox - Whether to enable sandbox mode for the download (defaults to false)
|
|
203
|
+
* @param options - Optional configuration for the download request
|
|
204
|
+
* @param options.registry - Custom registry URL to use instead of the default registry
|
|
205
|
+
* @returns A URL object pointing to the download endpoint for the specified version
|
|
206
|
+
*
|
|
207
|
+
* @example
|
|
208
|
+
* ```typescript
|
|
209
|
+
* // Download from default registry
|
|
210
|
+
* const downloadUrl = constructUrl('extension-v1.0.0');
|
|
211
|
+
* console.log(downloadUrl.href); // 'https://registry.directus.io/download/extension-v1.0.0'
|
|
212
|
+
*
|
|
213
|
+
* // Download with sandbox mode enabled
|
|
214
|
+
* const sandboxUrl = constructUrl('extension-v1.0.0', true);
|
|
215
|
+
* console.log(sandboxUrl.href); // 'https://registry.directus.io/download/extension-v1.0.0?sandbox=true'
|
|
216
|
+
*
|
|
217
|
+
* // Download from custom registry
|
|
218
|
+
* const customUrl = constructUrl('extension-v1.0.0', false, {
|
|
219
|
+
* registry: 'https://custom-registry.example.com'
|
|
220
|
+
* });
|
|
221
|
+
* console.log(customUrl.href); // 'https://custom-registry.example.com/download/extension-v1.0.0'
|
|
222
|
+
*
|
|
223
|
+
* // Combine custom registry with sandbox mode
|
|
224
|
+
* const customSandboxUrl = constructUrl('extension-v1.0.0', true, {
|
|
225
|
+
* registry: 'https://custom-registry.example.com'
|
|
226
|
+
* });
|
|
227
|
+
* console.log(customSandboxUrl.href);
|
|
228
|
+
* // 'https://custom-registry.example.com/download/extension-v1.0.0?sandbox=true'
|
|
229
|
+
* ```
|
|
230
|
+
*/
|
|
231
|
+
const constructUrl$1 = (versionId, requireSandbox = false, options) => {
|
|
232
|
+
const registry = options?.registry ?? DEFAULT_REGISTRY;
|
|
233
|
+
const url = new URL(`/download/${versionId}`, registry);
|
|
234
|
+
if (requireSandbox) url.searchParams.set("sandbox", "true");
|
|
235
|
+
return url;
|
|
168
236
|
};
|
|
169
237
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
238
|
+
//#endregion
|
|
239
|
+
//#region src/modules/download/download.ts
|
|
240
|
+
/**
|
|
241
|
+
* Downloads an extension version from the registry as a stream.
|
|
242
|
+
*
|
|
243
|
+
* This function retrieves the binary content of a specific extension version
|
|
244
|
+
* from the Directus extensions registry. It validates API version compatibility
|
|
245
|
+
* and returns a ReadableStream that can be used to process the downloaded content,
|
|
246
|
+
* such as saving to disk or streaming to a client.
|
|
247
|
+
*
|
|
248
|
+
* @param versionId - The unique identifier of the extension version to download
|
|
249
|
+
* @param requireSandbox - Whether to enable sandbox mode for the download (defaults to false)
|
|
250
|
+
* @param options - Optional configuration for the download request
|
|
251
|
+
* @param options.registry - Custom registry URL to use instead of the default registry
|
|
252
|
+
* @returns Promise that resolves to a ReadableStream containing the extension's binary content
|
|
253
|
+
*
|
|
254
|
+
* @throws {Error} When API version compatibility check fails
|
|
255
|
+
* @throws {Error} When the version ID is not found in the registry
|
|
256
|
+
* @throws {Error} When network request fails or registry is unreachable
|
|
257
|
+
* @throws {Error} When the response status indicates an error (4xx, 5xx)
|
|
258
|
+
*
|
|
259
|
+
* @example
|
|
260
|
+
* ```typescript
|
|
261
|
+
* // Download extension from default registry
|
|
262
|
+
* const stream = await download('my-extension-v1.0.0');
|
|
263
|
+
*
|
|
264
|
+
* // Save to file system
|
|
265
|
+
* import { createWriteStream } from 'fs';
|
|
266
|
+
* import { pipeline } from 'stream/promises';
|
|
267
|
+
*
|
|
268
|
+
* const fileStream = createWriteStream('./extension.zip');
|
|
269
|
+
* await pipeline(Readable.fromWeb(stream), fileStream);
|
|
270
|
+
*
|
|
271
|
+
* // Download with sandbox mode enabled
|
|
272
|
+
* const sandboxStream = await download('my-extension-v1.0.0', true);
|
|
273
|
+
*
|
|
274
|
+
* // Download from custom registry
|
|
275
|
+
* const customStream = await download('my-extension-v1.0.0', false, {
|
|
276
|
+
* registry: 'https://custom-registry.example.com'
|
|
277
|
+
* });
|
|
278
|
+
*
|
|
279
|
+
* // Download with both sandbox and custom registry
|
|
280
|
+
* const customSandboxStream = await download('my-extension-v1.0.0', true, {
|
|
281
|
+
* registry: 'https://custom-registry.example.com'
|
|
282
|
+
* });
|
|
283
|
+
*
|
|
284
|
+
* // Handle errors
|
|
285
|
+
* try {
|
|
286
|
+
* const stream = await download('non-existent-version');
|
|
287
|
+
* } catch (error) {
|
|
288
|
+
* console.error('Download failed:', error.message);
|
|
289
|
+
* }
|
|
290
|
+
* ```
|
|
291
|
+
*/
|
|
292
|
+
const download = async (versionId, requireSandbox = false, options) => {
|
|
293
|
+
await assertVersionCompatibility(options);
|
|
294
|
+
const url = constructUrl$1(versionId, requireSandbox, options);
|
|
295
|
+
return (await ky.get(url)).body;
|
|
176
296
|
};
|
|
177
297
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
if (query.limit) {
|
|
192
|
-
url.searchParams.set("limit", String(query.limit));
|
|
193
|
-
}
|
|
194
|
-
if (query.offset) {
|
|
195
|
-
url.searchParams.set("offset", String(query.offset));
|
|
196
|
-
}
|
|
197
|
-
if (query.by) {
|
|
198
|
-
url.searchParams.set("by", query.by);
|
|
199
|
-
}
|
|
200
|
-
if (query.sort) {
|
|
201
|
-
url.searchParams.set("sort", query.sort);
|
|
202
|
-
}
|
|
203
|
-
if (query.sandbox) {
|
|
204
|
-
url.searchParams.set("sandbox", "true");
|
|
205
|
-
}
|
|
206
|
-
return url;
|
|
298
|
+
//#endregion
|
|
299
|
+
//#region src/modules/list/lib/construct-url.ts
|
|
300
|
+
const constructUrl = (query, options) => {
|
|
301
|
+
const registry = options?.registry ?? DEFAULT_REGISTRY;
|
|
302
|
+
const url = new URL("/extensions", registry);
|
|
303
|
+
if (query.search) url.searchParams.set("search", query.search);
|
|
304
|
+
if (query.type) url.searchParams.set("type", query.type);
|
|
305
|
+
if (query.limit) url.searchParams.set("limit", String(query.limit));
|
|
306
|
+
if (query.offset) url.searchParams.set("offset", String(query.offset));
|
|
307
|
+
if (query.by) url.searchParams.set("by", query.by);
|
|
308
|
+
if (query.sort) url.searchParams.set("sort", query.sort);
|
|
309
|
+
if (query.sandbox) url.searchParams.set("sandbox", "true");
|
|
310
|
+
return url;
|
|
207
311
|
};
|
|
208
312
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
verified: z4.boolean(),
|
|
231
|
-
github_name: z4.string().nullable()
|
|
232
|
-
})
|
|
233
|
-
})
|
|
234
|
-
)
|
|
313
|
+
//#endregion
|
|
314
|
+
//#region src/modules/list/schemas/registry-list-response.ts
|
|
315
|
+
const RegistryListResponse = z.object({
|
|
316
|
+
meta: z.object({ filter_count: z.number() }),
|
|
317
|
+
data: z.array(z.object({
|
|
318
|
+
id: z.string(),
|
|
319
|
+
name: z.string(),
|
|
320
|
+
description: z.union([z.null(), z.string()]),
|
|
321
|
+
total_downloads: z.number(),
|
|
322
|
+
verified: z.boolean(),
|
|
323
|
+
type: z.enum(EXTENSION_TYPES),
|
|
324
|
+
last_updated: z.string(),
|
|
325
|
+
host_version: z.string(),
|
|
326
|
+
sandbox: z.boolean(),
|
|
327
|
+
license: z.string().nullable(),
|
|
328
|
+
publisher: z.object({
|
|
329
|
+
username: z.string(),
|
|
330
|
+
verified: z.boolean(),
|
|
331
|
+
github_name: z.string().nullable()
|
|
332
|
+
})
|
|
333
|
+
}))
|
|
235
334
|
});
|
|
236
335
|
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
export {
|
|
245
|
-
account,
|
|
246
|
-
describe,
|
|
247
|
-
download,
|
|
248
|
-
list
|
|
336
|
+
//#endregion
|
|
337
|
+
//#region src/modules/list/list.ts
|
|
338
|
+
const list = async (query, options) => {
|
|
339
|
+
await assertVersionCompatibility(options);
|
|
340
|
+
const url = constructUrl(query, options);
|
|
341
|
+
const response = await ky.get(url).json();
|
|
342
|
+
return await RegistryListResponse.parseAsync(response);
|
|
249
343
|
};
|
|
344
|
+
|
|
345
|
+
//#endregion
|
|
346
|
+
export { account, describe, download, list };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@directus/extensions-registry",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.11",
|
|
4
4
|
"description": "Abstraction for exploring Directus extensions on a package registry",
|
|
5
5
|
"homepage": "https://directus.io",
|
|
6
6
|
"repository": {
|
|
@@ -23,21 +23,21 @@
|
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"ky": "1.8.2",
|
|
25
25
|
"zod": "4.0.14",
|
|
26
|
-
"@directus/constants": "13.0.
|
|
27
|
-
"@directus/
|
|
28
|
-
"@directus/
|
|
26
|
+
"@directus/constants": "13.0.3",
|
|
27
|
+
"@directus/errors": "2.0.4",
|
|
28
|
+
"@directus/extensions": "3.0.11"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@directus/tsconfig": "3.0.0",
|
|
32
32
|
"@vitest/coverage-v8": "3.2.4",
|
|
33
|
-
"
|
|
33
|
+
"tsdown": "0.14.2",
|
|
34
34
|
"typescript": "5.8.3",
|
|
35
35
|
"vitest": "3.2.4",
|
|
36
|
-
"@directus/types": "13.2.
|
|
36
|
+
"@directus/types": "13.2.3"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
|
-
"build": "
|
|
40
|
-
"dev": "
|
|
39
|
+
"build": "tsdown src/index.ts --dts",
|
|
40
|
+
"dev": "tsdown src/index.ts --dts --watch",
|
|
41
41
|
"test": "vitest run",
|
|
42
42
|
"test:coverage": "vitest run --coverage"
|
|
43
43
|
}
|