@strapi/generators 0.0.0-next.e16a4b69b276a52e1b299f339479948d67ec66f3 → 0.0.0-next.e1a19b9e52cdcb526515883c8289522a64c9871a
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/LICENSE +18 -3
- package/dist/index.d.ts +10 -5
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +93 -27
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +95 -0
- package/dist/index.mjs.map +1 -0
- package/dist/plopfile.d.ts +2 -1
- package/dist/plopfile.d.ts.map +1 -0
- package/dist/plopfile.js +24 -26
- package/dist/plopfile.js.map +1 -1
- package/dist/plopfile.mjs +25 -0
- package/dist/plopfile.mjs.map +1 -0
- package/dist/plops/api.d.ts +2 -1
- package/dist/plops/api.d.ts.map +1 -0
- package/dist/plops/api.js +33 -31
- package/dist/plops/api.js.map +1 -1
- package/dist/plops/api.mjs +79 -0
- package/dist/plops/api.mjs.map +1 -0
- package/dist/plops/content-type.d.ts +2 -1
- package/dist/plops/content-type.d.ts.map +1 -0
- package/dist/plops/content-type.js +73 -82
- package/dist/plops/content-type.js.map +1 -1
- package/dist/plops/content-type.mjs +147 -0
- package/dist/plops/content-type.mjs.map +1 -0
- package/dist/plops/controller.d.ts +2 -1
- package/dist/plops/controller.d.ts.map +1 -0
- package/dist/plops/controller.js +20 -20
- package/dist/plops/controller.js.map +1 -1
- package/dist/plops/controller.mjs +38 -0
- package/dist/plops/controller.mjs.map +1 -0
- package/dist/plops/middleware.d.ts +2 -1
- package/dist/plops/middleware.d.ts.map +1 -0
- package/dist/plops/middleware.js +22 -20
- package/dist/plops/middleware.js.map +1 -1
- package/dist/plops/middleware.mjs +40 -0
- package/dist/plops/middleware.mjs.map +1 -0
- package/dist/plops/migration.d.ts +2 -1
- package/dist/plops/migration.d.ts.map +1 -0
- package/dist/plops/migration.js +19 -19
- package/dist/plops/migration.js.map +1 -1
- package/dist/plops/migration.mjs +33 -0
- package/dist/plops/migration.mjs.map +1 -0
- package/dist/plops/policy.d.ts +2 -1
- package/dist/plops/policy.d.ts.map +1 -0
- package/dist/plops/policy.js +22 -20
- package/dist/plops/policy.js.map +1 -1
- package/dist/plops/policy.mjs +40 -0
- package/dist/plops/policy.mjs.map +1 -0
- package/dist/plops/prompts/bootstrap-api-prompts.d.ts +7 -2
- package/dist/plops/prompts/bootstrap-api-prompts.d.ts.map +1 -0
- package/dist/plops/prompts/bootstrap-api-prompts.js +7 -6
- package/dist/plops/prompts/bootstrap-api-prompts.js.map +1 -1
- package/dist/plops/prompts/bootstrap-api-prompts.mjs +11 -0
- package/dist/plops/prompts/bootstrap-api-prompts.mjs.map +1 -0
- package/dist/plops/prompts/ct-names-prompts.d.ts +19 -2
- package/dist/plops/prompts/ct-names-prompts.d.ts.map +1 -0
- package/dist/plops/prompts/ct-names-prompts.js +19 -43
- package/dist/plops/prompts/ct-names-prompts.js.map +1 -1
- package/dist/plops/prompts/ct-names-prompts.mjs +42 -0
- package/dist/plops/prompts/ct-names-prompts.mjs.map +1 -0
- package/dist/plops/prompts/get-attributes-prompts.d.ts +9 -2
- package/dist/plops/prompts/get-attributes-prompts.d.ts.map +1 -0
- package/dist/plops/prompts/get-attributes-prompts.js +36 -30
- package/dist/plops/prompts/get-attributes-prompts.js.map +1 -1
- package/dist/plops/prompts/get-attributes-prompts.mjs +99 -0
- package/dist/plops/prompts/get-attributes-prompts.mjs.map +1 -0
- package/dist/plops/prompts/get-destination-prompts.d.ts +25 -2
- package/dist/plops/prompts/get-destination-prompts.d.ts.map +1 -0
- package/dist/plops/prompts/get-destination-prompts.js +47 -41
- package/dist/plops/prompts/get-destination-prompts.js.map +1 -1
- package/dist/plops/prompts/get-destination-prompts.mjs +76 -0
- package/dist/plops/prompts/get-destination-prompts.mjs.map +1 -0
- package/dist/plops/prompts/kind-prompts.d.ts +12 -2
- package/dist/plops/prompts/kind-prompts.d.ts.map +1 -0
- package/dist/plops/prompts/kind-prompts.js +17 -12
- package/dist/plops/prompts/kind-prompts.js.map +1 -1
- package/dist/plops/prompts/kind-prompts.mjs +24 -0
- package/dist/plops/prompts/kind-prompts.mjs.map +1 -0
- package/dist/plops/service.d.ts +2 -1
- package/dist/plops/service.d.ts.map +1 -0
- package/dist/plops/service.js +19 -19
- package/dist/plops/service.js.map +1 -1
- package/dist/plops/service.mjs +36 -0
- package/dist/plops/service.mjs.map +1 -0
- package/dist/plops/utils/get-file-path.d.ts +2 -1
- package/dist/plops/utils/get-file-path.d.ts.map +1 -0
- package/dist/plops/utils/get-file-path.js +7 -5
- package/dist/plops/utils/get-file-path.js.map +1 -1
- package/dist/plops/utils/get-file-path.mjs +15 -0
- package/dist/plops/utils/get-file-path.mjs.map +1 -0
- package/dist/plops/utils/get-formatted-date.d.ts +1 -0
- package/dist/plops/utils/get-formatted-date.d.ts.map +1 -0
- package/dist/plops/utils/get-formatted-date.js +8 -9
- package/dist/plops/utils/get-formatted-date.js.map +1 -1
- package/dist/plops/utils/get-formatted-date.mjs +6 -0
- package/dist/plops/utils/get-formatted-date.mjs.map +1 -0
- package/dist/plops/utils/validate-attribute-input.d.ts +1 -0
- package/dist/plops/utils/validate-attribute-input.d.ts.map +1 -0
- package/dist/plops/utils/validate-attribute-input.js +7 -5
- package/dist/plops/utils/validate-attribute-input.js.map +1 -1
- package/dist/plops/utils/validate-attribute-input.mjs +10 -0
- package/dist/plops/utils/validate-attribute-input.mjs.map +1 -0
- package/dist/plops/utils/validate-file-name-input.d.ts +1 -0
- package/dist/plops/utils/validate-file-name-input.d.ts.map +1 -0
- package/dist/plops/utils/validate-file-name-input.js +7 -5
- package/dist/plops/utils/validate-file-name-input.js.map +1 -1
- package/dist/plops/utils/validate-file-name-input.mjs +10 -0
- package/dist/plops/utils/validate-file-name-input.mjs.map +1 -0
- package/dist/plops/utils/validate-input.d.ts +1 -0
- package/dist/plops/utils/validate-input.d.ts.map +1 -0
- package/dist/plops/utils/validate-input.js +7 -5
- package/dist/plops/utils/validate-input.js.map +1 -1
- package/dist/plops/utils/validate-input.mjs +10 -0
- package/dist/plops/utils/validate-input.mjs.map +1 -0
- package/dist/templates/js/content-type.schema.json.hbs +0 -1
- package/dist/templates/ts/content-type.schema.json.hbs +0 -1
- package/dist/templates/ts/middleware.ts.hbs +2 -2
- package/package.json +21 -17
- package/dist/files/js/plugin/.editorconfig +0 -7
- package/dist/files/js/plugin/.gitattributes +0 -103
- package/dist/files/js/plugin/admin/src/components/Initializer/index.js +0 -26
- package/dist/files/js/plugin/admin/src/components/PluginIcon/index.js +0 -12
- package/dist/files/js/plugin/admin/src/index.js +0 -63
- package/dist/files/js/plugin/admin/src/pages/App/index.js +0 -25
- package/dist/files/js/plugin/admin/src/pages/HomePage/index.js +0 -20
- package/dist/files/js/plugin/admin/src/pluginId.js +0 -5
- package/dist/files/js/plugin/admin/src/translations/en.json +0 -1
- package/dist/files/js/plugin/admin/src/translations/fr.json +0 -1
- package/dist/files/js/plugin/admin/src/utils/getTrad.js +0 -5
- package/dist/files/js/plugin/server/bootstrap.js +0 -5
- package/dist/files/js/plugin/server/config/index.js +0 -6
- package/dist/files/js/plugin/server/content-types/index.js +0 -3
- package/dist/files/js/plugin/server/controllers/index.js +0 -7
- package/dist/files/js/plugin/server/controllers/my-controller.js.hbs +0 -10
- package/dist/files/js/plugin/server/destroy.js +0 -5
- package/dist/files/js/plugin/server/index.js +0 -25
- package/dist/files/js/plugin/server/middlewares/index.js +0 -3
- package/dist/files/js/plugin/server/policies/index.js +0 -3
- package/dist/files/js/plugin/server/register.js +0 -5
- package/dist/files/js/plugin/server/routes/index.js +0 -10
- package/dist/files/js/plugin/server/services/index.js +0 -7
- package/dist/files/js/plugin/server/services/my-service.js +0 -7
- package/dist/files/js/plugin/strapi-admin.js +0 -3
- package/dist/files/js/plugin/strapi-server.js +0 -3
- package/dist/files/ts/plugin/.editorconfig +0 -7
- package/dist/files/ts/plugin/.gitattributes +0 -103
- package/dist/files/ts/plugin/admin/src/components/Initializer/index.tsx +0 -24
- package/dist/files/ts/plugin/admin/src/components/PluginIcon/index.tsx +0 -12
- package/dist/files/ts/plugin/admin/src/index.tsx +0 -67
- package/dist/files/ts/plugin/admin/src/pages/App/index.tsx +0 -25
- package/dist/files/ts/plugin/admin/src/pages/HomePage/index.tsx +0 -19
- package/dist/files/ts/plugin/admin/src/pluginId.ts +0 -5
- package/dist/files/ts/plugin/admin/src/translations/en.json +0 -1
- package/dist/files/ts/plugin/admin/src/translations/fr.json +0 -1
- package/dist/files/ts/plugin/admin/src/utils/getTrad.ts +0 -5
- package/dist/files/ts/plugin/custom.d.ts +0 -5
- package/dist/files/ts/plugin/server/bootstrap.ts +0 -5
- package/dist/files/ts/plugin/server/config/index.ts +0 -4
- package/dist/files/ts/plugin/server/content-types/index.ts +0 -1
- package/dist/files/ts/plugin/server/controllers/index.ts +0 -5
- package/dist/files/ts/plugin/server/controllers/my-controller.ts.hbs +0 -10
- package/dist/files/ts/plugin/server/destroy.ts +0 -5
- package/dist/files/ts/plugin/server/index.ts +0 -23
- package/dist/files/ts/plugin/server/middlewares/index.ts +0 -1
- package/dist/files/ts/plugin/server/policies/index.ts +0 -1
- package/dist/files/ts/plugin/server/register.ts +0 -5
- package/dist/files/ts/plugin/server/routes/index.ts +0 -10
- package/dist/files/ts/plugin/server/services/index.ts +0 -5
- package/dist/files/ts/plugin/server/services/my-service.ts +0 -7
- package/dist/files/ts/plugin/strapi-admin.js +0 -3
- package/dist/files/ts/plugin/strapi-server.js +0 -3
- package/dist/files/ts/plugin/tsconfig.json +0 -20
- package/dist/files/ts/plugin/tsconfig.server.json +0 -25
- package/dist/plops/plugin.d.ts +0 -3
- package/dist/plops/plugin.js +0 -107
- package/dist/plops/plugin.js.map +0 -1
- package/dist/plops/prompts/draft-and-publish-prompts.d.ts +0 -3
- package/dist/plops/prompts/draft-and-publish-prompts.js +0 -12
- package/dist/plops/prompts/draft-and-publish-prompts.js.map +0 -1
- package/dist/templates/js/README.md.hbs +0 -3
- package/dist/templates/js/plugin-package.json.hbs +0 -42
- package/dist/templates/ts/README.md.hbs +0 -3
- package/dist/templates/ts/plugin-package.json.hbs +0 -51
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { join } from 'path';
|
|
2
|
+
import fs from 'fs-extra';
|
|
3
|
+
|
|
4
|
+
var getDestinationPrompts = ((action, basePath, { rootFolder = false } = {})=>{
|
|
5
|
+
return [
|
|
6
|
+
{
|
|
7
|
+
type: 'list',
|
|
8
|
+
name: 'destination',
|
|
9
|
+
message: `Where do you want to add this ${action}?`,
|
|
10
|
+
choices: [
|
|
11
|
+
...rootFolder ? [
|
|
12
|
+
{
|
|
13
|
+
name: `Add ${action} to root of project`,
|
|
14
|
+
value: 'root'
|
|
15
|
+
}
|
|
16
|
+
] : [
|
|
17
|
+
{
|
|
18
|
+
name: `Add ${action} to new API`,
|
|
19
|
+
value: 'new'
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
{
|
|
23
|
+
name: `Add ${action} to an existing API`,
|
|
24
|
+
value: 'api'
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: `Add ${action} to an existing plugin`,
|
|
28
|
+
value: 'plugin'
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
when: (answers)=>answers.destination === 'api',
|
|
34
|
+
type: 'list',
|
|
35
|
+
message: 'Which API is this for?',
|
|
36
|
+
name: 'api',
|
|
37
|
+
async choices () {
|
|
38
|
+
const apiPath = join(basePath, 'api');
|
|
39
|
+
const exists = await fs.pathExists(apiPath);
|
|
40
|
+
if (!exists) {
|
|
41
|
+
throw Error('Couldn\'t find an "api" directory');
|
|
42
|
+
}
|
|
43
|
+
const apiDir = await fs.readdir(apiPath, {
|
|
44
|
+
withFileTypes: true
|
|
45
|
+
});
|
|
46
|
+
const apiDirContent = apiDir.filter((fd)=>fd.isDirectory());
|
|
47
|
+
if (apiDirContent.length === 0) {
|
|
48
|
+
throw Error('The "api" directory is empty');
|
|
49
|
+
}
|
|
50
|
+
return apiDirContent;
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
when: (answers)=>answers.destination === 'plugin',
|
|
55
|
+
type: 'list',
|
|
56
|
+
message: 'Which plugin is this for?',
|
|
57
|
+
name: 'plugin',
|
|
58
|
+
async choices () {
|
|
59
|
+
const pluginsPath = join(basePath, 'plugins');
|
|
60
|
+
const exists = await fs.pathExists(pluginsPath);
|
|
61
|
+
if (!exists) {
|
|
62
|
+
throw Error('Couldn\'t find a "plugins" directory');
|
|
63
|
+
}
|
|
64
|
+
const pluginsDir = await fs.readdir(pluginsPath);
|
|
65
|
+
const pluginsDirContent = pluginsDir.filter((api)=>fs.lstatSync(join(pluginsPath, api)).isDirectory());
|
|
66
|
+
if (pluginsDirContent.length === 0) {
|
|
67
|
+
throw Error('The "plugins" directory is empty');
|
|
68
|
+
}
|
|
69
|
+
return pluginsDirContent;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
];
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
export { getDestinationPrompts as default };
|
|
76
|
+
//# sourceMappingURL=get-destination-prompts.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-destination-prompts.mjs","sources":["../../../src/plops/prompts/get-destination-prompts.ts"],"sourcesContent":["import { join } from 'path';\nimport fs from 'fs-extra';\n\nexport default (action: string, basePath: string, { rootFolder = false } = {}) => {\n return [\n {\n type: 'list',\n name: 'destination',\n message: `Where do you want to add this ${action}?`,\n choices: [\n ...(rootFolder\n ? [\n {\n name: `Add ${action} to root of project`,\n value: 'root',\n },\n ]\n : [\n {\n name: `Add ${action} to new API`,\n value: 'new',\n },\n ]),\n { name: `Add ${action} to an existing API`, value: 'api' },\n { name: `Add ${action} to an existing plugin`, value: 'plugin' },\n ],\n },\n {\n when: (answers: any) => answers.destination === 'api',\n type: 'list',\n message: 'Which API is this for?',\n name: 'api',\n async choices() {\n const apiPath = join(basePath, 'api');\n const exists = await fs.pathExists(apiPath);\n\n if (!exists) {\n throw Error('Couldn\\'t find an \"api\" directory');\n }\n\n const apiDir = await fs.readdir(apiPath, { withFileTypes: true });\n const apiDirContent = apiDir.filter((fd) => fd.isDirectory());\n\n if (apiDirContent.length === 0) {\n throw Error('The \"api\" directory is empty');\n }\n\n return apiDirContent;\n },\n },\n {\n when: (answers: any) => answers.destination === 'plugin',\n type: 'list',\n message: 'Which plugin is this for?',\n name: 'plugin',\n async choices() {\n const pluginsPath = join(basePath, 'plugins');\n const exists = await fs.pathExists(pluginsPath);\n\n if (!exists) {\n throw Error('Couldn\\'t find a \"plugins\" directory');\n }\n\n const pluginsDir = await fs.readdir(pluginsPath);\n const pluginsDirContent = pluginsDir.filter((api) =>\n fs.lstatSync(join(pluginsPath, api)).isDirectory()\n );\n\n if (pluginsDirContent.length === 0) {\n throw Error('The \"plugins\" directory is empty');\n }\n\n return pluginsDirContent;\n },\n },\n ];\n};\n"],"names":["action","basePath","rootFolder","type","name","message","choices","value","when","answers","destination","apiPath","join","exists","fs","pathExists","Error","apiDir","readdir","withFileTypes","apiDirContent","filter","fd","isDirectory","length","pluginsPath","pluginsDir","pluginsDirContent","api","lstatSync"],"mappings":";;;AAGA,4BAAe,CAAA,CAACA,MAAAA,EAAgBC,QAAkB,EAAA,EAAEC,aAAa,KAAK,EAAE,GAAG,EAAE,GAAA;IAC3E,OAAO;AACL,QAAA;YACEC,IAAM,EAAA,MAAA;YACNC,IAAM,EAAA,aAAA;AACNC,YAAAA,OAAAA,EAAS,CAAC,8BAA8B,EAAEL,MAAAA,CAAO,CAAC,CAAC;YACnDM,OAAS,EAAA;mBACHJ,UACA,GAAA;AACE,oBAAA;AACEE,wBAAAA,IAAAA,EAAM,CAAC,IAAI,EAAEJ,MAAAA,CAAO,mBAAmB,CAAC;wBACxCO,KAAO,EAAA;AACT;iBACD,GACD;AACE,oBAAA;AACEH,wBAAAA,IAAAA,EAAM,CAAC,IAAI,EAAEJ,MAAAA,CAAO,WAAW,CAAC;wBAChCO,KAAO,EAAA;AACT;AACD,iBAAA;AACL,gBAAA;AAAEH,oBAAAA,IAAAA,EAAM,CAAC,IAAI,EAAEJ,MAAAA,CAAO,mBAAmB,CAAC;oBAAEO,KAAO,EAAA;AAAM,iBAAA;AACzD,gBAAA;AAAEH,oBAAAA,IAAAA,EAAM,CAAC,IAAI,EAAEJ,MAAAA,CAAO,sBAAsB,CAAC;oBAAEO,KAAO,EAAA;AAAS;AAChE;AACH,SAAA;AACA,QAAA;AACEC,YAAAA,IAAAA,EAAM,CAACC,OAAAA,GAAiBA,OAAQC,CAAAA,WAAW,KAAK,KAAA;YAChDP,IAAM,EAAA,MAAA;YACNE,OAAS,EAAA,wBAAA;YACTD,IAAM,EAAA,KAAA;YACN,MAAME,OAAAA,CAAAA,GAAAA;gBACJ,MAAMK,OAAAA,GAAUC,KAAKX,QAAU,EAAA,KAAA,CAAA;AAC/B,gBAAA,MAAMY,MAAS,GAAA,MAAMC,EAAGC,CAAAA,UAAU,CAACJ,OAAAA,CAAAA;AAEnC,gBAAA,IAAI,CAACE,MAAQ,EAAA;AACX,oBAAA,MAAMG,KAAM,CAAA,mCAAA,CAAA;AACd;AAEA,gBAAA,MAAMC,MAAS,GAAA,MAAMH,EAAGI,CAAAA,OAAO,CAACP,OAAS,EAAA;oBAAEQ,aAAe,EAAA;AAAK,iBAAA,CAAA;AAC/D,gBAAA,MAAMC,gBAAgBH,MAAOI,CAAAA,MAAM,CAAC,CAACC,EAAAA,GAAOA,GAAGC,WAAW,EAAA,CAAA;gBAE1D,IAAIH,aAAAA,CAAcI,MAAM,KAAK,CAAG,EAAA;AAC9B,oBAAA,MAAMR,KAAM,CAAA,8BAAA,CAAA;AACd;gBAEA,OAAOI,aAAAA;AACT;AACF,SAAA;AACA,QAAA;AACEZ,YAAAA,IAAAA,EAAM,CAACC,OAAAA,GAAiBA,OAAQC,CAAAA,WAAW,KAAK,QAAA;YAChDP,IAAM,EAAA,MAAA;YACNE,OAAS,EAAA,2BAAA;YACTD,IAAM,EAAA,QAAA;YACN,MAAME,OAAAA,CAAAA,GAAAA;gBACJ,MAAMmB,WAAAA,GAAcb,KAAKX,QAAU,EAAA,SAAA,CAAA;AACnC,gBAAA,MAAMY,MAAS,GAAA,MAAMC,EAAGC,CAAAA,UAAU,CAACU,WAAAA,CAAAA;AAEnC,gBAAA,IAAI,CAACZ,MAAQ,EAAA;AACX,oBAAA,MAAMG,KAAM,CAAA,sCAAA,CAAA;AACd;AAEA,gBAAA,MAAMU,UAAa,GAAA,MAAMZ,EAAGI,CAAAA,OAAO,CAACO,WAAAA,CAAAA;AACpC,gBAAA,MAAME,iBAAoBD,GAAAA,UAAAA,CAAWL,MAAM,CAAC,CAACO,GAAAA,GAC3Cd,EAAGe,CAAAA,SAAS,CAACjB,IAAAA,CAAKa,WAAaG,EAAAA,GAAAA,CAAAA,CAAAA,CAAML,WAAW,EAAA,CAAA;gBAGlD,IAAII,iBAAAA,CAAkBH,MAAM,KAAK,CAAG,EAAA;AAClC,oBAAA,MAAMR,KAAM,CAAA,kCAAA,CAAA;AACd;gBAEA,OAAOW,iBAAAA;AACT;AACF;AACD,KAAA;AACH,CAAA;;;;"}
|
|
@@ -1,3 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
declare const questions: {
|
|
2
|
+
type: string;
|
|
3
|
+
name: string;
|
|
4
|
+
message: string;
|
|
5
|
+
default: string;
|
|
6
|
+
choices: {
|
|
7
|
+
name: string;
|
|
8
|
+
value: string;
|
|
9
|
+
}[];
|
|
10
|
+
validate: (input: string) => true | "You must provide an input" | "Please use only letters, '-' and no spaces";
|
|
11
|
+
}[];
|
|
3
12
|
export default questions;
|
|
13
|
+
//# sourceMappingURL=kind-prompts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kind-prompts.d.ts","sourceRoot":"","sources":["../../../src/plops/prompts/kind-prompts.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,SAAS;;;;;;;;;sBAUO,MAAM;GAE3B,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const validate_input_1 = __importDefault(require("../utils/validate-input"));
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var validateInput = require('../utils/validate-input.js');
|
|
4
|
+
|
|
7
5
|
const questions = [
|
|
8
6
|
{
|
|
9
7
|
type: 'list',
|
|
@@ -11,11 +9,18 @@ const questions = [
|
|
|
11
9
|
message: 'Please choose the model type',
|
|
12
10
|
default: 'collectionType',
|
|
13
11
|
choices: [
|
|
14
|
-
{
|
|
15
|
-
|
|
12
|
+
{
|
|
13
|
+
name: 'Collection Type',
|
|
14
|
+
value: 'collectionType'
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: 'Single Type',
|
|
18
|
+
value: 'singleType'
|
|
19
|
+
}
|
|
16
20
|
],
|
|
17
|
-
validate: (input)
|
|
18
|
-
}
|
|
21
|
+
validate: (input)=>validateInput(input)
|
|
22
|
+
}
|
|
19
23
|
];
|
|
20
|
-
|
|
21
|
-
|
|
24
|
+
|
|
25
|
+
module.exports = questions;
|
|
26
|
+
//# sourceMappingURL=kind-prompts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kind-prompts.js","
|
|
1
|
+
{"version":3,"file":"kind-prompts.js","sources":["../../../src/plops/prompts/kind-prompts.ts"],"sourcesContent":["import validateInput from '../utils/validate-input';\n\nconst questions = [\n {\n type: 'list',\n name: 'kind',\n message: 'Please choose the model type',\n default: 'collectionType',\n choices: [\n { name: 'Collection Type', value: 'collectionType' },\n { name: 'Single Type', value: 'singleType' },\n ],\n validate: (input: string) => validateInput(input),\n },\n];\n\nexport default questions;\n"],"names":["questions","type","name","message","default","choices","value","validate","input","validateInput"],"mappings":";;;;AAEA,MAAMA,SAAY,GAAA;AAChB,IAAA;QACEC,IAAM,EAAA,MAAA;QACNC,IAAM,EAAA,MAAA;QACNC,OAAS,EAAA,8BAAA;QACTC,OAAS,EAAA,gBAAA;QACTC,OAAS,EAAA;AACP,YAAA;gBAAEH,IAAM,EAAA,iBAAA;gBAAmBI,KAAO,EAAA;AAAiB,aAAA;AACnD,YAAA;gBAAEJ,IAAM,EAAA,aAAA;gBAAeI,KAAO,EAAA;AAAa;AAC5C,SAAA;QACDC,QAAU,EAAA,CAACC,QAAkBC,aAAcD,CAAAA,KAAAA;AAC7C;AACD;;;;"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import validateInput from '../utils/validate-input.mjs';
|
|
2
|
+
|
|
3
|
+
const questions = [
|
|
4
|
+
{
|
|
5
|
+
type: 'list',
|
|
6
|
+
name: 'kind',
|
|
7
|
+
message: 'Please choose the model type',
|
|
8
|
+
default: 'collectionType',
|
|
9
|
+
choices: [
|
|
10
|
+
{
|
|
11
|
+
name: 'Collection Type',
|
|
12
|
+
value: 'collectionType'
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
name: 'Single Type',
|
|
16
|
+
value: 'singleType'
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
validate: (input)=>validateInput(input)
|
|
20
|
+
}
|
|
21
|
+
];
|
|
22
|
+
|
|
23
|
+
export { questions as default };
|
|
24
|
+
//# sourceMappingURL=kind-prompts.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kind-prompts.mjs","sources":["../../../src/plops/prompts/kind-prompts.ts"],"sourcesContent":["import validateInput from '../utils/validate-input';\n\nconst questions = [\n {\n type: 'list',\n name: 'kind',\n message: 'Please choose the model type',\n default: 'collectionType',\n choices: [\n { name: 'Collection Type', value: 'collectionType' },\n { name: 'Single Type', value: 'singleType' },\n ],\n validate: (input: string) => validateInput(input),\n },\n];\n\nexport default questions;\n"],"names":["questions","type","name","message","default","choices","value","validate","input","validateInput"],"mappings":";;AAEA,MAAMA,SAAY,GAAA;AAChB,IAAA;QACEC,IAAM,EAAA,MAAA;QACNC,IAAM,EAAA,MAAA;QACNC,OAAS,EAAA,8BAAA;QACTC,OAAS,EAAA,gBAAA;QACTC,OAAS,EAAA;AACP,YAAA;gBAAEH,IAAM,EAAA,iBAAA;gBAAmBI,KAAO,EAAA;AAAiB,aAAA;AACnD,YAAA;gBAAEJ,IAAM,EAAA,aAAA;gBAAeI,KAAO,EAAA;AAAa;AAC5C,SAAA;QACDC,QAAU,EAAA,CAACC,QAAkBC,aAAcD,CAAAA,KAAAA;AAC7C;AACD;;;;"}
|
package/dist/plops/service.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../src/plops/service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;+BAMlB,WAAW;AAAjC,wBA8BE"}
|
package/dist/plops/service.js
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const get_file_path_1 = __importDefault(require("./utils/get-file-path"));
|
|
9
|
-
exports.default = (plop) => {
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var tsUtils = require('@strapi/typescript-utils');
|
|
4
|
+
var getDestinationPrompts = require('./prompts/get-destination-prompts.js');
|
|
5
|
+
var getFilePath = require('./utils/get-file-path.js');
|
|
6
|
+
|
|
7
|
+
var generateService = ((plop)=>{
|
|
10
8
|
// Service generator
|
|
11
9
|
plop.setGenerator('service', {
|
|
12
10
|
description: 'Generate a service for an API',
|
|
@@ -14,25 +12,27 @@ exports.default = (plop) => {
|
|
|
14
12
|
{
|
|
15
13
|
type: 'input',
|
|
16
14
|
name: 'id',
|
|
17
|
-
message: 'Service name'
|
|
15
|
+
message: 'Service name'
|
|
18
16
|
},
|
|
19
|
-
...(
|
|
17
|
+
...getDestinationPrompts('service', plop.getDestBasePath())
|
|
20
18
|
],
|
|
21
|
-
actions(answers) {
|
|
19
|
+
actions (answers) {
|
|
22
20
|
if (!answers) {
|
|
23
21
|
return [];
|
|
24
22
|
}
|
|
25
|
-
const filePath = (
|
|
23
|
+
const filePath = getFilePath(answers?.destination);
|
|
26
24
|
const currentDir = process.cwd();
|
|
27
|
-
const language =
|
|
25
|
+
const language = tsUtils.isUsingTypeScriptSync(currentDir) ? 'ts' : 'js';
|
|
28
26
|
return [
|
|
29
27
|
{
|
|
30
28
|
type: 'add',
|
|
31
29
|
path: `${filePath}/services/{{ id }}.${language}`,
|
|
32
|
-
templateFile: `templates/${language}/service.${language}.hbs
|
|
33
|
-
}
|
|
30
|
+
templateFile: `templates/${language}/service.${language}.hbs`
|
|
31
|
+
}
|
|
34
32
|
];
|
|
35
|
-
}
|
|
33
|
+
}
|
|
36
34
|
});
|
|
37
|
-
};
|
|
38
|
-
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
module.exports = generateService;
|
|
38
|
+
//# sourceMappingURL=service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.js","
|
|
1
|
+
{"version":3,"file":"service.js","sources":["../../src/plops/service.ts"],"sourcesContent":["import type { NodePlopAPI } from 'plop';\nimport tsUtils from '@strapi/typescript-utils';\n\nimport getDestinationPrompts from './prompts/get-destination-prompts';\nimport getFilePath from './utils/get-file-path';\n\nexport default (plop: NodePlopAPI) => {\n // Service generator\n plop.setGenerator('service', {\n description: 'Generate a service for an API',\n prompts: [\n {\n type: 'input',\n name: 'id',\n message: 'Service name',\n },\n ...getDestinationPrompts('service', plop.getDestBasePath()),\n ],\n actions(answers) {\n if (!answers) {\n return [];\n }\n\n const filePath = getFilePath(answers?.destination);\n const currentDir = process.cwd();\n const language = tsUtils.isUsingTypeScriptSync(currentDir) ? 'ts' : 'js';\n\n return [\n {\n type: 'add',\n path: `${filePath}/services/{{ id }}.${language}`,\n templateFile: `templates/${language}/service.${language}.hbs`,\n },\n ];\n },\n });\n};\n"],"names":["plop","setGenerator","description","prompts","type","name","message","getDestinationPrompts","getDestBasePath","actions","answers","filePath","getFilePath","destination","currentDir","process","cwd","language","tsUtils","isUsingTypeScriptSync","path","templateFile"],"mappings":";;;;;;AAMA,sBAAe,CAAA,CAACA,IAAAA,GAAAA;;IAEdA,IAAKC,CAAAA,YAAY,CAAC,SAAW,EAAA;QAC3BC,WAAa,EAAA,+BAAA;QACbC,OAAS,EAAA;AACP,YAAA;gBACEC,IAAM,EAAA,OAAA;gBACNC,IAAM,EAAA,IAAA;gBACNC,OAAS,EAAA;AACX,aAAA;eACGC,qBAAsB,CAAA,SAAA,EAAWP,KAAKQ,eAAe,EAAA;AACzD,SAAA;AACDC,QAAAA,OAAAA,CAAAA,CAAQC,OAAO,EAAA;AACb,YAAA,IAAI,CAACA,OAAS,EAAA;AACZ,gBAAA,OAAO,EAAE;AACX;YAEA,MAAMC,QAAAA,GAAWC,YAAYF,OAASG,EAAAA,WAAAA,CAAAA;YACtC,MAAMC,UAAAA,GAAaC,QAAQC,GAAG,EAAA;AAC9B,YAAA,MAAMC,QAAWC,GAAAA,OAAAA,CAAQC,qBAAqB,CAACL,cAAc,IAAO,GAAA,IAAA;YAEpE,OAAO;AACL,gBAAA;oBACEV,IAAM,EAAA,KAAA;AACNgB,oBAAAA,IAAAA,EAAM,CAAC,EAAET,QAAAA,CAAS,mBAAmB,EAAEM,SAAS,CAAC;oBACjDI,YAAc,EAAA,CAAC,UAAU,EAAEJ,QAAAA,CAAS,SAAS,EAAEA,QAAAA,CAAS,IAAI;AAC9D;AACD,aAAA;AACH;AACF,KAAA,CAAA;AACF,CAAA;;;;"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import tsUtils from '@strapi/typescript-utils';
|
|
2
|
+
import getDestinationPrompts from './prompts/get-destination-prompts.mjs';
|
|
3
|
+
import getFilePath from './utils/get-file-path.mjs';
|
|
4
|
+
|
|
5
|
+
var generateService = ((plop)=>{
|
|
6
|
+
// Service generator
|
|
7
|
+
plop.setGenerator('service', {
|
|
8
|
+
description: 'Generate a service for an API',
|
|
9
|
+
prompts: [
|
|
10
|
+
{
|
|
11
|
+
type: 'input',
|
|
12
|
+
name: 'id',
|
|
13
|
+
message: 'Service name'
|
|
14
|
+
},
|
|
15
|
+
...getDestinationPrompts('service', plop.getDestBasePath())
|
|
16
|
+
],
|
|
17
|
+
actions (answers) {
|
|
18
|
+
if (!answers) {
|
|
19
|
+
return [];
|
|
20
|
+
}
|
|
21
|
+
const filePath = getFilePath(answers?.destination);
|
|
22
|
+
const currentDir = process.cwd();
|
|
23
|
+
const language = tsUtils.isUsingTypeScriptSync(currentDir) ? 'ts' : 'js';
|
|
24
|
+
return [
|
|
25
|
+
{
|
|
26
|
+
type: 'add',
|
|
27
|
+
path: `${filePath}/services/{{ id }}.${language}`,
|
|
28
|
+
templateFile: `templates/${language}/service.${language}.hbs`
|
|
29
|
+
}
|
|
30
|
+
];
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
export { generateService as default };
|
|
36
|
+
//# sourceMappingURL=service.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.mjs","sources":["../../src/plops/service.ts"],"sourcesContent":["import type { NodePlopAPI } from 'plop';\nimport tsUtils from '@strapi/typescript-utils';\n\nimport getDestinationPrompts from './prompts/get-destination-prompts';\nimport getFilePath from './utils/get-file-path';\n\nexport default (plop: NodePlopAPI) => {\n // Service generator\n plop.setGenerator('service', {\n description: 'Generate a service for an API',\n prompts: [\n {\n type: 'input',\n name: 'id',\n message: 'Service name',\n },\n ...getDestinationPrompts('service', plop.getDestBasePath()),\n ],\n actions(answers) {\n if (!answers) {\n return [];\n }\n\n const filePath = getFilePath(answers?.destination);\n const currentDir = process.cwd();\n const language = tsUtils.isUsingTypeScriptSync(currentDir) ? 'ts' : 'js';\n\n return [\n {\n type: 'add',\n path: `${filePath}/services/{{ id }}.${language}`,\n templateFile: `templates/${language}/service.${language}.hbs`,\n },\n ];\n },\n });\n};\n"],"names":["plop","setGenerator","description","prompts","type","name","message","getDestinationPrompts","getDestBasePath","actions","answers","filePath","getFilePath","destination","currentDir","process","cwd","language","tsUtils","isUsingTypeScriptSync","path","templateFile"],"mappings":";;;;AAMA,sBAAe,CAAA,CAACA,IAAAA,GAAAA;;IAEdA,IAAKC,CAAAA,YAAY,CAAC,SAAW,EAAA;QAC3BC,WAAa,EAAA,+BAAA;QACbC,OAAS,EAAA;AACP,YAAA;gBACEC,IAAM,EAAA,OAAA;gBACNC,IAAM,EAAA,IAAA;gBACNC,OAAS,EAAA;AACX,aAAA;eACGC,qBAAsB,CAAA,SAAA,EAAWP,KAAKQ,eAAe,EAAA;AACzD,SAAA;AACDC,QAAAA,OAAAA,CAAAA,CAAQC,OAAO,EAAA;AACb,YAAA,IAAI,CAACA,OAAS,EAAA;AACZ,gBAAA,OAAO,EAAE;AACX;YAEA,MAAMC,QAAAA,GAAWC,YAAYF,OAASG,EAAAA,WAAAA,CAAAA;YACtC,MAAMC,UAAAA,GAAaC,QAAQC,GAAG,EAAA;AAC9B,YAAA,MAAMC,QAAWC,GAAAA,OAAAA,CAAQC,qBAAqB,CAACL,cAAc,IAAO,GAAA,IAAA;YAEpE,OAAO;AACL,gBAAA;oBACEV,IAAM,EAAA,KAAA;AACNgB,oBAAAA,IAAAA,EAAM,CAAC,EAAET,QAAAA,CAAS,mBAAmB,EAAEM,SAAS,CAAC;oBACjDI,YAAc,EAAA,CAAC,UAAU,EAAEJ,QAAAA,CAAS,SAAS,EAAEA,QAAAA,CAAS,IAAI;AAC9D;AACD,aAAA;AACH;AACF,KAAA,CAAA;AACF,CAAA;;;;"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
declare const _default: (destination: string) => "
|
|
1
|
+
declare const _default: (destination: string) => "plugins/{{ plugin }}/server" | "api/{{ id }}" | "api/{{ api }}" | "./";
|
|
2
2
|
export default _default;
|
|
3
|
+
//# sourceMappingURL=get-file-path.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-file-path.d.ts","sourceRoot":"","sources":["../../../src/plops/utils/get-file-path.ts"],"names":[],"mappings":"sCAA6B,MAAM;AAAnC,wBAcE"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var getFilePath = ((destination)=>{
|
|
4
4
|
if (destination === 'api') {
|
|
5
5
|
return `api/{{ api }}`;
|
|
6
6
|
}
|
|
@@ -11,5 +11,7 @@ exports.default = (destination) => {
|
|
|
11
11
|
return './';
|
|
12
12
|
}
|
|
13
13
|
return `api/{{ id }}`;
|
|
14
|
-
};
|
|
15
|
-
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
module.exports = getFilePath;
|
|
17
|
+
//# sourceMappingURL=get-file-path.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-file-path.js","
|
|
1
|
+
{"version":3,"file":"get-file-path.js","sources":["../../../src/plops/utils/get-file-path.ts"],"sourcesContent":["export default (destination: string) => {\n if (destination === 'api') {\n return `api/{{ api }}`;\n }\n\n if (destination === 'plugin') {\n return `plugins/{{ plugin }}/server`;\n }\n\n if (destination === 'root') {\n return './';\n }\n\n return `api/{{ id }}`;\n};\n"],"names":["destination"],"mappings":";;AAAA,kBAAe,CAAA,CAACA,WAAAA,GAAAA;AACd,IAAA,IAAIA,gBAAgB,KAAO,EAAA;QACzB,OAAO,CAAC,aAAa,CAAC;AACxB;AAEA,IAAA,IAAIA,gBAAgB,QAAU,EAAA;QAC5B,OAAO,CAAC,2BAA2B,CAAC;AACtC;AAEA,IAAA,IAAIA,gBAAgB,MAAQ,EAAA;QAC1B,OAAO,IAAA;AACT;IAEA,OAAO,CAAC,YAAY,CAAC;AACvB,CAAA;;;;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
var getFilePath = ((destination)=>{
|
|
2
|
+
if (destination === 'api') {
|
|
3
|
+
return `api/{{ api }}`;
|
|
4
|
+
}
|
|
5
|
+
if (destination === 'plugin') {
|
|
6
|
+
return `plugins/{{ plugin }}/server`;
|
|
7
|
+
}
|
|
8
|
+
if (destination === 'root') {
|
|
9
|
+
return './';
|
|
10
|
+
}
|
|
11
|
+
return `api/{{ id }}`;
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export { getFilePath as default };
|
|
15
|
+
//# sourceMappingURL=get-file-path.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-file-path.mjs","sources":["../../../src/plops/utils/get-file-path.ts"],"sourcesContent":["export default (destination: string) => {\n if (destination === 'api') {\n return `api/{{ api }}`;\n }\n\n if (destination === 'plugin') {\n return `plugins/{{ plugin }}/server`;\n }\n\n if (destination === 'root') {\n return './';\n }\n\n return `api/{{ id }}`;\n};\n"],"names":["destination"],"mappings":"AAAA,kBAAe,CAAA,CAACA,WAAAA,GAAAA;AACd,IAAA,IAAIA,gBAAgB,KAAO,EAAA;QACzB,OAAO,CAAC,aAAa,CAAC;AACxB;AAEA,IAAA,IAAIA,gBAAgB,QAAU,EAAA;QAC5B,OAAO,CAAC,2BAA2B,CAAC;AACtC;AAEA,IAAA,IAAIA,gBAAgB,MAAQ,EAAA;QAC1B,OAAO,IAAA;AACT;IAEA,OAAO,CAAC,YAAY,CAAC;AACvB,CAAA;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-formatted-date.d.ts","sourceRoot":"","sources":["../../../src/plops/utils/get-formatted-date.ts"],"names":[],"mappings":"gCAAsB,IAAI;AAA1B,wBAKE"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
return new Date(date.getTime() - date.getTimezoneOffset() * 60000)
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
//# sourceMappingURL=get-formatted-date.js.map
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var getFormattedDate = ((date = new Date())=>{
|
|
4
|
+
return new Date(date.getTime() - date.getTimezoneOffset() * 60000).toJSON().replace(/[-:]/g, '.').replace(/\....Z/, '');
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
module.exports = getFormattedDate;
|
|
8
|
+
//# sourceMappingURL=get-formatted-date.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-formatted-date.js","
|
|
1
|
+
{"version":3,"file":"get-formatted-date.js","sources":["../../../src/plops/utils/get-formatted-date.ts"],"sourcesContent":["export default (date: Date = new Date()) => {\n return new Date(date.getTime() - date.getTimezoneOffset() * 60000)\n .toJSON()\n .replace(/[-:]/g, '.')\n .replace(/\\....Z/, '');\n};\n"],"names":["date","Date","getTime","getTimezoneOffset","toJSON","replace"],"mappings":";;AAAA,uBAAe,CAAA,CAACA,IAAa,GAAA,IAAIC,IAAM,EAAA,GAAA;AACrC,IAAA,OAAO,IAAIA,IAAKD,CAAAA,IAAAA,CAAKE,OAAO,EAAA,GAAKF,KAAKG,iBAAiB,EAAA,GAAK,KACzDC,CAAAA,CAAAA,MAAM,GACNC,OAAO,CAAC,SAAS,GACjBA,CAAAA,CAAAA,OAAO,CAAC,QAAU,EAAA,EAAA,CAAA;AACvB,CAAA;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-formatted-date.mjs","sources":["../../../src/plops/utils/get-formatted-date.ts"],"sourcesContent":["export default (date: Date = new Date()) => {\n return new Date(date.getTime() - date.getTimezoneOffset() * 60000)\n .toJSON()\n .replace(/[-:]/g, '.')\n .replace(/\\....Z/, '');\n};\n"],"names":["date","Date","getTime","getTimezoneOffset","toJSON","replace"],"mappings":"AAAA,uBAAe,CAAA,CAACA,IAAa,GAAA,IAAIC,IAAM,EAAA,GAAA;AACrC,IAAA,OAAO,IAAIA,IAAKD,CAAAA,IAAAA,CAAKE,OAAO,EAAA,GAAKF,KAAKG,iBAAiB,EAAA,GAAK,KACzDC,CAAAA,CAAAA,MAAM,GACNC,OAAO,CAAC,SAAS,GACjBA,CAAAA,CAAAA,OAAO,CAAC,QAAU,EAAA,EAAA,CAAA;AACvB,CAAA;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-attribute-input.d.ts","sourceRoot":"","sources":["../../../src/plops/utils/validate-attribute-input.ts"],"names":[],"mappings":"gCAAuB,MAAM;AAA7B,wBAQE"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var validateAttributeInput = ((input)=>{
|
|
4
4
|
const regex = /^[A-Za-z-|_]+$/g;
|
|
5
5
|
if (!input) {
|
|
6
6
|
return 'You must provide an input';
|
|
7
7
|
}
|
|
8
8
|
return regex.test(input) || "Please use only letters, '-', '_', and no spaces";
|
|
9
|
-
};
|
|
10
|
-
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
module.exports = validateAttributeInput;
|
|
12
|
+
//# sourceMappingURL=validate-attribute-input.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-attribute-input.js","
|
|
1
|
+
{"version":3,"file":"validate-attribute-input.js","sources":["../../../src/plops/utils/validate-attribute-input.ts"],"sourcesContent":["export default (input: string) => {\n const regex = /^[A-Za-z-|_]+$/g;\n\n if (!input) {\n return 'You must provide an input';\n }\n\n return regex.test(input) || \"Please use only letters, '-', '_', and no spaces\";\n};\n"],"names":["input","regex","test"],"mappings":";;AAAA,6BAAe,CAAA,CAACA,KAAAA,GAAAA;AACd,IAAA,MAAMC,KAAQ,GAAA,iBAAA;AAEd,IAAA,IAAI,CAACD,KAAO,EAAA;QACV,OAAO,2BAAA;AACT;IAEA,OAAOC,KAAAA,CAAMC,IAAI,CAACF,KAAU,CAAA,IAAA,mDAAA;AAC9B,CAAA;;;;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
var validateAttributeInput = ((input)=>{
|
|
2
|
+
const regex = /^[A-Za-z-|_]+$/g;
|
|
3
|
+
if (!input) {
|
|
4
|
+
return 'You must provide an input';
|
|
5
|
+
}
|
|
6
|
+
return regex.test(input) || "Please use only letters, '-', '_', and no spaces";
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export { validateAttributeInput as default };
|
|
10
|
+
//# sourceMappingURL=validate-attribute-input.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-attribute-input.mjs","sources":["../../../src/plops/utils/validate-attribute-input.ts"],"sourcesContent":["export default (input: string) => {\n const regex = /^[A-Za-z-|_]+$/g;\n\n if (!input) {\n return 'You must provide an input';\n }\n\n return regex.test(input) || \"Please use only letters, '-', '_', and no spaces\";\n};\n"],"names":["input","regex","test"],"mappings":"AAAA,6BAAe,CAAA,CAACA,KAAAA,GAAAA;AACd,IAAA,MAAMC,KAAQ,GAAA,iBAAA;AAEd,IAAA,IAAI,CAACD,KAAO,EAAA;QACV,OAAO,2BAAA;AACT;IAEA,OAAOC,KAAAA,CAAMC,IAAI,CAACF,KAAU,CAAA,IAAA,mDAAA;AAC9B,CAAA;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-file-name-input.d.ts","sourceRoot":"","sources":["../../../src/plops/utils/validate-file-name-input.ts"],"names":[],"mappings":"gCAAuB,MAAM;AAA7B,wBAQE"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var validateFileNameInput = ((input)=>{
|
|
4
4
|
const regex = /^[A-Za-z-_0-9]+$/g;
|
|
5
5
|
if (!input) {
|
|
6
6
|
return 'You must provide an input';
|
|
7
7
|
}
|
|
8
8
|
return regex.test(input) || "Please use only letters and number, '-' or '_' and no spaces";
|
|
9
|
-
};
|
|
10
|
-
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
module.exports = validateFileNameInput;
|
|
12
|
+
//# sourceMappingURL=validate-file-name-input.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-file-name-input.js","
|
|
1
|
+
{"version":3,"file":"validate-file-name-input.js","sources":["../../../src/plops/utils/validate-file-name-input.ts"],"sourcesContent":["export default (input: string) => {\n const regex = /^[A-Za-z-_0-9]+$/g;\n\n if (!input) {\n return 'You must provide an input';\n }\n\n return regex.test(input) || \"Please use only letters and number, '-' or '_' and no spaces\";\n};\n"],"names":["input","regex","test"],"mappings":";;AAAA,4BAAe,CAAA,CAACA,KAAAA,GAAAA;AACd,IAAA,MAAMC,KAAQ,GAAA,mBAAA;AAEd,IAAA,IAAI,CAACD,KAAO,EAAA;QACV,OAAO,2BAAA;AACT;IAEA,OAAOC,KAAAA,CAAMC,IAAI,CAACF,KAAU,CAAA,IAAA,8DAAA;AAC9B,CAAA;;;;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
var validateFileNameInput = ((input)=>{
|
|
2
|
+
const regex = /^[A-Za-z-_0-9]+$/g;
|
|
3
|
+
if (!input) {
|
|
4
|
+
return 'You must provide an input';
|
|
5
|
+
}
|
|
6
|
+
return regex.test(input) || "Please use only letters and number, '-' or '_' and no spaces";
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export { validateFileNameInput as default };
|
|
10
|
+
//# sourceMappingURL=validate-file-name-input.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-file-name-input.mjs","sources":["../../../src/plops/utils/validate-file-name-input.ts"],"sourcesContent":["export default (input: string) => {\n const regex = /^[A-Za-z-_0-9]+$/g;\n\n if (!input) {\n return 'You must provide an input';\n }\n\n return regex.test(input) || \"Please use only letters and number, '-' or '_' and no spaces\";\n};\n"],"names":["input","regex","test"],"mappings":"AAAA,4BAAe,CAAA,CAACA,KAAAA,GAAAA;AACd,IAAA,MAAMC,KAAQ,GAAA,mBAAA;AAEd,IAAA,IAAI,CAACD,KAAO,EAAA;QACV,OAAO,2BAAA;AACT;IAEA,OAAOC,KAAAA,CAAMC,IAAI,CAACF,KAAU,CAAA,IAAA,8DAAA;AAC9B,CAAA;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-input.d.ts","sourceRoot":"","sources":["../../../src/plops/utils/validate-input.ts"],"names":[],"mappings":"gCAAuB,MAAM;AAA7B,wBAQE"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var validateInput = ((input)=>{
|
|
4
4
|
const regex = /^[A-Za-z-]+$/g;
|
|
5
5
|
if (!input) {
|
|
6
6
|
return 'You must provide an input';
|
|
7
7
|
}
|
|
8
8
|
return regex.test(input) || "Please use only letters, '-' and no spaces";
|
|
9
|
-
};
|
|
10
|
-
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
module.exports = validateInput;
|
|
12
|
+
//# sourceMappingURL=validate-input.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-input.js","
|
|
1
|
+
{"version":3,"file":"validate-input.js","sources":["../../../src/plops/utils/validate-input.ts"],"sourcesContent":["export default (input: string) => {\n const regex = /^[A-Za-z-]+$/g;\n\n if (!input) {\n return 'You must provide an input';\n }\n\n return regex.test(input) || \"Please use only letters, '-' and no spaces\";\n};\n"],"names":["input","regex","test"],"mappings":";;AAAA,oBAAe,CAAA,CAACA,KAAAA,GAAAA;AACd,IAAA,MAAMC,KAAQ,GAAA,eAAA;AAEd,IAAA,IAAI,CAACD,KAAO,EAAA;QACV,OAAO,2BAAA;AACT;IAEA,OAAOC,KAAAA,CAAMC,IAAI,CAACF,KAAU,CAAA,IAAA,4CAAA;AAC9B,CAAA;;;;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
var validateInput = ((input)=>{
|
|
2
|
+
const regex = /^[A-Za-z-]+$/g;
|
|
3
|
+
if (!input) {
|
|
4
|
+
return 'You must provide an input';
|
|
5
|
+
}
|
|
6
|
+
return regex.test(input) || "Please use only letters, '-' and no spaces";
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export { validateInput as default };
|
|
10
|
+
//# sourceMappingURL=validate-input.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-input.mjs","sources":["../../../src/plops/utils/validate-input.ts"],"sourcesContent":["export default (input: string) => {\n const regex = /^[A-Za-z-]+$/g;\n\n if (!input) {\n return 'You must provide an input';\n }\n\n return regex.test(input) || \"Please use only letters, '-' and no spaces\";\n};\n"],"names":["input","regex","test"],"mappings":"AAAA,oBAAe,CAAA,CAACA,KAAAA,GAAAA;AACd,IAAA,MAAMC,KAAQ,GAAA,eAAA;AAEd,IAAA,IAAI,CAACD,KAAO,EAAA;QACV,OAAO,2BAAA;AACT;IAEA,OAAOC,KAAAA,CAAMC,IAAI,CAACF,KAAU,CAAA,IAAA,4CAAA;AAC9B,CAAA;;;;"}
|