@seamapi/http 1.70.0 → 1.72.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/dist/connect.cjs +159 -0
- package/dist/connect.cjs.map +1 -1
- package/dist/connect.d.cts +48 -3
- package/dist/index.cjs +161 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/lib/seam/connect/routes/seam/customer/v1/index.d.ts +1 -0
- package/lib/seam/connect/routes/seam/customer/v1/index.js +1 -0
- package/lib/seam/connect/routes/seam/customer/v1/index.js.map +1 -1
- package/lib/seam/connect/routes/seam/customer/v1/reservations/index.d.ts +1 -0
- package/lib/seam/connect/routes/seam/customer/v1/reservations/index.js +6 -0
- package/lib/seam/connect/routes/seam/customer/v1/reservations/index.js.map +1 -0
- package/lib/seam/connect/routes/seam/customer/v1/reservations/reservations.d.ts +47 -0
- package/lib/seam/connect/routes/seam/customer/v1/reservations/reservations.js +116 -0
- package/lib/seam/connect/routes/seam/customer/v1/reservations/reservations.js.map +1 -0
- package/lib/seam/connect/routes/seam/customer/v1/v1.d.ts +2 -0
- package/lib/seam/connect/routes/seam/customer/v1/v1.js +4 -0
- package/lib/seam/connect/routes/seam/customer/v1/v1.js.map +1 -1
- package/lib/seam/connect/routes/seam-http-endpoints.d.ts +5 -2
- package/lib/seam/connect/routes/seam-http-endpoints.js +21 -0
- package/lib/seam/connect/routes/seam-http-endpoints.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +3 -3
- package/src/lib/seam/connect/routes/seam/customer/v1/index.ts +1 -0
- package/src/lib/seam/connect/routes/seam/customer/v1/reservations/index.ts +6 -0
- package/src/lib/seam/connect/routes/seam/customer/v1/reservations/reservations.ts +255 -0
- package/src/lib/seam/connect/routes/seam/customer/v1/v1.ts +8 -0
- package/src/lib/seam/connect/routes/seam-http-endpoints.ts +54 -0
- package/src/lib/version.ts +1 -1
package/dist/connect.cjs
CHANGED
|
@@ -6081,6 +6081,128 @@ var SeamHttpSeamCustomerV1Portals = class _SeamHttpSeamCustomerV1Portals {
|
|
|
6081
6081
|
}
|
|
6082
6082
|
};
|
|
6083
6083
|
|
|
6084
|
+
// src/lib/seam/connect/routes/seam/customer/v1/reservations/reservations.ts
|
|
6085
|
+
var SeamHttpSeamCustomerV1Reservations = class _SeamHttpSeamCustomerV1Reservations {
|
|
6086
|
+
client;
|
|
6087
|
+
defaults;
|
|
6088
|
+
ltsVersion = seamApiLtsVersion;
|
|
6089
|
+
static ltsVersion = seamApiLtsVersion;
|
|
6090
|
+
constructor(apiKeyOrOptions = {}) {
|
|
6091
|
+
const options = parseOptions(apiKeyOrOptions);
|
|
6092
|
+
if (!options.isUndocumentedApiEnabled) {
|
|
6093
|
+
throw new Error(
|
|
6094
|
+
"Cannot use undocumented API without isUndocumentedApiEnabled"
|
|
6095
|
+
);
|
|
6096
|
+
}
|
|
6097
|
+
this.client = "client" in options ? options.client : createClient(options);
|
|
6098
|
+
this.defaults = limitToSeamHttpRequestOptions(options);
|
|
6099
|
+
}
|
|
6100
|
+
static fromClient(client, options = {}) {
|
|
6101
|
+
const constructorOptions = { ...options, client };
|
|
6102
|
+
if (!isSeamHttpOptionsWithClient(constructorOptions)) {
|
|
6103
|
+
throw new SeamHttpInvalidOptionsError("Missing client");
|
|
6104
|
+
}
|
|
6105
|
+
return new _SeamHttpSeamCustomerV1Reservations(constructorOptions);
|
|
6106
|
+
}
|
|
6107
|
+
static fromApiKey(apiKey, options = {}) {
|
|
6108
|
+
const constructorOptions = { ...options, apiKey };
|
|
6109
|
+
if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
|
|
6110
|
+
throw new SeamHttpInvalidOptionsError("Missing apiKey");
|
|
6111
|
+
}
|
|
6112
|
+
return new _SeamHttpSeamCustomerV1Reservations(constructorOptions);
|
|
6113
|
+
}
|
|
6114
|
+
static fromClientSessionToken(clientSessionToken, options = {}) {
|
|
6115
|
+
const constructorOptions = { ...options, clientSessionToken };
|
|
6116
|
+
if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
|
|
6117
|
+
throw new SeamHttpInvalidOptionsError("Missing clientSessionToken");
|
|
6118
|
+
}
|
|
6119
|
+
return new _SeamHttpSeamCustomerV1Reservations(constructorOptions);
|
|
6120
|
+
}
|
|
6121
|
+
static async fromPublishableKey(publishableKey, userIdentifierKey, options = {}) {
|
|
6122
|
+
warnOnInsecureuserIdentifierKey(userIdentifierKey);
|
|
6123
|
+
const clientOptions = parseOptions({ ...options, publishableKey });
|
|
6124
|
+
if (isSeamHttpOptionsWithClient(clientOptions)) {
|
|
6125
|
+
throw new SeamHttpInvalidOptionsError(
|
|
6126
|
+
"The client option cannot be used with SeamHttpSeamCustomerV1Reservations.fromPublishableKey"
|
|
6127
|
+
);
|
|
6128
|
+
}
|
|
6129
|
+
const client = createClient(clientOptions);
|
|
6130
|
+
const clientSessions = SeamHttpClientSessions.fromClient(client);
|
|
6131
|
+
const { token } = await clientSessions.getOrCreate({
|
|
6132
|
+
user_identifier_key: userIdentifierKey
|
|
6133
|
+
});
|
|
6134
|
+
return _SeamHttpSeamCustomerV1Reservations.fromClientSessionToken(
|
|
6135
|
+
token,
|
|
6136
|
+
options
|
|
6137
|
+
);
|
|
6138
|
+
}
|
|
6139
|
+
static fromConsoleSessionToken(consoleSessionToken, workspaceId, options = {}) {
|
|
6140
|
+
const constructorOptions = { ...options, consoleSessionToken, workspaceId };
|
|
6141
|
+
if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) {
|
|
6142
|
+
throw new SeamHttpInvalidOptionsError(
|
|
6143
|
+
"Missing consoleSessionToken or workspaceId"
|
|
6144
|
+
);
|
|
6145
|
+
}
|
|
6146
|
+
return new _SeamHttpSeamCustomerV1Reservations(constructorOptions);
|
|
6147
|
+
}
|
|
6148
|
+
static fromPersonalAccessToken(personalAccessToken, workspaceId, options = {}) {
|
|
6149
|
+
const constructorOptions = { ...options, personalAccessToken, workspaceId };
|
|
6150
|
+
if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) {
|
|
6151
|
+
throw new SeamHttpInvalidOptionsError(
|
|
6152
|
+
"Missing personalAccessToken or workspaceId"
|
|
6153
|
+
);
|
|
6154
|
+
}
|
|
6155
|
+
return new _SeamHttpSeamCustomerV1Reservations(constructorOptions);
|
|
6156
|
+
}
|
|
6157
|
+
createPaginator(request) {
|
|
6158
|
+
return new SeamPaginator(this, request);
|
|
6159
|
+
}
|
|
6160
|
+
async updateClientSessionToken(clientSessionToken) {
|
|
6161
|
+
const { headers } = this.client.defaults;
|
|
6162
|
+
const authHeaders = getAuthHeadersForClientSessionToken({
|
|
6163
|
+
clientSessionToken
|
|
6164
|
+
});
|
|
6165
|
+
for (const key of Object.keys(authHeaders)) {
|
|
6166
|
+
if (headers[key] == null) {
|
|
6167
|
+
throw new Error(
|
|
6168
|
+
"Cannot update a clientSessionToken on a client created without a clientSessionToken"
|
|
6169
|
+
);
|
|
6170
|
+
}
|
|
6171
|
+
}
|
|
6172
|
+
this.client.defaults.headers = { ...headers, ...authHeaders };
|
|
6173
|
+
const clientSessions = SeamHttpClientSessions.fromClient(this.client);
|
|
6174
|
+
await clientSessions.get();
|
|
6175
|
+
}
|
|
6176
|
+
get(parameters, options = {}) {
|
|
6177
|
+
if (!this.defaults.isUndocumentedApiEnabled) {
|
|
6178
|
+
throw new Error(
|
|
6179
|
+
"Cannot use undocumented API without isUndocumentedApiEnabled"
|
|
6180
|
+
);
|
|
6181
|
+
}
|
|
6182
|
+
return new SeamHttpRequest(this, {
|
|
6183
|
+
pathname: "/seam/customer/v1/reservations/get",
|
|
6184
|
+
method: "POST",
|
|
6185
|
+
body: parameters,
|
|
6186
|
+
responseKey: "reservation",
|
|
6187
|
+
options
|
|
6188
|
+
});
|
|
6189
|
+
}
|
|
6190
|
+
list(parameters, options = {}) {
|
|
6191
|
+
if (!this.defaults.isUndocumentedApiEnabled) {
|
|
6192
|
+
throw new Error(
|
|
6193
|
+
"Cannot use undocumented API without isUndocumentedApiEnabled"
|
|
6194
|
+
);
|
|
6195
|
+
}
|
|
6196
|
+
return new SeamHttpRequest(this, {
|
|
6197
|
+
pathname: "/seam/customer/v1/reservations/list",
|
|
6198
|
+
method: "POST",
|
|
6199
|
+
body: parameters,
|
|
6200
|
+
responseKey: "reservations",
|
|
6201
|
+
options
|
|
6202
|
+
});
|
|
6203
|
+
}
|
|
6204
|
+
};
|
|
6205
|
+
|
|
6084
6206
|
// src/lib/seam/connect/routes/seam/customer/v1/settings/settings.ts
|
|
6085
6207
|
var SeamHttpSeamCustomerV1Settings = class _SeamHttpSeamCustomerV1Settings {
|
|
6086
6208
|
client;
|
|
@@ -6307,6 +6429,12 @@ var SeamHttpSeamCustomerV1 = class _SeamHttpSeamCustomerV1 {
|
|
|
6307
6429
|
get portals() {
|
|
6308
6430
|
return SeamHttpSeamCustomerV1Portals.fromClient(this.client, this.defaults);
|
|
6309
6431
|
}
|
|
6432
|
+
get reservations() {
|
|
6433
|
+
return SeamHttpSeamCustomerV1Reservations.fromClient(
|
|
6434
|
+
this.client,
|
|
6435
|
+
this.defaults
|
|
6436
|
+
);
|
|
6437
|
+
}
|
|
6310
6438
|
get settings() {
|
|
6311
6439
|
return SeamHttpSeamCustomerV1Settings.fromClient(this.client, this.defaults);
|
|
6312
6440
|
}
|
|
@@ -9704,6 +9832,36 @@ var SeamHttpEndpoints = class _SeamHttpEndpoints {
|
|
|
9704
9832
|
return seam.get(...args);
|
|
9705
9833
|
};
|
|
9706
9834
|
}
|
|
9835
|
+
get "/seam/customer/v1/reservations/get"() {
|
|
9836
|
+
const { client, defaults } = this;
|
|
9837
|
+
if (!this.defaults.isUndocumentedApiEnabled) {
|
|
9838
|
+
throw new Error(
|
|
9839
|
+
"Cannot use undocumented API without isUndocumentedApiEnabled"
|
|
9840
|
+
);
|
|
9841
|
+
}
|
|
9842
|
+
return function seamCustomerV1ReservationsGet(...args) {
|
|
9843
|
+
const seam = SeamHttpSeamCustomerV1Reservations.fromClient(
|
|
9844
|
+
client,
|
|
9845
|
+
defaults
|
|
9846
|
+
);
|
|
9847
|
+
return seam.get(...args);
|
|
9848
|
+
};
|
|
9849
|
+
}
|
|
9850
|
+
get "/seam/customer/v1/reservations/list"() {
|
|
9851
|
+
const { client, defaults } = this;
|
|
9852
|
+
if (!this.defaults.isUndocumentedApiEnabled) {
|
|
9853
|
+
throw new Error(
|
|
9854
|
+
"Cannot use undocumented API without isUndocumentedApiEnabled"
|
|
9855
|
+
);
|
|
9856
|
+
}
|
|
9857
|
+
return function seamCustomerV1ReservationsList(...args) {
|
|
9858
|
+
const seam = SeamHttpSeamCustomerV1Reservations.fromClient(
|
|
9859
|
+
client,
|
|
9860
|
+
defaults
|
|
9861
|
+
);
|
|
9862
|
+
return seam.list(...args);
|
|
9863
|
+
};
|
|
9864
|
+
}
|
|
9707
9865
|
get "/seam/customer/v1/settings/get"() {
|
|
9708
9866
|
const { client, defaults } = this;
|
|
9709
9867
|
if (!this.defaults.isUndocumentedApiEnabled) {
|
|
@@ -10521,6 +10679,7 @@ exports.SeamHttpSeamCustomerV1AutomationRuns = SeamHttpSeamCustomerV1AutomationR
|
|
|
10521
10679
|
exports.SeamHttpSeamCustomerV1Automations = SeamHttpSeamCustomerV1Automations;
|
|
10522
10680
|
exports.SeamHttpSeamCustomerV1Events = SeamHttpSeamCustomerV1Events;
|
|
10523
10681
|
exports.SeamHttpSeamCustomerV1Portals = SeamHttpSeamCustomerV1Portals;
|
|
10682
|
+
exports.SeamHttpSeamCustomerV1Reservations = SeamHttpSeamCustomerV1Reservations;
|
|
10524
10683
|
exports.SeamHttpSeamCustomerV1Settings = SeamHttpSeamCustomerV1Settings;
|
|
10525
10684
|
exports.SeamHttpSeamPartnerV1BuildingBlocks = SeamHttpSeamPartnerV1BuildingBlocks;
|
|
10526
10685
|
exports.SeamHttpSeamPartnerV1BuildingBlocksSpaces = SeamHttpSeamPartnerV1BuildingBlocksSpaces;
|