@d19n/youfibre-odin-sdk 2.0.335 → 2.0.337

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 (79) hide show
  1. package/README.md +31 -2
  2. package/dist/EntityRegistry.d.ts +8 -0
  3. package/dist/EntityRegistry.js +8 -0
  4. package/dist/OdinApiClient.d.ts +16 -0
  5. package/dist/OdinApiClient.js +32 -0
  6. package/dist/OdinDbClient.d.ts +16 -0
  7. package/dist/OdinDbClient.js +32 -0
  8. package/dist/accessors-v2/QaAutoFailAccessor.d.ts +112 -0
  9. package/dist/accessors-v2/QaAutoFailAccessor.js +191 -0
  10. package/dist/accessors-v2/QaRubricAccessor.d.ts +112 -0
  11. package/dist/accessors-v2/QaRubricAccessor.js +191 -0
  12. package/dist/accessors-v2/QaRubricItemAccessor.d.ts +112 -0
  13. package/dist/accessors-v2/QaRubricItemAccessor.js +191 -0
  14. package/dist/accessors-v2/QaRubricSectionAccessor.d.ts +112 -0
  15. package/dist/accessors-v2/QaRubricSectionAccessor.js +191 -0
  16. package/dist/accessors-v2/index.d.ts +4 -0
  17. package/dist/accessors-v2/index.js +10 -2
  18. package/dist/actions-v2/CreateContactSalesAppDto.d.ts +2 -25
  19. package/dist/actions-v2/CreateInstallDayBeforeWifiEducationDto.d.ts +63 -0
  20. package/dist/actions-v2/CreateInstallDayBeforeWifiEducationDto.js +59 -0
  21. package/dist/actions-v2/CreateLeadSalesAppDto.d.ts +10 -2
  22. package/dist/actions-v2/CreateTransactionalEmailDto.d.ts +8 -1
  23. package/dist/actions-v2/UpdateQaAutoFailDto.d.ts +102 -0
  24. package/dist/actions-v2/UpdateQaAutoFailDto.js +56 -0
  25. package/dist/actions-v2/UpdateQaRubricDto.d.ts +103 -0
  26. package/dist/actions-v2/UpdateQaRubricDto.js +56 -0
  27. package/dist/actions-v2/UpdateQaRubricItemDto.d.ts +157 -0
  28. package/dist/actions-v2/UpdateQaRubricItemDto.js +56 -0
  29. package/dist/actions-v2/UpdateQaRubricSectionDto.d.ts +87 -0
  30. package/dist/actions-v2/UpdateQaRubricSectionDto.js +56 -0
  31. package/dist/api-sdk-v2/QaAutoFailApi.d.ts +48 -0
  32. package/dist/api-sdk-v2/QaAutoFailApi.js +155 -0
  33. package/dist/api-sdk-v2/QaRubricApi.d.ts +50 -0
  34. package/dist/api-sdk-v2/QaRubricApi.js +161 -0
  35. package/dist/api-sdk-v2/QaRubricItemApi.d.ts +48 -0
  36. package/dist/api-sdk-v2/QaRubricItemApi.js +155 -0
  37. package/dist/api-sdk-v2/QaRubricSectionApi.d.ts +50 -0
  38. package/dist/api-sdk-v2/QaRubricSectionApi.js +161 -0
  39. package/dist/db-accessors-v2/QaAutoFailDbAccessor.d.ts +180 -0
  40. package/dist/db-accessors-v2/QaAutoFailDbAccessor.js +265 -0
  41. package/dist/db-accessors-v2/QaRubricDbAccessor.d.ts +180 -0
  42. package/dist/db-accessors-v2/QaRubricDbAccessor.js +265 -0
  43. package/dist/db-accessors-v2/QaRubricItemDbAccessor.d.ts +180 -0
  44. package/dist/db-accessors-v2/QaRubricItemDbAccessor.js +265 -0
  45. package/dist/db-accessors-v2/QaRubricSectionDbAccessor.d.ts +180 -0
  46. package/dist/db-accessors-v2/QaRubricSectionDbAccessor.js +265 -0
  47. package/dist/db-accessors-v2/index.d.ts +4 -0
  48. package/dist/db-accessors-v2/index.js +10 -2
  49. package/dist/db-sdk-v2/QaAutoFailDb.d.ts +120 -0
  50. package/dist/db-sdk-v2/QaAutoFailDb.js +204 -0
  51. package/dist/db-sdk-v2/QaRubricDb.d.ts +122 -0
  52. package/dist/db-sdk-v2/QaRubricDb.js +210 -0
  53. package/dist/db-sdk-v2/QaRubricItemDb.d.ts +120 -0
  54. package/dist/db-sdk-v2/QaRubricItemDb.js +204 -0
  55. package/dist/db-sdk-v2/QaRubricSectionDb.d.ts +122 -0
  56. package/dist/db-sdk-v2/QaRubricSectionDb.js +210 -0
  57. package/dist/entities-v2/QaAutoFail.d.ts +117 -0
  58. package/dist/entities-v2/QaAutoFail.js +76 -0
  59. package/dist/entities-v2/QaReport.d.ts +41 -1
  60. package/dist/entities-v2/QaReport.js +10 -0
  61. package/dist/entities-v2/QaRubric.d.ts +152 -0
  62. package/dist/entities-v2/QaRubric.js +114 -0
  63. package/dist/entities-v2/QaRubricItem.d.ts +199 -0
  64. package/dist/entities-v2/QaRubricItem.js +110 -0
  65. package/dist/entities-v2/QaRubricSection.d.ts +108 -0
  66. package/dist/entities-v2/QaRubricSection.js +76 -0
  67. package/dist/records-v2/EmailRecord.d.ts +29 -0
  68. package/dist/records-v2/EmailRecord.js +36 -0
  69. package/dist/records-v2/QaAutoFailRecord.d.ts +205 -0
  70. package/dist/records-v2/QaAutoFailRecord.js +275 -0
  71. package/dist/records-v2/QaRubricItemRecord.d.ts +205 -0
  72. package/dist/records-v2/QaRubricItemRecord.js +275 -0
  73. package/dist/records-v2/QaRubricRecord.d.ts +225 -0
  74. package/dist/records-v2/QaRubricRecord.js +308 -0
  75. package/dist/records-v2/QaRubricSectionRecord.d.ts +225 -0
  76. package/dist/records-v2/QaRubricSectionRecord.js +308 -0
  77. package/dist/records-v2/index.d.ts +4 -0
  78. package/dist/records-v2/index.js +13 -1
  79. 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 { QaRubricProperties } from '../entities-v2/QaRubric';
