merchi_sdk_ts 1.13.0 → 1.15.0
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/entities/agent_token_analytics.js +1 -0
- package/dist/entities/agent_token_usage.js +127 -0
- package/dist/entities/agent_token_usage.test.js +6 -0
- package/dist/entities/company.js +51 -1
- package/dist/entities/domain.js +6 -0
- package/dist/entities/product.js +5 -0
- package/dist/entities/product_form.js +92 -0
- package/dist/entities/product_form_version.js +95 -0
- package/dist/index.js +4 -1
- package/dist/merchi.js +6 -0
- package/merchi_sdk_ts-1.13.1.tgz +0 -0
- package/package.json +1 -1
- package/src/entities/agent_token_analytics.ts +49 -0
- package/src/entities/agent_token_usage.test.ts +7 -0
- package/src/entities/agent_token_usage.ts +88 -0
- package/src/entities/company.ts +55 -0
- package/src/entities/domain.ts +22 -0
- package/src/entities/product.ts +4 -0
- package/src/entities/product_form.ts +51 -0
- package/src/entities/product_form_version.ts +51 -0
- package/src/index.ts +15 -0
- package/src/merchi.ts +9 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
if (typeof b !== "function" && b !== null)
|
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
+
extendStatics(d, b);
|
|
12
|
+
function __() { this.constructor = d; }
|
|
13
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
var __assign = (this && this.__assign) || function () {
|
|
17
|
+
__assign = Object.assign || function(t) {
|
|
18
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
19
|
+
s = arguments[i];
|
|
20
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
21
|
+
t[p] = s[p];
|
|
22
|
+
}
|
|
23
|
+
return t;
|
|
24
|
+
};
|
|
25
|
+
return __assign.apply(this, arguments);
|
|
26
|
+
};
|
|
27
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
28
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
29
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
30
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
31
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
32
|
+
};
|
|
33
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
34
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
35
|
+
};
|
|
36
|
+
import { Entity } from '../entity.js';
|
|
37
|
+
import { Company } from './company.js';
|
|
38
|
+
import { Domain } from './domain.js';
|
|
39
|
+
import { User } from './user.js';
|
|
40
|
+
import { AgentConversation } from './agent_conversation.js';
|
|
41
|
+
import { SupportConversation } from './support_conversation.js';
|
|
42
|
+
var AgentTokenUsage = /** @class */ (function (_super) {
|
|
43
|
+
__extends(AgentTokenUsage, _super);
|
|
44
|
+
function AgentTokenUsage() {
|
|
45
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
46
|
+
}
|
|
47
|
+
var _a;
|
|
48
|
+
_a = AgentTokenUsage;
|
|
49
|
+
AgentTokenUsage.resourceName = 'agent_token_usage';
|
|
50
|
+
AgentTokenUsage.singularName = 'agentTokenUsage';
|
|
51
|
+
AgentTokenUsage.pluralName = 'agentTokenUsage';
|
|
52
|
+
AgentTokenUsage.record = function (payload, fetchOptions) {
|
|
53
|
+
var Constructor = _a;
|
|
54
|
+
var fetchOpts = __assign(__assign({}, (fetchOptions || {})), { method: 'POST', body: JSON.stringify(payload), headers: __assign(__assign({}, ((fetchOptions === null || fetchOptions === void 0 ? void 0 : fetchOptions.headers) || {})), { 'Content-Type': 'application/json' }) });
|
|
55
|
+
return Constructor.merchi.authenticatedFetch('/agent_token_usage/', fetchOpts);
|
|
56
|
+
};
|
|
57
|
+
__decorate([
|
|
58
|
+
AgentTokenUsage.property(),
|
|
59
|
+
__metadata("design:type", Number)
|
|
60
|
+
], AgentTokenUsage.prototype, "id", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
AgentTokenUsage.property({ type: Date }),
|
|
63
|
+
__metadata("design:type", Object)
|
|
64
|
+
], AgentTokenUsage.prototype, "createdAt", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
AgentTokenUsage.property(),
|
|
67
|
+
__metadata("design:type", Number)
|
|
68
|
+
], AgentTokenUsage.prototype, "companyId", void 0);
|
|
69
|
+
__decorate([
|
|
70
|
+
AgentTokenUsage.property(),
|
|
71
|
+
__metadata("design:type", Number)
|
|
72
|
+
], AgentTokenUsage.prototype, "domainId", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
AgentTokenUsage.property(),
|
|
75
|
+
__metadata("design:type", Number)
|
|
76
|
+
], AgentTokenUsage.prototype, "userId", void 0);
|
|
77
|
+
__decorate([
|
|
78
|
+
AgentTokenUsage.property({ type: Company }),
|
|
79
|
+
__metadata("design:type", Object)
|
|
80
|
+
], AgentTokenUsage.prototype, "company", void 0);
|
|
81
|
+
__decorate([
|
|
82
|
+
AgentTokenUsage.property({ type: Domain }),
|
|
83
|
+
__metadata("design:type", Object)
|
|
84
|
+
], AgentTokenUsage.prototype, "domain", void 0);
|
|
85
|
+
__decorate([
|
|
86
|
+
AgentTokenUsage.property({ type: User }),
|
|
87
|
+
__metadata("design:type", Object)
|
|
88
|
+
], AgentTokenUsage.prototype, "user", void 0);
|
|
89
|
+
__decorate([
|
|
90
|
+
AgentTokenUsage.property({ type: AgentConversation }),
|
|
91
|
+
__metadata("design:type", Object)
|
|
92
|
+
], AgentTokenUsage.prototype, "agentConversation", void 0);
|
|
93
|
+
__decorate([
|
|
94
|
+
AgentTokenUsage.property({ type: SupportConversation }),
|
|
95
|
+
__metadata("design:type", Object)
|
|
96
|
+
], AgentTokenUsage.prototype, "supportConversation", void 0);
|
|
97
|
+
__decorate([
|
|
98
|
+
AgentTokenUsage.property(),
|
|
99
|
+
__metadata("design:type", Number)
|
|
100
|
+
], AgentTokenUsage.prototype, "agentConversationId", void 0);
|
|
101
|
+
__decorate([
|
|
102
|
+
AgentTokenUsage.property(),
|
|
103
|
+
__metadata("design:type", Number)
|
|
104
|
+
], AgentTokenUsage.prototype, "supportConversationId", void 0);
|
|
105
|
+
__decorate([
|
|
106
|
+
AgentTokenUsage.property(),
|
|
107
|
+
__metadata("design:type", String)
|
|
108
|
+
], AgentTokenUsage.prototype, "sourceType", void 0);
|
|
109
|
+
__decorate([
|
|
110
|
+
AgentTokenUsage.property(),
|
|
111
|
+
__metadata("design:type", String)
|
|
112
|
+
], AgentTokenUsage.prototype, "modelName", void 0);
|
|
113
|
+
__decorate([
|
|
114
|
+
AgentTokenUsage.property(),
|
|
115
|
+
__metadata("design:type", Number)
|
|
116
|
+
], AgentTokenUsage.prototype, "promptTokens", void 0);
|
|
117
|
+
__decorate([
|
|
118
|
+
AgentTokenUsage.property(),
|
|
119
|
+
__metadata("design:type", Number)
|
|
120
|
+
], AgentTokenUsage.prototype, "completionTokens", void 0);
|
|
121
|
+
__decorate([
|
|
122
|
+
AgentTokenUsage.property(),
|
|
123
|
+
__metadata("design:type", Number)
|
|
124
|
+
], AgentTokenUsage.prototype, "totalTokens", void 0);
|
|
125
|
+
return AgentTokenUsage;
|
|
126
|
+
}(Entity));
|
|
127
|
+
export { AgentTokenUsage };
|
package/dist/entities/company.js
CHANGED
|
@@ -22,6 +22,22 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
22
22
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
23
23
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
24
24
|
};
|
|
25
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
26
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
27
|
+
if (!m) return o;
|
|
28
|
+
var i = m.call(o), r, ar = [], e;
|
|
29
|
+
try {
|
|
30
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
31
|
+
}
|
|
32
|
+
catch (error) { e = { error: error }; }
|
|
33
|
+
finally {
|
|
34
|
+
try {
|
|
35
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
36
|
+
}
|
|
37
|
+
finally { if (e) throw e.error; }
|
|
38
|
+
}
|
|
39
|
+
return ar;
|
|
40
|
+
};
|
|
25
41
|
import { Entity } from '../entity.js';
|
|
26
42
|
import { MerchiFile } from './file.js';
|
|
27
43
|
import { User } from './user.js';
|
|
@@ -29,7 +45,41 @@ import { SubscriptionPlan } from './subscription_plan.js';
|
|
|
29
45
|
var Company = /** @class */ (function (_super) {
|
|
30
46
|
__extends(Company, _super);
|
|
31
47
|
function Company() {
|
|
32
|
-
|
|
48
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
49
|
+
_this.getCompanyId = function () {
|
|
50
|
+
if (_this.id === undefined || _this.id === null) {
|
|
51
|
+
throw new Error('id is undefined, did you forget to set it?');
|
|
52
|
+
}
|
|
53
|
+
return _this.id;
|
|
54
|
+
};
|
|
55
|
+
_this.analyticsRequest = function (resource, method, payload, queryParams) {
|
|
56
|
+
if (method === void 0) { method = 'GET'; }
|
|
57
|
+
var query = [];
|
|
58
|
+
if (queryParams) {
|
|
59
|
+
Object.entries(queryParams).forEach(function (_a) {
|
|
60
|
+
var _b = __read(_a, 2), key = _b[0], value = _b[1];
|
|
61
|
+
if (value !== undefined && value !== '') {
|
|
62
|
+
query.push([key, value]);
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
var fetchOptions = {
|
|
67
|
+
method: method,
|
|
68
|
+
query: query,
|
|
69
|
+
};
|
|
70
|
+
if (payload !== undefined) {
|
|
71
|
+
fetchOptions.body = JSON.stringify(payload);
|
|
72
|
+
fetchOptions.headers = { 'Content-Type': 'application/json' };
|
|
73
|
+
}
|
|
74
|
+
return _this.merchi.authenticatedFetch(resource, fetchOptions);
|
|
75
|
+
};
|
|
76
|
+
_this.getAnalytics = function () {
|
|
77
|
+
return _this.analyticsRequest("/companies/".concat(_this.getCompanyId(), "/analytics/"), 'GET');
|
|
78
|
+
};
|
|
79
|
+
_this.getAgentTokenAnalytics = function (queryParams) {
|
|
80
|
+
return _this.analyticsRequest("/companies/".concat(_this.getCompanyId(), "/agent_token_analytics/"), 'GET', undefined, queryParams);
|
|
81
|
+
};
|
|
82
|
+
return _this;
|
|
33
83
|
}
|
|
34
84
|
Company.resourceName = 'companies';
|
|
35
85
|
Company.singularName = 'company';
|
package/dist/entities/domain.js
CHANGED
|
@@ -169,6 +169,12 @@ var Domain = /** @class */ (function (_super) {
|
|
|
169
169
|
_this.publishStorefrontV2Category = function (payload) {
|
|
170
170
|
return _this.storefrontV2Request(_this.storefrontV2DomainResource('categories/publish/'), 'POST', payload);
|
|
171
171
|
};
|
|
172
|
+
_this.getAnalytics = function () {
|
|
173
|
+
return _this.storefrontV2Request("/domains/".concat(_this.getDomainId(), "/analytics/"), 'GET');
|
|
174
|
+
};
|
|
175
|
+
_this.getAgentTokenAnalytics = function (queryParams) {
|
|
176
|
+
return _this.storefrontV2Request("/domains/".concat(_this.getDomainId(), "/agent_token_analytics/"), 'GET', undefined, queryParams);
|
|
177
|
+
};
|
|
172
178
|
return _this;
|
|
173
179
|
}
|
|
174
180
|
Domain.resourceName = 'domains';
|
package/dist/entities/product.js
CHANGED
|
@@ -35,6 +35,7 @@ var __values = (this && this.__values) || function(o) {
|
|
|
35
35
|
};
|
|
36
36
|
import * as _ from 'lodash';
|
|
37
37
|
import { Component } from './component.js';
|
|
38
|
+
import { ProductForm } from './product_form.js';
|
|
38
39
|
import { CountryTax } from './country_tax.js';
|
|
39
40
|
import { Domain } from './domain.js';
|
|
40
41
|
import { Entity } from '../entity.js';
|
|
@@ -486,6 +487,10 @@ var Product = /** @class */ (function (_super) {
|
|
|
486
487
|
Product.property({ type: Component }),
|
|
487
488
|
__metadata("design:type", Object)
|
|
488
489
|
], Product.prototype, "component", void 0);
|
|
490
|
+
__decorate([
|
|
491
|
+
Product.property({ type: ProductForm }),
|
|
492
|
+
__metadata("design:type", Object)
|
|
493
|
+
], Product.prototype, "productForm", void 0);
|
|
489
494
|
__decorate([
|
|
490
495
|
Product.property({ arrayType: 'MerchiFile' }),
|
|
491
496
|
__metadata("design:type", Array)
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
if (typeof b !== "function" && b !== null)
|
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
+
extendStatics(d, b);
|
|
12
|
+
function __() { this.constructor = d; }
|
|
13
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
17
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
18
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
19
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
20
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
21
|
+
};
|
|
22
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
23
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
24
|
+
};
|
|
25
|
+
import { Entity } from '../entity.js';
|
|
26
|
+
var ProductForm = /** @class */ (function (_super) {
|
|
27
|
+
__extends(ProductForm, _super);
|
|
28
|
+
function ProductForm() {
|
|
29
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
30
|
+
}
|
|
31
|
+
ProductForm.resourceName = 'product_forms';
|
|
32
|
+
ProductForm.singularName = 'productForm';
|
|
33
|
+
ProductForm.pluralName = 'productForms';
|
|
34
|
+
__decorate([
|
|
35
|
+
ProductForm.property({ type: Date }),
|
|
36
|
+
__metadata("design:type", Object)
|
|
37
|
+
], ProductForm.prototype, "archived", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
ProductForm.property({ type: Date }),
|
|
40
|
+
__metadata("design:type", Date)
|
|
41
|
+
], ProductForm.prototype, "created", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
ProductForm.property({ type: Date }),
|
|
44
|
+
__metadata("design:type", Date)
|
|
45
|
+
], ProductForm.prototype, "updated", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
ProductForm.property({ type: Number }),
|
|
48
|
+
__metadata("design:type", Number)
|
|
49
|
+
], ProductForm.prototype, "id", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
ProductForm.property({ type: String }),
|
|
52
|
+
__metadata("design:type", String)
|
|
53
|
+
], ProductForm.prototype, "name", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
ProductForm.property({ type: String }),
|
|
56
|
+
__metadata("design:type", String)
|
|
57
|
+
], ProductForm.prototype, "description", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
ProductForm.property(),
|
|
60
|
+
__metadata("design:type", Array)
|
|
61
|
+
], ProductForm.prototype, "tags", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
ProductForm.property({ type: String }),
|
|
64
|
+
__metadata("design:type", String)
|
|
65
|
+
], ProductForm.prototype, "source", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
ProductForm.property({ type: String }),
|
|
68
|
+
__metadata("design:type", String)
|
|
69
|
+
], ProductForm.prototype, "sdkVersion", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
ProductForm.property({ type: String }),
|
|
72
|
+
__metadata("design:type", String)
|
|
73
|
+
], ProductForm.prototype, "status", void 0);
|
|
74
|
+
__decorate([
|
|
75
|
+
ProductForm.property({ type: 'ProductFormVersion' }),
|
|
76
|
+
__metadata("design:type", Object)
|
|
77
|
+
], ProductForm.prototype, "activeVersion", void 0);
|
|
78
|
+
__decorate([
|
|
79
|
+
ProductForm.property({ arrayType: 'ProductFormVersion' }),
|
|
80
|
+
__metadata("design:type", Array)
|
|
81
|
+
], ProductForm.prototype, "versions", void 0);
|
|
82
|
+
__decorate([
|
|
83
|
+
ProductForm.property({ type: 'User' }),
|
|
84
|
+
__metadata("design:type", Object)
|
|
85
|
+
], ProductForm.prototype, "createdBy", void 0);
|
|
86
|
+
__decorate([
|
|
87
|
+
ProductForm.property({ type: 'User' }),
|
|
88
|
+
__metadata("design:type", Object)
|
|
89
|
+
], ProductForm.prototype, "updatedBy", void 0);
|
|
90
|
+
return ProductForm;
|
|
91
|
+
}(Entity));
|
|
92
|
+
export { ProductForm };
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
if (typeof b !== "function" && b !== null)
|
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
+
extendStatics(d, b);
|
|
12
|
+
function __() { this.constructor = d; }
|
|
13
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
17
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
18
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
19
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
20
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
21
|
+
};
|
|
22
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
23
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
24
|
+
};
|
|
25
|
+
import { Entity } from '../entity.js';
|
|
26
|
+
// Sentinel type for passthrough JSON columns (mirrors other entities). Must not
|
|
27
|
+
// be `Object`, which the property decorator rejects ("Bad attribute type").
|
|
28
|
+
var jsonPropertyType = /** @class */ (function () {
|
|
29
|
+
function jsonPropertyType() {
|
|
30
|
+
}
|
|
31
|
+
return jsonPropertyType;
|
|
32
|
+
}());
|
|
33
|
+
var ProductFormVersion = /** @class */ (function (_super) {
|
|
34
|
+
__extends(ProductFormVersion, _super);
|
|
35
|
+
function ProductFormVersion() {
|
|
36
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
37
|
+
}
|
|
38
|
+
ProductFormVersion.resourceName = 'product_form_versions';
|
|
39
|
+
ProductFormVersion.singularName = 'productFormVersion';
|
|
40
|
+
ProductFormVersion.pluralName = 'productFormVersions';
|
|
41
|
+
__decorate([
|
|
42
|
+
ProductFormVersion.property({ type: Date }),
|
|
43
|
+
__metadata("design:type", Date)
|
|
44
|
+
], ProductFormVersion.prototype, "created", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
ProductFormVersion.property({ type: Number }),
|
|
47
|
+
__metadata("design:type", Number)
|
|
48
|
+
], ProductFormVersion.prototype, "id", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
ProductFormVersion.property({ type: Number }),
|
|
51
|
+
__metadata("design:type", Number)
|
|
52
|
+
], ProductFormVersion.prototype, "versionNumber", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
ProductFormVersion.property({ type: String }),
|
|
55
|
+
__metadata("design:type", String)
|
|
56
|
+
], ProductFormVersion.prototype, "source", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
ProductFormVersion.property({ type: String }),
|
|
59
|
+
__metadata("design:type", String)
|
|
60
|
+
], ProductFormVersion.prototype, "sdkVersion", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
ProductFormVersion.property({ type: String }),
|
|
63
|
+
__metadata("design:type", Object)
|
|
64
|
+
], ProductFormVersion.prototype, "compiledBundleUrl", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
ProductFormVersion.property({ type: String }),
|
|
67
|
+
__metadata("design:type", Object)
|
|
68
|
+
], ProductFormVersion.prototype, "bundleSha", void 0);
|
|
69
|
+
__decorate([
|
|
70
|
+
ProductFormVersion.property({ type: String }),
|
|
71
|
+
__metadata("design:type", Object)
|
|
72
|
+
], ProductFormVersion.prototype, "compiledError", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
ProductFormVersion.property({ type: jsonPropertyType }),
|
|
75
|
+
__metadata("design:type", Object)
|
|
76
|
+
], ProductFormVersion.prototype, "staticGateReport", void 0);
|
|
77
|
+
__decorate([
|
|
78
|
+
ProductFormVersion.property({ type: String }),
|
|
79
|
+
__metadata("design:type", String)
|
|
80
|
+
], ProductFormVersion.prototype, "status", void 0);
|
|
81
|
+
__decorate([
|
|
82
|
+
ProductFormVersion.property({ type: Date }),
|
|
83
|
+
__metadata("design:type", Object)
|
|
84
|
+
], ProductFormVersion.prototype, "approvedAt", void 0);
|
|
85
|
+
__decorate([
|
|
86
|
+
ProductFormVersion.property({ type: 'User' }),
|
|
87
|
+
__metadata("design:type", Object)
|
|
88
|
+
], ProductFormVersion.prototype, "approvedBy", void 0);
|
|
89
|
+
__decorate([
|
|
90
|
+
ProductFormVersion.property({ type: 'User' }),
|
|
91
|
+
__metadata("design:type", Object)
|
|
92
|
+
], ProductFormVersion.prototype, "createdBy", void 0);
|
|
93
|
+
return ProductFormVersion;
|
|
94
|
+
}(Entity));
|
|
95
|
+
export { ProductFormVersion };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Address } from './entities/address.js';
|
|
2
2
|
import { AgentConversation } from './entities/agent_conversation.js';
|
|
3
|
+
import { AgentTokenUsage } from './entities/agent_token_usage.js';
|
|
3
4
|
import { AgentSkill } from './entities/agent_skill.js';
|
|
4
5
|
import { AgentSkillVersion } from './entities/agent_skill_version.js';
|
|
5
6
|
import { AgentSkillApproval } from './entities/agent_skill_approval.js';
|
|
@@ -19,6 +20,8 @@ import { CompanyInvitation } from './entities/company_invitation.js';
|
|
|
19
20
|
import { Component } from './entities/component.js';
|
|
20
21
|
import { ComponentTag } from './entities/component_tag.js';
|
|
21
22
|
import { ComponentVersion } from './entities/component_version.js';
|
|
23
|
+
import { ProductForm } from './entities/product_form.js';
|
|
24
|
+
import { ProductFormVersion } from './entities/product_form_version.js';
|
|
22
25
|
import { CountryTax } from './entities/country_tax.js';
|
|
23
26
|
import { Discount } from './entities/discount.js';
|
|
24
27
|
import { DiscountGroup } from './entities/discount_group.js';
|
|
@@ -86,4 +89,4 @@ import * as request from './request.js';
|
|
|
86
89
|
import * as util from './util/index.js';
|
|
87
90
|
import * as pricing from './pricing/index.js';
|
|
88
91
|
import { toastNotifications } from './toasts.js';
|
|
89
|
-
export { constants, request, util, pricing, toastNotifications, Address, AgentConversation, AgentSkill, AgentSkillVersion, AgentSkillApproval, DomainChatSettings, SupportConversation, SupportMessage, Assignment, AutomaticPaymentRelationship, Bank, Cart, CartItem, CartShipmentGroup, CartShipmentQuote, Category, Company, CompanyInvitation, Component, ComponentTag, ComponentVersion, CountryTax, Discount, DiscountGroup, Domain, DomainInvitation, DomainTag, Draft, DraftComment, DraftTemplate, EmailAddress, EmailCounter, EnrolledDomain, Entity, ExchangeRate, InternalTag, Inventory, InventoryUnitVariation, Invoice, Item, Job, JobComment, JobNote, JobOperationLog, MatchingInventory, Menu, MenuItem, Merchi, MerchiFile, Notification, Page, Payment, PaymentDevice, PhoneNumber, Product, ProductReview, ProductionComment, Quote, QuoteItem, Reminder, apiFetch, apiFetchWithProgress, Session, Shipment, ShipmentLog, ShipmentItem, ShipmentItemFulfillment, ShipmentMethod, ShipmentMethodVariation, ShortUrl, SubscriptionPlan, SupplyDomain, SystemRole, Theme, ThemeCssSetting, User, UserCompany, Variation, VariationField, VariationFieldsOption, VariationOption, VariationsGroup, generateUUID, getCookie };
|
|
92
|
+
export { constants, request, util, pricing, toastNotifications, Address, AgentConversation, AgentTokenUsage, AgentSkill, AgentSkillVersion, AgentSkillApproval, DomainChatSettings, SupportConversation, SupportMessage, Assignment, AutomaticPaymentRelationship, Bank, Cart, CartItem, CartShipmentGroup, CartShipmentQuote, Category, Company, CompanyInvitation, Component, ComponentTag, ComponentVersion, ProductForm, ProductFormVersion, CountryTax, Discount, DiscountGroup, Domain, DomainInvitation, DomainTag, Draft, DraftComment, DraftTemplate, EmailAddress, EmailCounter, EnrolledDomain, Entity, ExchangeRate, InternalTag, Inventory, InventoryUnitVariation, Invoice, Item, Job, JobComment, JobNote, JobOperationLog, MatchingInventory, Menu, MenuItem, Merchi, MerchiFile, Notification, Page, Payment, PaymentDevice, PhoneNumber, Product, ProductReview, ProductionComment, Quote, QuoteItem, Reminder, apiFetch, apiFetchWithProgress, Session, Shipment, ShipmentLog, ShipmentItem, ShipmentItemFulfillment, ShipmentMethod, ShipmentMethodVariation, ShortUrl, SubscriptionPlan, SupplyDomain, SystemRole, Theme, ThemeCssSetting, User, UserCompany, Variation, VariationField, VariationFieldsOption, VariationOption, VariationsGroup, generateUUID, getCookie };
|
package/dist/merchi.js
CHANGED
|
@@ -50,6 +50,8 @@ import { Theme } from './entities/theme.js';
|
|
|
50
50
|
import { ThemeCssSetting } from './entities/theme_css_setting.js';
|
|
51
51
|
import { Component } from './entities/component.js';
|
|
52
52
|
import { ComponentVersion } from './entities/component_version.js';
|
|
53
|
+
import { ProductForm } from './entities/product_form.js';
|
|
54
|
+
import { ProductFormVersion } from './entities/product_form_version.js';
|
|
53
55
|
import { MerchiFile } from './entities/file.js';
|
|
54
56
|
import { EmailAddress } from './entities/email_address.js';
|
|
55
57
|
import { SeoDomainPage } from './entities/seo_domain_page.js';
|
|
@@ -82,6 +84,7 @@ import { Variation } from './entities/variation.js';
|
|
|
82
84
|
import { CartItem } from './entities/cart_item.js';
|
|
83
85
|
import { Address } from './entities/address.js';
|
|
84
86
|
import { AgentConversation } from './entities/agent_conversation.js';
|
|
87
|
+
import { AgentTokenUsage } from './entities/agent_token_usage.js';
|
|
85
88
|
import { AgentSkill } from './entities/agent_skill.js';
|
|
86
89
|
import { AgentSkillVersion } from './entities/agent_skill_version.js';
|
|
87
90
|
import { AgentSkillApproval } from './entities/agent_skill_approval.js';
|
|
@@ -216,6 +219,8 @@ var Merchi = /** @class */ (function () {
|
|
|
216
219
|
this.DraftComment = this.setupClass(DraftComment);
|
|
217
220
|
this.Component = this.setupClass(Component);
|
|
218
221
|
this.ComponentVersion = this.setupClass(ComponentVersion);
|
|
222
|
+
this.ProductForm = this.setupClass(ProductForm);
|
|
223
|
+
this.ProductFormVersion = this.setupClass(ProductFormVersion);
|
|
219
224
|
this.Theme = this.setupClass(Theme);
|
|
220
225
|
this.ThemeCssSetting = this.setupClass(ThemeCssSetting);
|
|
221
226
|
this.Company = this.setupClass(Company);
|
|
@@ -265,6 +270,7 @@ var Merchi = /** @class */ (function () {
|
|
|
265
270
|
this.VariationFieldsOption = this.setupClass(VariationFieldsOption);
|
|
266
271
|
this.Address = this.setupClass(Address);
|
|
267
272
|
this.AgentConversation = this.setupClass(AgentConversation);
|
|
273
|
+
this.AgentTokenUsage = this.setupClass(AgentTokenUsage);
|
|
268
274
|
this.AgentSkill = this.setupClass(AgentSkill);
|
|
269
275
|
this.AgentSkillVersion = this.setupClass(AgentSkillVersion);
|
|
270
276
|
this.AgentSkillApproval = this.setupClass(AgentSkillApproval);
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export interface AgentTokenAnalyticsSummary {
|
|
2
|
+
percentageDifference?: number | null;
|
|
3
|
+
totals?: number;
|
|
4
|
+
previousTotals?: number;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface AgentTokenAnalyticsTimeseries {
|
|
8
|
+
dates?: string[];
|
|
9
|
+
totalTokens?: number[];
|
|
10
|
+
promptTokens?: number[];
|
|
11
|
+
completionTokens?: number[];
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface ProfileAnalyticsSummaryMetric {
|
|
15
|
+
percentageDifference?: number | null;
|
|
16
|
+
totals?: number | { total?: number; currency?: string };
|
|
17
|
+
previousTotals?: number | { total?: number; currency?: string };
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface CompanyAnalyticsResponse {
|
|
21
|
+
totalJobs?: ProfileAnalyticsSummaryMetric;
|
|
22
|
+
completedJobs?: ProfileAnalyticsSummaryMetric;
|
|
23
|
+
totalInvoices?: ProfileAnalyticsSummaryMetric;
|
|
24
|
+
paymentsReceived?: ProfileAnalyticsSummaryMetric;
|
|
25
|
+
agentTokenUsage?: AgentTokenAnalyticsSummary;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface DomainAnalyticsResponse extends CompanyAnalyticsResponse {}
|
|
29
|
+
|
|
30
|
+
export interface AgentTokenUsageRecordPayload {
|
|
31
|
+
companyId?: number;
|
|
32
|
+
domainId?: number;
|
|
33
|
+
promptTokens?: number;
|
|
34
|
+
completionTokens?: number;
|
|
35
|
+
totalTokens?: number;
|
|
36
|
+
sourceType?: string;
|
|
37
|
+
modelName?: string;
|
|
38
|
+
agentConversationId?: number;
|
|
39
|
+
supportConversationId?: number;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface AgentTokenUsageRecordResponse {
|
|
43
|
+
agentTokenUsage?: {
|
|
44
|
+
id?: number;
|
|
45
|
+
companyId?: number;
|
|
46
|
+
domainId?: number;
|
|
47
|
+
totalTokens?: number;
|
|
48
|
+
};
|
|
49
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { Entity } from '../entity.js';
|
|
2
|
+
import { Company } from './company.js';
|
|
3
|
+
import { Domain } from './domain.js';
|
|
4
|
+
import { User } from './user.js';
|
|
5
|
+
import { AgentConversation } from './agent_conversation.js';
|
|
6
|
+
import { SupportConversation } from './support_conversation.js';
|
|
7
|
+
import type {
|
|
8
|
+
AgentTokenUsageRecordPayload,
|
|
9
|
+
AgentTokenUsageRecordResponse,
|
|
10
|
+
} from './agent_token_analytics.js';
|
|
11
|
+
import type { RequestOptions } from '../request.js';
|
|
12
|
+
|
|
13
|
+
export class AgentTokenUsage extends Entity {
|
|
14
|
+
protected static resourceName = 'agent_token_usage';
|
|
15
|
+
protected static singularName = 'agentTokenUsage';
|
|
16
|
+
protected static pluralName = 'agentTokenUsage';
|
|
17
|
+
|
|
18
|
+
@AgentTokenUsage.property()
|
|
19
|
+
public id?: number;
|
|
20
|
+
|
|
21
|
+
@AgentTokenUsage.property({type: Date})
|
|
22
|
+
public createdAt?: Date | null;
|
|
23
|
+
|
|
24
|
+
@AgentTokenUsage.property()
|
|
25
|
+
public companyId?: number;
|
|
26
|
+
|
|
27
|
+
@AgentTokenUsage.property()
|
|
28
|
+
public domainId?: number;
|
|
29
|
+
|
|
30
|
+
@AgentTokenUsage.property()
|
|
31
|
+
public userId?: number;
|
|
32
|
+
|
|
33
|
+
@AgentTokenUsage.property({type: Company})
|
|
34
|
+
public company?: Company | null;
|
|
35
|
+
|
|
36
|
+
@AgentTokenUsage.property({type: Domain})
|
|
37
|
+
public domain?: Domain | null;
|
|
38
|
+
|
|
39
|
+
@AgentTokenUsage.property({type: User})
|
|
40
|
+
public user?: User | null;
|
|
41
|
+
|
|
42
|
+
@AgentTokenUsage.property({type: AgentConversation})
|
|
43
|
+
public agentConversation?: AgentConversation | null;
|
|
44
|
+
|
|
45
|
+
@AgentTokenUsage.property({type: SupportConversation})
|
|
46
|
+
public supportConversation?: SupportConversation | null;
|
|
47
|
+
|
|
48
|
+
@AgentTokenUsage.property()
|
|
49
|
+
public agentConversationId?: number;
|
|
50
|
+
|
|
51
|
+
@AgentTokenUsage.property()
|
|
52
|
+
public supportConversationId?: number;
|
|
53
|
+
|
|
54
|
+
@AgentTokenUsage.property()
|
|
55
|
+
public sourceType?: string;
|
|
56
|
+
|
|
57
|
+
@AgentTokenUsage.property()
|
|
58
|
+
public modelName?: string;
|
|
59
|
+
|
|
60
|
+
@AgentTokenUsage.property()
|
|
61
|
+
public promptTokens?: number;
|
|
62
|
+
|
|
63
|
+
@AgentTokenUsage.property()
|
|
64
|
+
public completionTokens?: number;
|
|
65
|
+
|
|
66
|
+
@AgentTokenUsage.property()
|
|
67
|
+
public totalTokens?: number;
|
|
68
|
+
|
|
69
|
+
public static record = (
|
|
70
|
+
payload: AgentTokenUsageRecordPayload,
|
|
71
|
+
fetchOptions?: RequestOptions
|
|
72
|
+
): Promise<AgentTokenUsageRecordResponse> => {
|
|
73
|
+
const Constructor = this as typeof AgentTokenUsage;
|
|
74
|
+
const fetchOpts: RequestOptions = {
|
|
75
|
+
...(fetchOptions || {}),
|
|
76
|
+
method: 'POST',
|
|
77
|
+
body: JSON.stringify(payload),
|
|
78
|
+
headers: {
|
|
79
|
+
...(fetchOptions?.headers || {}),
|
|
80
|
+
'Content-Type': 'application/json',
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
return Constructor.merchi.authenticatedFetch(
|
|
84
|
+
'/agent_token_usage/',
|
|
85
|
+
fetchOpts
|
|
86
|
+
) as Promise<AgentTokenUsageRecordResponse>;
|
|
87
|
+
};
|
|
88
|
+
}
|
package/src/entities/company.ts
CHANGED
|
@@ -19,6 +19,11 @@ import { User } from './user.js';
|
|
|
19
19
|
import { UserCompany } from './user_company.js';
|
|
20
20
|
import { SubscriptionPlan } from './subscription_plan.js';
|
|
21
21
|
import { PaymentDevice } from './payment_device.js';
|
|
22
|
+
import type {
|
|
23
|
+
AgentTokenAnalyticsTimeseries,
|
|
24
|
+
CompanyAnalyticsResponse,
|
|
25
|
+
} from './agent_token_analytics.js';
|
|
26
|
+
import type { RequestOptions } from '../request.js';
|
|
22
27
|
|
|
23
28
|
export class Company extends Entity {
|
|
24
29
|
protected static resourceName = 'companies';
|
|
@@ -333,4 +338,54 @@ export class Company extends Entity {
|
|
|
333
338
|
|
|
334
339
|
@Company.property({arrayType: 'Address'})
|
|
335
340
|
public addresses?: Address[];
|
|
341
|
+
|
|
342
|
+
private getCompanyId = () => {
|
|
343
|
+
if (this.id === undefined || this.id === null) {
|
|
344
|
+
throw new Error('id is undefined, did you forget to set it?');
|
|
345
|
+
}
|
|
346
|
+
return this.id;
|
|
347
|
+
};
|
|
348
|
+
|
|
349
|
+
private analyticsRequest = (
|
|
350
|
+
resource: string,
|
|
351
|
+
method: 'GET' | 'POST' = 'GET',
|
|
352
|
+
payload?: Record<string, any>,
|
|
353
|
+
queryParams?: Record<string, string | undefined>
|
|
354
|
+
) => {
|
|
355
|
+
const query: Array<[string, string]> = [];
|
|
356
|
+
if (queryParams) {
|
|
357
|
+
Object.entries(queryParams).forEach(([key, value]) => {
|
|
358
|
+
if (value !== undefined && value !== '') {
|
|
359
|
+
query.push([key, value]);
|
|
360
|
+
}
|
|
361
|
+
});
|
|
362
|
+
}
|
|
363
|
+
const fetchOptions: RequestOptions = {
|
|
364
|
+
method: method,
|
|
365
|
+
query: query,
|
|
366
|
+
};
|
|
367
|
+
if (payload !== undefined) {
|
|
368
|
+
fetchOptions.body = JSON.stringify(payload);
|
|
369
|
+
fetchOptions.headers = {'Content-Type': 'application/json'};
|
|
370
|
+
}
|
|
371
|
+
return this.merchi.authenticatedFetch(resource, fetchOptions);
|
|
372
|
+
};
|
|
373
|
+
|
|
374
|
+
public getAnalytics = (): Promise<CompanyAnalyticsResponse> => {
|
|
375
|
+
return this.analyticsRequest(
|
|
376
|
+
`/companies/${this.getCompanyId()}/analytics/`,
|
|
377
|
+
'GET'
|
|
378
|
+
) as Promise<CompanyAnalyticsResponse>;
|
|
379
|
+
};
|
|
380
|
+
|
|
381
|
+
public getAgentTokenAnalytics = (
|
|
382
|
+
queryParams?: Record<string, string | undefined>
|
|
383
|
+
): Promise<AgentTokenAnalyticsTimeseries> => {
|
|
384
|
+
return this.analyticsRequest(
|
|
385
|
+
`/companies/${this.getCompanyId()}/agent_token_analytics/`,
|
|
386
|
+
'GET',
|
|
387
|
+
undefined,
|
|
388
|
+
queryParams
|
|
389
|
+
) as Promise<AgentTokenAnalyticsTimeseries>;
|
|
390
|
+
};
|
|
336
391
|
}
|
package/src/entities/domain.ts
CHANGED
|
@@ -5,6 +5,10 @@ import { DomainInvitation } from './domain_invitation.js';
|
|
|
5
5
|
import { DomainTag } from './domain_tag.js';
|
|
6
6
|
import { EnrolledDomain } from './enrolled_domain.js';
|
|
7
7
|
import { Entity } from '../entity.js';
|
|
8
|
+
import type {
|
|
9
|
+
AgentTokenAnalyticsTimeseries,
|
|
10
|
+
DomainAnalyticsResponse,
|
|
11
|
+
} from './agent_token_analytics.js';
|
|
8
12
|
import { MerchiFile } from './file.js';
|
|
9
13
|
import { InternalTag } from './internal_tag.js';
|
|
10
14
|
import { Invoice } from './invoice.js';
|
|
@@ -891,4 +895,22 @@ export class Domain extends Entity {
|
|
|
891
895
|
payload
|
|
892
896
|
) as Promise<{categoryPublish: StorefrontV2CategoryPublishResult}>;
|
|
893
897
|
};
|
|
898
|
+
|
|
899
|
+
public getAnalytics = (): Promise<DomainAnalyticsResponse> => {
|
|
900
|
+
return this.storefrontV2Request(
|
|
901
|
+
`/domains/${this.getDomainId()}/analytics/`,
|
|
902
|
+
'GET'
|
|
903
|
+
) as Promise<DomainAnalyticsResponse>;
|
|
904
|
+
};
|
|
905
|
+
|
|
906
|
+
public getAgentTokenAnalytics = (
|
|
907
|
+
queryParams?: Record<string, string | undefined>
|
|
908
|
+
): Promise<AgentTokenAnalyticsTimeseries> => {
|
|
909
|
+
return this.storefrontV2Request(
|
|
910
|
+
`/domains/${this.getDomainId()}/agent_token_analytics/`,
|
|
911
|
+
'GET',
|
|
912
|
+
undefined,
|
|
913
|
+
queryParams
|
|
914
|
+
) as Promise<AgentTokenAnalyticsTimeseries>;
|
|
915
|
+
};
|
|
894
916
|
}
|
package/src/entities/product.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { CartItem } from './cart_item.js';
|
|
|
3
3
|
import { Category } from './category.js';
|
|
4
4
|
import { Company } from './company.js';
|
|
5
5
|
import { Component } from './component.js';
|
|
6
|
+
import { ProductForm } from './product_form.js';
|
|
6
7
|
import { CountryTax } from './country_tax.js';
|
|
7
8
|
import { DiscountGroup } from './discount_group.js';
|
|
8
9
|
import { Domain } from './domain.js';
|
|
@@ -264,6 +265,9 @@ export class Product extends Entity {
|
|
|
264
265
|
@Product.property({type: Component})
|
|
265
266
|
public component?: Component | null;
|
|
266
267
|
|
|
268
|
+
@Product.property({type: ProductForm})
|
|
269
|
+
public productForm?: ProductForm | null;
|
|
270
|
+
|
|
267
271
|
@Product.property({arrayType: 'MerchiFile'})
|
|
268
272
|
public images?: MerchiFile[];
|
|
269
273
|
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Entity } from '../entity.js';
|
|
2
|
+
import { ProductFormVersion } from './product_form_version.js';
|
|
3
|
+
import { User } from './user.js';
|
|
4
|
+
|
|
5
|
+
export class ProductForm extends Entity {
|
|
6
|
+
protected static resourceName = 'product_forms';
|
|
7
|
+
protected static singularName = 'productForm';
|
|
8
|
+
protected static pluralName = 'productForms';
|
|
9
|
+
|
|
10
|
+
@ProductForm.property({type: Date})
|
|
11
|
+
public archived?: Date | null;
|
|
12
|
+
|
|
13
|
+
@ProductForm.property({type: Date})
|
|
14
|
+
public created?: Date;
|
|
15
|
+
|
|
16
|
+
@ProductForm.property({type: Date})
|
|
17
|
+
public updated?: Date;
|
|
18
|
+
|
|
19
|
+
@ProductForm.property({type: Number})
|
|
20
|
+
public id?: number;
|
|
21
|
+
|
|
22
|
+
@ProductForm.property({type: String})
|
|
23
|
+
public name?: string;
|
|
24
|
+
|
|
25
|
+
@ProductForm.property({type: String})
|
|
26
|
+
public description?: string;
|
|
27
|
+
|
|
28
|
+
@ProductForm.property()
|
|
29
|
+
public tags?: string[];
|
|
30
|
+
|
|
31
|
+
@ProductForm.property({type: String})
|
|
32
|
+
public source?: string;
|
|
33
|
+
|
|
34
|
+
@ProductForm.property({type: String})
|
|
35
|
+
public sdkVersion?: string;
|
|
36
|
+
|
|
37
|
+
@ProductForm.property({type: String})
|
|
38
|
+
public status?: string;
|
|
39
|
+
|
|
40
|
+
@ProductForm.property({type: 'ProductFormVersion'})
|
|
41
|
+
public activeVersion?: ProductFormVersion | null;
|
|
42
|
+
|
|
43
|
+
@ProductForm.property({arrayType: 'ProductFormVersion'})
|
|
44
|
+
public versions?: ProductFormVersion[];
|
|
45
|
+
|
|
46
|
+
@ProductForm.property({type: 'User'})
|
|
47
|
+
public createdBy?: User | null;
|
|
48
|
+
|
|
49
|
+
@ProductForm.property({type: 'User'})
|
|
50
|
+
public updatedBy?: User | null;
|
|
51
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Entity } from '../entity.js';
|
|
2
|
+
import { User } from './user.js';
|
|
3
|
+
|
|
4
|
+
// Sentinel type for passthrough JSON columns (mirrors other entities). Must not
|
|
5
|
+
// be `Object`, which the property decorator rejects ("Bad attribute type").
|
|
6
|
+
const jsonPropertyType = class {};
|
|
7
|
+
|
|
8
|
+
export class ProductFormVersion extends Entity {
|
|
9
|
+
protected static resourceName = 'product_form_versions';
|
|
10
|
+
protected static singularName = 'productFormVersion';
|
|
11
|
+
protected static pluralName = 'productFormVersions';
|
|
12
|
+
|
|
13
|
+
@ProductFormVersion.property({type: Date})
|
|
14
|
+
public created?: Date;
|
|
15
|
+
|
|
16
|
+
@ProductFormVersion.property({type: Number})
|
|
17
|
+
public id?: number;
|
|
18
|
+
|
|
19
|
+
@ProductFormVersion.property({type: Number})
|
|
20
|
+
public versionNumber?: number;
|
|
21
|
+
|
|
22
|
+
@ProductFormVersion.property({type: String})
|
|
23
|
+
public source?: string;
|
|
24
|
+
|
|
25
|
+
@ProductFormVersion.property({type: String})
|
|
26
|
+
public sdkVersion?: string;
|
|
27
|
+
|
|
28
|
+
@ProductFormVersion.property({type: String})
|
|
29
|
+
public compiledBundleUrl?: string | null;
|
|
30
|
+
|
|
31
|
+
@ProductFormVersion.property({type: String})
|
|
32
|
+
public bundleSha?: string | null;
|
|
33
|
+
|
|
34
|
+
@ProductFormVersion.property({type: String})
|
|
35
|
+
public compiledError?: string | null;
|
|
36
|
+
|
|
37
|
+
@ProductFormVersion.property({type: jsonPropertyType})
|
|
38
|
+
public staticGateReport?: any;
|
|
39
|
+
|
|
40
|
+
@ProductFormVersion.property({type: String})
|
|
41
|
+
public status?: string;
|
|
42
|
+
|
|
43
|
+
@ProductFormVersion.property({type: Date})
|
|
44
|
+
public approvedAt?: Date | null;
|
|
45
|
+
|
|
46
|
+
@ProductFormVersion.property({type: 'User'})
|
|
47
|
+
public approvedBy?: User | null;
|
|
48
|
+
|
|
49
|
+
@ProductFormVersion.property({type: 'User'})
|
|
50
|
+
public createdBy?: User | null;
|
|
51
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import { Address } from './entities/address.js';
|
|
2
2
|
import { AgentConversation } from './entities/agent_conversation.js';
|
|
3
|
+
import { AgentTokenUsage } from './entities/agent_token_usage.js';
|
|
4
|
+
export type {
|
|
5
|
+
AgentTokenAnalyticsSummary,
|
|
6
|
+
AgentTokenAnalyticsTimeseries,
|
|
7
|
+
AgentTokenUsageRecordPayload,
|
|
8
|
+
AgentTokenUsageRecordResponse,
|
|
9
|
+
CompanyAnalyticsResponse,
|
|
10
|
+
DomainAnalyticsResponse,
|
|
11
|
+
ProfileAnalyticsSummaryMetric,
|
|
12
|
+
} from './entities/agent_token_analytics.js';
|
|
3
13
|
import { AgentSkill } from './entities/agent_skill.js';
|
|
4
14
|
import { AgentSkillVersion } from './entities/agent_skill_version.js';
|
|
5
15
|
import { AgentSkillApproval } from './entities/agent_skill_approval.js';
|
|
@@ -19,6 +29,8 @@ import { CompanyInvitation } from './entities/company_invitation.js';
|
|
|
19
29
|
import { Component } from './entities/component.js';
|
|
20
30
|
import { ComponentTag } from './entities/component_tag.js';
|
|
21
31
|
import { ComponentVersion } from './entities/component_version.js';
|
|
32
|
+
import { ProductForm } from './entities/product_form.js';
|
|
33
|
+
import { ProductFormVersion } from './entities/product_form_version.js';
|
|
22
34
|
import { CountryTax } from './entities/country_tax.js';
|
|
23
35
|
import { Discount } from './entities/discount.js';
|
|
24
36
|
import { DiscountGroup } from './entities/discount_group.js';
|
|
@@ -99,6 +111,7 @@ export {
|
|
|
99
111
|
toastNotifications,
|
|
100
112
|
Address,
|
|
101
113
|
AgentConversation,
|
|
114
|
+
AgentTokenUsage,
|
|
102
115
|
AgentSkill,
|
|
103
116
|
AgentSkillVersion,
|
|
104
117
|
AgentSkillApproval,
|
|
@@ -118,6 +131,8 @@ export {
|
|
|
118
131
|
Component,
|
|
119
132
|
ComponentTag,
|
|
120
133
|
ComponentVersion,
|
|
134
|
+
ProductForm,
|
|
135
|
+
ProductFormVersion,
|
|
121
136
|
CountryTax,
|
|
122
137
|
Discount,
|
|
123
138
|
DiscountGroup,
|
package/src/merchi.ts
CHANGED
|
@@ -44,6 +44,8 @@ import { Theme } from './entities/theme.js';
|
|
|
44
44
|
import { ThemeCssSetting } from './entities/theme_css_setting.js';
|
|
45
45
|
import { Component } from './entities/component.js';
|
|
46
46
|
import { ComponentVersion } from './entities/component_version.js';
|
|
47
|
+
import { ProductForm } from './entities/product_form.js';
|
|
48
|
+
import { ProductFormVersion } from './entities/product_form_version.js';
|
|
47
49
|
import { MerchiFile } from './entities/file.js';
|
|
48
50
|
import { EmailAddress } from './entities/email_address.js';
|
|
49
51
|
import { SeoDomainPage } from './entities/seo_domain_page.js';
|
|
@@ -76,6 +78,7 @@ import { Variation } from './entities/variation.js';
|
|
|
76
78
|
import { CartItem } from './entities/cart_item.js';
|
|
77
79
|
import { Address } from './entities/address.js';
|
|
78
80
|
import { AgentConversation } from './entities/agent_conversation.js';
|
|
81
|
+
import { AgentTokenUsage } from './entities/agent_token_usage.js';
|
|
79
82
|
import { AgentSkill } from './entities/agent_skill.js';
|
|
80
83
|
import { AgentSkillVersion } from './entities/agent_skill_version.js';
|
|
81
84
|
import { AgentSkillApproval } from './entities/agent_skill_approval.js';
|
|
@@ -167,6 +170,7 @@ export class Merchi {
|
|
|
167
170
|
public Company: typeof Company;
|
|
168
171
|
public Address: typeof Address;
|
|
169
172
|
public AgentConversation: typeof AgentConversation;
|
|
173
|
+
public AgentTokenUsage: typeof AgentTokenUsage;
|
|
170
174
|
public AgentSkill: typeof AgentSkill;
|
|
171
175
|
public AgentSkillVersion: typeof AgentSkillVersion;
|
|
172
176
|
public AgentSkillApproval: typeof AgentSkillApproval;
|
|
@@ -199,6 +203,8 @@ export class Merchi {
|
|
|
199
203
|
public Quote: typeof Quote;
|
|
200
204
|
public Component: typeof Component;
|
|
201
205
|
public ComponentVersion : typeof ComponentVersion;
|
|
206
|
+
public ProductForm: typeof ProductForm;
|
|
207
|
+
public ProductFormVersion: typeof ProductFormVersion;
|
|
202
208
|
public QuoteItem: typeof QuoteItem;
|
|
203
209
|
public Reminder: typeof Reminder;
|
|
204
210
|
public MatchingInventory: typeof MatchingInventory;
|
|
@@ -277,6 +283,8 @@ export class Merchi {
|
|
|
277
283
|
this.DraftComment = this.setupClass(DraftComment) as typeof DraftComment;
|
|
278
284
|
this.Component = this.setupClass(Component) as typeof Component;
|
|
279
285
|
this.ComponentVersion = this.setupClass(ComponentVersion) as typeof ComponentVersion;
|
|
286
|
+
this.ProductForm = this.setupClass(ProductForm) as typeof ProductForm;
|
|
287
|
+
this.ProductFormVersion = this.setupClass(ProductFormVersion) as typeof ProductFormVersion;
|
|
280
288
|
this.Theme = this.setupClass(Theme) as typeof Theme;
|
|
281
289
|
this.ThemeCssSetting = this.setupClass(ThemeCssSetting) as typeof ThemeCssSetting;
|
|
282
290
|
this.Company = this.setupClass(Company) as typeof Company;
|
|
@@ -348,6 +356,7 @@ export class Merchi {
|
|
|
348
356
|
) as typeof VariationFieldsOption;
|
|
349
357
|
this.Address = this.setupClass(Address) as typeof Address;
|
|
350
358
|
this.AgentConversation = this.setupClass(AgentConversation) as typeof AgentConversation;
|
|
359
|
+
this.AgentTokenUsage = this.setupClass(AgentTokenUsage) as typeof AgentTokenUsage;
|
|
351
360
|
this.AgentSkill = this.setupClass(AgentSkill) as typeof AgentSkill;
|
|
352
361
|
this.AgentSkillVersion = this.setupClass(AgentSkillVersion) as typeof AgentSkillVersion;
|
|
353
362
|
this.AgentSkillApproval = this.setupClass(AgentSkillApproval) as typeof AgentSkillApproval;
|