ingeniuscliq-core 0.2.47 → 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.
- package/core/commands/create-core-module.js +3 -3
- package/core/commands/rollback-core-module.js +3 -3
- package/dist/index.js +5 -1
- package/dist/modules/CoreCustomization/services/base.d.ts +2 -1
- package/dist/modules/CoreCustomization/types/CoreCustomization.d.ts +1 -0
- package/dist/modules/CoreShipment/classes/CoreShipmentBuilder.d.ts +23 -0
- package/dist/modules/CoreShipment/index.d.ts +1 -0
- package/dist/modules/CoreShipment/registry/index.d.ts +1 -0
- package/dist/modules/CoreShipment/registry/types/index.d.ts +1 -0
- package/dist/modules/CoreShipment/services/base.d.ts +10 -0
- package/dist/modules/CoreShipment/types/CoreShipment.d.ts +29 -0
- package/dist/modules/CoreShipment/types/index.d.ts +1 -0
- package/dist/modules/registry/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -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', ['
|
|
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, ['
|
|
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
|
|
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', ['
|
|
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, ['
|
|
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', ['
|
|
125
|
+
const modulesDir = createBaseDir('modules', ['core']);
|
|
126
126
|
|
|
127
127
|
try {
|
|
128
128
|
if (fs.existsSync(modulesDir)) {
|
package/dist/index.js
CHANGED
|
@@ -2104,6 +2104,9 @@ class uw extends go {
|
|
|
2104
2104
|
fetchTemplate() {
|
|
2105
2105
|
return this.api.get(this.apiPrefix + "/layout");
|
|
2106
2106
|
}
|
|
2107
|
+
fetchSettings() {
|
|
2108
|
+
return this.api.get(this.apiPrefix + "/store-config");
|
|
2109
|
+
}
|
|
2107
2110
|
}
|
|
2108
2111
|
class dw {
|
|
2109
2112
|
constructor(t = new uw(), n = this.initialState) {
|
|
@@ -2128,6 +2131,7 @@ class dw {
|
|
|
2128
2131
|
getStyles: () => n().styles,
|
|
2129
2132
|
getSettings: () => n().settings,
|
|
2130
2133
|
fetchTemplate: async () => (await this.customizationService.fetchTemplate()).data.data,
|
|
2134
|
+
fetchSettings: async () => (await this.customizationService.fetchSettings()).data.data,
|
|
2131
2135
|
setTemplate: (r) => t({ template: r }),
|
|
2132
2136
|
setComponents: (r) => t({ components: r }),
|
|
2133
2137
|
setStyles: (r) => t({ styles: r }),
|
|
@@ -2313,7 +2317,7 @@ class Y5 {
|
|
|
2313
2317
|
class Sw extends go {
|
|
2314
2318
|
constructor() {
|
|
2315
2319
|
super("product");
|
|
2316
|
-
ze(this, "getAllCategories", (n) => this.api.get(`${this.apiPrefix}/categories`, { params: n }));
|
|
2320
|
+
ze(this, "getAllCategories", (n) => this.api.get(`${this.apiPrefix}/shop/categories`, { params: n }));
|
|
2317
2321
|
this.setCrudResourceProperty("getAll", "shop/products"), this.setCrudResourceProperty("get", "products");
|
|
2318
2322
|
}
|
|
2319
2323
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { BaseService } from '../../../services/base';
|
|
2
2
|
import { BaseApiResponse } from '../../../types/contracts/BaseApiResponse';
|
|
3
|
-
import { CoreDesignTemplate } from '../../../types/ui/template';
|
|
3
|
+
import { CoreDesignTemplate, CoreDesignTemplateSettings } from '../../../types/ui/template';
|
|
4
4
|
/**
|
|
5
5
|
* Base class that can be extended by concrete services
|
|
6
6
|
*/
|
|
7
7
|
export declare class CoreCustomizationBaseService extends BaseService {
|
|
8
8
|
constructor();
|
|
9
9
|
fetchTemplate(): Promise<import('axios').AxiosResponse<BaseApiResponse<CoreDesignTemplate>, any>>;
|
|
10
|
+
fetchSettings(): Promise<import('axios').AxiosResponse<BaseApiResponse<CoreDesignTemplateSettings>, any>>;
|
|
10
11
|
}
|
|
@@ -18,6 +18,7 @@ export interface CoreCustomizationStore extends BaseStore {
|
|
|
18
18
|
styles: CoreDesignTemplateStyles[] | null;
|
|
19
19
|
settings: CoreDesignTemplateSettings | null;
|
|
20
20
|
fetchTemplate: () => Promise<CoreDesignTemplate>;
|
|
21
|
+
fetchSettings: () => Promise<CoreDesignTemplateSettings>;
|
|
21
22
|
setTemplate: (template: string) => void;
|
|
22
23
|
setComponents: (components: {
|
|
23
24
|
key: string;
|
|
@@ -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';
|