@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/index.cjs CHANGED
@@ -105,11 +105,13 @@ __export(index_exports, {
105
105
  SeamHttpSeamCustomerV1: () => SeamHttpSeamCustomerV1,
106
106
  SeamHttpSeamCustomerV1AutomationRuns: () => SeamHttpSeamCustomerV1AutomationRuns,
107
107
  SeamHttpSeamCustomerV1Automations: () => SeamHttpSeamCustomerV1Automations,
108
+ SeamHttpSeamCustomerV1Connectors: () => SeamHttpSeamCustomerV1Connectors,
108
109
  SeamHttpSeamCustomerV1Events: () => SeamHttpSeamCustomerV1Events,
109
110
  SeamHttpSeamCustomerV1Portals: () => SeamHttpSeamCustomerV1Portals,
110
111
  SeamHttpSeamCustomerV1Reservations: () => SeamHttpSeamCustomerV1Reservations,
111
112
  SeamHttpSeamCustomerV1Settings: () => SeamHttpSeamCustomerV1Settings,
112
113
  SeamHttpSeamCustomerV1Spaces: () => SeamHttpSeamCustomerV1Spaces,
114
+ SeamHttpSeamCustomerV1WebhooksConnectorsWorkspaceId: () => SeamHttpSeamCustomerV1WebhooksConnectorsWorkspaceId,
113
115
  SeamHttpSeamPartnerV1BuildingBlocks: () => SeamHttpSeamPartnerV1BuildingBlocks,
114
116
  SeamHttpSeamPartnerV1BuildingBlocksSpaces: () => SeamHttpSeamPartnerV1BuildingBlocksSpaces,
115
117
  SeamHttpSpaces: () => SeamHttpSpaces,
@@ -211,11 +213,13 @@ __export(connect_exports, {
211
213
  SeamHttpSeamCustomerV1: () => SeamHttpSeamCustomerV1,
212
214
  SeamHttpSeamCustomerV1AutomationRuns: () => SeamHttpSeamCustomerV1AutomationRuns,
213
215
  SeamHttpSeamCustomerV1Automations: () => SeamHttpSeamCustomerV1Automations,
216
+ SeamHttpSeamCustomerV1Connectors: () => SeamHttpSeamCustomerV1Connectors,
214
217
  SeamHttpSeamCustomerV1Events: () => SeamHttpSeamCustomerV1Events,
215
218
  SeamHttpSeamCustomerV1Portals: () => SeamHttpSeamCustomerV1Portals,
216
219
  SeamHttpSeamCustomerV1Reservations: () => SeamHttpSeamCustomerV1Reservations,
217
220
  SeamHttpSeamCustomerV1Settings: () => SeamHttpSeamCustomerV1Settings,
218
221
  SeamHttpSeamCustomerV1Spaces: () => SeamHttpSeamCustomerV1Spaces,
222
+ SeamHttpSeamCustomerV1WebhooksConnectorsWorkspaceId: () => SeamHttpSeamCustomerV1WebhooksConnectorsWorkspaceId,
219
223
  SeamHttpSeamPartnerV1BuildingBlocks: () => SeamHttpSeamPartnerV1BuildingBlocks,
220
224
  SeamHttpSeamPartnerV1BuildingBlocksSpaces: () => SeamHttpSeamPartnerV1BuildingBlocksSpaces,
221
225
  SeamHttpSpaces: () => SeamHttpSpaces,
@@ -6352,6 +6356,113 @@ var SeamHttpSeamCustomerV1Automations = class _SeamHttpSeamCustomerV1Automations
6352
6356
  }
6353
6357
  };
6354
6358
 
6359
+ // src/lib/seam/connect/routes/seam/customer/v1/connectors/connectors.ts
6360
+ var SeamHttpSeamCustomerV1Connectors = class _SeamHttpSeamCustomerV1Connectors {
6361
+ client;
6362
+ defaults;
6363
+ ltsVersion = seamApiLtsVersion;
6364
+ static ltsVersion = seamApiLtsVersion;
6365
+ constructor(apiKeyOrOptions = {}) {
6366
+ const options = parseOptions(apiKeyOrOptions);
6367
+ this.client = "client" in options ? options.client : createClient(options);
6368
+ this.defaults = limitToSeamHttpRequestOptions(options);
6369
+ }
6370
+ static fromClient(client, options = {}) {
6371
+ const constructorOptions = { ...options, client };
6372
+ if (!isSeamHttpOptionsWithClient(constructorOptions)) {
6373
+ throw new SeamHttpInvalidOptionsError("Missing client");
6374
+ }
6375
+ return new _SeamHttpSeamCustomerV1Connectors(constructorOptions);
6376
+ }
6377
+ static fromApiKey(apiKey, options = {}) {
6378
+ const constructorOptions = { ...options, apiKey };
6379
+ if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
6380
+ throw new SeamHttpInvalidOptionsError("Missing apiKey");
6381
+ }
6382
+ return new _SeamHttpSeamCustomerV1Connectors(constructorOptions);
6383
+ }
6384
+ static fromClientSessionToken(clientSessionToken, options = {}) {
6385
+ const constructorOptions = { ...options, clientSessionToken };
6386
+ if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
6387
+ throw new SeamHttpInvalidOptionsError("Missing clientSessionToken");
6388
+ }
6389
+ return new _SeamHttpSeamCustomerV1Connectors(constructorOptions);
6390
+ }
6391
+ static async fromPublishableKey(publishableKey, userIdentifierKey, options = {}) {
6392
+ warnOnInsecureuserIdentifierKey(userIdentifierKey);
6393
+ const clientOptions = parseOptions({ ...options, publishableKey });
6394
+ if (isSeamHttpOptionsWithClient(clientOptions)) {
6395
+ throw new SeamHttpInvalidOptionsError(
6396
+ "The client option cannot be used with SeamHttpSeamCustomerV1Connectors.fromPublishableKey"
6397
+ );
6398
+ }
6399
+ const client = createClient(clientOptions);
6400
+ const clientSessions = SeamHttpClientSessions.fromClient(client);
6401
+ const { token } = await clientSessions.getOrCreate({
6402
+ user_identifier_key: userIdentifierKey
6403
+ });
6404
+ return _SeamHttpSeamCustomerV1Connectors.fromClientSessionToken(
6405
+ token,
6406
+ options
6407
+ );
6408
+ }
6409
+ static fromConsoleSessionToken(consoleSessionToken, workspaceId, options = {}) {
6410
+ const constructorOptions = { ...options, consoleSessionToken, workspaceId };
6411
+ if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) {
6412
+ throw new SeamHttpInvalidOptionsError(
6413
+ "Missing consoleSessionToken or workspaceId"
6414
+ );
6415
+ }
6416
+ return new _SeamHttpSeamCustomerV1Connectors(constructorOptions);
6417
+ }
6418
+ static fromPersonalAccessToken(personalAccessToken, workspaceId, options = {}) {
6419
+ const constructorOptions = { ...options, personalAccessToken, workspaceId };
6420
+ if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) {
6421
+ throw new SeamHttpInvalidOptionsError(
6422
+ "Missing personalAccessToken or workspaceId"
6423
+ );
6424
+ }
6425
+ return new _SeamHttpSeamCustomerV1Connectors(constructorOptions);
6426
+ }
6427
+ createPaginator(request) {
6428
+ return new SeamPaginator(this, request);
6429
+ }
6430
+ async updateClientSessionToken(clientSessionToken) {
6431
+ const { headers } = this.client.defaults;
6432
+ const authHeaders = getAuthHeadersForClientSessionToken({
6433
+ clientSessionToken
6434
+ });
6435
+ for (const key of Object.keys(authHeaders)) {
6436
+ if (headers[key] == null) {
6437
+ throw new Error(
6438
+ "Cannot update a clientSessionToken on a client created without a clientSessionToken"
6439
+ );
6440
+ }
6441
+ }
6442
+ this.client.defaults.headers = { ...headers, ...authHeaders };
6443
+ const clientSessions = SeamHttpClientSessions.fromClient(this.client);
6444
+ await clientSessions.get();
6445
+ }
6446
+ create(parameters, options = {}) {
6447
+ return new SeamHttpRequest(this, {
6448
+ pathname: "/seam/customer/v1/connectors/create",
6449
+ method: "POST",
6450
+ body: parameters,
6451
+ responseKey: "connector",
6452
+ options
6453
+ });
6454
+ }
6455
+ sync(parameters, options = {}) {
6456
+ return new SeamHttpRequest(this, {
6457
+ pathname: "/seam/customer/v1/connectors/sync",
6458
+ method: "POST",
6459
+ body: parameters,
6460
+ responseKey: "connector_sync",
6461
+ options
6462
+ });
6463
+ }
6464
+ };
6465
+
6355
6466
  // src/lib/seam/connect/routes/seam/customer/v1/events/events.ts
