@topconsultnpm/sdk-ts 6.17.0-test.8 → 6.17.0-test11
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/dist/lib/Engine.js +99 -9
- package/dist/lib/TopMediaSession.js +9 -1
- package/dist/lib/helper/SDK_CacheServices.js +89 -7
- package/dist/lib/helper/SDK_Globals.js +1 -5
- package/dist/lib/helper/index.js +1 -0
- package/dist/lib/helper/utils.js +30 -0
- package/dist/lib/openAPIs/TopMediaServiceClient.js +1 -1
- package/dist/types/Engine.d.ts +27 -8
- package/dist/types/helper/SDK_CacheServices.d.ts +14 -1
- package/dist/types/helper/index.d.ts +1 -0
- package/dist/types/helper/utils.d.ts +2 -0
- package/dist/types/openAPIs/TopMediaServiceClient.d.ts +11 -8
- package/package.json +1 -1
package/dist/lib/Engine.js
CHANGED
|
@@ -10,7 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
import { ProgressCallbackData } from "./TopMediaServiceClientEx";
|
|
11
11
|
import { SDK_Globals } from "./helper";
|
|
12
12
|
import { StandardHelper } from "./helper/StandardHelper";
|
|
13
|
-
import { ArchiveModes, AreaDescriptor, AreaParams, BarcodeArchiverJobDescriptor, BarcodeDetectionDescriptor, Barcode_Colors, Barcode_Orientations, DcmtInputTypes, BasketTypeDescriptor, BatchUpdaterJobDescriptor, COSCheckerJobDescriptor, CassettoDoganaleJobDescriptor, CheckSequenceJobDescriptor, CultureIDs, DateTimeFormats, DcmtConverterJobDescriptor, DcmtDeleterJobDescriptor, DcmtDeleter_Actions, DcmtNoteJobDescriptor, DcmtPrinterJobDescriptor, DcmtTypeDescriptor, DiskDescriptor, FEAttacherJobDescriptor, FECreatorTxtJobDescriptor, FEDetacherJobDescriptor, FESenderWsJobDescriptor, FESplitterJobDescriptor, FEValidatorJobDescriptor, FileArchiverJobDescriptor, FileArchiver_ArchiveDescriptor, FileArchiver_ArchiveItemDescriptor, FileArchiver_InputTypes, FileCheckerJobDescriptor, FileDescriptor, FileExecJobDescriptor, FileExec_CheckFileModes, FileExportJobDescriptor, FileFormats, FileMoverJobDescriptor, FileTransferModes, FromItem, InputOrders, InvoiceRetrieveFormats, JobTypes, LexJobDescriptor, LinkerJobDescriptor, MailArchiverJobDescriptor, MailQueryJobDescriptor, MailSenderJobDescriptor, MigrationJobDescriptor, NSOCreatorTxtJobDescriptor, NSODetacherJobDescriptor, NSOSenderWsJobDescriptor, NSOValidatorJobDescriptor, OrderRetrieveFormats, OutputTypes, PDFArchiverJobDescriptor, PdDCreatorJobDescriptor, PdDTypes, PdVArchiverJobDescriptor, PdVQueryJobDescriptor, PdVSenderJobDescriptor, PeppolQueryJobDescriptor, PeppolSenderJobDescriptor, QueryDescriptor, ReplicatorJobDescriptor, SAPAlignerJobDescriptor, SAPBarcodeJobDescriptor, SAPDataReaderJobDescriptor, SAPDataWriterJobDescriptor, SignerJobDescriptor, Updater_UpdateDescriptor, SourceNotExistActions, SpoolArchiverJobDescriptor, UpdateModes, UpdaterJobDescriptor, Updater_MetadataMappingDescriptor, Updater_UpdateItemDescriptor, FileInputTypes, BarcodeArchiver_SplittingDescriptor, BarcodeArchiver_Splitting_Modes, BooleanExpressionDescriptor, BarcodeArchiver_ArchiveDescriptor, FileMover_Operations, SourceFilesFilters, FileRenameOptions, DestFileAlreadyExistActions, SplittingDescriptor, PDFArchiver_ArchiveDescriptor, HttpAddressDescriptor, Replicator_ArchiveDescriptor, BasketDescriptor, CommandSetDescriptor, PDFCommandSetDescriptor, ProcessDescriptor, ScheduleDescriptor, UserDescriptor, UserLevels, MetadataDataTypes, PreProc_Strategies, DataListDescriptor, ProcessRunAsModes, HistLogPurgeModes, ScheduleTypes, ScheduleOneTime, SignCertDescriptor, ScheduleDailyFrequency, ScheduleDailyOccursModes, ScheduleTimeUnits, ScheduleDuration, ScheduleRecurringMonthly, ScheduleRecurringWeekly, ScheduleRecurringDescriptor, ScheduleRecurringTypes, ProcessNotificationDescriptor, UpsertDescriptor, UpsertActions, UpsertSearchCriterias, BarcodeArchiver_ArchiveItemDescriptor, BarcodeArchiver_ArchiveMappingDescriptor, BarcodeArchiver_MetadataMappingDescriptor, MappingModes, MetadataMappingDescriptor, FileArchiver_ArchiveMappingDescriptor, CommandBaseDescriptor, CommandTypes, PadCommandDescriptor, ConcatCommandDescriptor, FormatCommandDescriptor, LeftSubstringCommandDescriptor, ReplaceCommandDescriptor, RightSubstringCommandDescriptor, SplitCommandDescriptor, TrimCommandDescriptor, SubstringCommandDescriptor, PDFCommandBaseDescriptor, PDFCommandTypes, PDFAddTextCommandDescriptor, PDFAddImageCommandDescriptor, PDFRemovePagesCommandDescriptor, PDFRemovePagesModes, COSDocTypes, ExpModes, AgentRoles, GroupingDescriptor, GroupingModes, SecureOperDescriptor, SignOperExDescriptor, SignFormats, TimeStampOperExDescriptor, PDFArchiver_ArchiveItemDescriptor, PDFArchiver_ArchiveMappingDescriptor, QueryFunctions, SelectItemVisibilities, QueryOperators, PdVCheckDescriptor, PDFTextItemDescriptor, PDFTextItemScopes, XYModes, SavedQueryDescriptor, Replicator_ArchiveItemDescriptor, Replicator_ArchiveMappingDescriptor, DossierDescriptor, WFDescriptor, TaskDescriptor, Updater_InputTypes, RemoveInputStrategies, SharingModes, RelationDescriptor, RelationTypes, NoDataActions, PrinterDescriptor, PagesRange, PrintOrientations, RetrieveFileOptions, DcmtOpers, MetadataValueDescriptor, MailBoxDescriptor, ReadingMailProtocols, IMAPDescriptor, SendingMailProtocols, MailAuthTypes, SMTPDescriptor, GraphAPIDescriptor, ProcessedItemActions, MailArchiver_FolderDescriptor, ArchiveDcmtDescriptor, MailSender_MailFormatDescriptor, MailArchiver_WholeMailCfgDescriptor, MailSender_TracingDescriptor, MailSender_GroupingDescriptor, MailSender_MailPropertyMappingDescriptor, MailSender_AttachmentCfgDescriptor, MailSender_AttachCompressModes, MailArchiver_WholeMailArchiveModes, MailArchiver_ArchiveMappingDescriptor, MailSender_GroupingModes, MailArchiver_AttachmentCfgDescriptor, Linker_OperTypes, MailArchiver_AttachmentCfgItemDescriptor, MailArchiver_MetadataMappingDescriptor, MailArchiver_ParametricValueTypes, MailMessageProperties, PeppolTracingDescriptor, PeppolDescriptor, GroupDescriptor, FEDistillerJobDescriptor, MailQuery_ArchiveItemDescriptor, MetadataDescriptor, IndexDescriptor, ArchiveConstraints, EncryptionModes, MembershipConstraints, UserTypes, CassettoFiscaleSenderJobDescriptor, CassettoFiscaleQueryJobDescriptor, MetadataDataDomains, DataListViewModes, SAPLoginDescriptor, SAPLoginModes, PdGs, Task_States, Priorities, AlreadySharedActions, DossierTypeDescriptor, WFTypes, WFPartRoles, WFSources, WFEvents, DossierDetail, Ds_ClassIDs } from "./openAPIs/TopMediaServiceClient";
|
|
13
|
+
import { ArchiveModes, AreaDescriptor, AreaParams, BarcodeArchiverJobDescriptor, BarcodeDetectionDescriptor, Barcode_Colors, Barcode_Orientations, DcmtInputTypes, BasketTypeDescriptor, BatchUpdaterJobDescriptor, COSCheckerJobDescriptor, CassettoDoganaleJobDescriptor, CheckSequenceJobDescriptor, CultureIDs, DateTimeFormats, DcmtConverterJobDescriptor, DcmtDeleterJobDescriptor, DcmtDeleter_Actions, DcmtNoteJobDescriptor, DcmtPrinterJobDescriptor, DcmtTypeDescriptor, DiskDescriptor, FEAttacherJobDescriptor, FECreatorTxtJobDescriptor, FEDetacherJobDescriptor, FESenderWsJobDescriptor, FESplitterJobDescriptor, FEValidatorJobDescriptor, FileArchiverJobDescriptor, FileArchiver_ArchiveDescriptor, FileArchiver_ArchiveItemDescriptor, FileArchiver_InputTypes, FileCheckerJobDescriptor, FileDescriptor, FileExecJobDescriptor, FileExec_CheckFileModes, FileExportJobDescriptor, FileFormats, FileMoverJobDescriptor, FileTransferModes, FromItem, InputOrders, InvoiceRetrieveFormats, JobTypes, LexJobDescriptor, LinkerJobDescriptor, MailArchiverJobDescriptor, MailQueryJobDescriptor, MailSenderJobDescriptor, MigrationJobDescriptor, NSOCreatorTxtJobDescriptor, NSODetacherJobDescriptor, NSOSenderWsJobDescriptor, NSOValidatorJobDescriptor, OrderRetrieveFormats, OutputTypes, PDFArchiverJobDescriptor, PdDCreatorJobDescriptor, PdDTypes, PdVArchiverJobDescriptor, PdVQueryJobDescriptor, PdVSenderJobDescriptor, PeppolQueryJobDescriptor, PeppolSenderJobDescriptor, QueryDescriptor, ReplicatorJobDescriptor, SAPAlignerJobDescriptor, SAPBarcodeJobDescriptor, SAPDataReaderJobDescriptor, SAPDataWriterJobDescriptor, SignerJobDescriptor, Updater_UpdateDescriptor, SourceNotExistActions, SpoolArchiverJobDescriptor, UpdateModes, UpdaterJobDescriptor, Updater_MetadataMappingDescriptor, Updater_UpdateItemDescriptor, FileInputTypes, BarcodeArchiver_SplittingDescriptor, BarcodeArchiver_Splitting_Modes, BooleanExpressionDescriptor, BarcodeArchiver_ArchiveDescriptor, FileMover_Operations, SourceFilesFilters, FileRenameOptions, DestFileAlreadyExistActions, SplittingDescriptor, PDFArchiver_ArchiveDescriptor, HttpAddressDescriptor, Replicator_ArchiveDescriptor, BasketDescriptor, CommandSetDescriptor, PDFCommandSetDescriptor, ProcessDescriptor, ScheduleDescriptor, UserDescriptor, UserLevels, MetadataDataTypes, PreProc_Strategies, DataListDescriptor, ProcessRunAsModes, HistLogPurgeModes, ScheduleTypes, ScheduleOneTime, SignCertDescriptor, ScheduleDailyFrequency, ScheduleDailyOccursModes, ScheduleTimeUnits, ScheduleDuration, ScheduleRecurringMonthly, ScheduleRecurringWeekly, ScheduleRecurringDescriptor, ScheduleRecurringTypes, ProcessNotificationDescriptor, UpsertDescriptor, UpsertActions, UpsertSearchCriterias, BarcodeArchiver_ArchiveItemDescriptor, BarcodeArchiver_ArchiveMappingDescriptor, BarcodeArchiver_MetadataMappingDescriptor, MappingModes, MetadataMappingDescriptor, FileArchiver_ArchiveMappingDescriptor, CommandBaseDescriptor, CommandTypes, PadCommandDescriptor, ConcatCommandDescriptor, FormatCommandDescriptor, LeftSubstringCommandDescriptor, ReplaceCommandDescriptor, RightSubstringCommandDescriptor, SplitCommandDescriptor, TrimCommandDescriptor, SubstringCommandDescriptor, PDFCommandBaseDescriptor, PDFCommandTypes, PDFAddTextCommandDescriptor, PDFAddImageCommandDescriptor, PDFRemovePagesCommandDescriptor, PDFRemovePagesModes, COSDocTypes, ExpModes, AgentRoles, GroupingDescriptor, GroupingModes, SecureOperDescriptor, SignOperExDescriptor, SignFormats, TimeStampOperExDescriptor, PDFArchiver_ArchiveItemDescriptor, PDFArchiver_ArchiveMappingDescriptor, QueryFunctions, SelectItemVisibilities, QueryOperators, PdVCheckDescriptor, PDFTextItemDescriptor, PDFTextItemScopes, XYModes, SavedQueryDescriptor, Replicator_ArchiveItemDescriptor, Replicator_ArchiveMappingDescriptor, DossierDescriptor, WFDescriptor, TaskDescriptor, Updater_InputTypes, RemoveInputStrategies, SharingModes, RelationDescriptor, RelationTypes, NoDataActions, PrinterDescriptor, PagesRange, PrintOrientations, RetrieveFileOptions, DcmtOpers, MetadataValueDescriptor, MailBoxDescriptor, ReadingMailProtocols, IMAPDescriptor, SendingMailProtocols, MailAuthTypes, SMTPDescriptor, GraphAPIDescriptor, ProcessedItemActions, MailArchiver_FolderDescriptor, ArchiveDcmtDescriptor, MailSender_MailFormatDescriptor, MailArchiver_WholeMailCfgDescriptor, MailSender_TracingDescriptor, MailSender_GroupingDescriptor, MailSender_MailPropertyMappingDescriptor, MailSender_AttachmentCfgDescriptor, MailSender_AttachCompressModes, MailArchiver_WholeMailArchiveModes, MailArchiver_ArchiveMappingDescriptor, MailSender_GroupingModes, MailArchiver_AttachmentCfgDescriptor, Linker_OperTypes, MailArchiver_AttachmentCfgItemDescriptor, MailArchiver_MetadataMappingDescriptor, MailArchiver_ParametricValueTypes, MailMessageProperties, PeppolTracingDescriptor, PeppolDescriptor, GroupDescriptor, FEDistillerJobDescriptor, MailQuery_ArchiveItemDescriptor, MetadataDescriptor, IndexDescriptor, ArchiveConstraints, EncryptionModes, MembershipConstraints, UserTypes, CassettoFiscaleSenderJobDescriptor, CassettoFiscaleQueryJobDescriptor, MetadataDataDomains, DataListViewModes, SAPLoginDescriptor, SAPLoginModes, PdGs, Task_States, Priorities, AlreadySharedActions, DossierTypeDescriptor, WFTypes, WFPartRoles, WFSources, WFEvents, DossierDetail, Ds_ClassIDs, LayoutCustomButtonModes } from "./openAPIs/TopMediaServiceClient";
|
|
14
14
|
class BaseEngine {
|
|
15
15
|
constructor(tms) {
|
|
16
16
|
this.TopMediaSession = tms;
|
|
@@ -490,6 +490,50 @@ export class DcmtTypeEngine extends BaseEngine {
|
|
|
490
490
|
(_c = d.isUnique) !== null && _c !== void 0 ? _c : (d.isUnique = 0);
|
|
491
491
|
return d;
|
|
492
492
|
}
|
|
493
|
+
static NormalizeLayoutDescriptor(d, isNew) {
|
|
494
|
+
var _a, _b, _c, _d;
|
|
495
|
+
if (!d)
|
|
496
|
+
return;
|
|
497
|
+
(_a = d.id) !== null && _a !== void 0 ? _a : (d.id = 0);
|
|
498
|
+
(_b = d.isForArchive) !== null && _b !== void 0 ? _b : (d.isForArchive = false);
|
|
499
|
+
(_c = d.isForUpdate) !== null && _c !== void 0 ? _c : (d.isForUpdate = false);
|
|
500
|
+
(_d = d.tid) !== null && _d !== void 0 ? _d : (d.tid = 0);
|
|
501
|
+
if (d.items) {
|
|
502
|
+
for (let item of d.items) {
|
|
503
|
+
this.NormalizeLayoutItemDescriptor(item, isNew);
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
else {
|
|
507
|
+
d.items = [];
|
|
508
|
+
}
|
|
509
|
+
if (d.customButtons) {
|
|
510
|
+
for (let cb of d.customButtons) {
|
|
511
|
+
this.NormalizeLayoutCustomButtonDescriptor(cb, isNew);
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
else {
|
|
515
|
+
d.customButtons = [];
|
|
516
|
+
}
|
|
517
|
+
return d;
|
|
518
|
+
}
|
|
519
|
+
static NormalizeLayoutItemDescriptor(d, isNew) {
|
|
520
|
+
var _a, _b;
|
|
521
|
+
if (!d)
|
|
522
|
+
return;
|
|
523
|
+
(_a = d.layoutItemID) !== null && _a !== void 0 ? _a : (d.layoutItemID = 0);
|
|
524
|
+
(_b = d.parentID) !== null && _b !== void 0 ? _b : (d.parentID = 0);
|
|
525
|
+
return d;
|
|
526
|
+
}
|
|
527
|
+
static NormalizeLayoutCustomButtonDescriptor(d, isNew) {
|
|
528
|
+
var _a, _b, _c, _d;
|
|
529
|
+
if (!d)
|
|
530
|
+
return;
|
|
531
|
+
(_a = d.isForArchive) !== null && _a !== void 0 ? _a : (d.isForArchive = 0);
|
|
532
|
+
(_b = d.isForUpdate) !== null && _b !== void 0 ? _b : (d.isForUpdate = 0);
|
|
533
|
+
(_c = d.isForSearchResult) !== null && _c !== void 0 ? _c : (d.isForSearchResult = 0);
|
|
534
|
+
(_d = d.mode) !== null && _d !== void 0 ? _d : (d.mode = LayoutCustomButtonModes.RunForEachDcmt);
|
|
535
|
+
return d;
|
|
536
|
+
}
|
|
493
537
|
CreateAsync(d) {
|
|
494
538
|
return __awaiter(this, void 0, void 0, function* () { var _a; return yield ((_a = this.TMSClient) === null || _a === void 0 ? void 0 : _a.dcmtTypeCreate(d)); });
|
|
495
539
|
}
|
|
@@ -548,7 +592,7 @@ export class DcmtTypeEngine extends BaseEngine {
|
|
|
548
592
|
return __awaiter(this, void 0, void 0, function* () { var _a; return yield ((_a = this.TMSClient) === null || _a === void 0 ? void 0 : _a.layoutCreate(ld)); });
|
|
549
593
|
}
|
|
550
594
|
LayoutRetrieveAsync(TID, layoutMode) {
|
|
551
|
-
return __awaiter(this, void 0, void 0, function* () { var _a; return yield ((_a = this.TMSClient) === null || _a === void 0 ? void 0 : _a.layoutRetrieve(TID, layoutMode)); });
|
|
595
|
+
return __awaiter(this, void 0, void 0, function* () { var _a; return DcmtTypeEngine.NormalizeLayoutDescriptor(yield ((_a = this.TMSClient) === null || _a === void 0 ? void 0 : _a.layoutRetrieve(TID, layoutMode)), false); });
|
|
552
596
|
}
|
|
553
597
|
LayoutRetrieveAdminAsync(TID, id) {
|
|
554
598
|
return __awaiter(this, void 0, void 0, function* () { var _a; return yield ((_a = this.TMSClient) === null || _a === void 0 ? void 0 : _a.layoutRetrieveAdmin(TID, id)); });
|
|
@@ -734,14 +778,11 @@ export class DossierEngine extends BaseEngine {
|
|
|
734
778
|
FollowAddOrRemoveAsync(id, remove) {
|
|
735
779
|
return __awaiter(this, void 0, void 0, function* () { var _a; return yield ((_a = this.TMSClient) === null || _a === void 0 ? void 0 : _a.dossierFollowAddOrRemove(id, remove ? 1 : 0)); });
|
|
736
780
|
}
|
|
737
|
-
|
|
738
|
-
return __awaiter(this, void 0, void 0, function* () { var _a; return yield ((_a = this.TMSClient) === null || _a === void 0 ? void 0 : _a.
|
|
739
|
-
}
|
|
740
|
-
DetailAttachDcmtAsync(id, dsdid, tid, did, mode) {
|
|
741
|
-
return __awaiter(this, void 0, void 0, function* () { var _a; yield ((_a = this.TMSClient) === null || _a === void 0 ? void 0 : _a.dossierDetailAttachDcmt(id, dsdid, tid, did, mode)); });
|
|
781
|
+
DetailCreateAsync(id, classID, id1, id2) {
|
|
782
|
+
return __awaiter(this, void 0, void 0, function* () { var _a; return yield ((_a = this.TMSClient) === null || _a === void 0 ? void 0 : _a.dossierDetailCreate(id, classID, id1, id2)); });
|
|
742
783
|
}
|
|
743
|
-
|
|
744
|
-
return __awaiter(this, void 0, void 0, function* () { var _a; yield ((_a = this.TMSClient) === null || _a === void 0 ? void 0 : _a.
|
|
784
|
+
DetailUpdateAsync(id, tid, min, max) {
|
|
785
|
+
return __awaiter(this, void 0, void 0, function* () { var _a; yield ((_a = this.TMSClient) === null || _a === void 0 ? void 0 : _a.dossierDetailUpdate(id, tid, min, max)); });
|
|
745
786
|
}
|
|
746
787
|
DetailDeleteAsync(id, dsdid) {
|
|
747
788
|
return __awaiter(this, void 0, void 0, function* () { var _a; yield ((_a = this.TMSClient) === null || _a === void 0 ? void 0 : _a.dossierDetailDelete(id, dsdid)); });
|
|
@@ -3889,6 +3930,16 @@ export class SearchEngine extends BaseEngine {
|
|
|
3889
3930
|
GetMetadataAsync(TID_1, DID_1, getTag_1) {
|
|
3890
3931
|
return __awaiter(this, arguments, void 0, function* (TID, DID, getTag, outputType = 6) { var _a; return yield ((_a = this.TMSClient) === null || _a === void 0 ? void 0 : _a.getMetadata(TID, DID, getTag ? 1 : 0, outputType)); });
|
|
3891
3932
|
}
|
|
3933
|
+
GetSharedDcmtsAsync(TID_1, DID_1) {
|
|
3934
|
+
return __awaiter(this, arguments, void 0, function* (TID, DID, outputType = 6) { var _a; return yield ((_a = this.TMSClient) === null || _a === void 0 ? void 0 : _a.getSharedDcmts(TID, DID, outputType)); });
|
|
3935
|
+
}
|
|
3936
|
+
ManyToManyRelateAsync(masterTID, masterDID, detailTID, detailDID) {
|
|
3937
|
+
return __awaiter(this, void 0, void 0, function* () { var _a; return yield ((_a = this.TMSClient) === null || _a === void 0 ? void 0 : _a.manyToManyRelate(masterTID, masterDID, detailTID, detailDID)); });
|
|
3938
|
+
}
|
|
3939
|
+
ManyToManyUnrelateAsync(masterTID, masterDID, detailTID, detailDID) {
|
|
3940
|
+
return __awaiter(this, void 0, void 0, function* () { var _a; return yield ((_a = this.TMSClient) === null || _a === void 0 ? void 0 : _a.manyToManyUnrelate(masterTID, masterDID, detailTID, detailDID)); });
|
|
3941
|
+
}
|
|
3942
|
+
;
|
|
3892
3943
|
RetrieveAttachmentsAsync(TID, DID, attachmentIndex, retrieveContent) {
|
|
3893
3944
|
return __awaiter(this, void 0, void 0, function* () { var _a; return yield ((_a = this.TMSClient) === null || _a === void 0 ? void 0 : _a.retrieveAttachments(TID, DID, attachmentIndex, retrieveContent)); });
|
|
3894
3945
|
}
|
|
@@ -4086,6 +4137,45 @@ export class UpdateEngineByID extends BaseEngine {
|
|
|
4086
4137
|
if (this.DID <= 0)
|
|
4087
4138
|
throw new Error("DID non specificato!");
|
|
4088
4139
|
}
|
|
4140
|
+
CheckOutAsync() {
|
|
4141
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
4142
|
+
var _a;
|
|
4143
|
+
this.Check_TID_DID();
|
|
4144
|
+
yield ((_a = this.TMSClient) === null || _a === void 0 ? void 0 : _a.checkOut(this.TID, this.DID));
|
|
4145
|
+
});
|
|
4146
|
+
}
|
|
4147
|
+
UndoCheckOutAsync() {
|
|
4148
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
4149
|
+
var _a;
|
|
4150
|
+
this.Check_TID_DID();
|
|
4151
|
+
yield ((_a = this.TMSClient) === null || _a === void 0 ? void 0 : _a.undoCheckOut(this.TID, this.DID));
|
|
4152
|
+
});
|
|
4153
|
+
}
|
|
4154
|
+
CheckInAsync(file, note, signal, progressCallback) {
|
|
4155
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
4156
|
+
var _a;
|
|
4157
|
+
this.Check_TID_DID();
|
|
4158
|
+
let fd = yield new ArchiveEngineByID(this.TopMediaSession).FileNameToFileDescriptorAsync(this.TopMediaSession, file, false, signal, progressCallback);
|
|
4159
|
+
yield ((_a = this.TMSClient) === null || _a === void 0 ? void 0 : _a.checkIn(this.TID, this.DID, note, fd, signal));
|
|
4160
|
+
});
|
|
4161
|
+
}
|
|
4162
|
+
GetChronologyAsync() {
|
|
4163
|
+
return __awaiter(this, arguments, void 0, function* (outputType = 6) {
|
|
4164
|
+
var _a;
|
|
4165
|
+
this.Check_TID_DID();
|
|
4166
|
+
return yield ((_a = this.TMSClient) === null || _a === void 0 ? void 0 : _a.getChronology(this.TID, this.DID, outputType));
|
|
4167
|
+
});
|
|
4168
|
+
}
|
|
4169
|
+
GetDcmtsInCheckOutAsync() {
|
|
4170
|
+
return __awaiter(this, arguments, void 0, function* (outputType = 6) { var _a; return yield ((_a = this.TMSClient) === null || _a === void 0 ? void 0 : _a.getDcmtsInCheckOut(outputType)); });
|
|
4171
|
+
}
|
|
4172
|
+
GetLastCheckInInfoAsync() {
|
|
4173
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
4174
|
+
var _a;
|
|
4175
|
+
this.Check_TID_DID();
|
|
4176
|
+
return yield ((_a = this.TMSClient) === null || _a === void 0 ? void 0 : _a.getLastCheckInInfo(this.TID, this.DID));
|
|
4177
|
+
});
|
|
4178
|
+
}
|
|
4089
4179
|
UpdateAsync() {
|
|
4090
4180
|
return __awaiter(this, void 0, void 0, function* () {
|
|
4091
4181
|
var _a;
|
|
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
import { PublicClientApplication } from "@azure/msal-browser";
|
|
11
11
|
import { ArchiveEngine, AreaEngine, BasketEngine, BasketTypeEngine, DataListEngine, DcmtTypeEngine, DiskEngine, DossierEngine, FavoritesEngine, HomePageEngine, RelationEngine, JobEngine, LicenseEngine, NotificationEngine, OrchPlatformEngine, PreviewEngine, ProcessEngine, RecentEngine, SavedQueryEngine, SearchEngine, SignCertEngine, TSAEngine, TaskEngine, TreeEngine, UploadFileEngine, UserEngine, WorkflowEngine, WorkingGroupEngine, DeleteEngine, UpdateEngineByID, ArchiveEngineByID, DcmtPlatformEngine, ADMEngine, NumeratorEngine, ReportEngine, SignServerEngine, LDAPEngine, GroupEngine, SAPEngine, PermissionEngine, ViewEngine, DossierTypeEngine } from "./Engine";
|
|
12
|
-
import { DataListCacheService, DcmtTypeListCacheService, RelationCacheService, SavedQueryCacheService, SignCertCacheService, TreeCacheService, TSACacheService, UserListCacheService, WorkingGroupCacheService } from "./helper/SDK_CacheServices";
|
|
12
|
+
import { DataListCacheService, DcmtTypeListCacheService, DossierCacheService, LayoutCacheService, RelationCacheService, SavedQueryCacheService, SignCertCacheService, TreeCacheService, TSACacheService, UserListCacheService, WorkingGroupCacheService } from "./helper/SDK_CacheServices";
|
|
13
13
|
import { AuthenticationModes } from "./openAPIs/TopMediaServiceClient";
|
|
14
14
|
import { SDK_Globals } from "./helper/SDK_Globals";
|
|
15
15
|
export class TopMediaSession {
|
|
@@ -160,6 +160,14 @@ export class TopMediaSession {
|
|
|
160
160
|
UserListCacheService.RemoveAll(this);
|
|
161
161
|
}
|
|
162
162
|
catch (_m) { }
|
|
163
|
+
try {
|
|
164
|
+
LayoutCacheService.RemoveAll(this);
|
|
165
|
+
}
|
|
166
|
+
catch (_o) { }
|
|
167
|
+
try {
|
|
168
|
+
DossierCacheService.RemoveAll(this);
|
|
169
|
+
}
|
|
170
|
+
catch (_p) { }
|
|
163
171
|
SDK_Globals.license = undefined;
|
|
164
172
|
SDK_Globals.currentWorkflowApproveData = [];
|
|
165
173
|
if (!useGlobals)
|
|
@@ -7,7 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import { AccessLevelsEx, DataColumnTypes, DataListDescriptor, DataListViewModes, DcmtTypeDescriptor, DossierDescriptor, MetadataDataDomains, MetadataDataTypes, MetadataDescriptor, ObjectClasses, RelationDescriptor, SavedQueryDescriptor, SignCertDescriptor, TSADescriptor, TreeContext, TreeDescriptor, UserDescriptor, UserLevels, WFDescriptor, WorkingGroupDescriptor } from "../openAPIs/TopMediaServiceClient";
|
|
10
|
+
import { AccessLevelsEx, DataColumnTypes, DataListDescriptor, DataListViewModes, DcmtTypeDescriptor, DossierDescriptor, LayoutDescriptor, MetadataDataDomains, MetadataDataTypes, MetadataDescriptor, ObjectClasses, RelationDescriptor, SavedQueryDescriptor, SignCertDescriptor, TSADescriptor, TreeContext, TreeDescriptor, UserDescriptor, UserLevels, WFDescriptor, WorkingGroupDescriptor } from "../openAPIs/TopMediaServiceClient";
|
|
11
11
|
import { Mutex } from 'async-mutex';
|
|
12
12
|
import { SDK_Globals } from "./SDK_Globals";
|
|
13
13
|
export class DataListCacheService {
|
|
@@ -481,9 +481,6 @@ export class DossierCacheService {
|
|
|
481
481
|
if (!tms)
|
|
482
482
|
throw new Error("No valid session available for DossierEngine.");
|
|
483
483
|
const items = (_a = (yield tms.NewDossierEngine().RetrieveAllAsync())) !== null && _a !== void 0 ? _a : [];
|
|
484
|
-
if (!items.length) {
|
|
485
|
-
console.warn(`RetrieveAllAsync() returned an empty list for accessToken: ${accessToken}`);
|
|
486
|
-
}
|
|
487
484
|
this._cacheAll.set(accessToken, items);
|
|
488
485
|
return deepCopy ? this.cloneItems(items) : items;
|
|
489
486
|
}));
|
|
@@ -561,9 +558,6 @@ export class WorkingGroupCacheService {
|
|
|
561
558
|
if (!tms)
|
|
562
559
|
throw new Error("No valid session available for WorkingGroupEngine.");
|
|
563
560
|
const items = (_a = (yield tms.NewWorkingGroupEngine().RetrieveAllAsync())) !== null && _a !== void 0 ? _a : [];
|
|
564
|
-
if (!items.length) {
|
|
565
|
-
console.warn(`RetrieveAllAsync() returned an empty list for accessToken: ${accessToken}`);
|
|
566
|
-
}
|
|
567
561
|
this._cacheAll.set(accessToken, items);
|
|
568
562
|
return deepCopy ? this.cloneItems(items) : items;
|
|
569
563
|
}));
|
|
@@ -959,3 +953,91 @@ export class UserListCacheService {
|
|
|
959
953
|
}
|
|
960
954
|
UserListCacheService._mutex = new Mutex();
|
|
961
955
|
UserListCacheService._cache = new Map();
|
|
956
|
+
export class LayoutCacheService {
|
|
957
|
+
static getCacheKey(TID, layoutMode) {
|
|
958
|
+
return `${TID}_${layoutMode}`;
|
|
959
|
+
}
|
|
960
|
+
static getAccessToken(tmSession) {
|
|
961
|
+
var _a, _b;
|
|
962
|
+
return (_b = (_a = (tmSession !== null && tmSession !== void 0 ? tmSession : SDK_Globals.tmSession)) === null || _a === void 0 ? void 0 : _a.SessionDescr) === null || _b === void 0 ? void 0 : _b.accessToken;
|
|
963
|
+
}
|
|
964
|
+
static GetAsync(TID_1, layoutMode_1, tmSession_1) {
|
|
965
|
+
return __awaiter(this, arguments, void 0, function* (TID, layoutMode, tmSession, deepCopy = false, refreshCache = false) {
|
|
966
|
+
if (!TID)
|
|
967
|
+
return undefined;
|
|
968
|
+
return yield this.withLock(() => __awaiter(this, void 0, void 0, function* () {
|
|
969
|
+
const tms = tmSession !== null && tmSession !== void 0 ? tmSession : SDK_Globals.tmSession;
|
|
970
|
+
if (!tms)
|
|
971
|
+
throw new Error("No valid session available for DcmtTypeEngine.");
|
|
972
|
+
const accessToken = this.getAccessToken(tmSession);
|
|
973
|
+
const cacheKey = this.getCacheKey(TID, layoutMode);
|
|
974
|
+
if (refreshCache) {
|
|
975
|
+
this.Remove(TID, layoutMode, tmSession);
|
|
976
|
+
}
|
|
977
|
+
let layoutMap = this._cache.get(accessToken);
|
|
978
|
+
if (!layoutMap) {
|
|
979
|
+
layoutMap = new Map();
|
|
980
|
+
this._cache.set(accessToken, layoutMap);
|
|
981
|
+
}
|
|
982
|
+
let cached = layoutMap.get(cacheKey);
|
|
983
|
+
if (cached !== undefined) {
|
|
984
|
+
if (cached === null)
|
|
985
|
+
return undefined;
|
|
986
|
+
return deepCopy ? this.cloneItem(cached) : cached;
|
|
987
|
+
}
|
|
988
|
+
let fetched = yield tms.NewDcmtTypeEngine().LayoutRetrieveAsync(TID, layoutMode);
|
|
989
|
+
layoutMap.set(cacheKey, fetched !== null && fetched !== void 0 ? fetched : null);
|
|
990
|
+
if (!fetched) {
|
|
991
|
+
return undefined;
|
|
992
|
+
}
|
|
993
|
+
return deepCopy ? this.cloneItem(fetched) : fetched;
|
|
994
|
+
}));
|
|
995
|
+
});
|
|
996
|
+
}
|
|
997
|
+
static Remove(TID, layoutMode, tmSession) {
|
|
998
|
+
if (!TID)
|
|
999
|
+
return;
|
|
1000
|
+
const accessToken = this.getAccessToken(tmSession);
|
|
1001
|
+
const layoutMap = this._cache.get(accessToken);
|
|
1002
|
+
if (layoutMap) {
|
|
1003
|
+
const cacheKey = this.getCacheKey(TID, layoutMode);
|
|
1004
|
+
layoutMap.delete(cacheKey);
|
|
1005
|
+
}
|
|
1006
|
+
}
|
|
1007
|
+
static RemoveAllForTID(TID, tmSession) {
|
|
1008
|
+
if (!TID)
|
|
1009
|
+
return;
|
|
1010
|
+
const accessToken = this.getAccessToken(tmSession);
|
|
1011
|
+
const layoutMap = this._cache.get(accessToken);
|
|
1012
|
+
if (layoutMap) {
|
|
1013
|
+
const keysToDelete = [];
|
|
1014
|
+
layoutMap.forEach((_, key) => {
|
|
1015
|
+
if (key.startsWith(`${TID}_`)) {
|
|
1016
|
+
keysToDelete.push(key);
|
|
1017
|
+
}
|
|
1018
|
+
});
|
|
1019
|
+
keysToDelete.forEach(key => layoutMap.delete(key));
|
|
1020
|
+
}
|
|
1021
|
+
}
|
|
1022
|
+
static RemoveAll(tmSession) {
|
|
1023
|
+
const accessToken = this.getAccessToken(tmSession);
|
|
1024
|
+
this._cache.delete(accessToken);
|
|
1025
|
+
}
|
|
1026
|
+
static CacheCount(tmSession) {
|
|
1027
|
+
var _a, _b;
|
|
1028
|
+
const accessToken = this.getAccessToken(tmSession);
|
|
1029
|
+
return (_b = (_a = this._cache.get(accessToken)) === null || _a === void 0 ? void 0 : _a.size) !== null && _b !== void 0 ? _b : 0;
|
|
1030
|
+
}
|
|
1031
|
+
static withLock(callback) {
|
|
1032
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1033
|
+
return yield this._mutex.runExclusive(callback);
|
|
1034
|
+
});
|
|
1035
|
+
}
|
|
1036
|
+
static cloneItem(item) {
|
|
1037
|
+
const cloned = new LayoutDescriptor();
|
|
1038
|
+
cloned.init(Object.assign({}, item));
|
|
1039
|
+
return cloned;
|
|
1040
|
+
}
|
|
1041
|
+
}
|
|
1042
|
+
LayoutCacheService._mutex = new Mutex();
|
|
1043
|
+
LayoutCacheService._cache = new Map();
|
|
@@ -10,11 +10,7 @@ export class SDK_Globals {
|
|
|
10
10
|
if (theTmSession) {
|
|
11
11
|
let sd = theTmSession.SessionDescr;
|
|
12
12
|
if ((sd === null || sd === void 0 ? void 0 : sd.version) != undefined) {
|
|
13
|
-
|
|
14
|
-
if (vs.length == 4)
|
|
15
|
-
this._websdkVersion = `${vs[0]}.${vs[1]}.${vs[2]}`;
|
|
16
|
-
else
|
|
17
|
-
this._websdkVersion = sd.version;
|
|
13
|
+
this._websdkVersion = sd.version;
|
|
18
14
|
}
|
|
19
15
|
if (sd === null || sd === void 0 ? void 0 : sd.archiveID)
|
|
20
16
|
theTmSession.NewArchiveEngine().RetrieveByStringAsync(sd.archiveID).then((ad) => { var _a; return this._dbBrand = (_a = ad === null || ad === void 0 ? void 0 : ad.dbBrand) !== null && _a !== void 0 ? _a : DBBrands.None; });
|
package/dist/lib/helper/index.js
CHANGED
package/dist/lib/helper/utils.js
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { TopMediaServer } from "../TopMediaServer";
|
|
11
|
+
import { SDK_Globals } from "./SDK_Globals";
|
|
1
12
|
export class TMPropertyNames {
|
|
2
13
|
}
|
|
3
14
|
TMPropertyNames.entityName = "name";
|
|
@@ -10,3 +21,22 @@ TMPropertyNames.where = "where";
|
|
|
10
21
|
export class TMScopeNames {
|
|
11
22
|
}
|
|
12
23
|
TMScopeNames.qd = "qd";
|
|
24
|
+
export const SetGlobalsInfoAsync = (tms) => __awaiter(void 0, void 0, void 0, function* () {
|
|
25
|
+
var _a;
|
|
26
|
+
const tmServer = new TopMediaServer((_a = tms === null || tms === void 0 ? void 0 : tms.TopMediaServer) === null || _a === void 0 ? void 0 : _a.BaseAddress);
|
|
27
|
+
const tmSessionNew = tmServer === null || tmServer === void 0 ? void 0 : tmServer.NewSession();
|
|
28
|
+
if (tmSessionNew) {
|
|
29
|
+
tmSessionNew.SessionDescr = tms === null || tms === void 0 ? void 0 : tms.SessionDescr;
|
|
30
|
+
}
|
|
31
|
+
SDK_Globals.tmSession = tmSessionNew;
|
|
32
|
+
SDK_Globals.tmSession.AutoRefresh = true;
|
|
33
|
+
if (SDK_Globals.license == undefined) {
|
|
34
|
+
try {
|
|
35
|
+
SDK_Globals.license = yield tmSessionNew.NewLicenseEngine().RetrieveAsync();
|
|
36
|
+
}
|
|
37
|
+
catch (e) {
|
|
38
|
+
throw e;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return tmSessionNew;
|
|
42
|
+
});
|