@seamapi/http 1.79.0 → 1.81.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 (46) hide show
  1. package/dist/connect.cjs +247 -0
  2. package/dist/connect.cjs.map +1 -1
  3. package/dist/connect.d.cts +78 -3
  4. package/dist/index.cjs +251 -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/connectors/connectors.d.ts +47 -0
  8. package/lib/seam/connect/routes/seam/customer/v1/connectors/connectors.js +107 -0
  9. package/lib/seam/connect/routes/seam/customer/v1/connectors/connectors.js.map +1 -0
  10. package/lib/seam/connect/routes/seam/customer/v1/connectors/index.d.ts +1 -0
  11. package/lib/seam/connect/routes/seam/customer/v1/connectors/index.js +6 -0
  12. package/lib/seam/connect/routes/seam/customer/v1/connectors/index.js.map +1 -0
  13. package/lib/seam/connect/routes/seam/customer/v1/index.d.ts +2 -0
  14. package/lib/seam/connect/routes/seam/customer/v1/index.js +2 -0
  15. package/lib/seam/connect/routes/seam/customer/v1/index.js.map +1 -1
  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/customer/v1/webhooks/connectors/index.d.ts +1 -0
  20. package/lib/seam/connect/routes/seam/customer/v1/webhooks/connectors/index.js +6 -0
  21. package/lib/seam/connect/routes/seam/customer/v1/webhooks/connectors/index.js.map +1 -0
  22. package/lib/seam/connect/routes/seam/customer/v1/webhooks/connectors/workspace-id/index.d.ts +1 -0
  23. package/lib/seam/connect/routes/seam/customer/v1/webhooks/connectors/workspace-id/index.js +6 -0
  24. package/lib/seam/connect/routes/seam/customer/v1/webhooks/connectors/workspace-id/index.js.map +1 -0
  25. package/lib/seam/connect/routes/seam/customer/v1/webhooks/connectors/workspace-id/workspace-id.d.ts +34 -0
  26. package/lib/seam/connect/routes/seam/customer/v1/webhooks/connectors/workspace-id/workspace-id.js +98 -0
  27. package/lib/seam/connect/routes/seam/customer/v1/webhooks/connectors/workspace-id/workspace-id.js.map +1 -0
  28. package/lib/seam/connect/routes/seam/customer/v1/webhooks/index.d.ts +1 -0
  29. package/lib/seam/connect/routes/seam/customer/v1/webhooks/index.js +6 -0
  30. package/lib/seam/connect/routes/seam/customer/v1/webhooks/index.js.map +1 -0
  31. package/lib/seam/connect/routes/seam-http-endpoints.d.ts +7 -2
  32. package/lib/seam/connect/routes/seam-http-endpoints.js +23 -0
  33. package/lib/seam/connect/routes/seam-http-endpoints.js.map +1 -1
  34. package/lib/version.d.ts +1 -1
  35. package/lib/version.js +1 -1
  36. package/package.json +3 -3
  37. package/src/lib/seam/connect/routes/seam/customer/v1/connectors/connectors.ts +240 -0
  38. package/src/lib/seam/connect/routes/seam/customer/v1/connectors/index.ts +6 -0
  39. package/src/lib/seam/connect/routes/seam/customer/v1/index.ts +2 -0
  40. package/src/lib/seam/connect/routes/seam/customer/v1/v1.ts +8 -0
  41. package/src/lib/seam/connect/routes/seam/customer/v1/webhooks/connectors/index.ts +6 -0
  42. package/src/lib/seam/connect/routes/seam/customer/v1/webhooks/connectors/workspace-id/index.ts +6 -0
  43. package/src/lib/seam/connect/routes/seam/customer/v1/webhooks/connectors/workspace-id/workspace-id.ts +216 -0
  44. package/src/lib/seam/connect/routes/seam/customer/v1/webhooks/index.ts +6 -0
  45. package/src/lib/seam/connect/routes/seam-http-endpoints.ts +67 -0
  46. package/src/lib/version.ts +1 -1
