@basis-theory/basis-theory-js 1.35.0 → 1.38.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@basis-theory/basis-theory-js",
3
- "version": "1.35.0",
3
+ "version": "1.38.0",
4
4
  "repository": "https://github.com/Basis-Theory/basis-theory-js",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -4,4 +4,4 @@ export declare const BasisTheoryProxies: {
4
4
  new (options: import("../service/types").BasisTheoryServiceOptions): {
5
5
  readonly client: import("axios").AxiosInstance;
6
6
  };
7
- } & (new (...args: any[]) => import("../types/sdk/services/shared").Create<Proxy, Pick<Proxy, "name" | "destinationUrl" | "requestReactorId" | "requireAuth">>) & (new (...args: any[]) => import("../types/sdk/services/shared").Retrieve<Proxy>) & (new (...args: any[]) => import("../types/sdk/services/shared").Update<Proxy, Pick<Proxy, "name" | "destinationUrl" | "requestReactorId" | "requireAuth">>) & (new (...args: any[]) => import("../types/sdk/services/shared").Delete) & (new (...args: any[]) => import("../types/sdk/services/shared").List<Proxy, ListProxyQuery>);
7
+ } & (new (...args: any[]) => import("../types/sdk/services/shared").Create<Proxy, Pick<Proxy, "name" | "destinationUrl" | "requestReactorId" | "responseReactorId" | "requireAuth">>) & (new (...args: any[]) => import("../types/sdk/services/shared").Retrieve<Proxy>) & (new (...args: any[]) => import("../types/sdk/services/shared").Update<Proxy, Pick<Proxy, "name" | "destinationUrl" | "requestReactorId" | "responseReactorId" | "requireAuth">>) & (new (...args: any[]) => import("../types/sdk/services/shared").Delete) & (new (...args: any[]) => import("../types/sdk/services/shared").List<Proxy, ListProxyQuery>);
@@ -1,9 +1,10 @@
1
1
  import { BasisTheoryServiceOptions } from '@/service';
2
- import type { Token, CreateToken } from '@/types/models';
2
+ import type { Token, CreateToken, UpdateToken } from '@/types/models';
3
3
  import type { PaginatedList, RequestOptions, ListTokensQuery, SearchTokensRequest } from '@/types/sdk';
4
4
  export declare const BasisTheoryTokens: {
5
5
  new (options: BasisTheoryServiceOptions): {
6
6
  retrieve(id: string, options?: RequestOptions): Promise<Token>;
7
+ update(id: string, model: UpdateToken, options?: RequestOptions): Promise<Token>;
7
8
  createAssociation(parentId: string, childId: string, options?: RequestOptions | undefined): Promise<void>;
8
9
  deleteAssociation(parentId: string, childId: string, options?: RequestOptions | undefined): Promise<void>;
9
10
  createChild(parentId: string, token: CreateToken, options?: RequestOptions | undefined): Promise<Token>;
@@ -11,5 +12,5 @@ export declare const BasisTheoryTokens: {
11
12
  search(searchRequest: SearchTokensRequest, options?: RequestOptions | undefined): Promise<PaginatedList<Token>>;
12
13
  readonly client: import("axios").AxiosInstance;
13
14
  };
14
- } & (new (...args: any[]) => import("../types/sdk/services/shared").Create<Token<import("../types/models/shared").Primitive>, Pick<Token<import("../types/models/shared").Primitive>, "type" | "data" | "privacy" | "metadata" | "encryption" | "searchIndexes" | "fingerprintExpression">>) & (new (...args: any[]) => import("../types/sdk/services/shared").Delete) & (new (...args: any[]) => import("../types/sdk/services/shared").List<Token<import("../types/models/shared").Primitive>, ListTokensQuery>);
15
+ } & (new (...args: any[]) => import("../types/sdk/services/shared").Create<Token<import("../types/models/shared").Primitive>, CreateToken<import("../types/models/shared").Primitive>>) & (new (...args: any[]) => import("../types/sdk/services/shared").Delete) & (new (...args: any[]) => import("../types/sdk/services/shared").List<Token<import("../types/models/shared").Primitive>, ListTokensQuery>);
15
16
  export declare type BasisTheoryTokens = InstanceType<typeof BasisTheoryTokens>;
@@ -28,6 +28,16 @@ const BasisTheoryTokens = new _CrudBuilder.CrudBuilder(class BasisTheoryTokens e
28
28
  return this.client.get(url, (0, _common.createRequestConfig)(options)).then(_utils.dataExtractor);
29
29
  }
30
30
 
