@strapi/strapi 5.0.0-beta.1 → 5.0.0-beta.3
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/admin.d.ts.map +1 -1
- package/dist/admin.js +5 -0
- package/dist/admin.js.map +1 -1
- package/dist/admin.mjs +4 -0
- package/dist/admin.mjs.map +1 -1
- package/dist/cli/commands/admin/create-user.js +2 -2
- package/dist/cli/commands/admin/create-user.js.map +1 -1
- package/dist/cli/commands/admin/create-user.mjs +88 -0
- package/dist/cli/commands/admin/create-user.mjs.map +1 -0
- package/dist/cli/commands/admin/reset-user-password.js +2 -2
- package/dist/cli/commands/admin/reset-user-password.js.map +1 -1
- package/dist/cli/commands/admin/reset-user-password.mjs +44 -0
- package/dist/cli/commands/admin/reset-user-password.mjs.map +1 -0
- package/dist/cli/commands/build.mjs +30 -0
- package/dist/cli/commands/build.mjs.map +1 -0
- package/dist/cli/commands/components/list.js +2 -2
- package/dist/cli/commands/components/list.js.map +1 -1
- package/dist/cli/commands/components/list.mjs +24 -0
- package/dist/cli/commands/components/list.mjs.map +1 -0
- package/dist/cli/commands/configuration/dump.js +2 -2
- package/dist/cli/commands/configuration/dump.js.map +1 -1
- package/dist/cli/commands/configuration/dump.mjs +41 -0
- package/dist/cli/commands/configuration/dump.mjs.map +1 -0
- package/dist/cli/commands/configuration/restore.js +2 -2
- package/dist/cli/commands/configuration/restore.js.map +1 -1
- package/dist/cli/commands/configuration/restore.mjs +140 -0
- package/dist/cli/commands/configuration/restore.mjs.map +1 -0
- package/dist/cli/commands/console.js +2 -2
- package/dist/cli/commands/console.js.map +1 -1
- package/dist/cli/commands/console.mjs +27 -0
- package/dist/cli/commands/console.mjs.map +1 -0
- package/dist/cli/commands/content-types/list.js +2 -2
- package/dist/cli/commands/content-types/list.js.map +1 -1
- package/dist/cli/commands/content-types/list.mjs +24 -0
- package/dist/cli/commands/content-types/list.mjs.map +1 -0
- package/dist/cli/commands/controllers/list.js +2 -2
- package/dist/cli/commands/controllers/list.js.map +1 -1
- package/dist/cli/commands/controllers/list.mjs +24 -0
- package/dist/cli/commands/controllers/list.mjs.map +1 -0
- package/dist/cli/commands/develop.mjs +27 -0
- package/dist/cli/commands/develop.mjs.map +1 -0
- package/dist/cli/commands/export/action.js.map +1 -1
- package/dist/cli/commands/export/action.mjs +116 -0
- package/dist/cli/commands/export/action.mjs.map +1 -0
- package/dist/cli/commands/export/command.mjs +24 -0
- package/dist/cli/commands/export/command.mjs.map +1 -0
- package/dist/cli/commands/generate.mjs +13 -0
- package/dist/cli/commands/generate.mjs.map +1 -0
- package/dist/cli/commands/hooks/list.js +2 -2
- package/dist/cli/commands/hooks/list.js.map +1 -1
- package/dist/cli/commands/hooks/list.mjs +24 -0
- package/dist/cli/commands/hooks/list.mjs.map +1 -0
- package/dist/cli/commands/import/action.js.map +1 -1
- package/dist/cli/commands/import/action.mjs +105 -0
- package/dist/cli/commands/import/action.mjs.map +1 -0
- package/dist/cli/commands/import/command.mjs +68 -0
- package/dist/cli/commands/import/command.mjs.map +1 -0
- package/dist/cli/commands/index.mjs +71 -0
- package/dist/cli/commands/index.mjs.map +1 -0
- package/dist/cli/commands/middlewares/list.js +2 -2
- package/dist/cli/commands/middlewares/list.js.map +1 -1
- package/dist/cli/commands/middlewares/list.mjs +24 -0
- package/dist/cli/commands/middlewares/list.mjs.map +1 -0
- package/dist/cli/commands/plugin/build.mjs +85 -0
- package/dist/cli/commands/plugin/build.mjs.map +1 -0
- package/dist/cli/commands/plugin/init/action.js +1 -1
- package/dist/cli/commands/plugin/init/action.js.map +1 -1
- package/dist/cli/commands/plugin/init/action.mjs +409 -0
- package/dist/cli/commands/plugin/init/action.mjs.map +1 -0
- package/dist/cli/commands/plugin/init/command.mjs +10 -0
- package/dist/cli/commands/plugin/init/command.mjs.map +1 -0
- package/dist/cli/commands/plugin/init/files/admin.mjs +283 -0
- package/dist/cli/commands/plugin/init/files/admin.mjs.map +1 -0
- package/dist/cli/commands/plugin/init/files/editorConfig.mjs +26 -0
- package/dist/cli/commands/plugin/init/files/editorConfig.mjs.map +1 -0
- package/dist/cli/commands/plugin/init/files/eslint.mjs +11 -0
- package/dist/cli/commands/plugin/init/files/eslint.mjs.map +1 -0
- package/dist/cli/commands/plugin/init/files/gitIgnore.mjs +34 -0
- package/dist/cli/commands/plugin/init/files/gitIgnore.mjs.map +1 -0
- package/dist/cli/commands/plugin/init/files/prettier.mjs +25 -0
- package/dist/cli/commands/plugin/init/files/prettier.mjs.map +1 -0
- package/dist/cli/commands/plugin/init/files/server.mjs +360 -0
- package/dist/cli/commands/plugin/init/files/server.mjs.map +1 -0
- package/dist/cli/commands/plugin/init/files/typescript.mjs +66 -0
- package/dist/cli/commands/plugin/init/files/typescript.mjs.map +1 -0
- package/dist/cli/commands/plugin/link-watch.mjs +82 -0
- package/dist/cli/commands/plugin/link-watch.mjs.map +1 -0
- package/dist/cli/commands/plugin/verify.mjs +34 -0
- package/dist/cli/commands/plugin/verify.mjs.map +1 -0
- package/dist/cli/commands/plugin/watch.mjs +83 -0
- package/dist/cli/commands/plugin/watch.mjs.map +1 -0
- package/dist/cli/commands/policies/list.js +2 -2
- package/dist/cli/commands/policies/list.js.map +1 -1
- package/dist/cli/commands/policies/list.mjs +24 -0
- package/dist/cli/commands/policies/list.mjs.map +1 -0
- package/dist/cli/commands/report.js +2 -2
- package/dist/cli/commands/report.js.map +1 -1
- package/dist/cli/commands/report.mjs +35 -0
- package/dist/cli/commands/report.mjs.map +1 -0
- package/dist/cli/commands/routes/list.js +2 -2
- package/dist/cli/commands/routes/list.js.map +1 -1
- package/dist/cli/commands/routes/list.mjs +28 -0
- package/dist/cli/commands/routes/list.mjs.map +1 -0
- package/dist/cli/commands/services/list.js +2 -2
- package/dist/cli/commands/services/list.js.map +1 -1
- package/dist/cli/commands/services/list.mjs +24 -0
- package/dist/cli/commands/services/list.mjs.map +1 -0
- package/dist/cli/commands/start.js +1 -1
- package/dist/cli/commands/start.js.map +1 -1
- package/dist/cli/commands/start.mjs +24 -0
- package/dist/cli/commands/start.mjs.map +1 -0
- package/dist/cli/commands/telemetry/disable.mjs +67 -0
- package/dist/cli/commands/telemetry/disable.mjs.map +1 -0
- package/dist/cli/commands/telemetry/enable.mjs +86 -0
- package/dist/cli/commands/telemetry/enable.mjs.map +1 -0
- package/dist/cli/commands/templates/generate.mjs +74 -0
- package/dist/cli/commands/templates/generate.mjs.map +1 -0
- package/dist/cli/commands/transfer/action.mjs +131 -0
- package/dist/cli/commands/transfer/action.mjs.map +1 -0
- package/dist/cli/commands/transfer/command.mjs +84 -0
- package/dist/cli/commands/transfer/command.mjs.map +1 -0
- package/dist/cli/commands/ts/generate-types.js +2 -2
- package/dist/cli/commands/ts/generate-types.js.map +1 -1
- package/dist/cli/commands/ts/generate-types.mjs +35 -0
- package/dist/cli/commands/ts/generate-types.mjs.map +1 -0
- package/dist/cli/commands/version.mjs +13 -0
- package/dist/cli/commands/version.mjs.map +1 -0
- package/dist/cli/index.mjs +49 -0
- package/dist/cli/index.mjs.map +1 -0
- package/dist/cli/utils/commander.mjs +109 -0
- package/dist/cli/utils/commander.mjs.map +1 -0
- package/dist/cli/utils/data-transfer.d.ts +2 -2
- package/dist/cli/utils/data-transfer.d.ts.map +1 -1
- package/dist/cli/utils/data-transfer.js +2 -2
- package/dist/cli/utils/data-transfer.js.map +1 -1
- package/dist/cli/utils/data-transfer.mjs +339 -0
- package/dist/cli/utils/data-transfer.mjs.map +1 -0
- package/dist/cli/utils/helpers.mjs +100 -0
- package/dist/cli/utils/helpers.mjs.map +1 -0
- package/dist/cli/utils/logger.mjs +80 -0
- package/dist/cli/utils/logger.mjs.map +1 -0
- package/dist/cli/utils/pkg.d.ts.map +1 -1
- package/dist/cli/utils/pkg.js +18 -15
- package/dist/cli/utils/pkg.js.map +1 -1
- package/dist/cli/utils/pkg.mjs +87 -0
- package/dist/cli/utils/pkg.mjs.map +1 -0
- package/dist/cli/utils/telemetry.mjs +22 -0
- package/dist/cli/utils/telemetry.mjs.map +1 -0
- package/dist/cli/utils/tsconfig.mjs +23 -0
- package/dist/cli/utils/tsconfig.mjs.map +1 -0
- package/dist/node/build.mjs +58 -0
- package/dist/node/build.mjs.map +1 -0
- package/dist/node/core/admin-customisations.mjs +22 -0
- package/dist/node/core/admin-customisations.mjs.map +1 -0
- package/dist/node/core/aliases.d.ts.map +1 -1
- package/dist/node/core/aliases.js +3 -1
- package/dist/node/core/aliases.js.map +1 -1
- package/dist/node/core/aliases.mjs +30 -0
- package/dist/node/core/aliases.mjs.map +1 -0
- package/dist/node/core/config.mjs +16 -0
- package/dist/node/core/config.mjs.map +1 -0
- package/dist/node/core/dependencies.mjs +151 -0
- package/dist/node/core/dependencies.mjs.map +1 -0
- package/dist/node/core/env.d.ts.map +1 -1
- package/dist/node/core/env.js +7 -4
- package/dist/node/core/env.js.map +1 -1
- package/dist/node/core/env.mjs +23 -0
- package/dist/node/core/env.mjs.map +1 -0
- package/dist/node/core/errors.mjs +29 -0
- package/dist/node/core/errors.mjs.map +1 -0
- package/dist/node/core/files.mjs +43 -0
- package/dist/node/core/files.mjs.map +1 -0
- package/dist/node/core/managers.mjs +17 -0
- package/dist/node/core/managers.mjs.map +1 -0
- package/dist/node/core/monorepo.mjs +20 -0
- package/dist/node/core/monorepo.mjs.map +1 -0
- package/dist/node/core/plugins.mjs +93 -0
- package/dist/node/core/plugins.mjs.map +1 -0
- package/dist/node/core/timer.mjs +27 -0
- package/dist/node/core/timer.mjs.map +1 -0
- package/dist/node/create-build-context.js +1 -1
- package/dist/node/create-build-context.js.map +1 -1
- package/dist/node/create-build-context.mjs +91 -0
- package/dist/node/create-build-context.mjs.map +1 -0
- package/dist/node/develop.js +1 -1
- package/dist/node/develop.js.map +1 -1
- package/dist/node/develop.mjs +252 -0
- package/dist/node/develop.mjs.map +1 -0
- package/dist/node/staticFiles.d.ts.map +1 -1
- package/dist/node/staticFiles.js +25 -3
- package/dist/node/staticFiles.js.map +1 -1
- package/dist/node/staticFiles.mjs +76 -0
- package/dist/node/staticFiles.mjs.map +1 -0
- package/dist/node/vite/build.mjs +12 -0
- package/dist/node/vite/build.mjs.map +1 -0
- package/dist/node/vite/config.mjs +99 -0
- package/dist/node/vite/config.mjs.map +1 -0
- package/dist/node/vite/plugins.mjs +43 -0
- package/dist/node/vite/plugins.mjs.map +1 -0
- package/dist/node/vite/watch.mjs +52 -0
- package/dist/node/vite/watch.mjs.map +1 -0
- package/dist/node/webpack/build.mjs +39 -0
- package/dist/node/webpack/build.mjs.map +1 -0
- package/dist/node/webpack/config.mjs +228 -0
- package/dist/node/webpack/config.mjs.map +1 -0
- package/dist/node/webpack/watch.mjs +92 -0
- package/dist/node/webpack/watch.mjs.map +1 -0
- package/package.json +24 -24
package/dist/admin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin.d.ts","sourceRoot":"","sources":["../src/admin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAe,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"admin.d.ts","sourceRoot":"","sources":["../src/admin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAe,MAAM,4BAA4B,CAAC;AAU1E,QAAA,MAAM,MAAM,cAAe,WAAW,GAAG,IAAI,4BAA4B,eAAe,kBAiBvF,CAAC;AAEF,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,CAAC;AACjC,YAAY,EAAE,eAAe,EAAE,CAAC;AAEhC,cAAc,4BAA4B,CAAC"}
|
package/dist/admin.js
CHANGED
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const strapiAdmin = require("@strapi/admin/strapi-admin");
|
|
4
4
|
const contentTypeBuilder = require("@strapi/plugin-content-type-builder/strapi-admin");
|
|
5
|
+
const contentManager = require("@strapi/plugin-content-manager/strapi-admin");
|
|
5
6
|
const email = require("@strapi/plugin-email/strapi-admin");
|
|
6
7
|
const upload = require("@strapi/plugin-upload/strapi-admin");
|
|
7
8
|
const i18n = require("@strapi/plugin-i18n/strapi-admin");
|
|
8
9
|
const contentReleases = require("@strapi/content-releases/strapi-admin");
|
|
9
10
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
10
11
|
const contentTypeBuilder__default = /* @__PURE__ */ _interopDefault(contentTypeBuilder);
|
|
12
|
+
const contentManager__default = /* @__PURE__ */ _interopDefault(contentManager);
|
|
11
13
|
const email__default = /* @__PURE__ */ _interopDefault(email);
|
|
12
14
|
const upload__default = /* @__PURE__ */ _interopDefault(upload);
|
|
13
15
|
const i18n__default = /* @__PURE__ */ _interopDefault(i18n);
|
|
@@ -16,6 +18,8 @@ const render = (mountNode, { plugins, ...restArgs }) => {
|
|
|
16
18
|
return strapiAdmin.renderAdmin(mountNode, {
|
|
17
19
|
...restArgs,
|
|
18
20
|
plugins: {
|
|
21
|
+
// @ts-expect-error – TODO: fix this
|
|
22
|
+
"content-manager": contentManager__default.default,
|
|
19
23
|
"content-type-builder": contentTypeBuilder__default.default,
|
|
20
24
|
// @ts-expect-error – TODO: fix this
|
|
21
25
|
email: email__default.default,
|
|
@@ -23,6 +27,7 @@ const render = (mountNode, { plugins, ...restArgs }) => {
|
|
|
23
27
|
// @ts-expect-error – TODO: fix this, the "types" folder has it wrong.
|
|
24
28
|
contentReleases: contentReleases__default.default,
|
|
25
29
|
i18n: i18n__default.default,
|
|
30
|
+
// reviewWorkflows, // ENABLE ME TO WORK ON
|
|
26
31
|
...plugins
|
|
27
32
|
}
|
|
28
33
|
});
|
package/dist/admin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin.js","sources":["../src/admin.ts"],"sourcesContent":["import { RenderAdminArgs, renderAdmin } from '@strapi/admin/strapi-admin';\nimport contentTypeBuilder from '@strapi/plugin-content-type-builder/strapi-admin';\nimport email from '@strapi/plugin-email/strapi-admin';\n// @ts-expect-error – No types, yet.\nimport upload from '@strapi/plugin-upload/strapi-admin';\nimport i18n from '@strapi/plugin-i18n/strapi-admin';\nimport contentReleases from '@strapi/content-releases/strapi-admin';\n\nconst render = (mountNode: HTMLElement | null, { plugins, ...restArgs }: RenderAdminArgs) => {\n return renderAdmin(mountNode, {\n ...restArgs,\n plugins: {\n 'content-type-builder': contentTypeBuilder,\n // @ts-expect-error – TODO: fix this\n email,\n upload,\n // @ts-expect-error – TODO: fix this, the \"types\" folder has it wrong.\n contentReleases,\n i18n,\n ...plugins,\n },\n });\n};\n\nexport { render as renderAdmin };\nexport type { RenderAdminArgs };\n\nexport * from '@strapi/admin/strapi-admin';\n"],"names":["renderAdmin","contentTypeBuilder","email","upload","contentReleases","i18n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"admin.js","sources":["../src/admin.ts"],"sourcesContent":["import { RenderAdminArgs, renderAdmin } from '@strapi/admin/strapi-admin';\nimport contentTypeBuilder from '@strapi/plugin-content-type-builder/strapi-admin';\nimport contentManager from '@strapi/plugin-content-manager/strapi-admin';\nimport email from '@strapi/plugin-email/strapi-admin';\n// @ts-expect-error – No types, yet.\nimport upload from '@strapi/plugin-upload/strapi-admin';\nimport i18n from '@strapi/plugin-i18n/strapi-admin';\nimport contentReleases from '@strapi/content-releases/strapi-admin';\n// import reviewWorkflows from '@strapi/review-workflows/strapi-admin'; // ENABLE ME TO WORK ON\n\nconst render = (mountNode: HTMLElement | null, { plugins, ...restArgs }: RenderAdminArgs) => {\n return renderAdmin(mountNode, {\n ...restArgs,\n plugins: {\n // @ts-expect-error – TODO: fix this\n 'content-manager': contentManager,\n 'content-type-builder': contentTypeBuilder,\n // @ts-expect-error – TODO: fix this\n email,\n upload,\n // @ts-expect-error – TODO: fix this, the \"types\" folder has it wrong.\n contentReleases,\n i18n,\n // reviewWorkflows, // ENABLE ME TO WORK ON\n ...plugins,\n },\n });\n};\n\nexport { render as renderAdmin };\nexport type { RenderAdminArgs };\n\nexport * from '@strapi/admin/strapi-admin';\n"],"names":["renderAdmin","contentManager","contentTypeBuilder","email","upload","contentReleases","i18n"],"mappings":";;;;;;;;;;;;;;;;AAUA,MAAM,SAAS,CAAC,WAA+B,EAAE,SAAS,GAAG,eAAgC;AAC3F,SAAOA,YAAAA,YAAY,WAAW;AAAA,IAC5B,GAAG;AAAA,IACH,SAAS;AAAA;AAAA,MAEP,mBAAmBC,wBAAA;AAAA,MACnB,wBAAwBC,4BAAA;AAAA;AAAA,MAAA,OAExBC,eAAA;AAAA,MAAA,QACAC,gBAAA;AAAA;AAAA,MAAA,iBAEAC,yBAAA;AAAA,MAAA,MACAC,cAAA;AAAA;AAAA,MAEA,GAAG;AAAA,IACL;AAAA,EAAA,CACD;AACH;;;;;;;;;"}
|
package/dist/admin.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { renderAdmin } from "@strapi/admin/strapi-admin";
|
|
2
2
|
export * from "@strapi/admin/strapi-admin";
|
|
3
3
|
import contentTypeBuilder from "@strapi/plugin-content-type-builder/strapi-admin";
|
|
4
|
+
import contentManager from "@strapi/plugin-content-manager/strapi-admin";
|
|
4
5
|
import email from "@strapi/plugin-email/strapi-admin";
|
|
5
6
|
import upload from "@strapi/plugin-upload/strapi-admin";
|
|
6
7
|
import i18n from "@strapi/plugin-i18n/strapi-admin";
|
|
@@ -9,6 +10,8 @@ const render = (mountNode, { plugins, ...restArgs }) => {
|
|
|
9
10
|
return renderAdmin(mountNode, {
|
|
10
11
|
...restArgs,
|
|
11
12
|
plugins: {
|
|
13
|
+
// @ts-expect-error – TODO: fix this
|
|
14
|
+
"content-manager": contentManager,
|
|
12
15
|
"content-type-builder": contentTypeBuilder,
|
|
13
16
|
// @ts-expect-error – TODO: fix this
|
|
14
17
|
email,
|
|
@@ -16,6 +19,7 @@ const render = (mountNode, { plugins, ...restArgs }) => {
|
|
|
16
19
|
// @ts-expect-error – TODO: fix this, the "types" folder has it wrong.
|
|
17
20
|
contentReleases,
|
|
18
21
|
i18n,
|
|
22
|
+
// reviewWorkflows, // ENABLE ME TO WORK ON
|
|
19
23
|
...plugins
|
|
20
24
|
}
|
|
21
25
|
});
|
package/dist/admin.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin.mjs","sources":["../src/admin.ts"],"sourcesContent":["import { RenderAdminArgs, renderAdmin } from '@strapi/admin/strapi-admin';\nimport contentTypeBuilder from '@strapi/plugin-content-type-builder/strapi-admin';\nimport email from '@strapi/plugin-email/strapi-admin';\n// @ts-expect-error – No types, yet.\nimport upload from '@strapi/plugin-upload/strapi-admin';\nimport i18n from '@strapi/plugin-i18n/strapi-admin';\nimport contentReleases from '@strapi/content-releases/strapi-admin';\n\nconst render = (mountNode: HTMLElement | null, { plugins, ...restArgs }: RenderAdminArgs) => {\n return renderAdmin(mountNode, {\n ...restArgs,\n plugins: {\n 'content-type-builder': contentTypeBuilder,\n // @ts-expect-error – TODO: fix this\n email,\n upload,\n // @ts-expect-error – TODO: fix this, the \"types\" folder has it wrong.\n contentReleases,\n i18n,\n ...plugins,\n },\n });\n};\n\nexport { render as renderAdmin };\nexport type { RenderAdminArgs };\n\nexport * from '@strapi/admin/strapi-admin';\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"admin.mjs","sources":["../src/admin.ts"],"sourcesContent":["import { RenderAdminArgs, renderAdmin } from '@strapi/admin/strapi-admin';\nimport contentTypeBuilder from '@strapi/plugin-content-type-builder/strapi-admin';\nimport contentManager from '@strapi/plugin-content-manager/strapi-admin';\nimport email from '@strapi/plugin-email/strapi-admin';\n// @ts-expect-error – No types, yet.\nimport upload from '@strapi/plugin-upload/strapi-admin';\nimport i18n from '@strapi/plugin-i18n/strapi-admin';\nimport contentReleases from '@strapi/content-releases/strapi-admin';\n// import reviewWorkflows from '@strapi/review-workflows/strapi-admin'; // ENABLE ME TO WORK ON\n\nconst render = (mountNode: HTMLElement | null, { plugins, ...restArgs }: RenderAdminArgs) => {\n return renderAdmin(mountNode, {\n ...restArgs,\n plugins: {\n // @ts-expect-error – TODO: fix this\n 'content-manager': contentManager,\n 'content-type-builder': contentTypeBuilder,\n // @ts-expect-error – TODO: fix this\n email,\n upload,\n // @ts-expect-error – TODO: fix this, the \"types\" folder has it wrong.\n contentReleases,\n i18n,\n // reviewWorkflows, // ENABLE ME TO WORK ON\n ...plugins,\n },\n });\n};\n\nexport { render as renderAdmin };\nexport type { RenderAdminArgs };\n\nexport * from '@strapi/admin/strapi-admin';\n"],"names":[],"mappings":";;;;;;;;AAUA,MAAM,SAAS,CAAC,WAA+B,EAAE,SAAS,GAAG,eAAgC;AAC3F,SAAO,YAAY,WAAW;AAAA,IAC5B,GAAG;AAAA,IACH,SAAS;AAAA;AAAA,MAEP,mBAAmB;AAAA,MACnB,wBAAwB;AAAA;AAAA,MAExB;AAAA,MACA;AAAA;AAAA,MAEA;AAAA,MACA;AAAA;AAAA,MAEA,GAAG;AAAA,IACL;AAAA,EAAA,CACD;AACH;"}
|
|
@@ -45,8 +45,8 @@ const promptQuestions = [
|
|
|
45
45
|
}
|
|
46
46
|
];
|
|
47
47
|
async function createAdmin({ email, password, firstname, lastname }) {
|
|
48
|
-
const appContext = await core.
|
|
49
|
-
const app = await core.
|
|
48
|
+
const appContext = await core.compileStrapi();
|
|
49
|
+
const app = await core.createStrapi(appContext).load();
|
|
50
50
|
const user = await app.admin.services.user.exists({ email });
|
|
51
51
|
if (user) {
|
|
52
52
|
console.error(`User with email "${email}" already exists`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-user.js","sources":["../../../../src/cli/commands/admin/create-user.ts"],"sourcesContent":["import { createCommand } from 'commander';\nimport { yup } from '@strapi/utils';\nimport _ from 'lodash';\nimport inquirer from 'inquirer';\nimport {
|
|
1
|
+
{"version":3,"file":"create-user.js","sources":["../../../../src/cli/commands/admin/create-user.ts"],"sourcesContent":["import { createCommand } from 'commander';\nimport { yup } from '@strapi/utils';\nimport _ from 'lodash';\nimport inquirer from 'inquirer';\nimport { createStrapi, compileStrapi } from '@strapi/core';\n\nimport { runAction } from '../../utils/helpers';\nimport type { StrapiCommand } from '../../types';\n\ninterface CmdOptions {\n email?: string;\n password?: string;\n firstname?: string;\n lastname?: string;\n}\n\nconst emailValidator = yup.string().email('Invalid email address').lowercase();\n\nconst passwordValidator = yup\n .string()\n .min(8, 'Password must be at least 8 characters long')\n .matches(/[a-z]/, 'Password must contain at least one lowercase character')\n .matches(/[A-Z]/, 'Password must contain at least one uppercase character')\n .matches(/\\d/, 'Password must contain at least one number');\n\nconst adminCreateSchema = yup.object().shape({\n email: emailValidator,\n password: passwordValidator,\n firstname: yup.string().trim().required('First name is required'),\n lastname: yup.string(),\n});\n\ninterface Answers {\n email: string;\n password: string;\n firstname: string;\n lastname: string;\n confirm: boolean;\n}\n\n/**\n * It's not an observable, in reality this is\n * `ReadOnlyArray<inquirer.DistinctQuestion<Answers>>`\n * but then the logic of the validate function needs to change.\n */\n// eslint-disable-next-line rxjs/finnish\nconst promptQuestions: inquirer.QuestionCollection<Answers> = [\n {\n type: 'input',\n name: 'email',\n message: 'Admin email?',\n async validate(value: string) {\n const validEmail = await emailValidator.validate(value);\n return validEmail === value || validEmail;\n },\n },\n {\n type: 'password',\n name: 'password',\n message: 'Admin password?',\n async validate(value: string) {\n const validPassword = await passwordValidator.validate(value);\n return validPassword === value || validPassword;\n },\n },\n { type: 'input', name: 'firstname', message: 'First name?' },\n { type: 'input', name: 'lastname', message: 'Last name?' },\n {\n type: 'confirm',\n name: 'confirm',\n message: 'Do you really want to create a new admin?',\n },\n];\n\nasync function createAdmin({ email, password, firstname, lastname }: CmdOptions) {\n const appContext = await compileStrapi();\n const app = await createStrapi(appContext).load();\n\n const user = await app.admin!.services.user.exists({ email });\n\n if (user) {\n console.error(`User with email \"${email}\" already exists`);\n process.exit(1);\n }\n\n const superAdminRole = await app.admin!.services.role.getSuperAdmin();\n\n await app.admin!.services.user.create({\n email,\n firstname,\n lastname,\n isActive: true,\n roles: [superAdminRole.id],\n ...(password && { password, registrationToken: null }),\n });\n\n console.log(`Successfully created new admin`);\n process.exit(0);\n}\n\n/**\n * Create new admin user\n */\nconst action = async (cmdOptions: CmdOptions = {}) => {\n let { email, password, firstname, lastname } = cmdOptions;\n\n if (\n _.isEmpty(email) &&\n _.isEmpty(password) &&\n _.isEmpty(firstname) &&\n _.isEmpty(lastname) &&\n process.stdin.isTTY\n ) {\n const inquiry = await inquirer.prompt(promptQuestions);\n\n if (!inquiry.confirm) {\n process.exit(0);\n }\n\n ({ email, password, firstname, lastname } = inquiry);\n }\n\n try {\n await adminCreateSchema.validate({ email, password, firstname, lastname });\n } catch (err) {\n if (err instanceof yup.ValidationError) {\n console.error(err.errors[0]);\n }\n\n process.exit(1);\n }\n\n return createAdmin({ email, password, firstname, lastname });\n};\n\n/**\n * `$ strapi admin:create-user`\n */\nconst command: StrapiCommand = () => {\n return createCommand('admin:create-user')\n .alias('admin:create')\n .description('Create a new admin')\n .option('-e, --email <email>', 'Email of the new admin')\n .option('-p, --password <password>', 'Password of the new admin')\n .option('-f, --firstname <first name>', 'First name of the new admin')\n .option('-l, --lastname <last name>', 'Last name of the new admin')\n .action(runAction('admin:create-user', action));\n};\n\nexport { action, command };\n"],"names":["yup","compileStrapi","createStrapi","_","inquirer","createCommand","runAction"],"mappings":";;;;;;;;;;;AAgBA,MAAM,iBAAiBA,MAAI,IAAA,SAAS,MAAM,uBAAuB,EAAE;AAEnE,MAAM,oBAAoBA,MACvB,IAAA,SACA,IAAI,GAAG,6CAA6C,EACpD,QAAQ,SAAS,wDAAwD,EACzE,QAAQ,SAAS,wDAAwD,EACzE,QAAQ,MAAM,2CAA2C;AAE5D,MAAM,oBAAoBA,MAAA,IAAI,OAAO,EAAE,MAAM;AAAA,EAC3C,OAAO;AAAA,EACP,UAAU;AAAA,EACV,WAAWA,MAAI,IAAA,OAAA,EAAS,KAAK,EAAE,SAAS,wBAAwB;AAAA,EAChE,UAAUA,UAAI,OAAO;AACvB,CAAC;AAgBD,MAAM,k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AE,OAAO,UAAU,WAAW,aAAa;AAE/C,MACEC,WAAAA,QAAE,QAAQ,KAAK,KACfA,WAAAA,QAAE,QAAQ,QAAQ,KAClBA,WAAA,QAAE,QAAQ,SAAS,KACnBA,WAAAA,QAAE,QAAQ,QAAQ,KAClB,QAAQ,MAAM,OACd;AACA,UAAM,UAAU,MAAMC,kBAAAA,QAAS,OAAO,eAAe;AAEjD,QAAA,CAAC,QAAQ,SAAS;AACpB,cAAQ,KAAK,CAAC;AAAA,IAChB;AAEA,KAAC,EAAE,OAAO,UAAU,WAAW,aAAa;AAAA,EAC9C;AAEI,MAAA;AACF,UAAM,kBAAkB,SAAS,EAAE,OAAO,UAAU,WAAW,UAAU;AAAA,WAClE,KAAK;AACR,QAAA,eAAeJ,UAAI,iBAAiB;AACtC,cAAQ,MAAM,IAAI,OAAO,CAAC,CAAC;AAAA,IAC7B;AAEA,YAAQ,KAAK,CAAC;AAAA,EAChB;AAEA,SAAO,YAAY,EAAE,OAAO,UAAU,WAAW,UAAU;AAC7D;AAKA,MAAM,UAAyB,MAAM;AACnC,SAAOK,UAAc,cAAA,mBAAmB,EACrC,MAAM,cAAc,EACpB,YAAY,oBAAoB,EAChC,OAAO,uBAAuB,wBAAwB,EACtD,OAAO,6BAA6B,2BAA2B,EAC/D,OAAO,gCAAgC,6BAA6B,EACpE,OAAO,8BAA8B,4BAA4B,EACjE,OAAOC,QAAAA,UAAU,qBAAqB,MAAM,CAAC;AAClD;;;"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { createCommand } from "commander";
|
|
2
|
+
import { yup } from "@strapi/utils";
|
|
3
|
+
import _ from "lodash";
|
|
4
|
+
import inquirer from "inquirer";
|
|
5
|
+
import { compileStrapi, createStrapi } from "@strapi/core";
|
|
6
|
+
import { runAction } from "../../utils/helpers.mjs";
|
|
7
|
+
const emailValidator = yup.string().email("Invalid email address").lowercase();
|
|
8
|
+
const passwordValidator = yup.string().min(8, "Password must be at least 8 characters long").matches(/[a-z]/, "Password must contain at least one lowercase character").matches(/[A-Z]/, "Password must contain at least one uppercase character").matches(/\d/, "Password must contain at least one number");
|
|
9
|
+
const adminCreateSchema = yup.object().shape({
|
|
10
|
+
email: emailValidator,
|
|
11
|
+
password: passwordValidator,
|
|
12
|
+
firstname: yup.string().trim().required("First name is required"),
|
|
13
|
+
lastname: yup.string()
|
|
14
|
+
});
|
|
15
|
+
const promptQuestions = [
|
|
16
|
+
{
|
|
17
|
+
type: "input",
|
|
18
|
+
name: "email",
|
|
19
|
+
message: "Admin email?",
|
|
20
|
+
async validate(value) {
|
|
21
|
+
const validEmail = await emailValidator.validate(value);
|
|
22
|
+
return validEmail === value || validEmail;
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
type: "password",
|
|
27
|
+
name: "password",
|
|
28
|
+
message: "Admin password?",
|
|
29
|
+
async validate(value) {
|
|
30
|
+
const validPassword = await passwordValidator.validate(value);
|
|
31
|
+
return validPassword === value || validPassword;
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
{ type: "input", name: "firstname", message: "First name?" },
|
|
35
|
+
{ type: "input", name: "lastname", message: "Last name?" },
|
|
36
|
+
{
|
|
37
|
+
type: "confirm",
|
|
38
|
+
name: "confirm",
|
|
39
|
+
message: "Do you really want to create a new admin?"
|
|
40
|
+
}
|
|
41
|
+
];
|
|
42
|
+
async function createAdmin({ email, password, firstname, lastname }) {
|
|
43
|
+
const appContext = await compileStrapi();
|
|
44
|
+
const app = await createStrapi(appContext).load();
|
|
45
|
+
const user = await app.admin.services.user.exists({ email });
|
|
46
|
+
if (user) {
|
|
47
|
+
console.error(`User with email "${email}" already exists`);
|
|
48
|
+
process.exit(1);
|
|
49
|
+
}
|
|
50
|
+
const superAdminRole = await app.admin.services.role.getSuperAdmin();
|
|
51
|
+
await app.admin.services.user.create({
|
|
52
|
+
email,
|
|
53
|
+
firstname,
|
|
54
|
+
lastname,
|
|
55
|
+
isActive: true,
|
|
56
|
+
roles: [superAdminRole.id],
|
|
57
|
+
...password && { password, registrationToken: null }
|
|
58
|
+
});
|
|
59
|
+
console.log(`Successfully created new admin`);
|
|
60
|
+
process.exit(0);
|
|
61
|
+
}
|
|
62
|
+
const action = async (cmdOptions = {}) => {
|
|
63
|
+
let { email, password, firstname, lastname } = cmdOptions;
|
|
64
|
+
if (_.isEmpty(email) && _.isEmpty(password) && _.isEmpty(firstname) && _.isEmpty(lastname) && process.stdin.isTTY) {
|
|
65
|
+
const inquiry = await inquirer.prompt(promptQuestions);
|
|
66
|
+
if (!inquiry.confirm) {
|
|
67
|
+
process.exit(0);
|
|
68
|
+
}
|
|
69
|
+
({ email, password, firstname, lastname } = inquiry);
|
|
70
|
+
}
|
|
71
|
+
try {
|
|
72
|
+
await adminCreateSchema.validate({ email, password, firstname, lastname });
|
|
73
|
+
} catch (err) {
|
|
74
|
+
if (err instanceof yup.ValidationError) {
|
|
75
|
+
console.error(err.errors[0]);
|
|
76
|
+
}
|
|
77
|
+
process.exit(1);
|
|
78
|
+
}
|
|
79
|
+
return createAdmin({ email, password, firstname, lastname });
|
|
80
|
+
};
|
|
81
|
+
const command = () => {
|
|
82
|
+
return createCommand("admin:create-user").alias("admin:create").description("Create a new admin").option("-e, --email <email>", "Email of the new admin").option("-p, --password <password>", "Password of the new admin").option("-f, --firstname <first name>", "First name of the new admin").option("-l, --lastname <last name>", "Last name of the new admin").action(runAction("admin:create-user", action));
|
|
83
|
+
};
|
|
84
|
+
export {
|
|
85
|
+
action,
|
|
86
|
+
command
|
|
87
|
+
};
|
|
88
|
+
//# sourceMappingURL=create-user.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-user.mjs","sources":["../../../../src/cli/commands/admin/create-user.ts"],"sourcesContent":["import { createCommand } from 'commander';\nimport { yup } from '@strapi/utils';\nimport _ from 'lodash';\nimport inquirer from 'inquirer';\nimport { createStrapi, compileStrapi } from '@strapi/core';\n\nimport { runAction } from '../../utils/helpers';\nimport type { StrapiCommand } from '../../types';\n\ninterface CmdOptions {\n email?: string;\n password?: string;\n firstname?: string;\n lastname?: string;\n}\n\nconst emailValidator = yup.string().email('Invalid email address').lowercase();\n\nconst passwordValidator = yup\n .string()\n .min(8, 'Password must be at least 8 characters long')\n .matches(/[a-z]/, 'Password must contain at least one lowercase character')\n .matches(/[A-Z]/, 'Password must contain at least one uppercase character')\n .matches(/\\d/, 'Password must contain at least one number');\n\nconst adminCreateSchema = yup.object().shape({\n email: emailValidator,\n password: passwordValidator,\n firstname: yup.string().trim().required('First name is required'),\n lastname: yup.string(),\n});\n\ninterface Answers {\n email: string;\n password: string;\n firstname: string;\n lastname: string;\n confirm: boolean;\n}\n\n/**\n * It's not an observable, in reality this is\n * `ReadOnlyArray<inquirer.DistinctQuestion<Answers>>`\n * but then the logic of the validate function needs to change.\n */\n// eslint-disable-next-line rxjs/finnish\nconst promptQuestions: inquirer.QuestionCollection<Answers> = [\n {\n type: 'input',\n name: 'email',\n message: 'Admin email?',\n async validate(value: string) {\n const validEmail = await emailValidator.validate(value);\n return validEmail === value || validEmail;\n },\n },\n {\n type: 'password',\n name: 'password',\n message: 'Admin password?',\n async validate(value: string) {\n const validPassword = await passwordValidator.validate(value);\n return validPassword === value || validPassword;\n },\n },\n { type: 'input', name: 'firstname', message: 'First name?' },\n { type: 'input', name: 'lastname', message: 'Last name?' },\n {\n type: 'confirm',\n name: 'confirm',\n message: 'Do you really want to create a new admin?',\n },\n];\n\nasync function createAdmin({ email, password, firstname, lastname }: CmdOptions) {\n const appContext = await compileStrapi();\n const app = await createStrapi(appContext).load();\n\n const user = await app.admin!.services.user.exists({ email });\n\n if (user) {\n console.error(`User with email \"${email}\" already exists`);\n process.exit(1);\n }\n\n const superAdminRole = await app.admin!.services.role.getSuperAdmin();\n\n await app.admin!.services.user.create({\n email,\n firstname,\n lastname,\n isActive: true,\n roles: [superAdminRole.id],\n ...(password && { password, registrationToken: null }),\n });\n\n console.log(`Successfully created new admin`);\n process.exit(0);\n}\n\n/**\n * Create new admin user\n */\nconst action = async (cmdOptions: CmdOptions = {}) => {\n let { email, password, firstname, lastname } = cmdOptions;\n\n if (\n _.isEmpty(email) &&\n _.isEmpty(password) &&\n _.isEmpty(firstname) &&\n _.isEmpty(lastname) &&\n process.stdin.isTTY\n ) {\n const inquiry = await inquirer.prompt(promptQuestions);\n\n if (!inquiry.confirm) {\n process.exit(0);\n }\n\n ({ email, password, firstname, lastname } = inquiry);\n }\n\n try {\n await adminCreateSchema.validate({ email, password, firstname, lastname });\n } catch (err) {\n if (err instanceof yup.ValidationError) {\n console.error(err.errors[0]);\n }\n\n process.exit(1);\n }\n\n return createAdmin({ email, password, firstname, lastname });\n};\n\n/**\n * `$ strapi admin:create-user`\n */\nconst command: StrapiCommand = () => {\n return createCommand('admin:create-user')\n .alias('admin:create')\n .description('Create a new admin')\n .option('-e, --email <email>', 'Email of the new admin')\n .option('-p, --password <password>', 'Password of the new admin')\n .option('-f, --firstname <first name>', 'First name of the new admin')\n .option('-l, --lastname <last name>', 'Last name of the new admin')\n .action(runAction('admin:create-user', action));\n};\n\nexport { action, command };\n"],"names":[],"mappings":";;;;;;AAgBA,MAAM,iBAAiB,IAAI,SAAS,MAAM,uBAAuB,EAAE;AAEnE,MAAM,oBAAoB,IACvB,SACA,IAAI,GAAG,6CAA6C,EACpD,QAAQ,SAAS,wDAAwD,EACzE,QAAQ,SAAS,wDAAwD,EACzE,QAAQ,MAAM,2CAA2C;AAE5D,MAAM,oBAAoB,IAAI,OAAO,EAAE,MAAM;AAAA,EAC3C,OAAO;AAAA,EACP,UAAU;AAAA,EACV,WAAW,IAAI,OAAA,EAAS,KAAK,EAAE,SAAS,wBAAwB;AAAA,EAChE,UAAU,IAAI,OAAO;AACvB,CAAC;AAgBD,MAAM,kBAAwD;AAAA,EAC5D;AAAA,IACE,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT,MAAM,SAAS,OAAe;AAC5B,YAAM,aAAa,MAAM,eAAe,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,MAAM,OACd;AACA,UAAM,UAAU,MAAM,SAAS,OAAO,eAAe;AAEjD,QAAA,CAAC,QAAQ,SAAS;AACpB,cAAQ,KAAK,CAAC;AAAA,IAChB;AAEA,KAAC,EAAE,OAAO,UAAU,WAAW,aAAa;AAAA,EAC9C;AAEI,MAAA;AACF,UAAM,kBAAkB,SAAS,EAAE,OAAO,UAAU,WAAW,UAAU;AAAA,WAClE,KAAK;AACR,QAAA,eAAe,IAAI,iBAAiB;AACtC,cAAQ,MAAM,IAAI,OAAO,CAAC,CAAC;AAAA,IAC7B;AAEA,YAAQ,KAAK,CAAC;AAAA,EAChB;AAEA,SAAO,YAAY,EAAE,OAAO,UAAU,WAAW,UAAU;AAC7D;AAKA,MAAM,UAAyB,MAAM;AACnC,SAAO,cAAc,mBAAmB,EACrC,MAAM,cAAc,EACpB,YAAY,oBAAoB,EAChC,OAAO,uBAAuB,wBAAwB,EACtD,OAAO,6BAA6B,2BAA2B,EAC/D,OAAO,gCAAgC,6BAA6B,EACpE,OAAO,8BAA8B,4BAA4B,EACjE,OAAO,UAAU,qBAAqB,MAAM,CAAC;AAClD;"}
|
|
@@ -18,8 +18,8 @@ const promptQuestions = [
|
|
|
18
18
|
}
|
|
19
19
|
];
|
|
20
20
|
async function changePassword({ email, password }) {
|
|
21
|
-
const appContext = await core.
|
|
22
|
-
const app = await core.
|
|
21
|
+
const appContext = await core.compileStrapi();
|
|
22
|
+
const app = await core.createStrapi(appContext).load();
|
|
23
23
|
await app.admin.services.user.resetPasswordByEmail(email, password);
|
|
24
24
|
console.log(`Successfully reset user's password`);
|
|
25
25
|
process.exit(0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reset-user-password.js","sources":["../../../../src/cli/commands/admin/reset-user-password.ts"],"sourcesContent":["import _ from 'lodash';\nimport inquirer from 'inquirer';\nimport { createCommand } from 'commander';\nimport {
|
|
1
|
+
{"version":3,"file":"reset-user-password.js","sources":["../../../../src/cli/commands/admin/reset-user-password.ts"],"sourcesContent":["import _ from 'lodash';\nimport inquirer from 'inquirer';\nimport { createCommand } from 'commander';\nimport { createStrapi, compileStrapi } from '@strapi/core';\n\nimport type { StrapiCommand } from '../../types';\nimport { runAction } from '../../utils/helpers';\n\ninterface CmdOptions {\n email?: string;\n password?: string;\n}\n\ninterface Answers {\n email: string;\n password: string;\n confirm: boolean;\n}\n\nconst promptQuestions: ReadonlyArray<inquirer.DistinctQuestion<Answers>> = [\n { type: 'input', name: 'email', message: 'User email?' },\n { type: 'password', name: 'password', message: 'New password?' },\n {\n type: 'confirm',\n name: 'confirm',\n message: \"Do you really want to reset this user's password?\",\n },\n];\n\nasync function changePassword({ email, password }: CmdOptions) {\n const appContext = await compileStrapi();\n const app = await createStrapi(appContext).load();\n\n await app.admin!.services.user.resetPasswordByEmail(email, password);\n\n console.log(`Successfully reset user's password`);\n process.exit(0);\n}\n\n/**\n * Reset user's password\n */\nconst action = async (cmdOptions: CmdOptions = {}) => {\n const { email, password } = cmdOptions;\n\n if (_.isEmpty(email) && _.isEmpty(password) && process.stdin.isTTY) {\n const inquiry = await inquirer.prompt(promptQuestions);\n\n if (!inquiry.confirm) {\n process.exit(0);\n }\n\n return changePassword(inquiry);\n }\n\n if (_.isEmpty(email) || _.isEmpty(password)) {\n console.error('Missing required options `email` or `password`');\n process.exit(1);\n }\n\n return changePassword({ email, password });\n};\n\n/**\n * `$ strapi admin:reset-user-password`\n */\nconst command: StrapiCommand = () => {\n return createCommand('admin:reset-user-password')\n .alias('admin:reset-password')\n .description(\"Reset an admin user's password\")\n .option('-e, --email <email>', 'The user email')\n .option('-p, --password <password>', 'New password for the user')\n .action(runAction('admin:reset-user-password', action));\n};\n\nexport { action, command };\n"],"names":["compileStrapi","createStrapi","_","inquirer","createCommand","runAction"],"mappings":";;;;;;;;;;AAmBA,MAAM,kBAAqE;AAAA,EACzE,EAAE,MAAM,SAAS,MAAM,SAAS,SAAS,cAAc;AAAA,EACvD,EAAE,MAAM,YAAY,MAAM,YAA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
|
5
|
+
import { runAction } from "../../utils/helpers.mjs";
|
|
6
|
+
const promptQuestions = [
|
|
7
|
+
{ type: "input", name: "email", message: "User email?" },
|
|
8
|
+
{ type: "password", name: "password", message: "New password?" },
|
|
9
|
+
{
|
|
10
|
+
type: "confirm",
|
|
11
|
+
name: "confirm",
|
|
12
|
+
message: "Do you really want to reset this user's password?"
|
|
13
|
+
}
|
|
14
|
+
];
|
|
15
|
+
async function changePassword({ email, password }) {
|
|
16
|
+
const appContext = await compileStrapi();
|
|
17
|
+
const app = await createStrapi(appContext).load();
|
|
18
|
+
await app.admin.services.user.resetPasswordByEmail(email, password);
|
|
19
|
+
console.log(`Successfully reset user's password`);
|
|
20
|
+
process.exit(0);
|
|
21
|
+
}
|
|
22
|
+
const action = async (cmdOptions = {}) => {
|
|
23
|
+
const { email, password } = cmdOptions;
|
|
24
|
+
if (_.isEmpty(email) && _.isEmpty(password) && process.stdin.isTTY) {
|
|
25
|
+
const inquiry = await inquirer.prompt(promptQuestions);
|
|
26
|
+
if (!inquiry.confirm) {
|
|
27
|
+
process.exit(0);
|
|
28
|
+
}
|
|
29
|
+
return changePassword(inquiry);
|
|
30
|
+
}
|
|
31
|
+
if (_.isEmpty(email) || _.isEmpty(password)) {
|
|
32
|
+
console.error("Missing required options `email` or `password`");
|
|
33
|
+
process.exit(1);
|
|
34
|
+
}
|
|
35
|
+
return changePassword({ email, password });
|
|
36
|
+
};
|
|
37
|
+
const command = () => {
|
|
38
|
+
return createCommand("admin:reset-user-password").alias("admin:reset-password").description("Reset an admin user's password").option("-e, --email <email>", "The user email").option("-p, --password <password>", "New password for the user").action(runAction("admin:reset-user-password", action));
|
|
39
|
+
};
|
|
40
|
+
export {
|
|
41
|
+
action,
|
|
42
|
+
command
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=reset-user-password.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reset-user-password.mjs","sources":["../../../../src/cli/commands/admin/reset-user-password.ts"],"sourcesContent":["import _ from 'lodash';\nimport inquirer from 'inquirer';\nimport { createCommand } from 'commander';\nimport { createStrapi, compileStrapi } from '@strapi/core';\n\nimport type { StrapiCommand } from '../../types';\nimport { runAction } from '../../utils/helpers';\n\ninterface CmdOptions {\n email?: string;\n password?: string;\n}\n\ninterface Answers {\n email: string;\n password: string;\n confirm: boolean;\n}\n\nconst promptQuestions: ReadonlyArray<inquirer.DistinctQuestion<Answers>> = [\n { type: 'input', name: 'email', message: 'User email?' },\n { type: 'password', name: 'password', message: 'New password?' },\n {\n type: 'confirm',\n name: 'confirm',\n message: \"Do you really want to reset this user's password?\",\n },\n];\n\nasync function changePassword({ email, password }: CmdOptions) {\n const appContext = await compileStrapi();\n const app = await createStrapi(appContext).load();\n\n await app.admin!.services.user.resetPasswordByEmail(email, password);\n\n console.log(`Successfully reset user's password`);\n process.exit(0);\n}\n\n/**\n * Reset user's password\n */\nconst action = async (cmdOptions: CmdOptions = {}) => {\n const { email, password } = cmdOptions;\n\n if (_.isEmpty(email) && _.isEmpty(password) && process.stdin.isTTY) {\n const inquiry = await inquirer.prompt(promptQuestions);\n\n if (!inquiry.confirm) {\n process.exit(0);\n }\n\n return changePassword(inquiry);\n }\n\n if (_.isEmpty(email) || _.isEmpty(password)) {\n console.error('Missing required options `email` or `password`');\n process.exit(1);\n }\n\n return changePassword({ email, password });\n};\n\n/**\n * `$ strapi admin:reset-user-password`\n */\nconst command: StrapiCommand = () => {\n return createCommand('admin:reset-user-password')\n .alias('admin:reset-password')\n .description(\"Reset an admin user's password\")\n .option('-e, --email <email>', 'The user email')\n .option('-p, --password <password>', 'New password for the user')\n .action(runAction('admin:reset-user-password', action));\n};\n\nexport { action, command };\n"],"names":[],"mappings":";;;;;AAmBA,MAAM,kBAAqE;AAAA,EACzE,EAAE,MAAM,SAAS,MAAM,SAAS,SAAS,cAAc;AAAA,EACvD,EAAE,MAAM,YAAY,MAAM,YAAY,SAAS,gBAAgB;AAAA,EAC/D;AAAA,IACE,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,EACX;AACF;AAEA,eAAe,eAAe,EAAE,OAAO,YAAwB;AACvD,QAAA,aAAa,MAAM;AACzB,QAAM,MAAM,MAAM,aAAa,UAAU,EAAE,KAAK;AAEhD,QAAM,IAAI,MAAO,SAAS,KAAK,qBAAqB,OAAO,QAAQ;AAEnE,UAAQ,IAAI,oCAAoC;AAChD,UAAQ,KAAK,CAAC;AAChB;AAKA,MAAM,SAAS,OAAO,aAAyB,OAAO;AAC9C,QAAA,EAAE,OAAO,SAAa,IAAA;AAExB,MAAA,EAAE,QAAQ,KAAK,KAAK,EAAE,QAAQ,QAAQ,KAAK,QAAQ,MAAM,OAAO;AAClE,UAAM,UAAU,MAAM,SAAS,OAAO,eAAe;AAEjD,QAAA,CAAC,QAAQ,SAAS;AACpB,cAAQ,KAAK,CAAC;AAAA,IAChB;AAEA,WAAO,eAAe,OAAO;AAAA,EAC/B;AAEA,MAAI,EAAE,QAAQ,KAAK,KAAK,EAAE,QAAQ,QAAQ,GAAG;AAC3C,YAAQ,MAAM,gDAAgD;AAC9D,YAAQ,KAAK,CAAC;AAAA,EAChB;AAEA,SAAO,eAAe,EAAE,OAAO,SAAU,CAAA;AAC3C;AAKA,MAAM,UAAyB,MAAM;AAC5B,SAAA,cAAc,2BAA2B,EAC7C,MAAM,sBAAsB,EAC5B,YAAY,gCAAgC,EAC5C,OAAO,uBAAuB,gBAAgB,EAC9C,OAAO,6BAA6B,2BAA2B,EAC/D,OAAO,UAAU,6BAA6B,MAAM,CAAC;AAC1D;"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { createCommand } from "commander";
|
|
2
|
+
import { build } from "../../node/build.mjs";
|
|
3
|
+
import { handleUnexpectedError } from "../../node/core/errors.mjs";
|
|
4
|
+
const action = async (options) => {
|
|
5
|
+
try {
|
|
6
|
+
if (options.bundler === "webpack") {
|
|
7
|
+
options.logger.warn(
|
|
8
|
+
"[@strapi/strapi]: Using webpack as a bundler is deprecated. You should migrate to vite."
|
|
9
|
+
);
|
|
10
|
+
}
|
|
11
|
+
process.env.NODE_ENV = process.env.NODE_ENV ?? "production";
|
|
12
|
+
if (process.env.NODE_ENV !== "production") {
|
|
13
|
+
options.logger.warn(
|
|
14
|
+
"[@strapi/strapi]: The NODE_ENV is not set to production. This may result in unexpected behavior."
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
await build(options);
|
|
18
|
+
} catch (err) {
|
|
19
|
+
handleUnexpectedError(err);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
const command = ({ ctx }) => {
|
|
23
|
+
return createCommand("build").option("--bundler [bundler]", "Bundler to use (webpack or vite)", "vite").option("-d, --debug", "Enable debugging mode with verbose logs", false).option("--minify", "Minify the output", true).option("--silent", "Don't log anything", false).option("--sourcemap", "Produce sourcemaps", false).option("--stats", "Print build statistics to the console", false).description("Build the strapi admin app").action(async (options) => {
|
|
24
|
+
return action({ ...options, ...ctx });
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
export {
|
|
28
|
+
command
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=build.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.mjs","sources":["../../../src/cli/commands/build.ts"],"sourcesContent":["import { createCommand } from 'commander';\nimport type { StrapiCommand } from '../types';\n\nimport { build as nodeBuild, BuildOptions } from '../../node/build';\nimport { handleUnexpectedError } from '../../node/core/errors';\n\ntype BuildCLIOptions = BuildOptions;\n\nconst action = async (options: BuildCLIOptions) => {\n try {\n if (options.bundler === 'webpack') {\n options.logger.warn(\n '[@strapi/strapi]: Using webpack as a bundler is deprecated. You should migrate to vite.'\n );\n }\n\n /**\n * ENFORCE NODE_ENV to production when building\n */\n process.env.NODE_ENV = process.env.NODE_ENV ?? 'production';\n\n if (process.env.NODE_ENV !== 'production') {\n options.logger.warn(\n '[@strapi/strapi]: The NODE_ENV is not set to production. This may result in unexpected behavior.'\n );\n }\n\n await nodeBuild(options);\n } catch (err) {\n handleUnexpectedError(err);\n }\n};\n\n/**\n * `$ strapi build`\n */\nconst command: StrapiCommand = ({ ctx }) => {\n return createCommand('build')\n .option('--bundler [bundler]', 'Bundler to use (webpack or vite)', 'vite')\n .option('-d, --debug', 'Enable debugging mode with verbose logs', false)\n .option('--minify', 'Minify the output', true)\n .option('--silent', \"Don't log anything\", false)\n .option('--sourcemap', 'Produce sourcemaps', false)\n .option('--stats', 'Print build statistics to the console', false)\n .description('Build the strapi admin app')\n .action(async (options: BuildCLIOptions) => {\n return action({ ...options, ...ctx });\n });\n};\n\nexport { command };\n"],"names":["nodeBuild"],"mappings":";;;AAQA,MAAM,SAAS,OAAO,YAA6B;AAC7C,MAAA;AACE,QAAA,QAAQ,YAAY,WAAW;AACjC,cAAQ,OAAO;AAAA,QACb;AAAA,MAAA;AAAA,IAEJ;AAKA,YAAQ,IAAI,WAAW,QAAQ,IAAI,YAAY;AAE3C,QAAA,QAAQ,IAAI,aAAa,cAAc;AACzC,cAAQ,OAAO;AAAA,QACb;AAAA,MAAA;AAAA,IAEJ;AAEA,UAAMA,MAAU,OAAO;AAAA,WAChB,KAAK;AACZ,0BAAsB,GAAG;AAAA,EAC3B;AACF;AAKA,MAAM,UAAyB,CAAC,EAAE,UAAU;AAC1C,SAAO,cAAc,OAAO,EACzB,OAAO,uBAAuB,oCAAoC,MAAM,EACxE,OAAO,eAAe,2CAA2C,KAAK,EACtE,OAAO,YAAY,qBAAqB,IAAI,EAC5C,OAAO,YAAY,sBAAsB,KAAK,EAC9C,OAAO,eAAe,sBAAsB,KAAK,EACjD,OAAO,WAAW,yCAAyC,KAAK,EAChE,YAAY,4BAA4B,EACxC,OAAO,OAAO,YAA6B;AAC1C,WAAO,OAAO,EAAE,GAAG,SAAS,GAAG,IAAK,CAAA;AAAA,EAAA,CACrC;AACL;"}
|
|
@@ -9,8 +9,8 @@ const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
|
9
9
|
const CLITable__default = /* @__PURE__ */ _interopDefault(CLITable);
|
|
10
10
|
const chalk__default = /* @__PURE__ */ _interopDefault(chalk);
|
|
11
11
|
const action = async () => {
|
|
12
|
-
const appContext = await core.
|
|
13
|
-
const app = await core.
|
|
12
|
+
const appContext = await core.compileStrapi();
|
|
13
|
+
const app = await core.createStrapi(appContext).register();
|
|
14
14
|
const list = Object.keys(app.components);
|
|
15
15
|
const infoTable = new CLITable__default.default({
|
|
16
16
|
head: [chalk__default.default.blue("Name")]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.js","sources":["../../../../src/cli/commands/components/list.ts"],"sourcesContent":["import { createCommand } from 'commander';\nimport CLITable from 'cli-table3';\nimport chalk from 'chalk';\nimport {
|
|
1
|
+
{"version":3,"file":"list.js","sources":["../../../../src/cli/commands/components/list.ts"],"sourcesContent":["import { createCommand } from 'commander';\nimport CLITable from 'cli-table3';\nimport chalk from 'chalk';\nimport { createStrapi, compileStrapi } from '@strapi/core';\n\nimport type { StrapiCommand } from '../../types';\nimport { runAction } from '../../utils/helpers';\n\nconst action = async () => {\n const appContext = await compileStrapi();\n const app = await createStrapi(appContext).register();\n\n const list = Object.keys(app.components);\n\n const infoTable = new CLITable({\n head: [chalk.blue('Name')],\n });\n\n list.forEach((name) => infoTable.push([name]));\n\n console.log(infoTable.toString());\n\n await app.destroy();\n};\n\n/**\n * `$ strapi components:list`\n */\nconst command: StrapiCommand = () => {\n return createCommand('components:list')\n .description('List all the application components')\n .action(runAction('components:list', action));\n};\n\nexport { action, command };\n"],"names":["compileStrapi","createStrapi","CLITable","chalk","createCommand","runAction"],"mappings":";;;;;;;;;;AAQA,MAAM,SAAS,YAAY;AACnB,QAAA,aAAa,MAAMA,KAAAA;AACzB,QAAM,MAAM,MAAMC,KAAAA,aAAa,UAAU,EAAE,SAAS;AAEpD,QAAM,OAAO,OAAO,KAAK,IAAI,UAAU;AAEjC,QAAA,YAAY,IAAIC,0BAAS;AAAA,IAC7B,MAAM,CAACC,eAAAA,QAAM,KAAK,MAAM,CAAC;AAAA,EAAA,CAC1B;AAEI,OAAA,QAAQ,CAAC,SAAS,UAAU,KAAK,CAAC,IAAI,CAAC,CAAC;AAErC,UAAA,IAAI,UAAU,SAAU,CAAA;AAEhC,QAAM,IAAI;AACZ;AAKA,MAAM,UAAyB,MAAM;AAC5B,SAAAC,wBAAc,iBAAiB,EACnC,YAAY,qCAAqC,EACjD,OAAOC,kBAAU,mBAAmB,MAAM,CAAC;AAChD;;;"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { createCommand } from "commander";
|
|
2
|
+
import CLITable from "cli-table3";
|
|
3
|
+
import chalk from "chalk";
|
|
4
|
+
import { compileStrapi, createStrapi } from "@strapi/core";
|
|
5
|
+
import { runAction } from "../../utils/helpers.mjs";
|
|
6
|
+
const action = async () => {
|
|
7
|
+
const appContext = await compileStrapi();
|
|
8
|
+
const app = await createStrapi(appContext).register();
|
|
9
|
+
const list = Object.keys(app.components);
|
|
10
|
+
const infoTable = new CLITable({
|
|
11
|
+
head: [chalk.blue("Name")]
|
|
12
|
+
});
|
|
13
|
+
list.forEach((name) => infoTable.push([name]));
|
|
14
|
+
console.log(infoTable.toString());
|
|
15
|
+
await app.destroy();
|
|
16
|
+
};
|
|
17
|
+
const command = () => {
|
|
18
|
+
return createCommand("components:list").description("List all the application components").action(runAction("components:list", action));
|
|
19
|
+
};
|
|
20
|
+
export {
|
|
21
|
+
action,
|
|
22
|
+
command
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=list.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.mjs","sources":["../../../../src/cli/commands/components/list.ts"],"sourcesContent":["import { createCommand } from 'commander';\nimport CLITable from 'cli-table3';\nimport chalk from 'chalk';\nimport { createStrapi, compileStrapi } from '@strapi/core';\n\nimport type { StrapiCommand } from '../../types';\nimport { runAction } from '../../utils/helpers';\n\nconst action = async () => {\n const appContext = await compileStrapi();\n const app = await createStrapi(appContext).register();\n\n const list = Object.keys(app.components);\n\n const infoTable = new CLITable({\n head: [chalk.blue('Name')],\n });\n\n list.forEach((name) => infoTable.push([name]));\n\n console.log(infoTable.toString());\n\n await app.destroy();\n};\n\n/**\n * `$ strapi components:list`\n */\nconst command: StrapiCommand = () => {\n return createCommand('components:list')\n .description('List all the application components')\n .action(runAction('components:list', action));\n};\n\nexport { action, command };\n"],"names":[],"mappings":";;;;;AAQA,MAAM,SAAS,YAAY;AACnB,QAAA,aAAa,MAAM;AACzB,QAAM,MAAM,MAAM,aAAa,UAAU,EAAE,SAAS;AAEpD,QAAM,OAAO,OAAO,KAAK,IAAI,UAAU;AAEjC,QAAA,YAAY,IAAI,SAAS;AAAA,IAC7B,MAAM,CAAC,MAAM,KAAK,MAAM,CAAC;AAAA,EAAA,CAC1B;AAEI,OAAA,QAAQ,CAAC,SAAS,UAAU,KAAK,CAAC,IAAI,CAAC,CAAC;AAErC,UAAA,IAAI,UAAU,SAAU,CAAA;AAEhC,QAAM,IAAI;AACZ;AAKA,MAAM,UAAyB,MAAM;AAC5B,SAAA,cAAc,iBAAiB,EACnC,YAAY,qCAAqC,EACjD,OAAO,UAAU,mBAAmB,MAAM,CAAC;AAChD;"}
|
|
@@ -9,8 +9,8 @@ const fs__default = /* @__PURE__ */ _interopDefault(fs);
|
|
|
9
9
|
const CHUNK_SIZE = 100;
|
|
10
10
|
const action = async ({ file: filePath, pretty }) => {
|
|
11
11
|
const output = filePath ? fs__default.default.createWriteStream(filePath) : process.stdout;
|
|
12
|
-
const appContext = await core.
|
|
13
|
-
const app = await core.
|
|
12
|
+
const appContext = await core.compileStrapi();
|
|
13
|
+
const app = await core.createStrapi(appContext).load();
|
|
14
14
|
const count = await app.query("strapi::core-store").count();
|
|
15
15
|
const exportData = [];
|
|
16
16
|
const pageCount = Math.ceil(count / CHUNK_SIZE);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dump.js","sources":["../../../../src/cli/commands/configuration/dump.ts"],"sourcesContent":["import fs from 'fs';\nimport { createCommand } from 'commander';\nimport {
|
|
1
|
+
{"version":3,"file":"dump.js","sources":["../../../../src/cli/commands/configuration/dump.ts"],"sourcesContent":["import fs from 'fs';\nimport { createCommand } from 'commander';\nimport { createStrapi, compileStrapi } from '@strapi/core';\n\nimport type { StrapiCommand } from '../../types';\nimport { runAction } from '../../utils/helpers';\n\ninterface CmdOptions {\n file?: string;\n pretty?: boolean;\n}\n\ninterface ExportItem {\n key: string;\n value: string;\n type: string;\n environment: string;\n tag: string;\n}\n\ninterface Output {\n write(str: string): void;\n end(): void;\n}\n\nconst CHUNK_SIZE = 100;\n\n/**\n * Will dump configurations to a file or stdout\n * @param {string} file filepath to use as output\n */\nconst action = async ({ file: filePath, pretty }: CmdOptions) => {\n const output: Output = filePath ? fs.createWriteStream(filePath) : process.stdout;\n\n const appContext = await compileStrapi();\n const app = await createStrapi(appContext).load();\n\n const count = await app.query('strapi::core-store').count();\n\n const exportData: ExportItem[] = [];\n\n const pageCount = Math.ceil(count / CHUNK_SIZE);\n\n for (let page = 0; page < pageCount; page += 1) {\n const results = await app\n .query('strapi::core-store')\n .findMany({ limit: CHUNK_SIZE, offset: page * CHUNK_SIZE, orderBy: 'key' });\n\n results\n .filter((result) => result.key.startsWith('plugin_'))\n .forEach((result) => {\n exportData.push({\n key: result.key,\n value: result.value,\n type: result.type,\n environment: result.environment,\n tag: result.tag,\n });\n });\n }\n\n const str = JSON.stringify(exportData, null, pretty ? 2 : undefined);\n\n output.write(str);\n output.write('\\n');\n output.end();\n\n // log success only when writting to file\n if (filePath) {\n console.log(`Successfully exported ${exportData.length} configuration entries`);\n }\n process.exit(0);\n};\n\n/**\n * `$ strapi configuration:dump`\n */\nconst command: StrapiCommand = () => {\n return createCommand('configuration:dump')\n .alias('config:dump')\n .description('Dump configurations of your application')\n .option('-f, --file <file>', 'Output file, default output is stdout')\n .option('-p, --pretty', 'Format the output JSON with indentation and line breaks', false)\n .action(runAction('configuration:dump', action));\n};\n\nexport { action, command };\n"],"names":["fs","compileStrapi","createStrapi","createCommand","runAction"],"mappings":";;;;;;;;AAyBA,MAAM,aAAa;AAMnB,MAAM,SAAS,OAAO,EAAE,MAAM,UAAU,aAAyB;AAC/D,QAAM,SAAiB,WAAWA,YAAA,QAAG,kBAAkB,QAAQ,IAAI,QAAQ;AAErE,QAAA,aAAa,MAAMC,KAAAA;AACzB,QAAM,MAAM,MAAMC,KAAAA,aAAa,UAAU,EAAE,KAAK;AAEhD,QAAM,QAAQ,MAAM,IAAI,MAAM,oBAAoB,EAAE;AAEpD,QAAM,aAA2B,CAAA;AAEjC,QAAM,YAAY,KAAK,KAAK,QAAQ,UAAU;AAE9C,WAAS,OAAO,GAAG,OAAO,WAAW,QAAQ,GAAG;AAC9C,UAAM,UAAU,MAAM,IACnB,MAAM,oBAAoB,EAC1B,SAAS,EAAE,OAAO,YAAY,QAAQ,OAAO,YAAY,SAAS,OAAO;AAGzE,YAAA,OAAO,CAAC,WAAW,OAAO,IAAI,WAAW,SAAS,CAAC,EACnD,QAAQ,CAAC,WAAW;AACnB,iBAAW,KAAK;AAAA,QACd,KAAK,OAAO;AAAA,QACZ,OAAO,OAAO;AAAA,QACd,MAAM,OAAO;AAAA,QACb,aAAa,OAAO;AAAA,QACpB,KAAK,OAAO;AAAA,MAAA,CACb;AAAA,IAAA,CACF;AAAA,EACL;AAEA,QAAM,MAAM,KAAK,UAAU,YAAY,MAAM,SAAS,IAAI,MAAS;AAEnE,SAAO,MAAM,GAAG;AAChB,SAAO,MAAM,IAAI;AACjB,SAAO,IAAI;AAGX,MAAI,UAAU;AACZ,YAAQ,IAAI,yBAAyB,WAAW,MAAM,wBAAwB;AAAA,EAChF;AACA,UAAQ,KAAK,CAAC;AAChB;AAKA,MAAM,UAAyB,MAAM;AAC5B,SAAAC,UAAA,cAAc,oBAAoB,EACtC,MAAM,aAAa,EACnB,YAAY,yCAAyC,EACrD,OAAO,qBAAqB,uCAAuC,EACnE,OAAO,gBAAgB,2DAA2D,KAAK,EACvF,OAAOC,kBAAU,sBAAsB,MAAM,CAAC;AACnD;;;"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import { createCommand } from "commander";
|
|
3
|
+
import { compileStrapi, createStrapi } from "@strapi/core";
|
|
4
|
+
import { runAction } from "../../utils/helpers.mjs";
|
|
5
|
+
const CHUNK_SIZE = 100;
|
|
6
|
+
const action = async ({ file: filePath, pretty }) => {
|
|
7
|
+
const output = filePath ? fs.createWriteStream(filePath) : process.stdout;
|
|
8
|
+
const appContext = await compileStrapi();
|
|
9
|
+
const app = await createStrapi(appContext).load();
|
|
10
|
+
const count = await app.query("strapi::core-store").count();
|
|
11
|
+
const exportData = [];
|
|
12
|
+
const pageCount = Math.ceil(count / CHUNK_SIZE);
|
|
13
|
+
for (let page = 0; page < pageCount; page += 1) {
|
|
14
|
+
const results = await app.query("strapi::core-store").findMany({ limit: CHUNK_SIZE, offset: page * CHUNK_SIZE, orderBy: "key" });
|
|
15
|
+
results.filter((result) => result.key.startsWith("plugin_")).forEach((result) => {
|
|
16
|
+
exportData.push({
|
|
17
|
+
key: result.key,
|
|
18
|
+
value: result.value,
|
|
19
|
+
type: result.type,
|
|
20
|
+
environment: result.environment,
|
|
21
|
+
tag: result.tag
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
const str = JSON.stringify(exportData, null, pretty ? 2 : void 0);
|
|
26
|
+
output.write(str);
|
|
27
|
+
output.write("\n");
|
|
28
|
+
output.end();
|
|
29
|
+
if (filePath) {
|
|
30
|
+
console.log(`Successfully exported ${exportData.length} configuration entries`);
|
|
31
|
+
}
|
|
32
|
+
process.exit(0);
|
|
33
|
+
};
|
|
34
|
+
const command = () => {
|
|
35
|
+
return createCommand("configuration:dump").alias("config:dump").description("Dump configurations of your application").option("-f, --file <file>", "Output file, default output is stdout").option("-p, --pretty", "Format the output JSON with indentation and line breaks", false).action(runAction("configuration:dump", action));
|
|
36
|
+
};
|
|
37
|
+
export {
|
|
38
|
+
action,
|
|
39
|
+
command
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=dump.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dump.mjs","sources":["../../../../src/cli/commands/configuration/dump.ts"],"sourcesContent":["import fs from 'fs';\nimport { createCommand } from 'commander';\nimport { createStrapi, compileStrapi } from '@strapi/core';\n\nimport type { StrapiCommand } from '../../types';\nimport { runAction } from '../../utils/helpers';\n\ninterface CmdOptions {\n file?: string;\n pretty?: boolean;\n}\n\ninterface ExportItem {\n key: string;\n value: string;\n type: string;\n environment: string;\n tag: string;\n}\n\ninterface Output {\n write(str: string): void;\n end(): void;\n}\n\nconst CHUNK_SIZE = 100;\n\n/**\n * Will dump configurations to a file or stdout\n * @param {string} file filepath to use as output\n */\nconst action = async ({ file: filePath, pretty }: CmdOptions) => {\n const output: Output = filePath ? fs.createWriteStream(filePath) : process.stdout;\n\n const appContext = await compileStrapi();\n const app = await createStrapi(appContext).load();\n\n const count = await app.query('strapi::core-store').count();\n\n const exportData: ExportItem[] = [];\n\n const pageCount = Math.ceil(count / CHUNK_SIZE);\n\n for (let page = 0; page < pageCount; page += 1) {\n const results = await app\n .query('strapi::core-store')\n .findMany({ limit: CHUNK_SIZE, offset: page * CHUNK_SIZE, orderBy: 'key' });\n\n results\n .filter((result) => result.key.startsWith('plugin_'))\n .forEach((result) => {\n exportData.push({\n key: result.key,\n value: result.value,\n type: result.type,\n environment: result.environment,\n tag: result.tag,\n });\n });\n }\n\n const str = JSON.stringify(exportData, null, pretty ? 2 : undefined);\n\n output.write(str);\n output.write('\\n');\n output.end();\n\n // log success only when writting to file\n if (filePath) {\n console.log(`Successfully exported ${exportData.length} configuration entries`);\n }\n process.exit(0);\n};\n\n/**\n * `$ strapi configuration:dump`\n */\nconst command: StrapiCommand = () => {\n return createCommand('configuration:dump')\n .alias('config:dump')\n .description('Dump configurations of your application')\n .option('-f, --file <file>', 'Output file, default output is stdout')\n .option('-p, --pretty', 'Format the output JSON with indentation and line breaks', false)\n .action(runAction('configuration:dump', action));\n};\n\nexport { action, command };\n"],"names":[],"mappings":";;;;AAyBA,MAAM,aAAa;AAMnB,MAAM,SAAS,OAAO,EAAE,MAAM,UAAU,aAAyB;AAC/D,QAAM,SAAiB,WAAW,GAAG,kBAAkB,QAAQ,IAAI,QAAQ;AAErE,QAAA,aAAa,MAAM;AACzB,QAAM,MAAM,MAAM,aAAa,UAAU,EAAE,KAAK;AAEhD,QAAM,QAAQ,MAAM,IAAI,MAAM,oBAAoB,EAAE;AAEpD,QAAM,aAA2B,CAAA;AAEjC,QAAM,YAAY,KAAK,KAAK,QAAQ,UAAU;AAE9C,WAAS,OAAO,GAAG,OAAO,WAAW,QAAQ,GAAG;AAC9C,UAAM,UAAU,MAAM,IACnB,MAAM,oBAAoB,EAC1B,SAAS,EAAE,OAAO,YAAY,QAAQ,OAAO,YAAY,SAAS,OAAO;AAGzE,YAAA,OAAO,CAAC,WAAW,OAAO,IAAI,WAAW,SAAS,CAAC,EACnD,QAAQ,CAAC,WAAW;AACnB,iBAAW,KAAK;AAAA,QACd,KAAK,OAAO;AAAA,QACZ,OAAO,OAAO;AAAA,QACd,MAAM,OAAO;AAAA,QACb,aAAa,OAAO;AAAA,QACpB,KAAK,OAAO;AAAA,MAAA,CACb;AAAA,IAAA,CACF;AAAA,EACL;AAEA,QAAM,MAAM,KAAK,UAAU,YAAY,MAAM,SAAS,IAAI,MAAS;AAEnE,SAAO,MAAM,GAAG;AAChB,SAAO,MAAM,IAAI;AACjB,SAAO,IAAI;AAGX,MAAI,UAAU;AACZ,YAAQ,IAAI,yBAAyB,WAAW,MAAM,wBAAwB;AAAA,EAChF;AACA,UAAQ,KAAK,CAAC;AAChB;AAKA,MAAM,UAAyB,MAAM;AAC5B,SAAA,cAAc,oBAAoB,EACtC,MAAM,aAAa,EACnB,YAAY,yCAAyC,EACrD,OAAO,qBAAqB,uCAAuC,EACnE,OAAO,gBAAgB,2DAA2D,KAAK,EACvF,OAAO,UAAU,sBAAsB,MAAM,CAAC;AACnD;"}
|
|
@@ -10,8 +10,8 @@ const fs__default = /* @__PURE__ */ _interopDefault(fs);
|
|
|
10
10
|
const ___default = /* @__PURE__ */ _interopDefault(_);
|
|
11
11
|
const action = async ({ file: filePath, strategy = "replace" }) => {
|
|
12
12
|
const input = filePath ? fs__default.default.readFileSync(filePath) : await readStdin();
|
|
13
|
-
const appContext = await core.
|
|
14
|
-
const app = await core.
|
|
13
|
+
const appContext = await core.compileStrapi();
|
|
14
|
+
const app = await core.createStrapi(appContext).load();
|
|
15
15
|
let dataToImport;
|
|
16
16
|
try {
|
|
17
17
|
dataToImport = JSON.parse(___default.default.toString(input));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"restore.js","sources":["../../../../src/cli/commands/configuration/restore.ts"],"sourcesContent":["import { createCommand } from 'commander';\nimport fs from 'fs';\nimport _ from 'lodash';\nimport {
|
|
1
|
+
{"version":3,"file":"restore.js","sources":["../../../../src/cli/commands/configuration/restore.ts"],"sourcesContent":["import { createCommand } from 'commander';\nimport fs from 'fs';\nimport _ from 'lodash';\nimport { createStrapi, compileStrapi } from '@strapi/core';\nimport type { Database } from '@strapi/database';\n\nimport type { StrapiCommand } from '../../types';\nimport { runAction } from '../../utils/helpers';\n\ntype Strategy = 'replace' | 'merge' | 'keep';\n\ninterface CmdOptions {\n file?: string;\n strategy?: Strategy;\n}\n\n/**\n * Will restore configurations. It reads from a file or stdin\n */\nconst action = async ({ file: filePath, strategy = 'replace' }: CmdOptions) => {\n const input = filePath ? fs.readFileSync(filePath) : await readStdin();\n\n const appContext = await compileStrapi();\n const app = await createStrapi(appContext).load();\n\n let dataToImport;\n try {\n dataToImport = JSON.parse(_.toString(input));\n } catch (error) {\n if (error instanceof Error) {\n throw new Error(`Invalid input data: ${error.message}. Expected a valid JSON array.`);\n }\n\n throw error;\n }\n\n if (!Array.isArray(dataToImport)) {\n throw new Error(`Invalid input data. Expected a valid JSON array.`);\n }\n\n if (!app.db) {\n throw new Error('Cannot import configuration without a database connection.');\n }\n\n const importer = createImporter(app.db, strategy);\n\n for (const config of dataToImport) {\n await importer.import(config);\n }\n\n console.log(\n `Successfully imported configuration with ${strategy} strategy. Statistics: ${importer.printStatistics()}.`\n );\n\n process.exit(0);\n};\n\nconst readStdin = () => {\n const { stdin } = process;\n let result = '';\n\n if (stdin.isTTY) return Promise.resolve(result);\n\n return new Promise((resolve, reject) => {\n stdin.setEncoding('utf8');\n stdin.on('readable', () => {\n let chunk;\n // eslint-disable-next-line no-cond-assign\n while ((chunk = stdin.read())) {\n result += chunk;\n }\n });\n\n stdin.on('end', () => {\n resolve(result);\n });\n\n stdin.on('error', reject);\n });\n};\n\nconst createImporter = (db: Database, strategy?: Strategy) => {\n switch (strategy) {\n case 'replace':\n return createReplaceImporter(db);\n case 'merge':\n return createMergeImporter(db);\n case 'keep':\n return createKeepImporter(db);\n default:\n throw new Error(`No importer available for strategy \"${strategy}\"`);\n }\n};\n\n/**\n * Replace importer. Will replace the keys that already exist and create the new ones\n */\nconst createReplaceImporter = (db: Database) => {\n const stats = {\n created: 0,\n replaced: 0,\n };\n\n return {\n printStatistics() {\n return `${stats.created} created, ${stats.replaced} replaced`;\n },\n\n async import(conf: Record<string, unknown>) {\n const matching = await db.query('strapi::core-store').count({ where: { key: conf.key } });\n if (matching > 0) {\n stats.replaced += 1;\n await db.query('strapi::core-store').update({\n where: { key: conf.key },\n data: conf,\n });\n } else {\n stats.created += 1;\n await db.query('strapi::core-store').create({ data: conf });\n }\n },\n };\n};\n\n/**\n * Merge importer. Will merge the keys that already exist with their new value and create the new ones\n */\nconst createMergeImporter = (db: Database) => {\n const stats = {\n created: 0,\n merged: 0,\n };\n\n return {\n printStatistics() {\n return `${stats.created} created, ${stats.merged} merged`;\n },\n\n async import(conf: Record<string, unknown>) {\n const existingConf = await db\n .query('strapi::core-store')\n .findOne({ where: { key: conf.key } });\n\n if (existingConf) {\n stats.merged += 1;\n await db.query('strapi::core-store').update({\n where: { key: conf.key },\n data: _.merge(existingConf, conf),\n });\n } else {\n stats.created += 1;\n await db.query('strapi::core-store').create({ data: conf });\n }\n },\n };\n};\n\n/**\n * Merge importer. Will keep the keys that already exist without changing them and create the new ones\n */\nconst createKeepImporter = (db: Database) => {\n const stats = {\n created: 0,\n untouched: 0,\n };\n\n return {\n printStatistics() {\n return `${stats.created} created, ${stats.untouched} untouched`;\n },\n\n async import(conf: Record<string, unknown>) {\n const matching = await db.query('strapi::core-store').count({ where: { key: conf.key } });\n if (matching > 0) {\n stats.untouched += 1;\n // if configuration already exists do not overwrite it\n return;\n }\n\n stats.created += 1;\n await db.query('strapi::core-store').create({ data: conf });\n },\n };\n};\n\n/**\n * `$ strapi configuration:restore`\n */\nconst command: StrapiCommand = () => {\n return createCommand('configuration:restore')\n .alias('config:restore')\n .description('Restore configurations of your application')\n .option('-f, --file <file>', 'Input file, default input is stdin')\n .option('-s, --strategy <strategy>', 'Strategy name, one of: \"replace\", \"merge\", \"keep\"')\n .action(runAction('configuration:restore', action));\n};\n\nexport { action, command };\n"],"names":["fs","compileStrapi","createStrapi","_","createCommand","runAction"],"mappings":";;;;;;;;;;AAmBA,MAAM,SAAS,OAAO,EAAE,MAAM,UAAU,WAAW,gBAA4B;AAC7E,QAAM,QAAQ,WAAWA,YAAA,QAAG,aAAa,QAAQ,IAAI,MAAM;AAErD,QAAA,aAAa,MAAMC,KAAAA;AACzB,QAAM,MAAM,MAAMC,KAAAA,aAAa,UAAU,EAAE,KAAK;AAE5C,MAAA;AACA,MAAA;AACF,mBAAe,KAAK,MAAMC,WAAE,QAAA,SAAS,KAAK,CAAC;AAAA,WACpC,OAAO;AACd,QAAI,iBAAiB,OAAO;AAC1B,YAAM,IAAI,MAAM,uBAAuB,MAAM,OAAO,gCAAgC;AAAA,IACtF;AAEM,UAAA;AAAA,EACR;AAEA,MAAI,CAAC,MAAM,Q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