@tap-payments/connect 0.0.13-test → 0.0.15-test
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/README.md +181 -178
- package/build/@types/index.d.ts +44 -42
- package/build/@types/index.js +1 -1
- package/build/constants/index.d.ts +9 -9
- package/build/constants/index.js +9 -9
- package/build/features/Connect/Connect.d.ts +5 -5
- package/build/features/Connect/Connect.js +65 -65
- package/build/features/Connect/ConnectExpress.d.ts +4 -4
- package/build/features/Connect/ConnectExpress.js +90 -90
- package/build/features/Connect/ConnectFull.d.ts +4 -4
- package/build/features/Connect/ConnectFull.js +13 -13
- package/build/features/Connect/index.d.ts +3 -3
- package/build/features/Connect/index.js +2 -2
- package/build/hooks/index.d.ts +2 -2
- package/build/hooks/index.js +2 -2
- package/build/hooks/useScript.d.ts +1 -1
- package/build/hooks/useScript.js +39 -39
- package/build/hooks/useStyle.d.ts +1 -1
- package/build/hooks/useStyle.js +13 -13
- package/build/index.d.ts +4 -4
- package/build/index.js +7 -7
- package/build/utils/config.d.ts +7 -7
- package/build/utils/config.js +42 -41
- package/build/utils/html.d.ts +1 -1
- package/build/utils/html.js +9 -9
- package/build/utils/index.d.ts +3 -3
- package/build/utils/index.js +3 -3
- package/build/utils/validation.d.ts +2 -2
- package/build/utils/validation.js +52 -52
- package/package.json +1 -1
package/build/utils/html.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export var findOrCreateElementAndInject = function (id) {
|
|
2
|
-
var elementExist = document.getElementById(id);
|
|
3
|
-
if (elementExist)
|
|
4
|
-
return elementExist;
|
|
5
|
-
var element = document.createElement('div');
|
|
6
|
-
element.setAttribute('id', id || 'tap-connect-sdk-lib');
|
|
7
|
-
document.body.prepend(element);
|
|
8
|
-
return element;
|
|
9
|
-
};
|
|
1
|
+
export var findOrCreateElementAndInject = function (id) {
|
|
2
|
+
var elementExist = document.getElementById(id);
|
|
3
|
+
if (elementExist)
|
|
4
|
+
return elementExist;
|
|
5
|
+
var element = document.createElement('div');
|
|
6
|
+
element.setAttribute('id', id || 'tap-connect-sdk-lib');
|
|
7
|
+
document.body.prepend(element);
|
|
8
|
+
return element;
|
|
9
|
+
};
|
package/build/utils/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './html';
|
|
2
|
-
export * from './validation';
|
|
3
|
-
export * from './config';
|
|
1
|
+
export * from './html';
|
|
2
|
+
export * from './validation';
|
|
3
|
+
export * from './config';
|
package/build/utils/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './html';
|
|
2
|
-
export * from './validation';
|
|
3
|
-
export * from './config';
|
|
1
|
+
export * from './html';
|
|
2
|
+
export * from './validation';
|
|
3
|
+
export * from './config';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ConnectProps } from '../@types';
|
|
2
|
-
export declare const validateConnectProps: (props: ConnectProps) => void;
|
|
1
|
+
import { ConnectProps } from '../@types';
|
|
2
|
+
export declare const validateConnectProps: (props: ConnectProps) => void;
|
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
import { Language } from '../constants';
|
|
2
|
-
export var validateConnectProps = function (props) {
|
|
3
|
-
var publicKey = props.publicKey, mature = props.mature, country = props.country, language = props.language, scope = props.scope, open = props.open, domain = props.domain, board = props.board, lead = props.lead, onClose = props.onClose, onCreated = props.onCreated, onError = props.onError, onReady = props.onReady, onSuccess = props.onSuccess, postURL = props.postURL;
|
|
4
|
-
if (!publicKey) {
|
|
5
|
-
throw new Error('publicKey is required');
|
|
6
|
-
}
|
|
7
|
-
if (!country) {
|
|
8
|
-
throw new Error('country is required');
|
|
9
|
-
}
|
|
10
|
-
if (!language) {
|
|
11
|
-
throw new Error('language is required');
|
|
12
|
-
}
|
|
13
|
-
if (![Language.AR, Language.EN].includes(language)) {
|
|
14
|
-
throw new Error('You can only use AR or EN for language');
|
|
15
|
-
}
|
|
16
|
-
if (!scope) {
|
|
17
|
-
throw new Error('scope is required');
|
|
18
|
-
}
|
|
19
|
-
if (!domain) {
|
|
20
|
-
throw new Error('domain is required');
|
|
21
|
-
}
|
|
22
|
-
if (typeof open !== 'boolean') {
|
|
23
|
-
throw new Error('open is required, and must be a boolean');
|
|
24
|
-
}
|
|
25
|
-
if (typeof mature !== 'boolean') {
|
|
26
|
-
throw new Error('mature is required, and must be a boolean');
|
|
27
|
-
}
|
|
28
|
-
if (typeof board !== 'undefined' && typeof board !== 'boolean') {
|
|
29
|
-
throw new Error('board is required, and must be a boolean');
|
|
30
|
-
}
|
|
31
|
-
if (typeof lead !== 'undefined' && typeof lead !== 'string') {
|
|
32
|
-
throw new Error('lead must be a string');
|
|
33
|
-
}
|
|
34
|
-
if (typeof postURL !== 'undefined' && typeof postURL !== 'string') {
|
|
35
|
-
throw new Error('postURL must be a string');
|
|
36
|
-
}
|
|
37
|
-
if (typeof onClose !== 'undefined' && typeof onClose !== 'function') {
|
|
38
|
-
throw new Error('onClose must be a function');
|
|
39
|
-
}
|
|
40
|
-
if (typeof onCreated !== 'undefined' && typeof onCreated !== 'function') {
|
|
41
|
-
throw new Error('onCreated must be a function');
|
|
42
|
-
}
|
|
43
|
-
if (typeof onError !== 'undefined' && typeof onError !== 'function') {
|
|
44
|
-
throw new Error('onError must be a function');
|
|
45
|
-
}
|
|
46
|
-
if (typeof onReady !== 'undefined' && typeof onReady !== 'function') {
|
|
47
|
-
throw new Error('onReady must be a function');
|
|
48
|
-
}
|
|
49
|
-
if (typeof onSuccess !== 'undefined' && typeof onSuccess !== 'function') {
|
|
50
|
-
throw new Error('onSuccess must be a function');
|
|
51
|
-
}
|
|
52
|
-
};
|
|
1
|
+
import { Language } from '../constants';
|
|
2
|
+
export var validateConnectProps = function (props) {
|
|
3
|
+
var publicKey = props.publicKey, mature = props.mature, country = props.country, language = props.language, scope = props.scope, open = props.open, domain = props.domain, board = props.board, lead = props.lead, onClose = props.onClose, onCreated = props.onCreated, onError = props.onError, onReady = props.onReady, onSuccess = props.onSuccess, postURL = props.postURL;
|
|
4
|
+
if (!publicKey) {
|
|
5
|
+
throw new Error('publicKey is required');
|
|
6
|
+
}
|
|
7
|
+
if (!country) {
|
|
8
|
+
throw new Error('country is required');
|
|
9
|
+
}
|
|
10
|
+
if (!language) {
|
|
11
|
+
throw new Error('language is required');
|
|
12
|
+
}
|
|
13
|
+
if (![Language.AR, Language.EN].includes(language)) {
|
|
14
|
+
throw new Error('You can only use AR or EN for language');
|
|
15
|
+
}
|
|
16
|
+
if (!scope) {
|
|
17
|
+
throw new Error('scope is required');
|
|
18
|
+
}
|
|
19
|
+
if (!domain) {
|
|
20
|
+
throw new Error('domain is required');
|
|
21
|
+
}
|
|
22
|
+
if (typeof open !== 'boolean') {
|
|
23
|
+
throw new Error('open is required, and must be a boolean');
|
|
24
|
+
}
|
|
25
|
+
if (typeof mature !== 'boolean') {
|
|
26
|
+
throw new Error('mature is required, and must be a boolean');
|
|
27
|
+
}
|
|
28
|
+
if (typeof board !== 'undefined' && typeof board !== 'boolean') {
|
|
29
|
+
throw new Error('board is required, and must be a boolean');
|
|
30
|
+
}
|
|
31
|
+
if (typeof lead !== 'undefined' && typeof lead !== 'string') {
|
|
32
|
+
throw new Error('lead must be a string');
|
|
33
|
+
}
|
|
34
|
+
if (typeof postURL !== 'undefined' && typeof postURL !== 'string') {
|
|
35
|
+
throw new Error('postURL must be a string');
|
|
36
|
+
}
|
|
37
|
+
if (typeof onClose !== 'undefined' && typeof onClose !== 'function') {
|
|
38
|
+
throw new Error('onClose must be a function');
|
|
39
|
+
}
|
|
40
|
+
if (typeof onCreated !== 'undefined' && typeof onCreated !== 'function') {
|
|
41
|
+
throw new Error('onCreated must be a function');
|
|
42
|
+
}
|
|
43
|
+
if (typeof onError !== 'undefined' && typeof onError !== 'function') {
|
|
44
|
+
throw new Error('onError must be a function');
|
|
45
|
+
}
|
|
46
|
+
if (typeof onReady !== 'undefined' && typeof onReady !== 'function') {
|
|
47
|
+
throw new Error('onReady must be a function');
|
|
48
|
+
}
|
|
49
|
+
if (typeof onSuccess !== 'undefined' && typeof onSuccess !== 'function') {
|
|
50
|
+
throw new Error('onSuccess must be a function');
|
|
51
|
+
}
|
|
52
|
+
};
|