@basis-theory/basis-theory-js 1.23.0 → 1.24.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.
package/common/utils.d.ts CHANGED
@@ -17,7 +17,7 @@ declare const concatRequestTransformerWithDefault: (requestTransformer: AxiosTra
17
17
  declare const concatResponseTransformermWithDefault: (responseTransformer: AxiosTransformer | AxiosTransformer[]) => AxiosTransformer | AxiosTransformer[] | undefined;
18
18
  declare const createRequestConfig: (options?: RequestOptions | undefined, transformers?: Pick<AxiosRequestConfig, "transformRequest" | "transformResponse"> | undefined) => AxiosRequestConfig | undefined;
19
19
  declare const errorInterceptor: (error: any) => void;
20
- declare const getQueryParams: <Q>(query: Q) => string;
20
+ declare const getQueryParams: <Q>(query?: Q) => string;
21
21
  declare const buildUserAgentString: (appInfo?: ApplicationInfo | undefined) => string;
22
22
  declare const getBrowser: () => string;
23
23
  declare const getOSVersion: () => string;
package/common/utils.js CHANGED
@@ -242,7 +242,7 @@ const errorInterceptor = error => {
242
242
 
243
243
  exports.errorInterceptor = errorInterceptor;
244
244
 
245
- const getQueryParams = query => {
245
+ const getQueryParams = (query = {}) => {
246
246
  const keys = Object.keys(query);
247
247
 
248
248
  if (keys.length) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@basis-theory/basis-theory-js",
3
- "version": "1.23.0",
3
+ "version": "1.24.0",
4
4
  "repository": "https://github.com/Basis-Theory/basis-theory-js",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -15,7 +15,7 @@
15
15
  "!*.bundle.js"
16
16
  ],
17
17
  "dependencies": {
18
- "@basis-theory/basis-theory-elements-interfaces": "^3.5.0",
18
+ "@basis-theory/basis-theory-elements-interfaces": "^3.6.0",
19
19
  "axios": "^0.21.2",
20
20
  "camelcase-keys": "^6.2.2",
21
21
  "os": "^0.1.2",
@@ -1,11 +1,20 @@
1
- import type { Tenant, TenantUsageReport, UpdateTenant } from '@basis-theory/basis-theory-elements-interfaces/models';
1
+ import type { Tenant, TenantUsageReport, UpdateTenant, CreateTenantInvitation, TenantInvitation, TenantMember } from '@basis-theory/basis-theory-elements-interfaces/models';
2
2
  import type { RequestOptions } from '@basis-theory/basis-theory-elements-interfaces/sdk/services';
3
+ import type { PaginatedList } from '@basis-theory/basis-theory-elements-interfaces/sdk/services/shared';
4
+ import type { ListTenantInvitationsQuery, ListTenantMembersQuery } from '@basis-theory/basis-theory-elements-interfaces/sdk/services/tenants';
3
5
  export declare const BasisTheoryTenants: {
4
6
  new (options: import("../service/types").BasisTheoryServiceOptions): {
5
7
  retrieve(options?: RequestOptions | undefined): Promise<Tenant>;
6
8
  update(model: UpdateTenant, options?: RequestOptions | undefined): Promise<Tenant>;
7
9
  delete(options?: RequestOptions | undefined): Promise<void>;
8
10
  retrieveUsageReport(options?: RequestOptions | undefined): Promise<TenantUsageReport>;
11
+ createInvitation(model: CreateTenantInvitation, options?: RequestOptions | undefined): Promise<TenantInvitation>;
12
+ resendInvitation(invitationId: string, options?: RequestOptions | undefined): Promise<TenantInvitation>;
13
+ listInvitations(query?: ListTenantInvitationsQuery | undefined, options?: RequestOptions | undefined): Promise<PaginatedList<TenantInvitation>>;
14
+ retrieveInvitation(invitationId: string, options?: RequestOptions | undefined): Promise<TenantInvitation>;
15
+ deleteInvitation(invitationId: string, options?: RequestOptions | undefined): Promise<void>;
16
+ listMembers(query?: ListTenantMembersQuery | undefined, options?: RequestOptions | undefined): Promise<PaginatedList<TenantMember>>;
17
+ deleteMember(memberId: string, options?: RequestOptions | undefined): Promise<void>;
9
18
  readonly client: import("axios").AxiosInstance;
10
19
  };
11
20
  };
@@ -28,5 +28,35 @@ const BasisTheoryTenants = new _CrudBuilder.CrudBuilder(class BasisTheoryTenants
28
28
  return this.client.get('/reports/usage', (0, _common.createRequestConfig)(options)).then(_common.dataExtractor);
29
29
  }
30
30
 
31
+ createInvitation(model, options) {
32
+ return this.client.post('/invitations', model, (0, _common.createRequestConfig)(options)).then(_common.dataExtractor);
33
+ }
34
+
35
+ resendInvitation(invitationId, options) {
36
+ return this.client.post(`/invitations/${invitationId}/resend`, {}, (0, _common.createRequestConfig)(options)).then(_common.dataExtractor);
37
+ }
38
+
39
+ listInvitations(query, options) {
40
+ const url = `/invitations${(0, _common.getQueryParams)(query)}`;
41
+ return this.client.get(url, (0, _common.createRequestConfig)(options)).then(_common.dataExtractor);
42
+ }
43
+
44
+ retrieveInvitation(invitationId, options) {
45
+ return this.client.get(`/invitations/${invitationId}`, (0, _common.createRequestConfig)(options)).then(_common.dataExtractor);
46
+ }
47
+
48
+ async deleteInvitation(invitationId, options) {
49
+ await this.client.delete(`/invitations/${invitationId}`, (0, _common.createRequestConfig)(options));
50
+ }
51
+
52
+ listMembers(query, options) {
53
+ const url = `/members${(0, _common.getQueryParams)(query)}`;
54
+ return this.client.get(url, (0, _common.createRequestConfig)(options)).then(_common.dataExtractor);
55
+ }
56
+
57
+ async deleteMember(memberId, options) {
58
+ await this.client.delete(`/members/${memberId}`, (0, _common.createRequestConfig)(options));
59
+ }
60
+
31
61
  }).build();
32
62
  exports.BasisTheoryTenants = BasisTheoryTenants;