@d19n/youfibre-odin-sdk 2.0.342 → 2.0.343

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 (88) hide show
  1. package/README.md +25 -2
  2. package/dist/EntityRegistry.d.ts +4 -0
  3. package/dist/EntityRegistry.js +4 -0
  4. package/dist/OdinApiClient.d.ts +8 -0
  5. package/dist/OdinApiClient.js +16 -0
  6. package/dist/OdinDbClient.d.ts +8 -0
  7. package/dist/OdinDbClient.js +16 -0
  8. package/dist/accessors-v2/DocumentAccessor.d.ts +112 -0
  9. package/dist/accessors-v2/DocumentAccessor.js +191 -0
  10. package/dist/accessors-v2/DocumentProcessingAccessor.d.ts +112 -0
  11. package/dist/accessors-v2/DocumentProcessingAccessor.js +191 -0
  12. package/dist/accessors-v2/index.d.ts +2 -0
  13. package/dist/accessors-v2/index.js +7 -3
  14. package/dist/actions-v2/CreateAiRouteRequestDto.d.ts +1 -1
  15. package/dist/actions-v2/CreateChurnRequestDto.d.ts +2 -0
  16. package/dist/actions-v2/CreateChurnRequestDto.js +2 -0
  17. package/dist/actions-v2/CreateDocumentDto.d.ts +235 -0
  18. package/dist/actions-v2/CreateDocumentDto.js +57 -0
  19. package/dist/actions-v2/CreateDocumentProcessingDto.d.ts +192 -0
  20. package/dist/actions-v2/CreateDocumentProcessingDto.js +57 -0
  21. package/dist/actions-v2/CreateLeadSalesAppDto.d.ts +9 -17
  22. package/dist/actions-v2/UpdateDocumentDto.d.ts +236 -0
  23. package/dist/actions-v2/UpdateDocumentDto.js +59 -0
  24. package/dist/actions-v2/UpdateMessageReadByCustomerDto.d.ts +72 -0
  25. package/dist/actions-v2/UpdateMessageReadByCustomerDto.js +56 -0
  26. package/dist/api-sdk-v2/ContractBuyOutApi.d.ts +2 -0
  27. package/dist/api-sdk-v2/ContractBuyOutApi.js +6 -0
  28. package/dist/api-sdk-v2/DocumentApi.d.ts +52 -0
  29. package/dist/api-sdk-v2/DocumentApi.js +167 -0
  30. package/dist/api-sdk-v2/DocumentProcessingApi.d.ts +50 -0
  31. package/dist/api-sdk-v2/DocumentProcessingApi.js +161 -0
  32. package/dist/api-sdk-v2/EquipmentReturnApi.d.ts +45 -0
  33. package/dist/api-sdk-v2/EquipmentReturnApi.js +151 -0
  34. package/dist/api-sdk-v2/EquipmentReturnItemApi.d.ts +45 -0
  35. package/dist/api-sdk-v2/EquipmentReturnItemApi.js +151 -0
  36. package/dist/api-sdk-v2/FileApi.d.ts +4 -0
  37. package/dist/api-sdk-v2/FileApi.js +12 -0
  38. package/dist/db-accessors-v2/DocumentDbAccessor.d.ts +180 -0
  39. package/dist/db-accessors-v2/DocumentDbAccessor.js +265 -0
  40. package/dist/db-accessors-v2/DocumentProcessingDbAccessor.d.ts +180 -0
  41. package/dist/db-accessors-v2/DocumentProcessingDbAccessor.js +265 -0
  42. package/dist/db-accessors-v2/index.d.ts +2 -0
  43. package/dist/db-accessors-v2/index.js +7 -3
  44. package/dist/db-sdk-v2/ContractBuyOutDb.d.ts +2 -0
  45. package/dist/db-sdk-v2/ContractBuyOutDb.js +6 -0
  46. package/dist/db-sdk-v2/DocumentDb.d.ts +124 -0
  47. package/dist/db-sdk-v2/DocumentDb.js +216 -0
  48. package/dist/db-sdk-v2/DocumentProcessingDb.d.ts +122 -0
  49. package/dist/db-sdk-v2/DocumentProcessingDb.js +210 -0
  50. package/dist/db-sdk-v2/EquipmentReturnDb.d.ts +117 -0
  51. package/dist/db-sdk-v2/EquipmentReturnDb.js +200 -0
  52. package/dist/db-sdk-v2/EquipmentReturnItemDb.d.ts +117 -0
  53. package/dist/db-sdk-v2/EquipmentReturnItemDb.js +200 -0
  54. package/dist/db-sdk-v2/FileDb.d.ts +4 -0
  55. package/dist/db-sdk-v2/FileDb.js +12 -0
  56. package/dist/entities-v2/AiRouteRequest.d.ts +23 -11
  57. package/dist/entities-v2/AiRouteRequest.js +15 -3
  58. package/dist/entities-v2/ContractBuyOut.d.ts +7 -0
  59. package/dist/entities-v2/ContractBuyOut.js +5 -1
  60. package/dist/entities-v2/Document.d.ts +1145 -0
  61. package/dist/entities-v2/Document.js +220 -0
  62. package/dist/entities-v2/DocumentProcessing.d.ts +272 -0
  63. package/dist/entities-v2/DocumentProcessing.js +156 -0
  64. package/dist/entities-v2/EquipmentReturn.d.ts +66 -0
  65. package/dist/entities-v2/EquipmentReturn.js +64 -0
  66. package/dist/entities-v2/EquipmentReturnItem.d.ts +66 -0
  67. package/dist/entities-v2/EquipmentReturnItem.js +64 -0
  68. package/dist/entities-v2/File.d.ts +81 -1
  69. package/dist/entities-v2/File.js +9 -1
  70. package/dist/entities-v2/Message.d.ts +27 -1
  71. package/dist/entities-v2/Message.js +2 -0
  72. package/dist/entities-v2/Order.d.ts +8 -8
  73. package/dist/entities-v2/Order.js +2 -2
  74. package/dist/entities-v2/YfStockCount.d.ts +197 -1
  75. package/dist/entities-v2/YfStockCount.js +28 -0
  76. package/dist/records-v2/ContractBuyOutRecord.d.ts +20 -0
  77. package/dist/records-v2/ContractBuyOutRecord.js +33 -0
  78. package/dist/records-v2/DocumentProcessingRecord.d.ts +227 -0
  79. package/dist/records-v2/DocumentProcessingRecord.js +315 -0
  80. package/dist/records-v2/DocumentRecord.d.ts +355 -0
  81. package/dist/records-v2/DocumentRecord.js +468 -0
  82. package/dist/records-v2/FileRecord.d.ts +59 -3
  83. package/dist/records-v2/FileRecord.js +83 -1
  84. package/dist/records-v2/MessageRecord.d.ts +28 -0
  85. package/dist/records-v2/MessageRecord.js +37 -0
  86. package/dist/records-v2/index.d.ts +2 -0
  87. package/dist/records-v2/index.js +10 -4
  88. package/package.json +1 -1
