@d19n/youfibre-odin-sdk 2.0.84 → 2.0.85
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 +7 -1
- package/dist/EntityRegistry.d.ts +2 -0
- package/dist/EntityRegistry.js +2 -0
- package/dist/OdinApiClient.d.ts +4 -0
- package/dist/OdinApiClient.js +8 -0
- package/dist/OdinDbClient.d.ts +4 -0
- package/dist/OdinDbClient.js +8 -0
- package/dist/accessors-v2/ContactIdentityAccessor.d.ts +111 -0
- package/dist/accessors-v2/ContactIdentityAccessor.js +190 -0
- package/dist/accessors-v2/index.d.ts +1 -0
- package/dist/accessors-v2/index.js +5 -3
- package/dist/actions-v2/AddressUpdateDto.d.ts +8 -1
- package/dist/actions-v2/CreateContactIdentityDto.d.ts +58 -0
- package/dist/actions-v2/CreateContactIdentityDto.js +54 -0
- package/dist/db-accessors-v2/ContactIdentityDbAccessor.d.ts +149 -0
- package/dist/db-accessors-v2/ContactIdentityDbAccessor.js +227 -0
- package/dist/db-accessors-v2/index.d.ts +1 -0
- package/dist/db-accessors-v2/index.js +5 -3
- package/dist/db-sdk-v2/FileDb.d.ts +122 -122
- package/dist/db-sdk-v2/FileDb.js +248 -248
- package/dist/entities-v2/File.d.ts +6 -0
- package/dist/entities-v2/File.js +5 -1
- package/dist/entities-v2/PgDirectDebitFile.d.ts +6 -2
- package/dist/entities-v2/PgDirectDebitFile.js +4 -0
- package/dist/records-v2/ContactIdentityRecord.d.ts +244 -0
- package/dist/records-v2/ContactIdentityRecord.js +357 -0
- package/dist/records-v2/ContactRecord.d.ts +20 -0
- package/dist/records-v2/ContactRecord.js +33 -0
- package/dist/records-v2/OrderRecord.d.ts +20 -0
- package/dist/records-v2/OrderRecord.js +33 -0
- package/dist/records-v2/PaymentMethodRecord.d.ts +20 -0
- package/dist/records-v2/PaymentMethodRecord.js +33 -0
- package/dist/records-v2/index.d.ts +1 -0
- package/dist/records-v2/index.js +6 -3
- package/package.json +3 -3
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* ContactIdentity Record Wrapper
|
|
4
|
+
*
|
|
5
|
+
* Provides typed action methods and link management.
|
|
6
|
+
* Works with both ApiProvider and DbProvider.
|
|
7
|
+
*
|
|
8
|
+
* All action methods return an ActionBuilder or FlowBuilder.
|
|
9
|
+
* Call .execute() to run or .dryRun() to get the payload for debugging.
|
|
10
|
+
*
|
|
11
|
+
* Can be instantiated with null record for create operations:
|
|
12
|
+
* ```typescript
|
|
13
|
+
* const record = odinClient.contactIdentitys.new();
|
|
14
|
+
* await record.createContactIdentity({ ... }).execute();
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* AUTO-GENERATED - DO NOT EDIT DIRECTLY
|
|
18
|
+
*/
|
|
19
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
20
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
21
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
22
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
23
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
24
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
25
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.isContactIdentityRecord = exports.ContactIdentityRecord = void 0;
|
|
30
|
+
const uuid_1 = require("uuid");
|
|
31
|
+
const core_1 = require("@d19n/odin-types/dist/core");
|
|
32
|
+
const record_link_manager_1 = require("@d19n/odin-sdk-generator/dist/record-link-manager");
|
|
33
|
+
const PaymentMethodRecord_1 = require("./PaymentMethodRecord");
|
|
34
|
+
const ContactRecord_1 = require("./ContactRecord");
|
|
35
|
+
const OrderRecord_1 = require("./OrderRecord");
|
|
36
|
+
/**
|
|
37
|
+
* Builder for action execution with dryRun support
|
|
38
|
+
*
|
|
39
|
+
* Provides a consistent API across all action types:
|
|
40
|
+
* - `.execute()` - Execute the action and return results
|
|
41
|
+
* - `.dryRun()` - Return the payload without executing (for debugging)
|
|
42
|
+
*/
|
|
43
|
+
class ActionBuilder {
|
|
44
|
+
constructor(provider, moduleName, entityName, payload, clearPendingLinks) {
|
|
45
|
+
this._provider = provider;
|
|
46
|
+
this._moduleName = moduleName;
|
|
47
|
+
this._entityName = entityName;
|
|
48
|
+
this._payload = payload;
|
|
49
|
+
this._clearPendingLinks = clearPendingLinks;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Set an external system identifier for this record.
|
|
53
|
+
* Links the record to a corresponding entry in an external application.
|
|
54
|
+
*
|
|
55
|
+
* @param externalId - The ID in the external system
|
|
56
|
+
* @param externalAppId - The external application identifier
|
|
57
|
+
* @returns this (for chaining)
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```typescript
|
|
61
|
+
* await record.createOrder({ ... }).withExternalId('SF-123', 'salesforce').execute();
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
withExternalId(externalId, externalAppId) {
|
|
65
|
+
this._payload.externalId = externalId;
|
|
66
|
+
this._payload.externalAppId = externalAppId;
|
|
67
|
+
return this;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Set security/access groups for this record.
|
|
71
|
+
* Controls which user groups can access the record.
|
|
72
|
+
*
|
|
73
|
+
* @param groups - Array of group names
|
|
74
|
+
* @returns this (for chaining)
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```typescript
|
|
78
|
+
* await record.createOrder({ ... }).withGroups(['TenantA', 'BillingTeam']).execute();
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
withGroups(groups) {
|
|
82
|
+
this._payload.groups = groups;
|
|
83
|
+
return this;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Execute the action
|
|
87
|
+
* @returns The result from the API
|
|
88
|
+
*/
|
|
89
|
+
execute() {
|
|
90
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
91
|
+
const result = yield this._provider._applyAction(this._moduleName, this._entityName, this._payload);
|
|
92
|
+
this._clearPendingLinks();
|
|
93
|
+
return result;
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Returns the request payload without executing (for debugging)
|
|
98
|
+
* @returns The request payload that would be sent to the API
|
|
99
|
+
*/
|
|
100
|
+
dryRun() {
|
|
101
|
+
return this._payload;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Prevents accidental `await actionBuilder` without .execute()
|
|
105
|
+
* Forces developers to explicitly call .execute()
|
|
106
|
+
* @throws Error always - use .execute() or .dryRun() instead
|
|
107
|
+
*/
|
|
108
|
+
then() {
|
|
109
|
+
throw new Error('ActionBuilder cannot be awaited directly. Call .execute() to run the action or .dryRun() to get the payload.');
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
class ContactIdentityRecord {
|
|
113
|
+
/**
|
|
114
|
+
* Create a record wrapper.
|
|
115
|
+
* @param record - The underlying record, or null for create operations
|
|
116
|
+
* @param provider - The API or DB provider
|
|
117
|
+
* @param preGeneratedId - Optional pre-generated ID for new records (auto-generated if not provided)
|
|
118
|
+
*/
|
|
119
|
+
constructor(record, provider, preGeneratedId) {
|
|
120
|
+
this._pendingLinks = [];
|
|
121
|
+
this._record = record;
|
|
122
|
+
this._provider = provider;
|
|
123
|
+
this._preGeneratedId = preGeneratedId !== null && preGeneratedId !== void 0 ? preGeneratedId : (0, uuid_1.v4)();
|
|
124
|
+
}
|
|
125
|
+
// ============================================
|
|
126
|
+
// CORE PROPERTIES
|
|
127
|
+
// ============================================
|
|
128
|
+
/** Returns true if this is a new (unsaved) record */
|
|
129
|
+
get isNew() { var _a; return !((_a = this._record) === null || _a === void 0 ? void 0 : _a.id); }
|
|
130
|
+
/** Record ID - always available (pre-generated for new records) */
|
|
131
|
+
get id() { var _a, _b; return (_b = (_a = this._record) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : this._preGeneratedId; }
|
|
132
|
+
get entity() { var _a, _b; return (_b = (_a = this._record) === null || _a === void 0 ? void 0 : _a.entity) !== null && _b !== void 0 ? _b : 'CrmModule:ContactIdentity'; }
|
|
133
|
+
get type() { var _a; return (_a = this._record) === null || _a === void 0 ? void 0 : _a.type; }
|
|
134
|
+
/** Record properties - empty object for new (unsaved) records */
|
|
135
|
+
get properties() { var _a; return ((_a = this._record) === null || _a === void 0 ? void 0 : _a.properties) || {}; }
|
|
136
|
+
get title() { var _a; return (_a = this._record) === null || _a === void 0 ? void 0 : _a.title; }
|
|
137
|
+
get recordNumber() { var _a; return (_a = this._record) === null || _a === void 0 ? void 0 : _a.recordNumber; }
|
|
138
|
+
get stage() { var _a; return (_a = this._record) === null || _a === void 0 ? void 0 : _a.stage; }
|
|
139
|
+
get createdAt() { var _a; return (_a = this._record) === null || _a === void 0 ? void 0 : _a.createdAt; }
|
|
140
|
+
get updatedAt() { var _a; return (_a = this._record) === null || _a === void 0 ? void 0 : _a.updatedAt; }
|
|
141
|
+
get externalId() { var _a; return (_a = this._record) === null || _a === void 0 ? void 0 : _a.externalId; }
|
|
142
|
+
get externalAppId() { var _a; return (_a = this._record) === null || _a === void 0 ? void 0 : _a.externalAppId; }
|
|
143
|
+
get groups() { var _a; return ((_a = this._record) === null || _a === void 0 ? void 0 : _a.groups) || []; }
|
|
144
|
+
/** Access the underlying OdinRecord (null for new records) */
|
|
145
|
+
get record() { return this._record; }
|
|
146
|
+
/**
|
|
147
|
+
* Access linked PaymentMethod records
|
|
148
|
+
* @remarks Available labels: ContactIdentity__PaymentMethod
|
|
149
|
+
* @throws Error if called on a new (unsaved) record
|
|
150
|
+
*
|
|
151
|
+
* @example
|
|
152
|
+
* ```typescript
|
|
153
|
+
* // Get all linked PaymentMethod records
|
|
154
|
+
* const items = await record.paymentMethods.list();
|
|
155
|
+
* const first = await record.paymentMethods.first();
|
|
156
|
+
*
|
|
157
|
+
* // Filter by label
|
|
158
|
+
* const specific = await record.paymentMethods.first({ label: 'ContactIdentity__PaymentMethod' });
|
|
159
|
+
* ```
|
|
160
|
+
*/
|
|
161
|
+
get paymentMethods() {
|
|
162
|
+
var _a;
|
|
163
|
+
if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
|
|
164
|
+
throw new Error('Cannot access links on a new (unsaved) record');
|
|
165
|
+
if (!this._paymentMethods) {
|
|
166
|
+
this._paymentMethods = new record_link_manager_1.RecordLinkManager(this._provider, this._record, {
|
|
167
|
+
sourceEntity: 'CrmModule:ContactIdentity',
|
|
168
|
+
targetEntity: 'BillingModule:PaymentMethod',
|
|
169
|
+
targetModuleName: 'BillingModule',
|
|
170
|
+
targetEntityName: 'PaymentMethod',
|
|
171
|
+
labels: ['ContactIdentity__PaymentMethod'],
|
|
172
|
+
}, PaymentMethodRecord_1.PaymentMethodRecord);
|
|
173
|
+
}
|
|
174
|
+
return this._paymentMethods;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Access linked ContactIdentity records
|
|
178
|
+
* @remarks Available labels: ContactIdentity__ContactIdentity
|
|
179
|
+
* @throws Error if called on a new (unsaved) record
|
|
180
|
+
*
|
|
181
|
+
* @example
|
|
182
|
+
* ```typescript
|
|
183
|
+
* // Get all linked ContactIdentity records
|
|
184
|
+
* const items = await record.contactIdentities.list();
|
|
185
|
+
* const first = await record.contactIdentities.first();
|
|
186
|
+
*
|
|
187
|
+
* // Filter by label
|
|
188
|
+
* const specific = await record.contactIdentities.first({ label: 'ContactIdentity__ContactIdentity' });
|
|
189
|
+
* ```
|
|
190
|
+
*/
|
|
191
|
+
get contactIdentities() {
|
|
192
|
+
var _a;
|
|
193
|
+
if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
|
|
194
|
+
throw new Error('Cannot access links on a new (unsaved) record');
|
|
195
|
+
if (!this._contactIdentities) {
|
|
196
|
+
this._contactIdentities = new record_link_manager_1.RecordLinkManager(this._provider, this._record, {
|
|
197
|
+
sourceEntity: 'CrmModule:ContactIdentity',
|
|
198
|
+
targetEntity: 'CrmModule:ContactIdentity',
|
|
199
|
+
targetModuleName: 'CrmModule',
|
|
200
|
+
targetEntityName: 'ContactIdentity',
|
|
201
|
+
labels: ['ContactIdentity__ContactIdentity'],
|
|
202
|
+
}, ContactIdentityRecord);
|
|
203
|
+
}
|
|
204
|
+
return this._contactIdentities;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Access linked Contact records
|
|
208
|
+
* @remarks Available labels: Contact__ContactIdentity
|
|
209
|
+
* @throws Error if called on a new (unsaved) record
|
|
210
|
+
*
|
|
211
|
+
* @example
|
|
212
|
+
* ```typescript
|
|
213
|
+
* // Get all linked Contact records
|
|
214
|
+
* const items = await record.contacts.list();
|
|
215
|
+
* const first = await record.contacts.first();
|
|
216
|
+
*
|
|
217
|
+
* // Filter by label
|
|
218
|
+
* const specific = await record.contacts.first({ label: 'Contact__ContactIdentity' });
|
|
219
|
+
* ```
|
|
220
|
+
*/
|
|
221
|
+
get contacts() {
|
|
222
|
+
var _a;
|
|
223
|
+
if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
|
|
224
|
+
throw new Error('Cannot access links on a new (unsaved) record');
|
|
225
|
+
if (!this._contacts) {
|
|
226
|
+
this._contacts = new record_link_manager_1.RecordLinkManager(this._provider, this._record, {
|
|
227
|
+
sourceEntity: 'CrmModule:ContactIdentity',
|
|
228
|
+
targetEntity: 'CrmModule:Contact',
|
|
229
|
+
targetModuleName: 'CrmModule',
|
|
230
|
+
targetEntityName: 'Contact',
|
|
231
|
+
labels: ['Contact__ContactIdentity'],
|
|
232
|
+
}, ContactRecord_1.ContactRecord);
|
|
233
|
+
}
|
|
234
|
+
return this._contacts;
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Access linked Order records
|
|
238
|
+
* @remarks Available labels: Order__ContactIdentity
|
|
239
|
+
* @throws Error if called on a new (unsaved) record
|
|
240
|
+
*
|
|
241
|
+
* @example
|
|
242
|
+
* ```typescript
|
|
243
|
+
* // Get all linked Order records
|
|
244
|
+
* const items = await record.orders.list();
|
|
245
|
+
* const first = await record.orders.first();
|
|
246
|
+
*
|
|
247
|
+
* // Filter by label
|
|
248
|
+
* const specific = await record.orders.first({ label: 'Order__ContactIdentity' });
|
|
249
|
+
* ```
|
|
250
|
+
*/
|
|
251
|
+
get orders() {
|
|
252
|
+
var _a;
|
|
253
|
+
if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
|
|
254
|
+
throw new Error('Cannot access links on a new (unsaved) record');
|
|
255
|
+
if (!this._orders) {
|
|
256
|
+
this._orders = new record_link_manager_1.RecordLinkManager(this._provider, this._record, {
|
|
257
|
+
sourceEntity: 'CrmModule:ContactIdentity',
|
|
258
|
+
targetEntity: 'OrderModule:Order',
|
|
259
|
+
targetModuleName: 'OrderModule',
|
|
260
|
+
targetEntityName: 'Order',
|
|
261
|
+
labels: ['Order__ContactIdentity'],
|
|
262
|
+
}, OrderRecord_1.OrderRecord);
|
|
263
|
+
}
|
|
264
|
+
return this._orders;
|
|
265
|
+
}
|
|
266
|
+
// ============================================
|
|
267
|
+
// LINK MANAGEMENT
|
|
268
|
+
// ============================================
|
|
269
|
+
/**
|
|
270
|
+
* Queue a link to be created with the next action.
|
|
271
|
+
* Works for both create and update actions.
|
|
272
|
+
* @returns this (for chaining)
|
|
273
|
+
*/
|
|
274
|
+
link(target) {
|
|
275
|
+
this._pendingLinks.push(new core_1.OdinRecordLinkDto({ id: target.id, entity: target.entity }));
|
|
276
|
+
return this;
|
|
277
|
+
}
|
|
278
|
+
/** Get the currently queued links */
|
|
279
|
+
get pendingLinks() {
|
|
280
|
+
return [...this._pendingLinks];
|
|
281
|
+
}
|
|
282
|
+
/** Clear pending links without executing an action */
|
|
283
|
+
clearPendingLinks() {
|
|
284
|
+
this._pendingLinks = [];
|
|
285
|
+
return this;
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Immediately unlink a record (API call).
|
|
289
|
+
* Unlike link(), this executes immediately.
|
|
290
|
+
* @throws Error if called on a new (unsaved) record
|
|
291
|
+
*/
|
|
292
|
+
unlink(target) {
|
|
293
|
+
var _a;
|
|
294
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
295
|
+
if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
|
|
296
|
+
throw new Error('Cannot unlink from a new (unsaved) record');
|
|
297
|
+
const targetId = typeof target === 'string' ? target : target.id;
|
|
298
|
+
yield this._provider._deleteLinks('CrmModule', 'ContactIdentity', this._record.id, targetId);
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
// ============================================
|
|
302
|
+
// CREATE ACTIONS (no existing record required)
|
|
303
|
+
// ============================================
|
|
304
|
+
/**
|
|
305
|
+
* createContactIdentity
|
|
306
|
+
*
|
|
307
|
+
* Creates a new ContactIdentity record with the specified properties.
|
|
308
|
+
* Returns an ActionBuilder - call .execute() to create or .dryRun() for debugging.
|
|
309
|
+
*
|
|
310
|
+
* @param properties - The properties for the new record
|
|
311
|
+
* @param options - Optional settings
|
|
312
|
+
* @param options.type - Override the record type
|
|
313
|
+
* @param options.journeyId - Associate with a journey
|
|
314
|
+
* @param options.stageKey - Set initial pipeline stage
|
|
315
|
+
* @returns ActionBuilder - call .execute() to create or .dryRun() for payload
|
|
316
|
+
*
|
|
317
|
+
* @example
|
|
318
|
+
* ```typescript
|
|
319
|
+
* // Create with properties
|
|
320
|
+
* const record = odinClient.contactIdentitys.new();
|
|
321
|
+
* await record.createContactIdentity({ ... }).execute();
|
|
322
|
+
*
|
|
323
|
+
* // Dry run (for debugging)
|
|
324
|
+
* const payload = record.createContactIdentity({ ... }).dryRun();
|
|
325
|
+
* ```
|
|
326
|
+
*/
|
|
327
|
+
createContactIdentity(properties, options) {
|
|
328
|
+
var _a, _b;
|
|
329
|
+
const payload = {
|
|
330
|
+
entity: 'CrmModule:ContactIdentity',
|
|
331
|
+
type: (_a = options === null || options === void 0 ? void 0 : options.type) !== null && _a !== void 0 ? _a : (_b = this._record) === null || _b === void 0 ? void 0 : _b.type,
|
|
332
|
+
actionName: 'createContactIdentity',
|
|
333
|
+
properties: properties || {},
|
|
334
|
+
associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined,
|
|
335
|
+
journeyId: options === null || options === void 0 ? void 0 : options.journeyId,
|
|
336
|
+
stageKey: options === null || options === void 0 ? void 0 : options.stageKey,
|
|
337
|
+
};
|
|
338
|
+
return new ActionBuilder(this._provider, 'CrmModule', 'ContactIdentity', payload, () => { this._pendingLinks = []; });
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
exports.ContactIdentityRecord = ContactIdentityRecord;
|
|
342
|
+
// ============================================
|
|
343
|
+
// TYPED LINK ACCESSORS
|
|
344
|
+
// ============================================
|
|
345
|
+
/** Valid labels for PaymentMethod associations */
|
|
346
|
+
ContactIdentityRecord.paymentMethodsLabels = ['ContactIdentity__PaymentMethod'];
|
|
347
|
+
/** Valid labels for ContactIdentity associations */
|
|
348
|
+
ContactIdentityRecord.contactIdentitiesLabels = ['ContactIdentity__ContactIdentity'];
|
|
349
|
+
/** Valid labels for Contact associations */
|
|
350
|
+
ContactIdentityRecord.contactsLabels = ['Contact__ContactIdentity'];
|
|
351
|
+
/** Valid labels for Order associations */
|
|
352
|
+
ContactIdentityRecord.ordersLabels = ['Order__ContactIdentity'];
|
|
353
|
+
/** Type guard to check if an object is a ContactIdentityRecord */
|
|
354
|
+
function isContactIdentityRecord(obj) {
|
|
355
|
+
return obj instanceof ContactIdentityRecord;
|
|
356
|
+
}
|
|
357
|
+
exports.isContactIdentityRecord = isContactIdentityRecord;
|
|
@@ -36,6 +36,7 @@ import { BillingRequestRecord } from './BillingRequestRecord';
|
|
|
36
36
|
import { InvoiceRecord } from './InvoiceRecord';
|
|
37
37
|
import { AffiliateCodeRecord } from './AffiliateCodeRecord';
|
|
38
38
|
import { OneTouchSwitchRecord } from './OneTouchSwitchRecord';
|
|
39
|
+
import { ContactIdentityRecord } from './ContactIdentityRecord';
|
|
39
40
|
import { PaymentMethodRefundRecord } from './PaymentMethodRefundRecord';
|
|
40
41
|
import { AppointmentRecord } from './AppointmentRecord';
|
|
41
42
|
import { CallRecord } from './CallRecord';
|
|
@@ -185,6 +186,7 @@ export declare class ContactRecord<TProps = ContactProperties> {
|
|
|
185
186
|
private _affiliateCodes?;
|
|
186
187
|
private _contacts?;
|
|
187
188
|
private _oneTouchSwitches?;
|
|
189
|
+
private _contactIdentities?;
|
|
188
190
|
private _paymentMethodRefunds?;
|
|
189
191
|
private _appointments?;
|
|
190
192
|
private _calls?;
|
|
@@ -422,6 +424,24 @@ export declare class ContactRecord<TProps = ContactProperties> {
|
|
|
422
424
|
* ```
|
|
423
425
|
*/
|
|
424
426
|
get oneTouchSwitches(): RecordLinkManager<OneTouchSwitchRecord, typeof ContactRecord['oneTouchSwitchesLabels'][number]>;
|
|
427
|
+
/** Valid labels for ContactIdentity associations */
|
|
428
|
+
static readonly contactIdentitiesLabels: readonly ["Contact__ContactIdentity"];
|
|
429
|
+
/**
|
|
430
|
+
* Access linked ContactIdentity records
|
|
431
|
+
* @remarks Available labels: Contact__ContactIdentity
|
|
432
|
+
* @throws Error if called on a new (unsaved) record
|
|
433
|
+
*
|
|
434
|
+
* @example
|
|
435
|
+
* ```typescript
|
|
436
|
+
* // Get all linked ContactIdentity records
|
|
437
|
+
* const items = await record.contactIdentities.list();
|
|
438
|
+
* const first = await record.contactIdentities.first();
|
|
439
|
+
*
|
|
440
|
+
* // Filter by label
|
|
441
|
+
* const specific = await record.contactIdentities.first({ label: 'Contact__ContactIdentity' });
|
|
442
|
+
* ```
|
|
443
|
+
*/
|
|
444
|
+
get contactIdentities(): RecordLinkManager<ContactIdentityRecord, typeof ContactRecord['contactIdentitiesLabels'][number]>;
|
|
425
445
|
/** Valid labels for PaymentMethodRefund associations */
|
|
426
446
|
static readonly paymentMethodRefundsLabels: readonly ["Contact__PaymentMethodRefund"];
|
|
427
447
|
/**
|
|
@@ -40,6 +40,7 @@ const BillingRequestRecord_1 = require("./BillingRequestRecord");
|
|
|
40
40
|
const InvoiceRecord_1 = require("./InvoiceRecord");
|
|
41
41
|
const AffiliateCodeRecord_1 = require("./AffiliateCodeRecord");
|
|
42
42
|
const OneTouchSwitchRecord_1 = require("./OneTouchSwitchRecord");
|
|
43
|
+
const ContactIdentityRecord_1 = require("./ContactIdentityRecord");
|
|
43
44
|
const PaymentMethodRefundRecord_1 = require("./PaymentMethodRefundRecord");
|
|
44
45
|
const AppointmentRecord_1 = require("./AppointmentRecord");
|
|
45
46
|
const CallRecord_1 = require("./CallRecord");
|
|
@@ -597,6 +598,36 @@ class ContactRecord {
|
|
|
597
598
|
}
|
|
598
599
|
return this._oneTouchSwitches;
|
|
599
600
|
}
|
|
601
|
+
/**
|
|
602
|
+
* Access linked ContactIdentity records
|
|
603
|
+
* @remarks Available labels: Contact__ContactIdentity
|
|
604
|
+
* @throws Error if called on a new (unsaved) record
|
|
605
|
+
*
|
|
606
|
+
* @example
|
|
607
|
+
* ```typescript
|
|
608
|
+
* // Get all linked ContactIdentity records
|
|
609
|
+
* const items = await record.contactIdentities.list();
|
|
610
|
+
* const first = await record.contactIdentities.first();
|
|
611
|
+
*
|
|
612
|
+
* // Filter by label
|
|
613
|
+
* const specific = await record.contactIdentities.first({ label: 'Contact__ContactIdentity' });
|
|
614
|
+
* ```
|
|
615
|
+
*/
|
|
616
|
+
get contactIdentities() {
|
|
617
|
+
var _a;
|
|
618
|
+
if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
|
|
619
|
+
throw new Error('Cannot access links on a new (unsaved) record');
|
|
620
|
+
if (!this._contactIdentities) {
|
|
621
|
+
this._contactIdentities = new record_link_manager_1.RecordLinkManager(this._provider, this._record, {
|
|
622
|
+
sourceEntity: 'CrmModule:Contact',
|
|
623
|
+
targetEntity: 'CrmModule:ContactIdentity',
|
|
624
|
+
targetModuleName: 'CrmModule',
|
|
625
|
+
targetEntityName: 'ContactIdentity',
|
|
626
|
+
labels: ['Contact__ContactIdentity'],
|
|
627
|
+
}, ContactIdentityRecord_1.ContactIdentityRecord);
|
|
628
|
+
}
|
|
629
|
+
return this._contactIdentities;
|
|
630
|
+
}
|
|
600
631
|
/**
|
|
601
632
|
* Access linked PaymentMethodRefund records
|
|
602
633
|
* @remarks Available labels: Contact__PaymentMethodRefund
|
|
@@ -1239,6 +1270,8 @@ ContactRecord.affiliateCodesLabels = ['ContactAffiliateCodes'];
|
|
|
1239
1270
|
ContactRecord.contactsLabels = ['Contact__Contact'];
|
|
1240
1271
|
/** Valid labels for OneTouchSwitch associations */
|
|
1241
1272
|
ContactRecord.oneTouchSwitchesLabels = ['OneTouchSwitch__Contact'];
|
|
1273
|
+
/** Valid labels for ContactIdentity associations */
|
|
1274
|
+
ContactRecord.contactIdentitiesLabels = ['Contact__ContactIdentity'];
|
|
1242
1275
|
/** Valid labels for PaymentMethodRefund associations */
|
|
1243
1276
|
ContactRecord.paymentMethodRefundsLabels = ['Contact__PaymentMethodRefund'];
|
|
1244
1277
|
/** Valid labels for Appointment associations */
|
|
@@ -57,6 +57,7 @@ import { CustomerDeviceOntRecord } from './CustomerDeviceOntRecord';
|
|
|
57
57
|
import { CustomerDeviceRouterRecord } from './CustomerDeviceRouterRecord';
|
|
58
58
|
import { AppointmentRecord } from './AppointmentRecord';
|
|
59
59
|
import { OrderCheckRecord } from './OrderCheckRecord';
|
|
60
|
+
import { ContactIdentityRecord } from './ContactIdentityRecord';
|
|
60
61
|
import { OneTouchSwitchRecord } from './OneTouchSwitchRecord';
|
|
61
62
|
import { ContractBuyOutRecord } from './ContractBuyOutRecord';
|
|
62
63
|
import { ActivityRecord } from './ActivityRecord';
|
|
@@ -642,6 +643,7 @@ export declare class OrderRecord<TProps = OrderProperties> {
|
|
|
642
643
|
private _customerDeviceRouters?;
|
|
643
644
|
private _appointments?;
|
|
644
645
|
private _orderChecks?;
|
|
646
|
+
private _contactIdentities?;
|
|
645
647
|
private _oneTouchSwitches?;
|
|
646
648
|
private _contractBuyOuts?;
|
|
647
649
|
private _activities?;
|
|
@@ -1070,6 +1072,24 @@ export declare class OrderRecord<TProps = OrderProperties> {
|
|
|
1070
1072
|
* ```
|
|
1071
1073
|
*/
|
|
1072
1074
|
get orderChecks(): RecordLinkManager<OrderCheckRecord, typeof OrderRecord['orderChecksLabels'][number]>;
|
|
1075
|
+
/** Valid labels for ContactIdentity associations */
|
|
1076
|
+
static readonly contactIdentitiesLabels: readonly ["Order__ContactIdentity"];
|
|
1077
|
+
/**
|
|
1078
|
+
* Access linked ContactIdentity records
|
|
1079
|
+
* @remarks Available labels: Order__ContactIdentity
|
|
1080
|
+
* @throws Error if called on a new (unsaved) record
|
|
1081
|
+
*
|
|
1082
|
+
* @example
|
|
1083
|
+
* ```typescript
|
|
1084
|
+
* // Get all linked ContactIdentity records
|
|
1085
|
+
* const items = await record.contactIdentities.list();
|
|
1086
|
+
* const first = await record.contactIdentities.first();
|
|
1087
|
+
*
|
|
1088
|
+
* // Filter by label
|
|
1089
|
+
* const specific = await record.contactIdentities.first({ label: 'Order__ContactIdentity' });
|
|
1090
|
+
* ```
|
|
1091
|
+
*/
|
|
1092
|
+
get contactIdentities(): RecordLinkManager<ContactIdentityRecord, typeof OrderRecord['contactIdentitiesLabels'][number]>;
|
|
1073
1093
|
/** Valid labels for OneTouchSwitch associations */
|
|
1074
1094
|
static readonly oneTouchSwitchesLabels: readonly ["OneTouchSwitch__Order"];
|
|
1075
1095
|
/**
|
|
@@ -51,6 +51,7 @@ const CustomerDeviceOntRecord_1 = require("./CustomerDeviceOntRecord");
|
|
|
51
51
|
const CustomerDeviceRouterRecord_1 = require("./CustomerDeviceRouterRecord");
|
|
52
52
|
const AppointmentRecord_1 = require("./AppointmentRecord");
|
|
53
53
|
const OrderCheckRecord_1 = require("./OrderCheckRecord");
|
|
54
|
+
const ContactIdentityRecord_1 = require("./ContactIdentityRecord");
|
|
54
55
|
const OneTouchSwitchRecord_1 = require("./OneTouchSwitchRecord");
|
|
55
56
|
const ContractBuyOutRecord_1 = require("./ContractBuyOutRecord");
|
|
56
57
|
const ActivityRecord_1 = require("./ActivityRecord");
|
|
@@ -1667,6 +1668,36 @@ class OrderRecord {
|
|
|
1667
1668
|
}
|
|
1668
1669
|
return this._orderChecks;
|
|
1669
1670
|
}
|
|
1671
|
+
/**
|
|
1672
|
+
* Access linked ContactIdentity records
|
|
1673
|
+
* @remarks Available labels: Order__ContactIdentity
|
|
1674
|
+
* @throws Error if called on a new (unsaved) record
|
|
1675
|
+
*
|
|
1676
|
+
* @example
|
|
1677
|
+
* ```typescript
|
|
1678
|
+
* // Get all linked ContactIdentity records
|
|
1679
|
+
* const items = await record.contactIdentities.list();
|
|
1680
|
+
* const first = await record.contactIdentities.first();
|
|
1681
|
+
*
|
|
1682
|
+
* // Filter by label
|
|
1683
|
+
* const specific = await record.contactIdentities.first({ label: 'Order__ContactIdentity' });
|
|
1684
|
+
* ```
|
|
1685
|
+
*/
|
|
1686
|
+
get contactIdentities() {
|
|
1687
|
+
var _a;
|
|
1688
|
+
if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
|
|
1689
|
+
throw new Error('Cannot access links on a new (unsaved) record');
|
|
1690
|
+
if (!this._contactIdentities) {
|
|
1691
|
+
this._contactIdentities = new record_link_manager_1.RecordLinkManager(this._provider, this._record, {
|
|
1692
|
+
sourceEntity: 'OrderModule:Order',
|
|
1693
|
+
targetEntity: 'CrmModule:ContactIdentity',
|
|
1694
|
+
targetModuleName: 'CrmModule',
|
|
1695
|
+
targetEntityName: 'ContactIdentity',
|
|
1696
|
+
labels: ['Order__ContactIdentity'],
|
|
1697
|
+
}, ContactIdentityRecord_1.ContactIdentityRecord);
|
|
1698
|
+
}
|
|
1699
|
+
return this._contactIdentities;
|
|
1700
|
+
}
|
|
1670
1701
|
/**
|
|
1671
1702
|
* Access linked OneTouchSwitch records
|
|
1672
1703
|
* @remarks Available labels: OneTouchSwitch__Order
|
|
@@ -2980,6 +3011,8 @@ OrderRecord.customerDeviceRoutersLabels = ['Order__CustomerDeviceRouter'];
|
|
|
2980
3011
|
OrderRecord.appointmentsLabels = ['Order__Appointment'];
|
|
2981
3012
|
/** Valid labels for OrderCheck associations */
|
|
2982
3013
|
OrderRecord.orderChecksLabels = ['Order__OrderCheck'];
|
|
3014
|
+
/** Valid labels for ContactIdentity associations */
|
|
3015
|
+
OrderRecord.contactIdentitiesLabels = ['Order__ContactIdentity'];
|
|
2983
3016
|
/** Valid labels for OneTouchSwitch associations */
|
|
2984
3017
|
OrderRecord.oneTouchSwitchesLabels = ['OneTouchSwitch__Order'];
|
|
2985
3018
|
/** Valid labels for ContractBuyOut associations */
|
|
@@ -24,6 +24,7 @@ import { PaymentMethodProperties } from '../entities-v2/PaymentMethod';
|
|
|
24
24
|
import { CreatePaymentMethodProperties } from '../actions-v2/CreatePaymentMethodDto';
|
|
25
25
|
import { UpdatePaymentMethodProperties } from '../actions-v2/UpdatePaymentMethodDto';
|
|
26
26
|
import { TransactionRecord } from './TransactionRecord';
|
|
27
|
+
import { ContactIdentityRecord } from './ContactIdentityRecord';
|
|
27
28
|
import { PaymentMethodRefundRecord } from './PaymentMethodRefundRecord';
|
|
28
29
|
import { NoteRecord } from './NoteRecord';
|
|
29
30
|
import { ContactRecord } from './ContactRecord';
|
|
@@ -92,6 +93,7 @@ export declare class PaymentMethodRecord<TProps = PaymentMethodProperties> {
|
|
|
92
93
|
private _pendingLinks;
|
|
93
94
|
private _preGeneratedId;
|
|
94
95
|
private _transactions?;
|
|
96
|
+
private _contactIdentities?;
|
|
95
97
|
private _paymentMethodRefunds?;
|
|
96
98
|
private _notes?;
|
|
97
99
|
private _contacts?;
|
|
@@ -139,6 +141,24 @@ export declare class PaymentMethodRecord<TProps = PaymentMethodProperties> {
|
|
|
139
141
|
* ```
|
|
140
142
|
*/
|
|
141
143
|
get transactions(): RecordLinkManager<TransactionRecord, typeof PaymentMethodRecord['transactionsLabels'][number]>;
|
|
144
|
+
/** Valid labels for ContactIdentity associations */
|
|
145
|
+
static readonly contactIdentitiesLabels: readonly ["ContactIdentity__PaymentMethod"];
|
|
146
|
+
/**
|
|
147
|
+
* Access linked ContactIdentity records
|
|
148
|
+
* @remarks Available labels: ContactIdentity__PaymentMethod
|
|
149
|
+
* @throws Error if called on a new (unsaved) record
|
|
150
|
+
*
|
|
151
|
+
* @example
|
|
152
|
+
* ```typescript
|
|
153
|
+
* // Get all linked ContactIdentity records
|
|
154
|
+
* const items = await record.contactIdentities.list();
|
|
155
|
+
* const first = await record.contactIdentities.first();
|
|
156
|
+
*
|
|
157
|
+
* // Filter by label
|
|
158
|
+
* const specific = await record.contactIdentities.first({ label: 'ContactIdentity__PaymentMethod' });
|
|
159
|
+
* ```
|
|
160
|
+
*/
|
|
161
|
+
get contactIdentities(): RecordLinkManager<ContactIdentityRecord, typeof PaymentMethodRecord['contactIdentitiesLabels'][number]>;
|
|
142
162
|
/** Valid labels for PaymentMethodRefund associations */
|
|
143
163
|
static readonly paymentMethodRefundsLabels: readonly ["PaymentMethod__PaymentMethodRefund"];
|
|
144
164
|
/**
|
|
@@ -31,6 +31,7 @@ const uuid_1 = require("uuid");
|
|
|
31
31
|
const core_1 = require("@d19n/odin-types/dist/core");
|
|
32
32
|
const record_link_manager_1 = require("@d19n/odin-sdk-generator/dist/record-link-manager");
|
|
33
33
|
const TransactionRecord_1 = require("./TransactionRecord");
|
|
34
|
+
const ContactIdentityRecord_1 = require("./ContactIdentityRecord");
|
|
34
35
|
const PaymentMethodRefundRecord_1 = require("./PaymentMethodRefundRecord");
|
|
35
36
|
const NoteRecord_1 = require("./NoteRecord");
|
|
36
37
|
const ContactRecord_1 = require("./ContactRecord");
|
|
@@ -175,6 +176,36 @@ class PaymentMethodRecord {
|
|
|
175
176
|
}
|
|
176
177
|
return this._transactions;
|
|
177
178
|
}
|
|
179
|
+
/**
|
|
180
|
+
* Access linked ContactIdentity records
|
|
181
|
+
* @remarks Available labels: ContactIdentity__PaymentMethod
|
|
182
|
+
* @throws Error if called on a new (unsaved) record
|
|
183
|
+
*
|
|
184
|
+
* @example
|
|
185
|
+
* ```typescript
|
|
186
|
+
* // Get all linked ContactIdentity records
|
|
187
|
+
* const items = await record.contactIdentities.list();
|
|
188
|
+
* const first = await record.contactIdentities.first();
|
|
189
|
+
*
|
|
190
|
+
* // Filter by label
|
|
191
|
+
* const specific = await record.contactIdentities.first({ label: 'ContactIdentity__PaymentMethod' });
|
|
192
|
+
* ```
|
|
193
|
+
*/
|
|
194
|
+
get contactIdentities() {
|
|
195
|
+
var _a;
|
|
196
|
+
if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
|
|
197
|
+
throw new Error('Cannot access links on a new (unsaved) record');
|
|
198
|
+
if (!this._contactIdentities) {
|
|
199
|
+
this._contactIdentities = new record_link_manager_1.RecordLinkManager(this._provider, this._record, {
|
|
200
|
+
sourceEntity: 'BillingModule:PaymentMethod',
|
|
201
|
+
targetEntity: 'CrmModule:ContactIdentity',
|
|
202
|
+
targetModuleName: 'CrmModule',
|
|
203
|
+
targetEntityName: 'ContactIdentity',
|
|
204
|
+
labels: ['ContactIdentity__PaymentMethod'],
|
|
205
|
+
}, ContactIdentityRecord_1.ContactIdentityRecord);
|
|
206
|
+
}
|
|
207
|
+
return this._contactIdentities;
|
|
208
|
+
}
|
|
178
209
|
/**
|
|
179
210
|
* Access linked PaymentMethodRefund records
|
|
180
211
|
* @remarks Available labels: PaymentMethod__PaymentMethodRefund
|
|
@@ -408,6 +439,8 @@ exports.PaymentMethodRecord = PaymentMethodRecord;
|
|
|
408
439
|
// ============================================
|
|
409
440
|
/** Valid labels for Transaction associations */
|
|
410
441
|
PaymentMethodRecord.transactionsLabels = ['Transaction__PaymentMethod'];
|
|
442
|
+
/** Valid labels for ContactIdentity associations */
|
|
443
|
+
PaymentMethodRecord.contactIdentitiesLabels = ['ContactIdentity__PaymentMethod'];
|
|
411
444
|
/** Valid labels for PaymentMethodRefund associations */
|
|
412
445
|
PaymentMethodRecord.paymentMethodRefundsLabels = ['PaymentMethod__PaymentMethodRefund'];
|
|
413
446
|
/** Valid labels for Note associations */
|
|
@@ -59,6 +59,7 @@ export { ContactRecord, isContactRecord } from './ContactRecord';
|
|
|
59
59
|
export { RewardRecord, isRewardRecord } from './RewardRecord';
|
|
60
60
|
export { EmailRecord, isEmailRecord } from './EmailRecord';
|
|
61
61
|
export { ConfigRecord, isConfigRecord } from './ConfigRecord';
|
|
62
|
+
export { ContactIdentityRecord, isContactIdentityRecord } from './ContactIdentityRecord';
|
|
62
63
|
export { CustomerDeviceConfigurationRecord, isCustomerDeviceConfigurationRecord } from './CustomerDeviceConfigurationRecord';
|
|
63
64
|
export { CustomerDeviceOntRecord, isCustomerDeviceOntRecord } from './CustomerDeviceOntRecord';
|
|
64
65
|
export { EmailSenderRecord, isEmailSenderRecord } from './EmailSenderRecord';
|