arkos 1.7.3-canary.9 → 1.7.4-rc

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.
@@ -56,7 +56,7 @@ function getSwaggerDefaultConfig(defaultModelsPaths) {
56
56
  description: "API documentation generated by Arkos.js",
57
57
  },
58
58
  pageTitle: "Arkos.js API Documentation",
59
- customCss: `.scalar-client {
59
+ customCss: `.scalar-app-client {
60
60
  width: 100vw !important;
61
61
  height: 100vh !important;
62
62
  max-width: 100vw !important;
@@ -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":";;AAGA,0CAqEC;AAxED,+CAAoD;AACpD,yEAAoE;AAEpE,SAAwB,uBAAuB,CAC7C,kBAAuC;IAEvC,MAAM,WAAW,GAAG;QAClB,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,MAAM;QACtD,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,MAAO,IAAI,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,WAAW;KAC7D,CAAC;IACF,MAAM,MAAM,GAAG,IAAA,uBAAc,GAAE,CAAC;IAEhC,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,IAAK,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,IAAI,WAAW,CAAC,IAAI,EAAE;wBACvI,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,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,CAAC,2BAA2B,EAAE,0BAA0B,CAAC;YAC/D,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,GAAG,EAAE,MAAM,CAAC,YAAY,GAAG,6CAA6C;YACxE,QAAQ,EAAE;gBACR,KAAK,EAAE,4BAA4B;gBACnC,WAAW,EAAE,yCAAyC;aACvD;YACD,SAAS,EAAE,4BAA4B;YACvC,SAAS,EAAE;;;;;;;;;EASf;SACG;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { getArkosConfig } from \"../../../../server\";\nimport { capitalize } from \"../../../../utils/helpers/text.helpers\";\n\nexport default function getSwaggerDefaultConfig(\n defaultModelsPaths: Record<string, any>\n) {\n const portAndHost = {\n port: process.env.__PORT || process.env.PORT || \"8000\",\n host: process.env.__HOST! || process.env.HOST || \"127.0.0.1\",\n };\n const config = getArkosConfig();\n\n return {\n endpoint: \"/docs\",\n mode: \"prisma\",\n strict: false,\n options: {\n definition: {\n openapi: \"3.1.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 securitySchemes: {\n BearerAuth: {\n type: \"http\",\n scheme: \"bearer\",\n bearerFormat: \"JWT\",\n },\n },\n },\n security: [],\n },\n apis: [\"./src/**/*.router.{ts,js}\", \"./src/**/*.route.{ts,js}\"],\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 cdn: config.globalPrefix + \"/scalar-api-reference/browser/standalone.js\",\n metaData: {\n title: \"Arkos.js API Documentation\",\n description: \"API documentation generated by Arkos.js\",\n },\n pageTitle: \"Arkos.js API Documentation\",\n customCss: `.scalar-client {\nwidth: 100vw !important;\nheight: 100vh !important;\nmax-width: 100vw !important;\nmax-height: 100vh !important;\ntop: 0 !important;\nleft: 0 !important;\ntransform: none !important;\nborder-radius: 0 !important;\n}`,\n },\n };\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":";;AAGA,0CAqEC;AAxED,+CAAoD;AACpD,yEAAoE;AAEpE,SAAwB,uBAAuB,CAC7C,kBAAuC;IAEvC,MAAM,WAAW,GAAG;QAClB,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,MAAM;QACtD,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,MAAO,IAAI,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,WAAW;KAC7D,CAAC;IACF,MAAM,MAAM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vD;YACD,SAAS,EAAE,4BAA4B;YACvC,SAAS,EAAE;;;;;;;;;EASf;SACG;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { getArkosConfig } from \"../../../../server\";\nimport { capitalize } from \"../../../../utils/helpers/text.helpers\";\n\nexport default function getSwaggerDefaultConfig(\n defaultModelsPaths: Record<string, any>,\n) {\n const portAndHost = {\n port: process.env.__PORT || process.env.PORT || \"8000\",\n host: process.env.__HOST! || process.env.HOST || \"127.0.0.1\",\n };\n const config = getArkosConfig();\n\n return {\n endpoint: \"/docs\",\n mode: \"prisma\",\n strict: false,\n options: {\n definition: {\n openapi: \"3.1.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 securitySchemes: {\n BearerAuth: {\n type: \"http\",\n scheme: \"bearer\",\n bearerFormat: \"JWT\",\n },\n },\n },\n security: [],\n },\n apis: [\"./src/**/*.router.{ts,js}\", \"./src/**/*.route.{ts,js}\"],\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 cdn: config.globalPrefix + \"/scalar-api-reference/browser/standalone.js\",\n metaData: {\n title: \"Arkos.js API Documentation\",\n description: \"API documentation generated by Arkos.js\",\n },\n pageTitle: \"Arkos.js API Documentation\",\n customCss: `.scalar-app-client {\nwidth: 100vw !important;\nheight: 100vh !important;\nmax-width: 100vw !important;\nmax-height: 100vh !important;\ntop: 0 !important;\nleft: 0 !important;\ntransform: none !important;\nborder-radius: 0 !important;\n}`,\n },\n };\n}\n\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"arkos-prisma-input.js","sourceRoot":"","sources":["../../../src/types/arkos-prisma-input.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Helper type to exclude properties from T that exist in U\n * Used internally by XOR to create mutually exclusive types\n */\ntype Without<T, U> = {\n [P in Exclude<keyof T, keyof U>]?: never;\n};\n/**\n * XOR (Exclusive OR) type for mutually exclusive union types\n * Ensures that properties from T and U cannot be mixed together\n * @see https://stackoverflow.com/questions/42123407/does-typescript-support-mutually-exclusive-types\n */\ntype XOR<T, U> = T extends object\n ? U extends object\n ? (Without<T, U> & U) | (Without<U, T> & T)\n : U\n : T;\ntype Unpack<T> = T;\n/**\n * Checks if a field is an array relation (one-to-many or many-to-many)\n * Identified by the presence of createMany property\n */\nexport type IsArrayRelation<T> =\n Exclude<T, undefined> extends never\n ? false\n : Exclude<T, undefined> extends { createMany?: any }\n ? true\n : false;\n/**\n * Checks if a field is an object relation (one-to-one or many-to-one)\n * Identified by the presence of relation operations without being an array\n */\nexport type IsObjectRelation<T> =\n Exclude<T, undefined> extends Array<any>\n ? false\n : Exclude<T, undefined> extends\n | {\n create?: any;\n }\n | {\n connect?: any;\n }\n | {\n connectOrCreate?: any;\n }\n | {\n update?: any;\n }\n | {\n delete?: any;\n }\n | {\n disconnect?: any;\n }\n ? true\n : false;\ntype ExtractCreateTypeArray<T> =\n Exclude<T, undefined> extends {\n create?: infer C;\n }\n ? Extract<C, Array<any>> extends Array<infer U>\n ? U extends Array<infer I>\n ? (Omit<I, \"OR\" | \"AND\" | \"NOT\"> & {\n apiAction?: \"create\";\n })[]\n : (Omit<U, \"OR\" | \"AND\" | \"NOT\"> & {\n apiAction?: \"create\";\n })[]\n : never\n : never;\ntype ExtractConnectTypeArray<\n T,\n A extends\n | \"connect\"\n | \"delete\"\n | \"update\"\n | \"disconnect\"\n | \"deleteMany\"\n | \"set\",\n> =\n Exclude<T, undefined> extends {\n [k in A]?: infer C;\n }\n ? Extract<C, Array<any>> extends Array<infer U>\n ? (Omit<U, \"OR\" | \"AND\" | \"NOT\"> & {\n apiAction?: A;\n })[]\n : never\n : never;\ntype ExtractUpdateTypeArray<T> =\n Exclude<T, undefined> extends Array<infer Item>\n ? Item extends {\n update?: infer U;\n }\n ? U extends Array<infer UpdateItem>\n ? UpdateItem extends {\n where: infer W;\n data: infer D;\n }\n ? ((W & D) & {\n apiAction?: \"update\";\n })[]\n : never\n : U extends {\n where: infer W;\n data: infer D;\n }\n ? ((W & D) & {\n apiAction?: \"update\";\n })[]\n : never\n : never\n : never;\ntype ExtractCreateTypeObject<T> =\n Exclude<T, undefined> extends {\n create?: infer C;\n }\n ? Exclude<\n Extract<Exclude<C, undefined>, object>,\n Array<any>\n > extends infer Obj\n ? Obj extends object\n ? Omit<Obj, \"OR\" | \"AND\" | \"NOT\"> & {\n apiAction?: \"create\";\n }\n : never\n : never\n : never;\ntype ExtractConnectTypeObject<\n T,\n A extends \"connect\" | \"delete\" | \"update\" | \"disconnect\",\n> =\n Exclude<T, undefined> extends {\n [k in A]?: infer C;\n }\n ? Exclude<\n Extract<Exclude<C, undefined>, object>,\n Array<any>\n > extends infer Obj\n ? Obj extends object\n ? Omit<Obj, \"OR\" | \"AND\" | \"NOT\"> & {\n apiAction?: A;\n }\n : never\n : never\n : never;\ntype ExtractUpdateTypeObject<T> =\n Exclude<T, undefined> extends {\n update?: infer U;\n }\n ? U extends {\n where: infer W;\n data: infer D;\n }\n ? (W & D) & {\n apiAction?: \"update\";\n }\n : Exclude<Extract<U, object>, Array<any>> & {\n apiAction?: \"update\";\n }\n : never;\ntype FlattenArrayRelation<T> =\n | (ExtractCreateTypeArray<T> extends never\n ? never\n : FlattenRelations<ExtractCreateTypeArray<T>>)\n | (ExtractConnectTypeArray<T, \"connect\"> extends never\n ? never\n : FlattenRelations<ExtractConnectTypeArray<T, \"connect\">>)\n | (ExtractUpdateTypeArray<T> extends never\n ? never\n : FlattenRelations<ExtractUpdateTypeArray<T>>)\n | (Exclude<T, undefined> extends Array<infer Item>\n ? Item extends {\n delete?: any;\n }\n ? FlattenRelations<ExtractConnectTypeArray<T, \"delete\">> & {\n apiAction: \"delete\";\n }\n : never\n : never)\n | (Exclude<T, undefined> extends Array<infer Item>\n ? Item extends {\n disconnect?: any;\n }\n ? FlattenRelations<ExtractConnectTypeArray<T, \"disconnect\">> & {\n apiAction: \"disconnect\";\n }\n : never\n : never)\n | (Exclude<T, undefined> extends Array<infer Item>\n ? Item extends {\n set?: infer S;\n }\n ? Unpack<S> & {\n apiAction?: \"set\";\n }\n : never\n : never)\n | (Exclude<T, undefined> extends Array<infer Item>\n ? Item extends {\n deleteMany?: any;\n }\n ? FlattenRelations<ExtractConnectTypeArray<T, \"deleteMany\">> & {\n apiAction: \"deleteMany\";\n }\n : never\n : never);\ntype FlattenObjectRelation<T> =\n | (ExtractCreateTypeObject<T> extends never\n ? never\n : FlattenRelations<ExtractCreateTypeObject<T>>)\n | (ExtractConnectTypeObject<T, \"connect\"> extends never\n ? never\n : FlattenRelations<ExtractConnectTypeObject<T, \"connect\">>)\n | (ExtractUpdateTypeObject<T> extends never\n ? never\n : FlattenRelations<ExtractUpdateTypeObject<T>>)\n | (Exclude<T, undefined> extends {\n delete?: any;\n }\n ? FlattenRelations<ExtractConnectTypeObject<T, \"delete\">> & {\n apiAction: \"delete\";\n }\n : never)\n | (Exclude<T, undefined> extends {\n disconnect?: any;\n }\n ? FlattenRelations<ExtractConnectTypeObject<T, \"disconnect\">> & {\n apiAction: \"disconnect\";\n }\n : never)\n | (Exclude<T, undefined> extends {\n set?: infer S;\n }\n ? Unpack<S> & {\n apiAction?: \"set\";\n }\n : never);\ntype StripPrismaFilters<T> = T extends\n | { equals?: any }\n | { in?: any }\n | { notIn?: any }\n | { lt?: any }\n | { lte?: any }\n | { gt?: any }\n | { gte?: any }\n | { AND?: any }\n | { OR?: any }\n | { NOT?: any }\n ? Omit<\n T,\n | \"equals\"\n | \"in\"\n | \"notIn\"\n | \"lt\"\n | \"lte\"\n | \"gt\"\n | \"gte\"\n | \"AND\"\n | \"OR\"\n | \"NOT\"\n >\n : T;\n\ntype StripToScalar<T> = T extends\n | string\n | number\n | boolean\n | Date\n | null\n | undefined\n ? T\n : never;\n\ntype FlattenRelations<T> = {\n [K in keyof T]: IsArrayRelation<T[K]> extends true\n ? FlattenArrayRelation<T[K]> | undefined\n : IsObjectRelation<T[K]> extends true\n ? XOR<FlattenObjectRelation<T[K]> | undefined, T[K]>\n : StripPrismaFilters<T[K]> extends never\n ? never\n : T[K] extends object\n ? T[K] extends Date | null | undefined\n ? T[K]\n : FlattenRelations<StripPrismaFilters<T[K]>> | undefined\n : StripToScalar<T[K]> extends never\n ? StripPrismaFilters<T[K]>\n : StripToScalar<T[K]>;\n};\n/**\n * Flattens Prisma relation inputs into a simpler, developer-friendly format\n *\n * Transforms Prisma's nested relation format:\n * ```typescript\n * { posts: { create: [...], connect: [...], update: [...] } }\n * ```\n *\n * Into a flattened format with optional apiAction discriminators:\n * ```typescript\n * { posts: [\n * { title: \"New Post\" }, // auto-detected as create\n * { id: 1 }, // auto-detected as connect\n * { id: 2, title: \"Updated\", apiAction: \"update\" }\n * ]}\n * ```\n *\n * @see {@link https://wwww.arkosjs.com/docs/reference/arkos-prisma-input}\n * @template T - The Prisma input type (e.g., Prisma.UserCreateInput)\n * @returns A flattened version of the input type with simplified relation handling\n */\nexport type ArkosPrismaInput<T> = FlattenRelations<T>;\n"]}
1
+ {"version":3,"file":"arkos-prisma-input.js","sourceRoot":"","sources":["../../../src/types/arkos-prisma-input.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Helper type to exclude properties from T that exist in U\n * Used internally by XOR to create mutually exclusive types\n */\ntype Without<T, U> = {\n [P in Exclude<keyof T, keyof U>]?: never;\n};\n/**\n * XOR (Exclusive OR) type for mutually exclusive union types\n * Ensures that properties from T and U cannot be mixed together\n * @see https://stackoverflow.com/questions/42123407/does-typescript-support-mutually-exclusive-types\n */\ntype XOR<T, U> = T extends object\n ? U extends object\n ? (Without<T, U> & U) | (Without<U, T> & T)\n : U\n : T;\ntype Unpack<T> = T;\n/**\n * Checks if a field is an array relation (one-to-many or many-to-many)\n * Identified by the presence of createMany property\n */\nexport type IsArrayRelation<T> = Exclude<T, undefined> extends never\n ? false\n : Exclude<T, undefined> extends { connect?: infer C; }\n ? (Extract<Exclude<C, undefined>, any[]> extends never ? false : true)\n : Exclude<T, undefined> extends { createMany?: any; }\n ? true\n : false;\n/**\n * Checks if a field is an object relation (one-to-one or many-to-one)\n * Identified by the presence of relation operations without being an array\n */\nexport type IsObjectRelation<T> =\n Exclude<T, undefined> extends Array<any>\n ? false\n : Exclude<T, undefined> extends\n | {\n create?: any;\n }\n | {\n connect?: any;\n }\n | {\n connectOrCreate?: any;\n }\n | {\n update?: any;\n }\n | {\n delete?: any;\n }\n | {\n disconnect?: any;\n }\n ? true\n : false;\ntype ExtractCreateTypeArray<T> =\n Exclude<T, undefined> extends {\n create?: infer C;\n }\n ? Extract<C, Array<any>> extends Array<infer U>\n ? U extends Array<infer I>\n ? (Omit<I, \"OR\" | \"AND\" | \"NOT\"> & {\n apiAction?: \"create\";\n })[]\n : (Omit<U, \"OR\" | \"AND\" | \"NOT\"> & {\n apiAction?: \"create\";\n })[]\n : never\n : never;\ntype ExtractConnectTypeArray<\n T,\n A extends\n | \"connect\"\n | \"delete\"\n | \"update\"\n | \"disconnect\"\n | \"deleteMany\"\n | \"set\",\n> =\n Exclude<T, undefined> extends {\n [k in A]?: infer C;\n }\n ? Extract<C, Array<any>> extends Array<infer U>\n ? (Omit<U, \"OR\" | \"AND\" | \"NOT\"> & {\n apiAction?: A;\n })[]\n : never\n : never;\ntype ExtractUpdateTypeArray<T> =\n Exclude<T, undefined> extends Array<infer Item>\n ? Item extends {\n update?: infer U;\n }\n ? U extends Array<infer UpdateItem>\n ? UpdateItem extends {\n where: infer W;\n data: infer D;\n }\n ? ((W & D) & {\n apiAction?: \"update\";\n })[]\n : never\n : U extends {\n where: infer W;\n data: infer D;\n }\n ? ((W & D) & {\n apiAction?: \"update\";\n })[]\n : never\n : never\n : never;\ntype ExtractCreateTypeObject<T> =\n Exclude<T, undefined> extends {\n create?: infer C;\n }\n ? Exclude<\n Extract<Exclude<C, undefined>, object>,\n Array<any>\n > extends infer Obj\n ? Obj extends object\n ? Omit<Obj, \"OR\" | \"AND\" | \"NOT\"> & {\n apiAction?: \"create\";\n }\n : never\n : never\n : never;\ntype ExtractConnectTypeObject<\n T,\n A extends \"connect\" | \"delete\" | \"update\" | \"disconnect\",\n> =\n Exclude<T, undefined> extends {\n [k in A]?: infer C;\n }\n ? Exclude<\n Extract<Exclude<C, undefined>, object>,\n Array<any>\n > extends infer Obj\n ? Obj extends object\n ? Omit<Obj, \"OR\" | \"AND\" | \"NOT\"> & {\n apiAction?: A;\n }\n : never\n : never\n : never;\ntype ExtractUpdateTypeObject<T> =\n Exclude<T, undefined> extends {\n update?: infer U;\n }\n ? U extends {\n where: infer W;\n data: infer D;\n }\n ? (W & D) & {\n apiAction?: \"update\";\n }\n : Exclude<Extract<U, object>, Array<any>> & {\n apiAction?: \"update\";\n }\n : never;\ntype FlattenArrayRelation<T> =\n | (ExtractCreateTypeArray<T> extends never\n ? never\n : FlattenRelations<ExtractCreateTypeArray<T>>)\n | (ExtractConnectTypeArray<T, \"connect\"> extends never\n ? never\n : FlattenRelations<ExtractConnectTypeArray<T, \"connect\">>)\n | (ExtractUpdateTypeArray<T> extends never\n ? never\n : FlattenRelations<ExtractUpdateTypeArray<T>>)\n | (Exclude<T, undefined> extends Array<infer Item>\n ? Item extends {\n delete?: any;\n }\n ? FlattenRelations<ExtractConnectTypeArray<T, \"delete\">> & {\n apiAction: \"delete\";\n }\n : never\n : never)\n | (Exclude<T, undefined> extends Array<infer Item>\n ? Item extends {\n disconnect?: any;\n }\n ? FlattenRelations<ExtractConnectTypeArray<T, \"disconnect\">> & {\n apiAction: \"disconnect\";\n }\n : never\n : never)\n | (Exclude<T, undefined> extends Array<infer Item>\n ? Item extends {\n set?: infer S;\n }\n ? Unpack<S> & {\n apiAction?: \"set\";\n }\n : never\n : never)\n | (Exclude<T, undefined> extends Array<infer Item>\n ? Item extends {\n deleteMany?: any;\n }\n ? FlattenRelations<ExtractConnectTypeArray<T, \"deleteMany\">> & {\n apiAction: \"deleteMany\";\n }\n : never\n : never);\ntype FlattenObjectRelation<T> =\n | (ExtractCreateTypeObject<T> extends never\n ? never\n : FlattenRelations<ExtractCreateTypeObject<T>>)\n | (ExtractConnectTypeObject<T, \"connect\"> extends never\n ? never\n : FlattenRelations<ExtractConnectTypeObject<T, \"connect\">>)\n | (ExtractUpdateTypeObject<T> extends never\n ? never\n : FlattenRelations<ExtractUpdateTypeObject<T>>)\n | (Exclude<T, undefined> extends {\n delete?: any;\n }\n ? FlattenRelations<ExtractConnectTypeObject<T, \"delete\">> & {\n apiAction: \"delete\";\n }\n : never)\n | (Exclude<T, undefined> extends {\n disconnect?: any;\n }\n ? FlattenRelations<ExtractConnectTypeObject<T, \"disconnect\">> & {\n apiAction: \"disconnect\";\n }\n : never)\n | (Exclude<T, undefined> extends {\n set?: infer S;\n }\n ? Unpack<S> & {\n apiAction?: \"set\";\n }\n : never);\ntype StripPrismaFilters<T> = T extends\n | { equals?: any; }\n | { in?: any; }\n | { notIn?: any; }\n | { lt?: any; }\n | { lte?: any; }\n | { gt?: any; }\n | { gte?: any; }\n | { AND?: any; }\n | { OR?: any; }\n | { NOT?: any; }\n ? Omit<\n T,\n | \"equals\"\n | \"in\"\n | \"notIn\"\n | \"lt\"\n | \"lte\"\n | \"gt\"\n | \"gte\"\n | \"AND\"\n | \"OR\"\n | \"NOT\"\n >\n : T;\n\ntype ScalarValue = string | number | boolean | Date | null | undefined;\ntype StripToScalar<T> = T extends Array<ScalarValue> ? T : T extends ScalarValue ? T : never;\n\ntype FlattenRelations<T> = {\n [K in keyof T]: IsArrayRelation<T[K]> extends true\n ? FlattenArrayRelation<T[K]> | undefined\n : IsObjectRelation<T[K]> extends true\n ? XOR<FlattenObjectRelation<T[K]> | undefined, T[K]>\n : StripPrismaFilters<T[K]> extends never\n ? never\n : T[K] extends object\n ? T[K] extends Date | null | undefined\n ? T[K]\n : FlattenRelations<StripPrismaFilters<T[K]>> | undefined\n : StripToScalar<T[K]> extends never\n ? StripPrismaFilters<T[K]>\n : StripToScalar<T[K]>;\n};\n/**\n * Flattens Prisma relation inputs into a simpler, developer-friendly format\n *\n * Transforms Prisma's nested relation format:\n * ```typescript\n * { posts: { create: [...], connect: [...], update: [...] } }\n * ```\n *\n * Into a flattened format with optional apiAction discriminators:\n * ```typescript\n * { posts: [\n * { title: \"New Post\" }, // auto-detected as create\n * { id: 1 }, // auto-detected as connect\n * { id: 2, title: \"Updated\", apiAction: \"update\" }\n * ]}\n * ```\n *\n * @see {@link https://wwww.arkosjs.com/docs/reference/arkos-prisma-input}\n * @template T - The Prisma input type (e.g., Prisma.UserCreateInput)\n * @returns A flattened version of the input type with simplified relation handling\n */\nexport type ArkosPrismaInput<T> = FlattenRelations<T>;\n"]}
@@ -19,6 +19,6 @@ function killServerChildProcess() {
19
19
  (0, start_1.killProductionServerChildProcess)();
20
20
  }
