@d19n/youfibre-odin-sdk 2.0.366 → 2.0.367

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.
Files changed (76) hide show
  1. package/README.md +6 -26
  2. package/dist/EntityRegistry.d.ts +0 -8
  3. package/dist/EntityRegistry.js +0 -8
  4. package/dist/OdinApiClient.d.ts +0 -16
  5. package/dist/OdinApiClient.js +0 -32
  6. package/dist/OdinDbClient.d.ts +0 -16
  7. package/dist/OdinDbClient.js +0 -32
  8. package/dist/accessors-v2/index.d.ts +0 -4
  9. package/dist/accessors-v2/index.js +2 -10
  10. package/dist/actions-v2/CancelOrderForEtfPaidDto.d.ts +67 -0
  11. package/dist/actions-v2/CancelOrderForEtfPaidDto.js +59 -0
  12. package/dist/actions-v2/CreateOutboundDialCampaignDto.d.ts +8 -1
  13. package/dist/actions-v2/CreateOutboundDialSessionDto.d.ts +15 -1
  14. package/dist/actions-v2/UpdateOutboundDialSessionDto.d.ts +15 -1
  15. package/dist/actions-v2/UpdateoutbounddialcampaignDto.d.ts +8 -1
  16. package/dist/api-sdk-v2/QaReportAmendmentApi.d.ts +48 -0
  17. package/dist/api-sdk-v2/QaReportAmendmentApi.js +155 -0
  18. package/dist/api-sdk-v2/QaReportApi.d.ts +2 -0
  19. package/dist/api-sdk-v2/QaReportApi.js +6 -0
  20. package/dist/db-accessors-v2/index.d.ts +0 -4
  21. package/dist/db-accessors-v2/index.js +2 -10
  22. package/dist/db-sdk-v2/CrmDatasetDb.d.ts +2 -2
  23. package/dist/db-sdk-v2/CrmDatasetDb.js +4 -4
  24. package/dist/db-sdk-v2/QaReportAmendmentDb.d.ts +120 -0
  25. package/dist/db-sdk-v2/QaReportAmendmentDb.js +204 -0
  26. package/dist/db-sdk-v2/QaReportDb.d.ts +2 -0
  27. package/dist/db-sdk-v2/QaReportDb.js +6 -0
  28. package/dist/entities-v2/HomeMove.d.ts +23 -1
  29. package/dist/entities-v2/HomeMove.js +17 -1
  30. package/dist/entities-v2/OrderItem.d.ts +2 -0
  31. package/dist/entities-v2/OrderItem.js +2 -0
  32. package/dist/entities-v2/OutboundDialCampaign.d.ts +9 -1
  33. package/dist/entities-v2/OutboundDialCampaign.js +2 -0
  34. package/dist/entities-v2/OutboundDialSession.d.ts +17 -1
  35. package/dist/entities-v2/OutboundDialSession.js +4 -0
  36. package/dist/entities-v2/QaReport.d.ts +70 -1
  37. package/dist/entities-v2/QaReport.js +31 -1
  38. package/dist/entities-v2/QaReportAmendment.d.ts +209 -0
  39. package/dist/entities-v2/QaReportAmendment.js +120 -0
  40. package/dist/records-v2/OrderRecord.d.ts +25 -0
  41. package/dist/records-v2/OrderRecord.js +29 -0
  42. package/dist/records-v2/index.d.ts +0 -4
  43. package/dist/records-v2/index.js +2 -14
  44. package/package.json +1 -1
  45. package/dist/accessors-v2/QaAutoFailAccessor.d.ts +0 -112
  46. package/dist/accessors-v2/QaAutoFailAccessor.js +0 -191
  47. package/dist/accessors-v2/QaRubricAccessor.d.ts +0 -112
  48. package/dist/accessors-v2/QaRubricAccessor.js +0 -191
  49. package/dist/accessors-v2/QaRubricItemAccessor.d.ts +0 -112
  50. package/dist/accessors-v2/QaRubricItemAccessor.js +0 -191
  51. package/dist/accessors-v2/QaRubricSectionAccessor.d.ts +0 -112
  52. package/dist/accessors-v2/QaRubricSectionAccessor.js +0 -191
  53. package/dist/actions-v2/UpdateQaAutoFailDto.d.ts +0 -102
  54. package/dist/actions-v2/UpdateQaAutoFailDto.js +0 -56
  55. package/dist/actions-v2/UpdateQaRubricDto.d.ts +0 -103
  56. package/dist/actions-v2/UpdateQaRubricDto.js +0 -56
  57. package/dist/actions-v2/UpdateQaRubricItemDto.d.ts +0 -157
  58. package/dist/actions-v2/UpdateQaRubricItemDto.js +0 -56
  59. package/dist/actions-v2/UpdateQaRubricSectionDto.d.ts +0 -87
  60. package/dist/actions-v2/UpdateQaRubricSectionDto.js +0 -56
  61. package/dist/db-accessors-v2/QaAutoFailDbAccessor.d.ts +0 -180
  62. package/dist/db-accessors-v2/QaAutoFailDbAccessor.js +0 -265
  63. package/dist/db-accessors-v2/QaRubricDbAccessor.d.ts +0 -180
  64. package/dist/db-accessors-v2/QaRubricDbAccessor.js +0 -265
  65. package/dist/db-accessors-v2/QaRubricItemDbAccessor.d.ts +0 -180
  66. package/dist/db-accessors-v2/QaRubricItemDbAccessor.js +0 -265
  67. package/dist/db-accessors-v2/QaRubricSectionDbAccessor.d.ts +0 -180
  68. package/dist/db-accessors-v2/QaRubricSectionDbAccessor.js +0 -265
  69. package/dist/records-v2/QaAutoFailRecord.d.ts +0 -205
  70. package/dist/records-v2/QaAutoFailRecord.js +0 -275
  71. package/dist/records-v2/QaRubricItemRecord.d.ts +0 -205
  72. package/dist/records-v2/QaRubricItemRecord.js +0 -275
  73. package/dist/records-v2/QaRubricRecord.d.ts +0 -225
  74. package/dist/records-v2/QaRubricRecord.js +0 -308
  75. package/dist/records-v2/QaRubricSectionRecord.d.ts +0 -225
  76. package/dist/records-v2/QaRubricSectionRecord.js +0 -308
