@d19n/youfibre-odin-sdk 2.0.142 → 2.0.144

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 (48) hide show
  1. package/README.md +14 -3
  2. package/dist/EntityRegistry.d.ts +2 -0
  3. package/dist/EntityRegistry.js +2 -0
  4. package/dist/OdinApiClient.d.ts +4 -0
  5. package/dist/OdinApiClient.js +8 -0
  6. package/dist/OdinDbClient.d.ts +4 -0
  7. package/dist/OdinDbClient.js +8 -0
  8. package/dist/accessors-v2/TwilioCallEventsAccessor.d.ts +111 -0
  9. package/dist/accessors-v2/TwilioCallEventsAccessor.js +190 -0
  10. package/dist/accessors-v2/index.d.ts +1 -0
  11. package/dist/accessors-v2/index.js +4 -2
  12. package/dist/actions-v2/CreateInboundCallStatusUpdateEventDto.d.ts +113 -0
  13. package/dist/actions-v2/CreateInboundCallStatusUpdateEventDto.js +59 -0
  14. package/dist/actions-v2/CreateNumberCallStatusEventDto.d.ts +105 -0
  15. package/dist/actions-v2/CreateNumberCallStatusEventDto.js +59 -0
  16. package/dist/actions-v2/CreateOutboundCallStatusUpdateEventDto.d.ts +113 -0
  17. package/dist/actions-v2/CreateOutboundCallStatusUpdateEventDto.js +59 -0
  18. package/dist/actions-v2/CreateOutboundDialActionEventDto.d.ts +113 -0
  19. package/dist/actions-v2/CreateOutboundDialActionEventDto.js +59 -0
  20. package/dist/actions-v2/UpdateCallOnTaskCanceledDto.d.ts +66 -0
  21. package/dist/actions-v2/UpdateCallOnTaskCanceledDto.js +52 -0
  22. package/dist/api-sdk-v2/CallApi.d.ts +2 -0
  23. package/dist/api-sdk-v2/CallApi.js +6 -0
  24. package/dist/api-sdk-v2/TwilioCallEventsApi.d.ts +48 -0
  25. package/dist/api-sdk-v2/TwilioCallEventsApi.js +155 -0
  26. package/dist/db-accessors-v2/TwilioCallEventsDbAccessor.d.ts +149 -0
  27. package/dist/db-accessors-v2/TwilioCallEventsDbAccessor.js +227 -0
  28. package/dist/db-accessors-v2/index.d.ts +1 -0
  29. package/dist/db-accessors-v2/index.js +4 -2
  30. package/dist/db-sdk-v2/CallDb.d.ts +2 -0
  31. package/dist/db-sdk-v2/CallDb.js +6 -0
  32. package/dist/db-sdk-v2/TwilioCallEventsDb.d.ts +120 -0
  33. package/dist/db-sdk-v2/TwilioCallEventsDb.js +204 -0
  34. package/dist/entities-v2/Call.d.ts +7 -0
  35. package/dist/entities-v2/Call.js +5 -1
  36. package/dist/entities-v2/CallEvent.d.ts +67 -1
  37. package/dist/entities-v2/CallEvent.js +9 -1
  38. package/dist/entities-v2/TwilioCallEvents.d.ts +282 -0
  39. package/dist/entities-v2/TwilioCallEvents.js +99 -0
  40. package/dist/records-v2/CallEventRecord.d.ts +19 -3
  41. package/dist/records-v2/CallEventRecord.js +17 -1
  42. package/dist/records-v2/CallRecord.d.ts +49 -0
  43. package/dist/records-v2/CallRecord.js +69 -0
  44. package/dist/records-v2/TwilioCallEventsRecord.d.ts +340 -0
  45. package/dist/records-v2/TwilioCallEventsRecord.js +436 -0
  46. package/dist/records-v2/index.d.ts +1 -0
  47. package/dist/records-v2/index.js +6 -3
  48. package/package.json +1 -1
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ /**
3
+ * UpdateCallOnTaskCanceled Action DTO
4
+ *
5
+ * UpdateCallOnTaskCanceled
6
+ *
7
+ * @module NotificationModule
8
+ * @entity Call
9
+ * @actionKey UpdateCallOnTaskCanceled
10
+ * @event k1.t-hEOJjsDb.NotificationModule.Call.Create.UpdateCallOnTaskCanceled
11
+ *
12
+ * AUTO-GENERATED - DO NOT EDIT DIRECTLY
13
+ */
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.UpdateCallOnTaskCanceledDto = void 0;
16
+ const core_1 = require("@d19n/odin-types/dist/core");
17
+ /**
18
+ * UpdateCallOnTaskCanceled
19
+ *
20
+ * @actionType CREATE - Creates a new Call record
21
+ * @module NotificationModule
22
+ * @entity Call
23
+ * @event k1.t-hEOJjsDb.NotificationModule.Call.Create.UpdateCallOnTaskCanceled
24
+ * @permission schema.action.updatecallontaskcanceled.trigger
25
+ * @benchmark This action is tracked for performance benchmarks
26
+ */
27
+ class UpdateCallOnTaskCanceledDto extends core_1.OdinRecordCreateDto {
28
+ constructor(properties, options) {
29
+ super({
30
+ entity: 'NotificationModule:Call',
31
+ type: undefined,
32
+ properties,
33
+ journeyId: options === null || options === void 0 ? void 0 : options.journeyId,
34
+ });
35
+ this.actionName = 'UpdateCallOnTaskCanceled';
36
+ this.schemaActionId = '7f8ddb83-6251-49d0-9c10-80a07d1a94e6';
37
+ this.entity = 'NotificationModule:Call';
38
+ }
39
+ }
40
+ exports.UpdateCallOnTaskCanceledDto = UpdateCallOnTaskCanceledDto;
41
+ /** Used by SDK generators to identify action type */
42
+ UpdateCallOnTaskCanceledDto.ACTION_TYPE = 'CREATE';
43
+ UpdateCallOnTaskCanceledDto.ACTION_KEY = 'UpdateCallOnTaskCanceled';
44
+ UpdateCallOnTaskCanceledDto.MODULE_NAME = 'NotificationModule';
45
+ UpdateCallOnTaskCanceledDto.ENTITIES = ['Call'];
46
+ UpdateCallOnTaskCanceledDto.EVENT_NAME = 'k1.t-hEOJjsDb.NotificationModule.Call.Create.UpdateCallOnTaskCanceled';
47
+ UpdateCallOnTaskCanceledDto.PERMISSION = 'schema.action.updatecallontaskcanceled.trigger';
48
+ /** Step metadata - entity this action targets */
49
+ UpdateCallOnTaskCanceledDto.STEP_ENTITY = 'NotificationModule:Call';
50
+ UpdateCallOnTaskCanceledDto.STEP_SCHEMA_ID = 'e157f15c-6846-4bfb-bc92-aed4c4084e9f';
51
+ UpdateCallOnTaskCanceledDto.STEP_SCHEMA_ACTION_ID = '7f8ddb83-6251-49d0-9c10-80a07d1a94e6';
52
+ UpdateCallOnTaskCanceledDto.AUTO_LINK_PARENT = true;
@@ -27,6 +27,7 @@ export declare class CallApi extends ApiProvider {
27
27
  private _callevent?;
28
28
  private _case?;
29
29
  private _workorder?;
30
+ private _twiliocallevents?;
30
31
  constructor(authParams?: OauthParams, authToken?: string);
31
32
  get lead(): ApiRecordLinkManager;
32
33
  get file(): ApiRecordLinkManager;
@@ -38,6 +39,7 @@ export declare class CallApi extends ApiProvider {
38
39
  get callevent(): ApiRecordLinkManager;
39
40
  get case(): ApiRecordLinkManager;
40
41
  get workorder(): ApiRecordLinkManager;
42
+ get twiliocallevents(): ApiRecordLinkManager;
41
43
  setRecord(sourceRecord: any): void;
42
44
  schema(): Promise<import("@d19n/odin-types/dist/core").OdinSchema>;
43
45
  search(params: Partial<OdinSearchV2>): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").OdinSearchResponse<import("@d19n/odin-types/dist/core").OdinRecord<CallProperties>>>;
@@ -93,6 +93,12 @@ class CallApi extends api_provider_1.ApiProvider {
93
93
  }
94
94
  return this._workorder;
95
95
  }
96
+ get twiliocallevents() {
97
+ if (!this._twiliocallevents) {
98
+ this._twiliocallevents = new api_record_link_manager_1.ApiRecordLinkManager(this.authParams, 'NotificationModule:Call', 'NotificationModule:TwilioCallEvents', 'Call__TwilioCallEvents');
99
+ }
100
+ return this._twiliocallevents;
101
+ }
96
102
  // ============================================
97
103
  // STANDARD METHODS (Unchanged API)
98
104
  // ============================================
@@ -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 { TwilioCallEventsProperties } from '../entities-v2/TwilioCallEvents';
6
+ /**
7
+ * @deprecated Use OdinApiClient.
8
+ *
9
+ * Migration:
10
+ * - Old: new TwilioCallEventsApi(authParams).get(id)
11
+ * - New: new odin.twiliocallevents.get(id)
12
+ *
13
+ * The new OdinApiClient returns typed record wrappers with action methods.
14
+ */
15
+ export declare class TwilioCallEventsApi extends ApiProvider {
16
+ protected readonly authToken?: string;
17
+ private readonly moduleName;
18
+ private readonly entityName;
19
+ private sourceRecord;
20
+ private _call?;
21
+ constructor(authParams?: OauthParams, authToken?: string);
22
+ get call(): 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<TwilioCallEventsProperties>>>;
26
+ searchAndPaginate(params: Partial<OdinSearchV2>): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").OdinSearchResponse<import("@d19n/odin-types/dist/core").OdinRecord<TwilioCallEventsProperties>>>;
27
+ reIndex(body: {
28
+ id: string;
29
+ schemaId: string;
30
+ }[]): Promise<any>;
31
+ get(twilioCallEventsId: string): Promise<import("@d19n/odin-types/dist/core").OdinRecord<TwilioCallEventsProperties>>;
32
+ getMany(twilioCallEventsIds: string[]): Promise<import("@d19n/odin-types/dist/core").OdinRecord<TwilioCallEventsProperties>[]>;
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(twilioCallEventsId: string): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").OdinDeleteResponse[]>;
38
+ deleteMany(twilioCallEventsIds: string[]): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").OdinDeleteResponse[]>;
39
+ restore(twilioCallEventsIds: 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.TwilioCallEventsApi = 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 TwilioCallEventsApi(authParams).get(id)
20
+ * - New: new odin.twiliocallevents.get(id)
21
+ *
22
+ * The new OdinApiClient returns typed record wrappers with action methods.
23
+ */
24
+ class TwilioCallEventsApi extends api_provider_1.ApiProvider {
25
+ constructor(authParams, authToken) {
26
+ super(authParams, authToken);
27
+ this.authToken = authToken;
28
+ this.moduleName = 'NotificationModule';
29
+ this.entityName = 'TwilioCallEvents';
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 call() {
37
+ if (!this._call) {
38
+ this._call = new api_record_link_manager_1.ApiRecordLinkManager(this.authParams, 'NotificationModule:TwilioCallEvents', 'NotificationModule:Call', 'Call__TwilioCallEvents');
39
+ }
40
+ return this._call;
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(twilioCallEventsId) {
73
+ return __awaiter(this, void 0, void 0, function* () {
74
+ const res = yield this._getByPrimaryKey(this.moduleName, this.entityName, twilioCallEventsId);
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(twilioCallEventsIds) {
82
+ return __awaiter(this, void 0, void 0, function* () {
83
+ return yield this._getManyByPrimaryKey(this.moduleName, this.entityName, twilioCallEventsIds);
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(twilioCallEventsId) {
114
+ return __awaiter(this, void 0, void 0, function* () {
115
+ return yield this._delete(this.moduleName, this.entityName, [twilioCallEventsId]);
116
+ });
117
+ }
118
+ // Use this function when you want to delete many records
119
+ deleteMany(twilioCallEventsIds) {
120
+ return __awaiter(this, void 0, void 0, function* () {
121
+ return yield this._delete(this.moduleName, this.entityName, twilioCallEventsIds);
122
+ });
123
+ }
124
+ // Use this function when you want to restore one or many records
125
+ restore(twilioCallEventsIds) {
126
+ return __awaiter(this, void 0, void 0, function* () {
127
+ return yield this._restore(this.moduleName, this.entityName, twilioCallEventsIds);
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.TwilioCallEventsApi = TwilioCallEventsApi;
@@ -0,0 +1,149 @@
1
+ /**
2
+ * TwilioCallEvents DB Accessor
3
+ *
4
+ * Provides typed access to TwilioCallEvents records via direct database access.
5
+ * For use in backend services with principal + dbService.
6
+ * Returns wrapped records with typed action methods.
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * // Simple get
11
+ * const record = await accessor.get(id);
12
+ *
13
+ * // With related entities
14
+ * const record = await accessor.get(id, { entities: ["Contact", "Address"] });
15
+ *
16
+ * // With permissions bypass (separate options)
17
+ * const record = await accessor.get(id, {}, { omitPermissionsCheck: true });
18
+ *
19
+ * // Silent write (no RabbitMQ events)
20
+ * const result = await accessor.upsert([dto], { omitWriteEvents: true });
21
+ *
22
+ * // Constructor-level default (applies to all calls)
23
+ * const accessor = new TwilioCallEventsDbAccessor(principal, dbService, { omitPermissionsCheck: true });
24
+ * ```
25
+ *
26
+ * AUTO-GENERATED - DO NOT EDIT DIRECTLY
27
+ */
28
+ import { OdinSearchV2 } from '@d19n/odin-types/dist/core';
29
+ import { DbProvider, DbProviderOptions, DbGetQueryOptions } from '@d19n/odin-sdk-generator/dist/db.provider';
30
+ import { QueryBuilder } from '@d19n/odin-sdk-generator/dist/query-builder';
31
+ import { TwilioCallEventsProperties } from '../entities-v2/TwilioCallEvents';
32
+ import { TwilioCallEventsRecord } from '../records-v2/TwilioCallEventsRecord';
33
+ /** Search response with wrapped records */
34
+ export interface TwilioCallEventsDbSearchResponse {
35
+ records: TwilioCallEventsRecord[];
36
+ totalRecords: number;
37
+ hasMore: boolean;
38
+ }
39
+ export declare class TwilioCallEventsDbAccessor {
40
+ private readonly _provider;
41
+ private readonly _moduleName;
42
+ private readonly _entityName;
43
+ private readonly _defaultOptions?;
44
+ /**
45
+ * Create a new TwilioCallEventsDbAccessor
46
+ * @param principal - The authenticated principal
47
+ * @param dbService - The database service instance
48
+ * @param defaultOptions - Default provider options applied to all operations
49
+ */
50
+ constructor(principal: any, dbService: any, defaultOptions?: DbProviderOptions);
51
+ get moduleName(): string;
52
+ get entityName(): string;
53
+ /**
54
+ * Create a new empty TwilioCallEvents record instance for create operations.
55
+ * Pre-generates an ID that can be referenced before the record is saved.
56
+ *
57
+ * @param id - Optional ID to use (auto-generated UUID if not provided)
58
+ * @returns A new record wrapper with pre-generated ID
59
+ *
60
+ * @example
61
+ * ```typescript
62
+ * // Auto-generated ID
63
+ * const note = odinDb.notes.new();
64
+ * console.log(note.id); // UUID available immediately
65
+ *
66
+ * // Custom ID
67
+ * const order = odinDb.orders.new("custom-id-123");
68
+ *
69
+ * // Reference ID before save
70
+ * const account = odinDb.accounts.new();
71
+ * const contact = odinDb.contacts.new();
72
+ * await contact
73
+ * .link({ id: account.id, entity: "CrmModule:Account" })
74
+ * .createContact({ FirstName: "John" });
75
+ * ```
76
+ */
77
+ new(id?: string): TwilioCallEventsRecord;
78
+ /**
79
+ * Get a single TwilioCallEvents record by ID
80
+ *
81
+ * @param id - The record ID
82
+ * @param queryOptions - Query options (WHAT to fetch: entities to include)
83
+ * @param providerOptions - Provider options (HOW to fetch: omitPermissionsCheck)
84
+ *
85
+ * @example
86
+ * ```typescript
87
+ * // Simple get
88
+ * const record = await accessor.get(id);
89
+ *
90
+ * // With related entities
91
+ * const record = await accessor.get(id, { entities: ["Contact", "Address"] });
92
+ *
93
+ * // With permissions bypass
94
+ * const record = await accessor.get(id, {}, { omitPermissionsCheck: true });
95
+ *
96
+ * // Both options
97
+ * const record = await accessor.get(id, { entities: ["Invoice"] }, { omitPermissionsCheck: true });
98
+ * ```
99
+ */
100
+ get(id: string, queryOptions?: DbGetQueryOptions, providerOptions?: DbProviderOptions): Promise<TwilioCallEventsRecord>;
101
+ /**
102
+ * Get multiple TwilioCallEvents records by IDs
103
+ *
104
+ * @param ids - Array of record IDs
105
+ * @param queryOptions - Query options (WHAT to fetch: entities to include)
106
+ * @param providerOptions - Provider options (HOW to fetch: omitPermissionsCheck)
107
+ */
108
+ getMany(ids: string[], queryOptions?: DbGetQueryOptions, providerOptions?: DbProviderOptions): Promise<TwilioCallEventsRecord[]>;
109
+ /**
110
+ * Search TwilioCallEvents records
111
+ *
112
+ * @param params - Search parameters
113
+ * @param providerOptions - Provider options (HOW to fetch: omitPermissionsCheck)
114
+ */
115
+ search(params: Partial<OdinSearchV2>, providerOptions?: DbProviderOptions): Promise<TwilioCallEventsDbSearchResponse>;
116
+ /**
117
+ * Search all TwilioCallEvents records with automatic pagination
118
+ *
119
+ * @param params - Search parameters
120
+ * @param providerOptions - Provider options (HOW to fetch: omitPermissionsCheck)
121
+ */
122
+ searchAll(params: Partial<OdinSearchV2>, providerOptions?: DbProviderOptions): Promise<TwilioCallEventsRecord[]>;
123
+ /**
124
+ * Async generator for paginating through all matching records.
125
+ * Yields batches of wrapped records.
126
+ *
127
+ * @param params - Search parameters
128
+ * @param providerOptions - Provider options (HOW to fetch: omitPermissionsCheck)
129
+ */
130
+ paginate(params: Partial<OdinSearchV2>, providerOptions?: DbProviderOptions): AsyncGenerator<TwilioCallEventsRecord[]>;
131
+ /**
132
+ * Create a fluent query builder for TwilioCallEvents records
133
+ *
134
+ * @example
135
+ * ```typescript
136
+ * const results = await accessor
137
+ * .query()
138
+ * .where('Status', 'in', ['Active', 'Pending'])
139
+ * .where('CreatedAt', 'gte', '2025-01-01')
140
+ * .select('id', 'title', 'properties.*')
141
+ * .sortBy('createdAt', 'desc')
142
+ * .limit(100)
143
+ * .execute();
144
+ * ```
145
+ */
146
+ query(): QueryBuilder<TwilioCallEventsProperties, TwilioCallEventsRecord>;
147
+ /** Access the underlying DbProvider */
148
+ get provider(): DbProvider;
149
+ }
@@ -0,0 +1,227 @@
1
+ "use strict";
2
+ /**
3
+ * TwilioCallEvents DB Accessor
4
+ *
5
+ * Provides typed access to TwilioCallEvents 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 TwilioCallEventsDbAccessor(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.TwilioCallEventsDbAccessor = 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 TwilioCallEventsRecord_1 = require("../records-v2/TwilioCallEventsRecord");
55
+ class TwilioCallEventsDbAccessor {
56
+ /**
57
+ * Create a new TwilioCallEventsDbAccessor
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 = 'NotificationModule';
64
+ this._entityName = 'TwilioCallEvents';
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 TwilioCallEvents 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 TwilioCallEventsRecord_1.TwilioCallEventsRecord(null, this._provider, id);
99
+ }
100
+ // ============================================
101
+ // RECORD RETRIEVAL
102
+ // ============================================
103
+ /**
104
+ * Get a single TwilioCallEvents 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 TwilioCallEventsRecord_1.TwilioCallEventsRecord(record, this._provider);
129
+ });
130
+ }
131
+ /**
132
+ * Get multiple TwilioCallEvents 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 TwilioCallEventsRecord_1.TwilioCallEventsRecord(r, this._provider));
144
+ });
145
+ }
146
+ // ============================================
147
+ // SEARCH OPERATIONS
148
+ // ============================================
149
+ /**
150
+ * Search TwilioCallEvents 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 TwilioCallEventsRecord_1.TwilioCallEventsRecord(r, this._provider)),
160
+ totalRecords: result.totalRecords,
161
+ hasMore: result.hasMore,
162
+ };
163
+ });
164
+ }
165
+ /**
166
+ * Search all TwilioCallEvents 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 TwilioCallEventsRecord_1.TwilioCallEventsRecord(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 TwilioCallEventsRecord_1.TwilioCallEventsRecord(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 TwilioCallEvents 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.TwilioCallEventsDbAccessor = TwilioCallEventsDbAccessor;
@@ -102,6 +102,7 @@ export { SmsMessageDbAccessor, SmsMessageDbSearchResponse } from './SmsMessageDb
102
102
  export { TeamDbAccessor, TeamDbSearchResponse } from './TeamDbAccessor';
103
103
  export { TimeSlotDbAccessor, TimeSlotDbSearchResponse } from './TimeSlotDbAccessor';
104
104
  export { TransactionDbAccessor, TransactionDbSearchResponse } from './TransactionDbAccessor';
105
+ export { TwilioCallEventsDbAccessor, TwilioCallEventsDbSearchResponse } from './TwilioCallEventsDbAccessor';
105
106
  export { TwilioTaskQueueDbAccessor, TwilioTaskQueueDbSearchResponse } from './TwilioTaskQueueDbAccessor';
106
107
  export { TwilioUserUpdateDbAccessor, TwilioUserUpdateDbSearchResponse } from './TwilioUserUpdateDbAccessor';
107
108
  export { UgExternalAuditDbAccessor, UgExternalAuditDbSearchResponse } from './UgExternalAuditDbAccessor';