skyflow-js 1.21.4 → 1.22.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.21.4",
5
+ "version": "1.22.0",
6
6
  "author": "Skyflow",
7
7
  "description": "Skyflow JavaScript SDK",
8
8
  "homepage": "https://github.com/skyflowapi/skyflow-js",
@@ -1,3 +1,4 @@
1
+ import { IUpsertOptions } from '../../../core-utils/collect';
1
2
  import { IValidationRule, IInsertRecordInput } from '../../../utils/common';
2
3
  import { ElementType } from '../../constants';
3
4
  import Container from '../common/container';
@@ -18,6 +19,7 @@ export interface CollectElementInput {
18
19
  interface ICollectOptions {
19
20
  tokens?: boolean;
20
21
  additionalFields?: IInsertRecordInput;
22
+ upsert?: Array<IUpsertOptions>;
21
23
  }
22
24
  declare class CollectContainer extends Container {
23
25
  #private;
@@ -1,4 +1,9 @@
1
1
  import { IInsertRecordInput, IInsertRecord, IValidationRule } from '../utils/common';
2
+ export interface IUpsertOptions {
3
+ table: string;
4
+ column: string;
5
+ }
6
+ export declare const getUpsertColumn: (tableName: string, options: Array<IUpsertOptions> | undefined) => string;
2
7
  export declare const constructInsertRecordRequest: (records: IInsertRecordInput, options?: Record<string, any>) => any;
3
8
  export declare const constructInsertRecordResponse: (responseBody: any, tokens: boolean, records: IInsertRecord[]) => {
4
9
  records: any;
@@ -375,5 +375,33 @@ declare const SKYFLOW_ERROR_CODE: {
375
375
  code: number;
376
376
  description: string;
377
377
  };
378
+ INVALID_TABLE_IN_UPSERT_OPTION: {
379
+ code: number;
380
+ description: string;
381
+ };
382
+ INVALID_COLUMN_IN_UPSERT_OPTION: {
383
+ code: number;
384
+ description: string;
385
+ };
386
+ INVALID_UPSERT_OPTION_TYPE: {
387
+ code: number;
388
+ description: string;
389
+ };
390
+ EMPTY_UPSERT_OPTIONS_ARRAY: {
391
+ code: number;
392
+ description: string;
393
+ };
394
+ INVALID_UPSERT_OPTION_OBJECT_TYPE: {
395
+ code: number;
396
+ description: string;
397
+ };
398
+ MISSING_TABLE_IN_UPSERT_OPTION: {
399
+ code: number;
400
+ description: string;
401
+ };
402
+ MISSING_COLUMN_IN_UPSERT_OPTION: {
403
+ code: number;
404
+ description: string;
405
+ };
378
406
  };
379
407
  export default SKYFLOW_ERROR_CODE;
@@ -169,6 +169,13 @@ declare const logs: {
169
169
  VALIDATION_FAILED: string;
170
170
  REVEAL_ELEMENT_ERROR_STATE: string;
171
171
  INVALID_FILE_TYPE: string;
172
+ INVALID_UPSERT_OPTION_TYPE: string;
173
+ EMPTY_UPSERT_OPTIONS_ARRAY: string;
174
+ INVALID_UPSERT_OPTION_OBJECT_TYPE: string;
175
+ MISSING_TABLE_IN_UPSERT_OPTION: string;
176
+ MISSING_COLUMN_IN_UPSERT_OPTION: string;
177
+ INVALID_TABLE_IN_UPSERT_OPTION: string;
178
+ INVALID_COLUMN_IN_UPSERT_OPTION: string;
172
179
  };
173
180
  warnLogs: {
174
181
  INVALID_EXPIRATION_DATE_FORMAT: string;
@@ -20,3 +20,4 @@ export declare const isValidRegExp: (input: any) => boolean;
20
20
  export declare const validateCardNumberLengthCheck: (cardNumber?: string) => boolean;
21
21
  export declare const validateInitConfig: (initConfig: ISkyflow) => void;
22
22
  export declare const validateCollectElementInput: (input: CollectElementInput, logLevel: any) => void;
23
+ export declare const validateUpsertOptions: (upsertOptions: any) => void;