arkos 1.4.0-canary.92 → 1.4.1-canary.2

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.
Files changed (151) hide show
  1. package/dist/cjs/app.js +1 -1
  2. package/dist/cjs/app.js.map +1 -1
  3. package/dist/cjs/exports/index.js.map +1 -1
  4. package/dist/cjs/modules/auth/auth.controller.js +1 -1
  5. package/dist/cjs/modules/auth/auth.controller.js.map +1 -1
  6. package/dist/cjs/modules/auth/auth.service.js +2 -3
  7. package/dist/cjs/modules/auth/auth.service.js.map +1 -1
  8. package/dist/cjs/modules/auth/utils/services/auth-action.service.js +50 -8
  9. package/dist/cjs/modules/auth/utils/services/auth-action.service.js.map +1 -1
  10. package/dist/cjs/modules/base/base.controller.js +6 -3
  11. package/dist/cjs/modules/base/base.controller.js.map +1 -1
  12. package/dist/cjs/modules/base/base.middlewares.js +8 -4
  13. package/dist/cjs/modules/base/base.middlewares.js.map +1 -1
  14. package/dist/cjs/modules/error-handler/error-handler.controller.js +2 -2
  15. package/dist/cjs/modules/error-handler/error-handler.controller.js.map +1 -1
  16. package/dist/cjs/modules/error-handler/utils/catch-async.js.map +1 -1
  17. package/dist/cjs/modules/swagger/swagger.router.js +6 -4
  18. package/dist/cjs/modules/swagger/swagger.router.js.map +1 -1
  19. package/dist/cjs/modules/swagger/utils/built-in-route-path-object-manager.js +7 -0
  20. package/dist/cjs/modules/swagger/utils/built-in-route-path-object-manager.js.map +1 -0
  21. package/dist/cjs/modules/swagger/utils/helpers/get-authentication-json-schema-paths.js +308 -183
  22. package/dist/cjs/modules/swagger/utils/helpers/get-authentication-json-schema-paths.js.map +1 -1
  23. package/dist/cjs/modules/swagger/utils/helpers/get-file-upload-json-schema-paths.js +357 -288
  24. package/dist/cjs/modules/swagger/utils/helpers/get-file-upload-json-schema-paths.js.map +1 -1
  25. package/dist/cjs/modules/swagger/utils/helpers/get-swagger-default-configs.js +1 -5
  26. package/dist/cjs/modules/swagger/utils/helpers/get-swagger-default-configs.js.map +1 -1
  27. package/dist/cjs/modules/swagger/utils/helpers/json-schema-generators/prisma-models/generate-prisma-model-main-routes-paths.js +280 -243
  28. package/dist/cjs/modules/swagger/utils/helpers/json-schema-generators/prisma-models/generate-prisma-model-main-routes-paths.js.map +1 -1
  29. package/dist/cjs/modules/swagger/utils/helpers/swagger.router.helpers.js +8 -6
  30. package/dist/cjs/modules/swagger/utils/helpers/swagger.router.helpers.js.map +1 -1
  31. package/dist/cjs/server.js +17 -15
  32. package/dist/cjs/server.js.map +1 -1
  33. package/dist/cjs/types/index.js.map +1 -1
  34. package/dist/cjs/types/new-arkos-config.js.map +1 -1
  35. package/dist/cjs/utils/arkos-router/index.js +32 -5
  36. package/dist/cjs/utils/arkos-router/index.js.map +1 -1
  37. package/dist/cjs/utils/arkos-router/types/index.js.map +1 -1
  38. package/dist/cjs/utils/arkos-router/utils/helpers/index.js +11 -0
  39. package/dist/cjs/utils/arkos-router/utils/helpers/index.js.map +1 -1
  40. package/dist/cjs/utils/cli/dev.js +12 -53
  41. package/dist/cjs/utils/cli/dev.js.map +1 -1
  42. package/dist/cjs/utils/cli/export-auth-action.js +1 -1
  43. package/dist/cjs/utils/cli/export-auth-action.js.map +1 -1
  44. package/dist/cjs/utils/cli/generate.js +3 -3
  45. package/dist/cjs/utils/cli/generate.js.map +1 -1
  46. package/dist/cjs/utils/cli/index.js +1 -1
  47. package/dist/cjs/utils/cli/index.js.map +1 -1
  48. package/dist/cjs/utils/cli/start.js +14 -10
  49. package/dist/cjs/utils/cli/start.js.map +1 -1
  50. package/dist/cjs/utils/cli/utils/cli.helpers.js +1 -1
  51. package/dist/cjs/utils/cli/utils/runtime-cli-commander.js +51 -6
  52. package/dist/cjs/utils/cli/utils/runtime-cli-commander.js.map +1 -1
  53. package/dist/cjs/utils/cli/utils/template-generator/templates/class-validator/create-dto-template.js +3 -3
  54. package/dist/cjs/utils/cli/utils/template-generator/templates/class-validator/create-dto-template.js.map +1 -1
  55. package/dist/cjs/utils/cli/utils/template-generator/templates/class-validator/update-dto-template.js +3 -3
  56. package/dist/cjs/utils/cli/utils/template-generator/templates/class-validator/update-dto-template.js.map +1 -1
  57. package/dist/cjs/utils/cli/utils/template-generator/templates/middlewares-template.js +6 -3
  58. package/dist/cjs/utils/cli/utils/template-generator/templates/middlewares-template.js.map +1 -1
  59. package/dist/cjs/utils/cli/utils/template-generator/templates/router-template.js +3 -1
  60. package/dist/cjs/utils/cli/utils/template-generator/templates/router-template.js.map +1 -1
  61. package/dist/cjs/utils/dotenv.helpers.js +10 -6
  62. package/dist/cjs/utils/dotenv.helpers.js.map +1 -1
  63. package/dist/cjs/utils/helpers/api.features.helpers.js +174 -81
  64. package/dist/cjs/utils/helpers/api.features.helpers.js.map +1 -1
  65. package/dist/cjs/utils/helpers/prisma.helpers.js +40 -1
  66. package/dist/cjs/utils/helpers/prisma.helpers.js.map +1 -1
  67. package/dist/cjs/utils/helpers/routers.helpers.js +0 -1
  68. package/dist/cjs/utils/helpers/routers.helpers.js.map +1 -1
  69. package/dist/esm/app.js +1 -1
  70. package/dist/esm/app.js.map +1 -1
  71. package/dist/esm/exports/index.js.map +1 -1
  72. package/dist/esm/modules/auth/auth.controller.js +1 -1
  73. package/dist/esm/modules/auth/auth.controller.js.map +1 -1
  74. package/dist/esm/modules/auth/auth.service.js +3 -4
  75. package/dist/esm/modules/auth/auth.service.js.map +1 -1
  76. package/dist/esm/modules/auth/utils/services/auth-action.service.js +50 -5
  77. package/dist/esm/modules/auth/utils/services/auth-action.service.js.map +1 -1
  78. package/dist/esm/modules/base/base.controller.js +6 -3
  79. package/dist/esm/modules/base/base.controller.js.map +1 -1
  80. package/dist/esm/modules/base/base.middlewares.js +8 -4
  81. package/dist/esm/modules/base/base.middlewares.js.map +1 -1
  82. package/dist/esm/modules/error-handler/error-handler.controller.js +2 -2
  83. package/dist/esm/modules/error-handler/error-handler.controller.js.map +1 -1
  84. package/dist/esm/modules/error-handler/utils/catch-async.js.map +1 -1
  85. package/dist/esm/modules/swagger/swagger.router.js +6 -4
  86. package/dist/esm/modules/swagger/swagger.router.js.map +1 -1
  87. package/dist/esm/modules/swagger/utils/built-in-route-path-object-manager.js +5 -0
  88. package/dist/esm/modules/swagger/utils/built-in-route-path-object-manager.js.map +1 -0
  89. package/dist/esm/modules/swagger/utils/helpers/get-authentication-json-schema-paths.js +308 -183
  90. package/dist/esm/modules/swagger/utils/helpers/get-authentication-json-schema-paths.js.map +1 -1
  91. package/dist/esm/modules/swagger/utils/helpers/get-file-upload-json-schema-paths.js +357 -288
  92. package/dist/esm/modules/swagger/utils/helpers/get-file-upload-json-schema-paths.js.map +1 -1
  93. package/dist/esm/modules/swagger/utils/helpers/get-swagger-default-configs.js +1 -2
  94. package/dist/esm/modules/swagger/utils/helpers/get-swagger-default-configs.js.map +1 -1
  95. package/dist/esm/modules/swagger/utils/helpers/json-schema-generators/prisma-models/generate-prisma-model-main-routes-paths.js +280 -243
  96. package/dist/esm/modules/swagger/utils/helpers/json-schema-generators/prisma-models/generate-prisma-model-main-routes-paths.js.map +1 -1
  97. package/dist/esm/modules/swagger/utils/helpers/swagger.router.helpers.js +8 -6
  98. package/dist/esm/modules/swagger/utils/helpers/swagger.router.helpers.js.map +1 -1
  99. package/dist/esm/server.js +17 -15
  100. package/dist/esm/server.js.map +1 -1
  101. package/dist/esm/types/index.js.map +1 -1
  102. package/dist/esm/types/new-arkos-config.js.map +1 -1
  103. package/dist/esm/utils/arkos-router/index.js +33 -6
  104. package/dist/esm/utils/arkos-router/index.js.map +1 -1
  105. package/dist/esm/utils/arkos-router/types/index.js.map +1 -1
  106. package/dist/esm/utils/arkos-router/utils/helpers/index.js +10 -0
  107. package/dist/esm/utils/arkos-router/utils/helpers/index.js.map +1 -1
  108. package/dist/esm/utils/cli/dev.js +13 -54
  109. package/dist/esm/utils/cli/dev.js.map +1 -1
  110. package/dist/esm/utils/cli/export-auth-action.js +1 -1
  111. package/dist/esm/utils/cli/export-auth-action.js.map +1 -1
  112. package/dist/esm/utils/cli/generate.js +3 -3
  113. package/dist/esm/utils/cli/generate.js.map +1 -1
  114. package/dist/esm/utils/cli/index.js +1 -1
  115. package/dist/esm/utils/cli/index.js.map +1 -1
  116. package/dist/esm/utils/cli/start.js +14 -10
  117. package/dist/esm/utils/cli/start.js.map +1 -1
  118. package/dist/esm/utils/cli/utils/cli.helpers.js +1 -1
  119. package/dist/esm/utils/cli/utils/runtime-cli-commander.js +52 -7
  120. package/dist/esm/utils/cli/utils/runtime-cli-commander.js.map +1 -1
  121. package/dist/esm/utils/cli/utils/template-generator/templates/class-validator/create-dto-template.js +3 -3
  122. package/dist/esm/utils/cli/utils/template-generator/templates/class-validator/create-dto-template.js.map +1 -1
  123. package/dist/esm/utils/cli/utils/template-generator/templates/class-validator/update-dto-template.js +3 -3
  124. package/dist/esm/utils/cli/utils/template-generator/templates/class-validator/update-dto-template.js.map +1 -1
  125. package/dist/esm/utils/cli/utils/template-generator/templates/middlewares-template.js +6 -3
  126. package/dist/esm/utils/cli/utils/template-generator/templates/middlewares-template.js.map +1 -1
  127. package/dist/esm/utils/cli/utils/template-generator/templates/router-template.js +3 -1
  128. package/dist/esm/utils/cli/utils/template-generator/templates/router-template.js.map +1 -1
  129. package/dist/esm/utils/dotenv.helpers.js +10 -6
  130. package/dist/esm/utils/dotenv.helpers.js.map +1 -1
  131. package/dist/esm/utils/helpers/api.features.helpers.js +174 -81
  132. package/dist/esm/utils/helpers/api.features.helpers.js.map +1 -1
  133. package/dist/esm/utils/helpers/prisma.helpers.js +39 -1
  134. package/dist/esm/utils/helpers/prisma.helpers.js.map +1 -1
  135. package/dist/esm/utils/helpers/routers.helpers.js +0 -1
  136. package/dist/esm/utils/helpers/routers.helpers.js.map +1 -1
  137. package/dist/types/exports/index.d.ts +2 -1
  138. package/dist/types/modules/auth/auth.router.d.ts +1 -1
  139. package/dist/types/modules/auth/auth.service.d.ts +2 -2
  140. package/dist/types/modules/base/base.router.d.ts +1 -1
  141. package/dist/types/modules/swagger/utils/built-in-route-path-object-manager.d.ts +4 -0
  142. package/dist/types/modules/swagger/utils/helpers/get-authentication-json-schema-paths.d.ts +1 -1
  143. package/dist/types/modules/swagger/utils/helpers/get-file-upload-json-schema-paths.d.ts +1 -1
  144. package/dist/types/modules/swagger/utils/helpers/json-schema-generators/prisma-models/generate-prisma-model-main-routes-paths.d.ts +1 -1
  145. package/dist/types/modules/swagger/utils/helpers/swagger.router.helpers.d.ts +1 -1
  146. package/dist/types/types/index.d.ts +5 -5
  147. package/dist/types/types/new-arkos-config.d.ts +1 -1
  148. package/dist/types/utils/arkos-router/types/index.d.ts +15 -14
  149. package/dist/types/utils/arkos-router/utils/helpers/index.d.ts +1 -0
  150. package/dist/types/utils/helpers/prisma.helpers.d.ts +1 -0
  151. package/package.json +2 -2
