skyflow-js 1.22.0 → 1.23.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.
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.22.0",
5
+ "version": "1.23.0",
6
6
  "author": "Skyflow",
7
7
  "description": "Skyflow JavaScript SDK",
8
8
  "homepage": "https://github.com/skyflowapi/skyflow-js",
@@ -1,9 +1,9 @@
1
- import { IDetokenizeInput, IGetByIdInput } from '../../utils/common';
1
+ import { IDetokenizeInput, IGetByIdInput, IInsertOptions } from '../../utils/common';
2
2
  declare class SkyflowContainer {
3
3
  #private;
4
4
  constructor(client: any, context: any);
5
5
  detokenize(detokenizeInput: IDetokenizeInput): Promise<any>;
6
- insert(records: any, options: any): Promise<any>;
6
+ insert(records: any, options: IInsertOptions): Promise<any>;
7
7
  getById(getByIdInput: IGetByIdInput): Promise<unknown>;
8
8
  }
9
9
  export default SkyflowContainer;
@@ -1,7 +1,7 @@
1
1
  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
- import { IRevealResponseType, RequestMethod, IInsertRecordInput, IDetokenizeInput, IGetByIdInput, RedactionType, EventName, Env, LogLevel, ValidationRuleType } from './utils/common';
4
+ import { IRevealResponseType, RequestMethod, IInsertRecordInput, IDetokenizeInput, IGetByIdInput, RedactionType, EventName, Env, LogLevel, ValidationRuleType, IInsertOptions } from './utils/common';
5
5
  export declare enum ContainerType {
6
6
  COLLECT = "COLLECT",
7
7
  REVEAL = "REVEAL"
@@ -17,9 +17,10 @@ declare class Skyflow {
17
17
  constructor(config: ISkyflow);
18
18
  static init(config: ISkyflow): Skyflow;
19
19
  container(type: ContainerType, options?: Record<string, any>): CollectContainer | RevealContainer;
20
- insert(records: IInsertRecordInput, options?: Record<string, any>): Promise<any>;
20
+ insert(records: IInsertRecordInput, options: IInsertOptions): Promise<any>;
21
21
  detokenize(detokenizeInput: IDetokenizeInput): Promise<IRevealResponseType>;
22
22
  getById(getByIdInput: IGetByIdInput): Promise<unknown>;
23
+ get(getByIdInput: IGetByIdInput): Promise<unknown>;
23
24
  static get ContainerType(): typeof ContainerType;
24
25
  static get ElementType(): typeof ElementType;
25
26
  static get RedactionType(): typeof RedactionType;
@@ -56,9 +56,11 @@ export interface IDetokenizeInput {
56
56
  records: IRevealRecord[];
57
57
  }
58
58
  export interface ISkyflowIdRecord {
59
- ids: string[];
59
+ ids?: string[];
60
60
  redaction: RedactionType;
61
61
  table: string;
62
+ columnName?: string;
63
+ columnValues?: string[];
62
64
  }
63
65
  export interface IGetByIdInput {
64
66
  records: ISkyflowIdRecord[];
@@ -71,3 +73,11 @@ export interface IValidationRule {
71
73
  type: ValidationRuleType;
72
74
  params: any;
73
75
  }
76
+ export interface IUpsertOption {
77
+ table: string;
78
+ column: string;
79
+ }
80
+ export interface IInsertOptions {
81
+ tokens?: boolean;
82
+ upsert?: IUpsertOption[];
83
+ }
@@ -131,47 +131,51 @@ declare const SKYFLOW_ERROR_CODE: {
131
131
  code: number;
132
132
  description: string;
133
133
  };
134
- RECORDS_KEY_NOT_FOUND_GETBYID: {
134
+ RECORDS_KEY_NOT_FOUND_GET: {
135
135
  code: number;
136
136
  description: string;
137
137
  };
138
- INVALID_RECORDS_IN_GETBYID: {
138
+ INVALID_RECORDS_IN_GET: {
139
139
  code: number;
140
140
  description: string;
141
141
  };
142
- EMPTY_RECORDS_GETBYID: {
142
+ EMPTY_RECORDS_GET: {
143
143
  code: number;
144
144
  description: string;
145
145
  };
146
- MISSING_IDS_IN_GETBYID: {
146
+ MISSING_IDS_IN_GET: {
147
147
  code: number;
148
148
  description: string;
149
149
  };
150
- INVALID_IDS_IN_GETBYID: {
150
+ INVALID_IDS_IN_GET: {
151
151
  code: number;
152
152
  description: string;
153
153
  };
154
- EMPTY_IDS_IN_GETBYID: {
154
+ INVALID_COLUMN_VALUES_IN_GET: {
155
155
  code: number;
156
156
  description: string;
157
157
  };
158
- INVALID_SKYFLOWID_TYPE_IN_GETBYID: {
158
+ EMPTY_IDS_IN_GET: {
159
159
  code: number;
160
160
  description: string;
161
161
  };
162
- MISSING_TABLE_IN_GETBYID: {
162
+ INVALID_SKYFLOWID_TYPE_IN_GET: {
163
163
  code: number;
164
164
  description: string;
165
165
  };
166
- INVALID_TABLE_IN_GETBYID: {
166
+ MISSING_TABLE_IN_GET: {
167
167
  code: number;
168
168
  description: string;
169
169
  };
170
- MISSING_REDACTION_IN_GETBYID: {
170
+ INVALID_TABLE_IN_GET: {
171
171
  code: number;
172
172
  description: string;
173
173
  };
174
- INVALID_REDACTION_TYPE_IN_GETBYID: {
174
+ MISSING_REDACTION_IN_GET: {
175
+ code: number;
176
+ description: string;
177
+ };
178
+ INVALID_REDACTION_TYPE_IN_GET: {
175
179
  code: number;
176
180
  description: string;
177
181
  };
@@ -239,15 +243,15 @@ declare const SKYFLOW_ERROR_CODE: {
239
243
  code: number;
240
244
  description: string;
241
245
  };
242
- EMPTY_SKYFLOWID_IN_GETBYID: {
246
+ EMPTY_SKYFLOWID_IN_GET: {
243
247
  code: number;
244
248
  description: string;
245
249
  };
246
- EMPTY_TABLE_IN_GETBYID: {
250
+ EMPTY_TABLE_IN_GET: {
247
251
  code: number;
248
252
  description: string;
249
253
  };
250
- EMPTY_REDACTION_TYPE_IN_GETBYID: {
254
+ EMPTY_REDACTION_TYPE_IN_GET: {
251
255
  code: number;
252
256
  description: string;
253
257
  };
@@ -287,6 +291,18 @@ declare const SKYFLOW_ERROR_CODE: {
287
291
  code: number;
288
292
  description: string;
289
293
  };
294
+ INVALID_RECORD_COLUMN_VALUE: {
295
+ code: number;
296
+ description: string;
297
+ };
298
+ MISSING_RECORD_COLUMN_VALUE: {
299
+ code: number;
300
+ description: string;
301
+ };
302
+ MISSING_RECORD_COLUMN_NAME: {
303
+ code: number;
304
+ description: string;
305
+ };
290
306
  INVALID_EVENT_TYPE: {
291
307
  code: number;
292
308
  description: string;
@@ -403,5 +419,29 @@ declare const SKYFLOW_ERROR_CODE: {
403
419
  code: number;
404
420
  description: string;
405
421
  };
422
+ INVALID_RECORD_COLUMN_VALUE_TYPE: {
423
+ code: number;
424
+ description: string;
425
+ };
426
+ INVALID_COLUMN_VALUES_TYPE: {
427
+ code: number;
428
+ description: string;
429
+ };
430
+ EMPTY_RECORD_COLUMN_VALUES: {
431
+ code: number;
432
+ description: string;
433
+ };
434
+ EMPTY_COLUMN_VALUE: {
435
+ code: number;
436
+ description: string;
437
+ };
438
+ MISSING_IDS_OR_COLUMN_VALUES_IN_GET: {
439
+ code: number;
440
+ description: string;
441
+ };
442
+ SKYFLOW_IDS_AND_COLUMN_NAME_BOTH_SPECIFIED: {
443
+ code: number;
444
+ description: string;
445
+ };
406
446
  };
407
447
  export default SKYFLOW_ERROR_CODE;
@@ -8,7 +8,7 @@ declare const logs: {
8
8
  REVEAL_CONTAINER_CREATED: string;
9
9
  VALIDATE_RECORDS: string;
10
10
  VALIDATE_DETOKENIZE_INPUT: string;
11
- VALIDATE_GET_BY_ID_INPUT: string;
11
+ VALIDATE_GET_INPUT: string;
12
12
  VALIDATE_COLLECT_RECORDS: string;
13
13
  VALIDATE_REVEAL_RECORDS: string;
14
14
  CREATED_ELEMENT: string;
@@ -18,7 +18,7 @@ declare const logs: {
18
18
  REVEAL_SUBMIT_SUCCESS: string;
19
19
  INSERT_DATA_SUCCESS: string;
20
20
  DETOKENIZE_SUCCESS: string;
21
- GET_BY_ID_SUCCESS: string;
21
+ GET_SUCCESS: string;
22
22
  BEARER_TOKEN_LISTENER: string;
23
23
  CAPTURED_BEARER_TOKEN_EVENT: string;
24
24
  BEARER_TOKEN_RESOLVED: string;
@@ -28,14 +28,14 @@ declare const logs: {
28
28
  EMIT_PURE_JS_CONTROLLER: string;
29
29
  INSERT_TRIGGERED: string;
30
30
  DETOKENIZE_TRIGGERED: string;
31
- GET_BY_ID_TRIGGERED: string;
31
+ GET_TRIGGERED: string;
32
32
  EMIT_PURE_JS_REQUEST: string;
33
33
  CAPTURE_PURE_JS_REQUEST: string;
34
34
  LISTEN_PURE_JS_REQUEST: string;
35
35
  CAPTURE_PUREJS_FRAME: string;
36
36
  FETCH_RECORDS_RESOLVED: string;
37
37
  INSERT_RECORDS_RESOLVED: string;
38
- GET_BY_SKYFLOWID_RESOLVED: string;
38
+ GET_RESOLVED: string;
39
39
  EMIT_EVENT: string;
40
40
  CAPTURE_EVENT: string;
41
41
  LISTEN_COLLECT_FRAME_READY: string;
@@ -98,17 +98,18 @@ declare const logs: {
98
98
  INVALID_RECORDS_IN_DETOKENIZE: string;
99
99
  MISSING_TOKEN_IN_DETOKENIZE: string;
100
100
  INVALID_TOKEN_IN_DETOKENIZE: string;
101
- RECORDS_KEY_NOT_FOUND_GETBYID: string;
102
- INVALID_RECORDS_IN_GETBYID: string;
103
- EMPTY_RECORDS_GETBYID: string;
104
- MISSING_IDS_IN_GETBYID: string;
105
- INVALID_IDS_IN_GETBYID: string;
106
- EMPTY_IDS_IN_GETBYID: string;
107
- INVALID_SKYFLOWID_TYPE_IN_GETBYID: string;
108
- MISSING_TABLE_IN_GETBYID: string;
109
- INVALID_TABLE_IN_GETBYID: string;
110
- MISSING_REDACTION_IN_GETBYID: string;
111
- INVALID_REDACTION_TYPE_IN_GETBYID: string;
101
+ RECORDS_KEY_NOT_FOUND_GET: string;
102
+ INVALID_RECORDS_IN_GET: string;
103
+ EMPTY_RECORDS_GET: string;
104
+ MISSING_IDS_IN_GET: string;
105
+ INVALID_IDS_IN_GET: string;
106
+ INVALID_COLUMN_VALUES_IN_GET: string;
107
+ EMPTY_IDS_IN_GET: string;
108
+ INVALID_SKYFLOWID_TYPE_IN_GET: string;
109
+ MISSING_TABLE_IN_GET: string;
110
+ INVALID_TABLE_IN_GET: string;
111
+ MISSING_REDACTION_IN_GET: string;
112
+ INVALID_REDACTION_TYPE_IN_GET: string;
112
113
  EMPTY_RECORDS_REVEAL: string;
113
114
  MISSING_TOKEN_KEY_REVEAL: string;
114
115
  INVALID_TOKEN_ID_REVEAL: string;
@@ -118,13 +119,13 @@ declare const logs: {
118
119
  EMPTY_TABLE_IN_ADDITIONAL_FIELDS: string;
119
120
  EMPTY_FIELDS_IN_ADDITIONAL_FIELDS: string;
120
121
  EMPTY_TOKEN_IN_DETOKENIZE: string;
121
- EMPTY_SKYFLOWID_IN_GETBYID: string;
122
- EMPTY_TABLE_IN_GETBYID: string;
123
- EMPTY_REDACTION_TYPE_IN_GETBYID: string;
122
+ EMPTY_SKYFLOWID_IN_GET: string;
123
+ EMPTY_TABLE_IN_GET: string;
124
+ EMPTY_REDACTION_TYPE_IN_GET: string;
124
125
  EMPTY_TOKEN_ID_REVEAL: string;
125
126
  FETCH_RECORDS_REJECTED: string;
126
127
  INSERT_RECORDS_REJECTED: string;
127
- GET_BY_SKYFLOWID_REJECTED: string;
128
+ GET_REJECTED: string;
128
129
  FAILED_REVEAL: string;
129
130
  MISSING_TABLE_IN_COLLECT: string;
130
131
  EMPTY_TABLE_IN_COLLECT: string;
@@ -176,6 +177,15 @@ declare const logs: {
176
177
  MISSING_COLUMN_IN_UPSERT_OPTION: string;
177
178
  INVALID_TABLE_IN_UPSERT_OPTION: string;
178
179
  INVALID_COLUMN_IN_UPSERT_OPTION: string;
180
+ INVALID_RECORD_COLUMN_VALUE: string;
181
+ MISSING_RECORD_COLUMN_VALUE: string;
182
+ MISSING_RECORD_COLUMN_NAME: string;
183
+ INVALID_RECORD_COLUMN_VALUE_TYPE: string;
184
+ INVALID_COLUMN_VALUES_TYPE: string;
185
+ EMPTY_RECORD_COLUMN_VALUES: string;
186
+ EMPTY_COLUMN_VALUE: string;
187
+ MISSING_IDS_OR_COLUMN_VALUES_IN_GET: string;
188
+ SKYFLOW_IDS_AND_COLUMN_NAME_BOTH_SPECIFIED: string;
179
189
  };
180
190
  warnLogs: {
181
191
  INVALID_EXPIRATION_DATE_FORMAT: string;
@@ -183,6 +193,7 @@ declare const logs: {
183
193
  UNABLE_TO_SET_VALUE_IN_PROD_ENV: string;
184
194
  UNABLE_TO_CLEAR_VALUE_IN_PROD_ENV: string;
185
195
  COLLECT_ALT_TEXT_DEPERECATED: string;
196
+ GET_BY_ID_DEPRECATED: string;
186
197
  };
187
198
  };
188
199
  export default logs;