skyflow-js 1.23.1 → 1.24.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/README.md +7 -0
- package/dist/sdkNodeBuild/index.js +1 -1
- package/dist/sdkNodeBuild/index.js.LICENSE.txt +9 -0
- package/dist/sdkNodeBuild/index.js.LICENSE.txt.gz +0 -0
- package/dist/sdkNodeBuild/index.js.gz +0 -0
- package/package.json +3 -3
- package/types/core/constants.d.ts +23 -0
- package/types/core/external/collect/collect-container.d.ts +1 -0
- package/types/core/external/collect/collect-element.d.ts +3 -1
- package/types/core/external/collect/compose-collect-container.d.ts +32 -0
- package/types/core/external/collect/compose-collect-element.d.ts +7 -0
- package/types/core/external/reveal/reveal-container.d.ts +1 -0
- package/types/core/internal/iframe-form/index.d.ts +1 -0
- package/types/skyflow.d.ts +4 -2
- package/types/utils/constants.d.ts +32 -0
- package/types/utils/helpers/index.d.ts +2 -0
- package/types/utils/logs.d.ts +8 -0
- package/types/utils/validators/index.d.ts +1 -0
|
@@ -4,3 +4,12 @@
|
|
|
4
4
|
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @license
|
|
10
|
+
* Lodash <https://lodash.com/>
|
|
11
|
+
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
12
|
+
* Released under MIT license <https://lodash.com/license>
|
|
13
|
+
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
14
|
+
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
15
|
+
*/
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "skyflow-js",
|
|
3
3
|
"preferGlobal": true,
|
|
4
4
|
"analyze": false,
|
|
5
|
-
"version": "1.
|
|
5
|
+
"version": "1.24.0",
|
|
6
6
|
"author": "Skyflow",
|
|
7
7
|
"description": "Skyflow JavaScript SDK",
|
|
8
8
|
"homepage": "https://github.com/skyflowapi/skyflow-js",
|
|
@@ -67,13 +67,13 @@
|
|
|
67
67
|
"@types/node": "^14.0.5",
|
|
68
68
|
"@typescript-eslint/eslint-plugin": "^4.31.2",
|
|
69
69
|
"@typescript-eslint/parser": "^4.31.2",
|
|
70
|
-
"babel-loader": "^
|
|
70
|
+
"babel-loader": "^9.1.2",
|
|
71
71
|
"clean-webpack-plugin": "^4.0.0-alpha.0",
|
|
72
72
|
"compression-webpack-plugin": "^8.0.1",
|
|
73
73
|
"eslint": "^7.32.0",
|
|
74
74
|
"eslint-config-airbnb-base": "^14.2.1",
|
|
75
75
|
"eslint-config-airbnb-typescript": "^14.0.0",
|
|
76
|
-
"eslint-plugin-import": "^2.
|
|
76
|
+
"eslint-plugin-import": "^2.26.0",
|
|
77
77
|
"fork-ts-checker-webpack-plugin": "^6.3.2",
|
|
78
78
|
"html-webpack-plugin": "^5.5.0",
|
|
79
79
|
"jest": "^27.2.1",
|
|
@@ -407,3 +407,26 @@ export declare enum ContentType {
|
|
|
407
407
|
FORMURLENCODED = "application/x-www-form-urlencoded",
|
|
408
408
|
FORMDATA = "multipart/form-data"
|
|
409
409
|
}
|
|
410
|
+
export declare const ALLOWED_FOCUS_AUTO_SHIFT_ELEMENT_TYPES: ElementType[];
|
|
411
|
+
export declare const DEFAULT_ERROR_TEXT_ELEMENT_TYPES: {
|
|
412
|
+
CVV: string;
|
|
413
|
+
EXPIRATION_DATE: string;
|
|
414
|
+
CARD_NUMBER: string;
|
|
415
|
+
CARDHOLDER_NAME: string;
|
|
416
|
+
INPUT_FIELD: string;
|
|
417
|
+
PIN: string;
|
|
418
|
+
EXPIRATION_MONTH: string;
|
|
419
|
+
EXPIRATION_YEAR: string;
|
|
420
|
+
FILE_INPUT: string;
|
|
421
|
+
};
|
|
422
|
+
export declare const DEFAULT_REQUIRED_TEXT_ELEMENT_TYPES: {
|
|
423
|
+
CVV: string;
|
|
424
|
+
EXPIRATION_DATE: string;
|
|
425
|
+
CARD_NUMBER: string;
|
|
426
|
+
CARDHOLDER_NAME: string;
|
|
427
|
+
INPUT_FIELD: string;
|
|
428
|
+
PIN: string;
|
|
429
|
+
EXPIRATION_MONTH: string;
|
|
430
|
+
EXPIRATION_YEAR: string;
|
|
431
|
+
FILE_INPUT: string;
|
|
432
|
+
};
|
|
@@ -23,6 +23,7 @@ interface ICollectOptions {
|
|
|
23
23
|
}
|
|
24
24
|
declare class CollectContainer extends Container {
|
|
25
25
|
#private;
|
|
26
|
+
type: string;
|
|
26
27
|
constructor(options: any, metaData: any, skyflowElements: any, context: any);
|
|
27
28
|
create: (input: CollectElementInput, options?: any) => CollectElement;
|
|
28
29
|
collect: (options?: ICollectOptions) => Promise<unknown>;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
import EventEmitter from '../../../event-emitter';
|
|
1
2
|
import { Context } from '../../../utils/common';
|
|
2
3
|
import SkyflowElement from '../common/skyflow-element';
|
|
3
4
|
declare class CollectElement extends SkyflowElement {
|
|
4
5
|
#private;
|
|
5
6
|
elementType: string;
|
|
7
|
+
type: string;
|
|
6
8
|
containerId: string;
|
|
7
|
-
constructor(elementId: string, elementGroup: any, metaData: any, containerId: string, isSingleElementAPI: boolean | undefined, destroyCallback: Function, updateCallback: Function, context: Context);
|
|
9
|
+
constructor(elementId: string, elementGroup: any, metaData: any, containerId: string, isSingleElementAPI: boolean | undefined, destroyCallback: Function, updateCallback: Function, context: Context, groupEventEmitter?: EventEmitter);
|
|
8
10
|
getID: () => string;
|
|
9
11
|
mount: (domElement: any) => void;
|
|
10
12
|
unmount: () => void;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { IUpsertOptions } from '../../../core-utils/collect';
|
|
2
|
+
import { IValidationRule, IInsertRecordInput } from '../../../utils/common';
|
|
3
|
+
import { ElementType } from '../../constants';
|
|
4
|
+
import Container from '../common/container';
|
|
5
|
+
import ComposableElement from './compose-collect-element';
|
|
6
|
+
export interface CollectElementInput {
|
|
7
|
+
table?: string;
|
|
8
|
+
column?: string;
|
|
9
|
+
inputStyles?: object;
|
|
10
|
+
label?: string;
|
|
11
|
+
labelStyles?: object;
|
|
12
|
+
errorTextStyles?: object;
|
|
13
|
+
placeholder?: string;
|
|
14
|
+
type: ElementType;
|
|
15
|
+
altText?: string;
|
|
16
|
+
validations?: IValidationRule[];
|
|
17
|
+
skyflowID?: string;
|
|
18
|
+
}
|
|
19
|
+
interface ICollectOptions {
|
|
20
|
+
tokens?: boolean;
|
|
21
|
+
additionalFields?: IInsertRecordInput;
|
|
22
|
+
upsert?: Array<IUpsertOptions>;
|
|
23
|
+
}
|
|
24
|
+
declare class ComposableContainer extends Container {
|
|
25
|
+
#private;
|
|
26
|
+
type: string;
|
|
27
|
+
constructor(options: any, metaData: any, skyflowElements: any, context: any);
|
|
28
|
+
create: (input: CollectElementInput, options?: any) => ComposableElement;
|
|
29
|
+
mount: (domElement: any) => void;
|
|
30
|
+
collect: (options?: ICollectOptions) => Promise<unknown>;
|
|
31
|
+
}
|
|
32
|
+
export default ComposableContainer;
|
|
@@ -15,6 +15,7 @@ export interface IRevealElementOptions {
|
|
|
15
15
|
}
|
|
16
16
|
declare class RevealContainer extends Container {
|
|
17
17
|
#private;
|
|
18
|
+
type: string;
|
|
18
19
|
constructor(metaData: any, skyflowElements: any, context: any);
|
|
19
20
|
create(record: IRevealElementInput, options?: IRevealElementOptions): RevealElement;
|
|
20
21
|
reveal(): Promise<unknown>;
|
|
@@ -27,6 +27,7 @@ export declare class IFrameFormElement extends EventEmitter {
|
|
|
27
27
|
clientErrorText: string | undefined;
|
|
28
28
|
format: string;
|
|
29
29
|
skyflowID?: string;
|
|
30
|
+
containerType: string;
|
|
30
31
|
constructor(name: string, label: string, metaData: any, context: Context, skyflowID?: string);
|
|
31
32
|
onFocusChange: (focus: boolean) => void;
|
|
32
33
|
changeFocus: (focus: boolean) => void;
|
package/types/skyflow.d.ts
CHANGED
|
@@ -2,9 +2,11 @@ import { ElementType } from './core/constants';
|
|
|
2
2
|
import RevealContainer from './core/external/reveal/reveal-container';
|
|
3
3
|
import CollectContainer from './core/external/collect/collect-container';
|
|
4
4
|
import { IRevealResponseType, RequestMethod, IInsertRecordInput, IDetokenizeInput, IGetInput, RedactionType, EventName, Env, LogLevel, ValidationRuleType, IGetByIdInput, IInsertOptions } from './utils/common';
|
|
5
|
+
import ComposableContainer from './core/external/collect/compose-collect-container';
|
|
5
6
|
export declare enum ContainerType {
|
|
6
7
|
COLLECT = "COLLECT",
|
|
7
|
-
REVEAL = "REVEAL"
|
|
8
|
+
REVEAL = "REVEAL",
|
|
9
|
+
COMPOSABLE = "COMPOSABLE"
|
|
8
10
|
}
|
|
9
11
|
export interface ISkyflow {
|
|
10
12
|
vaultID?: string;
|
|
@@ -16,7 +18,7 @@ declare class Skyflow {
|
|
|
16
18
|
#private;
|
|
17
19
|
constructor(config: ISkyflow);
|
|
18
20
|
static init(config: ISkyflow): Skyflow;
|
|
19
|
-
container(type: ContainerType, options?: Record<string, any>): CollectContainer | RevealContainer;
|
|
21
|
+
container(type: ContainerType, options?: Record<string, any>): CollectContainer | RevealContainer | ComposableContainer;
|
|
20
22
|
insert(records: IInsertRecordInput, options: IInsertOptions): Promise<any>;
|
|
21
23
|
detokenize(detokenizeInput: IDetokenizeInput): Promise<IRevealResponseType>;
|
|
22
24
|
getById(getByIdInput: IGetByIdInput): Promise<unknown>;
|
|
@@ -499,5 +499,37 @@ declare const SKYFLOW_ERROR_CODE: {
|
|
|
499
499
|
code: number;
|
|
500
500
|
description: string;
|
|
501
501
|
};
|
|
502
|
+
MISSING_COMPOSABLE_LAYOUT_KEY: {
|
|
503
|
+
code: number;
|
|
504
|
+
description: string;
|
|
505
|
+
};
|
|
506
|
+
EMPTY_COMPOSABLE_LAYOUT_ARRAY: {
|
|
507
|
+
code: number;
|
|
508
|
+
description: string;
|
|
509
|
+
};
|
|
510
|
+
INVALID_COMPOSABLE_LAYOUT_TYPE: {
|
|
511
|
+
code: number;
|
|
512
|
+
description: string;
|
|
513
|
+
};
|
|
514
|
+
NEGATIVE_VALUES_COMPOSABLE_LAYOUT: {
|
|
515
|
+
code: number;
|
|
516
|
+
description: string;
|
|
517
|
+
};
|
|
518
|
+
MISMATCH_ELEMENT_COUNT_LAYOUT_SUM: {
|
|
519
|
+
code: number;
|
|
520
|
+
description: string;
|
|
521
|
+
};
|
|
522
|
+
MISSING_COMPOSABLE_CONTAINER_OPTIONS: {
|
|
523
|
+
code: number;
|
|
524
|
+
description: string;
|
|
525
|
+
};
|
|
526
|
+
INVALID_COMPOSABLE_CONTAINER_OPTIONS: {
|
|
527
|
+
code: number;
|
|
528
|
+
description: string;
|
|
529
|
+
};
|
|
530
|
+
COMPOSABLE_CONTAINER_NOT_MOUNTED: {
|
|
531
|
+
code: number;
|
|
532
|
+
description: string;
|
|
533
|
+
};
|
|
502
534
|
};
|
|
503
535
|
export default SKYFLOW_ERROR_CODE;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ContainerType } from '../../skyflow';
|
|
1
2
|
export declare const flattenObject: (obj: any, roots?: any, sep?: string) => any;
|
|
2
3
|
export declare function formatFrameNameToId(name: string): string;
|
|
3
4
|
export declare function removeSpaces(inputString: string): string;
|
|
@@ -9,3 +10,4 @@ export declare const copyToClipboard: (text: string) => void;
|
|
|
9
10
|
export declare const handleCopyIconClick: (textToCopy: string, domCopy: any) => void;
|
|
10
11
|
export declare const fileValidation: (value: any) => boolean;
|
|
11
12
|
export declare const styleToString: (style: any) => string;
|
|
13
|
+
export declare const getContainerType: (frameName: string) => ContainerType;
|
package/types/utils/logs.d.ts
CHANGED
|
@@ -205,6 +205,14 @@ declare const logs: {
|
|
|
205
205
|
EMPTY_TABLE_IN_GETBYID: string;
|
|
206
206
|
EMPTY_REDACTION_TYPE_IN_GETBYID: string;
|
|
207
207
|
GET_BY_SKYFLOWID_REJECTED: string;
|
|
208
|
+
MISSING_COMPOSABLE_LAYOUT_KEY: string;
|
|
209
|
+
EMPTY_COMPOSABLE_LAYOUT_ARRAY: string;
|
|
210
|
+
INVALID_COMPOSABLE_LAYOUT_TYPE: string;
|
|
211
|
+
NEGATIVE_VALUES_COMPOSABLE_LAYOUT: string;
|
|
212
|
+
MISMATCH_ELEMENT_COUNT_LAYOUT_SUM: string;
|
|
213
|
+
MISSING_COMPOSABLE_CONTAINER_OPTIONS: string;
|
|
214
|
+
INVALID_COMPOSABLE_CONTAINER_OPTIONS: string;
|
|
215
|
+
COMPOSABLE_CONTAINER_NOT_MOUNTED: string;
|
|
208
216
|
};
|
|
209
217
|
warnLogs: {
|
|
210
218
|
INVALID_EXPIRATION_DATE_FORMAT: string;
|
|
@@ -22,3 +22,4 @@ export declare const validateCardNumberLengthCheck: (cardNumber?: string) => boo
|
|
|
22
22
|
export declare const validateInitConfig: (initConfig: ISkyflow) => void;
|
|
23
23
|
export declare const validateCollectElementInput: (input: CollectElementInput, logLevel: any) => void;
|
|
24
24
|
export declare const validateUpsertOptions: (upsertOptions: any) => void;
|
|
25
|
+
export declare const validateComposableContainerOptions: (options: any) => void;
|