expo-backend-types 0.4.0-EXPO-248-EB-GrupoEtiqueta.10 → 0.4.0-EXPO-248-EB-GrupoEtiqueta.12
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/src/auth/dto/login.dto.d.ts +10 -0
- package/dist/src/auth/dto/login.dto.js +1 -0
- package/dist/src/auth/dto/refresh.dto.d.ts +30 -0
- package/dist/src/auth/dto/refresh.dto.js +17 -0
- package/dist/src/shared/dto-modification/create-zod-dto-without-date.d.ts +4 -0
- package/dist/src/shared/dto-modification/create-zod-dto-without-date.js +10 -0
- package/dist/src/shared/dto-modification/create-zod-dto-without-date.js.map +1 -0
- package/dist/src/shared/dto-modification/without-dates.d.ts +4 -0
- package/dist/src/shared/dto-modification/without-dates.js +6 -0
- package/dist/src/shared/dto-modification/without-dates.js.map +1 -0
- package/dist/src/shared/dto-modification/zod-without-dates.d.ts +8 -0
- package/dist/src/shared/dto-modification/zod-without-dates.js +28 -0
- package/dist/src/shared/dto-modification/zod-without-dates.js.map +1 -0
- package/dist/types/schema.d.ts +10 -2
- package/package.json +2 -2
@@ -63,12 +63,15 @@ export declare const loginResponseSchema: z.ZodObject<{
|
|
63
63
|
backendTokens: z.ZodObject<{
|
64
64
|
accessToken: z.ZodString;
|
65
65
|
refreshToken: z.ZodString;
|
66
|
+
expiresIn: z.ZodNumber;
|
66
67
|
}, "strip", z.ZodTypeAny, {
|
67
68
|
accessToken: string;
|
68
69
|
refreshToken: string;
|
70
|
+
expiresIn: number;
|
69
71
|
}, {
|
70
72
|
accessToken: string;
|
71
73
|
refreshToken: string;
|
74
|
+
expiresIn: number;
|
72
75
|
}>;
|
73
76
|
}, "strip", z.ZodTypeAny, {
|
74
77
|
user: {
|
@@ -83,6 +86,7 @@ export declare const loginResponseSchema: z.ZodObject<{
|
|
83
86
|
backendTokens: {
|
84
87
|
accessToken: string;
|
85
88
|
refreshToken: string;
|
89
|
+
expiresIn: number;
|
86
90
|
};
|
87
91
|
}, {
|
88
92
|
user: {
|
@@ -97,6 +101,7 @@ export declare const loginResponseSchema: z.ZodObject<{
|
|
97
101
|
backendTokens: {
|
98
102
|
accessToken: string;
|
99
103
|
refreshToken: string;
|
104
|
+
expiresIn: number;
|
100
105
|
};
|
101
106
|
}>;
|
102
107
|
declare const LoginResponseDto_base: import("@anatine/zod-nestjs").ZodDtoStatic<z.ZodObject<{
|
@@ -131,12 +136,15 @@ declare const LoginResponseDto_base: import("@anatine/zod-nestjs").ZodDtoStatic<
|
|
131
136
|
backendTokens: z.ZodObject<{
|
132
137
|
accessToken: z.ZodString;
|
133
138
|
refreshToken: z.ZodString;
|
139
|
+
expiresIn: z.ZodNumber;
|
134
140
|
}, z.UnknownKeysParam, z.ZodTypeAny, {
|
135
141
|
accessToken: string;
|
136
142
|
refreshToken: string;
|
143
|
+
expiresIn: number;
|
137
144
|
}, {
|
138
145
|
accessToken: string;
|
139
146
|
refreshToken: string;
|
147
|
+
expiresIn: number;
|
140
148
|
}>;
|
141
149
|
}, z.UnknownKeysParam, z.ZodTypeAny, {
|
142
150
|
user: {
|
@@ -151,6 +159,7 @@ declare const LoginResponseDto_base: import("@anatine/zod-nestjs").ZodDtoStatic<
|
|
151
159
|
backendTokens: {
|
152
160
|
accessToken: string;
|
153
161
|
refreshToken: string;
|
162
|
+
expiresIn: number;
|
154
163
|
};
|
155
164
|
}, {
|
156
165
|
user: {
|
@@ -165,6 +174,7 @@ declare const LoginResponseDto_base: import("@anatine/zod-nestjs").ZodDtoStatic<
|
|
165
174
|
backendTokens: {
|
166
175
|
accessToken: string;
|
167
176
|
refreshToken: string;
|
177
|
+
expiresIn: number;
|
168
178
|
};
|
169
179
|
}>>;
|
170
180
|
export declare class LoginResponseDto extends LoginResponseDto_base {
|
@@ -21,6 +21,7 @@ exports.loginResponseSchema = zod_1.default.object({
|
|
21
21
|
backendTokens: zod_1.default.object({
|
22
22
|
accessToken: zod_1.default.string(),
|
23
23
|
refreshToken: zod_1.default.string(),
|
24
|
+
expiresIn: zod_1.default.number(),
|
24
25
|
}),
|
25
26
|
});
|
26
27
|
class LoginResponseDto extends (0, create_zod_dto_without_date_1.createZodDtoWithoutDate)(exports.loginResponseSchema) {
|
@@ -0,0 +1,30 @@
|
|
1
|
+
import z from 'zod';
|
2
|
+
export declare const refreshResponseSchema: z.ZodObject<{
|
3
|
+
refreshToken: z.ZodString;
|
4
|
+
accessToken: z.ZodString;
|
5
|
+
expiresIn: z.ZodNumber;
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
7
|
+
accessToken: string;
|
8
|
+
refreshToken: string;
|
9
|
+
expiresIn: number;
|
10
|
+
}, {
|
11
|
+
accessToken: string;
|
12
|
+
refreshToken: string;
|
13
|
+
expiresIn: number;
|
14
|
+
}>;
|
15
|
+
declare const RefreshResponseDto_base: import("@anatine/zod-nestjs").ZodDtoStatic<z.ZodObject<{
|
16
|
+
refreshToken: z.ZodString;
|
17
|
+
accessToken: z.ZodString;
|
18
|
+
expiresIn: z.ZodNumber;
|
19
|
+
}, z.UnknownKeysParam, z.ZodTypeAny, {
|
20
|
+
accessToken: string;
|
21
|
+
refreshToken: string;
|
22
|
+
expiresIn: number;
|
23
|
+
}, {
|
24
|
+
accessToken: string;
|
25
|
+
refreshToken: string;
|
26
|
+
expiresIn: number;
|
27
|
+
}>>;
|
28
|
+
export declare class RefreshResponseDto extends RefreshResponseDto_base {
|
29
|
+
}
|
30
|
+
export {};
|
@@ -0,0 +1,17 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
exports.RefreshResponseDto = exports.refreshResponseSchema = void 0;
|
7
|
+
const create_zod_dto_without_date_1 = require("../../shared/dto-modification/create-zod-dto-without-date");
|
8
|
+
const zod_1 = __importDefault(require("zod"));
|
9
|
+
exports.refreshResponseSchema = zod_1.default.object({
|
10
|
+
refreshToken: zod_1.default.string(),
|
11
|
+
accessToken: zod_1.default.string(),
|
12
|
+
expiresIn: zod_1.default.number(),
|
13
|
+
});
|
14
|
+
class RefreshResponseDto extends (0, create_zod_dto_without_date_1.createZodDtoWithoutDate)(exports.refreshResponseSchema) {
|
15
|
+
}
|
16
|
+
exports.RefreshResponseDto = RefreshResponseDto;
|
17
|
+
//# sourceMappingURL=refresh.dto.js.map
|
@@ -0,0 +1,4 @@
|
|
1
|
+
import { ReplaceDatesWithStrings } from '@/shared/dto-modification/zod-without-dates';
|
2
|
+
import { ZodDtoStatic } from '@anatine/zod-nestjs';
|
3
|
+
import { OpenApiZodAny } from '@anatine/zod-openapi';
|
4
|
+
export declare function createZodDtoWithoutDate<T extends OpenApiZodAny>(schema: T): ZodDtoStatic<ReplaceDatesWithStrings<T>>;
|
@@ -0,0 +1,10 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.createZodDtoWithoutDate = void 0;
|
4
|
+
const zod_without_dates_1 = require("./zod-without-dates");
|
5
|
+
const zod_nestjs_1 = require("@anatine/zod-nestjs");
|
6
|
+
function createZodDtoWithoutDate(schema) {
|
7
|
+
return (0, zod_nestjs_1.createZodDto)((0, zod_without_dates_1.replaceDatesWithStrings)(schema));
|
8
|
+
}
|
9
|
+
exports.createZodDtoWithoutDate = createZodDtoWithoutDate;
|
10
|
+
//# sourceMappingURL=create-zod-dto-without-date.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"create-zod-dto-without-date.js","sourceRoot":"","sources":["../../../../src/shared/dto-modification/create-zod-dto-without-date.ts"],"names":[],"mappings":";;;AAAA,2DAGqD;AACrD,oDAAiE;AAGjE,SAAgB,uBAAuB,CACrC,MAAS;IAET,OAAO,IAAA,yBAAY,EAAC,IAAA,2CAAuB,EAAC,MAAM,CAAC,CAElD,CAAC;AACJ,CAAC;AAND,0DAMC"}
|
@@ -0,0 +1,4 @@
|
|
1
|
+
export type WithSerializedDates<T> = T extends Date ? string : T extends Array<infer R> ? Array<WithSerializedDates<R>> : T extends object ? {
|
2
|
+
[K in keyof T]: WithSerializedDates<T[K]>;
|
3
|
+
} : T;
|
4
|
+
export declare const withoutDates: <T>(model: T) => WithSerializedDates<T>;
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"without-dates.js","sourceRoot":"","sources":["../../../../src/shared/dto-modification/without-dates.ts"],"names":[],"mappings":";;;AAQO,MAAM,YAAY,GAAG,CAAI,KAAQ,EAA0B,EAAE,CAClE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAA2B,CAAC;AADjD,QAAA,YAAY,gBACqC"}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { OpenApiZodAny } from '@anatine/zod-openapi';
|
2
|
+
import { z, ZodArray, ZodDate, ZodIntersection, ZodObject, ZodTypeAny, ZodUnion } from 'zod';
|
3
|
+
export type ReplaceDatesWithStrings<T extends ZodTypeAny> = T extends ZodDate ? ReturnType<typeof z.string> : T extends ZodObject<infer Shape> ? ZodObject<{
|
4
|
+
[k in keyof Shape]: ReplaceDatesWithStrings<Shape[k]>;
|
5
|
+
}> : T extends ZodArray<infer Item> ? ZodArray<ReplaceDatesWithStrings<Item>> : T extends ZodUnion<infer Options> ? ZodUnion<{
|
6
|
+
[k in keyof Options]: ReplaceDatesWithStrings<Options[k]>;
|
7
|
+
}> : T extends ZodIntersection<infer Left, infer Right> ? ZodIntersection<ReplaceDatesWithStrings<Left>, ReplaceDatesWithStrings<Right>> : T;
|
8
|
+
export declare const replaceDatesWithStrings: <T extends OpenApiZodAny>(schema: T) => ReplaceDatesWithStrings<T>;
|
@@ -0,0 +1,28 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.replaceDatesWithStrings = void 0;
|
4
|
+
const zod_1 = require("zod");
|
5
|
+
const replaceDatesWithStrings = (schema) => {
|
6
|
+
if (schema instanceof zod_1.ZodDate) {
|
7
|
+
return zod_1.z.string().datetime();
|
8
|
+
}
|
9
|
+
if (schema instanceof zod_1.ZodObject) {
|
10
|
+
const newShape = {};
|
11
|
+
for (const key in schema.shape) {
|
12
|
+
newShape[key] = (0, exports.replaceDatesWithStrings)(schema.shape[key]);
|
13
|
+
}
|
14
|
+
return zod_1.z.object(newShape);
|
15
|
+
}
|
16
|
+
if (schema instanceof zod_1.ZodArray) {
|
17
|
+
return zod_1.z.array((0, exports.replaceDatesWithStrings)(schema.element));
|
18
|
+
}
|
19
|
+
if (schema instanceof zod_1.ZodUnion) {
|
20
|
+
return zod_1.z.union(schema._def.options.map((option) => (0, exports.replaceDatesWithStrings)(option)));
|
21
|
+
}
|
22
|
+
if (schema instanceof zod_1.ZodIntersection) {
|
23
|
+
return zod_1.z.intersection((0, exports.replaceDatesWithStrings)(schema._def.left), (0, exports.replaceDatesWithStrings)(schema._def.right));
|
24
|
+
}
|
25
|
+
return schema;
|
26
|
+
};
|
27
|
+
exports.replaceDatesWithStrings = replaceDatesWithStrings;
|
28
|
+
//# sourceMappingURL=zod-without-dates.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"zod-without-dates.js","sourceRoot":"","sources":["../../../../src/shared/dto-modification/zod-without-dates.ts"],"names":[],"mappings":";;;AACA,6BASa;AAoBN,MAAM,uBAAuB,GAAG,CACrC,MAAS,EACmB,EAAE;IAC9B,IAAI,MAAM,YAAY,aAAO,EAAE,CAAC;QAC9B,OAAO,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAgC,CAAC;IAC7D,CAAC;IAED,IAAI,MAAM,YAAY,eAAS,EAAE,CAAC;QAChC,MAAM,QAAQ,GAAgB,EAAE,CAAC;QACjC,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;YAC/B,QAAQ,CAAC,GAAG,CAAC,GAAG,IAAA,+BAAuB,EAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;QAC7D,CAAC;QACD,OAAO,OAAC,CAAC,MAAM,CAAC,QAAQ,CAA+B,CAAC;IAC1D,CAAC;IAED,IAAI,MAAM,YAAY,cAAQ,EAAE,CAAC;QAC/B,OAAO,OAAC,CAAC,KAAK,CACZ,IAAA,+BAAuB,EAAC,MAAM,CAAC,OAAO,CAAC,CACV,CAAC;IAClC,CAAC;IAED,IAAI,MAAM,YAAY,cAAQ,EAAE,CAAC;QAC/B,OAAO,OAAC,CAAC,KAAK,CACZ,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAS,EAAE,EAAE,CAAC,IAAA,+BAAuB,EAAC,MAAM,CAAC,CAAC,CAC1C,CAAC;IAClC,CAAC;IAED,IAAI,MAAM,YAAY,qBAAe,EAAE,CAAC;QACtC,OAAO,OAAC,CAAC,YAAY,CACnB,IAAA,+BAAuB,EAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EACzC,IAAA,+BAAuB,EAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CACb,CAAC;IAClC,CAAC;IAGD,OAAO,MAAoC,CAAC;AAC9C,CAAC,CAAC;AApCW,QAAA,uBAAuB,2BAoClC"}
|
package/dist/types/schema.d.ts
CHANGED
@@ -228,8 +228,14 @@ export interface components {
|
|
228
228
|
backendTokens: {
|
229
229
|
accessToken?: string;
|
230
230
|
refreshToken?: string;
|
231
|
+
expiresIn?: number;
|
231
232
|
};
|
232
233
|
};
|
234
|
+
RefreshResponseDto: {
|
235
|
+
refreshToken: string;
|
236
|
+
accessToken: string;
|
237
|
+
expiresIn: number;
|
238
|
+
};
|
233
239
|
CreateTagDto: {
|
234
240
|
name: string;
|
235
241
|
groupId: string;
|
@@ -517,11 +523,13 @@ export interface operations {
|
|
517
523
|
};
|
518
524
|
requestBody?: never;
|
519
525
|
responses: {
|
520
|
-
|
526
|
+
200: {
|
521
527
|
headers: {
|
522
528
|
[name: string]: unknown;
|
523
529
|
};
|
524
|
-
content
|
530
|
+
content: {
|
531
|
+
"application/json": components["schemas"]["RefreshResponseDto"];
|
532
|
+
};
|
525
533
|
};
|
526
534
|
};
|
527
535
|
};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "expo-backend-types",
|
3
|
-
"version": "0.4.0-EXPO-248-EB-GrupoEtiqueta.
|
3
|
+
"version": "0.4.0-EXPO-248-EB-GrupoEtiqueta.12",
|
4
4
|
"description": "",
|
5
5
|
"author": "Expo",
|
6
6
|
"private": false,
|
@@ -9,7 +9,7 @@
|
|
9
9
|
"dist/types",
|
10
10
|
"dist/src/**/*.dto.{js,d.ts,ts}",
|
11
11
|
"dist/src/**/exports.{js,d.ts,ts}",
|
12
|
-
"dist/src/shared/
|
12
|
+
"dist/src/shared/dto-modification",
|
13
13
|
"dist/src/i18n"
|
14
14
|
],
|
15
15
|
"scripts": {
|