@darco2903/auth-api 2.1.3 → 2.1.6
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/client.d.ts +371 -363
- package/dist/client.js +2 -1
- package/dist/consts.d.ts +2 -3
- package/dist/contract/assets.d.ts +2 -2
- package/dist/contract/assets.js +2 -2
- package/dist/contract/auth.d.ts +12 -756
- package/dist/contract/auth.js +4 -77
- package/dist/contract/index.d.ts +906 -889
- package/dist/contract/index.js +2 -0
- package/dist/contract/requests.d.ts +2 -2
- package/dist/contract/requests.js +2 -2
- package/dist/contract/totp.d.ts +763 -0
- package/dist/contract/totp.js +81 -0
- package/dist/contract/user.d.ts +4 -4
- package/dist/contract/user.js +4 -4
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/otp.d.ts +2 -0
- package/dist/otp.js +7 -0
- package/dist/server.d.ts +2 -1
- package/dist/server.js +2 -1
- package/dist/types/auth.d.ts +17 -0
- package/dist/types/auth.js +4 -0
- package/dist/types/jwt.d.ts +2 -2
- package/package.json +5 -4
- package/LICENSE +0 -674
package/dist/client.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Second } from "@darco2903/secondthought";
|
|
2
|
-
export * from "./common.js";
|
|
3
2
|
import { initClient } from "@ts-rest/core";
|
|
4
3
|
import contract from "./contract/index.js";
|
|
5
4
|
import { UserRole } from "./roles.js";
|
|
5
|
+
export * from "./common.js";
|
|
6
|
+
export { generateOTP } from "./otp.js";
|
|
6
7
|
export function createClient(origin) {
|
|
7
8
|
return initClient(contract, {
|
|
8
9
|
baseUrl: origin,
|
package/dist/consts.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import type { Algorithm } from "jsonwebtoken";
|
|
2
1
|
export declare const API_VERSION = "v2";
|
|
3
2
|
export declare const API_PATH_PREFIX = "/api/v2";
|
|
4
|
-
export declare const JWT_ALGORITHM
|
|
5
|
-
export declare const JWT_ALGORITHMS:
|
|
3
|
+
export declare const JWT_ALGORITHM = "ES256";
|
|
4
|
+
export declare const JWT_ALGORITHMS: string[];
|
|
6
5
|
export declare const NAME_MIN_LENGTH = 3;
|
|
7
6
|
export declare const NAME_MAX_LENGTH = 32;
|
|
8
7
|
export declare const EMAIL_MAX_LENGTH = 255;
|
|
@@ -167,7 +167,7 @@ declare const _default: {
|
|
|
167
167
|
authorization: string;
|
|
168
168
|
}>;
|
|
169
169
|
responses: {
|
|
170
|
-
|
|
170
|
+
204: typeof import("@ts-rest/core").ContractNoBody;
|
|
171
171
|
400: z.ZodObject<{
|
|
172
172
|
name: z.ZodLiteral<"ZodError">;
|
|
173
173
|
issues: z.ZodArray<z.ZodObject<{
|
|
@@ -323,7 +323,7 @@ declare const _default: {
|
|
|
323
323
|
authorization: string;
|
|
324
324
|
}>;
|
|
325
325
|
responses: {
|
|
326
|
-
|
|
326
|
+
204: typeof import("@ts-rest/core").ContractNoBody;
|
|
327
327
|
401: z.ZodObject<{
|
|
328
328
|
code: z.ZodType<"UNAUTHORIZED", z.ZodTypeDef, "UNAUTHORIZED">;
|
|
329
329
|
error: z.ZodType<"Unauthorized", z.ZodTypeDef, "Unauthorized">;
|
package/dist/contract/assets.js
CHANGED
|
@@ -25,7 +25,7 @@ export default c.router({
|
|
|
25
25
|
headers: cdnFeedbackHeaderSchema,
|
|
26
26
|
body: c.noBody(),
|
|
27
27
|
responses: {
|
|
28
|
-
|
|
28
|
+
204: apiSuccess(c.noBody()),
|
|
29
29
|
400: ZodErrorSchema,
|
|
30
30
|
401: apiError(z.literal("UNAUTHORIZED"), z.literal("Unauthorized")),
|
|
31
31
|
500: apiError(z.literal("INTERNAL_SERVER_ERROR"), z.string()),
|
|
@@ -37,7 +37,7 @@ export default c.router({
|
|
|
37
37
|
description: "Delete user avatar picture",
|
|
38
38
|
headers: cdnFeedbackHeaderSchema,
|
|
39
39
|
responses: {
|
|
40
|
-
|
|
40
|
+
204: apiSuccess(c.noBody()),
|
|
41
41
|
401: apiError(z.literal("UNAUTHORIZED"), z.literal("Unauthorized")),
|
|
42
42
|
500: apiError(z.literal("INTERNAL_SERVER_ERROR"), z.string()),
|
|
43
43
|
},
|