@seamapi/http 1.70.0 → 1.71.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.
Files changed (30) hide show
  1. package/dist/connect.cjs +130 -0
  2. package/dist/connect.cjs.map +1 -1
  3. package/dist/connect.d.cts +34 -3
  4. package/dist/index.cjs +132 -0
  5. package/dist/index.cjs.map +1 -1
  6. package/dist/index.d.cts +1 -1
  7. package/lib/seam/connect/routes/seam/customer/v1/index.d.ts +1 -0
  8. package/lib/seam/connect/routes/seam/customer/v1/index.js +1 -0
  9. package/lib/seam/connect/routes/seam/customer/v1/index.js.map +1 -1
  10. package/lib/seam/connect/routes/seam/customer/v1/reservations/index.d.ts +1 -0
  11. package/lib/seam/connect/routes/seam/customer/v1/reservations/index.js +6 -0
  12. package/lib/seam/connect/routes/seam/customer/v1/reservations/index.js.map +1 -0
  13. package/lib/seam/connect/routes/seam/customer/v1/reservations/reservations.d.ts +34 -0
  14. package/lib/seam/connect/routes/seam/customer/v1/reservations/reservations.js +104 -0
  15. package/lib/seam/connect/routes/seam/customer/v1/reservations/reservations.js.map +1 -0
  16. package/lib/seam/connect/routes/seam/customer/v1/v1.d.ts +2 -0
  17. package/lib/seam/connect/routes/seam/customer/v1/v1.js +4 -0
  18. package/lib/seam/connect/routes/seam/customer/v1/v1.js.map +1 -1
  19. package/lib/seam/connect/routes/seam-http-endpoints.d.ts +4 -2
  20. package/lib/seam/connect/routes/seam-http-endpoints.js +11 -0
  21. package/lib/seam/connect/routes/seam-http-endpoints.js.map +1 -1
  22. package/lib/version.d.ts +1 -1
  23. package/lib/version.js +1 -1
  24. package/package.json +3 -3
  25. package/src/lib/seam/connect/routes/seam/customer/v1/index.ts +1 -0
  26. package/src/lib/seam/connect/routes/seam/customer/v1/reservations/index.ts +6 -0
  27. package/src/lib/seam/connect/routes/seam/customer/v1/reservations/reservations.ts +214 -0
  28. package/src/lib/seam/connect/routes/seam/customer/v1/v1.ts +8 -0
  29. package/src/lib/seam/connect/routes/seam-http-endpoints.ts +29 -0
  30. package/src/lib/version.ts +1 -1
package/dist/connect.cjs CHANGED
@@ -6081,6 +6081,114 @@ 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
+ list(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/list",
6184
+ method: "POST",
6185
+ body: parameters,
6186
+ responseKey: "reservations",
6187
+ options
6188
+ });
6189
+ }
6190
+ };
6191
+
6084
6192
  // src/lib/seam/connect/routes/seam/customer/v1/settings/settings.ts
6085
6193
  var SeamHttpSeamCustomerV1Settings = class _SeamHttpSeamCustomerV1Settings {
6086
6194
  client;
@@ -6307,6 +6415,12 @@ var SeamHttpSeamCustomerV1 = class _SeamHttpSeamCustomerV1 {
6307
6415
  get portals() {
6308
6416
  return SeamHttpSeamCustomerV1Portals.fromClient(this.client, this.defaults);
6309
6417
  }
6418
+ get reservations() {
6419
+ return SeamHttpSeamCustomerV1Reservations.fromClient(
6420
+ this.client,
6421
+ this.defaults
6422
+ );
6423
+ }
6310
6424
  get settings() {
6311
6425
  return SeamHttpSeamCustomerV1Settings.fromClient(this.client, this.defaults);
6312
6426
  }
@@ -9704,6 +9818,21 @@ var SeamHttpEndpoints = class _SeamHttpEndpoints {
9704
9818
  return seam.get(...args);
9705
9819
  };
9706
9820
  }
9821
+ get "/seam/customer/v1/reservations/list"() {
9822
+ const { client, defaults } = this;
9823
+ if (!this.defaults.isUndocumentedApiEnabled) {
9824
+ throw new Error(
9825
+ "Cannot use undocumented API without isUndocumentedApiEnabled"
9826
+ );
9827
+ }
9828
+ return function seamCustomerV1ReservationsList(...args) {
9829
+ const seam = SeamHttpSeamCustomerV1Reservations.fromClient(
9830
+ client,
9831
+ defaults
9832
+ );
9833
+ return seam.list(...args);
9834
+ };
9835
+ }
9707
9836
  get "/seam/customer/v1/settings/get"() {
9708
9837
  const { client, defaults } = this;
9709
9838
  if (!this.defaults.isUndocumentedApiEnabled) {
@@ -10521,6 +10650,7 @@ exports.SeamHttpSeamCustomerV1AutomationRuns = SeamHttpSeamCustomerV1AutomationR
10521
10650
  exports.SeamHttpSeamCustomerV1Automations = SeamHttpSeamCustomerV1Automations;
10522
10651
  exports.SeamHttpSeamCustomerV1Events = SeamHttpSeamCustomerV1Events;
10523
10652
  exports.SeamHttpSeamCustomerV1Portals = SeamHttpSeamCustomerV1Portals;
10653
+ exports.SeamHttpSeamCustomerV1Reservations = SeamHttpSeamCustomerV1Reservations;
10524
10654
  exports.SeamHttpSeamCustomerV1Settings = SeamHttpSeamCustomerV1Settings;
10525
10655
  exports.SeamHttpSeamPartnerV1BuildingBlocks = SeamHttpSeamPartnerV1BuildingBlocks;
10526
10656
  exports.SeamHttpSeamPartnerV1BuildingBlocksSpaces = SeamHttpSeamPartnerV1BuildingBlocksSpaces;