roomzin-js 1.0.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.
- package/LICENSE +68 -0
- package/README.md +467 -0
- package/dist/api/client.d.ts +86 -0
- package/dist/api/client.d.ts.map +1 -0
- package/dist/api/client.js +3 -0
- package/dist/api/client.js.map +1 -0
- package/dist/cluster/api.d.ts +34 -0
- package/dist/cluster/api.d.ts.map +1 -0
- package/dist/cluster/api.js +250 -0
- package/dist/cluster/api.js.map +1 -0
- package/dist/cluster/config.d.ts +30 -0
- package/dist/cluster/config.d.ts.map +1 -0
- package/dist/cluster/config.js +86 -0
- package/dist/cluster/config.js.map +1 -0
- package/dist/cluster/index.d.ts +3 -0
- package/dist/cluster/index.d.ts.map +1 -0
- package/dist/cluster/index.js +21 -0
- package/dist/cluster/index.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/cluster/handler.d.ts +60 -0
- package/dist/internal/cluster/handler.d.ts.map +1 -0
- package/dist/internal/cluster/handler.js +589 -0
- package/dist/internal/cluster/handler.js.map +1 -0
- package/dist/internal/cluster/httputil.d.ts +25 -0
- package/dist/internal/cluster/httputil.d.ts.map +1 -0
- package/dist/internal/cluster/httputil.js +193 -0
- package/dist/internal/cluster/httputil.js.map +1 -0
- package/dist/internal/command/dec_room_avl.d.ts +5 -0
- package/dist/internal/command/dec_room_avl.d.ts.map +1 -0
- package/dist/internal/command/dec_room_avl.js +49 -0
- package/dist/internal/command/dec_room_avl.js.map +1 -0
- package/dist/internal/command/del_prop.d.ts +4 -0
- package/dist/internal/command/del_prop.d.ts.map +1 -0
- package/dist/internal/command/del_prop.js +43 -0
- package/dist/internal/command/del_prop.js.map +1 -0
- package/dist/internal/command/del_prop_day.d.ts +5 -0
- package/dist/internal/command/del_prop_day.d.ts.map +1 -0
- package/dist/internal/command/del_prop_day.js +47 -0
- package/dist/internal/command/del_prop_day.js.map +1 -0
- package/dist/internal/command/del_prop_room.d.ts +5 -0
- package/dist/internal/command/del_prop_room.d.ts.map +1 -0
- package/dist/internal/command/del_prop_room.js +46 -0
- package/dist/internal/command/del_prop_room.js.map +1 -0
- package/dist/internal/command/del_room_day.d.ts +5 -0
- package/dist/internal/command/del_room_day.d.ts.map +1 -0
- package/dist/internal/command/del_room_day.js +47 -0
- package/dist/internal/command/del_room_day.js.map +1 -0
- package/dist/internal/command/del_segment.d.ts +4 -0
- package/dist/internal/command/del_segment.d.ts.map +1 -0
- package/dist/internal/command/del_segment.js +43 -0
- package/dist/internal/command/del_segment.js.map +1 -0
- package/dist/internal/command/get_codecs.d.ts +5 -0
- package/dist/internal/command/get_codecs.d.ts.map +1 -0
- package/dist/internal/command/get_codecs.js +38 -0
- package/dist/internal/command/get_codecs.js.map +1 -0
- package/dist/internal/command/get_prop_room_day.d.ts +7 -0
- package/dist/internal/command/get_prop_room_day.d.ts.map +1 -0
- package/dist/internal/command/get_prop_room_day.js +59 -0
- package/dist/internal/command/get_prop_room_day.js.map +1 -0
- package/dist/internal/command/get_segments.d.ts +5 -0
- package/dist/internal/command/get_segments.d.ts.map +1 -0
- package/dist/internal/command/get_segments.js +47 -0
- package/dist/internal/command/get_segments.js.map +1 -0
- package/dist/internal/command/inc_room_avl.d.ts +5 -0
- package/dist/internal/command/inc_room_avl.d.ts.map +1 -0
- package/dist/internal/command/inc_room_avl.js +46 -0
- package/dist/internal/command/inc_room_avl.js.map +1 -0
- package/dist/internal/command/index.d.ts +20 -0
- package/dist/internal/command/index.d.ts.map +1 -0
- package/dist/internal/command/index.js +61 -0
- package/dist/internal/command/index.js.map +1 -0
- package/dist/internal/command/prop_exist.d.ts +4 -0
- package/dist/internal/command/prop_exist.d.ts.map +1 -0
- package/dist/internal/command/prop_exist.js +43 -0
- package/dist/internal/command/prop_exist.js.map +1 -0
- package/dist/internal/command/prop_room_date_list.d.ts +5 -0
- package/dist/internal/command/prop_room_date_list.d.ts.map +1 -0
- package/dist/internal/command/prop_room_date_list.js +50 -0
- package/dist/internal/command/prop_room_date_list.js.map +1 -0
- package/dist/internal/command/prop_room_exist.d.ts +5 -0
- package/dist/internal/command/prop_room_exist.d.ts.map +1 -0
- package/dist/internal/command/prop_room_exist.js +44 -0
- package/dist/internal/command/prop_room_exist.js.map +1 -0
- package/dist/internal/command/prop_room_list.d.ts +4 -0
- package/dist/internal/command/prop_room_list.d.ts.map +1 -0
- package/dist/internal/command/prop_room_list.js +45 -0
- package/dist/internal/command/prop_room_list.js.map +1 -0
- package/dist/internal/command/search_avail.d.ts +7 -0
- package/dist/internal/command/search_avail.d.ts.map +1 -0
- package/dist/internal/command/search_avail.js +129 -0
- package/dist/internal/command/search_avail.js.map +1 -0
- package/dist/internal/command/search_prop.d.ts +5 -0
- package/dist/internal/command/search_prop.d.ts.map +1 -0
- package/dist/internal/command/search_prop.js +73 -0
- package/dist/internal/command/search_prop.js.map +1 -0
- package/dist/internal/command/set_prop.d.ts +5 -0
- package/dist/internal/command/set_prop.d.ts.map +1 -0
- package/dist/internal/command/set_prop.js +47 -0
- package/dist/internal/command/set_prop.js.map +1 -0
- package/dist/internal/command/set_room_avl.d.ts +5 -0
- package/dist/internal/command/set_room_avl.d.ts.map +1 -0
- package/dist/internal/command/set_room_avl.js +46 -0
- package/dist/internal/command/set_room_avl.js.map +1 -0
- package/dist/internal/command/set_room_pkg.d.ts +5 -0
- package/dist/internal/command/set_room_pkg.d.ts.map +1 -0
- package/dist/internal/command/set_room_pkg.js +76 -0
- package/dist/internal/command/set_room_pkg.js.map +1 -0
- package/dist/internal/err.d.ts +16 -0
- package/dist/internal/err.d.ts.map +1 -0
- package/dist/internal/err.js +39 -0
- package/dist/internal/err.js.map +1 -0
- package/dist/internal/protocol/frame.d.ts +6 -0
- package/dist/internal/protocol/frame.d.ts.map +1 -0
- package/dist/internal/protocol/frame.js +118 -0
- package/dist/internal/protocol/frame.js.map +1 -0
- package/dist/internal/protocol/helpers.d.ts +8 -0
- package/dist/internal/protocol/helpers.d.ts.map +1 -0
- package/dist/internal/protocol/helpers.js +101 -0
- package/dist/internal/protocol/helpers.js.map +1 -0
- package/dist/internal/protocol/login.d.ts +2 -0
- package/dist/internal/protocol/login.d.ts.map +1 -0
- package/dist/internal/protocol/login.js +30 -0
- package/dist/internal/protocol/login.js.map +1 -0
- package/dist/internal/protocol/types.d.ts +19 -0
- package/dist/internal/protocol/types.d.ts.map +1 -0
- package/dist/internal/protocol/types.js +8 -0
- package/dist/internal/protocol/types.js.map +1 -0
- package/dist/internal/single/handler.d.ts +30 -0
- package/dist/internal/single/handler.d.ts.map +1 -0
- package/dist/internal/single/handler.js +197 -0
- package/dist/internal/single/handler.js.map +1 -0
- package/dist/single/api.d.ts +38 -0
- package/dist/single/api.d.ts.map +1 -0
- package/dist/single/api.js +240 -0
- package/dist/single/api.js.map +1 -0
- package/dist/single/config.d.ts +21 -0
- package/dist/single/config.d.ts.map +1 -0
- package/dist/single/config.js +64 -0
- package/dist/single/config.js.map +1 -0
- package/dist/single/index.d.ts +3 -0
- package/dist/single/index.d.ts.map +1 -0
- package/dist/single/index.js +21 -0
- package/dist/single/index.js.map +1 -0
- package/dist/types/codecs.d.ts +5 -0
- package/dist/types/codecs.d.ts.map +1 -0
- package/dist/types/codecs.js +16 -0
- package/dist/types/codecs.js.map +1 -0
- package/dist/types/discovery.d.ts +7 -0
- package/dist/types/discovery.d.ts.map +1 -0
- package/dist/types/discovery.js +3 -0
- package/dist/types/discovery.js.map +1 -0
- package/dist/types/err.d.ts +20 -0
- package/dist/types/err.d.ts.map +1 -0
- package/dist/types/err.js +38 -0
- package/dist/types/err.js.map +1 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +21 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/request.d.ts +94 -0
- package/dist/types/request.d.ts.map +1 -0
- package/dist/types/request.js +207 -0
- package/dist/types/request.js.map +1 -0
- package/dist/types/response.d.ts +22 -0
- package/dist/types/response.d.ts.map +1 -0
- package/dist/types/response.js +3 -0
- package/dist/types/response.js.map +1 -0
- package/package.json +34 -0
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Client = void 0;
|
|
4
|
+
// src/single/client.ts
|
|
5
|
+
const handler_1 = require("../internal/single/handler");
|
|
6
|
+
const index_1 = require("../internal/command/index");
|
|
7
|
+
const request_1 = require("../types/request");
|
|
8
|
+
const err_1 = require("../internal/err");
|
|
9
|
+
const types_1 = require("../types");
|
|
10
|
+
class Client {
|
|
11
|
+
constructor(handler) {
|
|
12
|
+
this.codecs = null;
|
|
13
|
+
this.closed = false;
|
|
14
|
+
this.nextClrId = 1;
|
|
15
|
+
this.handler = handler;
|
|
16
|
+
}
|
|
17
|
+
static async create(cfg) {
|
|
18
|
+
if (!cfg)
|
|
19
|
+
throw (0, err_1.RzError)('cfg must not be null', types_1.ErrorKind.Client);
|
|
20
|
+
const handler = new handler_1.SingleHandler({
|
|
21
|
+
addr: cfg.host,
|
|
22
|
+
tcpPort: cfg.tcpPort,
|
|
23
|
+
authToken: cfg.authToken,
|
|
24
|
+
timeout: cfg.timeout,
|
|
25
|
+
keepAlive: cfg.keepAlive,
|
|
26
|
+
});
|
|
27
|
+
await handler.connect();
|
|
28
|
+
const client = new Client(handler);
|
|
29
|
+
handler.setOnReconnect(() => {
|
|
30
|
+
client.codecs = null; // invalidate on reconnect
|
|
31
|
+
});
|
|
32
|
+
client.codecs = await client.fetchCodecs();
|
|
33
|
+
return client;
|
|
34
|
+
}
|
|
35
|
+
nextID() {
|
|
36
|
+
return this.nextClrId++;
|
|
37
|
+
}
|
|
38
|
+
async roundTrip(payload) {
|
|
39
|
+
if (this.closed)
|
|
40
|
+
throw (0, err_1.RzError)('client is closed');
|
|
41
|
+
const clrId = this.nextID();
|
|
42
|
+
return await this.handler.roundTrip(clrId, payload);
|
|
43
|
+
}
|
|
44
|
+
async fetchCodecs() {
|
|
45
|
+
const payload = (0, index_1.buildGetCodecsPayload)();
|
|
46
|
+
const res = await this.roundTrip(payload);
|
|
47
|
+
const codecs = (0, index_1.parseGetCodecsResp)(res.status, res.fields);
|
|
48
|
+
if (!codecs)
|
|
49
|
+
throw (0, err_1.RzError)('failed to get codecs list from server');
|
|
50
|
+
return codecs;
|
|
51
|
+
}
|
|
52
|
+
// Returns cached codecs
|
|
53
|
+
async getCodecsInternal() {
|
|
54
|
+
if (this.codecs != null) {
|
|
55
|
+
return this.codecs;
|
|
56
|
+
}
|
|
57
|
+
this.codecs = await this.fetchCodecs();
|
|
58
|
+
return this.codecs;
|
|
59
|
+
}
|
|
60
|
+
// Public async version
|
|
61
|
+
async getCodecs() {
|
|
62
|
+
if (this.codecs)
|
|
63
|
+
return this.codecs;
|
|
64
|
+
this.codecs = await this.fetchCodecs();
|
|
65
|
+
return this.codecs;
|
|
66
|
+
}
|
|
67
|
+
// Helper: throw on server ERROR status
|
|
68
|
+
assertOk(status, fields, context) {
|
|
69
|
+
if (status === 'ERROR') {
|
|
70
|
+
const msg = fields.length > 0 ? fields[0].data.toString('utf8') : 'unknown error';
|
|
71
|
+
throw (0, err_1.RzError)(`${context}: ${msg}`);
|
|
72
|
+
}
|
|
73
|
+
if (status !== 'SUCCESS') {
|
|
74
|
+
throw (0, err_1.RzError)(`${context}: unexpected status "${status}"`);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
// ———————————————————————— API ————————————————————————
|
|
78
|
+
async setProp(p) {
|
|
79
|
+
const codecs = await this.getCodecsInternal();
|
|
80
|
+
const [valid, errMsg] = (0, request_1.verifySetPropPayload)(p, codecs);
|
|
81
|
+
if (!valid)
|
|
82
|
+
throw (0, err_1.RzError)(errMsg);
|
|
83
|
+
const payload = (0, index_1.buildSetPropPayload)(p);
|
|
84
|
+
const res = await this.roundTrip(payload);
|
|
85
|
+
this.assertOk(res.status, res.fields, 'setProp');
|
|
86
|
+
}
|
|
87
|
+
async searchProp(p) {
|
|
88
|
+
const codecs = await this.getCodecsInternal();
|
|
89
|
+
const [valid, errMsg] = (0, request_1.verifySearchPropPayload)(p, codecs);
|
|
90
|
+
if (!valid)
|
|
91
|
+
throw (0, err_1.RzError)(errMsg);
|
|
92
|
+
const payload = (0, index_1.buildSearchPropPayload)(p);
|
|
93
|
+
const res = await this.roundTrip(payload);
|
|
94
|
+
this.assertOk(res.status, res.fields, 'searchProp');
|
|
95
|
+
return (0, index_1.parseSearchPropResp)(res.status, res.fields);
|
|
96
|
+
}
|
|
97
|
+
async searchAvail(p) {
|
|
98
|
+
const codecs = await this.getCodecsInternal();
|
|
99
|
+
const [valid, errMsg] = (0, request_1.verifySearchAvailPayload)(p, codecs);
|
|
100
|
+
if (!valid)
|
|
101
|
+
throw (0, err_1.RzError)(errMsg);
|
|
102
|
+
const payload = (0, index_1.buildSearchAvailPayload)(p);
|
|
103
|
+
const res = await this.roundTrip(payload);
|
|
104
|
+
this.assertOk(res.status, res.fields, 'searchAvail');
|
|
105
|
+
return (0, index_1.parseSearchAvailResp)(codecs, res.status, res.fields);
|
|
106
|
+
}
|
|
107
|
+
async setRoomPkg(p) {
|
|
108
|
+
const codecs = await this.getCodecsInternal();
|
|
109
|
+
const [valid, errMsg] = (0, request_1.verifySetRoomPkgPayload)(p, codecs);
|
|
110
|
+
if (!valid)
|
|
111
|
+
throw (0, err_1.RzError)(errMsg);
|
|
112
|
+
const payload = (0, index_1.buildSetRoomPkgPayload)(p);
|
|
113
|
+
const res = await this.roundTrip(payload);
|
|
114
|
+
this.assertOk(res.status, res.fields, 'setRoomPkg');
|
|
115
|
+
}
|
|
116
|
+
async setRoomAvl(p) {
|
|
117
|
+
const [valid, errMsg] = (0, request_1.verifyUpdRoomAvlPayload)(p);
|
|
118
|
+
if (!valid)
|
|
119
|
+
throw (0, err_1.RzError)(errMsg);
|
|
120
|
+
const payload = (0, index_1.buildSetRoomAvlPayload)(p);
|
|
121
|
+
const res = await this.roundTrip(payload);
|
|
122
|
+
this.assertOk(res.status, res.fields, 'setRoomAvl');
|
|
123
|
+
return (0, index_1.parseSetRoomAvlResp)(res.status, res.fields);
|
|
124
|
+
}
|
|
125
|
+
async incRoomAvl(p) {
|
|
126
|
+
const [valid, errMsg] = (0, request_1.verifyUpdRoomAvlPayload)(p);
|
|
127
|
+
if (!valid)
|
|
128
|
+
throw (0, err_1.RzError)(errMsg);
|
|
129
|
+
const payload = (0, index_1.buildIncRoomAvlPayload)(p);
|
|
130
|
+
const res = await this.roundTrip(payload);
|
|
131
|
+
this.assertOk(res.status, res.fields, 'incRoomAvl');
|
|
132
|
+
return (0, index_1.parseIncRoomAvlResp)(res.status, res.fields);
|
|
133
|
+
}
|
|
134
|
+
async decRoomAvl(p) {
|
|
135
|
+
const [valid, errMsg] = (0, request_1.verifyUpdRoomAvlPayload)(p);
|
|
136
|
+
if (!valid)
|
|
137
|
+
throw (0, err_1.RzError)(errMsg);
|
|
138
|
+
const payload = (0, index_1.buildDecRoomAvlPayload)(p);
|
|
139
|
+
const res = await this.roundTrip(payload);
|
|
140
|
+
this.assertOk(res.status, res.fields, 'decRoomAvl');
|
|
141
|
+
return (0, index_1.parseDecRoomAvlResp)(res.status, res.fields);
|
|
142
|
+
}
|
|
143
|
+
async propExist(propertyID) {
|
|
144
|
+
if (!propertyID?.trim())
|
|
145
|
+
throw (0, err_1.RzError)('propertyID is required');
|
|
146
|
+
const payload = (0, index_1.buildPropExistPayload)(propertyID.trim());
|
|
147
|
+
const res = await this.roundTrip(payload);
|
|
148
|
+
this.assertOk(res.status, res.fields, 'propExist');
|
|
149
|
+
return (0, index_1.parsePropExistResp)(res.status, res.fields);
|
|
150
|
+
}
|
|
151
|
+
async propRoomExist(p) {
|
|
152
|
+
if (!p.propertyID?.trim())
|
|
153
|
+
throw (0, err_1.RzError)('propertyID is required');
|
|
154
|
+
if (!p.roomType?.trim())
|
|
155
|
+
throw (0, err_1.RzError)('roomType is required');
|
|
156
|
+
const payload = (0, index_1.buildPropRoomExistPayload)(p);
|
|
157
|
+
const res = await this.roundTrip(payload);
|
|
158
|
+
this.assertOk(res.status, res.fields, 'propRoomExist');
|
|
159
|
+
return (0, index_1.parsePropRoomExistResp)(res.status, res.fields);
|
|
160
|
+
}
|
|
161
|
+
async propRoomList(propertyID) {
|
|
162
|
+
if (!propertyID?.trim())
|
|
163
|
+
throw (0, err_1.RzError)('propertyID is required');
|
|
164
|
+
const payload = (0, index_1.buildPropRoomListPayload)(propertyID.trim());
|
|
165
|
+
const res = await this.roundTrip(payload);
|
|
166
|
+
this.assertOk(res.status, res.fields, 'propRoomList');
|
|
167
|
+
return (0, index_1.parsePropRoomListResp)(res.status, res.fields);
|
|
168
|
+
}
|
|
169
|
+
async propRoomDateList(p) {
|
|
170
|
+
if (!p.propertyID?.trim())
|
|
171
|
+
throw (0, err_1.RzError)('propertyID is required');
|
|
172
|
+
if (!p.roomType?.trim())
|
|
173
|
+
throw (0, err_1.RzError)('roomType is required');
|
|
174
|
+
const payload = (0, index_1.buildPropRoomDateListPayload)(p);
|
|
175
|
+
const res = await this.roundTrip(payload);
|
|
176
|
+
this.assertOk(res.status, res.fields, 'propRoomDateList');
|
|
177
|
+
return (0, index_1.parsePropRoomDateListResp)(res.status, res.fields);
|
|
178
|
+
}
|
|
179
|
+
async delProp(propertyID) {
|
|
180
|
+
if (!propertyID?.trim())
|
|
181
|
+
throw (0, err_1.RzError)('propertyID is required');
|
|
182
|
+
const payload = (0, index_1.buildDelPropPayload)(propertyID.trim());
|
|
183
|
+
const res = await this.roundTrip(payload);
|
|
184
|
+
this.assertOk(res.status, res.fields, 'delProp');
|
|
185
|
+
}
|
|
186
|
+
async delSegment(segment) {
|
|
187
|
+
if (!segment?.trim())
|
|
188
|
+
throw (0, err_1.RzError)('segment is required');
|
|
189
|
+
const payload = (0, index_1.buildDelSegmentPayload)(segment.trim());
|
|
190
|
+
const res = await this.roundTrip(payload);
|
|
191
|
+
this.assertOk(res.status, res.fields, 'delSegment');
|
|
192
|
+
}
|
|
193
|
+
async delPropDay(p) {
|
|
194
|
+
const [valid, errMsg] = (0, request_1.verifyDelPropDayRequest)(p);
|
|
195
|
+
if (!valid)
|
|
196
|
+
throw (0, err_1.RzError)(errMsg);
|
|
197
|
+
const payload = (0, index_1.buildDelPropDayPayload)(p);
|
|
198
|
+
const res = await this.roundTrip(payload);
|
|
199
|
+
this.assertOk(res.status, res.fields, 'delPropDay');
|
|
200
|
+
}
|
|
201
|
+
async delPropRoom(p) {
|
|
202
|
+
if (!p.propertyID?.trim())
|
|
203
|
+
throw (0, err_1.RzError)('propertyID is required');
|
|
204
|
+
if (!p.roomType?.trim())
|
|
205
|
+
throw (0, err_1.RzError)('roomType is required');
|
|
206
|
+
const payload = (0, index_1.buildDelPropRoomPayload)(p);
|
|
207
|
+
const res = await this.roundTrip(payload);
|
|
208
|
+
this.assertOk(res.status, res.fields, 'delPropRoom');
|
|
209
|
+
}
|
|
210
|
+
async delRoomDay(p) {
|
|
211
|
+
const [valid, errMsg] = (0, request_1.verifyDelRoomDayRequest)(p);
|
|
212
|
+
if (!valid)
|
|
213
|
+
throw (0, err_1.RzError)(errMsg);
|
|
214
|
+
const payload = (0, index_1.buildDelRoomDayPayload)(p);
|
|
215
|
+
const res = await this.roundTrip(payload);
|
|
216
|
+
this.assertOk(res.status, res.fields, 'delRoomDay');
|
|
217
|
+
}
|
|
218
|
+
async getPropRoomDay(p) {
|
|
219
|
+
const [valid, errMsg] = (0, request_1.verifyGetRoomDayRequest)(p);
|
|
220
|
+
if (!valid)
|
|
221
|
+
throw (0, err_1.RzError)(errMsg);
|
|
222
|
+
const payload = (0, index_1.buildGetPropRoomDayPayload)(p);
|
|
223
|
+
const res = await this.roundTrip(payload);
|
|
224
|
+
this.assertOk(res.status, res.fields, 'getPropRoomDay');
|
|
225
|
+
const codecs = await this.getCodecsInternal();
|
|
226
|
+
return (0, index_1.parseGetPropRoomDayResp)(codecs, res.status, res.fields);
|
|
227
|
+
}
|
|
228
|
+
async getSegments() {
|
|
229
|
+
const payload = (0, index_1.buildGetSegmentsPayload)();
|
|
230
|
+
const res = await this.roundTrip(payload);
|
|
231
|
+
this.assertOk(res.status, res.fields, 'getSegments');
|
|
232
|
+
return (0, index_1.parseGetSegmentsResp)(res.status, res.fields);
|
|
233
|
+
}
|
|
234
|
+
async close() {
|
|
235
|
+
this.closed = true;
|
|
236
|
+
await this.handler.close();
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
exports.Client = Client;
|
|
240
|
+
//# sourceMappingURL=api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/single/api.ts"],"names":[],"mappings":";;;AAAA,uBAAuB;AACvB,wDAA2D;AAM3D,qDAuCmC;AAEnC,8CAAic;AACjc,yCAA0C;AAC1C,oCAAqC;AAErC,MAAa,MAAM;IAMf,YAAoB,OAAsB;QAJlC,WAAM,GAAkB,IAAI,CAAC;QAC7B,WAAM,GAAG,KAAK,CAAC;QACf,cAAS,GAAG,CAAC,CAAC;QAGlB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IAC3B,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,GAAW;QAC3B,IAAI,CAAC,GAAG;YAAE,MAAM,IAAA,aAAO,EAAC,sBAAsB,EAAE,iBAAS,CAAC,MAAM,CAAC,CAAC;QAElE,MAAM,OAAO,GAAG,IAAI,uBAAa,CAAC;YAC9B,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,OAAO,EAAE,GAAG,CAAC,OAAO;YACpB,SAAS,EAAE,GAAG,CAAC,SAAS;YACxB,OAAO,EAAE,GAAG,CAAC,OAAO;YACpB,SAAS,EAAE,GAAG,CAAC,SAAS;SAC3B,CAAC,CAAC;QAEH,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC;QAExB,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC;QACnC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,KAAK,EAAE,CAAC;IAC/B,CAAC;CACJ;AA1PD,wBA0PC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare class Config {
|
|
2
|
+
host: string;
|
|
3
|
+
tcpPort: number;
|
|
4
|
+
authToken: string;
|
|
5
|
+
timeout: number;
|
|
6
|
+
keepAlive: number;
|
|
7
|
+
}
|
|
8
|
+
export declare class ConfigBuilder {
|
|
9
|
+
private config;
|
|
10
|
+
private constructor();
|
|
11
|
+
/** Create a new builder with sensible defaults */
|
|
12
|
+
static new(): ConfigBuilder;
|
|
13
|
+
withHost(host: string): this;
|
|
14
|
+
withTCPPort(port: number): this;
|
|
15
|
+
withToken(token: string): this;
|
|
16
|
+
withTimeout(timeoutMs: number): this;
|
|
17
|
+
withKeepAlive(keepAliveMs: number): this;
|
|
18
|
+
/** Build and validate the config */
|
|
19
|
+
build(): Config;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/single/config.ts"],"names":[],"mappings":"AAKA,qBAAa,MAAM;IACf,IAAI,SAAM;IACV,OAAO,SAAK;IACZ,SAAS,SAAM;IACf,OAAO,SAAS;IAChB,SAAS,SAAU;CAEtB;AAED,qBAAa,aAAa;IACtB,OAAO,CAAC,MAAM,CAAgB;IAE9B,OAAO;IAEP,kDAAkD;IAClD,MAAM,CAAC,GAAG,IAAI,aAAa;IAI3B,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAK5B,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAK/B,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAK9B,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAKpC,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IAKxC,oCAAoC;IACpC,KAAK,IAAI,MAAM;CAmBlB"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// src/single/config.ts
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.ConfigBuilder = exports.Config = void 0;
|
|
5
|
+
const err_1 = require("../internal/err");
|
|
6
|
+
const types_1 = require("../types");
|
|
7
|
+
class Config {
|
|
8
|
+
constructor() {
|
|
9
|
+
this.host = '';
|
|
10
|
+
this.tcpPort = 0;
|
|
11
|
+
this.authToken = '';
|
|
12
|
+
this.timeout = 2000; // 2 seconds in ms
|
|
13
|
+
this.keepAlive = 30000; // 30 seconds in ms
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.Config = Config;
|
|
17
|
+
class ConfigBuilder {
|
|
18
|
+
constructor() {
|
|
19
|
+
this.config = new Config();
|
|
20
|
+
}
|
|
21
|
+
/** Create a new builder with sensible defaults */
|
|
22
|
+
static new() {
|
|
23
|
+
return new ConfigBuilder();
|
|
24
|
+
}
|
|
25
|
+
withHost(host) {
|
|
26
|
+
this.config.host = host.trim();
|
|
27
|
+
return this;
|
|
28
|
+
}
|
|
29
|
+
withTCPPort(port) {
|
|
30
|
+
this.config.tcpPort = port;
|
|
31
|
+
return this;
|
|
32
|
+
}
|
|
33
|
+
withToken(token) {
|
|
34
|
+
this.config.authToken = token;
|
|
35
|
+
return this;
|
|
36
|
+
}
|
|
37
|
+
withTimeout(timeoutMs) {
|
|
38
|
+
this.config.timeout = timeoutMs;
|
|
39
|
+
return this;
|
|
40
|
+
}
|
|
41
|
+
withKeepAlive(keepAliveMs) {
|
|
42
|
+
this.config.keepAlive = keepAliveMs;
|
|
43
|
+
return this;
|
|
44
|
+
}
|
|
45
|
+
/** Build and validate the config */
|
|
46
|
+
build() {
|
|
47
|
+
const errors = [];
|
|
48
|
+
if (!this.config.host) {
|
|
49
|
+
errors.push('server address is required');
|
|
50
|
+
}
|
|
51
|
+
if (this.config.tcpPort === 0) {
|
|
52
|
+
errors.push('TCP port is required');
|
|
53
|
+
}
|
|
54
|
+
if (!this.config.authToken) {
|
|
55
|
+
errors.push('authentication requires a token');
|
|
56
|
+
}
|
|
57
|
+
if (errors.length > 0) {
|
|
58
|
+
throw (0, err_1.RzError)(`Config validation failed:\n - ${errors.join('\n - ')}`, types_1.ErrorKind.Client);
|
|
59
|
+
}
|
|
60
|
+
return { ...this.config };
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
exports.ConfigBuilder = ConfigBuilder;
|
|
64
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/single/config.ts"],"names":[],"mappings":";AAAA,uBAAuB;;;AAEvB,yCAA0C;AAC1C,oCAAqC;AAErC,MAAa,MAAM;IAAnB;QACI,SAAI,GAAG,EAAE,CAAC;QACV,YAAO,GAAG,CAAC,CAAC;QACZ,cAAS,GAAG,EAAE,CAAC;QACf,YAAO,GAAG,IAAK,CAAC,CAAC,kBAAkB;QACnC,cAAS,GAAG,KAAM,CAAC,CAAC,mBAAmB;IAE3C,CAAC;CAAA;AAPD,wBAOC;AAED,MAAa,aAAa;IAGtB;QAFQ,WAAM,GAAG,IAAI,MAAM,EAAE,CAAC;IAEN,CAAC;IAEzB,kDAAkD;IAClD,MAAM,CAAC,GAAG;QACN,OAAO,IAAI,aAAa,EAAE,CAAC;IAC/B,CAAC;IAED,QAAQ,CAAC,IAAY;QACjB,IAAI,CAAC,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;QAC/B,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,WAAW,CAAC,IAAY;QACpB,IAAI,CAAC,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC;QAC3B,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,SAAS,CAAC,KAAa;QACnB,IAAI,CAAC,MAAM,CAAC,SAAS,GAAG,KAAK,CAAC;QAC9B,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,WAAW,CAAC,SAAiB;QACzB,IAAI,CAAC,MAAM,CAAC,OAAO,GAAG,SAAS,CAAC;QAChC,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,aAAa,CAAC,WAAmB;QAC7B,IAAI,CAAC,MAAM,CAAC,SAAS,GAAG,WAAW,CAAC;QACpC,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,oCAAoC;IACpC,KAAK;QACD,MAAM,MAAM,GAAa,EAAE,CAAC;QAE5B,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;YACpB,MAAM,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC;QAC9C,CAAC;QACD,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,KAAK,CAAC,EAAE,CAAC;YAC5B,MAAM,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;QACxC,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;YACzB,MAAM,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC;QACnD,CAAC;QAED,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACpB,MAAM,IAAA,aAAO,EAAC,kCAAkC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,iBAAS,CAAC,MAAM,CAAC,CAAC;QAC/F,CAAC;QAED,OAAO,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;IAC9B,CAAC;CACJ;AAvDD,sCAuDC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/single/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,OAAO,CAAC;AAC/C,cAAc,UAAU,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.SingleClient = void 0;
|
|
18
|
+
var api_1 = require("./api");
|
|
19
|
+
Object.defineProperty(exports, "SingleClient", { enumerable: true, get: function () { return api_1.Client; } });
|
|
20
|
+
__exportStar(require("./config"), exports);
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/single/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,6BAA+C;AAAtC,mGAAA,MAAM,OAAgB;AAC/B,2CAAwB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codecs.d.ts","sourceRoot":"","sources":["../../src/types/codecs.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,MAAM,GAAG;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;CAC1B,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,CAavF"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateRateFeatures = validateRateFeatures;
|
|
4
|
+
function validateRateFeatures(codecs, input) {
|
|
5
|
+
const invalid = [];
|
|
6
|
+
for (const rate of input) {
|
|
7
|
+
if (!codecs.rateFeatures.includes(rate)) {
|
|
8
|
+
invalid.push(rate);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
if (invalid.length > 0) {
|
|
12
|
+
return [false, "Invalid rate features: " + invalid.join(", ")];
|
|
13
|
+
}
|
|
14
|
+
return [true, ""];
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=codecs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codecs.js","sourceRoot":"","sources":["../../src/types/codecs.ts"],"names":[],"mappings":";;AAIA,oDAaC;AAbD,SAAgB,oBAAoB,CAAC,MAAc,EAAE,KAAe;IAChE,MAAM,OAAO,GAAa,EAAE,CAAC;IAE7B,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACvB,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YACtC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACvB,CAAC;IACL,CAAC;IAED,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACrB,OAAO,CAAC,KAAK,EAAE,yBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACnE,CAAC;IACD,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AACtB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../src/types/discovery.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,QAAQ,GAAG;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discovery.js","sourceRoot":"","sources":["../../src/types/discovery.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare enum ErrorKind {
|
|
2
|
+
Client = "CLIENT",
|
|
3
|
+
Request = "REQUEST",
|
|
4
|
+
Internal = "INTERNAL",
|
|
5
|
+
Retry = "RETRY"
|
|
6
|
+
}
|
|
7
|
+
export declare class RoomzinError extends Error {
|
|
8
|
+
readonly kind: ErrorKind;
|
|
9
|
+
readonly code: string;
|
|
10
|
+
constructor(kind: ErrorKind, code: string, message: string);
|
|
11
|
+
static readonly Client: RoomzinError;
|
|
12
|
+
static readonly Request: RoomzinError;
|
|
13
|
+
static readonly Internal: RoomzinError;
|
|
14
|
+
static readonly Retry: RoomzinError;
|
|
15
|
+
}
|
|
16
|
+
export declare const IsClient: (e: any) => e is RoomzinError;
|
|
17
|
+
export declare const IsRequest: (e: any) => e is RoomzinError;
|
|
18
|
+
export declare const IsInternal: (e: any) => e is RoomzinError;
|
|
19
|
+
export declare const IsRetry: (e: any) => e is RoomzinError;
|
|
20
|
+
//# sourceMappingURL=err.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"err.d.ts","sourceRoot":"","sources":["../../src/types/err.ts"],"names":[],"mappings":"AAAA,oBAAY,SAAS;IACjB,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,QAAQ,aAAa;IACrB,KAAK,UAAU;CAClB;AAED,qBAAa,YAAa,SAAQ,KAAK;IACnC,SAAgB,IAAI,EAAE,SAAS,CAAC;IAChC,SAAgB,IAAI,EAAE,MAAM,CAAC;gBAEjB,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;IAS1D,MAAM,CAAC,QAAQ,CAAC,MAAM,eAA0D;IAChF,MAAM,CAAC,QAAQ,CAAC,OAAO,eAA4D;IACnF,MAAM,CAAC,QAAQ,CAAC,QAAQ,eAA8D;IACtF,MAAM,CAAC,QAAQ,CAAC,KAAK,eAAwD;CAChF;AAGD,eAAO,MAAM,QAAQ,GAAI,GAAG,GAAG,KAAG,CAAC,IAAI,YAA2C,CAAC;AACnF,eAAO,MAAM,SAAS,GAAI,GAAG,GAAG,KAAG,CAAC,IAAI,YAA4C,CAAC;AACrF,eAAO,MAAM,UAAU,GAAI,GAAG,GAAG,KAAG,CAAC,IAAI,YAA6C,CAAC;AACvF,eAAO,MAAM,OAAO,GAAI,GAAG,GAAG,KAAG,CAAC,IAAI,YAA0C,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IsRetry = exports.IsInternal = exports.IsRequest = exports.IsClient = exports.RoomzinError = exports.ErrorKind = void 0;
|
|
4
|
+
var ErrorKind;
|
|
5
|
+
(function (ErrorKind) {
|
|
6
|
+
ErrorKind["Client"] = "CLIENT";
|
|
7
|
+
ErrorKind["Request"] = "REQUEST";
|
|
8
|
+
ErrorKind["Internal"] = "INTERNAL";
|
|
9
|
+
ErrorKind["Retry"] = "RETRY";
|
|
10
|
+
})(ErrorKind || (exports.ErrorKind = ErrorKind = {}));
|
|
11
|
+
class RoomzinError extends Error {
|
|
12
|
+
constructor(kind, code, message) {
|
|
13
|
+
super(`${code}:${message}`); // same string format as Go
|
|
14
|
+
this.name = 'RoomzinError';
|
|
15
|
+
this.kind = kind;
|
|
16
|
+
this.code = code;
|
|
17
|
+
Object.setPrototypeOf(this, RoomzinError.prototype); // instanceof works across realms
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.RoomzinError = RoomzinError;
|
|
21
|
+
/* allow errors.is(err, RoomzinError.Client) usage */
|
|
22
|
+
RoomzinError.Client = new RoomzinError(ErrorKind.Client, 'CLIENT_ERROR', '');
|
|
23
|
+
RoomzinError.Request = new RoomzinError(ErrorKind.Request, 'REQUEST_ERROR', '');
|
|
24
|
+
RoomzinError.Internal = new RoomzinError(ErrorKind.Internal, 'INTERNAL_ERROR', '');
|
|
25
|
+
RoomzinError.Retry = new RoomzinError(ErrorKind.Retry, 'RETRY_ERROR', '');
|
|
26
|
+
/* ---------- user-facing helpers ---------- */
|
|
27
|
+
const IsClient = (e) => isKind(e, ErrorKind.Client);
|
|
28
|
+
exports.IsClient = IsClient;
|
|
29
|
+
const IsRequest = (e) => isKind(e, ErrorKind.Request);
|
|
30
|
+
exports.IsRequest = IsRequest;
|
|
31
|
+
const IsInternal = (e) => isKind(e, ErrorKind.Internal);
|
|
32
|
+
exports.IsInternal = IsInternal;
|
|
33
|
+
const IsRetry = (e) => isKind(e, ErrorKind.Retry);
|
|
34
|
+
exports.IsRetry = IsRetry;
|
|
35
|
+
function isKind(err, want) {
|
|
36
|
+
return err instanceof RoomzinError && err.kind === want;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=err.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"err.js","sourceRoot":"","sources":["../../src/types/err.ts"],"names":[],"mappings":";;;AAAA,IAAY,SAKX;AALD,WAAY,SAAS;IACjB,8BAAiB,CAAA;IACjB,gCAAmB,CAAA;IACnB,kCAAqB,CAAA;IACrB,4BAAe,CAAA;AACnB,CAAC,EALW,SAAS,yBAAT,SAAS,QAKpB;AAED,MAAa,YAAa,SAAQ,KAAK;IAInC,YAAY,IAAe,EAAE,IAAY,EAAE,OAAe;QACtD,KAAK,CAAC,GAAG,IAAI,IAAI,OAAO,EAAE,CAAC,CAAC,CAAG,2BAA2B;QAC1D,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC;QAC3B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,MAAM,CAAC,cAAc,CAAC,IAAI,EAA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/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA;AAC1B,cAAc,OAAO,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./codecs"), exports);
|
|
18
|
+
__exportStar(require("./request"), exports);
|
|
19
|
+
__exportStar(require("./response"), exports);
|
|
20
|
+
__exportStar(require("./err"), exports);
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAwB;AACxB,4CAAyB;AACzB,6CAA0B;AAC1B,wCAAqB"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
export declare function validateDate(date: string): [boolean, string];
|
|
2
|
+
export declare function validateDates(dates: string[]): [boolean, string];
|
|
3
|
+
export type LoginPayload = {
|
|
4
|
+
token: string;
|
|
5
|
+
};
|
|
6
|
+
export declare function verifyLoginPayload(p: LoginPayload): [boolean, string];
|
|
7
|
+
export type SetPropPayload = {
|
|
8
|
+
segment: string;
|
|
9
|
+
area: string;
|
|
10
|
+
propertyID: string;
|
|
11
|
+
propertyType: string;
|
|
12
|
+
category: string;
|
|
13
|
+
stars: number;
|
|
14
|
+
latitude: number;
|
|
15
|
+
longitude: number;
|
|
16
|
+
amenities: string[];
|
|
17
|
+
};
|
|
18
|
+
export declare function verifySetPropPayload(p: SetPropPayload, codecs: any): [boolean, string];
|
|
19
|
+
export type PropRoomExistPayload = {
|
|
20
|
+
propertyID: string;
|
|
21
|
+
roomType: string;
|
|
22
|
+
};
|
|
23
|
+
export type DelPropRoomPayload = {
|
|
24
|
+
propertyID: string;
|
|
25
|
+
roomType: string;
|
|
26
|
+
};
|
|
27
|
+
export type PropRoomDateListPayload = {
|
|
28
|
+
propertyID: string;
|
|
29
|
+
roomType: string;
|
|
30
|
+
};
|
|
31
|
+
export type DelRoomDayRequest = {
|
|
32
|
+
propertyID: string;
|
|
33
|
+
roomType: string;
|
|
34
|
+
date: string;
|
|
35
|
+
};
|
|
36
|
+
export declare function verifyDelRoomDayRequest(p: DelRoomDayRequest): [boolean, string];
|
|
37
|
+
export type UpdRoomAvlPayload = {
|
|
38
|
+
propertyID: string;
|
|
39
|
+
roomType: string;
|
|
40
|
+
date: string;
|
|
41
|
+
amount: number;
|
|
42
|
+
};
|
|
43
|
+
export declare function verifyUpdRoomAvlPayload(p: UpdRoomAvlPayload): [boolean, string];
|
|
44
|
+
export type SetRoomPkgPayload = {
|
|
45
|
+
propertyID: string;
|
|
46
|
+
roomType: string;
|
|
47
|
+
date: string;
|
|
48
|
+
availability?: number;
|
|
49
|
+
finalPrice?: number;
|
|
50
|
+
rateFeature: string[];
|
|
51
|
+
};
|
|
52
|
+
export declare function verifySetRoomPkgPayload(p: SetRoomPkgPayload, codecs: any): [boolean, string];
|
|
53
|
+
export type GetRoomDayRequest = {
|
|
54
|
+
propertyID: string;
|
|
55
|
+
roomType: string;
|
|
56
|
+
date: string;
|
|
57
|
+
};
|
|
58
|
+
export declare function verifyGetRoomDayRequest(p: GetRoomDayRequest): [boolean, string];
|
|
59
|
+
export type SearchPropPayload = {
|
|
60
|
+
segment: string;
|
|
61
|
+
area?: string;
|
|
62
|
+
type?: string;
|
|
63
|
+
stars?: number;
|
|
64
|
+
category?: string;
|
|
65
|
+
amenities?: string[];
|
|
66
|
+
longitude?: number;
|
|
67
|
+
latitude?: number;
|
|
68
|
+
limit?: number;
|
|
69
|
+
};
|
|
70
|
+
export declare function verifySearchPropPayload(p: SearchPropPayload, codecs: any): [boolean, string];
|
|
71
|
+
export type SearchAvailPayload = {
|
|
72
|
+
segment: string;
|
|
73
|
+
roomType: string;
|
|
74
|
+
area?: string;
|
|
75
|
+
propertyID?: string;
|
|
76
|
+
type?: string;
|
|
77
|
+
stars?: number;
|
|
78
|
+
category?: string;
|
|
79
|
+
amenities: string[];
|
|
80
|
+
longitude?: number;
|
|
81
|
+
latitude?: number;
|
|
82
|
+
date: string[];
|
|
83
|
+
availability?: number;
|
|
84
|
+
finalPrice?: number;
|
|
85
|
+
rateFeature: string[];
|
|
86
|
+
limit?: number;
|
|
87
|
+
};
|
|
88
|
+
export declare function verifySearchAvailPayload(p: SearchAvailPayload, codecs: any): [boolean, string];
|
|
89
|
+
export type DelPropDayRequest = {
|
|
90
|
+
propertyID: string;
|
|
91
|
+
date: string;
|
|
92
|
+
};
|
|
93
|
+
export declare function verifyDelPropDayRequest(p: DelPropDayRequest): [boolean, string];
|
|
94
|
+
//# sourceMappingURL=request.d.ts.map
|