package/dist/connect.cjs CHANGED
@@ -6103,6 +6103,113 @@ var SeamHttpSeamCustomerV1Automations = class _SeamHttpSeamCustomerV1Automations
6103
6103
  }
6104
6104
  };
6105
6105
 
6106
+ // src/lib/seam/connect/routes/seam/customer/v1/connectors/connectors.ts
6107
+ var SeamHttpSeamCustomerV1Connectors = class _SeamHttpSeamCustomerV1Connectors {
6108
+ client;
6109
+ defaults;
6110
+ ltsVersion = seamApiLtsVersion;
6111
+ static ltsVersion = seamApiLtsVersion;
6112
+ constructor(apiKeyOrOptions = {}) {
6113
+ const options = parseOptions(apiKeyOrOptions);
6114
+ this.client = "client" in options ? options.client : createClient(options);
6115
+ this.defaults = limitToSeamHttpRequestOptions(options);
6116
+ }
6117
+ static fromClient(client, options = {}) {
6118
+ const constructorOptions = { ...options, client };
6119
+ if (!isSeamHttpOptionsWithClient(constructorOptions)) {
6120
+ throw new SeamHttpInvalidOptionsError("Missing client");
6121
+ }
6122
+ return new _SeamHttpSeamCustomerV1Connectors(constructorOptions);
6123
+ }
6124
+ static fromApiKey(apiKey, options = {}) {
6125
+ const constructorOptions = { ...options, apiKey };
6126
+ if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
6127
+ throw new SeamHttpInvalidOptionsError("Missing apiKey");
6128
+ }
6129
+ return new _SeamHttpSeamCustomerV1Connectors(constructorOptions);
6130
+ }
6131
+ static fromClientSessionToken(clientSessionToken, options = {}) {
6132
+ const constructorOptions = { ...options, clientSessionToken };
6133
+ if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
6134
+ throw new SeamHttpInvalidOptionsError("Missing clientSessionToken");
6135
+ }
6136
+ return new _SeamHttpSeamCustomerV1Connectors(constructorOptions);
6137
+ }
6138
+ static async fromPublishableKey(publishableKey, userIdentifierKey, options = {}) {
6139
+ warnOnInsecureuserIdentifierKey(userIdentifierKey);
6140
+ const clientOptions = parseOptions({ ...options, publishableKey });
6141
+ if (isSeamHttpOptionsWithClient(clientOptions)) {
6142
+ throw new SeamHttpInvalidOptionsError(
6143
+ "The client option cannot be used with SeamHttpSeamCustomerV1Connectors.fromPublishableKey"
6144
+ );
6145
+ }
6146
+ const client = createClient(clientOptions);
6147
+ const clientSessions = SeamHttpClientSessions.fromClient(client);
6148
+ const { token } = await clientSessions.getOrCreate({
6149
+ user_identifier_key: userIdentifierKey
6150
+ });
6151
+ return _SeamHttpSeamCustomerV1Connectors.fromClientSessionToken(
6152
+ token,
6153
+ options
6154
+ );
6155
+ }
6156
+ static fromConsoleSessionToken(consoleSessionToken, workspaceId, options = {}) {
6157
+ const constructorOptions = { ...options, consoleSessionToken, workspaceId };
6158
+ if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) {
6159
+ throw new SeamHttpInvalidOptionsError(
6160
+ "Missing consoleSessionToken or workspaceId"
6161
+ );
6162
+ }
6163
+ return new _SeamHttpSeamCustomerV1Connectors(constructorOptions);
6164
+ }
6165
+ static fromPersonalAccessToken(personalAccessToken, workspaceId, options = {}) {
6166
+ const constructorOptions = { ...options, personalAccessToken, workspaceId };
6167
+ if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) {
6168
+ throw new SeamHttpInvalidOptionsError(
6169
+ "Missing personalAccessToken or workspaceId"
6170
+ );
6171
+ }
6172
+ return new _SeamHttpSeamCustomerV1Connectors(constructorOptions);
6173
+ }
6174
+ createPaginator(request) {
6175
+ return new SeamPaginator(this, request);
6176
+ }
6177
+ async updateClientSessionToken(clientSessionToken) {
6178
+ const { headers } = this.client.defaults;
6179
+ const authHeaders = getAuthHeadersForClientSessionToken({
6180
+ clientSessionToken
6181
+ });
6182
+ for (const key of Object.keys(authHeaders)) {
6183
+ if (headers[key] == null) {
6184
+ throw new Error(
6185
+ "Cannot update a clientSessionToken on a client created without a clientSessionToken"
6186
+ );
6187
+ }
6188
+ }
6189
+ this.client.defaults.headers = { ...headers, ...authHeaders };
6190
+ const clientSessions = SeamHttpClientSessions.fromClient(this.client);
6191
+ await clientSessions.get();
6192
+ }
6193
+ create(parameters, options = {}) {
6194
+ return new SeamHttpRequest(this, {
6195
+ pathname: "/seam/customer/v1/connectors/create",
6196
+ method: "POST",
6197
+ body: parameters,
6198
+ responseKey: "connector",
6199
+ options
6200
+ });
6201
+ }
6202
+ sync(parameters, options = {}) {
6203
+ return new SeamHttpRequest(this, {
6204
+ pathname: "/seam/customer/v1/connectors/sync",
6205
+ method: "POST",
6206
+ body: parameters,
6207
+ responseKey: "connector_sync",
6208
+ options
6209
+ });
6210
+ }
6211
+ };
6212
+
6106
6213
  // src/lib/seam/connect/routes/seam/customer/v1/events/events.ts