5
+ /**
6
+ * @deprecated Use OdinDbClient.
7
+ *
8
+ * Migration:
9
+ * - Old: new QaRubricApi(authParams).get(id)
10
+ * - New: new odin.qarubric.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 QaRubricDb(principal, dbService, { omitPermissionsCheck: true })
16
+ * - Method level: await db.getByPrimaryKey(id, { entities: [] }, { omitPermissionsCheck: true })
17
+ */
18
+ export declare class QaRubricDb 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 _qarubricsection?;
25
+ private _qaautofail?;
26
+ constructor(principal: any, dbService: any, defaultOptions?: DbProviderOptions);
27
+ get qarubricsection(): DbRecordLinkManager;
28
+ get qaautofail(): 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<QaRubricProperties>>>;
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<QaRubricProperties>>>;
42
+ /**
43
+ * Get a single record by primary key
44
+ * @param qaRubricId - 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(qaRubricId: string, queryOptions?: DbGetQueryOptions, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").OdinRecord<QaRubricProperties>>;
62
+ /**
63
+ * Get multiple records by primary keys
64
+ * @param qaRubricIds - Array of record IDs
65
+ * @param queryOptions - Query options (WHAT: entities to include)
66
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
67
+ */
68
+ getManyByPrimaryKey(qaRubricIds: string[], queryOptions?: DbGetQueryOptions, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").OdinRecord<QaRubricProperties>[]>;
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 qaRubricIds - Record IDs to delete
96
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
97
+ */
98
+ delete(qaRubricIds: string[], providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-sdk-generator").DbRecordDeleted[]>;
99
+ /**
100
+ * Restore one or many deleted records
101
+ * @param qaRubricIds - Record IDs to restore
102
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
103
+ */
104
+ restore(qaRubricIds: 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.QaRubricDb = 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 QaRubricApi(authParams).get(id)
20
+ * - New: new odin.qarubric.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 QaRubricDb(principal, dbService, { omitPermissionsCheck: true })
26
+ * - Method level: await db.getByPrimaryKey(id, { entities: [] }, { omitPermissionsCheck: true })
27
+ */
28
+ class QaRubricDb extends db_provider_1.DbProvider {
29
+ constructor(principal, dbService, defaultOptions) {
30
+ super(principal, dbService, defaultOptions);
31
+ this.moduleName = 'SupportModule';
32
+ this.entityName = 'QaRubric';
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 qarubricsection() {
42
+ if (!this._qarubricsection) {
43
+ this._qarubricsection = new db_record_link_manager_1.DbRecordLinkManager(this.principal, this.dbService, 'SupportModule:QaRubric', 'SupportModule:QaRubricSection', 'Rubric__Section');
44
+ }
45
+ return this._qarubricsection;
46
+ }
47
+ get qaautofail() {
48
+ if (!this._qaautofail) {
49
+ this._qaautofail = new db_record_link_manager_1.DbRecordLinkManager(this.principal, this.dbService, 'SupportModule:QaRubric', 'SupportModule:QaAutoFail', 'Rubric__AutoFail');
50
+ }
51
+ return this._qaautofail;
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 qaRubricId - 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(qaRubricId, queryOptions, providerOptions) {
100
+ return __awaiter(this, void 0, void 0, function* () {
101
+ const res = yield this._getByPrimaryKey(this.moduleName, this.entityName, qaRubricId, queryOptions, providerOptions);
102
+ if (res)
103
+ this.setRecord(res);
104
+ return res;
105
+ });
106
+ }
107
+ /**
108
+ * Get multiple records by primary keys
109
+ * @param qaRubricIds - Array of record IDs
110
+ * @param queryOptions - Query options (WHAT: entities to include)
111
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
112
+ */
113
+ getManyByPrimaryKey(qaRubricIds, queryOptions, providerOptions) {
114
+ return __awaiter(this, void 0, void 0, function* () {
115
+ return yield this._getManyByPrimaryKey(this.moduleName, this.entityName, qaRubricIds, 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 qaRubricIds - Record IDs to delete
163
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
164
+ */
165
+ delete(qaRubricIds, providerOptions) {
166
+ return __awaiter(this, void 0, void 0, function* () {
167
+ return yield this._delete(this.moduleName, this.entityName, qaRubricIds, providerOptions);
168
+ });
169
+ }
170
+ /**
171
+ * Restore one or many deleted records
172
+ * @param qaRubricIds - Record IDs to restore
173
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
174
+ */
175
+ restore(qaRubricIds, providerOptions) {
176
+ return __awaiter(this, void 0, void 0, function* () {
177
+ return yield this._restore(this.moduleName, this.entityName, qaRubricIds, 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.QaRubricDb = QaRubricDb;
@@ -0,0 +1,120 @@
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 { QaRubricItemProperties } from '../entities-v2/QaRubricItem';
5
+ /**
6
+ * @deprecated Use OdinDbClient.
7
+ *
8
+ * Migration:
9
+ * - Old: new QaRubricItemApi(authParams).get(id)
10
+ * - New: new odin.qarubricitem.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 QaRubricItemDb(principal, dbService, { omitPermissionsCheck: true })
16
+ * - Method level: await db.getByPrimaryKey(id, { entities: [] }, { omitPermissionsCheck: true })
17
+ */
18
+ export declare class QaRubricItemDb 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 _qarubricsection?;
25
+ constructor(principal: any, dbService: any, defaultOptions?: DbProviderOptions);
26
+ get qarubricsection(): DbRecordLinkManager;
27
+ setRecord(sourceRecord: any): void;
28
+ /**
29
+ * Search records with manual pagination control
30
+ * @param params - Search parameters
31
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
32
+ */
33
+ 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<QaRubricItemProperties>>>;
34
+ /**
35
+ * Search all records with automatic pagination
36
+ * @param params - Search parameters
37
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
38
+ */
39
+ 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<QaRubricItemProperties>>>;
40
+ /**
41
+ * Get a single record by primary key
42
+ * @param qaRubricItemId - Record ID
43
+ * @param queryOptions - Query options (WHAT: entities to include)
44
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
45
+ *
46
+ * @example
47
+ * // Simple get
48
+ * const record = await db.getByPrimaryKey(id);
49
+ *
50
+ * // With related entities
51
+ * const record = await db.getByPrimaryKey(id, { entities: ['InvoiceItem', 'Transaction'] });
52
+ *
53
+ * // With permissions bypass
54
+ * const record = await db.getByPrimaryKey(id, {}, { omitPermissionsCheck: true });
55
+ *
56
+ * // Both options
57
+ * const record = await db.getByPrimaryKey(id, { entities: ['Invoice'] }, { omitPermissionsCheck: true });
58
+ */
59
+ getByPrimaryKey(qaRubricItemId: string, queryOptions?: DbGetQueryOptions, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").OdinRecord<QaRubricItemProperties>>;
60
+ /**
61
+ * Get multiple records by primary keys
62
+ * @param qaRubricItemIds - Array of record IDs
63
+ * @param queryOptions - Query options (WHAT: entities to include)
64
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
65
+ */
66
+ getManyByPrimaryKey(qaRubricItemIds: string[], queryOptions?: DbGetQueryOptions, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").OdinRecord<QaRubricItemProperties>[]>;
67
+ /**
68
+ * Upsert a single record
69
+ * @param upsertDto - Record to upsert
70
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
71
+ */
72
+ upsert(upsertDto: OdinRecordCreateDto, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").IDbRecordCreateUpdateRes>;
73
+ /**
74
+ * Upsert multiple records
75
+ * @param upsertDtos - Records to upsert
76
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
77
+ */
78
+ upsertMany(upsertDtos: OdinRecordCreateDto[], providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").IDbRecordCreateUpdateRes[]>;
79
+ /**
80
+ * Update a single record
81
+ * @param updateDto - Record to update
82
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
83
+ */
84
+ update(updateDto: OdinRecordUpdateDto, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").IDbRecordCreateUpdateRes>;
85
+ /**
86
+ * Update multiple records
87
+ * @param updateDtos - Records to update
88
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
89
+ */
90
+ updateMany(updateDtos: OdinRecordUpdateDto[], providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").IDbRecordCreateUpdateRes[]>;
91
+ /**
92
+ * Delete one or many records
93
+ * @param qaRubricItemIds - Record IDs to delete
94
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
95
+ */
96
+ delete(qaRubricItemIds: string[], providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-sdk-generator").DbRecordDeleted[]>;
97
+ /**
98
+ * Restore one or many deleted records
99
+ * @param qaRubricItemIds - Record IDs to restore
100
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
101
+ */
102
+ restore(qaRubricItemIds: string[], providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-sdk-generator").DbRecordRestored[]>;
103
+ /**
104
+ * Apply an action to a record
105
+ * @param actionName - The action key
106
+ * @param dto - The action DTO
107
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
108
+ */
109
+ applyAction(actionName: string, dto: any, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").IDbRecordCreateUpdateRes[]>;
110
+ /**
111
+ * Get version history for the current source record
112
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
113
+ */
114
+ getVersions(providerOptions?: DbProviderOptions): Promise<any>;
115
+ /**
116
+ * Get revision timeline for the current source record
117
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
118
+ */
119
+ getRevisionTimeline(providerOptions?: DbProviderOptions): Promise<any>;
120
+ }
@@ -0,0 +1,204 @@
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.QaRubricItemDb = 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 QaRubricItemApi(authParams).get(id)
20
+ * - New: new odin.qarubricitem.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 QaRubricItemDb(principal, dbService, { omitPermissionsCheck: true })
26
+ * - Method level: await db.getByPrimaryKey(id, { entities: [] }, { omitPermissionsCheck: true })
27
+ */
28
+ class QaRubricItemDb extends db_provider_1.DbProvider {
29
+ constructor(principal, dbService, defaultOptions) {
30
+ super(principal, dbService, defaultOptions);
31
+ this.moduleName = 'SupportModule';
32
+ this.entityName = 'QaRubricItem';
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 qarubricsection() {
42
+ if (!this._qarubricsection) {
43
+ this._qarubricsection = new db_record_link_manager_1.DbRecordLinkManager(this.principal, this.dbService, 'SupportModule:QaRubricItem', 'SupportModule:QaRubricSection', 'Section__Item');
44
+ }
45
+ return this._qarubricsection;
46
+ }
47
+ // ============================================
48
+ // STANDARD METHODS
49
+ // ============================================
50
+ // Methods support separate query options and provider options for clean API
51
+ setRecord(sourceRecord) {
52
+ this.sourceRecord = sourceRecord;
53
+ }
54
+ /**
55
+ * Search records with manual pagination control
56
+ * @param params - Search parameters
57
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
58
+ */
59
+ searchRecords(params, providerOptions) {
60
+ return __awaiter(this, void 0, void 0, function* () {
61
+ return yield this._searchRecords(this.moduleName, this.entityName, params, providerOptions);
62
+ });
63
+ }
64
+ /**
65
+ * Search all records with automatic pagination
66
+ * @param params - Search parameters
67
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
68
+ */
69
+ searchAllRecordsAndPaginate(params, providerOptions) {
70
+ return __awaiter(this, void 0, void 0, function* () {
71
+ return yield this._searchAllRecordsAndPaginate(this.moduleName, this.entityName, params, 0, providerOptions);
72
+ });
73
+ }
74
+ /**
75
+ * Get a single record by primary key
76
+ * @param qaRubricItemId - Record ID
77
+ * @param queryOptions - Query options (WHAT: entities to include)
78
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
79
+ *
80
+ * @example
81
+ * // Simple get
82
+ * const record = await db.getByPrimaryKey(id);
83
+ *
84
+ * // With related entities
85
+ * const record = await db.getByPrimaryKey(id, { entities: ['InvoiceItem', 'Transaction'] });
86
+ *
87
+ * // With permissions bypass
88
+ * const record = await db.getByPrimaryKey(id, {}, { omitPermissionsCheck: true });
89
+ *
90
+ * // Both options
91
+ * const record = await db.getByPrimaryKey(id, { entities: ['Invoice'] }, { omitPermissionsCheck: true });
92
+ */
93
+ getByPrimaryKey(qaRubricItemId, queryOptions, providerOptions) {
94
+ return __awaiter(this, void 0, void 0, function* () {
95
+ const res = yield this._getByPrimaryKey(this.moduleName, this.entityName, qaRubricItemId, queryOptions, providerOptions);
96
+ if (res)
97
+ this.setRecord(res);
98
+ return res;
99
+ });
100
+ }
101
+ /**
102
+ * Get multiple records by primary keys
103
+ * @param qaRubricItemIds - Array of record IDs
104
+ * @param queryOptions - Query options (WHAT: entities to include)
105
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
106
+ */
107
+ getManyByPrimaryKey(qaRubricItemIds, queryOptions, providerOptions) {
108
+ return __awaiter(this, void 0, void 0, function* () {
109
+ return yield this._getManyByPrimaryKey(this.moduleName, this.entityName, qaRubricItemIds, queryOptions, providerOptions);
110
+ });
111
+ }
112
+ /**
113
+ * Upsert a single record
114
+ * @param upsertDto - Record to upsert
115
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
116
+ */
117
+ upsert(upsertDto, providerOptions) {
118
+ return __awaiter(this, void 0, void 0, function* () {
119
+ const res = yield this._upsert(this.moduleName, this.entityName, [upsertDto], providerOptions);
120
+ return res[0];
121
+ });
122
+ }
123
+ /**
124
+ * Upsert multiple records
125
+ * @param upsertDtos - Records to upsert
126
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
127
+ */
128
+ upsertMany(upsertDtos, providerOptions) {
129
+ return __awaiter(this, void 0, void 0, function* () {
130
+ return yield this._upsert(this.moduleName, this.entityName, upsertDtos, providerOptions);
131
+ });
132
+ }
133
+ /**
134
+ * Update a single record
135
+ * @param updateDto - Record to update
136
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
137
+ */
138
+ update(updateDto, providerOptions) {
139
+ return __awaiter(this, void 0, void 0, function* () {
140
+ const res = yield this._update(this.moduleName, this.entityName, [updateDto], providerOptions);
141
+ return res[0];
142
+ });
143
+ }
144
+ /**
145
+ * Update multiple records
146
+ * @param updateDtos - Records to update
147
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
148
+ */
149
+ updateMany(updateDtos, providerOptions) {
150
+ return __awaiter(this, void 0, void 0, function* () {
151
+ return yield this._update(this.moduleName, this.entityName, updateDtos, providerOptions);
152
+ });
153
+ }
154
+ /**
155
+ * Delete one or many records
156
+ * @param qaRubricItemIds - Record IDs to delete
157
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
158
+ */
159
+ delete(qaRubricItemIds, providerOptions) {
160
+ return __awaiter(this, void 0, void 0, function* () {
161
+ return yield this._delete(this.moduleName, this.entityName, qaRubricItemIds, providerOptions);
162
+ });
163
+ }
164
+ /**
165
+ * Restore one or many deleted records
166
+ * @param qaRubricItemIds - Record IDs to restore
167
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
168
+ */
169
+ restore(qaRubricItemIds, providerOptions) {
170
+ return __awaiter(this, void 0, void 0, function* () {
171
+ return yield this._restore(this.moduleName, this.entityName, qaRubricItemIds, providerOptions);
172
+ });
173
+ }
174
+ /**
175
+ * Apply an action to a record
176
+ * @param actionName - The action key
177
+ * @param dto - The action DTO
178
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
179
+ */
180
+ applyAction(actionName, dto, providerOptions) {
181
+ return __awaiter(this, void 0, void 0, function* () {
182
+ return yield this._applyAction(this.moduleName, this.entityName, dto, providerOptions);
183
+ });
184
+ }
185
+ /**
186
+ * Get version history for the current source record
187
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
188
+ */
189
+ getVersions(providerOptions) {
190
+ return __awaiter(this, void 0, void 0, function* () {
191
+ return yield this._getVersions(this.moduleName, this.entityName, this.sourceRecord.id, providerOptions);
192
+ });
193
+ }
194
+ /**
195
+ * Get revision timeline for the current source record
196
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
197
+ */
198
+ getRevisionTimeline(providerOptions) {
199
+ return __awaiter(this, void 0, void 0, function* () {
200
+ return yield this._getRevisionTimeline(this.moduleName, this.entityName, this.sourceRecord.id, providerOptions);
201
+ });
202
+ }
203
+ }
204
+ exports.QaRubricItemDb = QaRubricItemDb;