ingeniuscliq-core 0.2.48 → 0.2.49

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.
@@ -17,7 +17,7 @@ const { prompt } = enquirer;
17
17
  * @param {string} moduleName The name of the module
18
18
  */
19
19
  function updateModulesIndex(moduleName) {
20
- const modulesDir = createBaseDir('modules', ['src', 'core']);
20
+ const modulesDir = createBaseDir('modules', ['core']);
21
21
  const indexPath = joinPaths(modulesDir, 'index.ts');
22
22
  const importStatement = `import './${moduleName}'`;
23
23
 
@@ -74,7 +74,7 @@ function createModule(moduleName, selectedDirectories = SUPPORTED_DIRECTORIES) {
74
74
  process.exit(1);
75
75
  }
76
76
 
77
- const baseDir = createBaseDir(moduleName, ['src', 'core', 'modules']);
77
+ const baseDir = createBaseDir(moduleName, ['core', 'modules']);
78
78
 
79
79
  // Check if module already exists
80
80
  if (fs.existsSync(baseDir)) {
@@ -141,7 +141,7 @@ function createModule(moduleName, selectedDirectories = SUPPORTED_DIRECTORIES) {
141
141
  }
142
142
  console.log(chalk.green(`✓ Created ${chalk.bold('index.ts')} file`));
143
143
 
144
- console.log(chalk.green.bold(`\n✨ Module '${moduleName}' successfully created at src/core/modules/${moduleName}`));
144
+ console.log(chalk.green.bold(`\n✨ Module '${moduleName}' successfully created at core/modules/${moduleName}`));
145
145
  } catch (error) {
146
146
  console.error(chalk.red.bold(`❌ Error creating module: ${error.message}`));
147
147
  process.exit(1);
@@ -13,7 +13,7 @@ const { prompt } = enquirer;
13
13
  * @param {string} moduleName The name of the module to remove
14
14
  */
15
15
  function removeModuleImport(moduleName) {
16
- const modulesDir = createBaseDir('modules', ['src', 'core']);
16
+ const modulesDir = createBaseDir('modules', ['core']);
17
17
  const indexPath = joinPaths(modulesDir, 'index.ts');
18
18
 
19
19
  try {
@@ -79,7 +79,7 @@ async function rollbackModule(moduleName) {
79
79
  process.exit(1);
80
80
  }
81
81
 
82
- const baseDir = createBaseDir(moduleName, ['src', 'core', 'modules']);
82
+ const baseDir = createBaseDir(moduleName, ['core', 'modules']);
83
83
 
84
84
  // Check if module exists
85
85
  if (!fs.existsSync(baseDir)) {
@@ -122,7 +122,7 @@ async function rollbackModule(moduleName) {
122
122
  * @returns {string[]} Array of module names
123
123
  */
124
124
  function listAvailableModules() {
125
- const modulesDir = createBaseDir('modules', ['src', 'core']);
125
+ const modulesDir = createBaseDir('modules', ['core']);
126
126
 
127
127
  try {
128
128
  if (fs.existsSync(modulesDir)) {
@@ -0,0 +1,23 @@
1
+ import { CoreBuilder } from '../../../classes/CoreBuilder';
2
+ import { CoreShipmentBaseService } from '../services/base';
3
+ import { CoreShipment, CoreShipmentStore } from '../types/CoreShipment';
4
+ export declare class CoreShipmentBuilder implements CoreBuilder {
5
+ protected shipmentService: CoreShipmentBaseService;
6
+ protected initialState: Pick<CoreShipmentStore<CoreShipment>, "shipment" | "loading" | "error">;
7
+ constructor(service?: CoreShipmentBaseService, initialState?: any);
8
+ build(): import('zustand').UseBoundStore<Omit<import('zustand').StoreApi<CoreShipmentStore<CoreShipment>>, "persist"> & {
9
+ persist: {
10
+ setOptions: (options: Partial<import('zustand/middleware').PersistOptions<CoreShipmentStore<CoreShipment>, {
11
+ shipment: CoreShipment | null;
12
+ }>>) => void;
13
+ clearStorage: () => void;
14
+ rehydrate: () => Promise<void> | void;
15
+ hasHydrated: () => boolean;
16
+ onHydrate: (fn: (state: CoreShipmentStore<CoreShipment>) => void) => () => void;
17
+ onFinishHydration: (fn: (state: CoreShipmentStore<CoreShipment>) => void) => () => void;
18
+ getOptions: () => Partial<import('zustand/middleware').PersistOptions<CoreShipmentStore<CoreShipment>, {
19
+ shipment: CoreShipment | null;
20
+ }>>;
21
+ };
22
+ }>;
23
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export * from '../types/index';
@@ -0,0 +1 @@
1
+ export * from '../../types/index';
@@ -0,0 +1,10 @@
1
+ import { BaseService } from '../../../services/base';
2
+ import { CoreShipment } from '../types/CoreShipment';
3
+ import { BaseApiResponse } from '../../../types';
4
+ /**
5
+ * Base class that can be extended by concrete services
6
+ */
7
+ export declare class CoreShipmentBaseService extends BaseService {
8
+ constructor();
9
+ getShippingMethods(): Promise<import('axios').AxiosResponse<BaseApiResponse<CoreShipment>, any>>;
10
+ }
@@ -0,0 +1,29 @@
1
+ import { BaseApiResponse, BaseStore } from '../../../types';
2
+ import { BaseType } from '../../../types/BaseType';
3
+ /**
4
+ * CoreShipment base type
5
+ */
6
+ export interface CoreShipment extends BaseType {
7
+ shippingMethods: CoreShippingMethod[];
8
+ }
9
+ export interface CoreShipmentStore<T extends CoreShipment> extends BaseStore {
10
+ shipment: T | null;
11
+ setShipment: (shipment: T | null) => void;
12
+ getShipment: () => T | null;
13
+ fetchShipment: () => Promise<BaseApiResponse<T>>;
14
+ }
15
+ export interface CoreShippingMethod extends BaseType {
16
+ name: string;
17
+ calculation_data_rules: CoreShippingCalculationRule;
18
+ calculation_data_form: CoreShippingCalculationForm;
19
+ }
20
+ export type CoreShippingCalculationRule = Record<string, Array<any>>;
21
+ export interface CoreShippingCalculationForm {
22
+ field: string;
23
+ type: string;
24
+ label: string;
25
+ placeholder: string;
26
+ required: boolean;
27
+ value: string;
28
+ disabled: boolean;
29
+ }
@@ -0,0 +1 @@
1
+ export * from './CoreShipment';
@@ -4,3 +4,4 @@ export * from '../CoreOrder/registry/index';
4
4
  export * from '../CorePayForm/registry/index';
5
5
  export * from '../CoreProduct/registry/index';
6
6
  export * from '../CoreShopCart/registry/index';
7
+ export * from '../CoreShipment/registry/index';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ingeniuscliq-core",
3
- "version": "0.2.48",
3
+ "version": "0.2.49",
4
4
  "description": "IngeniusCliq Core UI y lógica compartida",
5
5
  "license": "MIT",
6
6
  "type": "module",