@seamapi/http 1.88.0 → 1.89.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 +33 -2
  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/access-grants/access-grants.d.ts +34 -0
  8. package/lib/seam/connect/routes/seam/customer/v1/access-grants/access-grants.js +104 -0
  9. package/lib/seam/connect/routes/seam/customer/v1/access-grants/access-grants.js.map +1 -0
  10. package/lib/seam/connect/routes/seam/customer/v1/access-grants/index.d.ts +1 -0
  11. package/lib/seam/connect/routes/seam/customer/v1/access-grants/index.js +6 -0
  12. package/lib/seam/connect/routes/seam/customer/v1/access-grants/index.js.map +1 -0
  13. package/lib/seam/connect/routes/seam/customer/v1/index.d.ts +1 -0
  14. package/lib/seam/connect/routes/seam/customer/v1/index.js +1 -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-http-endpoints.d.ts +3 -1
  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/access-grants/access-grants.ts +214 -0
  26. package/src/lib/seam/connect/routes/seam/customer/v1/access-grants/index.ts +6 -0
  27. package/src/lib/seam/connect/routes/seam/customer/v1/index.ts +1 -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 +28 -0
  30. package/src/lib/version.ts +1 -1
package/dist/connect.cjs CHANGED
@@ -5868,6 +5868,114 @@ var SeamHttpSeamConsole = class _SeamHttpSeamConsole {
5868
5868
  }
5869
5869
  };
5870
5870
 
5871
+ // src/lib/seam/connect/routes/seam/customer/v1/access-grants/access-grants.ts
5872
+ var SeamHttpSeamCustomerV1AccessGrants = class _SeamHttpSeamCustomerV1AccessGrants {
5873
+ client;
5874
+ defaults;
5875
+ ltsVersion = seamApiLtsVersion;
5876
+ static ltsVersion = seamApiLtsVersion;
5877
+ constructor(apiKeyOrOptions = {}) {
5878
+ const options = parseOptions(apiKeyOrOptions);
5879
+ if (!options.isUndocumentedApiEnabled) {
5880
+ throw new Error(
5881
+ "Cannot use undocumented API without isUndocumentedApiEnabled"
5882
+ );
5883
+ }
5884
+ this.client = "client" in options ? options.client : createClient(options);
5885
+ this.defaults = limitToSeamHttpRequestOptions(options);
5886
+ }
5887
+ static fromClient(client, options = {}) {
5888
+ const constructorOptions = { ...options, client };
5889
+ if (!isSeamHttpOptionsWithClient(constructorOptions)) {
5890
+ throw new SeamHttpInvalidOptionsError("Missing client");
5891
+ }
5892
+ return new _SeamHttpSeamCustomerV1AccessGrants(constructorOptions);
5893
+ }
5894
+ static fromApiKey(apiKey, options = {}) {
5895
+ const constructorOptions = { ...options, apiKey };
5896
+ if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
5897
+ throw new SeamHttpInvalidOptionsError("Missing apiKey");
5898
+ }
5899
+ return new _SeamHttpSeamCustomerV1AccessGrants(constructorOptions);
5900
+ }
5901
+ static fromClientSessionToken(clientSessionToken, options = {}) {
5902
+ const constructorOptions = { ...options, clientSessionToken };
5903
+ if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
5904
+ throw new SeamHttpInvalidOptionsError("Missing clientSessionToken");
5905
+ }
5906
+ return new _SeamHttpSeamCustomerV1AccessGrants(constructorOptions);
5907
+ }
5908
+ static async fromPublishableKey(publishableKey, userIdentifierKey, options = {}) {
5909
+ warnOnInsecureuserIdentifierKey(userIdentifierKey);
5910
+ const clientOptions = parseOptions({ ...options, publishableKey });
5911
+ if (isSeamHttpOptionsWithClient(clientOptions)) {
5912
+ throw new SeamHttpInvalidOptionsError(
5913
+ "The client option cannot be used with SeamHttpSeamCustomerV1AccessGrants.fromPublishableKey"
5914
+ );
5915
+ }
5916
+ const client = createClient(clientOptions);
5917
+ const clientSessions = SeamHttpClientSessions.fromClient(client);
5918
+ const { token } = await clientSessions.getOrCreate({
5919
+ user_identifier_key: userIdentifierKey
5920
+ });
5921
+ return _SeamHttpSeamCustomerV1AccessGrants.fromClientSessionToken(
5922
+ token,
5923
+ options
5924
+ );
5925
+ }
5926
+ static fromConsoleSessionToken(consoleSessionToken, workspaceId, options = {}) {
5927
+ const constructorOptions = { ...options, consoleSessionToken, workspaceId };
5928
+ if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) {
5929
+ throw new SeamHttpInvalidOptionsError(
5930
+ "Missing consoleSessionToken or workspaceId"
5931
+ );
5932
+ }
5933
+ return new _SeamHttpSeamCustomerV1AccessGrants(constructorOptions);
5934
+ }
5935
+ static fromPersonalAccessToken(personalAccessToken, workspaceId, options = {}) {
5936
+ const constructorOptions = { ...options, personalAccessToken, workspaceId };
5937
+ if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) {
5938
+ throw new SeamHttpInvalidOptionsError(
5939
+ "Missing personalAccessToken or workspaceId"
5940
+ );
5941
+ }
5942
+ return new _SeamHttpSeamCustomerV1AccessGrants(constructorOptions);
5943
+ }
5944
+ createPaginator(request) {
5945
+ return new SeamPaginator(this, request);
5946
+ }
5947
+ async updateClientSessionToken(clientSessionToken) {
5948
+ const { headers } = this.client.defaults;
5949
+ const authHeaders = getAuthHeadersForClientSessionToken({
5950
+ clientSessionToken
5951
+ });
5952
+ for (const key of Object.keys(authHeaders)) {
5953
+ if (headers[key] == null) {
5954
+ throw new Error(
5955
+ "Cannot update a clientSessionToken on a client created without a clientSessionToken"
5956
+ );
5957
+ }
5958
+ }
5959
+ this.client.defaults.headers = { ...headers, ...authHeaders };
5960
+ const clientSessions = SeamHttpClientSessions.fromClient(this.client);
5961
+ await clientSessions.get();
5962
+ }
5963
+ list(parameters, options = {}) {
5964
+ if (!this.defaults.isUndocumentedApiEnabled) {
5965
+ throw new Error(
5966
+ "Cannot use undocumented API without isUndocumentedApiEnabled"
5967
+ );
5968
+ }
5969
+ return new SeamHttpRequest(this, {
5970
+ pathname: "/seam/customer/v1/access_grants/list",
5971
+ method: "POST",
5972
+ body: parameters,
5973
+ responseKey: "access_grants",
5974
+ options
5975
+ });
5976
+ }
5977
+ };
5978
+
5871
5979
  // src/lib/seam/connect/routes/seam/customer/v1/automation-runs/automation-runs.ts
