arkos 1.4.0-canary.41 → 1.4.0-canary.42

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.
@@ -22,7 +22,7 @@ async function getSwaggerDefaultConfig(defaultModelsPaths, defaultJsonSchemas) {
22
22
  },
23
23
  servers: [
24
24
  {
25
- url: `http://${portAndHost.host}:${portAndHost.port}`,
25
+ url: `http://${["0.0.0.0", "localhost", "127.0.0.1"].includes(portAndHost.host) ? "localhost" : portAndHost.host}:${portAndHost.port}`,
26
26
  description: `Local ${(0, text_helpers_1.capitalize)(process.env.NODE_ENV || "development")} Server`,
27
27
  },
28
28
  ],
@@ -1 +1 @@
1
- {"version":3,"file":"get-swagger-default-configs.js","sourceRoot":"","sources":["../../../../../../src/modules/swagger/utils/helpers/get-swagger-default-configs.ts"],"names":[],"mappings":";;;;;AAKA,0CA2DC;AA9DD,yEAAoE;AACpE,iHAAsF;AAEvE,KAAK,UAAU,uBAAuB,CACnD,kBAAuC,EACvC,kBAAiD;IAEjD,MAAM,WAAW,GAAG,MAAM,iCAAoB,CAAC,uBAAuB,CAAC,EAAE,CAAC,CAAC;IAE3E,OAAO;QACL,QAAQ,EAAE,OAAO;QACjB,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,KAAK;QACb,OAAO,EAAE;YACP,UAAU,EAAE;gBACV,OAAO,EAAE,OAAO;gBAChB,IAAI,EAAE;oBACJ,KAAK,EAAE,qBAAqB;oBAC5B,OAAO,EAAE,OAAO;oBAChB,WAAW,EACT,sFAAsF;iBACzF;gBACD,OAAO,EAAE;oBACP;wBACE,GAAG,EAAE,UAAU,WAAW,CAAC,IAAI,IAAI,WAAW,CAAC,IAAI,EAAE;wBACrD,WAAW,EAAE,SAAS,IAAA,yBAAU,EAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAC,SAAS;qBACjF;iBACF;gBACD,KAAK,EAAE,kBAAkB;gBACzB,UAAU,EAAE;oBACV,OAAO,EAAE,kBAAkB,IAAI,EAAE;oBACjC,eAAe,EAAE;wBACf,UAAU,EAAE;4BACV,IAAI,EAAE,MAAM;4BACZ,MAAM,EAAE,QAAQ;4BAChB,YAAY,EAAE,KAAK;yBACpB;qBACF;iBACF;gBACD,QAAQ,EAAE,EAAE;aACb;YACD,IAAI,EAAE;gBACJ,gCAAgC;gBAChC,mCAAmC;aACpC;YACD,WAAW,EAAE,IAAI;YACjB,eAAe,EAAE,IAAI;YACrB,oBAAoB,EAAE,KAAK;SAC5B;QACD,+BAA+B,EAAE;YAC/B,KAAK,EAAE,WAAW;YAClB,QAAQ,EAAE,IAAI;YACd,MAAM,EAAE,QAAQ;YAChB,WAAW,EAAE,IAAI;YACjB,kBAAkB,EAAE,KAAK;YACzB,QAAQ,EAAE;gBACR,KAAK,EAAE,4BAA4B;gBACnC,WAAW,EAAE,yCAAyC;aACvD;YACD,SAAS,EAAE,4BAA4B;SACxC;KACwB,CAAC;AAC9B,CAAC","sourcesContent":["import { OpenAPIV3 } from \"openapi-types\";\nimport { ArkosConfig } from \"../../../../exports\";\nimport { capitalize } from \"../../../../utils/helpers/text.helpers\";\nimport portAndHostAllocator from \"../../../../utils/features/port-and-host-allocator\";\n\nexport default async function getSwaggerDefaultConfig(\n defaultModelsPaths: Record<string, any>,\n defaultJsonSchemas: OpenAPIV3.PathsObject<{}, {}>\n) {\n const portAndHost = await portAndHostAllocator.getHostAndAvailablePort({});\n\n return {\n endpoint: \"/docs\",\n mode: \"prisma\",\n strict: false,\n options: {\n definition: {\n openapi: \"3.0.0\",\n info: {\n title: \"Powered By Arkos.js\",\n version: \"1.0.0\",\n description:\n \"This API was automatically generated by Arkos.js, read more about at www.arkosjs.com\",\n },\n servers: [\n {\n url: `http://${portAndHost.host}:${portAndHost.port}`,\n description: `Local ${capitalize(process.env.NODE_ENV || \"development\")} Server`,\n },\n ],\n paths: defaultModelsPaths,\n components: {\n schemas: defaultJsonSchemas || {},\n securitySchemes: {\n BearerAuth: {\n type: \"http\",\n scheme: \"bearer\",\n bearerFormat: \"JWT\",\n },\n },\n },\n security: [],\n },\n apis: [\n \"./src/routers/*.router.{ts,js}\",\n \"./src/modules/**/*.router.{ts,js}\",\n ],\n deepLinking: true,\n tryItOutEnabled: true,\n persistAuthorization: false,\n },\n scalarApiReferenceConfiguration: {\n theme: \"deepSpace\",\n darkMode: true,\n layout: \"modern\",\n showSidebar: true,\n hideDownloadButton: false,\n metaData: {\n title: \"Arkos.js API Documentation\",\n description: \"API documentation generated by Arkos.js\",\n },\n pageTitle: \"Arkos.js API Documentation\",\n },\n } as ArkosConfig[\"swagger\"];\n}\n"]}
1
+ {"version":3,"file":"get-swagger-default-configs.js","sourceRoot":"","sources":["../../../../../../src/modules/swagger/utils/helpers/get-swagger-default-configs.ts"],"names":[],"mappings":";;;;;AAKA,0CA2DC;AA9DD,yEAAoE;AACpE,iHAAsF;AAEvE,KAAK,UAAU,uBAAuB,CACnD,kBAAuC,EACvC,kBAAiD;IAEjD,MAAM,WAAW,GAAG,MAAM,iCAAoB,CAAC,uBAAuB,CAAC,EAAE,CAAC,CAAC;IAE3E,OAAO;QACL,QAAQ,EAAE,OAAO;QACjB,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE,KAAK;QACb,OAAO,EAAE;YACP,UAAU,EAAE;gBACV,OAAO,EAAE,OAAO;gBAChB,IAAI,EAAE;oBACJ,KAAK,EAAE,qBAAqB;oBAC5B,OAAO,EAAE,OAAO;oBAChB,WAAW,EACT,sFAAsF;iBACzF;gBACD,OAAO,EAAE;oBACP;wBACE,GAAG,EAAE,UAAU,CAAC,SAAS,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,IAAI,WAAW,CAAC,IAAI,EAAE;wBACtI,WAAW,EAAE,SAAS,IAAA,yBAAU,EAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAC,SAAS;qBACjF;iBACF;gBACD,KAAK,EAAE,kBAAkB;gBACzB,UAAU,EAAE;oBACV,OAAO,EAAE,kBAAkB,IAAI,EAAE;oBACjC,eAAe,EAAE;wBACf,UAAU,EAAE;4BACV,IAAI,EAAE,MAAM;4BACZ,MAAM,EAAE,QAAQ;4BAChB,YAAY,EAAE,KAAK;yBACpB;qBACF;iBACF;gBACD,QAAQ,EAAE,EAAE;aACb;YACD,IAAI,EAAE;gBACJ,gCAAgC;gBAChC,mCAAmC;aACpC;YACD,WAAW,EAAE,IAAI;YACjB,eAAe,EAAE,IAAI;YACrB,oBAAoB,EAAE,KAAK;SAC5B;QACD,+BAA+B,EAAE;YAC/B,KAAK,EAAE,WAAW;YAClB,QAAQ,EAAE,IAAI;YACd,MAAM,EAAE,QAAQ;YAChB,WAAW,EAAE,IAAI;YACjB,kBAAkB,EAAE,KAAK;YACzB,QAAQ,EAAE;gBACR,KAAK,EAAE,4BAA4B;gBACnC,WAAW,EAAE,yCAAyC;aACvD;YACD,SAAS,EAAE,4BAA4B;SACxC;KACwB,CAAC;AAC9B,CAAC","sourcesContent":["import { OpenAPIV3 } from \"openapi-types\";\nimport { ArkosConfig } from \"../../../../exports\";\nimport { capitalize } from \"../../../../utils/helpers/text.helpers\";\nimport portAndHostAllocator from \"../../../../utils/features/port-and-host-allocator\";\n\nexport default async function getSwaggerDefaultConfig(\n defaultModelsPaths: Record<string, any>,\n defaultJsonSchemas: OpenAPIV3.PathsObject<{}, {}>\n) {\n const portAndHost = await portAndHostAllocator.getHostAndAvailablePort({});\n\n return {\n endpoint: \"/docs\",\n mode: \"prisma\",\n strict: false,\n options: {\n definition: {\n openapi: \"3.0.0\",\n info: {\n title: \"Powered By Arkos.js\",\n version: \"1.0.0\",\n description:\n \"This API was automatically generated by Arkos.js, read more about at www.arkosjs.com\",\n },\n servers: [\n {\n url: `http://${[\"0.0.0.0\", \"localhost\", \"127.0.0.1\"].includes(portAndHost.host) ? \"localhost\" : portAndHost.host}:${portAndHost.port}`,\n description: `Local ${capitalize(process.env.NODE_ENV || \"development\")} Server`,\n },\n ],\n paths: defaultModelsPaths,\n components: {\n schemas: defaultJsonSchemas || {},\n securitySchemes: {\n BearerAuth: {\n type: \"http\",\n scheme: \"bearer\",\n bearerFormat: \"JWT\",\n },\n },\n },\n security: [],\n },\n apis: [\n \"./src/routers/*.router.{ts,js}\",\n \"./src/modules/**/*.router.{ts,js}\",\n ],\n deepLinking: true,\n tryItOutEnabled: true,\n persistAuthorization: false,\n },\n scalarApiReferenceConfiguration: {\n theme: \"deepSpace\",\n darkMode: true,\n layout: \"modern\",\n showSidebar: true,\n hideDownloadButton: false,\n metaData: {\n title: \"Arkos.js API Documentation\",\n description: \"API documentation generated by Arkos.js\",\n },\n pageTitle: \"Arkos.js API Documentation\",\n },\n } as ArkosConfig[\"swagger\"];\n}\n"]}
@@ -19,6 +19,6 @@ function killServerChildProcess() {
19
19
  (0, start_1.killProductionServerChildProcess)();
20
20
  }
