@d19n/youfibre-odin-sdk 2.0.376 → 2.0.378

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.
package/README.md CHANGED
@@ -124,7 +124,7 @@ await workOrder.completeWorkOrder({ ... });
124
124
 
125
125
  ## Entities
126
126
 
127
- This SDK includes **206** entities across **13** modules.
127
+ This SDK includes **207** entities across **13** modules.
128
128
 
129
129
  ### CrmModule
130
130
 
@@ -375,6 +375,7 @@ This SDK includes **206** entities across **13** modules.
375
375
  |--------|-------------|-------|
376
376
  | **Document** | Document Entity Definition | CONTRACT, CONTRACT_BUYOUT, CORPORATE_DOCUMENT... |
377
377
  | **DocumentProcessing** | DocumentProcessing Entity Definition | DEFAULT |
378
+ | **DocumentValue** | DocumentValue Entity Definition | DEFAULT |
378
379
 
379
380
  ### ProjectModule
380
381
 
@@ -20,10 +20,12 @@ export declare class DocumentApi extends ApiProvider {
20
20
  private _file?;
21
21
  private _documentprocessing?;
22
22
  private _contractbuyout?;
23
+ private _documentvalue?;
23
24
  constructor(authParams?: OauthParams, authToken?: string);
24
25
  get file(): ApiRecordLinkManager;
25
26
  get documentprocessing(): ApiRecordLinkManager;
26
27
  get contractbuyout(): ApiRecordLinkManager;
28
+ get documentvalue(): ApiRecordLinkManager;
27
29
  setRecord(sourceRecord: any): void;
28
30
  schema(): Promise<import("@d19n/odin-types/dist/core").OdinSchema>;
29
31
  search(params: Partial<OdinSearchV2>): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").OdinSearchResponse<import("@d19n/odin-types/dist/core").OdinRecord<DocumentProperties>>>;
@@ -51,6 +51,12 @@ class DocumentApi extends api_provider_1.ApiProvider {
51
51
  }
52
52
  return this._contractbuyout;
53
53
  }
54
+ get documentvalue() {
55
+ if (!this._documentvalue) {
56
+ this._documentvalue = new api_record_link_manager_1.ApiRecordLinkManager(this.authParams, 'AiModule:Document', 'AiModule:DocumentValue', 'Document__DocumentValue');
57
+ }
58
+ return this._documentvalue;
59
+ }
54
60
  // ============================================
55
61
  // STANDARD METHODS (Unchanged API)
56
62
  // ============================================
