hububb-saas-shared 1.1.78 → 1.1.79
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/schemas/index.d.ts +1 -0
- package/dist/schemas/index.js +1 -0
- package/dist/schemas/klevio/index.d.ts +170 -0
- package/dist/schemas/klevio/index.js +65 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +1 -0
- package/dist/types/klevio/index.d.ts +82 -0
- package/dist/types/klevio/index.js +2 -0
- package/package.json +1 -1
package/dist/schemas/index.d.ts
CHANGED
package/dist/schemas/index.js
CHANGED
|
@@ -82,3 +82,4 @@ __exportStar(require("./custom-bundle-service"), exports);
|
|
|
82
82
|
__exportStar(require("./custom-bundle-coupon"), exports);
|
|
83
83
|
__exportStar(require("./pending-payment-action"), exports);
|
|
84
84
|
__exportStar(require("./seam"), exports);
|
|
85
|
+
__exportStar(require("./klevio"), exports);
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const klevioLockActionSchema: z.ZodEnum<["UNLOCK_LOCK", "OPEN"]>;
|
|
3
|
+
export declare const klevioAccountSchema: z.ZodObject<{
|
|
4
|
+
id: z.ZodNumber;
|
|
5
|
+
userId: z.ZodString;
|
|
6
|
+
apiKeyId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
7
|
+
clientId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
8
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
9
|
+
publicKey: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
10
|
+
isActive: z.ZodBoolean;
|
|
11
|
+
createdAt: z.ZodDate;
|
|
12
|
+
updatedAt: z.ZodDate;
|
|
13
|
+
}, "strip", z.ZodTypeAny, {
|
|
14
|
+
id: number;
|
|
15
|
+
createdAt: Date;
|
|
16
|
+
updatedAt: Date;
|
|
17
|
+
userId: string;
|
|
18
|
+
isActive: boolean;
|
|
19
|
+
name?: string | null | undefined;
|
|
20
|
+
apiKeyId?: string | null | undefined;
|
|
21
|
+
clientId?: string | null | undefined;
|
|
22
|
+
publicKey?: string | null | undefined;
|
|
23
|
+
}, {
|
|
24
|
+
id: number;
|
|
25
|
+
createdAt: Date;
|
|
26
|
+
updatedAt: Date;
|
|
27
|
+
userId: string;
|
|
28
|
+
isActive: boolean;
|
|
29
|
+
name?: string | null | undefined;
|
|
30
|
+
apiKeyId?: string | null | undefined;
|
|
31
|
+
clientId?: string | null | undefined;
|
|
32
|
+
publicKey?: string | null | undefined;
|
|
33
|
+
}>;
|
|
34
|
+
export declare const klevioLockSchema: z.ZodObject<{
|
|
35
|
+
id: z.ZodNumber;
|
|
36
|
+
klevioAccountId: z.ZodNumber;
|
|
37
|
+
klevioPropertyId: z.ZodString;
|
|
38
|
+
name: z.ZodString;
|
|
39
|
+
action: z.ZodEnum<["UNLOCK_LOCK", "OPEN"]>;
|
|
40
|
+
isConnected: z.ZodBoolean;
|
|
41
|
+
availableActions: z.ZodArray<z.ZodString, "many">;
|
|
42
|
+
hasKeypad: z.ZodBoolean;
|
|
43
|
+
masterKeyId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
44
|
+
createdAt: z.ZodDate;
|
|
45
|
+
updatedAt: z.ZodDate;
|
|
46
|
+
}, "strip", z.ZodTypeAny, {
|
|
47
|
+
name: string;
|
|
48
|
+
id: number;
|
|
49
|
+
action: "UNLOCK_LOCK" | "OPEN";
|
|
50
|
+
isConnected: boolean;
|
|
51
|
+
createdAt: Date;
|
|
52
|
+
updatedAt: Date;
|
|
53
|
+
klevioAccountId: number;
|
|
54
|
+
klevioPropertyId: string;
|
|
55
|
+
availableActions: string[];
|
|
56
|
+
hasKeypad: boolean;
|
|
57
|
+
masterKeyId?: string | null | undefined;
|
|
58
|
+
}, {
|
|
59
|
+
name: string;
|
|
60
|
+
id: number;
|
|
61
|
+
action: "UNLOCK_LOCK" | "OPEN";
|
|
62
|
+
isConnected: boolean;
|
|
63
|
+
createdAt: Date;
|
|
64
|
+
updatedAt: Date;
|
|
65
|
+
klevioAccountId: number;
|
|
66
|
+
klevioPropertyId: string;
|
|
67
|
+
availableActions: string[];
|
|
68
|
+
hasKeypad: boolean;
|
|
69
|
+
masterKeyId?: string | null | undefined;
|
|
70
|
+
}>;
|
|
71
|
+
export declare const propertyKlevioLockSchema: z.ZodObject<{
|
|
72
|
+
id: z.ZodNumber;
|
|
73
|
+
propertyId: z.ZodNumber;
|
|
74
|
+
klevioLockId: z.ZodNumber;
|
|
75
|
+
isShared: z.ZodBoolean;
|
|
76
|
+
createdAt: z.ZodDate;
|
|
77
|
+
updatedAt: z.ZodDate;
|
|
78
|
+
}, "strip", z.ZodTypeAny, {
|
|
79
|
+
id: number;
|
|
80
|
+
createdAt: Date;
|
|
81
|
+
updatedAt: Date;
|
|
82
|
+
propertyId: number;
|
|
83
|
+
isShared: boolean;
|
|
84
|
+
klevioLockId: number;
|
|
85
|
+
}, {
|
|
86
|
+
id: number;
|
|
87
|
+
createdAt: Date;
|
|
88
|
+
updatedAt: Date;
|
|
89
|
+
propertyId: number;
|
|
90
|
+
isShared: boolean;
|
|
91
|
+
klevioLockId: number;
|
|
92
|
+
}>;
|
|
93
|
+
export declare const klevioKeySchema: z.ZodObject<{
|
|
94
|
+
id: z.ZodString;
|
|
95
|
+
klevioAccountId: z.ZodNumber;
|
|
96
|
+
klevioPropertyId: z.ZodString;
|
|
97
|
+
reservationId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
98
|
+
taskId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
99
|
+
email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
100
|
+
from: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
101
|
+
to: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
102
|
+
status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
103
|
+
meta: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
|
|
104
|
+
createdAt: z.ZodDate;
|
|
105
|
+
updatedAt: z.ZodDate;
|
|
106
|
+
}, "strip", z.ZodTypeAny, {
|
|
107
|
+
id: string;
|
|
108
|
+
createdAt: Date;
|
|
109
|
+
updatedAt: Date;
|
|
110
|
+
klevioAccountId: number;
|
|
111
|
+
klevioPropertyId: string;
|
|
112
|
+
meta?: unknown;
|
|
113
|
+
email?: string | null | undefined;
|
|
114
|
+
status?: string | null | undefined;
|
|
115
|
+
reservationId?: number | null | undefined;
|
|
116
|
+
from?: Date | null | undefined;
|
|
117
|
+
taskId?: number | null | undefined;
|
|
118
|
+
to?: Date | null | undefined;
|
|
119
|
+
}, {
|
|
120
|
+
id: string;
|
|
121
|
+
createdAt: Date;
|
|
122
|
+
updatedAt: Date;
|
|
123
|
+
klevioAccountId: number;
|
|
124
|
+
klevioPropertyId: string;
|
|
125
|
+
meta?: unknown;
|
|
126
|
+
email?: string | null | undefined;
|
|
127
|
+
status?: string | null | undefined;
|
|
128
|
+
reservationId?: number | null | undefined;
|
|
129
|
+
from?: Date | null | undefined;
|
|
130
|
+
taskId?: number | null | undefined;
|
|
131
|
+
to?: Date | null | undefined;
|
|
132
|
+
}>;
|
|
133
|
+
export declare const klevioLockPreviewSchema: z.ZodObject<{
|
|
134
|
+
name: z.ZodString;
|
|
135
|
+
isConnected: z.ZodBoolean;
|
|
136
|
+
availableActions: z.ZodArray<z.ZodString, "many">;
|
|
137
|
+
hasKeypad: z.ZodBoolean;
|
|
138
|
+
masterKeyId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
139
|
+
suggestedAction: z.ZodEnum<["UNLOCK_LOCK", "OPEN"]>;
|
|
140
|
+
}, "strip", z.ZodTypeAny, {
|
|
141
|
+
name: string;
|
|
142
|
+
isConnected: boolean;
|
|
143
|
+
availableActions: string[];
|
|
144
|
+
hasKeypad: boolean;
|
|
145
|
+
suggestedAction: "UNLOCK_LOCK" | "OPEN";
|
|
146
|
+
masterKeyId?: string | null | undefined;
|
|
147
|
+
}, {
|
|
148
|
+
name: string;
|
|
149
|
+
isConnected: boolean;
|
|
150
|
+
availableActions: string[];
|
|
151
|
+
hasKeypad: boolean;
|
|
152
|
+
suggestedAction: "UNLOCK_LOCK" | "OPEN";
|
|
153
|
+
masterKeyId?: string | null | undefined;
|
|
154
|
+
}>;
|
|
155
|
+
export declare const lockControlResponseSchema: z.ZodObject<{
|
|
156
|
+
success: z.ZodBoolean;
|
|
157
|
+
lockId: z.ZodNumber;
|
|
158
|
+
lockName: z.ZodString;
|
|
159
|
+
action: z.ZodString;
|
|
160
|
+
}, "strip", z.ZodTypeAny, {
|
|
161
|
+
action: string;
|
|
162
|
+
success: boolean;
|
|
163
|
+
lockId: number;
|
|
164
|
+
lockName: string;
|
|
165
|
+
}, {
|
|
166
|
+
action: string;
|
|
167
|
+
success: boolean;
|
|
168
|
+
lockId: number;
|
|
169
|
+
lockName: string;
|
|
170
|
+
}>;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.lockControlResponseSchema = exports.klevioLockPreviewSchema = exports.klevioKeySchema = exports.propertyKlevioLockSchema = exports.klevioLockSchema = exports.klevioAccountSchema = exports.klevioLockActionSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.klevioLockActionSchema = zod_1.z.enum(["UNLOCK_LOCK", "OPEN"]);
|
|
6
|
+
exports.klevioAccountSchema = zod_1.z.object({
|
|
7
|
+
id: zod_1.z.number().int(),
|
|
8
|
+
userId: zod_1.z.string(),
|
|
9
|
+
apiKeyId: zod_1.z.string().nullish(),
|
|
10
|
+
clientId: zod_1.z.string().nullish(),
|
|
11
|
+
name: zod_1.z.string().nullish(),
|
|
12
|
+
publicKey: zod_1.z.string().nullish(),
|
|
13
|
+
isActive: zod_1.z.boolean(),
|
|
14
|
+
createdAt: zod_1.z.date(),
|
|
15
|
+
updatedAt: zod_1.z.date(),
|
|
16
|
+
});
|
|
17
|
+
exports.klevioLockSchema = zod_1.z.object({
|
|
18
|
+
id: zod_1.z.number().int(),
|
|
19
|
+
klevioAccountId: zod_1.z.number().int(),
|
|
20
|
+
klevioPropertyId: zod_1.z.string(),
|
|
21
|
+
name: zod_1.z.string(),
|
|
22
|
+
action: exports.klevioLockActionSchema,
|
|
23
|
+
isConnected: zod_1.z.boolean(),
|
|
24
|
+
availableActions: zod_1.z.array(zod_1.z.string()),
|
|
25
|
+
hasKeypad: zod_1.z.boolean(),
|
|
26
|
+
masterKeyId: zod_1.z.string().nullish(),
|
|
27
|
+
createdAt: zod_1.z.date(),
|
|
28
|
+
updatedAt: zod_1.z.date(),
|
|
29
|
+
});
|
|
30
|
+
exports.propertyKlevioLockSchema = zod_1.z.object({
|
|
31
|
+
id: zod_1.z.number().int(),
|
|
32
|
+
propertyId: zod_1.z.number().int(),
|
|
33
|
+
klevioLockId: zod_1.z.number().int(),
|
|
34
|
+
isShared: zod_1.z.boolean(),
|
|
35
|
+
createdAt: zod_1.z.date(),
|
|
36
|
+
updatedAt: zod_1.z.date(),
|
|
37
|
+
});
|
|
38
|
+
exports.klevioKeySchema = zod_1.z.object({
|
|
39
|
+
id: zod_1.z.string(),
|
|
40
|
+
klevioAccountId: zod_1.z.number().int(),
|
|
41
|
+
klevioPropertyId: zod_1.z.string(),
|
|
42
|
+
reservationId: zod_1.z.number().int().nullish(),
|
|
43
|
+
taskId: zod_1.z.number().int().nullish(),
|
|
44
|
+
email: zod_1.z.string().nullish(),
|
|
45
|
+
from: zod_1.z.date().nullish(),
|
|
46
|
+
to: zod_1.z.date().nullish(),
|
|
47
|
+
status: zod_1.z.string().nullish(),
|
|
48
|
+
meta: zod_1.z.unknown().nullish(),
|
|
49
|
+
createdAt: zod_1.z.date(),
|
|
50
|
+
updatedAt: zod_1.z.date(),
|
|
51
|
+
});
|
|
52
|
+
exports.klevioLockPreviewSchema = zod_1.z.object({
|
|
53
|
+
name: zod_1.z.string(),
|
|
54
|
+
isConnected: zod_1.z.boolean(),
|
|
55
|
+
availableActions: zod_1.z.array(zod_1.z.string()),
|
|
56
|
+
hasKeypad: zod_1.z.boolean(),
|
|
57
|
+
masterKeyId: zod_1.z.string().nullish(),
|
|
58
|
+
suggestedAction: exports.klevioLockActionSchema,
|
|
59
|
+
});
|
|
60
|
+
exports.lockControlResponseSchema = zod_1.z.object({
|
|
61
|
+
success: zod_1.z.boolean(),
|
|
62
|
+
lockId: zod_1.z.number().int(),
|
|
63
|
+
lockName: zod_1.z.string(),
|
|
64
|
+
action: zod_1.z.string(),
|
|
65
|
+
});
|
package/dist/types/index.d.ts
CHANGED
package/dist/types/index.js
CHANGED
|
@@ -83,3 +83,4 @@ __exportStar(require("./custom-bundle-service"), exports);
|
|
|
83
83
|
__exportStar(require("./custom-bundle-coupon"), exports);
|
|
84
84
|
__exportStar(require("./pending-payment-action"), exports);
|
|
85
85
|
__exportStar(require("./seam"), exports);
|
|
86
|
+
__exportStar(require("./klevio"), exports);
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { klevioAccountSchema, klevioLockSchema, klevioLockActionSchema, propertyKlevioLockSchema, klevioKeySchema, klevioLockPreviewSchema, lockControlResponseSchema } from "../../schemas/klevio";
|
|
3
|
+
import { Property } from "../property";
|
|
4
|
+
import { User } from "../user";
|
|
5
|
+
import { Reservation } from "../reservation";
|
|
6
|
+
import { Task } from "../task";
|
|
7
|
+
export type KlevioLockAction = z.infer<typeof klevioLockActionSchema>;
|
|
8
|
+
export interface KlevioAccount extends z.infer<typeof klevioAccountSchema> {
|
|
9
|
+
user?: User;
|
|
10
|
+
locks?: KlevioLock[];
|
|
11
|
+
keys?: KlevioKey[];
|
|
12
|
+
}
|
|
13
|
+
export interface KlevioAccountWithCounts {
|
|
14
|
+
id: number;
|
|
15
|
+
apiKeyId: string | null;
|
|
16
|
+
clientId: string | null;
|
|
17
|
+
name: string | null;
|
|
18
|
+
isActive: boolean;
|
|
19
|
+
createdAt: string;
|
|
20
|
+
updatedAt: string;
|
|
21
|
+
locksCount: number;
|
|
22
|
+
keysCount: number;
|
|
23
|
+
}
|
|
24
|
+
export interface KlevioAccountSummary {
|
|
25
|
+
id: number;
|
|
26
|
+
name: string | null;
|
|
27
|
+
}
|
|
28
|
+
export interface KlevioLock extends z.infer<typeof klevioLockSchema> {
|
|
29
|
+
account?: KlevioAccountSummary;
|
|
30
|
+
properties?: PropertyKlevioLock[];
|
|
31
|
+
}
|
|
32
|
+
export interface PropertyKlevioLock extends z.infer<typeof propertyKlevioLockSchema> {
|
|
33
|
+
property?: Property;
|
|
34
|
+
lock?: KlevioLock;
|
|
35
|
+
}
|
|
36
|
+
export interface KlevioKey extends z.infer<typeof klevioKeySchema> {
|
|
37
|
+
account?: KlevioAccount;
|
|
38
|
+
reservation?: Reservation | null;
|
|
39
|
+
task?: Task | null;
|
|
40
|
+
}
|
|
41
|
+
export type KlevioLockPreview = z.infer<typeof klevioLockPreviewSchema>;
|
|
42
|
+
export type LockControlResponse = z.infer<typeof lockControlResponseSchema>;
|
|
43
|
+
export interface CreateKlevioAccountParams {
|
|
44
|
+
apiKeyId: string;
|
|
45
|
+
privateKey: string;
|
|
46
|
+
clientId: string;
|
|
47
|
+
name?: string;
|
|
48
|
+
}
|
|
49
|
+
export interface CreateKlevioAccountResponse {
|
|
50
|
+
id: number;
|
|
51
|
+
name: string | null;
|
|
52
|
+
createdAt: string;
|
|
53
|
+
reactivated?: boolean;
|
|
54
|
+
}
|
|
55
|
+
export interface FetchLocksParams {
|
|
56
|
+
accountId: number;
|
|
57
|
+
klevioPropertyId: string;
|
|
58
|
+
}
|
|
59
|
+
export interface FetchLocksResponse {
|
|
60
|
+
locks: KlevioLockPreview[];
|
|
61
|
+
klevioPropertyId: string;
|
|
62
|
+
}
|
|
63
|
+
export interface SaveLocksParams {
|
|
64
|
+
accountId: number;
|
|
65
|
+
klevioPropertyId: string;
|
|
66
|
+
locks: Array<{
|
|
67
|
+
name: string;
|
|
68
|
+
action: KlevioLockAction;
|
|
69
|
+
masterKeyId?: string;
|
|
70
|
+
isConnected?: boolean;
|
|
71
|
+
availableActions?: string[];
|
|
72
|
+
hasKeypad?: boolean;
|
|
73
|
+
}>;
|
|
74
|
+
}
|
|
75
|
+
export interface SaveLocksResponse {
|
|
76
|
+
saved: number;
|
|
77
|
+
locks: KlevioLock[];
|
|
78
|
+
}
|
|
79
|
+
export interface AssignLockParams {
|
|
80
|
+
lockId: number;
|
|
81
|
+
propertyId: number;
|
|
82
|
+
}
|