@intlayer/backend 7.2.1-canary.1 → 7.2.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/esm/utils/AI/aiSdk.mjs +7 -1
- package/dist/esm/utils/AI/aiSdk.mjs.map +1 -1
- package/dist/types/controllers/projectAccessKey.controller.d.ts.map +1 -1
- package/dist/types/controllers/tag.controller.d.ts.map +1 -1
- package/dist/types/emails/InviteUserEmail.d.ts +4 -4
- package/dist/types/emails/InviteUserEmail.d.ts.map +1 -1
- package/dist/types/emails/MagicLinkEmail.d.ts +4 -4
- package/dist/types/emails/OAuthTokenCreatedEmail.d.ts +4 -4
- package/dist/types/emails/OAuthTokenCreatedEmail.d.ts.map +1 -1
- package/dist/types/emails/PasswordChangeConfirmation.d.ts +4 -4
- package/dist/types/emails/ResetUserPassword.d.ts +4 -4
- package/dist/types/emails/SubscriptionPaymentCancellation.d.ts +4 -4
- package/dist/types/emails/SubscriptionPaymentError.d.ts +4 -4
- package/dist/types/emails/SubscriptionPaymentError.d.ts.map +1 -1
- package/dist/types/emails/SubscriptionPaymentSuccess.d.ts +4 -4
- package/dist/types/emails/ValidateUserEmail.d.ts +4 -4
- package/dist/types/emails/Welcome.d.ts +4 -4
- package/dist/types/emails/Welcome.d.ts.map +1 -1
- package/dist/types/models/dictionary.model.d.ts +4 -4
- package/dist/types/models/dictionary.model.d.ts.map +1 -1
- package/dist/types/models/discussion.model.d.ts +2 -2
- package/dist/types/models/oAuth2.model.d.ts +3 -3
- package/dist/types/models/oAuth2.model.d.ts.map +1 -1
- package/dist/types/routes/ai.routes.d.ts.map +1 -1
- package/dist/types/routes/eventListener.routes.d.ts.map +1 -1
- package/dist/types/routes/project.routes.d.ts.map +1 -1
- package/dist/types/schemas/dictionary.schema.d.ts +6 -6
- package/dist/types/schemas/dictionary.schema.d.ts.map +1 -1
- package/dist/types/schemas/discussion.schema.d.ts +6 -6
- package/dist/types/schemas/oAuth2.schema.d.ts +5 -5
- package/dist/types/schemas/organization.schema.d.ts +6 -6
- package/dist/types/schemas/plans.schema.d.ts +6 -6
- package/dist/types/schemas/project.schema.d.ts +6 -6
- package/dist/types/schemas/project.schema.d.ts.map +1 -1
- package/dist/types/schemas/session.schema.d.ts +6 -6
- package/dist/types/schemas/tag.schema.d.ts +6 -6
- package/dist/types/schemas/user.schema.d.ts +6 -6
- package/dist/types/utils/filtersAndPagination/getDictionaryFiltersAndPagination.d.ts +2 -2
- package/dist/types/utils/filtersAndPagination/getDiscussionFiltersAndPagination.d.ts +2 -2
- package/dist/types/utils/filtersAndPagination/getOrganizationFiltersAndPagination.d.ts +2 -2
- package/dist/types/utils/filtersAndPagination/getProjectFiltersAndPagination.d.ts +2 -2
- package/dist/types/utils/filtersAndPagination/getTagFiltersAndPagination.d.ts +2 -2
- package/package.json +17 -18
- package/dist/cjs/_virtual/_utils_asset.cjs +0 -98
- package/dist/cjs/_virtual/rolldown_runtime.cjs +0 -25
- package/dist/cjs/controllers/ai.controller.cjs +0 -381
- package/dist/cjs/controllers/ai.controller.cjs.map +0 -1
- package/dist/cjs/controllers/dictionary.controller.cjs +0 -463
- package/dist/cjs/controllers/dictionary.controller.cjs.map +0 -1
- package/dist/cjs/controllers/eventListener.controller.cjs +0 -53
- package/dist/cjs/controllers/eventListener.controller.cjs.map +0 -1
- package/dist/cjs/controllers/newsletter.controller.cjs +0 -164
- package/dist/cjs/controllers/newsletter.controller.cjs.map +0 -1
- package/dist/cjs/controllers/oAuth2.controller.cjs +0 -22
- package/dist/cjs/controllers/oAuth2.controller.cjs.map +0 -1
- package/dist/cjs/controllers/organization.controller.cjs +0 -492
- package/dist/cjs/controllers/organization.controller.cjs.map +0 -1
- package/dist/cjs/controllers/project.controller.cjs +0 -430
- package/dist/cjs/controllers/project.controller.cjs.map +0 -1
- package/dist/cjs/controllers/projectAccessKey.controller.cjs +0 -161
- package/dist/cjs/controllers/projectAccessKey.controller.cjs.map +0 -1
- package/dist/cjs/controllers/search.controller.cjs +0 -14
- package/dist/cjs/controllers/search.controller.cjs.map +0 -1
- package/dist/cjs/controllers/stripe.controller.cjs +0 -149
- package/dist/cjs/controllers/stripe.controller.cjs.map +0 -1
- package/dist/cjs/controllers/tag.controller.cjs +0 -226
- package/dist/cjs/controllers/tag.controller.cjs.map +0 -1
- package/dist/cjs/controllers/user.controller.cjs +0 -269
- package/dist/cjs/controllers/user.controller.cjs.map +0 -1
- package/dist/cjs/emails/InviteUserEmail.cjs +0 -325
- package/dist/cjs/emails/InviteUserEmail.cjs.map +0 -1
- package/dist/cjs/emails/MagicLinkEmail.cjs +0 -242
- package/dist/cjs/emails/MagicLinkEmail.cjs.map +0 -1
- package/dist/cjs/emails/OAuthTokenCreatedEmail.cjs +0 -301
- package/dist/cjs/emails/OAuthTokenCreatedEmail.cjs.map +0 -1
- package/dist/cjs/emails/PasswordChangeConfirmation.cjs +0 -177
- package/dist/cjs/emails/PasswordChangeConfirmation.cjs.map +0 -1
- package/dist/cjs/emails/ResetUserPassword.cjs +0 -240
- package/dist/cjs/emails/ResetUserPassword.cjs.map +0 -1
- package/dist/cjs/emails/SubscriptionPaymentCancellation.cjs +0 -202
- package/dist/cjs/emails/SubscriptionPaymentCancellation.cjs.map +0 -1
- package/dist/cjs/emails/SubscriptionPaymentError.cjs +0 -202
- package/dist/cjs/emails/SubscriptionPaymentError.cjs.map +0 -1
- package/dist/cjs/emails/SubscriptionPaymentSuccess.cjs +0 -208
- package/dist/cjs/emails/SubscriptionPaymentSuccess.cjs.map +0 -1
- package/dist/cjs/emails/ValidateUserEmail.cjs +0 -240
- package/dist/cjs/emails/ValidateUserEmail.cjs.map +0 -1
- package/dist/cjs/emails/Welcome.cjs +0 -216
- package/dist/cjs/emails/Welcome.cjs.map +0 -1
- package/dist/cjs/emails/index.cjs +0 -25
- package/dist/cjs/export.cjs +0 -24
- package/dist/cjs/index.cjs +0 -91
- package/dist/cjs/index.cjs.map +0 -1
- package/dist/cjs/logger/index.cjs +0 -13
- package/dist/cjs/logger/index.cjs.map +0 -1
- package/dist/cjs/middlewares/oAuth2.middleware.cjs +0 -42
- package/dist/cjs/middlewares/oAuth2.middleware.cjs.map +0 -1
- package/dist/cjs/middlewares/request.middleware.cjs +0 -17
- package/dist/cjs/middlewares/request.middleware.cjs.map +0 -1
- package/dist/cjs/middlewares/sessionAuth.middleware.cjs +0 -22
- package/dist/cjs/middlewares/sessionAuth.middleware.cjs.map +0 -1
- package/dist/cjs/models/dictionary.model.cjs +0 -10
- package/dist/cjs/models/dictionary.model.cjs.map +0 -1
- package/dist/cjs/models/discussion.model.cjs +0 -10
- package/dist/cjs/models/discussion.model.cjs.map +0 -1
- package/dist/cjs/models/oAuth2.model.cjs +0 -10
- package/dist/cjs/models/oAuth2.model.cjs.map +0 -1
- package/dist/cjs/models/organization.model.cjs +0 -10
- package/dist/cjs/models/organization.model.cjs.map +0 -1
- package/dist/cjs/models/project.model.cjs +0 -10
- package/dist/cjs/models/project.model.cjs.map +0 -1
- package/dist/cjs/models/session.model.cjs +0 -10
- package/dist/cjs/models/session.model.cjs.map +0 -1
- package/dist/cjs/models/tag.model.cjs +0 -10
- package/dist/cjs/models/tag.model.cjs.map +0 -1
- package/dist/cjs/models/user.model.cjs +0 -10
- package/dist/cjs/models/user.model.cjs.map +0 -1
- package/dist/cjs/routes/ai.routes.cjs +0 -75
- package/dist/cjs/routes/ai.routes.cjs.map +0 -1
- package/dist/cjs/routes/dictionary.routes.cjs +0 -64
- package/dist/cjs/routes/dictionary.routes.cjs.map +0 -1
- package/dist/cjs/routes/eventListener.routes.cjs +0 -20
- package/dist/cjs/routes/eventListener.routes.cjs.map +0 -1
- package/dist/cjs/routes/newsletter.routes.cjs +0 -34
- package/dist/cjs/routes/newsletter.routes.cjs.map +0 -1
- package/dist/cjs/routes/organization.routes.cjs +0 -70
- package/dist/cjs/routes/organization.routes.cjs.map +0 -1
- package/dist/cjs/routes/project.routes.cjs +0 -83
- package/dist/cjs/routes/project.routes.cjs.map +0 -1
- package/dist/cjs/routes/search.routes.cjs +0 -20
- package/dist/cjs/routes/search.routes.cjs.map +0 -1
- package/dist/cjs/routes/stripe.routes.cjs +0 -34
- package/dist/cjs/routes/stripe.routes.cjs.map +0 -1
- package/dist/cjs/routes/tags.routes.cjs +0 -40
- package/dist/cjs/routes/tags.routes.cjs.map +0 -1
- package/dist/cjs/routes/user.routes.cjs +0 -58
- package/dist/cjs/routes/user.routes.cjs.map +0 -1
- package/dist/cjs/schemas/dictionary.schema.cjs +0 -73
- package/dist/cjs/schemas/dictionary.schema.cjs.map +0 -1
- package/dist/cjs/schemas/discussion.schema.cjs +0 -81
- package/dist/cjs/schemas/discussion.schema.cjs.map +0 -1
- package/dist/cjs/schemas/oAuth2.schema.cjs +0 -49
- package/dist/cjs/schemas/oAuth2.schema.cjs.map +0 -1
- package/dist/cjs/schemas/organization.schema.cjs +0 -62
- package/dist/cjs/schemas/organization.schema.cjs.map +0 -1
- package/dist/cjs/schemas/plans.schema.cjs +0 -75
- package/dist/cjs/schemas/plans.schema.cjs.map +0 -1
- package/dist/cjs/schemas/project.schema.cjs +0 -112
- package/dist/cjs/schemas/project.schema.cjs.map +0 -1
- package/dist/cjs/schemas/session.schema.cjs +0 -43
- package/dist/cjs/schemas/session.schema.cjs.map +0 -1
- package/dist/cjs/schemas/tag.schema.cjs +0 -62
- package/dist/cjs/schemas/tag.schema.cjs.map +0 -1
- package/dist/cjs/schemas/user.schema.cjs +0 -87
- package/dist/cjs/schemas/user.schema.cjs.map +0 -1
- package/dist/cjs/services/dictionary.service.cjs +0 -176
- package/dist/cjs/services/dictionary.service.cjs.map +0 -1
- package/dist/cjs/services/email.service.cjs +0 -155
- package/dist/cjs/services/email.service.cjs.map +0 -1
- package/dist/cjs/services/oAuth2.service.cjs +0 -211
- package/dist/cjs/services/oAuth2.service.cjs.map +0 -1
- package/dist/cjs/services/organization.service.cjs +0 -106
- package/dist/cjs/services/organization.service.cjs.map +0 -1
- package/dist/cjs/services/project.service.cjs +0 -89
- package/dist/cjs/services/project.service.cjs.map +0 -1
- package/dist/cjs/services/projectAccessKey.service.cjs +0 -111
- package/dist/cjs/services/projectAccessKey.service.cjs.map +0 -1
- package/dist/cjs/services/subscription.service.cjs +0 -184
- package/dist/cjs/services/subscription.service.cjs.map +0 -1
- package/dist/cjs/services/tag.service.cjs +0 -88
- package/dist/cjs/services/tag.service.cjs.map +0 -1
- package/dist/cjs/services/user.service.cjs +0 -120
- package/dist/cjs/services/user.service.cjs.map +0 -1
- package/dist/cjs/types/Routes.cjs +0 -0
- package/dist/cjs/types/dictionary.types.cjs +0 -0
- package/dist/cjs/types/discussion.types.cjs +0 -0
- package/dist/cjs/types/oAuth2.types.cjs +0 -0
- package/dist/cjs/types/organization.types.cjs +0 -0
- package/dist/cjs/types/plan.types.cjs +0 -0
- package/dist/cjs/types/project.types.cjs +0 -0
- package/dist/cjs/types/session.types.cjs +0 -0
- package/dist/cjs/types/tag.types.cjs +0 -0
- package/dist/cjs/types/user.types.cjs +0 -10
- package/dist/cjs/types/user.types.cjs.map +0 -1
- package/dist/cjs/utils/AI/aiSdk.cjs +0 -94
- package/dist/cjs/utils/AI/aiSdk.cjs.map +0 -1
- package/dist/cjs/utils/AI/askDocQuestion/askDocQuestion.cjs +0 -201
- package/dist/cjs/utils/AI/askDocQuestion/askDocQuestion.cjs.map +0 -1
- package/dist/cjs/utils/AI/askDocQuestion/indexMarkdownFiles.cjs +0 -150
- package/dist/cjs/utils/AI/askDocQuestion/indexMarkdownFiles.cjs.map +0 -1
- package/dist/cjs/utils/AI/auditDictionary/index.cjs +0 -60
- package/dist/cjs/utils/AI/auditDictionary/index.cjs.map +0 -1
- package/dist/cjs/utils/AI/auditDictionaryField/index.cjs +0 -63
- package/dist/cjs/utils/AI/auditDictionaryField/index.cjs.map +0 -1
- package/dist/cjs/utils/AI/auditDictionaryMetadata/index.cjs +0 -45
- package/dist/cjs/utils/AI/auditDictionaryMetadata/index.cjs.map +0 -1
- package/dist/cjs/utils/AI/auditTag/index.cjs +0 -40
- package/dist/cjs/utils/AI/auditTag/index.cjs.map +0 -1
- package/dist/cjs/utils/AI/autocomplete/index.cjs +0 -41
- package/dist/cjs/utils/AI/autocomplete/index.cjs.map +0 -1
- package/dist/cjs/utils/AI/customQuery/index.cjs +0 -27
- package/dist/cjs/utils/AI/customQuery/index.cjs.map +0 -1
- package/dist/cjs/utils/AI/translateJSON/index.cjs +0 -71
- package/dist/cjs/utils/AI/translateJSON/index.cjs.map +0 -1
- package/dist/cjs/utils/access.cjs +0 -0
- package/dist/cjs/utils/accessControl.cjs +0 -133
- package/dist/cjs/utils/accessControl.cjs.map +0 -1
- package/dist/cjs/utils/auth/getAuth.cjs +0 -218
- package/dist/cjs/utils/auth/getAuth.cjs.map +0 -1
- package/dist/cjs/utils/cors.cjs +0 -33
- package/dist/cjs/utils/cors.cjs.map +0 -1
- package/dist/cjs/utils/ensureArrayQueryFilter.cjs +0 -13
- package/dist/cjs/utils/ensureArrayQueryFilter.cjs.map +0 -1
- package/dist/cjs/utils/ensureMongoDocumentToObject.cjs +0 -16
- package/dist/cjs/utils/ensureMongoDocumentToObject.cjs.map +0 -1
- package/dist/cjs/utils/errors/ErrorHandler.cjs +0 -76
- package/dist/cjs/utils/errors/ErrorHandler.cjs.map +0 -1
- package/dist/cjs/utils/errors/ErrorsClass.cjs +0 -54
- package/dist/cjs/utils/errors/ErrorsClass.cjs.map +0 -1
- package/dist/cjs/utils/errors/errorCodes.cjs +0 -1387
- package/dist/cjs/utils/errors/errorCodes.cjs.map +0 -1
- package/dist/cjs/utils/errors/index.cjs +0 -8
- package/dist/cjs/utils/extractJSON.cjs +0 -61
- package/dist/cjs/utils/extractJSON.cjs.map +0 -1
- package/dist/cjs/utils/filtersAndPagination/getDictionaryFiltersAndPagination.cjs +0 -94
- package/dist/cjs/utils/filtersAndPagination/getDictionaryFiltersAndPagination.cjs.map +0 -1
- package/dist/cjs/utils/filtersAndPagination/getDiscussionFiltersAndPagination.cjs +0 -65
- package/dist/cjs/utils/filtersAndPagination/getDiscussionFiltersAndPagination.cjs.map +0 -1
- package/dist/cjs/utils/filtersAndPagination/getFiltersAndPaginationFromBody.cjs +0 -36
- package/dist/cjs/utils/filtersAndPagination/getFiltersAndPaginationFromBody.cjs.map +0 -1
- package/dist/cjs/utils/filtersAndPagination/getOrganizationFiltersAndPagination.cjs +0 -49
- package/dist/cjs/utils/filtersAndPagination/getOrganizationFiltersAndPagination.cjs.map +0 -1
- package/dist/cjs/utils/filtersAndPagination/getProjectFiltersAndPagination.cjs +0 -53
- package/dist/cjs/utils/filtersAndPagination/getProjectFiltersAndPagination.cjs.map +0 -1
- package/dist/cjs/utils/filtersAndPagination/getTagFiltersAndPagination.cjs +0 -57
- package/dist/cjs/utils/filtersAndPagination/getTagFiltersAndPagination.cjs.map +0 -1
- package/dist/cjs/utils/filtersAndPagination/getUserFiltersAndPagination.cjs +0 -74
- package/dist/cjs/utils/filtersAndPagination/getUserFiltersAndPagination.cjs.map +0 -1
- package/dist/cjs/utils/httpStatusCodes.cjs +0 -401
- package/dist/cjs/utils/httpStatusCodes.cjs.map +0 -1
- package/dist/cjs/utils/mapper/dictionary.cjs +0 -29
- package/dist/cjs/utils/mapper/dictionary.cjs.map +0 -1
- package/dist/cjs/utils/mapper/organization.cjs +0 -19
- package/dist/cjs/utils/mapper/organization.cjs.map +0 -1
- package/dist/cjs/utils/mapper/project.cjs +0 -26
- package/dist/cjs/utils/mapper/project.cjs.map +0 -1
- package/dist/cjs/utils/mapper/session.cjs +0 -15
- package/dist/cjs/utils/mapper/session.cjs.map +0 -1
- package/dist/cjs/utils/mapper/tag.cjs +0 -25
- package/dist/cjs/utils/mapper/tag.cjs.map +0 -1
- package/dist/cjs/utils/mapper/user.cjs +0 -24
- package/dist/cjs/utils/mapper/user.cjs.map +0 -1
- package/dist/cjs/utils/mergeFunctionTypes.cjs +0 -0
- package/dist/cjs/utils/mongoDB/connectDB.cjs +0 -32
- package/dist/cjs/utils/mongoDB/connectDB.cjs.map +0 -1
- package/dist/cjs/utils/mongoDB/types.cjs +0 -0
- package/dist/cjs/utils/oAuth2.cjs +0 -25
- package/dist/cjs/utils/oAuth2.cjs.map +0 -1
- package/dist/cjs/utils/permissions.cjs +0 -103
- package/dist/cjs/utils/permissions.cjs.map +0 -1
- package/dist/cjs/utils/plan.cjs +0 -63
- package/dist/cjs/utils/plan.cjs.map +0 -1
- package/dist/cjs/utils/rateLimiter.cjs +0 -48
- package/dist/cjs/utils/rateLimiter.cjs.map +0 -1
- package/dist/cjs/utils/removeObjectKeys.cjs +0 -11
- package/dist/cjs/utils/removeObjectKeys.cjs.map +0 -1
- package/dist/cjs/utils/responseData.cjs +0 -33
- package/dist/cjs/utils/responseData.cjs.map +0 -1
- package/dist/cjs/utils/validation/validateArray.cjs +0 -31
- package/dist/cjs/utils/validation/validateArray.cjs.map +0 -1
- package/dist/cjs/utils/validation/validateDictionary.cjs +0 -35
- package/dist/cjs/utils/validation/validateDictionary.cjs.map +0 -1
- package/dist/cjs/utils/validation/validateEmail.cjs +0 -20
- package/dist/cjs/utils/validation/validateEmail.cjs.map +0 -1
- package/dist/cjs/utils/validation/validateOrganization.cjs +0 -43
- package/dist/cjs/utils/validation/validateOrganization.cjs.map +0 -1
- package/dist/cjs/utils/validation/validatePhone.cjs +0 -20
- package/dist/cjs/utils/validation/validatePhone.cjs.map +0 -1
- package/dist/cjs/utils/validation/validateProject.cjs +0 -55
- package/dist/cjs/utils/validation/validateProject.cjs.map +0 -1
- package/dist/cjs/utils/validation/validateString.cjs +0 -21
- package/dist/cjs/utils/validation/validateString.cjs.map +0 -1
- package/dist/cjs/utils/validation/validateTag.cjs +0 -47
- package/dist/cjs/utils/validation/validateTag.cjs.map +0 -1
- package/dist/cjs/utils/validation/validateUser.cjs +0 -47
- package/dist/cjs/utils/validation/validateUser.cjs.map +0 -1
- package/dist/cjs/webhooks/stripe.webhook.cjs +0 -116
- package/dist/cjs/webhooks/stripe.webhook.cjs.map +0 -1
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
const require_utils_ensureArrayQueryFilter = require('../ensureArrayQueryFilter.cjs');
|
|
2
|
-
const require_utils_filtersAndPagination_getFiltersAndPaginationFromBody = require('./getFiltersAndPaginationFromBody.cjs');
|
|
3
|
-
|
|
4
|
-
//#region src/utils/filtersAndPagination/getTagFiltersAndPagination.ts
|
|
5
|
-
/**
|
|
6
|
-
* Extracts filters and pagination information from the request body.
|
|
7
|
-
* @param req - Express request object.
|
|
8
|
-
* @returns Object containing filters, page, pageSize, and getNumberOfPages functions.
|
|
9
|
-
*/
|
|
10
|
-
const getTagFiltersAndPagination = (req, res) => {
|
|
11
|
-
const { filters: filtersRequest, ...pagination } = require_utils_filtersAndPagination_getFiltersAndPaginationFromBody.getFiltersAndPaginationFromBody(req);
|
|
12
|
-
const { roles, organization } = res.locals;
|
|
13
|
-
let filters = {};
|
|
14
|
-
const sortOptions = { updatedAt: -1 };
|
|
15
|
-
const { name, search, ids, keys, organizationId, fetchAll } = filtersRequest ?? {};
|
|
16
|
-
if (ids) filters = {
|
|
17
|
-
...filters,
|
|
18
|
-
_id: { $in: require_utils_ensureArrayQueryFilter.ensureArrayQueryFilter(ids) }
|
|
19
|
-
};
|
|
20
|
-
if (keys) filters = {
|
|
21
|
-
...filters,
|
|
22
|
-
key: { $in: require_utils_ensureArrayQueryFilter.ensureArrayQueryFilter(keys) }
|
|
23
|
-
};
|
|
24
|
-
if (name) filters = {
|
|
25
|
-
...filters,
|
|
26
|
-
name: new RegExp(name, "i")
|
|
27
|
-
};
|
|
28
|
-
if (search) {
|
|
29
|
-
const searchRegex = new RegExp(search, "i");
|
|
30
|
-
filters = {
|
|
31
|
-
...filters,
|
|
32
|
-
$or: [
|
|
33
|
-
{ name: searchRegex },
|
|
34
|
-
{ key: searchRegex },
|
|
35
|
-
{ description: searchRegex },
|
|
36
|
-
{ instructions: searchRegex }
|
|
37
|
-
]
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
if (organizationId) filters = {
|
|
41
|
-
...filters,
|
|
42
|
-
organizationId
|
|
43
|
-
};
|
|
44
|
-
if (!(roles.includes("admin") && fetchAll === "true")) filters = {
|
|
45
|
-
...filters,
|
|
46
|
-
organizationId: organization?.id
|
|
47
|
-
};
|
|
48
|
-
return {
|
|
49
|
-
filters,
|
|
50
|
-
sortOptions,
|
|
51
|
-
...pagination
|
|
52
|
-
};
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
//#endregion
|
|
56
|
-
exports.getTagFiltersAndPagination = getTagFiltersAndPagination;
|
|
57
|
-
//# sourceMappingURL=getTagFiltersAndPagination.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getTagFiltersAndPagination.cjs","names":["getFiltersAndPaginationFromBody","filters: TagFilters","sortOptions: Record<string, 1 | -1>","ensureArrayQueryFilter"],"sources":["../../../../src/utils/filtersAndPagination/getTagFiltersAndPagination.ts"],"sourcesContent":["import type { ResponseWithSession } from '@middlewares/sessionAuth.middleware';\nimport { ensureArrayQueryFilter } from '@utils/ensureArrayQueryFilter';\nimport type { Request } from 'express';\nimport type { RootFilterQuery } from 'mongoose';\nimport type { Tag } from '@/types/tag.types';\nimport {\n type FiltersAndPagination,\n getFiltersAndPaginationFromBody,\n} from './getFiltersAndPaginationFromBody';\n\nexport type TagFiltersParams = {\n ids?: string | string[];\n keys?: string | string[];\n name?: string;\n search?: string;\n organizationId?: string;\n /**\n * For admin users, if true, will fetch all tags without filtering by organization\n */\n fetchAll?: 'true' | 'false';\n};\nexport type TagFilters = RootFilterQuery<Tag>;\n\n/**\n * Extracts filters and pagination information from the request body.\n * @param req - Express request object.\n * @returns Object containing filters, page, pageSize, and getNumberOfPages functions.\n */\nexport const getTagFiltersAndPagination = (\n req: Request<FiltersAndPagination<TagFiltersParams>>,\n res: ResponseWithSession\n) => {\n const { filters: filtersRequest, ...pagination } =\n getFiltersAndPaginationFromBody<TagFiltersParams>(req);\n const { roles, organization } = res.locals;\n\n let filters: TagFilters = {};\n const sortOptions: Record<string, 1 | -1> = { updatedAt: -1 };\n\n const { name, search, ids, keys, organizationId, fetchAll } =\n filtersRequest ?? {};\n\n if (ids) {\n filters = { ...filters, _id: { $in: ensureArrayQueryFilter(ids) } };\n }\n\n if (keys) {\n filters = { ...filters, key: { $in: ensureArrayQueryFilter(keys) } };\n }\n\n if (name) {\n filters = { ...filters, name: new RegExp(name, 'i') };\n }\n\n if (search) {\n const searchRegex = new RegExp(search, 'i');\n filters = {\n ...filters,\n $or: [\n { name: searchRegex },\n { key: searchRegex },\n { description: searchRegex },\n { instructions: searchRegex },\n ],\n };\n }\n\n if (organizationId) {\n filters = { ...filters, organizationId };\n }\n\n if (!(roles.includes('admin') && fetchAll === 'true')) {\n filters = { ...filters, organizationId: organization?.id };\n }\n\n return { filters, sortOptions, ...pagination };\n};\n"],"mappings":";;;;;;;;;AA4BA,MAAa,8BACX,KACA,QACG;CACH,MAAM,EAAE,SAAS,gBAAgB,GAAG,eAClCA,mGAAkD,IAAI;CACxD,MAAM,EAAE,OAAO,iBAAiB,IAAI;CAEpC,IAAIC,UAAsB,EAAE;CAC5B,MAAMC,cAAsC,EAAE,WAAW,IAAI;CAE7D,MAAM,EAAE,MAAM,QAAQ,KAAK,MAAM,gBAAgB,aAC/C,kBAAkB,EAAE;AAEtB,KAAI,IACF,WAAU;EAAE,GAAG;EAAS,KAAK,EAAE,KAAKC,4DAAuB,IAAI,EAAE;EAAE;AAGrE,KAAI,KACF,WAAU;EAAE,GAAG;EAAS,KAAK,EAAE,KAAKA,4DAAuB,KAAK,EAAE;EAAE;AAGtE,KAAI,KACF,WAAU;EAAE,GAAG;EAAS,MAAM,IAAI,OAAO,MAAM,IAAI;EAAE;AAGvD,KAAI,QAAQ;EACV,MAAM,cAAc,IAAI,OAAO,QAAQ,IAAI;AAC3C,YAAU;GACR,GAAG;GACH,KAAK;IACH,EAAE,MAAM,aAAa;IACrB,EAAE,KAAK,aAAa;IACpB,EAAE,aAAa,aAAa;IAC5B,EAAE,cAAc,aAAa;IAC9B;GACF;;AAGH,KAAI,eACF,WAAU;EAAE,GAAG;EAAS;EAAgB;AAG1C,KAAI,EAAE,MAAM,SAAS,QAAQ,IAAI,aAAa,QAC5C,WAAU;EAAE,GAAG;EAAS,gBAAgB,cAAc;EAAI;AAG5D,QAAO;EAAE;EAAS;EAAa,GAAG;EAAY"}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
const require_utils_ensureArrayQueryFilter = require('../ensureArrayQueryFilter.cjs');
|
|
2
|
-
const require_utils_filtersAndPagination_getFiltersAndPaginationFromBody = require('./getFiltersAndPaginationFromBody.cjs');
|
|
3
|
-
|
|
4
|
-
//#region src/utils/filtersAndPagination/getUserFiltersAndPagination.ts
|
|
5
|
-
/**
|
|
6
|
-
* Extracts filters and pagination information from the request body.
|
|
7
|
-
* @param req - Express request object.
|
|
8
|
-
* @returns Object containing filters, page, pageSize, and getNumberOfPages functions.
|
|
9
|
-
*/
|
|
10
|
-
const getUserFiltersAndPagination = (req, res) => {
|
|
11
|
-
const { filters: filtersRequest, ...pagination } = require_utils_filtersAndPagination_getFiltersAndPaginationFromBody.getFiltersAndPaginationFromBody(req);
|
|
12
|
-
const { roles, organization } = res.locals;
|
|
13
|
-
let filters = {};
|
|
14
|
-
let sortOptions = { updatedAt: -1 };
|
|
15
|
-
const { firstName, lastName, email, emailVerified, role, search, sortBy, sortOrder, ids, fetchAll } = filtersRequest ?? {};
|
|
16
|
-
if (ids) {
|
|
17
|
-
filters = {
|
|
18
|
-
...filters,
|
|
19
|
-
_id: { $in: require_utils_ensureArrayQueryFilter.ensureArrayQueryFilter(ids) }
|
|
20
|
-
};
|
|
21
|
-
if (!(roles.includes("admin") && fetchAll === "true")) {
|
|
22
|
-
const secureMembersIds = require_utils_ensureArrayQueryFilter.ensureArrayQueryFilter(ids)?.filter((id) => organization?.membersIds?.map(String).includes(id)) ?? [];
|
|
23
|
-
filters = {
|
|
24
|
-
...filters,
|
|
25
|
-
_id: { $in: secureMembersIds }
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
if (firstName) filters = {
|
|
30
|
-
...filters,
|
|
31
|
-
firstName: new RegExp(firstName, "i")
|
|
32
|
-
};
|
|
33
|
-
if (lastName) filters = {
|
|
34
|
-
...filters,
|
|
35
|
-
lastName: new RegExp(lastName, "i")
|
|
36
|
-
};
|
|
37
|
-
if (email) filters = {
|
|
38
|
-
...filters,
|
|
39
|
-
email: new RegExp(email, "i")
|
|
40
|
-
};
|
|
41
|
-
if (emailVerified !== void 0) {
|
|
42
|
-
const isVerified = emailVerified === "true";
|
|
43
|
-
filters = {
|
|
44
|
-
...filters,
|
|
45
|
-
emailVerified: isVerified
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
if (role) filters = {
|
|
49
|
-
...filters,
|
|
50
|
-
role
|
|
51
|
-
};
|
|
52
|
-
if (search) {
|
|
53
|
-
const searchRegex = new RegExp(search, "i");
|
|
54
|
-
filters = {
|
|
55
|
-
...filters,
|
|
56
|
-
$or: [
|
|
57
|
-
{ firstName: searchRegex },
|
|
58
|
-
{ lastName: searchRegex },
|
|
59
|
-
{ email: searchRegex },
|
|
60
|
-
{ name: searchRegex }
|
|
61
|
-
]
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
if (sortBy && sortOrder && (sortOrder === "asc" || sortOrder === "desc")) sortOptions = { [sortBy]: sortOrder === "asc" ? 1 : -1 };
|
|
65
|
-
return {
|
|
66
|
-
filters,
|
|
67
|
-
sortOptions,
|
|
68
|
-
...pagination
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
//#endregion
|
|
73
|
-
exports.getUserFiltersAndPagination = getUserFiltersAndPagination;
|
|
74
|
-
//# sourceMappingURL=getUserFiltersAndPagination.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getUserFiltersAndPagination.cjs","names":["getFiltersAndPaginationFromBody","sortOptions: Record<string, 1 | -1>","ensureArrayQueryFilter","secureMembersIds: string[]"],"sources":["../../../../src/utils/filtersAndPagination/getUserFiltersAndPagination.ts"],"sourcesContent":["import type { GetUsersResult } from '@controllers/user.controller';\nimport type { ResponseWithSession } from '@middlewares/sessionAuth.middleware';\nimport { ensureArrayQueryFilter } from '@utils/ensureArrayQueryFilter';\nimport type { Request } from 'express';\nimport type { RootFilterQuery } from 'mongoose';\nimport type { User } from '@/types/user.types';\nimport {\n type FiltersAndPagination,\n getFiltersAndPaginationFromBody,\n} from './getFiltersAndPaginationFromBody';\n\nexport type UserFiltersParam = {\n ids?: string | string[];\n firstName?: string;\n lastName?: string;\n email?: string;\n emailVerified?: string;\n role?: string;\n search?: string;\n sortBy?: string;\n sortOrder?: string;\n /**\n * For admin users, if true, will fetch all users without filtering by organization\n */\n fetchAll?: 'true' | 'false';\n};\nexport type UserFilters = RootFilterQuery<User>;\n\n/**\n * Extracts filters and pagination information from the request body.\n * @param req - Express request object.\n * @returns Object containing filters, page, pageSize, and getNumberOfPages functions.\n */\nexport const getUserFiltersAndPagination = (\n req: Request<FiltersAndPagination<UserFiltersParam>>,\n res: ResponseWithSession<GetUsersResult>\n) => {\n const { filters: filtersRequest, ...pagination } =\n getFiltersAndPaginationFromBody<UserFiltersParam>(req);\n const { roles, organization } = res.locals;\n\n let filters = {};\n let sortOptions: Record<string, 1 | -1> = { updatedAt: -1 };\n\n const {\n firstName,\n lastName,\n email,\n emailVerified,\n role,\n search,\n sortBy,\n sortOrder,\n ids,\n fetchAll,\n } = filtersRequest ?? {};\n\n if (ids) {\n filters = { ...filters, _id: { $in: ensureArrayQueryFilter(ids) } };\n\n if (!(roles.includes('admin') && fetchAll === 'true')) {\n const secureMembersIds: string[] =\n ensureArrayQueryFilter(ids)?.filter((id) =>\n organization?.membersIds?.map(String).includes(id)\n ) ?? [];\n\n filters = {\n ...filters,\n _id: {\n $in: secureMembersIds,\n },\n };\n }\n }\n\n if (firstName) {\n filters = { ...filters, firstName: new RegExp(firstName, 'i') };\n }\n\n if (lastName) {\n filters = { ...filters, lastName: new RegExp(lastName, 'i') };\n }\n\n if (email) {\n filters = { ...filters, email: new RegExp(email, 'i') };\n }\n\n if (emailVerified !== undefined) {\n const isVerified = emailVerified === 'true';\n filters = { ...filters, emailVerified: isVerified };\n }\n\n if (role) {\n filters = { ...filters, role };\n }\n\n if (search) {\n const searchRegex = new RegExp(search, 'i');\n filters = {\n ...filters,\n $or: [\n { firstName: searchRegex },\n { lastName: searchRegex },\n { email: searchRegex },\n { name: searchRegex },\n ],\n };\n }\n\n if (sortBy && sortOrder && (sortOrder === 'asc' || sortOrder === 'desc')) {\n sortOptions = { [sortBy]: sortOrder === 'asc' ? 1 : -1 };\n }\n\n return { filters, sortOptions, ...pagination };\n};\n"],"mappings":";;;;;;;;;AAiCA,MAAa,+BACX,KACA,QACG;CACH,MAAM,EAAE,SAAS,gBAAgB,GAAG,eAClCA,mGAAkD,IAAI;CACxD,MAAM,EAAE,OAAO,iBAAiB,IAAI;CAEpC,IAAI,UAAU,EAAE;CAChB,IAAIC,cAAsC,EAAE,WAAW,IAAI;CAE3D,MAAM,EACJ,WACA,UACA,OACA,eACA,MACA,QACA,QACA,WACA,KACA,aACE,kBAAkB,EAAE;AAExB,KAAI,KAAK;AACP,YAAU;GAAE,GAAG;GAAS,KAAK,EAAE,KAAKC,4DAAuB,IAAI,EAAE;GAAE;AAEnE,MAAI,EAAE,MAAM,SAAS,QAAQ,IAAI,aAAa,SAAS;GACrD,MAAMC,mBACJD,4DAAuB,IAAI,EAAE,QAAQ,OACnC,cAAc,YAAY,IAAI,OAAO,CAAC,SAAS,GAAG,CACnD,IAAI,EAAE;AAET,aAAU;IACR,GAAG;IACH,KAAK,EACH,KAAK,kBACN;IACF;;;AAIL,KAAI,UACF,WAAU;EAAE,GAAG;EAAS,WAAW,IAAI,OAAO,WAAW,IAAI;EAAE;AAGjE,KAAI,SACF,WAAU;EAAE,GAAG;EAAS,UAAU,IAAI,OAAO,UAAU,IAAI;EAAE;AAG/D,KAAI,MACF,WAAU;EAAE,GAAG;EAAS,OAAO,IAAI,OAAO,OAAO,IAAI;EAAE;AAGzD,KAAI,kBAAkB,QAAW;EAC/B,MAAM,aAAa,kBAAkB;AACrC,YAAU;GAAE,GAAG;GAAS,eAAe;GAAY;;AAGrD,KAAI,KACF,WAAU;EAAE,GAAG;EAAS;EAAM;AAGhC,KAAI,QAAQ;EACV,MAAM,cAAc,IAAI,OAAO,QAAQ,IAAI;AAC3C,YAAU;GACR,GAAG;GACH,KAAK;IACH,EAAE,WAAW,aAAa;IAC1B,EAAE,UAAU,aAAa;IACzB,EAAE,OAAO,aAAa;IACtB,EAAE,MAAM,aAAa;IACtB;GACF;;AAGH,KAAI,UAAU,cAAc,cAAc,SAAS,cAAc,QAC/D,eAAc,GAAG,SAAS,cAAc,QAAQ,IAAI,IAAI;AAG1D,QAAO;EAAE;EAAS;EAAa,GAAG;EAAY"}
|
|
@@ -1,401 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
//#region src/utils/httpStatusCodes.ts
|
|
3
|
-
/**
|
|
4
|
-
* Enum for HTTP response status codes.
|
|
5
|
-
* Contains all the possible HTTP response codes according to the standard.
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* 1xx: Informational responses
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* 100 - CONTINUE - The server has received the request headers and the client should proceed to send the request body.
|
|
12
|
-
*
|
|
13
|
-
* 101 - SWITCHING_PROTOCOLS - The requester has asked the server to switch protocols and the server has agreed to do so.
|
|
14
|
-
*
|
|
15
|
-
* 102 - PROCESSING - Used to return some response headers before final HTTP message.
|
|
16
|
-
*
|
|
17
|
-
* 103 - EARLY_HINTS - Early hints - part of optimization to improve page load time.
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* 2xx: Successful responses
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* 200 - OK - The request has succeeded.
|
|
24
|
-
*
|
|
25
|
-
* 201 - CREATED - The request has been fulfilled and has resulted in one or more new resources being created.
|
|
26
|
-
*
|
|
27
|
-
* 202 - ACCEPTED - The request has been accepted for processing, but the processing has not been completed.
|
|
28
|
-
*
|
|
29
|
-
* 203 - NON_AUTHORITATIVE_INFORMATION - The server successfully processed the request, but is returning information that may be from another source.
|
|
30
|
-
*
|
|
31
|
-
* 204 - NO_CONTENT - The server successfully processed the request and is not returning any content.
|
|
32
|
-
*
|
|
33
|
-
* 205 - RESET_CONTENT - The server successfully processed the request, but is not returning any content and requires that the requester reset the document view.
|
|
34
|
-
*
|
|
35
|
-
* 206 - PARTIAL_CONTENT - The server is delivering only part of the resource due to a range header sent by the client.
|
|
36
|
-
*
|
|
37
|
-
* 207 - MULTI_STATUS - Multi-status response providing status for multiple independent operations.
|
|
38
|
-
*
|
|
39
|
-
* 208 - ALREADY_REPORTED - The members of a DAV binding have already been enumerated in a preceding part of the request.
|
|
40
|
-
*
|
|
41
|
-
* 226 - IM_USED - The server has fulfilled a GET request for the resource, and the response is a representation of the result of one or more instance manipulations applied to the current instance.
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
* 3xx: Redirection messages
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
* 300 - MULTIPLE_CHOICES - The request has more than one possible response. The user-agent or user should choose one of them.
|
|
48
|
-
*
|
|
49
|
-
* 301 - MOVED_PERMANENTLY - The URL of the requested resource has been changed permanently.
|
|
50
|
-
*
|
|
51
|
-
* 302 - FOUND - The requested resource is available at a different URI.
|
|
52
|
-
*
|
|
53
|
-
* 303 - SEE_OTHER - The response to the request can be found under another URI using a GET method.
|
|
54
|
-
*
|
|
55
|
-
* 304 - NOT_MODIFIED - Indicates that the resource has not been modified since the version specified by the request headers.
|
|
56
|
-
*
|
|
57
|
-
* 305 - USE_PROXY - The requested resource must be accessed through the proxy given by the Location field.
|
|
58
|
-
*
|
|
59
|
-
* 306 - SWITCH_PROXY - No longer used. Originally meant to direct the client to switch to a different proxy.
|
|
60
|
-
*
|
|
61
|
-
* 307 - TEMPORARY_REDIRECT - The requested resource resides temporarily under a different URI.
|
|
62
|
-
*
|
|
63
|
-
* 308 - PERMANENT_REDIRECT - The request should be repeated with another URI, but future requests should still use the original URI.
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
* 4xx: Client error responses
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
* 400 - BAD_REQUEST - The server cannot or will not process the request due to something perceived to be a client error.
|
|
70
|
-
*
|
|
71
|
-
* 401 - UNAUTHORIZED - The client must authenticate itself to get the requested response.
|
|
72
|
-
*
|
|
73
|
-
* 403 - FORBIDDEN - The client does not have access rights to the content.
|
|
74
|
-
*
|
|
75
|
-
* 404 - NOT_FOUND - The server can not find the requested resource.
|
|
76
|
-
*
|
|
77
|
-
* 405 - METHOD_NOT_ALLOWED - The request method is known by the server but is not supported by the target resource.
|
|
78
|
-
*
|
|
79
|
-
* 406 - NOT_ACCEPTABLE - This response is sent when the requested resource is capable of generating only content not acceptable according to the Accept headers sent in the request.
|
|
80
|
-
*
|
|
81
|
-
* 407 - PROXY_AUTHENTICATION_REQUIRED - This is similar to 401 but authentication is needed to be done by a proxy.
|
|
82
|
-
*
|
|
83
|
-
* 408 - REQUEST_TIMEOUT - This response is sent on an idle connection by some servers, even without any previous request by the client.
|
|
84
|
-
*
|
|
85
|
-
* 409 - CONFLICT - This response is sent when a request conflicts with the current state of the server.
|
|
86
|
-
*
|
|
87
|
-
* 410 - GONE - This response is sent when the requested resource is no longer available and will not be available again.
|
|
88
|
-
*
|
|
89
|
-
* 411 - LENGTH_REQUIRED - The request did not specify the length of its content, which is required by the requested resource.
|
|
90
|
-
*
|
|
91
|
-
* 412 - PRECONDITION_FAILED - The server does not meet one of the preconditions that the requester put on the request.
|
|
92
|
-
*
|
|
93
|
-
* 413 - PAYLOAD_TOO_LARGE - The request is larger than the server is willing or able to process.
|
|
94
|
-
*
|
|
95
|
-
* 414 - URI_TOO_LONG - The URI requested by the client is longer than the server is willing to interpret.
|
|
96
|
-
*
|
|
97
|
-
* 415 - UNSUPPORTED_MEDIA_TYPE - The media format of the requested data is not supported by the server.
|
|
98
|
-
*
|
|
99
|
-
* 416 - RANGE_NOT_SATISFIABLE - The range specified by the Range header field in the request can't be fulfilled.
|
|
100
|
-
*
|
|
101
|
-
* 417 - EXPECTATION_FAILED - The expectation indicated by the Expect request header field can't be met by the server.
|
|
102
|
-
*
|
|
103
|
-
* 418 - IM_A_TEAPOT - The server refuses the attempt to brew coffee with a teapot.
|
|
104
|
-
*
|
|
105
|
-
* 421 - MISDIRECTED_REQUEST - The request was directed at a server that is not able to produce a response.
|
|
106
|
-
*
|
|
107
|
-
* 422 - UNPROCESSABLE_ENTITY - The request was well-formed but was unable to be followed due to semantic errors.
|
|
108
|
-
*
|
|
109
|
-
* 423 - LOCKED - The resource that is being accessed is locked.
|
|
110
|
-
*
|
|
111
|
-
* 424 - FAILED_DEPENDENCY - The request failed due to failure of a previous request.
|
|
112
|
-
*
|
|
113
|
-
* 425 - TOO_EARLY - Indicates that the server is unwilling to risk processing a request that might be replayed.
|
|
114
|
-
*
|
|
115
|
-
* 426 - UPGRADE_REQUIRED - The server refuses to perform the request using the current protocol but might be willing to do so after the client upgrades to a different protocol.
|
|
116
|
-
*
|
|
117
|
-
* 428 - PRECONDITION_REQUIRED - The origin server requires the request to be conditional.
|
|
118
|
-
*
|
|
119
|
-
* 429 - TOO_MANY_REQUESTS - The user has sent too many requests in a given amount of time.
|
|
120
|
-
*
|
|
121
|
-
* 431 - REQUEST_HEADER_FIELDS_TOO_LARGE - The server is unwilling to process the request because its header fields are too large.
|
|
122
|
-
*
|
|
123
|
-
* 451 - UNAVAILABLE_FOR_LEGAL_REASONS - The user-agent requested a resource that cannot legally be provided, such as a censored resource.
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
* 5xx: Server error responses
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
* 500 - INTERNAL_SERVER_ERROR - The server encountered an unexpected condition that prevented it from fulfilling the request.
|
|
130
|
-
*
|
|
131
|
-
* 501 - NOT_IMPLEMENTED - The server does not support the functionality required to fulfill the request.
|
|
132
|
-
*
|
|
133
|
-
* 502 - BAD_GATEWAY - The server, while acting as a gateway or proxy, received an invalid response from the upstream server.
|
|
134
|
-
*
|
|
135
|
-
* 503 - SERVICE_UNAVAILABLE - The server is currently unavailable (because it is overloaded or down for maintenance).
|
|
136
|
-
*
|
|
137
|
-
* 504 - GATEWAY_TIMEOUT - The server was acting as a gateway or proxy and did not receive a timely response from the upstream server.
|
|
138
|
-
*
|
|
139
|
-
* 505 - HTTP_VERSION_NOT_SUPPORTED - The server does not support the HTTP protocol version used in the request.
|
|
140
|
-
*
|
|
141
|
-
* 506 - VARIANT_ALSO_NEGOTIATES - The server has an internal configuration error, such as a misconfigured gateway.
|
|
142
|
-
*
|
|
143
|
-
* 507 - INSUFFICIENT_STORAGE - The server is unable to store the representation needed to complete the request.
|
|
144
|
-
*
|
|
145
|
-
* 508 - LOOP_DETECTED - The server detected an infinite loop while processing a request.
|
|
146
|
-
*/
|
|
147
|
-
let HttpStatusCodes = /* @__PURE__ */ function(HttpStatusCodes$1) {
|
|
148
|
-
/**
|
|
149
|
-
* The server has received the request headers and the client should proceed to send the request body.
|
|
150
|
-
*/
|
|
151
|
-
HttpStatusCodes$1[HttpStatusCodes$1["CONTINUE_100"] = 100] = "CONTINUE_100";
|
|
152
|
-
/**
|
|
153
|
-
* The requester has asked the server to switch protocols and the server has agreed to do so.
|
|
154
|
-
*/
|
|
155
|
-
HttpStatusCodes$1[HttpStatusCodes$1["SWITCHING_PROTOCOLS_101"] = 101] = "SWITCHING_PROTOCOLS_101";
|
|
156
|
-
/**
|
|
157
|
-
* Used to return some response headers before final HTTP message.
|
|
158
|
-
*/
|
|
159
|
-
HttpStatusCodes$1[HttpStatusCodes$1["PROCESSING_102"] = 102] = "PROCESSING_102";
|
|
160
|
-
/**
|
|
161
|
-
* Early hints - part of optimization to improve page load time.
|
|
162
|
-
*/
|
|
163
|
-
HttpStatusCodes$1[HttpStatusCodes$1["EARLY_HINTS_103"] = 103] = "EARLY_HINTS_103";
|
|
164
|
-
/**
|
|
165
|
-
* The request has succeeded.
|
|
166
|
-
*/
|
|
167
|
-
HttpStatusCodes$1[HttpStatusCodes$1["OK_200"] = 200] = "OK_200";
|
|
168
|
-
/**
|
|
169
|
-
* The request has been fulfilled and has resulted in one or more new resources being created.
|
|
170
|
-
*/
|
|
171
|
-
HttpStatusCodes$1[HttpStatusCodes$1["CREATED_201"] = 201] = "CREATED_201";
|
|
172
|
-
/**
|
|
173
|
-
* The request has been accepted for processing, but the processing has not been completed.
|
|
174
|
-
*/
|
|
175
|
-
HttpStatusCodes$1[HttpStatusCodes$1["ACCEPTED_202"] = 202] = "ACCEPTED_202";
|
|
176
|
-
/**
|
|
177
|
-
* The server successfully processed the request, but is returning information that may be from another source.
|
|
178
|
-
*/
|
|
179
|
-
HttpStatusCodes$1[HttpStatusCodes$1["NON_AUTHORITATIVE_INFORMATION_203"] = 203] = "NON_AUTHORITATIVE_INFORMATION_203";
|
|
180
|
-
/**
|
|
181
|
-
* The server successfully processed the request and is not returning any content.
|
|
182
|
-
*/
|
|
183
|
-
HttpStatusCodes$1[HttpStatusCodes$1["NO_CONTENT_204"] = 204] = "NO_CONTENT_204";
|
|
184
|
-
/**
|
|
185
|
-
* The server successfully processed the request, but is not returning any content and requires that the requester reset the document view.
|
|
186
|
-
*/
|
|
187
|
-
HttpStatusCodes$1[HttpStatusCodes$1["RESET_CONTENT_205"] = 205] = "RESET_CONTENT_205";
|
|
188
|
-
/**
|
|
189
|
-
* The server is delivering only part of the resource due to a range header sent by the client.
|
|
190
|
-
*/
|
|
191
|
-
HttpStatusCodes$1[HttpStatusCodes$1["PARTIAL_CONTENT_206"] = 206] = "PARTIAL_CONTENT_206";
|
|
192
|
-
/**
|
|
193
|
-
* Multi-status response providing status for multiple independent operations.
|
|
194
|
-
*/
|
|
195
|
-
HttpStatusCodes$1[HttpStatusCodes$1["MULTI_STATUS_207"] = 207] = "MULTI_STATUS_207";
|
|
196
|
-
/**
|
|
197
|
-
* The members of a DAV binding have already been enumerated in a preceding part of the request.
|
|
198
|
-
*/
|
|
199
|
-
HttpStatusCodes$1[HttpStatusCodes$1["ALREADY_REPORTED_208"] = 208] = "ALREADY_REPORTED_208";
|
|
200
|
-
/**
|
|
201
|
-
* The server has fulfilled a GET request for the resource, and the response is a representation of the result of one or more instance manipulations applied to the current instance.
|
|
202
|
-
*/
|
|
203
|
-
HttpStatusCodes$1[HttpStatusCodes$1["IM_USED_226"] = 226] = "IM_USED_226";
|
|
204
|
-
/**
|
|
205
|
-
* The request has more than one possible response. The user-agent or user should choose one of them.
|
|
206
|
-
*/
|
|
207
|
-
HttpStatusCodes$1[HttpStatusCodes$1["MULTIPLE_CHOICES_300"] = 300] = "MULTIPLE_CHOICES_300";
|
|
208
|
-
/**
|
|
209
|
-
* The URL of the requested resource has been changed permanently.
|
|
210
|
-
*/
|
|
211
|
-
HttpStatusCodes$1[HttpStatusCodes$1["MOVED_PERMANENTLY_301"] = 301] = "MOVED_PERMANENTLY_301";
|
|
212
|
-
/**
|
|
213
|
-
* The requested resource is available at a different URI.
|
|
214
|
-
*/
|
|
215
|
-
HttpStatusCodes$1[HttpStatusCodes$1["FOUND_302"] = 302] = "FOUND_302";
|
|
216
|
-
/**
|
|
217
|
-
* The response to the request can be found under another URI using a GET method.
|
|
218
|
-
*/
|
|
219
|
-
HttpStatusCodes$1[HttpStatusCodes$1["SEE_OTHER_303"] = 303] = "SEE_OTHER_303";
|
|
220
|
-
/**
|
|
221
|
-
* Indicates that the resource has not been modified since the version specified by the request headers.
|
|
222
|
-
*/
|
|
223
|
-
HttpStatusCodes$1[HttpStatusCodes$1["NOT_MODIFIED_304"] = 304] = "NOT_MODIFIED_304";
|
|
224
|
-
/**
|
|
225
|
-
* The requested resource must be accessed through the proxy given by the Location field.
|
|
226
|
-
*/
|
|
227
|
-
HttpStatusCodes$1[HttpStatusCodes$1["USE_PROXY_305"] = 305] = "USE_PROXY_305";
|
|
228
|
-
/**
|
|
229
|
-
* No longer used. Originally meant to direct the client to switch to a different proxy.
|
|
230
|
-
*/
|
|
231
|
-
HttpStatusCodes$1[HttpStatusCodes$1["SWITCH_PROXY_306"] = 306] = "SWITCH_PROXY_306";
|
|
232
|
-
/**
|
|
233
|
-
* The requested resource resides temporarily under a different URI.
|
|
234
|
-
*/
|
|
235
|
-
HttpStatusCodes$1[HttpStatusCodes$1["TEMPORARY_REDIRECT_307"] = 307] = "TEMPORARY_REDIRECT_307";
|
|
236
|
-
/**
|
|
237
|
-
* The request should be repeated with another URI, but future requests should still use the original URI.
|
|
238
|
-
*/
|
|
239
|
-
HttpStatusCodes$1[HttpStatusCodes$1["PERMANENT_REDIRECT_308"] = 308] = "PERMANENT_REDIRECT_308";
|
|
240
|
-
/**
|
|
241
|
-
* The server cannot or will not process the request due to something perceived to be a client error.
|
|
242
|
-
*/
|
|
243
|
-
HttpStatusCodes$1[HttpStatusCodes$1["BAD_REQUEST_400"] = 400] = "BAD_REQUEST_400";
|
|
244
|
-
/**
|
|
245
|
-
* The client must authenticate itself to get the requested response.
|
|
246
|
-
*/
|
|
247
|
-
HttpStatusCodes$1[HttpStatusCodes$1["UNAUTHORIZED_401"] = 401] = "UNAUTHORIZED_401";
|
|
248
|
-
/**
|
|
249
|
-
* The client does not have access rights to the content.
|
|
250
|
-
*/
|
|
251
|
-
HttpStatusCodes$1[HttpStatusCodes$1["FORBIDDEN_403"] = 403] = "FORBIDDEN_403";
|
|
252
|
-
/**
|
|
253
|
-
* The server can not find the requested resource.
|
|
254
|
-
*/
|
|
255
|
-
HttpStatusCodes$1[HttpStatusCodes$1["NOT_FOUND_404"] = 404] = "NOT_FOUND_404";
|
|
256
|
-
/**
|
|
257
|
-
* The request method is known by the server but is not supported by the target resource.
|
|
258
|
-
*/
|
|
259
|
-
HttpStatusCodes$1[HttpStatusCodes$1["METHOD_NOT_ALLOWED_405"] = 405] = "METHOD_NOT_ALLOWED_405";
|
|
260
|
-
/**
|
|
261
|
-
* This response is sent when the requested resource is capable of generating only content not acceptable according to the Accept headers sent in the request.
|
|
262
|
-
*/
|
|
263
|
-
HttpStatusCodes$1[HttpStatusCodes$1["NOT_ACCEPTABLE_406"] = 406] = "NOT_ACCEPTABLE_406";
|
|
264
|
-
/**
|
|
265
|
-
* This is similar to 401 but authentication is needed to be done by a proxy.
|
|
266
|
-
*/
|
|
267
|
-
HttpStatusCodes$1[HttpStatusCodes$1["PROXY_AUTHENTICATION_REQUIRED_407"] = 407] = "PROXY_AUTHENTICATION_REQUIRED_407";
|
|
268
|
-
/**
|
|
269
|
-
* This response is sent on an idle connection by some servers, even without any previous request by the client.
|
|
270
|
-
*/
|
|
271
|
-
HttpStatusCodes$1[HttpStatusCodes$1["REQUEST_TIMEOUT_408"] = 408] = "REQUEST_TIMEOUT_408";
|
|
272
|
-
/**
|
|
273
|
-
* This response is sent when a request conflicts with the current state of the server.
|
|
274
|
-
*/
|
|
275
|
-
HttpStatusCodes$1[HttpStatusCodes$1["CONFLICT_409"] = 409] = "CONFLICT_409";
|
|
276
|
-
/**
|
|
277
|
-
* This response is sent when the requested resource is no longer available and will not be available again.
|
|
278
|
-
*/
|
|
279
|
-
HttpStatusCodes$1[HttpStatusCodes$1["GONE_410"] = 410] = "GONE_410";
|
|
280
|
-
/**
|
|
281
|
-
* The request did not specify the length of its content, which is required by the requested resource.
|
|
282
|
-
*/
|
|
283
|
-
HttpStatusCodes$1[HttpStatusCodes$1["LENGTH_REQUIRED_411"] = 411] = "LENGTH_REQUIRED_411";
|
|
284
|
-
/**
|
|
285
|
-
* The server does not meet one of the preconditions that the requester put on the request.
|
|
286
|
-
*/
|
|
287
|
-
HttpStatusCodes$1[HttpStatusCodes$1["PRECONDITION_FAILED_412"] = 412] = "PRECONDITION_FAILED_412";
|
|
288
|
-
/**
|
|
289
|
-
* The request is larger than the server is willing or able to process.
|
|
290
|
-
*/
|
|
291
|
-
HttpStatusCodes$1[HttpStatusCodes$1["PAYLOAD_TOO_LARGE_413"] = 413] = "PAYLOAD_TOO_LARGE_413";
|
|
292
|
-
/**
|
|
293
|
-
* The URI requested by the client is longer than the server is willing to interpret.
|
|
294
|
-
*/
|
|
295
|
-
HttpStatusCodes$1[HttpStatusCodes$1["URI_TOO_LONG_414"] = 414] = "URI_TOO_LONG_414";
|
|
296
|
-
/**
|
|
297
|
-
* The media format of the requested data is not supported by the server.
|
|
298
|
-
*/
|
|
299
|
-
HttpStatusCodes$1[HttpStatusCodes$1["UNSUPPORTED_MEDIA_TYPE_415"] = 415] = "UNSUPPORTED_MEDIA_TYPE_415";
|
|
300
|
-
/**
|
|
301
|
-
* The range specified by the Range header field in the request can't be fulfilled.
|
|
302
|
-
*/
|
|
303
|
-
HttpStatusCodes$1[HttpStatusCodes$1["RANGE_NOT_SATISFIABLE_416"] = 416] = "RANGE_NOT_SATISFIABLE_416";
|
|
304
|
-
/**
|
|
305
|
-
* The expectation indicated by the Expect request header field can't be met by the server.
|
|
306
|
-
*/
|
|
307
|
-
HttpStatusCodes$1[HttpStatusCodes$1["EXPECTATION_FAILED_417"] = 417] = "EXPECTATION_FAILED_417";
|
|
308
|
-
/**
|
|
309
|
-
* The server refuses the attempt to brew coffee with a teapot.
|
|
310
|
-
*/
|
|
311
|
-
HttpStatusCodes$1[HttpStatusCodes$1["IM_A_TEAPOT_418"] = 418] = "IM_A_TEAPOT_418";
|
|
312
|
-
/**
|
|
313
|
-
* The request was directed at a server that is not able to produce a response.
|
|
314
|
-
*/
|
|
315
|
-
HttpStatusCodes$1[HttpStatusCodes$1["MISDIRECTED_REQUEST_421"] = 421] = "MISDIRECTED_REQUEST_421";
|
|
316
|
-
/**
|
|
317
|
-
* The request was well-formed but was unable to be followed due to semantic errors.
|
|
318
|
-
*/
|
|
319
|
-
HttpStatusCodes$1[HttpStatusCodes$1["UNPROCESSABLE_ENTITY_422"] = 422] = "UNPROCESSABLE_ENTITY_422";
|
|
320
|
-
/**
|
|
321
|
-
* The resource that is being accessed is locked.
|
|
322
|
-
*/
|
|
323
|
-
HttpStatusCodes$1[HttpStatusCodes$1["LOCKED_423"] = 423] = "LOCKED_423";
|
|
324
|
-
/**
|
|
325
|
-
* The request failed due to failure of a previous request.
|
|
326
|
-
*/
|
|
327
|
-
HttpStatusCodes$1[HttpStatusCodes$1["FAILED_DEPENDENCY_424"] = 424] = "FAILED_DEPENDENCY_424";
|
|
328
|
-
/**
|
|
329
|
-
* Indicates that the server is unwilling to risk processing a request that might be replayed.
|
|
330
|
-
*/
|
|
331
|
-
HttpStatusCodes$1[HttpStatusCodes$1["TOO_EARLY_425"] = 425] = "TOO_EARLY_425";
|
|
332
|
-
/**
|
|
333
|
-
* The server refuses to perform the request using the current protocol but might be willing to do so after the client upgrades to a different protocol.
|
|
334
|
-
*/
|
|
335
|
-
HttpStatusCodes$1[HttpStatusCodes$1["UPGRADE_REQUIRED_426"] = 426] = "UPGRADE_REQUIRED_426";
|
|
336
|
-
/**
|
|
337
|
-
* The origin server requires the request to be conditional.
|
|
338
|
-
*/
|
|
339
|
-
HttpStatusCodes$1[HttpStatusCodes$1["PRECONDITION_REQUIRED_428"] = 428] = "PRECONDITION_REQUIRED_428";
|
|
340
|
-
/**
|
|
341
|
-
* The user has sent too many requests in a given amount of time.
|
|
342
|
-
*/
|
|
343
|
-
HttpStatusCodes$1[HttpStatusCodes$1["TOO_MANY_REQUESTS_429"] = 429] = "TOO_MANY_REQUESTS_429";
|
|
344
|
-
/**
|
|
345
|
-
* The server is unwilling to process the request because its header fields are too large.
|
|
346
|
-
*/
|
|
347
|
-
HttpStatusCodes$1[HttpStatusCodes$1["REQUEST_HEADER_FIELDS_TOO_LARGE_431"] = 431] = "REQUEST_HEADER_FIELDS_TOO_LARGE_431";
|
|
348
|
-
/**
|
|
349
|
-
* The user-agent requested a resource that cannot legally be provided, such as a censored resource.
|
|
350
|
-
*/
|
|
351
|
-
HttpStatusCodes$1[HttpStatusCodes$1["UNAVAILABLE_FOR_LEGAL_REASONS_451"] = 451] = "UNAVAILABLE_FOR_LEGAL_REASONS_451";
|
|
352
|
-
/**
|
|
353
|
-
* The server encountered an unexpected condition that prevented it from fulfilling the request.
|
|
354
|
-
*/
|
|
355
|
-
HttpStatusCodes$1[HttpStatusCodes$1["INTERNAL_SERVER_ERROR_500"] = 500] = "INTERNAL_SERVER_ERROR_500";
|
|
356
|
-
/**
|
|
357
|
-
* The server does not support the functionality required to fulfill the request.
|
|
358
|
-
*/
|
|
359
|
-
HttpStatusCodes$1[HttpStatusCodes$1["NOT_IMPLEMENTED_501"] = 501] = "NOT_IMPLEMENTED_501";
|
|
360
|
-
/**
|
|
361
|
-
* The server, while acting as a gateway or proxy, received an invalid response from the upstream server.
|
|
362
|
-
*/
|
|
363
|
-
HttpStatusCodes$1[HttpStatusCodes$1["BAD_GATEWAY_502"] = 502] = "BAD_GATEWAY_502";
|
|
364
|
-
/**
|
|
365
|
-
* The server is currently unavailable (because it is overloaded or down for maintenance).
|
|
366
|
-
*/
|
|
367
|
-
HttpStatusCodes$1[HttpStatusCodes$1["SERVICE_UNAVAILABLE_503"] = 503] = "SERVICE_UNAVAILABLE_503";
|
|
368
|
-
/**
|
|
369
|
-
* The server was acting as a gateway or proxy and did not receive a timely response from the upstream server.
|
|
370
|
-
*/
|
|
371
|
-
HttpStatusCodes$1[HttpStatusCodes$1["GATEWAY_TIMEOUT_504"] = 504] = "GATEWAY_TIMEOUT_504";
|
|
372
|
-
/**
|
|
373
|
-
* The server does not support the HTTP protocol version used in the request.
|
|
374
|
-
*/
|
|
375
|
-
HttpStatusCodes$1[HttpStatusCodes$1["HTTP_VERSION_NOT_SUPPORTED_505"] = 505] = "HTTP_VERSION_NOT_SUPPORTED_505";
|
|
376
|
-
/**
|
|
377
|
-
* The server has an internal configuration error, such as a misconfigured gateway.
|
|
378
|
-
*/
|
|
379
|
-
HttpStatusCodes$1[HttpStatusCodes$1["VARIANT_ALSO_NEGOTIATES_506"] = 506] = "VARIANT_ALSO_NEGOTIATES_506";
|
|
380
|
-
/**
|
|
381
|
-
* The server is unable to store the representation needed to complete the request.
|
|
382
|
-
*/
|
|
383
|
-
HttpStatusCodes$1[HttpStatusCodes$1["INSUFFICIENT_STORAGE_507"] = 507] = "INSUFFICIENT_STORAGE_507";
|
|
384
|
-
/**
|
|
385
|
-
* The server detected an infinite loop while processing a request.
|
|
386
|
-
*/
|
|
387
|
-
HttpStatusCodes$1[HttpStatusCodes$1["LOOP_DETECTED_508"] = 508] = "LOOP_DETECTED_508";
|
|
388
|
-
/**
|
|
389
|
-
* Further extensions to the request are required for the server to fulfill it.
|
|
390
|
-
*/
|
|
391
|
-
HttpStatusCodes$1[HttpStatusCodes$1["NOT_EXTENDED_510"] = 510] = "NOT_EXTENDED_510";
|
|
392
|
-
/**
|
|
393
|
-
* The client needs to authenticate to gain network access.
|
|
394
|
-
*/
|
|
395
|
-
HttpStatusCodes$1[HttpStatusCodes$1["NETWORK_AUTHENTICATION_REQUIRED_511"] = 511] = "NETWORK_AUTHENTICATION_REQUIRED_511";
|
|
396
|
-
return HttpStatusCodes$1;
|
|
397
|
-
}({});
|
|
398
|
-
|
|
399
|
-
//#endregion
|
|
400
|
-
exports.HttpStatusCodes = HttpStatusCodes;
|
|
401
|
-
//# sourceMappingURL=httpStatusCodes.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"httpStatusCodes.cjs","names":[],"sources":["../../../src/utils/httpStatusCodes.ts"],"sourcesContent":["/**\n * Enum for HTTP response status codes.\n * Contains all the possible HTTP response codes according to the standard.\n *\n *\n * 1xx: Informational responses\n *\n *\n * 100 - CONTINUE - The server has received the request headers and the client should proceed to send the request body.\n *\n * 101 - SWITCHING_PROTOCOLS - The requester has asked the server to switch protocols and the server has agreed to do so.\n *\n * 102 - PROCESSING - Used to return some response headers before final HTTP message.\n *\n * 103 - EARLY_HINTS - Early hints - part of optimization to improve page load time.\n *\n *\n * 2xx: Successful responses\n *\n *\n * 200 - OK - The request has succeeded.\n *\n * 201 - CREATED - The request has been fulfilled and has resulted in one or more new resources being created.\n *\n * 202 - ACCEPTED - The request has been accepted for processing, but the processing has not been completed.\n *\n * 203 - NON_AUTHORITATIVE_INFORMATION - The server successfully processed the request, but is returning information that may be from another source.\n *\n * 204 - NO_CONTENT - The server successfully processed the request and is not returning any content.\n *\n * 205 - RESET_CONTENT - The server successfully processed the request, but is not returning any content and requires that the requester reset the document view.\n *\n * 206 - PARTIAL_CONTENT - The server is delivering only part of the resource due to a range header sent by the client.\n *\n * 207 - MULTI_STATUS - Multi-status response providing status for multiple independent operations.\n *\n * 208 - ALREADY_REPORTED - The members of a DAV binding have already been enumerated in a preceding part of the request.\n *\n * 226 - IM_USED - The server has fulfilled a GET request for the resource, and the response is a representation of the result of one or more instance manipulations applied to the current instance.\n *\n *\n * 3xx: Redirection messages\n *\n *\n * 300 - MULTIPLE_CHOICES - The request has more than one possible response. The user-agent or user should choose one of them.\n *\n * 301 - MOVED_PERMANENTLY - The URL of the requested resource has been changed permanently.\n *\n * 302 - FOUND - The requested resource is available at a different URI.\n *\n * 303 - SEE_OTHER - The response to the request can be found under another URI using a GET method.\n *\n * 304 - NOT_MODIFIED - Indicates that the resource has not been modified since the version specified by the request headers.\n *\n * 305 - USE_PROXY - The requested resource must be accessed through the proxy given by the Location field.\n *\n * 306 - SWITCH_PROXY - No longer used. Originally meant to direct the client to switch to a different proxy.\n *\n * 307 - TEMPORARY_REDIRECT - The requested resource resides temporarily under a different URI.\n *\n * 308 - PERMANENT_REDIRECT - The request should be repeated with another URI, but future requests should still use the original URI.\n *\n *\n * 4xx: Client error responses\n *\n *\n * 400 - BAD_REQUEST - The server cannot or will not process the request due to something perceived to be a client error.\n *\n * 401 - UNAUTHORIZED - The client must authenticate itself to get the requested response.\n *\n * 403 - FORBIDDEN - The client does not have access rights to the content.\n *\n * 404 - NOT_FOUND - The server can not find the requested resource.\n *\n * 405 - METHOD_NOT_ALLOWED - The request method is known by the server but is not supported by the target resource.\n *\n * 406 - NOT_ACCEPTABLE - This response is sent when the requested resource is capable of generating only content not acceptable according to the Accept headers sent in the request.\n *\n * 407 - PROXY_AUTHENTICATION_REQUIRED - This is similar to 401 but authentication is needed to be done by a proxy.\n *\n * 408 - REQUEST_TIMEOUT - This response is sent on an idle connection by some servers, even without any previous request by the client.\n *\n * 409 - CONFLICT - This response is sent when a request conflicts with the current state of the server.\n *\n * 410 - GONE - This response is sent when the requested resource is no longer available and will not be available again.\n *\n * 411 - LENGTH_REQUIRED - The request did not specify the length of its content, which is required by the requested resource.\n *\n * 412 - PRECONDITION_FAILED - The server does not meet one of the preconditions that the requester put on the request.\n *\n * 413 - PAYLOAD_TOO_LARGE - The request is larger than the server is willing or able to process.\n *\n * 414 - URI_TOO_LONG - The URI requested by the client is longer than the server is willing to interpret.\n *\n * 415 - UNSUPPORTED_MEDIA_TYPE - The media format of the requested data is not supported by the server.\n *\n * 416 - RANGE_NOT_SATISFIABLE - The range specified by the Range header field in the request can't be fulfilled.\n *\n * 417 - EXPECTATION_FAILED - The expectation indicated by the Expect request header field can't be met by the server.\n *\n * 418 - IM_A_TEAPOT - The server refuses the attempt to brew coffee with a teapot.\n *\n * 421 - MISDIRECTED_REQUEST - The request was directed at a server that is not able to produce a response.\n *\n * 422 - UNPROCESSABLE_ENTITY - The request was well-formed but was unable to be followed due to semantic errors.\n *\n * 423 - LOCKED - The resource that is being accessed is locked.\n *\n * 424 - FAILED_DEPENDENCY - The request failed due to failure of a previous request.\n *\n * 425 - TOO_EARLY - Indicates that the server is unwilling to risk processing a request that might be replayed.\n *\n * 426 - UPGRADE_REQUIRED - The server refuses to perform the request using the current protocol but might be willing to do so after the client upgrades to a different protocol.\n *\n * 428 - PRECONDITION_REQUIRED - The origin server requires the request to be conditional.\n *\n * 429 - TOO_MANY_REQUESTS - The user has sent too many requests in a given amount of time.\n *\n * 431 - REQUEST_HEADER_FIELDS_TOO_LARGE - The server is unwilling to process the request because its header fields are too large.\n *\n * 451 - UNAVAILABLE_FOR_LEGAL_REASONS - The user-agent requested a resource that cannot legally be provided, such as a censored resource.\n *\n *\n * 5xx: Server error responses\n *\n *\n * 500 - INTERNAL_SERVER_ERROR - The server encountered an unexpected condition that prevented it from fulfilling the request.\n *\n * 501 - NOT_IMPLEMENTED - The server does not support the functionality required to fulfill the request.\n *\n * 502 - BAD_GATEWAY - The server, while acting as a gateway or proxy, received an invalid response from the upstream server.\n *\n * 503 - SERVICE_UNAVAILABLE - The server is currently unavailable (because it is overloaded or down for maintenance).\n *\n * 504 - GATEWAY_TIMEOUT - The server was acting as a gateway or proxy and did not receive a timely response from the upstream server.\n *\n * 505 - HTTP_VERSION_NOT_SUPPORTED - The server does not support the HTTP protocol version used in the request.\n *\n * 506 - VARIANT_ALSO_NEGOTIATES - The server has an internal configuration error, such as a misconfigured gateway.\n *\n * 507 - INSUFFICIENT_STORAGE - The server is unable to store the representation needed to complete the request.\n *\n * 508 - LOOP_DETECTED - The server detected an infinite loop while processing a request.\n */\nexport enum HttpStatusCodes {\n //* ********************************\n // 1xx: Informational responses\n //* ********************************\n\n /**\n * The server has received the request headers and the client should proceed to send the request body.\n */\n CONTINUE_100 = 100,\n\n /**\n * The requester has asked the server to switch protocols and the server has agreed to do so.\n */\n SWITCHING_PROTOCOLS_101 = 101,\n\n /**\n * Used to return some response headers before final HTTP message.\n */\n PROCESSING_102 = 102, // WebDAV\n\n /**\n * Early hints - part of optimization to improve page load time.\n */\n EARLY_HINTS_103 = 103,\n\n //* ********************************\n // 2xx: Successful responses\n //* ********************************\n\n /**\n * The request has succeeded.\n */\n OK_200 = 200,\n\n /**\n * The request has been fulfilled and has resulted in one or more new resources being created.\n */\n CREATED_201 = 201,\n\n /**\n * The request has been accepted for processing, but the processing has not been completed.\n */\n ACCEPTED_202 = 202,\n\n /**\n * The server successfully processed the request, but is returning information that may be from another source.\n */\n NON_AUTHORITATIVE_INFORMATION_203 = 203,\n\n /**\n * The server successfully processed the request and is not returning any content.\n */\n NO_CONTENT_204 = 204,\n\n /**\n * The server successfully processed the request, but is not returning any content and requires that the requester reset the document view.\n */\n RESET_CONTENT_205 = 205,\n\n /**\n * The server is delivering only part of the resource due to a range header sent by the client.\n */\n PARTIAL_CONTENT_206 = 206,\n\n /**\n * Multi-status response providing status for multiple independent operations.\n */\n MULTI_STATUS_207 = 207, // WebDAV\n\n /**\n * The members of a DAV binding have already been enumerated in a preceding part of the request.\n */\n ALREADY_REPORTED_208 = 208, // WebDAV\n\n /**\n * The server has fulfilled a GET request for the resource, and the response is a representation of the result of one or more instance manipulations applied to the current instance.\n */\n IM_USED_226 = 226,\n\n //* ********************************\n // 3xx: Redirection messages\n //* ********************************\n\n /**\n * The request has more than one possible response. The user-agent or user should choose one of them.\n */\n MULTIPLE_CHOICES_300 = 300,\n\n /**\n * The URL of the requested resource has been changed permanently.\n */\n MOVED_PERMANENTLY_301 = 301,\n\n /**\n * The requested resource is available at a different URI.\n */\n FOUND_302 = 302,\n\n /**\n * The response to the request can be found under another URI using a GET method.\n */\n SEE_OTHER_303 = 303,\n\n /**\n * Indicates that the resource has not been modified since the version specified by the request headers.\n */\n NOT_MODIFIED_304 = 304,\n\n /**\n * The requested resource must be accessed through the proxy given by the Location field.\n */\n USE_PROXY_305 = 305,\n\n /**\n * No longer used. Originally meant to direct the client to switch to a different proxy.\n */\n SWITCH_PROXY_306 = 306,\n\n /**\n * The requested resource resides temporarily under a different URI.\n */\n TEMPORARY_REDIRECT_307 = 307,\n\n /**\n * The request should be repeated with another URI, but future requests should still use the original URI.\n */\n PERMANENT_REDIRECT_308 = 308,\n\n //* ********************************\n // 4xx: Client error responses\n //* ********************************\n\n /**\n * The server cannot or will not process the request due to something perceived to be a client error.\n */\n BAD_REQUEST_400 = 400,\n\n /**\n * The client must authenticate itself to get the requested response.\n */\n UNAUTHORIZED_401 = 401,\n\n /**\n * The client does not have access rights to the content.\n */\n FORBIDDEN_403 = 403,\n\n /**\n * The server can not find the requested resource.\n */\n NOT_FOUND_404 = 404,\n\n /**\n * The request method is known by the server but is not supported by the target resource.\n */\n METHOD_NOT_ALLOWED_405 = 405,\n\n /**\n * This response is sent when the requested resource is capable of generating only content not acceptable according to the Accept headers sent in the request.\n */\n NOT_ACCEPTABLE_406 = 406,\n\n /**\n * This is similar to 401 but authentication is needed to be done by a proxy.\n */\n PROXY_AUTHENTICATION_REQUIRED_407 = 407,\n\n /**\n * This response is sent on an idle connection by some servers, even without any previous request by the client.\n */\n REQUEST_TIMEOUT_408 = 408,\n\n /**\n * This response is sent when a request conflicts with the current state of the server.\n */\n CONFLICT_409 = 409,\n\n /**\n * This response is sent when the requested resource is no longer available and will not be available again.\n */\n GONE_410 = 410,\n\n /**\n * The request did not specify the length of its content, which is required by the requested resource.\n */\n LENGTH_REQUIRED_411 = 411,\n\n /**\n * The server does not meet one of the preconditions that the requester put on the request.\n */\n PRECONDITION_FAILED_412 = 412,\n\n /**\n * The request is larger than the server is willing or able to process.\n */\n PAYLOAD_TOO_LARGE_413 = 413,\n\n /**\n * The URI requested by the client is longer than the server is willing to interpret.\n */\n URI_TOO_LONG_414 = 414,\n\n /**\n * The media format of the requested data is not supported by the server.\n */\n UNSUPPORTED_MEDIA_TYPE_415 = 415,\n\n /**\n * The range specified by the Range header field in the request can't be fulfilled.\n */\n RANGE_NOT_SATISFIABLE_416 = 416,\n\n /**\n * The expectation indicated by the Expect request header field can't be met by the server.\n */\n EXPECTATION_FAILED_417 = 417,\n\n /**\n * The server refuses the attempt to brew coffee with a teapot.\n */\n IM_A_TEAPOT_418 = 418, // Easter egg from the HTCPCP/1.0 protocol.\n\n /**\n * The request was directed at a server that is not able to produce a response.\n */\n MISDIRECTED_REQUEST_421 = 421,\n\n /**\n * The request was well-formed but was unable to be followed due to semantic errors.\n */\n UNPROCESSABLE_ENTITY_422 = 422, // WebDAV\n\n /**\n * The resource that is being accessed is locked.\n */\n LOCKED_423 = 423, // WebDAV\n\n /**\n * The request failed due to failure of a previous request.\n */\n FAILED_DEPENDENCY_424 = 424, // WebDAV\n\n /**\n * Indicates that the server is unwilling to risk processing a request that might be replayed.\n */\n TOO_EARLY_425 = 425,\n\n /**\n * The server refuses to perform the request using the current protocol but might be willing to do so after the client upgrades to a different protocol.\n */\n UPGRADE_REQUIRED_426 = 426,\n\n /**\n * The origin server requires the request to be conditional.\n */\n PRECONDITION_REQUIRED_428 = 428,\n\n /**\n * The user has sent too many requests in a given amount of time.\n */\n TOO_MANY_REQUESTS_429 = 429,\n\n /**\n * The server is unwilling to process the request because its header fields are too large.\n */\n REQUEST_HEADER_FIELDS_TOO_LARGE_431 = 431,\n\n /**\n * The user-agent requested a resource that cannot legally be provided, such as a censored resource.\n */\n UNAVAILABLE_FOR_LEGAL_REASONS_451 = 451,\n\n //* ********************************\n // 5xx: Server error responses\n //* ********************************\n\n /**\n * The server encountered an unexpected condition that prevented it from fulfilling the request.\n */\n INTERNAL_SERVER_ERROR_500 = 500,\n\n /**\n * The server does not support the functionality required to fulfill the request.\n */\n NOT_IMPLEMENTED_501 = 501,\n\n /**\n * The server, while acting as a gateway or proxy, received an invalid response from the upstream server.\n */\n BAD_GATEWAY_502 = 502,\n\n /**\n * The server is currently unavailable (because it is overloaded or down for maintenance).\n */\n SERVICE_UNAVAILABLE_503 = 503,\n\n /**\n * The server was acting as a gateway or proxy and did not receive a timely response from the upstream server.\n */\n GATEWAY_TIMEOUT_504 = 504,\n\n /**\n * The server does not support the HTTP protocol version used in the request.\n */\n HTTP_VERSION_NOT_SUPPORTED_505 = 505,\n\n /**\n * The server has an internal configuration error, such as a misconfigured gateway.\n */\n VARIANT_ALSO_NEGOTIATES_506 = 506,\n\n /**\n * The server is unable to store the representation needed to complete the request.\n */\n INSUFFICIENT_STORAGE_507 = 507, // WebDAV\n\n /**\n * The server detected an infinite loop while processing a request.\n */\n LOOP_DETECTED_508 = 508, // WebDAV\n\n /**\n * Further extensions to the request are required for the server to fulfill it.\n */\n NOT_EXTENDED_510 = 510,\n\n /**\n * The client needs to authenticate to gain network access.\n */\n NETWORK_AUTHENTICATION_REQUIRED_511 = 511,\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgJA,IAAY,8DAAL;;;;AAQL;;;;AAKA;;;;AAKA;;;;AAKA;;;;AASA;;;;AAKA;;;;AAKA;;;;AAKA;;;;AAKA;;;;AAKA;;;;AAKA;;;;AAKA;;;;AAKA;;;;AAKA;;;;AASA;;;;AAKA;;;;AAKA;;;;AAKA;;;;AAKA;;;;AAKA;;;;AAKA;;;;AAKA;;;;AAKA;;;;AASA;;;;AAKA;;;;AAKA;;;;AAKA;;;;AAKA;;;;AAKA;;;;AAKA;;;;AAKA;;;;AAKA;;;;AAKA;;;;AAKA;;;;AAKA;;;;AAKA;;;;AAKA;;;;AAKA;;;;AAKA;;;;AAKA;;;;AAKA;;;;AAKA;;;;AAKA;;;;AAKA;;;;AAKA;;;;AAKA;;;;AAKA;;;;AAKA;;;;AAKA;;;;AAKA;;;;AAKA;;;;AASA;;;;AAKA;;;;AAKA;;;;AAKA;;;;AAKA;;;;AAKA;;;;AAKA;;;;AAKA;;;;AAKA;;;;AAKA;;;;AAKA"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
const require_utils_ensureMongoDocumentToObject = require('../ensureMongoDocumentToObject.cjs');
|
|
2
|
-
|
|
3
|
-
//#region src/utils/mapper/dictionary.ts
|
|
4
|
-
/**
|
|
5
|
-
* Maps a dictionary to an API response.
|
|
6
|
-
* If the version is not provided, the latest version is used.
|
|
7
|
-
*
|
|
8
|
-
* @param dictionary - The dictionary to map.
|
|
9
|
-
* @param projectId - The ID of the project the dictionary belongs to.
|
|
10
|
-
* @returns The dictionary mapped to an API response.
|
|
11
|
-
*/
|
|
12
|
-
const mapDictionaryToAPI = (dictionary, version) => {
|
|
13
|
-
const dictionaryObject = require_utils_ensureMongoDocumentToObject.ensureMongoDocumentToObject(dictionary);
|
|
14
|
-
const versionList = [...dictionaryObject.content.keys() ?? []];
|
|
15
|
-
let returnedVersion = version;
|
|
16
|
-
if (!returnedVersion) returnedVersion = versionList[versionList.length - 1];
|
|
17
|
-
const content = dictionaryObject.content.get(returnedVersion)?.content ?? null;
|
|
18
|
-
return {
|
|
19
|
-
...dictionaryObject,
|
|
20
|
-
content,
|
|
21
|
-
version: returnedVersion,
|
|
22
|
-
localId: `${dictionaryObject.key}::remote::${dictionaryObject.id}`,
|
|
23
|
-
versionList
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
//#endregion
|
|
28
|
-
exports.mapDictionaryToAPI = mapDictionaryToAPI;
|
|
29
|
-
//# sourceMappingURL=dictionary.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dictionary.cjs","names":["ensureMongoDocumentToObject"],"sources":["../../../../src/utils/mapper/dictionary.ts"],"sourcesContent":["import { ensureMongoDocumentToObject } from '@utils/ensureMongoDocumentToObject';\nimport type { Dictionary, DictionaryAPI } from '@/types/dictionary.types';\n\n/**\n * Maps a dictionary to an API response.\n * If the version is not provided, the latest version is used.\n *\n * @param dictionary - The dictionary to map.\n * @param projectId - The ID of the project the dictionary belongs to.\n * @returns The dictionary mapped to an API response.\n */\nexport const mapDictionaryToAPI = (\n dictionary: Dictionary,\n version?: string\n): DictionaryAPI => {\n const dictionaryObject = ensureMongoDocumentToObject<Dictionary>(dictionary);\n\n const versionList = [...(dictionaryObject.content.keys() ?? [])];\n let returnedVersion = version;\n\n if (!returnedVersion) {\n const lastVersion = versionList[versionList.length - 1];\n returnedVersion = lastVersion;\n }\n\n const content =\n (dictionaryObject.content.get(returnedVersion)\n ?.content as DictionaryAPI['content']) ?? null;\n\n return {\n ...dictionaryObject,\n content,\n version: returnedVersion,\n localId: `${dictionaryObject.key}::remote::${dictionaryObject.id}`,\n versionList,\n } as unknown as DictionaryAPI;\n};\n"],"mappings":";;;;;;;;;;;AAWA,MAAa,sBACX,YACA,YACkB;CAClB,MAAM,mBAAmBA,sEAAwC,WAAW;CAE5E,MAAM,cAAc,CAAC,GAAI,iBAAiB,QAAQ,MAAM,IAAI,EAAE,CAAE;CAChE,IAAI,kBAAkB;AAEtB,KAAI,CAAC,gBAEH,mBADoB,YAAY,YAAY,SAAS;CAIvD,MAAM,UACH,iBAAiB,QAAQ,IAAI,gBAAgB,EAC1C,WAAwC;AAE9C,QAAO;EACL,GAAG;EACH;EACA,SAAS;EACT,SAAS,GAAG,iBAAiB,IAAI,YAAY,iBAAiB;EAC9D;EACD"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
const require_utils_ensureMongoDocumentToObject = require('../ensureMongoDocumentToObject.cjs');
|
|
2
|
-
|
|
3
|
-
//#region src/utils/mapper/organization.ts
|
|
4
|
-
/**
|
|
5
|
-
* Maps an organization to an API response.
|
|
6
|
-
* @param organization - The organization to map.
|
|
7
|
-
* @param - Whether the user is an admin of the organization.
|
|
8
|
-
* @returns The organization mapped to an API response.
|
|
9
|
-
*/
|
|
10
|
-
const mapOrganizationToAPI = (organization) => {
|
|
11
|
-
if (!organization) return null;
|
|
12
|
-
return require_utils_ensureMongoDocumentToObject.ensureMongoDocumentToObject(organization);
|
|
13
|
-
};
|
|
14
|
-
const mapOrganizationsToAPI = (organizations) => organizations.map(mapOrganizationToAPI).filter(Boolean);
|
|
15
|
-
|
|
16
|
-
//#endregion
|
|
17
|
-
exports.mapOrganizationToAPI = mapOrganizationToAPI;
|
|
18
|
-
exports.mapOrganizationsToAPI = mapOrganizationsToAPI;
|
|
19
|
-
//# sourceMappingURL=organization.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"organization.cjs","names":["ensureMongoDocumentToObject"],"sources":["../../../../src/utils/mapper/organization.ts"],"sourcesContent":["import { ensureMongoDocumentToObject } from '@utils/ensureMongoDocumentToObject';\nimport type { Organization, OrganizationAPI } from '@/types/organization.types';\n\n/**\n * Maps an organization to an API response.\n * @param organization - The organization to map.\n * @param - Whether the user is an admin of the organization.\n * @returns The organization mapped to an API response.\n */\nexport const mapOrganizationToAPI = <\n T extends Organization | OrganizationAPI | null,\n>(\n organization?: T\n): T extends null ? null : OrganizationAPI => {\n if (!organization) {\n return null as any;\n }\n\n const organizationObject = ensureMongoDocumentToObject(organization);\n\n return organizationObject as any;\n};\n\nexport const mapOrganizationsToAPI = (\n organizations: (Organization | OrganizationAPI)[]\n): OrganizationAPI[] =>\n organizations.map(mapOrganizationToAPI).filter(Boolean) as OrganizationAPI[];\n"],"mappings":";;;;;;;;;AASA,MAAa,wBAGX,iBAC4C;AAC5C,KAAI,CAAC,aACH,QAAO;AAKT,QAF2BA,sEAA4B,aAAa;;AAKtE,MAAa,yBACX,kBAEA,cAAc,IAAI,qBAAqB,CAAC,OAAO,QAAQ"}
|