@basis-theory/basis-theory-js 1.37.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,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>;
|
|
@@ -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));
|
package/types/models/tokens.d.ts
CHANGED
|
@@ -33,5 +33,9 @@ interface Token<DataType = Primitive> extends TokenBase {
|
|
|
33
33
|
declare type CreateToken<DataType = Primitive> = Pick<Token<DataType>, 'type' | 'data' | 'privacy' | 'metadata' | 'encryption' | 'searchIndexes' | 'fingerprintExpression'> & {
|
|
34
34
|
deduplicateToken?: boolean;
|
|
35
35
|
};
|
|
36
|
-
|
|
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, };
|
|
37
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>;
|