6107
6214
  var SeamHttpSeamCustomerV1Events = class _SeamHttpSeamCustomerV1Events {
6108
6215
  client;
@@ -6754,6 +6861,12 @@ var SeamHttpSeamCustomerV1 = class _SeamHttpSeamCustomerV1 {
6754
6861
  this.defaults
6755
6862
  );
6756
6863
  }
6864
+ get connectors() {
6865
+ return SeamHttpSeamCustomerV1Connectors.fromClient(
6866
+ this.client,
6867
+ this.defaults
6868
+ );
6869
+ }
6757
6870
  get events() {
6758
6871
  return SeamHttpSeamCustomerV1Events.fromClient(this.client, this.defaults);
6759
6872
  }
@@ -6774,6 +6887,114 @@ var SeamHttpSeamCustomerV1 = class _SeamHttpSeamCustomerV1 {
6774
6887
  }
6775
6888
  };
6776
6889
 
6890
+ // src/lib/seam/connect/routes/seam/customer/v1/webhooks/connectors/workspace-id/workspace-id.ts
6891
+ var SeamHttpSeamCustomerV1WebhooksConnectorsWorkspaceId = class _SeamHttpSeamCustomerV1WebhooksConnectorsWorkspaceId {
6892
+ client;
6893
+ defaults;
6894
+ ltsVersion = seamApiLtsVersion;
6895
+ static ltsVersion = seamApiLtsVersion;
6896
+ constructor(apiKeyOrOptions = {}) {
6897
+ const options = parseOptions(apiKeyOrOptions);
6898
+ this.client = "client" in options ? options.client : createClient(options);
6899
+ this.defaults = limitToSeamHttpRequestOptions(options);
6900
+ }
6901
+ static fromClient(client, options = {}) {
6902
+ const constructorOptions = { ...options, client };
6903
+ if (!isSeamHttpOptionsWithClient(constructorOptions)) {
6904
+ throw new SeamHttpInvalidOptionsError("Missing client");
6905
+ }
6906
+ return new _SeamHttpSeamCustomerV1WebhooksConnectorsWorkspaceId(
6907
+ constructorOptions
6908
+ );
6909
+ }
6910
+ static fromApiKey(apiKey, options = {}) {
6911
+ const constructorOptions = { ...options, apiKey };
6912
+ if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
6913
+ throw new SeamHttpInvalidOptionsError("Missing apiKey");
6914
+ }
6915
+ return new _SeamHttpSeamCustomerV1WebhooksConnectorsWorkspaceId(
6916
+ constructorOptions
6917
+ );
6918
+ }
6919
+ static fromClientSessionToken(clientSessionToken, options = {}) {
6920
+ const constructorOptions = { ...options, clientSessionToken };
6921
+ if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
6922
+ throw new SeamHttpInvalidOptionsError("Missing clientSessionToken");
6923
+ }
6924
+ return new _SeamHttpSeamCustomerV1WebhooksConnectorsWorkspaceId(
6925
+ constructorOptions
6926
+ );
6927
+ }
6928
+ static async fromPublishableKey(publishableKey, userIdentifierKey, options = {}) {
6929
+ warnOnInsecureuserIdentifierKey(userIdentifierKey);
6930
+ const clientOptions = parseOptions({ ...options, publishableKey });
6931
+ if (isSeamHttpOptionsWithClient(clientOptions)) {
6932
+ throw new SeamHttpInvalidOptionsError(
6933
+ "The client option cannot be used with SeamHttpSeamCustomerV1WebhooksConnectorsWorkspaceId.fromPublishableKey"
6934
+ );
6935
+ }
6936
+ const client = createClient(clientOptions);
6937
+ const clientSessions = SeamHttpClientSessions.fromClient(client);
6938
+ const { token } = await clientSessions.getOrCreate({
6939
+ user_identifier_key: userIdentifierKey
6940
+ });
6941
+ return _SeamHttpSeamCustomerV1WebhooksConnectorsWorkspaceId.fromClientSessionToken(
6942
+ token,
6943
+ options
6944
+ );
6945
+ }
6946
+ static fromConsoleSessionToken(consoleSessionToken, workspaceId, options = {}) {
6947
+ const constructorOptions = { ...options, consoleSessionToken, workspaceId };
6948
+ if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) {
6949
+ throw new SeamHttpInvalidOptionsError(
6950
+ "Missing consoleSessionToken or workspaceId"
6951
+ );
6952
+ }
6953
+ return new _SeamHttpSeamCustomerV1WebhooksConnectorsWorkspaceId(
6954
+ constructorOptions
6955
+ );
6956
+ }
6957
+ static fromPersonalAccessToken(personalAccessToken, workspaceId, options = {}) {
6958
+ const constructorOptions = { ...options, personalAccessToken, workspaceId };
6959
+ if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) {
6960
+ throw new SeamHttpInvalidOptionsError(
6961
+ "Missing personalAccessToken or workspaceId"
6962
+ );
6963
+ }
6964
+ return new _SeamHttpSeamCustomerV1WebhooksConnectorsWorkspaceId(
6965
+ constructorOptions
6966
+ );
6967
+ }
6968
+ createPaginator(request) {
6969
+ return new SeamPaginator(this, request);
6970
+ }
6971
+ async updateClientSessionToken(clientSessionToken) {
6972
+ const { headers } = this.client.defaults;
6973
+ const authHeaders = getAuthHeadersForClientSessionToken({
6974
+ clientSessionToken
6975
+ });
6976
+ for (const key of Object.keys(authHeaders)) {
6977
+ if (headers[key] == null) {
6978
+ throw new Error(
6979
+ "Cannot update a clientSessionToken on a client created without a clientSessionToken"
6980
+ );
6981
+ }
6982
+ }
6983
+ this.client.defaults.headers = { ...headers, ...authHeaders };
6984
+ const clientSessions = SeamHttpClientSessions.fromClient(this.client);
6985
+ await clientSessions.get();
6986
+ }
6987
+ connectorId(parameters, options = {}) {
6988
+ return new SeamHttpRequest(this, {
6989
+ pathname: "/seam/customer/v1/webhooks/connectors/[workspace_id]/[connector_id]",
6990
+ method: "POST",
6991
+ body: parameters,
6992
+ responseKey: void 0,
6993
+ options
6994
+ });
6995
+ }
6996
+ };
6997
+
6777
6998
  // src/lib/seam/connect/routes/seam/partner/v1/building-blocks/spaces/spaces.ts
