@d19n/youfibre-odin-sdk 2.0.345 → 2.0.347

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 (32) hide show
  1. package/README.md +3 -1
  2. package/dist/api-sdk-v2/AccountApi.d.ts +4 -0
  3. package/dist/api-sdk-v2/AccountApi.js +12 -0
  4. package/dist/api-sdk-v2/CaseApi.d.ts +2 -0
  5. package/dist/api-sdk-v2/CaseApi.js +6 -0
  6. package/dist/api-sdk-v2/ContactApi.d.ts +2 -0
  7. package/dist/api-sdk-v2/ContactApi.js +6 -0
  8. package/dist/api-sdk-v2/FrustrationEventApi.d.ts +50 -0
  9. package/dist/api-sdk-v2/FrustrationEventApi.js +161 -0
  10. package/dist/api-sdk-v2/FrustrationScoreApi.d.ts +54 -0
  11. package/dist/api-sdk-v2/FrustrationScoreApi.js +173 -0
  12. package/dist/db-sdk-v2/AccountDb.d.ts +4 -0
  13. package/dist/db-sdk-v2/AccountDb.js +12 -0
  14. package/dist/db-sdk-v2/CaseDb.d.ts +2 -0
  15. package/dist/db-sdk-v2/CaseDb.js +6 -0
  16. package/dist/db-sdk-v2/ContactDb.d.ts +2 -0
  17. package/dist/db-sdk-v2/ContactDb.js +6 -0
  18. package/dist/db-sdk-v2/FrustrationEventDb.d.ts +122 -0
  19. package/dist/db-sdk-v2/FrustrationEventDb.js +210 -0
  20. package/dist/db-sdk-v2/FrustrationScoreDb.d.ts +126 -0
  21. package/dist/db-sdk-v2/FrustrationScoreDb.js +222 -0
  22. package/dist/entities-v2/Account.d.ts +6 -0
  23. package/dist/entities-v2/Case.d.ts +87 -4
  24. package/dist/entities-v2/Case.js +47 -5
  25. package/dist/entities-v2/Contact.d.ts +3 -0
  26. package/dist/entities-v2/Conversation.d.ts +6 -0
  27. package/dist/entities-v2/Conversation.js +6 -0
  28. package/dist/entities-v2/FrustrationEvent.d.ts +222 -0
  29. package/dist/entities-v2/FrustrationEvent.js +160 -0
  30. package/dist/entities-v2/FrustrationScore.d.ts +171 -0
  31. package/dist/entities-v2/FrustrationScore.js +123 -0
  32. package/package.json +1 -1
