@basis-theory/basis-theory-js 2.5.0 → 2.7.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/BasisTheory.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { BasisTheoryElements, CardElement, CardExpirationDateElement, CardNumberElement, CardVerificationCodeElement, CreateCardElementOptions, CreateCardExpirationDateElementOptions, CreateCardNumberElementOptions, CreateCardVerificationCodeElementOptions, CreateTextElementOptions, TextElement, TokenizeData as ElementsTokenizeData, Tokens as ElementsTokens } from './types/elements';
2
2
  import type { TokenizeData } from './types/models';
3
- import type { Applications, BasisTheory as IBasisTheory, BasisTheoryInit, BasisTheoryInitOptions, BasisTheoryInitOptionsWithElements, BasisTheoryInitOptionsWithoutElements, HttpClient, Logs, Permissions, Proxies, Proxy, ReactorFormulas, Reactors, RequestOptions, Sessions, Tenants, Tokens } from './types/sdk';
3
+ import type { Applications, ApplicationTemplates, BasisTheory as IBasisTheory, BasisTheoryInit, BasisTheoryInitOptions, BasisTheoryInitOptionsWithElements, BasisTheoryInitOptionsWithoutElements, HttpClient, Logs, Permissions, Proxies, Proxy, ReactorFormulas, Reactors, RequestOptions, Sessions, Tenants, Tokens } from './types/sdk';
4
4
  import { Transactions } from './types/sdk/services/transactions';
5
5
  export declare class BasisTheory implements BasisTheoryInit, IBasisTheory, BasisTheoryElements {
6
6
  private _initStatus;
@@ -9,6 +9,7 @@ export declare class BasisTheory implements BasisTheoryInit, IBasisTheory, Basis
9
9
  private _tokenize?;
10
10
  private _elements?;
11
11
  private _applications?;
12
+ private _applicationTemplates?;
12
13
  private _tenants?;
13
14
  private _logs?;
14
15
  private _reactorFormulas?;
@@ -30,6 +31,7 @@ export declare class BasisTheory implements BasisTheoryInit, IBasisTheory, Basis
30
31
  get initOptions(): Required<BasisTheoryInitOptions>;
31
32
  get tokens(): Tokens & ElementsTokens;
32
33
  get applications(): Applications;
34
+ get applicationTemplates(): ApplicationTemplates;
33
35
  get client(): HttpClient | undefined;
34
36
  get tenants(): Tenants;
35
37
  get logs(): Logs;
package/BasisTheory.js CHANGED
@@ -7,6 +7,8 @@ exports.BasisTheory = void 0;
7
7
 
8
8
  var _transactions = require("./transactions");
9
9
 
10
+ var _applicationTemplates = require("./application-templates");
11
+
10
12
  var _applications = require("./applications");
11
13
 
12
14
  var _common = require("./common");
@@ -90,6 +92,11 @@ class BasisTheory {
90
92
  baseURL: new URL(_common.CLIENT_BASE_PATHS.applications, baseUrl).toString(),
91
93
  appInfo
92
94
  });
