hububb-saas-shared 1.2.57 → 1.2.59
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/helpers/chat-thread.d.ts +17 -0
- package/dist/helpers/chat-thread.js +36 -0
- package/dist/helpers/index.d.ts +1 -0
- package/dist/helpers/index.js +6 -1
- package/dist/schemas/thread/index.d.ts +31 -0
- package/dist/schemas/thread/index.js +15 -1
- package/package.json +1 -1
- package/dist/schemas/api-key/index.d.ts +0 -81
- package/dist/schemas/api-key/index.js +0 -33
- package/dist/schemas/external-sync-request/index.d.ts +0 -32
- package/dist/schemas/external-sync-request/index.js +0 -15
- package/dist/schemas/service-availability/index.d.ts +0 -25
- package/dist/schemas/service-availability/index.js +0 -13
- package/dist/schemas/service-worker-payout/index.d.ts +0 -88
- package/dist/schemas/service-worker-payout/index.js +0 -36
- package/dist/schemas/webhook/index.d.ts +0 -104
- package/dist/schemas/webhook/index.js +0 -41
- package/dist/types/api-key/index.d.ts +0 -10
- package/dist/types/api-key/index.js +0 -2
- package/dist/types/external-sync-request/index.d.ts +0 -4
- package/dist/types/external-sync-request/index.js +0 -2
- package/dist/types/service-availability/index.d.ts +0 -6
- package/dist/types/service-availability/index.js +0 -2
- package/dist/types/service-worker-payout/index.d.ts +0 -17
- package/dist/types/service-worker-payout/index.js +0 -2
- package/dist/types/webhook/index.d.ts +0 -15
- package/dist/types/webhook/index.js +0 -2
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const AIRBNB_SUPPORT_THREAD_TITLE = "Airbnb Support";
|
|
2
|
+
export declare function isAirbnbSupportThreadTitle(title?: string | null): boolean;
|
|
3
|
+
/** Airbnb ↔ host support threads from Channex (not guest inquiries). */
|
|
4
|
+
export declare function isAirbnbSupportThread(params: {
|
|
5
|
+
externalSource?: string | null;
|
|
6
|
+
title?: string | null;
|
|
7
|
+
bookingId?: string | null;
|
|
8
|
+
isAirbnbSupportThread?: boolean | null;
|
|
9
|
+
}): boolean;
|
|
10
|
+
/** Whether a Channex Airbnb thread is a pre-booking guest inquiry (not Airbnb Support). */
|
|
11
|
+
export declare function resolveAirbnbInquiryThread(params: {
|
|
12
|
+
externalSource?: string | null;
|
|
13
|
+
bookingId?: string | null;
|
|
14
|
+
title?: string | null;
|
|
15
|
+
hasInquirySystemMessage?: boolean;
|
|
16
|
+
existingIsInquiryThread?: boolean;
|
|
17
|
+
}): boolean;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AIRBNB_SUPPORT_THREAD_TITLE = void 0;
|
|
4
|
+
exports.isAirbnbSupportThreadTitle = isAirbnbSupportThreadTitle;
|
|
5
|
+
exports.isAirbnbSupportThread = isAirbnbSupportThread;
|
|
6
|
+
exports.resolveAirbnbInquiryThread = resolveAirbnbInquiryThread;
|
|
7
|
+
exports.AIRBNB_SUPPORT_THREAD_TITLE = "Airbnb Support";
|
|
8
|
+
function isAirbnbSupportThreadTitle(title) {
|
|
9
|
+
if (!(title === null || title === void 0 ? void 0 : title.trim()))
|
|
10
|
+
return false;
|
|
11
|
+
return title.trim().toLowerCase() === exports.AIRBNB_SUPPORT_THREAD_TITLE.toLowerCase();
|
|
12
|
+
}
|
|
13
|
+
/** Airbnb ↔ host support threads from Channex (not guest inquiries). */
|
|
14
|
+
function isAirbnbSupportThread(params) {
|
|
15
|
+
var _a;
|
|
16
|
+
if (params.isAirbnbSupportThread)
|
|
17
|
+
return true;
|
|
18
|
+
if (((_a = params.externalSource) === null || _a === void 0 ? void 0 : _a.toLowerCase()) !== "airbnb")
|
|
19
|
+
return false;
|
|
20
|
+
if (params.bookingId)
|
|
21
|
+
return false;
|
|
22
|
+
return isAirbnbSupportThreadTitle(params.title);
|
|
23
|
+
}
|
|
24
|
+
/** Whether a Channex Airbnb thread is a pre-booking guest inquiry (not Airbnb Support). */
|
|
25
|
+
function resolveAirbnbInquiryThread(params) {
|
|
26
|
+
var _a;
|
|
27
|
+
if (params.bookingId)
|
|
28
|
+
return false;
|
|
29
|
+
if (((_a = params.externalSource) === null || _a === void 0 ? void 0 : _a.toLowerCase()) !== "airbnb")
|
|
30
|
+
return false;
|
|
31
|
+
if (isAirbnbSupportThread(params))
|
|
32
|
+
return false;
|
|
33
|
+
if (params.hasInquirySystemMessage)
|
|
34
|
+
return true;
|
|
35
|
+
return !!params.existingIsInquiryThread;
|
|
36
|
+
}
|
package/dist/helpers/index.d.ts
CHANGED
|
@@ -9,3 +9,4 @@ export interface Timestamp {
|
|
|
9
9
|
}
|
|
10
10
|
export declare const firestoreTimestampSchema: z.ZodType<Timestamp>;
|
|
11
11
|
export { getReservationXeroSyncView, type ReservationXeroSyncView, type XeroSyncStatus, } from "./reservation-xero";
|
|
12
|
+
export { AIRBNB_SUPPORT_THREAD_TITLE, isAirbnbSupportThread, isAirbnbSupportThreadTitle, resolveAirbnbInquiryThread, } from "./chat-thread";
|
package/dist/helpers/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getReservationXeroSyncView = exports.firestoreTimestampSchema = void 0;
|
|
3
|
+
exports.resolveAirbnbInquiryThread = exports.isAirbnbSupportThreadTitle = exports.isAirbnbSupportThread = exports.AIRBNB_SUPPORT_THREAD_TITLE = exports.getReservationXeroSyncView = exports.firestoreTimestampSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
// Create a complete type-safe timestamp schema
|
|
6
6
|
exports.firestoreTimestampSchema = zod_1.z
|
|
@@ -15,3 +15,8 @@ exports.firestoreTimestampSchema = zod_1.z
|
|
|
15
15
|
.refine((val) => val && typeof val.toDate === "function", "Must be a valid Timestamp");
|
|
16
16
|
var reservation_xero_1 = require("./reservation-xero");
|
|
17
17
|
Object.defineProperty(exports, "getReservationXeroSyncView", { enumerable: true, get: function () { return reservation_xero_1.getReservationXeroSyncView; } });
|
|
18
|
+
var chat_thread_1 = require("./chat-thread");
|
|
19
|
+
Object.defineProperty(exports, "AIRBNB_SUPPORT_THREAD_TITLE", { enumerable: true, get: function () { return chat_thread_1.AIRBNB_SUPPORT_THREAD_TITLE; } });
|
|
20
|
+
Object.defineProperty(exports, "isAirbnbSupportThread", { enumerable: true, get: function () { return chat_thread_1.isAirbnbSupportThread; } });
|
|
21
|
+
Object.defineProperty(exports, "isAirbnbSupportThreadTitle", { enumerable: true, get: function () { return chat_thread_1.isAirbnbSupportThreadTitle; } });
|
|
22
|
+
Object.defineProperty(exports, "resolveAirbnbInquiryThread", { enumerable: true, get: function () { return chat_thread_1.resolveAirbnbInquiryThread; } });
|
|
@@ -1420,6 +1420,7 @@ export declare const ChatThreadSchema: z.ZodObject<{
|
|
|
1420
1420
|
propertyNickname?: string | undefined;
|
|
1421
1421
|
}>>;
|
|
1422
1422
|
isInquiryThread: z.ZodOptional<z.ZodBoolean>;
|
|
1423
|
+
isAirbnbSupportThread: z.ZodOptional<z.ZodBoolean>;
|
|
1423
1424
|
whatsappTemplateSent: z.ZodOptional<z.ZodBoolean>;
|
|
1424
1425
|
whatsappUserReplied: z.ZodOptional<z.ZodBoolean>;
|
|
1425
1426
|
lastWhatsappMessageSentAt: z.ZodOptional<z.ZodType<import("../../helpers").Timestamp, z.ZodTypeDef, import("../../helpers").Timestamp>>;
|
|
@@ -1530,6 +1531,22 @@ export declare const ChatThreadSchema: z.ZodObject<{
|
|
|
1530
1531
|
propertyTitle: z.ZodOptional<z.ZodString>;
|
|
1531
1532
|
reservationStatus: z.ZodOptional<z.ZodString>;
|
|
1532
1533
|
blockAIResponses: z.ZodOptional<z.ZodBoolean>;
|
|
1534
|
+
sentiment: z.ZodOptional<z.ZodObject<{
|
|
1535
|
+
label: z.ZodUnion<[z.ZodLiteral<"positive">, z.ZodLiteral<"neutral">, z.ZodLiteral<"negative">]>;
|
|
1536
|
+
score: z.ZodNumber;
|
|
1537
|
+
messageId: z.ZodOptional<z.ZodString>;
|
|
1538
|
+
updatedAt: z.ZodType<import("../../helpers").Timestamp, z.ZodTypeDef, import("../../helpers").Timestamp>;
|
|
1539
|
+
}, "strip", z.ZodTypeAny, {
|
|
1540
|
+
label: "positive" | "neutral" | "negative";
|
|
1541
|
+
updatedAt: import("../../helpers").Timestamp;
|
|
1542
|
+
score: number;
|
|
1543
|
+
messageId?: string | undefined;
|
|
1544
|
+
}, {
|
|
1545
|
+
label: "positive" | "neutral" | "negative";
|
|
1546
|
+
updatedAt: import("../../helpers").Timestamp;
|
|
1547
|
+
score: number;
|
|
1548
|
+
messageId?: string | undefined;
|
|
1549
|
+
}>>;
|
|
1533
1550
|
}, "strip", z.ZodTypeAny, {
|
|
1534
1551
|
type: "ONE_TO_ONE" | "GROUP" | "OPERATIONS_GROUP" | "OPERATIONS_ONE_TO_ONE";
|
|
1535
1552
|
createdAt: import("../../helpers").Timestamp;
|
|
@@ -1718,6 +1735,7 @@ export declare const ChatThreadSchema: z.ZodObject<{
|
|
|
1718
1735
|
propertyNickname?: string | undefined;
|
|
1719
1736
|
} | undefined;
|
|
1720
1737
|
isInquiryThread?: boolean | undefined;
|
|
1738
|
+
isAirbnbSupportThread?: boolean | undefined;
|
|
1721
1739
|
whatsappTemplateSent?: boolean | undefined;
|
|
1722
1740
|
whatsappUserReplied?: boolean | undefined;
|
|
1723
1741
|
lastWhatsappMessageSentAt?: import("../../helpers").Timestamp | undefined;
|
|
@@ -1733,6 +1751,12 @@ export declare const ChatThreadSchema: z.ZodObject<{
|
|
|
1733
1751
|
propertyTitle?: string | undefined;
|
|
1734
1752
|
reservationStatus?: string | undefined;
|
|
1735
1753
|
blockAIResponses?: boolean | undefined;
|
|
1754
|
+
sentiment?: {
|
|
1755
|
+
label: "positive" | "neutral" | "negative";
|
|
1756
|
+
updatedAt: import("../../helpers").Timestamp;
|
|
1757
|
+
score: number;
|
|
1758
|
+
messageId?: string | undefined;
|
|
1759
|
+
} | undefined;
|
|
1736
1760
|
}, {
|
|
1737
1761
|
type: "ONE_TO_ONE" | "GROUP" | "OPERATIONS_GROUP" | "OPERATIONS_ONE_TO_ONE";
|
|
1738
1762
|
createdAt: import("../../helpers").Timestamp;
|
|
@@ -1921,6 +1945,7 @@ export declare const ChatThreadSchema: z.ZodObject<{
|
|
|
1921
1945
|
propertyNickname?: string | undefined;
|
|
1922
1946
|
} | undefined;
|
|
1923
1947
|
isInquiryThread?: boolean | undefined;
|
|
1948
|
+
isAirbnbSupportThread?: boolean | undefined;
|
|
1924
1949
|
whatsappTemplateSent?: boolean | undefined;
|
|
1925
1950
|
whatsappUserReplied?: boolean | undefined;
|
|
1926
1951
|
lastWhatsappMessageSentAt?: import("../../helpers").Timestamp | undefined;
|
|
@@ -1936,6 +1961,12 @@ export declare const ChatThreadSchema: z.ZodObject<{
|
|
|
1936
1961
|
propertyTitle?: string | undefined;
|
|
1937
1962
|
reservationStatus?: string | undefined;
|
|
1938
1963
|
blockAIResponses?: boolean | undefined;
|
|
1964
|
+
sentiment?: {
|
|
1965
|
+
label: "positive" | "neutral" | "negative";
|
|
1966
|
+
updatedAt: import("../../helpers").Timestamp;
|
|
1967
|
+
score: number;
|
|
1968
|
+
messageId?: string | undefined;
|
|
1969
|
+
} | undefined;
|
|
1939
1970
|
}>;
|
|
1940
1971
|
export declare const MessageAutomationTemplateSchema: z.ZodObject<{
|
|
1941
1972
|
id: z.ZodOptional<z.ZodString>;
|
|
@@ -100,6 +100,7 @@ exports.ChatThreadSchema = (0, zod_1.object)({
|
|
|
100
100
|
property: (0, zod_1.optional)(property_1.propertySchema),
|
|
101
101
|
})),
|
|
102
102
|
isInquiryThread: (0, zod_1.optional)((0, zod_1.boolean)()),
|
|
103
|
+
isAirbnbSupportThread: (0, zod_1.optional)((0, zod_1.boolean)()),
|
|
103
104
|
whatsappTemplateSent: (0, zod_1.optional)((0, zod_1.boolean)()),
|
|
104
105
|
whatsappUserReplied: (0, zod_1.optional)((0, zod_1.boolean)()),
|
|
105
106
|
lastWhatsappMessageSentAt: (0, zod_1.optional)(helpers_1.firestoreTimestampSchema),
|
|
@@ -126,7 +127,20 @@ exports.ChatThreadSchema = (0, zod_1.object)({
|
|
|
126
127
|
propertyImage: (0, zod_1.optional)((0, zod_1.string)()),
|
|
127
128
|
propertyTitle: (0, zod_1.optional)((0, zod_1.string)()),
|
|
128
129
|
reservationStatus: (0, zod_1.optional)((0, zod_1.string)()),
|
|
129
|
-
blockAIResponses: (0, zod_1.optional)((0, zod_1.boolean)())
|
|
130
|
+
blockAIResponses: (0, zod_1.optional)((0, zod_1.boolean)()),
|
|
131
|
+
// Live guest-mood signal. Written by the API SentimentService each time a
|
|
132
|
+
// guest message arrives (latest-message model). Absent on threads scored
|
|
133
|
+
// before the feature shipped — treat missing as "unknown", not neutral.
|
|
134
|
+
sentiment: (0, zod_1.optional)((0, zod_1.object)({
|
|
135
|
+
label: (0, zod_1.union)([
|
|
136
|
+
(0, zod_1.literal)("positive"),
|
|
137
|
+
(0, zod_1.literal)("neutral"),
|
|
138
|
+
(0, zod_1.literal)("negative"),
|
|
139
|
+
]),
|
|
140
|
+
score: (0, zod_1.number)(), // -1 (very negative) .. 1 (very positive)
|
|
141
|
+
messageId: (0, zod_1.optional)((0, zod_1.string)()), // guest message that produced this
|
|
142
|
+
updatedAt: helpers_1.firestoreTimestampSchema,
|
|
143
|
+
})),
|
|
130
144
|
});
|
|
131
145
|
exports.MessageAutomationTemplateSchema = (0, zod_1.object)({
|
|
132
146
|
id: (0, zod_1.optional)((0, zod_1.string)()),
|
package/package.json
CHANGED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { ApiKeyStatus } from "../../types/enums";
|
|
2
|
-
export declare const apiKeySchema: import("zod").ZodObject<{
|
|
3
|
-
id: import("zod").ZodString;
|
|
4
|
-
name: import("zod").ZodString;
|
|
5
|
-
prefix: import("zod").ZodString;
|
|
6
|
-
keyHash: import("zod").ZodString;
|
|
7
|
-
email: import("zod").ZodString;
|
|
8
|
-
userId: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
9
|
-
scopes: import("zod").ZodArray<import("zod").ZodString, "many">;
|
|
10
|
-
status: import("zod").ZodNativeEnum<typeof ApiKeyStatus>;
|
|
11
|
-
expiresAt: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodDate>>;
|
|
12
|
-
lastUsedAt: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodDate>>;
|
|
13
|
-
revokedAt: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodDate>>;
|
|
14
|
-
revokedBy: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
15
|
-
createdBy: import("zod").ZodString;
|
|
16
|
-
createdAt: import("zod").ZodDate;
|
|
17
|
-
updatedAt: import("zod").ZodDate;
|
|
18
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
19
|
-
name: string;
|
|
20
|
-
id: string;
|
|
21
|
-
prefix: string;
|
|
22
|
-
email: string;
|
|
23
|
-
status: ApiKeyStatus;
|
|
24
|
-
createdAt: Date;
|
|
25
|
-
updatedAt: Date;
|
|
26
|
-
createdBy: string;
|
|
27
|
-
keyHash: string;
|
|
28
|
-
scopes: string[];
|
|
29
|
-
userId?: string | null | undefined;
|
|
30
|
-
expiresAt?: Date | null | undefined;
|
|
31
|
-
lastUsedAt?: Date | null | undefined;
|
|
32
|
-
revokedAt?: Date | null | undefined;
|
|
33
|
-
revokedBy?: string | null | undefined;
|
|
34
|
-
}, {
|
|
35
|
-
name: string;
|
|
36
|
-
id: string;
|
|
37
|
-
prefix: string;
|
|
38
|
-
email: string;
|
|
39
|
-
status: ApiKeyStatus;
|
|
40
|
-
createdAt: Date;
|
|
41
|
-
updatedAt: Date;
|
|
42
|
-
createdBy: string;
|
|
43
|
-
keyHash: string;
|
|
44
|
-
scopes: string[];
|
|
45
|
-
userId?: string | null | undefined;
|
|
46
|
-
expiresAt?: Date | null | undefined;
|
|
47
|
-
lastUsedAt?: Date | null | undefined;
|
|
48
|
-
revokedAt?: Date | null | undefined;
|
|
49
|
-
revokedBy?: string | null | undefined;
|
|
50
|
-
}>;
|
|
51
|
-
export declare const apiKeyUsageLogSchema: import("zod").ZodObject<{
|
|
52
|
-
id: import("zod").ZodString;
|
|
53
|
-
apiKeyId: import("zod").ZodString;
|
|
54
|
-
endpoint: import("zod").ZodString;
|
|
55
|
-
method: import("zod").ZodString;
|
|
56
|
-
statusCode: import("zod").ZodNumber;
|
|
57
|
-
responseTime: import("zod").ZodNumber;
|
|
58
|
-
ipAddress: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
59
|
-
userAgent: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
60
|
-
createdAt: import("zod").ZodDate;
|
|
61
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
62
|
-
id: string;
|
|
63
|
-
statusCode: number;
|
|
64
|
-
method: string;
|
|
65
|
-
createdAt: Date;
|
|
66
|
-
apiKeyId: string;
|
|
67
|
-
endpoint: string;
|
|
68
|
-
responseTime: number;
|
|
69
|
-
ipAddress?: string | null | undefined;
|
|
70
|
-
userAgent?: string | null | undefined;
|
|
71
|
-
}, {
|
|
72
|
-
id: string;
|
|
73
|
-
statusCode: number;
|
|
74
|
-
method: string;
|
|
75
|
-
createdAt: Date;
|
|
76
|
-
apiKeyId: string;
|
|
77
|
-
endpoint: string;
|
|
78
|
-
responseTime: number;
|
|
79
|
-
ipAddress?: string | null | undefined;
|
|
80
|
-
userAgent?: string | null | undefined;
|
|
81
|
-
}>;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.apiKeyUsageLogSchema = exports.apiKeySchema = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const enums_1 = require("../../types/enums");
|
|
6
|
-
exports.apiKeySchema = (0, zod_1.object)({
|
|
7
|
-
id: (0, zod_1.string)(),
|
|
8
|
-
name: (0, zod_1.string)(),
|
|
9
|
-
prefix: (0, zod_1.string)(),
|
|
10
|
-
keyHash: (0, zod_1.string)(),
|
|
11
|
-
email: (0, zod_1.string)(),
|
|
12
|
-
userId: (0, zod_1.string)().nullish(),
|
|
13
|
-
scopes: (0, zod_1.string)().array(),
|
|
14
|
-
status: (0, zod_1.nativeEnum)(enums_1.ApiKeyStatus),
|
|
15
|
-
expiresAt: (0, zod_1.date)().nullish(),
|
|
16
|
-
lastUsedAt: (0, zod_1.date)().nullish(),
|
|
17
|
-
revokedAt: (0, zod_1.date)().nullish(),
|
|
18
|
-
revokedBy: (0, zod_1.string)().nullish(),
|
|
19
|
-
createdBy: (0, zod_1.string)(),
|
|
20
|
-
createdAt: (0, zod_1.date)(),
|
|
21
|
-
updatedAt: (0, zod_1.date)(),
|
|
22
|
-
});
|
|
23
|
-
exports.apiKeyUsageLogSchema = (0, zod_1.object)({
|
|
24
|
-
id: (0, zod_1.string)(),
|
|
25
|
-
apiKeyId: (0, zod_1.string)(),
|
|
26
|
-
endpoint: (0, zod_1.string)(),
|
|
27
|
-
method: (0, zod_1.string)(),
|
|
28
|
-
statusCode: (0, zod_1.number)().int(),
|
|
29
|
-
responseTime: (0, zod_1.number)().int(),
|
|
30
|
-
ipAddress: (0, zod_1.string)().nullish(),
|
|
31
|
-
userAgent: (0, zod_1.string)().nullish(),
|
|
32
|
-
createdAt: (0, zod_1.date)(),
|
|
33
|
-
});
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export declare const externalSyncRequestSchema: z.ZodObject<{
|
|
3
|
-
id: z.ZodString;
|
|
4
|
-
userId: z.ZodString;
|
|
5
|
-
apiKeyId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
6
|
-
idempotencyKey: z.ZodString;
|
|
7
|
-
method: z.ZodString;
|
|
8
|
-
endpoint: z.ZodString;
|
|
9
|
-
responseStatus: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
10
|
-
responseBody: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
|
|
11
|
-
createdAt: z.ZodDate;
|
|
12
|
-
}, "strip", z.ZodTypeAny, {
|
|
13
|
-
id: string;
|
|
14
|
-
method: string;
|
|
15
|
-
createdAt: Date;
|
|
16
|
-
userId: string;
|
|
17
|
-
endpoint: string;
|
|
18
|
-
idempotencyKey: string;
|
|
19
|
-
apiKeyId?: string | null | undefined;
|
|
20
|
-
responseStatus?: number | null | undefined;
|
|
21
|
-
responseBody?: unknown;
|
|
22
|
-
}, {
|
|
23
|
-
id: string;
|
|
24
|
-
method: string;
|
|
25
|
-
createdAt: Date;
|
|
26
|
-
userId: string;
|
|
27
|
-
endpoint: string;
|
|
28
|
-
idempotencyKey: string;
|
|
29
|
-
apiKeyId?: string | null | undefined;
|
|
30
|
-
responseStatus?: number | null | undefined;
|
|
31
|
-
responseBody?: unknown;
|
|
32
|
-
}>;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.externalSyncRequestSchema = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
exports.externalSyncRequestSchema = (0, zod_1.object)({
|
|
6
|
-
id: (0, zod_1.string)(),
|
|
7
|
-
userId: (0, zod_1.string)(),
|
|
8
|
-
apiKeyId: (0, zod_1.string)().nullish(),
|
|
9
|
-
idempotencyKey: (0, zod_1.string)(),
|
|
10
|
-
method: (0, zod_1.string)(),
|
|
11
|
-
endpoint: (0, zod_1.string)(),
|
|
12
|
-
responseStatus: (0, zod_1.number)().int().nullish(),
|
|
13
|
-
responseBody: zod_1.z.unknown().nullish(),
|
|
14
|
-
createdAt: (0, zod_1.date)(),
|
|
15
|
-
});
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export declare const serviceAvailabilitySchema: import("zod").ZodObject<{
|
|
2
|
-
id: import("zod").ZodNumber;
|
|
3
|
-
serviceId: import("zod").ZodNumber;
|
|
4
|
-
dayOfWeek: import("zod").ZodNumber;
|
|
5
|
-
startTime: import("zod").ZodString;
|
|
6
|
-
endTime: import("zod").ZodString;
|
|
7
|
-
createdAt: import("zod").ZodDate;
|
|
8
|
-
updatedAt: import("zod").ZodDate;
|
|
9
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
10
|
-
endTime: string;
|
|
11
|
-
startTime: string;
|
|
12
|
-
id: number;
|
|
13
|
-
createdAt: Date;
|
|
14
|
-
updatedAt: Date;
|
|
15
|
-
serviceId: number;
|
|
16
|
-
dayOfWeek: number;
|
|
17
|
-
}, {
|
|
18
|
-
endTime: string;
|
|
19
|
-
startTime: string;
|
|
20
|
-
id: number;
|
|
21
|
-
createdAt: Date;
|
|
22
|
-
updatedAt: Date;
|
|
23
|
-
serviceId: number;
|
|
24
|
-
dayOfWeek: number;
|
|
25
|
-
}>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.serviceAvailabilitySchema = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
exports.serviceAvailabilitySchema = (0, zod_1.object)({
|
|
6
|
-
id: (0, zod_1.number)().int(),
|
|
7
|
-
serviceId: (0, zod_1.number)().int(),
|
|
8
|
-
dayOfWeek: (0, zod_1.number)().int(),
|
|
9
|
-
startTime: (0, zod_1.string)(),
|
|
10
|
-
endTime: (0, zod_1.string)(),
|
|
11
|
-
createdAt: (0, zod_1.date)(),
|
|
12
|
-
updatedAt: (0, zod_1.date)(),
|
|
13
|
-
});
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { ServiceWorkerPayoutStatus } from "../../types/enums";
|
|
2
|
-
export declare const serviceWorkerPayoutInfoSchema: import("zod").ZodObject<{
|
|
3
|
-
id: import("zod").ZodNumber;
|
|
4
|
-
serviceWorkerId: import("zod").ZodNumber;
|
|
5
|
-
fullName: import("zod").ZodString;
|
|
6
|
-
sortCode: import("zod").ZodString;
|
|
7
|
-
accountNumber: import("zod").ZodString;
|
|
8
|
-
createdAt: import("zod").ZodDate;
|
|
9
|
-
updatedAt: import("zod").ZodDate;
|
|
10
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
11
|
-
id: number;
|
|
12
|
-
createdAt: Date;
|
|
13
|
-
updatedAt: Date;
|
|
14
|
-
accountNumber: string;
|
|
15
|
-
fullName: string;
|
|
16
|
-
sortCode: string;
|
|
17
|
-
serviceWorkerId: number;
|
|
18
|
-
}, {
|
|
19
|
-
id: number;
|
|
20
|
-
createdAt: Date;
|
|
21
|
-
updatedAt: Date;
|
|
22
|
-
accountNumber: string;
|
|
23
|
-
fullName: string;
|
|
24
|
-
sortCode: string;
|
|
25
|
-
serviceWorkerId: number;
|
|
26
|
-
}>;
|
|
27
|
-
export declare const serviceWorkerPayoutSchema: import("zod").ZodObject<{
|
|
28
|
-
id: import("zod").ZodNumber;
|
|
29
|
-
createdAt: import("zod").ZodDate;
|
|
30
|
-
updatedAt: import("zod").ZodDate;
|
|
31
|
-
total: import("zod").ZodNumber;
|
|
32
|
-
status: import("zod").ZodNativeEnum<typeof ServiceWorkerPayoutStatus>;
|
|
33
|
-
payoutDate: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodDate>>;
|
|
34
|
-
opsSeenAt: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodDate>>;
|
|
35
|
-
currency: import("zod").ZodString;
|
|
36
|
-
payoutInfoId: import("zod").ZodNumber;
|
|
37
|
-
invoiceUrl: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
38
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
39
|
-
currency: string;
|
|
40
|
-
id: number;
|
|
41
|
-
total: number;
|
|
42
|
-
status: ServiceWorkerPayoutStatus;
|
|
43
|
-
createdAt: Date;
|
|
44
|
-
updatedAt: Date;
|
|
45
|
-
payoutInfoId: number;
|
|
46
|
-
payoutDate?: Date | null | undefined;
|
|
47
|
-
opsSeenAt?: Date | null | undefined;
|
|
48
|
-
invoiceUrl?: string | null | undefined;
|
|
49
|
-
}, {
|
|
50
|
-
currency: string;
|
|
51
|
-
id: number;
|
|
52
|
-
total: number;
|
|
53
|
-
status: ServiceWorkerPayoutStatus;
|
|
54
|
-
createdAt: Date;
|
|
55
|
-
updatedAt: Date;
|
|
56
|
-
payoutInfoId: number;
|
|
57
|
-
payoutDate?: Date | null | undefined;
|
|
58
|
-
opsSeenAt?: Date | null | undefined;
|
|
59
|
-
invoiceUrl?: string | null | undefined;
|
|
60
|
-
}>;
|
|
61
|
-
export declare const serviceWorkerWorkingHoursSchema: import("zod").ZodObject<{
|
|
62
|
-
id: import("zod").ZodNumber;
|
|
63
|
-
serviceWorkerId: import("zod").ZodNumber;
|
|
64
|
-
dayOfWeek: import("zod").ZodNumber;
|
|
65
|
-
isEnabled: import("zod").ZodBoolean;
|
|
66
|
-
startTime: import("zod").ZodString;
|
|
67
|
-
endTime: import("zod").ZodString;
|
|
68
|
-
createdAt: import("zod").ZodDate;
|
|
69
|
-
updatedAt: import("zod").ZodDate;
|
|
70
|
-
}, "strip", import("zod").ZodTypeAny, {
|
|
71
|
-
endTime: string;
|
|
72
|
-
startTime: string;
|
|
73
|
-
id: number;
|
|
74
|
-
createdAt: Date;
|
|
75
|
-
updatedAt: Date;
|
|
76
|
-
serviceWorkerId: number;
|
|
77
|
-
dayOfWeek: number;
|
|
78
|
-
isEnabled: boolean;
|
|
79
|
-
}, {
|
|
80
|
-
endTime: string;
|
|
81
|
-
startTime: string;
|
|
82
|
-
id: number;
|
|
83
|
-
createdAt: Date;
|
|
84
|
-
updatedAt: Date;
|
|
85
|
-
serviceWorkerId: number;
|
|
86
|
-
dayOfWeek: number;
|
|
87
|
-
isEnabled: boolean;
|
|
88
|
-
}>;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.serviceWorkerWorkingHoursSchema = exports.serviceWorkerPayoutSchema = exports.serviceWorkerPayoutInfoSchema = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const enums_1 = require("../../types/enums");
|
|
6
|
-
exports.serviceWorkerPayoutInfoSchema = (0, zod_1.object)({
|
|
7
|
-
id: (0, zod_1.number)().int(),
|
|
8
|
-
serviceWorkerId: (0, zod_1.number)().int(),
|
|
9
|
-
fullName: (0, zod_1.string)(),
|
|
10
|
-
sortCode: (0, zod_1.string)(),
|
|
11
|
-
accountNumber: (0, zod_1.string)(),
|
|
12
|
-
createdAt: (0, zod_1.date)(),
|
|
13
|
-
updatedAt: (0, zod_1.date)(),
|
|
14
|
-
});
|
|
15
|
-
exports.serviceWorkerPayoutSchema = (0, zod_1.object)({
|
|
16
|
-
id: (0, zod_1.number)().int(),
|
|
17
|
-
createdAt: (0, zod_1.date)(),
|
|
18
|
-
updatedAt: (0, zod_1.date)(),
|
|
19
|
-
total: (0, zod_1.number)(),
|
|
20
|
-
status: (0, zod_1.nativeEnum)(enums_1.ServiceWorkerPayoutStatus),
|
|
21
|
-
payoutDate: (0, zod_1.date)().nullish(),
|
|
22
|
-
opsSeenAt: (0, zod_1.date)().nullish(),
|
|
23
|
-
currency: (0, zod_1.string)(),
|
|
24
|
-
payoutInfoId: (0, zod_1.number)().int(),
|
|
25
|
-
invoiceUrl: (0, zod_1.string)().nullish(),
|
|
26
|
-
});
|
|
27
|
-
exports.serviceWorkerWorkingHoursSchema = (0, zod_1.object)({
|
|
28
|
-
id: (0, zod_1.number)().int(),
|
|
29
|
-
serviceWorkerId: (0, zod_1.number)().int(),
|
|
30
|
-
dayOfWeek: (0, zod_1.number)().int(),
|
|
31
|
-
isEnabled: (0, zod_1.boolean)(),
|
|
32
|
-
startTime: (0, zod_1.string)(),
|
|
33
|
-
endTime: (0, zod_1.string)(),
|
|
34
|
-
createdAt: (0, zod_1.date)(),
|
|
35
|
-
updatedAt: (0, zod_1.date)(),
|
|
36
|
-
});
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { WebhookDeliveryStatus, WebhookEndpointStatus } from "../../types/enums";
|
|
3
|
-
export declare const webhookEndpointSchema: z.ZodObject<{
|
|
4
|
-
id: z.ZodString;
|
|
5
|
-
userId: z.ZodString;
|
|
6
|
-
url: z.ZodString;
|
|
7
|
-
secret: z.ZodString;
|
|
8
|
-
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
9
|
-
events: z.ZodArray<z.ZodString, "many">;
|
|
10
|
-
status: z.ZodNativeEnum<typeof WebhookEndpointStatus>;
|
|
11
|
-
apiKeyId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
12
|
-
createdAt: z.ZodDate;
|
|
13
|
-
updatedAt: z.ZodDate;
|
|
14
|
-
}, "strip", z.ZodTypeAny, {
|
|
15
|
-
id: string;
|
|
16
|
-
url: string;
|
|
17
|
-
secret: string;
|
|
18
|
-
status: WebhookEndpointStatus;
|
|
19
|
-
createdAt: Date;
|
|
20
|
-
updatedAt: Date;
|
|
21
|
-
userId: string;
|
|
22
|
-
events: string[];
|
|
23
|
-
description?: string | null | undefined;
|
|
24
|
-
apiKeyId?: string | null | undefined;
|
|
25
|
-
}, {
|
|
26
|
-
id: string;
|
|
27
|
-
url: string;
|
|
28
|
-
secret: string;
|
|
29
|
-
status: WebhookEndpointStatus;
|
|
30
|
-
createdAt: Date;
|
|
31
|
-
updatedAt: Date;
|
|
32
|
-
userId: string;
|
|
33
|
-
events: string[];
|
|
34
|
-
description?: string | null | undefined;
|
|
35
|
-
apiKeyId?: string | null | undefined;
|
|
36
|
-
}>;
|
|
37
|
-
export declare const webhookEventSchema: z.ZodObject<{
|
|
38
|
-
id: z.ZodString;
|
|
39
|
-
userId: z.ZodString;
|
|
40
|
-
type: z.ZodString;
|
|
41
|
-
payload: z.ZodUnknown;
|
|
42
|
-
propertyId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
43
|
-
roomId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
44
|
-
source: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
45
|
-
createdAt: z.ZodDate;
|
|
46
|
-
}, "strip", z.ZodTypeAny, {
|
|
47
|
-
type: string;
|
|
48
|
-
id: string;
|
|
49
|
-
createdAt: Date;
|
|
50
|
-
userId: string;
|
|
51
|
-
source?: string | null | undefined;
|
|
52
|
-
propertyId?: number | null | undefined;
|
|
53
|
-
roomId?: number | null | undefined;
|
|
54
|
-
payload?: unknown;
|
|
55
|
-
}, {
|
|
56
|
-
type: string;
|
|
57
|
-
id: string;
|
|
58
|
-
createdAt: Date;
|
|
59
|
-
userId: string;
|
|
60
|
-
source?: string | null | undefined;
|
|
61
|
-
propertyId?: number | null | undefined;
|
|
62
|
-
roomId?: number | null | undefined;
|
|
63
|
-
payload?: unknown;
|
|
64
|
-
}>;
|
|
65
|
-
export declare const webhookDeliverySchema: z.ZodObject<{
|
|
66
|
-
id: z.ZodString;
|
|
67
|
-
endpointId: z.ZodString;
|
|
68
|
-
eventId: z.ZodString;
|
|
69
|
-
status: z.ZodNativeEnum<typeof WebhookDeliveryStatus>;
|
|
70
|
-
attemptCount: z.ZodNumber;
|
|
71
|
-
maxAttempts: z.ZodNumber;
|
|
72
|
-
lastAttemptAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
73
|
-
responseStatus: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
74
|
-
responseBody: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
75
|
-
error: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
76
|
-
createdAt: z.ZodDate;
|
|
77
|
-
updatedAt: z.ZodDate;
|
|
78
|
-
}, "strip", z.ZodTypeAny, {
|
|
79
|
-
id: string;
|
|
80
|
-
status: WebhookDeliveryStatus;
|
|
81
|
-
createdAt: Date;
|
|
82
|
-
updatedAt: Date;
|
|
83
|
-
eventId: string;
|
|
84
|
-
endpointId: string;
|
|
85
|
-
attemptCount: number;
|
|
86
|
-
maxAttempts: number;
|
|
87
|
-
error?: string | null | undefined;
|
|
88
|
-
lastAttemptAt?: Date | null | undefined;
|
|
89
|
-
responseStatus?: number | null | undefined;
|
|
90
|
-
responseBody?: string | null | undefined;
|
|
91
|
-
}, {
|
|
92
|
-
id: string;
|
|
93
|
-
status: WebhookDeliveryStatus;
|
|
94
|
-
createdAt: Date;
|
|
95
|
-
updatedAt: Date;
|
|
96
|
-
eventId: string;
|
|
97
|
-
endpointId: string;
|
|
98
|
-
attemptCount: number;
|
|
99
|
-
maxAttempts: number;
|
|
100
|
-
error?: string | null | undefined;
|
|
101
|
-
lastAttemptAt?: Date | null | undefined;
|
|
102
|
-
responseStatus?: number | null | undefined;
|
|
103
|
-
responseBody?: string | null | undefined;
|
|
104
|
-
}>;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.webhookDeliverySchema = exports.webhookEventSchema = exports.webhookEndpointSchema = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const enums_1 = require("../../types/enums");
|
|
6
|
-
exports.webhookEndpointSchema = (0, zod_1.object)({
|
|
7
|
-
id: (0, zod_1.string)(),
|
|
8
|
-
userId: (0, zod_1.string)(),
|
|
9
|
-
url: (0, zod_1.string)(),
|
|
10
|
-
secret: (0, zod_1.string)(),
|
|
11
|
-
description: (0, zod_1.string)().nullish(),
|
|
12
|
-
events: (0, zod_1.string)().array(),
|
|
13
|
-
status: (0, zod_1.nativeEnum)(enums_1.WebhookEndpointStatus),
|
|
14
|
-
apiKeyId: (0, zod_1.string)().nullish(),
|
|
15
|
-
createdAt: (0, zod_1.date)(),
|
|
16
|
-
updatedAt: (0, zod_1.date)(),
|
|
17
|
-
});
|
|
18
|
-
exports.webhookEventSchema = (0, zod_1.object)({
|
|
19
|
-
id: (0, zod_1.string)(),
|
|
20
|
-
userId: (0, zod_1.string)(),
|
|
21
|
-
type: (0, zod_1.string)(),
|
|
22
|
-
payload: zod_1.z.unknown(),
|
|
23
|
-
propertyId: (0, zod_1.number)().int().nullish(),
|
|
24
|
-
roomId: (0, zod_1.number)().int().nullish(),
|
|
25
|
-
source: (0, zod_1.string)().nullish(),
|
|
26
|
-
createdAt: (0, zod_1.date)(),
|
|
27
|
-
});
|
|
28
|
-
exports.webhookDeliverySchema = (0, zod_1.object)({
|
|
29
|
-
id: (0, zod_1.string)(),
|
|
30
|
-
endpointId: (0, zod_1.string)(),
|
|
31
|
-
eventId: (0, zod_1.string)(),
|
|
32
|
-
status: (0, zod_1.nativeEnum)(enums_1.WebhookDeliveryStatus),
|
|
33
|
-
attemptCount: (0, zod_1.number)().int(),
|
|
34
|
-
maxAttempts: (0, zod_1.number)().int(),
|
|
35
|
-
lastAttemptAt: (0, zod_1.date)().nullish(),
|
|
36
|
-
responseStatus: (0, zod_1.number)().int().nullish(),
|
|
37
|
-
responseBody: (0, zod_1.string)().nullish(),
|
|
38
|
-
error: (0, zod_1.string)().nullish(),
|
|
39
|
-
createdAt: (0, zod_1.date)(),
|
|
40
|
-
updatedAt: (0, zod_1.date)(),
|
|
41
|
-
});
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { infer } from "zod";
|
|
2
|
-
import { apiKeySchema, apiKeyUsageLogSchema } from "../../schemas/api-key";
|
|
3
|
-
import { User } from "../user";
|
|
4
|
-
export interface ApiKey extends infer<typeof apiKeySchema> {
|
|
5
|
-
user?: User | null;
|
|
6
|
-
usageLogs?: ApiKeyUsageLog[];
|
|
7
|
-
}
|
|
8
|
-
export interface ApiKeyUsageLog extends infer<typeof apiKeyUsageLogSchema> {
|
|
9
|
-
apiKey?: ApiKey;
|
|
10
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { infer } from "zod";
|
|
2
|
-
import { serviceWorkerPayoutInfoSchema, serviceWorkerPayoutSchema, serviceWorkerWorkingHoursSchema } from "../../schemas/service-worker-payout";
|
|
3
|
-
import { ServiceWorker } from "../service-worker";
|
|
4
|
-
import { Task } from "../task";
|
|
5
|
-
import { ServiceProviderPayout } from "../service-provider-payout";
|
|
6
|
-
export interface ServiceWorkerPayoutInfo extends infer<typeof serviceWorkerPayoutInfoSchema> {
|
|
7
|
-
serviceWorker?: ServiceWorker;
|
|
8
|
-
payouts?: ServiceWorkerPayout[];
|
|
9
|
-
}
|
|
10
|
-
export interface ServiceWorkerPayout extends infer<typeof serviceWorkerPayoutSchema> {
|
|
11
|
-
payoutInfo?: ServiceWorkerPayoutInfo;
|
|
12
|
-
tasks?: Task[];
|
|
13
|
-
providerPayout?: ServiceProviderPayout | null;
|
|
14
|
-
}
|
|
15
|
-
export interface ServiceWorkerWorkingHours extends infer<typeof serviceWorkerWorkingHoursSchema> {
|
|
16
|
-
serviceWorker?: ServiceWorker;
|
|
17
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { infer } from "zod";
|
|
2
|
-
import { webhookDeliverySchema, webhookEndpointSchema, webhookEventSchema } from "../../schemas/webhook";
|
|
3
|
-
import { User } from "../user";
|
|
4
|
-
export interface WebhookEndpoint extends infer<typeof webhookEndpointSchema> {
|
|
5
|
-
user?: User;
|
|
6
|
-
deliveries?: WebhookDelivery[];
|
|
7
|
-
}
|
|
8
|
-
export interface WebhookEvent extends infer<typeof webhookEventSchema> {
|
|
9
|
-
user?: User;
|
|
10
|
-
deliveries?: WebhookDelivery[];
|
|
11
|
-
}
|
|
12
|
-
export interface WebhookDelivery extends infer<typeof webhookDeliverySchema> {
|
|
13
|
-
endpoint?: WebhookEndpoint;
|
|
14
|
-
event?: WebhookEvent;
|
|
15
|
-
}
|