@commercetools-frontend-extensions/export-resources-modal 4.3.5 → 4.4.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.
@@ -1,6 +1,6 @@
1
1
  export declare const EXPORTABLE_RESOURCES: {
2
- CATEGORY: string;
3
- PRODUCT: string;
4
- DISCOUNT_CODE: string;
5
- INVENTORY_ENTRY: string;
2
+ readonly CATEGORY: "category";
3
+ readonly PRODUCT: "product";
4
+ readonly DISCOUNT_CODE: "discount-code";
5
+ readonly INVENTORY_ENTRY: "inventory-entry";
6
6
  };
@@ -1,3 +1,5 @@
1
+ import { EXPORT_TYPES } from "../@constants/index.js";
2
+ import type { ExportableResources } from "./resource-type.js";
1
3
  export interface Field {
2
4
  name: string;
3
5
  label: string;
@@ -19,13 +21,19 @@ export interface FieldGroup {
19
21
  }
20
22
  export interface ExportResourcesModalShape {
21
23
  isOpen?: boolean;
22
- resourceType: string;
24
+ resourceType: ExportableResources;
23
25
  outputFormat?: string;
24
- onClose: () => void;
25
- onExportSuccess: () => void;
26
+ filters?: Filters;
26
27
  totalResourcesCount: number;
27
28
  selectedResourceIds?: string[];
28
29
  fieldGroups: FieldGroup[];
29
- renderProperties?: () => void;
30
30
  fieldOrder?: string[];
31
+ withFilters?: boolean;
32
+ onClose: () => void;
33
+ onExportSuccess?: () => void;
31
34
  }
35
+ export type ExportType = keyof typeof EXPORT_TYPES;
36
+ export type Filters = {
37
+ where?: string;
38
+ total: number;
39
+ };
@@ -1,4 +1,4 @@
1
- import { Field, FieldGroup } from "./export-resources-modal-shape.js";
1
+ import type { Field, FieldGroup } from "./export-resources-modal-types.js";
2
2
  export interface FormikField extends Field {
3
3
  isChecked?: boolean;
4
4
  fields?: FormikField[];
@@ -1,3 +1,3 @@
1
- export * from "./export-resources-modal-shape.js";
1
+ export * from "./export-resources-modal-types.js";
2
2
  export * from "./formik.js";
3
3
  export * from "./resource-type.js";
@@ -1,7 +1,5 @@
1
1
  import { EXPORTABLE_RESOURCES } from "../@constants/exportable-resources.js";
2
- type ExportableResources = typeof EXPORTABLE_RESOURCES;
3
- type ResourceKeys = keyof ExportableResources;
2
+ export type ExportableResources = (typeof EXPORTABLE_RESOURCES)[keyof typeof EXPORTABLE_RESOURCES];
4
3
  export type ResourceTypeMap = {
5
- [K in ExportableResources[ResourceKeys]]: any;
4
+ [K in ExportableResources]: unknown;
6
5
  };
7
- export {};
@@ -1,3 +1,4 @@
1
1
  import ExportResourcesModal from "./export-resources-modal.js";
2
2
  export { EXPORT_TYPES, EXPORTABLE_RESOURCES } from "./@constants/index.js";
3
+ export * from "./@types/index.js";
3
4
  export default ExportResourcesModal;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@commercetools-frontend-extensions/export-resources-modal",
3
3
  "description": "Shared export modal for exporting resources",
4
- "version": "4.3.5",
4
+ "version": "4.4.0",
5
5
  "license": "BSD-3-Clause",
6
6
  "publishConfig": {
7
7
  "access": "public"