@@ -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 { DocumentValueProperties } from '../entities-v2/DocumentValue';
6
+ /**
7
+ * @deprecated Use OdinApiClient.
8
+ *
9
+ * Migration:
10
+ * - Old: new DocumentValueApi(authParams).get(id)
11
+ * - New: new odin.documentvalue.get(id)
12
+ *
13
+ * The new OdinApiClient returns typed record wrappers with action methods.
14
+ */
15
+ export declare class DocumentValueApi extends ApiProvider {
16
+ protected readonly authToken?: string;
17
+ private readonly moduleName;
18
+ private readonly entityName;
19
+ private sourceRecord;
20
+ private _document?;
21
+ constructor(authParams?: OauthParams, authToken?: string);
22
+ get document(): 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<DocumentValueProperties>>>;
26
+ searchAndPaginate(params: Partial<OdinSearchV2>): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").OdinSearchResponse<import("@d19n/odin-types/dist/core").OdinRecord<DocumentValueProperties>>>;
27
+ reIndex(body: {
28
+ id: string;
29
+ schemaId: string;
30
+ }[]): Promise<any>;
31
+ get(documentValueId: string): Promise<import("@d19n/odin-types/dist/core").OdinRecord<DocumentValueProperties>>;
32
+ getMany(documentValueIds: string[]): Promise<import("@d19n/odin-types/dist/core").OdinRecord<DocumentValueProperties>[]>;
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(documentValueId: string): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").OdinDeleteResponse[]>;
38
+ deleteMany(documentValueIds: string[]): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").OdinDeleteResponse[]>;
39
+ restore(documentValueIds: 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.DocumentValueApi = 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 DocumentValueApi(authParams).get(id)
20
+ * - New: new odin.documentvalue.get(id)
21
+ *
22
+ * The new OdinApiClient returns typed record wrappers with action methods.
23
+ */
24
+ class DocumentValueApi extends api_provider_1.ApiProvider {
25
+ constructor(authParams, authToken) {
26
+ super(authParams, authToken);
27
+ this.authToken = authToken;
28
+ this.moduleName = 'AiModule';
29
+ this.entityName = 'DocumentValue';
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 document() {
37
+ if (!this._document) {
38
+ this._document = new api_record_link_manager_1.ApiRecordLinkManager(this.authParams, 'AiModule:DocumentValue', 'AiModule:Document', 'Document__DocumentValue');
39
+ }
40
+ return this._document;
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(documentValueId) {
73
+ return __awaiter(this, void 0, void 0, function* () {
74
+ const res = yield this._getByPrimaryKey(this.moduleName, this.entityName, documentValueId);
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(documentValueIds) {
82
+ return __awaiter(this, void 0, void 0, function* () {
83
+ return yield this._getManyByPrimaryKey(this.moduleName, this.entityName, documentValueIds);
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(documentValueId) {
114
+ return __awaiter(this, void 0, void 0, function* () {
115
+ return yield this._delete(this.moduleName, this.entityName, [documentValueId]);
116
+ });
117
+ }
118
+ // Use this function when you want to delete many records
119
+ deleteMany(documentValueIds) {
120
+ return __awaiter(this, void 0, void 0, function* () {
121
+ return yield this._delete(this.moduleName, this.entityName, documentValueIds);
122
+ });
123
+ }
124
+ // Use this function when you want to restore one or many records
125
+ restore(documentValueIds) {
126
+ return __awaiter(this, void 0, void 0, function* () {
127
+ return yield this._restore(this.moduleName, this.entityName, documentValueIds);
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.DocumentValueApi = DocumentValueApi;
@@ -24,10 +24,12 @@ export declare class DocumentDb extends DbProvider {
24
24
  private _file?;
25
25
  private _documentprocessing?;
26
26
  private _contractbuyout?;
27
+ private _documentvalue?;
27
28
  constructor(principal: any, dbService: any, defaultOptions?: DbProviderOptions);
28
29
  get file(): DbRecordLinkManager;
29
30
  get documentprocessing(): DbRecordLinkManager;
30
31
  get contractbuyout(): DbRecordLinkManager;
32
+ get documentvalue(): DbRecordLinkManager;
31
33
  setRecord(sourceRecord: any): void;
32
34
  /**
33
35
  * Search records with manual pagination control
@@ -56,6 +56,12 @@ class DocumentDb extends db_provider_1.DbProvider {
56
56
  }
57
57
  return this._contractbuyout;
58
58
  }
59
+ get documentvalue() {
60
+ if (!this._documentvalue) {
61
+ this._documentvalue = new db_record_link_manager_1.DbRecordLinkManager(this.principal, this.dbService, 'AiModule:Document', 'AiModule:DocumentValue', 'Document__DocumentValue');
62
+ }
63
+ return this._documentvalue;
64
+ }
59
65
  // ============================================
60
66
  // STANDARD METHODS
61
67
  // ============================================
@@ -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 { DocumentValueProperties } from '../entities-v2/DocumentValue';
5
+ /**
6
+ * @deprecated Use OdinDbClient.
7
+ *
8
+ * Migration:
9
+ * - Old: new DocumentValueApi(authParams).get(id)
10
+ * - New: new odin.documentvalue.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 DocumentValueDb(principal, dbService, { omitPermissionsCheck: true })
16
+ * - Method level: await db.getByPrimaryKey(id, { entities: [] }, { omitPermissionsCheck: true })
17
+ */
18
+ export declare class DocumentValueDb 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 _document?;
25
+ constructor(principal: any, dbService: any, defaultOptions?: DbProviderOptions);
26
+ get document(): 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<DocumentValueProperties>>>;
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<DocumentValueProperties>>>;
40
+ /**
41
+ * Get a single record by primary key
42
+ * @param documentValueId - 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(documentValueId: string, queryOptions?: DbGetQueryOptions, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").OdinRecord<DocumentValueProperties>>;
60
+ /**
61
+ * Get multiple records by primary keys
62
+ * @param documentValueIds - Array of record IDs
63
+ * @param queryOptions - Query options (WHAT: entities to include)
64
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
65
+ */
66
+ getManyByPrimaryKey(documentValueIds: string[], queryOptions?: DbGetQueryOptions, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").OdinRecord<DocumentValueProperties>[]>;
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 documentValueIds - Record IDs to delete
94
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
95
+ */
96
+ delete(documentValueIds: string[], providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-sdk-generator").DbRecordDeleted[]>;
97
+ /**
98
+ * Restore one or many deleted records
99
+ * @param documentValueIds - Record IDs to restore
100
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
101
+ */
102
+ restore(documentValueIds: 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.DocumentValueDb = 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 DocumentValueApi(authParams).get(id)
20
+ * - New: new odin.documentvalue.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 DocumentValueDb(principal, dbService, { omitPermissionsCheck: true })
26
+ * - Method level: await db.getByPrimaryKey(id, { entities: [] }, { omitPermissionsCheck: true })
27
+ */
28
+ class DocumentValueDb extends db_provider_1.DbProvider {
29
+ constructor(principal, dbService, defaultOptions) {
30
+ super(principal, dbService, defaultOptions);
31
+ this.moduleName = 'AiModule';
32
+ this.entityName = 'DocumentValue';
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 document() {
42
+ if (!this._document) {
43
+ this._document = new db_record_link_manager_1.DbRecordLinkManager(this.principal, this.dbService, 'AiModule:DocumentValue', 'AiModule:Document', 'Document__DocumentValue');
44
+ }
45
+ return this._document;
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 documentValueId - 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(documentValueId, queryOptions, providerOptions) {
94
+ return __awaiter(this, void 0, void 0, function* () {
95
+ const res = yield this._getByPrimaryKey(this.moduleName, this.entityName, documentValueId, queryOptions, providerOptions);
96
+ if (res)
97
+ this.setRecord(res);
98
+ return res;
99
+ });
100
+ }
101
+ /**
102
+ * Get multiple records by primary keys
103
+ * @param documentValueIds - Array of record IDs
104
+ * @param queryOptions - Query options (WHAT: entities to include)
105
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
106
+ */
107
+ getManyByPrimaryKey(documentValueIds, queryOptions, providerOptions) {
108
+ return __awaiter(this, void 0, void 0, function* () {
109
+ return yield this._getManyByPrimaryKey(this.moduleName, this.entityName, documentValueIds, 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 documentValueIds - Record IDs to delete
157
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
158
+ */
159
+ delete(documentValueIds, providerOptions) {
160
+ return __awaiter(this, void 0, void 0, function* () {
161
+ return yield this._delete(this.moduleName, this.entityName, documentValueIds, providerOptions);
162
+ });
163
+ }
164
+ /**
165
+ * Restore one or many deleted records
166
+ * @param documentValueIds - Record IDs to restore
167
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
168
+ */
169
+ restore(documentValueIds, providerOptions) {
170
+ return __awaiter(this, void 0, void 0, function* () {
171
+ return yield this._restore(this.moduleName, this.entityName, documentValueIds, 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.DocumentValueDb = DocumentValueDb;
@@ -430,6 +430,7 @@ export declare enum CaseCategory {
430
430
  * - `AMEND_MY_ORDER` - Amend my Order
431
431
  * - `AREA_AVAILABILITY_QUERY` - Area Availability Query
432
432
  * - `BAD_CSAT` - Bad CSAT
433
+ * - `BILLING` - Billing
433
434
  * - `CANCEL_APPOINTMENT` - Cancel Appointment
434
435
  * - `CHANGE_CONTACT_DETAILS` - Change contact details
435
436
  * - `CHURN_REQUEST` - Churn Request
@@ -439,15 +440,15 @@ export declare enum CaseCategory {
439
440
  * - `COMPLAINT` - Complaint
440
441
  * - `CONTRACT_BUYOUT` - Contract Buyout
441
442
  * - `COPY_OF_INVOICE` - Copy of Invoice
442
- * - `CUSTOMER_DEVICE_ISSUE` - Customer Device Issue
443
- * - `DATA_SUBJECT_ACCESS_REQUEST` - Data Subject Access Request
444
- * - ... and 45 more
443
+ * - `CS_ESCALATIONS` - CS Escalations
444
+ * - ... and 51 more
445
445
  */
446
446
  export declare enum CaseSubCategory {
447
447
  AMEND_BILLING_DATE = "AMEND_BILLING_DATE",
448
448
  AMEND_MY_ORDER = "AMEND_MY_ORDER",
449
449
  AREA_AVAILABILITY_QUERY = "AREA_AVAILABILITY_QUERY",
450
450
  BAD_CSAT = "BAD_CSAT",
451
+ BILLING = "BILLING",
451
452
  CANCEL_APPOINTMENT = "CANCEL_APPOINTMENT",
452
453
  CHANGE_CONTACT_DETAILS = "CHANGE_CONTACT_DETAILS",
453
454
  CHURN_REQUEST = "CHURN_REQUEST",
@@ -457,6 +458,7 @@ export declare enum CaseSubCategory {
457
458
  COMPLAINT = "COMPLAINT",
458
459
  CONTRACT_BUYOUT = "CONTRACT_BUYOUT",
459
460
  COPY_OF_INVOICE = "COPY_OF_INVOICE",
461
+ CS_ESCALATIONS = "CS_ESCALATIONS",
460
462
  CUSTOMER_DEVICE_ISSUE = "CUSTOMER_DEVICE_ISSUE",
461
463
  DATA_SUBJECT_ACCESS_REQUEST = "DATA_SUBJECT_ACCESS_REQUEST",
462
464
  DIRECT_DEBIT = "DIRECT_DEBIT",
@@ -464,8 +466,10 @@ export declare enum CaseSubCategory {
464
466
  EQUIPMENT_RETURN_REFUND = "EQUIPMENT_RETURN_REFUND",
465
467
  ESCALATED_COMPLAINT = "ESCALATED_COMPLAINT",
466
468
  ETF_CUSTOMER_LEAVING_YF = "ETF_CUSTOMER_LEAVING",
469
+ FORMAL_COMPLAINTS = "FORMAL_COMPLAINTS",
467
470
  FRUSTRATION_OUTREACH = "FRUSTRATION_OUTREACH",
468
471
  GDPR_DATA_BREACH = "GDPR_DATA_BREACH",
472
+ HOME_MOVES = "HOME_MOVES",
469
473
  INACTIVE_CHAT_NO_CUSTOMER_RESPONSE = "INACTIVE_CHAT_NO_CUSTOMER_RESPONSE",
470
474
  INSTALL_APPOINTMENT = "INSTALL_APPOINTMENT",
471
475
  INSTALL_REMEDIATION_QUERY = "INSTALL_REMEDIATION_QUERY",
@@ -495,6 +499,8 @@ export declare enum CaseSubCategory {
495
499
  RECONTRACT_UPGRADE = "RECONTRACT_UPGRADE",
496
500
  REFERRAL = "REFERRAL",
497
501
  RETENTIONS = "RETENTIONS",
502
+ SALES = "SALES",
503
+ SALES_CBO = "SALES_CBO",
498
504
  SERVICE_VISIT = "SERVICE_VISIT",
499
505
  SPAM = "SPAM",
500
506
  SPEED_HARD_WIRED = "SPEED_HARD_WIRED",