directus-template-cli 0.4.2 → 0.5.0-beta.1

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 (61) hide show
  1. package/dist/commands/apply.d.ts +22 -1
  2. package/dist/commands/apply.js +243 -106
  3. package/dist/commands/extract.d.ts +12 -0
  4. package/dist/commands/extract.js +79 -16
  5. package/dist/lib/extract/extract-access.d.ts +1 -0
  6. package/dist/lib/extract/extract-access.js +25 -0
  7. package/dist/lib/extract/extract-assets.d.ts +257 -25
  8. package/dist/lib/extract/extract-extensions.d.ts +4 -0
  9. package/dist/lib/extract/extract-extensions.js +22 -0
  10. package/dist/lib/extract/extract-fields.js +8 -2
  11. package/dist/lib/extract/extract-permissions.d.ts +3 -0
  12. package/dist/lib/extract/extract-permissions.js +11 -4
  13. package/dist/lib/extract/extract-policies.d.ts +4 -0
  14. package/dist/lib/extract/extract-policies.js +28 -0
  15. package/dist/lib/extract/extract-presets.js +1 -1
  16. package/dist/lib/extract/extract-relations.js +1 -1
  17. package/dist/lib/extract/index.js +6 -0
  18. package/dist/lib/load/index.d.ts +13 -1
  19. package/dist/lib/load/index.js +38 -20
  20. package/dist/lib/load/load-access.d.ts +1 -0
  21. package/dist/lib/load/load-access.js +62 -0
  22. package/dist/lib/load/load-collections.js +4 -4
  23. package/dist/lib/load/load-dashboards.js +31 -8
  24. package/dist/lib/load/load-data.js +29 -39
  25. package/dist/lib/load/load-extensions.d.ts +1 -0
  26. package/dist/lib/load/load-extensions.js +70 -0
  27. package/dist/lib/load/load-files.d.ts +1 -2
  28. package/dist/lib/load/load-files.js +54 -23
  29. package/dist/lib/load/load-flows.js +19 -7
  30. package/dist/lib/load/load-folders.js +33 -9
  31. package/dist/lib/load/load-permissions.js +16 -9
  32. package/dist/lib/load/load-policies.d.ts +1 -0
  33. package/dist/lib/load/load-policies.js +37 -0
  34. package/dist/lib/load/load-presets.js +25 -8
  35. package/dist/lib/load/load-relations.js +16 -5
  36. package/dist/lib/load/load-roles.js +47 -14
  37. package/dist/lib/load/load-settings.js +7 -4
  38. package/dist/lib/load/load-translations.js +24 -5
  39. package/dist/lib/load/load-users.js +19 -3
  40. package/dist/lib/sdk.d.ts +1 -1
  41. package/dist/lib/sdk.js +10 -3
  42. package/dist/lib/types/extension.d.ts +42 -0
  43. package/dist/lib/types/extension.js +2 -0
  44. package/dist/lib/utils/auth.js +8 -2
  45. package/dist/lib/utils/catch-error.d.ts +6 -0
  46. package/dist/lib/utils/catch-error.js +35 -0
  47. package/dist/lib/utils/check-template.js +1 -16
  48. package/dist/lib/utils/chunk-array.d.ts +1 -0
  49. package/dist/lib/utils/chunk-array.js +7 -0
  50. package/dist/lib/utils/get-role-ids.d.ts +3 -53
  51. package/dist/lib/utils/get-role-ids.js +4 -2
  52. package/dist/lib/utils/get-template.d.ts +8 -0
  53. package/dist/lib/utils/get-template.js +58 -0
  54. package/dist/lib/utils/logger.d.ts +12 -0
  55. package/dist/lib/utils/logger.js +55 -0
  56. package/oclif.manifest.json +192 -5
  57. package/package.json +4 -5
  58. package/dist/lib/load/load-schema.d.ts +0 -14
  59. package/dist/lib/load/load-schema.js +0 -95
  60. package/dist/lib/utils/log-error.d.ts +0 -14
  61. package/dist/lib/utils/log-error.js +0 -25
