lua-cli 2.2.7 → 2.2.8-alpha.2
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/api/agent.api.service.d.ts +18 -0
- package/dist/api/agent.api.service.js +30 -0
- package/dist/api/auth.api.service.d.ts +19 -0
- package/dist/api/auth.api.service.js +25 -0
- package/dist/api/basket.api.service.d.ts +43 -0
- package/dist/api/basket.api.service.js +115 -0
- package/dist/api/chat.api.service.d.ts +9 -0
- package/dist/api/chat.api.service.js +12 -0
- package/dist/api/custom.data.api.service.d.ts +33 -0
- package/dist/api/custom.data.api.service.js +91 -0
- package/dist/api/order.api.service.d.ts +23 -0
- package/dist/api/order.api.service.js +57 -0
- package/dist/api/products.api.service.d.ts +36 -0
- package/dist/api/products.api.service.js +74 -0
- package/dist/api/skills.api.service.d.ts +30 -0
- package/dist/api/skills.api.service.js +42 -0
- package/dist/api/tool.api.service.d.ts +14 -0
- package/dist/api/tool.api.service.js +35 -0
- package/dist/api/user.data.api.service.d.ts +11 -0
- package/dist/api/user.data.api.service.js +37 -0
- package/dist/api-exports.d.ts +40 -0
- package/dist/api-exports.js +189 -0
- package/dist/commands/dev.js +22 -17
- package/dist/common/basket.instance.d.ts +27 -0
- package/dist/common/basket.instance.js +79 -0
- package/dist/common/config.d.ts +5 -0
- package/dist/common/config.js +5 -0
- package/dist/common/data.entry.instance.d.ts +16 -0
- package/dist/common/data.entry.instance.js +52 -0
- package/dist/common/http.client.d.ts +14 -0
- package/dist/common/http.client.js +83 -0
- package/dist/common/order.instance.d.ts +18 -0
- package/dist/common/order.instance.js +52 -0
- package/dist/common/product.instance.d.ts +12 -0
- package/dist/common/product.instance.js +45 -0
- package/dist/common/product.pagination.instance.d.ts +23 -0
- package/dist/common/product.pagination.instance.js +53 -0
- package/dist/common/product.search.instance.d.ts +12 -0
- package/dist/common/product.search.instance.js +29 -0
- package/dist/common/user.instance.d.ts +17 -0
- package/dist/common/user.instance.js +63 -0
- package/dist/interfaces/admin.d.ts +95 -0
- package/dist/interfaces/admin.js +1 -0
- package/dist/interfaces/agent.d.ts +86 -0
- package/dist/interfaces/agent.js +1 -0
- package/dist/interfaces/baskets.d.ts +75 -0
- package/dist/interfaces/baskets.js +7 -0
- package/dist/interfaces/chat.d.ts +17 -0
- package/dist/interfaces/chat.js +1 -0
- package/dist/interfaces/custom.data.d.ts +52 -0
- package/dist/interfaces/custom.data.js +1 -0
- package/dist/interfaces/orders.d.ts +54 -0
- package/dist/interfaces/orders.js +7 -0
- package/dist/interfaces/product.d.ts +37 -0
- package/dist/interfaces/product.js +1 -0
- package/dist/product-api.d.ts +2 -10
- package/dist/product-api.js +3 -14
- package/dist/services/api.d.ts +3 -23
- package/dist/services/api.js +2 -31
- package/dist/services/auth.d.ts +1 -1
- package/dist/skill.js +2 -4
- package/dist/types/index.d.ts +36 -0
- package/dist/utils/sandbox.js +3 -7
- package/package.json +8 -12
- package/template/lua.skill.yaml +3 -12
- package/template/package-lock.json +3781 -0
- package/template/package.json +1 -1
- package/template/src/index.ts +200 -99
- package/template/src/tools/UserDataTool.ts +6 -7
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generic HTTP client with common error handling
|
|
3
|
+
*/
|
|
4
|
+
export class HttpClient {
|
|
5
|
+
constructor(baseUrl) {
|
|
6
|
+
this.baseUrl = baseUrl;
|
|
7
|
+
}
|
|
8
|
+
async request(url, options = {}) {
|
|
9
|
+
try {
|
|
10
|
+
const response = await fetch(url, {
|
|
11
|
+
...options,
|
|
12
|
+
headers: {
|
|
13
|
+
'Content-Type': 'application/json',
|
|
14
|
+
...options.headers,
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
// Check if response is ok (status 200-299)
|
|
18
|
+
if (!response.ok) {
|
|
19
|
+
return {
|
|
20
|
+
success: false,
|
|
21
|
+
error: {
|
|
22
|
+
message: `HTTP ${response.status}: ${response.statusText}`,
|
|
23
|
+
statusCode: response.status,
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
// Try to parse JSON response
|
|
28
|
+
let data;
|
|
29
|
+
try {
|
|
30
|
+
data = await response.json();
|
|
31
|
+
}
|
|
32
|
+
catch (jsonError) {
|
|
33
|
+
data = {};
|
|
34
|
+
}
|
|
35
|
+
// If the response already has the ApiResponse structure, return it
|
|
36
|
+
if (typeof data === 'object' && data !== null && 'success' in data) {
|
|
37
|
+
return data;
|
|
38
|
+
}
|
|
39
|
+
// Otherwise, wrap the data in a successful ApiResponse
|
|
40
|
+
return {
|
|
41
|
+
success: true,
|
|
42
|
+
data,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
// Handle network errors, timeouts, etc.
|
|
47
|
+
return {
|
|
48
|
+
success: false,
|
|
49
|
+
error: {
|
|
50
|
+
message: error instanceof Error ? error.message : 'Network request failed',
|
|
51
|
+
statusCode: 0, // Use 0 to indicate network/connection error
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
async httpGet(url, headers) {
|
|
57
|
+
return this.request(this.baseUrl + url, { method: 'GET', headers });
|
|
58
|
+
}
|
|
59
|
+
async httpPost(url, data, headers) {
|
|
60
|
+
return this.request(this.baseUrl + url, {
|
|
61
|
+
method: 'POST',
|
|
62
|
+
body: data ? JSON.stringify(data) : undefined,
|
|
63
|
+
headers,
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
async httpPut(url, data, headers) {
|
|
67
|
+
return this.request(this.baseUrl + url, {
|
|
68
|
+
method: 'PUT',
|
|
69
|
+
body: data ? JSON.stringify(data) : undefined,
|
|
70
|
+
headers,
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
async httpDelete(url, headers) {
|
|
74
|
+
return this.request(this.baseUrl + url, { method: 'DELETE', headers });
|
|
75
|
+
}
|
|
76
|
+
async httpPatch(url, data, headers) {
|
|
77
|
+
return this.request(this.baseUrl + url, {
|
|
78
|
+
method: 'PATCH',
|
|
79
|
+
body: data ? JSON.stringify(data) : undefined,
|
|
80
|
+
headers,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import OrderApi from "../api/order.api.service.js";
|
|
2
|
+
import { OrderResponse, OrderStatus } from "../interfaces/orders.js";
|
|
3
|
+
export default class OrderInstance {
|
|
4
|
+
private data;
|
|
5
|
+
private common;
|
|
6
|
+
private id;
|
|
7
|
+
private userId;
|
|
8
|
+
private agentId;
|
|
9
|
+
private orderId;
|
|
10
|
+
private orderAPI;
|
|
11
|
+
constructor(api: OrderApi, order: OrderResponse);
|
|
12
|
+
/**
|
|
13
|
+
* Custom toJSON method to control what gets serialized when logging
|
|
14
|
+
*/
|
|
15
|
+
toJSON(): Record<string, any>;
|
|
16
|
+
updateStatus(status: OrderStatus): Promise<any>;
|
|
17
|
+
update(data: Record<string, any>): Promise<any>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export default class OrderInstance {
|
|
2
|
+
constructor(api, order) {
|
|
3
|
+
this.data = order.data;
|
|
4
|
+
this.common = order.common;
|
|
5
|
+
this.id = order.id;
|
|
6
|
+
this.userId = order.userId;
|
|
7
|
+
this.agentId = order.agentId;
|
|
8
|
+
this.orderId = order.orderId;
|
|
9
|
+
// Make orderAPI non-enumerable so it doesn't show up in console.log
|
|
10
|
+
Object.defineProperty(this, 'orderAPI', {
|
|
11
|
+
value: api,
|
|
12
|
+
writable: true,
|
|
13
|
+
enumerable: false,
|
|
14
|
+
configurable: true
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Custom toJSON method to control what gets serialized when logging
|
|
19
|
+
*/
|
|
20
|
+
toJSON() {
|
|
21
|
+
return {
|
|
22
|
+
...this.data,
|
|
23
|
+
...this.common
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Custom inspect method for Node.js console.log
|
|
28
|
+
*/
|
|
29
|
+
[Symbol.for('nodejs.util.inspect.custom')]() {
|
|
30
|
+
return {
|
|
31
|
+
...this.data,
|
|
32
|
+
...this.common
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
async updateStatus(status) {
|
|
36
|
+
const response = await this.orderAPI.updateStatus(status, this.id);
|
|
37
|
+
this.common = response.common;
|
|
38
|
+
return {
|
|
39
|
+
...this.data,
|
|
40
|
+
...this.common
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
async update(data) {
|
|
44
|
+
const response = await this.orderAPI.updateData(data, this.id);
|
|
45
|
+
this.data = response.data;
|
|
46
|
+
this.common = response.common;
|
|
47
|
+
return {
|
|
48
|
+
...this.data,
|
|
49
|
+
...this.common
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Product } from "../interfaces/product";
|
|
2
|
+
export default class ProductInstance {
|
|
3
|
+
data: Product;
|
|
4
|
+
private productAPI;
|
|
5
|
+
constructor(api: any, product: Product);
|
|
6
|
+
/**
|
|
7
|
+
* Custom toJSON method to control what gets serialized when logging
|
|
8
|
+
*/
|
|
9
|
+
toJSON(): Record<string, any>;
|
|
10
|
+
update(data: Record<string, any>): Promise<Product>;
|
|
11
|
+
delete(): Promise<Product>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export default class ProductInstance {
|
|
2
|
+
constructor(api, product) {
|
|
3
|
+
this.data = product;
|
|
4
|
+
// Make productAPI non-enumerable so it doesn't show up in console.log
|
|
5
|
+
Object.defineProperty(this, 'productAPI', {
|
|
6
|
+
value: api,
|
|
7
|
+
writable: true,
|
|
8
|
+
enumerable: false,
|
|
9
|
+
configurable: true
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Custom toJSON method to control what gets serialized when logging
|
|
14
|
+
*/
|
|
15
|
+
toJSON() {
|
|
16
|
+
return {
|
|
17
|
+
data: this.data
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Custom inspect method for Node.js console.log
|
|
22
|
+
*/
|
|
23
|
+
[Symbol.for('nodejs.util.inspect.custom')]() {
|
|
24
|
+
return {
|
|
25
|
+
data: this.data
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
async update(data) {
|
|
29
|
+
const response = await this.productAPI.update(data, this.data.id);
|
|
30
|
+
if (response.updated) {
|
|
31
|
+
this.data = response.product;
|
|
32
|
+
return this.data;
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
throw new Error('Failed to update product');
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
async delete() {
|
|
39
|
+
const response = await this.productAPI.delete(this.data.id);
|
|
40
|
+
if (response.deleted) {
|
|
41
|
+
this.data = {};
|
|
42
|
+
}
|
|
43
|
+
return this.data;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ProductsResponse } from "../interfaces/product";
|
|
2
|
+
import ProductInstance from "./product.instance";
|
|
3
|
+
export default class ProductPaginationInstance {
|
|
4
|
+
products: ProductInstance[];
|
|
5
|
+
pagination: {
|
|
6
|
+
currentPage: number;
|
|
7
|
+
totalPages: number;
|
|
8
|
+
totalCount: number;
|
|
9
|
+
limit: number;
|
|
10
|
+
hasNextPage: boolean;
|
|
11
|
+
hasPrevPage: boolean;
|
|
12
|
+
nextPage: number | null;
|
|
13
|
+
prevPage: number | null;
|
|
14
|
+
};
|
|
15
|
+
private productAPI;
|
|
16
|
+
constructor(api: any, results: ProductsResponse);
|
|
17
|
+
/**
|
|
18
|
+
* Custom toJSON method to control what gets serialized when logging
|
|
19
|
+
*/
|
|
20
|
+
toJSON(): Record<string, any>;
|
|
21
|
+
nextPage(): Promise<ProductPaginationInstance>;
|
|
22
|
+
prevPage(): Promise<ProductPaginationInstance>;
|
|
23
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import ProductInstance from "./product.instance";
|
|
2
|
+
export default class ProductPaginationInstance {
|
|
3
|
+
constructor(api, results) {
|
|
4
|
+
this.products = results.data?.map(product => new ProductInstance(api, product)) || [];
|
|
5
|
+
this.pagination = results.pagination || {
|
|
6
|
+
currentPage: 1,
|
|
7
|
+
totalPages: 1,
|
|
8
|
+
totalCount: 0,
|
|
9
|
+
limit: 10,
|
|
10
|
+
hasNextPage: false,
|
|
11
|
+
hasPrevPage: false,
|
|
12
|
+
nextPage: null,
|
|
13
|
+
prevPage: null
|
|
14
|
+
};
|
|
15
|
+
// Make productAPI non-enumerable so it doesn't show up in console.log
|
|
16
|
+
Object.defineProperty(this, 'productAPI', {
|
|
17
|
+
value: api,
|
|
18
|
+
writable: true,
|
|
19
|
+
enumerable: false,
|
|
20
|
+
configurable: true
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Custom toJSON method to control what gets serialized when logging
|
|
25
|
+
*/
|
|
26
|
+
toJSON() {
|
|
27
|
+
return {
|
|
28
|
+
products: this.products,
|
|
29
|
+
pagination: this.pagination
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Custom inspect method for Node.js console.log
|
|
34
|
+
*/
|
|
35
|
+
[Symbol.for('nodejs.util.inspect.custom')]() {
|
|
36
|
+
return {
|
|
37
|
+
products: this.products,
|
|
38
|
+
pagination: this.pagination
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
async nextPage() {
|
|
42
|
+
if (!this.pagination.nextPage) {
|
|
43
|
+
throw new Error('No next page');
|
|
44
|
+
}
|
|
45
|
+
return await this.productAPI.get(this.pagination.nextPage, this.pagination.limit);
|
|
46
|
+
}
|
|
47
|
+
async prevPage() {
|
|
48
|
+
if (!this.pagination.prevPage) {
|
|
49
|
+
throw new Error('No previous page');
|
|
50
|
+
}
|
|
51
|
+
return await this.productAPI.get(this.pagination.prevPage, this.pagination.limit);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SearchProductsResponse } from "../interfaces/product";
|
|
2
|
+
import { ProductAPI } from "../types";
|
|
3
|
+
import ProductInstance from "./product.instance";
|
|
4
|
+
export default class ProductSearchInstance {
|
|
5
|
+
products: ProductInstance[];
|
|
6
|
+
private productAPI;
|
|
7
|
+
constructor(api: ProductAPI, results: SearchProductsResponse);
|
|
8
|
+
/**
|
|
9
|
+
* Custom toJSON method to control what gets serialized when logging
|
|
10
|
+
*/
|
|
11
|
+
toJSON(): Record<string, any>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import ProductInstance from "./product.instance";
|
|
2
|
+
export default class ProductSearchInstance {
|
|
3
|
+
constructor(api, results) {
|
|
4
|
+
this.products = results.data?.map(product => new ProductInstance(api, product)) || [];
|
|
5
|
+
// Make productAPI non-enumerable so it doesn't show up in console.log
|
|
6
|
+
Object.defineProperty(this, 'productAPI', {
|
|
7
|
+
value: api,
|
|
8
|
+
writable: true,
|
|
9
|
+
enumerable: false,
|
|
10
|
+
configurable: true
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Custom toJSON method to control what gets serialized when logging
|
|
15
|
+
*/
|
|
16
|
+
toJSON() {
|
|
17
|
+
return {
|
|
18
|
+
products: this.products,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Custom inspect method for Node.js console.log
|
|
23
|
+
*/
|
|
24
|
+
[Symbol.for('nodejs.util.inspect.custom')]() {
|
|
25
|
+
return {
|
|
26
|
+
products: this.products,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { UserData } from "../interfaces/admin";
|
|
2
|
+
import { UserDataAPI } from "../types";
|
|
3
|
+
export default class UserDataInstance {
|
|
4
|
+
data: Record<string, any>;
|
|
5
|
+
private userAPI;
|
|
6
|
+
constructor(api: UserDataAPI, data: UserData);
|
|
7
|
+
/**
|
|
8
|
+
* Remove sensitive fields from the data before storing
|
|
9
|
+
*/
|
|
10
|
+
private sanitizeData;
|
|
11
|
+
/**
|
|
12
|
+
* Custom toJSON method to control what gets serialized when logging
|
|
13
|
+
*/
|
|
14
|
+
toJSON(): Record<string, any>;
|
|
15
|
+
update(data: Record<string, any>): Promise<any>;
|
|
16
|
+
clear(): Promise<boolean>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
export default class UserDataInstance {
|
|
2
|
+
constructor(api, data) {
|
|
3
|
+
this.data = this.sanitizeData(data);
|
|
4
|
+
// Make userAPI non-enumerable so it doesn't show up in console.log
|
|
5
|
+
Object.defineProperty(this, 'userAPI', {
|
|
6
|
+
value: api,
|
|
7
|
+
writable: true,
|
|
8
|
+
enumerable: false,
|
|
9
|
+
configurable: true
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Remove sensitive fields from the data before storing
|
|
14
|
+
*/
|
|
15
|
+
sanitizeData(data) {
|
|
16
|
+
if (!data || typeof data !== 'object') {
|
|
17
|
+
return data;
|
|
18
|
+
}
|
|
19
|
+
// Create a copy of the data to avoid mutating the original
|
|
20
|
+
const sanitized = { ...data };
|
|
21
|
+
// Remove sensitive fields
|
|
22
|
+
const sensitiveFields = ['apiKey', 'agentId', 'userId', 'token', 'secret', 'key'];
|
|
23
|
+
sensitiveFields.forEach(field => {
|
|
24
|
+
delete sanitized[field];
|
|
25
|
+
});
|
|
26
|
+
return sanitized;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Custom toJSON method to control what gets serialized when logging
|
|
30
|
+
*/
|
|
31
|
+
toJSON() {
|
|
32
|
+
return {
|
|
33
|
+
data: this.data
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Custom inspect method for Node.js console.log
|
|
38
|
+
*/
|
|
39
|
+
[Symbol.for('nodejs.util.inspect.custom')]() {
|
|
40
|
+
return {
|
|
41
|
+
data: this.data
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
async update(data) {
|
|
45
|
+
try {
|
|
46
|
+
const response = await this.userAPI.update(data);
|
|
47
|
+
this.data = this.sanitizeData(response.data);
|
|
48
|
+
return this.data;
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
throw new Error('Failed to update user data');
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
async clear() {
|
|
55
|
+
try {
|
|
56
|
+
await this.userAPI.clear();
|
|
57
|
+
return true;
|
|
58
|
+
}
|
|
59
|
+
catch (error) {
|
|
60
|
+
throw new Error('Failed to clear user data');
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
export interface ApiResponse<T = any> {
|
|
2
|
+
success: boolean;
|
|
3
|
+
data?: T;
|
|
4
|
+
error?: {
|
|
5
|
+
message: string;
|
|
6
|
+
statusCode?: number;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
export interface UserData {
|
|
10
|
+
uid: string;
|
|
11
|
+
email: string;
|
|
12
|
+
emailVerified: boolean;
|
|
13
|
+
fullName: string;
|
|
14
|
+
mobileNumbers: any[];
|
|
15
|
+
emailAddresses: any[];
|
|
16
|
+
country: any;
|
|
17
|
+
admin: any;
|
|
18
|
+
channels: Record<string, any>;
|
|
19
|
+
rights: Record<string, any>;
|
|
20
|
+
setupPersona: Record<string, any>;
|
|
21
|
+
notifications: Record<string, any>;
|
|
22
|
+
}
|
|
23
|
+
export interface Organization {
|
|
24
|
+
id: string;
|
|
25
|
+
name: string;
|
|
26
|
+
agents: string[];
|
|
27
|
+
}
|
|
28
|
+
export interface SkillVersion {
|
|
29
|
+
version: string;
|
|
30
|
+
createdAt: string;
|
|
31
|
+
status: string;
|
|
32
|
+
}
|
|
33
|
+
export interface DevVersionResponse {
|
|
34
|
+
success: boolean;
|
|
35
|
+
data?: {
|
|
36
|
+
message: string;
|
|
37
|
+
skillId: string;
|
|
38
|
+
version: string;
|
|
39
|
+
};
|
|
40
|
+
error?: {
|
|
41
|
+
message: string;
|
|
42
|
+
statusCode: number;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
export interface UpdateDevVersionResponse {
|
|
46
|
+
success: boolean;
|
|
47
|
+
data?: {
|
|
48
|
+
message: string;
|
|
49
|
+
version: string;
|
|
50
|
+
};
|
|
51
|
+
error?: {
|
|
52
|
+
message: string;
|
|
53
|
+
statusCode: number;
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
export interface EmailAddress {
|
|
57
|
+
address: string;
|
|
58
|
+
validated: boolean;
|
|
59
|
+
validatedAt: number;
|
|
60
|
+
_id: string;
|
|
61
|
+
}
|
|
62
|
+
export interface Country {
|
|
63
|
+
code: string;
|
|
64
|
+
name: string;
|
|
65
|
+
}
|
|
66
|
+
export interface Admin {
|
|
67
|
+
userId: string;
|
|
68
|
+
orgs: Organization[];
|
|
69
|
+
id: string;
|
|
70
|
+
createdAt: number;
|
|
71
|
+
__v: number;
|
|
72
|
+
}
|
|
73
|
+
export interface Agent {
|
|
74
|
+
agentId: string;
|
|
75
|
+
rights: string[];
|
|
76
|
+
name: string;
|
|
77
|
+
}
|
|
78
|
+
export interface OrganizationAuth {
|
|
79
|
+
id: string;
|
|
80
|
+
rights?: string[];
|
|
81
|
+
agents: Agent[];
|
|
82
|
+
registeredName: string;
|
|
83
|
+
country: string;
|
|
84
|
+
phoneNumber?: string | null;
|
|
85
|
+
type: string;
|
|
86
|
+
}
|
|
87
|
+
export interface OTPResponse {
|
|
88
|
+
signInToken: string;
|
|
89
|
+
}
|
|
90
|
+
export interface ApiKeyResponse {
|
|
91
|
+
message: string;
|
|
92
|
+
userId: string;
|
|
93
|
+
apiKey: string;
|
|
94
|
+
apiId: string;
|
|
95
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
export interface Agent {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
persona?: string;
|
|
5
|
+
welcomeMessage?: string;
|
|
6
|
+
featuresOverride?: Record<string, any>;
|
|
7
|
+
}
|
|
8
|
+
export interface AgentType {
|
|
9
|
+
id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
features: Record<string, any>;
|
|
12
|
+
requiredSubAgentMetadata?: string[];
|
|
13
|
+
}
|
|
14
|
+
export interface CreateAgentRequest {
|
|
15
|
+
id: string;
|
|
16
|
+
type: string;
|
|
17
|
+
metadata: Record<string, any>;
|
|
18
|
+
persona: {
|
|
19
|
+
agentName: string;
|
|
20
|
+
businessType: string;
|
|
21
|
+
brandPersonality: string;
|
|
22
|
+
brandTraits: string;
|
|
23
|
+
};
|
|
24
|
+
features: Record<string, boolean>;
|
|
25
|
+
channels: any[];
|
|
26
|
+
org: {
|
|
27
|
+
registeredName: string;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export interface CreateAgentResponse {
|
|
31
|
+
success: boolean;
|
|
32
|
+
data?: {
|
|
33
|
+
agentId: string;
|
|
34
|
+
name: string;
|
|
35
|
+
baseAgentId: string;
|
|
36
|
+
persona: string;
|
|
37
|
+
createdAt: string;
|
|
38
|
+
welcomeMessage: string;
|
|
39
|
+
featuresOverride: Record<string, any>;
|
|
40
|
+
_id: string;
|
|
41
|
+
updatedAt: string;
|
|
42
|
+
__v: number;
|
|
43
|
+
org: {
|
|
44
|
+
registeredName: string;
|
|
45
|
+
type: string;
|
|
46
|
+
agents: string[];
|
|
47
|
+
paymentMethods: any[];
|
|
48
|
+
_id: string;
|
|
49
|
+
id: string;
|
|
50
|
+
createdAt: number;
|
|
51
|
+
__v: number;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
error?: {
|
|
55
|
+
message: string;
|
|
56
|
+
error: string;
|
|
57
|
+
statusCode: number;
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
export interface AgentDetailsResponse {
|
|
61
|
+
success: boolean;
|
|
62
|
+
data?: {
|
|
63
|
+
_id: string;
|
|
64
|
+
agentId: string;
|
|
65
|
+
name: string;
|
|
66
|
+
baseAgentId: string;
|
|
67
|
+
persona: string;
|
|
68
|
+
createdAt: string;
|
|
69
|
+
welcomeMessage: string;
|
|
70
|
+
featuresOverride: Record<string, any>;
|
|
71
|
+
updatedAt: string;
|
|
72
|
+
__v: number;
|
|
73
|
+
personaConfig: {
|
|
74
|
+
agentName: string;
|
|
75
|
+
businessType: string;
|
|
76
|
+
brandPersonality: string;
|
|
77
|
+
brandTraits: string;
|
|
78
|
+
};
|
|
79
|
+
skills: any[];
|
|
80
|
+
};
|
|
81
|
+
error?: {
|
|
82
|
+
message: string;
|
|
83
|
+
error: string;
|
|
84
|
+
statusCode: number;
|
|
85
|
+
};
|
|
86
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
export declare enum BasketStatus {
|
|
2
|
+
ACTIVE = "active",
|
|
3
|
+
CHECKED_OUT = "checked_out",
|
|
4
|
+
ABANDONED = "abandoned",
|
|
5
|
+
EXPIRED = "expired"
|
|
6
|
+
}
|
|
7
|
+
export interface BasketItem {
|
|
8
|
+
id: string;
|
|
9
|
+
price: number;
|
|
10
|
+
quantity: number;
|
|
11
|
+
SKU?: string;
|
|
12
|
+
addedAt?: string;
|
|
13
|
+
[key: string]: any;
|
|
14
|
+
}
|
|
15
|
+
export interface BasketData {
|
|
16
|
+
currency: string;
|
|
17
|
+
metadata?: any;
|
|
18
|
+
items: BasketItem[];
|
|
19
|
+
createdAt: string;
|
|
20
|
+
}
|
|
21
|
+
export interface BasketCommon {
|
|
22
|
+
status: BasketStatus;
|
|
23
|
+
totalAmount: string | number;
|
|
24
|
+
itemCount: number;
|
|
25
|
+
}
|
|
26
|
+
export interface Basket {
|
|
27
|
+
id: string;
|
|
28
|
+
userId: string;
|
|
29
|
+
agentId: string;
|
|
30
|
+
data: BasketData;
|
|
31
|
+
common: BasketCommon;
|
|
32
|
+
createdAt: string;
|
|
33
|
+
updatedAt: string;
|
|
34
|
+
__v: number;
|
|
35
|
+
}
|
|
36
|
+
export interface CreateBasketRequest {
|
|
37
|
+
currency: string;
|
|
38
|
+
metadata?: any;
|
|
39
|
+
}
|
|
40
|
+
export interface CreateBasketResponse {
|
|
41
|
+
success: boolean;
|
|
42
|
+
message: string;
|
|
43
|
+
data?: Basket;
|
|
44
|
+
}
|
|
45
|
+
export interface GetBasketsResponse {
|
|
46
|
+
success: boolean;
|
|
47
|
+
message: string;
|
|
48
|
+
data?: Basket[];
|
|
49
|
+
}
|
|
50
|
+
export interface AddItemToBasketRequest {
|
|
51
|
+
id: string;
|
|
52
|
+
price: number;
|
|
53
|
+
quantity: number;
|
|
54
|
+
[key: string]: any;
|
|
55
|
+
}
|
|
56
|
+
export interface AddItemToBasketResponse {
|
|
57
|
+
success: boolean;
|
|
58
|
+
message: string;
|
|
59
|
+
data?: Basket;
|
|
60
|
+
}
|
|
61
|
+
export interface RemoveItemFromBasketResponse {
|
|
62
|
+
success: boolean;
|
|
63
|
+
message: string;
|
|
64
|
+
data?: Basket;
|
|
65
|
+
}
|
|
66
|
+
export interface ClearBasketResponse {
|
|
67
|
+
success: boolean;
|
|
68
|
+
message: string;
|
|
69
|
+
data?: Basket;
|
|
70
|
+
}
|
|
71
|
+
export interface UpdateBasketStatusResponse {
|
|
72
|
+
success: boolean;
|
|
73
|
+
message: string;
|
|
74
|
+
data?: Basket;
|
|
75
|
+
}
|