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