@@ -0,0 +1,151 @@
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.EquipmentReturnApi = void 0;
13
+ const api_provider_1 = require("@d19n/odin-sdk-generator/dist/api.provider");
14
+ /**
15
+ * @deprecated Use OdinApiClient.
16
+ *
17
+ * Migration:
18
+ * - Old: new EquipmentReturnApi(authParams).get(id)
19
+ * - New: new odin.equipmentreturn.get(id)
20
+ *
21
+ * The new OdinApiClient returns typed record wrappers with action methods.
22
+ */
23
+ class EquipmentReturnApi extends api_provider_1.ApiProvider {
24
+ // ============================================
25
+ // PRIVATE BACKING FIELDS (Lazy Loading)
26
+ // ============================================
27
+ constructor(authParams, authToken) {
28
+ super(authParams, authToken);
29
+ this.authToken = authToken;
30
+ this.moduleName = 'FieldServiceModule';
31
+ this.entityName = 'EquipmentReturn';
32
+ // Link managers are lazy-loaded on first access
33
+ }
34
+ // ============================================
35
+ // LAZY-LOADED LINK MANAGERS (Public Getters)
36
+ // ============================================
37
+ // Usage remains identical: api.address.list(recordId)
38
+ // ============================================
39
+ // STANDARD METHODS (Unchanged API)
40
+ // ============================================
41
+ setRecord(sourceRecord) {
42
+ this.sourceRecord = sourceRecord;
43
+ }
44
+ schema() {
45
+ return __awaiter(this, void 0, void 0, function* () {
46
+ return yield this.getSchema(this.moduleName, this.entityName);
47
+ });
48
+ }
49
+ // Use this function when you want to search and handle all pagination on your own
50
+ search(params) {
51
+ return __awaiter(this, void 0, void 0, function* () {
52
+ return yield this._searchRecords(this.moduleName, this.entityName, params);
53
+ });
54
+ }
55
+ // Use this function when you want paginating through the results to be handled
56
+ searchAndPaginate(params) {
57
+ return __awaiter(this, void 0, void 0, function* () {
58
+ return yield this._searchAllRecordsAndPaginate(this.moduleName, this.entityName, params);
59
+ });
60
+ }
61
+ // Use this function to re-index records in elastic search
62
+ reIndex(body) {
63
+ return __awaiter(this, void 0, void 0, function* () {
64
+ return yield this._reIndexRecords(body);
65
+ });
66
+ }
67
+ // Use this function when you want to return a single record
68
+ get(equipmentReturnId) {
69
+ return __awaiter(this, void 0, void 0, function* () {
70
+ const res = yield this._getByPrimaryKey(this.moduleName, this.entityName, equipmentReturnId);
71
+ if (res)
72
+ this.setRecord(res);
73
+ return res;
74
+ });
75
+ }
76
+ // Use this function when you want to return many records by primaryKeys
77
+ getMany(equipmentReturnIds) {
78
+ return __awaiter(this, void 0, void 0, function* () {
79
+ return yield this._getManyByPrimaryKey(this.moduleName, this.entityName, equipmentReturnIds);
80
+ });
81
+ }
82
+ // Use this function when you want to upsert one record
83
+ upsert(upsertDto) {
84
+ return __awaiter(this, void 0, void 0, function* () {
85
+ const res = yield this._upsert(this.moduleName, this.entityName, [upsertDto]);
86
+ return res[0];
87
+ });
88
+ }
89
+ // Use this function when you want to upsert many records
90
+ upsertMany(upsertDtos) {
91
+ return __awaiter(this, void 0, void 0, function* () {
92
+ return yield this._upsert(this.moduleName, this.entityName, upsertDtos);
93
+ });
94
+ }
95
+ // Use this function when you want to update one record
96
+ update(updateDto) {
97
+ return __awaiter(this, void 0, void 0, function* () {
98
+ const res = yield this._update(this.moduleName, this.entityName, [updateDto]);
99
+ return res[0];
100
+ });
101
+ }
102
+ // Use this function when you want to update many records
103
+ updateMany(updateDtos) {
104
+ return __awaiter(this, void 0, void 0, function* () {
105
+ return yield this._update(this.moduleName, this.entityName, updateDtos);
106
+ });
107
+ }
108
+ // Use this function when you want to delete one record
109
+ delete(equipmentReturnId) {
110
+ return __awaiter(this, void 0, void 0, function* () {
111
+ return yield this._delete(this.moduleName, this.entityName, [equipmentReturnId]);
112
+ });
113
+ }
114
+ // Use this function when you want to delete many records
115
+ deleteMany(equipmentReturnIds) {
116
+ return __awaiter(this, void 0, void 0, function* () {
117
+ return yield this._delete(this.moduleName, this.entityName, equipmentReturnIds);
118
+ });
119
+ }
120
+ // Use this function when you want to restore one or many records
121
+ restore(equipmentReturnIds) {
122
+ return __awaiter(this, void 0, void 0, function* () {
123
+ return yield this._restore(this.moduleName, this.entityName, equipmentReturnIds);
124
+ });
125
+ }
126
+ // Use this function when you want to apply a single action
127
+ applyAction(dto) {
128
+ return __awaiter(this, void 0, void 0, function* () {
129
+ return yield this._applyAction(this.moduleName, this.entityName, dto);
130
+ });
131
+ }
132
+ // Use this function when you want to bulk apply actions
133
+ bulkApplyActions(dtos) {
134
+ return __awaiter(this, void 0, void 0, function* () {
135
+ return yield this._bulkApplyActions(this.moduleName, this.entityName, dtos);
136
+ });
137
+ }
138
+ // Use this function when you want to return the versions for a single record
139
+ getVersions() {
140
+ return __awaiter(this, void 0, void 0, function* () {
141
+ return yield this._getVersions(this.moduleName, this.entityName, this.sourceRecord.id);
142
+ });
143
+ }
144
+ // Use this function when you want to return the change history for a single record
145
+ getRevisionTimeline() {
146
+ return __awaiter(this, void 0, void 0, function* () {
147
+ return yield this._getRevisionTimeline(this.moduleName, this.entityName, this.sourceRecord.id);
148
+ });
149
+ }
150
+ }
151
+ exports.EquipmentReturnApi = EquipmentReturnApi;
@@ -0,0 +1,45 @@
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 { EquipmentReturnItemProperties } from '../entities-v2/EquipmentReturnItem';
5
+ /**
6
+ * @deprecated Use OdinApiClient.
7
+ *
8
+ * Migration:
9
+ * - Old: new EquipmentReturnItemApi(authParams).get(id)
10
+ * - New: new odin.equipmentreturnitem.get(id)
11
+ *
12
+ * The new OdinApiClient returns typed record wrappers with action methods.
13
+ */
14
+ export declare class EquipmentReturnItemApi extends ApiProvider {
15
+ protected readonly authToken?: string;
16
+ private readonly moduleName;
17
+ private readonly entityName;
18
+ private sourceRecord;
19
+ constructor(authParams?: OauthParams, authToken?: string);
20
+ setRecord(sourceRecord: any): void;
21
+ schema(): Promise<import("@d19n/odin-types/dist/core").OdinSchema>;
22
+ search(params: Partial<OdinSearchV2>): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").OdinSearchResponse<import("@d19n/odin-types/dist/core").OdinRecord<EquipmentReturnItemProperties>>>;
23
+ searchAndPaginate(params: Partial<OdinSearchV2>): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").OdinSearchResponse<import("@d19n/odin-types/dist/core").OdinRecord<EquipmentReturnItemProperties>>>;
24
+ reIndex(body: {
25
+ id: string;
26
+ schemaId: string;
27
+ }[]): Promise<any>;
28
+ get(equipmentReturnItemId: string): Promise<import("@d19n/odin-types/dist/core").OdinRecord<EquipmentReturnItemProperties>>;
29
+ getMany(equipmentReturnItemIds: string[]): Promise<import("@d19n/odin-types/dist/core").OdinRecord<EquipmentReturnItemProperties>[]>;
30
+ upsert(upsertDto: OdinRecordCreateDto): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").IDbRecordCreateUpdateRes>;
31
+ upsertMany(upsertDtos: OdinRecordCreateDto[]): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").IDbRecordCreateUpdateRes[]>;
32
+ update(updateDto: OdinRecordUpdateDto): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").IDbRecordCreateUpdateRes>;
33
+ updateMany(updateDtos: OdinRecordUpdateDto[]): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").IDbRecordCreateUpdateRes[]>;
34
+ delete(equipmentReturnItemId: string): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").OdinDeleteResponse[]>;
35
+ deleteMany(equipmentReturnItemIds: string[]): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").OdinDeleteResponse[]>;
36
+ restore(equipmentReturnItemIds: string[]): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").OdinRestoreResponse[]>;
37
+ applyAction(dto: any): Promise<any[]>;
38
+ bulkApplyActions(dtos: any[]): Promise<any[]>;
39
+ getVersions(): Promise<{
40
+ [key: string]: Record<string, any>;
41
+ }>;
42
+ getRevisionTimeline(): Promise<{
43
+ [key: string]: Record<string, any>[];
44
+ }>;
45
+ }
@@ -0,0 +1,151 @@
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.EquipmentReturnItemApi = void 0;
13
+ const api_provider_1 = require("@d19n/odin-sdk-generator/dist/api.provider");
14
+ /**
15
+ * @deprecated Use OdinApiClient.
16
+ *
17
+ * Migration:
18
+ * - Old: new EquipmentReturnItemApi(authParams).get(id)
19
+ * - New: new odin.equipmentreturnitem.get(id)
20
+ *
21
+ * The new OdinApiClient returns typed record wrappers with action methods.
22
+ */
23
+ class EquipmentReturnItemApi extends api_provider_1.ApiProvider {
24
+ // ============================================
25
+ // PRIVATE BACKING FIELDS (Lazy Loading)
26
+ // ============================================
27
+ constructor(authParams, authToken) {
28
+ super(authParams, authToken);
29
+ this.authToken = authToken;
30
+ this.moduleName = 'FieldServiceModule';
31
+ this.entityName = 'EquipmentReturnItem';
32
+ // Link managers are lazy-loaded on first access
33
+ }
34
+ // ============================================
35
+ // LAZY-LOADED LINK MANAGERS (Public Getters)
36
+ // ============================================
37
+ // Usage remains identical: api.address.list(recordId)
38
+ // ============================================
39
+ // STANDARD METHODS (Unchanged API)
40
+ // ============================================
41
+ setRecord(sourceRecord) {
42
+ this.sourceRecord = sourceRecord;
43
+ }
44
+ schema() {
45
+ return __awaiter(this, void 0, void 0, function* () {
46
+ return yield this.getSchema(this.moduleName, this.entityName);
47
+ });
48
+ }
49
+ // Use this function when you want to search and handle all pagination on your own
50
+ search(params) {
51
+ return __awaiter(this, void 0, void 0, function* () {
52
+ return yield this._searchRecords(this.moduleName, this.entityName, params);
53
+ });
54
+ }
55
+ // Use this function when you want paginating through the results to be handled
56
+ searchAndPaginate(params) {
57
+ return __awaiter(this, void 0, void 0, function* () {
58
+ return yield this._searchAllRecordsAndPaginate(this.moduleName, this.entityName, params);
59
+ });
60
+ }
61
+ // Use this function to re-index records in elastic search
62
+ reIndex(body) {
63
+ return __awaiter(this, void 0, void 0, function* () {
64
+ return yield this._reIndexRecords(body);
65
+ });
66
+ }
67
+ // Use this function when you want to return a single record
68
+ get(equipmentReturnItemId) {
69
+ return __awaiter(this, void 0, void 0, function* () {
70
+ const res = yield this._getByPrimaryKey(this.moduleName, this.entityName, equipmentReturnItemId);
71
+ if (res)
72
+ this.setRecord(res);
73
+ return res;
74
+ });
75
+ }
76
+ // Use this function when you want to return many records by primaryKeys
77
+ getMany(equipmentReturnItemIds) {
78
+ return __awaiter(this, void 0, void 0, function* () {
79
+ return yield this._getManyByPrimaryKey(this.moduleName, this.entityName, equipmentReturnItemIds);
80
+ });
81
+ }
82
+ // Use this function when you want to upsert one record
83
+ upsert(upsertDto) {
84
+ return __awaiter(this, void 0, void 0, function* () {
85
+ const res = yield this._upsert(this.moduleName, this.entityName, [upsertDto]);
86
+ return res[0];
87
+ });
88
+ }
89
+ // Use this function when you want to upsert many records
90
+ upsertMany(upsertDtos) {
91
+ return __awaiter(this, void 0, void 0, function* () {
92
+ return yield this._upsert(this.moduleName, this.entityName, upsertDtos);
93
+ });
94
+ }
95
+ // Use this function when you want to update one record
96
+ update(updateDto) {
97
+ return __awaiter(this, void 0, void 0, function* () {
98
+ const res = yield this._update(this.moduleName, this.entityName, [updateDto]);
99
+ return res[0];
100
+ });
101
+ }
102
+ // Use this function when you want to update many records
103
+ updateMany(updateDtos) {
104
+ return __awaiter(this, void 0, void 0, function* () {
105
+ return yield this._update(this.moduleName, this.entityName, updateDtos);
106
+ });
107
+ }
108
+ // Use this function when you want to delete one record
109
+ delete(equipmentReturnItemId) {
110
+ return __awaiter(this, void 0, void 0, function* () {
111
+ return yield this._delete(this.moduleName, this.entityName, [equipmentReturnItemId]);
112
+ });
113
+ }
114
+ // Use this function when you want to delete many records
115
+ deleteMany(equipmentReturnItemIds) {
116
+ return __awaiter(this, void 0, void 0, function* () {
117
+ return yield this._delete(this.moduleName, this.entityName, equipmentReturnItemIds);
118
+ });
119
+ }
120
+ // Use this function when you want to restore one or many records
121
+ restore(equipmentReturnItemIds) {
122
+ return __awaiter(this, void 0, void 0, function* () {
123
+ return yield this._restore(this.moduleName, this.entityName, equipmentReturnItemIds);
124
+ });
125
+ }
126
+ // Use this function when you want to apply a single action
127
+ applyAction(dto) {
128
+ return __awaiter(this, void 0, void 0, function* () {
129
+ return yield this._applyAction(this.moduleName, this.entityName, dto);
130
+ });
131
+ }
132
+ // Use this function when you want to bulk apply actions
133
+ bulkApplyActions(dtos) {
134
+ return __awaiter(this, void 0, void 0, function* () {
135
+ return yield this._bulkApplyActions(this.moduleName, this.entityName, dtos);
136
+ });
137
+ }
138
+ // Use this function when you want to return the versions for a single record
139
+ getVersions() {
140
+ return __awaiter(this, void 0, void 0, function* () {
141
+ return yield this._getVersions(this.moduleName, this.entityName, this.sourceRecord.id);
142
+ });
143
+ }
144
+ // Use this function when you want to return the change history for a single record
145
+ getRevisionTimeline() {
146
+ return __awaiter(this, void 0, void 0, function* () {
147
+ return yield this._getRevisionTimeline(this.moduleName, this.entityName, this.sourceRecord.id);
148
+ });
149
+ }
150
+ }
151
+ exports.EquipmentReturnItemApi = EquipmentReturnItemApi;
@@ -81,6 +81,8 @@ export declare class FileApi extends ApiProvider {
81
81
  private _pgdirectdebitfile?;
82
82
  private _yfwifisurvey?;
83
83
  private _yffieldvisitoutcomeform?;
84
+ private _document?;
85
+ private _documentprocessing?;
84
86
  constructor(authParams?: OauthParams, authToken?: string);
85
87
  get servicevisitaudit(): ApiRecordLinkManager;
86
88
  get blockagea55(): ApiRecordLinkManager;
@@ -146,6 +148,8 @@ export declare class FileApi extends ApiProvider {
146
148
  get pgdirectdebitfile(): ApiRecordLinkManager;
147
149
  get yfwifisurvey(): ApiRecordLinkManager;
148
150
  get yffieldvisitoutcomeform(): ApiRecordLinkManager;
151
+ get document(): ApiRecordLinkManager;
152
+ get documentprocessing(): ApiRecordLinkManager;
149
153
  setRecord(sourceRecord: any): void;
150
154
  schema(): Promise<import("@d19n/odin-types/dist/core").OdinSchema>;
151
155
  search(params: Partial<OdinSearchV2>): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").OdinSearchResponse<import("@d19n/odin-types/dist/core").OdinRecord<FileProperties>>>;
@@ -417,6 +417,18 @@ class FileApi extends api_provider_1.ApiProvider {
417
417
  }
418
418
  return this._yffieldvisitoutcomeform;
419
419
  }
420
+ get document() {
421
+ if (!this._document) {
422
+ this._document = new api_record_link_manager_1.ApiRecordLinkManager(this.authParams, 'SchemaModule:File', 'AiModule:Document', 'Document__File');
423
+ }
424
+ return this._document;
425
+ }
426
+ get documentprocessing() {
427
+ if (!this._documentprocessing) {
428
+ this._documentprocessing = new api_record_link_manager_1.ApiRecordLinkManager(this.authParams, 'SchemaModule:File', 'AiModule:DocumentProcessing', 'DocumentProcessing__File');
429
+ }
430
+ return this._documentprocessing;
431
+ }
420
432
  // ============================================
421
433
  // STANDARD METHODS (Unchanged API)
422
434
  // ============================================
@@ -0,0 +1,180 @@
1
+ /**
2
+ * Document DB Accessor
3
+ *
4
+ * Provides typed access to Document records via direct database access.
5
+ * For use in backend services with principal + dbService.
6
+ * Returns wrapped records with typed action methods.
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * // Simple get
11
+ * const record = await accessor.get(id);
12
+ *
13
+ * // With related entities
14
+ * const record = await accessor.get(id, { entities: ["Contact", "Address"] });
15
+ *
16
+ * // With permissions bypass (separate options)
17
+ * const record = await accessor.get(id, {}, { omitPermissionsCheck: true });
18
+ *
19
+ * // Silent write (no RabbitMQ events)
20
+ * const result = await accessor.upsert([dto], { omitWriteEvents: true });
21
+ *
22
+ * // Constructor-level default (applies to all calls)
23
+ * const accessor = new DocumentDbAccessor(principal, dbService, { omitPermissionsCheck: true });
24
+ * ```
25
+ *
26
+ * AUTO-GENERATED - DO NOT EDIT DIRECTLY
27
+ */
28
+ import { OdinSearchV2 } from '@d19n/odin-types/dist/core';
29
+ import { DbProvider, DbProviderOptions, DbGetQueryOptions, DbExternalIdQueryOptions } from '@d19n/odin-sdk-generator/dist/db.provider';
30
+ import { QueryBuilder } from '@d19n/odin-sdk-generator/dist/query-builder';
31
+ import { DocumentProperties } from '../entities-v2/Document';
32
+ import { DocumentRecord } from '../records-v2/DocumentRecord';
33
+ /** Search response with wrapped records */
34
+ export interface DocumentDbSearchResponse {
35
+ records: DocumentRecord[];
36
+ totalRecords: number;
37
+ hasMore: boolean;
38
+ aggregations?: Record<string, any>;
39
+ }
40
+ export declare class DocumentDbAccessor {
41
+ private readonly _provider;
42
+ private readonly _moduleName;
43
+ private readonly _entityName;
44
+ private readonly _defaultOptions?;
45
+ /**
46
+ * Create a new DocumentDbAccessor
47
+ * @param principal - The authenticated principal
48
+ * @param dbService - The database service instance
49
+ * @param defaultOptions - Default provider options applied to all operations
50
+ */
51
+ constructor(principal: any, dbService: any, defaultOptions?: DbProviderOptions);
52
+ get moduleName(): string;
53
+ get entityName(): string;
54
+ /**
55
+ * Create a new empty Document record instance for create operations.
56
+ * Pre-generates an ID that can be referenced before the record is saved.
57
+ *
58
+ * @param id - Optional ID to use (auto-generated UUID if not provided)
59
+ * @returns A new record wrapper with pre-generated ID
60
+ *
61
+ * @example
62
+ * ```typescript
63
+ * // Auto-generated ID
64
+ * const note = odinDb.notes.new();
65
+ * console.log(note.id); // UUID available immediately
66
+ *
67
+ * // Custom ID
68
+ * const order = odinDb.orders.new("custom-id-123");
69
+ *
70
+ * // Reference ID before save
71
+ * const account = odinDb.accounts.new();
72
+ * const contact = odinDb.contacts.new();
73
+ * await contact
74
+ * .link({ id: account.id, entity: "CrmModule:Account" })
75
+ * .createContact({ FirstName: "John" });
76
+ * ```
77
+ */
78
+ new(id?: string): DocumentRecord;
79
+ /**
80
+ * Get a single Document record by ID
81
+ *
82
+ * @param id - The record ID
83
+ * @param queryOptions - Query options (WHAT to fetch: entities to include)
84
+ * @param providerOptions - Provider options (HOW to fetch: omitPermissionsCheck)
85
+ *
86
+ * @example
87
+ * ```typescript
88
+ * // Simple get
89
+ * const record = await accessor.get(id);
90
+ *
91
+ * // With related entities
92
+ * const record = await accessor.get(id, { entities: ["Contact", "Address"] });
93
+ *
94
+ * // With permissions bypass
95
+ * const record = await accessor.get(id, {}, { omitPermissionsCheck: true });
96
+ *
97
+ * // Both options
98
+ * const record = await accessor.get(id, { entities: ["Invoice"] }, { omitPermissionsCheck: true });
99
+ * ```
100
+ */
101
+ get(id: string, queryOptions?: DbGetQueryOptions, providerOptions?: DbProviderOptions): Promise<DocumentRecord>;
102
+ /**
103
+ * Get multiple Document records by IDs
104
+ *
105
+ * @param ids - Array of record IDs
106
+ * @param queryOptions - Query options (WHAT to fetch: entities to include)
107
+ * @param providerOptions - Provider options (HOW to fetch: omitPermissionsCheck)
108
+ */
109
+ getMany(ids: string[], queryOptions?: DbGetQueryOptions, providerOptions?: DbProviderOptions): Promise<DocumentRecord[]>;
110
+ /**
111
+ * Get Document records by the RECORD-LEVEL external id.
112
+ *
113
+ * Resolved server-side in Postgres against `record.external_id` - not a property
114
+ * search, and not reachable through `query()` (`externalId` is not a queryable
115
+ * column). Use this when an external system hands back its own identifier.
116
+ *
117
+ * Platform limits: max 5000 ids per call, each at most 36 characters. An unknown
118
+ * `type` is rejected with 400 `invalid type`.
119
+ *
120
+ * @param externalIds - The external ids to match (plural - the platform takes an array)
121
+ * @param queryOptions - Query options (WHAT to fetch: narrow by record type)
122
+ * @param providerOptions - Provider options (HOW to fetch: omitPermissionsCheck, withLinks)
123
+ *
124
+ * @example
125
+ * ```typescript
126
+ * // Correlate a provider webhook back to the record it wrote
127
+ * const [message] = await accessor.getManyByExternalId([body.SmsSid]);
128
+ *
129
+ * // Narrowed by record type
130
+ * const closures = await accessor.getManyByExternalId(refs, { type: 'CLOSURE' });
131
+ *
132
+ * // Background job, no link hydration
133
+ * const records = await accessor.getManyByExternalId(refs, undefined, {
134
+ * omitPermissionsCheck: true,
135
+ * withLinks: false,
136
+ * });
137
+ * ```
138
+ */
139
+ getManyByExternalId(externalIds: string[], queryOptions?: DbExternalIdQueryOptions, providerOptions?: DbProviderOptions): Promise<DocumentRecord[]>;
140
+ /**
141
+ * Search Document records
142
+ *
143
+ * @param params - Search parameters
144
+ * @param providerOptions - Provider options (HOW to fetch: omitPermissionsCheck)
145
+ */
146
+ search(params: Partial<OdinSearchV2>, providerOptions?: DbProviderOptions): Promise<DocumentDbSearchResponse>;
147
+ /**
148
+ * Search all Document records with automatic pagination
149
+ *
150
+ * @param params - Search parameters
151
+ * @param providerOptions - Provider options (HOW to fetch: omitPermissionsCheck)
152
+ */
153
+ searchAll(params: Partial<OdinSearchV2>, providerOptions?: DbProviderOptions): Promise<DocumentRecord[]>;
154
+ /**
155
+ * Async generator for paginating through all matching records.
156
+ * Yields batches of wrapped records.
157
+ *
158
+ * @param params - Search parameters
159
+ * @param providerOptions - Provider options (HOW to fetch: omitPermissionsCheck)
160
+ */
161
+ paginate(params: Partial<OdinSearchV2>, providerOptions?: DbProviderOptions): AsyncGenerator<DocumentRecord[]>;
162
+ /**
163
+ * Create a fluent query builder for Document records
164
+ *
165
+ * @example
166
+ * ```typescript
167
+ * const results = await accessor
168
+ * .query()
169
+ * .where('Status', 'in', ['Active', 'Pending'])
170
+ * .where('CreatedAt', 'gte', '2025-01-01')
171
+ * .select('id', 'title', 'properties.*')
172
+ * .sortBy('createdAt', 'desc')
173
+ * .limit(100)
174
+ * .execute();
175
+ * ```
176
+ */
177
+ query(): QueryBuilder<DocumentProperties, DocumentRecord>;
178
+ /** Access the underlying DbProvider */
179
+ get provider(): DbProvider;
180
+ }