lua-cli 2.1.0-alpha.2 → 2.1.0-alpha.4
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/dist/product-api.d.ts
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
+
import { CreateProductResponse, DeleteProductResponse, ProductsResponse, SearchProductsResponse, UpdateProductResponse } from "./services/api";
|
|
1
2
|
export declare class ProductAPI {
|
|
2
3
|
products: any;
|
|
3
4
|
constructor();
|
|
4
|
-
get(page?: number, limit?: number): Promise<
|
|
5
|
-
create(data: Record<string, any>): Promise<
|
|
6
|
-
update(data: Record<string, any>, productId: string): Promise<
|
|
7
|
-
delete(productId: string): Promise<
|
|
8
|
-
|
|
9
|
-
}>;
|
|
10
|
-
search(searchQuery: string): Promise<any>;
|
|
5
|
+
get(page?: number, limit?: number): Promise<ProductsResponse>;
|
|
6
|
+
create(data: Record<string, any>): Promise<CreateProductResponse>;
|
|
7
|
+
update(data: Record<string, any>, productId: string): Promise<UpdateProductResponse>;
|
|
8
|
+
delete(productId: string): Promise<DeleteProductResponse>;
|
|
9
|
+
search(searchQuery: string): Promise<SearchProductsResponse>;
|
|
11
10
|
}
|
|
12
11
|
export declare const product: {
|
|
13
12
|
data: ProductAPI;
|
package/dist/product-api.js
CHANGED
|
@@ -3,23 +3,23 @@ export class ProductAPI {
|
|
|
3
3
|
this.products = {};
|
|
4
4
|
}
|
|
5
5
|
async get(page = 1, limit = 10) {
|
|
6
|
-
return { success: true, data: this.products };
|
|
6
|
+
return { success: true, data: this.products, pagination: { currentPage: page, totalPages: 1, totalCount: this.products.length, limit: limit, hasNextPage: false, hasPrevPage: false, nextPage: null, prevPage: null } };
|
|
7
7
|
}
|
|
8
8
|
async create(data) {
|
|
9
9
|
this.products = data;
|
|
10
|
-
return {
|
|
10
|
+
return { updated: true, isNew: true, product: this.products };
|
|
11
11
|
}
|
|
12
12
|
async update(data, productId) {
|
|
13
13
|
// Update is the same as create for this API
|
|
14
14
|
this.products = { ...this.products, ...data };
|
|
15
|
-
return {
|
|
15
|
+
return { updated: true, isNew: false, product: this.products };
|
|
16
16
|
}
|
|
17
17
|
async delete(productId) {
|
|
18
18
|
this.products = this.products.filter((product) => product.id !== productId);
|
|
19
|
-
return {
|
|
19
|
+
return { deleted: true };
|
|
20
20
|
}
|
|
21
21
|
async search(searchQuery) {
|
|
22
|
-
return { success: true, data: this.products };
|
|
22
|
+
return { success: true, message: 'Products searched successfully', data: this.products };
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
export const product = {
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"axios": "^1.6.0",
|
|
16
16
|
"inquirer": "^12.9.6",
|
|
17
17
|
"js-yaml": "^4.1.0",
|
|
18
|
-
"lua-cli": "2.1.0-alpha.
|
|
18
|
+
"lua-cli": "2.1.0-alpha.3",
|
|
19
19
|
"openai": "^5.23.0",
|
|
20
20
|
"zod": "^3.24.1"
|
|
21
21
|
},
|
|
@@ -2045,9 +2045,9 @@
|
|
|
2045
2045
|
}
|
|
2046
2046
|
},
|
|
2047
2047
|
"node_modules/lua-cli": {
|
|
2048
|
-
"version": "2.1.0-alpha.
|
|
2049
|
-
"resolved": "https://registry.npmjs.org/lua-cli/-/lua-cli-2.1.0-alpha.
|
|
2050
|
-
"integrity": "sha512-
|
|
2048
|
+
"version": "2.1.0-alpha.3",
|
|
2049
|
+
"resolved": "https://registry.npmjs.org/lua-cli/-/lua-cli-2.1.0-alpha.3.tgz",
|
|
2050
|
+
"integrity": "sha512-uOW9xX23Ghz7E+lF69epNzQTBy8p/dE3qn46l2KeMkrdVtSWZuuPBKmTfpP7b7wjozgksY2j/Kh5bSPMWm/0eA==",
|
|
2051
2051
|
"license": "MIT",
|
|
2052
2052
|
"dependencies": {
|
|
2053
2053
|
"commander": "^14.0.1",
|
package/template/package.json
CHANGED
|
File without changes
|