arkos 1.4.1-canary.1 → 1.4.1-canary.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/modules/auth/auth.service.js +1 -1
- package/dist/cjs/modules/auth/auth.service.js.map +1 -1
- package/dist/cjs/modules/auth/utils/services/auth-action.service.js +15 -9
- package/dist/cjs/modules/auth/utils/services/auth-action.service.js.map +1 -1
- package/dist/cjs/modules/base/base.middlewares.js +10 -2
- package/dist/cjs/modules/base/base.middlewares.js.map +1 -1
- package/dist/cjs/modules/swagger/utils/helpers/get-authentication-json-schema-paths.js +27 -9
- package/dist/cjs/modules/swagger/utils/helpers/get-authentication-json-schema-paths.js.map +1 -1
- package/dist/cjs/modules/swagger/utils/helpers/get-file-upload-json-schema-paths.js +28 -11
- package/dist/cjs/modules/swagger/utils/helpers/get-file-upload-json-schema-paths.js.map +1 -1
- package/dist/cjs/modules/swagger/utils/helpers/missing-json-schemas-generator.js +3 -0
- package/dist/cjs/modules/swagger/utils/helpers/missing-json-schemas-generator.js.map +1 -1
- package/dist/cjs/utils/arkos-router/index.js +19 -6
- package/dist/cjs/utils/arkos-router/index.js.map +1 -1
- package/dist/cjs/utils/cli/dev.js +1 -45
- package/dist/cjs/utils/cli/dev.js.map +1 -1
- package/dist/cjs/utils/cli/start.js +11 -8
- package/dist/cjs/utils/cli/start.js.map +1 -1
- package/dist/cjs/utils/cli/utils/cli.helpers.js +1 -1
- package/dist/cjs/utils/cli/utils/runtime-cli-commander.js +6 -6
- package/dist/cjs/utils/cli/utils/runtime-cli-commander.js.map +1 -1
- package/dist/cjs/utils/dotenv.helpers.js +6 -2
- package/dist/cjs/utils/dotenv.helpers.js.map +1 -1
- package/dist/cjs/utils/prisma/prisma-json-schema-generator.js +19 -4
- package/dist/cjs/utils/prisma/prisma-json-schema-generator.js.map +1 -1
- package/dist/cjs/utils/validate-dto.js +1 -5
- package/dist/cjs/utils/validate-dto.js.map +1 -1
- package/dist/cjs/utils/validate-schema.js +2 -7
- package/dist/cjs/utils/validate-schema.js.map +1 -1
- package/dist/esm/modules/auth/auth.service.js +1 -1
- package/dist/esm/modules/auth/auth.service.js.map +1 -1
- package/dist/esm/modules/auth/utils/services/auth-action.service.js +15 -9
- package/dist/esm/modules/auth/utils/services/auth-action.service.js.map +1 -1
- package/dist/esm/modules/base/base.middlewares.js +10 -2
- package/dist/esm/modules/base/base.middlewares.js.map +1 -1
- package/dist/esm/modules/swagger/utils/helpers/get-authentication-json-schema-paths.js +27 -9
- package/dist/esm/modules/swagger/utils/helpers/get-authentication-json-schema-paths.js.map +1 -1
- package/dist/esm/modules/swagger/utils/helpers/get-file-upload-json-schema-paths.js +28 -11
- package/dist/esm/modules/swagger/utils/helpers/get-file-upload-json-schema-paths.js.map +1 -1
- package/dist/esm/modules/swagger/utils/helpers/missing-json-schemas-generator.js +3 -0
- package/dist/esm/modules/swagger/utils/helpers/missing-json-schemas-generator.js.map +1 -1
- package/dist/esm/utils/arkos-router/index.js +19 -6
- package/dist/esm/utils/arkos-router/index.js.map +1 -1
- package/dist/esm/utils/cli/dev.js +2 -46
- package/dist/esm/utils/cli/dev.js.map +1 -1
- package/dist/esm/utils/cli/start.js +11 -8
- package/dist/esm/utils/cli/start.js.map +1 -1
- package/dist/esm/utils/cli/utils/cli.helpers.js +1 -1
- package/dist/esm/utils/cli/utils/runtime-cli-commander.js +6 -6
- package/dist/esm/utils/cli/utils/runtime-cli-commander.js.map +1 -1
- package/dist/esm/utils/dotenv.helpers.js +6 -2
- package/dist/esm/utils/dotenv.helpers.js.map +1 -1
- package/dist/esm/utils/prisma/prisma-json-schema-generator.js +19 -4
- package/dist/esm/utils/prisma/prisma-json-schema-generator.js.map +1 -1
- package/dist/esm/utils/validate-dto.js +1 -2
- package/dist/esm/utils/validate-dto.js.map +1 -1
- package/dist/esm/utils/validate-schema.js +2 -4
- package/dist/esm/utils/validate-schema.js.map +1 -1
- package/dist/types/utils/arkos-router/index.d.ts +2 -1
- package/dist/types/utils/cli/dev.d.ts +1 -1
- package/dist/types/utils/cli/start.d.ts +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.middlewares.js","sourceRoot":"","sources":["../../../../src/modules/base/base.middlewares.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,SAAS,MAAM,sCAAsC,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,WAAW,MAAM,0BAA0B,CAAC;AACnD,OAAO,cAAc,MAAM,6BAA6B,CAAC;AAIzD,OAAO,EAAE,yBAAyB,EAAE,MAAM,0CAA0C,CAAC;AAErF,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAElE,MAAM,UAAU,QAAQ,CAAC,CAAU,EAAE,EAAY,EAAE,IAAkB;IACnE,IAAI,EAAE,CAAC;AACT,CAAC;AAKD,SAAS,SAAS,CAAC,CAAM,EAAE,CAAM;IAC/B,IAAI,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACzB,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,IAAI;QAAE,OAAO,KAAK,CAAC;IACzC,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,OAAO,CAAC,KAAK,QAAQ;QAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IAEnE,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC7B,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAE7B,IAAI,KAAK,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IAEhD,KAAK,MAAM,GAAG,IAAI,KAAK,EAAE,CAAC;QAC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G,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;YAClD,MAAM,SAAS,GAAI,UAAkB,EAAE,CAAC,GAAG,CAAC,CAAC;YAC7C,MAAM,oBAAoB,GAAG,IAAI,QAAQ,CACvC,WAAW,GAAG,+BAA+B,EAC7C,GAAG,EACH,UAAU,UAAU,CAAC,GAAG,CAAC,YAAY,EACrC,EAAE,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,EAAE,CACpB,CAAC;YAEF,IACE,CAAC,CAAC,OAAO,UAAU,KAAK,SAAS,IAAI,UAAU,KAAK,KAAK,CAAC;gBACxD,SAAS,KAAK,KAAK,CAAC;gBACtB,QAAQ;gBAER,MAAM,oBAAoB,CAAC;YAE7B,IAAI,gBAAgB,IAAI,CAAC,SAAS,IAAI,QAAQ;gBAC5C,MAAM,oBAAoB,CAAC;YAC7B,IAAI,SAAS;gBACX,GAAG,CAAC,GAAG,CAAC,GAAG,MAAM,WAAW,CAC1B,SAAS,EACT,GAAG,CAAC,GAAG,CAAC,EACR,WAAW,CAAC,UAAU,EAAE,iBAAiB,CAC1C,CAAC;QACN,CAAC;QAED,IAAI,EAAE,CAAC;IACT,CAAC,CACF,CAAC;AACJ,CAAC","sourcesContent":["import { NextFunction, Request, Response } from \"express\";\nimport {\n PrismaQueryOptions,\n ArkosNextFunction,\n ArkosRequest,\n ArkosRequestHandler,\n ArkosResponse,\n AuthPrismaQueryOptions,\n} from \"../../types\";\nimport { getArkosConfig } from \"../../server\";\nimport deepmerge from \"../../utils/helpers/deepmerge.helper\";\nimport { AppError, catchAsync } from \"../../exports/error-handler\";\nimport validateDto from \"../../utils/validate-dto\";\nimport validateSchema from \"../../utils/validate-schema\";\nimport { ZodSchema } from \"zod\";\nimport { ClassConstructor } from \"class-transformer\";\nimport { ValidatorOptions } from \"class-validator\";\nimport { resolvePrismaQueryOptions } from \"./utils/helpers/base.middlewares.helpers\";\nimport { ArkosRouteConfig } from \"../../utils/arkos-router/types\";\nimport { capitalize } from \"../../utils/helpers/text.helpers\";\nimport { isClass, isZodSchema } from \"../../utils/dynamic-loader\";\n\nexport function callNext(_: Request, _1: Response, next: NextFunction) {\n next();\n}\n\n/**\n * Deep comparison helper for objects\n */\nfunction deepEqual(a: any, b: any): boolean {\n if (a === b) return true;\n if (a == null || b == null) return false;\n if (typeof a !== \"object\" || typeof b !== \"object\") return a === b;\n\n const keysA = Object.keys(a);\n const keysB = Object.keys(b);\n\n if (keysA.length !== keysB.length) return false;\n\n for (const key of keysA) {\n if (!keysB.includes(key)) return false;\n if (!deepEqual(a[key], b[key])) return false;\n }\n\n return true;\n}\n\n/**\n * Sends response with backward compatibility support\n * Compares current values against original values to detect middleware changes\n * If values were modified by subsequent middleware, use the modified version\n */\nexport function sendResponse(req: ArkosRequest, res: ArkosResponse) {\n let responseData;\n let responseStatus;\n\n const originalData = (res as any).originalData;\n const originalStatus = (res as any).originalStatus;\n\n const currentReqData = req.responseData;\n const currentReqStatus = req.responseStatus;\n const currentLocalsData = res.locals?.data;\n const currentLocalsStatus = res.locals?.status;\n\n if (\n currentReqData !== undefined &&\n !deepEqual(currentReqData, originalData)\n ) {\n responseData = currentReqData;\n } else if (\n currentLocalsData !== undefined &&\n !deepEqual(currentLocalsData, originalData)\n ) {\n responseData = currentLocalsData;\n } else if (originalData !== undefined) {\n responseData = originalData;\n } else {\n responseData = currentReqData ?? currentLocalsData;\n }\n\n if (currentReqStatus !== undefined && currentReqStatus !== originalStatus) {\n responseStatus = currentReqStatus;\n } else if (\n currentLocalsStatus !== undefined &&\n currentLocalsStatus !== originalStatus\n ) {\n responseStatus = currentLocalsStatus;\n } else if (originalStatus !== undefined) {\n responseStatus = originalStatus;\n } else {\n responseStatus = currentReqStatus ?? currentLocalsStatus;\n }\n\n // Send response\n\n if (Number(responseStatus) === 204) {\n res.status(Number(responseStatus)).send();\n } else if (\n (responseData !== undefined || responseData !== null) &&\n responseStatus\n ) {\n res.status(Number(responseStatus)).json(responseData);\n } else if (\n Number(responseStatus) &&\n (responseData === undefined || responseData === null)\n ) {\n res.status(Number(responseStatus)).send();\n } else {\n res.status(500).json({\n message: \"No status or data attached to the response\",\n });\n }\n}\n\n/**\n * Type representing all possible actions that can be performed on a controller\n * Combines both standard CRUD operations and auth-specific operations\n */\nexport type ControllerActions =\n | keyof PrismaQueryOptions<any>\n | keyof Omit<AuthPrismaQueryOptions<any>, keyof PrismaQueryOptions<any>>;\n\n/**\n * Middleware to add Prisma query options to the request's query parameters.\n *\n * @template T - The type of the Prisma model.\n * @param {PrismaQueryOptions<T> | AuthPrismaQueryOptions<T>} prismaQueryOptions - The Prisma query options to attach.\n * @param {ControllerActions} action - The controller action to apply.\n * @returns A middleware function that attaches the query options to the request.\n */\nexport function addPrismaQueryOptionsToRequest<T extends Record<string, any>>(\n prismaQueryOptions: PrismaQueryOptions<T> | AuthPrismaQueryOptions<T>,\n action: ControllerActions\n) {\n return (req: ArkosRequest, _: ArkosResponse, next: NextFunction) => {\n const configs = getArkosConfig();\n\n const resolvedOptions = resolvePrismaQueryOptions(\n prismaQueryOptions,\n action\n );\n\n const requestQueryOptions = configs?.request?.parameters\n ?.allowDangerousPrismaQueryOptions\n ? JSON.parse((req.query?.prismaQueryOptions as string) || \"{}\")\n : {};\n\n req.prismaQueryOptions = deepmerge(resolvedOptions, requestQueryOptions);\n\n next();\n };\n}\n\n/**\n * Logs request events with colored text such as errors, requests responses.\n *\n */\nexport function handleRequestLogs(\n req: Request,\n res: Response,\n next: NextFunction\n) {\n const startTime = Date.now();\n\n const methodColors = {\n GET: \"\\x1b[36m\", // Cyan\n POST: \"\\x1b[32m\", // Green\n PUT: \"\\x1b[33m\", // Orange/Yellow\n PATCH: \"\\x1b[33m\", // Orange/Yellow\n DELETE: \"\\x1b[31m\", // Red\n HEAD: \"\\x1b[34m\", // Blue\n OPTIONS: \"\\x1b[34m\", // Blue\n };\n\n const getStatusColor = (statusCode: number) => {\n if (statusCode >= 200 && statusCode < 300) return \"\\x1b[32m\";\n if (statusCode >= 300 && statusCode < 400) return \"\\x1b[33m\";\n if (statusCode >= 400 && statusCode < 500) return \"\\x1b[33m\";\n if (statusCode >= 500) return \"\\x1b[31m\";\n return \"\\x1b[0m\";\n };\n\n res.on(\"finish\", () => {\n const duration = Date.now() - startTime;\n\n const now = new Date();\n const time = now.toTimeString().split(\" \")[0];\n\n const methodColor =\n methodColors[req.method as keyof typeof methodColors] || \"\\x1b[0m\";\n const statusColor = getStatusColor(res.statusCode);\n\n console.info(\n `[\\x1b[36mInfo\\x1b[0m] \\x1b[90m${time}\\x1b[0m ${methodColor}${\n req.method\n }\\x1b[0m ${decodeURIComponent(req.originalUrl)} ${statusColor}${\n res.statusCode\n }\\x1b[0m \\x1b[35m${duration}ms\\x1b[0m`\n );\n });\n\n next();\n}\n\nexport function handleRequestBodyValidationAndTransformation<T extends object>(\n schemaOrDtoClass?: ClassConstructor<T>,\n classValidatorValidationOptions?: ValidatorOptions\n): ArkosRequestHandler;\nexport function handleRequestBodyValidationAndTransformation<T extends object>(\n schemaOrDtoClass?: ZodSchema<T>\n): ArkosRequestHandler;\nexport function handleRequestBodyValidationAndTransformation<T extends object>(\n schemaOrDtoClass?: ZodSchema<T> | ClassConstructor<T>,\n classValidatorValidationOptions?: ValidatorOptions\n) {\n return catchAsync(\n async (req: ArkosRequest, _: ArkosResponse, next: ArkosNextFunction) => {\n const validationConfigs = getArkosConfig()?.validation;\n let body = req.body;\n\n if (validationConfigs?.resolver === \"class-validator\" && schemaOrDtoClass)\n req.body = await validateDto(\n schemaOrDtoClass as ClassConstructor<T>,\n body,\n deepmerge(\n {\n whitelist: true,\n ...classValidatorValidationOptions,\n },\n validationConfigs?.validationOptions || {}\n )\n );\n else if (validationConfigs?.resolver === \"zod\" && schemaOrDtoClass)\n req.body = await validateSchema(schemaOrDtoClass as ZodSchema<T>, body);\n\n next();\n }\n );\n}\n\nexport function validateRequestInputs(routeConfig: ArkosRouteConfig) {\n const arkosConfig = getArkosConfig();\n const validationConfig = arkosConfig.validation;\n const strictValidation = validationConfig?.strict;\n const validators = routeConfig?.validation;\n const openapi = routeConfig?.experimental?.openapi;\n\n const validationToParameterMapping = {\n query: \"query\",\n params: \"path\",\n headers: \"header\",\n cookies: \"cookie\",\n };\n\n if (!validationConfig?.resolver && validators)\n throw Error(\n \"Trying to pass validators into route config validation option without choosing a validation resolver under arkos config { validation: {} }.\"\n );\n\n if ((validators as any) === true)\n throw Error(\n `Invalid value ${validators} passed to validation option, it can only receive false or object of { query, body, params }.`\n );\n\n const validatorFn: (validator: any, data: any, options: any) => Promise<any> =\n validationConfig?.resolver == \"zod\" ? validateSchema : validateDto;\n const validatorsKey: (\"body\" | \"query\" | \"params\")[] = [\n \"body\",\n \"query\",\n \"params\",\n ];\n\n const isValidValidator =\n validationConfig?.resolver == \"zod\" ? isZodSchema : isClass;\n const validatorName =\n validationConfig?.resolver == \"zod\" ? \"zod schema\" : \"class-validator dto\";\n const validatorNameType =\n validationConfig?.resolver == \"zod\" ? \"Schema\" : \"Dto\";\n\n if (typeof validators === \"object\")\n validatorsKey.forEach((key) => {\n if (\n openapi &&\n typeof openapi === \"object\" &&\n key != \"body\" &&\n openapi.parameters?.some(\n (parameter: any) => parameter.in === validationToParameterMapping[key]\n ) &&\n validators[key]\n ) {\n throw Error(\n `When usign validation.${key} you must not define parameters under openapi.parameters as documentation of req.${key} because the ${validatorName} you passed under validation.${key} will be added as jsonSchema into the api documenation, if you wish to define documenation by yourself do not define validation.${key}.`\n );\n }\n\n if (\n openapi &&\n typeof openapi === \"object\" &&\n openapi.requestBody &&\n validators[key] &&\n key === \"body\"\n ) {\n throw Error(\n `When usign validation.${key} you must not define json-schema under openapi.requestBody as documentation for req.${key}, because the ${validatorName} you passed under validation.${key} will be added as json-schema into the api documenation, if you wish to define documenation by yourself do not define validation.${key}.`\n );\n }\n\n if (strictValidation && !(key in validators))\n throw Error(\n `No { validation: { ${key}: ${validatorNameType} } } was found, while using strict validation you will need to pass undefined into ${key} in order to deny any request ${key} input.`\n );\n\n if (\n key in validators &&\n validators?.[key] !== undefined &&\n validators?.[key] !== false &&\n !isValidValidator(validators[key])\n )\n throw Error(\n `Your validation resolver is set to ${arkosConfig.validation!.resolver}, please provide a valid ${validatorName} in order to use in { validation: { ${key}: ${validatorNameType} } } under route ${routeConfig.path}`\n );\n });\n\n return catchAsync(\n async (req: ArkosRequest, _: ArkosResponse, next: ArkosNextFunction) => {\n for (const key of validatorsKey) {\n const reqInput = Object.keys(req[key]).length > 0;\n const validator = (validators as any)?.[key];\n const notAllowedInputError = new AppError(\n `Request ${key} is not allowed on this route`,\n 400,\n `Request${capitalize(key)}NotAllowed`,\n { [key]: req[key] }\n );\n\n if (\n ((typeof validators === \"boolean\" && validators === false) ||\n validator === false) &&\n reqInput\n )\n throw notAllowedInputError;\n\n if (strictValidation && !validator && reqInput)\n throw notAllowedInputError;\n if (validator)\n req[key] = await validatorFn(\n validator,\n req[key],\n arkosConfig.validation?.validationOptions\n );\n }\n\n next();\n }\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"base.middlewares.js","sourceRoot":"","sources":["../../../../src/modules/base/base.middlewares.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,SAAS,MAAM,sCAAsC,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,WAAW,MAAM,0BAA0B,CAAC;AACnD,OAAO,cAAc,MAAM,6BAA6B,CAAC;AAIzD,OAAO,EAAE,yBAAyB,EAAE,MAAM,0CAA0C,CAAC;AAErF,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,MAAM,UAAU,QAAQ,CAAC,CAAU,EAAE,EAAY,EAAE,I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,CAC1B,SAAS,EACT,GAAG,CAAC,GAAG,CAAC,EACR,WAAW,CAAC,UAAU,EAAE,iBAAiB,CAC1C,CAAC;gBACJ,CAAC;gBAAC,OAAO,GAAQ,EAAE,CAAC;oBAClB,MAAM,IAAI,QAAQ,CAChB,mBAAmB,GAAG,EAAE,EACxB,GAAG,EACH,iBAAiB,UAAU,CAAC,GAAG,CAAC,EAAE,EAClC,CAAC,GAAG;wBACF,CAAC,gBAAgB,EAAE,QAAQ,KAAK,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;wBAC5D,EAAE,CACL,CAAC;gBACJ,CAAC;QACL,CAAC;QAED,IAAI,EAAE,CAAC;IACT,CAAC,CACF,CAAC;AACJ,CAAC","sourcesContent":["import { NextFunction, Request, Response } from \"express\";\nimport {\n PrismaQueryOptions,\n ArkosNextFunction,\n ArkosRequest,\n ArkosRequestHandler,\n ArkosResponse,\n AuthPrismaQueryOptions,\n} from \"../../types\";\nimport { getArkosConfig } from \"../../server\";\nimport deepmerge from \"../../utils/helpers/deepmerge.helper\";\nimport { AppError, catchAsync } from \"../../exports/error-handler\";\nimport validateDto from \"../../utils/validate-dto\";\nimport validateSchema from \"../../utils/validate-schema\";\nimport { ZodSchema } from \"zod\";\nimport { ClassConstructor } from \"class-transformer\";\nimport { ValidatorOptions } from \"class-validator\";\nimport { resolvePrismaQueryOptions } from \"./utils/helpers/base.middlewares.helpers\";\nimport { ArkosRouteConfig } from \"../../utils/arkos-router/types\";\nimport { capitalize } from \"../../utils/helpers/text.helpers\";\nimport { isClass, isZodSchema } from \"../../utils/dynamic-loader\";\nimport { pascalCase } from \"../../exports/utils\";\n\nexport function callNext(_: Request, _1: Response, next: NextFunction) {\n next();\n}\n\n/**\n * Deep comparison helper for objects\n */\nfunction deepEqual(a: any, b: any): boolean {\n if (a === b) return true;\n if (a == null || b == null) return false;\n if (typeof a !== \"object\" || typeof b !== \"object\") return a === b;\n\n const keysA = Object.keys(a);\n const keysB = Object.keys(b);\n\n if (keysA.length !== keysB.length) return false;\n\n for (const key of keysA) {\n if (!keysB.includes(key)) return false;\n if (!deepEqual(a[key], b[key])) return false;\n }\n\n return true;\n}\n\n/**\n * Sends response with backward compatibility support\n * Compares current values against original values to detect middleware changes\n * If values were modified by subsequent middleware, use the modified version\n */\nexport function sendResponse(req: ArkosRequest, res: ArkosResponse) {\n let responseData;\n let responseStatus;\n\n const originalData = (res as any).originalData;\n const originalStatus = (res as any).originalStatus;\n\n const currentReqData = req.responseData;\n const currentReqStatus = req.responseStatus;\n const currentLocalsData = res.locals?.data;\n const currentLocalsStatus = res.locals?.status;\n\n if (\n currentReqData !== undefined &&\n !deepEqual(currentReqData, originalData)\n ) {\n responseData = currentReqData;\n } else if (\n currentLocalsData !== undefined &&\n !deepEqual(currentLocalsData, originalData)\n ) {\n responseData = currentLocalsData;\n } else if (originalData !== undefined) {\n responseData = originalData;\n } else {\n responseData = currentReqData ?? currentLocalsData;\n }\n\n if (currentReqStatus !== undefined && currentReqStatus !== originalStatus) {\n responseStatus = currentReqStatus;\n } else if (\n currentLocalsStatus !== undefined &&\n currentLocalsStatus !== originalStatus\n ) {\n responseStatus = currentLocalsStatus;\n } else if (originalStatus !== undefined) {\n responseStatus = originalStatus;\n } else {\n responseStatus = currentReqStatus ?? currentLocalsStatus;\n }\n\n // Send response\n\n if (Number(responseStatus) === 204) {\n res.status(Number(responseStatus)).send();\n } else if (\n (responseData !== undefined || responseData !== null) &&\n responseStatus\n ) {\n res.status(Number(responseStatus)).json(responseData);\n } else if (\n Number(responseStatus) &&\n (responseData === undefined || responseData === null)\n ) {\n res.status(Number(responseStatus)).send();\n } else {\n res.status(500).json({\n message: \"No status or data attached to the response\",\n });\n }\n}\n\n/**\n * Type representing all possible actions that can be performed on a controller\n * Combines both standard CRUD operations and auth-specific operations\n */\nexport type ControllerActions =\n | keyof PrismaQueryOptions<any>\n | keyof Omit<AuthPrismaQueryOptions<any>, keyof PrismaQueryOptions<any>>;\n\n/**\n * Middleware to add Prisma query options to the request's query parameters.\n *\n * @template T - The type of the Prisma model.\n * @param {PrismaQueryOptions<T> | AuthPrismaQueryOptions<T>} prismaQueryOptions - The Prisma query options to attach.\n * @param {ControllerActions} action - The controller action to apply.\n * @returns A middleware function that attaches the query options to the request.\n */\nexport function addPrismaQueryOptionsToRequest<T extends Record<string, any>>(\n prismaQueryOptions: PrismaQueryOptions<T> | AuthPrismaQueryOptions<T>,\n action: ControllerActions\n) {\n return (req: ArkosRequest, _: ArkosResponse, next: NextFunction) => {\n const configs = getArkosConfig();\n\n const resolvedOptions = resolvePrismaQueryOptions(\n prismaQueryOptions,\n action\n );\n\n const requestQueryOptions = configs?.request?.parameters\n ?.allowDangerousPrismaQueryOptions\n ? JSON.parse((req.query?.prismaQueryOptions as string) || \"{}\")\n : {};\n\n req.prismaQueryOptions = deepmerge(resolvedOptions, requestQueryOptions);\n\n next();\n };\n}\n\n/**\n * Logs request events with colored text such as errors, requests responses.\n *\n */\nexport function handleRequestLogs(\n req: Request,\n res: Response,\n next: NextFunction\n) {\n const startTime = Date.now();\n\n const methodColors = {\n GET: \"\\x1b[36m\", // Cyan\n POST: \"\\x1b[32m\", // Green\n PUT: \"\\x1b[33m\", // Orange/Yellow\n PATCH: \"\\x1b[33m\", // Orange/Yellow\n DELETE: \"\\x1b[31m\", // Red\n HEAD: \"\\x1b[34m\", // Blue\n OPTIONS: \"\\x1b[34m\", // Blue\n };\n\n const getStatusColor = (statusCode: number) => {\n if (statusCode >= 200 && statusCode < 300) return \"\\x1b[32m\";\n if (statusCode >= 300 && statusCode < 400) return \"\\x1b[33m\";\n if (statusCode >= 400 && statusCode < 500) return \"\\x1b[33m\";\n if (statusCode >= 500) return \"\\x1b[31m\";\n return \"\\x1b[0m\";\n };\n\n res.on(\"finish\", () => {\n const duration = Date.now() - startTime;\n\n const now = new Date();\n const time = now.toTimeString().split(\" \")[0];\n\n const methodColor =\n methodColors[req.method as keyof typeof methodColors] || \"\\x1b[0m\";\n const statusColor = getStatusColor(res.statusCode);\n\n console.info(\n `[\\x1b[36mInfo\\x1b[0m] \\x1b[90m${time}\\x1b[0m ${methodColor}${\n req.method\n }\\x1b[0m ${decodeURIComponent(req.originalUrl)} ${statusColor}${\n res.statusCode\n }\\x1b[0m \\x1b[35m${duration}ms\\x1b[0m`\n );\n });\n\n next();\n}\n\nexport function handleRequestBodyValidationAndTransformation<T extends object>(\n schemaOrDtoClass?: ClassConstructor<T>,\n classValidatorValidationOptions?: ValidatorOptions\n): ArkosRequestHandler;\nexport function handleRequestBodyValidationAndTransformation<T extends object>(\n schemaOrDtoClass?: ZodSchema<T>\n): ArkosRequestHandler;\nexport function handleRequestBodyValidationAndTransformation<T extends object>(\n schemaOrDtoClass?: ZodSchema<T> | ClassConstructor<T>,\n classValidatorValidationOptions?: ValidatorOptions\n) {\n return catchAsync(\n async (req: ArkosRequest, _: ArkosResponse, next: ArkosNextFunction) => {\n const validationConfigs = getArkosConfig()?.validation;\n let body = req.body;\n\n if (validationConfigs?.resolver === \"class-validator\" && schemaOrDtoClass)\n req.body = await validateDto(\n schemaOrDtoClass as ClassConstructor<T>,\n body,\n deepmerge(\n {\n whitelist: true,\n ...classValidatorValidationOptions,\n },\n validationConfigs?.validationOptions || {}\n )\n );\n else if (validationConfigs?.resolver === \"zod\" && schemaOrDtoClass)\n req.body = await validateSchema(schemaOrDtoClass as ZodSchema<T>, body);\n\n next();\n }\n );\n}\n\nexport function validateRequestInputs(routeConfig: ArkosRouteConfig) {\n const arkosConfig = getArkosConfig();\n const validationConfig = arkosConfig.validation;\n const strictValidation = validationConfig?.strict;\n const validators = routeConfig?.validation;\n const openapi = routeConfig?.experimental?.openapi;\n\n const validationToParameterMapping = {\n query: \"query\",\n params: \"path\",\n headers: \"header\",\n cookies: \"cookie\",\n };\n\n if (!validationConfig?.resolver && validators)\n throw Error(\n \"Trying to pass validators into route config validation option without choosing a validation resolver under arkos config { validation: {} }.\"\n );\n\n if ((validators as any) === true)\n throw Error(\n `Invalid value ${validators} passed to validation option, it can only receive false or object of { query, body, params }.`\n );\n\n const validatorFn: (validator: any, data: any, options: any) => Promise<any> =\n validationConfig?.resolver == \"zod\" ? validateSchema : validateDto;\n const validatorsKey: (\"body\" | \"query\" | \"params\")[] = [\n \"body\",\n \"query\",\n \"params\",\n ];\n\n const isValidValidator =\n validationConfig?.resolver == \"zod\" ? isZodSchema : isClass;\n const validatorName =\n validationConfig?.resolver == \"zod\" ? \"zod schema\" : \"class-validator dto\";\n const validatorNameType =\n validationConfig?.resolver == \"zod\" ? \"Schema\" : \"Dto\";\n\n if (typeof validators === \"object\")\n validatorsKey.forEach((key) => {\n if (\n openapi &&\n typeof openapi === \"object\" &&\n key != \"body\" &&\n openapi.parameters?.some(\n (parameter: any) => parameter.in === validationToParameterMapping[key]\n ) &&\n validators[key]\n ) {\n throw Error(\n `When usign validation.${key} you must not define parameters under openapi.parameters as documentation of req.${key} because the ${validatorName} you passed under validation.${key} will be added as jsonSchema into the api documenation, if you wish to define documenation by yourself do not define validation.${key}.`\n );\n }\n\n if (\n openapi &&\n typeof openapi === \"object\" &&\n openapi.requestBody &&\n validators[key] &&\n key === \"body\"\n ) {\n throw Error(\n `When usign validation.${key} you must not define json-schema under openapi.requestBody as documentation for req.${key}, because the ${validatorName} you passed under validation.${key} will be added as json-schema into the api documenation, if you wish to define documenation by yourself do not define validation.${key}.`\n );\n }\n\n if (strictValidation && !(key in validators))\n throw Error(\n `No { validation: { ${key}: ${validatorNameType} } } was found, while using strict validation you will need to pass undefined into ${key} in order to deny any request ${key} input.`\n );\n\n if (\n key in validators &&\n validators?.[key] !== undefined &&\n validators?.[key] !== false &&\n !isValidValidator(validators[key])\n )\n throw Error(\n `Your validation resolver is set to ${arkosConfig.validation!.resolver}, please provide a valid ${validatorName} in order to use in { validation: { ${key}: ${validatorNameType} } } under route ${routeConfig.path}`\n );\n });\n\n return catchAsync(\n async (req: ArkosRequest, _: ArkosResponse, next: ArkosNextFunction) => {\n for (const key of validatorsKey) {\n const reqInput = Object.keys(req[key] || {}).length > 0;\n const validator = (validators as any)?.[key];\n const notAllowedInputError = new AppError(\n `Request ${key} is not allowed on this route`,\n 400,\n `Request${capitalize(key)}NotAllowed`,\n { [key]: req[key] }\n );\n\n if (\n ((typeof validators === \"boolean\" && validators === false) ||\n validator === false) &&\n reqInput\n )\n throw notAllowedInputError;\n\n if (strictValidation && !validator && reqInput)\n throw notAllowedInputError;\n if (validator)\n try {\n req[key] = await validatorFn(\n validator,\n req[key],\n arkosConfig.validation?.validationOptions\n );\n } catch (err: any) {\n throw new AppError(\n `Invalid request ${key}`,\n 400,\n `InvalidRequest${pascalCase(key)}`,\n (err &&\n (validationConfig?.resolver === \"zod\" ? err.format() : err)) ||\n {}\n );\n }\n }\n\n next();\n }\n );\n}\n"]}
|
|
@@ -39,7 +39,9 @@ export default function getAuthenticationJsonSchemaPaths(arkosConfig, existingPa
|
|
|
39
39
|
: currentPath?.summary,
|
|
40
40
|
description: currentPath?.description ||
|
|
41
41
|
"Authenticates a user and returns an access token",
|
|
42
|
-
operationId: currentPath?.operationId
|
|
42
|
+
operationId: currentPath?.operationId?.includes(pathname)
|
|
43
|
+
? "login"
|
|
44
|
+
: currentPath?.operationId,
|
|
43
45
|
requestBody: currentPath?.requestBody || {
|
|
44
46
|
description: "User credentials",
|
|
45
47
|
required: true,
|
|
@@ -90,7 +92,9 @@ export default function getAuthenticationJsonSchemaPaths(arkosConfig, existingPa
|
|
|
90
92
|
? "Logout from the system"
|
|
91
93
|
: currentPath?.summary,
|
|
92
94
|
description: currentPath?.description || "Invalidates the current user's JWT token",
|
|
93
|
-
operationId: currentPath?.operationId
|
|
95
|
+
operationId: currentPath?.operationId?.includes(pathname)
|
|
96
|
+
? "logout"
|
|
97
|
+
: currentPath?.operationId,
|
|
94
98
|
security: [{ BearerAuth: [] }],
|
|
95
99
|
responses: {
|
|
96
100
|
...(currentPath?.responses || {}),
|
|
@@ -117,7 +121,9 @@ export default function getAuthenticationJsonSchemaPaths(arkosConfig, existingPa
|
|
|
117
121
|
? "Register a new user"
|
|
118
122
|
: currentPath?.summary,
|
|
119
123
|
description: currentPath?.description || "Creates a new user account",
|
|
120
|
-
operationId: currentPath?.operationId
|
|
124
|
+
operationId: currentPath?.operationId?.includes(pathname)
|
|
125
|
+
? "signup"
|
|
126
|
+
: currentPath?.operationId,
|
|
121
127
|
requestBody: currentPath?.requestBody || {
|
|
122
128
|
description: "User registration data",
|
|
123
129
|
required: true,
|
|
@@ -164,7 +170,9 @@ export default function getAuthenticationJsonSchemaPaths(arkosConfig, existingPa
|
|
|
164
170
|
: currentPath?.summary,
|
|
165
171
|
description: currentPath?.description ||
|
|
166
172
|
"Changes the password for the authenticated user",
|
|
167
|
-
operationId: currentPath?.operationId
|
|
173
|
+
operationId: currentPath?.operationId?.includes(pathname)
|
|
174
|
+
? "updatePassword"
|
|
175
|
+
: currentPath?.operationId,
|
|
168
176
|
security: [{ BearerAuth: [] }],
|
|
169
177
|
requestBody: currentPath?.requestBody || {
|
|
170
178
|
description: "Current and new password",
|
|
@@ -222,7 +230,9 @@ export default function getAuthenticationJsonSchemaPaths(arkosConfig, existingPa
|
|
|
222
230
|
: currentPath?.summary,
|
|
223
231
|
description: currentPath?.description ||
|
|
224
232
|
"Retrieves information about the currently authenticated user",
|
|
225
|
-
operationId: currentPath?.operationId
|
|
233
|
+
operationId: currentPath?.operationId?.includes(pathname)
|
|
234
|
+
? "getMe"
|
|
235
|
+
: currentPath?.operationId,
|
|
226
236
|
security: [{ BearerAuth: [] }],
|
|
227
237
|
responses: {
|
|
228
238
|
...(currentPath?.responses || {}),
|
|
@@ -257,7 +267,9 @@ export default function getAuthenticationJsonSchemaPaths(arkosConfig, existingPa
|
|
|
257
267
|
: currentPath?.summary,
|
|
258
268
|
description: currentPath?.description ||
|
|
259
269
|
"Updates information for the currently authenticated user",
|
|
260
|
-
operationId: currentPath?.operationId
|
|
270
|
+
operationId: currentPath?.operationId?.includes(pathname)
|
|
271
|
+
? "updateMe"
|
|
272
|
+
: currentPath?.operationId,
|
|
261
273
|
security: [{ BearerAuth: [] }],
|
|
262
274
|
requestBody: currentPath?.requestBody || {
|
|
263
275
|
description: "User data to update",
|
|
@@ -304,7 +316,9 @@ export default function getAuthenticationJsonSchemaPaths(arkosConfig, existingPa
|
|
|
304
316
|
: currentPath?.summary,
|
|
305
317
|
description: currentPath?.description ||
|
|
306
318
|
"Marks the current user's account as deleted",
|
|
307
|
-
operationId: currentPath?.operationId
|
|
319
|
+
operationId: currentPath?.operationId?.includes(pathname)
|
|
320
|
+
? "deleteMe"
|
|
321
|
+
: currentPath?.operationId,
|
|
308
322
|
security: [{ BearerAuth: [] }],
|
|
309
323
|
responses: {
|
|
310
324
|
...(currentPath?.responses || {}),
|
|
@@ -343,7 +357,9 @@ export default function getAuthenticationJsonSchemaPaths(arkosConfig, existingPa
|
|
|
343
357
|
: currentPath?.summary,
|
|
344
358
|
description: currentPath?.description ||
|
|
345
359
|
"Retrieves a list of all available authentication actions and permissions",
|
|
346
|
-
operationId: currentPath?.operationId
|
|
360
|
+
operationId: currentPath?.operationId?.includes(pathname)
|
|
361
|
+
? "findManyAuthAction"
|
|
362
|
+
: currentPath?.operationId,
|
|
347
363
|
security: [{ BearerAuth: [] }],
|
|
348
364
|
responses: {
|
|
349
365
|
...(currentPath?.responses || {}),
|
|
@@ -410,7 +426,9 @@ export default function getAuthenticationJsonSchemaPaths(arkosConfig, existingPa
|
|
|
410
426
|
: currentPath?.summary,
|
|
411
427
|
description: currentPath?.description ||
|
|
412
428
|
"Retrieves all authentication actions for a specific resource",
|
|
413
|
-
operationId: currentPath?.operationId
|
|
429
|
+
operationId: currentPath?.operationId?.includes(pathname)
|
|
430
|
+
? "findOneAuthAction"
|
|
431
|
+
: currentPath?.operationId,
|
|
414
432
|
security: [{ BearerAuth: [] }],
|
|
415
433
|
parameters: mergedParameters,
|
|
416
434
|
responses: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-authentication-json-schema-paths.js","sourceRoot":"","sources":["../../../../../../src/modules/swagger/utils/helpers/get-authentication-json-schema-paths.ts"],"names":[],"mappings":"AACA,OAAO,EACL,YAAY,EACZ,wBAAwB,GACzB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,iDAAiD,CAAC;AAErF,MAAM,CAAC,MAAM,aAAa,GAAG,CAC3B,MAAc,EACd,WAAwB,EACc,EAAE;IACxC,MAAM,WAAW,GAAG,WAAW,CAAC,OAAO,EAAE,IAAI,CAAC;IAC9C,MAAM,QAAQ,GAAG,WAAW,CAAC,OAAO,EAAE,MAAM,CAAC;IAE7C,IAAI,CAAC,WAAW;QAAE,OAAO,QAAQ,CAAC;IAClC,IAAI,QAAQ;QAAE,OAAO,WAAW,CAAC;IAEjC,MAAM,SAAS,GAAG,MAAa,CAAC;IAChC,MAAM,eAAe,GAAG,wBAAwB,CAC9C,SAAS,EACT,MAAM,EACN,WAAW,CACZ,CAAC;IAEF,IAAI,CAAC,eAAe;QAAE,OAAO,QAAQ,CAAC;IACtC,OAAO,WAAW,CAAC;AACrB,CAAC,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,gCAAgC,CACtD,WAAwB,EACxB,aAAoC;IAEpC,MAAM,KAAK,GAA0B,EAAE,GAAG,aAAa,EAAE,CAAC;IAE1D,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,IAAI;QAAE,OAAO,KAAK,CAAC;IAE7C,MAAM,oBAAoB,GAAG,mBAAmB,CAAC,MAAM,CAAC,CAAC;IACzD,MAAM,YAAY,GAAG,oBAAoB,EAAE,MAAM;QAC/C,EAAE,MAA8B,CAAC;IAEnC,IAAI,YAAY,EAAE,OAAO,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IAEjD,MAAM,sBAAsB,GAAG,CAAC,QAAgB,EAAW,EAAE;QAC3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AAK,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC,KAAK,CAAC,IAAI;oBACxC,WAAW,EAAE,yBAAyB;iBACvC;gBACD,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC,KAAK,CAAC,IAAI;oBACxC,WAAW,EAAE,0BAA0B;iBACxC;gBACD,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC,KAAK,CAAC,IAAI;oBACxC,WAAW,EAAE,oBAAoB;iBAClC;aACF;SACF,CAAC;QAEF,KAAK,CAAC,QAAQ,CAAE,CAAC,GAAG,GAAG,EAAE,GAAG,CAAC,WAAW,IAAI,EAAE,CAAC,EAAE,GAAG,WAAW,EAAE,CAAC;IACpE,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import { OpenAPIV3 } from \"openapi-types\";\nimport {\n getSchemaRef,\n localValidatorFileExists,\n} from \"./swagger.router.helpers\";\nimport { ArkosConfig, RouterConfig } from \"../../../../exports\";\nimport { getModuleComponents } from \"../../../../utils/dynamic-loader\";\nimport { isEndpointDisabled } from \"../../../base/utils/helpers/base.router.helpers\";\n\nexport const getSchemaMode = (\n action: string,\n arkosConfig: ArkosConfig\n): \"prisma\" | \"zod\" | \"class-validator\" => {\n const swaggerMode = arkosConfig.swagger?.mode;\n const isStrict = arkosConfig.swagger?.strict;\n\n if (!swaggerMode) return \"prisma\";\n if (isStrict) return swaggerMode;\n\n const actionKey = action as any;\n const localFileExists = localValidatorFileExists(\n actionKey,\n \"auth\",\n arkosConfig\n );\n\n if (!localFileExists) return \"prisma\";\n return swaggerMode;\n};\n\nexport default function getAuthenticationJsonSchemaPaths(\n arkosConfig: ArkosConfig,\n existingPaths: OpenAPIV3.PathsObject\n) {\n const paths: OpenAPIV3.PathsObject = { ...existingPaths };\n\n if (!arkosConfig.swagger?.mode) return paths;\n\n const AuthModuleComponents = getModuleComponents(\"auth\");\n const routerConfig = AuthModuleComponents?.router\n ?.config as RouterConfig<\"auth\">;\n\n if (routerConfig?.disable === true) return paths;\n\n const isAuthEndpointDisabled = (endpoint: string): boolean => {\n return isEndpointDisabled(routerConfig, endpoint as any);\n };\n\n // Login\n if (!isAuthEndpointDisabled(\"login\")) {\n const pathname = \"/api/auth/login\";\n if (!paths[pathname]) paths[pathname] = {};\n const loginMode = getSchemaMode(\"login\", arkosConfig);\n const currentPath = paths[pathname]!.post;\n\n const defaultSpec = {\n tags: [\"Authentication\", ...(currentPath?.tags || [])].filter(\n (tag) => tag !== \"Defaults\"\n ),\n summary:\n currentPath?.summary === pathname || !currentPath?.summary\n ? \"Login to the system\"\n : currentPath?.summary,\n description:\n currentPath?.description ||\n \"Authenticates a user and returns an access token\",\n operationId: currentPath?.operationId || \"login\",\n requestBody: currentPath?.requestBody || {\n description: \"User credentials\",\n required: true,\n content: {\n \"application/json\": {\n schema: {\n $ref: getSchemaRef(\"Login\", loginMode),\n },\n },\n },\n },\n responses: {\n ...(currentPath?.responses || {}),\n \"200\": currentPath?.responses?.[\"200\"] || {\n description: \"Login successful\",\n content: {\n \"application/json\": {\n schema: {\n type: \"object\",\n properties: {\n accessToken: {\n type: \"string\",\n description: \"JWT access token\",\n },\n },\n },\n },\n },\n },\n \"400\": currentPath?.responses?.[\"400\"] || {\n description: \"Invalid input data\",\n },\n \"401\": currentPath?.responses?.[\"401\"] || {\n description: \"Invalid credentials\",\n },\n },\n };\n\n paths[pathname]!.post = { ...(currentPath || {}), ...defaultSpec };\n }\n\n // Logout\n if (!isAuthEndpointDisabled(\"logout\")) {\n const pathname = \"/api/auth/logout\";\n if (!paths[pathname]) paths[pathname] = {};\n const currentPath = paths[pathname]!.delete;\n\n const defaultSpec = {\n tags: [\"Authentication\", ...(currentPath?.tags || [])].filter(\n (tag) => tag !== \"Defaults\"\n ),\n summary:\n currentPath?.summary === pathname || !currentPath?.summary\n ? \"Logout from the system\"\n : currentPath?.summary,\n description:\n currentPath?.description || \"Invalidates the current user's JWT token\",\n operationId: currentPath?.operationId || \"logout\",\n security: [{ BearerAuth: [] }],\n responses: {\n ...(currentPath?.responses || {}),\n \"204\": currentPath?.responses?.[\"204\"] || {\n description: \"Logout successful\",\n },\n \"401\": currentPath?.responses?.[\"401\"] || {\n description: \"Authentication required\",\n },\n },\n };\n\n paths[pathname]!.delete = { ...(currentPath || {}), ...defaultSpec };\n }\n\n // Signup\n if (!isAuthEndpointDisabled(\"signup\")) {\n const pathname = \"/api/auth/signup\";\n if (!paths[pathname]) paths[pathname] = {};\n const signupMode = getSchemaMode(\"signup\", arkosConfig);\n const userMode = getSchemaMode(\"user\", arkosConfig);\n const currentPath = paths[pathname]!.post;\n\n const defaultSpec = {\n tags: [\"Authentication\", ...(currentPath?.tags || [])].filter(\n (tag) => tag !== \"Defaults\"\n ),\n summary:\n currentPath?.summary === pathname || !currentPath?.summary\n ? \"Register a new user\"\n : currentPath?.summary,\n description: currentPath?.description || \"Creates a new user account\",\n operationId: currentPath?.operationId || \"signup\",\n requestBody: currentPath?.requestBody || {\n description: \"User registration data\",\n required: true,\n content: {\n \"application/json\": {\n schema: {\n $ref: getSchemaRef(\"Signup\", signupMode),\n },\n },\n },\n },\n responses: {\n ...(currentPath?.responses || {}),\n \"201\": currentPath?.responses?.[\"201\"] || {\n description: \"User created successfully\",\n content: {\n \"application/json\": {\n schema: {\n $ref: getSchemaRef(\"User\", userMode),\n },\n },\n },\n },\n \"400\": currentPath?.responses?.[\"400\"] || {\n description: \"Invalid input data\",\n },\n \"409\": currentPath?.responses?.[\"409\"] || {\n description: \"User already exists\",\n },\n },\n };\n\n paths[pathname]!.post = { ...(currentPath || {}), ...defaultSpec };\n }\n\n // Update Password\n if (!isAuthEndpointDisabled(\"updatePassword\")) {\n const pathname = \"/api/auth/update-password\";\n if (!paths[pathname]) paths[pathname] = {};\n const updatePasswordMode = getSchemaMode(\"updatePassword\", arkosConfig);\n const currentPath = paths[pathname]!.post;\n\n const defaultSpec = {\n tags: [\"Authentication\", ...(currentPath?.tags || [])].filter(\n (tag) => tag !== \"Defaults\"\n ),\n summary:\n currentPath?.summary === pathname || !currentPath?.summary\n ? \"Update user password\"\n : currentPath?.summary,\n description:\n currentPath?.description ||\n \"Changes the password for the authenticated user\",\n operationId: currentPath?.operationId || \"updatePassword\",\n security: [{ BearerAuth: [] }],\n requestBody: currentPath?.requestBody || {\n description: \"Current and new password\",\n required: true,\n content: {\n \"application/json\": {\n schema: {\n $ref: getSchemaRef(\"UpdatePassword\", updatePasswordMode),\n },\n },\n },\n },\n responses: {\n ...(currentPath?.responses || {}),\n \"200\": currentPath?.responses?.[\"200\"] || {\n description: \"Password updated successfully\",\n content: {\n \"application/json\": {\n schema: {\n type: \"object\",\n properties: {\n status: {\n type: \"string\",\n example: \"success\",\n },\n message: {\n type: \"string\",\n example: \"Password updated successfully!\",\n },\n },\n },\n },\n },\n },\n \"400\": currentPath?.responses?.[\"400\"] || {\n description: \"Invalid input data or current password incorrect\",\n },\n \"401\": currentPath?.responses?.[\"401\"] || {\n description: \"Authentication required\",\n },\n },\n };\n\n paths[pathname]!.post = { ...(currentPath || {}), ...defaultSpec };\n }\n\n // Get Me\n if (!isAuthEndpointDisabled(\"getMe\")) {\n const pathname = \"/api/users/me\";\n if (!paths[pathname]) paths[pathname] = {};\n const findMeMode = getSchemaMode(\"getMe\", arkosConfig);\n const currentPath = paths[pathname]!.get;\n\n const defaultSpec = {\n tags: [\"Authentication\", ...(currentPath?.tags || [])].filter(\n (tag) => tag !== \"Defaults\"\n ),\n summary:\n currentPath?.summary === pathname || !currentPath?.summary\n ? \"Get current user information\"\n : currentPath?.summary,\n description:\n currentPath?.description ||\n \"Retrieves information about the currently authenticated user\",\n operationId: currentPath?.operationId || \"getMe\",\n security: [{ BearerAuth: [] }],\n responses: {\n ...(currentPath?.responses || {}),\n \"200\": currentPath?.responses?.[\"200\"] || {\n description: \"User information retrieved successfully\",\n content: {\n \"application/json\": {\n schema: {\n $ref: getSchemaRef(\"GetMe\", findMeMode),\n },\n },\n },\n },\n \"401\": currentPath?.responses?.[\"401\"] || {\n description: \"Authentication required\",\n },\n },\n };\n\n paths[pathname]!.get = { ...(currentPath || {}), ...defaultSpec };\n }\n\n // Update Me\n if (!isAuthEndpointDisabled(\"updateMe\")) {\n const pathname = \"/api/users/me\";\n if (!paths[pathname]) paths[pathname] = {};\n const updateMeMode = getSchemaMode(\"updateMe\", arkosConfig);\n const userMode = getSchemaMode(\"user\", arkosConfig);\n const currentPath = paths[pathname]!.patch;\n\n const defaultSpec = {\n tags: [\"Authentication\", ...(currentPath?.tags || [])].filter(\n (tag) => tag !== \"Defaults\"\n ),\n summary:\n currentPath?.summary === pathname || !currentPath?.summary\n ? \"Update current user information\"\n : currentPath?.summary,\n description:\n currentPath?.description ||\n \"Updates information for the currently authenticated user\",\n operationId: currentPath?.operationId || \"updateMe\",\n security: [{ BearerAuth: [] }],\n requestBody: currentPath?.requestBody || {\n description: \"User data to update\",\n required: true,\n content: {\n \"application/json\": {\n schema: {\n $ref: getSchemaRef(\"UpdateMe\", updateMeMode),\n },\n },\n },\n },\n responses: {\n ...(currentPath?.responses || {}),\n \"200\": currentPath?.responses?.[\"200\"] || {\n description: \"User updated successfully\",\n content: {\n \"application/json\": {\n schema: {\n $ref: getSchemaRef(\"User\", userMode),\n },\n },\n },\n },\n \"400\": currentPath?.responses?.[\"400\"] || {\n description: \"Invalid input data\",\n },\n \"401\": currentPath?.responses?.[\"401\"] || {\n description: \"Authentication required\",\n },\n },\n };\n\n paths[pathname]!.patch = { ...(currentPath || {}), ...defaultSpec };\n }\n\n // Delete Me\n if (!isAuthEndpointDisabled(\"deleteMe\")) {\n const pathname = \"/api/users/me\";\n if (!paths[pathname]) paths[pathname] = {};\n const currentPath = paths[pathname]!.delete;\n\n const defaultSpec = {\n tags: [\"Authentication\", ...(currentPath?.tags || [])].filter(\n (tag) => tag !== \"Defaults\"\n ),\n summary:\n currentPath?.summary === pathname || !currentPath?.summary\n ? \"Delete current user account\"\n : currentPath?.summary,\n description:\n currentPath?.description ||\n \"Marks the current user's account as deleted\",\n operationId: currentPath?.operationId || \"deleteMe\",\n security: [{ BearerAuth: [] }],\n responses: {\n ...(currentPath?.responses || {}),\n \"200\": currentPath?.responses?.[\"200\"] || {\n description: \"Account deleted successfully\",\n content: {\n \"application/json\": {\n schema: {\n type: \"object\",\n properties: {\n message: {\n type: \"string\",\n example: \"Account deleted successfully\",\n },\n },\n },\n },\n },\n },\n \"401\": currentPath?.responses?.[\"401\"] || {\n description: \"Authentication required\",\n },\n },\n };\n\n paths[pathname]!.delete = { ...(currentPath || {}), ...defaultSpec };\n }\n\n // Find Many Auth Action\n if (!isAuthEndpointDisabled(\"findManyAuthAction\")) {\n const pathname = \"/api/auth-actions\";\n if (!paths[pathname]) paths[pathname] = {};\n const currentPath = paths[pathname]!.get;\n\n const defaultSpec = {\n tags: [\"Authentication\", ...(currentPath?.tags || [])].filter(\n (tag) => tag !== \"Defaults\"\n ),\n summary:\n currentPath?.summary === pathname || !currentPath?.summary\n ? \"Get all authentication actions\"\n : currentPath?.summary,\n description:\n currentPath?.description ||\n \"Retrieves a list of all available authentication actions and permissions\",\n operationId: currentPath?.operationId || \"findManyAuthAction\",\n security: [{ BearerAuth: [] }],\n responses: {\n ...(currentPath?.responses || {}),\n \"200\": currentPath?.responses?.[\"200\"] || {\n description: \"Auth actions retrieved successfully\",\n content: {\n \"application/json\": {\n schema: {\n type: \"object\",\n properties: {\n total: {\n type: \"number\",\n description: \"Total number of auth actions\",\n },\n results: {\n type: \"number\",\n description: \"Number of auth actions returned\",\n },\n data: {\n type: \"array\",\n items: {\n $ref: \"#/components/schemas/FindManyAuthActionSystemSchema\",\n },\n },\n },\n },\n },\n },\n },\n \"401\": currentPath?.responses?.[\"401\"] || {\n description: \"Authentication required\",\n },\n \"403\": currentPath?.responses?.[\"403\"] || {\n description: \"Insufficient permissions\",\n },\n },\n };\n\n paths[pathname]!.get = { ...(currentPath || {}), ...defaultSpec };\n }\n\n if (!isAuthEndpointDisabled(\"findOneAuthAction\")) {\n const pathname = \"/api/auth-actions/{resourceName}\";\n if (!paths[pathname]) paths[pathname] = {};\n const currentPath = paths[pathname]!.get;\n\n const defaultParameters: OpenAPIV3.ParameterObject[] = [\n {\n name: \"resourceName\",\n in: \"path\",\n description: \"Name of the resource to retrieve auth actions for\",\n required: true,\n schema: { type: \"string\" },\n },\n ];\n\n const existingParams =\n (currentPath?.parameters as OpenAPIV3.ParameterObject[]) || [];\n const existingParamKeys = new Set(\n existingParams.map((p) => `${p.in}-${p.name}`)\n );\n\n const mergedParameters = [\n ...existingParams,\n ...defaultParameters.filter(\n (p) => !existingParamKeys.has(`${p.in}-${p.name}`)\n ),\n ];\n\n const defaultSpec = {\n tags: [\"Authentication\", ...(currentPath?.tags || [])].filter(\n (tag) => tag !== \"Defaults\"\n ),\n summary:\n currentPath?.summary === pathname || !currentPath?.summary\n ? \"Get authentication actions by resource\"\n : currentPath?.summary,\n description:\n currentPath?.description ||\n \"Retrieves all authentication actions for a specific resource\",\n operationId: currentPath?.operationId || \"findOneAuthAction\",\n security: [{ BearerAuth: [] }],\n parameters: mergedParameters,\n responses: {\n ...(currentPath?.responses || {}),\n \"200\": currentPath?.responses?.[\"200\"] || {\n description: \"Auth actions for resource retrieved successfully\",\n content: {\n \"application/json\": {\n schema: {\n type: \"object\",\n properties: {\n total: {\n type: \"number\",\n description:\n \"Total number of auth actions for this resource\",\n },\n results: {\n type: \"number\",\n description: \"Number of auth actions returned\",\n },\n data: {\n type: \"array\",\n items: {\n $ref: \"#/components/schemas/FindManyAuthActionSystemSchema\",\n },\n },\n },\n },\n },\n },\n },\n \"401\": currentPath?.responses?.[\"401\"] || {\n description: \"Authentication required\",\n },\n \"403\": currentPath?.responses?.[\"403\"] || {\n description: \"Insufficient permissions\",\n },\n \"404\": currentPath?.responses?.[\"404\"] || {\n description: \"Resource not found\",\n },\n },\n };\n\n paths[pathname]!.get = { ...(currentPath || {}), ...defaultSpec };\n }\n\n return paths;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"get-authentication-json-schema-pa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\nimport {\n getSchemaRef,\n localValidatorFileExists,\n} from \"./swagger.router.helpers\";\nimport { ArkosConfig, RouterConfig } from \"../../../../exports\";\nimport { getModuleComponents } from \"../../../../utils/dynamic-loader\";\nimport { isEndpointDisabled } from \"../../../base/utils/helpers/base.router.helpers\";\n\nexport const getSchemaMode = (\n action: string,\n arkosConfig: ArkosConfig\n): \"prisma\" | \"zod\" | \"class-validator\" => {\n const swaggerMode = arkosConfig.swagger?.mode;\n const isStrict = arkosConfig.swagger?.strict;\n\n if (!swaggerMode) return \"prisma\";\n if (isStrict) return swaggerMode;\n\n const actionKey = action as any;\n const localFileExists = localValidatorFileExists(\n actionKey,\n \"auth\",\n arkosConfig\n );\n\n if (!localFileExists) return \"prisma\";\n return swaggerMode;\n};\n\nexport default function getAuthenticationJsonSchemaPaths(\n arkosConfig: ArkosConfig,\n existingPaths: OpenAPIV3.PathsObject\n) {\n const paths: OpenAPIV3.PathsObject = { ...existingPaths };\n\n if (!arkosConfig.swagger?.mode) return paths;\n\n const AuthModuleComponents = getModuleComponents(\"auth\");\n const routerConfig = AuthModuleComponents?.router\n ?.config as RouterConfig<\"auth\">;\n\n if (routerConfig?.disable === true) return paths;\n\n const isAuthEndpointDisabled = (endpoint: string): boolean => {\n return isEndpointDisabled(routerConfig, endpoint as any);\n };\n\n // Login\n if (!isAuthEndpointDisabled(\"login\")) {\n const pathname = \"/api/auth/login\";\n if (!paths[pathname]) paths[pathname] = {};\n const loginMode = getSchemaMode(\"login\", arkosConfig);\n const currentPath = paths[pathname]!.post;\n\n const defaultSpec = {\n tags: [\"Authentication\", ...(currentPath?.tags || [])].filter(\n (tag) => tag !== \"Defaults\"\n ),\n summary:\n currentPath?.summary === pathname || !currentPath?.summary\n ? \"Login to the system\"\n : currentPath?.summary,\n description:\n currentPath?.description ||\n \"Authenticates a user and returns an access token\",\n operationId: currentPath?.operationId?.includes(pathname)\n ? \"login\"\n : currentPath?.operationId,\n requestBody: currentPath?.requestBody || {\n description: \"User credentials\",\n required: true,\n content: {\n \"application/json\": {\n schema: {\n $ref: getSchemaRef(\"Login\", loginMode),\n },\n },\n },\n },\n responses: {\n ...(currentPath?.responses || {}),\n \"200\": currentPath?.responses?.[\"200\"] || {\n description: \"Login successful\",\n content: {\n \"application/json\": {\n schema: {\n type: \"object\",\n properties: {\n accessToken: {\n type: \"string\",\n description: \"JWT access token\",\n },\n },\n },\n },\n },\n },\n \"400\": currentPath?.responses?.[\"400\"] || {\n description: \"Invalid input data\",\n },\n \"401\": currentPath?.responses?.[\"401\"] || {\n description: \"Invalid credentials\",\n },\n },\n };\n\n paths[pathname]!.post = { ...(currentPath || {}), ...defaultSpec };\n }\n\n // Logout\n if (!isAuthEndpointDisabled(\"logout\")) {\n const pathname = \"/api/auth/logout\";\n if (!paths[pathname]) paths[pathname] = {};\n const currentPath = paths[pathname]!.delete;\n\n const defaultSpec = {\n tags: [\"Authentication\", ...(currentPath?.tags || [])].filter(\n (tag) => tag !== \"Defaults\"\n ),\n summary:\n currentPath?.summary === pathname || !currentPath?.summary\n ? \"Logout from the system\"\n : currentPath?.summary,\n description:\n currentPath?.description || \"Invalidates the current user's JWT token\",\n operationId: currentPath?.operationId?.includes(pathname)\n ? \"logout\"\n : currentPath?.operationId,\n security: [{ BearerAuth: [] }],\n responses: {\n ...(currentPath?.responses || {}),\n \"204\": currentPath?.responses?.[\"204\"] || {\n description: \"Logout successful\",\n },\n \"401\": currentPath?.responses?.[\"401\"] || {\n description: \"Authentication required\",\n },\n },\n };\n\n paths[pathname]!.delete = { ...(currentPath || {}), ...defaultSpec };\n }\n\n // Signup\n if (!isAuthEndpointDisabled(\"signup\")) {\n const pathname = \"/api/auth/signup\";\n if (!paths[pathname]) paths[pathname] = {};\n const signupMode = getSchemaMode(\"signup\", arkosConfig);\n const userMode = getSchemaMode(\"user\", arkosConfig);\n const currentPath = paths[pathname]!.post;\n\n const defaultSpec = {\n tags: [\"Authentication\", ...(currentPath?.tags || [])].filter(\n (tag) => tag !== \"Defaults\"\n ),\n summary:\n currentPath?.summary === pathname || !currentPath?.summary\n ? \"Register a new user\"\n : currentPath?.summary,\n description: currentPath?.description || \"Creates a new user account\",\n operationId: currentPath?.operationId?.includes(pathname)\n ? \"signup\"\n : currentPath?.operationId,\n requestBody: currentPath?.requestBody || {\n description: \"User registration data\",\n required: true,\n content: {\n \"application/json\": {\n schema: {\n $ref: getSchemaRef(\"Signup\", signupMode),\n },\n },\n },\n },\n responses: {\n ...(currentPath?.responses || {}),\n \"201\": currentPath?.responses?.[\"201\"] || {\n description: \"User created successfully\",\n content: {\n \"application/json\": {\n schema: {\n $ref: getSchemaRef(\"User\", userMode),\n },\n },\n },\n },\n \"400\": currentPath?.responses?.[\"400\"] || {\n description: \"Invalid input data\",\n },\n \"409\": currentPath?.responses?.[\"409\"] || {\n description: \"User already exists\",\n },\n },\n };\n\n paths[pathname]!.post = { ...(currentPath || {}), ...defaultSpec };\n }\n\n // Update Password\n if (!isAuthEndpointDisabled(\"updatePassword\")) {\n const pathname = \"/api/auth/update-password\";\n if (!paths[pathname]) paths[pathname] = {};\n const updatePasswordMode = getSchemaMode(\"updatePassword\", arkosConfig);\n const currentPath = paths[pathname]!.post;\n\n const defaultSpec = {\n tags: [\"Authentication\", ...(currentPath?.tags || [])].filter(\n (tag) => tag !== \"Defaults\"\n ),\n summary:\n currentPath?.summary === pathname || !currentPath?.summary\n ? \"Update user password\"\n : currentPath?.summary,\n description:\n currentPath?.description ||\n \"Changes the password for the authenticated user\",\n operationId: currentPath?.operationId?.includes(pathname)\n ? \"updatePassword\"\n : currentPath?.operationId,\n security: [{ BearerAuth: [] }],\n requestBody: currentPath?.requestBody || {\n description: \"Current and new password\",\n required: true,\n content: {\n \"application/json\": {\n schema: {\n $ref: getSchemaRef(\"UpdatePassword\", updatePasswordMode),\n },\n },\n },\n },\n responses: {\n ...(currentPath?.responses || {}),\n \"200\": currentPath?.responses?.[\"200\"] || {\n description: \"Password updated successfully\",\n content: {\n \"application/json\": {\n schema: {\n type: \"object\",\n properties: {\n status: {\n type: \"string\",\n example: \"success\",\n },\n message: {\n type: \"string\",\n example: \"Password updated successfully!\",\n },\n },\n },\n },\n },\n },\n \"400\": currentPath?.responses?.[\"400\"] || {\n description: \"Invalid input data or current password incorrect\",\n },\n \"401\": currentPath?.responses?.[\"401\"] || {\n description: \"Authentication required\",\n },\n },\n };\n\n paths[pathname]!.post = { ...(currentPath || {}), ...defaultSpec };\n }\n\n // Get Me\n if (!isAuthEndpointDisabled(\"getMe\")) {\n const pathname = \"/api/users/me\";\n if (!paths[pathname]) paths[pathname] = {};\n const findMeMode = getSchemaMode(\"getMe\", arkosConfig);\n const currentPath = paths[pathname]!.get;\n\n const defaultSpec = {\n tags: [\"Authentication\", ...(currentPath?.tags || [])].filter(\n (tag) => tag !== \"Defaults\"\n ),\n summary:\n currentPath?.summary === pathname || !currentPath?.summary\n ? \"Get current user information\"\n : currentPath?.summary,\n description:\n currentPath?.description ||\n \"Retrieves information about the currently authenticated user\",\n operationId: currentPath?.operationId?.includes(pathname)\n ? \"getMe\"\n : currentPath?.operationId,\n security: [{ BearerAuth: [] }],\n responses: {\n ...(currentPath?.responses || {}),\n \"200\": currentPath?.responses?.[\"200\"] || {\n description: \"User information retrieved successfully\",\n content: {\n \"application/json\": {\n schema: {\n $ref: getSchemaRef(\"GetMe\", findMeMode),\n },\n },\n },\n },\n \"401\": currentPath?.responses?.[\"401\"] || {\n description: \"Authentication required\",\n },\n },\n };\n\n paths[pathname]!.get = { ...(currentPath || {}), ...defaultSpec };\n }\n\n // Update Me\n if (!isAuthEndpointDisabled(\"updateMe\")) {\n const pathname = \"/api/users/me\";\n if (!paths[pathname]) paths[pathname] = {};\n const updateMeMode = getSchemaMode(\"updateMe\", arkosConfig);\n const userMode = getSchemaMode(\"user\", arkosConfig);\n const currentPath = paths[pathname]!.patch;\n\n const defaultSpec = {\n tags: [\"Authentication\", ...(currentPath?.tags || [])].filter(\n (tag) => tag !== \"Defaults\"\n ),\n summary:\n currentPath?.summary === pathname || !currentPath?.summary\n ? \"Update current user information\"\n : currentPath?.summary,\n description:\n currentPath?.description ||\n \"Updates information for the currently authenticated user\",\n operationId: currentPath?.operationId?.includes(pathname)\n ? \"updateMe\"\n : currentPath?.operationId,\n security: [{ BearerAuth: [] }],\n requestBody: currentPath?.requestBody || {\n description: \"User data to update\",\n required: true,\n content: {\n \"application/json\": {\n schema: {\n $ref: getSchemaRef(\"UpdateMe\", updateMeMode),\n },\n },\n },\n },\n responses: {\n ...(currentPath?.responses || {}),\n \"200\": currentPath?.responses?.[\"200\"] || {\n description: \"User updated successfully\",\n content: {\n \"application/json\": {\n schema: {\n $ref: getSchemaRef(\"User\", userMode),\n },\n },\n },\n },\n \"400\": currentPath?.responses?.[\"400\"] || {\n description: \"Invalid input data\",\n },\n \"401\": currentPath?.responses?.[\"401\"] || {\n description: \"Authentication required\",\n },\n },\n };\n\n paths[pathname]!.patch = { ...(currentPath || {}), ...defaultSpec };\n }\n\n // Delete Me\n if (!isAuthEndpointDisabled(\"deleteMe\")) {\n const pathname = \"/api/users/me\";\n if (!paths[pathname]) paths[pathname] = {};\n const currentPath = paths[pathname]!.delete;\n\n const defaultSpec = {\n tags: [\"Authentication\", ...(currentPath?.tags || [])].filter(\n (tag) => tag !== \"Defaults\"\n ),\n summary:\n currentPath?.summary === pathname || !currentPath?.summary\n ? \"Delete current user account\"\n : currentPath?.summary,\n description:\n currentPath?.description ||\n \"Marks the current user's account as deleted\",\n operationId: currentPath?.operationId?.includes(pathname)\n ? \"deleteMe\"\n : currentPath?.operationId,\n security: [{ BearerAuth: [] }],\n responses: {\n ...(currentPath?.responses || {}),\n \"200\": currentPath?.responses?.[\"200\"] || {\n description: \"Account deleted successfully\",\n content: {\n \"application/json\": {\n schema: {\n type: \"object\",\n properties: {\n message: {\n type: \"string\",\n example: \"Account deleted successfully\",\n },\n },\n },\n },\n },\n },\n \"401\": currentPath?.responses?.[\"401\"] || {\n description: \"Authentication required\",\n },\n },\n };\n\n paths[pathname]!.delete = { ...(currentPath || {}), ...defaultSpec };\n }\n\n // Find Many Auth Action\n if (!isAuthEndpointDisabled(\"findManyAuthAction\")) {\n const pathname = \"/api/auth-actions\";\n if (!paths[pathname]) paths[pathname] = {};\n const currentPath = paths[pathname]!.get;\n\n const defaultSpec = {\n tags: [\"Authentication\", ...(currentPath?.tags || [])].filter(\n (tag) => tag !== \"Defaults\"\n ),\n summary:\n currentPath?.summary === pathname || !currentPath?.summary\n ? \"Get all authentication actions\"\n : currentPath?.summary,\n description:\n currentPath?.description ||\n \"Retrieves a list of all available authentication actions and permissions\",\n operationId: currentPath?.operationId?.includes(pathname)\n ? \"findManyAuthAction\"\n : currentPath?.operationId,\n security: [{ BearerAuth: [] }],\n responses: {\n ...(currentPath?.responses || {}),\n \"200\": currentPath?.responses?.[\"200\"] || {\n description: \"Auth actions retrieved successfully\",\n content: {\n \"application/json\": {\n schema: {\n type: \"object\",\n properties: {\n total: {\n type: \"number\",\n description: \"Total number of auth actions\",\n },\n results: {\n type: \"number\",\n description: \"Number of auth actions returned\",\n },\n data: {\n type: \"array\",\n items: {\n $ref: \"#/components/schemas/FindManyAuthActionSystemSchema\",\n },\n },\n },\n },\n },\n },\n },\n \"401\": currentPath?.responses?.[\"401\"] || {\n description: \"Authentication required\",\n },\n \"403\": currentPath?.responses?.[\"403\"] || {\n description: \"Insufficient permissions\",\n },\n },\n };\n\n paths[pathname]!.get = { ...(currentPath || {}), ...defaultSpec };\n }\n\n if (!isAuthEndpointDisabled(\"findOneAuthAction\")) {\n const pathname = \"/api/auth-actions/{resourceName}\";\n if (!paths[pathname]) paths[pathname] = {};\n const currentPath = paths[pathname]!.get;\n\n const defaultParameters: OpenAPIV3.ParameterObject[] = [\n {\n name: \"resourceName\",\n in: \"path\",\n description: \"Name of the resource to retrieve auth actions for\",\n required: true,\n schema: { type: \"string\" },\n },\n ];\n\n const existingParams =\n (currentPath?.parameters as OpenAPIV3.ParameterObject[]) || [];\n const existingParamKeys = new Set(\n existingParams.map((p) => `${p.in}-${p.name}`)\n );\n\n const mergedParameters = [\n ...existingParams,\n ...defaultParameters.filter(\n (p) => !existingParamKeys.has(`${p.in}-${p.name}`)\n ),\n ];\n\n const defaultSpec = {\n tags: [\"Authentication\", ...(currentPath?.tags || [])].filter(\n (tag) => tag !== \"Defaults\"\n ),\n summary:\n currentPath?.summary === pathname || !currentPath?.summary\n ? \"Get authentication actions by resource\"\n : currentPath?.summary,\n description:\n currentPath?.description ||\n \"Retrieves all authentication actions for a specific resource\",\n operationId: currentPath?.operationId?.includes(pathname)\n ? \"findOneAuthAction\"\n : currentPath?.operationId,\n security: [{ BearerAuth: [] }],\n parameters: mergedParameters,\n responses: {\n ...(currentPath?.responses || {}),\n \"200\": currentPath?.responses?.[\"200\"] || {\n description: \"Auth actions for resource retrieved successfully\",\n content: {\n \"application/json\": {\n schema: {\n type: \"object\",\n properties: {\n total: {\n type: \"number\",\n description:\n \"Total number of auth actions for this resource\",\n },\n results: {\n type: \"number\",\n description: \"Number of auth actions returned\",\n },\n data: {\n type: \"array\",\n items: {\n $ref: \"#/components/schemas/FindManyAuthActionSystemSchema\",\n },\n },\n },\n },\n },\n },\n },\n \"401\": currentPath?.responses?.[\"401\"] || {\n description: \"Authentication required\",\n },\n \"403\": currentPath?.responses?.[\"403\"] || {\n description: \"Insufficient permissions\",\n },\n \"404\": currentPath?.responses?.[\"404\"] || {\n description: \"Resource not found\",\n },\n },\n };\n\n paths[pathname]!.get = { ...(currentPath || {}), ...defaultSpec };\n }\n\n return paths;\n}\n"]}
|
|
@@ -78,9 +78,13 @@ export default function getFileUploadJsonSchemaPaths(arkosConfig, existingPaths)
|
|
|
78
78
|
summary: currentPath?.summary === pathname || !currentPath?.summary
|
|
79
79
|
? "Retrieve uploaded file"
|
|
80
80
|
: currentPath?.summary,
|
|
81
|
-
description: currentPath?.description ||
|
|
82
|
-
`Serves static files from the upload directory (${baseUploadDir}). This endpoint uses wildcard path matching to serve files from any subdirectory
|
|
83
|
-
|
|
81
|
+
description: currentPath?.description === pathname || !currentPath?.description
|
|
82
|
+
? `Serves static files from the upload directory (${baseUploadDir}). This endpoint uses wildcard path matching to serve files from any subdirectory.`
|
|
83
|
+
: currentPath?.description,
|
|
84
|
+
operationId: currentPath?.operationId?.includes(pathname) ||
|
|
85
|
+
!currentPath?.operationId
|
|
86
|
+
? "findFile"
|
|
87
|
+
: currentPath?.operationId,
|
|
84
88
|
...(shouldIncludeSecurity("View") && {
|
|
85
89
|
security: [{ BearerAuth: [] }],
|
|
86
90
|
}),
|
|
@@ -178,9 +182,13 @@ export default function getFileUploadJsonSchemaPaths(arkosConfig, existingPaths)
|
|
|
178
182
|
summary: currentPath?.summary === pathname || !currentPath?.summary
|
|
179
183
|
? "Upload file(s)"
|
|
180
184
|
: currentPath?.summary,
|
|
181
|
-
description: currentPath?.description ||
|
|
182
|
-
"Upload one or multiple files. Supports image processing options for image uploads."
|
|
183
|
-
|
|
185
|
+
description: currentPath?.description === pathname || !currentPath?.description
|
|
186
|
+
? "Upload one or multiple files. Supports image processing options for image uploads."
|
|
187
|
+
: currentPath?.description,
|
|
188
|
+
operationId: currentPath?.operationId?.includes(pathname) ||
|
|
189
|
+
!currentPath?.operationId
|
|
190
|
+
? "uploadFile"
|
|
191
|
+
: currentPath?.operationId,
|
|
184
192
|
...(shouldIncludeSecurity("Create") && {
|
|
185
193
|
security: [{ BearerAuth: [] }],
|
|
186
194
|
}),
|
|
@@ -330,9 +338,13 @@ export default function getFileUploadJsonSchemaPaths(arkosConfig, existingPaths)
|
|
|
330
338
|
summary: currentPath?.summary === pathname || !currentPath?.summary
|
|
331
339
|
? "Update existing file"
|
|
332
340
|
: currentPath?.summary,
|
|
333
|
-
description: currentPath?.description ||
|
|
334
|
-
"Replace an existing file with a new one. Deletes the old file and uploads the new one."
|
|
335
|
-
|
|
341
|
+
description: currentPath?.description === pathname || !currentPath?.description
|
|
342
|
+
? "Replace an existing file with a new one. Deletes the old file and uploads the new one."
|
|
343
|
+
: currentPath?.description,
|
|
344
|
+
operationId: currentPath?.operationId?.includes(pathname) ||
|
|
345
|
+
!currentPath?.operationId
|
|
346
|
+
? "updateFile"
|
|
347
|
+
: currentPath?.operationId,
|
|
336
348
|
...(shouldIncludeSecurity("Update") && {
|
|
337
349
|
security: [{ BearerAuth: [] }],
|
|
338
350
|
}),
|
|
@@ -451,8 +463,13 @@ export default function getFileUploadJsonSchemaPaths(arkosConfig, existingPaths)
|
|
|
451
463
|
summary: currentPath?.summary === pathname || !currentPath?.summary
|
|
452
464
|
? "Delete file"
|
|
453
465
|
: currentPath?.summary,
|
|
454
|
-
description: currentPath?.description
|
|
455
|
-
|
|
466
|
+
description: currentPath?.description === pathname || !currentPath?.description
|
|
467
|
+
? "Delete an uploaded file from the server"
|
|
468
|
+
: currentPath?.description,
|
|
469
|
+
operationId: currentPath?.operationId?.includes(pathname) ||
|
|
470
|
+
!currentPath?.operationId
|
|
471
|
+
? "deleteFile"
|
|
472
|
+
: currentPath?.operationId,
|
|
456
473
|
...(shouldIncludeSecurity("Delete") && {
|
|
457
474
|
security: [{ BearerAuth: [] }],
|
|
458
475
|
}),
|