6778
6999
  var SeamHttpSeamPartnerV1BuildingBlocksSpaces = class _SeamHttpSeamPartnerV1BuildingBlocksSpaces {
6779
7000
  client;
@@ -10306,6 +10527,20 @@ var SeamHttpEndpoints = class _SeamHttpEndpoints {
10306
10527
  return seam.update(...args);
10307
10528
  };
10308
10529
  }
10530
+ get "/seam/customer/v1/connectors/create"() {
10531
+ const { client, defaults } = this;
10532
+ return function seamCustomerV1ConnectorsCreate(...args) {
10533
+ const seam = SeamHttpSeamCustomerV1Connectors.fromClient(client, defaults);
10534
+ return seam.create(...args);
10535
+ };
10536
+ }
10537
+ get "/seam/customer/v1/connectors/sync"() {
10538
+ const { client, defaults } = this;
10539
+ return function seamCustomerV1ConnectorsSync(...args) {
10540
+ const seam = SeamHttpSeamCustomerV1Connectors.fromClient(client, defaults);
10541
+ return seam.sync(...args);
10542
+ };
10543
+ }
10309
10544
  get "/seam/customer/v1/events/list"() {
10310
10545
  const { client, defaults } = this;
10311
10546
  if (!this.defaults.isUndocumentedApiEnabled) {
@@ -10398,6 +10633,16 @@ var SeamHttpEndpoints = class _SeamHttpEndpoints {
10398
10633
  return seam.list(...args);
10399
10634
  };
10400
10635
  }
10636
+ get "/seam/customer/v1/webhooks/connectors/[workspace_id]/[connector_id]"() {
10637
+ const { client, defaults } = this;
10638
+ return function seamCustomerV1WebhooksConnectorsWorkspaceIdConnectorId(...args) {
10639
+ const seam = SeamHttpSeamCustomerV1WebhooksConnectorsWorkspaceId.fromClient(
10640
+ client,
10641
+ defaults
10642
+ );
10643
+ return seam.connectorId(...args);
10644
+ };
10645
+ }
10401
10646
  get "/seam/partner/v1/building_blocks/spaces/auto_map"() {
10402
10647
  const { client, defaults } = this;
10403
10648
  if (!this.defaults.isUndocumentedApiEnabled) {
@@ -11212,11 +11457,13 @@ exports.SeamHttpSeamConsoleV1Timelines = SeamHttpSeamConsoleV1Timelines;
11212
11457
  exports.SeamHttpSeamCustomerV1 = SeamHttpSeamCustomerV1;
11213
11458
  exports.SeamHttpSeamCustomerV1AutomationRuns = SeamHttpSeamCustomerV1AutomationRuns;
11214
11459
  exports.SeamHttpSeamCustomerV1Automations = SeamHttpSeamCustomerV1Automations;
11460
+ exports.SeamHttpSeamCustomerV1Connectors = SeamHttpSeamCustomerV1Connectors;
11215
11461
  exports.SeamHttpSeamCustomerV1Events = SeamHttpSeamCustomerV1Events;
11216
11462
  exports.SeamHttpSeamCustomerV1Portals = SeamHttpSeamCustomerV1Portals;
11217
11463
  exports.SeamHttpSeamCustomerV1Reservations = SeamHttpSeamCustomerV1Reservations;
11218
11464
  exports.SeamHttpSeamCustomerV1Settings = SeamHttpSeamCustomerV1Settings;
11219
11465
  exports.SeamHttpSeamCustomerV1Spaces = SeamHttpSeamCustomerV1Spaces;
11466
+ exports.SeamHttpSeamCustomerV1WebhooksConnectorsWorkspaceId = SeamHttpSeamCustomerV1WebhooksConnectorsWorkspaceId;
11220
11467
  exports.SeamHttpSeamPartnerV1BuildingBlocks = SeamHttpSeamPartnerV1BuildingBlocks;
11221
11468
  exports.SeamHttpSeamPartnerV1BuildingBlocksSpaces = SeamHttpSeamPartnerV1BuildingBlocksSpaces;
11222
11469
  exports.SeamHttpSpaces = SeamHttpSpaces;