@design-edito/publisher-core 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/README.md +265 -0
  2. package/dist/index.d.ts +1 -0
  3. package/dist/index.js +5105 -0
  4. package/dist/index.js.map +7 -0
  5. package/dist/public/empty.txt +0 -0
  6. package/dist/types/api/admin/temp/flush/index.d.ts +6 -0
  7. package/dist/types/api/admin/users/create/index.d.ts +23 -0
  8. package/dist/types/api/admin/users/delete/index.d.ts +12 -0
  9. package/dist/types/api/admin/users/get/index.d.ts +18 -0
  10. package/dist/types/api/admin/users/get-upload-quota/index.d.ts +12 -0
  11. package/dist/types/api/admin/users/list/index.d.ts +24 -0
  12. package/dist/types/api/admin/users/reset-upload-quota/index.d.ts +15 -0
  13. package/dist/types/api/admin/users/revoke-auth-tokens/index.d.ts +10 -0
  14. package/dist/types/api/admin/users/revoke-email-validation-tokens/index.d.ts +10 -0
  15. package/dist/types/api/admin/users/revoke-pasword-renewal-tokens/index.d.ts +10 -0
  16. package/dist/types/api/admin/users/update/index.d.ts +23 -0
  17. package/dist/types/api/auth/login/index.d.ts +15 -0
  18. package/dist/types/api/auth/logout/index.d.ts +5 -0
  19. package/dist/types/api/auth/logout-everywhere/index.d.ts +5 -0
  20. package/dist/types/api/auth/refresh-token/index.d.ts +5 -0
  21. package/dist/types/api/auth/request-email-verification-token/index.d.ts +9 -0
  22. package/dist/types/api/auth/request-new-password/index.d.ts +9 -0
  23. package/dist/types/api/auth/signup/index.d.ts +13 -0
  24. package/dist/types/api/auth/submit-new-password/index.d.ts +11 -0
  25. package/dist/types/api/auth/verify-email/index.d.ts +12 -0
  26. package/dist/types/api/auth/whoami/index.d.ts +8 -0
  27. package/dist/types/api/csrf/get-token/index.d.ts +8 -0
  28. package/dist/types/api/image/format/index.d.ts +28 -0
  29. package/dist/types/api/image/transform/index.d.ts +11 -0
  30. package/dist/types/api/index.d.ts +102 -0
  31. package/dist/types/api/internals.d.ts +270 -0
  32. package/dist/types/api/system/kill/index.d.ts +3 -0
  33. package/dist/types/api/system/ping/index.d.ts +6 -0
  34. package/dist/types/api/system/send-mail/index.d.ts +11 -0
  35. package/dist/types/api/system/status-check/index.d.ts +22 -0
  36. package/dist/types/auth/index.d.ts +11 -0
  37. package/dist/types/csrf/index.d.ts +5 -0
  38. package/dist/types/database/index.d.ts +69 -0
  39. package/dist/types/dto/index.d.ts +25 -0
  40. package/dist/types/email/index.d.ts +6 -0
  41. package/dist/types/env/index.d.ts +83 -0
  42. package/dist/types/errors/index.d.ts +295 -0
  43. package/dist/types/fs/index.d.ts +110 -0
  44. package/dist/types/index.d.ts +21 -0
  45. package/dist/types/index.js +1 -0
  46. package/dist/types/index.js.map +7 -0
  47. package/dist/types/init/index.d.ts +1 -0
  48. package/dist/types/jwt/index.d.ts +7 -0
  49. package/dist/types/logs/index.d.ts +46 -0
  50. package/dist/types/plugins/index.d.ts +3 -0
  51. package/dist/types/plugins/internals.d.ts +177 -0
  52. package/dist/types/schema/index.d.ts +156 -0
  53. package/dist/types/temp/index.d.ts +7 -0
  54. package/dist/types/transformers/index.d.ts +3 -0
  55. package/dist/types/transformers/user/index.d.ts +5 -0
  56. package/dist/types/transformers/user-upload-quota/index.d.ts +3 -0
  57. package/dist/types/uploads/index.d.ts +73 -0
  58. package/dist/types/validation/index.d.ts +4 -0
  59. package/package.json +280 -0
