@topconsultnpm/sdk-ts 6.20.0-dev1.6 → 6.20.0-dev2.10
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.d.ts +1949 -0
- package/dist/lib/Engine.js +37 -0
- package/dist/lib/TopMediaServer.d.ts +26 -0
- package/dist/lib/TopMediaServiceClientEx.d.ts +20 -0
- package/dist/lib/TopMediaSession.d.ts +124 -0
- package/dist/lib/TopMediaSession.js +7 -7
- package/dist/lib/helper/ExtMethods.d.ts +4 -0
- package/dist/lib/helper/LocalStorageService.d.ts +10 -0
- package/dist/lib/helper/PlatformObjectValidator.d.ts +43 -0
- package/dist/lib/helper/PlatformObjectValidator.js +41 -0
- package/dist/lib/helper/SDK_CacheServices.d.ts +124 -0
- package/dist/lib/helper/SDK_Globals.d.ts +36 -0
- package/dist/lib/helper/SDK_Localizator.d.ts +137 -0
- package/dist/lib/helper/SDK_Localizator.js +10 -0
- package/dist/lib/helper/StandardHelper.d.ts +4 -0
- package/dist/lib/helper/StringHelper.d.ts +4 -0
- package/dist/lib/helper/index.d.ts +7 -0
- package/dist/lib/helper/utils.d.ts +12 -0
- package/dist/lib/helper/utils.js +2 -0
- package/dist/lib/index.d.ts +6 -0
- package/dist/lib/openAPIs/TopMediaServiceClient.d.ts +8347 -0
- package/dist/lib/openAPIs/TopMediaServiceClient.js +1 -1
- package/dist/types/Engine.d.ts +21 -1
- package/dist/types/helper/PlatformObjectValidator.d.ts +3 -1
- package/dist/types/helper/SDK_Localizator.d.ts +1 -0
- package/dist/types/helper/utils.d.ts +9 -7
- package/dist/types/openAPIs/TopMediaServiceClient.d.ts +8 -3
- package/package.json +2 -2
package/dist/lib/Engine.js
CHANGED
|
@@ -335,6 +335,43 @@ export class BasketEngine extends BaseEngine {
|
|
|
335
335
|
DeleteAsync(BTID, BID) {
|
|
336
336
|
return __awaiter(this, void 0, void 0, function* () { var _a; return yield ((_a = this.TMSClient) === null || _a === void 0 ? void 0 : _a.basketDelete(BTID, BID)); });
|
|
337
337
|
}
|
|
338
|
+
LockAsync(BTID, BID, autoUnlock) {
|
|
339
|
+
return __awaiter(this, void 0, void 0, function* () { var _a; return yield ((_a = this.TMSClient) === null || _a === void 0 ? void 0 : _a.basketLock(BTID, BID, autoUnlock)); });
|
|
340
|
+
}
|
|
341
|
+
UnlockAsync(BTID, BID) {
|
|
342
|
+
return __awaiter(this, void 0, void 0, function* () { var _a; return yield ((_a = this.TMSClient) === null || _a === void 0 ? void 0 : _a.basketUnlock(BTID, BID)); });
|
|
343
|
+
}
|
|
344
|
+
UnlockAllAsync() {
|
|
345
|
+
return __awaiter(this, void 0, void 0, function* () { var _a; return yield ((_a = this.TMSClient) === null || _a === void 0 ? void 0 : _a.basketUnlockAll()); });
|
|
346
|
+
}
|
|
347
|
+
ChangeStatusAsync(BTID, BID, newStatus, newAction) {
|
|
348
|
+
return __awaiter(this, void 0, void 0, function* () { var _a; return yield ((_a = this.TMSClient) === null || _a === void 0 ? void 0 : _a.basketChangeStatus(BTID, BID, newStatus, newAction)); });
|
|
349
|
+
}
|
|
350
|
+
AddFileAsync(BTID, BID, batch, barcode, dateTime, fd, abortSignal) {
|
|
351
|
+
return __awaiter(this, void 0, void 0, function* () { var _a; return yield ((_a = this.TMSClient) === null || _a === void 0 ? void 0 : _a.basketAddFile(BTID, BID, batch, barcode, dateTime, fd, abortSignal)); });
|
|
352
|
+
}
|
|
353
|
+
RetrieveAllFilesAsync(BTID, BID, fromBFID, toBFID, excludeIgnore) {
|
|
354
|
+
return __awaiter(this, void 0, void 0, function* () { var _a; return yield ((_a = this.TMSClient) === null || _a === void 0 ? void 0 : _a.basketRetrieveAllFiles(BTID, BID, fromBFID, toBFID, excludeIgnore ? 1 : 0)); });
|
|
355
|
+
}
|
|
356
|
+
RemoveFilesAsync(BTID, BID, BFIDs) {
|
|
357
|
+
return __awaiter(this, void 0, void 0, function* () { var _a; return yield ((_a = this.TMSClient) === null || _a === void 0 ? void 0 : _a.basketRemoveFiles(BTID, BID, BFIDs)); });
|
|
358
|
+
}
|
|
359
|
+
SetIgnoreFilesFlagAsync(BTID, BID, BFIDs, ignore) {
|
|
360
|
+
return __awaiter(this, void 0, void 0, function* () { var _a; return yield ((_a = this.TMSClient) === null || _a === void 0 ? void 0 : _a.basketSetIgnoreFiles(BTID, BID, ignore ? 1 : 0, BFIDs)); });
|
|
361
|
+
}
|
|
362
|
+
SetFileBarcodeAsync(BTID, BID, BFID, barcode) {
|
|
363
|
+
return __awaiter(this, void 0, void 0, function* () { var _a; return yield ((_a = this.TMSClient) === null || _a === void 0 ? void 0 : _a.basketSetFileBarcode(BTID, BID, BFID, barcode)); });
|
|
364
|
+
}
|
|
365
|
+
RetrieveFileAsync(BTID, BID, BFID, cvtFormat, abortSignal) {
|
|
366
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
367
|
+
var _a;
|
|
368
|
+
let fr = yield ((_a = this.TMSClient) === null || _a === void 0 ? void 0 : _a.basketRetrieveFile(BTID, BID, BFID, cvtFormat, abortSignal));
|
|
369
|
+
return new File([fr === null || fr === void 0 ? void 0 : fr.data], fr === null || fr === void 0 ? void 0 : fr.fileName, {
|
|
370
|
+
lastModified: new Date().getTime(),
|
|
371
|
+
type: fr === null || fr === void 0 ? void 0 : fr.data.type
|
|
372
|
+
});
|
|
373
|
+
});
|
|
374
|
+
}
|
|
338
375
|
}
|
|
339
376
|
export class BasketTypeEngine extends BaseEngine {
|
|
340
377
|
static NewBasketTypeDescriptor() { return this.Normalize(new BasketTypeDescriptor(), true); }
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ITopMediaSession } from "./TopMediaSession";
|
|
2
|
+
import { CultureIDs, TopMediaServiceClient } from "./openAPIs/TopMediaServiceClient";
|
|
3
|
+
import { TopMediaServiceClientEx } from "./TopMediaServiceClientEx";
|
|
4
|
+
export interface ITopMediaServer {
|
|
5
|
+
BaseAddress?: string;
|
|
6
|
+
NullValue: string;
|
|
7
|
+
PingAsync(): Promise<string[]>;
|
|
8
|
+
NewSession(): ITopMediaSession;
|
|
9
|
+
CreateHttpClient(accessToken?: string, useClientEx?: boolean): TopMediaServiceClient | TopMediaServiceClientEx;
|
|
10
|
+
FontNamesAsync(): Promise<string[]>;
|
|
11
|
+
PrinterNamesAsync(): Promise<string[]>;
|
|
12
|
+
EncryptAsync(input: string): Promise<string>;
|
|
13
|
+
}
|
|
14
|
+
export declare class TopMediaServer implements ITopMediaServer {
|
|
15
|
+
constructor(baseAddress?: string);
|
|
16
|
+
BaseAddress: string | undefined;
|
|
17
|
+
NullValue: string;
|
|
18
|
+
PingAsync(): Promise<string[]>;
|
|
19
|
+
NewSession(): ITopMediaSession;
|
|
20
|
+
/** Restituisce l'elenco dei CultureID disponibili */
|
|
21
|
+
static RetrieveAllCultureIDs(): CultureIDs[];
|
|
22
|
+
FontNamesAsync(): Promise<string[]>;
|
|
23
|
+
PrinterNamesAsync(): Promise<string[]>;
|
|
24
|
+
EncryptAsync(input: string): Promise<string>;
|
|
25
|
+
CreateHttpClient(accessToken?: string, useClientEx?: boolean): TopMediaServiceClient | TopMediaServiceClientEx;
|
|
26
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { AxiosInstance, AxiosResponse } from 'axios';
|
|
2
|
+
import { AreaParams, FileResponse, RetrieveFileOptions } from './openAPIs/TopMediaServiceClient';
|
|
3
|
+
export declare class TopMediaServiceClientEx {
|
|
4
|
+
private instance;
|
|
5
|
+
private baseUrl;
|
|
6
|
+
protected jsonParseReviver: ((key: string, value: any) => any) | undefined;
|
|
7
|
+
constructor(baseUrl?: string, instance?: AxiosInstance);
|
|
8
|
+
areaAddFileEx(body: AreaParams | undefined, progressCallback?: (pd: ProgressCallbackData) => any, signal?: AbortSignal | undefined): Promise<void>;
|
|
9
|
+
protected processAreaAddFileEx(response: AxiosResponse): Promise<void>;
|
|
10
|
+
areaRetrieveFileEx(body: AreaParams | undefined, progressCallback?: (pd: ProgressCallbackData) => any, signal?: AbortSignal | undefined): Promise<FileResponse>;
|
|
11
|
+
protected processAreaRetrieveFileEx(response: AxiosResponse): Promise<FileResponse>;
|
|
12
|
+
retrieveFileEx(tID: number | undefined, dID: number | undefined, body: RetrieveFileOptions | undefined, progressCallback?: (pd: ProgressCallbackData) => any, signal?: AbortSignal): Promise<FileResponse>;
|
|
13
|
+
protected processRetrieveFileEx(response: AxiosResponse): Promise<FileResponse>;
|
|
14
|
+
}
|
|
15
|
+
export declare class ProgressCallbackData {
|
|
16
|
+
ProgressBarMaximum: number | undefined;
|
|
17
|
+
ProgressBarValue: number;
|
|
18
|
+
ProgressMessage?: string;
|
|
19
|
+
CustomParam?: object;
|
|
20
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { PopupRequest, PublicClientApplication } from "@azure/msal-browser";
|
|
2
|
+
import { IArchiveEngine, IAreaEngine, IBasketEngine, IBasketTypeEngine, IDataListEngine, IDcmtTypeEngine, IDiskEngine, IDossierEngine, IFavoritesEngine, IHomePageEngine, IJobEngine, ILicenseEngine, INotificationEngine, IOrchPlatformEngine, IPreviewEngine, IProcessEngine, IRecentEngine, ISavedQueryEngine, ISearchEngine, ISignCertEngine, ITSAEngine, ITaskEngine, ITreeEngine, IUploadFileEngine, IUserEngine, IWorkflowEngine, IWorkingGroupEngine, IRelationEngine, IDeleteEngine, IUpdateEngineByID, IArchiveEngineByID, IDcmtPlatformEngine, IADMEngine, INumeratorEngine, IReportEngine, ISignServerEngine, ILDAPEngine, IGroupEngine, ISAPEngine, IPermissionEngine } from "./Engine";
|
|
3
|
+
import { ITopMediaServer } from "./TopMediaServer";
|
|
4
|
+
import { TopMediaServiceClient, SessionDescriptor, AppModules } from "./openAPIs/TopMediaServiceClient";
|
|
5
|
+
import { TopMediaServiceClientEx } from "./TopMediaServiceClientEx";
|
|
6
|
+
export interface ITopMediaSession {
|
|
7
|
+
/**Se impostato a true, aggiorna automaticamente la sessione.
|
|
8
|
+
* Se non viene impostato AutoRefreshInterval, la sessione viene aggiornata ogni 5 minuti */
|
|
9
|
+
AutoRefresh: boolean | undefined;
|
|
10
|
+
/** Intervallo espresso in minuti che indica ogni quanto deve essere aggiornata la sessione (default 5 minuti) */
|
|
11
|
+
AutoRefreshInterval: number;
|
|
12
|
+
SessionDescr: SessionDescriptor | undefined;
|
|
13
|
+
TopMediaServer: ITopMediaServer;
|
|
14
|
+
TMSClient: TopMediaServiceClient | undefined;
|
|
15
|
+
TMSClientEx: TopMediaServiceClientEx | undefined;
|
|
16
|
+
LoginAsync(sd: SessionDescriptor, useGlobals?: boolean): Promise<void>;
|
|
17
|
+
LoginToAsync(toAppModule: AppModules): Promise<SessionDescriptor | undefined>;
|
|
18
|
+
LogoutAsync(useGlobals?: boolean): Promise<void>;
|
|
19
|
+
RefreshAsync(): Promise<number | undefined>;
|
|
20
|
+
NewADMEngine(): IADMEngine;
|
|
21
|
+
NewArchiveEngine(): IArchiveEngine;
|
|
22
|
+
NewArchiveEngineByID(): IArchiveEngineByID;
|
|
23
|
+
NewAreaEngine(): IAreaEngine;
|
|
24
|
+
NewBasketEngine(): IBasketEngine;
|
|
25
|
+
NewBasketTypeEngine(): IBasketTypeEngine;
|
|
26
|
+
NewDataListEngine(): IDataListEngine;
|
|
27
|
+
NewDcmtPlatformEngine(): IDcmtPlatformEngine;
|
|
28
|
+
NewDcmtTypeEngine(): IDcmtTypeEngine;
|
|
29
|
+
NewDeleteEngine(): IDeleteEngine;
|
|
30
|
+
NewDiskEngine(): IDiskEngine;
|
|
31
|
+
NewDossierEngine(): IDossierEngine;
|
|
32
|
+
NewFavoritesEngine(): IFavoritesEngine;
|
|
33
|
+
NewGroupEngine(): IGroupEngine;
|
|
34
|
+
NewHomePageEngine(): IHomePageEngine;
|
|
35
|
+
NewJobEngine(): IJobEngine;
|
|
36
|
+
NewLDAPEngine(): ILDAPEngine;
|
|
37
|
+
NewLicenseEngine(): ILicenseEngine;
|
|
38
|
+
NewNotificationEngine(): INotificationEngine;
|
|
39
|
+
NewNumeratorEngine(): INumeratorEngine;
|
|
40
|
+
NewOrchPlatformEngine(): IOrchPlatformEngine;
|
|
41
|
+
NewPermissionEngine(): IPermissionEngine;
|
|
42
|
+
NewPreviewEngine(): IPreviewEngine;
|
|
43
|
+
NewProcessEngine(): IProcessEngine;
|
|
44
|
+
NewRecentEngine(): IRecentEngine;
|
|
45
|
+
NewRelationEngine(): IRelationEngine;
|
|
46
|
+
NewReportEngine(): IReportEngine;
|
|
47
|
+
NewSAPEngine(): ISAPEngine;
|
|
48
|
+
NewSavedQueryEngine(): ISavedQueryEngine;
|
|
49
|
+
NewSearchEngine(): ISearchEngine;
|
|
50
|
+
NewSignCertEngine(): ISignCertEngine;
|
|
51
|
+
NewSignServerEngine(): ISignServerEngine;
|
|
52
|
+
NewTaskEngine(): ITaskEngine;
|
|
53
|
+
NewTreeEngine(): ITreeEngine;
|
|
54
|
+
NewTSAEngine(): ITSAEngine;
|
|
55
|
+
NewUpdateEngineByID(): IUpdateEngineByID;
|
|
56
|
+
NewUploadFileEngine(): IUploadFileEngine;
|
|
57
|
+
NewUserEngine(): IUserEngine;
|
|
58
|
+
NewWorkflowEngine(): IWorkflowEngine;
|
|
59
|
+
NewWorkingGroupEngine(): IWorkingGroupEngine;
|
|
60
|
+
}
|
|
61
|
+
export declare class TopMediaSession implements ITopMediaSession {
|
|
62
|
+
constructor(tmSrv: ITopMediaServer);
|
|
63
|
+
SessionDescr: SessionDescriptor | undefined;
|
|
64
|
+
get TMSClient(): TopMediaServiceClient | undefined;
|
|
65
|
+
get TMSClientEx(): TopMediaServiceClientEx | undefined;
|
|
66
|
+
TopMediaServer: ITopMediaServer;
|
|
67
|
+
private _autoRefreshInterval;
|
|
68
|
+
get AutoRefreshInterval(): number;
|
|
69
|
+
set AutoRefreshInterval(autoRefreshInterval: number);
|
|
70
|
+
private _refreshTimer;
|
|
71
|
+
private _autoRefresh;
|
|
72
|
+
get AutoRefresh(): boolean | undefined;
|
|
73
|
+
set AutoRefresh(autoRefresh: boolean | undefined);
|
|
74
|
+
IsLogged(): boolean;
|
|
75
|
+
CheckIsLogged(): void;
|
|
76
|
+
_loginRequest: PopupRequest;
|
|
77
|
+
_accountId: string;
|
|
78
|
+
_msalInstance: PublicClientApplication | null | undefined;
|
|
79
|
+
LoginAsync(sd: SessionDescriptor, useGlobals?: boolean): Promise<void>;
|
|
80
|
+
LoginToAsync(toAppModule: AppModules): Promise<SessionDescriptor | undefined>;
|
|
81
|
+
private _azureLogout;
|
|
82
|
+
LogoutAsync(useGlobals?: boolean): Promise<void>;
|
|
83
|
+
RefreshAsync(): Promise<number | undefined>;
|
|
84
|
+
NewADMEngine(): IADMEngine;
|
|
85
|
+
NewArchiveEngine(): IArchiveEngine;
|
|
86
|
+
NewArchiveEngineByID(): IArchiveEngineByID;
|
|
87
|
+
NewAreaEngine(): IAreaEngine;
|
|
88
|
+
NewBasketEngine(): IBasketEngine;
|
|
89
|
+
NewBasketTypeEngine(): IBasketTypeEngine;
|
|
90
|
+
NewDataListEngine(): IDataListEngine;
|
|
91
|
+
NewDcmtPlatformEngine(): IDcmtPlatformEngine;
|
|
92
|
+
NewDcmtTypeEngine(): IDcmtTypeEngine;
|
|
93
|
+
NewDeleteEngine(): IDeleteEngine;
|
|
94
|
+
NewDiskEngine(): IDiskEngine;
|
|
95
|
+
NewDossierEngine(): IDossierEngine;
|
|
96
|
+
NewFavoritesEngine(): IFavoritesEngine;
|
|
97
|
+
NewGroupEngine(): IGroupEngine;
|
|
98
|
+
NewHomePageEngine(): IHomePageEngine;
|
|
99
|
+
NewJobEngine(): IJobEngine;
|
|
100
|
+
NewLDAPEngine(): ILDAPEngine;
|
|
101
|
+
NewLicenseEngine(): ILicenseEngine;
|
|
102
|
+
NewNotificationEngine(): INotificationEngine;
|
|
103
|
+
NewNumeratorEngine(): INumeratorEngine;
|
|
104
|
+
NewOrchPlatformEngine(): IOrchPlatformEngine;
|
|
105
|
+
NewPermissionEngine(): IPermissionEngine;
|
|
106
|
+
NewPreviewEngine(): IPreviewEngine;
|
|
107
|
+
NewProcessEngine(): IProcessEngine;
|
|
108
|
+
NewRecentEngine(): IRecentEngine;
|
|
109
|
+
NewRelationEngine(): IRelationEngine;
|
|
110
|
+
NewReportEngine(): IReportEngine;
|
|
111
|
+
NewSAPEngine(): ISAPEngine;
|
|
112
|
+
NewSavedQueryEngine(): ISavedQueryEngine;
|
|
113
|
+
NewSearchEngine(): ISearchEngine;
|
|
114
|
+
NewSignCertEngine(): ISignCertEngine;
|
|
115
|
+
NewSignServerEngine(): ISignServerEngine;
|
|
116
|
+
NewTaskEngine(): ITaskEngine;
|
|
117
|
+
NewTreeEngine(): ITreeEngine;
|
|
118
|
+
NewTSAEngine(): ITSAEngine;
|
|
119
|
+
NewUpdateEngineByID(): IUpdateEngineByID;
|
|
120
|
+
NewUploadFileEngine(): IUploadFileEngine;
|
|
121
|
+
NewUserEngine(): IUserEngine;
|
|
122
|
+
NewWorkflowEngine(): IWorkflowEngine;
|
|
123
|
+
NewWorkingGroupEngine(): IWorkingGroupEngine;
|
|
124
|
+
}
|
|
@@ -16,7 +16,10 @@ export class TopMediaSession {
|
|
|
16
16
|
constructor(tmSrv) {
|
|
17
17
|
this._autoRefreshInterval = 5;
|
|
18
18
|
this._loginRequest = {
|
|
19
|
-
scopes: ["User.Read"]
|
|
19
|
+
scopes: ["User.Read"],
|
|
20
|
+
popupWindowAttributes: {
|
|
21
|
+
popupSize: { width: 600, height: 700 }
|
|
22
|
+
}
|
|
20
23
|
};
|
|
21
24
|
this._accountId = "";
|
|
22
25
|
this.TopMediaServer = tmSrv;
|
|
@@ -62,18 +65,16 @@ export class TopMediaSession {
|
|
|
62
65
|
throw new Error(`MsAzureTenantID not configured (ArchiveID = ${sd.archiveID})`);
|
|
63
66
|
if (!(ad === null || ad === void 0 ? void 0 : ad.msAzureClientID))
|
|
64
67
|
throw new Error(`MsAzureClientID not configured (ArchiveID = ${sd.archiveID})`);
|
|
68
|
+
console.log("MSAzure window.location.origin: " + window.location.origin);
|
|
65
69
|
this._msalInstance = new PublicClientApplication({
|
|
66
70
|
auth: {
|
|
67
71
|
clientId: ad === null || ad === void 0 ? void 0 : ad.msAzureClientID,
|
|
68
72
|
authority: "https://login.microsoftonline.com/" + (ad === null || ad === void 0 ? void 0 : ad.msAzureTenantID),
|
|
69
|
-
redirectUri:
|
|
73
|
+
redirectUri: window.location.origin
|
|
70
74
|
},
|
|
71
75
|
cache: {
|
|
72
76
|
cacheLocation: 'sessionStorage',
|
|
73
77
|
storeAuthStateInCookie: false,
|
|
74
|
-
},
|
|
75
|
-
system: {
|
|
76
|
-
allowNativeBroker: false
|
|
77
78
|
}
|
|
78
79
|
});
|
|
79
80
|
yield this._msalInstance.initialize();
|
|
@@ -99,8 +100,7 @@ export class TopMediaSession {
|
|
|
99
100
|
_azureLogout() {
|
|
100
101
|
return __awaiter(this, void 0, void 0, function* () {
|
|
101
102
|
if (this._msalInstance) {
|
|
102
|
-
|
|
103
|
-
yield this._msalInstance.logoutPopup({ account: currentAccount });
|
|
103
|
+
yield this._msalInstance.logoutPopup();
|
|
104
104
|
this._msalInstance = null;
|
|
105
105
|
}
|
|
106
106
|
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare class LocalStorageService {
|
|
2
|
+
static setItem<T extends string | number | Record<string, any>>(key: string, value: T): void;
|
|
3
|
+
static getItem<T extends Record<string, any> | string>(key: string): T | null;
|
|
4
|
+
static updateItem<T extends Record<string, any>>(key: string, value: T): void;
|
|
5
|
+
static deleteItem(key: string): void;
|
|
6
|
+
static clear(): void;
|
|
7
|
+
static findItemByField<T extends Record<string, any>>(key: string, field: keyof T, value: any): T | null;
|
|
8
|
+
static deleteItemByField<T extends Record<string, any>>(key: string, field: keyof T, value: any): void;
|
|
9
|
+
static updateItemByField<T extends Record<string, any>>(key: string, field: keyof T, value: any, newData: Partial<T>): void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { DcmtTypeDescriptor, QueryDescriptor, QueryOperators, WhereItem } from "../openAPIs/TopMediaServiceClient";
|
|
2
|
+
export declare enum ResultTypes {
|
|
3
|
+
NONE = "None",
|
|
4
|
+
SUCCESS = "Success",
|
|
5
|
+
WARNING = "Warning",
|
|
6
|
+
ERROR = "Error",
|
|
7
|
+
INFO = "Info"
|
|
8
|
+
}
|
|
9
|
+
export declare class QueryValidatorOptions {
|
|
10
|
+
DoSelectValidation: boolean;
|
|
11
|
+
DoOrderByValidation: boolean;
|
|
12
|
+
DoWhereHasItemsValidation: boolean;
|
|
13
|
+
PropertyName: string;
|
|
14
|
+
RaiseWarningForOnlyMetadataDcmtTypes: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare class ValidationItem {
|
|
17
|
+
ResultType: ResultTypes;
|
|
18
|
+
Message: string;
|
|
19
|
+
PropertyName: string;
|
|
20
|
+
PropertyScopes: string[];
|
|
21
|
+
constructor(resultType: ResultTypes, propertyName: string, message: string, propertyScopes?: string[]);
|
|
22
|
+
}
|
|
23
|
+
export declare class PlatformObjectValidator {
|
|
24
|
+
static StringIsNullOrEmpty(value: string | undefined): boolean;
|
|
25
|
+
static StringIsNullOrWhiteSpace(value: string | undefined): boolean;
|
|
26
|
+
static GetInvalidFileNameChars(): string[];
|
|
27
|
+
static IsValidObjectName(name: string | null | undefined): boolean;
|
|
28
|
+
static GetTIDByQd(qd?: QueryDescriptor): number;
|
|
29
|
+
static ObjectNameValidator(propertyValue: string | null | undefined, propertyName: string, vl: ValidationItem[], localizedPropertyCaption: string): void;
|
|
30
|
+
static RequiredObjectValidator(propertyValue: object | null | undefined, propertyName: string, vl: ValidationItem[], localizedPropertyCaption: string, showPropertyName?: boolean): void;
|
|
31
|
+
static RequiredStrictlyPositiveNumberValidator(propertyValue: number | undefined, propertyName: string, vl: ValidationItem[], localizedPropertyCaption: string, showPropertyName?: boolean): void;
|
|
32
|
+
static RequiredStrictlyPositiveNumberValidator_RequiredField(propertyValue: number | undefined, propertyName: string, vl: ValidationItem[], localizedPropertyCaption: string, showPropertyName?: boolean): void;
|
|
33
|
+
static RequiredStrictlyPositiveNumberValidator_ValueNotAllowed(propertyValue: number | undefined, propertyName: string, vl: ValidationItem[], localizedPropertyCaption: string, showPropertyName?: boolean): void;
|
|
34
|
+
static RequiredNotEqualZeroNumberValidator(propertyValue: number | undefined, propertyName: string, vl: ValidationItem[], localizedPropertyCaption: string, showPropertyName?: boolean): void;
|
|
35
|
+
static RequiredNotEqualZeroNumberValidator_RequiredField(propertyValue: number | undefined, propertyName: string, vl: ValidationItem[], localizedPropertyCaption: string, showPropertyName?: boolean): void;
|
|
36
|
+
static RequiredNotEqualZeroNumberValidator_ValueNotAllowed(propertyValue: number | undefined, propertyName: string, vl: ValidationItem[], localizedPropertyCaption: string, showPropertyName?: boolean): void;
|
|
37
|
+
static RequiredNotNoneValueValidator(propertyValue: string | undefined, propertyName: string, vl: ValidationItem[], localizedPropertyCaption: string, showPropertyName?: boolean): void;
|
|
38
|
+
static RequiredStringValidator(propertyValue: string | null | undefined, propertyName: string, vl: ValidationItem[], localizedPropertyCaption: string, showPropertyName?: boolean): void;
|
|
39
|
+
static RequiredStringWithValidSpacesValidator(propertyValue: string | null | undefined, propertyName: string, vl: ValidationItem[], localizedPropertyCaption: string, showPropertyName?: boolean): void;
|
|
40
|
+
static GetNumberOfOperands(qo?: QueryOperators): 0 | 1 | 2 | 12 | 11 | 99;
|
|
41
|
+
static WhereItemHasValues(wi: WhereItem): boolean;
|
|
42
|
+
static QueryValidatorAsync(qdNew: QueryDescriptor | undefined, vl: ValidationItem[], qvo: QueryValidatorOptions, showPropertyName?: boolean): Promise<DcmtTypeDescriptor | undefined>;
|
|
43
|
+
}
|
|
@@ -307,4 +307,45 @@ export class PlatformObjectValidator {
|
|
|
307
307
|
return dtdFrom;
|
|
308
308
|
});
|
|
309
309
|
}
|
|
310
|
+
static DataListValidator(d) {
|
|
311
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
312
|
+
var _a;
|
|
313
|
+
let vil = [];
|
|
314
|
+
this.ObjectNameValidator(d.name, TMPropertyNames.entityName, vil, TMPropertyNames.entityName);
|
|
315
|
+
this.RequiredObjectValidator(d.items, TMPropertyNames.items, vil, '');
|
|
316
|
+
if (d.items) {
|
|
317
|
+
if (d.items.length == 0)
|
|
318
|
+
this.RequiredNotEqualZeroNumberValidator_RequiredField((_a = d.items) === null || _a === void 0 ? void 0 : _a.length, TMPropertyNames.items, vil, '');
|
|
319
|
+
else {
|
|
320
|
+
let viList;
|
|
321
|
+
let i = 0;
|
|
322
|
+
for (let aid of d.items) {
|
|
323
|
+
i++;
|
|
324
|
+
viList = [];
|
|
325
|
+
yield this.DataListItemValidator(aid, viList, true);
|
|
326
|
+
for (let vi of viList) {
|
|
327
|
+
vil.push(new ValidationItem(vi.ResultType, vi.PropertyName, `${SDK_Localizator.DataListItem} #${i} - ${vi.Message}`));
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
for (let curdlid of d.items) {
|
|
331
|
+
let v = d.items.filter(i => i.value == curdlid.value);
|
|
332
|
+
if (v.length > 1) {
|
|
333
|
+
vil.push(new ValidationItem(ResultTypes.ERROR, "items", `Esistono più elementi della lista dati con valore ${v[0].value}`));
|
|
334
|
+
break;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
return vil;
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
static DataListItemValidator(dlid_1, vil_1) {
|
|
343
|
+
return __awaiter(this, arguments, void 0, function* (dlid, vil, showPropertyName = false) {
|
|
344
|
+
this.RequiredStringValidator(dlid.value, TMPropertyNames.value, vil, '');
|
|
345
|
+
if (!dlid.name) {
|
|
346
|
+
vil.push(new ValidationItem(ResultTypes.ERROR, "itemName", SDK_Localizator.RequiredField));
|
|
347
|
+
return;
|
|
348
|
+
}
|
|
349
|
+
});
|
|
350
|
+
}
|
|
310
351
|
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { ITopMediaSession } from "../TopMediaSession";
|
|
2
|
+
import { DataListDescriptor, DcmtTypeDescriptor, QueryDescriptor, RelationDescriptor, SavedQueryDescriptor, SearchResultDescriptor, SignCertDescriptor, TSADescriptor, TreeDescriptor, UserDescriptor, WFDescriptor, WorkingGroupDescriptor } from "../openAPIs/TopMediaServiceClient";
|
|
3
|
+
export declare class DataListCacheService {
|
|
4
|
+
private static readonly _mutex;
|
|
5
|
+
private static readonly _cacheAll;
|
|
6
|
+
private static readonly _cache;
|
|
7
|
+
static GetAllAsync(tmSession?: ITopMediaSession | undefined, deepCopy?: boolean): Promise<DataListDescriptor[]>;
|
|
8
|
+
static GetAsync(id: number | undefined, tmSession?: ITopMediaSession | undefined, deepCopy?: boolean): Promise<DataListDescriptor | undefined>;
|
|
9
|
+
static RemoveAll(tmSession?: ITopMediaSession | undefined): void;
|
|
10
|
+
static Remove(tmSession?: ITopMediaSession | undefined): void;
|
|
11
|
+
}
|
|
12
|
+
export interface DcmtTypeCacheEventArgs {
|
|
13
|
+
count: number;
|
|
14
|
+
accessToken: string;
|
|
15
|
+
timestamp: Date;
|
|
16
|
+
}
|
|
17
|
+
export declare class DcmtTypeListCacheService {
|
|
18
|
+
private static readonly _mutex;
|
|
19
|
+
private static _onCacheRefreshed?;
|
|
20
|
+
static get onCacheRefreshed(): ((args: DcmtTypeCacheEventArgs) => void) | undefined;
|
|
21
|
+
static set onCacheRefreshed(value: ((args: DcmtTypeCacheEventArgs) => void) | undefined);
|
|
22
|
+
private static readonly _cacheWithoutMetadata;
|
|
23
|
+
/** Restituisce la cache di tutti i tipi documento SENZA metadati.
|
|
24
|
+
* Se deepCopy = true restituisce una copia della cache */
|
|
25
|
+
static GetAllWithoutMetadataAsync(tmSession?: ITopMediaSession | undefined, deepCopy?: boolean): Promise<DcmtTypeDescriptor[]>;
|
|
26
|
+
static RemoveAllWithoutMetadata(tmSession?: ITopMediaSession | undefined): void;
|
|
27
|
+
private static readonly _cacheWithMetadata;
|
|
28
|
+
/** Restituisce il tipo documento (tid).
|
|
29
|
+
* Se withMetadata = true, restituisce anche i metadati.
|
|
30
|
+
* Se deepCopy = true restituisce una copia */
|
|
31
|
+
static GetAsync(tid: number | undefined, withMetadata?: boolean, tmSession?: ITopMediaSession | undefined, deepCopy?: boolean, refreshCache?: boolean): Promise<DcmtTypeDescriptor | undefined>;
|
|
32
|
+
/** Restituisce il tipo documento (tid).
|
|
33
|
+
* Se NON autorizzato esegue la GetMetadata(tid,did) per farsi dare le info sul tipo documento.
|
|
34
|
+
* Se withMetadata = true, restituisce anche i metadati.
|
|
35
|
+
* Se deepCopy = true restituisce una copia */
|
|
36
|
+
static GetWithNotGrantedAsync(tid: number | undefined, did: number | undefined, getMetadataResult?: SearchResultDescriptor | undefined, withMetadata?: boolean, tmSession?: ITopMediaSession | undefined, deepCopy?: boolean, refreshCache?: boolean): Promise<DcmtTypeDescriptor | undefined>;
|
|
37
|
+
static RemoveAllWithMetadata(tmSession?: ITopMediaSession | undefined): void;
|
|
38
|
+
private static RemoveWithMetadata;
|
|
39
|
+
/** Restituisce i tipi documento (CON metadati) referenziati da qd.
|
|
40
|
+
* Se deepCopy = true restituisce una copia */
|
|
41
|
+
static GetFromQdAsync(qd: QueryDescriptor | undefined, tmSession?: ITopMediaSession | undefined, deepCopy?: boolean, refreshCache?: boolean): Promise<DcmtTypeDescriptor[]>;
|
|
42
|
+
/** Restituisce i tipi documento tids.
|
|
43
|
+
* Se withMetadata = true, restituisce anche i metadati.
|
|
44
|
+
* Se deepCopy = true restituisce una copia */
|
|
45
|
+
static GetFromTIDsAsync(tids: number[] | undefined, withMetadata?: boolean, tmSession?: ITopMediaSession | undefined, deepCopy?: boolean, refreshCache?: boolean): Promise<DcmtTypeDescriptor[]>;
|
|
46
|
+
static GetCache(cacheWithoutMetadata: boolean): Map<string, DcmtTypeDescriptor[]>;
|
|
47
|
+
static CacheCount(cacheWithoutMetadata: boolean, tmSession?: ITopMediaSession | undefined): number;
|
|
48
|
+
}
|
|
49
|
+
export declare class RelationCacheService {
|
|
50
|
+
private static readonly _mutex;
|
|
51
|
+
private static readonly _cacheAllRelation;
|
|
52
|
+
static GetAllAsync(tmSession?: ITopMediaSession | undefined, deepCopy?: boolean, refreshCache?: boolean): Promise<RelationDescriptor[]>;
|
|
53
|
+
static RemoveAll(tmSession?: ITopMediaSession | undefined): void;
|
|
54
|
+
static CacheAllCount(tmSession?: ITopMediaSession | undefined): number;
|
|
55
|
+
}
|
|
56
|
+
export declare class SavedQueryCacheService {
|
|
57
|
+
private static _mutex;
|
|
58
|
+
private static _cacheAll;
|
|
59
|
+
private static _cache;
|
|
60
|
+
static GetAllAsync(tmSession?: ITopMediaSession | undefined, deepCopy?: boolean): Promise<SavedQueryDescriptor[]>;
|
|
61
|
+
static GetAsync(id: number | undefined, tmSession?: ITopMediaSession | undefined, deepCopy?: boolean): Promise<SavedQueryDescriptor | undefined>;
|
|
62
|
+
static RemoveAll(tmSession?: ITopMediaSession | undefined): void;
|
|
63
|
+
static Remove(tmSession?: ITopMediaSession | undefined): void;
|
|
64
|
+
static CacheAllCount(tmSession?: ITopMediaSession | undefined): number;
|
|
65
|
+
}
|
|
66
|
+
export declare class WorkingGroupCacheService {
|
|
67
|
+
private static readonly _mutex;
|
|
68
|
+
private static readonly _cacheAll;
|
|
69
|
+
private static readonly _cache;
|
|
70
|
+
private static getAccessToken;
|
|
71
|
+
static GetAllAsync(tmSession?: ITopMediaSession, deepCopy?: boolean): Promise<WorkingGroupDescriptor[]>;
|
|
72
|
+
static GetAsync(id?: number, tmSession?: ITopMediaSession, deepCopy?: boolean): Promise<WorkingGroupDescriptor | undefined>;
|
|
73
|
+
static RemoveAll(tmSession?: ITopMediaSession): void;
|
|
74
|
+
static Remove(tmSession?: ITopMediaSession): void;
|
|
75
|
+
static CacheAllCount(tmSession?: ITopMediaSession): number;
|
|
76
|
+
/** Thread-safe execution wrapper using mutex */
|
|
77
|
+
private static withLock;
|
|
78
|
+
/** Deep copy helper */
|
|
79
|
+
private static cloneItems;
|
|
80
|
+
private static cloneItem;
|
|
81
|
+
}
|
|
82
|
+
export declare class WorkflowCacheService {
|
|
83
|
+
private static readonly _mutex;
|
|
84
|
+
private static readonly _cache;
|
|
85
|
+
static GetWFInfoAsync(VID: number | undefined, tmSession?: ITopMediaSession | undefined, deepCopy?: boolean): Promise<WFDescriptor | undefined>;
|
|
86
|
+
static RemoveWFInfo(tmSession?: ITopMediaSession | undefined): void;
|
|
87
|
+
static CacheCount(tmSession?: ITopMediaSession | undefined): number;
|
|
88
|
+
}
|
|
89
|
+
export declare class SignCertCacheService {
|
|
90
|
+
private static _mutex;
|
|
91
|
+
private static _cacheAll;
|
|
92
|
+
private static _cache;
|
|
93
|
+
static GetAllAsync(tmSession?: ITopMediaSession | undefined, deepCopy?: boolean): Promise<SignCertDescriptor[]>;
|
|
94
|
+
static GetAsync(id: number | undefined, tmSession?: ITopMediaSession | undefined, deepCopy?: boolean): Promise<SignCertDescriptor | undefined>;
|
|
95
|
+
static RemoveAll(tmSession?: ITopMediaSession | undefined): void;
|
|
96
|
+
static Remove(tmSession?: ITopMediaSession | undefined): void;
|
|
97
|
+
}
|
|
98
|
+
export declare class TreeCacheService {
|
|
99
|
+
private static _mutex;
|
|
100
|
+
private static _cacheAllSearch;
|
|
101
|
+
private static _cacheAllArchive;
|
|
102
|
+
static GetAllSearchAsync(tmSession?: ITopMediaSession | undefined, deepCopy?: boolean): Promise<TreeDescriptor[]>;
|
|
103
|
+
static GetAllArchiveAsync(tmSession?: ITopMediaSession | undefined, deepCopy?: boolean): Promise<TreeDescriptor[]>;
|
|
104
|
+
static RemoveAllSearch(tmSession?: ITopMediaSession | undefined): void;
|
|
105
|
+
static RemoveAllArchive(tmSession?: ITopMediaSession | undefined): void;
|
|
106
|
+
static CacheAllSearchCount(tmSession?: ITopMediaSession | undefined): number;
|
|
107
|
+
static CacheAllArchiveCount(tmSession?: ITopMediaSession | undefined): number;
|
|
108
|
+
}
|
|
109
|
+
export declare class TSACacheService {
|
|
110
|
+
private static _mutex;
|
|
111
|
+
private static _cacheAll;
|
|
112
|
+
private static _cache;
|
|
113
|
+
static GetAllAsync(tmSession?: ITopMediaSession | undefined, deepCopy?: boolean): Promise<TSADescriptor[]>;
|
|
114
|
+
static GetAsync(id: number | undefined, tmSession?: ITopMediaSession | undefined, deepCopy?: boolean): Promise<TSADescriptor | undefined>;
|
|
115
|
+
static RemoveAll(tmSession?: ITopMediaSession | undefined): void;
|
|
116
|
+
static Remove(tmSession?: ITopMediaSession | undefined): void;
|
|
117
|
+
}
|
|
118
|
+
export declare class UserListCacheService {
|
|
119
|
+
private static _mutex;
|
|
120
|
+
private static _cache;
|
|
121
|
+
static GetAllAsync(tmSession?: ITopMediaSession | undefined, deepCopy?: boolean): Promise<UserDescriptor[]>;
|
|
122
|
+
static GetAsync(userId: number | undefined, tmSession?: ITopMediaSession | undefined, deepCopy?: boolean): Promise<UserDescriptor | undefined>;
|
|
123
|
+
static RemoveAll(tmSession?: ITopMediaSession | undefined): void;
|
|
124
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ITopMediaSession } from "../TopMediaSession";
|
|
2
|
+
import { AppModules, DBBrands, LicenseDescriptor, SearchResultDescriptor } from "../openAPIs/TopMediaServiceClient";
|
|
3
|
+
export declare class SDK_Globals {
|
|
4
|
+
private static _tmSession;
|
|
5
|
+
private static _appModule;
|
|
6
|
+
private static _appVersion;
|
|
7
|
+
private static _sdkVersion;
|
|
8
|
+
private static _sdkuiVersion;
|
|
9
|
+
private static _sdkName;
|
|
10
|
+
private static _sdkuiName;
|
|
11
|
+
private static _websdkVersion;
|
|
12
|
+
private static _useLocalizedName;
|
|
13
|
+
private static _dbBrand;
|
|
14
|
+
private static _license;
|
|
15
|
+
static get tmSession(): ITopMediaSession | undefined;
|
|
16
|
+
static set tmSession(theTmSession: ITopMediaSession | undefined);
|
|
17
|
+
static get appModule(): AppModules | undefined;
|
|
18
|
+
static set appModule(theAppModule: AppModules | undefined);
|
|
19
|
+
static get appVersion(): string | undefined;
|
|
20
|
+
static set appVersion(theAppVersion: string | undefined);
|
|
21
|
+
static get dbBrand(): DBBrands;
|
|
22
|
+
static get sdkVersion(): string | undefined;
|
|
23
|
+
static set sdkVersion(theSdkVersion: string | undefined);
|
|
24
|
+
static get sdkuiVersion(): string | undefined;
|
|
25
|
+
static set sdkuiVersion(theSdkuiVersion: string | undefined);
|
|
26
|
+
static get sdkName(): string | undefined;
|
|
27
|
+
static set sdkName(theSdkName: string | undefined);
|
|
28
|
+
static get sdkuiName(): string | undefined;
|
|
29
|
+
static set sdkuiName(theSdkuiName: string | undefined);
|
|
30
|
+
static get websdkVersion(): string | undefined;
|
|
31
|
+
static get useLocalizedName(): boolean;
|
|
32
|
+
static set useLocalizedName(theUseLocalizedName: boolean);
|
|
33
|
+
static get license(): LicenseDescriptor | undefined;
|
|
34
|
+
static set license(theLicense: LicenseDescriptor | undefined);
|
|
35
|
+
static currentWorkflowApproveData: SearchResultDescriptor[];
|
|
36
|
+
}
|