@deallony/shared 1.2.50 → 1.2.51
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/dto/addresses/addresses.dto.d.ts +7 -0
- package/dist/cjs/dto/addresses/addresses.dto.js +2 -0
- package/dist/cjs/dto/index.d.ts +1 -0
- package/dist/cjs/dto/index.js +2 -1
- package/dist/cjs/schema/ad/save-ad.schema.d.ts +4 -0
- package/dist/cjs/schema/ad/save-ad.schema.js +1 -0
- package/dist/cjs/schema/addresses/addresses.schema.d.ts +19 -0
- package/dist/cjs/schema/addresses/addresses.schema.js +18 -0
- package/dist/cjs/schema/index.d.ts +1 -0
- package/dist/cjs/schema/index.js +2 -1
- package/dist/cjs/types/ad/Ad.d.ts +1 -0
- package/dist/cjs/types/ad/Ad.js +1 -0
- package/dist/cjs/types/addresses/Address.d.ts +14 -0
- package/dist/cjs/types/addresses/Address.js +2 -0
- package/dist/cjs/types/communication/Chat.d.ts +8 -1
- package/dist/cjs/types/communication/Chat.js +1 -0
- package/dist/cjs/types/index.d.ts +1 -0
- package/dist/cjs/types/index.js +3 -2
- package/dist/esm/dto/addresses/addresses.dto.js +1 -0
- package/dist/esm/dto/index.js +1 -0
- package/dist/esm/schema/ad/save-ad.schema.js +1 -0
- package/dist/esm/schema/addresses/addresses.schema.js +15 -0
- package/dist/esm/schema/index.js +1 -0
- package/dist/esm/types/ad/Ad.js +1 -0
- package/dist/esm/types/addresses/Address.js +1 -0
- package/dist/esm/types/communication/Chat.js +1 -0
- package/dist/esm/types/index.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { z } from "zod";
|
|
2
|
+
import type { createAddressSchema, updateAddressSchema } from "../../schema/addresses/addresses.schema";
|
|
3
|
+
import type { IAddress } from "../../types/addresses/Address";
|
|
4
|
+
export type CreateAddressDto = z.infer<typeof createAddressSchema>;
|
|
5
|
+
export type UpdateAddressDto = z.infer<typeof updateAddressSchema>;
|
|
6
|
+
export type AddressResponse = IAddress;
|
|
7
|
+
export type AddressListResponse = IAddress[];
|
package/dist/cjs/dto/index.d.ts
CHANGED
package/dist/cjs/dto/index.js
CHANGED
|
@@ -33,10 +33,11 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.PAYMENTS = exports.Ai = exports.EVENTS = exports.AD = exports.AdDto = void 0;
|
|
36
|
+
exports.ADDRESSES = exports.PAYMENTS = exports.Ai = exports.EVENTS = exports.AD = exports.AdDto = void 0;
|
|
37
37
|
var Ad_dto_1 = require("./ad/Ad.dto");
|
|
38
38
|
Object.defineProperty(exports, "AdDto", { enumerable: true, get: function () { return Ad_dto_1.AdDto; } });
|
|
39
39
|
exports.AD = __importStar(require("./ad/Ad.dto"));
|
|
40
40
|
exports.EVENTS = __importStar(require("./events"));
|
|
41
41
|
exports.Ai = __importStar(require("./ai/Ai.dto"));
|
|
42
42
|
exports.PAYMENTS = __importStar(require("./payments"));
|
|
43
|
+
exports.ADDRESSES = __importStar(require("./addresses/addresses.dto"));
|
|
@@ -75,6 +75,7 @@ export declare const createAdSchema: z.ZodObject<{
|
|
|
75
75
|
negotiable: z.ZodNullable<z.ZodOptional<z.ZodCoercedBoolean<unknown>>>;
|
|
76
76
|
latitude: z.ZodNullable<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
77
77
|
longitude: z.ZodNullable<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
78
|
+
saved_address_id: z.ZodNullable<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
78
79
|
baseAdminBoundaryId: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodNullable<z.ZodOptional<z.ZodCoercedNumber<unknown>>>>;
|
|
79
80
|
media: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodAny>>>;
|
|
80
81
|
subject_type: z.ZodOptional<z.ZodEnum<{
|
|
@@ -172,6 +173,7 @@ export declare const updateAdSchema: z.ZodObject<{
|
|
|
172
173
|
negotiable: z.ZodNullable<z.ZodOptional<z.ZodCoercedBoolean<unknown>>>;
|
|
173
174
|
latitude: z.ZodNullable<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
174
175
|
longitude: z.ZodNullable<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
176
|
+
saved_address_id: z.ZodNullable<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
175
177
|
baseAdminBoundaryId: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodNullable<z.ZodOptional<z.ZodCoercedNumber<unknown>>>>;
|
|
176
178
|
media: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodAny>>>;
|
|
177
179
|
subject_type: z.ZodOptional<z.ZodEnum<{
|
|
@@ -264,6 +266,7 @@ export declare const saveAdSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
264
266
|
negotiable: z.ZodNullable<z.ZodOptional<z.ZodCoercedBoolean<unknown>>>;
|
|
265
267
|
latitude: z.ZodNullable<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
266
268
|
longitude: z.ZodNullable<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
269
|
+
saved_address_id: z.ZodNullable<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
267
270
|
baseAdminBoundaryId: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodNullable<z.ZodOptional<z.ZodCoercedNumber<unknown>>>>;
|
|
268
271
|
media: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodAny>>>;
|
|
269
272
|
subject_type: z.ZodOptional<z.ZodEnum<{
|
|
@@ -360,6 +363,7 @@ export declare const saveAdSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
360
363
|
negotiable: z.ZodNullable<z.ZodOptional<z.ZodCoercedBoolean<unknown>>>;
|
|
361
364
|
latitude: z.ZodNullable<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
362
365
|
longitude: z.ZodNullable<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
366
|
+
saved_address_id: z.ZodNullable<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
363
367
|
baseAdminBoundaryId: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodNullable<z.ZodOptional<z.ZodCoercedNumber<unknown>>>>;
|
|
364
368
|
media: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodAny>>>;
|
|
365
369
|
subject_type: z.ZodOptional<z.ZodEnum<{
|
|
@@ -140,6 +140,7 @@ const baseAdCommon = zod_1.z.object({
|
|
|
140
140
|
negotiable: zod_1.z.coerce.boolean().optional().nullable(),
|
|
141
141
|
latitude: zod_1.z.coerce.number().optional().nullable(),
|
|
142
142
|
longitude: zod_1.z.coerce.number().optional().nullable(),
|
|
143
|
+
saved_address_id: zod_1.z.coerce.number().int().positive().optional().nullable(),
|
|
143
144
|
baseAdminBoundaryId: zod_1.z.preprocess((value) => {
|
|
144
145
|
if (value === 0 || value === "0")
|
|
145
146
|
return undefined;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const createAddressSchema: z.ZodObject<{
|
|
3
|
+
label: z.ZodString;
|
|
4
|
+
location_description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
5
|
+
formatted_address: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
6
|
+
latitude: z.ZodCoercedNumber<unknown>;
|
|
7
|
+
longitude: z.ZodCoercedNumber<unknown>;
|
|
8
|
+
admin_boundary_id: z.ZodCoercedNumber<unknown>;
|
|
9
|
+
is_default: z.ZodOptional<z.ZodBoolean>;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
export declare const updateAddressSchema: z.ZodObject<{
|
|
12
|
+
label: z.ZodOptional<z.ZodString>;
|
|
13
|
+
location_description: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
14
|
+
formatted_address: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
15
|
+
latitude: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
16
|
+
longitude: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
17
|
+
admin_boundary_id: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
18
|
+
is_default: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
|
|
19
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updateAddressSchema = exports.createAddressSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.createAddressSchema = zod_1.z.object({
|
|
6
|
+
label: zod_1.z.string().trim().min(1).max(100),
|
|
7
|
+
location_description: zod_1.z.string().trim().max(500).nullable().optional(),
|
|
8
|
+
formatted_address: zod_1.z.string().trim().max(1000).nullable().optional(),
|
|
9
|
+
latitude: zod_1.z.coerce.number().finite().min(-90).max(90),
|
|
10
|
+
longitude: zod_1.z.coerce.number().finite().min(-180).max(180),
|
|
11
|
+
admin_boundary_id: zod_1.z.coerce.number().int().positive(),
|
|
12
|
+
is_default: zod_1.z.boolean().optional(),
|
|
13
|
+
});
|
|
14
|
+
exports.updateAddressSchema = exports.createAddressSchema
|
|
15
|
+
.partial()
|
|
16
|
+
.refine((value) => Object.keys(value).length > 0, {
|
|
17
|
+
message: "At least one field is required",
|
|
18
|
+
});
|
package/dist/cjs/schema/index.js
CHANGED
|
@@ -33,10 +33,11 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.COMMUNICATION = exports.PAYMENTS = exports.EVENTS = exports.COMMON = exports.AI = exports.AD = void 0;
|
|
36
|
+
exports.ADDRESSES = exports.COMMUNICATION = exports.PAYMENTS = exports.EVENTS = exports.COMMON = exports.AI = exports.AD = void 0;
|
|
37
37
|
exports.AD = __importStar(require("./ad"));
|
|
38
38
|
exports.AI = __importStar(require("./ai"));
|
|
39
39
|
exports.COMMON = __importStar(require("./common"));
|
|
40
40
|
exports.EVENTS = __importStar(require("./events"));
|
|
41
41
|
exports.PAYMENTS = __importStar(require("./payments"));
|
|
42
42
|
exports.COMMUNICATION = __importStar(require("./communication"));
|
|
43
|
+
exports.ADDRESSES = __importStar(require("./addresses/addresses.schema"));
|
package/dist/cjs/types/ad/Ad.js
CHANGED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** Reusable, private address owned by a user. */
|
|
2
|
+
export interface IAddress {
|
|
3
|
+
id: number;
|
|
4
|
+
user_id: number;
|
|
5
|
+
label: string;
|
|
6
|
+
location_description: string | null;
|
|
7
|
+
formatted_address: string | null;
|
|
8
|
+
latitude: number;
|
|
9
|
+
longitude: number;
|
|
10
|
+
admin_boundary_id: number;
|
|
11
|
+
is_default: boolean;
|
|
12
|
+
created_at: string;
|
|
13
|
+
updated_at: string;
|
|
14
|
+
}
|
|
@@ -40,9 +40,16 @@ export type IChatMessage = {
|
|
|
40
40
|
};
|
|
41
41
|
export declare enum MessageTypeEnum {
|
|
42
42
|
TEXT = 1,
|
|
43
|
-
PRICE_OFFER = 2
|
|
43
|
+
PRICE_OFFER = 2,
|
|
44
|
+
CONTACT_INVITATION = 3
|
|
44
45
|
}
|
|
45
46
|
export { MessageTypeEnum as MessageTypeType };
|
|
47
|
+
export type ContactInvitationPayload = {
|
|
48
|
+
version: 1;
|
|
49
|
+
phone_e164: string;
|
|
50
|
+
can_call: boolean;
|
|
51
|
+
can_whatsapp: boolean;
|
|
52
|
+
};
|
|
46
53
|
export type SendMessageDto = {
|
|
47
54
|
chat_room_id: number;
|
|
48
55
|
requester_id: number;
|
|
@@ -5,4 +5,5 @@ var MessageTypeEnum;
|
|
|
5
5
|
(function (MessageTypeEnum) {
|
|
6
6
|
MessageTypeEnum[MessageTypeEnum["TEXT"] = 1] = "TEXT";
|
|
7
7
|
MessageTypeEnum[MessageTypeEnum["PRICE_OFFER"] = 2] = "PRICE_OFFER";
|
|
8
|
+
MessageTypeEnum[MessageTypeEnum["CONTACT_INVITATION"] = 3] = "CONTACT_INVITATION";
|
|
8
9
|
})(MessageTypeEnum || (exports.MessageTypeType = exports.MessageTypeEnum = MessageTypeEnum = {}));
|
|
@@ -6,6 +6,7 @@ export * as Config from "./common/Config";
|
|
|
6
6
|
export * as FilterParams from "./common/FilterParams";
|
|
7
7
|
export * as Ad from "./ad/Ad";
|
|
8
8
|
export * as AdLocation from "./ad/AdLocation";
|
|
9
|
+
export * as Addresses from "./addresses/Address";
|
|
9
10
|
export * as AdPromotion from "./ad/AdPromotion";
|
|
10
11
|
export * as Motor from "./motor/Motor";
|
|
11
12
|
export * as MotorTrim from "./motor/MotorTrim";
|
package/dist/cjs/types/index.js
CHANGED
|
@@ -36,8 +36,8 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
36
36
|
};
|
|
37
37
|
})();
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.
|
|
40
|
-
exports.Payment = exports.Analysis = exports.Google = exports.Kyc = exports.SocialMediaProfile = exports.SocialMediaPlatform = exports.Image = exports.Media = exports.File = exports.NotificationToken = exports.MessageTemplate = exports.Device = exports.Chat = exports.AppStartScreen = exports.MetaData = void 0;
|
|
39
|
+
exports.PotentialUser = exports.Loyalty = exports.Favorite = exports.Wallet = exports.Permission = exports.Role = exports.User = exports.EventVenue = exports.EventWedding = exports.EventTimeline = exports.EventRsvp = exports.Event = exports.District = exports.City = exports.AdminBoundary = exports.WorkType = exports.UsedProductCondition = exports.UsedProductAge = exports.Unit = exports.Transmission = exports.RegionalSpec = exports.PublisherType = exports.PropertyStatus = exports.PriceType = exports.OfferType = exports.LicenseType = exports.FuelType = exports.Feature = exports.Facility = exports.Currency = exports.Color = exports.CategoryWorkType = exports.Category = exports.CarBody = exports.UsedProduct = exports.Service = exports.PropertySubType = exports.Property = exports.MotorTrim = exports.Motor = exports.AdPromotion = exports.Addresses = exports.AdLocation = exports.Ad = exports.FilterParams = exports.Config = exports.AccessType = exports.Status = exports.Response = exports.LocalizedName = void 0;
|
|
40
|
+
exports.Payment = exports.Analysis = exports.Google = exports.Kyc = exports.SocialMediaProfile = exports.SocialMediaPlatform = exports.Image = exports.Media = exports.File = exports.NotificationToken = exports.MessageTemplate = exports.Device = exports.Chat = exports.AppStartScreen = exports.MetaData = exports.Company = void 0;
|
|
41
41
|
// common
|
|
42
42
|
exports.LocalizedName = __importStar(require("./common/LocalizedName"));
|
|
43
43
|
exports.Response = __importStar(require("./common/Response"));
|
|
@@ -48,6 +48,7 @@ exports.FilterParams = __importStar(require("./common/FilterParams"));
|
|
|
48
48
|
// listings
|
|
49
49
|
exports.Ad = __importStar(require("./ad/Ad"));
|
|
50
50
|
exports.AdLocation = __importStar(require("./ad/AdLocation"));
|
|
51
|
+
exports.Addresses = __importStar(require("./addresses/Address"));
|
|
51
52
|
exports.AdPromotion = __importStar(require("./ad/AdPromotion"));
|
|
52
53
|
exports.Motor = __importStar(require("./motor/Motor"));
|
|
53
54
|
exports.MotorTrim = __importStar(require("./motor/MotorTrim"));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/esm/dto/index.js
CHANGED
|
@@ -137,6 +137,7 @@ const baseAdCommon = z.object({
|
|
|
137
137
|
negotiable: z.coerce.boolean().optional().nullable(),
|
|
138
138
|
latitude: z.coerce.number().optional().nullable(),
|
|
139
139
|
longitude: z.coerce.number().optional().nullable(),
|
|
140
|
+
saved_address_id: z.coerce.number().int().positive().optional().nullable(),
|
|
140
141
|
baseAdminBoundaryId: z.preprocess((value) => {
|
|
141
142
|
if (value === 0 || value === "0")
|
|
142
143
|
return undefined;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const createAddressSchema = z.object({
|
|
3
|
+
label: z.string().trim().min(1).max(100),
|
|
4
|
+
location_description: z.string().trim().max(500).nullable().optional(),
|
|
5
|
+
formatted_address: z.string().trim().max(1000).nullable().optional(),
|
|
6
|
+
latitude: z.coerce.number().finite().min(-90).max(90),
|
|
7
|
+
longitude: z.coerce.number().finite().min(-180).max(180),
|
|
8
|
+
admin_boundary_id: z.coerce.number().int().positive(),
|
|
9
|
+
is_default: z.boolean().optional(),
|
|
10
|
+
});
|
|
11
|
+
export const updateAddressSchema = createAddressSchema
|
|
12
|
+
.partial()
|
|
13
|
+
.refine((value) => Object.keys(value).length > 0, {
|
|
14
|
+
message: "At least one field is required",
|
|
15
|
+
});
|
package/dist/esm/schema/index.js
CHANGED
package/dist/esm/types/ad/Ad.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -2,5 +2,6 @@ export var MessageTypeEnum;
|
|
|
2
2
|
(function (MessageTypeEnum) {
|
|
3
3
|
MessageTypeEnum[MessageTypeEnum["TEXT"] = 1] = "TEXT";
|
|
4
4
|
MessageTypeEnum[MessageTypeEnum["PRICE_OFFER"] = 2] = "PRICE_OFFER";
|
|
5
|
+
MessageTypeEnum[MessageTypeEnum["CONTACT_INVITATION"] = 3] = "CONTACT_INVITATION";
|
|
5
6
|
})(MessageTypeEnum || (MessageTypeEnum = {}));
|
|
6
7
|
export { MessageTypeEnum as MessageTypeType };
|
package/dist/esm/types/index.js
CHANGED
|
@@ -11,6 +11,7 @@ export * as FilterParams from "./common/FilterParams.js";
|
|
|
11
11
|
// listings
|
|
12
12
|
export * as Ad from "./ad/Ad.js";
|
|
13
13
|
export * as AdLocation from "./ad/AdLocation.js";
|
|
14
|
+
export * as Addresses from "./addresses/Address.js";
|
|
14
15
|
export * as AdPromotion from "./ad/AdPromotion.js";
|
|
15
16
|
export * as Motor from "./motor/Motor.js";
|
|
16
17
|
export * as MotorTrim from "./motor/MotorTrim.js";
|