@d19n/youfibre-odin-sdk 1.0.326 → 1.0.327
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/README.md +2 -1
- package/dist/actions-v2/CreateTransactionalEmailDto.d.ts +91 -56
- package/dist/api-sdk-v2/EmailApi.d.ts +2 -0
- package/dist/api-sdk-v2/EmailApi.js +6 -0
- package/dist/api-sdk-v2/EmailSenderApi.d.ts +48 -0
- package/dist/api-sdk-v2/EmailSenderApi.js +155 -0
- package/dist/db-sdk-v2/EmailDb.d.ts +2 -0
- package/dist/db-sdk-v2/EmailDb.js +6 -0
- package/dist/db-sdk-v2/EmailSenderDb.d.ts +120 -0
- package/dist/db-sdk-v2/EmailSenderDb.js +204 -0
- package/dist/entities-v2/Email.d.ts +107 -1
- package/dist/entities-v2/Email.js +27 -1
- package/dist/entities-v2/EmailSender.d.ts +65 -0
- package/dist/entities-v2/EmailSender.js +55 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -124,7 +124,7 @@ await workOrder.completeWorkOrder({ ... });
|
|
|
124
124
|
|
|
125
125
|
## Entities
|
|
126
126
|
|
|
127
|
-
This SDK includes **
|
|
127
|
+
This SDK includes **160** entities across **12** modules.
|
|
128
128
|
|
|
129
129
|
### CrmModule
|
|
130
130
|
|
|
@@ -266,6 +266,7 @@ This SDK includes **159** entities across **12** modules.
|
|
|
266
266
|
| **Conversation** | Conversation Entity Definition | DEFAULT |
|
|
267
267
|
| **CustomerDeviceConfiguration** | CustomerDeviceConfiguration Entity Definition | DEFAULT |
|
|
268
268
|
| **Email** | Email Entity Definition | SUPPORT, TRANSACTIONAL |
|
|
269
|
+
| **EmailSender** | EmailSender Entity Definition | DEFAULT |
|
|
269
270
|
| **EmailTemplate** | EmailTemplate Entity Definition | DEFAULT |
|
|
270
271
|
| **Message** | Message Entity Definition | EVENT |
|
|
271
272
|
| **NotificationTemplate** | NotificationTemplate Entity Definition | DEFAULT |
|
|
@@ -23,7 +23,7 @@ export interface CreateTransactionalEmailMessage extends OdinRecordCreatedEvent<
|
|
|
23
23
|
* Properties for CreateTransactionalEmail action
|
|
24
24
|
*
|
|
25
25
|
* @property Required fields: 1
|
|
26
|
-
* @property Optional fields:
|
|
26
|
+
* @property Optional fields: 22
|
|
27
27
|
*/
|
|
28
28
|
export interface CreateTransactionalEmailProperties {
|
|
29
29
|
/**
|
|
@@ -35,40 +35,68 @@ export interface CreateTransactionalEmailProperties {
|
|
|
35
35
|
*/
|
|
36
36
|
Date: string;
|
|
37
37
|
/**
|
|
38
|
-
*
|
|
38
|
+
* Subject
|
|
39
39
|
*
|
|
40
40
|
* Data field for Email records. Used by Communications team.
|
|
41
|
-
* @type {
|
|
41
|
+
* @type {TEXT}
|
|
42
42
|
*/
|
|
43
|
-
|
|
43
|
+
Subject?: string | null;
|
|
44
44
|
/**
|
|
45
|
-
*
|
|
45
|
+
* FormattedMessage
|
|
46
46
|
*
|
|
47
|
-
*
|
|
48
|
-
* @type {
|
|
47
|
+
* Formatted Message (Communications - Email)
|
|
48
|
+
* @type {HTML}
|
|
49
49
|
*/
|
|
50
|
-
|
|
50
|
+
FormattedMessage?: string | null;
|
|
51
51
|
/**
|
|
52
|
-
*
|
|
52
|
+
* Cc
|
|
53
53
|
*
|
|
54
|
-
*
|
|
54
|
+
* Carbon Copy (Communications - Email)
|
|
55
55
|
* @type {TEXT}
|
|
56
56
|
*/
|
|
57
|
-
|
|
57
|
+
Cc?: string | null;
|
|
58
58
|
/**
|
|
59
|
-
*
|
|
59
|
+
* To
|
|
60
60
|
*
|
|
61
|
-
*
|
|
61
|
+
* Data field for Email records. Used by Communications team.
|
|
62
|
+
* @type {TEXT}
|
|
63
|
+
*/
|
|
64
|
+
To?: string | null;
|
|
65
|
+
/**
|
|
66
|
+
* InReplyTo
|
|
67
|
+
*
|
|
68
|
+
* In Reply To (Communications - Email)
|
|
69
|
+
* @type {TEXT}
|
|
70
|
+
*/
|
|
71
|
+
InReplyTo?: string | null;
|
|
72
|
+
/**
|
|
73
|
+
* Envelope
|
|
74
|
+
*
|
|
75
|
+
* Data field for Email records. Used by Communications team.
|
|
76
|
+
* @type {JSON}
|
|
77
|
+
*/
|
|
78
|
+
Envelope?: string | null;
|
|
79
|
+
/**
|
|
80
|
+
* CreatedAt
|
|
81
|
+
*
|
|
82
|
+
* When the email was created (Communications - Email)
|
|
62
83
|
* @type {DATE_TIME}
|
|
63
84
|
*/
|
|
64
|
-
|
|
85
|
+
CreatedAt?: string | null;
|
|
65
86
|
/**
|
|
66
|
-
*
|
|
87
|
+
* ParentMessageId
|
|
67
88
|
*
|
|
68
|
-
*
|
|
69
|
-
* @type {
|
|
89
|
+
* Parent Message id (Communications - Email)
|
|
90
|
+
* @type {LOOKUP}
|
|
70
91
|
*/
|
|
71
|
-
|
|
92
|
+
ParentMessageId?: string | null;
|
|
93
|
+
/**
|
|
94
|
+
* Message
|
|
95
|
+
*
|
|
96
|
+
* Data field for Email records. Used by Communications team.
|
|
97
|
+
* @type {TEXT}
|
|
98
|
+
*/
|
|
99
|
+
Message?: string | null;
|
|
72
100
|
/**
|
|
73
101
|
* From
|
|
74
102
|
*
|
|
@@ -76,6 +104,13 @@ export interface CreateTransactionalEmailProperties {
|
|
|
76
104
|
* @type {TEXT}
|
|
77
105
|
*/
|
|
78
106
|
From?: string | null;
|
|
107
|
+
/**
|
|
108
|
+
* Files
|
|
109
|
+
*
|
|
110
|
+
* email attachments (Communications - Email)
|
|
111
|
+
* @type {FILE_MULTIPLE}
|
|
112
|
+
*/
|
|
113
|
+
Files?: string | null;
|
|
79
114
|
/**
|
|
80
115
|
* MessageId
|
|
81
116
|
*
|
|
@@ -84,75 +119,75 @@ export interface CreateTransactionalEmailProperties {
|
|
|
84
119
|
*/
|
|
85
120
|
MessageId?: string | null;
|
|
86
121
|
/**
|
|
87
|
-
*
|
|
122
|
+
* UpdatedAt
|
|
88
123
|
*
|
|
89
|
-
*
|
|
90
|
-
* @type {
|
|
124
|
+
* When the email was updated (Communications - Email)
|
|
125
|
+
* @type {DATE_TIME}
|
|
91
126
|
*/
|
|
92
|
-
|
|
127
|
+
UpdatedAt?: string | null;
|
|
93
128
|
/**
|
|
94
|
-
*
|
|
129
|
+
* Bcc
|
|
95
130
|
*
|
|
96
|
-
*
|
|
97
|
-
* @type {
|
|
131
|
+
* Blind Carbon Copy (Communications - Email)
|
|
132
|
+
* @type {TEXT}
|
|
98
133
|
*/
|
|
99
|
-
|
|
134
|
+
Bcc?: string | null;
|
|
100
135
|
/**
|
|
101
|
-
*
|
|
136
|
+
* SenderType
|
|
102
137
|
*
|
|
103
|
-
*
|
|
104
|
-
* @type {
|
|
138
|
+
* Sender Type (Communications - Email)
|
|
139
|
+
* @type {ENUM}
|
|
105
140
|
*/
|
|
106
|
-
|
|
141
|
+
SenderType?: string | null;
|
|
107
142
|
/**
|
|
108
|
-
*
|
|
143
|
+
* Case
|
|
109
144
|
*
|
|
110
145
|
* Data field for Email records. Used by Communications team.
|
|
111
|
-
* @type {
|
|
146
|
+
* @type {LOOKUP}
|
|
112
147
|
*/
|
|
113
|
-
|
|
148
|
+
Case?: string | null;
|
|
114
149
|
/**
|
|
115
|
-
*
|
|
150
|
+
* Status
|
|
116
151
|
*
|
|
117
|
-
*
|
|
118
|
-
* @type {
|
|
152
|
+
* Status of the email in the process
|
|
153
|
+
* @type {ENUM}
|
|
119
154
|
*/
|
|
120
|
-
|
|
155
|
+
Status?: string | null;
|
|
121
156
|
/**
|
|
122
|
-
*
|
|
157
|
+
* DynamicData
|
|
123
158
|
*
|
|
124
|
-
* Data
|
|
125
|
-
* @type {
|
|
159
|
+
* Data will pass to emailing service (variables)
|
|
160
|
+
* @type {JSON}
|
|
126
161
|
*/
|
|
127
|
-
|
|
162
|
+
DynamicData?: string | null;
|
|
128
163
|
/**
|
|
129
|
-
*
|
|
164
|
+
* TemplateLabel
|
|
130
165
|
*
|
|
131
|
-
*
|
|
166
|
+
* The template label from email templates engine
|
|
132
167
|
* @type {TEXT}
|
|
133
168
|
*/
|
|
134
|
-
|
|
169
|
+
TemplateLabel?: string | null;
|
|
135
170
|
/**
|
|
136
|
-
*
|
|
171
|
+
* ContactId
|
|
137
172
|
*
|
|
138
|
-
*
|
|
139
|
-
* @type {
|
|
173
|
+
* The related Contact to send the email
|
|
174
|
+
* @type {LOOKUP}
|
|
140
175
|
*/
|
|
141
|
-
|
|
176
|
+
ContactId?: string | null;
|
|
142
177
|
/**
|
|
143
|
-
*
|
|
178
|
+
* EmailingService
|
|
144
179
|
*
|
|
145
|
-
*
|
|
146
|
-
* @type {
|
|
180
|
+
* The provider we use to send email (eg. Sendgrid)
|
|
181
|
+
* @type {ENUM}
|
|
147
182
|
*/
|
|
148
|
-
|
|
183
|
+
EmailingService?: string | null;
|
|
149
184
|
/**
|
|
150
|
-
*
|
|
185
|
+
* EmailSenderId
|
|
151
186
|
*
|
|
152
|
-
*
|
|
153
|
-
* @type {
|
|
187
|
+
* The Email Sender related entity
|
|
188
|
+
* @type {LOOKUP}
|
|
154
189
|
*/
|
|
155
|
-
|
|
190
|
+
EmailSenderId?: string | null;
|
|
156
191
|
}
|
|
157
192
|
/**
|
|
158
193
|
* CreateTransactionalEmail
|
|
@@ -22,12 +22,14 @@ export declare class EmailApi extends ApiProvider {
|
|
|
22
22
|
private _file?;
|
|
23
23
|
private _case?;
|
|
24
24
|
private _contact?;
|
|
25
|
+
private _emailsender?;
|
|
25
26
|
constructor(authParams?: OauthParams, authToken?: string);
|
|
26
27
|
get user(): ApiRecordLinkManager;
|
|
27
28
|
get email(): ApiRecordLinkManager;
|
|
28
29
|
get file(): ApiRecordLinkManager;
|
|
29
30
|
get case(): ApiRecordLinkManager;
|
|
30
31
|
get contact(): ApiRecordLinkManager;
|
|
32
|
+
get emailsender(): ApiRecordLinkManager;
|
|
31
33
|
setRecord(sourceRecord: any): void;
|
|
32
34
|
schema(): Promise<import("@d19n/odin-types/dist/core").OdinSchema>;
|
|
33
35
|
search(params: Partial<OdinSearchV2>): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").OdinSearchResponse<import("@d19n/odin-types/dist/core").OdinRecord<EmailProperties>>>;
|
|
@@ -63,6 +63,12 @@ class EmailApi extends api_provider_1.ApiProvider {
|
|
|
63
63
|
}
|
|
64
64
|
return this._contact;
|
|
65
65
|
}
|
|
66
|
+
get emailsender() {
|
|
67
|
+
if (!this._emailsender) {
|
|
68
|
+
this._emailsender = new api_record_link_manager_1.ApiRecordLinkManager(this.authParams, 'NotificationModule:Email', 'NotificationModule:EmailSender', 'Emai__EmailSender');
|
|
69
|
+
}
|
|
70
|
+
return this._emailsender;
|
|
71
|
+
}
|
|
66
72
|
// ============================================
|
|
67
73
|
// STANDARD METHODS (Unchanged API)
|
|
68
74
|
// ============================================
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { OauthParams } from '@d19n/odin-sdk-generator/dist/odin-sdk-types';
|
|
2
|
+
import { ApiProvider } from '@d19n/odin-sdk-generator/dist/api.provider';
|
|
3
|
+
import { OdinSearchV2, OdinRecordCreateDto, OdinRecordUpdateDto } from '@d19n/odin-types/dist/core';
|
|
4
|
+
import { ApiRecordLinkManager } from '@d19n/odin-sdk-generator/dist/api.record.link.manager';
|
|
5
|
+
import { EmailSenderProperties } from '../entities-v2/EmailSender';
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated Use OdinApiClient.
|
|
8
|
+
*
|
|
9
|
+
* Migration:
|
|
10
|
+
* - Old: new EmailSenderApi(authParams).get(id)
|
|
11
|
+
* - New: new odin.emailsender.get(id)
|
|
12
|
+
*
|
|
13
|
+
* The new OdinApiClient returns typed record wrappers with action methods.
|
|
14
|
+
*/
|
|
15
|
+
export declare class EmailSenderApi extends ApiProvider {
|
|
16
|
+
protected readonly authToken?: string;
|
|
17
|
+
private readonly moduleName;
|
|
18
|
+
private readonly entityName;
|
|
19
|
+
private sourceRecord;
|
|
20
|
+
private _email?;
|
|
21
|
+
constructor(authParams?: OauthParams, authToken?: string);
|
|
22
|
+
get email(): ApiRecordLinkManager;
|
|
23
|
+
setRecord(sourceRecord: any): void;
|
|
24
|
+
schema(): Promise<import("@d19n/odin-types/dist/core").OdinSchema>;
|
|
25
|
+
search(params: Partial<OdinSearchV2>): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").OdinSearchResponse<import("@d19n/odin-types/dist/core").OdinRecord<EmailSenderProperties>>>;
|
|
26
|
+
searchAndPaginate(params: Partial<OdinSearchV2>): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").OdinSearchResponse<import("@d19n/odin-types/dist/core").OdinRecord<EmailSenderProperties>>>;
|
|
27
|
+
reIndex(body: {
|
|
28
|
+
id: string;
|
|
29
|
+
schemaId: string;
|
|
30
|
+
}[]): Promise<any>;
|
|
31
|
+
get(emailSenderId: string): Promise<import("@d19n/odin-types/dist/core").OdinRecord<EmailSenderProperties>>;
|
|
32
|
+
getMany(emailSenderIds: string[]): Promise<import("@d19n/odin-types/dist/core").OdinRecord<EmailSenderProperties>[]>;
|
|
33
|
+
upsert(upsertDto: OdinRecordCreateDto): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").IDbRecordCreateUpdateRes>;
|
|
34
|
+
upsertMany(upsertDtos: OdinRecordCreateDto[]): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").IDbRecordCreateUpdateRes[]>;
|
|
35
|
+
update(updateDto: OdinRecordUpdateDto): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").IDbRecordCreateUpdateRes>;
|
|
36
|
+
updateMany(updateDtos: OdinRecordUpdateDto[]): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").IDbRecordCreateUpdateRes[]>;
|
|
37
|
+
delete(emailSenderId: string): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").OdinDeleteResponse[]>;
|
|
38
|
+
deleteMany(emailSenderIds: string[]): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").OdinDeleteResponse[]>;
|
|
39
|
+
restore(emailSenderIds: string[]): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").OdinRestoreResponse[]>;
|
|
40
|
+
applyAction(dto: any): Promise<any[]>;
|
|
41
|
+
bulkApplyActions(dtos: any[]): Promise<any[]>;
|
|
42
|
+
getVersions(): Promise<{
|
|
43
|
+
[key: string]: Record<string, any>;
|
|
44
|
+
}>;
|
|
45
|
+
getRevisionTimeline(): Promise<{
|
|
46
|
+
[key: string]: Record<string, any>[];
|
|
47
|
+
}>;
|
|
48
|
+
}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.EmailSenderApi = void 0;
|
|
13
|
+
const api_provider_1 = require("@d19n/odin-sdk-generator/dist/api.provider");
|
|
14
|
+
const api_record_link_manager_1 = require("@d19n/odin-sdk-generator/dist/api.record.link.manager");
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated Use OdinApiClient.
|
|
17
|
+
*
|
|
18
|
+
* Migration:
|
|
19
|
+
* - Old: new EmailSenderApi(authParams).get(id)
|
|
20
|
+
* - New: new odin.emailsender.get(id)
|
|
21
|
+
*
|
|
22
|
+
* The new OdinApiClient returns typed record wrappers with action methods.
|
|
23
|
+
*/
|
|
24
|
+
class EmailSenderApi extends api_provider_1.ApiProvider {
|
|
25
|
+
constructor(authParams, authToken) {
|
|
26
|
+
super(authParams, authToken);
|
|
27
|
+
this.authToken = authToken;
|
|
28
|
+
this.moduleName = 'NotificationModule';
|
|
29
|
+
this.entityName = 'EmailSender';
|
|
30
|
+
// Link managers are lazy-loaded on first access
|
|
31
|
+
}
|
|
32
|
+
// ============================================
|
|
33
|
+
// LAZY-LOADED LINK MANAGERS (Public Getters)
|
|
34
|
+
// ============================================
|
|
35
|
+
// Usage remains identical: api.address.list(recordId)
|
|
36
|
+
get email() {
|
|
37
|
+
if (!this._email) {
|
|
38
|
+
this._email = new api_record_link_manager_1.ApiRecordLinkManager(this.authParams, 'NotificationModule:EmailSender', 'NotificationModule:Email', 'Emai__EmailSender');
|
|
39
|
+
}
|
|
40
|
+
return this._email;
|
|
41
|
+
}
|
|
42
|
+
// ============================================
|
|
43
|
+
// STANDARD METHODS (Unchanged API)
|
|
44
|
+
// ============================================
|
|
45
|
+
setRecord(sourceRecord) {
|
|
46
|
+
this.sourceRecord = sourceRecord;
|
|
47
|
+
}
|
|
48
|
+
schema() {
|
|
49
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
50
|
+
return yield this.getSchema(this.moduleName, this.entityName);
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
// Use this function when you want to search and handle all pagination on your own
|
|
54
|
+
search(params) {
|
|
55
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
56
|
+
return yield this._searchRecords(this.moduleName, this.entityName, params);
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
// Use this function when you want paginating through the results to be handled
|
|
60
|
+
searchAndPaginate(params) {
|
|
61
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
62
|
+
return yield this._searchAllRecordsAndPaginate(this.moduleName, this.entityName, params);
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
// Use this function to re-index records in elastic search
|
|
66
|
+
reIndex(body) {
|
|
67
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
68
|
+
return yield this._reIndexRecords(body);
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
// Use this function when you want to return a single record
|
|
72
|
+
get(emailSenderId) {
|
|
73
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
74
|
+
const res = yield this._getByPrimaryKey(this.moduleName, this.entityName, emailSenderId);
|
|
75
|
+
if (res)
|
|
76
|
+
this.setRecord(res);
|
|
77
|
+
return res;
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
// Use this function when you want to return many records by primaryKeys
|
|
81
|
+
getMany(emailSenderIds) {
|
|
82
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
83
|
+
return yield this._getManyByPrimaryKey(this.moduleName, this.entityName, emailSenderIds);
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
// Use this function when you want to upsert one record
|
|
87
|
+
upsert(upsertDto) {
|
|
88
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
89
|
+
const res = yield this._upsert(this.moduleName, this.entityName, [upsertDto]);
|
|
90
|
+
return res[0];
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
// Use this function when you want to upsert many records
|
|
94
|
+
upsertMany(upsertDtos) {
|
|
95
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
96
|
+
return yield this._upsert(this.moduleName, this.entityName, upsertDtos);
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
// Use this function when you want to update one record
|
|
100
|
+
update(updateDto) {
|
|
101
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
102
|
+
const res = yield this._update(this.moduleName, this.entityName, [updateDto]);
|
|
103
|
+
return res[0];
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
// Use this function when you want to update many records
|
|
107
|
+
updateMany(updateDtos) {
|
|
108
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
109
|
+
return yield this._update(this.moduleName, this.entityName, updateDtos);
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
// Use this function when you want to delete one record
|
|
113
|
+
delete(emailSenderId) {
|
|
114
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
115
|
+
return yield this._delete(this.moduleName, this.entityName, [emailSenderId]);
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
// Use this function when you want to delete many records
|
|
119
|
+
deleteMany(emailSenderIds) {
|
|
120
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
121
|
+
return yield this._delete(this.moduleName, this.entityName, emailSenderIds);
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
// Use this function when you want to restore one or many records
|
|
125
|
+
restore(emailSenderIds) {
|
|
126
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
127
|
+
return yield this._restore(this.moduleName, this.entityName, emailSenderIds);
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
// Use this function when you want to apply a single action
|
|
131
|
+
applyAction(dto) {
|
|
132
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
133
|
+
return yield this._applyAction(this.moduleName, this.entityName, dto);
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
// Use this function when you want to bulk apply actions
|
|
137
|
+
bulkApplyActions(dtos) {
|
|
138
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
139
|
+
return yield this._bulkApplyActions(this.moduleName, this.entityName, dtos);
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
// Use this function when you want to return the versions for a single record
|
|
143
|
+
getVersions() {
|
|
144
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
145
|
+
return yield this._getVersions(this.moduleName, this.entityName, this.sourceRecord.id);
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
// Use this function when you want to return the change history for a single record
|
|
149
|
+
getRevisionTimeline() {
|
|
150
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
151
|
+
return yield this._getRevisionTimeline(this.moduleName, this.entityName, this.sourceRecord.id);
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
exports.EmailSenderApi = EmailSenderApi;
|
|
@@ -26,12 +26,14 @@ export declare class EmailDb extends DbProvider {
|
|
|
26
26
|
private _file?;
|
|
27
27
|
private _case?;
|
|
28
28
|
private _contact?;
|
|
29
|
+
private _emailsender?;
|
|
29
30
|
constructor(principal: any, dbService: any, defaultOptions?: DbProviderOptions);
|
|
30
31
|
get user(): DbRecordLinkManager;
|
|
31
32
|
get email(): DbRecordLinkManager;
|
|
32
33
|
get file(): DbRecordLinkManager;
|
|
33
34
|
get case(): DbRecordLinkManager;
|
|
34
35
|
get contact(): DbRecordLinkManager;
|
|
36
|
+
get emailsender(): DbRecordLinkManager;
|
|
35
37
|
setRecord(sourceRecord: any): void;
|
|
36
38
|
/**
|
|
37
39
|
* Search records with manual pagination control
|
|
@@ -68,6 +68,12 @@ class EmailDb extends db_provider_1.DbProvider {
|
|
|
68
68
|
}
|
|
69
69
|
return this._contact;
|
|
70
70
|
}
|
|
71
|
+
get emailsender() {
|
|
72
|
+
if (!this._emailsender) {
|
|
73
|
+
this._emailsender = new db_record_link_manager_1.DbRecordLinkManager(this.principal, this.dbService, 'NotificationModule:Email', 'NotificationModule:EmailSender', 'Emai__EmailSender');
|
|
74
|
+
}
|
|
75
|
+
return this._emailsender;
|
|
76
|
+
}
|
|
71
77
|
// ============================================
|
|
72
78
|
// STANDARD METHODS
|
|
73
79
|
// ============================================
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { DbProvider, DbProviderOptions, DbGetQueryOptions } from '@d19n/odin-sdk-generator/dist/db.provider';
|
|
2
|
+
import { OdinSearchV2, OdinRecordCreateDto, OdinRecordUpdateDto } from '@d19n/odin-types/dist/core';
|
|
3
|
+
import { DbRecordLinkManager } from '@d19n/odin-sdk-generator/dist/db.record.link.manager';
|
|
4
|
+
import { EmailSenderProperties } from '../entities-v2/EmailSender';
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated Use OdinDbClient.
|
|
7
|
+
*
|
|
8
|
+
* Migration:
|
|
9
|
+
* - Old: new EmailSenderApi(authParams).get(id)
|
|
10
|
+
* - New: new odin.emailsender.get(id)
|
|
11
|
+
*
|
|
12
|
+
* The new OdinDbClient returns typed record wrappers with action methods.
|
|
13
|
+
*
|
|
14
|
+
* Supports separate query options and provider options:
|
|
15
|
+
* - Constructor level: new EmailSenderDb(principal, dbService, { omitPermissionsCheck: true })
|
|
16
|
+
* - Method level: await db.getByPrimaryKey(id, { entities: [] }, { omitPermissionsCheck: true })
|
|
17
|
+
*/
|
|
18
|
+
export declare class EmailSenderDb extends DbProvider {
|
|
19
|
+
protected readonly principal: any;
|
|
20
|
+
protected readonly dbService: any;
|
|
21
|
+
private readonly moduleName;
|
|
22
|
+
private readonly entityName;
|
|
23
|
+
private sourceRecord;
|
|
24
|
+
private _email?;
|
|
25
|
+
constructor(principal: any, dbService: any, defaultOptions?: DbProviderOptions);
|
|
26
|
+
get email(): DbRecordLinkManager;
|
|
27
|
+
setRecord(sourceRecord: any): void;
|
|
28
|
+
/**
|
|
29
|
+
* Search records with manual pagination control
|
|
30
|
+
* @param params - Search parameters
|
|
31
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
32
|
+
*/
|
|
33
|
+
searchRecords(params: Partial<OdinSearchV2>, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core/interfaces/v2.db.interfaces").OdinSearchResponse<import("@d19n/odin-types/dist/core").OdinRecord<EmailSenderProperties>>>;
|
|
34
|
+
/**
|
|
35
|
+
* Search all records with automatic pagination
|
|
36
|
+
* @param params - Search parameters
|
|
37
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
38
|
+
*/
|
|
39
|
+
searchAllRecordsAndPaginate(params: Partial<OdinSearchV2>, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core/interfaces/v2.db.interfaces").OdinSearchResponse<import("@d19n/odin-types/dist/core").OdinRecord<EmailSenderProperties>>>;
|
|
40
|
+
/**
|
|
41
|
+
* Get a single record by primary key
|
|
42
|
+
* @param emailSenderId - Record ID
|
|
43
|
+
* @param queryOptions - Query options (WHAT: entities to include)
|
|
44
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* // Simple get
|
|
48
|
+
* const record = await db.getByPrimaryKey(id);
|
|
49
|
+
*
|
|
50
|
+
* // With related entities
|
|
51
|
+
* const record = await db.getByPrimaryKey(id, { entities: ['InvoiceItem', 'Transaction'] });
|
|
52
|
+
*
|
|
53
|
+
* // With permissions bypass
|
|
54
|
+
* const record = await db.getByPrimaryKey(id, {}, { omitPermissionsCheck: true });
|
|
55
|
+
*
|
|
56
|
+
* // Both options
|
|
57
|
+
* const record = await db.getByPrimaryKey(id, { entities: ['Invoice'] }, { omitPermissionsCheck: true });
|
|
58
|
+
*/
|
|
59
|
+
getByPrimaryKey(emailSenderId: string, queryOptions?: DbGetQueryOptions, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").OdinRecord<EmailSenderProperties>>;
|
|
60
|
+
/**
|
|
61
|
+
* Get multiple records by primary keys
|
|
62
|
+
* @param emailSenderIds - Array of record IDs
|
|
63
|
+
* @param queryOptions - Query options (WHAT: entities to include)
|
|
64
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
65
|
+
*/
|
|
66
|
+
getManyByPrimaryKey(emailSenderIds: string[], queryOptions?: DbGetQueryOptions, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").OdinRecord<EmailSenderProperties>[]>;
|
|
67
|
+
/**
|
|
68
|
+
* Upsert a single record
|
|
69
|
+
* @param upsertDto - Record to upsert
|
|
70
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
71
|
+
*/
|
|
72
|
+
upsert(upsertDto: OdinRecordCreateDto, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-sdk-generator").IDbRecordCreateUpdateRes>;
|
|
73
|
+
/**
|
|
74
|
+
* Upsert multiple records
|
|
75
|
+
* @param upsertDtos - Records to upsert
|
|
76
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
77
|
+
*/
|
|
78
|
+
upsertMany(upsertDtos: OdinRecordCreateDto[], providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-sdk-generator").IDbRecordCreateUpdateRes[]>;
|
|
79
|
+
/**
|
|
80
|
+
* Update a single record
|
|
81
|
+
* @param updateDto - Record to update
|
|
82
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
83
|
+
*/
|
|
84
|
+
update(updateDto: OdinRecordUpdateDto, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-sdk-generator").IDbRecordCreateUpdateRes>;
|
|
85
|
+
/**
|
|
86
|
+
* Update multiple records
|
|
87
|
+
* @param updateDtos - Records to update
|
|
88
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
89
|
+
*/
|
|
90
|
+
updateMany(updateDtos: OdinRecordUpdateDto[], providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-sdk-generator").IDbRecordCreateUpdateRes[]>;
|
|
91
|
+
/**
|
|
92
|
+
* Delete one or many records
|
|
93
|
+
* @param emailSenderIds - Record IDs to delete
|
|
94
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
95
|
+
*/
|
|
96
|
+
delete(emailSenderIds: string[], providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-sdk-generator").DbRecordDeleted[]>;
|
|
97
|
+
/**
|
|
98
|
+
* Restore one or many deleted records
|
|
99
|
+
* @param emailSenderIds - Record IDs to restore
|
|
100
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
101
|
+
*/
|
|
102
|
+
restore(emailSenderIds: string[], providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-sdk-generator").DbRecordRestored[]>;
|
|
103
|
+
/**
|
|
104
|
+
* Apply an action to a record
|
|
105
|
+
* @param actionName - The action key
|
|
106
|
+
* @param dto - The action DTO
|
|
107
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
108
|
+
*/
|
|
109
|
+
applyAction(actionName: string, dto: any, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-sdk-generator").IDbRecordCreateUpdateRes[]>;
|
|
110
|
+
/**
|
|
111
|
+
* Get version history for the current source record
|
|
112
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
113
|
+
*/
|
|
114
|
+
getVersions(providerOptions?: DbProviderOptions): Promise<any>;
|
|
115
|
+
/**
|
|
116
|
+
* Get revision timeline for the current source record
|
|
117
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
118
|
+
*/
|
|
119
|
+
getRevisionTimeline(providerOptions?: DbProviderOptions): Promise<any>;
|
|
120
|
+
}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.EmailSenderDb = void 0;
|
|
13
|
+
const db_provider_1 = require("@d19n/odin-sdk-generator/dist/db.provider");
|
|
14
|
+
const db_record_link_manager_1 = require("@d19n/odin-sdk-generator/dist/db.record.link.manager");
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated Use OdinDbClient.
|
|
17
|
+
*
|
|
18
|
+
* Migration:
|
|
19
|
+
* - Old: new EmailSenderApi(authParams).get(id)
|
|
20
|
+
* - New: new odin.emailsender.get(id)
|
|
21
|
+
*
|
|
22
|
+
* The new OdinDbClient returns typed record wrappers with action methods.
|
|
23
|
+
*
|
|
24
|
+
* Supports separate query options and provider options:
|
|
25
|
+
* - Constructor level: new EmailSenderDb(principal, dbService, { omitPermissionsCheck: true })
|
|
26
|
+
* - Method level: await db.getByPrimaryKey(id, { entities: [] }, { omitPermissionsCheck: true })
|
|
27
|
+
*/
|
|
28
|
+
class EmailSenderDb extends db_provider_1.DbProvider {
|
|
29
|
+
constructor(principal, dbService, defaultOptions) {
|
|
30
|
+
super(principal, dbService, defaultOptions);
|
|
31
|
+
this.moduleName = 'NotificationModule';
|
|
32
|
+
this.entityName = 'EmailSender';
|
|
33
|
+
this.principal = principal;
|
|
34
|
+
this.dbService = dbService;
|
|
35
|
+
// Link managers are lazy-loaded on first access
|
|
36
|
+
}
|
|
37
|
+
// ============================================
|
|
38
|
+
// LAZY-LOADED LINK MANAGERS (Public Getters)
|
|
39
|
+
// ============================================
|
|
40
|
+
// Usage remains identical: db.address.list(recordId)
|
|
41
|
+
get email() {
|
|
42
|
+
if (!this._email) {
|
|
43
|
+
this._email = new db_record_link_manager_1.DbRecordLinkManager(this.principal, this.dbService, 'NotificationModule:EmailSender', 'NotificationModule:Email', 'Emai__EmailSender');
|
|
44
|
+
}
|
|
45
|
+
return this._email;
|
|
46
|
+
}
|
|
47
|
+
// ============================================
|
|
48
|
+
// STANDARD METHODS
|
|
49
|
+
// ============================================
|
|
50
|
+
// Methods support separate query options and provider options for clean API
|
|
51
|
+
setRecord(sourceRecord) {
|
|
52
|
+
this.sourceRecord = sourceRecord;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Search records with manual pagination control
|
|
56
|
+
* @param params - Search parameters
|
|
57
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
58
|
+
*/
|
|
59
|
+
searchRecords(params, providerOptions) {
|
|
60
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
61
|
+
return yield this._searchRecords(this.moduleName, this.entityName, params, providerOptions);
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Search all records with automatic pagination
|
|
66
|
+
* @param params - Search parameters
|
|
67
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
68
|
+
*/
|
|
69
|
+
searchAllRecordsAndPaginate(params, providerOptions) {
|
|
70
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
71
|
+
return yield this._searchAllRecordsAndPaginate(this.moduleName, this.entityName, params, 0, providerOptions);
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Get a single record by primary key
|
|
76
|
+
* @param emailSenderId - Record ID
|
|
77
|
+
* @param queryOptions - Query options (WHAT: entities to include)
|
|
78
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* // Simple get
|
|
82
|
+
* const record = await db.getByPrimaryKey(id);
|
|
83
|
+
*
|
|
84
|
+
* // With related entities
|
|
85
|
+
* const record = await db.getByPrimaryKey(id, { entities: ['InvoiceItem', 'Transaction'] });
|
|
86
|
+
*
|
|
87
|
+
* // With permissions bypass
|
|
88
|
+
* const record = await db.getByPrimaryKey(id, {}, { omitPermissionsCheck: true });
|
|
89
|
+
*
|
|
90
|
+
* // Both options
|
|
91
|
+
* const record = await db.getByPrimaryKey(id, { entities: ['Invoice'] }, { omitPermissionsCheck: true });
|
|
92
|
+
*/
|
|
93
|
+
getByPrimaryKey(emailSenderId, queryOptions, providerOptions) {
|
|
94
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
95
|
+
const res = yield this._getByPrimaryKey(this.moduleName, this.entityName, emailSenderId, queryOptions, providerOptions);
|
|
96
|
+
if (res)
|
|
97
|
+
this.setRecord(res);
|
|
98
|
+
return res;
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Get multiple records by primary keys
|
|
103
|
+
* @param emailSenderIds - Array of record IDs
|
|
104
|
+
* @param queryOptions - Query options (WHAT: entities to include)
|
|
105
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
106
|
+
*/
|
|
107
|
+
getManyByPrimaryKey(emailSenderIds, queryOptions, providerOptions) {
|
|
108
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
109
|
+
return yield this._getManyByPrimaryKey(this.moduleName, this.entityName, emailSenderIds, queryOptions, providerOptions);
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Upsert a single record
|
|
114
|
+
* @param upsertDto - Record to upsert
|
|
115
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
116
|
+
*/
|
|
117
|
+
upsert(upsertDto, providerOptions) {
|
|
118
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
119
|
+
const res = yield this._upsert(this.moduleName, this.entityName, [upsertDto], providerOptions);
|
|
120
|
+
return res[0];
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Upsert multiple records
|
|
125
|
+
* @param upsertDtos - Records to upsert
|
|
126
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
127
|
+
*/
|
|
128
|
+
upsertMany(upsertDtos, providerOptions) {
|
|
129
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
130
|
+
return yield this._upsert(this.moduleName, this.entityName, upsertDtos, providerOptions);
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Update a single record
|
|
135
|
+
* @param updateDto - Record to update
|
|
136
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
137
|
+
*/
|
|
138
|
+
update(updateDto, providerOptions) {
|
|
139
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
140
|
+
const res = yield this._update(this.moduleName, this.entityName, [updateDto], providerOptions);
|
|
141
|
+
return res[0];
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Update multiple records
|
|
146
|
+
* @param updateDtos - Records to update
|
|
147
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
148
|
+
*/
|
|
149
|
+
updateMany(updateDtos, providerOptions) {
|
|
150
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
151
|
+
return yield this._update(this.moduleName, this.entityName, updateDtos, providerOptions);
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Delete one or many records
|
|
156
|
+
* @param emailSenderIds - Record IDs to delete
|
|
157
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
158
|
+
*/
|
|
159
|
+
delete(emailSenderIds, providerOptions) {
|
|
160
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
161
|
+
return yield this._delete(this.moduleName, this.entityName, emailSenderIds, providerOptions);
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Restore one or many deleted records
|
|
166
|
+
* @param emailSenderIds - Record IDs to restore
|
|
167
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
168
|
+
*/
|
|
169
|
+
restore(emailSenderIds, providerOptions) {
|
|
170
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
171
|
+
return yield this._restore(this.moduleName, this.entityName, emailSenderIds, providerOptions);
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Apply an action to a record
|
|
176
|
+
* @param actionName - The action key
|
|
177
|
+
* @param dto - The action DTO
|
|
178
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
179
|
+
*/
|
|
180
|
+
applyAction(actionName, dto, providerOptions) {
|
|
181
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
182
|
+
return yield this._applyAction(this.moduleName, this.entityName, dto, providerOptions);
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Get version history for the current source record
|
|
187
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
188
|
+
*/
|
|
189
|
+
getVersions(providerOptions) {
|
|
190
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
191
|
+
return yield this._getVersions(this.moduleName, this.entityName, this.sourceRecord.id, providerOptions);
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Get revision timeline for the current source record
|
|
196
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
197
|
+
*/
|
|
198
|
+
getRevisionTimeline(providerOptions) {
|
|
199
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
200
|
+
return yield this._getRevisionTimeline(this.moduleName, this.entityName, this.sourceRecord.id, providerOptions);
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
exports.EmailSenderDb = EmailSenderDb;
|
|
@@ -15,6 +15,7 @@ import { UserProperties } from './User';
|
|
|
15
15
|
import { FileProperties } from './File';
|
|
16
16
|
import { CaseProperties } from './Case';
|
|
17
17
|
import { ContactProperties } from './Contact';
|
|
18
|
+
import { EmailSenderProperties } from './EmailSender';
|
|
18
19
|
/**
|
|
19
20
|
* Available types for Email records
|
|
20
21
|
*/
|
|
@@ -58,6 +59,17 @@ export declare enum EmailStatus {
|
|
|
58
59
|
SENDING = "SENDING",
|
|
59
60
|
SUCCESS = "SUCCESS"
|
|
60
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* Valid values for Email.EmailingService
|
|
64
|
+
*
|
|
65
|
+
* The provider we use to send email (eg. Sendgrid)
|
|
66
|
+
*
|
|
67
|
+
* @remarks Available options:
|
|
68
|
+
* - `SENDGRID` - Sendgrid
|
|
69
|
+
*/
|
|
70
|
+
export declare enum EmailEmailingService {
|
|
71
|
+
SENDGRID = "SENDGRID"
|
|
72
|
+
}
|
|
61
73
|
/**
|
|
62
74
|
* Property keys for Email
|
|
63
75
|
* Use these constants instead of string literals for type safety
|
|
@@ -98,7 +110,17 @@ export declare enum EmailPropertyKeys {
|
|
|
98
110
|
/** Data field for Email records. Used by Communications team. */
|
|
99
111
|
Case = "Case",
|
|
100
112
|
/** Status of the email in the process */
|
|
101
|
-
Status = "Status"
|
|
113
|
+
Status = "Status",
|
|
114
|
+
/** Data will pass to emailing service (variables) */
|
|
115
|
+
DynamicData = "DynamicData",
|
|
116
|
+
/** The template label from email templates engine */
|
|
117
|
+
TemplateLabel = "TemplateLabel",
|
|
118
|
+
/** The related Contact to send the email */
|
|
119
|
+
ContactId = "ContactId",
|
|
120
|
+
/** The provider we use to send email (eg. Sendgrid) */
|
|
121
|
+
EmailingService = "EmailingService",
|
|
122
|
+
/** The Email Sender related entity */
|
|
123
|
+
EmailSenderId = "EmailSenderId"
|
|
102
124
|
}
|
|
103
125
|
/**
|
|
104
126
|
* Properties for Email records
|
|
@@ -200,6 +222,32 @@ export interface EmailProperties {
|
|
|
200
222
|
* @enum {EmailStatus}
|
|
201
223
|
*/
|
|
202
224
|
Status: EmailStatus;
|
|
225
|
+
/** Data will pass to emailing service (variables)
|
|
226
|
+
*
|
|
227
|
+
* @type {JSON}
|
|
228
|
+
*/
|
|
229
|
+
DynamicData: string;
|
|
230
|
+
/** The template label from email templates engine
|
|
231
|
+
*
|
|
232
|
+
* @type {TEXT}
|
|
233
|
+
*/
|
|
234
|
+
TemplateLabel: string;
|
|
235
|
+
/** The related Contact to send the email
|
|
236
|
+
*
|
|
237
|
+
* @type {LOOKUP}
|
|
238
|
+
*/
|
|
239
|
+
ContactId: string;
|
|
240
|
+
/** The provider we use to send email (eg. Sendgrid)
|
|
241
|
+
*
|
|
242
|
+
* @type {ENUM}
|
|
243
|
+
* @enum {EmailEmailingService}
|
|
244
|
+
*/
|
|
245
|
+
EmailingService: EmailEmailingService;
|
|
246
|
+
/** The Email Sender related entity
|
|
247
|
+
*
|
|
248
|
+
* @type {LOOKUP}
|
|
249
|
+
*/
|
|
250
|
+
EmailSenderId: string;
|
|
203
251
|
}
|
|
204
252
|
/**
|
|
205
253
|
* Properties for SUPPORT Email records
|
|
@@ -301,6 +349,32 @@ export interface SupportEmailProperties {
|
|
|
301
349
|
* @enum {EmailStatus}
|
|
302
350
|
*/
|
|
303
351
|
Status: EmailStatus;
|
|
352
|
+
/** Data will pass to emailing service (variables)
|
|
353
|
+
*
|
|
354
|
+
* @type {JSON}
|
|
355
|
+
*/
|
|
356
|
+
DynamicData: string;
|
|
357
|
+
/** The template label from email templates engine
|
|
358
|
+
*
|
|
359
|
+
* @type {TEXT}
|
|
360
|
+
*/
|
|
361
|
+
TemplateLabel: string;
|
|
362
|
+
/** The related Contact to send the email
|
|
363
|
+
*
|
|
364
|
+
* @type {LOOKUP}
|
|
365
|
+
*/
|
|
366
|
+
ContactId: string;
|
|
367
|
+
/** The provider we use to send email (eg. Sendgrid)
|
|
368
|
+
*
|
|
369
|
+
* @type {ENUM}
|
|
370
|
+
* @enum {EmailEmailingService}
|
|
371
|
+
*/
|
|
372
|
+
EmailingService: EmailEmailingService;
|
|
373
|
+
/** The Email Sender related entity
|
|
374
|
+
*
|
|
375
|
+
* @type {LOOKUP}
|
|
376
|
+
*/
|
|
377
|
+
EmailSenderId: string;
|
|
304
378
|
}
|
|
305
379
|
/**
|
|
306
380
|
* Properties for TRANSACTIONAL Email records
|
|
@@ -402,6 +476,32 @@ export interface TransactionalEmailProperties {
|
|
|
402
476
|
* @enum {EmailStatus}
|
|
403
477
|
*/
|
|
404
478
|
Status: EmailStatus;
|
|
479
|
+
/** Data will pass to emailing service (variables)
|
|
480
|
+
*
|
|
481
|
+
* @type {JSON}
|
|
482
|
+
*/
|
|
483
|
+
DynamicData: string;
|
|
484
|
+
/** The template label from email templates engine
|
|
485
|
+
*
|
|
486
|
+
* @type {TEXT}
|
|
487
|
+
*/
|
|
488
|
+
TemplateLabel: string;
|
|
489
|
+
/** The related Contact to send the email
|
|
490
|
+
*
|
|
491
|
+
* @type {LOOKUP}
|
|
492
|
+
*/
|
|
493
|
+
ContactId: string;
|
|
494
|
+
/** The provider we use to send email (eg. Sendgrid)
|
|
495
|
+
*
|
|
496
|
+
* @type {ENUM}
|
|
497
|
+
* @enum {EmailEmailingService}
|
|
498
|
+
*/
|
|
499
|
+
EmailingService: EmailEmailingService;
|
|
500
|
+
/** The Email Sender related entity
|
|
501
|
+
*
|
|
502
|
+
* @type {LOOKUP}
|
|
503
|
+
*/
|
|
504
|
+
EmailSenderId: string;
|
|
405
505
|
}
|
|
406
506
|
/**
|
|
407
507
|
* Email entity from NotificationModule
|
|
@@ -428,6 +528,8 @@ export declare class Email extends OdinRecord<EmailProperties> {
|
|
|
428
528
|
Case: OdinLink<LinkedOdinRecord<CaseProperties>>;
|
|
429
529
|
/** Linked Contact records (Email_Contact) */
|
|
430
530
|
Contact: OdinLink<LinkedOdinRecord<ContactProperties>>;
|
|
531
|
+
/** Linked EmailSender records (Emai__EmailSender) */
|
|
532
|
+
EmailSender: OdinLink<LinkedOdinRecord<EmailSenderProperties>>;
|
|
431
533
|
}
|
|
432
534
|
/**
|
|
433
535
|
* RabbitMQ routing keys for Email events
|
|
@@ -451,3 +553,7 @@ export declare const ROUTING_KEY_LINK_ATTACHMENTS_DELETED = "NotificationModule.
|
|
|
451
553
|
export declare const ROUTING_KEY_LINK_EMAIL_CONTACT_CREATED = "NotificationModule.Email.Contact.SubDbRecordAssociationCreated";
|
|
452
554
|
/** Event: Email_Contact link deleted */
|
|
453
555
|
export declare const ROUTING_KEY_LINK_EMAIL_CONTACT_DELETED = "NotificationModule.Email.Contact.SubDbRecordAssociationDeleted";
|
|
556
|
+
/** Event: Emai__EmailSender link created */
|
|
557
|
+
export declare const ROUTING_KEY_LINK_EMAI_EMAIL_SENDER_CREATED = "NotificationModule.Email.EmailSender.SubDbRecordAssociationCreated";
|
|
558
|
+
/** Event: Emai__EmailSender link deleted */
|
|
559
|
+
export declare const ROUTING_KEY_LINK_EMAI_EMAIL_SENDER_DELETED = "NotificationModule.Email.EmailSender.SubDbRecordAssociationDeleted";
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* Generated from Odin schema definition
|
|
13
13
|
*/
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.ROUTING_KEY_LINK_EMAIL_CONTACT_DELETED = exports.ROUTING_KEY_LINK_EMAIL_CONTACT_CREATED = exports.ROUTING_KEY_LINK_ATTACHMENTS_DELETED = exports.ROUTING_KEY_LINK_ATTACHMENTS_CREATED = exports.ROUTING_KEY_LINK_EMAIL_EMAIL_DELETED = exports.ROUTING_KEY_LINK_EMAIL_EMAIL_CREATED = exports.ROUTING_KEY_LINK_EMAIL_USER_DELETED = exports.ROUTING_KEY_LINK_EMAIL_USER_CREATED = exports.ROUTING_KEY_EMAIL_DELETED = exports.ROUTING_KEY_EMAIL_UPDATED = exports.ROUTING_KEY_EMAIL_CREATED = exports.Email = exports.EmailPropertyKeys = exports.EmailStatus = exports.EmailSenderType = exports.EmailEntityTypes = void 0;
|
|
15
|
+
exports.ROUTING_KEY_LINK_EMAI_EMAIL_SENDER_DELETED = exports.ROUTING_KEY_LINK_EMAI_EMAIL_SENDER_CREATED = exports.ROUTING_KEY_LINK_EMAIL_CONTACT_DELETED = exports.ROUTING_KEY_LINK_EMAIL_CONTACT_CREATED = exports.ROUTING_KEY_LINK_ATTACHMENTS_DELETED = exports.ROUTING_KEY_LINK_ATTACHMENTS_CREATED = exports.ROUTING_KEY_LINK_EMAIL_EMAIL_DELETED = exports.ROUTING_KEY_LINK_EMAIL_EMAIL_CREATED = exports.ROUTING_KEY_LINK_EMAIL_USER_DELETED = exports.ROUTING_KEY_LINK_EMAIL_USER_CREATED = exports.ROUTING_KEY_EMAIL_DELETED = exports.ROUTING_KEY_EMAIL_UPDATED = exports.ROUTING_KEY_EMAIL_CREATED = exports.Email = exports.EmailPropertyKeys = exports.EmailEmailingService = exports.EmailStatus = exports.EmailSenderType = exports.EmailEntityTypes = void 0;
|
|
16
16
|
const core_1 = require("@d19n/odin-types/dist/core");
|
|
17
17
|
/**
|
|
18
18
|
* Available types for Email records
|
|
@@ -60,6 +60,18 @@ var EmailStatus;
|
|
|
60
60
|
EmailStatus["SENDING"] = "SENDING";
|
|
61
61
|
EmailStatus["SUCCESS"] = "SUCCESS";
|
|
62
62
|
})(EmailStatus = exports.EmailStatus || (exports.EmailStatus = {}));
|
|
63
|
+
/**
|
|
64
|
+
* Valid values for Email.EmailingService
|
|
65
|
+
*
|
|
66
|
+
* The provider we use to send email (eg. Sendgrid)
|
|
67
|
+
*
|
|
68
|
+
* @remarks Available options:
|
|
69
|
+
* - `SENDGRID` - Sendgrid
|
|
70
|
+
*/
|
|
71
|
+
var EmailEmailingService;
|
|
72
|
+
(function (EmailEmailingService) {
|
|
73
|
+
EmailEmailingService["SENDGRID"] = "SENDGRID";
|
|
74
|
+
})(EmailEmailingService = exports.EmailEmailingService || (exports.EmailEmailingService = {}));
|
|
63
75
|
/**
|
|
64
76
|
* Property keys for Email
|
|
65
77
|
* Use these constants instead of string literals for type safety
|
|
@@ -102,6 +114,16 @@ var EmailPropertyKeys;
|
|
|
102
114
|
EmailPropertyKeys["Case"] = "Case";
|
|
103
115
|
/** Status of the email in the process */
|
|
104
116
|
EmailPropertyKeys["Status"] = "Status";
|
|
117
|
+
/** Data will pass to emailing service (variables) */
|
|
118
|
+
EmailPropertyKeys["DynamicData"] = "DynamicData";
|
|
119
|
+
/** The template label from email templates engine */
|
|
120
|
+
EmailPropertyKeys["TemplateLabel"] = "TemplateLabel";
|
|
121
|
+
/** The related Contact to send the email */
|
|
122
|
+
EmailPropertyKeys["ContactId"] = "ContactId";
|
|
123
|
+
/** The provider we use to send email (eg. Sendgrid) */
|
|
124
|
+
EmailPropertyKeys["EmailingService"] = "EmailingService";
|
|
125
|
+
/** The Email Sender related entity */
|
|
126
|
+
EmailPropertyKeys["EmailSenderId"] = "EmailSenderId";
|
|
105
127
|
})(EmailPropertyKeys = exports.EmailPropertyKeys || (exports.EmailPropertyKeys = {}));
|
|
106
128
|
/**
|
|
107
129
|
* Email entity from NotificationModule
|
|
@@ -141,3 +163,7 @@ exports.ROUTING_KEY_LINK_ATTACHMENTS_DELETED = 'NotificationModule.Email.File.Su
|
|
|
141
163
|
exports.ROUTING_KEY_LINK_EMAIL_CONTACT_CREATED = 'NotificationModule.Email.Contact.SubDbRecordAssociationCreated';
|
|
142
164
|
/** Event: Email_Contact link deleted */
|
|
143
165
|
exports.ROUTING_KEY_LINK_EMAIL_CONTACT_DELETED = 'NotificationModule.Email.Contact.SubDbRecordAssociationDeleted';
|
|
166
|
+
/** Event: Emai__EmailSender link created */
|
|
167
|
+
exports.ROUTING_KEY_LINK_EMAI_EMAIL_SENDER_CREATED = 'NotificationModule.Email.EmailSender.SubDbRecordAssociationCreated';
|
|
168
|
+
/** Event: Emai__EmailSender link deleted */
|
|
169
|
+
exports.ROUTING_KEY_LINK_EMAI_EMAIL_SENDER_DELETED = 'NotificationModule.Email.EmailSender.SubDbRecordAssociationDeleted';
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EmailSender Entity Definition
|
|
3
|
+
*
|
|
4
|
+
* List of email we use to send emails
|
|
5
|
+
*
|
|
6
|
+
* @module NotificationModule
|
|
7
|
+
* @entity EmailSender
|
|
8
|
+
* @schemaId be5ed5ff-9c9d-410c-b636-f9fd92b8c7f8
|
|
9
|
+
*
|
|
10
|
+
* AUTO-GENERATED - DO NOT EDIT DIRECTLY
|
|
11
|
+
* Generated from Odin schema definition
|
|
12
|
+
*/
|
|
13
|
+
import { OdinRecord, OdinLink, LinkedOdinRecord } from '@d19n/odin-types/dist/core';
|
|
14
|
+
import { EmailProperties } from './Email';
|
|
15
|
+
/**
|
|
16
|
+
* Available types for EmailSender records
|
|
17
|
+
*/
|
|
18
|
+
export declare enum EmailSenderEntityTypes {
|
|
19
|
+
/** This is the default record type */
|
|
20
|
+
DEFAULT = "DEFAULT"
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Property keys for EmailSender
|
|
24
|
+
* Use these constants instead of string literals for type safety
|
|
25
|
+
*/
|
|
26
|
+
export declare enum EmailSenderPropertyKeys {
|
|
27
|
+
/** The email Address that send the email */
|
|
28
|
+
EmailAddress = "EmailAddress"
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Properties for EmailSender records
|
|
32
|
+
*
|
|
33
|
+
* @see NotificationModule:EmailSender
|
|
34
|
+
*/
|
|
35
|
+
export interface EmailSenderProperties {
|
|
36
|
+
/** The email Address that send the email
|
|
37
|
+
*
|
|
38
|
+
* @type {TEXT}
|
|
39
|
+
*/
|
|
40
|
+
EmailAddress: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* EmailSender entity from NotificationModule
|
|
44
|
+
*
|
|
45
|
+
* List of email we use to send emails
|
|
46
|
+
*
|
|
47
|
+
* @module NotificationModule
|
|
48
|
+
* @entity EmailSender
|
|
49
|
+
* @schemaId be5ed5ff-9c9d-410c-b636-f9fd92b8c7f8
|
|
50
|
+
* @capabilities searchable, updateable, undeletable, triggerable
|
|
51
|
+
*/
|
|
52
|
+
export declare class EmailSender extends OdinRecord<EmailSenderProperties> {
|
|
53
|
+
entity: 'NotificationModule:EmailSender';
|
|
54
|
+
type: EmailSenderEntityTypes;
|
|
55
|
+
schemaId: 'be5ed5ff-9c9d-410c-b636-f9fd92b8c7f8';
|
|
56
|
+
properties: EmailSenderProperties;
|
|
57
|
+
/** Linked Email records (Emai__EmailSender) */
|
|
58
|
+
Email: OdinLink<LinkedOdinRecord<EmailProperties>>;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* RabbitMQ routing keys for EmailSender events
|
|
62
|
+
*/
|
|
63
|
+
export declare const ROUTING_KEY_EMAIL_SENDER_CREATED = "NotificationModule.EmailSender.SubDbRecordCreated";
|
|
64
|
+
export declare const ROUTING_KEY_EMAIL_SENDER_UPDATED = "NotificationModule.EmailSender.SubDbRecordUpdated";
|
|
65
|
+
export declare const ROUTING_KEY_EMAIL_SENDER_DELETED = "NotificationModule.EmailSender.SubDbRecordDeleted";
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* EmailSender Entity Definition
|
|
4
|
+
*
|
|
5
|
+
* List of email we use to send emails
|
|
6
|
+
*
|
|
7
|
+
* @module NotificationModule
|
|
8
|
+
* @entity EmailSender
|
|
9
|
+
* @schemaId be5ed5ff-9c9d-410c-b636-f9fd92b8c7f8
|
|
10
|
+
*
|
|
11
|
+
* AUTO-GENERATED - DO NOT EDIT DIRECTLY
|
|
12
|
+
* Generated from Odin schema definition
|
|
13
|
+
*/
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.ROUTING_KEY_EMAIL_SENDER_DELETED = exports.ROUTING_KEY_EMAIL_SENDER_UPDATED = exports.ROUTING_KEY_EMAIL_SENDER_CREATED = exports.EmailSender = exports.EmailSenderPropertyKeys = exports.EmailSenderEntityTypes = void 0;
|
|
16
|
+
const core_1 = require("@d19n/odin-types/dist/core");
|
|
17
|
+
/**
|
|
18
|
+
* Available types for EmailSender records
|
|
19
|
+
*/
|
|
20
|
+
var EmailSenderEntityTypes;
|
|
21
|
+
(function (EmailSenderEntityTypes) {
|
|
22
|
+
/** This is the default record type */
|
|
23
|
+
EmailSenderEntityTypes["DEFAULT"] = "DEFAULT";
|
|
24
|
+
})(EmailSenderEntityTypes = exports.EmailSenderEntityTypes || (exports.EmailSenderEntityTypes = {}));
|
|
25
|
+
/**
|
|
26
|
+
* Property keys for EmailSender
|
|
27
|
+
* Use these constants instead of string literals for type safety
|
|
28
|
+
*/
|
|
29
|
+
var EmailSenderPropertyKeys;
|
|
30
|
+
(function (EmailSenderPropertyKeys) {
|
|
31
|
+
/** The email Address that send the email */
|
|
32
|
+
EmailSenderPropertyKeys["EmailAddress"] = "EmailAddress";
|
|
33
|
+
})(EmailSenderPropertyKeys = exports.EmailSenderPropertyKeys || (exports.EmailSenderPropertyKeys = {}));
|
|
34
|
+
/**
|
|
35
|
+
* EmailSender entity from NotificationModule
|
|
36
|
+
*
|
|
37
|
+
* List of email we use to send emails
|
|
38
|
+
*
|
|
39
|
+
* @module NotificationModule
|
|
40
|
+
* @entity EmailSender
|
|
41
|
+
* @schemaId be5ed5ff-9c9d-410c-b636-f9fd92b8c7f8
|
|
42
|
+
* @capabilities searchable, updateable, undeletable, triggerable
|
|
43
|
+
*/
|
|
44
|
+
class EmailSender extends core_1.OdinRecord {
|
|
45
|
+
}
|
|
46
|
+
exports.EmailSender = EmailSender;
|
|
47
|
+
// ============================================
|
|
48
|
+
// RABBITMQ EVENT ROUTING KEYS
|
|
49
|
+
// ============================================
|
|
50
|
+
/**
|
|
51
|
+
* RabbitMQ routing keys for EmailSender events
|
|
52
|
+
*/
|
|
53
|
+
exports.ROUTING_KEY_EMAIL_SENDER_CREATED = 'NotificationModule.EmailSender.SubDbRecordCreated';
|
|
54
|
+
exports.ROUTING_KEY_EMAIL_SENDER_UPDATED = 'NotificationModule.EmailSender.SubDbRecordUpdated';
|
|
55
|
+
exports.ROUTING_KEY_EMAIL_SENDER_DELETED = 'NotificationModule.EmailSender.SubDbRecordDeleted';
|