@directus/extensions-registry 3.0.21 → 3.0.23

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 CHANGED
@@ -1,12 +1,7 @@
1
1
  import { z } from "zod";
2
- import * as stream_web0 from "stream/web";
2
+ import { ReadableStream } from "stream/web";
3
3
  import { ExtensionType } from "@directus/types";
4
4
 
5
- //#region src/modules/account/types/account-options.d.ts
6
- interface AccountOptions {
7
- registry?: string;
8
- }
9
- //#endregion
10
5
  //#region src/modules/account/schemas/registry-account-response.d.ts
11
6
  declare const RegistryAccountResponse: z.ZodObject<{
12
7
  data: z.ZodObject<{
@@ -24,6 +19,11 @@ declare const RegistryAccountResponse: z.ZodObject<{
24
19
  }, z.core.$strip>;
25
20
  type RegistryAccountResponse = z.infer<typeof RegistryAccountResponse>;
26
21
  //#endregion
22
+ //#region src/modules/account/types/account-options.d.ts
23
+ interface AccountOptions {
24
+ registry?: string;
25
+ }
26
+ //#endregion
27
27
  //#region src/modules/account/account.d.ts
28
28
  /**
29
29
  * Retrieves account information from the extensions registry.
@@ -63,25 +63,7 @@ type RegistryAccountResponse = z.infer<typeof RegistryAccountResponse>;
63
63
  * }
64
64
  * ```
65
65
  */
66
- declare const account: (id: string, options?: AccountOptions) => Promise<{
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
- };
79
- }>;
80
- //#endregion
81
- //#region src/modules/describe/types/describe-options.d.ts
82
- interface DescribeOptions {
83
- registry?: string;
84
- }
66
+ declare const account: (id: string, options?: AccountOptions) => Promise<RegistryAccountResponse>;
85
67
  //#endregion
86
68
  //#region src/modules/describe/schemas/registry-describe-response.d.ts
87
69
  declare const RegistryDescribeResponse: z.ZodObject<{
@@ -158,57 +140,13 @@ declare const RegistryDescribeResponse: z.ZodObject<{
158
140
  }, z.core.$strip>;
159
141
  type RegistryDescribeResponse = z.infer<typeof RegistryDescribeResponse>;
160
142
  //#endregion
143
+ //#region src/modules/describe/types/describe-options.d.ts
144
+ interface DescribeOptions {
145
+ registry?: string;
146
+ }
147
+ //#endregion
161
148
  //#region src/modules/describe/describe.d.ts
162
- declare const describe: (id: string, options?: DescribeOptions) => Promise<{
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: {
190
- id: string;
191
- username: string;
192
- verified: boolean;
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
- };
211
- }>;
149
+ declare const describe: (id: string, options?: DescribeOptions) => Promise<RegistryDescribeResponse>;
212
150
  //#endregion
213
151
  //#region src/modules/download/types/download-options.d.ts
214
152
  interface DownloadOptions {
@@ -268,23 +206,7 @@ interface DownloadOptions {
268
206
  * }
269
207
  * ```
270
208
  */
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
274
- interface ListOptions {
275
- registry?: string;
276
- }
277
- //#endregion
278
- //#region src/modules/list/types/list-query.d.ts
279
- interface ListQuery {
280
- type?: ExtensionType;
281
- search?: string;
282
- limit?: number;
283
- offset?: number;
284
- by?: string;
285
- sort?: 'popular' | 'recent' | 'downloads';
286
- sandbox?: boolean;
287
- }
209
+ declare const download: (versionId: string, requireSandbox?: boolean, options?: DownloadOptions) => Promise<ReadableStream<any> | null>;
288
210
  //#endregion
289
211
  //#region src/modules/list/schemas/registry-list-response.d.ts
290
212
  declare const RegistryListResponse: z.ZodObject<{
@@ -322,28 +244,23 @@ declare const RegistryListResponse: z.ZodObject<{
322
244
  }, z.core.$strip>;
323
245
  type RegistryListResponse = z.infer<typeof RegistryListResponse>;
324
246
  //#endregion
247
+ //#region src/modules/list/types/list-options.d.ts
248
+ interface ListOptions {
249
+ registry?: string;
250
+ }
251
+ //#endregion
252
+ //#region src/modules/list/types/list-query.d.ts
253
+ interface ListQuery {
254
+ type?: ExtensionType;
255
+ search?: string;
256
+ limit?: number;
257
+ offset?: number;
258
+ by?: string;
259
+ sort?: 'popular' | 'recent' | 'downloads';
260
+ sandbox?: boolean;
261
+ }
262
+ //#endregion
325
263
  //#region src/modules/list/list.d.ts
326
- declare const list: (query: ListQuery, options?: ListOptions) => Promise<{
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;
345
- };
346
- }[];
347
- }>;
264
+ declare const list: (query: ListQuery, options?: ListOptions) => Promise<RegistryListResponse>;
348
265
  //#endregion
349
266
  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,6 +1,7 @@
1
1
  import ky from "ky";
2
2
  import { OutOfDateError } from "@directus/errors";
3
3
  import { z } from "zod";
4
+ import { URL as URL$1 } from "url";
4
5
  import { EXTENSION_TYPES } from "@directus/constants";
5
6
 
6
7
  //#region src/constants.ts
@@ -59,7 +60,7 @@ const assertVersionCompatibility = async (options) => {
59
60
  */
60
61
  const constructUrl$3 = (id, options) => {
61
62
  const registry = options?.registry ?? DEFAULT_REGISTRY;
62
- return new URL(`/accounts/${id}`, registry);
63
+ return new URL$1(`/accounts/${id}`, registry);
63
64
  };
64
65
 
65
66
  //#endregion
@@ -128,7 +129,7 @@ const account = async (id, options) => {
128
129
  //#region src/modules/describe/lib/construct-url.ts
129
130
  const constructUrl$2 = (id, options) => {
130
131
  const registry = options?.registry ?? DEFAULT_REGISTRY;
131
- return new URL(`/extensions/${id}`, registry);
132
+ return new URL$1(`/extensions/${id}`, registry);
132
133
  };
133
134
 
134
135
  //#endregion
@@ -230,7 +231,7 @@ const describe = async (id, options) => {
230
231
  */
231
232
  const constructUrl$1 = (versionId, requireSandbox = false, options) => {
232
233
  const registry = options?.registry ?? DEFAULT_REGISTRY;
233
- const url = new URL(`/download/${versionId}`, registry);
234
+ const url = new URL$1(`/download/${versionId}`, registry);
234
235
  if (requireSandbox) url.searchParams.set("sandbox", "true");
235
236
  return url;
236
237
  };
@@ -298,8 +299,7 @@ const download = async (versionId, requireSandbox = false, options) => {
298
299
  //#endregion
299
300
  //#region src/modules/list/lib/construct-url.ts
300
301
  const constructUrl = (query, options) => {
301
- const registry = options?.registry ?? DEFAULT_REGISTRY;
302
- const url = new URL("/extensions", registry);
302
+ const url = new URL$1("/extensions", options?.registry ?? DEFAULT_REGISTRY);
303
303
  if (query.search) url.searchParams.set("search", query.search);
304
304
  if (query.type) url.searchParams.set("type", query.type);
305
305
  if (query.limit) url.searchParams.set("limit", String(query.limit));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@directus/extensions-registry",
3
- "version": "3.0.21",
3
+ "version": "3.0.23",
4
4
  "description": "Abstraction for exploring Directus extensions on a package registry",
5
5
  "homepage": "https://directus.io",
6
6
  "repository": {
@@ -23,17 +23,17 @@
23
23
  "dependencies": {
24
24
  "ky": "1.14.0",
25
25
  "zod": "4.1.12",
26
- "@directus/constants": "14.2.0",
27
- "@directus/errors": "2.2.0",
28
- "@directus/extensions": "3.0.21"
26
+ "@directus/constants": "14.3.0",
27
+ "@directus/errors": "2.3.0",
28
+ "@directus/extensions": "3.0.23"
29
29
  },
30
30
  "devDependencies": {
31
- "@directus/tsconfig": "3.0.0",
31
+ "@directus/tsconfig": "4.0.0",
32
32
  "@vitest/coverage-v8": "3.2.4",
33
33
  "tsdown": "0.15.11",
34
34
  "typescript": "5.9.3",
35
35
  "vitest": "3.2.4",
36
- "@directus/types": "14.3.1"
36
+ "@directus/types": "15.0.1"
37
37
  },
38
38
  "scripts": {
39
39
  "build": "tsdown src/index.ts --dts",