@deallony/shared 1.2.60 → 1.2.62
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/cjs/constants/routes/app.d.ts +114 -0
- package/dist/cjs/constants/routes/app.js +44 -0
- package/dist/cjs/dto/ad/Ad.dto.d.ts +2 -0
- package/dist/cjs/schema/ad/find-ad.schema.d.ts +9 -0
- package/dist/cjs/schema/ad/find-ad.schema.js +12 -0
- package/dist/cjs/schema/ad/index.d.ts +1 -0
- package/dist/cjs/schema/ad/index.js +1 -0
- package/dist/esm/constants/routes/app.js +44 -0
- package/dist/esm/schema/ad/find-ad.schema.js +9 -0
- package/dist/esm/schema/ad/index.js +1 -0
- package/package.json +1 -1
|
@@ -71,6 +71,18 @@ export declare const APP_ROUTES: {
|
|
|
71
71
|
ad_id: string | number;
|
|
72
72
|
};
|
|
73
73
|
};
|
|
74
|
+
readonly promotionDetails: (params: {
|
|
75
|
+
id: number | string;
|
|
76
|
+
ad_id?: number | string;
|
|
77
|
+
data?: unknown;
|
|
78
|
+
}) => {
|
|
79
|
+
pathname: string;
|
|
80
|
+
params: {
|
|
81
|
+
id: string;
|
|
82
|
+
ad_id: string | undefined;
|
|
83
|
+
promotion: string | undefined;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
74
86
|
readonly list: (params: GenericParams) => {
|
|
75
87
|
pathname: string;
|
|
76
88
|
params: {
|
|
@@ -177,6 +189,9 @@ export declare const APP_ROUTES: {
|
|
|
177
189
|
readonly noInternet: () => {
|
|
178
190
|
pathname: string;
|
|
179
191
|
};
|
|
192
|
+
readonly savedData: () => {
|
|
193
|
+
pathname: string;
|
|
194
|
+
};
|
|
180
195
|
};
|
|
181
196
|
readonly settings: {
|
|
182
197
|
readonly selectCurrency: () => {
|
|
@@ -297,6 +312,105 @@ export declare const APP_ROUTES: {
|
|
|
297
312
|
readonly details: () => {
|
|
298
313
|
pathname: string;
|
|
299
314
|
};
|
|
315
|
+
readonly topup: (amount?: number | string) => {
|
|
316
|
+
pathname: string;
|
|
317
|
+
params: {
|
|
318
|
+
amount: string;
|
|
319
|
+
} | undefined;
|
|
320
|
+
};
|
|
321
|
+
};
|
|
322
|
+
readonly addresses: {
|
|
323
|
+
readonly list: () => {
|
|
324
|
+
pathname: string;
|
|
325
|
+
};
|
|
326
|
+
readonly new: (fromAdDraftId?: string) => {
|
|
327
|
+
pathname: string;
|
|
328
|
+
params: {
|
|
329
|
+
fromAdDraftId: string;
|
|
330
|
+
} | undefined;
|
|
331
|
+
};
|
|
332
|
+
readonly edit: (id: number) => {
|
|
333
|
+
pathname: string;
|
|
334
|
+
params: {
|
|
335
|
+
id: string;
|
|
336
|
+
};
|
|
337
|
+
};
|
|
338
|
+
};
|
|
339
|
+
readonly support: {
|
|
340
|
+
readonly tickets: () => {
|
|
341
|
+
pathname: string;
|
|
342
|
+
};
|
|
343
|
+
};
|
|
344
|
+
readonly kyc: {
|
|
345
|
+
readonly details: () => {
|
|
346
|
+
pathname: string;
|
|
347
|
+
};
|
|
348
|
+
readonly fromSettings: () => {
|
|
349
|
+
pathname: string;
|
|
350
|
+
params: {
|
|
351
|
+
source: string;
|
|
352
|
+
};
|
|
353
|
+
};
|
|
354
|
+
};
|
|
355
|
+
readonly company: {
|
|
356
|
+
readonly list: () => {
|
|
357
|
+
pathname: string;
|
|
358
|
+
};
|
|
359
|
+
readonly new: () => {
|
|
360
|
+
pathname: string;
|
|
361
|
+
};
|
|
362
|
+
readonly edit: (id: number | string) => {
|
|
363
|
+
pathname: string;
|
|
364
|
+
params: {
|
|
365
|
+
id: string | number;
|
|
366
|
+
};
|
|
367
|
+
};
|
|
368
|
+
readonly details: (id: number | string) => {
|
|
369
|
+
pathname: string;
|
|
370
|
+
params: {
|
|
371
|
+
id: string | number;
|
|
372
|
+
};
|
|
373
|
+
};
|
|
374
|
+
};
|
|
375
|
+
readonly venue: {
|
|
376
|
+
readonly new: (companyId: number | string) => {
|
|
377
|
+
pathname: string;
|
|
378
|
+
params: {
|
|
379
|
+
company_id: string | number;
|
|
380
|
+
};
|
|
381
|
+
};
|
|
382
|
+
readonly edit: (id: number | string) => {
|
|
383
|
+
pathname: string;
|
|
384
|
+
params: {
|
|
385
|
+
id: string | number;
|
|
386
|
+
};
|
|
387
|
+
};
|
|
388
|
+
readonly details: (id: number | string) => {
|
|
389
|
+
pathname: string;
|
|
390
|
+
params: {
|
|
391
|
+
id: string | number;
|
|
392
|
+
};
|
|
393
|
+
};
|
|
394
|
+
};
|
|
395
|
+
readonly event: {
|
|
396
|
+
readonly new: (venueId: number | string) => {
|
|
397
|
+
pathname: string;
|
|
398
|
+
params: {
|
|
399
|
+
venue_id: string | number;
|
|
400
|
+
};
|
|
401
|
+
};
|
|
402
|
+
readonly edit: (id: number | string) => {
|
|
403
|
+
pathname: string;
|
|
404
|
+
params: {
|
|
405
|
+
id: string | number;
|
|
406
|
+
};
|
|
407
|
+
};
|
|
408
|
+
readonly details: (id: number | string) => {
|
|
409
|
+
pathname: string;
|
|
410
|
+
params: {
|
|
411
|
+
id: string | number;
|
|
412
|
+
};
|
|
413
|
+
};
|
|
300
414
|
};
|
|
301
415
|
};
|
|
302
416
|
export type SharedAppRoutes = typeof APP_ROUTES;
|
|
@@ -36,6 +36,14 @@ exports.APP_ROUTES = {
|
|
|
36
36
|
pathname: "/ad/promotions/history/[ad_id]",
|
|
37
37
|
params: { ad_id: params.id },
|
|
38
38
|
}),
|
|
39
|
+
promotionDetails: (params) => ({
|
|
40
|
+
pathname: "/ad/promotions/details/[id]",
|
|
41
|
+
params: {
|
|
42
|
+
id: String(params.id),
|
|
43
|
+
ad_id: params.ad_id != null ? String(params.ad_id) : undefined,
|
|
44
|
+
promotion: params.data ? JSON.stringify(params.data) : undefined,
|
|
45
|
+
},
|
|
46
|
+
}),
|
|
39
47
|
list: (params) => {
|
|
40
48
|
const filter = JSON.stringify(params);
|
|
41
49
|
if (params === null || params === void 0 ? void 0 : params.subject_type) {
|
|
@@ -80,6 +88,7 @@ exports.APP_ROUTES = {
|
|
|
80
88
|
download: () => ({ pathname: "/system/download-app" }),
|
|
81
89
|
needMobileApp: () => ({ pathname: "/system/need-mobile-app" }),
|
|
82
90
|
noInternet: () => ({ pathname: "/system/no-internet" }),
|
|
91
|
+
savedData: () => ({ pathname: "/system/saved-data" }),
|
|
83
92
|
},
|
|
84
93
|
settings: {
|
|
85
94
|
selectCurrency: () => ({ pathname: "/settings/select-currency" }),
|
|
@@ -132,5 +141,40 @@ exports.APP_ROUTES = {
|
|
|
132
141
|
},
|
|
133
142
|
wallet: {
|
|
134
143
|
details: () => ({ pathname: "/wallet" }),
|
|
144
|
+
topup: (amount) => ({
|
|
145
|
+
pathname: "/wallet/topup",
|
|
146
|
+
params: amount != null ? { amount: String(amount) } : undefined,
|
|
147
|
+
}),
|
|
148
|
+
},
|
|
149
|
+
addresses: {
|
|
150
|
+
list: () => ({ pathname: "/user/addresses" }),
|
|
151
|
+
new: (fromAdDraftId) => ({
|
|
152
|
+
pathname: "/user/addresses/new",
|
|
153
|
+
params: fromAdDraftId ? { fromAdDraftId } : undefined,
|
|
154
|
+
}),
|
|
155
|
+
edit: (id) => ({ pathname: "/user/addresses/[id]", params: { id: String(id) } }),
|
|
156
|
+
},
|
|
157
|
+
support: {
|
|
158
|
+
tickets: () => ({ pathname: "/system/support-tickets" }),
|
|
159
|
+
},
|
|
160
|
+
kyc: {
|
|
161
|
+
details: () => ({ pathname: "/kyc" }),
|
|
162
|
+
fromSettings: () => ({ pathname: "/kyc", params: { source: "settings" } }),
|
|
163
|
+
},
|
|
164
|
+
company: {
|
|
165
|
+
list: () => ({ pathname: "/company/list" }),
|
|
166
|
+
new: () => ({ pathname: "/company/new" }),
|
|
167
|
+
edit: (id) => ({ pathname: "/company/new", params: { id } }),
|
|
168
|
+
details: (id) => ({ pathname: "/company/details/[id]", params: { id } }),
|
|
169
|
+
},
|
|
170
|
+
venue: {
|
|
171
|
+
new: (companyId) => ({ pathname: "/venue/new", params: { company_id: companyId } }),
|
|
172
|
+
edit: (id) => ({ pathname: "/venue/new", params: { id } }),
|
|
173
|
+
details: (id) => ({ pathname: "/venue/details/[id]", params: { id } }),
|
|
174
|
+
},
|
|
175
|
+
event: {
|
|
176
|
+
new: (venueId) => ({ pathname: "/event/new", params: { venue_id: venueId } }),
|
|
177
|
+
edit: (id) => ({ pathname: "/event/new", params: { id } }),
|
|
178
|
+
details: (id) => ({ pathname: "/event/details/[id]", params: { id } }),
|
|
135
179
|
},
|
|
136
180
|
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import type { IAd } from "../../types/ad/Ad";
|
|
3
3
|
import { createAdSchema, saveAdSchema, updateAdSchema } from "../../schema/ad/save-ad.schema";
|
|
4
|
+
import { findAdSchema } from "../../schema/ad/find-ad.schema";
|
|
4
5
|
export type CreateAdDto = z.infer<typeof createAdSchema>;
|
|
5
6
|
export type UpdateAdDto = z.infer<typeof updateAdSchema>;
|
|
6
7
|
export type SaveAdDto = z.infer<typeof saveAdSchema>;
|
|
8
|
+
export type FindAdDto = z.input<typeof findAdSchema>;
|
|
7
9
|
export declare const AdDto: (params: {
|
|
8
10
|
ad: IAd;
|
|
9
11
|
}) => IAd;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Body of `POST api/v1/ads/find-one/:id`. Loading an ad counts a view unless `track_view` is false:
|
|
4
|
+
* only the ad details page should count, not the chat preview, the edit form or promotion screens.
|
|
5
|
+
* The viewer comes from the auth token, never from the body.
|
|
6
|
+
*/
|
|
7
|
+
export declare const findAdSchema: z.ZodObject<{
|
|
8
|
+
track_view: z.ZodDefault<z.ZodBoolean>;
|
|
9
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.findAdSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
/**
|
|
6
|
+
* Body of `POST api/v1/ads/find-one/:id`. Loading an ad counts a view unless `track_view` is false:
|
|
7
|
+
* only the ad details page should count, not the chat preview, the edit form or promotion screens.
|
|
8
|
+
* The viewer comes from the auth token, never from the body.
|
|
9
|
+
*/
|
|
10
|
+
exports.findAdSchema = zod_1.z.object({
|
|
11
|
+
track_view: zod_1.z.boolean().default(true),
|
|
12
|
+
});
|
|
@@ -33,6 +33,14 @@ export const APP_ROUTES = {
|
|
|
33
33
|
pathname: "/ad/promotions/history/[ad_id]",
|
|
34
34
|
params: { ad_id: params.id },
|
|
35
35
|
}),
|
|
36
|
+
promotionDetails: (params) => ({
|
|
37
|
+
pathname: "/ad/promotions/details/[id]",
|
|
38
|
+
params: {
|
|
39
|
+
id: String(params.id),
|
|
40
|
+
ad_id: params.ad_id != null ? String(params.ad_id) : undefined,
|
|
41
|
+
promotion: params.data ? JSON.stringify(params.data) : undefined,
|
|
42
|
+
},
|
|
43
|
+
}),
|
|
36
44
|
list: (params) => {
|
|
37
45
|
const filter = JSON.stringify(params);
|
|
38
46
|
if (params === null || params === void 0 ? void 0 : params.subject_type) {
|
|
@@ -77,6 +85,7 @@ export const APP_ROUTES = {
|
|
|
77
85
|
download: () => ({ pathname: "/system/download-app" }),
|
|
78
86
|
needMobileApp: () => ({ pathname: "/system/need-mobile-app" }),
|
|
79
87
|
noInternet: () => ({ pathname: "/system/no-internet" }),
|
|
88
|
+
savedData: () => ({ pathname: "/system/saved-data" }),
|
|
80
89
|
},
|
|
81
90
|
settings: {
|
|
82
91
|
selectCurrency: () => ({ pathname: "/settings/select-currency" }),
|
|
@@ -129,5 +138,40 @@ export const APP_ROUTES = {
|
|
|
129
138
|
},
|
|
130
139
|
wallet: {
|
|
131
140
|
details: () => ({ pathname: "/wallet" }),
|
|
141
|
+
topup: (amount) => ({
|
|
142
|
+
pathname: "/wallet/topup",
|
|
143
|
+
params: amount != null ? { amount: String(amount) } : undefined,
|
|
144
|
+
}),
|
|
145
|
+
},
|
|
146
|
+
addresses: {
|
|
147
|
+
list: () => ({ pathname: "/user/addresses" }),
|
|
148
|
+
new: (fromAdDraftId) => ({
|
|
149
|
+
pathname: "/user/addresses/new",
|
|
150
|
+
params: fromAdDraftId ? { fromAdDraftId } : undefined,
|
|
151
|
+
}),
|
|
152
|
+
edit: (id) => ({ pathname: "/user/addresses/[id]", params: { id: String(id) } }),
|
|
153
|
+
},
|
|
154
|
+
support: {
|
|
155
|
+
tickets: () => ({ pathname: "/system/support-tickets" }),
|
|
156
|
+
},
|
|
157
|
+
kyc: {
|
|
158
|
+
details: () => ({ pathname: "/kyc" }),
|
|
159
|
+
fromSettings: () => ({ pathname: "/kyc", params: { source: "settings" } }),
|
|
160
|
+
},
|
|
161
|
+
company: {
|
|
162
|
+
list: () => ({ pathname: "/company/list" }),
|
|
163
|
+
new: () => ({ pathname: "/company/new" }),
|
|
164
|
+
edit: (id) => ({ pathname: "/company/new", params: { id } }),
|
|
165
|
+
details: (id) => ({ pathname: "/company/details/[id]", params: { id } }),
|
|
166
|
+
},
|
|
167
|
+
venue: {
|
|
168
|
+
new: (companyId) => ({ pathname: "/venue/new", params: { company_id: companyId } }),
|
|
169
|
+
edit: (id) => ({ pathname: "/venue/new", params: { id } }),
|
|
170
|
+
details: (id) => ({ pathname: "/venue/details/[id]", params: { id } }),
|
|
171
|
+
},
|
|
172
|
+
event: {
|
|
173
|
+
new: (venueId) => ({ pathname: "/event/new", params: { venue_id: venueId } }),
|
|
174
|
+
edit: (id) => ({ pathname: "/event/new", params: { id } }),
|
|
175
|
+
details: (id) => ({ pathname: "/event/details/[id]", params: { id } }),
|
|
132
176
|
},
|
|
133
177
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Body of `POST api/v1/ads/find-one/:id`. Loading an ad counts a view unless `track_view` is false:
|
|
4
|
+
* only the ad details page should count, not the chat preview, the edit form or promotion screens.
|
|
5
|
+
* The viewer comes from the auth token, never from the body.
|
|
6
|
+
*/
|
|
7
|
+
export const findAdSchema = z.object({
|
|
8
|
+
track_view: z.boolean().default(true),
|
|
9
|
+
});
|