@@ -14,8 +14,8 @@ export const getSchemaMode = (action, arkosConfig) => {
14
14
  return "prisma";
15
15
  return swaggerMode;
16
16
  };
17
- export default function getAuthenticationJsonSchemaPaths(arkosConfig) {
18
- const paths = {};
17
+ export default function getAuthenticationJsonSchemaPaths(arkosConfig, existingPaths) {
18
+ const paths = { ...existingPaths };
19
19
  if (!arkosConfig.swagger?.mode)
20
20
  return paths;
21
21
  const AuthModuleComponents = getModuleComponents("auth");
@@ -27,201 +27,239 @@ export default function getAuthenticationJsonSchemaPaths(arkosConfig) {
27
27
  return isEndpointDisabled(routerConfig, endpoint);
28
28
  };
29
29
  if (!isAuthEndpointDisabled("login")) {
30
+ const pathname = "/api/auth/login";
31
+ if (!paths[pathname])
32
+ paths[pathname] = {};
30
33
  const loginMode = getSchemaMode("login", arkosConfig);
31
- paths["/api/auth/login"] = {
32
- post: {
33
- tags: ["Authentication"],
34
- summary: "Login to the system",
35
- description: "Authenticates a user and returns an access token",
36
- operationId: "login",
37
- requestBody: {
38
- description: "User credentials",
39
- required: true,
40
- content: {
41
- "application/json": {
42
- schema: {
43
- $ref: getSchemaRef("Login", loginMode),
44
- },
34
+ const currentPath = paths[pathname].post;
35
+ const defaultSpec = {
36
+ tags: ["Authentication", ...(currentPath?.tags || [])].filter((tag) => tag !== "Defaults"),
37
+ summary: currentPath?.summary === pathname || !currentPath?.summary
38
+ ? "Login to the system"
39
+ : currentPath?.summary,
40
+ description: currentPath?.description ||
41
+ "Authenticates a user and returns an access token",
42
+ operationId: currentPath?.operationId || "login",
43
+ requestBody: currentPath?.requestBody || {
44
+ description: "User credentials",
45
+ required: true,
46
+ content: {
47
+ "application/json": {
48
+ schema: {
49
+ $ref: getSchemaRef("Login", loginMode),
45
50
  },
46
51
  },
47
52
  },
48
- responses: {
49
- "200": {
50
- description: "Login successful",
51
- content: {
52
- "application/json": {
53
- schema: {
54
- type: "object",
55
- properties: {
56
- accessToken: {
57
- type: "string",
58
- description: "JWT access token",
59
- },
53
+ },
54
+ responses: {
55
+ ...(currentPath?.responses || {}),
56
+ "200": currentPath?.responses?.["200"] || {
57
+ description: "Login successful",
58
+ content: {
59
+ "application/json": {
60
+ schema: {
61
+ type: "object",
62
+ properties: {
63
+ accessToken: {
64
+ type: "string",
65
+ description: "JWT access token",
60
66
  },
61
67
  },
62
68
  },
63
69
  },
64
70
  },
65
- "400": {
66
- description: "Invalid input data",
67
- },
68
- "401": {
69
- description: "Invalid credentials",
70
- },
71
+ },
72
+ "400": currentPath?.responses?.["400"] || {
73
+ description: "Invalid input data",
74
+ },
75
+ "401": currentPath?.responses?.["401"] || {
76
+ description: "Invalid credentials",
71
77
  },
72
78
  },
73
79
  };
80
+ paths[pathname].post = { ...(currentPath || {}), ...defaultSpec };
74
81
  }
75
82
  if (!isAuthEndpointDisabled("logout")) {
76
- paths["/api/auth/logout"] = {
77
- delete: {
78
- tags: ["Authentication"],
79
- summary: "Logout from the system",
80
- description: "Invalidates the current user's JWT token",
81
- operationId: "logout",
82
- security: [{ BearerAuth: [] }],
83
- responses: {
84
- "204": {
85
- description: "Logout successful",
86
- },
87
- "401": {
88
- description: "Authentication required",
89
- },
83
+ const pathname = "/api/auth/logout";
84
+ if (!paths[pathname])
85
+ paths[pathname] = {};
86
+ const currentPath = paths[pathname].delete;
87
+ const defaultSpec = {
88
+ tags: ["Authentication", ...(currentPath?.tags || [])].filter((tag) => tag !== "Defaults"),
89
+ summary: currentPath?.summary === pathname || !currentPath?.summary
90
+ ? "Logout from the system"
91
+ : currentPath?.summary,
92
+ description: currentPath?.description || "Invalidates the current user's JWT token",
93
+ operationId: currentPath?.operationId || "logout",
94
+ security: [{ BearerAuth: [] }],
95
+ responses: {
96
+ ...(currentPath?.responses || {}),
97
+ "204": currentPath?.responses?.["204"] || {
98
+ description: "Logout successful",
99
+ },
100
+ "401": currentPath?.responses?.["401"] || {
101
+ description: "Authentication required",
90
102
  },
91
103
  },
92
104
  };
105
+ paths[pathname].delete = { ...(currentPath || {}), ...defaultSpec };
93
106
  }
94
107
  if (!isAuthEndpointDisabled("signup")) {
108
+ const pathname = "/api/auth/signup";
109
+ if (!paths[pathname])
110
+ paths[pathname] = {};
95
111
  const signupMode = getSchemaMode("signup", arkosConfig);
96
112
  const userMode = getSchemaMode("user", arkosConfig);
97
- paths["/api/auth/signup"] = {
98
- post: {
99
- tags: ["Authentication"],
100
- summary: "Register a new user",
101
- description: "Creates a new user account",
102
- operationId: "signup",
103
- requestBody: {
104
- description: "User registration data",
105
- required: true,
113
+ const currentPath = paths[pathname].post;
114
+ const defaultSpec = {
115
+ tags: ["Authentication", ...(currentPath?.tags || [])].filter((tag) => tag !== "Defaults"),
116
+ summary: currentPath?.summary === pathname || !currentPath?.summary
117
+ ? "Register a new user"
118
+ : currentPath?.summary,
119
+ description: currentPath?.description || "Creates a new user account",
120
+ operationId: currentPath?.operationId || "signup",
121
+ requestBody: currentPath?.requestBody || {
122
+ description: "User registration data",
123
+ required: true,
124
+ content: {
125
+ "application/json": {
126
+ schema: {
127
+ $ref: getSchemaRef("Signup", signupMode),
128
+ },
129
+ },
130
+ },
131
+ },
132
+ responses: {
133
+ ...(currentPath?.responses || {}),
134
+ "201": currentPath?.responses?.["201"] || {
135
+ description: "User created successfully",
106
136
  content: {
107
137
  "application/json": {
108
138
  schema: {
109
- $ref: getSchemaRef("Signup", signupMode),
139
+ $ref: getSchemaRef("User", userMode),
110
140
  },
111
141
  },
112
142
  },
113
143
  },
114
- responses: {
115
- "201": {
116
- description: "User created successfully",
117
- content: {
118
- "application/json": {
119
- schema: {
120
- $ref: getSchemaRef("User", userMode),
121
- },
122
- },
123
- },
124
- },
125
- "400": {
126
- description: "Invalid input data",
127
- },
128
- "409": {
129
- description: "User already exists",
130
- },
144
+ "400": currentPath?.responses?.["400"] || {
145
+ description: "Invalid input data",
146
+ },
147
+ "409": currentPath?.responses?.["409"] || {
148
+ description: "User already exists",
131
149
  },
132
150
  },
133
151
  };
152
+ paths[pathname].post = { ...(currentPath || {}), ...defaultSpec };
134
153
  }
135
154
  if (!isAuthEndpointDisabled("updatePassword")) {
155
+ const pathname = "/api/auth/update-password";
156
+ if (!paths[pathname])
157
+ paths[pathname] = {};
136
158
  const updatePasswordMode = getSchemaMode("updatePassword", arkosConfig);
137
- paths["/api/auth/update-password"] = {
138
- post: {
139
- tags: ["Authentication"],
140
- summary: "Update user password",
141
- description: "Changes the password for the authenticated user",
142
- operationId: "updatePassword",
143
- security: [{ BearerAuth: [] }],
144
- requestBody: {
145
- description: "Current and new password",
146
- required: true,
147
- content: {
148
- "application/json": {
149
- schema: {
150
- $ref: getSchemaRef("UpdatePassword", updatePasswordMode),
151
- },
159
+ const currentPath = paths[pathname].post;
160
+ const defaultSpec = {
161
+ tags: ["Authentication", ...(currentPath?.tags || [])].filter((tag) => tag !== "Defaults"),
162
+ summary: currentPath?.summary === pathname || !currentPath?.summary
163
+ ? "Update user password"
164
+ : currentPath?.summary,
165
+ description: currentPath?.description ||
166
+ "Changes the password for the authenticated user",
167
+ operationId: currentPath?.operationId || "updatePassword",
168
+ security: [{ BearerAuth: [] }],
169
+ requestBody: currentPath?.requestBody || {
170
+ description: "Current and new password",
171
+ required: true,
172
+ content: {
173
+ "application/json": {
174
+ schema: {
175
+ $ref: getSchemaRef("UpdatePassword", updatePasswordMode),
152
176
  },
153
177
  },
154
178
  },
155
- responses: {
156
- "200": {
157
- description: "Password updated successfully",
158
- content: {
159
- "application/json": {
160
- schema: {
161
- type: "object",
162
- properties: {
163
- status: {
164
- type: "string",
165
- example: "success",
166
- },
167
- message: {
168
- type: "string",
169
- example: "Password updated successfully!",
170
- },
179
+ },
180
+ responses: {
181
+ ...(currentPath?.responses || {}),
182
+ "200": currentPath?.responses?.["200"] || {
183
+ description: "Password updated successfully",
184
+ content: {
185
+ "application/json": {
186
+ schema: {
187
+ type: "object",
188
+ properties: {
189
+ status: {
190
+ type: "string",
191
+ example: "success",
192
+ },
193
+ message: {
194
+ type: "string",
195
+ example: "Password updated successfully!",
171
196
  },
172
197
  },
173
198
  },
174
199
  },
175
200
  },
176
- "400": {
177
- description: "Invalid input data or current password incorrect",
178
- },
179
- "401": {
180
- description: "Authentication required",
181
- },
201
+ },
202
+ "400": currentPath?.responses?.["400"] || {
203
+ description: "Invalid input data or current password incorrect",
204
+ },
205
+ "401": currentPath?.responses?.["401"] || {
206
+ description: "Authentication required",
182
207
  },
183
208
  },
184
209
  };
210
+ paths[pathname].post = { ...(currentPath || {}), ...defaultSpec };
185
211
  }
186
212
  if (!isAuthEndpointDisabled("getMe")) {
213
+ const pathname = "/api/users/me";
214
+ if (!paths[pathname])
215
+ paths[pathname] = {};
187
216
  const findMeMode = getSchemaMode("getMe", arkosConfig);
188
- paths["/api/users/me"] = {
189
- get: {
190
- tags: ["Authentication"],
191
- summary: "Get current user information",
192
- description: "Retrieves information about the currently authenticated user",
193
- operationId: "getMe",
194
- security: [{ BearerAuth: [] }],
195
- responses: {
196
- "200": {
197
- description: "User information retrieved successfully",
198
- content: {
199
- "application/json": {
200
- schema: {
201
- $ref: getSchemaRef("GetMe", findMeMode),
202
- },
217
+ const currentPath = paths[pathname].get;
218
+ const defaultSpec = {
219
+ tags: ["Authentication", ...(currentPath?.tags || [])].filter((tag) => tag !== "Defaults"),
220
+ summary: currentPath?.summary === pathname || !currentPath?.summary
221
+ ? "Get current user information"
222
+ : currentPath?.summary,
223
+ description: currentPath?.description ||
224
+ "Retrieves information about the currently authenticated user",
225
+ operationId: currentPath?.operationId || "getMe",
226
+ security: [{ BearerAuth: [] }],
227
+ responses: {
228
+ ...(currentPath?.responses || {}),
229
+ "200": currentPath?.responses?.["200"] || {
230
+ description: "User information retrieved successfully",
231
+ content: {
232
+ "application/json": {
233
+ schema: {
234
+ $ref: getSchemaRef("GetMe", findMeMode),
203
235
  },
204
236
  },
205
237
  },
206
- "401": {
207
- description: "Authentication required",
208
- },
238
+ },
239
+ "401": currentPath?.responses?.["401"] || {
240
+ description: "Authentication required",
209
241
  },
210
242
  },
211
243
  };
244
+ paths[pathname].get = { ...(currentPath || {}), ...defaultSpec };
212
245
  }
213
246
  if (!isAuthEndpointDisabled("updateMe")) {
247
+ const pathname = "/api/users/me";
248
+ if (!paths[pathname])
249
+ paths[pathname] = {};
214
250
  const updateMeMode = getSchemaMode("updateMe", arkosConfig);
215
251
  const userMode = getSchemaMode("user", arkosConfig);
216
- if (!paths["/api/users/me"])
217
- paths["/api/users/me"] = {};
218
- paths["/api/users/me"].patch = {
219
- tags: ["Authentication"],
220
- summary: "Update current user information",
221
- description: "Updates information for the currently authenticated user",
222
- operationId: "updateMe",
252
+ const currentPath = paths[pathname].patch;
253
+ const defaultSpec = {
254
+ tags: ["Authentication", ...(currentPath?.tags || [])].filter((tag) => tag !== "Defaults"),
255
+ summary: currentPath?.summary === pathname || !currentPath?.summary
256
+ ? "Update current user information"
257
+ : currentPath?.summary,
258
+ description: currentPath?.description ||
259
+ "Updates information for the currently authenticated user",
260
+ operationId: currentPath?.operationId || "updateMe",
223
261
  security: [{ BearerAuth: [] }],
224
- requestBody: {
262
+ requestBody: currentPath?.requestBody || {
225
263
  description: "User data to update",
226
264
  required: true,
227
265
  content: {
@@ -233,7 +271,8 @@ export default function getAuthenticationJsonSchemaPaths(arkosConfig) {
233
271
  },
234
272
  },
235
273
  responses: {
236
- "200": {
274
+ ...(currentPath?.responses || {}),
275
+ "200": currentPath?.responses?.["200"] || {
237
276
  description: "User updated successfully",
238
277
  content: {
239
278
  "application/json": {
@@ -243,26 +282,33 @@ export default function getAuthenticationJsonSchemaPaths(arkosConfig) {
243
282
  },
244
283
  },
245
284
  },
246
- "400": {
285
+ "400": currentPath?.responses?.["400"] || {
247
286
  description: "Invalid input data",
248
287
  },
249
- "401": {
288
+ "401": currentPath?.responses?.["401"] || {
250
289
  description: "Authentication required",
251
290
  },
252
291
  },
253
292
  };
293
+ paths[pathname].patch = { ...(currentPath || {}), ...defaultSpec };
254
294
  }
255
295
  if (!isAuthEndpointDisabled("deleteMe")) {
256
- if (!paths["/api/users/me"])
257
- paths["/api/users/me"] = {};
258
- paths["/api/users/me"].delete = {
259
- tags: ["Authentication"],
260
- summary: "Delete current user account",
261
- description: "Marks the current user's account as deleted",
262
- operationId: "deleteMe",
296
+ const pathname = "/api/users/me";
297
+ if (!paths[pathname])
298
+ paths[pathname] = {};
299
+ const currentPath = paths[pathname].delete;
300
+ const defaultSpec = {
301
+ tags: ["Authentication", ...(currentPath?.tags || [])].filter((tag) => tag !== "Defaults"),
302
+ summary: currentPath?.summary === pathname || !currentPath?.summary
303
+ ? "Delete current user account"
304
+ : currentPath?.summary,
305
+ description: currentPath?.description ||
306
+ "Marks the current user's account as deleted",
307
+ operationId: currentPath?.operationId || "deleteMe",
263
308
  security: [{ BearerAuth: [] }],
264
309
  responses: {
265
- "200": {
310
+ ...(currentPath?.responses || {}),
311
+ "200": currentPath?.responses?.["200"] || {
266
312
  description: "Account deleted successfully",
267
313
  content: {
268
314
  "application/json": {
@@ -278,56 +324,135 @@ export default function getAuthenticationJsonSchemaPaths(arkosConfig) {
278
324
  },
279
325
  },
280
326
  },
281
- "401": {
327
+ "401": currentPath?.responses?.["401"] || {
282
328
  description: "Authentication required",
283
329
  },
284
330
  },
285
331
  };
332
+ paths[pathname].delete = { ...(currentPath || {}), ...defaultSpec };
286
333
  }
287
334
  if (!isAuthEndpointDisabled("findManyAuthAction")) {
288
- paths["/api/auth-actions"] = {
289
- get: {
290
- tags: ["Authentication"],
291
- summary: "Get all authentication actions",
292
- description: "Retrieves a list of all available authentication actions and permissions",
293
- operationId: "findManyAuthAction",
294
- security: [{ BearerAuth: [] }],
295
- responses: {
296
- "200": {
297
- description: "Auth actions retrieved successfully",
298
- content: {
299
- "application/json": {
300
- schema: {
301
- type: "object",
302
- properties: {
303
- total: {
304
- type: "number",
305
- description: "Total number of auth actions",
306
- },
307
- results: {
308
- type: "number",
309
- description: "Number of auth actions returned",
310
- },
311
- data: {
312
- type: "array",
313
- items: {
314
- $ref: "#/components/schemas/FindManyAuthActionSystemSchema",
315
- },
335
+ const pathname = "/api/auth-actions";
336
+ if (!paths[pathname])
337
+ paths[pathname] = {};
338
+ const currentPath = paths[pathname].get;
339
+ const defaultSpec = {
340
+ tags: ["Authentication", ...(currentPath?.tags || [])].filter((tag) => tag !== "Defaults"),
341
+ summary: currentPath?.summary === pathname || !currentPath?.summary
342
+ ? "Get all authentication actions"
343
+ : currentPath?.summary,
344
+ description: currentPath?.description ||
345
+ "Retrieves a list of all available authentication actions and permissions",
346
+ operationId: currentPath?.operationId || "findManyAuthAction",
347
+ security: [{ BearerAuth: [] }],
348
+ responses: {
349
+ ...(currentPath?.responses || {}),
350
+ "200": currentPath?.responses?.["200"] || {
351
+ description: "Auth actions retrieved successfully",
352
+ content: {
353
+ "application/json": {
354
+ schema: {
355
+ type: "object",
356
+ properties: {
357
+ total: {
358
+ type: "number",
359
+ description: "Total number of auth actions",
360
+ },
361
+ results: {
362
+ type: "number",
363
+ description: "Number of auth actions returned",
364
+ },
365
+ data: {
366
+ type: "array",
367
+ items: {
368
+ $ref: "#/components/schemas/FindManyAuthActionSystemSchema",
316
369
  },
317
370
  },
318
371
  },
319
372
  },
320
373
  },
321
374
  },
322
- "401": {
323
- description: "Authentication required",
324
- },
325
- "403": {
326
- description: "Insufficient permissions",
375
+ },
376
+ "401": currentPath?.responses?.["401"] || {
377
+ description: "Authentication required",
378
+ },
379
+ "403": currentPath?.responses?.["403"] || {
380
+ description: "Insufficient permissions",
381
+ },
382
+ },
383
+ };
384
+ paths[pathname].get = { ...(currentPath || {}), ...defaultSpec };
385
+ }
386
+ if (!isAuthEndpointDisabled("findOneAuthAction")) {
387
+ const pathname = "/api/auth-actions/{resourceName}";
388
+ if (!paths[pathname])
389
+ paths[pathname] = {};
390
+ const currentPath = paths[pathname].get;
391
+ const defaultParameters = [
392
+ {
393
+ name: "resourceName",
394
+ in: "path",
395
+ description: "Name of the resource to retrieve auth actions for",
396
+ required: true,
397
+ schema: { type: "string" },
398
+ },
399
+ ];
400
+ const existingParams = currentPath?.parameters || [];
401
+ const existingParamKeys = new Set(existingParams.map((p) => `${p.in}-${p.name}`));
402
+ const mergedParameters = [
403
+ ...existingParams,
404
+ ...defaultParameters.filter((p) => !existingParamKeys.has(`${p.in}-${p.name}`)),
405
+ ];
406
+ const defaultSpec = {
407
+ tags: ["Authentication", ...(currentPath?.tags || [])].filter((tag) => tag !== "Defaults"),
408
+ summary: currentPath?.summary === pathname || !currentPath?.summary
409
+ ? "Get authentication actions by resource"
410
+ : currentPath?.summary,
411
+ description: currentPath?.description ||
412
+ "Retrieves all authentication actions for a specific resource",
413
+ operationId: currentPath?.operationId || "findOneAuthAction",
414
+ security: [{ BearerAuth: [] }],
415
+ parameters: mergedParameters,
416
+ responses: {
417
+ ...(currentPath?.responses || {}),
418
+ "200": currentPath?.responses?.["200"] || {
419
+ description: "Auth actions for resource retrieved successfully",
420
+ content: {
421
+ "application/json": {
422
+ schema: {
423
+ type: "object",
424
+ properties: {
425
+ total: {
426
+ type: "number",
427
+ description: "Total number of auth actions for this resource",
428
+ },
429
+ results: {
430
+ type: "number",
431
+ description: "Number of auth actions returned",
432
+ },
433
+ data: {
434
+ type: "array",
435
+ items: {
436
+ $ref: "#/components/schemas/FindManyAuthActionSystemSchema",
437
+ },
438
+ },
439
+ },
440
+ },
441
+ },
327
442
  },
328
443
  },
444
+ "401": currentPath?.responses?.["401"] || {
445
+ description: "Authentication required",
446
+ },
447
+ "403": currentPath?.responses?.["403"] || {
448
+ description: "Insufficient permissions",
449
+ },
450
+ "404": currentPath?.responses?.["404"] || {
451
+ description: "Resource not found",
452
+ },
329
453
  },
330
454
  };
455
+ paths[pathname].get = { ...(currentPath || {}), ...defaultSpec };
331
456
  }
332
457
  return paths;
333
458
  }