21
21
  function getVersion() {
22
- return "1.7.3-canary.9";
22
+ return "1.7.4-rc";
23
23
  }
24
24
  //# sourceMappingURL=cli.helpers.js.map
@@ -20,15 +20,14 @@ function generateRouterTemplate(options) {
20
20
  const routerConfigTsTypeImport = ext === "ts" ? "import { RouteHook } from 'arkos'" : "";
21
21
  const routeConfig = isNormalModule
22
22
  ? `
23
- export const hook${routerConfigTsType} = { }
24
- `
23
+ export const hook${routerConfigTsType} = { }`
25
24
  : "";
26
25
  return `import { ArkosRouter } from 'arkos';${modelName.kebab === "file-upload" ? "\nimport config from '../../arkos.config.js'" : ""}
27
26
  ${routerConfigTsTypeImport}
28
27
  ${routeConfig}
29
28
 
30
29
  const ${modelName.camel}Router = ArkosRouter({
31
- openapi: { tags: ["${(0, pluralize_1.default)((0, text_helpers_1.capitalize)(modelName.kebab.replaceAll("-", " ")))}"] }
30
+ openapi: { tags: ["${modelName.kebab === "auth" ? "Authentication" : (0, pluralize_1.default)((0, text_helpers_1.capitalize)(modelName.kebab.replaceAll("-", " ")))}"] }
32
31
  })
33
32
 
34
33
  export default ${modelName.camel}Router
@@ -1 +1 @@
1
- {"version":3,"file":"router-template.js","sourceRoot":"","sources":["../../../../../../../src/utils/cli/utils/template-generator/templates/router-template.ts"],"names":[],"mappings":";;;;;AAMA,wDAiCC;AAvCD,0DAAkC;AAClC,+DAAsE;AACtE,gDAAsD;AAEtD,mEAA8D;AAE9D,SAAgB,sBAAsB,CAAC,OAAwB;IAC7D,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;IAE9B,IAAI,CAAC,SAAS;QACZ,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;IAEjE,MAAM,cAAc,GAAG,CAAC,GAAG,4BAAiB,EAAE,aAAa,EAAE,MAAM,CAAC,CAAC,QAAQ,CAC3E,SAAS,CAAC,KAAK,CAChB,CAAC;IACF,MAAM,GAAG,GAAG,IAAA,iCAAoB,GAAE,CAAC;IAEnC,MAAM,kBAAkB,GACtB,GAAG,KAAK,IAAI;QACV,CAAC,CAAC,eAAe,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,SAAS,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,UAAU,GAAG;QAC3G,CAAC,CAAC,EAAE,CAAC;IACT,MAAM,wBAAwB,GAC5B,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,mCAAmC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC1D,MAAM,WAAW,GAAG,cAAc;QAChC,CAAC,CAAC;mBACa,kBAAkB;CACpC;QACG,CAAC,CAAC,EAAE,CAAC;IAEP,OAAO,uCAAuC,SAAS,CAAC,KAAK,KAAK,aAAa,CAAC,CAAC,CAAC,2CAA2C,CAAC,CAAC,CAAC,EAAE;EAClI,wBAAwB;EACxB,WAAW;;QAEL,SAAS,CAAC,KAAK;uBACA,IAAA,mBAAS,EAAC,IAAA,yBAAU,EAAC,SAAS,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;;;iBAGjE,SAAS,CAAC,KAAK;CAC/B,CAAC;AACF,CAAC","sourcesContent":["import pluralize from \"pluralize\";\nimport { getUserFileExtension } from \"../../../../helpers/fs.helpers\";\nimport { kebabPrismaModels } from \"../../../generate\";\nimport { TemplateOptions } from \"../../template-generators\";\nimport { capitalize } from \"../../../../helpers/text.helpers\";\n\nexport function generateRouterTemplate(options: TemplateOptions): string {\n const { modelName } = options;\n\n if (!modelName)\n throw new Error(\"Module name is required for router template\");\n\n const isNormalModule = [...kebabPrismaModels, \"file-upload\", \"auth\"].includes(\n modelName.kebab\n );\n const ext = getUserFileExtension();\n\n const routerConfigTsType =\n ext === \"ts\"\n ? `: RouteHook<${[\"file-upload\", \"auth\"].includes(modelName.kebab) ? `\"${modelName.kebab}\"` : '\"prisma\"'}>`\n : \"\";\n const routerConfigTsTypeImport =\n ext === \"ts\" ? \"import { RouteHook } from 'arkos'\" : \"\";\n const routeConfig = isNormalModule\n ? `\nexport const hook${routerConfigTsType} = { }\n`\n : \"\";\n\n return `import { ArkosRouter } from 'arkos';${modelName.kebab === \"file-upload\" ? \"\\nimport config from '../../arkos.config'\" : \"\"}\n${routerConfigTsTypeImport}\n${routeConfig}\n\nconst ${modelName.camel}Router = ArkosRouter({ \n openapi: { tags: [\"${pluralize(capitalize(modelName.kebab.replaceAll(\"-\", \" \")))}\"] }\n})\n\nexport default ${modelName.camel}Router\n`;\n}\n"]}
1
+ {"version":3,"file":"router-template.js","sourceRoot":"","sources":["../../../../../../../src/utils/cli/utils/template-generator/templates/router-template.ts"],"names":[],"mappings":";;;;;AAMA,wDAgCC;AAtCD,0DAAkC;AAClC,+DAAsE;AACtE,gDAAsD;AAEtD,mE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Extension } from \"../../../../helpers/fs.helpers\";\nimport { kebabPrismaModels } from \"../../../generate\";\nimport { TemplateOptions } from \"../../template-generators\";\nimport { capitalize } from \"../../../../helpers/text.helpers\";\n\nexport function generateRouterTemplate(options: TemplateOptions): string {\n const { modelName } = options;\n\n if (!modelName)\n throw new Error(\"Module name is required for router template\");\n\n const isNormalModule = [...kebabPrismaModels, \"file-upload\", \"auth\"].includes(\n modelName.kebab,\n );\n const ext = getUserFileExtension();\n\n const routerConfigTsType =\n ext === \"ts\"\n ? `: RouteHook<${[\"file-upload\", \"auth\"].includes(modelName.kebab) ? `\"${modelName.kebab}\"` : '\"prisma\"'}>`\n : \"\";\n const routerConfigTsTypeImport =\n ext === \"ts\" ? \"import { RouteHook } from 'arkos'\" : \"\";\n const routeConfig = isNormalModule\n ? `\nexport const hook${routerConfigTsType} = { }`\n : \"\";\n\n return `import { ArkosRouter } from 'arkos';${modelName.kebab === \"file-upload\" ? \"\\nimport config from '../../arkos.config'\" : \"\"}\n${routerConfigTsTypeImport}\n${routeConfig}\n\nconst ${modelName.camel}Router = ArkosRouter({ \n openapi: { tags: [\"${modelName.kebab === \"auth\" ? \"Authentication\" : pluralize(capitalize(modelName.kebab.replaceAll(\"-\", \" \")))}\"] }\n})\n\nexport default ${modelName.camel}Router\n`;\n}\n\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"arkos-config.helpers.js","sourceRoot":"","sources":["../../../../src/utils/helpers/arkos-config.helpers.ts"],"names":[],"mappings":";;;;;AAUA,0CA2BC;AAED,sDAIC;AAED,0DAIC;AAOD,wCA4BC;AAOD,oCAEC;AAED,kDAuBC;AAtHD,oDAAiE;AACjE,mDAA2B;AAC3B,8DAAqC;AACrC,6CAAyD;AACzD,qDAAqD;AACrD,qDAA+C;AAC/C,sDAA6D;AAE7D,IAAI,kBAAuB,CAAC;AAE5B,SAAgB,eAAe;IAC7B,IAAA,yCAAwB,GAAE,CAAC;IAC3B,MAAM,cAAc,GAAG,gBAAgB,IAAA,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,QAAQ,EAAE,cAAc,EAAE;QAC9B,CAAC,CAAE,kBAA0B,EAAE,OAAO,IAAI,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAC;IAC3E,MAAM,UAAU,GAAG,gBAAgB,IAAA,iCAAoB,GAAE,EAAE,CAAC;IAE5D,IACG,MAAc,CAAC,QAAQ,KAAK,cAAc;QAC3C,OAAO,IAAI,IAAI,WAAW;QAC1B,OAAO,kBAAkB,KAAK,QAAQ,EACtC,CAAC;QACD,cAAI,CAAC,KAAK,CACR,0BAA0B,UAAU,8GAA8G,UAAU;;;;;;;CAOjK,CACI,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,OAAO,IAAA,4BAAY,EAAC,MAAM,CAAQ,CAAC;AACrC,CAAC;AAOD,SAAgB,YAAY;IAC1B,OAAO,OAAO,CAAC,GAAG,CAAC,WAAW,KAAK,MAAM,CAAC;AAC5C,CAAC;AAED,SAAgB,mBAAmB;IACjC,MAAM,MAAM,GAAG,cAAc,EAAE,CAAC;IAChC,MAAM,qBAAqB,GAAG,uBAAuB,EAAE,CAAC;IAExD,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU;QAC7B,MAAM,IAAA,oBAAS,EACb,gHAAgH,CACjH,CAAC;IAEJ,IACE,qBAAqB;QACrB,YAAY,EAAE;QACd,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU;QACvB,CAAC,MAAM,CAAC,cAAc,EAAE,GAAG,EAAE,MAAM;QAEnC,MAAM,IAAA,oBAAS,EACb,qHAAqH,CACtH,CAAC;IAEJ,IAAI,qBAAqB,IAAI,CAAC,IAAA,kCAAiB,GAAE;QAC/C,MAAM,IAAA,oBAAS,EACb,2LAA2L,CAC5L,CAAC;AACN,CAAC","sourcesContent":["import { defineConfig, UserArkosConfig } from \"../define-config\";\nimport sheu from \"../sheu\";\nimport ExitError from \"./exit-error\";\nimport { crd, getUserFileExtension } from './fs.helpers';\nimport { getPrismaInstance } from \"./prisma.helpers\";\nimport { userRequire } from './global.helpers';\nimport { loadEnvironmentVariables } from '../dotenv.helpers';\n\nlet definedArkosConfig: any;\n\nexport function readArkosConfig() {\n loadEnvironmentVariables();\n const configFilename = `arkos.config.${getUserFileExtension()}`;\n const configPath = `${crd()}/${configFilename}`;\n try {\n let requireFunc: Function;\n if (typeof jest !== \"undefined\")\n requireFunc = () => ({});\n else if (typeof require !== \"undefined\") {\n requireFunc = require;\n } else {\n requireFunc = userRequire;\n }\n definedArkosConfig = requireFunc(configPath);\n } catch (err: any) {\n if (err.message.toLowerCase().includes(`${configFilename}`)) {\n definedArkosConfig = {};\n sheu.warn(\n `Using default configs, because ${configFilename} was not found`,\n {\n timestamp: true,\n }\n );\n } else {\n throw err;\n }\n }\n}\n\nexport function isUsingAuthentication() {\n const { authentication } = getArkosConfig();\n\n return authentication?.mode;\n}\n\nexport function isAuthenticationEnabled() {\n const { authentication } = getArkosConfig();\n\n return authentication?.mode && authentication?.enabled !== false;\n}\n\n/**\n * Gives access to the underlying current configurations being used by **Arkos** by default and also loaded through `arkos.config.{ts|js}`\n *\n * @returns {ArkosConfig}\n */\nexport function getArkosConfig(): UserArkosConfig {\n if (definedArkosConfig === undefined) readArkosConfig();\n\n const config =\n typeof definedArkosConfig === \"string\"\n ? { __loader: \"defineConfig\" }\n : (definedArkosConfig as any)?.default || { __loader: \"defineConfig\" };\n const configFile = `arkos.config.${getUserFileExtension()}`;\n\n if (\n (config as any).__loader !== \"defineConfig\" &&\n typeof jest == \"undefined\" &&\n typeof definedArkosConfig === \"object\"\n ) {\n sheu.error(\n `From v1.6 config under ${configFile} must be wrapped in \\`defineConfig()\\` function from \\`arkos/config\\`. You can do the following under your ${configFile}:\n\nimport { defineConfig } from \"arkos/config\"\n\nconst config = defineConfig({ ... })\n\nexport default config\n`\n );\n process.exit(1);\n }\n\n return defineConfig(config) as any;\n}\n\n/**\n * Returns true if application is being run through `arkos start` after `arkos build`\n *\n * @since 1.5.16-beta\n */\nexport function isProduction() {\n return process.env.ARKOS_BUILD === \"true\";\n}\n\nexport function validateArkosConfig() {\n const config = getArkosConfig();\n const authenticationEnabled = isAuthenticationEnabled();\n\n if (!config?.source?.entryPoint)\n throw ExitError(\n `Invalid value for 'arkosConfig.source.entryPoint', please pass a valid path from the current working directory`\n );\n\n if (\n authenticationEnabled &&\n isProduction() &&\n !process.env.JWT_SECRET &&\n !config.authentication?.jwt?.secret\n )\n throw ExitError(\n `Missing jwt secret in production, see https://www.arkosjs.com/docs/core-concepts/authentication/setup#configuration`\n );\n\n if (authenticationEnabled && !getPrismaInstance())\n throw ExitError(\n `Arkos' authentication system relies on prisma instance, please disabled your authentication or see https://www.arkosjs.com/docs/core-concepts/prisma-orm/setup to setup a prisma instance`\n );\n}\n"]}
1
+ {"version":3,"file":"arkos-config.helpers.js","sourceRoot":"","sources":["../../../../src/utils/helpers/arkos-config.helpers.ts"],"names":[],"mappings":";;;;;AAUA,0CA2BC;AAED,sDAIC;AAED,0DAIC;AAOD,wCA4BC;AAOD,oCAEC;AAED,kDAuBC;AAtHD,oDAAiE;AACjE,mDAA2B;AAC3B,8DAAqC;AACrC,6CAAyD;AACzD,qDAAqD;AACrD,qDAA+C;AAC/C,sDAA6D;AAE7D,IAAI,kBAAuB,CAAC;AAE5B,SAAgB,eAAe;IAC7B,IAAA,yCAAwB,GAAE,CAAC;IAC3B,MAAM,cAAc,GAAG,gBAAgB,IAAA,iCAAoB,GAAE,EAAE,CAAC;IAChE,MAAM,UAAU,GAAG,GAAG,IAAA,gBAAG,GAAE,IAAI,cAAc,EAAE,CAAC;IAChD,IAAI,CAAC;QACH,IAAI,WAAqB,CAAC;QAC1B,IAAI,OAAO,IAAI,KAAK,WAAW;YAC7B,WAAW,GAAG,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;aACtB,IAAI,OAAO,OAAO,KAAK,WAAW,EAAE,CAAC;YACxC,WAAW,GAAG,OAAO,CAAC;QACxB,CAAC;aAAM,CAAC;YAC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G,UAAU;;;;;;;CAOjK,CACI,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,OAAO,IAAA,4BAAY,EAAC,MAAM,CAAQ,CAAC;AACrC,CAAC;AAOD,SAAgB,YAAY;IAC1B,OAAO,OAAO,CAAC,GAAG,CAAC,WAAW,KAAK,MAAM,CAAC;AAC5C,CAAC;AAED,SAAgB,mBAAmB;IACjC,MAAM,MAAM,GAAG,cAAc,EAAE,CAAC;IAChC,MAAM,qBAAqB,GAAG,uBAAuB,EAAE,CAAC;IAExD,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU;QAC7B,MAAM,IAAA,oBAAS,EACb,gHAAgH,CACjH,CAAC;IAEJ,IACE,qBAAqB;QACrB,YAAY,EAAE;QACd,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU;QACvB,CAAC,MAAM,CAAC,cAAc,EAAE,GAAG,EAAE,MAAM;QAEnC,MAAM,IAAA,oBAAS,EACb,qHAAqH,CACtH,CAAC;IAEJ,IAAI,qBAAqB,IAAI,CAAC,IAAA,kCAAiB,GAAE;QAC/C,MAAM,IAAA,oBAAS,EACb,2LAA2L,CAC5L,CAAC;AACN,CAAC","sourcesContent":["import { defineConfig, UserArkosConfig } from \"../define-config\";\nimport sheu from \"../sheu\";\nimport ExitError from \"./exit-error\";\nimport { crd, getUserFileExtension } from './fs.helpers';\nimport { getPrismaInstance } from \"./prisma.helpers\";\nimport { userRequire } from './global.helpers';\nimport { loadEnvironmentVariables } from '../dotenv.helpers';\n\nlet definedArkosConfig: any;\n\nexport function readArkosConfig() {\n loadEnvironmentVariables();\n const configFilename = `arkos.config.${getUserFileExtension()}`;\n const configPath = `${crd()}/${configFilename}`;\n try {\n let requireFunc: Function;\n if (typeof jest !== \"undefined\")\n requireFunc = () => ({});\n else if (typeof require !== \"undefined\") {\n requireFunc = require;\n } else {\n requireFunc = userRequire;\n }\n definedArkosConfig = requireFunc(configPath);\n } catch (err: any) {\n if (err.message.toLowerCase().includes(`${configFilename}`)) {\n definedArkosConfig = {};\n sheu.warn(\n `Using default configs, because ${configFilename} was not found`,\n {\n timestamp: true,\n }\n );\n } else {\n throw err;\n }\n }\n}\n\nexport function isUsingAuthentication() {\n const { authentication } = getArkosConfig();\n\n return authentication?.mode;\n}\n\nexport function isAuthenticationEnabled() {\n const { authentication } = getArkosConfig();\n\n return authentication?.mode && authentication?.enabled !== false;\n}\n\n/**\n * Gives access to the underlying current configurations being used by **Arkos** by default and also loaded through `arkos.config.{ts|js}`\n *\n * @returns {ArkosConfig}\n */\nexport function getArkosConfig(): UserArkosConfig {\n if (definedArkosConfig === undefined) readArkosConfig();\n\n const config =\n typeof definedArkosConfig === \"string\"\n ? { __loader: \"defineConfig\" }\n : (definedArkosConfig as any)?.default || { __loader: \"defineConfig\" };\n const configFile = `arkos.config.${getUserFileExtension()}`;\n\n if (\n (config as any).__loader !== \"defineConfig\" &&\n typeof jest == \"undefined\" &&\n typeof definedArkosConfig === \"object\"\n ) {\n sheu.error(\n `From v1.6 config under ${configFile} must be wrapped in \\`defineConfig()\\` function from \\`arkos/config\\`. You can do the following under your ${configFile}:\n\nimport { defineConfig } from \"arkos/config\"\n\nconst config = defineConfig({ ... })\n\nexport default config\n`\n );\n process.exit(1);\n }\n\n return defineConfig(config) as any;\n}\n\n/**\n * Returns true if application is being run through `arkos start` after `arkos build`\n *\n * @since 1.5.16-beta\n */\nexport function isProduction() {\n return process.env.ARKOS_BUILD === \"true\";\n}\n\nexport function validateArkosConfig() {\n const config = getArkosConfig();\n const authenticationEnabled = isAuthenticationEnabled();\n\n if (!config?.source?.entryPoint)\n throw ExitError(\n `Invalid value for 'arkosConfig.source.entryPoint', please pass a valid path from the current working directory`\n );\n\n if (\n authenticationEnabled &&\n isProduction() &&\n !process.env.JWT_SECRET &&\n !config.authentication?.jwt?.secret\n )\n throw ExitError(\n `Missing jwt secret in production, see https://www.arkosjs.com/docs/core-concepts/authentication/setup#configuration`\n );\n\n if (authenticationEnabled && !getPrismaInstance())\n throw ExitError(\n `Arkos' authentication system relies on prisma instance, please disabled your authentication or see https://www.arkosjs.com/docs/core-concepts/prisma-orm/setup to setup a prisma instance`\n );\n}\n\n"]}
@@ -53,7 +53,7 @@ export default function getSwaggerDefaultConfig(defaultModelsPaths) {
53
53
  description: "API documentation generated by Arkos.js",
54
54
  },
