dromo-uploader-js 2.7.0 → 2.9.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.
@@ -610,6 +610,14 @@ export type IDeveloperSettings = {
610
610
  browserExcelParsing?: boolean;
611
611
  version?: string;
612
612
  alternateDomain?: string | null;
613
+ xmlParsingOptions?: {
614
+ forceArrayTags?: string[] | undefined;
615
+ headerAlias?: {
616
+ [x: string]: string;
617
+ } | undefined;
618
+ enableAutoArrayHeuristics?: boolean;
619
+ assumeSingleRootChildIsArray?: boolean;
620
+ } | undefined;
613
621
  savePartialSession?: boolean;
614
622
  sessionId?: string | null;
615
623
  };
@@ -620,6 +628,7 @@ export type IUser = {
620
628
  companyId?: string | undefined;
621
629
  companyName?: string | undefined;
622
630
  };
631
+ export type CustomStepInsertAfter = "HEADER_SELECT" | "COLUMN_MATCH" | "SELECT_MATCH";
623
632
  type MaybeAsync<T> = T | Promise<T>;
624
633
  export interface IParentConnectionMethods {
625
634
  handleColumnHooks: (fieldName: string, data: IColumnHookInput[]) => Promise<IColumnHookOutput[]>;
@@ -631,6 +640,8 @@ export interface IParentConnectionMethods {
631
640
  handleCloseModal: () => void;
632
641
  handleCancel: () => void;
633
642
  handleParseFileCallback: (buffer: ArrayBuffer, fileName: string) => Promise<string[][] | void>;
643
+ handleCustomStep: (id: string) => Promise<string | void>;
644
+ handleCustomStepMessage: (id: string, payload: unknown) => Promise<void>;
634
645
  }
635
646
  export interface IConnectionMethods {
636
647
  init: (licenseKey: string, fields: IDeveloperField[], settings: IDeveloperSettings, user: IUser, appHost?: string) => void;
@@ -653,11 +664,20 @@ export interface IConnectionMethods {
653
664
  cancelButtonText?: string;
654
665
  }) => void;
655
666
  setCustomParserFileExtensions: (fileExtensions: string[]) => void;
667
+ setCustomSteps: (steps: Array<{
668
+ id: string;
669
+ insertAfter: CustomStepInsertAfter;
670
+ label?: string;
671
+ url?: string;
672
+ }>) => void;
673
+ completeCustomStep: () => void;
674
+ goBackCustomStep: () => void;
656
675
  }
657
676
  export type WrapAsync<T> = {
658
677
  [P in keyof T]: T[P] extends (...args: infer Args) => infer Return ? (...args: Args) => Promise<Return> : T[P];
659
678
  };
660
679
  export type IPublicConnectionMethods = WrapAsync<Pick<IConnectionMethods, "addField" | "updateInfoMessages" | "setHeaderRowOverride" | "setUser" | "removeField" | "setDevelopmentMode" | "addRows" | "removeRows" | "setConfirmationMessage">>;
680
+ export type ICustomStepConnectionMethods = IPublicConnectionMethods & WrapAsync<Pick<IConnectionMethods, "completeCustomStep" | "goBackCustomStep">>;
661
681
  export type IDeveloperFieldType = "string" | "checkbox" | "select" | "multi-select" | "number" | "domain" | "date" | "ssn" | "datetime" | "phone-number" | "time" | "url" | "us-zip-code" | "country" | "uuid" | "us-state-territory" | "email";
662
682
  export interface ICellRef {
663
683
  rowIndex: number;
@@ -808,6 +828,25 @@ export interface IStepHook {
808
828
  type: keyof typeof EStepHook;
809
829
  callback: (uploader: IPublicConnectionMethods, data: IUploadStepData | IReviewStepData | IReviewStepPostHooksData) => MaybeAsync<void>;
810
830
  }
831
+ export interface ICustomStepConfig {
832
+ id: string;
833
+ insertAfter: CustomStepInsertAfter;
834
+ /** Label shown in the stepper bar. Defaults to the step id if omitted. */
835
+ label?: string;
836
+ /**
837
+ * Dromo renders an <iframe> pointing to this URL inside the standard
838
+ * StepContainer. Step id and label are appended as query params
839
+ * (?stepId=…&stepLabel=…). The iframe page signals navigation by posting
840
+ * { type: "DROMO_NEXT" } or { type: "DROMO_BACK" } to its parent window.
841
+ */
842
+ url?: string;
843
+ /**
844
+ * Called when the iframe posts { type: "DROMO_MESSAGE", payload: any }.
845
+ * Receives the same uploader instance as step hooks so you can call
846
+ * addField, removeField, addRows, etc. in response to iframe messages.
847
+ */
848
+ onMessage?: (uploader: ICustomStepConnectionMethods, payload: unknown) => MaybeAsync<void>;
849
+ }
811
850
  export type IBeforeFinishCallback = (data: Record<string, any>[], metadata: IResultMetadataWithValues, instance: IPublicConnectionMethods) => MaybeAsync<IBeforeFinishOutput>;
812
851
  export type IBeforeFinishOutput = void | {
813
852
  cancel: true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dromo-uploader-js",
3
- "version": "2.7.0",
3
+ "version": "2.9.0",
4
4
  "description": "Easy to use data (CSV, TSV, Excel) importer",
5
5
  "author": "ankitgoyal100",
6
6
  "license": "MIT",
@@ -34,6 +34,7 @@
34
34
  "@rollup/plugin-commonjs": "^16.0.0",
35
35
  "@rollup/plugin-node-resolve": "^10.0.0",
36
36
  "@rollup/plugin-replace": "^2.3.4",
37
+ "@rollup/plugin-terser": "^1.0.0",
37
38
  "@typescript-eslint/eslint-plugin": "^6.3.0",
38
39
  "@typescript-eslint/parser": "^6.3.0",
39
40
  "eslint": "^7.32.0",
@@ -43,12 +44,11 @@
43
44
  "eslint-plugin-node": "^11.1.0",
44
45
  "eslint-plugin-prettier": "^4.0.0",
45
46
  "eslint-plugin-promise": "^5.2.0",
46
- "microbundle-crl": "^0.13.10",
47
47
  "prettier": "^2.6.2",
48
48
  "rollup": "^2.79.2",
49
- "rollup-plugin-terser": "^7.0.2",
50
49
  "rollup-plugin-typescript2": "^0.29.0",
51
- "serve": "^13.0.2",
50
+ "serve": "^14.2.6",
51
+ "tslib": "^2.8.1",
52
52
  "typescript": "^5.1.6"
53
53
  },
54
54
  "files": [