31
+ update(id, model, options = {}) {
32
+ const url = `/${id}`;
33
+ const config = (0, _common.createRequestConfig)(options);
34
+ return this.client.patch(url, model, { ...config,
35
+ headers: { ...(config === null || config === void 0 ? void 0 : config.headers),
36
+ 'Content-Type': 'application/merge-patch+json'
37
+ }
38
+ }).then(_utils.dataExtractor);
39
+ }
40
+
31
41
  async createAssociation(parentId, childId, options) {
32
42
  const url = `/${parentId}/children/${childId}`;
33
43
  await this.client.post(url, {}, (0, _common.createRequestConfig)(options));
@@ -5,9 +5,10 @@ interface Proxy extends Auditable {
5
5
  tenantId: string;
6
6
  name: string;
7
7
  destinationUrl: string;
8
- requestReactorId: string;
8
+ requestReactorId?: string;
9
+ responseReactorId?: string;
9
10
  requireAuth?: boolean;
10
11
  }
11
- declare type CreateProxy = Pick<Proxy, 'name' | 'destinationUrl' | 'requestReactorId' | 'requireAuth'>;
12
+ declare type CreateProxy = Pick<Proxy, 'name' | 'destinationUrl' | 'requestReactorId' | 'responseReactorId' | 'requireAuth'>;
12
13
  declare type UpdateProxy = CreateProxy;
13
14
  export type { Proxy, CreateProxy, UpdateProxy };
@@ -3,8 +3,9 @@ interface Tenant extends Auditable {
3
3
  id: string;
4
4
  ownerId: string;
5
5
  name: string;
6
+ settings?: Record<string, string>;
6
7
  }
7
- declare type UpdateTenant = Pick<Tenant, 'name'>;
8
+ declare type UpdateTenant = Pick<Tenant, 'name' | 'settings'>;
8
9
  interface TenantUsageReport {
9
10
  tokenReport: TokenReport;
10
11
  }
@@ -30,6 +30,12 @@ interface Token<DataType = Primitive> extends TokenBase {
30
30
  searchIndexes?: string[];
31
31
  fingerprintExpression?: string;
32
32
  }
33
- declare type CreateToken<DataType = Primitive> = Pick<Token<DataType>, 'type' | 'data' | 'privacy' | 'metadata' | 'encryption' | 'searchIndexes' | 'fingerprintExpression'>;
34
- export type { Token, CreateToken, DataArray, DataObject, TokenData, DataClassification, DataImpactLevel, DataRestrictionPolicy, };
33
+ declare type CreateToken<DataType = Primitive> = Pick<Token<DataType>, 'type' | 'data' | 'privacy' | 'metadata' | 'encryption' | 'searchIndexes' | 'fingerprintExpression'> & {
34
+ deduplicateToken?: boolean;
35
+ };
36
+ declare type UpdateToken<DataType = Primitive> = Partial<Pick<Token<DataType>, 'data' | 'metadata' | 'encryption' | 'searchIndexes' | 'fingerprintExpression'> & {
37
+ privacy: Omit<TokenPrivacy, 'classification'>;
38
+ deduplicateToken: boolean;
39
+ }>;
40
+ export type { Token, CreateToken, UpdateToken, DataArray, DataObject, TokenData, DataClassification, DataImpactLevel, DataRestrictionPolicy, };
35
41
  export { DATA_CLASSIFICATIONS, DATA_IMPACT_LEVELS, DATA_RESTRICTION_POLICIES };
@@ -1,5 +1,5 @@
1
- import type { Token, CreateToken, TokenType } from '@/types/models';
2
- import type { Create, Retrieve, Delete, List, RequestOptions, PaginatedQuery, PaginatedList } from './shared';
1
+ import type { Token, CreateToken, TokenType, UpdateToken } from '@/types/models';
2
+ import type { Create, Retrieve, Delete, List, RequestOptions, PaginatedQuery, PaginatedList, Update } from './shared';
3
3
  interface ListTokensQuery extends PaginatedQuery {
4
4
  id?: string | string[];
5
5
  type?: TokenType | TokenType[];
@@ -10,7 +10,7 @@ interface SearchTokensRequest {
10
10
  page?: number;
11
11
  size?: number;
12
12
  }
13
- interface Tokens extends Create<Token, CreateToken>, Retrieve<Token>, Delete, List<Token, ListTokensQuery> {
13
+ interface Tokens extends Create<Token, CreateToken>, Update<Token, UpdateToken>, Retrieve<Token>, Delete, List<Token, ListTokensQuery> {
14
14
  createAssociation(parentId: string, childId: string, options?: RequestOptions): Promise<void>;
15
15
  deleteAssociation(parentId: string, childId: string, options?: RequestOptions): Promise<void>;
16
16
  createChild(parentId: string, token: CreateToken, options?: RequestOptions): Promise<Token>;