55
55
  pageTitle: "Arkos.js API Documentation",
56
- customCss: `.scalar-client {
56
+ customCss: `.scalar-app-client {
57
57
  width: 100vw !important;
58
58
  height: 100vh !important;
59
59
  max-width: 100vw !important;
@@ -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":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAEpE,MAAM,CAAC,OAAO,UAAU,uBAAuB,CAC7C,kBAAuC;IAEvC,MAAM,WAAW,GAAG;QAClB,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,MAAM;QACtD,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,MAAO,IAAI,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,WAAW;KAC7D,CAAC;IACF,MAAM,MAAM,GAAG,cAAc,EAAE,CAAC;IAEhC,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,IAAK,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,IAAI,WAAW,CAAC,IAAI,EAAE;wBACvI,WAAW,EAAE,SAAS,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAC,SAAS;qBACjF;iBACF;gBACD,KAAK,EAAE,kBAAkB;gBACzB,UAAU,EAAE;oBACV,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,CAAC,2BAA2B,EAAE,0BAA0B,CAAC;YAC/D,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,GAAG,EAAE,MAAM,CAAC,YAAY,GAAG,6CAA6C;YACxE,QAAQ,EAAE;gBACR,KAAK,EAAE,4BAA4B;gBACnC,WAAW,EAAE,yCAAyC;aACvD;YACD,SAAS,EAAE,4BAA4B;YACvC,SAAS,EAAE;;;;;;;;;EASf;SACG;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { getArkosConfig } from \"../../../../server\";\nimport { capitalize } from \"../../../../utils/helpers/text.helpers\";\n\nexport default function getSwaggerDefaultConfig(\n defaultModelsPaths: Record<string, any>\n) {\n const portAndHost = {\n port: process.env.__PORT || process.env.PORT || \"8000\",\n host: process.env.__HOST! || process.env.HOST || \"127.0.0.1\",\n };\n const config = getArkosConfig();\n\n return {\n endpoint: \"/docs\",\n mode: \"prisma\",\n strict: false,\n options: {\n definition: {\n openapi: \"3.1.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 securitySchemes: {\n BearerAuth: {\n type: \"http\",\n scheme: \"bearer\",\n bearerFormat: \"JWT\",\n },\n },\n },\n security: [],\n },\n apis: [\"./src/**/*.router.{ts,js}\", \"./src/**/*.route.{ts,js}\"],\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 cdn: config.globalPrefix + \"/scalar-api-reference/browser/standalone.js\",\n metaData: {\n title: \"Arkos.js API Documentation\",\n description: \"API documentation generated by Arkos.js\",\n },\n pageTitle: \"Arkos.js API Documentation\",\n customCss: `.scalar-client {\nwidth: 100vw !important;\nheight: 100vh !important;\nmax-width: 100vw !important;\nmax-height: 100vh !important;\ntop: 0 !important;\nleft: 0 !important;\ntransform: none !important;\nborder-radius: 0 !important;\n}`,\n },\n };\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":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAEpE,MAAM,CAAC,OAAO,UAAU,uBAAuB,CAC7C,kBAAuC;IAEvC,MAAM,WAAW,GAAG;QAClB,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,MAAM,IAAI,OAAO,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kBAAkB,EAAE,KAAK;YACzB,GAAG,EAAE,MAAM,CAAC,YAAY,GAAG,6CAA6C;YACxE,QAAQ,EAAE;gBACR,KAAK,EAAE,4BAA4B;gBACnC,WAAW,EAAE,yCAAyC;aACvD;YACD,SAAS,EAAE,4BAA4B;YACvC,SAAS,EAAE;;;;;;;;;EASf;SACG;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { getArkosConfig } from \"../../../../server\";\nimport { capitalize } from \"../../../../utils/helpers/text.helpers\";\n\nexport default function getSwaggerDefaultConfig(\n defaultModelsPaths: Record<string, any>,\n) {\n const portAndHost = {\n port: process.env.__PORT || process.env.PORT || \"8000\",\n host: process.env.__HOST! || process.env.HOST || \"127.0.0.1\",\n };\n const config = getArkosConfig();\n\n return {\n endpoint: \"/docs\",\n mode: \"prisma\",\n strict: false,\n options: {\n definition: {\n openapi: \"3.1.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 securitySchemes: {\n BearerAuth: {\n type: \"http\",\n scheme: \"bearer\",\n bearerFormat: \"JWT\",\n },\n },\n },\n security: [],\n },\n apis: [\"./src/**/*.router.{ts,js}\", \"./src/**/*.route.{ts,js}\"],\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 cdn: config.globalPrefix + \"/scalar-api-reference/browser/standalone.js\",\n metaData: {\n title: \"Arkos.js API Documentation\",\n description: \"API documentation generated by Arkos.js\",\n },\n pageTitle: \"Arkos.js API Documentation\",\n customCss: `.scalar-app-client {\nwidth: 100vw !important;\nheight: 100vh !important;\nmax-width: 100vw !important;\nmax-height: 100vh !important;\ntop: 0 !important;\nleft: 0 !important;\ntransform: none !important;\nborder-radius: 0 !important;\n}`,\n },\n };\n}\n\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"arkos-prisma-input.js","sourceRoot":"","sources":["../../../src/types/arkos-prisma-input.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Helper type to exclude properties from T that exist in U\n * Used internally by XOR to create mutually exclusive types\n */\ntype Without<T, U> = {\n [P in Exclude<keyof T, keyof U>]?: never;\n};\n/**\n * XOR (Exclusive OR) type for mutually exclusive union types\n * Ensures that properties from T and U cannot be mixed together\n * @see https://stackoverflow.com/questions/42123407/does-typescript-support-mutually-exclusive-types\n */\ntype XOR<T, U> = T extends object\n ? U extends object\n ? (Without<T, U> & U) | (Without<U, T> & T)\n : U\n : T;\ntype Unpack<T> = T;\n/**\n * Checks if a field is an array relation (one-to-many or many-to-many)\n * Identified by the presence of createMany property\n */\nexport type IsArrayRelation<T> =\n Exclude<T, undefined> extends never\n ? false\n : Exclude<T, undefined> extends { createMany?: any }\n ? true\n : false;\n/**\n * Checks if a field is an object relation (one-to-one or many-to-one)\n * Identified by the presence of relation operations without being an array\n */\nexport type IsObjectRelation<T> =\n Exclude<T, undefined> extends Array<any>\n ? false\n : Exclude<T, undefined> extends\n | {\n create?: any;\n }\n | {\n connect?: any;\n }\n | {\n connectOrCreate?: any;\n }\n | {\n update?: any;\n }\n | {\n delete?: any;\n }\n | {\n disconnect?: any;\n }\n ? true\n : false;\ntype ExtractCreateTypeArray<T> =\n Exclude<T, undefined> extends {\n create?: infer C;\n }\n ? Extract<C, Array<any>> extends Array<infer U>\n ? U extends Array<infer I>\n ? (Omit<I, \"OR\" | \"AND\" | \"NOT\"> & {\n apiAction?: \"create\";\n })[]\n : (Omit<U, \"OR\" | \"AND\" | \"NOT\"> & {\n apiAction?: \"create\";\n })[]\n : never\n : never;\ntype ExtractConnectTypeArray<\n T,\n A extends\n | \"connect\"\n | \"delete\"\n | \"update\"\n | \"disconnect\"\n | \"deleteMany\"\n | \"set\",\n> =\n Exclude<T, undefined> extends {\n [k in A]?: infer C;\n }\n ? Extract<C, Array<any>> extends Array<infer U>\n ? (Omit<U, \"OR\" | \"AND\" | \"NOT\"> & {\n apiAction?: A;\n })[]\n : never\n : never;\ntype ExtractUpdateTypeArray<T> =\n Exclude<T, undefined> extends Array<infer Item>\n ? Item extends {\n update?: infer U;\n }\n ? U extends Array<infer UpdateItem>\n ? UpdateItem extends {\n where: infer W;\n data: infer D;\n }\n ? ((W & D) & {\n apiAction?: \"update\";\n })[]\n : never\n : U extends {\n where: infer W;\n data: infer D;\n }\n ? ((W & D) & {\n apiAction?: \"update\";\n })[]\n : never\n : never\n : never;\ntype ExtractCreateTypeObject<T> =\n Exclude<T, undefined> extends {\n create?: infer C;\n }\n ? Exclude<\n Extract<Exclude<C, undefined>, object>,\n Array<any>\n > extends infer Obj\n ? Obj extends object\n ? Omit<Obj, \"OR\" | \"AND\" | \"NOT\"> & {\n apiAction?: \"create\";\n }\n : never\n : never\n : never;\ntype ExtractConnectTypeObject<\n T,\n A extends \"connect\" | \"delete\" | \"update\" | \"disconnect\",\n> =\n Exclude<T, undefined> extends {\n [k in A]?: infer C;\n }\n ? Exclude<\n Extract<Exclude<C, undefined>, object>,\n Array<any>\n > extends infer Obj\n ? Obj extends object\n ? Omit<Obj, \"OR\" | \"AND\" | \"NOT\"> & {\n apiAction?: A;\n }\n : never\n : never\n : never;\ntype ExtractUpdateTypeObject<T> =\n Exclude<T, undefined> extends {\n update?: infer U;\n }\n ? U extends {\n where: infer W;\n data: infer D;\n }\n ? (W & D) & {\n apiAction?: \"update\";\n }\n : Exclude<Extract<U, object>, Array<any>> & {\n apiAction?: \"update\";\n }\n : never;\ntype FlattenArrayRelation<T> =\n | (ExtractCreateTypeArray<T> extends never\n ? never\n : FlattenRelations<ExtractCreateTypeArray<T>>)\n | (ExtractConnectTypeArray<T, \"connect\"> extends never\n ? never\n : FlattenRelations<ExtractConnectTypeArray<T, \"connect\">>)\n | (ExtractUpdateTypeArray<T> extends never\n ? never\n : FlattenRelations<ExtractUpdateTypeArray<T>>)\n | (Exclude<T, undefined> extends Array<infer Item>\n ? Item extends {\n delete?: any;\n }\n ? FlattenRelations<ExtractConnectTypeArray<T, \"delete\">> & {\n apiAction: \"delete\";\n }\n : never\n : never)\n | (Exclude<T, undefined> extends Array<infer Item>\n ? Item extends {\n disconnect?: any;\n }\n ? FlattenRelations<ExtractConnectTypeArray<T, \"disconnect\">> & {\n apiAction: \"disconnect\";\n }\n : never\n : never)\n | (Exclude<T, undefined> extends Array<infer Item>\n ? Item extends {\n set?: infer S;\n }\n ? Unpack<S> & {\n apiAction?: \"set\";\n }\n : never\n : never)\n | (Exclude<T, undefined> extends Array<infer Item>\n ? Item extends {\n deleteMany?: any;\n }\n ? FlattenRelations<ExtractConnectTypeArray<T, \"deleteMany\">> & {\n apiAction: \"deleteMany\";\n }\n : never\n : never);\ntype FlattenObjectRelation<T> =\n | (ExtractCreateTypeObject<T> extends never\n ? never\n : FlattenRelations<ExtractCreateTypeObject<T>>)\n | (ExtractConnectTypeObject<T, \"connect\"> extends never\n ? never\n : FlattenRelations<ExtractConnectTypeObject<T, \"connect\">>)\n | (ExtractUpdateTypeObject<T> extends never\n ? never\n : FlattenRelations<ExtractUpdateTypeObject<T>>)\n | (Exclude<T, undefined> extends {\n delete?: any;\n }\n ? FlattenRelations<ExtractConnectTypeObject<T, \"delete\">> & {\n apiAction: \"delete\";\n }\n : never)\n | (Exclude<T, undefined> extends {\n disconnect?: any;\n }\n ? FlattenRelations<ExtractConnectTypeObject<T, \"disconnect\">> & {\n apiAction: \"disconnect\";\n }\n : never)\n | (Exclude<T, undefined> extends {\n set?: infer S;\n }\n ? Unpack<S> & {\n apiAction?: \"set\";\n }\n : never);\ntype StripPrismaFilters<T> = T extends\n | { equals?: any }\n | { in?: any }\n | { notIn?: any }\n | { lt?: any }\n | { lte?: any }\n | { gt?: any }\n | { gte?: any }\n | { AND?: any }\n | { OR?: any }\n | { NOT?: any }\n ? Omit<\n T,\n | \"equals\"\n | \"in\"\n | \"notIn\"\n | \"lt\"\n | \"lte\"\n | \"gt\"\n | \"gte\"\n | \"AND\"\n | \"OR\"\n | \"NOT\"\n >\n : T;\n\ntype StripToScalar<T> = T extends\n | string\n | number\n | boolean\n | Date\n | null\n | undefined\n ? T\n : never;\n\ntype FlattenRelations<T> = {\n [K in keyof T]: IsArrayRelation<T[K]> extends true\n ? FlattenArrayRelation<T[K]> | undefined\n : IsObjectRelation<T[K]> extends true\n ? XOR<FlattenObjectRelation<T[K]> | undefined, T[K]>\n : StripPrismaFilters<T[K]> extends never\n ? never\n : T[K] extends object\n ? T[K] extends Date | null | undefined\n ? T[K]\n : FlattenRelations<StripPrismaFilters<T[K]>> | undefined\n : StripToScalar<T[K]> extends never\n ? StripPrismaFilters<T[K]>\n : StripToScalar<T[K]>;\n};\n/**\n * Flattens Prisma relation inputs into a simpler, developer-friendly format\n *\n * Transforms Prisma's nested relation format:\n * ```typescript\n * { posts: { create: [...], connect: [...], update: [...] } }\n * ```\n *\n * Into a flattened format with optional apiAction discriminators:\n * ```typescript\n * { posts: [\n * { title: \"New Post\" }, // auto-detected as create\n * { id: 1 }, // auto-detected as connect\n * { id: 2, title: \"Updated\", apiAction: \"update\" }\n * ]}\n * ```\n *\n * @see {@link https://wwww.arkosjs.com/docs/reference/arkos-prisma-input}\n * @template T - The Prisma input type (e.g., Prisma.UserCreateInput)\n * @returns A flattened version of the input type with simplified relation handling\n */\nexport type ArkosPrismaInput<T> = FlattenRelations<T>;\n"]}
1
+ {"version":3,"file":"arkos-prisma-input.js","sourceRoot":"","sources":["../../../src/types/arkos-prisma-input.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Helper type to exclude properties from T that exist in U\n * Used internally by XOR to create mutually exclusive types\n */\ntype Without<T, U> = {\n [P in Exclude<keyof T, keyof U>]?: never;\n};\n/**\n * XOR (Exclusive OR) type for mutually exclusive union types\n * Ensures that properties from T and U cannot be mixed together\n * @see https://stackoverflow.com/questions/42123407/does-typescript-support-mutually-exclusive-types\n */\ntype XOR<T, U> = T extends object\n ? U extends object\n ? (Without<T, U> & U) | (Without<U, T> & T)\n : U\n : T;\ntype Unpack<T> = T;\n/**\n * Checks if a field is an array relation (one-to-many or many-to-many)\n * Identified by the presence of createMany property\n */\nexport type IsArrayRelation<T> = Exclude<T, undefined> extends never\n ? false\n : Exclude<T, undefined> extends { connect?: infer C; }\n ? (Extract<Exclude<C, undefined>, any[]> extends never ? false : true)\n : Exclude<T, undefined> extends { createMany?: any; }\n ? true\n : false;\n/**\n * Checks if a field is an object relation (one-to-one or many-to-one)\n * Identified by the presence of relation operations without being an array\n */\nexport type IsObjectRelation<T> =\n Exclude<T, undefined> extends Array<any>\n ? false\n : Exclude<T, undefined> extends\n | {\n create?: any;\n }\n | {\n connect?: any;\n }\n | {\n connectOrCreate?: any;\n }\n | {\n update?: any;\n }\n | {\n delete?: any;\n }\n | {\n disconnect?: any;\n }\n ? true\n : false;\ntype ExtractCreateTypeArray<T> =\n Exclude<T, undefined> extends {\n create?: infer C;\n }\n ? Extract<C, Array<any>> extends Array<infer U>\n ? U extends Array<infer I>\n ? (Omit<I, \"OR\" | \"AND\" | \"NOT\"> & {\n apiAction?: \"create\";\n })[]\n : (Omit<U, \"OR\" | \"AND\" | \"NOT\"> & {\n apiAction?: \"create\";\n })[]\n : never\n : never;\ntype ExtractConnectTypeArray<\n T,\n A extends\n | \"connect\"\n | \"delete\"\n | \"update\"\n | \"disconnect\"\n | \"deleteMany\"\n | \"set\",\n> =\n Exclude<T, undefined> extends {\n [k in A]?: infer C;\n }\n ? Extract<C, Array<any>> extends Array<infer U>\n ? (Omit<U, \"OR\" | \"AND\" | \"NOT\"> & {\n apiAction?: A;\n })[]\n : never\n : never;\ntype ExtractUpdateTypeArray<T> =\n Exclude<T, undefined> extends Array<infer Item>\n ? Item extends {\n update?: infer U;\n }\n ? U extends Array<infer UpdateItem>\n ? UpdateItem extends {\n where: infer W;\n data: infer D;\n }\n ? ((W & D) & {\n apiAction?: \"update\";\n })[]\n : never\n : U extends {\n where: infer W;\n data: infer D;\n }\n ? ((W & D) & {\n apiAction?: \"update\";\n })[]\n : never\n : never\n : never;\ntype ExtractCreateTypeObject<T> =\n Exclude<T, undefined> extends {\n create?: infer C;\n }\n ? Exclude<\n Extract<Exclude<C, undefined>, object>,\n Array<any>\n > extends infer Obj\n ? Obj extends object\n ? Omit<Obj, \"OR\" | \"AND\" | \"NOT\"> & {\n apiAction?: \"create\";\n }\n : never\n : never\n : never;\ntype ExtractConnectTypeObject<\n T,\n A extends \"connect\" | \"delete\" | \"update\" | \"disconnect\",\n> =\n Exclude<T, undefined> extends {\n [k in A]?: infer C;\n }\n ? Exclude<\n Extract<Exclude<C, undefined>, object>,\n Array<any>\n > extends infer Obj\n ? Obj extends object\n ? Omit<Obj, \"OR\" | \"AND\" | \"NOT\"> & {\n apiAction?: A;\n }\n : never\n : never\n : never;\ntype ExtractUpdateTypeObject<T> =\n Exclude<T, undefined> extends {\n update?: infer U;\n }\n ? U extends {\n where: infer W;\n data: infer D;\n }\n ? (W & D) & {\n apiAction?: \"update\";\n }\n : Exclude<Extract<U, object>, Array<any>> & {\n apiAction?: \"update\";\n }\n : never;\ntype FlattenArrayRelation<T> =\n | (ExtractCreateTypeArray<T> extends never\n ? never\n : FlattenRelations<ExtractCreateTypeArray<T>>)\n | (ExtractConnectTypeArray<T, \"connect\"> extends never\n ? never\n : FlattenRelations<ExtractConnectTypeArray<T, \"connect\">>)\n | (ExtractUpdateTypeArray<T> extends never\n ? never\n : FlattenRelations<ExtractUpdateTypeArray<T>>)\n | (Exclude<T, undefined> extends Array<infer Item>\n ? Item extends {\n delete?: any;\n }\n ? FlattenRelations<ExtractConnectTypeArray<T, \"delete\">> & {\n apiAction: \"delete\";\n }\n : never\n : never)\n | (Exclude<T, undefined> extends Array<infer Item>\n ? Item extends {\n disconnect?: any;\n }\n ? FlattenRelations<ExtractConnectTypeArray<T, \"disconnect\">> & {\n apiAction: \"disconnect\";\n }\n : never\n : never)\n | (Exclude<T, undefined> extends Array<infer Item>\n ? Item extends {\n set?: infer S;\n }\n ? Unpack<S> & {\n apiAction?: \"set\";\n }\n : never\n : never)\n | (Exclude<T, undefined> extends Array<infer Item>\n ? Item extends {\n deleteMany?: any;\n }\n ? FlattenRelations<ExtractConnectTypeArray<T, \"deleteMany\">> & {\n apiAction: \"deleteMany\";\n }\n : never\n : never);\ntype FlattenObjectRelation<T> =\n | (ExtractCreateTypeObject<T> extends never\n ? never\n : FlattenRelations<ExtractCreateTypeObject<T>>)\n | (ExtractConnectTypeObject<T, \"connect\"> extends never\n ? never\n : FlattenRelations<ExtractConnectTypeObject<T, \"connect\">>)\n | (ExtractUpdateTypeObject<T> extends never\n ? never\n : FlattenRelations<ExtractUpdateTypeObject<T>>)\n | (Exclude<T, undefined> extends {\n delete?: any;\n }\n ? FlattenRelations<ExtractConnectTypeObject<T, \"delete\">> & {\n apiAction: \"delete\";\n }\n : never)\n | (Exclude<T, undefined> extends {\n disconnect?: any;\n }\n ? FlattenRelations<ExtractConnectTypeObject<T, \"disconnect\">> & {\n apiAction: \"disconnect\";\n }\n : never)\n | (Exclude<T, undefined> extends {\n set?: infer S;\n }\n ? Unpack<S> & {\n apiAction?: \"set\";\n }\n : never);\ntype StripPrismaFilters<T> = T extends\n | { equals?: any; }\n | { in?: any; }\n | { notIn?: any; }\n | { lt?: any; }\n | { lte?: any; }\n | { gt?: any; }\n | { gte?: any; }\n | { AND?: any; }\n | { OR?: any; }\n | { NOT?: any; }\n ? Omit<\n T,\n | \"equals\"\n | \"in\"\n | \"notIn\"\n | \"lt\"\n | \"lte\"\n | \"gt\"\n | \"gte\"\n | \"AND\"\n | \"OR\"\n | \"NOT\"\n >\n : T;\n\ntype ScalarValue = string | number | boolean | Date | null | undefined;\ntype StripToScalar<T> = T extends Array<ScalarValue> ? T : T extends ScalarValue ? T : never;\n\ntype FlattenRelations<T> = {\n [K in keyof T]: IsArrayRelation<T[K]> extends true\n ? FlattenArrayRelation<T[K]> | undefined\n : IsObjectRelation<T[K]> extends true\n ? XOR<FlattenObjectRelation<T[K]> | undefined, T[K]>\n : StripPrismaFilters<T[K]> extends never\n ? never\n : T[K] extends object\n ? T[K] extends Date | null | undefined\n ? T[K]\n : FlattenRelations<StripPrismaFilters<T[K]>> | undefined\n : StripToScalar<T[K]> extends never\n ? StripPrismaFilters<T[K]>\n : StripToScalar<T[K]>;\n};\n/**\n * Flattens Prisma relation inputs into a simpler, developer-friendly format\n *\n * Transforms Prisma's nested relation format:\n * ```typescript\n * { posts: { create: [...], connect: [...], update: [...] } }\n * ```\n *\n * Into a flattened format with optional apiAction discriminators:\n * ```typescript\n * { posts: [\n * { title: \"New Post\" }, // auto-detected as create\n * { id: 1 }, // auto-detected as connect\n * { id: 2, title: \"Updated\", apiAction: \"update\" }\n * ]}\n * ```\n *\n * @see {@link https://wwww.arkosjs.com/docs/reference/arkos-prisma-input}\n * @template T - The Prisma input type (e.g., Prisma.UserCreateInput)\n * @returns A flattened version of the input type with simplified relation handling\n */\nexport type ArkosPrismaInput<T> = FlattenRelations<T>;\n"]}
@@ -11,6 +11,6 @@ export function killServerChildProcess() {
11
11
  killProductionServerChildProcess();
12
12
  }
