@seamapi/http 1.64.0 → 1.66.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 (35) hide show
  1. package/dist/connect.cjs +136 -0
  2. package/dist/connect.cjs.map +1 -1
  3. package/dist/connect.d.cts +61 -16
  4. package/dist/index.cjs +138 -0
  5. package/dist/index.cjs.map +1 -1
  6. package/dist/index.d.cts +1 -1
  7. package/lib/seam/connect/resolve-action-attempt.d.ts +16 -16
  8. package/lib/seam/connect/routes/customers/customers.d.ts +13 -0
  9. package/lib/seam/connect/routes/customers/customers.js +9 -0
  10. package/lib/seam/connect/routes/customers/customers.js.map +1 -1
  11. package/lib/seam/connect/routes/seam/console/v1/index.d.ts +1 -0
  12. package/lib/seam/connect/routes/seam/console/v1/index.js +1 -0
  13. package/lib/seam/connect/routes/seam/console/v1/index.js.map +1 -1
  14. package/lib/seam/connect/routes/seam/console/v1/timelines/index.d.ts +1 -0
  15. package/lib/seam/connect/routes/seam/console/v1/timelines/index.js +6 -0
  16. package/lib/seam/connect/routes/seam/console/v1/timelines/index.js.map +1 -0
  17. package/lib/seam/connect/routes/seam/console/v1/timelines/timelines.d.ts +34 -0
  18. package/lib/seam/connect/routes/seam/console/v1/timelines/timelines.js +102 -0
  19. package/lib/seam/connect/routes/seam/console/v1/timelines/timelines.js.map +1 -0
  20. package/lib/seam/connect/routes/seam/console/v1/v1.d.ts +2 -0
  21. package/lib/seam/connect/routes/seam/console/v1/v1.js +4 -0
  22. package/lib/seam/connect/routes/seam/console/v1/v1.js.map +1 -1
  23. package/lib/seam/connect/routes/seam-http-endpoints.d.ts +7 -4
  24. package/lib/seam/connect/routes/seam-http-endpoints.js +18 -0
  25. package/lib/seam/connect/routes/seam-http-endpoints.js.map +1 -1
  26. package/lib/version.d.ts +1 -1
  27. package/lib/version.js +1 -1
  28. package/package.json +3 -3
  29. package/src/lib/seam/connect/routes/customers/customers.ts +33 -0
  30. package/src/lib/seam/connect/routes/seam/console/v1/index.ts +1 -0
  31. package/src/lib/seam/connect/routes/seam/console/v1/timelines/index.ts +6 -0
  32. package/src/lib/seam/connect/routes/seam/console/v1/timelines/timelines.ts +212 -0
  33. package/src/lib/seam/connect/routes/seam/console/v1/v1.ts +6 -0
  34. package/src/lib/seam/connect/routes/seam-http-endpoints.ts +43 -0
  35. package/src/lib/version.ts +1 -1
package/dist/connect.cjs CHANGED
@@ -3900,6 +3900,15 @@ var _SeamHttpCustomers = class _SeamHttpCustomers {
3900
3900
  options
3901
3901
  });
3902
3902
  }