@@ -1,4 +1,4 @@
1
- export declare function getAssetList(): Promise<import("@directus/sdk/dist/types-ZBNrmR-A").ax<import("@directus/sdk/dist/types-ZBNrmR-A").a8<{
1
+ export declare function getAssetList(): Promise<import("@directus/sdk").Merge<import("@directus/sdk").MapFlatFields<{
2
2
  id: string;
3
3
  storage: string;
4
4
  filename_disk: string;
@@ -8,7 +8,7 @@ export declare function getAssetList(): Promise<import("@directus/sdk/dist/types
8
8
  folder: string | {
9
9
  id: string;
10
10
  name: string;
11
- parent: any;
11
+ parent: string | any;
12
12
  };
13
13
  uploaded_by: string | {
14
14
  id: string;
@@ -20,7 +20,7 @@ export declare function getAssetList(): Promise<import("@directus/sdk/dist/types
20
20
  title: string;
21
21
  description: string;
22
22
  tags: string[];
23
- avatar: any;
23
+ avatar: string | any;
24
24
  language: string;
25
25
  theme: string;
26
26
  tfa_secret: string;
@@ -30,10 +30,31 @@ export declare function getAssetList(): Promise<import("@directus/sdk/dist/types
30
30
  name: string;
31
31
  icon: string;
32
32
  description: string;
33
- ip_access: string;
34
- enforce_tfa: boolean;
35
- admin_access: boolean;
36
- app_access: boolean;
33
+ parent: string | any;
34
+ children: string[] | any[];
35
+ policies: string[] | {
36
+ id: string;
37
+ name: string;
38
+ icon: string;
39
+ description: string;
40
+ ip_access: string;
41
+ enforce_tfa: boolean;
42
+ admin_access: boolean;
43
+ app_access: boolean;
44
+ permissions: number[] | {
45
+ id: number;
46
+ policy: string | any;
47
+ collection: string;
48
+ action: string;
49
+ permissions: Record<string, any>;
50
+ validation: Record<string, any>;
51
+ presets: Record<string, any>;
52
+ fields: string[];
53
+ }[];
54
+ users: string[] | any[];
55
+ roles: string[] | any[];
56
+ }[];
57
+ users: string[] | any[];
37
58
  };
38
59
  token: string;
39
60
  last_access: "datetime";
@@ -42,6 +63,33 @@ export declare function getAssetList(): Promise<import("@directus/sdk/dist/types
42
63
  external_identifier: string;
43
64
  auth_data: Record<string, any>;
44
65
  email_notifications: boolean;
66
+ appearance: string;
67
+ theme_dark: string;
68
+ theme_light: string;
69
+ theme_light_overrides: Record<string, unknown>;
70
+ theme_dark_overrides: Record<string, unknown>;
71
+ policies: string[] | {
72
+ id: string;
73
+ name: string;
74
+ icon: string;
75
+ description: string;
76
+ ip_access: string;
77
+ enforce_tfa: boolean;
78
+ admin_access: boolean;
79
+ app_access: boolean;
80
+ permissions: number[] | {
81
+ id: number;
82
+ policy: string | any;
83
+ collection: string;
84
+ action: string;
85
+ permissions: Record<string, any>;
86
+ validation: Record<string, any>;
87
+ presets: Record<string, any>;
88
+ fields: string[];
89
+ }[];
90
+ users: string[] | any[];
91
+ roles: string[] | any[];
92
+ }[];
45
93
  };
46
94
  uploaded_on: "datetime";
47
95
  modified_by: string | {
@@ -54,7 +102,7 @@ export declare function getAssetList(): Promise<import("@directus/sdk/dist/types
54
102
  title: string;
55
103
  description: string;
56
104
  tags: string[];
57
- avatar: any;
105
+ avatar: string | any;
58
106
  language: string;
59
107
  theme: string;
60
108
  tfa_secret: string;
@@ -64,10 +112,31 @@ export declare function getAssetList(): Promise<import("@directus/sdk/dist/types
64
112
  name: string;
65
113
  icon: string;
66
114
  description: string;
67
- ip_access: string;
68
- enforce_tfa: boolean;
69
- admin_access: boolean;
70
- app_access: boolean;
115
+ parent: string | any;
116
+ children: string[] | any[];
117
+ policies: string[] | {
118
+ id: string;
119
+ name: string;
120
+ icon: string;
121
+ description: string;
122
+ ip_access: string;
123
+ enforce_tfa: boolean;
124
+ admin_access: boolean;
125
+ app_access: boolean;
126
+ permissions: number[] | {
127
+ id: number;
128
+ policy: string | any;
129
+ collection: string;
130
+ action: string;
131
+ permissions: Record<string, any>;
132
+ validation: Record<string, any>;
133
+ presets: Record<string, any>;
134
+ fields: string[];
135
+ }[];
136
+ users: string[] | any[];
137
+ roles: string[] | any[];
138
+ }[];
139
+ users: string[] | any[];
71
140
  };
72
141
  token: string;
73
142
  last_access: "datetime";
@@ -76,6 +145,33 @@ export declare function getAssetList(): Promise<import("@directus/sdk/dist/types
76
145
  external_identifier: string;
77
146
  auth_data: Record<string, any>;
78
147
  email_notifications: boolean;
148
+ appearance: string;
149
+ theme_dark: string;
150
+ theme_light: string;
151
+ theme_light_overrides: Record<string, unknown>;
152
+ theme_dark_overrides: Record<string, unknown>;
153
+ policies: string[] | {
154
+ id: string;
155
+ name: string;
156
+ icon: string;
157
+ description: string;
158
+ ip_access: string;
159
+ enforce_tfa: boolean;
160
+ admin_access: boolean;
161
+ app_access: boolean;
162
+ permissions: number[] | {
163
+ id: number;
164
+ policy: string | any;
165
+ collection: string;
166
+ action: string;
167
+ permissions: Record<string, any>;
168
+ validation: Record<string, any>;
169
+ presets: Record<string, any>;
170
+ fields: string[];
171
+ }[];
172
+ users: string[] | any[];
173
+ roles: string[] | any[];
174
+ }[];
79
175
  };
80
176
  modified_on: "datetime";
81
177
  charset: string;
@@ -88,7 +184,27 @@ export declare function getAssetList(): Promise<import("@directus/sdk/dist/types
88
184
  location: string;
89
185
  tags: string[];
90
186
  metadata: Record<string, any>;
91
- }, "embed" | "type" | "location" | "description" | "id" | "duration" | "title" | "tags" | "storage" | "filename_disk" | "filename_download" | "folder" | "uploaded_by" | "uploaded_on" | "modified_by" | "modified_on" | "charset" | "filesize" | "width" | "height" | "metadata", import("@directus/sdk/dist/types-ZBNrmR-A").aI<import("../sdk").Schema, {
187
+ focal_point_x: number;
188
+ focal_point_y: number;
189
+ }, "embed" | "type" | "location" | "description" | "id" | "duration" | "title" | "tags" | "storage" | "filename_disk" | "filename_download" | "folder" | "uploaded_by" | "uploaded_on" | "modified_by" | "modified_on" | "charset" | "filesize" | "width" | "height" | "metadata" | "focal_point_x" | "focal_point_y", {
190
+ "year(uploaded_on)": "uploaded_on_year";
191
+ "year(modified_on)": "modified_on_year";
192
+ "month(uploaded_on)": "uploaded_on_month";
193
+ "month(modified_on)": "modified_on_month";
194
+ "week(uploaded_on)": "uploaded_on_week";
195
+ "week(modified_on)": "modified_on_week";
196
+ "day(uploaded_on)": "uploaded_on_day";
197
+ "day(modified_on)": "modified_on_day";
198
+ "weekday(uploaded_on)": "uploaded_on_weekday";
199
+ "weekday(modified_on)": "modified_on_weekday";
200
+ "hour(uploaded_on)": "uploaded_on_hour";
201
+ "hour(modified_on)": "modified_on_hour";
202
+ "minute(uploaded_on)": "uploaded_on_minute";
203
+ "minute(modified_on)": "modified_on_minute";
204
+ "second(uploaded_on)": "uploaded_on_second";
205
+ "second(modified_on)": "modified_on_second";
206
+ "count(tags)": "tags_count";
207
+ }>, {}, import("@directus/sdk").MapFlatFields<{
92
208
  id: string;
93
209
  storage: string;
94
210
  filename_disk: string;
@@ -98,7 +214,7 @@ export declare function getAssetList(): Promise<import("@directus/sdk/dist/types
98
214
  folder: string | {
99
215
  id: string;
100
216
  name: string;
101
- parent: any;
217
+ parent: string | any;
102
218
  };
103
219
  uploaded_by: string | {
104
220
  id: string;
@@ -110,7 +226,7 @@ export declare function getAssetList(): Promise<import("@directus/sdk/dist/types
110
226
  title: string;
111
227
  description: string;
112
228
  tags: string[];
113
- avatar: any;
229
+ avatar: string | any;
114
230
  language: string;
115
231
  theme: string;
116
232
  tfa_secret: string;
@@ -120,10 +236,31 @@ export declare function getAssetList(): Promise<import("@directus/sdk/dist/types
120
236
  name: string;
121
237
  icon: string;
122
238
  description: string;
123
- ip_access: string;
124
- enforce_tfa: boolean;
125
- admin_access: boolean;
126
- app_access: boolean;
239
+ parent: string | any;
240
+ children: string[] | any[];
241
+ policies: string[] | {
242
+ id: string;
243
+ name: string;
244
+ icon: string;
245
+ description: string;
246
+ ip_access: string;
247
+ enforce_tfa: boolean;
248
+ admin_access: boolean;
249
+ app_access: boolean;
250
+ permissions: number[] | {
251
+ id: number;
252
+ policy: string | any;
253
+ collection: string;
254
+ action: string;
255
+ permissions: Record<string, any>;
256
+ validation: Record<string, any>;
257
+ presets: Record<string, any>;
258
+ fields: string[];
259
+ }[];
260
+ users: string[] | any[];
261
+ roles: string[] | any[];
262
+ }[];
263
+ users: string[] | any[];
127
264
  };
128
265
  token: string;
129
266
  last_access: "datetime";
@@ -132,6 +269,33 @@ export declare function getAssetList(): Promise<import("@directus/sdk/dist/types
132
269
  external_identifier: string;
133
270
  auth_data: Record<string, any>;
134
271
  email_notifications: boolean;
272
+ appearance: string;
273
+ theme_dark: string;
274
+ theme_light: string;
275
+ theme_light_overrides: Record<string, unknown>;
276
+ theme_dark_overrides: Record<string, unknown>;
277
+ policies: string[] | {
278
+ id: string;
279
+ name: string;
280
+ icon: string;
281
+ description: string;
282
+ ip_access: string;
283
+ enforce_tfa: boolean;
284
+ admin_access: boolean;
285
+ app_access: boolean;
286
+ permissions: number[] | {
287
+ id: number;
288
+ policy: string | any;
289
+ collection: string;
290
+ action: string;
291
+ permissions: Record<string, any>;
292
+ validation: Record<string, any>;
293
+ presets: Record<string, any>;
294
+ fields: string[];
295
+ }[];
296
+ users: string[] | any[];
297
+ roles: string[] | any[];
298
+ }[];
135
299
  };
136
300
  uploaded_on: "datetime";
137
301
  modified_by: string | {
@@ -144,7 +308,7 @@ export declare function getAssetList(): Promise<import("@directus/sdk/dist/types
144
308
  title: string;
145
309
  description: string;
146
310
  tags: string[];
147
- avatar: any;
311
+ avatar: string | any;
148
312
  language: string;
149
313
  theme: string;
150
314
  tfa_secret: string;
@@ -154,10 +318,31 @@ export declare function getAssetList(): Promise<import("@directus/sdk/dist/types
154
318
  name: string;
155
319
  icon: string;
156
320
  description: string;
157
- ip_access: string;
158
- enforce_tfa: boolean;
159
- admin_access: boolean;
160
- app_access: boolean;
321
+ parent: string | any;
322
+ children: string[] | any[];
323
+ policies: string[] | {
324
+ id: string;
325
+ name: string;
326
+ icon: string;
327
+ description: string;
328
+ ip_access: string;
329
+ enforce_tfa: boolean;
330
+ admin_access: boolean;
331
+ app_access: boolean;
332
+ permissions: number[] | {
333
+ id: number;
334
+ policy: string | any;
335
+ collection: string;
336
+ action: string;
337
+ permissions: Record<string, any>;
338
+ validation: Record<string, any>;
339
+ presets: Record<string, any>;
340
+ fields: string[];
341
+ }[];
342
+ users: string[] | any[];
343
+ roles: string[] | any[];
344
+ }[];
345
+ users: string[] | any[];
161
346
  };
162
347
  token: string;
163
348
  last_access: "datetime";
@@ -166,6 +351,33 @@ export declare function getAssetList(): Promise<import("@directus/sdk/dist/types
166
351
  external_identifier: string;
167
352
  auth_data: Record<string, any>;
168
353
  email_notifications: boolean;
354
+ appearance: string;
355
+ theme_dark: string;
356
+ theme_light: string;
357
+ theme_light_overrides: Record<string, unknown>;
358
+ theme_dark_overrides: Record<string, unknown>;
359
+ policies: string[] | {
360
+ id: string;
361
+ name: string;
362
+ icon: string;
363
+ description: string;
364
+ ip_access: string;
365
+ enforce_tfa: boolean;
366
+ admin_access: boolean;
367
+ app_access: boolean;
368
+ permissions: number[] | {
369
+ id: number;
370
+ policy: string | any;
371
+ collection: string;
372
+ action: string;
373
+ permissions: Record<string, any>;
374
+ validation: Record<string, any>;
375
+ presets: Record<string, any>;
376
+ fields: string[];
377
+ }[];
378
+ users: string[] | any[];
379
+ roles: string[] | any[];
380
+ }[];
169
381
  };
170
382
  modified_on: "datetime";
171
383
  charset: string;
@@ -178,6 +390,26 @@ export declare function getAssetList(): Promise<import("@directus/sdk/dist/types
178
390
  location: string;
179
391
  tags: string[];
180
392
  metadata: Record<string, any>;
181
- }>>, {}>[]>;
393
+ focal_point_x: number;
394
+ focal_point_y: number;
395
+ }, "embed" | "type" | "location" | "description" | "id" | "duration" | "title" | "tags" | "storage" | "filename_disk" | "filename_download" | "folder" | "uploaded_by" | "uploaded_on" | "modified_by" | "modified_on" | "charset" | "filesize" | "width" | "height" | "metadata" | "focal_point_x" | "focal_point_y", {
396
+ "year(uploaded_on)": "uploaded_on_year";
397
+ "year(modified_on)": "modified_on_year";
398
+ "month(uploaded_on)": "uploaded_on_month";
399
+ "month(modified_on)": "modified_on_month";
400
+ "week(uploaded_on)": "uploaded_on_week";
401
+ "week(modified_on)": "modified_on_week";
402
+ "day(uploaded_on)": "uploaded_on_day";
403
+ "day(modified_on)": "modified_on_day";
404
+ "weekday(uploaded_on)": "uploaded_on_weekday";
405
+ "weekday(modified_on)": "modified_on_weekday";
406
+ "hour(uploaded_on)": "uploaded_on_hour";
407
+ "hour(modified_on)": "modified_on_hour";
408
+ "minute(uploaded_on)": "uploaded_on_minute";
409
+ "minute(modified_on)": "modified_on_minute";
410
+ "second(uploaded_on)": "uploaded_on_second";
411
+ "second(modified_on)": "modified_on_second";
412
+ "count(tags)": "tags_count";
413
+ }>, {}>[]>;
182
414
  export declare function downloadFile(file: any, dir: string): Promise<void>;
183
415
  export declare function downloadAllFiles(dir: string): Promise<void>;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Extract extensions from the API
3
+ */
4
+ export default function extractExtensions(dir: string): Promise<void>;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const sdk_1 = require("@directus/sdk");
5
+ const core_1 = require("@oclif/core");
6
+ const sdk_2 = require("../sdk");
7
+ const write_to_file_1 = tslib_1.__importDefault(require("../utils/write-to-file"));
8
+ /**
9
+ * Extract extensions from the API
10
+ */
11
+ async function extractExtensions(dir) {
12
+ try {
13
+ const response = await sdk_2.api.client.request((0, sdk_1.readExtensions)());
14
+ await (0, write_to_file_1.default)('extensions', response, dir);
15
+ core_1.ux.log('Extracted extensions');
16
+ }
17
+ catch (error) {
18
+ core_1.ux.warn('Error extracting extensions:');
19
+ core_1.ux.warn(error.message);
20
+ }
21
+ }
22
+ exports.default = extractExtensions;
@@ -11,12 +11,17 @@ const write_to_file_1 = tslib_1.__importDefault(require("../utils/write-to-file"
11
11
  async function extractFields(dir) {
12
12
  try {
13
13
  const response = await sdk_2.api.client.request((0, sdk_1.readFields)());
14
+ if (!Array.isArray(response)) {
15
+ throw new TypeError('Unexpected response format');
16
+ }
14
17
  const fields = response
15
18
  .filter(
16
19
  // @ts-ignore
17
- (i) => !i.meta.system)
20
+ (i) => i.meta && !i.meta.system)
18
21
  .map(i => {
19
- delete i.meta.id;
22
+ if (i.meta) {
23
+ delete i.meta.id;
24
+ }
20
25
  return i;
21
26
  });
22
27
  await (0, write_to_file_1.default)('fields', fields, dir);
@@ -25,6 +30,7 @@ async function extractFields(dir) {
25
30
  catch (error) {
26
31
  core_1.ux.warn('Error extracting Fields:');
27
32
  core_1.ux.warn(error.message);
33
+ console.error(error);
28
34
  }
29
35
  }
30
36
  exports.default = extractFields;
@@ -1 +1,4 @@
1
+ /**
2
+ * Extract Permissions from the API
3
+ */
1
4
  export default function extractPermissions(dir: string): Promise<void>;
@@ -5,15 +5,22 @@ const sdk_1 = require("@directus/sdk");
5
5
  const core_1 = require("@oclif/core");
6
6
  const sdk_2 = require("../sdk");
7
7
  const write_to_file_1 = tslib_1.__importDefault(require("../utils/write-to-file"));
8
+ /**
9
+ * Extract Permissions from the API
10
+ */
8
11
  async function extractPermissions(dir) {
9
12
  try {
10
- const response = await sdk_2.api.client.request((0, sdk_1.readPermissions)({
13
+ let response = await sdk_2.api.client.request((0, sdk_1.readPermissions)({
11
14
  limit: -1,
12
15
  }));
13
16
  // Delete the id field from the permissions so we don't have to reset the autoincrement on the db
14
- for (const permission of response) {
15
- delete permission.id;
16
- }
17
+ // Permissions API returns some items without a linked Policy, and are not stored in the DB
18
+ response = response
19
+ .filter(i => i.policy !== null)
20
+ .map(i => {
21
+ delete i.id;
22
+ return i;
23
+ });
17
24
  await (0, write_to_file_1.default)('permissions', response, dir);
18
25
  core_1.ux.log('Extracted permissions');
19
26
  }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Extract policies from the API
3
+ */
4
+ export default function extractPolicies(dir: string): Promise<void>;
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const sdk_1 = require("@directus/sdk");
5
+ const core_1 = require("@oclif/core");
6
+ const sdk_2 = require("../sdk");
7
+ const write_to_file_1 = tslib_1.__importDefault(require("../utils/write-to-file"));
8
+ /**
9
+ * Extract policies from the API
10
+ */
11
+ async function extractPolicies(dir) {
12
+ try {
13
+ const response = await sdk_2.api.client.request((0, sdk_1.readPolicies)({ limit: -1 }));
14
+ // Delete the id field from the permissions so we don't have to reset the autoincrement on the db
15
+ for (const policies of response) {
16
+ delete policies.users; // Alias Field
17
+ delete policies.roles; // Alias Field
18
+ delete policies.permissions; // Alias Field
19
+ }
20
+ await (0, write_to_file_1.default)('policies', response, dir);
21
+ core_1.ux.log('Extracted policies');
22
+ }
23
+ catch (error) {
24
+ core_1.ux.warn('Error extracting policies:');
25
+ core_1.ux.warn(error.message);
26
+ }
27
+ }
28
+ exports.default = extractPolicies;
@@ -18,7 +18,7 @@ async function extractPresets(dir) {
18
18
  limit: -1,
19
19
  }));
20
20
  // Remove the id field from the presets so we don't have to reset the autoincrement on the db
21
- const presets = response.map((preset) => {
21
+ const presets = response.map(preset => {
22
22
  delete preset.id;
23
23
  return preset;
24
24
  });
@@ -13,7 +13,7 @@ async function extractRelations(dir) {
13
13
  const response = await sdk_2.api.client.request((0, sdk_1.readRelations)());
14
14
  // Fetching fields to filter out system fields while retaining custom fields on system collections
15
15
  const fields = await sdk_2.api.client.request((0, sdk_1.readFields)());
16
- const customFields = fields.filter((i) => !i.meta.system);
16
+ const customFields = fields.filter((i) => { var _a; return !((_a = i.meta) === null || _a === void 0 ? void 0 : _a.system); });
17
17
  const relations = response
18
18
  // Filter out relations where the collection starts with 'directus_' && the field is not within the customFields array
19
19
  .filter((i) => !i.collection.startsWith('directus_', 0)
@@ -3,15 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const core_1 = require("@oclif/core");
5
5
  const node_fs_1 = tslib_1.__importDefault(require("node:fs"));
6
+ const extract_access_1 = tslib_1.__importDefault(require("./extract-access"));
6
7
  const extract_assets_1 = require("./extract-assets");
7
8
  const extract_collections_1 = tslib_1.__importDefault(require("./extract-collections"));
8
9
  const extract_content_1 = require("./extract-content");
9
10
  const extract_dashboards_1 = require("./extract-dashboards");
11
+ const extract_extensions_1 = tslib_1.__importDefault(require("./extract-extensions"));
10
12
  const extract_fields_1 = tslib_1.__importDefault(require("./extract-fields"));
11
13
  const extract_files_1 = tslib_1.__importDefault(require("./extract-files"));
12
14
  const extract_flows_1 = require("./extract-flows");
13
15
  const extract_folders_1 = tslib_1.__importDefault(require("./extract-folders"));
14
16
  const extract_permissions_1 = tslib_1.__importDefault(require("./extract-permissions"));
17
+ const extract_policies_1 = tslib_1.__importDefault(require("./extract-policies"));
15
18
  const extract_presets_1 = tslib_1.__importDefault(require("./extract-presets"));
16
19
  const extract_relations_1 = tslib_1.__importDefault(require("./extract-relations"));
17
20
  const extract_roles_1 = tslib_1.__importDefault(require("./extract-roles"));
@@ -36,6 +39,8 @@ async function extract(dir) {
36
39
  await (0, extract_users_1.default)(destination);
37
40
  await (0, extract_roles_1.default)(destination);
38
41
  await (0, extract_permissions_1.default)(destination);
42
+ await (0, extract_policies_1.default)(destination);
43
+ await (0, extract_access_1.default)(destination);
39
44
  await (0, extract_presets_1.default)(destination);
40
45
  await (0, extract_translations_1.default)(destination);
41
46
  await (0, extract_flows_1.extractFlows)(destination);
@@ -43,6 +48,7 @@ async function extract(dir) {
43
48
  await (0, extract_dashboards_1.extractDashboards)(destination);
44
49
  await (0, extract_dashboards_1.extractPanels)(destination);
45
50
  await (0, extract_settings_1.default)(destination);
51
+ await (0, extract_extensions_1.default)(destination);
46
52
  await (0, extract_content_1.extractContent)(destination);
47
53
  await (0, extract_assets_1.downloadAllFiles)(destination);
48
54
  return {};
@@ -1 +1,13 @@
1
- export default function apply(dir: string): Promise<{}>;
1
+ interface ApplyFlags {
2
+ content: boolean;
3
+ dashboards: boolean;
4
+ extensions: boolean;
5
+ files: boolean;
6
+ flows: boolean;
7
+ permissions: boolean;
8
+ schema: boolean;
9
+ settings: boolean;
10
+ users: boolean;
11
+ }
12
+ export default function apply(dir: string, flags: ApplyFlags): Promise<{}>;
13
+ export {};