@basis-theory/basis-theory-js 2.6.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 +3 -1
- package/BasisTheory.js +11 -0
- package/application-templates/BasisTheoryApplicationTemplates.d.ts +9 -0
- package/application-templates/BasisTheoryApplicationTemplates.js +20 -0
- package/application-templates/index.d.ts +1 -0
- package/application-templates/index.js +13 -0
- package/common/constants.js +1 -0
- package/package.json +1 -1
- package/types/models/application-templates.d.ts +15 -0
- package/types/models/application-templates.js +8 -0
- package/types/sdk/sdk.d.ts +2 -1
- package/types/sdk/services/application-templates.d.ts +6 -0
- package/types/sdk/services/application-templates.js +1 -0
- package/types/sdk/services/index.d.ts +1 -0
- package/types/sdk/services/index.js +13 -0
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");
|
package/common/constants.js
CHANGED
package/package.json
CHANGED
|
@@ -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 };
|
package/types/sdk/sdk.d.ts
CHANGED
|
@@ -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";
|
|
@@ -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
|
});
|