3903
+ deleteData(parameters, options = {}) {
3904
+ return new SeamHttpRequest(this, {
3905
+ pathname: "/customers/delete_data",
3906
+ method: "POST",
3907
+ body: parameters,
3908
+ responseKey: void 0,
3909
+ options
3910
+ });
3911
+ }
3903
3912
  pushData(parameters, options = {}) {
3904
3913
  return new SeamHttpRequest(this, {
3905
3914
  pathname: "/customers/push_data",
@@ -5277,6 +5286,110 @@ var _SeamHttpPhones = class _SeamHttpPhones {
5277
5286
  _SeamHttpPhones.ltsVersion = seamApiLtsVersion;
5278
5287
  var SeamHttpPhones = _SeamHttpPhones;
5279
5288
 
5289
+ // src/lib/seam/connect/routes/seam/console/v1/timelines/timelines.ts
5290
+ var _SeamHttpSeamConsoleV1Timelines = class _SeamHttpSeamConsoleV1Timelines {
5291
+ constructor(apiKeyOrOptions = {}) {
5292
+ this.ltsVersion = seamApiLtsVersion;
5293
+ const options = parseOptions(apiKeyOrOptions);
5294
+ if (!options.isUndocumentedApiEnabled) {
5295
+ throw new Error(
5296
+ "Cannot use undocumented API without isUndocumentedApiEnabled"
5297
+ );
5298
+ }
5299
+ this.client = "client" in options ? options.client : createClient(options);
5300
+ this.defaults = limitToSeamHttpRequestOptions(options);
5301
+ }
5302
+ static fromClient(client, options = {}) {
5303
+ const constructorOptions = { ...options, client };
5304
+ if (!isSeamHttpOptionsWithClient(constructorOptions)) {
5305
+ throw new SeamHttpInvalidOptionsError("Missing client");
5306
+ }
5307
+ return new _SeamHttpSeamConsoleV1Timelines(constructorOptions);
5308
+ }
5309
+ static fromApiKey(apiKey, options = {}) {
5310
+ const constructorOptions = { ...options, apiKey };
5311
+ if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
5312
+ throw new SeamHttpInvalidOptionsError("Missing apiKey");
5313
+ }
5314
+ return new _SeamHttpSeamConsoleV1Timelines(constructorOptions);
5315
+ }
5316
+ static fromClientSessionToken(clientSessionToken, options = {}) {
5317
+ const constructorOptions = { ...options, clientSessionToken };
5318
+ if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
5319
+ throw new SeamHttpInvalidOptionsError("Missing clientSessionToken");
5320
+ }
5321
+ return new _SeamHttpSeamConsoleV1Timelines(constructorOptions);
5322
+ }
5323
+ static async fromPublishableKey(publishableKey, userIdentifierKey, options = {}) {
5324
+ warnOnInsecureuserIdentifierKey(userIdentifierKey);
5325
+ const clientOptions = parseOptions({ ...options, publishableKey });
5326
+ if (isSeamHttpOptionsWithClient(clientOptions)) {
5327
+ throw new SeamHttpInvalidOptionsError(
5328
+ "The client option cannot be used with SeamHttpSeamConsoleV1Timelines.fromPublishableKey"
5329
+ );
5330
+ }
5331
+ const client = createClient(clientOptions);
5332
+ const clientSessions = SeamHttpClientSessions.fromClient(client);
5333
+ const { token } = await clientSessions.getOrCreate({
5334
+ user_identifier_key: userIdentifierKey
5335
+ });
5336
+ return _SeamHttpSeamConsoleV1Timelines.fromClientSessionToken(token, options);
5337
+ }
5338
+ static fromConsoleSessionToken(consoleSessionToken, workspaceId, options = {}) {
5339
+ const constructorOptions = { ...options, consoleSessionToken, workspaceId };
5340
+ if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) {
5341
+ throw new SeamHttpInvalidOptionsError(
5342
+ "Missing consoleSessionToken or workspaceId"
5343
+ );
5344
+ }
5345
+ return new _SeamHttpSeamConsoleV1Timelines(constructorOptions);
5346
+ }
5347
+ static fromPersonalAccessToken(personalAccessToken, workspaceId, options = {}) {
5348
+ const constructorOptions = { ...options, personalAccessToken, workspaceId };
5349
+ if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) {
5350
+ throw new SeamHttpInvalidOptionsError(
5351
+ "Missing personalAccessToken or workspaceId"
5352
+ );
5353
+ }
5354
+ return new _SeamHttpSeamConsoleV1Timelines(constructorOptions);
5355
+ }
5356
+ createPaginator(request) {
5357
+ return new SeamPaginator(this, request);
5358
+ }
5359
+ async updateClientSessionToken(clientSessionToken) {
5360
+ const { headers } = this.client.defaults;
5361
+ const authHeaders = getAuthHeadersForClientSessionToken({
5362
+ clientSessionToken
5363
+ });
5364
+ for (const key of Object.keys(authHeaders)) {
5365
+ if (headers[key] == null) {
5366
+ throw new Error(
5367
+ "Cannot update a clientSessionToken on a client created without a clientSessionToken"
5368
+ );
5369
+ }
5370
+ }
5371
+ this.client.defaults.headers = { ...headers, ...authHeaders };
5372
+ const clientSessions = SeamHttpClientSessions.fromClient(this.client);
5373
+ await clientSessions.get();
5374
+ }
5375
+ get(parameters, options = {}) {
5376
+ if (!this.defaults.isUndocumentedApiEnabled) {
5377
+ throw new Error(
5378
+ "Cannot use undocumented API without isUndocumentedApiEnabled"
5379
+ );
5380
+ }
5381
+ return new SeamHttpRequest(this, {
5382
+ pathname: "/seam/console/v1/timelines/get",
5383
+ method: "POST",
5384
+ body: parameters,
5385
+ responseKey: "timeline",
5386
+ options
5387
+ });
5388
+ }
5389
+ };
5390
+ _SeamHttpSeamConsoleV1Timelines.ltsVersion = seamApiLtsVersion;
5391
+ var SeamHttpSeamConsoleV1Timelines = _SeamHttpSeamConsoleV1Timelines;
5392
+
5280
5393
  // src/lib/seam/connect/routes/seam/console/v1/v1.ts