File without changes
@@ -0,0 +1,6 @@
1
+ import type { AllowerErrCodes } from '../../../../auth/index.js';
2
+ import type { Codes } from '../../../../errors/index.js';
3
+ import type { StrongAuthVoidProcessContract } from '../../../internals.js';
4
+ type OperationErrCodes = Codes.DB_NO_DOCUMENT_MATCHES_FILTER | Codes.DB_ERROR;
5
+ export type AdminTempFlushProcessContract = StrongAuthVoidProcessContract<{}, {}, {}, null, AllowerErrCodes, never, OperationErrCodes>;
6
+ export {};
@@ -0,0 +1,23 @@
1
+ import type { UserRole, UserStatus, UserBadge } from '../../../../schema/index.js';
2
+ import type { Codes } from '../../../../errors/index.js';
3
+ import type { LocalUserDTO, GoogleUserDTO } from '../../../../dto/index.js';
4
+ import type { StrongAuthJsonProcessContract } from '../../../internals.js';
5
+ import type { AllowerErrCodes } from '../../../../auth/index.js';
6
+ type ExpectedBody = {
7
+ username: string;
8
+ role: UserRole;
9
+ status: UserStatus;
10
+ badges: UserBadge[];
11
+ } & ({
12
+ email: string;
13
+ verified: boolean;
14
+ password: string;
15
+ } | {
16
+ googleId: string;
17
+ verified: true;
18
+ });
19
+ type ValidationErrCodes = Codes.INVALID_REQUEST_BODY;
20
+ type OperationErrCodes = Codes.DB_ERROR;
21
+ type SuccessPayload = LocalUserDTO | GoogleUserDTO;
22
+ export type AdminUsersCreateProcessContract = StrongAuthJsonProcessContract<ExpectedBody, {}, {}, null, AllowerErrCodes, ValidationErrCodes, OperationErrCodes, SuccessPayload>;
23
+ export {};
@@ -0,0 +1,12 @@
1
+ import type { Codes } from '../../../../errors/index.js';
2
+ import type { LocalUserDTO, GoogleUserDTO } from '../../../../dto/index.js';
3
+ import type { StrongAuthJsonProcessContract } from '../../../internals.js';
4
+ import type { AllowerErrCodes } from '../../../../auth/index.js';
5
+ type ExpectedBody = {
6
+ _id: string;
7
+ };
8
+ type ValidationErrCodes = Codes.INVALID_REQUEST_BODY;
9
+ type OperationErrCodes = Codes.DB_NO_DOCUMENT_MATCHES_FILTER | Codes.DB_ERROR;
10
+ type SuccessPayload = LocalUserDTO | GoogleUserDTO;
11
+ export type AdminUsersDeleteProcessContract = StrongAuthJsonProcessContract<ExpectedBody, {}, {}, null, AllowerErrCodes, ValidationErrCodes, OperationErrCodes, SuccessPayload>;
12
+ export {};
@@ -0,0 +1,18 @@
1
+ import type { AllowerErrCodes } from '../../../../auth/index.js';
2
+ import type { GoogleUserDTO, LocalUserDTO } from '../../../../dto/index.js';
3
+ import type { Codes } from '../../../../errors/index.js';
4
+ import type { StrongAuthJsonProcessContract } from '../../../internals.js';
5
+ type ExpectedBody = {
6
+ _id: string;
7
+ } | {
8
+ username: string;
9
+ } | {
10
+ email: string;
11
+ } | {
12
+ googleId: string;
13
+ };
14
+ type ValidationErrCodes = Codes.INVALID_REQUEST_BODY;
15
+ type OperationErrCodes = Codes.DB_NO_DOCUMENT_MATCHES_FILTER | Codes.DB_ERROR;
16
+ type SuccessPayload = LocalUserDTO | GoogleUserDTO;
17
+ export type AdminUsersGetProcessContract = StrongAuthJsonProcessContract<ExpectedBody, {}, {}, null, AllowerErrCodes, ValidationErrCodes, OperationErrCodes, SuccessPayload>;
18
+ export {};
@@ -0,0 +1,12 @@
1
+ import type { AllowerErrCodes } from '../../../../auth/index.js';
2
+ import type { UserUploadQuotaDTO } from '../../../../dto/index.js';
3
+ import type { Codes } from '../../../../errors/index.js';
4
+ import type { StrongAuthJsonProcessContract } from '../../../internals.js';
5
+ type ExpectedBody = {
6
+ userId: string;
7
+ };
8
+ type ValidationErrCodes = Codes.INVALID_REQUEST_BODY;
9
+ type OperationErrCodes = Codes.DB_NO_DOCUMENT_MATCHES_FILTER | Codes.DB_ERROR;
10
+ type SuccessPayload = UserUploadQuotaDTO;
11
+ export type AdminUsersGetUplpadQuotaProcessContract = StrongAuthJsonProcessContract<ExpectedBody, {}, {}, null, AllowerErrCodes, ValidationErrCodes, OperationErrCodes, SuccessPayload>;
12
+ export {};
@@ -0,0 +1,24 @@
1
+ import type { AllowerErrCodes } from '../../../../auth/index.js';
2
+ import type { LocalUserDTO, GoogleUserDTO } from '../../../../dto/index.js';
3
+ import type { Codes } from '../../../../errors/index.js';
4
+ import type { UserRole, UserStatus, UserBadge } from '../../../../schema/index.js';
5
+ import type { StrongAuthListProcessContract } from '../../../internals.js';
6
+ type ExpectedBody = {
7
+ verified?: boolean;
8
+ usernameIncludes?: string;
9
+ hasAnyRole?: UserRole[];
10
+ hasAnyStatus?: UserStatus[];
11
+ hasAllBadges?: UserBadge[];
12
+ emailIncludes?: string;
13
+ googleIdIncludes?: string;
14
+ createdAfterTimestamp?: number;
15
+ createdBeforeTimestamp?: number;
16
+ };
17
+ type ExpectedQuery = {
18
+ page?: string;
19
+ };
20
+ type ValidationErrCodes = Codes.INVALID_REQUEST_BODY | Codes.INVALID_REQUEST_QUERY;
21
+ type OperationErrCodes = Codes.INVALID_REQUEST_BODY | Codes.DB_ERROR;
22
+ type SuccessPayload = LocalUserDTO | GoogleUserDTO;
23
+ export type AdminUsersListProcessContract = StrongAuthListProcessContract<ExpectedBody, ExpectedQuery, {}, null, AllowerErrCodes, ValidationErrCodes, OperationErrCodes, SuccessPayload>;
24
+ export {};
@@ -0,0 +1,15 @@
1
+ import type { Codes } from '../../../../errors/index.js';
2
+ import type { UserUploadQuotaDTO } from '../../../../dto/index.js';
3
+ import type { StrongAuthJsonProcessContract } from '../../../internals.js';
4
+ import type { AllowerErrCodes } from '../../../../auth/index.js';
5
+ type ExpectedBody = {
6
+ userId: string;
7
+ dailyUploadsByteSize?: number;
8
+ monthlyUploadsByteSize?: number;
9
+ totalUploadsByteSize?: number;
10
+ };
11
+ type ValidationErrCodes = Codes.INVALID_REQUEST_BODY;
12
+ type OperationErrCodes = Codes.DB_NO_DOCUMENT_MATCHES_FILTER | Codes.DB_ERROR;
13
+ type SuccessPayload = UserUploadQuotaDTO;
14
+ export type AdminUsersResetUploadQuotaProcessContract = StrongAuthJsonProcessContract<ExpectedBody, {}, {}, null, AllowerErrCodes, ValidationErrCodes, OperationErrCodes, SuccessPayload>;
15
+ export {};
@@ -0,0 +1,10 @@
1
+ import type { Codes } from '../../../../errors/index.js';
2
+ import type { AllowerErrCodes } from '../../../../auth/index.js';
3
+ import type { StrongAuthVoidProcessContract } from '../../../internals.js';
4
+ type ExpectedBody = {
5
+ userId: string;
6
+ };
7
+ type ValidationErrCodes = Codes.INVALID_REQUEST_BODY;
8
+ type OperationErrCodes = Codes.DB_ERROR | Codes.DB_NO_DOCUMENT_MATCHES_FILTER;
9
+ export type AdminUsersRevokeAuthTokensProcessContract = StrongAuthVoidProcessContract<ExpectedBody, {}, {}, null, AllowerErrCodes, ValidationErrCodes, OperationErrCodes>;
10
+ export {};
@@ -0,0 +1,10 @@
1
+ import type { Codes } from '../../../../errors/index.js';
2
+ import type { StrongAuthVoidProcessContract } from '../../../internals.js';
3
+ import type { AllowerErrCodes } from '../../../../auth/index.js';
4
+ type ExpectedBody = {
5
+ email: string;
6
+ };
7
+ type ValidationErrCodes = Codes.INVALID_REQUEST_BODY;
8
+ type OperationErrCodes = Codes.DB_ERROR | Codes.DB_NO_DOCUMENT_MATCHES_FILTER;
9
+ export type AdminUsersRevokeEmailValidationTokensProcessContract = StrongAuthVoidProcessContract<ExpectedBody, {}, {}, null, AllowerErrCodes, ValidationErrCodes, OperationErrCodes>;
10
+ export {};
@@ -0,0 +1,10 @@
1
+ import type { Codes } from '../../../../errors/index.js';
2
+ import type { AllowerErrCodes } from '../../../../auth/index.js';
3
+ import type { StrongAuthVoidProcessContract } from '../../../internals.js';
4
+ type ExpectedBody = {
5
+ email: string;
6
+ };
7
+ type ValidationErrCodes = Codes.INVALID_REQUEST_BODY;
8
+ type OperationErrCodes = Codes.DB_ERROR | Codes.DB_NO_DOCUMENT_MATCHES_FILTER;
9
+ export type AdminUsersRevokePasswordRenewalTokensProcessContract = StrongAuthVoidProcessContract<ExpectedBody, {}, {}, null, AllowerErrCodes, ValidationErrCodes, OperationErrCodes>;
10
+ export {};
@@ -0,0 +1,23 @@
1
+ import type { Codes } from '../../../../errors/index.js';
2
+ import type { UserRole, UserBadge, UserStatus } from '../../../../schema/index.js';
3
+ import type { LocalUserDTO, GoogleUserDTO } from '../../../../dto/index.js';
4
+ import type { AllowerErrCodes } from '../../../../auth/index.js';
5
+ import type { StrongAuthJsonProcessContract } from '../../../internals.js';
6
+ type ExpectedBody = {
7
+ _id: string;
8
+ username?: string;
9
+ role?: UserRole;
10
+ status?: UserStatus;
11
+ addBadges?: UserBadge[];
12
+ removeBadges?: UserBadge[];
13
+ setBadges?: UserBadge[];
14
+ verified?: boolean;
15
+ email?: string;
16
+ password?: string;
17
+ googleId?: string;
18
+ };
19
+ type ValidationErrCodes = Codes.INVALID_REQUEST_BODY;
20
+ type OperationErrCodes = Codes.DB_NO_DOCUMENT_MATCHES_FILTER | Codes.DB_ERROR | Codes.INVALID_REQUEST_BODY;
21
+ type SuccessPayload = LocalUserDTO | GoogleUserDTO;
22
+ export type AdminUsersUpdateProcessContract = StrongAuthJsonProcessContract<ExpectedBody, {}, {}, null, AllowerErrCodes, ValidationErrCodes, OperationErrCodes, SuccessPayload>;
23
+ export {};
@@ -0,0 +1,15 @@
1
+ import type { Codes } from '../../../errors/index.js';
2
+ import type { LocalUserDTO } from '../../../dto/index.js';
3
+ import type { NoAuthJsonProcessContract } from '../../internals.js';
4
+ type ExpectedBody = {
5
+ email: string;
6
+ password: string;
7
+ } | {
8
+ username: string;
9
+ password: string;
10
+ };
11
+ type ValidationErrCodes = Codes.INVALID_REQUEST_BODY;
12
+ type OperationErrCodes = Codes.INVALID_CREDENTIALS | Codes.DB_ERROR | Codes.USER_ACCESS_TOKEN_GENERATION_FAILED | Codes.USER_REFRESH_TOKEN_GENERATION_FAILED;
13
+ type SuccessPayload = LocalUserDTO;
14
+ export type AuthLoginProcessContract = NoAuthJsonProcessContract<ExpectedBody, {}, {}, null, ValidationErrCodes, OperationErrCodes, SuccessPayload>;
15
+ export {};
@@ -0,0 +1,5 @@
1
+ import type { Codes } from '../../../errors/index.js';
2
+ import type { WeakAuthVoidProcessContract } from '../../internals.js';
3
+ type OperationErrCodes = Codes.USER_NOT_AUTHENTICATED | Codes.USER_TOKENS_REVOCATION_FAILED;
4
+ export type AuthLogoutProcessContract = WeakAuthVoidProcessContract<{}, {}, {}, null, never, never, OperationErrCodes>;
5
+ export {};
@@ -0,0 +1,5 @@
1
+ import type { Codes } from '../../../errors/index.js';
2
+ import type { WeakAuthVoidProcessContract } from '../../internals.js';
3
+ type OperationErrCodes = Codes.USER_NOT_AUTHENTICATED | Codes.USER_TOKENS_REVOCATION_FAILED;
4
+ export type AuthLogoutEverywhereProcessContract = WeakAuthVoidProcessContract<{}, {}, {}, null, never, never, OperationErrCodes>;
5
+ export {};
@@ -0,0 +1,5 @@
1
+ import type { Codes } from '../../../errors/index.js';
2
+ import type { NoAuthVoidProcessContract } from '../../internals.js';
3
+ type OperationErrCodes = Codes.USER_REFRESH_TOKEN_MISSING | Codes.USER_REFRESH_TOKEN_REVOKED | Codes.USER_REFRESH_TOKEN_MALFORMED | Codes.USER_REFRESH_TOKEN_EXPIRED | Codes.USER_NOT_AUTHENTICATED | Codes.USER_DOES_NOT_EXIST | Codes.USER_ACCESS_TOKEN_GENERATION_FAILED | Codes.USER_REFRESH_TOKEN_GENERATION_FAILED;
4
+ export type AuthRefreshTokenProcessContract = NoAuthVoidProcessContract<{}, {}, {}, null, never, OperationErrCodes>;
5
+ export {};
@@ -0,0 +1,9 @@
1
+ import type { Codes } from '../../../errors/index.js';
2
+ import type { NoAuthVoidProcessContract } from '../../internals.js';
3
+ type ExpectedBody = {
4
+ email: string;
5
+ };
6
+ type ValidationErrCodes = Codes.INVALID_REQUEST_BODY;
7
+ type OperationErrCodes = Codes.USER_NOT_AUTHENTICATED | Codes.USER_EMAIL_DOES_NOT_EXIST | Codes.USER_EMAIL_ALREADY_VERIFIED;
8
+ export type AuthRequestEmailVerificationTokenProcessContract = NoAuthVoidProcessContract<ExpectedBody, {}, {}, null, ValidationErrCodes, OperationErrCodes>;
9
+ export {};
@@ -0,0 +1,9 @@
1
+ import type { Codes } from '../../../errors/index.js';
2
+ import type { NoAuthVoidProcessContract } from '../../internals.js';
3
+ type ExpectedBody = {
4
+ email: string;
5
+ };
6
+ type ValidationErrCodes = Codes.INVALID_REQUEST_BODY;
7
+ type OperationErrCodes = Codes.USER_EMAIL_DOES_NOT_EXIST;
8
+ export type AuthRequestNewPasswordProcessContract = NoAuthVoidProcessContract<ExpectedBody, {}, {}, null, ValidationErrCodes, OperationErrCodes>;
9
+ export {};
@@ -0,0 +1,13 @@
1
+ import type { Codes } from '../../../errors/index.js';
2
+ import type { LocalUserDTO } from '../../../dto/index.js';
3
+ import type { NoAuthJsonProcessContract } from '../../internals.js';
4
+ type ExpectedBody = {
5
+ username: string;
6
+ email: string;
7
+ password: string;
8
+ };
9
+ type ValidationErrCodes = Codes.INVALID_REQUEST_BODY;
10
+ type OperationErrCodes = Codes.USERNAME_ALREADY_TAKEN | Codes.EMAIL_ADDRESS_ALREADY_TAKEN | Codes.DB_ERROR;
11
+ type SuccessPayload = LocalUserDTO;
12
+ export type AuthSignupProcessContract = NoAuthJsonProcessContract<ExpectedBody, {}, {}, null, ValidationErrCodes, OperationErrCodes, SuccessPayload>;
13
+ export {};
@@ -0,0 +1,11 @@
1
+ import type { Codes } from '../../../errors/index.js';
2
+ import type { NoAuthVoidProcessContract } from '../../internals.js';
3
+ type ExpectedBody = {
4
+ token: string;
5
+ email: string;
6
+ password: string;
7
+ };
8
+ type ValidationErrCodes = Codes.INVALID_REQUEST_BODY;
9
+ type OperationErrCodes = Codes.USER_PASSWORD_RENEWAL_TOKEN_DOES_NOT_EXIST | Codes.USER_EMAIL_DOES_NOT_EXIST | Codes.USER_TOKENS_REVOCATION_FAILED | Codes.DB_ERROR | Codes.USER_DOES_NOT_EXIST;
10
+ export type AuthSubmitNewPasswordProcessContract = NoAuthVoidProcessContract<ExpectedBody, {}, {}, null, ValidationErrCodes, OperationErrCodes>;
11
+ export {};
@@ -0,0 +1,12 @@
1
+ import type { Codes } from '../../../errors/index.js';
2
+ import type { LocalUserDTO } from '../../../dto/index.js';
3
+ import type { NoAuthJsonProcessContract } from '../../internals.js';
4
+ type ExpectedBody = {
5
+ email: string;
6
+ token: string;
7
+ };
8
+ type ValidationErrCodes = Codes.INVALID_REQUEST_BODY;
9
+ type OperationErrCodes = Codes.USER_EMAIL_VERIFICATION_TOKEN_NOT_PROVIDED | Codes.USER_EMAIL_VERIFICATION_TOKEN_DOES_NOT_EXIST | Codes.DB_ERROR | Codes.USER_EMAIL_DOES_NOT_EXIST;
10
+ type SuccessPayload = LocalUserDTO;
11
+ export type AuthVerifyEmailProcessContract = NoAuthJsonProcessContract<ExpectedBody, {}, {}, null, ValidationErrCodes, OperationErrCodes, SuccessPayload>;
12
+ export {};
@@ -0,0 +1,8 @@
1
+ import type { Codes } from '../../../errors/index.js';
2
+ import type { LocalUserDTO } from '../../../dto/index.js';
3
+ import type { GoogleUserDTO } from '../../../dto/index.js';
4
+ import type { StrongAuthJsonProcessContract } from '../../internals.js';
5
+ type OperationErrCodes = Codes.USER_DOES_NOT_EXIST | Codes.DB_ERROR | Codes.USER_DOES_NOT_EXIST;
6
+ type SuccessPayload = LocalUserDTO | GoogleUserDTO;
7
+ export type AuthWhoamiProcessContract = StrongAuthJsonProcessContract<{}, {}, {}, null, never, never, OperationErrCodes, SuccessPayload>;
8
+ export {};
@@ -0,0 +1,8 @@
1
+ import type { NoAuthJsonProcessContract } from '../../internals.js';
2
+ type ValidationErrCodes = never;
3
+ type OperationErrCodes = never;
4
+ type SuccessPayload = {
5
+ token: string;
6
+ };
7
+ export type CsrfGetTokenProcessContract = NoAuthJsonProcessContract<{}, {}, {}, null, ValidationErrCodes, OperationErrCodes, SuccessPayload>;
8
+ export {};
@@ -0,0 +1,28 @@
1
+ import type { AllowerErrCodes } from '../../../auth/index.js';
2
+ import type { Codes } from '../../../errors/index.js';
3
+ import type { StrongAuthFileProcessContract } from '../../internals.js';
4
+ import type { FormatJpgOptions, FormatPngOptions, FormatWebpOptions, FormatAvifOptions, FormatTiffOptions, FormatHeifOptions, FormatKeepOptions } from '@design-edito/tools/node/images/format/index.js';
5
+ type JpgExpectedBody = FormatJpgOptions & {
6
+ format: 'jpg' | 'jpeg';
7
+ };
8
+ type PngExpectedBody = FormatPngOptions & {
9
+ format: 'png';
10
+ };
11
+ type WebpExpectedBody = FormatWebpOptions & {
12
+ format: 'webp';
13
+ };
14
+ type AvifExpectedBody = FormatAvifOptions & {
15
+ format: 'avif';
16
+ };
17
+ type TiffExpectedBody = FormatTiffOptions & {
18
+ format: 'tiff';
19
+ };
20
+ type HeifExpectedBody = FormatHeifOptions & {
21
+ format: 'heif';
22
+ };
23
+ type KeepExpectedBody = FormatKeepOptions;
24
+ type ExpectedBody = JpgExpectedBody | PngExpectedBody | WebpExpectedBody | AvifExpectedBody | TiffExpectedBody | HeifExpectedBody | KeepExpectedBody;
25
+ type ValidationErrCodes = Codes.INVALID_REQUEST_BODY | Codes.INVALID_REQUEST_FILES;
26
+ type OperationErrCodes = Codes.INVALID_REQUEST_FILES | Codes.IMAGE_FORMAT_FAILED;
27
+ export type ImageFormatProcessContract = StrongAuthFileProcessContract<ExpectedBody, {}, {}, 'image', AllowerErrCodes, ValidationErrCodes, OperationErrCodes>;
28
+ export {};
@@ -0,0 +1,11 @@
1
+ import type { AllowerErrCodes } from '../../../auth/index.js';
2
+ import type { Codes } from '../../../errors/index.js';
3
+ import type { StrongAuthFileProcessContract } from '../../internals.js';
4
+ import type { OperationDescriptor } from '@design-edito/tools/node/images/transform/index.js';
5
+ type ExpectedBody = {
6
+ operations: OperationDescriptor[];
7
+ };
8
+ type ValidationErrCodes = Codes.INVALID_REQUEST_FILES | Codes.INVALID_REQUEST_BODY;
9
+ type OperationErrCodes = Codes.UNKNOWN_ERROR | Codes.INVALID_REQUEST_FILES | Codes.TOO_MANY_REQUESTS | Codes.IMAGE_TRANSFORM_FAILED;
10
+ export type ImageTransformProcessContract = StrongAuthFileProcessContract<ExpectedBody, {}, {}, 'image', AllowerErrCodes, ValidationErrCodes, OperationErrCodes>;
11
+ export {};
@@ -0,0 +1,102 @@
1
+ import type { ExtractExpectedBody, ExtractExpectedFileFields, ExtractExpectedParams, ExtractExpectedQuery, InferServerErrorResponse, InferServerResponse, InferServerSuccessResponse } from './internals.js';
2
+ import type { Contracts as PluginsContracts } from '../plugins/index.js';
3
+ import type { AdminTempFlushProcessContract } from './admin/temp/flush/index.js';
4
+ import type { AdminUsersCreateProcessContract } from './admin/users/create/index.js';
5
+ import type { AdminUsersDeleteProcessContract } from './admin/users/delete/index.js';
6
+ import type { AdminUsersGetProcessContract } from './admin/users/get/index.js';
7
+ import type { AdminUsersGetUplpadQuotaProcessContract } from './admin/users/get-upload-quota/index.js';
8
+ import type { AdminUsersListProcessContract } from './admin/users/list/index.js';
9
+ import type { AdminUsersUpdateProcessContract } from './admin/users/update/index.js';
10
+ import type { AdminUsersRevokeAuthTokensProcessContract } from './admin/users/revoke-auth-tokens/index.js';
11
+ import type { AdminUsersRevokeEmailValidationTokensProcessContract } from './admin/users/revoke-email-validation-tokens/index.js';
12
+ import type { AdminUsersRevokePasswordRenewalTokensProcessContract } from './admin/users/revoke-pasword-renewal-tokens/index.js';
13
+ import type { AdminUsersResetUploadQuotaProcessContract } from './admin/users/reset-upload-quota/index.js';
14
+ import type { AuthLoginProcessContract } from './auth/login/index.js';
15
+ import type { AuthLogoutProcessContract } from './auth/logout/index.js';
16
+ import type { AuthLogoutEverywhereProcessContract } from './auth/logout-everywhere/index.js';
17
+ import type { AuthRefreshTokenProcessContract } from './auth/refresh-token/index.js';
18
+ import type { AuthRequestEmailVerificationTokenProcessContract } from './auth/request-email-verification-token/index.js';
19
+ import type { AuthRequestNewPasswordProcessContract } from './auth/request-new-password/index.js';
20
+ import type { AuthSignupProcessContract } from './auth/signup/index.js';
21
+ import type { AuthSubmitNewPasswordProcessContract } from './auth/submit-new-password/index.js';
22
+ import type { AuthVerifyEmailProcessContract } from './auth/verify-email/index.js';
23
+ import type { AuthWhoamiProcessContract } from './auth/whoami/index.js';
24
+ import type { CsrfGetTokenProcessContract } from './csrf/get-token/index.js';
25
+ import type { SystemKillProcessContract } from './system/kill/index.js';
26
+ import type { SystemSendMailProcessContract } from './system/send-mail/index.js';
27
+ import type { SystemStatusCheckProcessContract } from './system/status-check/index.js';
28
+ import type { SystemPingProcessContract } from './system/ping/index.js';
29
+ import type { ImageFormatProcessContract } from './image/format/index.js';
30
+ import type { ImageTransformProcessContract } from './image/transform/index.js';
31
+ export declare enum ENDPOINT {
32
+ CSRF_GET_TOKEN = "GET:/csrf/get-token",
33
+ SYSTEM_KILL = "GET:/system/kill",
34
+ SYSTEM_PING = "GET:/system/ping",
35
+ SYSTEM_SEND_MAIL = "GET:/system/send-mail",
36
+ SYSTEM_STATUS_CHECK_GET = "GET:/system/status-check",
37
+ SYSTEM_STATUS_CHECK_POST = "POST:/system/status-check",
38
+ AUTH_LOGIN = "POST:/auth/login",
39
+ AUTH_LOGOUT = "POST:/auth/logout",
40
+ AUTH_LOGOUT_EVERYWHERE = "POST:/auth/logout-everywhere",
41
+ AUTH_REFRESH_TOKEN = "POST:/auth/refresh-token",
42
+ AUTH_REQUEST_EMAIL_VERIFICATION_TOKEN = "POST:/auth/request-email-verification-token",
43
+ AUTH_REQUEST_NEW_PASSWORD = "POST:/auth/request-new-password",
44
+ AUTH_SIGNUP = "POST:/auth/signup",
45
+ AUTH_SUBMIT_NEW_PASSWORD = "POST:/auth/submit-new-password",
46
+ AUTH_VERIFY_EMAIL = "POST:/auth/verify-email",
47
+ AUTH_WHOAMI = "POST:/auth/whoami",
48
+ AUTH_WHOAMI_GET = "GET:/auth/whoami",
49
+ ADMIN_TEMP_FLUSH = "POST:/admin/temp/flush",
50
+ ADMIN_USERS_CREATE = "POST:/admin/users/create",
51
+ ADMIN_USERS_GET = "POST:/admin/users/get",
52
+ ADMIN_USERS_LIST = "POST:/admin/users/list",
53
+ ADMIN_USERS_UPDATE = "POST:/admin/users/update",
54
+ ADMIN_USERS_DELETE = "POST:/admin/users/delete",
55
+ ADMIN_USERS_REVOKE_AUTH_TOKENS = "POST:/admin/users/revoke-auth-tokens",
56
+ ADMIN_USERS_REVOKE_EMAIL_VALIDATION_TOKENS = "POST:/admin/users/revoke-email-validation-tokens",
57
+ ADMIN_USERS_REVOKE_PASSWORD_RENEWAL_TOKENS = "POST:/admin/users/revoke-password-renewal-tokens",
58
+ ADMIN_USERS_GET_UPLOAD_QUOTA = "POST:/admin/users/get-upload-quota",
59
+ ADMIN_USERS_RESET_UPLOAD_QUOTA = "POST:/admin/users/reset-upload-quota",
60
+ IMAGE_FORMAT = "POST:/image/format",
61
+ IMAGE_TRANSFORM = "POST:/image/transform"
62
+ }
63
+ export type Contracts = {
64
+ [ENDPOINT.CSRF_GET_TOKEN]: CsrfGetTokenProcessContract;
65
+ [ENDPOINT.SYSTEM_KILL]: SystemKillProcessContract;
66
+ [ENDPOINT.SYSTEM_PING]: SystemPingProcessContract;
67
+ [ENDPOINT.SYSTEM_SEND_MAIL]: SystemSendMailProcessContract;
68
+ [ENDPOINT.SYSTEM_STATUS_CHECK_GET]: SystemStatusCheckProcessContract;
69
+ [ENDPOINT.SYSTEM_STATUS_CHECK_POST]: SystemStatusCheckProcessContract;
70
+ [ENDPOINT.AUTH_LOGIN]: AuthLoginProcessContract;
71
+ [ENDPOINT.AUTH_LOGOUT]: AuthLogoutProcessContract;
72
+ [ENDPOINT.AUTH_LOGOUT_EVERYWHERE]: AuthLogoutEverywhereProcessContract;
73
+ [ENDPOINT.AUTH_REFRESH_TOKEN]: AuthRefreshTokenProcessContract;
74
+ [ENDPOINT.AUTH_REQUEST_EMAIL_VERIFICATION_TOKEN]: AuthRequestEmailVerificationTokenProcessContract;
75
+ [ENDPOINT.AUTH_REQUEST_NEW_PASSWORD]: AuthRequestNewPasswordProcessContract;
76
+ [ENDPOINT.AUTH_SIGNUP]: AuthSignupProcessContract;
77
+ [ENDPOINT.AUTH_SUBMIT_NEW_PASSWORD]: AuthSubmitNewPasswordProcessContract;
78
+ [ENDPOINT.AUTH_VERIFY_EMAIL]: AuthVerifyEmailProcessContract;
79
+ [ENDPOINT.AUTH_WHOAMI]: AuthWhoamiProcessContract;
80
+ [ENDPOINT.AUTH_WHOAMI_GET]: AuthWhoamiProcessContract;
81
+ [ENDPOINT.ADMIN_TEMP_FLUSH]: AdminTempFlushProcessContract;
82
+ [ENDPOINT.ADMIN_USERS_CREATE]: AdminUsersCreateProcessContract;
83
+ [ENDPOINT.ADMIN_USERS_GET]: AdminUsersGetProcessContract;
84
+ [ENDPOINT.ADMIN_USERS_LIST]: AdminUsersListProcessContract;
85
+ [ENDPOINT.ADMIN_USERS_UPDATE]: AdminUsersUpdateProcessContract;
86
+ [ENDPOINT.ADMIN_USERS_DELETE]: AdminUsersDeleteProcessContract;
87
+ [ENDPOINT.ADMIN_USERS_REVOKE_AUTH_TOKENS]: AdminUsersRevokeAuthTokensProcessContract;
88
+ [ENDPOINT.ADMIN_USERS_REVOKE_EMAIL_VALIDATION_TOKENS]: AdminUsersRevokeEmailValidationTokensProcessContract;
89
+ [ENDPOINT.ADMIN_USERS_REVOKE_PASSWORD_RENEWAL_TOKENS]: AdminUsersRevokePasswordRenewalTokensProcessContract;
90
+ [ENDPOINT.ADMIN_USERS_GET_UPLOAD_QUOTA]: AdminUsersGetUplpadQuotaProcessContract;
91
+ [ENDPOINT.ADMIN_USERS_RESET_UPLOAD_QUOTA]: AdminUsersResetUploadQuotaProcessContract;
92
+ [ENDPOINT.IMAGE_FORMAT]: ImageFormatProcessContract;
93
+ [ENDPOINT.IMAGE_TRANSFORM]: ImageTransformProcessContract;
94
+ };
95
+ export type AllContracts = Contracts & PluginsContracts;
96
+ export type BodyOf<C extends keyof AllContracts> = ExtractExpectedBody<AllContracts[C]>;
97
+ export type ParamsOf<C extends keyof AllContracts> = ExtractExpectedParams<AllContracts[C]>;
98
+ export type QueryOf<C extends keyof AllContracts> = ExtractExpectedQuery<AllContracts[C]>;
99
+ export type FileFieldsOf<C extends keyof AllContracts> = ExtractExpectedFileFields<AllContracts[C]>;
100
+ export type SuccessResponseOf<C extends keyof AllContracts> = InferServerSuccessResponse<AllContracts[C]>;
101
+ export type ErrorResponseOf<C extends keyof AllContracts> = InferServerErrorResponse<AllContracts[C]>;
102
+ export type ResponseOf<C extends keyof AllContracts> = InferServerResponse<AllContracts[C]>;