@seamapi/http 1.74.0 → 1.76.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 (33) hide show
  1. package/dist/connect.cjs +107 -6
  2. package/dist/connect.cjs.map +1 -1
  3. package/dist/connect.d.cts +33 -2
  4. package/dist/index.cjs +109 -6
  5. package/dist/index.cjs.map +1 -1
  6. package/dist/index.d.cts +1 -1
  7. package/lib/seam/connect/routes/connected-accounts/connected-accounts.js +1 -1
  8. package/lib/seam/connect/routes/connected-accounts/connected-accounts.js.map +1 -1
  9. package/lib/seam/connect/routes/seam/customer/v1/index.d.ts +1 -0
  10. package/lib/seam/connect/routes/seam/customer/v1/index.js +1 -0
  11. package/lib/seam/connect/routes/seam/customer/v1/index.js.map +1 -1
  12. package/lib/seam/connect/routes/seam/customer/v1/spaces/index.d.ts +1 -0
  13. package/lib/seam/connect/routes/seam/customer/v1/spaces/index.js +6 -0
  14. package/lib/seam/connect/routes/seam/customer/v1/spaces/index.js.map +1 -0
  15. package/lib/seam/connect/routes/seam/customer/v1/spaces/spaces.d.ts +34 -0
  16. package/lib/seam/connect/routes/seam/customer/v1/spaces/spaces.js +98 -0
  17. package/lib/seam/connect/routes/seam/customer/v1/spaces/spaces.js.map +1 -0
  18. package/lib/seam/connect/routes/seam/customer/v1/v1.d.ts +2 -0
  19. package/lib/seam/connect/routes/seam/customer/v1/v1.js +4 -3
  20. package/lib/seam/connect/routes/seam/customer/v1/v1.js.map +1 -1
  21. package/lib/seam/connect/routes/seam-http-endpoints.d.ts +3 -1
  22. package/lib/seam/connect/routes/seam-http-endpoints.js +8 -0
  23. package/lib/seam/connect/routes/seam-http-endpoints.js.map +1 -1
  24. package/lib/version.d.ts +1 -1
  25. package/lib/version.js +1 -1
  26. package/package.json +3 -3
  27. package/src/lib/seam/connect/routes/connected-accounts/connected-accounts.ts +1 -1
  28. package/src/lib/seam/connect/routes/seam/customer/v1/index.ts +1 -0
  29. package/src/lib/seam/connect/routes/seam/customer/v1/spaces/index.ts +6 -0
  30. package/src/lib/seam/connect/routes/seam/customer/v1/spaces/spaces.ts +201 -0
  31. package/src/lib/seam/connect/routes/seam/customer/v1/v1.ts +5 -5
  32. package/src/lib/seam/connect/routes/seam-http-endpoints.ts +20 -0
  33. package/src/lib/version.ts +1 -1
