@basis-theory/basis-theory-js 1.36.0 → 1.39.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.36.0",
3
+ "version": "1.39.0",
4
4
  "repository": "https://github.com/Basis-Theory/basis-theory-js",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -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));
@@ -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
  }
@@ -10,6 +10,11 @@ declare type DataObject<DataType = Primitive> = {
10
10
  };
11
11
  declare type DataArray<DataType> = Array<TokenData<DataType>>;
12
12
  declare type TokenData<DataType = Primitive> = Primitive | DataObject<DataType> | DataArray<DataType> | DataType;
13
+ declare type MaskObject = {
14
+ [member: string]: TokenMask;
15
+ };
16
+ declare type MaskArray = Array<TokenMask>;
17
+ declare type TokenMask = string | MaskObject | MaskArray;
13
18
  interface TokenEncryptionKey {
14
19
  key: string;
15
20
  alg: string;
@@ -29,7 +34,14 @@ interface Token<DataType = Primitive> extends TokenBase {
29
34
  encryption?: TokenEncryption;
30
35
  searchIndexes?: string[];
31
36
  fingerprintExpression?: string;
37
+ mask?: TokenMask;
32
38
  }
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, };
39
+ declare type CreateToken<DataType = Primitive> = Pick<Token<DataType>, 'type' | 'data' | 'privacy' | 'metadata' | 'encryption' | 'searchIndexes' | 'fingerprintExpression' | 'mask'> & {
40
+ deduplicateToken?: boolean;
41
+ };
42
+ declare type UpdateToken<DataType = Primitive> = Partial<Pick<Token<DataType>, 'data' | 'metadata' | 'encryption' | 'searchIndexes' | 'fingerprintExpression' | 'mask'> & {
43
+ privacy: Omit<TokenPrivacy, 'classification'>;
44
+ deduplicateToken: boolean;
45
+ }>;
46
+ export type { Token, CreateToken, UpdateToken, DataArray, DataObject, TokenData, DataClassification, DataImpactLevel, DataRestrictionPolicy, };
35
47
  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>;