@@ -1,308 +0,0 @@
1
- "use strict";
2
- /**
3
- * QaRubricSection 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.qaRubricSections.new();
14
- * await record.createQaRubricSection({ ... }).execute();
15
- * ```
16
- *
17
- * Entity Types: DEFAULT
18
- *
19
- * AUTO-GENERATED - DO NOT EDIT DIRECTLY
20
- */
21
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
22
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
23
- return new (P || (P = Promise))(function (resolve, reject) {
24
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
25
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
26
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
27
- step((generator = generator.apply(thisArg, _arguments || [])).next());
28
- });
29
- };
30
- Object.defineProperty(exports, "__esModule", { value: true });
31
- exports.isQaRubricSectionRecord = exports.QaRubricSectionRecord = void 0;
32
- const uuid_1 = require("uuid");
33
- const core_1 = require("@d19n/odin-types/dist/core");
34
- const record_link_manager_1 = require("@d19n/odin-sdk-generator/dist/record-link-manager");
35
- const QaRubricRecord_1 = require("./QaRubricRecord");
36
- const QaRubricItemRecord_1 = require("./QaRubricItemRecord");
37
- /**
38
- * Builder for action execution with dryRun support
39
- *
40
- * Provides a consistent API across all action types:
41
- * - `.execute()` - Execute the action and return results
42
- * - `.dryRun()` - Return the payload without executing (for debugging)
43
- */
44
- class ActionBuilder {
45
- constructor(provider, moduleName, entityName, payload, clearPendingLinks) {
46
- this._provider = provider;
47
- this._moduleName = moduleName;
48
- this._entityName = entityName;
49
- this._payload = payload;
50
- this._clearPendingLinks = clearPendingLinks;
51
- }
52
- /**
53
- * Set an external system identifier for this record.
54
- * Links the record to a corresponding entry in an external application.
55
- *
56
- * @param externalId - The ID in the external system
57
- * @param externalAppId - The external application identifier
58
- * @returns this (for chaining)
59
- *
60
- * @example
61
- * ```typescript
62
- * await record.createOrder({ ... }).withExternalId('SF-123', 'salesforce').execute();
63
- * ```
64
- */
65
- withExternalId(externalId, externalAppId) {
66
- this._payload.externalId = externalId;
67
- this._payload.externalAppId = externalAppId;
68
- return this;
69
- }
70
- /**
71
- * Set security/access groups for this record.
72
- * Controls which user groups can access the record.
73
- *
74
- * @param groups - Array of group names
75
- * @returns this (for chaining)
76
- *
77
- * @example
78
- * ```typescript
79
- * await record.createOrder({ ... }).withGroups(['TenantA', 'BillingTeam']).execute();
80
- * ```
81
- */
82
- withGroups(groups) {
83
- this._payload.groups = groups;
84
- return this;
85
- }
86
- /**
87
- * Execute the action
88
- * @returns The result from the API
89
- */
90
- execute() {
91
- return __awaiter(this, void 0, void 0, function* () {
92
- const result = yield this._provider._applyAction(this._moduleName, this._entityName, this._payload);
93
- this._clearPendingLinks();
94
- return result;
95
- });
96
- }
97
- /**
98
- * Returns the request payload without executing (for debugging)
99
- * @returns The request payload that would be sent to the API
100
- */
101
- dryRun() {
102
- return this._payload;
103
- }
104
- /**
105
- * Prevents accidental `await actionBuilder` without .execute()
106
- * Forces developers to explicitly call .execute()
107
- * @throws Error always - use .execute() or .dryRun() instead
108
- */
109
- then() {
110
- throw new Error('ActionBuilder cannot be awaited directly. Call .execute() to run the action or .dryRun() to get the payload.');
111
- }
112
- }
113
- class QaRubricSectionRecord {
114
- /**
115
- * Create a record wrapper.
116
- * @param record - The underlying record, or null for create operations
117
- * @param provider - The API or DB provider
118
- * @param preGeneratedId - Optional pre-generated ID for new records (auto-generated if not provided)
119
- */
120
- constructor(record, provider, preGeneratedId) {
121
- this._pendingLinks = [];
122
- this._record = record;
123
- this._provider = provider;
124
- this._preGeneratedId = preGeneratedId !== null && preGeneratedId !== void 0 ? preGeneratedId : (0, uuid_1.v4)();
125
- }
126
- // ============================================
127
- // CORE PROPERTIES
128
- // ============================================
129
- /** Returns true if this is a new (unsaved) record */
130
- get isNew() { var _a; return !((_a = this._record) === null || _a === void 0 ? void 0 : _a.id); }
131
- /** Record ID - always available (pre-generated for new records) */
132
- 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; }
133
- get entity() { var _a, _b; return (_b = (_a = this._record) === null || _a === void 0 ? void 0 : _a.entity) !== null && _b !== void 0 ? _b : 'SupportModule:QaRubricSection'; }
134
- get type() { var _a; return (_a = this._record) === null || _a === void 0 ? void 0 : _a.type; }
135
- /** Record properties - empty object for new (unsaved) records */
136
- get properties() { var _a; return ((_a = this._record) === null || _a === void 0 ? void 0 : _a.properties) || {}; }
137
- get title() { var _a; return (_a = this._record) === null || _a === void 0 ? void 0 : _a.title; }
138
- get recordNumber() { var _a; return (_a = this._record) === null || _a === void 0 ? void 0 : _a.recordNumber; }
139
- get stage() { var _a; return (_a = this._record) === null || _a === void 0 ? void 0 : _a.stage; }
140
- get createdAt() { var _a; return (_a = this._record) === null || _a === void 0 ? void 0 : _a.createdAt; }
141
- get updatedAt() { var _a; return (_a = this._record) === null || _a === void 0 ? void 0 : _a.updatedAt; }
142
- get externalId() { var _a; return (_a = this._record) === null || _a === void 0 ? void 0 : _a.externalId; }
143
- get externalAppId() { var _a; return (_a = this._record) === null || _a === void 0 ? void 0 : _a.externalAppId; }
144
- get groups() { var _a; return ((_a = this._record) === null || _a === void 0 ? void 0 : _a.groups) || []; }
145
- /** Link metadata - populated only when the read passed withLinks (empty otherwise) */
146
- get links() { var _a, _b; return (_b = (_a = this._record) === null || _a === void 0 ? void 0 : _a.links) !== null && _b !== void 0 ? _b : []; }
147
- /** Access the underlying OdinRecord (null for new records) */
148
- get record() { return this._record; }
149
- // ============================================
150
- // TYPE GUARDS (with TypeScript type predicates)
151
- // ============================================
152
- /**
153
- * Type guard: check if this record is of type DEFAULT
154
- *
155
- * When this returns true, TypeScript automatically narrows the type,
156
- * giving you access to DEFAULT-specific properties.
157
- *
158
- * @example
159
- * ```typescript
160
- * if (record.isDefault()) {
161
- * // TypeScript knows record.properties is QaRubricSectionProperties
162
- * console.log(record.properties.SomeTypeSpecificField);
163
- * }
164
- * ```
165
- * @remarks This is the default record type
166
- */
167
- isDefault() { var _a; return ((_a = this._record) === null || _a === void 0 ? void 0 : _a.type) === 'DEFAULT'; }
168
- /**
169
- * Access linked QaRubric records
170
- * @remarks Available labels: Rubric__Section
171
- * @throws Error if called on a new (unsaved) record
172
- *
173
- * @example
174
- * ```typescript
175
- * // Get all linked QaRubric records
176
- * const items = await record.qaRubrics.list();
177
- * const first = await record.qaRubrics.first();
178
- *
179
- * // Filter by label
180
- * const specific = await record.qaRubrics.first({ label: 'Rubric__Section' });
181
- * ```
182
- */
183
- get qaRubrics() {
184
- var _a;
185
- if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
186
- throw new Error('Cannot access links on a new (unsaved) record');
187
- if (!this._qaRubrics) {
188
- this._qaRubrics = new record_link_manager_1.RecordLinkManager(this._provider, this._record, {
189
- sourceEntity: 'SupportModule:QaRubricSection',
190
- targetEntity: 'SupportModule:QaRubric',
191
- targetModuleName: 'SupportModule',
192
- targetEntityName: 'QaRubric',
193
- labels: ['Rubric__Section'],
194
- }, QaRubricRecord_1.QaRubricRecord);
195
- }
196
- return this._qaRubrics;
197
- }
198
- /**
199
- * Access linked QaRubricItem records
200
- * @remarks Available labels: Section__Item
201
- * @throws Error if called on a new (unsaved) record
202
- *
203
- * @example
204
- * ```typescript
205
- * // Get all linked QaRubricItem records
206
- * const items = await record.qaRubricItems.list();
207
- * const first = await record.qaRubricItems.first();
208
- *
209
- * // Filter by label
210
- * const specific = await record.qaRubricItems.first({ label: 'Section__Item' });
211
- * ```
212
- */
213
- get qaRubricItems() {
214
- var _a;
215
- if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
216
- throw new Error('Cannot access links on a new (unsaved) record');
217
- if (!this._qaRubricItems) {
218
- this._qaRubricItems = new record_link_manager_1.RecordLinkManager(this._provider, this._record, {
219
- sourceEntity: 'SupportModule:QaRubricSection',
220
- targetEntity: 'SupportModule:QaRubricItem',
221
- targetModuleName: 'SupportModule',
222
- targetEntityName: 'QaRubricItem',
223
- labels: ['Section__Item'],
224
- }, QaRubricItemRecord_1.QaRubricItemRecord);
225
- }
226
- return this._qaRubricItems;
227
- }
228
- // ============================================
229
- // LINK MANAGEMENT
230
- // ============================================
231
- /**
232
- * Queue a link to be created with the next action.
233
- * Works for both create and update actions.
234
- * @returns this (for chaining)
235
- */
236
- link(target) {
237
- this._pendingLinks.push(new core_1.OdinRecordLinkDto({ id: target.id, entity: target.entity }));
238
- return this;
239
- }
240
- /** Get the currently queued links */
241
- get pendingLinks() {
242
- return [...this._pendingLinks];
243
- }
244
- /** Clear pending links without executing an action */
245
- clearPendingLinks() {
246
- this._pendingLinks = [];
247
- return this;
248
- }
249
- /**
250
- * Immediately unlink a record (API call).
251
- * Unlike link(), this executes immediately.
252
- * @throws Error if called on a new (unsaved) record
253
- */
254
- unlink(target) {
255
- var _a;
256
- return __awaiter(this, void 0, void 0, function* () {
257
- if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
258
- throw new Error('Cannot unlink from a new (unsaved) record');
259
- const targetId = typeof target === 'string' ? target : target.id;
260
- yield this._provider._deleteLinks('SupportModule', 'QaRubricSection', this._record.id, targetId);
261
- });
262
- }
263
- // ============================================
264
- // UPDATE ACTIONS (require existing record)
265
- // ============================================
266
- /**
267
- * UpdateQaRubricSection
268
- *
269
- * Updates this QaRubricSection record with the specified properties.
270
- * Returns an ActionBuilder - call .execute() to update or .dryRun() for debugging.
271
- *
272
- * @param properties - Required properties for this action
273
- * @param options - Optional settings
274
- * @param options.journeyId - Associate with a journey
275
- * @param options.stageKey - Transition to pipeline stage
276
- * @returns ActionBuilder - call .execute() to update or .dryRun() for payload
277
- * @throws Error if called on a new (unsaved) record
278
- *
279
- * @example
280
- * ```typescript
281
- * const record = await odinClient.qaRubricSections.get(id);
282
- * await record.updateQaRubricSection({ ... }).execute();
283
- *
284
- * // Dry run (for debugging)
285
- * const payload = record.updateQaRubricSection({ ... }).dryRun();
286
- * ```
287
- */
288
- updateQaRubricSection(properties, options) {
289
- var _a;
290
- if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
291
- throw new Error('updateQaRubricSection requires an existing record. Use accessor.get() first.');
292
- const payload = Object.assign({ id: this._record.id, entity: this._record.entity, type: this._record.type, actionName: 'UpdateQaRubricSection', properties, associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined }, options);
293
- return new ActionBuilder(this._provider, 'SupportModule', 'QaRubricSection', payload, () => { this._pendingLinks = []; });
294
- }
295
- }
296
- exports.QaRubricSectionRecord = QaRubricSectionRecord;
297
- // ============================================
298
- // TYPED LINK ACCESSORS
299
- // ============================================
300
- /** Valid labels for QaRubric associations */
301
- QaRubricSectionRecord.qaRubricsLabels = ['Rubric__Section'];
302
- /** Valid labels for QaRubricItem associations */
303
- QaRubricSectionRecord.qaRubricItemsLabels = ['Section__Item'];
304
- /** Type guard to check if an object is a QaRubricSectionRecord */
305
- function isQaRubricSectionRecord(obj) {
306
- return obj instanceof QaRubricSectionRecord;
307
- }
308
- exports.isQaRubricSectionRecord = isQaRubricSectionRecord;