@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.
- package/README.md +25 -2
- package/dist/EntityRegistry.d.ts +4 -0
- package/dist/EntityRegistry.js +4 -0
- package/dist/OdinApiClient.d.ts +8 -0
- package/dist/OdinApiClient.js +16 -0
- package/dist/OdinDbClient.d.ts +8 -0
- package/dist/OdinDbClient.js +16 -0
- package/dist/accessors-v2/DocumentAccessor.d.ts +112 -0
- package/dist/accessors-v2/DocumentAccessor.js +191 -0
- package/dist/accessors-v2/DocumentProcessingAccessor.d.ts +112 -0
- package/dist/accessors-v2/DocumentProcessingAccessor.js +191 -0
- package/dist/accessors-v2/index.d.ts +2 -0
- package/dist/accessors-v2/index.js +7 -3
- package/dist/actions-v2/CreateAiRouteRequestDto.d.ts +1 -1
- package/dist/actions-v2/CreateChurnRequestDto.d.ts +2 -0
- package/dist/actions-v2/CreateChurnRequestDto.js +2 -0
- package/dist/actions-v2/CreateDocumentDto.d.ts +235 -0
- package/dist/actions-v2/CreateDocumentDto.js +57 -0
- package/dist/actions-v2/CreateDocumentProcessingDto.d.ts +192 -0
- package/dist/actions-v2/CreateDocumentProcessingDto.js +57 -0
- package/dist/actions-v2/CreateLeadSalesAppDto.d.ts +9 -17
- package/dist/actions-v2/UpdateDocumentDto.d.ts +236 -0
- package/dist/actions-v2/UpdateDocumentDto.js +59 -0
- package/dist/actions-v2/UpdateMessageReadByCustomerDto.d.ts +72 -0
- package/dist/actions-v2/UpdateMessageReadByCustomerDto.js +56 -0
- package/dist/api-sdk-v2/ContractBuyOutApi.d.ts +2 -0
- package/dist/api-sdk-v2/ContractBuyOutApi.js +6 -0
- package/dist/api-sdk-v2/DocumentApi.d.ts +52 -0
- package/dist/api-sdk-v2/DocumentApi.js +167 -0
- package/dist/api-sdk-v2/DocumentProcessingApi.d.ts +50 -0
- package/dist/api-sdk-v2/DocumentProcessingApi.js +161 -0
- package/dist/api-sdk-v2/EquipmentReturnApi.d.ts +45 -0
- package/dist/api-sdk-v2/EquipmentReturnApi.js +151 -0
- package/dist/api-sdk-v2/EquipmentReturnItemApi.d.ts +45 -0
- package/dist/api-sdk-v2/EquipmentReturnItemApi.js +151 -0
- package/dist/api-sdk-v2/FileApi.d.ts +4 -0
- package/dist/api-sdk-v2/FileApi.js +12 -0
- package/dist/db-accessors-v2/DocumentDbAccessor.d.ts +180 -0
- package/dist/db-accessors-v2/DocumentDbAccessor.js +265 -0
- package/dist/db-accessors-v2/DocumentProcessingDbAccessor.d.ts +180 -0
- package/dist/db-accessors-v2/DocumentProcessingDbAccessor.js +265 -0
- package/dist/db-accessors-v2/index.d.ts +2 -0
- package/dist/db-accessors-v2/index.js +7 -3
- package/dist/db-sdk-v2/ContractBuyOutDb.d.ts +2 -0
- package/dist/db-sdk-v2/ContractBuyOutDb.js +6 -0
- package/dist/db-sdk-v2/DocumentDb.d.ts +124 -0
- package/dist/db-sdk-v2/DocumentDb.js +216 -0
- package/dist/db-sdk-v2/DocumentProcessingDb.d.ts +122 -0
- package/dist/db-sdk-v2/DocumentProcessingDb.js +210 -0
- package/dist/db-sdk-v2/EquipmentReturnDb.d.ts +117 -0
- package/dist/db-sdk-v2/EquipmentReturnDb.js +200 -0
- package/dist/db-sdk-v2/EquipmentReturnItemDb.d.ts +117 -0
- package/dist/db-sdk-v2/EquipmentReturnItemDb.js +200 -0
- package/dist/db-sdk-v2/FileDb.d.ts +4 -0
- package/dist/db-sdk-v2/FileDb.js +12 -0
- package/dist/entities-v2/AiRouteRequest.d.ts +23 -11
- package/dist/entities-v2/AiRouteRequest.js +15 -3
- package/dist/entities-v2/ContractBuyOut.d.ts +7 -0
- package/dist/entities-v2/ContractBuyOut.js +5 -1
- package/dist/entities-v2/Document.d.ts +1145 -0
- package/dist/entities-v2/Document.js +220 -0
- package/dist/entities-v2/DocumentProcessing.d.ts +272 -0
- package/dist/entities-v2/DocumentProcessing.js +156 -0
- package/dist/entities-v2/EquipmentReturn.d.ts +66 -0
- package/dist/entities-v2/EquipmentReturn.js +64 -0
- package/dist/entities-v2/EquipmentReturnItem.d.ts +66 -0
- package/dist/entities-v2/EquipmentReturnItem.js +64 -0
- package/dist/entities-v2/File.d.ts +81 -1
- package/dist/entities-v2/File.js +9 -1
- package/dist/entities-v2/Message.d.ts +27 -1
- package/dist/entities-v2/Message.js +2 -0
- package/dist/entities-v2/Order.d.ts +8 -8
- package/dist/entities-v2/Order.js +2 -2
- package/dist/entities-v2/YfStockCount.d.ts +197 -1
- package/dist/entities-v2/YfStockCount.js +28 -0
- package/dist/records-v2/ContractBuyOutRecord.d.ts +20 -0
- package/dist/records-v2/ContractBuyOutRecord.js +33 -0
- package/dist/records-v2/DocumentProcessingRecord.d.ts +227 -0
- package/dist/records-v2/DocumentProcessingRecord.js +315 -0
- package/dist/records-v2/DocumentRecord.d.ts +355 -0
- package/dist/records-v2/DocumentRecord.js +468 -0
- package/dist/records-v2/FileRecord.d.ts +59 -3
- package/dist/records-v2/FileRecord.js +83 -1
- package/dist/records-v2/MessageRecord.d.ts +28 -0
- package/dist/records-v2/MessageRecord.js +37 -0
- package/dist/records-v2/index.d.ts +2 -0
- package/dist/records-v2/index.js +10 -4
- package/package.json +1 -1
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* UpdateMessageReadByCustomer Action DTO
|
|
4
|
+
*
|
|
5
|
+
* Set whether the customer has read this message. Called by the chat gateway when the app reports which messages it has shown.
|
|
6
|
+
*
|
|
7
|
+
* @module NotificationModule
|
|
8
|
+
* @entity Message
|
|
9
|
+
* @actionKey UpdateMessageReadByCustomer
|
|
10
|
+
* @event k1.t-hEOJjsDb.NotificationModule.Message.Update.UpdateMessageReadByCustomer
|
|
11
|
+
*
|
|
12
|
+
* AUTO-GENERATED - DO NOT EDIT DIRECTLY
|
|
13
|
+
*/
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.UpdateMessageReadByCustomerDto = void 0;
|
|
16
|
+
const core_1 = require("@d19n/odin-types/dist/core");
|
|
17
|
+
/**
|
|
18
|
+
* UpdateMessageReadByCustomer
|
|
19
|
+
*
|
|
20
|
+
* Set whether the customer has read this message. Called by the chat gateway when the app reports which messages it has shown.
|
|
21
|
+
*
|
|
22
|
+
* @actionType UPDATE - Updates an existing Message record
|
|
23
|
+
* @module NotificationModule
|
|
24
|
+
* @entity Message
|
|
25
|
+
* @event k1.t-hEOJjsDb.NotificationModule.Message.Update.UpdateMessageReadByCustomer
|
|
26
|
+
* @permission schema.action.updatemessagereadbycustomer.trigger
|
|
27
|
+
* @benchmark This action is tracked for performance benchmarks
|
|
28
|
+
*/
|
|
29
|
+
class UpdateMessageReadByCustomerDto extends core_1.OdinRecordUpdateDto {
|
|
30
|
+
constructor(record, properties, options) {
|
|
31
|
+
super({
|
|
32
|
+
id: record.id,
|
|
33
|
+
entity: record.entity,
|
|
34
|
+
type: record.type,
|
|
35
|
+
properties,
|
|
36
|
+
journeyId: options === null || options === void 0 ? void 0 : options.journeyId,
|
|
37
|
+
stageKey: options === null || options === void 0 ? void 0 : options.stageKey,
|
|
38
|
+
});
|
|
39
|
+
this.actionName = 'UpdateMessageReadByCustomer';
|
|
40
|
+
this.schemaActionId = 'e93486b9-74ef-4451-848b-ac949ed5caf9';
|
|
41
|
+
this.entity = 'NotificationModule:Message';
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.UpdateMessageReadByCustomerDto = UpdateMessageReadByCustomerDto;
|
|
45
|
+
/** Used by SDK generators to identify action type */
|
|
46
|
+
UpdateMessageReadByCustomerDto.ACTION_TYPE = 'UPDATE';
|
|
47
|
+
UpdateMessageReadByCustomerDto.ACTION_KEY = 'UpdateMessageReadByCustomer';
|
|
48
|
+
UpdateMessageReadByCustomerDto.MODULE_NAME = 'NotificationModule';
|
|
49
|
+
UpdateMessageReadByCustomerDto.ENTITIES = ['Message'];
|
|
50
|
+
UpdateMessageReadByCustomerDto.EVENT_NAME = 'k1.t-hEOJjsDb.NotificationModule.Message.Update.UpdateMessageReadByCustomer';
|
|
51
|
+
UpdateMessageReadByCustomerDto.PERMISSION = 'schema.action.updatemessagereadbycustomer.trigger';
|
|
52
|
+
/** Step metadata - entity this action targets */
|
|
53
|
+
UpdateMessageReadByCustomerDto.STEP_ENTITY = 'NotificationModule:Message';
|
|
54
|
+
UpdateMessageReadByCustomerDto.STEP_SCHEMA_ID = 'f1c6db7a-eda8-405b-9d9e-536047a61b57';
|
|
55
|
+
UpdateMessageReadByCustomerDto.STEP_SCHEMA_ACTION_ID = 'e93486b9-74ef-4451-848b-ac949ed5caf9';
|
|
56
|
+
UpdateMessageReadByCustomerDto.AUTO_LINK_PARENT = false;
|
|
@@ -25,6 +25,7 @@ export declare class ContractBuyOutApi extends ApiProvider {
|
|
|
25
25
|
private _user?;
|
|
26
26
|
private _paymentmethodrefund?;
|
|
27
27
|
private _contact?;
|
|
28
|
+
private _document?;
|
|
28
29
|
constructor(authParams?: OauthParams, authToken?: string);
|
|
29
30
|
get note(): ApiRecordLinkManager;
|
|
30
31
|
get paymentmethod(): ApiRecordLinkManager;
|
|
@@ -34,6 +35,7 @@ export declare class ContractBuyOutApi extends ApiProvider {
|
|
|
34
35
|
get user(): ApiRecordLinkManager;
|
|
35
36
|
get paymentmethodrefund(): ApiRecordLinkManager;
|
|
36
37
|
get contact(): ApiRecordLinkManager;
|
|
38
|
+
get document(): ApiRecordLinkManager;
|
|
37
39
|
setRecord(sourceRecord: any): void;
|
|
38
40
|
schema(): Promise<import("@d19n/odin-types/dist/core").OdinSchema>;
|
|
39
41
|
search(params: Partial<OdinSearchV2>): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").OdinSearchResponse<import("@d19n/odin-types/dist/core").OdinRecord<ContractBuyOutProperties>>>;
|
|
@@ -81,6 +81,12 @@ class ContractBuyOutApi extends api_provider_1.ApiProvider {
|
|
|
81
81
|
}
|
|
82
82
|
return this._contact;
|
|
83
83
|
}
|
|
84
|
+
get document() {
|
|
85
|
+
if (!this._document) {
|
|
86
|
+
this._document = new api_record_link_manager_1.ApiRecordLinkManager(this.authParams, 'OrderModule:ContractBuyOut', 'AiModule:Document', 'ContractBuyOut__Document');
|
|
87
|
+
}
|
|
88
|
+
return this._document;
|
|
89
|
+
}
|
|
84
90
|
// ============================================
|
|
85
91
|
// STANDARD METHODS (Unchanged API)
|
|
86
92
|
// ============================================
|
|
@@ -0,0 +1,52 @@
|
|
|
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 { DocumentProperties } from '../entities-v2/Document';
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated Use OdinApiClient.
|
|
8
|
+
*
|
|
9
|
+
* Migration:
|
|
10
|
+
* - Old: new DocumentApi(authParams).get(id)
|
|
11
|
+
* - New: new odin.document.get(id)
|
|
12
|
+
*
|
|
13
|
+
* The new OdinApiClient returns typed record wrappers with action methods.
|
|
14
|
+
*/
|
|
15
|
+
export declare class DocumentApi extends ApiProvider {
|
|
16
|
+
protected readonly authToken?: string;
|
|
17
|
+
private readonly moduleName;
|
|
18
|
+
private readonly entityName;
|
|
19
|
+
private sourceRecord;
|
|
20
|
+
private _file?;
|
|
21
|
+
private _documentprocessing?;
|
|
22
|
+
private _contractbuyout?;
|
|
23
|
+
constructor(authParams?: OauthParams, authToken?: string);
|
|
24
|
+
get file(): ApiRecordLinkManager;
|
|
25
|
+
get documentprocessing(): ApiRecordLinkManager;
|
|
26
|
+
get contractbuyout(): ApiRecordLinkManager;
|
|
27
|
+
setRecord(sourceRecord: any): void;
|
|
28
|
+
schema(): Promise<import("@d19n/odin-types/dist/core").OdinSchema>;
|
|
29
|
+
search(params: Partial<OdinSearchV2>): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").OdinSearchResponse<import("@d19n/odin-types/dist/core").OdinRecord<DocumentProperties>>>;
|
|
30
|
+
searchAndPaginate(params: Partial<OdinSearchV2>): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").OdinSearchResponse<import("@d19n/odin-types/dist/core").OdinRecord<DocumentProperties>>>;
|
|
31
|
+
reIndex(body: {
|
|
32
|
+
id: string;
|
|
33
|
+
schemaId: string;
|
|
34
|
+
}[]): Promise<any>;
|
|
35
|
+
get(documentId: string): Promise<import("@d19n/odin-types/dist/core").OdinRecord<DocumentProperties>>;
|
|
36
|
+
getMany(documentIds: string[]): Promise<import("@d19n/odin-types/dist/core").OdinRecord<DocumentProperties>[]>;
|
|
37
|
+
upsert(upsertDto: OdinRecordCreateDto): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").IDbRecordCreateUpdateRes>;
|
|
38
|
+
upsertMany(upsertDtos: OdinRecordCreateDto[]): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").IDbRecordCreateUpdateRes[]>;
|
|
39
|
+
update(updateDto: OdinRecordUpdateDto): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").IDbRecordCreateUpdateRes>;
|
|
40
|
+
updateMany(updateDtos: OdinRecordUpdateDto[]): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").IDbRecordCreateUpdateRes[]>;
|
|
41
|
+
delete(documentId: string): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").OdinDeleteResponse[]>;
|
|
42
|
+
deleteMany(documentIds: string[]): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").OdinDeleteResponse[]>;
|
|
43
|
+
restore(documentIds: string[]): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").OdinRestoreResponse[]>;
|
|
44
|
+
applyAction(dto: any): Promise<any[]>;
|
|
45
|
+
bulkApplyActions(dtos: any[]): Promise<any[]>;
|
|
46
|
+
getVersions(): Promise<{
|
|
47
|
+
[key: string]: Record<string, any>;
|
|
48
|
+
}>;
|
|
49
|
+
getRevisionTimeline(): Promise<{
|
|
50
|
+
[key: string]: Record<string, any>[];
|
|
51
|
+
}>;
|
|
52
|
+
}
|
|
@@ -0,0 +1,167 @@
|
|
|
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.DocumentApi = 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 DocumentApi(authParams).get(id)
|
|
20
|
+
* - New: new odin.document.get(id)
|
|
21
|
+
*
|
|
22
|
+
* The new OdinApiClient returns typed record wrappers with action methods.
|
|
23
|
+
*/
|
|
24
|
+
class DocumentApi extends api_provider_1.ApiProvider {
|
|
25
|
+
constructor(authParams, authToken) {
|
|
26
|
+
super(authParams, authToken);
|
|
27
|
+
this.authToken = authToken;
|
|
28
|
+
this.moduleName = 'AiModule';
|
|
29
|
+
this.entityName = 'Document';
|
|
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 file() {
|
|
37
|
+
if (!this._file) {
|
|
38
|
+
this._file = new api_record_link_manager_1.ApiRecordLinkManager(this.authParams, 'AiModule:Document', 'SchemaModule:File', 'Document__File');
|
|
39
|
+
}
|
|
40
|
+
return this._file;
|
|
41
|
+
}
|
|
42
|
+
get documentprocessing() {
|
|
43
|
+
if (!this._documentprocessing) {
|
|
44
|
+
this._documentprocessing = new api_record_link_manager_1.ApiRecordLinkManager(this.authParams, 'AiModule:Document', 'AiModule:DocumentProcessing', 'Document__DocumentProcessing');
|
|
45
|
+
}
|
|
46
|
+
return this._documentprocessing;
|
|
47
|
+
}
|
|
48
|
+
get contractbuyout() {
|
|
49
|
+
if (!this._contractbuyout) {
|
|
50
|
+
this._contractbuyout = new api_record_link_manager_1.ApiRecordLinkManager(this.authParams, 'AiModule:Document', 'OrderModule:ContractBuyOut', 'ContractBuyOut__Document');
|
|
51
|
+
}
|
|
52
|
+
return this._contractbuyout;
|
|
53
|
+
}
|
|
54
|
+
// ============================================
|
|
55
|
+
// STANDARD METHODS (Unchanged API)
|
|
56
|
+
// ============================================
|
|
57
|
+
setRecord(sourceRecord) {
|
|
58
|
+
this.sourceRecord = sourceRecord;
|
|
59
|
+
}
|
|
60
|
+
schema() {
|
|
61
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
62
|
+
return yield this.getSchema(this.moduleName, this.entityName);
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
// Use this function when you want to search and handle all pagination on your own
|
|
66
|
+
search(params) {
|
|
67
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
68
|
+
return yield this._searchRecords(this.moduleName, this.entityName, params);
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
// Use this function when you want paginating through the results to be handled
|
|
72
|
+
searchAndPaginate(params) {
|
|
73
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
74
|
+
return yield this._searchAllRecordsAndPaginate(this.moduleName, this.entityName, params);
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
// Use this function to re-index records in elastic search
|
|
78
|
+
reIndex(body) {
|
|
79
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
80
|
+
return yield this._reIndexRecords(body);
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
// Use this function when you want to return a single record
|
|
84
|
+
get(documentId) {
|
|
85
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
86
|
+
const res = yield this._getByPrimaryKey(this.moduleName, this.entityName, documentId);
|
|
87
|
+
if (res)
|
|
88
|
+
this.setRecord(res);
|
|
89
|
+
return res;
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
// Use this function when you want to return many records by primaryKeys
|
|
93
|
+
getMany(documentIds) {
|
|
94
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
95
|
+
return yield this._getManyByPrimaryKey(this.moduleName, this.entityName, documentIds);
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
// Use this function when you want to upsert one record
|
|
99
|
+
upsert(upsertDto) {
|
|
100
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
101
|
+
const res = yield this._upsert(this.moduleName, this.entityName, [upsertDto]);
|
|
102
|
+
return res[0];
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
// Use this function when you want to upsert many records
|
|
106
|
+
upsertMany(upsertDtos) {
|
|
107
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
108
|
+
return yield this._upsert(this.moduleName, this.entityName, upsertDtos);
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
// Use this function when you want to update one record
|
|
112
|
+
update(updateDto) {
|
|
113
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
114
|
+
const res = yield this._update(this.moduleName, this.entityName, [updateDto]);
|
|
115
|
+
return res[0];
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
// Use this function when you want to update many records
|
|
119
|
+
updateMany(updateDtos) {
|
|
120
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
121
|
+
return yield this._update(this.moduleName, this.entityName, updateDtos);
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
// Use this function when you want to delete one record
|
|
125
|
+
delete(documentId) {
|
|
126
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
127
|
+
return yield this._delete(this.moduleName, this.entityName, [documentId]);
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
// Use this function when you want to delete many records
|
|
131
|
+
deleteMany(documentIds) {
|
|
132
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
133
|
+
return yield this._delete(this.moduleName, this.entityName, documentIds);
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
// Use this function when you want to restore one or many records
|
|
137
|
+
restore(documentIds) {
|
|
138
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
139
|
+
return yield this._restore(this.moduleName, this.entityName, documentIds);
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
// Use this function when you want to apply a single action
|
|
143
|
+
applyAction(dto) {
|
|
144
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
145
|
+
return yield this._applyAction(this.moduleName, this.entityName, dto);
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
// Use this function when you want to bulk apply actions
|
|
149
|
+
bulkApplyActions(dtos) {
|
|
150
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
151
|
+
return yield this._bulkApplyActions(this.moduleName, this.entityName, dtos);
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
// Use this function when you want to return the versions for a single record
|
|
155
|
+
getVersions() {
|
|
156
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
157
|
+
return yield this._getVersions(this.moduleName, this.entityName, this.sourceRecord.id);
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
// Use this function when you want to return the change history for a single record
|
|
161
|
+
getRevisionTimeline() {
|
|
162
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
163
|
+
return yield this._getRevisionTimeline(this.moduleName, this.entityName, this.sourceRecord.id);
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
exports.DocumentApi = DocumentApi;
|
|
@@ -0,0 +1,50 @@
|
|
|
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 { DocumentProcessingProperties } from '../entities-v2/DocumentProcessing';
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated Use OdinApiClient.
|
|
8
|
+
*
|
|
9
|
+
* Migration:
|
|
10
|
+
* - Old: new DocumentProcessingApi(authParams).get(id)
|
|
11
|
+
* - New: new odin.documentprocessing.get(id)
|
|
12
|
+
*
|
|
13
|
+
* The new OdinApiClient returns typed record wrappers with action methods.
|
|
14
|
+
*/
|
|
15
|
+
export declare class DocumentProcessingApi extends ApiProvider {
|
|
16
|
+
protected readonly authToken?: string;
|
|
17
|
+
private readonly moduleName;
|
|
18
|
+
private readonly entityName;
|
|
19
|
+
private sourceRecord;
|
|
20
|
+
private _document?;
|
|
21
|
+
private _file?;
|
|
22
|
+
constructor(authParams?: OauthParams, authToken?: string);
|
|
23
|
+
get document(): ApiRecordLinkManager;
|
|
24
|
+
get file(): ApiRecordLinkManager;
|
|
25
|
+
setRecord(sourceRecord: any): void;
|
|
26
|
+
schema(): Promise<import("@d19n/odin-types/dist/core").OdinSchema>;
|
|
27
|
+
search(params: Partial<OdinSearchV2>): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").OdinSearchResponse<import("@d19n/odin-types/dist/core").OdinRecord<DocumentProcessingProperties>>>;
|
|
28
|
+
searchAndPaginate(params: Partial<OdinSearchV2>): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").OdinSearchResponse<import("@d19n/odin-types/dist/core").OdinRecord<DocumentProcessingProperties>>>;
|
|
29
|
+
reIndex(body: {
|
|
30
|
+
id: string;
|
|
31
|
+
schemaId: string;
|
|
32
|
+
}[]): Promise<any>;
|
|
33
|
+
get(documentProcessingId: string): Promise<import("@d19n/odin-types/dist/core").OdinRecord<DocumentProcessingProperties>>;
|
|
34
|
+
getMany(documentProcessingIds: string[]): Promise<import("@d19n/odin-types/dist/core").OdinRecord<DocumentProcessingProperties>[]>;
|
|
35
|
+
upsert(upsertDto: OdinRecordCreateDto): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").IDbRecordCreateUpdateRes>;
|
|
36
|
+
upsertMany(upsertDtos: OdinRecordCreateDto[]): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").IDbRecordCreateUpdateRes[]>;
|
|
37
|
+
update(updateDto: OdinRecordUpdateDto): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").IDbRecordCreateUpdateRes>;
|
|
38
|
+
updateMany(updateDtos: OdinRecordUpdateDto[]): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").IDbRecordCreateUpdateRes[]>;
|
|
39
|
+
delete(documentProcessingId: string): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").OdinDeleteResponse[]>;
|
|
40
|
+
deleteMany(documentProcessingIds: string[]): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").OdinDeleteResponse[]>;
|
|
41
|
+
restore(documentProcessingIds: string[]): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").OdinRestoreResponse[]>;
|
|
42
|
+
applyAction(dto: any): Promise<any[]>;
|
|
43
|
+
bulkApplyActions(dtos: any[]): Promise<any[]>;
|
|
44
|
+
getVersions(): Promise<{
|
|
45
|
+
[key: string]: Record<string, any>;
|
|
46
|
+
}>;
|
|
47
|
+
getRevisionTimeline(): Promise<{
|
|
48
|
+
[key: string]: Record<string, any>[];
|
|
49
|
+
}>;
|
|
50
|
+
}
|
|
@@ -0,0 +1,161 @@
|
|
|
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.DocumentProcessingApi = 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 DocumentProcessingApi(authParams).get(id)
|
|
20
|
+
* - New: new odin.documentprocessing.get(id)
|
|
21
|
+
*
|
|
22
|
+
* The new OdinApiClient returns typed record wrappers with action methods.
|
|
23
|
+
*/
|
|
24
|
+
class DocumentProcessingApi extends api_provider_1.ApiProvider {
|
|
25
|
+
constructor(authParams, authToken) {
|
|
26
|
+
super(authParams, authToken);
|
|
27
|
+
this.authToken = authToken;
|
|
28
|
+
this.moduleName = 'AiModule';
|
|
29
|
+
this.entityName = 'DocumentProcessing';
|
|
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:DocumentProcessing', 'AiModule:Document', 'Document__DocumentProcessing');
|
|
39
|
+
}
|
|
40
|
+
return this._document;
|
|
41
|
+
}
|
|
42
|
+
get file() {
|
|
43
|
+
if (!this._file) {
|
|
44
|
+
this._file = new api_record_link_manager_1.ApiRecordLinkManager(this.authParams, 'AiModule:DocumentProcessing', 'SchemaModule:File', 'DocumentProcessing__File');
|
|
45
|
+
}
|
|
46
|
+
return this._file;
|
|
47
|
+
}
|
|
48
|
+
// ============================================
|
|
49
|
+
// STANDARD METHODS (Unchanged API)
|
|
50
|
+
// ============================================
|
|
51
|
+
setRecord(sourceRecord) {
|
|
52
|
+
this.sourceRecord = sourceRecord;
|
|
53
|
+
}
|
|
54
|
+
schema() {
|
|
55
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
56
|
+
return yield this.getSchema(this.moduleName, this.entityName);
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
// Use this function when you want to search and handle all pagination on your own
|
|
60
|
+
search(params) {
|
|
61
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
62
|
+
return yield this._searchRecords(this.moduleName, this.entityName, params);
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
// Use this function when you want paginating through the results to be handled
|
|
66
|
+
searchAndPaginate(params) {
|
|
67
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
68
|
+
return yield this._searchAllRecordsAndPaginate(this.moduleName, this.entityName, params);
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
// Use this function to re-index records in elastic search
|
|
72
|
+
reIndex(body) {
|
|
73
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
74
|
+
return yield this._reIndexRecords(body);
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
// Use this function when you want to return a single record
|
|
78
|
+
get(documentProcessingId) {
|
|
79
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
80
|
+
const res = yield this._getByPrimaryKey(this.moduleName, this.entityName, documentProcessingId);
|
|
81
|
+
if (res)
|
|
82
|
+
this.setRecord(res);
|
|
83
|
+
return res;
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
// Use this function when you want to return many records by primaryKeys
|
|
87
|
+
getMany(documentProcessingIds) {
|
|
88
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
89
|
+
return yield this._getManyByPrimaryKey(this.moduleName, this.entityName, documentProcessingIds);
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
// Use this function when you want to upsert one record
|
|
93
|
+
upsert(upsertDto) {
|
|
94
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
95
|
+
const res = yield this._upsert(this.moduleName, this.entityName, [upsertDto]);
|
|
96
|
+
return res[0];
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
// Use this function when you want to upsert many records
|
|
100
|
+
upsertMany(upsertDtos) {
|
|
101
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
102
|
+
return yield this._upsert(this.moduleName, this.entityName, upsertDtos);
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
// Use this function when you want to update one record
|
|
106
|
+
update(updateDto) {
|
|
107
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
108
|
+
const res = yield this._update(this.moduleName, this.entityName, [updateDto]);
|
|
109
|
+
return res[0];
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
// Use this function when you want to update many records
|
|
113
|
+
updateMany(updateDtos) {
|
|
114
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
115
|
+
return yield this._update(this.moduleName, this.entityName, updateDtos);
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
// Use this function when you want to delete one record
|
|
119
|
+
delete(documentProcessingId) {
|
|
120
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
121
|
+
return yield this._delete(this.moduleName, this.entityName, [documentProcessingId]);
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
// Use this function when you want to delete many records
|
|
125
|
+
deleteMany(documentProcessingIds) {
|
|
126
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
127
|
+
return yield this._delete(this.moduleName, this.entityName, documentProcessingIds);
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
// Use this function when you want to restore one or many records
|
|
131
|
+
restore(documentProcessingIds) {
|
|
132
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
133
|
+
return yield this._restore(this.moduleName, this.entityName, documentProcessingIds);
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
// Use this function when you want to apply a single action
|
|
137
|
+
applyAction(dto) {
|
|
138
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
139
|
+
return yield this._applyAction(this.moduleName, this.entityName, dto);
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
// Use this function when you want to bulk apply actions
|
|
143
|
+
bulkApplyActions(dtos) {
|
|
144
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
145
|
+
return yield this._bulkApplyActions(this.moduleName, this.entityName, dtos);
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
// Use this function when you want to return the versions for a single record
|
|
149
|
+
getVersions() {
|
|
150
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
151
|
+
return yield this._getVersions(this.moduleName, this.entityName, this.sourceRecord.id);
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
// Use this function when you want to return the change history for a single record
|
|
155
|
+
getRevisionTimeline() {
|
|
156
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
157
|
+
return yield this._getRevisionTimeline(this.moduleName, this.entityName, this.sourceRecord.id);
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
exports.DocumentProcessingApi = DocumentProcessingApi;
|
|
@@ -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 { EquipmentReturnProperties } from '../entities-v2/EquipmentReturn';
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated Use OdinApiClient.
|
|
7
|
+
*
|
|
8
|
+
* Migration:
|
|
9
|
+
* - Old: new EquipmentReturnApi(authParams).get(id)
|
|
10
|
+
* - New: new odin.equipmentreturn.get(id)
|
|
11
|
+
*
|
|
12
|
+
* The new OdinApiClient returns typed record wrappers with action methods.
|
|
13
|
+
*/
|
|
14
|
+
export declare class EquipmentReturnApi 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<EquipmentReturnProperties>>>;
|
|
23
|
+
searchAndPaginate(params: Partial<OdinSearchV2>): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").OdinSearchResponse<import("@d19n/odin-types/dist/core").OdinRecord<EquipmentReturnProperties>>>;
|
|
24
|
+
reIndex(body: {
|
|
25
|
+
id: string;
|
|
26
|
+
schemaId: string;
|
|
27
|
+
}[]): Promise<any>;
|
|
28
|
+
get(equipmentReturnId: string): Promise<import("@d19n/odin-types/dist/core").OdinRecord<EquipmentReturnProperties>>;
|
|
29
|
+
getMany(equipmentReturnIds: string[]): Promise<import("@d19n/odin-types/dist/core").OdinRecord<EquipmentReturnProperties>[]>;
|
|
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(equipmentReturnId: string): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").OdinDeleteResponse[]>;
|
|
35
|
+
deleteMany(equipmentReturnIds: string[]): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").OdinDeleteResponse[]>;
|
|
36
|
+
restore(equipmentReturnIds: 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
|
+
}
|