5872
5980
  var SeamHttpSeamCustomerV1AutomationRuns = class _SeamHttpSeamCustomerV1AutomationRuns {
5873
5981
  client;
@@ -7057,6 +7165,12 @@ var SeamHttpSeamCustomerV1 = class _SeamHttpSeamCustomerV1 {
7057
7165
  const clientSessions = SeamHttpClientSessions.fromClient(this.client);
7058
7166
  await clientSessions.get();
7059
7167
  }
7168
+ get accessGrants() {
7169
+ return SeamHttpSeamCustomerV1AccessGrants.fromClient(
7170
+ this.client,
7171
+ this.defaults
7172
+ );
7173
+ }
7060
7174
  get automationRuns() {
7061
7175
  return SeamHttpSeamCustomerV1AutomationRuns.fromClient(
7062
7176
  this.client,
@@ -10580,6 +10694,21 @@ var SeamHttpEndpoints = class _SeamHttpEndpoints {
10580
10694
  return seam.get(...args);
10581
10695
  };
10582
10696
  }
10697
+ get "/seam/customer/v1/access_grants/list"() {
10698
+ const { client, defaults } = this;
10699
+ if (!this.defaults.isUndocumentedApiEnabled) {
10700
+ throw new Error(
10701
+ "Cannot use undocumented API without isUndocumentedApiEnabled"
10702
+ );
10703
+ }
10704
+ return function seamCustomerV1AccessGrantsList(...args) {
10705
+ const seam = SeamHttpSeamCustomerV1AccessGrants.fromClient(
10706
+ client,
10707
+ defaults
10708
+ );
10709
+ return seam.list(...args);
10710
+ };
10711
+ }
10583
10712
  get "/seam/customer/v1/automation_runs/list"() {
10584
10713
  const { client, defaults } = this;
10585
10714
  if (!this.defaults.isUndocumentedApiEnabled) {
@@ -11644,6 +11773,7 @@ exports.SeamHttpSeamConsole = SeamHttpSeamConsole;
11644
11773
  exports.SeamHttpSeamConsoleV1 = SeamHttpSeamConsoleV1;
11645
11774
  exports.SeamHttpSeamConsoleV1Timelines = SeamHttpSeamConsoleV1Timelines;
11646
11775
  exports.SeamHttpSeamCustomerV1 = SeamHttpSeamCustomerV1;
11776
+ exports.SeamHttpSeamCustomerV1AccessGrants = SeamHttpSeamCustomerV1AccessGrants;
11647
11777
  exports.SeamHttpSeamCustomerV1AutomationRuns = SeamHttpSeamCustomerV1AutomationRuns;
11648
11778
  exports.SeamHttpSeamCustomerV1Automations = SeamHttpSeamCustomerV1Automations;
11649
11779
  exports.SeamHttpSeamCustomerV1Connectors = SeamHttpSeamCustomerV1Connectors;