6356
6467
  var SeamHttpSeamCustomerV1Events = class _SeamHttpSeamCustomerV1Events {
6357
6468
  client;
@@ -7003,6 +7114,12 @@ var SeamHttpSeamCustomerV1 = class _SeamHttpSeamCustomerV1 {
7003
7114
  this.defaults
7004
7115
  );
7005
7116
  }
7117
+ get connectors() {
7118
+ return SeamHttpSeamCustomerV1Connectors.fromClient(
7119
+ this.client,
7120
+ this.defaults
7121
+ );
7122
+ }
7006
7123
  get events() {
7007
7124
  return SeamHttpSeamCustomerV1Events.fromClient(this.client, this.defaults);
7008
7125
  }
@@ -7023,6 +7140,114 @@ var SeamHttpSeamCustomerV1 = class _SeamHttpSeamCustomerV1 {
7023
7140
  }
7024
7141
  };
7025
7142
 
7143
+ // src/lib/seam/connect/routes/seam/customer/v1/webhooks/connectors/workspace-id/workspace-id.ts
7144
+ var SeamHttpSeamCustomerV1WebhooksConnectorsWorkspaceId = class _SeamHttpSeamCustomerV1WebhooksConnectorsWorkspaceId {
7145
+ client;
7146
+ defaults;
7147
+ ltsVersion = seamApiLtsVersion;
7148
+ static ltsVersion = seamApiLtsVersion;
7149
+ constructor(apiKeyOrOptions = {}) {
7150
+ const options = parseOptions(apiKeyOrOptions);
7151
+ this.client = "client" in options ? options.client : createClient(options);
7152
+ this.defaults = limitToSeamHttpRequestOptions(options);
7153
+ }
7154
+ static fromClient(client, options = {}) {
7155
+ const constructorOptions = { ...options, client };
7156
+ if (!isSeamHttpOptionsWithClient(constructorOptions)) {
7157
+ throw new SeamHttpInvalidOptionsError("Missing client");
7158
+ }
7159
+ return new _SeamHttpSeamCustomerV1WebhooksConnectorsWorkspaceId(
7160
+ constructorOptions
7161
+ );
7162
+ }
7163
+ static fromApiKey(apiKey, options = {}) {
7164
+ const constructorOptions = { ...options, apiKey };
7165
+ if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
7166
+ throw new SeamHttpInvalidOptionsError("Missing apiKey");
7167
+ }
7168
+ return new _SeamHttpSeamCustomerV1WebhooksConnectorsWorkspaceId(
7169
+ constructorOptions
7170
+ );
7171
+ }
7172
+ static fromClientSessionToken(clientSessionToken, options = {}) {
7173
+ const constructorOptions = { ...options, clientSessionToken };
7174
+ if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
7175
+ throw new SeamHttpInvalidOptionsError("Missing clientSessionToken");
7176
+ }
7177
+ return new _SeamHttpSeamCustomerV1WebhooksConnectorsWorkspaceId(
7178
+ constructorOptions
7179
+ );
7180
+ }
7181
+ static async fromPublishableKey(publishableKey, userIdentifierKey, options = {}) {
7182
+ warnOnInsecureuserIdentifierKey(userIdentifierKey);
7183
+ const clientOptions = parseOptions({ ...options, publishableKey });
7184
+ if (isSeamHttpOptionsWithClient(clientOptions)) {
7185
+ throw new SeamHttpInvalidOptionsError(
7186
+ "The client option cannot be used with SeamHttpSeamCustomerV1WebhooksConnectorsWorkspaceId.fromPublishableKey"
7187
+ );
7188
+ }
7189
+ const client = createClient(clientOptions);
7190
+ const clientSessions = SeamHttpClientSessions.fromClient(client);
7191
+ const { token } = await clientSessions.getOrCreate({
7192
+ user_identifier_key: userIdentifierKey
7193
+ });
7194
+ return _SeamHttpSeamCustomerV1WebhooksConnectorsWorkspaceId.fromClientSessionToken(
7195
+ token,
7196
+ options
7197
+ );
7198
+ }
7199
+ static fromConsoleSessionToken(consoleSessionToken, workspaceId, options = {}) {
7200
+ const constructorOptions = { ...options, consoleSessionToken, workspaceId };
7201
+ if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) {
7202
+ throw new SeamHttpInvalidOptionsError(
7203
+ "Missing consoleSessionToken or workspaceId"
7204
+ );
7205
+ }
7206
+ return new _SeamHttpSeamCustomerV1WebhooksConnectorsWorkspaceId(
7207
+ constructorOptions
7208
+ );
7209
+ }
7210
+ static fromPersonalAccessToken(personalAccessToken, workspaceId, options = {}) {
7211
+ const constructorOptions = { ...options, personalAccessToken, workspaceId };
7212
+ if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) {
7213
+ throw new SeamHttpInvalidOptionsError(
7214
+ "Missing personalAccessToken or workspaceId"
7215
+ );
7216
+ }
7217
+ return new _SeamHttpSeamCustomerV1WebhooksConnectorsWorkspaceId(
7218
+ constructorOptions
7219
+ );
7220
+ }
7221
+ createPaginator(request) {
7222
+ return new SeamPaginator(this, request);
7223
+ }
7224
+ async updateClientSessionToken(clientSessionToken) {
7225
+ const { headers } = this.client.defaults;
7226
+ const authHeaders = getAuthHeadersForClientSessionToken({
7227
+ clientSessionToken
7228
+ });
7229
+ for (const key of Object.keys(authHeaders)) {
7230
+ if (headers[key] == null) {
7231
+ throw new Error(
7232
+ "Cannot update a clientSessionToken on a client created without a clientSessionToken"
7233
+ );
7234
+ }
7235
+ }
7236
+ this.client.defaults.headers = { ...headers, ...authHeaders };
7237
+ const clientSessions = SeamHttpClientSessions.fromClient(this.client);
7238
+ await clientSessions.get();
7239
+ }
7240
+ connectorId(parameters, options = {}) {
7241
+ return new SeamHttpRequest(this, {
7242
+ pathname: "/seam/customer/v1/webhooks/connectors/[workspace_id]/[connector_id]",
7243
+ method: "POST",
7244
+ body: parameters,
7245
+ responseKey: void 0,
7246
+ options
7247
+ });
7248
+ }
7249
+ };
7250
+
7026
7251
  // src/lib/seam/connect/routes/seam/partner/v1/building-blocks/spaces/spaces.ts