13
13
  export function getVersion() {
14
- return "1.7.3-canary.9";
14
+ return "1.7.4-rc";
15
15
  }
16
16
  //# sourceMappingURL=cli.helpers.js.map
@@ -14,15 +14,14 @@ export function generateRouterTemplate(options) {
14
14
  const routerConfigTsTypeImport = ext === "ts" ? "import { RouteHook } from 'arkos'" : "";
15
15
  const routeConfig = isNormalModule
16
16
  ? `
17
- export const hook${routerConfigTsType} = { }
18
- `
17
+ export const hook${routerConfigTsType} = { }`
19
18
  : "";
20
19
  return `import { ArkosRouter } from 'arkos';${modelName.kebab === "file-upload" ? "\nimport config from '../../arkos.config.js'" : ""}
21
20
  ${routerConfigTsTypeImport}
22
21
  ${routeConfig}
23
22
 
24
23
  const ${modelName.camel}Router = ArkosRouter({
25
- openapi: { tags: ["${pluralize(capitalize(modelName.kebab.replaceAll("-", " ")))}"] }
24
+ openapi: { tags: ["${modelName.kebab === "auth" ? "Authentication" : pluralize(capitalize(modelName.kebab.replaceAll("-", " ")))}"] }
26
25
  })
27
26
 
28
27
  export default ${modelName.camel}Router
@@ -1 +1 @@
1
- {"version":3,"file":"router-template.js","sourceRoot":"","sources":["../../../../../../../src/utils/cli/utils/template-generator/templates/router-template.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAE9D,MAAM,UAAU,sBAAsB,CAAC,OAAwB;IAC7D,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;IAE9B,IAAI,CAAC,SAAS;QACZ,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;IAEjE,MAAM,cAAc,GAAG,CAAC,GAAG,iBAAiB,EAAE,aAAa,EAAE,MAAM,CAAC,CAAC,QAAQ,CAC3E,SAAS,CAAC,KAAK,CAChB,CAAC;IACF,MAAM,GAAG,GAAG,oBAAoB,EAAE,CAAC;IAEnC,MAAM,kBAAkB,GACtB,GAAG,KAAK,IAAI;QACV,CAAC,CAAC,eAAe,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,SAAS,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,UAAU,GAAG;QAC3G,CAAC,CAAC,EAAE,CAAC;IACT,MAAM,wBAAwB,GAC5B,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,mCAAmC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC1D,MAAM,WAAW,GAAG,cAAc;QAChC,CAAC,CAAC;mBACa,kBAAkB;CACpC;QACG,CAAC,CAAC,EAAE,CAAC;IAEP,OAAO,uCAAuC,SAAS,CAAC,KAAK,KAAK,aAAa,CAAC,CAAC,CAAC,2CAA2C,CAAC,CAAC,CAAC,EAAE;EAClI,wBAAwB;EACxB,WAAW;;QAEL,SAAS,CAAC,KAAK;uBACA,SAAS,CAAC,UAAU,CAAC,SAAS,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;;;iBAGjE,SAAS,CAAC,KAAK;CAC/B,CAAC;AACF,CAAC","sourcesContent":["import pluralize from \"pluralize\";\nimport { getUserFileExtension } from \"../../../../helpers/fs.helpers\";\nimport { kebabPrismaModels } from \"../../../generate\";\nimport { TemplateOptions } from \"../../template-generators\";\nimport { capitalize } from \"../../../../helpers/text.helpers\";\n\nexport function generateRouterTemplate(options: TemplateOptions): string {\n const { modelName } = options;\n\n if (!modelName)\n throw new Error(\"Module name is required for router template\");\n\n const isNormalModule = [...kebabPrismaModels, \"file-upload\", \"auth\"].includes(\n modelName.kebab\n );\n const ext = getUserFileExtension();\n\n const routerConfigTsType =\n ext === \"ts\"\n ? `: RouteHook<${[\"file-upload\", \"auth\"].includes(modelName.kebab) ? `\"${modelName.kebab}\"` : '\"prisma\"'}>`\n : \"\";\n const routerConfigTsTypeImport =\n ext === \"ts\" ? \"import { RouteHook } from 'arkos'\" : \"\";\n const routeConfig = isNormalModule\n ? `\nexport const hook${routerConfigTsType} = { }\n`\n : \"\";\n\n return `import { ArkosRouter } from 'arkos';${modelName.kebab === \"file-upload\" ? \"\\nimport config from '../../arkos.config'\" : \"\"}\n${routerConfigTsTypeImport}\n${routeConfig}\n\nconst ${modelName.camel}Router = ArkosRouter({ \n openapi: { tags: [\"${pluralize(capitalize(modelName.kebab.replaceAll(\"-\", \" \")))}\"] }\n})\n\nexport default ${modelName.camel}Router\n`;\n}\n"]}
1
+ {"version":3,"file":"router-template.js","sourceRoot":"","sources":["../../../../../../../src/utils/cli/utils/template-generator/templates/router-template.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAE9D,MAAM,UAAU,sBAAsB,CAAC,OAAwB;IAC7D,MAAM,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;IAE9B,IAAI,CAAC,SAAS;QACZ,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;IAEjE,MAAM,cAAc,GAAG,CAAC,GAAG,iBAAiB,EAAE,aAAa,EAAE,MAAM,CAAC,CAAC,QAAQ,CAC3E,SAAS,CAAC,KAAK,CAChB,CAAC;IACF,MAAM,GAAG,GAAG,oBAAoB,EAAE,CAAC;IAEnC,MAAM,kBAAkB,GACtB,GAAG,KAAK,IAAI;QACV,CAAC,CAAC,eAAe,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,SAAS,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,UAAU,GAAG;QAC3G,CAAC,CAAC,EAAE,CAAC;IACT,MAAM,wBAAwB,GAC5B,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,mCAAmC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC1D,MAAM,WAAW,GAAG,cAAc;QAChC,CAAC,CAAC;mBACa,kBAAkB,QAAQ;QACzC,CAAC,CAAC,EAAE,CAAC;IAEP,OAAO,uCAAuC,SAAS,CAAC,KAAK,KAAK,aAAa,CAAC,CAAC,CAAC,2CAA2C,CAAC,CAAC,CAAC,EAAE;EAClI,wBAAwB;EACxB,WAAW;;QAEL,SAAS,CAAC,KAAK;uBACA,SAAS,CAAC,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,SAAS,CAAC,UAAU,CAAC,SAAS,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;;;iBAGjH,SAAS,CAAC,KAAK;CAC/B,CAAC;AACF,CAAC","sourcesContent":["import pluralize from \"pluralize\";\nimport { getUserFileExtension } from \"../../../../helpers/fs.helpers\";\nimport { kebabPrismaModels } from \"../../../generate\";\nimport { TemplateOptions } from \"../../template-generators\";\nimport { capitalize } from \"../../../../helpers/text.helpers\";\n\nexport function generateRouterTemplate(options: TemplateOptions): string {\n const { modelName } = options;\n\n if (!modelName)\n throw new Error(\"Module name is required for router template\");\n\n const isNormalModule = [...kebabPrismaModels, \"file-upload\", \"auth\"].includes(\n modelName.kebab,\n );\n const ext = getUserFileExtension();\n\n const routerConfigTsType =\n ext === \"ts\"\n ? `: RouteHook<${[\"file-upload\", \"auth\"].includes(modelName.kebab) ? `\"${modelName.kebab}\"` : '\"prisma\"'}>`\n : \"\";\n const routerConfigTsTypeImport =\n ext === \"ts\" ? \"import { RouteHook } from 'arkos'\" : \"\";\n const routeConfig = isNormalModule\n ? `\nexport const hook${routerConfigTsType} = { }`\n : \"\";\n\n return `import { ArkosRouter } from 'arkos';${modelName.kebab === \"file-upload\" ? \"\\nimport config from '../../arkos.config'\" : \"\"}\n${routerConfigTsTypeImport}\n${routeConfig}\n\nconst ${modelName.camel}Router = ArkosRouter({ \n openapi: { tags: [\"${modelName.kebab === \"auth\" ? \"Authentication\" : pluralize(capitalize(modelName.kebab.replaceAll(\"-\", \" \")))}\"] }\n})\n\nexport default ${modelName.camel}Router\n`;\n}\n\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"arkos-config.helpers.js","sourceRoot":"","sources":["../../../../src/utils/helpers/arkos-config.helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,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,CAAC;IAEJ,IACE,qBAAqB;QACrB,YAAY,EAAE;QACd,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU;QACvB,CAAC,MAAM,CAAC,cAAc,EAAE,GAAG,EAAE,MAAM;QAEnC,MAAM,SAAS,CACb,qHAAqH,CACtH,CAAC;IAEJ,IAAI,qBAAqB,IAAI,CAAC,iBAAiB,EAAE;QAC/C,MAAM,SAAS,CACb,2LAA2L,CAC5L,CAAC;AACN,CAAC","sourcesContent":["import { defineConfig, UserArkosConfig } from \"../define-config\";\nimport sheu from \"../sheu\";\nimport ExitError from \"./exit-error\";\nimport { crd, getUserFileExtension } from './fs.helpers';\nimport { getPrismaInstance } from \"./prisma.helpers\";\nimport { userRequire } from './global.helpers';\nimport { loadEnvironmentVariables } from '../dotenv.helpers';\n\nlet definedArkosConfig: any;\n\nexport function readArkosConfig() {\n loadEnvironmentVariables();\n const configFilename = `arkos.config.${getUserFileExtension()}`;\n const configPath = `${crd()}/${configFilename}`;\n try {\n let requireFunc: Function;\n if (typeof jest !== \"undefined\")\n requireFunc = () => ({});\n else if (typeof require !== \"undefined\") {\n requireFunc = require;\n } else {\n requireFunc = userRequire;\n }\n definedArkosConfig = requireFunc(configPath);\n } catch (err: any) {\n if (err.message.toLowerCase().includes(`${configFilename}`)) {\n definedArkosConfig = {};\n sheu.warn(\n `Using default configs, because ${configFilename} was not found`,\n {\n timestamp: true,\n }\n );\n } else {\n throw err;\n }\n }\n}\n\nexport function isUsingAuthentication() {\n const { authentication } = getArkosConfig();\n\n return authentication?.mode;\n}\n\nexport function isAuthenticationEnabled() {\n const { authentication } = getArkosConfig();\n\n return authentication?.mode && authentication?.enabled !== false;\n}\n\n/**\n * Gives access to the underlying current configurations being used by **Arkos** by default and also loaded through `arkos.config.{ts|js}`\n *\n * @returns {ArkosConfig}\n */\nexport function getArkosConfig(): UserArkosConfig {\n if (definedArkosConfig === undefined) readArkosConfig();\n\n const config =\n typeof definedArkosConfig === \"string\"\n ? { __loader: \"defineConfig\" }\n : (definedArkosConfig as any)?.default || { __loader: \"defineConfig\" };\n const configFile = `arkos.config.${getUserFileExtension()}`;\n\n if (\n (config as any).__loader !== \"defineConfig\" &&\n typeof jest == \"undefined\" &&\n typeof definedArkosConfig === \"object\"\n ) {\n sheu.error(\n `From v1.6 config under ${configFile} must be wrapped in \\`defineConfig()\\` function from \\`arkos/config\\`. You can do the following under your ${configFile}:\n\nimport { defineConfig } from \"arkos/config\"\n\nconst config = defineConfig({ ... })\n\nexport default config\n`\n );\n process.exit(1);\n }\n\n return defineConfig(config) as any;\n}\n\n/**\n * Returns true if application is being run through `arkos start` after `arkos build`\n *\n * @since 1.5.16-beta\n */\nexport function isProduction() {\n return process.env.ARKOS_BUILD === \"true\";\n}\n\nexport function validateArkosConfig() {\n const config = getArkosConfig();\n const authenticationEnabled = isAuthenticationEnabled();\n\n if (!config?.source?.entryPoint)\n throw ExitError(\n `Invalid value for 'arkosConfig.source.entryPoint', please pass a valid path from the current working directory`\n );\n\n if (\n authenticationEnabled &&\n isProduction() &&\n !process.env.JWT_SECRET &&\n !config.authentication?.jwt?.secret\n )\n throw ExitError(\n `Missing jwt secret in production, see https://www.arkosjs.com/docs/core-concepts/authentication/setup#configuration`\n );\n\n if (authenticationEnabled && !getPrismaInstance())\n throw ExitError(\n `Arkos' authentication system relies on prisma instance, please disabled your authentication or see https://www.arkosjs.com/docs/core-concepts/prisma-orm/setup to setup a prisma instance`\n );\n}\n"]}
1
+ {"version":3,"file":"arkos-config.helpers.js","sourceRoot":"","sources":["../../../../src/utils/helpers/arkos-config.helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAmB,MAAM,kBAAkB,CAAC;AACjE,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,GAAG,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC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AAiB,EAAE;QAC/C,MAAM,SAAS,CACb,2LAA2L,CAC5L,CAAC;AACN,CAAC","sourcesContent":["import { defineConfig, UserArkosConfig } from \"../define-config\";\nimport sheu from \"../sheu\";\nimport ExitError from \"./exit-error\";\nimport { crd, getUserFileExtension } from './fs.helpers';\nimport { getPrismaInstance } from \"./prisma.helpers\";\nimport { userRequire } from './global.helpers';\nimport { loadEnvironmentVariables } from '../dotenv.helpers';\n\nlet definedArkosConfig: any;\n\nexport function readArkosConfig() {\n loadEnvironmentVariables();\n const configFilename = `arkos.config.${getUserFileExtension()}`;\n const configPath = `${crd()}/${configFilename}`;\n try {\n let requireFunc: Function;\n if (typeof jest !== \"undefined\")\n requireFunc = () => ({});\n else if (typeof require !== \"undefined\") {\n requireFunc = require;\n } else {\n requireFunc = userRequire;\n }\n definedArkosConfig = requireFunc(configPath);\n } catch (err: any) {\n if (err.message.toLowerCase().includes(`${configFilename}`)) {\n definedArkosConfig = {};\n sheu.warn(\n `Using default configs, because ${configFilename} was not found`,\n {\n timestamp: true,\n }\n );\n } else {\n throw err;\n }\n }\n}\n\nexport function isUsingAuthentication() {\n const { authentication } = getArkosConfig();\n\n return authentication?.mode;\n}\n\nexport function isAuthenticationEnabled() {\n const { authentication } = getArkosConfig();\n\n return authentication?.mode && authentication?.enabled !== false;\n}\n\n/**\n * Gives access to the underlying current configurations being used by **Arkos** by default and also loaded through `arkos.config.{ts|js}`\n *\n * @returns {ArkosConfig}\n */\nexport function getArkosConfig(): UserArkosConfig {\n if (definedArkosConfig === undefined) readArkosConfig();\n\n const config =\n typeof definedArkosConfig === \"string\"\n ? { __loader: \"defineConfig\" }\n : (definedArkosConfig as any)?.default || { __loader: \"defineConfig\" };\n const configFile = `arkos.config.${getUserFileExtension()}`;\n\n if (\n (config as any).__loader !== \"defineConfig\" &&\n typeof jest == \"undefined\" &&\n typeof definedArkosConfig === \"object\"\n ) {\n sheu.error(\n `From v1.6 config under ${configFile} must be wrapped in \\`defineConfig()\\` function from \\`arkos/config\\`. You can do the following under your ${configFile}:\n\nimport { defineConfig } from \"arkos/config\"\n\nconst config = defineConfig({ ... })\n\nexport default config\n`\n );\n process.exit(1);\n }\n\n return defineConfig(config) as any;\n}\n\n/**\n * Returns true if application is being run through `arkos start` after `arkos build`\n *\n * @since 1.5.16-beta\n */\nexport function isProduction() {\n return process.env.ARKOS_BUILD === \"true\";\n}\n\nexport function validateArkosConfig() {\n const config = getArkosConfig();\n const authenticationEnabled = isAuthenticationEnabled();\n\n if (!config?.source?.entryPoint)\n throw ExitError(\n `Invalid value for 'arkosConfig.source.entryPoint', please pass a valid path from the current working directory`\n );\n\n if (\n authenticationEnabled &&\n isProduction() &&\n !process.env.JWT_SECRET &&\n !config.authentication?.jwt?.secret\n )\n throw ExitError(\n `Missing jwt secret in production, see https://www.arkosjs.com/docs/core-concepts/authentication/setup#configuration`\n );\n\n if (authenticationEnabled && !getPrismaInstance())\n throw ExitError(\n `Arkos' authentication system relies on prisma instance, please disabled your authentication or see https://www.arkosjs.com/docs/core-concepts/prisma-orm/setup to setup a prisma instance`\n );\n}\n\n"]}
@@ -17,6 +17,8 @@ type Unpack<T> = T;
17
17
  * Identified by the presence of createMany property
18
18
  */
19
19
  export type IsArrayRelation<T> = Exclude<T, undefined> extends never ? false : Exclude<T, undefined> extends {
20
+ connect?: infer C;
21
+ } ? (Extract<Exclude<C, undefined>, any[]> extends never ? false : true) : Exclude<T, undefined> extends {
20
22
  createMany?: any;
21
23
  } ? true : false;
22
24
  /**
@@ -132,7 +134,8 @@ type StripPrismaFilters<T> = T extends {
132
134
  } | {
133
135
  NOT?: any;
134
136
  } ? Omit<T, "equals" | "in" | "notIn" | "lt" | "lte" | "gt" | "gte" | "AND" | "OR" | "NOT"> : T;
135
- type StripToScalar<T> = T extends string | number | boolean | Date | null | undefined ? T : never;
137
+ type ScalarValue = string | number | boolean | Date | null | undefined;
138
+ type StripToScalar<T> = T extends Array<ScalarValue> ? T : T extends ScalarValue ? T : never;
136
139
  type FlattenRelations<T> = {
137
140
  [K in keyof T]: IsArrayRelation<T[K]> extends true ? FlattenArrayRelation<T[K]> | undefined : IsObjectRelation<T[K]> extends true ? XOR<FlattenObjectRelation<T[K]> | undefined, T[K]> : StripPrismaFilters<T[K]> extends never ? never : T[K] extends object ? T[K] extends Date | null | undefined ? T[K] : FlattenRelations<StripPrismaFilters<T[K]>> | undefined : StripToScalar<T[K]> extends never ? StripPrismaFilters<T[K]> : StripToScalar<T[K]>;
138
141
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arkos",
3
- "version": "1.7.3-canary.9",
3
+ "version": "1.7.4-rc",
4
4
  "description": "The Express & Prisma RESTful Framework",
5
5
  "main": "dist/cjs/exports/index.js",
6
6
  "module": "dist/esm/exports/index.js",
@@ -76,30 +76,14 @@
76
76
  },
77
77
  "typesVersions": {
78
78
  "*": {
79
- "*": [
80
- "./dist/types/exports/*/index.d.ts"
81
- ],
82
- "services": [
83
- "./dist/types/exports/services/index.d.ts"
84
- ],
85
- "validation": [
86
- "./dist/types/exports/validation/index.d.ts"
87
- ],
88
- "error-handler": [
89
- "./dist/types/exports/error-handler/index.d.ts"
90
- ],
91
- "prisma": [
92
- "./dist/types/exports/prisma/index.d.ts"
93
- ],
94
- "auth": [
95
- "./dist/types/exports/auth/index.d.ts"
96
- ],
97
- "middlewares": [
98
- "./dist/types/exports/middlewares/index.d.ts"
99
- ],
100
- "utils": [
101
- "./dist/types/exports/utils/index.d.ts"
102
- ],
79
+ "*": ["./dist/types/exports/*/index.d.ts"],
80
+ "services": ["./dist/types/exports/services/index.d.ts"],
81
+ "validation": ["./dist/types/exports/validation/index.d.ts"],
82
+ "error-handler": ["./dist/types/exports/error-handler/index.d.ts"],
83
+ "prisma": ["./dist/types/exports/prisma/index.d.ts"],
84
+ "auth": ["./dist/types/exports/auth/index.d.ts"],
85
+ "middlewares": ["./dist/types/exports/middlewares/index.d.ts"],
86
+ "utils": ["./dist/types/exports/utils/index.d.ts"],
103
87
  "websockets": ["./dist/types/exports/websockets.d.ts"]
104
88
  }
105
89
  },
@@ -107,7 +91,7 @@
107
91
  "build:esm": "tsc -p tsconfig.esm.json && npx tsx scripts/fix-esm-imports.ts",
108
92
  "build:types": "tsc -p tsconfig.types.json",
109
93
  "build:cjs": "tsc -p tsconfig.cjs.json",
110
- "build": "pnpm clean -p dist && pnpm run build:cjs && pnpm run build:esm && pnpm run build:types && tsx scripts/post-build-scripts.ts",
94
+ "build": "pnpm run clean -p dist && pnpm run build:cjs && pnpm run build:esm && pnpm run build:types && tsx scripts/post-build-scripts.ts",
111
95
  "buildTsup": "tsup && tsx scripts/post-build-scripts.ts",
112
96
  "minifyOld": "esbuild dist/cjs/**/*.js --minify --outdir=dist --allow-overwrite --log-limit=0 --define:process.env.NODE_ENV=process.env.NODE_ENV",
113
97
  "minify": "esbuild $(find dist -type f -name '*.js') --minify --outdir=dist --allow-overwrite --log-limit=0 --define:process.env.NODE_ENV=process.env.NODE_ENV",
@@ -153,11 +137,7 @@
153
137
  "url": "https://github.com/uanela/arkos/issues"
154
138
  },
155
139
  "homepage": "https://www.arkosjs.com",
156
- "files": [
157
- "dist",
158
- "cli.js",
159
- "README.md"
160
- ],
140
+ "files": ["dist", "cli.js", "README.md"],
161
141
  "devDependencies": {
162
142
  "@babel/preset-typescript": "7.27.1",
163
143
  "@prisma/client": "6.19.3",
@@ -231,3 +211,4 @@
231
211
  "node": ">=22.9"
232
212
  }
233
213
  }
214
+