merchi_sdk_ts 1.3.2 → 1.3.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/entities/domain_chat_settings.js +8 -0
- package/dist/entities/product.test.js +1 -0
- package/dist/entities/support_conversation.js +24 -3
- package/dist/entities/support_conversation.test.js +6 -0
- package/dist/entities/support_message.js +8 -6
- package/dist/entities/support_message.test.js +6 -0
- package/dist/entity.js +4 -0
- package/package.json +1 -1
- package/src/entities/domain_chat_settings.ts +6 -0
- package/src/entities/product.test.ts +1 -0
- package/src/entities/support_conversation.test.ts +7 -0
- package/src/entities/support_conversation.ts +20 -3
- package/src/entities/support_message.test.ts +7 -0
- package/src/entities/support_message.ts +6 -5
- package/src/entity.ts +5 -0
|
@@ -77,6 +77,14 @@ var DomainChatSettings = /** @class */ (function (_super) {
|
|
|
77
77
|
DomainChatSettings.property(),
|
|
78
78
|
__metadata("design:type", Boolean)
|
|
79
79
|
], DomainChatSettings.prototype, "notifyEmailNewMessage", void 0);
|
|
80
|
+
__decorate([
|
|
81
|
+
DomainChatSettings.property(),
|
|
82
|
+
__metadata("design:type", Boolean)
|
|
83
|
+
], DomainChatSettings.prototype, "requireGuestContact", void 0);
|
|
84
|
+
__decorate([
|
|
85
|
+
DomainChatSettings.property(),
|
|
86
|
+
__metadata("design:type", Boolean)
|
|
87
|
+
], DomainChatSettings.prototype, "embedTestMode", void 0);
|
|
80
88
|
return DomainChatSettings;
|
|
81
89
|
}(Entity));
|
|
82
90
|
export { DomainChatSettings };
|
|
@@ -24,6 +24,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
24
24
|
};
|
|
25
25
|
import { Domain } from './domain.js';
|
|
26
26
|
import { Entity } from '../entity.js';
|
|
27
|
+
import { User } from './user.js';
|
|
27
28
|
var SupportConversation = /** @class */ (function (_super) {
|
|
28
29
|
__extends(SupportConversation, _super);
|
|
29
30
|
function SupportConversation() {
|
|
@@ -45,15 +46,35 @@ var SupportConversation = /** @class */ (function (_super) {
|
|
|
45
46
|
__metadata("design:type", Object)
|
|
46
47
|
], SupportConversation.prototype, "lastMessageAt", void 0);
|
|
47
48
|
__decorate([
|
|
48
|
-
SupportConversation.property(),
|
|
49
|
+
SupportConversation.property({ type: Date }),
|
|
50
|
+
__metadata("design:type", Object)
|
|
51
|
+
], SupportConversation.prototype, "archivedAt", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
SupportConversation.property({ type: Domain }),
|
|
49
54
|
__metadata("design:type", Domain)
|
|
50
55
|
], SupportConversation.prototype, "domain", void 0);
|
|
51
56
|
__decorate([
|
|
52
|
-
SupportConversation.property(),
|
|
57
|
+
SupportConversation.property({ arrayType: 'DomainTag' }),
|
|
58
|
+
__metadata("design:type", Array)
|
|
59
|
+
], SupportConversation.prototype, "tags", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
SupportConversation.property({ type: String }),
|
|
53
62
|
__metadata("design:type", Object)
|
|
54
63
|
], SupportConversation.prototype, "guestId", void 0);
|
|
55
64
|
__decorate([
|
|
56
|
-
SupportConversation.property(),
|
|
65
|
+
SupportConversation.property({ type: String }),
|
|
66
|
+
__metadata("design:type", Object)
|
|
67
|
+
], SupportConversation.prototype, "guestContactEmail", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
SupportConversation.property({ type: String }),
|
|
70
|
+
__metadata("design:type", Object)
|
|
71
|
+
], SupportConversation.prototype, "guestContactName", void 0);
|
|
72
|
+
__decorate([
|
|
73
|
+
SupportConversation.property({ type: String }),
|
|
74
|
+
__metadata("design:type", Object)
|
|
75
|
+
], SupportConversation.prototype, "clientFingerprint", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
SupportConversation.property({ type: User }),
|
|
57
78
|
__metadata("design:type", Object)
|
|
58
79
|
], SupportConversation.prototype, "user", void 0);
|
|
59
80
|
__decorate([
|
|
@@ -23,6 +23,8 @@ 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
25
|
import { Entity } from '../entity.js';
|
|
26
|
+
import { SupportConversation } from './support_conversation.js';
|
|
27
|
+
import { User } from './user.js';
|
|
26
28
|
var SupportMessage = /** @class */ (function (_super) {
|
|
27
29
|
__extends(SupportMessage, _super);
|
|
28
30
|
function SupportMessage() {
|
|
@@ -36,19 +38,19 @@ var SupportMessage = /** @class */ (function (_super) {
|
|
|
36
38
|
__metadata("design:type", Number)
|
|
37
39
|
], SupportMessage.prototype, "id", void 0);
|
|
38
40
|
__decorate([
|
|
39
|
-
SupportMessage.property(),
|
|
40
|
-
__metadata("design:type",
|
|
41
|
-
], SupportMessage.prototype, "
|
|
41
|
+
SupportMessage.property({ type: SupportConversation }),
|
|
42
|
+
__metadata("design:type", SupportConversation)
|
|
43
|
+
], SupportMessage.prototype, "conversation", void 0);
|
|
42
44
|
__decorate([
|
|
43
|
-
SupportMessage.property(),
|
|
45
|
+
SupportMessage.property({ type: String }),
|
|
44
46
|
__metadata("design:type", String)
|
|
45
47
|
], SupportMessage.prototype, "senderType", void 0);
|
|
46
48
|
__decorate([
|
|
47
|
-
SupportMessage.property(),
|
|
49
|
+
SupportMessage.property({ type: User }),
|
|
48
50
|
__metadata("design:type", Object)
|
|
49
51
|
], SupportMessage.prototype, "user", void 0);
|
|
50
52
|
__decorate([
|
|
51
|
-
SupportMessage.property(),
|
|
53
|
+
SupportMessage.property({ type: String }),
|
|
52
54
|
__metadata("design:type", String)
|
|
53
55
|
], SupportMessage.prototype, "content", void 0);
|
|
54
56
|
__decorate([
|
package/dist/entity.js
CHANGED
|
@@ -814,6 +814,10 @@ var Entity = /** @class */ (function () {
|
|
|
814
814
|
fetchOptions.query.push(['component_id',
|
|
815
815
|
options.componentId.toString()]);
|
|
816
816
|
}
|
|
817
|
+
if (options.conversationId !== undefined) {
|
|
818
|
+
fetchOptions.query.push(['conversation_id',
|
|
819
|
+
options.conversationId.toString()]);
|
|
820
|
+
}
|
|
817
821
|
if (options.groupBuyForJobId !== undefined) {
|
|
818
822
|
fetchOptions.query.push(['group_buy_for_job_id',
|
|
819
823
|
options.groupBuyForJobId.toString()]);
|
package/package.json
CHANGED
|
@@ -39,4 +39,10 @@ export class DomainChatSettings extends Entity {
|
|
|
39
39
|
|
|
40
40
|
@DomainChatSettings.property()
|
|
41
41
|
public notifyEmailNewMessage?: boolean;
|
|
42
|
+
|
|
43
|
+
@DomainChatSettings.property()
|
|
44
|
+
public requireGuestContact?: boolean;
|
|
45
|
+
|
|
46
|
+
@DomainChatSettings.property()
|
|
47
|
+
public embedTestMode?: boolean;
|
|
42
48
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Domain } from './domain.js';
|
|
2
|
+
import { DomainTag } from './domain_tag.js';
|
|
2
3
|
import { Entity } from '../entity.js';
|
|
3
4
|
import { User } from './user.js';
|
|
4
5
|
import { SupportMessage } from './support_message.js';
|
|
@@ -17,13 +18,29 @@ export class SupportConversation extends Entity {
|
|
|
17
18
|
@SupportConversation.property({ type: Date })
|
|
18
19
|
public lastMessageAt?: Date | null;
|
|
19
20
|
|
|
20
|
-
@SupportConversation.property()
|
|
21
|
+
@SupportConversation.property({ type: Date })
|
|
22
|
+
public archivedAt?: Date | null;
|
|
23
|
+
|
|
24
|
+
@SupportConversation.property({ type: Domain })
|
|
21
25
|
public domain?: Domain;
|
|
22
26
|
|
|
23
|
-
@SupportConversation.property()
|
|
27
|
+
@SupportConversation.property({ arrayType: 'DomainTag' })
|
|
28
|
+
public tags?: DomainTag[];
|
|
29
|
+
|
|
30
|
+
@SupportConversation.property({ type: String })
|
|
24
31
|
public guestId?: string | null;
|
|
25
32
|
|
|
26
|
-
@SupportConversation.property()
|
|
33
|
+
@SupportConversation.property({ type: String })
|
|
34
|
+
public guestContactEmail?: string | null;
|
|
35
|
+
|
|
36
|
+
@SupportConversation.property({ type: String })
|
|
37
|
+
public guestContactName?: string | null;
|
|
38
|
+
|
|
39
|
+
/** Opaque client fingerprint for repeat-visitor / spam correlation (max 512 chars). */
|
|
40
|
+
@SupportConversation.property({ type: String })
|
|
41
|
+
public clientFingerprint?: string | null;
|
|
42
|
+
|
|
43
|
+
@SupportConversation.property({ type: User })
|
|
27
44
|
public user?: User | null;
|
|
28
45
|
|
|
29
46
|
@SupportConversation.property({ arrayType: 'SupportMessage' })
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Entity } from '../entity.js';
|
|
2
|
+
import { SupportConversation } from './support_conversation.js';
|
|
2
3
|
import { User } from './user.js';
|
|
3
4
|
|
|
4
5
|
export class SupportMessage extends Entity {
|
|
@@ -9,16 +10,16 @@ export class SupportMessage extends Entity {
|
|
|
9
10
|
@SupportMessage.property()
|
|
10
11
|
public id?: number;
|
|
11
12
|
|
|
12
|
-
@SupportMessage.property()
|
|
13
|
-
public
|
|
13
|
+
@SupportMessage.property({ type: SupportConversation })
|
|
14
|
+
public conversation?: SupportConversation;
|
|
14
15
|
|
|
15
|
-
@SupportMessage.property()
|
|
16
|
+
@SupportMessage.property({ type: String })
|
|
16
17
|
public senderType?: string; // 'guest' | 'manager'
|
|
17
18
|
|
|
18
|
-
@SupportMessage.property()
|
|
19
|
+
@SupportMessage.property({ type: User })
|
|
19
20
|
public user?: User | null;
|
|
20
21
|
|
|
21
|
-
@SupportMessage.property()
|
|
22
|
+
@SupportMessage.property({ type: String })
|
|
22
23
|
public content?: string;
|
|
23
24
|
|
|
24
25
|
@SupportMessage.property({ type: Date })
|
package/src/entity.ts
CHANGED
|
@@ -85,6 +85,7 @@ interface ListOptions {
|
|
|
85
85
|
companyId?: number;
|
|
86
86
|
companySupplierId?: number;
|
|
87
87
|
componentId?: number;
|
|
88
|
+
conversationId?: number;
|
|
88
89
|
dateFrom?: Date;
|
|
89
90
|
dateTo?: Date;
|
|
90
91
|
domainRoles?: Role[];
|
|
@@ -615,6 +616,10 @@ export class Entity {
|
|
|
615
616
|
fetchOptions.query.push(['component_id',
|
|
616
617
|
options.componentId.toString()]);
|
|
617
618
|
}
|
|
619
|
+
if (options.conversationId !== undefined) {
|
|
620
|
+
fetchOptions.query.push(['conversation_id',
|
|
621
|
+
options.conversationId.toString()]);
|
|
622
|
+
}
|
|
618
623
|
if (options.groupBuyForJobId !== undefined) {
|
|
619
624
|
fetchOptions.query.push(['group_buy_for_job_id',
|
|
620
625
|
options.groupBuyForJobId.toString()]);
|