5281
5394
  var _SeamHttpSeamConsoleV1 = class _SeamHttpSeamConsoleV1 {
5282
5395
  constructor(apiKeyOrOptions = {}) {
@@ -5363,6 +5476,9 @@ var _SeamHttpSeamConsoleV1 = class _SeamHttpSeamConsoleV1 {
5363
5476
  const clientSessions = SeamHttpClientSessions.fromClient(this.client);
5364
5477
  await clientSessions.get();
5365
5478
  }
5479
+ get timelines() {
5480
+ return SeamHttpSeamConsoleV1Timelines.fromClient(this.client, this.defaults);
5481
+ }
5366
5482
  getResourceLocator(parameters, options = {}) {
5367
5483
  if (!this.defaults.isUndocumentedApiEnabled) {
5368
5484
  throw new Error(
@@ -9133,6 +9249,13 @@ var _SeamHttpEndpoints = class _SeamHttpEndpoints {
9133
9249
  return seam.createPortal(...args);
9134
9250
  };
9135
9251
  }
9252
+ get ["/customers/delete_data"]() {
9253
+ const { client, defaults } = this;
9254
+ return function customersDeleteData(...args) {
9255
+ const seam = SeamHttpCustomers.fromClient(client, defaults);
9256
+ return seam.deleteData(...args);
9257
+ };
9258
+ }
9136
9259
  get ["/customers/push_data"]() {
9137
9260
  const { client, defaults } = this;
9138
9261
  return function customersPushData(...args) {
@@ -9417,6 +9540,18 @@ var _SeamHttpEndpoints = class _SeamHttpEndpoints {
9417
9540
  return seam.getResourceLocator(...args);
9418
9541
  };
9419
9542
  }
9543
+ get ["/seam/console/v1/timelines/get"]() {
9544
+ const { client, defaults } = this;
9545
+ if (!this.defaults.isUndocumentedApiEnabled) {
9546
+ throw new Error(
9547
+ "Cannot use undocumented API without isUndocumentedApiEnabled"
9548
+ );
9549
+ }
9550
+ return function seamConsoleV1TimelinesGet(...args) {
9551
+ const seam = SeamHttpSeamConsoleV1Timelines.fromClient(client, defaults);
9552
+ return seam.get(...args);
9553
+ };
9554
+ }
9420
9555
  get ["/seam/customer/v1/automation_runs/list"]() {
9421
9556
  const { client, defaults } = this;
9422
9557
  if (!this.defaults.isUndocumentedApiEnabled) {
@@ -10312,6 +10447,7 @@ exports.SeamHttpPhonesSimulate = SeamHttpPhonesSimulate;
10312
10447
  exports.SeamHttpRequest = SeamHttpRequest;
10313
10448
  exports.SeamHttpSeamConsole = SeamHttpSeamConsole;
10314
10449
  exports.SeamHttpSeamConsoleV1 = SeamHttpSeamConsoleV1;
10450
+ exports.SeamHttpSeamConsoleV1Timelines = SeamHttpSeamConsoleV1Timelines;
10315
10451
  exports.SeamHttpSeamCustomerV1 = SeamHttpSeamCustomerV1;
10316
10452
  exports.SeamHttpSeamCustomerV1AutomationRuns = SeamHttpSeamCustomerV1AutomationRuns;
10317
10453
  exports.SeamHttpSeamCustomerV1Automations = SeamHttpSeamCustomerV1Automations;