directus-template-cli 0.5.0-beta.2 → 0.5.0-beta.20
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/README.md +176 -15
- package/dist/commands/apply.d.ts +41 -18
- package/dist/commands/apply.js +113 -122
- package/dist/commands/extract.d.ts +29 -1
- package/dist/commands/extract.js +76 -51
- package/dist/flags/common.d.ts +7 -0
- package/dist/flags/common.js +41 -0
- package/dist/lib/constants.d.ts +3 -0
- package/dist/lib/constants.js +6 -0
- package/dist/lib/extract/extract-access.js +5 -3
- package/dist/lib/extract/extract-assets.d.ts +0 -414
- package/dist/lib/extract/extract-assets.js +29 -25
- package/dist/lib/extract/extract-collections.js +5 -4
- package/dist/lib/extract/extract-content.d.ts +0 -2
- package/dist/lib/extract/extract-content.js +16 -15
- package/dist/lib/extract/extract-dashboards.js +8 -6
- package/dist/lib/extract/extract-extensions.js +5 -3
- package/dist/lib/extract/extract-fields.js +5 -4
- package/dist/lib/extract/extract-files.js +5 -3
- package/dist/lib/extract/extract-flows.js +8 -6
- package/dist/lib/extract/extract-folders.js +5 -3
- package/dist/lib/extract/extract-permissions.js +5 -3
- package/dist/lib/extract/extract-policies.js +5 -3
- package/dist/lib/extract/extract-presets.js +5 -3
- package/dist/lib/extract/extract-relations.js +5 -3
- package/dist/lib/extract/extract-roles.js +5 -3
- package/dist/lib/extract/extract-schema.js +6 -8
- package/dist/lib/extract/extract-settings.js +5 -3
- package/dist/lib/extract/extract-translations.js +6 -6
- package/dist/lib/extract/extract-users.js +6 -6
- package/dist/lib/load/apply-flags.d.ts +22 -0
- package/dist/lib/load/apply-flags.js +67 -0
- package/dist/lib/load/index.js +9 -5
- package/dist/lib/load/load-access.js +47 -41
- package/dist/lib/load/load-collections.js +61 -17
- package/dist/lib/load/load-dashboards.js +30 -30
- package/dist/lib/load/load-data.js +47 -11
- package/dist/lib/load/load-extensions.js +49 -43
- package/dist/lib/load/load-files.js +44 -51
- package/dist/lib/load/load-flows.d.ts +1 -1
- package/dist/lib/load/load-flows.js +44 -38
- package/dist/lib/load/load-folders.js +34 -35
- package/dist/lib/load/load-permissions.js +15 -17
- package/dist/lib/load/load-policies.js +23 -21
- package/dist/lib/load/load-presets.js +27 -26
- package/dist/lib/load/load-relations.js +19 -18
- package/dist/lib/load/load-roles.js +45 -45
- package/dist/lib/load/load-settings.js +39 -2
- package/dist/lib/load/load-translations.js +24 -24
- package/dist/lib/load/load-users.js +44 -34
- package/dist/lib/load/update-required-fields.d.ts +1 -0
- package/dist/lib/load/update-required-fields.js +24 -0
- package/dist/lib/sdk.d.ts +20 -2
- package/dist/lib/sdk.js +124 -9
- package/dist/lib/utils/auth.d.ts +26 -0
- package/dist/lib/utils/auth.js +48 -4
- package/dist/lib/utils/catch-error.d.ts +15 -2
- package/dist/lib/utils/catch-error.js +31 -25
- package/dist/lib/utils/get-template.d.ts +1 -0
- package/dist/lib/utils/get-template.js +42 -1
- package/dist/lib/utils/read-file.js +2 -1
- package/dist/lib/utils/read-templates.js +4 -2
- package/oclif.manifest.json +74 -28
- package/package.json +2 -2
- package/dist/lib/interfaces.d.ts +0 -8
- package/dist/lib/interfaces.js +0 -2
|
@@ -17,8 +17,10 @@ async function readTemplate(directoryPath) {
|
|
|
17
17
|
}
|
|
18
18
|
return null;
|
|
19
19
|
}
|
|
20
|
-
catch
|
|
21
|
-
console.error(
|
|
20
|
+
catch {
|
|
21
|
+
// console.error(
|
|
22
|
+
// `Failed to read package.json file in directory ${directoryPath}: ${error}`,
|
|
23
|
+
// )
|
|
22
24
|
return null;
|
|
23
25
|
}
|
|
24
26
|
}
|
package/oclif.manifest.json
CHANGED
|
@@ -13,15 +13,6 @@
|
|
|
13
13
|
"content": {
|
|
14
14
|
"description": "Load Content (data)",
|
|
15
15
|
"name": "content",
|
|
16
|
-
"relationships": [
|
|
17
|
-
{
|
|
18
|
-
"flags": [
|
|
19
|
-
"schema",
|
|
20
|
-
"files"
|
|
21
|
-
],
|
|
22
|
-
"type": "all"
|
|
23
|
-
}
|
|
24
|
-
],
|
|
25
16
|
"allowNo": true,
|
|
26
17
|
"type": "boolean"
|
|
27
18
|
},
|
|
@@ -33,15 +24,19 @@
|
|
|
33
24
|
},
|
|
34
25
|
"directusToken": {
|
|
35
26
|
"description": "Token to use for the Directus instance",
|
|
36
|
-
"env": "
|
|
27
|
+
"env": "DIRECTUS_TOKEN",
|
|
28
|
+
"exclusive": [
|
|
29
|
+
"userEmail",
|
|
30
|
+
"userPassword"
|
|
31
|
+
],
|
|
37
32
|
"name": "directusToken",
|
|
38
33
|
"hasDynamicHelp": false,
|
|
39
34
|
"multiple": false,
|
|
40
35
|
"type": "option"
|
|
41
36
|
},
|
|
42
37
|
"directusUrl": {
|
|
43
|
-
"description": "URL of the Directus instance
|
|
44
|
-
"env": "
|
|
38
|
+
"description": "URL of the Directus instance",
|
|
39
|
+
"env": "DIRECTUS_URL",
|
|
45
40
|
"name": "directusUrl",
|
|
46
41
|
"hasDynamicHelp": false,
|
|
47
42
|
"multiple": false,
|
|
@@ -104,10 +99,9 @@
|
|
|
104
99
|
},
|
|
105
100
|
"templateLocation": {
|
|
106
101
|
"dependsOn": [
|
|
107
|
-
"programmatic"
|
|
108
|
-
"templateType"
|
|
102
|
+
"programmatic"
|
|
109
103
|
],
|
|
110
|
-
"description": "Location of the template
|
|
104
|
+
"description": "Location of the template",
|
|
111
105
|
"env": "TEMPLATE_LOCATION",
|
|
112
106
|
"name": "templateLocation",
|
|
113
107
|
"hasDynamicHelp": false,
|
|
@@ -132,17 +126,37 @@
|
|
|
132
126
|
],
|
|
133
127
|
"type": "option"
|
|
134
128
|
},
|
|
129
|
+
"userEmail": {
|
|
130
|
+
"dependsOn": [
|
|
131
|
+
"userPassword"
|
|
132
|
+
],
|
|
133
|
+
"description": "Email for Directus authentication",
|
|
134
|
+
"env": "DIRECTUS_EMAIL",
|
|
135
|
+
"exclusive": [
|
|
136
|
+
"directusToken"
|
|
137
|
+
],
|
|
138
|
+
"name": "userEmail",
|
|
139
|
+
"hasDynamicHelp": false,
|
|
140
|
+
"multiple": false,
|
|
141
|
+
"type": "option"
|
|
142
|
+
},
|
|
143
|
+
"userPassword": {
|
|
144
|
+
"dependsOn": [
|
|
145
|
+
"userEmail"
|
|
146
|
+
],
|
|
147
|
+
"description": "Password for Directus authentication",
|
|
148
|
+
"env": "DIRECTUS_PASSWORD",
|
|
149
|
+
"exclusive": [
|
|
150
|
+
"directusToken"
|
|
151
|
+
],
|
|
152
|
+
"name": "userPassword",
|
|
153
|
+
"hasDynamicHelp": false,
|
|
154
|
+
"multiple": false,
|
|
155
|
+
"type": "option"
|
|
156
|
+
},
|
|
135
157
|
"users": {
|
|
136
158
|
"description": "Load users",
|
|
137
159
|
"name": "users",
|
|
138
|
-
"relationships": [
|
|
139
|
-
{
|
|
140
|
-
"flags": [
|
|
141
|
-
"permissions"
|
|
142
|
-
],
|
|
143
|
-
"type": "all"
|
|
144
|
-
}
|
|
145
|
-
],
|
|
146
160
|
"allowNo": true,
|
|
147
161
|
"type": "boolean"
|
|
148
162
|
}
|
|
@@ -173,15 +187,19 @@
|
|
|
173
187
|
"flags": {
|
|
174
188
|
"directusToken": {
|
|
175
189
|
"description": "Token to use for the Directus instance",
|
|
176
|
-
"env": "
|
|
190
|
+
"env": "DIRECTUS_TOKEN",
|
|
191
|
+
"exclusive": [
|
|
192
|
+
"userEmail",
|
|
193
|
+
"userPassword"
|
|
194
|
+
],
|
|
177
195
|
"name": "directusToken",
|
|
178
196
|
"hasDynamicHelp": false,
|
|
179
197
|
"multiple": false,
|
|
180
198
|
"type": "option"
|
|
181
199
|
},
|
|
182
200
|
"directusUrl": {
|
|
183
|
-
"description": "URL of the Directus instance
|
|
184
|
-
"env": "
|
|
201
|
+
"description": "URL of the Directus instance",
|
|
202
|
+
"env": "DIRECTUS_URL",
|
|
185
203
|
"name": "directusUrl",
|
|
186
204
|
"hasDynamicHelp": false,
|
|
187
205
|
"multiple": false,
|
|
@@ -199,7 +217,7 @@
|
|
|
199
217
|
"dependsOn": [
|
|
200
218
|
"programmatic"
|
|
201
219
|
],
|
|
202
|
-
"description": "
|
|
220
|
+
"description": "Location of the template",
|
|
203
221
|
"env": "TEMPLATE_LOCATION",
|
|
204
222
|
"name": "templateLocation",
|
|
205
223
|
"hasDynamicHelp": false,
|
|
@@ -216,6 +234,34 @@
|
|
|
216
234
|
"hasDynamicHelp": false,
|
|
217
235
|
"multiple": false,
|
|
218
236
|
"type": "option"
|
|
237
|
+
},
|
|
238
|
+
"userEmail": {
|
|
239
|
+
"dependsOn": [
|
|
240
|
+
"userPassword"
|
|
241
|
+
],
|
|
242
|
+
"description": "Email for Directus authentication",
|
|
243
|
+
"env": "DIRECTUS_EMAIL",
|
|
244
|
+
"exclusive": [
|
|
245
|
+
"directusToken"
|
|
246
|
+
],
|
|
247
|
+
"name": "userEmail",
|
|
248
|
+
"hasDynamicHelp": false,
|
|
249
|
+
"multiple": false,
|
|
250
|
+
"type": "option"
|
|
251
|
+
},
|
|
252
|
+
"userPassword": {
|
|
253
|
+
"dependsOn": [
|
|
254
|
+
"userEmail"
|
|
255
|
+
],
|
|
256
|
+
"description": "Password for Directus authentication",
|
|
257
|
+
"env": "DIRECTUS_PASSWORD",
|
|
258
|
+
"exclusive": [
|
|
259
|
+
"directusToken"
|
|
260
|
+
],
|
|
261
|
+
"name": "userPassword",
|
|
262
|
+
"hasDynamicHelp": false,
|
|
263
|
+
"multiple": false,
|
|
264
|
+
"type": "option"
|
|
219
265
|
}
|
|
220
266
|
},
|
|
221
267
|
"hasDynamicHelp": false,
|
|
@@ -234,5 +280,5 @@
|
|
|
234
280
|
]
|
|
235
281
|
}
|
|
236
282
|
},
|
|
237
|
-
"version": "0.5.0-beta.
|
|
283
|
+
"version": "0.5.0-beta.20"
|
|
238
284
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "directus-template-cli",
|
|
3
|
-
"version": "0.5.0-beta.
|
|
3
|
+
"version": "0.5.0-beta.20",
|
|
4
4
|
"description": "CLI Utility for applying templates to a Directus instance.",
|
|
5
5
|
"author": "bryantgillespie @bryantgillespie",
|
|
6
6
|
"bin": {
|
|
@@ -18,7 +18,6 @@
|
|
|
18
18
|
],
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@directus/sdk": "^17.0.1",
|
|
21
|
-
"@directus/types": "^12.0.1",
|
|
22
21
|
"@oclif/core": "^3.18.1",
|
|
23
22
|
"@oclif/plugin-help": "^6.0.12",
|
|
24
23
|
"@oclif/plugin-plugins": "^4.1.22",
|
|
@@ -31,6 +30,7 @@
|
|
|
31
30
|
"slugify": "^1.6.6"
|
|
32
31
|
},
|
|
33
32
|
"devDependencies": {
|
|
33
|
+
"@directus/types": "^12.0.1",
|
|
34
34
|
"@oclif/test": "^3.1.13",
|
|
35
35
|
"@types/chai": "^4.3.11",
|
|
36
36
|
"@types/mocha": "^10.0.6",
|
package/dist/lib/interfaces.d.ts
DELETED
package/dist/lib/interfaces.js
DELETED