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.
- package/dist/cjs/app.js +1 -1
- package/dist/cjs/app.js.map +1 -1
- package/dist/cjs/exports/index.js.map +1 -1
- package/dist/cjs/modules/auth/auth.controller.js +1 -1
- package/dist/cjs/modules/auth/auth.controller.js.map +1 -1
- package/dist/cjs/modules/auth/auth.service.js +2 -3
- package/dist/cjs/modules/auth/auth.service.js.map +1 -1
- package/dist/cjs/modules/auth/utils/services/auth-action.service.js +50 -8
- package/dist/cjs/modules/auth/utils/services/auth-action.service.js.map +1 -1
- package/dist/cjs/modules/base/base.controller.js +6 -3
- package/dist/cjs/modules/base/base.controller.js.map +1 -1
- package/dist/cjs/modules/base/base.middlewares.js +8 -4
- package/dist/cjs/modules/base/base.middlewares.js.map +1 -1
- package/dist/cjs/modules/error-handler/error-handler.controller.js +2 -2
- package/dist/cjs/modules/error-handler/error-handler.controller.js.map +1 -1
- package/dist/cjs/modules/error-handler/utils/catch-async.js.map +1 -1
- package/dist/cjs/modules/swagger/swagger.router.js +6 -4
- package/dist/cjs/modules/swagger/swagger.router.js.map +1 -1
- package/dist/cjs/modules/swagger/utils/built-in-route-path-object-manager.js +7 -0
- package/dist/cjs/modules/swagger/utils/built-in-route-path-object-manager.js.map +1 -0
- package/dist/cjs/modules/swagger/utils/helpers/get-authentication-json-schema-paths.js +308 -183
- 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 +357 -288
- package/dist/cjs/modules/swagger/utils/helpers/get-file-upload-json-schema-paths.js.map +1 -1
- package/dist/cjs/modules/swagger/utils/helpers/get-swagger-default-configs.js +1 -5
- package/dist/cjs/modules/swagger/utils/helpers/get-swagger-default-configs.js.map +1 -1
- package/dist/cjs/modules/swagger/utils/helpers/json-schema-generators/prisma-models/generate-prisma-model-main-routes-paths.js +280 -243
- package/dist/cjs/modules/swagger/utils/helpers/json-schema-generators/prisma-models/generate-prisma-model-main-routes-paths.js.map +1 -1
- package/dist/cjs/modules/swagger/utils/helpers/swagger.router.helpers.js +8 -6
- package/dist/cjs/modules/swagger/utils/helpers/swagger.router.helpers.js.map +1 -1
- package/dist/cjs/server.js +17 -15
- package/dist/cjs/server.js.map +1 -1
- package/dist/cjs/types/index.js.map +1 -1
- package/dist/cjs/types/new-arkos-config.js.map +1 -1
- package/dist/cjs/utils/arkos-router/index.js +32 -5
- package/dist/cjs/utils/arkos-router/index.js.map +1 -1
- package/dist/cjs/utils/arkos-router/types/index.js.map +1 -1
- package/dist/cjs/utils/arkos-router/utils/helpers/index.js +11 -0
- package/dist/cjs/utils/arkos-router/utils/helpers/index.js.map +1 -1
- package/dist/cjs/utils/cli/dev.js +12 -53
- package/dist/cjs/utils/cli/dev.js.map +1 -1
- package/dist/cjs/utils/cli/export-auth-action.js +1 -1
- package/dist/cjs/utils/cli/export-auth-action.js.map +1 -1
- package/dist/cjs/utils/cli/generate.js +3 -3
- package/dist/cjs/utils/cli/generate.js.map +1 -1
- package/dist/cjs/utils/cli/index.js +1 -1
- package/dist/cjs/utils/cli/index.js.map +1 -1
- package/dist/cjs/utils/cli/start.js +14 -10
- 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 +51 -6
- package/dist/cjs/utils/cli/utils/runtime-cli-commander.js.map +1 -1
- package/dist/cjs/utils/cli/utils/template-generator/templates/class-validator/create-dto-template.js +3 -3
- package/dist/cjs/utils/cli/utils/template-generator/templates/class-validator/create-dto-template.js.map +1 -1
- package/dist/cjs/utils/cli/utils/template-generator/templates/class-validator/update-dto-template.js +3 -3
- package/dist/cjs/utils/cli/utils/template-generator/templates/class-validator/update-dto-template.js.map +1 -1
- package/dist/cjs/utils/cli/utils/template-generator/templates/middlewares-template.js +6 -3
- package/dist/cjs/utils/cli/utils/template-generator/templates/middlewares-template.js.map +1 -1
- package/dist/cjs/utils/cli/utils/template-generator/templates/router-template.js +3 -1
- package/dist/cjs/utils/cli/utils/template-generator/templates/router-template.js.map +1 -1
- package/dist/cjs/utils/dotenv.helpers.js +10 -6
- package/dist/cjs/utils/dotenv.helpers.js.map +1 -1
- package/dist/cjs/utils/helpers/api.features.helpers.js +174 -81
- package/dist/cjs/utils/helpers/api.features.helpers.js.map +1 -1
- package/dist/cjs/utils/helpers/prisma.helpers.js +40 -1
- package/dist/cjs/utils/helpers/prisma.helpers.js.map +1 -1
- package/dist/cjs/utils/helpers/routers.helpers.js +0 -1
- package/dist/cjs/utils/helpers/routers.helpers.js.map +1 -1
- package/dist/esm/app.js +1 -1
- package/dist/esm/app.js.map +1 -1
- package/dist/esm/exports/index.js.map +1 -1
- package/dist/esm/modules/auth/auth.controller.js +1 -1
- package/dist/esm/modules/auth/auth.controller.js.map +1 -1
- package/dist/esm/modules/auth/auth.service.js +3 -4
- package/dist/esm/modules/auth/auth.service.js.map +1 -1
- package/dist/esm/modules/auth/utils/services/auth-action.service.js +50 -5
- package/dist/esm/modules/auth/utils/services/auth-action.service.js.map +1 -1
- package/dist/esm/modules/base/base.controller.js +6 -3
- package/dist/esm/modules/base/base.controller.js.map +1 -1
- package/dist/esm/modules/base/base.middlewares.js +8 -4
- package/dist/esm/modules/base/base.middlewares.js.map +1 -1
- package/dist/esm/modules/error-handler/error-handler.controller.js +2 -2
- package/dist/esm/modules/error-handler/error-handler.controller.js.map +1 -1
- package/dist/esm/modules/error-handler/utils/catch-async.js.map +1 -1
- package/dist/esm/modules/swagger/swagger.router.js +6 -4
- package/dist/esm/modules/swagger/swagger.router.js.map +1 -1
- package/dist/esm/modules/swagger/utils/built-in-route-path-object-manager.js +5 -0
- package/dist/esm/modules/swagger/utils/built-in-route-path-object-manager.js.map +1 -0
- package/dist/esm/modules/swagger/utils/helpers/get-authentication-json-schema-paths.js +308 -183
- 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 +357 -288
- package/dist/esm/modules/swagger/utils/helpers/get-file-upload-json-schema-paths.js.map +1 -1
- package/dist/esm/modules/swagger/utils/helpers/get-swagger-default-configs.js +1 -2
- package/dist/esm/modules/swagger/utils/helpers/get-swagger-default-configs.js.map +1 -1
- package/dist/esm/modules/swagger/utils/helpers/json-schema-generators/prisma-models/generate-prisma-model-main-routes-paths.js +280 -243
- package/dist/esm/modules/swagger/utils/helpers/json-schema-generators/prisma-models/generate-prisma-model-main-routes-paths.js.map +1 -1
- package/dist/esm/modules/swagger/utils/helpers/swagger.router.helpers.js +8 -6
- package/dist/esm/modules/swagger/utils/helpers/swagger.router.helpers.js.map +1 -1
- package/dist/esm/server.js +17 -15
- package/dist/esm/server.js.map +1 -1
- package/dist/esm/types/index.js.map +1 -1
- package/dist/esm/types/new-arkos-config.js.map +1 -1
- package/dist/esm/utils/arkos-router/index.js +33 -6
- package/dist/esm/utils/arkos-router/index.js.map +1 -1
- package/dist/esm/utils/arkos-router/types/index.js.map +1 -1
- package/dist/esm/utils/arkos-router/utils/helpers/index.js +10 -0
- package/dist/esm/utils/arkos-router/utils/helpers/index.js.map +1 -1
- package/dist/esm/utils/cli/dev.js +13 -54
- package/dist/esm/utils/cli/dev.js.map +1 -1
- package/dist/esm/utils/cli/export-auth-action.js +1 -1
- package/dist/esm/utils/cli/export-auth-action.js.map +1 -1
- package/dist/esm/utils/cli/generate.js +3 -3
- package/dist/esm/utils/cli/generate.js.map +1 -1
- package/dist/esm/utils/cli/index.js +1 -1
- package/dist/esm/utils/cli/index.js.map +1 -1
- package/dist/esm/utils/cli/start.js +14 -10
- 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 +52 -7
- package/dist/esm/utils/cli/utils/runtime-cli-commander.js.map +1 -1
- package/dist/esm/utils/cli/utils/template-generator/templates/class-validator/create-dto-template.js +3 -3
- package/dist/esm/utils/cli/utils/template-generator/templates/class-validator/create-dto-template.js.map +1 -1
- package/dist/esm/utils/cli/utils/template-generator/templates/class-validator/update-dto-template.js +3 -3
- package/dist/esm/utils/cli/utils/template-generator/templates/class-validator/update-dto-template.js.map +1 -1
- package/dist/esm/utils/cli/utils/template-generator/templates/middlewares-template.js +6 -3
- package/dist/esm/utils/cli/utils/template-generator/templates/middlewares-template.js.map +1 -1
- package/dist/esm/utils/cli/utils/template-generator/templates/router-template.js +3 -1
- package/dist/esm/utils/cli/utils/template-generator/templates/router-template.js.map +1 -1
- package/dist/esm/utils/dotenv.helpers.js +10 -6
- package/dist/esm/utils/dotenv.helpers.js.map +1 -1
- package/dist/esm/utils/helpers/api.features.helpers.js +174 -81
- package/dist/esm/utils/helpers/api.features.helpers.js.map +1 -1
- package/dist/esm/utils/helpers/prisma.helpers.js +39 -1
- package/dist/esm/utils/helpers/prisma.helpers.js.map +1 -1
- package/dist/esm/utils/helpers/routers.helpers.js +0 -1
- package/dist/esm/utils/helpers/routers.helpers.js.map +1 -1
- package/dist/types/exports/index.d.ts +2 -1
- package/dist/types/modules/auth/auth.router.d.ts +1 -1
- package/dist/types/modules/auth/auth.service.d.ts +2 -2
- package/dist/types/modules/base/base.router.d.ts +1 -1
- package/dist/types/modules/swagger/utils/built-in-route-path-object-manager.d.ts +4 -0
- package/dist/types/modules/swagger/utils/helpers/get-authentication-json-schema-paths.d.ts +1 -1
- package/dist/types/modules/swagger/utils/helpers/get-file-upload-json-schema-paths.d.ts +1 -1
- package/dist/types/modules/swagger/utils/helpers/json-schema-generators/prisma-models/generate-prisma-model-main-routes-paths.d.ts +1 -1
- package/dist/types/modules/swagger/utils/helpers/swagger.router.helpers.d.ts +1 -1
- package/dist/types/types/index.d.ts +5 -5
- package/dist/types/types/new-arkos-config.d.ts +1 -1
- package/dist/types/utils/arkos-router/types/index.d.ts +15 -14
- package/dist/types/utils/arkos-router/utils/helpers/index.d.ts +1 -0
- package/dist/types/utils/helpers/prisma.helpers.d.ts +1 -0
- 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[
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
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
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
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
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
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[
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
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("
|
|
139
|
+
$ref: getSchemaRef("User", userMode),
|
|
110
140
|
},
|
|
111
141
|
},
|
|
112
142
|
},
|
|
113
143
|
},
|
|
114
|
-
|
|
115
|
-
"
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
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[
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
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
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
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
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
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[
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
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
|
-
|
|
207
|
-
|
|
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
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
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
|
-
|
|
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
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
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
|
-
|
|
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
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
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
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
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
|
}
|