package/dist/connect.cjs CHANGED
@@ -4028,7 +4028,7 @@ var SeamHttpConnectedAccounts = class _SeamHttpConnectedAccounts {
4028
4028
  update(parameters, options = {}) {
4029
4029
  return new SeamHttpRequest(this, {
4030
4030
  pathname: "/connected_accounts/update",
4031
- method: "POST",
4031
+ method: "PATCH",
4032
4032
  body: parameters,
4033
4033
  responseKey: void 0,
4034
4034
  options
@@ -6536,19 +6536,109 @@ var SeamHttpSeamCustomerV1Settings = class _SeamHttpSeamCustomerV1Settings {
6536
6536
  }
6537
6537
  };
6538
6538
 
6539
- // src/lib/seam/connect/routes/seam/customer/v1/v1.ts
6540
- var SeamHttpSeamCustomerV1 = class _SeamHttpSeamCustomerV1 {
6539
+ // src/lib/seam/connect/routes/seam/customer/v1/spaces/spaces.ts
6540
+ var SeamHttpSeamCustomerV1Spaces = class _SeamHttpSeamCustomerV1Spaces {
6541
6541
  client;
6542
6542
  defaults;
6543
6543
  ltsVersion = seamApiLtsVersion;
6544
6544
  static ltsVersion = seamApiLtsVersion;
6545
6545
  constructor(apiKeyOrOptions = {}) {
6546
6546
  const options = parseOptions(apiKeyOrOptions);
6547
- if (!options.isUndocumentedApiEnabled) {
6548
- throw new Error(
6549
- "Cannot use undocumented API without isUndocumentedApiEnabled"
6547
+ this.client = "client" in options ? options.client : createClient(options);
6548
+ this.defaults = limitToSeamHttpRequestOptions(options);
6549
+ }
6550
+ static fromClient(client, options = {}) {
6551
+ const constructorOptions = { ...options, client };
6552
+ if (!isSeamHttpOptionsWithClient(constructorOptions)) {
6553
+ throw new SeamHttpInvalidOptionsError("Missing client");
6554
+ }
6555
+ return new _SeamHttpSeamCustomerV1Spaces(constructorOptions);
6556
+ }
6557
+ static fromApiKey(apiKey, options = {}) {
6558
+ const constructorOptions = { ...options, apiKey };
6559
+ if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
6560
+ throw new SeamHttpInvalidOptionsError("Missing apiKey");
6561
+ }
6562
+ return new _SeamHttpSeamCustomerV1Spaces(constructorOptions);
6563
+ }
6564
+ static fromClientSessionToken(clientSessionToken, options = {}) {
6565
+ const constructorOptions = { ...options, clientSessionToken };
6566
+ if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
6567
+ throw new SeamHttpInvalidOptionsError("Missing clientSessionToken");
6568
+ }
6569
+ return new _SeamHttpSeamCustomerV1Spaces(constructorOptions);
6570
+ }
6571
+ static async fromPublishableKey(publishableKey, userIdentifierKey, options = {}) {
6572
+ warnOnInsecureuserIdentifierKey(userIdentifierKey);
6573
+ const clientOptions = parseOptions({ ...options, publishableKey });
6574
+ if (isSeamHttpOptionsWithClient(clientOptions)) {
6575
+ throw new SeamHttpInvalidOptionsError(
6576
+ "The client option cannot be used with SeamHttpSeamCustomerV1Spaces.fromPublishableKey"
6577
+ );
6578
+ }
6579
+ const client = createClient(clientOptions);
6580
+ const clientSessions = SeamHttpClientSessions.fromClient(client);
6581
+ const { token } = await clientSessions.getOrCreate({
6582
+ user_identifier_key: userIdentifierKey
6583
+ });
6584
+ return _SeamHttpSeamCustomerV1Spaces.fromClientSessionToken(token, options);
6585
+ }
6586
+ static fromConsoleSessionToken(consoleSessionToken, workspaceId, options = {}) {
6587
+ const constructorOptions = { ...options, consoleSessionToken, workspaceId };
6588
+ if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) {
6589
+ throw new SeamHttpInvalidOptionsError(
6590
+ "Missing consoleSessionToken or workspaceId"
6591
+ );
6592
+ }
6593
+ return new _SeamHttpSeamCustomerV1Spaces(constructorOptions);
6594
+ }
6595
+ static fromPersonalAccessToken(personalAccessToken, workspaceId, options = {}) {
6596
+ const constructorOptions = { ...options, personalAccessToken, workspaceId };
6597
+ if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) {
6598
+ throw new SeamHttpInvalidOptionsError(
6599
+ "Missing personalAccessToken or workspaceId"
6550
6600
  );
6551
6601
  }
6602
+ return new _SeamHttpSeamCustomerV1Spaces(constructorOptions);
6603
+ }
6604
+ createPaginator(request) {
6605
+ return new SeamPaginator(this, request);
6606
+ }
6607
+ async updateClientSessionToken(clientSessionToken) {
6608
+ const { headers } = this.client.defaults;
6609
+ const authHeaders = getAuthHeadersForClientSessionToken({
6610
+ clientSessionToken
6611
+ });
6612
+ for (const key of Object.keys(authHeaders)) {
6613
+ if (headers[key] == null) {
6614
+ throw new Error(
6615
+ "Cannot update a clientSessionToken on a client created without a clientSessionToken"
6616
+ );
6617
+ }
6618
+ }
6619
+ this.client.defaults.headers = { ...headers, ...authHeaders };
6620
+ const clientSessions = SeamHttpClientSessions.fromClient(this.client);
6621
+ await clientSessions.get();
6622
+ }
6623
+ create(parameters, options = {}) {
6624
+ return new SeamHttpRequest(this, {
6625
+ pathname: "/seam/customer/v1/spaces/create",
6626
+ method: "POST",
6627
+ body: parameters,
6628
+ responseKey: "space",
6629
+ options
6630
+ });
6631
+ }
6632
+ };
6633
+
6634
+ // src/lib/seam/connect/routes/seam/customer/v1/v1.ts
6635
+ var SeamHttpSeamCustomerV1 = class _SeamHttpSeamCustomerV1 {
6636
+ client;
6637
+ defaults;
6638
+ ltsVersion = seamApiLtsVersion;
6639
+ static ltsVersion = seamApiLtsVersion;
6640
+ constructor(apiKeyOrOptions = {}) {
6641
+ const options = parseOptions(apiKeyOrOptions);
6552
6642
  this.client = "client" in options ? options.client : createClient(options);
6553
6643
  this.defaults = limitToSeamHttpRequestOptions(options);
6554
6644
  }
@@ -6652,6 +6742,9 @@ var SeamHttpSeamCustomerV1 = class _SeamHttpSeamCustomerV1 {
6652
6742
  get settings() {
6653
6743
  return SeamHttpSeamCustomerV1Settings.fromClient(this.client, this.defaults);
6654
6744
  }
6745
+ get spaces() {
6746
+ return SeamHttpSeamCustomerV1Spaces.fromClient(this.client, this.defaults);
6747
+ }
6655
6748
  };
6656
6749
 
6657
6750
  // src/lib/seam/connect/routes/seam/partner/v1/building-blocks/spaces/spaces.ts
@@ -10241,6 +10334,13 @@ var SeamHttpEndpoints = class _SeamHttpEndpoints {
10241
10334
  return seam.update(...args);
10242
10335
  };
10243
10336
  }
10337
+ get "/seam/customer/v1/spaces/create"() {
10338
+ const { client, defaults } = this;
10339
+ return function seamCustomerV1SpacesCreate(...args) {
10340
+ const seam = SeamHttpSeamCustomerV1Spaces.fromClient(client, defaults);
10341
+ return seam.create(...args);
10342
+ };
10343
+ }
10244
10344
  get "/seam/partner/v1/building_blocks/spaces/auto_map"() {
10245
10345
  const { client, defaults } = this;
10246
10346
  if (!this.defaults.isUndocumentedApiEnabled) {
@@ -11052,6 +11152,7 @@ exports.SeamHttpSeamCustomerV1Events = SeamHttpSeamCustomerV1Events;
11052
11152
  exports.SeamHttpSeamCustomerV1Portals = SeamHttpSeamCustomerV1Portals;
11053
11153
  exports.SeamHttpSeamCustomerV1Reservations = SeamHttpSeamCustomerV1Reservations;
11054
11154
  exports.SeamHttpSeamCustomerV1Settings = SeamHttpSeamCustomerV1Settings;
11155
+ exports.SeamHttpSeamCustomerV1Spaces = SeamHttpSeamCustomerV1Spaces;
11055
11156
  exports.SeamHttpSeamPartnerV1BuildingBlocks = SeamHttpSeamPartnerV1BuildingBlocks;
11056
11157
  exports.SeamHttpSeamPartnerV1BuildingBlocksSpaces = SeamHttpSeamPartnerV1BuildingBlocksSpaces;
11057
11158
  exports.SeamHttpSpaces = SeamHttpSpaces;