@basis-theory/basis-theory-js 1.13.0 → 1.16.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 (86) hide show
  1. package/BasisTheory.d.ts +23 -27
  2. package/BasisTheory.js +33 -30
  3. package/README.md +5 -1
  4. package/applications/BasisTheoryApplications.d.ts +3 -3
  5. package/applications/index.d.ts +0 -1
  6. package/applications/index.js +0 -17
  7. package/atomic/banks/BasisTheoryAtomicBanks.d.ts +5 -5
  8. package/atomic/banks/index.d.ts +0 -1
  9. package/atomic/banks/index.js +0 -17
  10. package/atomic/cards/BasisTheoryAtomicCards.d.ts +5 -5
  11. package/atomic/cards/index.d.ts +0 -1
  12. package/atomic/cards/index.js +0 -17
  13. package/atomic/index.d.ts +2 -2
  14. package/atomic/index.js +8 -8
  15. package/common/constants.d.ts +1 -1
  16. package/common/constants.js +1 -2
  17. package/common/index.d.ts +0 -1
  18. package/common/index.js +0 -13
  19. package/common/utils.d.ts +1 -1
  20. package/common/utils.js +0 -6
  21. package/elements/constants.d.ts +5 -0
  22. package/elements/constants.js +14 -0
  23. package/elements/index.d.ts +3 -6
  24. package/elements/index.js +44 -1
  25. package/elements/load.d.ts +3 -0
  26. package/{common/elements.js → elements/load.js} +5 -3
  27. package/{common → elements}/script.d.ts +0 -0
  28. package/{common → elements}/script.js +0 -0
  29. package/elements/services/banks.d.ts +5 -0
  30. package/elements/services/banks.js +21 -0
  31. package/elements/services/cards.d.ts +5 -0
  32. package/elements/services/cards.js +21 -0
  33. package/elements/services/index.d.ts +4 -0
  34. package/elements/services/index.js +57 -0
  35. package/elements/services/tokenize.d.ts +5 -0
  36. package/elements/services/tokenize.js +21 -0
  37. package/elements/services/tokens.d.ts +5 -0
  38. package/elements/services/tokens.js +21 -0
  39. package/index.d.ts +2 -2
  40. package/logs/BasisTheoryLogs.d.ts +3 -2
  41. package/logs/index.d.ts +0 -1
  42. package/logs/index.js +0 -17
  43. package/package.json +2 -1
  44. package/permissions/BasisTheoryPermissions.d.ts +3 -2
  45. package/permissions/index.d.ts +0 -1
  46. package/permissions/index.js +1 -18
  47. package/reactor-formulas/BasisTheoryReactorFormulas.d.ts +3 -2
  48. package/reactor-formulas/index.d.ts +0 -1
  49. package/reactor-formulas/index.js +0 -17
  50. package/reactors/BasisTheoryReactors.d.ts +3 -2
  51. package/reactors/index.d.ts +0 -1
  52. package/reactors/index.js +0 -17
  53. package/service/CrudBuilder.d.ts +2 -17
  54. package/service/types.d.ts +1 -21
  55. package/tenants/BasisTheoryTenants.d.ts +3 -3
  56. package/tenants/index.d.ts +0 -1
  57. package/tenants/index.js +0 -17
  58. package/tokenize/BasisTheoryTokenize.d.ts +4 -4
  59. package/tokenize/BasisTheoryTokenize.js +0 -9
  60. package/tokens/BasisTheoryTokens.d.ts +6 -5
  61. package/tokens/index.d.ts +0 -1
  62. package/tokens/index.js +1 -18
  63. package/types.d.ts +10 -11
  64. package/applications/types.d.ts +0 -18
  65. package/applications/types.js +0 -8
  66. package/atomic/BasisTheoryAtomic.d.ts +0 -16
  67. package/atomic/BasisTheoryAtomic.js +0 -33
  68. package/atomic/banks/types.d.ts +0 -13
  69. package/atomic/banks/types.js +0 -1
  70. package/atomic/cards/types.d.ts +0 -15
  71. package/atomic/cards/types.js +0 -1
  72. package/atomic/types.d.ts +0 -18
  73. package/atomic/types.js +0 -1
  74. package/common/elements.d.ts +0 -2
  75. package/logs/types.d.ts +0 -18
  76. package/logs/types.js +0 -1
  77. package/permissions/types.d.ts +0 -10
  78. package/permissions/types.js +0 -8
  79. package/reactor-formulas/types.d.ts +0 -33
  80. package/reactor-formulas/types.js +0 -1
  81. package/reactors/types.d.ts +0 -21
  82. package/reactors/types.js +0 -1
  83. package/tenants/types.d.ts +0 -20
  84. package/tenants/types.js +0 -1
  85. package/tokens/types.d.ts +0 -36
  86. package/tokens/types.js +0 -1
