@gigapay-dev/contracts 3.11.0 → 3.13.0

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.
@@ -0,0 +1,228 @@
1
+ import { z } from "zod";
2
+ export declare const CreateCollectionRequestSchema: z.ZodObject<{
3
+ slug: z.ZodString;
4
+ name: z.ZodString;
5
+ description: z.ZodOptional<z.ZodString>;
6
+ imageUrl: z.ZodOptional<z.ZodURL>;
7
+ isActive: z.ZodOptional<z.ZodBoolean>;
8
+ }, z.core.$strip>;
9
+ export type CreateCollectionRequest = z.infer<typeof CreateCollectionRequestSchema>;
10
+ export declare const UpdateCollectionRequestSchema: z.ZodObject<{
11
+ slug: z.ZodOptional<z.ZodString>;
12
+ name: z.ZodOptional<z.ZodString>;
13
+ description: z.ZodOptional<z.ZodOptional<z.ZodString>>;
14
+ imageUrl: z.ZodOptional<z.ZodOptional<z.ZodURL>>;
15
+ isActive: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
16
+ }, z.core.$strip>;
17
+ export type UpdateCollectionRequest = z.infer<typeof UpdateCollectionRequestSchema>;
18
+ export declare const ReplaceCollectionProductsRequestSchema: z.ZodObject<{
19
+ productIds: z.ZodArray<z.ZodNumber>;
20
+ }, z.core.$strip>;
21
+ export type ReplaceCollectionProductsRequest = z.infer<typeof ReplaceCollectionProductsRequestSchema>;
22
+ export declare const CreateCollectionEndpoint: {
23
+ readonly method: "POST";
24
+ readonly path: "/api/admin/collections";
25
+ readonly request: z.ZodObject<{
26
+ slug: z.ZodString;
27
+ name: z.ZodString;
28
+ description: z.ZodOptional<z.ZodString>;
29
+ imageUrl: z.ZodOptional<z.ZodURL>;
30
+ isActive: z.ZodOptional<z.ZodBoolean>;
31
+ }, z.core.$strip>;
32
+ readonly response: z.ZodObject<{
33
+ id: z.ZodNumber;
34
+ slug: z.ZodString;
35
+ name: z.ZodString;
36
+ description: z.ZodNullable<z.ZodString>;
37
+ imageUrl: z.ZodNullable<z.ZodString>;
38
+ isActive: z.ZodBoolean;
39
+ createdAt: z.ZodString;
40
+ updatedAt: z.ZodString;
41
+ version: z.ZodNumber;
42
+ }, z.core.$strip>;
43
+ readonly requiresAuth: true;
44
+ readonly requiresAdmin: true;
45
+ };
46
+ export declare const UpdateCollectionEndpoint: {
47
+ readonly method: "PATCH";
48
+ readonly path: "/api/admin/collections/:id";
49
+ readonly params: z.ZodObject<{
50
+ id: z.ZodCoercedNumber<unknown>;
51
+ }, z.core.$strip>;
52
+ readonly request: z.ZodObject<{
53
+ slug: z.ZodOptional<z.ZodString>;
54
+ name: z.ZodOptional<z.ZodString>;
55
+ description: z.ZodOptional<z.ZodOptional<z.ZodString>>;
56
+ imageUrl: z.ZodOptional<z.ZodOptional<z.ZodURL>>;
57
+ isActive: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
58
+ }, z.core.$strip>;
59
+ readonly response: z.ZodObject<{
60
+ id: z.ZodNumber;
61
+ slug: z.ZodString;
62
+ name: z.ZodString;
63
+ description: z.ZodNullable<z.ZodString>;
64
+ imageUrl: z.ZodNullable<z.ZodString>;
65
+ isActive: z.ZodBoolean;
66
+ createdAt: z.ZodString;
67
+ updatedAt: z.ZodString;
68
+ version: z.ZodNumber;
69
+ }, z.core.$strip>;
70
+ readonly requiresAuth: true;
71
+ readonly requiresAdmin: true;
72
+ };
73
+ export declare const ReplaceCollectionProductsEndpoint: {
74
+ readonly method: "PUT";
75
+ readonly path: "/api/admin/collections/:id/products";
76
+ readonly params: z.ZodObject<{
77
+ id: z.ZodCoercedNumber<unknown>;
78
+ }, z.core.$strip>;
79
+ readonly request: z.ZodObject<{
80
+ productIds: z.ZodArray<z.ZodNumber>;
81
+ }, z.core.$strip>;
82
+ readonly response: z.ZodObject<{
83
+ id: z.ZodNumber;
84
+ slug: z.ZodString;
85
+ name: z.ZodString;
86
+ description: z.ZodNullable<z.ZodString>;
87
+ imageUrl: z.ZodNullable<z.ZodString>;
88
+ isActive: z.ZodBoolean;
89
+ createdAt: z.ZodString;
90
+ updatedAt: z.ZodString;
91
+ version: z.ZodNumber;
92
+ products: z.ZodArray<z.ZodObject<{
93
+ productId: z.ZodNumber;
94
+ collectionId: z.ZodNumber;
95
+ sortOrder: z.ZodNumber;
96
+ product: z.ZodObject<{
97
+ id: z.ZodNumber;
98
+ slug: z.ZodString;
99
+ title: z.ZodString;
100
+ status: z.ZodEnum<{
101
+ OUT_OF_STOCK: "OUT_OF_STOCK";
102
+ ACTIVE: "ACTIVE";
103
+ DRAFT: "DRAFT";
104
+ ARCHIVED: "ARCHIVED";
105
+ }>;
106
+ }, z.core.$strip>;
107
+ }, z.core.$strip>>;
108
+ }, z.core.$strip>;
109
+ readonly requiresAuth: true;
110
+ readonly requiresAdmin: true;
111
+ };
112
+ export declare const DeleteCollectionEndpoint: {
113
+ readonly method: "DELETE";
114
+ readonly path: "/api/admin/collections/:id";
115
+ readonly params: z.ZodObject<{
116
+ id: z.ZodCoercedNumber<unknown>;
117
+ }, z.core.$strip>;
118
+ readonly response: z.ZodObject<{
119
+ ok: z.ZodLiteral<true>;
120
+ }, z.core.$strip>;
121
+ readonly requiresAuth: true;
122
+ readonly requiresAdmin: true;
123
+ };
124
+ export declare const CollectionCommands: {
125
+ readonly create: {
126
+ readonly method: "POST";
127
+ readonly path: "/api/admin/collections";
128
+ readonly request: z.ZodObject<{
129
+ slug: z.ZodString;
130
+ name: z.ZodString;
131
+ description: z.ZodOptional<z.ZodString>;
132
+ imageUrl: z.ZodOptional<z.ZodURL>;
133
+ isActive: z.ZodOptional<z.ZodBoolean>;
134
+ }, z.core.$strip>;
135
+ readonly response: z.ZodObject<{
136
+ id: z.ZodNumber;
137
+ slug: z.ZodString;
138
+ name: z.ZodString;
139
+ description: z.ZodNullable<z.ZodString>;
140
+ imageUrl: z.ZodNullable<z.ZodString>;
141
+ isActive: z.ZodBoolean;
142
+ createdAt: z.ZodString;
143
+ updatedAt: z.ZodString;
144
+ version: z.ZodNumber;
145
+ }, z.core.$strip>;
146
+ readonly requiresAuth: true;
147
+ readonly requiresAdmin: true;
148
+ };
149
+ readonly update: {
150
+ readonly method: "PATCH";
151
+ readonly path: "/api/admin/collections/:id";
152
+ readonly params: z.ZodObject<{
153
+ id: z.ZodCoercedNumber<unknown>;
154
+ }, z.core.$strip>;
155
+ readonly request: z.ZodObject<{
156
+ slug: z.ZodOptional<z.ZodString>;
157
+ name: z.ZodOptional<z.ZodString>;
158
+ description: z.ZodOptional<z.ZodOptional<z.ZodString>>;
159
+ imageUrl: z.ZodOptional<z.ZodOptional<z.ZodURL>>;
160
+ isActive: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
161
+ }, z.core.$strip>;
162
+ readonly response: z.ZodObject<{
163
+ id: z.ZodNumber;
164
+ slug: z.ZodString;
165
+ name: z.ZodString;
166
+ description: z.ZodNullable<z.ZodString>;
167
+ imageUrl: z.ZodNullable<z.ZodString>;
168
+ isActive: z.ZodBoolean;
169
+ createdAt: z.ZodString;
170
+ updatedAt: z.ZodString;
171
+ version: z.ZodNumber;
172
+ }, z.core.$strip>;
173
+ readonly requiresAuth: true;
174
+ readonly requiresAdmin: true;
175
+ };
176
+ readonly replaceProducts: {
177
+ readonly method: "PUT";
178
+ readonly path: "/api/admin/collections/:id/products";
179
+ readonly params: z.ZodObject<{
180
+ id: z.ZodCoercedNumber<unknown>;
181
+ }, z.core.$strip>;
182
+ readonly request: z.ZodObject<{
183
+ productIds: z.ZodArray<z.ZodNumber>;
184
+ }, z.core.$strip>;
185
+ readonly response: z.ZodObject<{
186
+ id: z.ZodNumber;
187
+ slug: z.ZodString;
188
+ name: z.ZodString;
189
+ description: z.ZodNullable<z.ZodString>;
190
+ imageUrl: z.ZodNullable<z.ZodString>;
191
+ isActive: z.ZodBoolean;
192
+ createdAt: z.ZodString;
193
+ updatedAt: z.ZodString;
194
+ version: z.ZodNumber;
195
+ products: z.ZodArray<z.ZodObject<{
196
+ productId: z.ZodNumber;
197
+ collectionId: z.ZodNumber;
198
+ sortOrder: z.ZodNumber;
199
+ product: z.ZodObject<{
200
+ id: z.ZodNumber;
201
+ slug: z.ZodString;
202
+ title: z.ZodString;
203
+ status: z.ZodEnum<{
204
+ OUT_OF_STOCK: "OUT_OF_STOCK";
205
+ ACTIVE: "ACTIVE";
206
+ DRAFT: "DRAFT";
207
+ ARCHIVED: "ARCHIVED";
208
+ }>;
209
+ }, z.core.$strip>;
210
+ }, z.core.$strip>>;
211
+ }, z.core.$strip>;
212
+ readonly requiresAuth: true;
213
+ readonly requiresAdmin: true;
214
+ };
215
+ readonly delete: {
216
+ readonly method: "DELETE";
217
+ readonly path: "/api/admin/collections/:id";
218
+ readonly params: z.ZodObject<{
219
+ id: z.ZodCoercedNumber<unknown>;
220
+ }, z.core.$strip>;
221
+ readonly response: z.ZodObject<{
222
+ ok: z.ZodLiteral<true>;
223
+ }, z.core.$strip>;
224
+ readonly requiresAuth: true;
225
+ readonly requiresAdmin: true;
226
+ };
227
+ };
228
+ //# sourceMappingURL=commands.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../src/domains/collections/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,6BAA6B;;;;;;iBAMxC,CAAC;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEpF,eAAO,MAAM,6BAA6B;;;;;;iBAA0C,CAAC;AACrF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEpF,eAAO,MAAM,sCAAsC;;iBAKjD,CAAC;AACH,MAAM,MAAM,gCAAgC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sCAAsC,CAAC,CAAC;AAEtG,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;CAOA,CAAC;AAEtC,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;CAQA,CAAC;AAEtC,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQT,CAAC;AAEtC,eAAO,MAAM,wBAAwB;;;;;;;;;;;CAOA,CAAC;AAEtC,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKrB,CAAC"}
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CollectionCommands = exports.DeleteCollectionEndpoint = exports.ReplaceCollectionProductsEndpoint = exports.UpdateCollectionEndpoint = exports.CreateCollectionEndpoint = exports.ReplaceCollectionProductsRequestSchema = exports.UpdateCollectionRequestSchema = exports.CreateCollectionRequestSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const common_1 = require("../../shared/common");
6
+ const dtos_1 = require("./dtos");
7
+ exports.CreateCollectionRequestSchema = zod_1.z.object({
8
+ slug: zod_1.z.string().min(1).max(64),
9
+ name: zod_1.z.string().min(1).max(128),
10
+ description: zod_1.z.string().max(2048).optional(),
11
+ imageUrl: zod_1.z.url().max(512).optional(),
12
+ isActive: zod_1.z.boolean().optional(),
13
+ });
14
+ exports.UpdateCollectionRequestSchema = exports.CreateCollectionRequestSchema.partial();
15
+ exports.ReplaceCollectionProductsRequestSchema = zod_1.z.object({
16
+ productIds: zod_1.z
17
+ .array(zod_1.z.number().int().positive())
18
+ .max(1000)
19
+ .refine(ids => new Set(ids).size === ids.length, "productIds must be unique"),
20
+ });
21
+ exports.CreateCollectionEndpoint = {
22
+ method: "POST",
23
+ path: "/api/admin/collections",
24
+ request: exports.CreateCollectionRequestSchema,
25
+ response: dtos_1.CollectionSchema,
26
+ requiresAuth: true,
27
+ requiresAdmin: true,
28
+ };
29
+ exports.UpdateCollectionEndpoint = {
30
+ method: "PATCH",
31
+ path: "/api/admin/collections/:id",
32
+ params: common_1.IdParamSchema,
33
+ request: exports.UpdateCollectionRequestSchema,
34
+ response: dtos_1.CollectionSchema,
35
+ requiresAuth: true,
36
+ requiresAdmin: true,
37
+ };
38
+ exports.ReplaceCollectionProductsEndpoint = {
39
+ method: "PUT",
40
+ path: "/api/admin/collections/:id/products",
41
+ params: common_1.IdParamSchema,
42
+ request: exports.ReplaceCollectionProductsRequestSchema,
43
+ response: dtos_1.AdminCollectionSchema,
44
+ requiresAuth: true,
45
+ requiresAdmin: true,
46
+ };
47
+ exports.DeleteCollectionEndpoint = {
48
+ method: "DELETE",
49
+ path: "/api/admin/collections/:id",
50
+ params: common_1.IdParamSchema,
51
+ response: common_1.SuccessResponseSchema,
52
+ requiresAuth: true,
53
+ requiresAdmin: true,
54
+ };
55
+ exports.CollectionCommands = {
56
+ create: exports.CreateCollectionEndpoint,
57
+ update: exports.UpdateCollectionEndpoint,
58
+ replaceProducts: exports.ReplaceCollectionProductsEndpoint,
59
+ delete: exports.DeleteCollectionEndpoint,
60
+ };
61
+ //# sourceMappingURL=commands.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commands.js","sourceRoot":"","sources":["../../../src/domains/collections/commands.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,gDAA2E;AAE3E,iCAAiE;AAEpD,QAAA,6BAA6B,GAAG,OAAC,CAAC,MAAM,CAAC;IACrD,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;IAC/B,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;IAChC,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE;IAC5C,QAAQ,EAAE,OAAC,CA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IAAI,EAAE,4BAA4B;IAClC,MAAM,EAAE,sBAAa;IACrB,QAAQ,EAAE,8BAAqB;IAC/B,YAAY,EAAE,IAAI;IAClB,aAAa,EAAE,IAAI;CACiB,CAAC;AAEzB,QAAA,kBAAkB,GAAG;IACjC,MAAM,EAAE,gCAAwB;IAChC,MAAM,EAAE,gCAAwB;IAChC,eAAe,EAAE,yCAAiC;IAClD,MAAM,EAAE,gCAAwB;CACvB,CAAC"}
@@ -0,0 +1,168 @@
1
+ import { z } from "zod";
2
+ export declare const CollectionSchema: z.ZodObject<{
3
+ id: z.ZodNumber;
4
+ slug: z.ZodString;
5
+ name: z.ZodString;
6
+ description: z.ZodNullable<z.ZodString>;
7
+ imageUrl: z.ZodNullable<z.ZodString>;
8
+ isActive: z.ZodBoolean;
9
+ createdAt: z.ZodString;
10
+ updatedAt: z.ZodString;
11
+ version: z.ZodNumber;
12
+ }, z.core.$strip>;
13
+ export type Collection = z.infer<typeof CollectionSchema>;
14
+ export declare const CollectionProductSchema: z.ZodObject<{
15
+ productId: z.ZodNumber;
16
+ collectionId: z.ZodNumber;
17
+ sortOrder: z.ZodNumber;
18
+ product: z.ZodObject<{
19
+ id: z.ZodNumber;
20
+ slug: z.ZodString;
21
+ title: z.ZodString;
22
+ status: z.ZodEnum<{
23
+ OUT_OF_STOCK: "OUT_OF_STOCK";
24
+ ACTIVE: "ACTIVE";
25
+ DRAFT: "DRAFT";
26
+ ARCHIVED: "ARCHIVED";
27
+ }>;
28
+ }, z.core.$strip>;
29
+ }, z.core.$strip>;
30
+ export type CollectionProduct = z.infer<typeof CollectionProductSchema>;
31
+ export declare const AdminCollectionSchema: z.ZodObject<{
32
+ id: z.ZodNumber;
33
+ slug: z.ZodString;
34
+ name: z.ZodString;
35
+ description: z.ZodNullable<z.ZodString>;
36
+ imageUrl: z.ZodNullable<z.ZodString>;
37
+ isActive: z.ZodBoolean;
38
+ createdAt: z.ZodString;
39
+ updatedAt: z.ZodString;
40
+ version: z.ZodNumber;
41
+ products: z.ZodArray<z.ZodObject<{
42
+ productId: z.ZodNumber;
43
+ collectionId: z.ZodNumber;
44
+ sortOrder: z.ZodNumber;
45
+ product: z.ZodObject<{
46
+ id: z.ZodNumber;
47
+ slug: z.ZodString;
48
+ title: z.ZodString;
49
+ status: z.ZodEnum<{
50
+ OUT_OF_STOCK: "OUT_OF_STOCK";
51
+ ACTIVE: "ACTIVE";
52
+ DRAFT: "DRAFT";
53
+ ARCHIVED: "ARCHIVED";
54
+ }>;
55
+ }, z.core.$strip>;
56
+ }, z.core.$strip>>;
57
+ }, z.core.$strip>;
58
+ export type AdminCollection = z.infer<typeof AdminCollectionSchema>;
59
+ export declare const AdminCollectionListItemSchema: z.ZodObject<{
60
+ id: z.ZodNumber;
61
+ slug: z.ZodString;
62
+ name: z.ZodString;
63
+ description: z.ZodNullable<z.ZodString>;
64
+ imageUrl: z.ZodNullable<z.ZodString>;
65
+ isActive: z.ZodBoolean;
66
+ createdAt: z.ZodString;
67
+ updatedAt: z.ZodString;
68
+ version: z.ZodNumber;
69
+ _count: z.ZodObject<{
70
+ products: z.ZodNumber;
71
+ }, z.core.$strip>;
72
+ }, z.core.$strip>;
73
+ export type AdminCollectionListItem = z.infer<typeof AdminCollectionListItemSchema>;
74
+ export declare const CollectionPageSchema: z.ZodObject<{
75
+ collection: z.ZodObject<{
76
+ id: z.ZodNumber;
77
+ slug: z.ZodString;
78
+ name: z.ZodString;
79
+ description: z.ZodNullable<z.ZodString>;
80
+ imageUrl: z.ZodNullable<z.ZodString>;
81
+ isActive: z.ZodBoolean;
82
+ createdAt: z.ZodString;
83
+ updatedAt: z.ZodString;
84
+ version: z.ZodNumber;
85
+ }, z.core.$strip>;
86
+ items: z.ZodArray<z.ZodObject<{
87
+ id: z.ZodNumber;
88
+ slug: z.ZodString;
89
+ title: z.ZodString;
90
+ type: z.ZodEnum<{
91
+ GAME_KEY: "GAME_KEY";
92
+ GAME_GIFT: "GAME_GIFT";
93
+ TOPUP: "TOPUP";
94
+ SUBSCRIPTION: "SUBSCRIPTION";
95
+ IN_GAME_ITEM: "IN_GAME_ITEM";
96
+ DLC: "DLC";
97
+ CURRENCY: "CURRENCY";
98
+ VOUCHER: "VOUCHER";
99
+ }>;
100
+ status: z.ZodEnum<{
101
+ OUT_OF_STOCK: "OUT_OF_STOCK";
102
+ ACTIVE: "ACTIVE";
103
+ DRAFT: "DRAFT";
104
+ ARCHIVED: "ARCHIVED";
105
+ }>;
106
+ description: z.ZodNullable<z.ZodString>;
107
+ shortDescription: z.ZodNullable<z.ZodString>;
108
+ coverImageUrl: z.ZodNullable<z.ZodString>;
109
+ basePrice: z.ZodObject<{
110
+ usd: z.ZodString;
111
+ rub: z.ZodString;
112
+ uah: z.ZodString;
113
+ kzt: z.ZodString;
114
+ }, z.core.$strip>;
115
+ popularityScore: z.ZodNumber;
116
+ seo: z.ZodObject<{
117
+ metaTitle: z.ZodString;
118
+ metaDescription: z.ZodString;
119
+ ogImageUrl: z.ZodNullable<z.ZodString>;
120
+ canonicalPath: z.ZodString;
121
+ breadcrumb: z.ZodArray<z.ZodObject<{
122
+ id: z.ZodNumber;
123
+ slug: z.ZodString;
124
+ name: z.ZodString;
125
+ }, z.core.$strip>>;
126
+ }, z.core.$strip>;
127
+ variants: z.ZodArray<z.ZodObject<{
128
+ id: z.ZodNumber;
129
+ name: z.ZodString;
130
+ sku: z.ZodString;
131
+ imageUrl: z.ZodNullable<z.ZodString>;
132
+ price: z.ZodObject<{
133
+ usd: z.ZodString;
134
+ rub: z.ZodString;
135
+ uah: z.ZodString;
136
+ kzt: z.ZodString;
137
+ }, z.core.$strip>;
138
+ deliveryType: z.ZodEnum<{
139
+ AUTOMATIC: "AUTOMATIC";
140
+ MANUAL: "MANUAL";
141
+ BOT: "BOT";
142
+ }>;
143
+ desslyServiceType: z.ZodNullable<z.ZodEnum<{
144
+ VOUCHER: "VOUCHER";
145
+ STEAM_TOPUP: "STEAM_TOPUP";
146
+ STEAM_GIFT: "STEAM_GIFT";
147
+ MOBILE_REFILL: "MOBILE_REFILL";
148
+ CRYPTO_REFILL: "CRYPTO_REFILL";
149
+ }>>;
150
+ isActive: z.ZodBoolean;
151
+ }, z.core.$strip>>;
152
+ media: z.ZodArray<z.ZodObject<{
153
+ id: z.ZodNumber;
154
+ type: z.ZodEnum<{
155
+ IMAGE: "IMAGE";
156
+ VIDEO: "VIDEO";
157
+ }>;
158
+ url: z.ZodString;
159
+ thumbnailUrl: z.ZodNullable<z.ZodString>;
160
+ sortOrder: z.ZodNumber;
161
+ }, z.core.$strip>>;
162
+ }, z.core.$strip>>;
163
+ total: z.ZodNumber;
164
+ skip: z.ZodNumber;
165
+ take: z.ZodNumber;
166
+ }, z.core.$strip>;
167
+ export type CollectionPage = z.infer<typeof CollectionPageSchema>;
168
+ //# sourceMappingURL=dtos.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dtos.d.ts","sourceRoot":"","sources":["../../../src/domains/collections/dtos.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,gBAAgB;;;;;;;;;;iBAU3B,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;iBAUlC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;iBAEhC,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;iBAExC,CAAC;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEpF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAM/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CollectionPageSchema = exports.AdminCollectionListItemSchema = exports.AdminCollectionSchema = exports.CollectionProductSchema = exports.CollectionSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const dtos_1 = require("../products/dtos");
6
+ exports.CollectionSchema = zod_1.z.object({
7
+ id: zod_1.z.number().int().positive(),
8
+ slug: zod_1.z.string(),
9
+ name: zod_1.z.string(),
10
+ description: zod_1.z.string().nullable(),
11
+ imageUrl: zod_1.z.string().nullable(),
12
+ isActive: zod_1.z.boolean(),
13
+ createdAt: zod_1.z.string(),
14
+ updatedAt: zod_1.z.string(),
15
+ version: zod_1.z.number().int().nonnegative(),
16
+ });
17
+ exports.CollectionProductSchema = zod_1.z.object({
18
+ productId: zod_1.z.number().int().positive(),
19
+ collectionId: zod_1.z.number().int().positive(),
20
+ sortOrder: zod_1.z.number().int().nonnegative(),
21
+ product: zod_1.z.object({
22
+ id: zod_1.z.number().int().positive(),
23
+ slug: zod_1.z.string(),
24
+ title: zod_1.z.string(),
25
+ status: dtos_1.ProductStatusSchema,
26
+ }),
27
+ });
28
+ exports.AdminCollectionSchema = exports.CollectionSchema.extend({
29
+ products: zod_1.z.array(exports.CollectionProductSchema),
30
+ });
31
+ exports.AdminCollectionListItemSchema = exports.CollectionSchema.extend({
32
+ _count: zod_1.z.object({ products: zod_1.z.number().int().nonnegative() }),
33
+ });
34
+ exports.CollectionPageSchema = zod_1.z.object({
35
+ collection: exports.CollectionSchema,
36
+ items: zod_1.z.array(dtos_1.ProductSchema),
37
+ total: zod_1.z.number().int().nonnegative(),
38
+ skip: zod_1.z.number().int().nonnegative(),
39
+ take: zod_1.z.number().int().positive(),
40
+ });
41
+ //# sourceMappingURL=dtos.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dtos.js","sourceRoot":"","sources":["../../../src/domains/collections/dtos.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,2CAAsE;AAEzD,QAAA,gBAAgB,GAAG,OAAC,CAAC,MAAM,CAAC;IACxC,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IAC/B,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,QAAQ,EAAE,OAAC,CAAC,OAAO,EAAE;IACrB,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;IACrB,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;IACrB,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;CACvC,CAAC,CAAC;AAGU,QAAA,uBAAuB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC/C,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IACtC,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IACzC,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;IACzC,OAAO,EAAE,OAAC,CAAC,MAAM,CAAC;QACjB,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;QAC/B,IAAI,EAAE,OAAC,CA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