expo-backend-types 0.30.0-EXPO-308-auth.8 → 0.30.0-EXPO-308-auth.9

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.
@@ -15,31 +15,143 @@ declare const SendOtpDto_base: import("@anatine/zod-nestjs").ZodDtoStatic<z.ZodO
15
15
  }>>;
16
16
  export declare class SendOtpDto extends SendOtpDto_base {
17
17
  }
18
- export declare const sendOtpResponseSchema: z.ZodObject<{
19
- success: z.ZodBoolean;
18
+ export declare const discriminatedResponseSchema: z.ZodDiscriminatedUnion<"success", [z.ZodObject<z.objectUtil.extendShape<{
20
19
  hasVerified: z.ZodBoolean;
21
20
  hasUsername: z.ZodBoolean;
22
- }, "strip", z.ZodTypeAny, {
23
- success: boolean;
21
+ }, {
22
+ success: z.ZodLiteral<true>;
23
+ }>, "strip", z.ZodTypeAny, {
24
+ success: true;
24
25
  hasVerified: boolean;
25
26
  hasUsername: boolean;
26
27
  }, {
27
- success: boolean;
28
+ success: true;
28
29
  hasVerified: boolean;
29
30
  hasUsername: boolean;
30
- }>;
31
- declare const SendOtpResponseDto_base: import("@anatine/zod-nestjs").ZodDtoStatic<z.ZodObject<{
32
- success: z.ZodBoolean;
31
+ }>, z.ZodObject<z.objectUtil.extendShape<{
33
32
  hasVerified: z.ZodBoolean;
34
33
  hasUsername: z.ZodBoolean;
35
- }, z.UnknownKeysParam, z.ZodTypeAny, {
36
- success: boolean;
34
+ }, {
35
+ success: z.ZodLiteral<false>;
36
+ message: z.ZodString;
37
+ }>, "strip", z.ZodTypeAny, {
38
+ message: string;
39
+ success: false;
37
40
  hasVerified: boolean;
38
41
  hasUsername: boolean;
39
42
  }, {
40
- success: boolean;
43
+ message: string;
44
+ success: false;
41
45
  hasVerified: boolean;
42
46
  hasUsername: boolean;
47
+ }>]>;
48
+ export declare const sendOtpResponseSchema: z.ZodObject<{
49
+ response: z.ZodDiscriminatedUnion<"success", [z.ZodObject<z.objectUtil.extendShape<{
50
+ hasVerified: z.ZodBoolean;
51
+ hasUsername: z.ZodBoolean;
52
+ }, {
53
+ success: z.ZodLiteral<true>;
54
+ }>, "strip", z.ZodTypeAny, {
55
+ success: true;
56
+ hasVerified: boolean;
57
+ hasUsername: boolean;
58
+ }, {
59
+ success: true;
60
+ hasVerified: boolean;
61
+ hasUsername: boolean;
62
+ }>, z.ZodObject<z.objectUtil.extendShape<{
63
+ hasVerified: z.ZodBoolean;
64
+ hasUsername: z.ZodBoolean;
65
+ }, {
66
+ success: z.ZodLiteral<false>;
67
+ message: z.ZodString;
68
+ }>, "strip", z.ZodTypeAny, {
69
+ message: string;
70
+ success: false;
71
+ hasVerified: boolean;
72
+ hasUsername: boolean;
73
+ }, {
74
+ message: string;
75
+ success: false;
76
+ hasVerified: boolean;
77
+ hasUsername: boolean;
78
+ }>]>;
79
+ }, "strip", z.ZodTypeAny, {
80
+ response: {
81
+ success: true;
82
+ hasVerified: boolean;
83
+ hasUsername: boolean;
84
+ } | {
85
+ message: string;
86
+ success: false;
87
+ hasVerified: boolean;
88
+ hasUsername: boolean;
89
+ };
90
+ }, {
91
+ response: {
92
+ success: true;
93
+ hasVerified: boolean;
94
+ hasUsername: boolean;
95
+ } | {
96
+ message: string;
97
+ success: false;
98
+ hasVerified: boolean;
99
+ hasUsername: boolean;
100
+ };
101
+ }>;
102
+ declare const SendOtpResponseDto_base: import("@anatine/zod-nestjs").ZodDtoStatic<z.ZodObject<{
103
+ response: z.ZodDiscriminatedUnion<"success", [z.ZodObject<z.objectUtil.extendShape<{
104
+ hasVerified: z.ZodBoolean;
105
+ hasUsername: z.ZodBoolean;
106
+ }, {
107
+ success: z.ZodLiteral<true>;
108
+ }>, "strip", z.ZodTypeAny, {
109
+ success: true;
110
+ hasVerified: boolean;
111
+ hasUsername: boolean;
112
+ }, {
113
+ success: true;
114
+ hasVerified: boolean;
115
+ hasUsername: boolean;
116
+ }>, z.ZodObject<z.objectUtil.extendShape<{
117
+ hasVerified: z.ZodBoolean;
118
+ hasUsername: z.ZodBoolean;
119
+ }, {
120
+ success: z.ZodLiteral<false>;
121
+ message: z.ZodString;
122
+ }>, "strip", z.ZodTypeAny, {
123
+ message: string;
124
+ success: false;
125
+ hasVerified: boolean;
126
+ hasUsername: boolean;
127
+ }, {
128
+ message: string;
129
+ success: false;
130
+ hasVerified: boolean;
131
+ hasUsername: boolean;
132
+ }>]>;
133
+ }, z.UnknownKeysParam, z.ZodTypeAny, {
134
+ response: {
135
+ success: true;
136
+ hasVerified: boolean;
137
+ hasUsername: boolean;
138
+ } | {
139
+ message: string;
140
+ success: false;
141
+ hasVerified: boolean;
142
+ hasUsername: boolean;
143
+ };
144
+ }, {
145
+ response: {
146
+ success: true;
147
+ hasVerified: boolean;
148
+ hasUsername: boolean;
149
+ } | {
150
+ message: string;
151
+ success: false;
152
+ hasVerified: boolean;
153
+ hasUsername: boolean;
154
+ };
43
155
  }>>;
44
156
  export declare class SendOtpResponseDto extends SendOtpResponseDto_base {
45
157
  }
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.SendOtpResponseDto = exports.sendOtpResponseSchema = exports.SendOtpDto = exports.sendOtpSchema = void 0;
6
+ exports.SendOtpResponseDto = exports.sendOtpResponseSchema = exports.discriminatedResponseSchema = exports.SendOtpDto = exports.sendOtpSchema = void 0;
7
7
  const profile_dto_1 = require("../../profile/dto/profile.dto");
8
8
  const create_zod_dto_without_date_1 = require("../../shared/dto-modification/create-zod-dto-without-date");
9
9
  const zod_1 = __importDefault(require("zod"));
@@ -13,11 +13,22 @@ exports.sendOtpSchema = zod_1.default.object({
13
13
  class SendOtpDto extends (0, create_zod_dto_without_date_1.createZodDtoWithoutDate)(exports.sendOtpSchema) {
14
14
  }
15
15
  exports.SendOtpDto = SendOtpDto;
16
- exports.sendOtpResponseSchema = zod_1.default.object({
17
- success: zod_1.default.boolean(),
16
+ const baseResponseSchema = zod_1.default.object({
18
17
  hasVerified: zod_1.default.boolean(),
19
18
  hasUsername: zod_1.default.boolean(),
20
19
  });
20
+ exports.discriminatedResponseSchema = zod_1.default.discriminatedUnion('success', [
21
+ baseResponseSchema.merge(zod_1.default.object({
22
+ success: zod_1.default.literal(true),
23
+ })),
24
+ baseResponseSchema.merge(zod_1.default.object({
25
+ success: zod_1.default.literal(false),
26
+ message: zod_1.default.string(),
27
+ })),
28
+ ]);
29
+ exports.sendOtpResponseSchema = zod_1.default.object({
30
+ response: exports.discriminatedResponseSchema,
31
+ });
21
32
  class SendOtpResponseDto extends (0, create_zod_dto_without_date_1.createZodDtoWithoutDate)(exports.sendOtpResponseSchema) {
22
33
  }
23
34
  exports.SendOtpResponseDto = SendOtpResponseDto;
@@ -2278,9 +2278,16 @@ export interface components {
2278
2278
  phoneNumber: string;
2279
2279
  };
2280
2280
  SendOtpResponseDto: {
2281
- success: boolean;
2282
- hasVerified: boolean;
2283
- hasUsername: boolean;
2281
+ response: {
2282
+ hasVerified: boolean;
2283
+ hasUsername: boolean;
2284
+ success: true;
2285
+ } | {
2286
+ hasVerified: boolean;
2287
+ hasUsername: boolean;
2288
+ success: false;
2289
+ message: string;
2290
+ };
2284
2291
  };
2285
2292
  VerifyOtpDto: {
2286
2293
  phoneNumber: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-backend-types",
3
- "version": "0.30.0-EXPO-308-auth.8",
3
+ "version": "0.30.0-EXPO-308-auth.9",
4
4
  "description": "",
5
5
  "author": "Expo",
6
6
  "private": false,