lua-cli 2.0.4 → 2.0.6
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/services/api.d.ts +62 -0
- package/dist/services/api.js +46 -0
- package/package.json +1 -1
- package/template/package.json +1 -1
package/dist/services/api.d.ts
CHANGED
|
@@ -122,6 +122,42 @@ export interface ChatResponse {
|
|
|
122
122
|
text?: string;
|
|
123
123
|
error?: string;
|
|
124
124
|
}
|
|
125
|
+
export interface Product {
|
|
126
|
+
id: string;
|
|
127
|
+
[key: string]: any;
|
|
128
|
+
}
|
|
129
|
+
export interface ProductsResponse {
|
|
130
|
+
success: boolean;
|
|
131
|
+
data: Product[];
|
|
132
|
+
pagination: {
|
|
133
|
+
currentPage: number;
|
|
134
|
+
totalPages: number;
|
|
135
|
+
totalCount: number;
|
|
136
|
+
limit: number;
|
|
137
|
+
hasNextPage: boolean;
|
|
138
|
+
hasPrevPage: boolean;
|
|
139
|
+
nextPage: number | null;
|
|
140
|
+
prevPage: number | null;
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
export interface CreateProductResponse {
|
|
144
|
+
updated: boolean;
|
|
145
|
+
isNew: boolean;
|
|
146
|
+
product: Product;
|
|
147
|
+
}
|
|
148
|
+
export interface UpdateProductResponse {
|
|
149
|
+
updated: boolean;
|
|
150
|
+
isNew: boolean;
|
|
151
|
+
product: Product;
|
|
152
|
+
}
|
|
153
|
+
export interface DeleteProductResponse {
|
|
154
|
+
deleted: boolean;
|
|
155
|
+
}
|
|
156
|
+
export interface SearchProductsResponse {
|
|
157
|
+
success: boolean;
|
|
158
|
+
message: string;
|
|
159
|
+
data: Product[];
|
|
160
|
+
}
|
|
125
161
|
/**
|
|
126
162
|
* Authentication API calls
|
|
127
163
|
*/
|
|
@@ -176,6 +212,31 @@ export declare class SkillApi {
|
|
|
176
212
|
export declare class ChatApi {
|
|
177
213
|
static sendMessage(agentId: string, chatData: ChatRequest, apiKey: string): Promise<ApiResponse<ChatResponse>>;
|
|
178
214
|
}
|
|
215
|
+
/**
|
|
216
|
+
* Product API calls
|
|
217
|
+
*/
|
|
218
|
+
export declare class ProductApi {
|
|
219
|
+
/**
|
|
220
|
+
* Get all products for an agent with pagination
|
|
221
|
+
*/
|
|
222
|
+
static getProducts(apiKey: string, agentId: string, page?: number, limit?: number): Promise<ApiResponse<ProductsResponse>>;
|
|
223
|
+
/**
|
|
224
|
+
* Create a new product
|
|
225
|
+
*/
|
|
226
|
+
static createProduct(apiKey: string, agentId: string, productData: Product): Promise<ApiResponse<CreateProductResponse>>;
|
|
227
|
+
/**
|
|
228
|
+
* Update an existing product
|
|
229
|
+
*/
|
|
230
|
+
static updateProduct(apiKey: string, agentId: string, productData: Product): Promise<ApiResponse<UpdateProductResponse>>;
|
|
231
|
+
/**
|
|
232
|
+
* Delete a product
|
|
233
|
+
*/
|
|
234
|
+
static deleteProduct(apiKey: string, agentId: string, productId: string): Promise<ApiResponse<DeleteProductResponse>>;
|
|
235
|
+
/**
|
|
236
|
+
* Search products by text query
|
|
237
|
+
*/
|
|
238
|
+
static searchProducts(apiKey: string, agentId: string, searchQuery: string): Promise<ApiResponse<SearchProductsResponse>>;
|
|
239
|
+
}
|
|
179
240
|
/**
|
|
180
241
|
* Tool API calls (for compile command)
|
|
181
242
|
*/
|
|
@@ -200,5 +261,6 @@ export declare const ApiService: {
|
|
|
200
261
|
Agent: typeof AgentApi;
|
|
201
262
|
Skill: typeof SkillApi;
|
|
202
263
|
Chat: typeof ChatApi;
|
|
264
|
+
Product: typeof ProductApi;
|
|
203
265
|
Tool: typeof ToolApi;
|
|
204
266
|
};
|
package/dist/services/api.js
CHANGED
|
@@ -168,6 +168,51 @@ export class ChatApi {
|
|
|
168
168
|
});
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
|
+
/**
|
|
172
|
+
* Product API calls
|
|
173
|
+
*/
|
|
174
|
+
export class ProductApi {
|
|
175
|
+
/**
|
|
176
|
+
* Get all products for an agent with pagination
|
|
177
|
+
*/
|
|
178
|
+
static async getProducts(apiKey, agentId, page = 1, limit = 10) {
|
|
179
|
+
return httpClient.get(`${BASE_URLS.API}/developer/agents/${agentId}/products?page=${page}&limit=${limit}`, {
|
|
180
|
+
Authorization: `Bearer ${apiKey}`,
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Create a new product
|
|
185
|
+
*/
|
|
186
|
+
static async createProduct(apiKey, agentId, productData) {
|
|
187
|
+
return httpClient.post(`${BASE_URLS.API}/developer/agents/${agentId}/products`, productData, {
|
|
188
|
+
Authorization: `Bearer ${apiKey}`,
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Update an existing product
|
|
193
|
+
*/
|
|
194
|
+
static async updateProduct(apiKey, agentId, productData) {
|
|
195
|
+
return httpClient.put(`${BASE_URLS.API}/developer/agents/${agentId}/products`, productData, {
|
|
196
|
+
Authorization: `Bearer ${apiKey}`,
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Delete a product
|
|
201
|
+
*/
|
|
202
|
+
static async deleteProduct(apiKey, agentId, productId) {
|
|
203
|
+
return httpClient.delete(`${BASE_URLS.API}/developer/agents/${agentId}/products/${productId}`, {
|
|
204
|
+
Authorization: `Bearer ${apiKey}`,
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Search products by text query
|
|
209
|
+
*/
|
|
210
|
+
static async searchProducts(apiKey, agentId, searchQuery) {
|
|
211
|
+
return httpClient.get(`${BASE_URLS.API}/developer/agents/${agentId}/products/search?searchQuery=${encodeURIComponent(searchQuery)}`, {
|
|
212
|
+
Authorization: `Bearer ${apiKey}`,
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
}
|
|
171
216
|
/**
|
|
172
217
|
* Tool API calls (for compile command)
|
|
173
218
|
*/
|
|
@@ -233,5 +278,6 @@ export const ApiService = {
|
|
|
233
278
|
Agent: AgentApi,
|
|
234
279
|
Skill: SkillApi,
|
|
235
280
|
Chat: ChatApi,
|
|
281
|
+
Product: ProductApi,
|
|
236
282
|
Tool: ToolApi,
|
|
237
283
|
};
|
package/package.json
CHANGED