@@ -0,0 +1,122 @@
1
+ import { DbProvider, DbProviderOptions, DbGetQueryOptions } from '@d19n/odin-sdk-generator/dist/db.provider';
2
+ import { OdinSearchV2, OdinRecordCreateDto, OdinRecordUpdateDto } from '@d19n/odin-types/dist/core';
3
+ import { DbRecordLinkManager } from '@d19n/odin-sdk-generator/dist/db.record.link.manager';
4
+ import { FrustrationEventProperties } from '../entities-v2/FrustrationEvent';
5
+ /**
6
+ * @deprecated Use OdinDbClient.
7
+ *
8
+ * Migration:
9
+ * - Old: new FrustrationEventApi(authParams).get(id)
10
+ * - New: new odin.frustrationevent.get(id)
11
+ *
12
+ * The new OdinDbClient returns typed record wrappers with action methods.
13
+ *
14
+ * Supports separate query options and provider options:
15
+ * - Constructor level: new FrustrationEventDb(principal, dbService, { omitPermissionsCheck: true })
16
+ * - Method level: await db.getByPrimaryKey(id, { entities: [] }, { omitPermissionsCheck: true })
17
+ */
18
+ export declare class FrustrationEventDb extends DbProvider {
19
+ protected readonly principal: any;
20
+ protected readonly dbService: any;
21
+ private readonly moduleName;
22
+ private readonly entityName;
23
+ private sourceRecord;
24
+ private _account?;
25
+ private _frustrationscore?;
26
+ constructor(principal: any, dbService: any, defaultOptions?: DbProviderOptions);
27
+ get account(): DbRecordLinkManager;
28
+ get frustrationscore(): DbRecordLinkManager;
29
+ setRecord(sourceRecord: any): void;
30
+ /**
31
+ * Search records with manual pagination control
32
+ * @param params - Search parameters
33
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
34
+ */
35
+ 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<FrustrationEventProperties>>>;
36
+ /**
37
+ * Search all records with automatic pagination
38
+ * @param params - Search parameters
39
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
40
+ */
41
+ 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<FrustrationEventProperties>>>;
42
+ /**
43
+ * Get a single record by primary key
44
+ * @param frustrationEventId - Record ID
45
+ * @param queryOptions - Query options (WHAT: entities to include)
46
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
47
+ *
48
+ * @example
49
+ * // Simple get
50
+ * const record = await db.getByPrimaryKey(id);
51
+ *
52
+ * // With related entities
53
+ * const record = await db.getByPrimaryKey(id, { entities: ['InvoiceItem', 'Transaction'] });
54
+ *
55
+ * // With permissions bypass
56
+ * const record = await db.getByPrimaryKey(id, {}, { omitPermissionsCheck: true });
57
+ *
58
+ * // Both options
59
+ * const record = await db.getByPrimaryKey(id, { entities: ['Invoice'] }, { omitPermissionsCheck: true });
60
+ */
61
+ getByPrimaryKey(frustrationEventId: string, queryOptions?: DbGetQueryOptions, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").OdinRecord<FrustrationEventProperties>>;
62
+ /**
63
+ * Get multiple records by primary keys
64
+ * @param frustrationEventIds - Array of record IDs
65
+ * @param queryOptions - Query options (WHAT: entities to include)
66
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
67
+ */
68
+ getManyByPrimaryKey(frustrationEventIds: string[], queryOptions?: DbGetQueryOptions, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").OdinRecord<FrustrationEventProperties>[]>;
69
+ /**
70
+ * Upsert a single record
71
+ * @param upsertDto - Record to upsert
72
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
73
+ */
74
+ upsert(upsertDto: OdinRecordCreateDto, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").IDbRecordCreateUpdateRes>;
75
+ /**
76
+ * Upsert multiple records
77
+ * @param upsertDtos - Records to upsert
78
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
79
+ */
80
+ upsertMany(upsertDtos: OdinRecordCreateDto[], providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").IDbRecordCreateUpdateRes[]>;
81
+ /**
82
+ * Update a single record
83
+ * @param updateDto - Record to update
84
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
85
+ */
86
+ update(updateDto: OdinRecordUpdateDto, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").IDbRecordCreateUpdateRes>;
87
+ /**
88
+ * Update multiple records
89
+ * @param updateDtos - Records to update
90
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
91
+ */
92
+ updateMany(updateDtos: OdinRecordUpdateDto[], providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").IDbRecordCreateUpdateRes[]>;
93
+ /**
94
+ * Delete one or many records
95
+ * @param frustrationEventIds - Record IDs to delete
96
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
97
+ */
98
+ delete(frustrationEventIds: string[], providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-sdk-generator").DbRecordDeleted[]>;
99
+ /**
100
+ * Restore one or many deleted records
101
+ * @param frustrationEventIds - Record IDs to restore
102
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
103
+ */
104
+ restore(frustrationEventIds: string[], providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-sdk-generator").DbRecordRestored[]>;
105
+ /**
106
+ * Apply an action to a record
107
+ * @param actionName - The action key
108
+ * @param dto - The action DTO
109
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
110
+ */
111
+ applyAction(actionName: string, dto: any, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").IDbRecordCreateUpdateRes[]>;
112
+ /**
113
+ * Get version history for the current source record
114
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
115
+ */
116
+ getVersions(providerOptions?: DbProviderOptions): Promise<any>;
117
+ /**
118
+ * Get revision timeline for the current source record
119
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
120
+ */
121
+ getRevisionTimeline(providerOptions?: DbProviderOptions): Promise<any>;
122
+ }
@@ -0,0 +1,210 @@
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.FrustrationEventDb = void 0;
13
+ const db_provider_1 = require("@d19n/odin-sdk-generator/dist/db.provider");
14
+ const db_record_link_manager_1 = require("@d19n/odin-sdk-generator/dist/db.record.link.manager");
15
+ /**
16
+ * @deprecated Use OdinDbClient.
17
+ *
18
+ * Migration:
19
+ * - Old: new FrustrationEventApi(authParams).get(id)
20
+ * - New: new odin.frustrationevent.get(id)
21
+ *
22
+ * The new OdinDbClient returns typed record wrappers with action methods.
23
+ *
24
+ * Supports separate query options and provider options:
25
+ * - Constructor level: new FrustrationEventDb(principal, dbService, { omitPermissionsCheck: true })
26
+ * - Method level: await db.getByPrimaryKey(id, { entities: [] }, { omitPermissionsCheck: true })
27
+ */
28
+ class FrustrationEventDb extends db_provider_1.DbProvider {
29
+ constructor(principal, dbService, defaultOptions) {
30
+ super(principal, dbService, defaultOptions);
31
+ this.moduleName = 'SupportModule';
32
+ this.entityName = 'FrustrationEvent';
33
+ this.principal = principal;
34
+ this.dbService = dbService;
35
+ // Link managers are lazy-loaded on first access
36
+ }
37
+ // ============================================
38
+ // LAZY-LOADED LINK MANAGERS (Public Getters)
39
+ // ============================================
40
+ // Usage remains identical: db.address.list(recordId)
41
+ get account() {
42
+ if (!this._account) {
43
+ this._account = new db_record_link_manager_1.DbRecordLinkManager(this.principal, this.dbService, 'SupportModule:FrustrationEvent', 'CrmModule:Account', 'FrustrationEvent__Account');
44
+ }
45
+ return this._account;
46
+ }
47
+ get frustrationscore() {
48
+ if (!this._frustrationscore) {
49
+ this._frustrationscore = new db_record_link_manager_1.DbRecordLinkManager(this.principal, this.dbService, 'SupportModule:FrustrationEvent', 'SupportModule:FrustrationScore', 'FrustrationEvent__FrustrationScore');
50
+ }
51
+ return this._frustrationscore;
52
+ }
53
+ // ============================================
54
+ // STANDARD METHODS
55
+ // ============================================
56
+ // Methods support separate query options and provider options for clean API
57
+ setRecord(sourceRecord) {
58
+ this.sourceRecord = sourceRecord;
59
+ }
60
+ /**
61
+ * Search records with manual pagination control
62
+ * @param params - Search parameters
63
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
64
+ */
65
+ searchRecords(params, providerOptions) {
66
+ return __awaiter(this, void 0, void 0, function* () {
67
+ return yield this._searchRecords(this.moduleName, this.entityName, params, providerOptions);
68
+ });
69
+ }
70
+ /**
71
+ * Search all records with automatic pagination
72
+ * @param params - Search parameters
73
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
74
+ */
75
+ searchAllRecordsAndPaginate(params, providerOptions) {
76
+ return __awaiter(this, void 0, void 0, function* () {
77
+ return yield this._searchAllRecordsAndPaginate(this.moduleName, this.entityName, params, 0, providerOptions);
78
+ });
79
+ }
80
+ /**
81
+ * Get a single record by primary key
82
+ * @param frustrationEventId - Record ID
83
+ * @param queryOptions - Query options (WHAT: entities to include)
84
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
85
+ *
86
+ * @example
87
+ * // Simple get
88
+ * const record = await db.getByPrimaryKey(id);
89
+ *
90
+ * // With related entities
91
+ * const record = await db.getByPrimaryKey(id, { entities: ['InvoiceItem', 'Transaction'] });
92
+ *
93
+ * // With permissions bypass
94
+ * const record = await db.getByPrimaryKey(id, {}, { omitPermissionsCheck: true });
95
+ *
96
+ * // Both options
97
+ * const record = await db.getByPrimaryKey(id, { entities: ['Invoice'] }, { omitPermissionsCheck: true });
98
+ */
99
+ getByPrimaryKey(frustrationEventId, queryOptions, providerOptions) {
100
+ return __awaiter(this, void 0, void 0, function* () {
101
+ const res = yield this._getByPrimaryKey(this.moduleName, this.entityName, frustrationEventId, queryOptions, providerOptions);
102
+ if (res)
103
+ this.setRecord(res);
104
+ return res;
105
+ });
106
+ }
107
+ /**
108
+ * Get multiple records by primary keys
109
+ * @param frustrationEventIds - Array of record IDs
110
+ * @param queryOptions - Query options (WHAT: entities to include)
111
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
112
+ */
113
+ getManyByPrimaryKey(frustrationEventIds, queryOptions, providerOptions) {
114
+ return __awaiter(this, void 0, void 0, function* () {
115
+ return yield this._getManyByPrimaryKey(this.moduleName, this.entityName, frustrationEventIds, queryOptions, providerOptions);
116
+ });
117
+ }
118
+ /**
119
+ * Upsert a single record
120
+ * @param upsertDto - Record to upsert
121
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
122
+ */
123
+ upsert(upsertDto, providerOptions) {
124
+ return __awaiter(this, void 0, void 0, function* () {
125
+ const res = yield this._upsert(this.moduleName, this.entityName, [upsertDto], providerOptions);
126
+ return res[0];
127
+ });
128
+ }
129
+ /**
130
+ * Upsert multiple records
131
+ * @param upsertDtos - Records to upsert
132
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
133
+ */
134
+ upsertMany(upsertDtos, providerOptions) {
135
+ return __awaiter(this, void 0, void 0, function* () {
136
+ return yield this._upsert(this.moduleName, this.entityName, upsertDtos, providerOptions);
137
+ });
138
+ }
139
+ /**
140
+ * Update a single record
141
+ * @param updateDto - Record to update
142
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
143
+ */
144
+ update(updateDto, providerOptions) {
145
+ return __awaiter(this, void 0, void 0, function* () {
146
+ const res = yield this._update(this.moduleName, this.entityName, [updateDto], providerOptions);
147
+ return res[0];
148
+ });
149
+ }
150
+ /**
151
+ * Update multiple records
152
+ * @param updateDtos - Records to update
153
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
154
+ */
155
+ updateMany(updateDtos, providerOptions) {
156
+ return __awaiter(this, void 0, void 0, function* () {
157
+ return yield this._update(this.moduleName, this.entityName, updateDtos, providerOptions);
158
+ });
159
+ }
160
+ /**
161
+ * Delete one or many records
162
+ * @param frustrationEventIds - Record IDs to delete
163
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
164
+ */
165
+ delete(frustrationEventIds, providerOptions) {
166
+ return __awaiter(this, void 0, void 0, function* () {
167
+ return yield this._delete(this.moduleName, this.entityName, frustrationEventIds, providerOptions);
168
+ });
169
+ }
170
+ /**
171
+ * Restore one or many deleted records
172
+ * @param frustrationEventIds - Record IDs to restore
173
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
174
+ */
175
+ restore(frustrationEventIds, providerOptions) {
176
+ return __awaiter(this, void 0, void 0, function* () {
177
+ return yield this._restore(this.moduleName, this.entityName, frustrationEventIds, providerOptions);
178
+ });
179
+ }
180
+ /**
181
+ * Apply an action to a record
182
+ * @param actionName - The action key
183
+ * @param dto - The action DTO
184
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
185
+ */
186
+ applyAction(actionName, dto, providerOptions) {
187
+ return __awaiter(this, void 0, void 0, function* () {
188
+ return yield this._applyAction(this.moduleName, this.entityName, dto, providerOptions);
189
+ });
190
+ }
191
+ /**
192
+ * Get version history for the current source record
193
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
194
+ */
195
+ getVersions(providerOptions) {
196
+ return __awaiter(this, void 0, void 0, function* () {
197
+ return yield this._getVersions(this.moduleName, this.entityName, this.sourceRecord.id, providerOptions);
198
+ });
199
+ }
200
+ /**
201
+ * Get revision timeline for the current source record
202
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
203
+ */
204
+ getRevisionTimeline(providerOptions) {
205
+ return __awaiter(this, void 0, void 0, function* () {
206
+ return yield this._getRevisionTimeline(this.moduleName, this.entityName, this.sourceRecord.id, providerOptions);
207
+ });
208
+ }
209
+ }
210
+ exports.FrustrationEventDb = FrustrationEventDb;
@@ -0,0 +1,126 @@
1
+ import { DbProvider, DbProviderOptions, DbGetQueryOptions } from '@d19n/odin-sdk-generator/dist/db.provider';
2
+ import { OdinSearchV2, OdinRecordCreateDto, OdinRecordUpdateDto } from '@d19n/odin-types/dist/core';
3
+ import { DbRecordLinkManager } from '@d19n/odin-sdk-generator/dist/db.record.link.manager';
4
+ import { FrustrationScoreProperties } from '../entities-v2/FrustrationScore';
5
+ /**
6
+ * @deprecated Use OdinDbClient.
7
+ *
8
+ * Migration:
9
+ * - Old: new FrustrationScoreApi(authParams).get(id)
10
+ * - New: new odin.frustrationscore.get(id)
11
+ *
12
+ * The new OdinDbClient returns typed record wrappers with action methods.
13
+ *
14
+ * Supports separate query options and provider options:
15
+ * - Constructor level: new FrustrationScoreDb(principal, dbService, { omitPermissionsCheck: true })
16
+ * - Method level: await db.getByPrimaryKey(id, { entities: [] }, { omitPermissionsCheck: true })
17
+ */
18
+ export declare class FrustrationScoreDb extends DbProvider {
19
+ protected readonly principal: any;
20
+ protected readonly dbService: any;
21
+ private readonly moduleName;
22
+ private readonly entityName;
23
+ private sourceRecord;
24
+ private _account?;
25
+ private _contact?;
26
+ private _case?;
27
+ private _frustrationevent?;
28
+ constructor(principal: any, dbService: any, defaultOptions?: DbProviderOptions);
29
+ get account(): DbRecordLinkManager;
30
+ get contact(): DbRecordLinkManager;
31
+ get case(): DbRecordLinkManager;
32
+ get frustrationevent(): DbRecordLinkManager;
33
+ setRecord(sourceRecord: any): void;
34
+ /**
35
+ * Search records with manual pagination control
36
+ * @param params - Search parameters
37
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
38
+ */
39
+ 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<FrustrationScoreProperties>>>;
40
+ /**
41
+ * Search all records with automatic pagination
42
+ * @param params - Search parameters
43
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
44
+ */
45
+ 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<FrustrationScoreProperties>>>;
46
+ /**
47
+ * Get a single record by primary key
48
+ * @param frustrationScoreId - Record ID
49
+ * @param queryOptions - Query options (WHAT: entities to include)
50
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
51
+ *
52
+ * @example
53
+ * // Simple get
54
+ * const record = await db.getByPrimaryKey(id);
55
+ *
56
+ * // With related entities
57
+ * const record = await db.getByPrimaryKey(id, { entities: ['InvoiceItem', 'Transaction'] });
58
+ *
59
+ * // With permissions bypass
60
+ * const record = await db.getByPrimaryKey(id, {}, { omitPermissionsCheck: true });
61
+ *
62
+ * // Both options
63
+ * const record = await db.getByPrimaryKey(id, { entities: ['Invoice'] }, { omitPermissionsCheck: true });
64
+ */
65
+ getByPrimaryKey(frustrationScoreId: string, queryOptions?: DbGetQueryOptions, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").OdinRecord<FrustrationScoreProperties>>;
66
+ /**
67
+ * Get multiple records by primary keys
68
+ * @param frustrationScoreIds - Array of record IDs
69
+ * @param queryOptions - Query options (WHAT: entities to include)
70
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
71
+ */
72
+ getManyByPrimaryKey(frustrationScoreIds: string[], queryOptions?: DbGetQueryOptions, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").OdinRecord<FrustrationScoreProperties>[]>;
73
+ /**
74
+ * Upsert a single record
75
+ * @param upsertDto - Record to upsert
76
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
77
+ */
78
+ upsert(upsertDto: OdinRecordCreateDto, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").IDbRecordCreateUpdateRes>;
79
+ /**
80
+ * Upsert multiple records
81
+ * @param upsertDtos - Records to upsert
82
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
83
+ */
84
+ upsertMany(upsertDtos: OdinRecordCreateDto[], providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").IDbRecordCreateUpdateRes[]>;
85
+ /**
86
+ * Update a single record
87
+ * @param updateDto - Record to update
88
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
89
+ */
90
+ update(updateDto: OdinRecordUpdateDto, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").IDbRecordCreateUpdateRes>;
91
+ /**
92
+ * Update multiple records
93
+ * @param updateDtos - Records to update
94
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
95
+ */
96
+ updateMany(updateDtos: OdinRecordUpdateDto[], providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").IDbRecordCreateUpdateRes[]>;
97
+ /**
98
+ * Delete one or many records
99
+ * @param frustrationScoreIds - Record IDs to delete
100
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
101
+ */
102
+ delete(frustrationScoreIds: string[], providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-sdk-generator").DbRecordDeleted[]>;
103
+ /**
104
+ * Restore one or many deleted records
105
+ * @param frustrationScoreIds - Record IDs to restore
106
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
107
+ */
108
+ restore(frustrationScoreIds: string[], providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-sdk-generator").DbRecordRestored[]>;
109
+ /**
110
+ * Apply an action to a record
111
+ * @param actionName - The action key
112
+ * @param dto - The action DTO
113
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
114
+ */
115
+ applyAction(actionName: string, dto: any, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").IDbRecordCreateUpdateRes[]>;
116
+ /**
117
+ * Get version history for the current source record
118
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
119
+ */
120
+ getVersions(providerOptions?: DbProviderOptions): Promise<any>;
121
+ /**
122
+ * Get revision timeline for the current source record
123
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
124
+ */
125
+ getRevisionTimeline(providerOptions?: DbProviderOptions): Promise<any>;
126
+ }
@@ -0,0 +1,222 @@
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.FrustrationScoreDb = void 0;
13
+ const db_provider_1 = require("@d19n/odin-sdk-generator/dist/db.provider");
14
+ const db_record_link_manager_1 = require("@d19n/odin-sdk-generator/dist/db.record.link.manager");
15
+ /**
16
+ * @deprecated Use OdinDbClient.
17
+ *
18
+ * Migration:
19
+ * - Old: new FrustrationScoreApi(authParams).get(id)
20
+ * - New: new odin.frustrationscore.get(id)
21
+ *
22
+ * The new OdinDbClient returns typed record wrappers with action methods.
23
+ *
24
+ * Supports separate query options and provider options:
25
+ * - Constructor level: new FrustrationScoreDb(principal, dbService, { omitPermissionsCheck: true })
26
+ * - Method level: await db.getByPrimaryKey(id, { entities: [] }, { omitPermissionsCheck: true })
27
+ */
28
+ class FrustrationScoreDb extends db_provider_1.DbProvider {
29
+ constructor(principal, dbService, defaultOptions) {
30
+ super(principal, dbService, defaultOptions);
31
+ this.moduleName = 'SupportModule';
32
+ this.entityName = 'FrustrationScore';
33
+ this.principal = principal;
34
+ this.dbService = dbService;
35
+ // Link managers are lazy-loaded on first access
36
+ }
37
+ // ============================================
38
+ // LAZY-LOADED LINK MANAGERS (Public Getters)
39
+ // ============================================
40
+ // Usage remains identical: db.address.list(recordId)
41
+ get account() {
42
+ if (!this._account) {
43
+ this._account = new db_record_link_manager_1.DbRecordLinkManager(this.principal, this.dbService, 'SupportModule:FrustrationScore', 'CrmModule:Account', 'FrustrationScore__Account');
44
+ }
45
+ return this._account;
46
+ }
47
+ get contact() {
48
+ if (!this._contact) {
49
+ this._contact = new db_record_link_manager_1.DbRecordLinkManager(this.principal, this.dbService, 'SupportModule:FrustrationScore', 'CrmModule:Contact', 'FrustrationScore__Contact');
50
+ }
51
+ return this._contact;
52
+ }
53
+ get case() {
54
+ if (!this._case) {
55
+ this._case = new db_record_link_manager_1.DbRecordLinkManager(this.principal, this.dbService, 'SupportModule:FrustrationScore', 'SupportModule:Case', 'FrustrationScore__Case');
56
+ }
57
+ return this._case;
58
+ }
59
+ get frustrationevent() {
60
+ if (!this._frustrationevent) {
61
+ this._frustrationevent = new db_record_link_manager_1.DbRecordLinkManager(this.principal, this.dbService, 'SupportModule:FrustrationScore', 'SupportModule:FrustrationEvent', 'FrustrationEvent__FrustrationScore');
62
+ }
63
+ return this._frustrationevent;
64
+ }
65
+ // ============================================
66
+ // STANDARD METHODS
67
+ // ============================================
68
+ // Methods support separate query options and provider options for clean API
69
+ setRecord(sourceRecord) {
70
+ this.sourceRecord = sourceRecord;
71
+ }
72
+ /**
73
+ * Search records with manual pagination control
74
+ * @param params - Search parameters
75
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
76
+ */
77
+ searchRecords(params, providerOptions) {
78
+ return __awaiter(this, void 0, void 0, function* () {
79
+ return yield this._searchRecords(this.moduleName, this.entityName, params, providerOptions);
80
+ });
81
+ }
82
+ /**
83
+ * Search all records with automatic pagination
84
+ * @param params - Search parameters
85
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
86
+ */
87
+ searchAllRecordsAndPaginate(params, providerOptions) {
88
+ return __awaiter(this, void 0, void 0, function* () {
89
+ return yield this._searchAllRecordsAndPaginate(this.moduleName, this.entityName, params, 0, providerOptions);
90
+ });
91
+ }
92
+ /**
93
+ * Get a single record by primary key
94
+ * @param frustrationScoreId - Record ID
95
+ * @param queryOptions - Query options (WHAT: entities to include)
96
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
97
+ *
98
+ * @example
99
+ * // Simple get
100
+ * const record = await db.getByPrimaryKey(id);
101
+ *
102
+ * // With related entities
103
+ * const record = await db.getByPrimaryKey(id, { entities: ['InvoiceItem', 'Transaction'] });
104
+ *
105
+ * // With permissions bypass
106
+ * const record = await db.getByPrimaryKey(id, {}, { omitPermissionsCheck: true });
107
+ *
108
+ * // Both options
109
+ * const record = await db.getByPrimaryKey(id, { entities: ['Invoice'] }, { omitPermissionsCheck: true });
110
+ */
111
+ getByPrimaryKey(frustrationScoreId, queryOptions, providerOptions) {
112
+ return __awaiter(this, void 0, void 0, function* () {
113
+ const res = yield this._getByPrimaryKey(this.moduleName, this.entityName, frustrationScoreId, queryOptions, providerOptions);
114
+ if (res)
115
+ this.setRecord(res);
116
+ return res;
117
+ });
118
+ }
119
+ /**
120
+ * Get multiple records by primary keys
121
+ * @param frustrationScoreIds - Array of record IDs
122
+ * @param queryOptions - Query options (WHAT: entities to include)
123
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
124
+ */
125
+ getManyByPrimaryKey(frustrationScoreIds, queryOptions, providerOptions) {
126
+ return __awaiter(this, void 0, void 0, function* () {
127
+ return yield this._getManyByPrimaryKey(this.moduleName, this.entityName, frustrationScoreIds, queryOptions, providerOptions);
128
+ });
129
+ }
130
+ /**
131
+ * Upsert a single record
132
+ * @param upsertDto - Record to upsert
133
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
134
+ */
135
+ upsert(upsertDto, providerOptions) {
136
+ return __awaiter(this, void 0, void 0, function* () {
137
+ const res = yield this._upsert(this.moduleName, this.entityName, [upsertDto], providerOptions);
138
+ return res[0];
139
+ });
140
+ }
141
+ /**
142
+ * Upsert multiple records
143
+ * @param upsertDtos - Records to upsert
144
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
145
+ */
146
+ upsertMany(upsertDtos, providerOptions) {
147
+ return __awaiter(this, void 0, void 0, function* () {
148
+ return yield this._upsert(this.moduleName, this.entityName, upsertDtos, providerOptions);
149
+ });
150
+ }
151
+ /**
152
+ * Update a single record
153
+ * @param updateDto - Record to update
154
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
155
+ */
156
+ update(updateDto, providerOptions) {
157
+ return __awaiter(this, void 0, void 0, function* () {
158
+ const res = yield this._update(this.moduleName, this.entityName, [updateDto], providerOptions);
159
+ return res[0];
160
+ });
161
+ }
162
+ /**
163
+ * Update multiple records
164
+ * @param updateDtos - Records to update
165
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
166
+ */
167
+ updateMany(updateDtos, providerOptions) {
168
+ return __awaiter(this, void 0, void 0, function* () {
169
+ return yield this._update(this.moduleName, this.entityName, updateDtos, providerOptions);
170
+ });
171
+ }
172
+ /**
173
+ * Delete one or many records
174
+ * @param frustrationScoreIds - Record IDs to delete
175
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
176
+ */
177
+ delete(frustrationScoreIds, providerOptions) {
178
+ return __awaiter(this, void 0, void 0, function* () {
179
+ return yield this._delete(this.moduleName, this.entityName, frustrationScoreIds, providerOptions);
180
+ });
181
+ }
182
+ /**
183
+ * Restore one or many deleted records
184
+ * @param frustrationScoreIds - Record IDs to restore
185
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
186
+ */
187
+ restore(frustrationScoreIds, providerOptions) {
188
+ return __awaiter(this, void 0, void 0, function* () {
189
+ return yield this._restore(this.moduleName, this.entityName, frustrationScoreIds, providerOptions);
190
+ });
191
+ }
192
+ /**
193
+ * Apply an action to a record
194
+ * @param actionName - The action key
195
+ * @param dto - The action DTO
196
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
197
+ */
198
+ applyAction(actionName, dto, providerOptions) {
199
+ return __awaiter(this, void 0, void 0, function* () {
200
+ return yield this._applyAction(this.moduleName, this.entityName, dto, providerOptions);
201
+ });
202
+ }
203
+ /**
204
+ * Get version history for the current source record
205
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
206
+ */
207
+ getVersions(providerOptions) {
208
+ return __awaiter(this, void 0, void 0, function* () {
209
+ return yield this._getVersions(this.moduleName, this.entityName, this.sourceRecord.id, providerOptions);
210
+ });
211
+ }
212
+ /**
213
+ * Get revision timeline for the current source record
214
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
215
+ */
216
+ getRevisionTimeline(providerOptions) {
217
+ return __awaiter(this, void 0, void 0, function* () {
218
+ return yield this._getRevisionTimeline(this.moduleName, this.entityName, this.sourceRecord.id, providerOptions);
219
+ });
220
+ }
221
+ }
222
+ exports.FrustrationScoreDb = FrustrationScoreDb;