95
+ this._applicationTemplates = new _applicationTemplates.BasisTheoryApplicationTemplates({
96
+ apiKey,
97
+ baseURL: new URL(_common.CLIENT_BASE_PATHS.applicationTemplates, baseUrl).toString(),
98
+ appInfo
99
+ });
93
100
  this._tenants = new _tenants.BasisTheoryTenants({
94
101
  apiKey,
95
102
  baseURL: new URL(_common.CLIENT_BASE_PATHS.tenants, baseUrl).toString(),
@@ -186,6 +193,10 @@ class BasisTheory {
186
193
  return (0, _common.assertInit)(this._applications);
187
194
  }
188
195
 
196
+ get applicationTemplates() {
197
+ return (0, _common.assertInit)(this._applicationTemplates);
198
+ }
199
+
189
200
  get client() {
190
201
  if (this._elements) {
191
202
  var _this$_elements;
@@ -0,0 +1,9 @@
1
+ import { ApplicationTemplate } from '../types/models/application-templates';
2
+ import { RequestOptions } from '../types/sdk';
3
+ export declare const BasisTheoryApplicationTemplates: {
4
+ new (options: import("../service/types").BasisTheoryServiceOptions): {
5
+ list(options?: RequestOptions): Promise<ApplicationTemplate[]>;
6
+ readonly client: import("axios").AxiosInstance;
7
+ };
8
+ } & (new (...args: any[]) => import("../types/sdk/services/shared").Retrieve<ApplicationTemplate>);
9
+ export type BasisTheoryApplicationTemplates = InstanceType<typeof BasisTheoryApplicationTemplates>;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.BasisTheoryApplicationTemplates = void 0;
7
+
8
+ var _common = require("./../common");
9
+
10
+ var _service = require("./../service");
11
+
12
+ var _CrudBuilder = require("./../service/CrudBuilder");
13
+
14
+ const BasisTheoryApplicationTemplates = new _CrudBuilder.CrudBuilder(class BasisTheoryApplicationTemplates extends _service.BasisTheoryService {
15
+ list(options) {
16
+ return this.client.get('/', (0, _common.createRequestConfig)(options)).then(_common.dataExtractor);
17
+ }
18
+
19
+ }).retrieve().build();
20
+ exports.BasisTheoryApplicationTemplates = BasisTheoryApplicationTemplates;
@@ -0,0 +1 @@
1
+ export { BasisTheoryApplicationTemplates } from './BasisTheoryApplicationTemplates';
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "BasisTheoryApplicationTemplates", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _BasisTheoryApplicationTemplates.BasisTheoryApplicationTemplates;
10
+ }
11
+ });
12
+
13
+ var _BasisTheoryApplicationTemplates = require("./BasisTheoryApplicationTemplates");
@@ -32,6 +32,7 @@ const CLIENT_BASE_PATHS = {
32
32
  tokens: 'tokens',
33
33
  tokenize: 'tokenize',
34
34
  applications: 'applications',
35
+ applicationTemplates: 'application-templates',
35
36
  tenants: 'tenants/self',
36
37
  logs: 'logs',
37
38
  reactorFormulas: 'reactor-formulas',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@basis-theory/basis-theory-js",
3
- "version": "2.5.0",
3
+ "version": "2.7.0",
4
4
  "repository": "https://github.com/Basis-Theory/basis-theory-js",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -0,0 +1,15 @@
1
+ import type { ApplicationType, AccessRule } from './applications';
2
+ declare const TEMPLATE_TYPES: readonly ["starters", "payments", "banking", "pii", "management"];
3
+ type TemplateType = typeof TEMPLATE_TYPES[number];
4
+ interface ApplicationTemplate {
5
+ id: string;
6
+ name: string;
7
+ description: string;
8
+ applicationType: ApplicationType;
9
+ templateType: TemplateType;
10
+ isStarter: boolean;
11
+ permissions?: string[];
12
+ rules?: AccessRule[];
13
+ }
14
+ export type { TemplateType, ApplicationTemplate };
15
+ export { TEMPLATE_TYPES };
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.TEMPLATE_TYPES = void 0;
7
+ const TEMPLATE_TYPES = ['starters', 'payments', 'banking', 'pii', 'management'];
8
+ exports.TEMPLATE_TYPES = TEMPLATE_TYPES;
@@ -1,6 +1,6 @@
1
1
  import type { BasisTheoryElements } from '../../types/elements';
2
2
  import { Transactions } from '../../types/sdk/services/transactions';
3
- import type { Applications, HttpClient, Logs, Permissions, Proxies, Proxy, ReactorFormulas, Reactors, Sessions, Tenants, Tokenize, Tokens } from './services';
3
+ import type { Applications, ApplicationTemplates, HttpClient, Logs, Permissions, Proxies, Proxy, ReactorFormulas, Reactors, Sessions, Tenants, Tokenize, Tokens } from './services';
4
4
  interface ApplicationInfo {
5
5
  name?: string;
6
6
  version?: string;
@@ -25,6 +25,7 @@ interface BasisTheoryInit {
25
25
  }
26
26
  interface BasisTheory extends Tokenize {
27
27
  applications: Applications;
28
+ applicationTemplates: ApplicationTemplates;
28
29
  /**
29
30
  * @description Allows you to utilize element values in requests to a third-party API using our HTTP client service.
30
31
  * @requires Before proceeding, ensure that the elements are properly initialized. Refer to the [Basis Theory Docs - Initialize elements]((https://developers.basistheory.com/docs/sdks/web/javascript/#initialization)) for more information.
@@ -0,0 +1,6 @@
1
+ import type { ApplicationTemplate } from '../../../types/models/application-templates';
2
+ import type { RequestOptions, Retrieve } from './shared';
3
+ interface ApplicationTemplates extends Retrieve<ApplicationTemplate> {
4
+ list(options?: RequestOptions): Promise<ApplicationTemplate[]>;
5
+ }
6
+ export type { ApplicationTemplates };
@@ -0,0 +1 @@
1
+ "use strict";
@@ -12,3 +12,4 @@ export * from './proxy';
12
12
  export * from './sessions';
13
13
  export * from './transactions';
14
14
  export * from './http';
15
+ export * from './application-templates';
@@ -184,4 +184,17 @@ Object.keys(_http).forEach(function (key) {
184
184
  return _http[key];
185
185
  }
186
186
  });
187
+ });
188
+
189
+ var _applicationTemplates = require("./application-templates");
190
+
191
+ Object.keys(_applicationTemplates).forEach(function (key) {
192
+ if (key === "default" || key === "__esModule") return;
193
+ if (key in exports && exports[key] === _applicationTemplates[key]) return;
194
+ Object.defineProperty(exports, key, {
195
+ enumerable: true,
196
+ get: function () {
197
+ return _applicationTemplates[key];
198
+ }
199
+ });
187
200
  });