@@ -1,8 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.APPLICATION_TYPES = void 0;
7
- const APPLICATION_TYPES = ['server_to_server', 'public', 'elements', 'management'];
8
- exports.APPLICATION_TYPES = APPLICATION_TYPES;
@@ -1,16 +0,0 @@
1
- import { BasisTheoryService } from '../service';
2
- import type { AtomicBank, CreateAtomicBankModel } from './banks/types';
3
- import type { AtomicCard, CreateAtomicCardModel } from './cards/types';
4
- /**
5
- * @deprecated use {@link BasisTheoryAtomicBanks} and {@link BasisTheoryAtomicCards} instead
6
- */
7
- export declare class BasisTheoryAtomic extends BasisTheoryService {
8
- /**
9
- * @deprecated use {@link BasisTheoryAtomicCards.create} instead
10
- */
11
- storeCreditCard(model: CreateAtomicCardModel): Promise<AtomicCard>;
12
- /**
13
- * @deprecated use {@link BasisTheoryAtomicBanks.create} instead
14
- */
15
- storeBank(model: CreateAtomicBankModel): Promise<AtomicBank>;
16
- }
@@ -1,33 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.BasisTheoryAtomic = void 0;
7
-
8
- var _common = require("../common");
9
-
10
- var _service = require("../service");
11
-
12
- /**
13
- * @deprecated use {@link BasisTheoryAtomicBanks} and {@link BasisTheoryAtomicCards} instead
14
- */
15
- class BasisTheoryAtomic extends _service.BasisTheoryService {
16
- /**
17
- * @deprecated use {@link BasisTheoryAtomicCards.create} instead
18
- */
19
- storeCreditCard(model) {
20
- return this.client.post('/cards', model).then(_common.dataExtractor);
21
- }
22
- /**
23
- * @deprecated use {@link BasisTheoryAtomicBanks.create} instead
24
- */
25
-
26
-
27
- storeBank(model) {
28
- return this.client.post('/banks', model).then(_common.dataExtractor);
29
- }
30
-
31
- }
32
-
33
- exports.BasisTheoryAtomic = BasisTheoryAtomic;
@@ -1,13 +0,0 @@
1
- import type { Atomic } from '../types';
2
- interface Bank {
3
- routingNumber: string;
4
- accountNumber: string;
5
- }
6
- interface AtomicBank extends Atomic {
7
- bank: Bank;
8
- }
9
- declare type CreateAtomicBankModel = Pick<AtomicBank, 'bank' | 'metadata'>;
10
- interface UpdateAtomicBankModel {
11
- bank: Partial<Bank>;
12
- }
13
- export type { Bank, AtomicBank, CreateAtomicBankModel, UpdateAtomicBankModel };
@@ -1 +0,0 @@
1
- "use strict";
@@ -1,15 +0,0 @@
1
- import type { Atomic } from '../types';
2
- interface AtomicCard extends Atomic {
3
- card: Card;
4
- }
5
- interface Card {
6
- number: string;
7
- expirationMonth?: number;
8
- expirationYear?: number;
9
- cvc?: string;
10
- }
11
- declare type CreateAtomicCardModel = Pick<AtomicCard, 'card' | 'metadata'>;
12
- interface UpdateAtomicCardModel {
13
- card?: Partial<Card>;
14
- }
15
- export type { AtomicCard, Card, CreateAtomicCardModel, UpdateAtomicCardModel };
@@ -1 +0,0 @@
1
- "use strict";
package/atomic/types.d.ts DELETED
@@ -1,18 +0,0 @@
1
- import type { DataObject, TokenType } from '../tokens';
2
- import type { Auditable } from '../types';
3
- interface Atomic extends Auditable {
4
- id: string;
5
- tenantId: string;
6
- type: TokenType;
7
- fingerprint: string;
8
- metadata?: Record<string, string>;
9
- }
10
- interface ReactRequest {
11
- reactorId: string;
12
- requestParameters?: Record<string, unknown>;
13
- }
14
- interface ReactResponse {
15
- tokens: DataObject;
16
- raw: DataObject;
17
- }
18
- export type { Atomic, ReactRequest, ReactResponse };
package/atomic/types.js DELETED
@@ -1 +0,0 @@
1
- "use strict";
@@ -1,2 +0,0 @@
1
- import { BasisTheoryElements } from '../elements';
2
- export declare const loadElements: () => Promise<BasisTheoryElements>;
package/logs/types.d.ts DELETED
@@ -1,18 +0,0 @@
1
- import type { PaginatedQuery } from '../service';
2
- interface Log {
3
- tenantId: string;
4
- actorId?: string;
5
- actorType?: string;
6
- entityType: string;
7
- entityId: string;
8
- operation: string;
9
- message: string;
10
- createdAt: string;
11
- }
12
- interface LogQuery extends PaginatedQuery {
13
- entityType?: string;
14
- entityId?: string;
15
- startDate?: string;
16
- endDate?: string;
17
- }
18
- export type { Log, LogQuery };
package/logs/types.js DELETED
@@ -1 +0,0 @@
1
- "use strict";
@@ -1,10 +0,0 @@
1
- import type { ApplicationType } from '../applications';
2
- declare const PERMISSION_TYPES: readonly ["tenant:read", "tenant:update", "tenant:delete", "application:read", "application:create", "application:update", "application:create", "reactor:read", "reactor:create", "reactor:update", "reactor:delete", "log:read", "token:read", "token:create", "token:delete", "token:decrypt", "card:read", "card:create", "card:update", "card:delete", "bank:read", "bank:create", "bank:update", "bank:delete", "bank:decrypt"];
3
- declare type PermissionType = typeof PERMISSION_TYPES[number];
4
- interface Permission {
5
- type: PermissionType;
6
- description: string;
7
- applicationTypes: ApplicationType[];
8
- }
9
- export { PERMISSION_TYPES };
10
- export type { PermissionType, Permission };
@@ -1,8 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.PERMISSION_TYPES = void 0;
7
- const PERMISSION_TYPES = ['tenant:read', 'tenant:update', 'tenant:delete', 'application:read', 'application:create', 'application:update', 'application:create', 'reactor:read', 'reactor:create', 'reactor:update', 'reactor:delete', 'log:read', 'token:read', 'token:create', 'token:delete', 'token:decrypt', 'card:read', 'card:create', 'card:update', 'card:delete', 'bank:read', 'bank:create', 'bank:update', 'bank:delete', 'bank:decrypt'];
8
- exports.PERMISSION_TYPES = PERMISSION_TYPES;
@@ -1,33 +0,0 @@
1
- import type { PaginatedQuery } from '../service';
2
- import type { TokenType } from '../tokens';
3
- import type { Auditable } from '../types';
4
- declare type FormulaType = 'official' | 'private';
5
- declare type DataType = 'string' | 'boolean' | 'number';
6
- interface ReactorFormula extends Auditable {
7
- id: string;
8
- name: string;
9
- description?: string;
10
- type: FormulaType;
11
- sourceTokenType: TokenType;
12
- icon?: string;
13
- code: string;
14
- configuration: ReactorFormulaConfig[];
15
- requestParameters: ReactorFormulaRequestParam[];
16
- }
17
- interface ReactorFormulaConfig {
18
- name: string;
19
- description?: string;
20
- type: DataType;
21
- }
22
- interface ReactorFormulaRequestParam {
23
- name: string;
24
- description?: string;
25
- type: DataType;
26
- optional?: boolean;
27
- }
28
- declare type CreateReactorFormulaModel = Omit<ReactorFormula, 'id' | 'createdAt' | 'createdBy' | 'modifiedAt' | 'modifiedBy'>;
29
- interface ReactorFormulaQuery extends PaginatedQuery {
30
- name?: string;
31
- sourceTokenType?: TokenType;
32
- }
33
- export type { FormulaType, DataType, ReactorFormula, ReactorFormulaConfig, ReactorFormulaRequestParam, CreateReactorFormulaModel, ReactorFormulaQuery, };
@@ -1 +0,0 @@
1
- "use strict";
@@ -1,21 +0,0 @@
1
- import type { ReactorFormula } from '../reactor-formulas/types';
2
- import type { PaginatedQuery } from '../service';
3
- import type { TokenType } from '../tokens/types';
4
- import type { Auditable } from '../types';
5
- interface Reactor extends Auditable {
6
- id: string;
7
- tenantId: string;
8
- name: string;
9
- formula: ReactorFormula;
10
- configuration: Record<string, string>;
11
- }
12
- declare type CreateReactorModel = Pick<Reactor, 'name' | 'configuration'> & {
13
- formula: Pick<ReactorFormula, 'id'>;
14
- };
15
- declare type UpdateReactorModel = Pick<Reactor, 'name' | 'configuration'>;
16
- interface ReactorQuery extends PaginatedQuery {
17
- id?: string | string[];
18
- name?: string;
19
- sourceTokenType?: TokenType;
20
- }
21
- export type { Reactor, CreateReactorModel, UpdateReactorModel, ReactorQuery };
package/reactors/types.js DELETED
@@ -1 +0,0 @@
1
- "use strict";
@@ -1,20 +0,0 @@
1
- import type { Auditable } from '../types';
2
- interface Tenant extends Auditable {
3
- id: string;
4
- ownerId: string;
5
- name: string;
6
- }
7
- declare type UpdateTenantModel = Pick<Tenant, 'name'>;
8
- interface TenantUsageReport {
9
- tokenReport: TokenReport;
10
- }
11
- interface TokenReport {
12
- metricsByType: Record<string, TokenTypeMetrics>;
13
- includedMonthlyActiveTokens: number;
14
- monthlyActiveTokens: number;
15
- }
16
- interface TokenTypeMetrics {
17
- count: number;
18
- lastCreatedAt?: string;
19
- }
20
- export type { Tenant, UpdateTenantModel, TenantUsageReport, TokenReport, TokenTypeMetrics, };
package/tenants/types.js DELETED
@@ -1 +0,0 @@
1
- "use strict";
package/tokens/types.d.ts DELETED
@@ -1,36 +0,0 @@
1
- import type { PaginatedQuery } from '../service';
2
- import type { Auditable } from '../types';
3
- declare type Primitive = string | number | boolean | null;
4
- declare type DataObject = {
5
- [member: string]: TokenData;
6
- };
7
- declare type DataArray = Array<TokenData>;
8
- declare type TokenData = Primitive | DataObject | DataArray;
9
- declare type TokenType = 'token' | 'card' | 'bank';
10
- interface TokenEncryptionKey {
11
- key: string;
12
- alg: string;
13
- }
14
- interface TokenEncryption {
15
- cek: TokenEncryptionKey;
16
- kek: TokenEncryptionKey;
17
- }
18
- interface Token extends Auditable {
19
- id: string;
20
- tenantId: string;
21
- type: TokenType;
22
- data: TokenData;
23
- fingerprint?: string;
24
- mask?: DataObject;
25
- metadata?: Record<string, string>;
26
- encryption?: TokenEncryption;
27
- }
28
- declare type CreateTokenModel = Pick<Token, 'type' | 'data' | 'metadata' | 'encryption'>;
29
- interface ListTokensQuery extends PaginatedQuery {
30
- id?: string | string[];
31
- type?: TokenType | TokenType[];
32
- }
33
- interface ListTokensQueryDecrypted extends ListTokensQuery {
34
- decryptType?: TokenType | TokenType[];
35
- }
36
- export type { Primitive, DataObject, DataArray, TokenData, TokenType, TokenEncryptionKey, TokenEncryption, Token, CreateTokenModel, ListTokensQuery, ListTokensQueryDecrypted, };
package/tokens/types.js DELETED
@@ -1 +0,0 @@
1
- "use strict";