7027
7252
  var SeamHttpSeamPartnerV1BuildingBlocksSpaces = class _SeamHttpSeamPartnerV1BuildingBlocksSpaces {
7028
7253
  client;
@@ -10555,6 +10780,20 @@ var SeamHttpEndpoints = class _SeamHttpEndpoints {
10555
10780
  return seam.update(...args);
10556
10781
  };
10557
10782
  }
10783
+ get "/seam/customer/v1/connectors/create"() {
10784
+ const { client, defaults } = this;
10785
+ return function seamCustomerV1ConnectorsCreate(...args) {
10786
+ const seam = SeamHttpSeamCustomerV1Connectors.fromClient(client, defaults);
10787
+ return seam.create(...args);
10788
+ };
10789
+ }
10790
+ get "/seam/customer/v1/connectors/sync"() {
10791
+ const { client, defaults } = this;
10792
+ return function seamCustomerV1ConnectorsSync(...args) {
10793
+ const seam = SeamHttpSeamCustomerV1Connectors.fromClient(client, defaults);
10794
+ return seam.sync(...args);
10795
+ };
10796
+ }
10558
10797
  get "/seam/customer/v1/events/list"() {
10559
10798
  const { client, defaults } = this;
10560
10799
  if (!this.defaults.isUndocumentedApiEnabled) {
@@ -10647,6 +10886,16 @@ var SeamHttpEndpoints = class _SeamHttpEndpoints {
10647
10886
  return seam.list(...args);
10648
10887
  };
10649
10888
  }
10889
+ get "/seam/customer/v1/webhooks/connectors/[workspace_id]/[connector_id]"() {
10890
+ const { client, defaults } = this;
10891
+ return function seamCustomerV1WebhooksConnectorsWorkspaceIdConnectorId(...args) {
10892
+ const seam = SeamHttpSeamCustomerV1WebhooksConnectorsWorkspaceId.fromClient(
10893
+ client,
10894
+ defaults
10895
+ );
10896
+ return seam.connectorId(...args);
10897
+ };
10898
+ }
10650
10899
  get "/seam/partner/v1/building_blocks/spaces/auto_map"() {
10651
10900
  const { client, defaults } = this;
10652
10901
  if (!this.defaults.isUndocumentedApiEnabled) {
@@ -11467,11 +11716,13 @@ exports.SeamHttpSeamConsoleV1Timelines = SeamHttpSeamConsoleV1Timelines;
11467
11716
  exports.SeamHttpSeamCustomerV1 = SeamHttpSeamCustomerV1;
11468
11717
  exports.SeamHttpSeamCustomerV1AutomationRuns = SeamHttpSeamCustomerV1AutomationRuns;
11469
11718
  exports.SeamHttpSeamCustomerV1Automations = SeamHttpSeamCustomerV1Automations;
11719
+ exports.SeamHttpSeamCustomerV1Connectors = SeamHttpSeamCustomerV1Connectors;
11470
11720
  exports.SeamHttpSeamCustomerV1Events = SeamHttpSeamCustomerV1Events;
11471
11721
  exports.SeamHttpSeamCustomerV1Portals = SeamHttpSeamCustomerV1Portals;
11472
11722
  exports.SeamHttpSeamCustomerV1Reservations = SeamHttpSeamCustomerV1Reservations;
11473
11723
  exports.SeamHttpSeamCustomerV1Settings = SeamHttpSeamCustomerV1Settings;
11474
11724
  exports.SeamHttpSeamCustomerV1Spaces = SeamHttpSeamCustomerV1Spaces;
11725
+ exports.SeamHttpSeamCustomerV1WebhooksConnectorsWorkspaceId = SeamHttpSeamCustomerV1WebhooksConnectorsWorkspaceId;
11475
11726
  exports.SeamHttpSeamPartnerV1BuildingBlocks = SeamHttpSeamPartnerV1BuildingBlocks;
11476
11727
  exports.SeamHttpSeamPartnerV1BuildingBlocksSpaces = SeamHttpSeamPartnerV1BuildingBlocksSpaces;
11477
11728
  exports.SeamHttpSpaces = SeamHttpSpaces;