@d19n/youfibre-odin-sdk 2.0.68 → 2.0.70

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.
@@ -0,0 +1,227 @@
1
+ "use strict";
2
+ /**
3
+ * TwilioTaskQueue DB Accessor
4
+ *
5
+ * Provides typed access to TwilioTaskQueue records via direct database access.
6
+ * For use in backend services with principal + dbService.
7
+ * Returns wrapped records with typed action methods.
8
+ *
9
+ * @example
10
+ * ```typescript
11
+ * // Simple get
12
+ * const record = await accessor.get(id);
13
+ *
14
+ * // With related entities
15
+ * const record = await accessor.get(id, { entities: ["Contact", "Address"] });
16
+ *
17
+ * // With permissions bypass (separate options)
18
+ * const record = await accessor.get(id, {}, { omitPermissionsCheck: true });
19
+ *
20
+ * // Silent write (no RabbitMQ events)
21
+ * const result = await accessor.upsert([dto], { omitWriteEvents: true });
22
+ *
23
+ * // Constructor-level default (applies to all calls)
24
+ * const accessor = new TwilioTaskQueueDbAccessor(principal, dbService, { omitPermissionsCheck: true });
25
+ * ```
26
+ *
27
+ * AUTO-GENERATED - DO NOT EDIT DIRECTLY
28
+ */
29
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
30
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
31
+ return new (P || (P = Promise))(function (resolve, reject) {
32
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
33
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
34
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
35
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
36
+ });
37
+ };
38
+ var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
39
+ var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
40
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
41
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
42
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
43
+ function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
44
+ function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
45
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
46
+ function fulfill(value) { resume("next", value); }
47
+ function reject(value) { resume("throw", value); }
48
+ function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
49
+ };
50
+ Object.defineProperty(exports, "__esModule", { value: true });
51
+ exports.TwilioTaskQueueDbAccessor = void 0;
52
+ const db_provider_1 = require("@d19n/odin-sdk-generator/dist/db.provider");
53
+ const query_builder_1 = require("@d19n/odin-sdk-generator/dist/query-builder");
54
+ const TwilioTaskQueueRecord_1 = require("../records-v2/TwilioTaskQueueRecord");
55
+ class TwilioTaskQueueDbAccessor {
56
+ /**
57
+ * Create a new TwilioTaskQueueDbAccessor
58
+ * @param principal - The authenticated principal
59
+ * @param dbService - The database service instance
60
+ * @param defaultOptions - Default provider options applied to all operations
61
+ */
62
+ constructor(principal, dbService, defaultOptions) {
63
+ this._moduleName = 'ServiceModule';
64
+ this._entityName = 'TwilioTaskQueue';
65
+ this._provider = new db_provider_1.DbProvider(principal, dbService, defaultOptions);
66
+ this._defaultOptions = defaultOptions;
67
+ }
68
+ get moduleName() { return this._moduleName; }
69
+ get entityName() { return this._entityName; }
70
+ // ============================================
71
+ // RECORD CREATION
72
+ // ============================================
73
+ /**
74
+ * Create a new empty TwilioTaskQueue record instance for create operations.
75
+ * Pre-generates an ID that can be referenced before the record is saved.
76
+ *
77
+ * @param id - Optional ID to use (auto-generated UUID if not provided)
78
+ * @returns A new record wrapper with pre-generated ID
79
+ *
80
+ * @example
81
+ * ```typescript
82
+ * // Auto-generated ID
83
+ * const note = odinDb.notes.new();
84
+ * console.log(note.id); // UUID available immediately
85
+ *
86
+ * // Custom ID
87
+ * const order = odinDb.orders.new("custom-id-123");
88
+ *
89
+ * // Reference ID before save
90
+ * const account = odinDb.accounts.new();
91
+ * const contact = odinDb.contacts.new();
92
+ * await contact
93
+ * .link({ id: account.id, entity: "CrmModule:Account" })
94
+ * .createContact({ FirstName: "John" });
95
+ * ```
96
+ */
97
+ new(id) {
98
+ return new TwilioTaskQueueRecord_1.TwilioTaskQueueRecord(null, this._provider, id);
99
+ }
100
+ // ============================================
101
+ // RECORD RETRIEVAL
102
+ // ============================================
103
+ /**
104
+ * Get a single TwilioTaskQueue record by ID
105
+ *
106
+ * @param id - The record ID
107
+ * @param queryOptions - Query options (WHAT to fetch: entities to include)
108
+ * @param providerOptions - Provider options (HOW to fetch: omitPermissionsCheck)
109
+ *
110
+ * @example
111
+ * ```typescript
112
+ * // Simple get
113
+ * const record = await accessor.get(id);
114
+ *
115
+ * // With related entities
116
+ * const record = await accessor.get(id, { entities: ["Contact", "Address"] });
117
+ *
118
+ * // With permissions bypass
119
+ * const record = await accessor.get(id, {}, { omitPermissionsCheck: true });
120
+ *
121
+ * // Both options
122
+ * const record = await accessor.get(id, { entities: ["Invoice"] }, { omitPermissionsCheck: true });
123
+ * ```
124
+ */
125
+ get(id, queryOptions, providerOptions) {
126
+ return __awaiter(this, void 0, void 0, function* () {
127
+ const record = yield this._provider._getByPrimaryKey(this._moduleName, this._entityName, id, queryOptions, providerOptions);
128
+ return new TwilioTaskQueueRecord_1.TwilioTaskQueueRecord(record, this._provider);
129
+ });
130
+ }
131
+ /**
132
+ * Get multiple TwilioTaskQueue records by IDs
133
+ *
134
+ * @param ids - Array of record IDs
135
+ * @param queryOptions - Query options (WHAT to fetch: entities to include)
136
+ * @param providerOptions - Provider options (HOW to fetch: omitPermissionsCheck)
137
+ */
138
+ getMany(ids, queryOptions, providerOptions) {
139
+ return __awaiter(this, void 0, void 0, function* () {
140
+ if (ids.length === 0)
141
+ return [];
142
+ const records = yield this._provider._getManyByPrimaryKey(this._moduleName, this._entityName, ids, queryOptions, providerOptions);
143
+ return records.map((r) => new TwilioTaskQueueRecord_1.TwilioTaskQueueRecord(r, this._provider));
144
+ });
145
+ }
146
+ // ============================================
147
+ // SEARCH OPERATIONS
148
+ // ============================================
149
+ /**
150
+ * Search TwilioTaskQueue records
151
+ *
152
+ * @param params - Search parameters
153
+ * @param providerOptions - Provider options (HOW to fetch: omitPermissionsCheck)
154
+ */
155
+ search(params, providerOptions) {
156
+ return __awaiter(this, void 0, void 0, function* () {
157
+ const result = yield this._provider._searchRecords(this._moduleName, this._entityName, params, providerOptions);
158
+ return {
159
+ records: result.records.map((r) => new TwilioTaskQueueRecord_1.TwilioTaskQueueRecord(r, this._provider)),
160
+ totalRecords: result.totalRecords,
161
+ hasMore: result.hasMore,
162
+ };
163
+ });
164
+ }
165
+ /**
166
+ * Search all TwilioTaskQueue records with automatic pagination
167
+ *
168
+ * @param params - Search parameters
169
+ * @param providerOptions - Provider options (HOW to fetch: omitPermissionsCheck)
170
+ */
171
+ searchAll(params, providerOptions) {
172
+ return __awaiter(this, void 0, void 0, function* () {
173
+ const result = yield this._provider._searchAllRecordsAndPaginate(this._moduleName, this._entityName, params, 0, providerOptions);
174
+ return result.records.map((r) => new TwilioTaskQueueRecord_1.TwilioTaskQueueRecord(r, this._provider));
175
+ });
176
+ }
177
+ /**
178
+ * Async generator for paginating through all matching records.
179
+ * Yields batches of wrapped records.
180
+ *
181
+ * @param params - Search parameters
182
+ * @param providerOptions - Provider options (HOW to fetch: omitPermissionsCheck)
183
+ */
184
+ paginate(params, providerOptions) {
185
+ var _a;
186
+ return __asyncGenerator(this, arguments, function* paginate_1() {
187
+ let hasMore = true;
188
+ let searchAfter;
189
+ const query = Object.assign(Object.assign({}, params.query), { pageSize: ((_a = params.query) === null || _a === void 0 ? void 0 : _a.pageSize) || 500 });
190
+ while (hasMore) {
191
+ const result = yield __await(this._provider._searchRecords(this._moduleName, this._entityName, Object.assign(Object.assign({}, params), { query: Object.assign(Object.assign({}, query), { searchAfter }) }), providerOptions));
192
+ if (result.records.length > 0) {
193
+ yield yield __await(result.records.map((r) => new TwilioTaskQueueRecord_1.TwilioTaskQueueRecord(r, this._provider)));
194
+ const lastRecord = result.records[result.records.length - 1];
195
+ searchAfter = lastRecord === null || lastRecord === void 0 ? void 0 : lastRecord.sort;
196
+ }
197
+ hasMore = result.hasMore && result.records.length >= query.pageSize;
198
+ }
199
+ });
200
+ }
201
+ // ============================================
202
+ // QUERY BUILDER
203
+ // ============================================
204
+ /**
205
+ * Create a fluent query builder for TwilioTaskQueue records
206
+ *
207
+ * @example
208
+ * ```typescript
209
+ * const results = await accessor
210
+ * .query()
211
+ * .where('Status', 'in', ['Active', 'Pending'])
212
+ * .where('CreatedAt', 'gte', '2025-01-01')
213
+ * .select('id', 'title', 'properties.*')
214
+ * .sortBy('createdAt', 'desc')
215
+ * .limit(100)
216
+ * .execute();
217
+ * ```
218
+ */
219
+ query() {
220
+ return (0, query_builder_1.createQueryBuilder)(this);
221
+ }
222
+ /** Access the underlying DbProvider */
223
+ get provider() {
224
+ return this._provider;
225
+ }
226
+ }
227
+ exports.TwilioTaskQueueDbAccessor = TwilioTaskQueueDbAccessor;
@@ -105,6 +105,7 @@ export { SweeperMaintenanceAuditDbAccessor, SweeperMaintenanceAuditDbSearchRespo
105
105
  export { TeamDbAccessor, TeamDbSearchResponse } from './TeamDbAccessor';
106
106
  export { TimeSlotDbAccessor, TimeSlotDbSearchResponse } from './TimeSlotDbAccessor';
107
107
  export { TransactionDbAccessor, TransactionDbSearchResponse } from './TransactionDbAccessor';
108
+ export { TwilioTaskQueueDbAccessor, TwilioTaskQueueDbSearchResponse } from './TwilioTaskQueueDbAccessor';
108
109
  export { UgAuditOfInstallationDbAccessor, UgAuditOfInstallationDbSearchResponse } from './UgAuditOfInstallationDbAccessor';
109
110
  export { UgExternalAuditDbAccessor, UgExternalAuditDbSearchResponse } from './UgExternalAuditDbAccessor';
110
111
  export { UgInProgressAuditDbAccessor, UgInProgressAuditDbSearchResponse } from './UgInProgressAuditDbAccessor';
@@ -10,8 +10,8 @@
10
10
  */
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.OhExternalAuditDbAccessor = exports.OhAuditOfInstallationDbAccessor = exports.OfferDbAccessor = exports.NoteDbAccessor = exports.NetworkDeviceDbAccessor = exports.MessageDbAccessor = exports.LeadDbAccessor = exports.KnowledgeArticleDbAccessor = exports.InvoiceDbAccessor = exports.InvoiceItemDbAccessor = exports.InternalInstallAuditDbAccessor = exports.ImpersonationTrackerDbAccessor = exports.FieldServiceProductDbAccessor = exports.FieldServiceDispatchedProductDbAccessor = exports.ExchangeDbAccessor = exports.EmailTemplateDbAccessor = exports.EmailSenderDbAccessor = exports.EmailDbAccessor = exports.DiscountDbAccessor = exports.CustomerPhonePortingDbAccessor = exports.CustomerDeviceRouterDbAccessor = exports.CustomerDeviceOntDbAccessor = exports.CustomerDeviceConfigurationDbAccessor = exports.CustomerDeviceAtaDbAccessor = exports.CrmDatasetDbAccessor = exports.CreditNoteDbAccessor = exports.ConversationDbAccessor = exports.ContractBuyOutDbAccessor = exports.ContactDbAccessor = exports.ConfigDbAccessor = exports.ChurnRequestDbAccessor = exports.ChangeReasonDbAccessor = exports.CaseDbAccessor = exports.CampaignDbAccessor = exports.CallTransferDbAccessor = exports.CallDbAccessor = exports.CallLegDbAccessor = exports.CallEventDbAccessor = exports.BrskEntityMigrationErrorDbAccessor = exports.BngProvisionDbAccessor = exports.BlockageA55DbAccessor = exports.BillingRequestDbAccessor = exports.BillingAdjustmentDbAccessor = exports.AppointmentDbAccessor = exports.AffiliateCodeDbAccessor = exports.AddressDbAccessor = exports.ActivityDbAccessor = exports.ActivityLogDbAccessor = exports.AccountDbAccessor = exports.AccountCreditDbAccessor = void 0;
13
- exports.UgExternalAuditDbAccessor = exports.UgAuditOfInstallationDbAccessor = exports.TransactionDbAccessor = exports.TimeSlotDbAccessor = exports.TeamDbAccessor = exports.SweeperMaintenanceAuditDbAccessor = exports.SmsMessageDbAccessor = exports.SiteSpecificRiskAssessmentOutcomeFormDbAccessor = exports.ServiceVisitAuditDbAccessor = exports.ServiceDbAccessor = exports.ServiceAppointmentDbAccessor = exports.ServiceAppointmentConfigDbAccessor = exports.ScheduleSlotDbAccessor = exports.SalesTerritoryDbAccessor = exports.RewardDbAccessor = exports.ReturnsDbAccessor = exports.RemediationRequiredReasonDbAccessor = exports.RemediationOutcomeFormDbAccessor = exports.ReferralDbAccessor = exports.PushNotificationDbAccessor = exports.ProductDbAccessor = exports.PriceBookDbAccessor = exports.PgWebhookDbAccessor = exports.PgWebhookAttemptDbAccessor = exports.PgVocalinkDbAccessor = exports.PgTransactionDbAccessor = exports.PgSortCodeSubstitutionDbAccessor = exports.PgPaymentMethodDbAccessor = exports.PgLogDbAccessor = exports.PgFileAllocationDbAccessor = exports.PgDisputeDbAccessor = exports.PgDirectDebitFileDbAccessor = exports.PgContactDbAccessor = exports.PgAccountValidationDbAccessor = exports.PermissionToFailDbAccessor = exports.PaymentDbAccessor = exports.PaymentMethodRefundDbAccessor = exports.PaymentMethodDbAccessor = exports.PICRequestDbAccessor = exports.OverlayRealA55DbAccessor = exports.OutageDbAccessor = exports.OrderDbAccessor = exports.OrderKciDbAccessor = exports.OrderItemDbAccessor = exports.OrderCheckDbAccessor = exports.OntReplacementApprovalDbAccessor = exports.OneTouchSwitchDbAccessor = exports.OhRetroAuditDbAccessor = exports.OhInstallationAuditDbAccessor = exports.OhInProgressAuditDbAccessor = void 0;
14
- exports.YfFieldServiceVisitDbAccessor = exports.WorkOrderStatusUpdateDbAccessor = exports.WorkOrderDbAccessor = exports.WayleaveAuditDbAccessor = exports.VoiceConfigurationDbAccessor = exports.VisitDbAccessor = exports.UserDbAccessor = exports.UgRetroAuditDbAccessor = exports.UgInstallationAuditDbAccessor = exports.UgInProgressAuditDbAccessor = void 0;
13
+ exports.UgAuditOfInstallationDbAccessor = exports.TwilioTaskQueueDbAccessor = exports.TransactionDbAccessor = exports.TimeSlotDbAccessor = exports.TeamDbAccessor = exports.SweeperMaintenanceAuditDbAccessor = exports.SmsMessageDbAccessor = exports.SiteSpecificRiskAssessmentOutcomeFormDbAccessor = exports.ServiceVisitAuditDbAccessor = exports.ServiceDbAccessor = exports.ServiceAppointmentDbAccessor = exports.ServiceAppointmentConfigDbAccessor = exports.ScheduleSlotDbAccessor = exports.SalesTerritoryDbAccessor = exports.RewardDbAccessor = exports.ReturnsDbAccessor = exports.RemediationRequiredReasonDbAccessor = exports.RemediationOutcomeFormDbAccessor = exports.ReferralDbAccessor = exports.PushNotificationDbAccessor = exports.ProductDbAccessor = exports.PriceBookDbAccessor = exports.PgWebhookDbAccessor = exports.PgWebhookAttemptDbAccessor = exports.PgVocalinkDbAccessor = exports.PgTransactionDbAccessor = exports.PgSortCodeSubstitutionDbAccessor = exports.PgPaymentMethodDbAccessor = exports.PgLogDbAccessor = exports.PgFileAllocationDbAccessor = exports.PgDisputeDbAccessor = exports.PgDirectDebitFileDbAccessor = exports.PgContactDbAccessor = exports.PgAccountValidationDbAccessor = exports.PermissionToFailDbAccessor = exports.PaymentDbAccessor = exports.PaymentMethodRefundDbAccessor = exports.PaymentMethodDbAccessor = exports.PICRequestDbAccessor = exports.OverlayRealA55DbAccessor = exports.OutageDbAccessor = exports.OrderDbAccessor = exports.OrderKciDbAccessor = exports.OrderItemDbAccessor = exports.OrderCheckDbAccessor = exports.OntReplacementApprovalDbAccessor = exports.OneTouchSwitchDbAccessor = exports.OhRetroAuditDbAccessor = exports.OhInstallationAuditDbAccessor = exports.OhInProgressAuditDbAccessor = void 0;
14
+ exports.YfFieldServiceVisitDbAccessor = exports.WorkOrderStatusUpdateDbAccessor = exports.WorkOrderDbAccessor = exports.WayleaveAuditDbAccessor = exports.VoiceConfigurationDbAccessor = exports.VisitDbAccessor = exports.UserDbAccessor = exports.UgRetroAuditDbAccessor = exports.UgInstallationAuditDbAccessor = exports.UgInProgressAuditDbAccessor = exports.UgExternalAuditDbAccessor = void 0;
15
15
  var AccountCreditDbAccessor_1 = require("./AccountCreditDbAccessor");
16
16
  Object.defineProperty(exports, "AccountCreditDbAccessor", { enumerable: true, get: function () { return AccountCreditDbAccessor_1.AccountCreditDbAccessor; } });
17
17
  var AccountDbAccessor_1 = require("./AccountDbAccessor");
@@ -208,6 +208,8 @@ var TimeSlotDbAccessor_1 = require("./TimeSlotDbAccessor");
208
208
  Object.defineProperty(exports, "TimeSlotDbAccessor", { enumerable: true, get: function () { return TimeSlotDbAccessor_1.TimeSlotDbAccessor; } });
209
209
  var TransactionDbAccessor_1 = require("./TransactionDbAccessor");
210
210
  Object.defineProperty(exports, "TransactionDbAccessor", { enumerable: true, get: function () { return TransactionDbAccessor_1.TransactionDbAccessor; } });
211
+ var TwilioTaskQueueDbAccessor_1 = require("./TwilioTaskQueueDbAccessor");
212
+ Object.defineProperty(exports, "TwilioTaskQueueDbAccessor", { enumerable: true, get: function () { return TwilioTaskQueueDbAccessor_1.TwilioTaskQueueDbAccessor; } });
211
213
  var UgAuditOfInstallationDbAccessor_1 = require("./UgAuditOfInstallationDbAccessor");
212
214
  Object.defineProperty(exports, "UgAuditOfInstallationDbAccessor", { enumerable: true, get: function () { return UgAuditOfInstallationDbAccessor_1.UgAuditOfInstallationDbAccessor; } });
213
215
  var UgExternalAuditDbAccessor_1 = require("./UgExternalAuditDbAccessor");
@@ -0,0 +1,117 @@
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 { TwilioTaskQueueProperties } from '../entities-v2/TwilioTaskQueue';
4
+ /**
5
+ * @deprecated Use OdinDbClient.
6
+ *
7
+ * Migration:
8
+ * - Old: new TwilioTaskQueueApi(authParams).get(id)
9
+ * - New: new odin.twiliotaskqueue.get(id)
10
+ *
11
+ * The new OdinDbClient returns typed record wrappers with action methods.
12
+ *
13
+ * Supports separate query options and provider options:
14
+ * - Constructor level: new TwilioTaskQueueDb(principal, dbService, { omitPermissionsCheck: true })
15
+ * - Method level: await db.getByPrimaryKey(id, { entities: [] }, { omitPermissionsCheck: true })
16
+ */
17
+ export declare class TwilioTaskQueueDb extends DbProvider {
18
+ protected readonly principal: any;
19
+ protected readonly dbService: any;
20
+ private readonly moduleName;
21
+ private readonly entityName;
22
+ private sourceRecord;
23
+ constructor(principal: any, dbService: any, defaultOptions?: DbProviderOptions);
24
+ setRecord(sourceRecord: any): void;
25
+ /**
26
+ * Search records with manual pagination control
27
+ * @param params - Search parameters
28
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
29
+ */
30
+ 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<TwilioTaskQueueProperties>>>;
31
+ /**
32
+ * Search all records with automatic pagination
33
+ * @param params - Search parameters
34
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
35
+ */
36
+ 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<TwilioTaskQueueProperties>>>;
37
+ /**
38
+ * Get a single record by primary key
39
+ * @param twilioTaskQueueId - Record ID
40
+ * @param queryOptions - Query options (WHAT: entities to include)
41
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
42
+ *
43
+ * @example
44
+ * // Simple get
45
+ * const record = await db.getByPrimaryKey(id);
46
+ *
47
+ * // With related entities
48
+ * const record = await db.getByPrimaryKey(id, { entities: ['InvoiceItem', 'Transaction'] });
49
+ *
50
+ * // With permissions bypass
51
+ * const record = await db.getByPrimaryKey(id, {}, { omitPermissionsCheck: true });
52
+ *
53
+ * // Both options
54
+ * const record = await db.getByPrimaryKey(id, { entities: ['Invoice'] }, { omitPermissionsCheck: true });
55
+ */
56
+ getByPrimaryKey(twilioTaskQueueId: string, queryOptions?: DbGetQueryOptions, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").OdinRecord<TwilioTaskQueueProperties>>;
57
+ /**
58
+ * Get multiple records by primary keys
59
+ * @param twilioTaskQueueIds - Array of record IDs
60
+ * @param queryOptions - Query options (WHAT: entities to include)
61
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
62
+ */
63
+ getManyByPrimaryKey(twilioTaskQueueIds: string[], queryOptions?: DbGetQueryOptions, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").OdinRecord<TwilioTaskQueueProperties>[]>;
64
+ /**
65
+ * Upsert a single record
66
+ * @param upsertDto - Record to upsert
67
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
68
+ */
69
+ upsert(upsertDto: OdinRecordCreateDto, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-sdk-generator").IDbRecordCreateUpdateRes>;
70
+ /**
71
+ * Upsert multiple records
72
+ * @param upsertDtos - Records to upsert
73
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
74
+ */
75
+ upsertMany(upsertDtos: OdinRecordCreateDto[], providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-sdk-generator").IDbRecordCreateUpdateRes[]>;
76
+ /**
77
+ * Update a single record
78
+ * @param updateDto - Record to update
79
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
80
+ */
81
+ update(updateDto: OdinRecordUpdateDto, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-sdk-generator").IDbRecordCreateUpdateRes>;
82
+ /**
83
+ * Update multiple records
84
+ * @param updateDtos - Records to update
85
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
86
+ */
87
+ updateMany(updateDtos: OdinRecordUpdateDto[], providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-sdk-generator").IDbRecordCreateUpdateRes[]>;
88
+ /**
89
+ * Delete one or many records
90
+ * @param twilioTaskQueueIds - Record IDs to delete
91
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
92
+ */
93
+ delete(twilioTaskQueueIds: string[], providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-sdk-generator").DbRecordDeleted[]>;
94
+ /**
95
+ * Restore one or many deleted records
96
+ * @param twilioTaskQueueIds - Record IDs to restore
97
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
98
+ */
99
+ restore(twilioTaskQueueIds: string[], providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-sdk-generator").DbRecordRestored[]>;
100
+ /**
101
+ * Apply an action to a record
102
+ * @param actionName - The action key
103
+ * @param dto - The action DTO
104
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
105
+ */
106
+ applyAction(actionName: string, dto: any, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-sdk-generator").IDbRecordCreateUpdateRes[]>;
107
+ /**
108
+ * Get version history for the current source record
109
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
110
+ */
111
+ getVersions(providerOptions?: DbProviderOptions): Promise<any>;
112
+ /**
113
+ * Get revision timeline for the current source record
114
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
115
+ */
116
+ getRevisionTimeline(providerOptions?: DbProviderOptions): Promise<any>;
117
+ }
@@ -0,0 +1,200 @@
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.TwilioTaskQueueDb = void 0;
13
+ const db_provider_1 = require("@d19n/odin-sdk-generator/dist/db.provider");
14
+ /**
15
+ * @deprecated Use OdinDbClient.
16
+ *
17
+ * Migration:
18
+ * - Old: new TwilioTaskQueueApi(authParams).get(id)
19
+ * - New: new odin.twiliotaskqueue.get(id)
20
+ *
21
+ * The new OdinDbClient returns typed record wrappers with action methods.
22
+ *
23
+ * Supports separate query options and provider options:
24
+ * - Constructor level: new TwilioTaskQueueDb(principal, dbService, { omitPermissionsCheck: true })
25
+ * - Method level: await db.getByPrimaryKey(id, { entities: [] }, { omitPermissionsCheck: true })
26
+ */
27
+ class TwilioTaskQueueDb extends db_provider_1.DbProvider {
28
+ // ============================================
29
+ // PRIVATE BACKING FIELDS (Lazy Loading)
30
+ // ============================================
31
+ constructor(principal, dbService, defaultOptions) {
32
+ super(principal, dbService, defaultOptions);
33
+ this.moduleName = 'ServiceModule';
34
+ this.entityName = 'TwilioTaskQueue';
35
+ this.principal = principal;
36
+ this.dbService = dbService;
37
+ // Link managers are lazy-loaded on first access
38
+ }
39
+ // ============================================
40
+ // LAZY-LOADED LINK MANAGERS (Public Getters)
41
+ // ============================================
42
+ // Usage remains identical: db.address.list(recordId)
43
+ // ============================================
44
+ // STANDARD METHODS
45
+ // ============================================
46
+ // Methods support separate query options and provider options for clean API
47
+ setRecord(sourceRecord) {
48
+ this.sourceRecord = sourceRecord;
49
+ }
50
+ /**
51
+ * Search records with manual pagination control
52
+ * @param params - Search parameters
53
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
54
+ */
55
+ searchRecords(params, providerOptions) {
56
+ return __awaiter(this, void 0, void 0, function* () {
57
+ return yield this._searchRecords(this.moduleName, this.entityName, params, providerOptions);
58
+ });
59
+ }
60
+ /**
61
+ * Search all records with automatic pagination
62
+ * @param params - Search parameters
63
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
64
+ */
65
+ searchAllRecordsAndPaginate(params, providerOptions) {
66
+ return __awaiter(this, void 0, void 0, function* () {
67
+ return yield this._searchAllRecordsAndPaginate(this.moduleName, this.entityName, params, 0, providerOptions);
68
+ });
69
+ }
70
+ /**
71
+ * Get a single record by primary key
72
+ * @param twilioTaskQueueId - Record ID
73
+ * @param queryOptions - Query options (WHAT: entities to include)
74
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
75
+ *
76
+ * @example
77
+ * // Simple get
78
+ * const record = await db.getByPrimaryKey(id);
79
+ *
80
+ * // With related entities
81
+ * const record = await db.getByPrimaryKey(id, { entities: ['InvoiceItem', 'Transaction'] });
82
+ *
83
+ * // With permissions bypass
84
+ * const record = await db.getByPrimaryKey(id, {}, { omitPermissionsCheck: true });
85
+ *
86
+ * // Both options
87
+ * const record = await db.getByPrimaryKey(id, { entities: ['Invoice'] }, { omitPermissionsCheck: true });
88
+ */
89
+ getByPrimaryKey(twilioTaskQueueId, queryOptions, providerOptions) {
90
+ return __awaiter(this, void 0, void 0, function* () {
91
+ const res = yield this._getByPrimaryKey(this.moduleName, this.entityName, twilioTaskQueueId, queryOptions, providerOptions);
92
+ if (res)
93
+ this.setRecord(res);
94
+ return res;
95
+ });
96
+ }
97
+ /**
98
+ * Get multiple records by primary keys
99
+ * @param twilioTaskQueueIds - Array of record IDs
100
+ * @param queryOptions - Query options (WHAT: entities to include)
101
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
102
+ */
103
+ getManyByPrimaryKey(twilioTaskQueueIds, queryOptions, providerOptions) {
104
+ return __awaiter(this, void 0, void 0, function* () {
105
+ return yield this._getManyByPrimaryKey(this.moduleName, this.entityName, twilioTaskQueueIds, queryOptions, providerOptions);
106
+ });
107
+ }
108
+ /**
109
+ * Upsert a single record
110
+ * @param upsertDto - Record to upsert
111
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
112
+ */
113
+ upsert(upsertDto, providerOptions) {
114
+ return __awaiter(this, void 0, void 0, function* () {
115
+ const res = yield this._upsert(this.moduleName, this.entityName, [upsertDto], providerOptions);
116
+ return res[0];
117
+ });
118
+ }
119
+ /**
120
+ * Upsert multiple records
121
+ * @param upsertDtos - Records to upsert
122
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
123
+ */
124
+ upsertMany(upsertDtos, providerOptions) {
125
+ return __awaiter(this, void 0, void 0, function* () {
126
+ return yield this._upsert(this.moduleName, this.entityName, upsertDtos, providerOptions);
127
+ });
128
+ }
129
+ /**
130
+ * Update a single record
131
+ * @param updateDto - Record to update
132
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
133
+ */
134
+ update(updateDto, providerOptions) {
135
+ return __awaiter(this, void 0, void 0, function* () {
136
+ const res = yield this._update(this.moduleName, this.entityName, [updateDto], providerOptions);
137
+ return res[0];
138
+ });
139
+ }
140
+ /**
141
+ * Update multiple records
142
+ * @param updateDtos - Records to update
143
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
144
+ */
145
+ updateMany(updateDtos, providerOptions) {
146
+ return __awaiter(this, void 0, void 0, function* () {
147
+ return yield this._update(this.moduleName, this.entityName, updateDtos, providerOptions);
148
+ });
149
+ }
150
+ /**
151
+ * Delete one or many records
152
+ * @param twilioTaskQueueIds - Record IDs to delete
153
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
154
+ */
155
+ delete(twilioTaskQueueIds, providerOptions) {
156
+ return __awaiter(this, void 0, void 0, function* () {
157
+ return yield this._delete(this.moduleName, this.entityName, twilioTaskQueueIds, providerOptions);
158
+ });
159
+ }
160
+ /**
161
+ * Restore one or many deleted records
162
+ * @param twilioTaskQueueIds - Record IDs to restore
163
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
164
+ */
165
+ restore(twilioTaskQueueIds, providerOptions) {
166
+ return __awaiter(this, void 0, void 0, function* () {
167
+ return yield this._restore(this.moduleName, this.entityName, twilioTaskQueueIds, providerOptions);
168
+ });
169
+ }
170
+ /**
171
+ * Apply an action to a record
172
+ * @param actionName - The action key
173
+ * @param dto - The action DTO
174
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
175
+ */
176
+ applyAction(actionName, dto, providerOptions) {
177
+ return __awaiter(this, void 0, void 0, function* () {
178
+ return yield this._applyAction(this.moduleName, this.entityName, dto, providerOptions);
179
+ });
180
+ }
181
+ /**
182
+ * Get version history for the current source record
183
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
184
+ */
185
+ getVersions(providerOptions) {
186
+ return __awaiter(this, void 0, void 0, function* () {
187
+ return yield this._getVersions(this.moduleName, this.entityName, this.sourceRecord.id, providerOptions);
188
+ });
189
+ }
190
+ /**
191
+ * Get revision timeline for the current source record
192
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
193
+ */
194
+ getRevisionTimeline(providerOptions) {
195
+ return __awaiter(this, void 0, void 0, function* () {
196
+ return yield this._getRevisionTimeline(this.moduleName, this.entityName, this.sourceRecord.id, providerOptions);
197
+ });
198
+ }
199
+ }
200
+ exports.TwilioTaskQueueDb = TwilioTaskQueueDb;