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