lua-cli 2.1.0-alpha.3 → 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/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
  export { user, UserDataAPI } from './user-data-api.js';
3
+ export { product, ProductAPI } from './product-api.js';
package/dist/index.js CHANGED
@@ -45,3 +45,4 @@ program
45
45
  program.parse(process.argv);
46
46
  // Export user data API for use in projects
47
47
  export { user, UserDataAPI } from './user-data-api.js';
48
+ export { product, ProductAPI } from './product-api.js';
@@ -0,0 +1,13 @@
1
+ import { CreateProductResponse, DeleteProductResponse, ProductsResponse, SearchProductsResponse, UpdateProductResponse } from "./services/api";
2
+ export declare class ProductAPI {
3
+ products: any;
4
+ constructor();
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>;
10
+ }
11
+ export declare const product: {
12
+ data: ProductAPI;
13
+ };
@@ -0,0 +1,27 @@
1
+ export class ProductAPI {
2
+ constructor() {
3
+ this.products = {};
4
+ }
5
+ async get(page = 1, limit = 10) {
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
+ }
8
+ async create(data) {
9
+ this.products = data;
10
+ return { updated: true, isNew: true, product: this.products };
11
+ }
12
+ async update(data, productId) {
13
+ // Update is the same as create for this API
14
+ this.products = { ...this.products, ...data };
15
+ return { updated: true, isNew: false, product: this.products };
16
+ }
17
+ async delete(productId) {
18
+ this.products = this.products.filter((product) => product.id !== productId);
19
+ return { deleted: true };
20
+ }
21
+ async search(searchQuery) {
22
+ return { success: true, message: 'Products searched successfully', data: this.products };
23
+ }
24
+ }
25
+ export const product = {
26
+ data: new ProductAPI()
27
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lua-cli",
3
- "version": "2.1.0-alpha.3",
3
+ "version": "2.1.0-alpha.4",
4
4
  "description": "Command-line interface for Lua AI platform - develop, test, and deploy LuaSkills with custom tools",
5
5
  "readmeFilename": "README.md",
6
6
  "main": "dist/index.js",
@@ -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.2",
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.2",
2049
- "resolved": "https://registry.npmjs.org/lua-cli/-/lua-cli-2.1.0-alpha.2.tgz",
2050
- "integrity": "sha512-nfggqkIGBePS5g0ahiRt9B4hRtWfJFUkgC7jfcQmg9QTdyRk5wrrZClOcPeNYuPdBMYcC284F5cFGvVhNaXA/Q==",
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",
@@ -19,7 +19,7 @@
19
19
  "axios": "^1.6.0",
20
20
  "inquirer": "^12.9.6",
21
21
  "js-yaml": "^4.1.0",
22
- "lua-cli": "2.1.0-alpha.3",
22
+ "lua-cli": "2.1.0-alpha.4",
23
23
  "openai": "^5.23.0",
24
24
  "zod": "^3.24.1"
25
25
  },