21
21
  function getVersion() {
22
- return "1.4.0-canary.41";
22
+ return "1.4.0-canary.42";
23
23
  }
24
24
  //# sourceMappingURL=cli.helpers.js.map
@@ -13,12 +13,9 @@ function generateServiceTemplate(options) {
13
13
  : "base";
14
14
  let serviceName = (serviceType !== "base" ? `Arkos${modelName.pascal}` : "Base") + "Service";
15
15
  let serviceImport = imports?.[`${serviceType}Service`] || "arkos/services";
16
- const prismaImport = isTypeScript && serviceType === "base"
17
- ? `import { Prisma } from "@prisma/client";\n`
18
- : "";
19
16
  const serviceClassImport = `import { ${serviceName.startsWith("Arkos") ? `${serviceName.replace("Arkos", "")} as ${serviceName}` : serviceName} } from "${serviceImport}";`;
20
17
  const typeParameter = isTypeScript && serviceType === "base" ? `<"${modelName.kebab}">` : "";
21
- return `${serviceClassImport}${prismaImport}
18
+ return `${serviceClassImport}
22
19
 
23
20
  class ${modelName.pascal}Service extends ${serviceName}${typeParameter} {}
24
21
 
@@ -1 +1 @@
1
- {"version":3,"file":"service-template.js","sourceRoot":"","sources":["../../../../../../../src/utils/cli/utils/template-generator/templates/service-template.ts"],"names":[],"mappings":";;AAGA,0DAkCC;AArCD,+DAAsE;AAGtE,SAAgB,uBAAuB,CAAC,OAAwB;IAC9D,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IACvC,MAAM,GAAG,GAAG,IAAA,iCAAoB,GAAE,CAAC;IACnC,MAAM,YAAY,GAAG,GAAG,KAAK,IAAI,CAAC;IAElC,IAAI,CAAC,SAAS;QACZ,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;IAElE,IAAI,WAAW,GAAG,CAAC,MAAM,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,KAAK,CAAC;QACzE,CAAC,CAAC,SAAS,CAAC,KAAK;QACjB,CAAC,CAAC,MAAM,CAAC;IACX,IAAI,WAAW,GACb,CAAC,WAAW,KAAK,MAAM,CAAC,CAAC,CAAC,QAAQ,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;IAC7E,IAAI,aAAa,GACf,OAAO,EAAE,CAAC,GAAG,WAAW,SAAS,CAAC,IAAI,gBAAgB,CAAC;IAEzD,MAAM,YAAY,GAChB,YAAY,IAAI,WAAW,KAAK,MAAM;QACpC,CAAC,CAAC,4CAA4C;QAC9C,CAAC,CAAC,EAAE,CAAC;IAET,MAAM,kBAAkB,GAAG,YAAY,WAAW,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,WAAW,EAAE,CAAC,CAAC,CAAC,WAAW,YAAY,aAAa,IAAI,CAAC;IAE5K,MAAM,aAAa,GACjB,YAAY,IAAI,WAAW,KAAK,MAAM,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;IAEzE,OAAO,GAAG,kBAAkB,GAAG,YAAY;;QAErC,SAAS,CAAC,MAAM,mBAAmB,WAAW,GAAG,aAAa;;QAE9D,SAAS,CAAC,KAAK,iBAAiB,SAAS,CAAC,MAAM,WAAW,WAAW,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,SAAS,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE;;iBAEtG,SAAS,CAAC,KAAK;CAC/B,CAAC;AACF,CAAC","sourcesContent":["import { getUserFileExtension } from \"../../../../helpers/fs.helpers\";\nimport { TemplateOptions } from \"../../template-generators\";\n\nexport function generateServiceTemplate(options: TemplateOptions): string {\n const { modelName, imports } = options;\n const ext = getUserFileExtension();\n const isTypeScript = ext === \"ts\";\n\n if (!modelName)\n throw new Error(\"Module name is required for service template\");\n\n let serviceType = [\"auth\", \"fileUpload\", \"email\"].includes(modelName.camel)\n ? modelName.camel\n : \"base\";\n let serviceName: string =\n (serviceType !== \"base\" ? `Arkos${modelName.pascal}` : \"Base\") + \"Service\";\n let serviceImport: string =\n imports?.[`${serviceType}Service`] || \"arkos/services\";\n\n const prismaImport =\n isTypeScript && serviceType === \"base\"\n ? `import { Prisma } from \"@prisma/client\";\\n`\n : \"\";\n\n const serviceClassImport = `import { ${serviceName.startsWith(\"Arkos\") ? `${serviceName.replace(\"Arkos\", \"\")} as ${serviceName}` : serviceName} } from \"${serviceImport}\";`;\n\n const typeParameter =\n isTypeScript && serviceType === \"base\" ? `<\"${modelName.kebab}\">` : \"\";\n\n return `${serviceClassImport}${prismaImport}\n \nclass ${modelName.pascal}Service extends ${serviceName}${typeParameter} {}\n\nconst ${modelName.camel}Service = new ${modelName.pascal}Service(${serviceType === \"base\" ? `\"${modelName.kebab}\"` : \"\"});\n\nexport default ${modelName.camel}Service;\n`;\n}\n"]}
1
+ {"version":3,"file":"service-template.js","sourceRoot":"","sources":["../../../../../../../src/utils/cli/utils/template-generator/templates/service-template.ts"],"names":[],"mappings":";;AAGA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AAC,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE;;iBAEtG,SAAS,CAAC,KAAK;CAC/B,CAAC;AACF,CAAC","sourcesContent":["import { getUserFileExtension } from \"../../../../helpers/fs.helpers\";\nimport { TemplateOptions } from \"../../template-generators\";\n\nexport function generateServiceTemplate(options: TemplateOptions): string {\n const { modelName, imports } = options;\n const ext = getUserFileExtension();\n const isTypeScript = ext === \"ts\";\n\n if (!modelName)\n throw new Error(\"Module name is required for service template\");\n\n let serviceType = [\"auth\", \"fileUpload\", \"email\"].includes(modelName.camel)\n ? modelName.camel\n : \"base\";\n let serviceName: string =\n (serviceType !== \"base\" ? `Arkos${modelName.pascal}` : \"Base\") + \"Service\";\n let serviceImport: string =\n imports?.[`${serviceType}Service`] || \"arkos/services\";\n\n const serviceClassImport = `import { ${serviceName.startsWith(\"Arkos\") ? `${serviceName.replace(\"Arkos\", \"\")} as ${serviceName}` : serviceName} } from \"${serviceImport}\";`;\n\n const typeParameter =\n isTypeScript && serviceType === \"base\" ? `<\"${modelName.kebab}\">` : \"\";\n\n return `${serviceClassImport}\n \nclass ${modelName.pascal}Service extends ${serviceName}${typeParameter} {}\n\nconst ${modelName.camel}Service = new ${modelName.pascal}Service(${serviceType === \"base\" ? `\"${modelName.kebab}\"` : \"\"});\n\nexport default ${modelName.camel}Service;\n`;\n}\n"]}
@@ -16,7 +16,7 @@ export default async function getSwaggerDefaultConfig(defaultModelsPaths, defaul
16
16
  },
17
17
  servers: [
18
18
  {
19
- url: `http://${portAndHost.host}:${portAndHost.port}`,
19
+ url: `http://${["0.0.0.0", "localhost", "127.0.0.1"].includes(portAndHost.host) ? "localhost" : portAndHost.host}:${portAndHost.port}`,
20
20
  description: `Local ${capitalize(process.env.NODE_ENV || "development")} Server`,
21
21
  },
22
22
  ],
@@ -1 +1 @@
1
- {"version":3,"file":"get-swagger-default-configs.js","sourceRoot":"","sources":["../../../../../../src/modules/swagger/utils/helpers/get-swagger-default-configs.ts"],"names":[],"mappings":"AA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QAAQ,EAAE;gBACR,KAAK,EAAE,4BAA4B;gBACnC,WAAW,EAAE,yCAAyC;aACvD;YACD,SAAS,EAAE,4BAA4B;SACxC;KACwB,CAAC;AAC9B,CAAC","sourcesContent":["import { OpenAPIV3 } from \"openapi-types\";\nimport { ArkosConfig } from \"../../../../exports\";\nimport { capitalize } from \"../../../../utils/helpers/text.helpers\";\nimport portAndHostAllocator from \"../../../../utils/features/port-and-host-allocator\";\n\nexport default async function getSwaggerDefaultConfig(\n defaultModelsPaths: Record<string, any>,\n defaultJsonSchemas: OpenAPIV3.PathsObject<{}, {}>\n) {\n const portAndHost = await portAndHostAllocator.getHostAndAvailablePort({});\n\n return {\n endpoint: \"/docs\",\n mode: \"prisma\",\n strict: false,\n options: {\n definition: {\n openapi: \"3.0.0\",\n info: {\n title: \"Powered By Arkos.js\",\n version: \"1.0.0\",\n description:\n \"This API was automatically generated by Arkos.js, read more about at www.arkosjs.com\",\n },\n servers: [\n {\n url: `http://${portAndHost.host}:${portAndHost.port}`,\n description: `Local ${capitalize(process.env.NODE_ENV || \"development\")} Server`,\n },\n ],\n paths: defaultModelsPaths,\n components: {\n schemas: defaultJsonSchemas || {},\n securitySchemes: {\n BearerAuth: {\n type: \"http\",\n scheme: \"bearer\",\n bearerFormat: \"JWT\",\n },\n },\n },\n security: [],\n },\n apis: [\n \"./src/routers/*.router.{ts,js}\",\n \"./src/modules/**/*.router.{ts,js}\",\n ],\n deepLinking: true,\n tryItOutEnabled: true,\n persistAuthorization: false,\n },\n scalarApiReferenceConfiguration: {\n theme: \"deepSpace\",\n darkMode: true,\n layout: \"modern\",\n showSidebar: true,\n hideDownloadButton: false,\n metaData: {\n title: \"Arkos.js API Documentation\",\n description: \"API documentation generated by Arkos.js\",\n },\n pageTitle: \"Arkos.js API Documentation\",\n },\n } as ArkosConfig[\"swagger\"];\n}\n"]}
1
+ {"version":3,"file":"get-swagger-default-configs.js","sourceRoot":"","sources":["../../../../../../src/modules/swagger/utils/helpers/get-swagger-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5B;QACD,+BAA+B,EAAE;YAC/B,KAAK,EAAE,WAAW;YAClB,QAAQ,EAAE,IAAI;YACd,MAAM,EAAE,QAAQ;YAChB,WAAW,EAAE,IAAI;YACjB,kBAAkB,EAAE,KAAK;YACzB,QAAQ,EAAE;gBACR,KAAK,EAAE,4BAA4B;gBACnC,WAAW,EAAE,yCAAyC;aACvD;YACD,SAAS,EAAE,4BAA4B;SACxC;KACwB,CAAC;AAC9B,CAAC","sourcesContent":["import { OpenAPIV3 } from \"openapi-types\";\nimport { ArkosConfig } from \"../../../../exports\";\nimport { capitalize } from \"../../../../utils/helpers/text.helpers\";\nimport portAndHostAllocator from \"../../../../utils/features/port-and-host-allocator\";\n\nexport default async function getSwaggerDefaultConfig(\n defaultModelsPaths: Record<string, any>,\n defaultJsonSchemas: OpenAPIV3.PathsObject<{}, {}>\n) {\n const portAndHost = await portAndHostAllocator.getHostAndAvailablePort({});\n\n return {\n endpoint: \"/docs\",\n mode: \"prisma\",\n strict: false,\n options: {\n definition: {\n openapi: \"3.0.0\",\n info: {\n title: \"Powered By Arkos.js\",\n version: \"1.0.0\",\n description:\n \"This API was automatically generated by Arkos.js, read more about at www.arkosjs.com\",\n },\n servers: [\n {\n url: `http://${[\"0.0.0.0\", \"localhost\", \"127.0.0.1\"].includes(portAndHost.host) ? \"localhost\" : portAndHost.host}:${portAndHost.port}`,\n description: `Local ${capitalize(process.env.NODE_ENV || \"development\")} Server`,\n },\n ],\n paths: defaultModelsPaths,\n components: {\n schemas: defaultJsonSchemas || {},\n securitySchemes: {\n BearerAuth: {\n type: \"http\",\n scheme: \"bearer\",\n bearerFormat: \"JWT\",\n },\n },\n },\n security: [],\n },\n apis: [\n \"./src/routers/*.router.{ts,js}\",\n \"./src/modules/**/*.router.{ts,js}\",\n ],\n deepLinking: true,\n tryItOutEnabled: true,\n persistAuthorization: false,\n },\n scalarApiReferenceConfiguration: {\n theme: \"deepSpace\",\n darkMode: true,\n layout: \"modern\",\n showSidebar: true,\n hideDownloadButton: false,\n metaData: {\n title: \"Arkos.js API Documentation\",\n description: \"API documentation generated by Arkos.js\",\n },\n pageTitle: \"Arkos.js API Documentation\",\n },\n } as ArkosConfig[\"swagger\"];\n}\n"]}
@@ -11,6 +11,6 @@ export function killServerChildProcess() {
11
11
  killProductionServerChildProcess();
12
12
  }
13
13
  export function getVersion() {
14
- return "1.4.0-canary.41";
14
+ return "1.4.0-canary.42";
15
15
  }
16
16
  //# sourceMappingURL=cli.helpers.js.map
@@ -10,12 +10,9 @@ export function generateServiceTemplate(options) {
10
10
  : "base";
11
11
  let serviceName = (serviceType !== "base" ? `Arkos${modelName.pascal}` : "Base") + "Service";
12
12
  let serviceImport = imports?.[`${serviceType}Service`] || "arkos/services";
13
- const prismaImport = isTypeScript && serviceType === "base"
14
- ? `import { Prisma } from "@prisma/client";\n`
15
- : "";
16
13
  const serviceClassImport = `import { ${serviceName.startsWith("Arkos") ? `${serviceName.replace("Arkos", "")} as ${serviceName}` : serviceName} } from "${serviceImport}";`;
17
14
  const typeParameter = isTypeScript && serviceType === "base" ? `<"${modelName.kebab}">` : "";
18
- return `${serviceClassImport}${prismaImport}
15
+ return `${serviceClassImport}
19
16
 
20
17
  class ${modelName.pascal}Service extends ${serviceName}${typeParameter} {}
21
18
 
@@ -1 +1 @@
1
- {"version":3,"file":"service-template.js","sourceRoot":"","sources":["../../../../../../../src/utils/cli/utils/template-generator/templates/service-template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAGtE,MAAM,UAAU,uBAAuB,CAAC,OAAwB;IAC9D,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IACvC,MAAM,GAAG,GAAG,oBAAoB,EAAE,CAAC;IACnC,MAAM,YAAY,GAAG,GAAG,KAAK,IAAI,CAAC;IAElC,IAAI,CAAC,SAAS;QACZ,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;IAElE,IAAI,WAAW,GAAG,CAAC,MAAM,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,KAAK,CAAC;QACzE,CAAC,CAAC,SAAS,CAAC,KAAK;QACjB,CAAC,CAAC,MAAM,CAAC;IACX,IAAI,WAAW,GACb,CAAC,WAAW,KAAK,MAAM,CAAC,CAAC,CAAC,QAAQ,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;IAC7E,IAAI,aAAa,GACf,OAAO,EAAE,CAAC,GAAG,WAAW,SAAS,CAAC,IAAI,gBAAgB,CAAC;IAEzD,MAAM,YAAY,GAChB,YAAY,IAAI,WAAW,KAAK,MAAM;QACpC,CAAC,CAAC,4CAA4C;QAC9C,CAAC,CAAC,EAAE,CAAC;IAET,MAAM,kBAAkB,GAAG,YAAY,WAAW,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,WAAW,EAAE,CAAC,CAAC,CAAC,WAAW,YAAY,aAAa,IAAI,CAAC;IAE5K,MAAM,aAAa,GACjB,YAAY,IAAI,WAAW,KAAK,MAAM,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;IAEzE,OAAO,GAAG,kBAAkB,GAAG,YAAY;;QAErC,SAAS,CAAC,MAAM,mBAAmB,WAAW,GAAG,aAAa;;QAE9D,SAAS,CAAC,KAAK,iBAAiB,SAAS,CAAC,MAAM,WAAW,WAAW,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,SAAS,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE;;iBAEtG,SAAS,CAAC,KAAK;CAC/B,CAAC;AACF,CAAC","sourcesContent":["import { getUserFileExtension } from \"../../../../helpers/fs.helpers\";\nimport { TemplateOptions } from \"../../template-generators\";\n\nexport function generateServiceTemplate(options: TemplateOptions): string {\n const { modelName, imports } = options;\n const ext = getUserFileExtension();\n const isTypeScript = ext === \"ts\";\n\n if (!modelName)\n throw new Error(\"Module name is required for service template\");\n\n let serviceType = [\"auth\", \"fileUpload\", \"email\"].includes(modelName.camel)\n ? modelName.camel\n : \"base\";\n let serviceName: string =\n (serviceType !== \"base\" ? `Arkos${modelName.pascal}` : \"Base\") + \"Service\";\n let serviceImport: string =\n imports?.[`${serviceType}Service`] || \"arkos/services\";\n\n const prismaImport =\n isTypeScript && serviceType === \"base\"\n ? `import { Prisma } from \"@prisma/client\";\\n`\n : \"\";\n\n const serviceClassImport = `import { ${serviceName.startsWith(\"Arkos\") ? `${serviceName.replace(\"Arkos\", \"\")} as ${serviceName}` : serviceName} } from \"${serviceImport}\";`;\n\n const typeParameter =\n isTypeScript && serviceType === \"base\" ? `<\"${modelName.kebab}\">` : \"\";\n\n return `${serviceClassImport}${prismaImport}\n \nclass ${modelName.pascal}Service extends ${serviceName}${typeParameter} {}\n\nconst ${modelName.camel}Service = new ${modelName.pascal}Service(${serviceType === \"base\" ? `\"${modelName.kebab}\"` : \"\"});\n\nexport default ${modelName.camel}Service;\n`;\n}\n"]}
1
+ {"version":3,"file":"service-template.js","sourceRoot":"","sources":["../../../../../../../src/utils/cli/utils/template-generator/templates/service-template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAGtE,MAAM,UAAU,uBAAuB,CAAC,OAAwB;IAC9D,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IACvC,MAAM,GAAG,GAAG,oBAAoB,EAAE,CAAC;IACnC,MAAM,YAAY,GAAG,GAAG,KAAK,IAAI,CAAC;IAElC,IAAI,CAAC,SAAS;QACZ,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;IAElE,IAAI,WAAW,GAAG,CAAC,MAAM,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,KAAK,CAAC;QACzE,CAAC,CAAC,SAAS,CAAC,KAAK;QACjB,CAAC,CAAC,MAAM,CAAC;IACX,IAAI,WAAW,GACb,CAAC,WAAW,KAAK,MAAM,CAAC,CAAC,CAAC,QAAQ,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;IAC7E,IAAI,aAAa,GACf,OAAO,EAAE,CAAC,GAAG,WAAW,SAAS,CAAC,IAAI,gBAAgB,CAAC;IAEzD,MAAM,kBAAkB,GAAG,YAAY,WAAW,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,WAAW,EAAE,CAAC,CAAC,CAAC,WAAW,YAAY,aAAa,IAAI,CAAC;IAE5K,MAAM,aAAa,GACjB,YAAY,IAAI,WAAW,KAAK,MAAM,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;IAEzE,OAAO,GAAG,kBAAkB;;QAEtB,SAAS,CAAC,MAAM,mBAAmB,WAAW,GAAG,aAAa;;QAE9D,SAAS,CAAC,KAAK,iBAAiB,SAAS,CAAC,MAAM,WAAW,WAAW,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,SAAS,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE;;iBAEtG,SAAS,CAAC,KAAK;CAC/B,CAAC;AACF,CAAC","sourcesContent":["import { getUserFileExtension } from \"../../../../helpers/fs.helpers\";\nimport { TemplateOptions } from \"../../template-generators\";\n\nexport function generateServiceTemplate(options: TemplateOptions): string {\n const { modelName, imports } = options;\n const ext = getUserFileExtension();\n const isTypeScript = ext === \"ts\";\n\n if (!modelName)\n throw new Error(\"Module name is required for service template\");\n\n let serviceType = [\"auth\", \"fileUpload\", \"email\"].includes(modelName.camel)\n ? modelName.camel\n : \"base\";\n let serviceName: string =\n (serviceType !== \"base\" ? `Arkos${modelName.pascal}` : \"Base\") + \"Service\";\n let serviceImport: string =\n imports?.[`${serviceType}Service`] || \"arkos/services\";\n\n const serviceClassImport = `import { ${serviceName.startsWith(\"Arkos\") ? `${serviceName.replace(\"Arkos\", \"\")} as ${serviceName}` : serviceName} } from \"${serviceImport}\";`;\n\n const typeParameter =\n isTypeScript && serviceType === \"base\" ? `<\"${modelName.kebab}\">` : \"\";\n\n return `${serviceClassImport}\n \nclass ${modelName.pascal}Service extends ${serviceName}${typeParameter} {}\n\nconst ${modelName.camel}Service = new ${modelName.pascal}Service(${serviceType === \"base\" ? `\"${modelName.kebab}\"` : \"\"});\n\nexport default ${modelName.camel}Service;\n`;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arkos",
3
- "version": "1.4.0-canary.41",
3
+ "version": "1.4.0-canary.42",
4
4
  "description": "The Express & Prisma RESTful Framework",
5
5
  "main": "dist/cjs/exports/index.js",
6
6
  "module": "dist/esm/exports/index.js",