@pilotdev/pilot-web-sdk 25.4.0 → 25.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/esm2022/lib/data/cades-type.mjs +13 -0
  2. package/esm2022/lib/data/data-object.mjs +1 -1
  3. package/esm2022/lib/data/file.mjs +1 -1
  4. package/esm2022/lib/data/index.mjs +3 -2
  5. package/esm2022/lib/data/signature-custom-state.mjs +2 -0
  6. package/esm2022/lib/data/signature-verification-result.mjs +1 -1
  7. package/esm2022/lib/data/signature-verification-status.mjs +4 -3
  8. package/esm2022/lib/icrypto-provider.mjs +95 -2
  9. package/esm2022/lib/idata.plugin.mjs +11 -2
  10. package/esm2022/lib/menu/menu.mjs +2 -1
  11. package/esm2022/lib/modifier/signature-modifier.mjs +1 -1
  12. package/esm2022/lib/object-card/object-card-handler.mjs +2 -1
  13. package/esm2022/lib/openspace/openspace-view.mjs +2 -1
  14. package/esm2022/lib/page-navigation/page-navigation.mjs +2 -1
  15. package/esm2022/lib/personal-settings/system-settings-keys.mjs +6 -2
  16. package/esm2022/lib/tabs/tabs.mjs +2 -1
  17. package/esm2022/lib/toolbar/toolbar.mjs +2 -1
  18. package/esm2022/public-api.mjs +1 -1
  19. package/extensions.config.schema.json +164 -0
  20. package/fesm2022/pilotdev-pilot-web-sdk.mjs +133 -12
  21. package/fesm2022/pilotdev-pilot-web-sdk.mjs.map +1 -1
  22. package/lib/data/cades-type.d.ts +11 -0
  23. package/lib/data/data-object.d.ts +1 -0
  24. package/lib/data/file.d.ts +4 -0
  25. package/lib/data/index.d.ts +2 -1
  26. package/lib/data/signature-custom-state.d.ts +23 -0
  27. package/lib/data/signature-verification-result.d.ts +14 -1
  28. package/lib/data/signature-verification-status.d.ts +3 -2
  29. package/lib/icrypto-provider.d.ts +35 -10
  30. package/lib/idata.plugin.d.ts +5 -1
  31. package/lib/menu/menu.d.ts +3 -1
  32. package/lib/modifier/signature-modifier.d.ts +22 -1
  33. package/lib/object-card/object-card-handler.d.ts +1 -0
  34. package/lib/openspace/openspace-view.d.ts +3 -1
  35. package/lib/page-navigation/page-navigation.d.ts +1 -0
  36. package/lib/personal-settings/system-settings-keys.d.ts +5 -1
  37. package/lib/tabs/tabs.d.ts +3 -1
  38. package/lib/toolbar/toolbar.d.ts +3 -1
  39. package/package.json +1 -1
  40. package/esm2022/lib/data/signature-type.mjs +0 -9
  41. package/lib/data/signature-type.d.ts +0 -7
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Sets for signature the custom icon and title to the tooltip
3
+ * @interface ISignatureCustomState
4
+ *
5
+ * @property { string } icon - base64 string
6
+ * @property { string } iconName - unique icon name with prefix of the plugin name `${unique_prefix}-${icon_name}`
7
+ * @property { string } title - tooltip title
8
+ * @property { string } description - tooltip description
9
+ *
10
+ * @example
11
+ * const customState: ISignatureCustomState = {
12
+ * icon: 'data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCAxNiAxNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+DQogIC5zdC1yZWR7ZmlsbDogI2ZmYjgyOTt9DQogIC5zdC13aGl0ZXtmaWxsOiNmZmZmZmY7fQ0KPC9zdHlsZT4NCjxjaXJjbGUgY2xhc3M9InN0LXJlZCIgY3g9IjgiIGN5PSI4IiByPSI3Ii8+DQo8cGF0aCBjbGFzcz0ic3Qtd2hpdGUiIGQ9Im01LjcwNyA0LjI5My0xLjQxNDEgMS40MTQxIDIuMjkzIDIuMjkzLTIuMjkzIDIuMjkzIDEuNDE0MSAxLjQxNDEgMi4yOTMtMi4yOTMgMi4yOTMgMi4yOTMgMS40MTQxLTEuNDE0MS0yLjI5My0yLjI5MyAyLjI5My0yLjI5My0xLjQxNDEtMS40MTQxLTIuMjkzIDIuMjkzLTIuMjkzLTIuMjkzeiIvPg0KPC9zdmc+DQo=',
13
+ * iconName: 'cryptoprovider_custom-error',
14
+ * title: 'Custom state error',
15
+ * description: 'Custom state error was thrown',
16
+ * };
17
+ */
18
+ export interface ISignatureCustomState {
19
+ icon: string;
20
+ iconName: string;
21
+ title: string;
22
+ description: string;
23
+ }
@@ -1,5 +1,18 @@
1
1
  import { SignatureVerificationStatus } from "./signature-verification-status";
2
- export interface ISignatureVerificationResult {
2
+ import { ISignatureCustomState } from "./signature-custom-state";
3
+ import { CadesType } from "./cades-type";
4
+ export interface ISignatureVerificationResultBase {
3
5
  verificationStatus: SignatureVerificationStatus;
4
6
  error?: string;
7
+ signerName?: string;
8
+ }
9
+ export interface ISignatureVerificationResult extends ISignatureVerificationResultBase {
10
+ issuerName?: string;
11
+ signDate?: string;
12
+ customState?: ISignatureCustomState;
13
+ signerNameForeground?: string;
14
+ }
15
+ export interface IImportedSignatureVerificationResult extends ISignatureVerificationResultBase {
16
+ publicKeyOid: string;
17
+ cadesType: CadesType;
5
18
  }
@@ -3,6 +3,7 @@ export declare enum SignatureVerificationStatus {
3
3
  Valid = 1,
4
4
  ValidWithWarnings = 2,
5
5
  CannotBeChecked = 3,
6
- Invalid = 4,
7
- Error = 5
6
+ Duplicate = 4,
7
+ Invalid = 5,
8
+ Error = 6
8
9
  }
@@ -1,34 +1,34 @@
1
1
  import { Observable } from 'rxjs';
2
- import { IDataObject, ISignatureVerificationResult } from './data';
2
+ import { IFile, IImportedSignatureVerificationResult, ISignatureRequest, ISignatureVerificationResult } from './data';
3
3
  import { ICertificate } from './data/certificate';
4
- import { SignatureType } from './data/signature-type';
5
4
  /**
6
5
  * Represents a cryptographic provider interface for signing, verifying, and retrieving certificates.
7
6
  */
8
- export interface ICryptoProvider {
7
+ export declare abstract class ICryptoProvider {
8
+ constructor();
9
9
  /**
10
10
  * Signs a file with a digital signature using the provided certificate.
11
11
  *
12
- * @param document The document for additional information, represented as an IDataObject.
13
- * @param file The file to be signed, represented as an ArrayBuffer.
12
+ * @param documentId The documentId, represented as string.
13
+ * @param actualFile The actualFile for additional information, represented as an IFile.
14
+ * @param arrayBuffer The file to be signed, represented as an ArrayBuffer.
14
15
  * @param certificate The digital certificate to use for signing, represented as an ArrayBuffer.
15
16
  * @param signatureRequestIds An array of IDs for the signature requests.
16
17
  * @returns An observable that resolves to the digital signature as a string.
17
18
  */
18
- sign(document: IDataObject, file: ArrayBuffer, certificate: ICertificate, signatureRequestIds: string[]): Observable<string>;
19
+ sign(documentId: string, actualFile: IFile, arrayBuffer: ArrayBuffer, certificate: ICertificate, signatureRequestIds: string[]): Observable<string>;
19
20
  /**
20
21
  * Verifies the digital signature of a file.
21
22
  *
22
23
  * @param file - The file data to be verified. This should be the raw binary data of the file.
23
24
  * @param sign - The digital signature to be verified against the file. This should be the raw binary data of the signature.
24
- * @param signatureType - The signature's type.
25
+ * @param signatureRequest - Description of signature's request.
25
26
  * @returns - An observable that emits the result of the verification process. The result will indicate whether the signature is valid, and may include additional information such as error messages.
26
27
  *
27
28
  * @example
28
29
  const fileData = new ArrayBuffer(1024);
29
30
  const signatureData = new ArrayBuffer(256);
30
- const signatureType = SignatureType.CadesBes;
31
- verify(fileData, signatureData, signatureType).subscribe(result => {
31
+ verify(fileData, signatureData, signatureRequest).subscribe(result => {
32
32
  if (result.verificationStatus === F.Valid) {
33
33
  console.log("Signature is valid");
34
34
  } else {
@@ -36,7 +36,26 @@ export interface ICryptoProvider {
36
36
  }
37
37
  });
38
38
  */
39
- verify(file: ArrayBuffer, sign: ArrayBuffer, signatureType: SignatureType): Observable<ISignatureVerificationResult>;
39
+ verify(file: ArrayBuffer, sign: ArrayBuffer, signatureRequest: ISignatureRequest): Observable<ISignatureVerificationResult>;
40
+ /**
41
+ * Verifies the digital signature that being imported.
42
+ *
43
+ * @param file - The file data to be verified. This should be the raw binary data of the file.
44
+ * @param sign - The digital signature to be verified against the file. This should be the raw binary data of the signature.
45
+ * @returns - An observable that emits the result of the verification process. The result will indicate whether the signature is valid, and may include additional information such as error messages.
46
+ *
47
+ * @example
48
+ const fileData = new ArrayBuffer(1024);
49
+ const signatureData = new ArrayBuffer(256);
50
+ verifyImportedSignature(fileData, signatureData).subscribe(result => {
51
+ if (result.verificationStatus === F.Valid) {
52
+ console.log("Signature is valid");
53
+ } else {
54
+ console.log(`Signature is invalid: ${result.error}`);
55
+ }
56
+ });
57
+ */
58
+ verifyImportedSignature(file: ArrayBuffer, sign: ArrayBuffer): Observable<IImportedSignatureVerificationResult>;
40
59
  /**
41
60
  * Retrieves a list of digital certificates.
42
61
  *
@@ -53,4 +72,10 @@ export interface ICryptoProvider {
53
72
  * const can = canProcessAlgorithms("1.2.840.113549.1.1.1");
54
73
  */
55
74
  canProcessAlgorithms(publicKeyOid: string): boolean;
75
+ /** Determines whether the cryptoprovider can process signature. The method is needed when the signature is being imported and the signature algorithm is unknown.
76
+ *
77
+ * @param signatureFile signature file.
78
+ * @returns {boolean} True if the cryptoprovider can process the signature, false otherwise.
79
+ */
80
+ canProcessSignature(signatureFile: ArrayBuffer): boolean;
56
81
  }
@@ -1,2 +1,6 @@
1
- export interface IDataPlugin {
1
+ /**
2
+ * @exposedInterface
3
+ */
4
+ export declare abstract class IDataPlugin {
5
+ constructor();
2
6
  }
@@ -1,8 +1,10 @@
1
+ import { DocumentAnnotationsListContext, ObjectsViewContext } from "../contexts";
1
2
  import { IMenuBuilder } from "./menu.builder";
2
3
  /**
3
4
  * Interface that allows to add new items to the menu and context menus
5
+ * @exposedInterface
4
6
  */
5
- export declare abstract class IMenu<TMenuContext> {
7
+ export declare abstract class IMenu<TMenuContext extends ObjectsViewContext | DocumentAnnotationsListContext> {
6
8
  /**
7
9
  * The method is called just before the menu is shown
8
10
  * @param builder The menu builder object of associated menu
@@ -1,4 +1,4 @@
1
- import { ISignatureRequest } from "../data";
1
+ import { ISignatureRequest, CadesType } from "../data";
2
2
  /**
3
3
  * Interface for modifying digital signature requests.
4
4
  */
@@ -63,4 +63,25 @@ export interface ISignatureBuilder {
63
63
  * @returns This instance of ISignatureBuilder for method chaining.
64
64
  */
65
65
  withObjectId(objectId: string): ISignatureBuilder;
66
+ /**
67
+ * Set certificate's public key oid for the signature.
68
+ *
69
+ * @param publicKeyOid - certificate's public key oid.
70
+ * @returns This instance of ISignatureBuilder for method chaining.
71
+ */
72
+ withPublicKeyOid(publicKeyOid: string): ISignatureBuilder;
73
+ /**
74
+ * Set cades type of last signature.
75
+ *
76
+ * @param cadesType - cades type.
77
+ * @returns This instance of ISignatureBuilder for method chaining.
78
+ */
79
+ withLastSignCadesType(cadesType: CadesType): ISignatureBuilder;
80
+ /**
81
+ * Set requirement property for advancement of the signature.
82
+ *
83
+ * @param needAdvancement - signature needs advancement.
84
+ * @returns This instance of ISignatureBuilder for method chaining.
85
+ */
86
+ withIsAdvancementRequired(needAdvancement: boolean): ISignatureBuilder;
66
87
  }
@@ -4,6 +4,7 @@ import { IAttributeModifier } from "../modifier/attribute-modifier";
4
4
  import { AttributeValueChangedEventArgs } from "./attribute-value-changed-event-args";
5
5
  /**
6
6
  * Enables support for handling changing object attributes in object card
7
+ * @exposedInterface
7
8
  */
8
9
  export declare abstract class IObjectCardHandler {
9
10
  constructor();
@@ -1,7 +1,9 @@
1
+ import { ObjectsViewContext, PageContext } from "../contexts";
1
2
  /**
2
3
  * Class that allows to declare the view for the openspace container
4
+ * @exposedInterface
3
5
  */
4
- export declare abstract class IOpenspaceView<TOpenspaceViewContext> {
6
+ export declare abstract class IOpenspaceView<TOpenspaceViewContext extends ObjectsViewContext | PageContext> {
5
7
  constructor();
6
8
  /**
7
9
  * The method is called to match this View to the corresponding openspace container
@@ -1,6 +1,7 @@
1
1
  import { IPageNavigationBuilder } from './page-navigation.builder';
2
2
  /**
3
3
  * Interface that allows to add new sections and elements to navigation window
4
+ * @exposedInterface
4
5
  */
5
6
  export declare abstract class IPageNavigation {
6
7
  constructor();
@@ -70,5 +70,9 @@ export declare class SystemSettingsKeys {
70
70
  /**
71
71
  * User-defined digital signature title
72
72
  */
73
- static readonly digitalSinatureTitleFeatureKey = "DigitalSinatureTitleFeatureKey-481EFA14-B116-434A-BAD6-F90DB883DEC9";
73
+ static readonly digitalSignatureTitleFeatureKey = "DigitalSignatureTitleFeatureKey-481EFA14-B116-434A-BAD6-F90DB883DEC9";
74
+ /**
75
+ * Enhanced signature service settings
76
+ */
77
+ static readonly advancedSignatureFeatureKey = "AdvancedSignatureFeatureKey-D267127C-DCED-4DEC-B1A8-6E7A919E383D";
74
78
  }
@@ -1,8 +1,10 @@
1
+ import { ObjectsViewContext } from "../contexts";
1
2
  import { ITabsBuilder } from "./tabs.builder";
2
3
  /**
3
4
  * Interface that allows to add new items to the tabs
5
+ * @exposedInterface
4
6
  */
5
- export declare abstract class ITabs<TTabsContext> {
7
+ export declare abstract class ITabs<TTabsContext extends ObjectsViewContext> {
6
8
  /**
7
9
  * The method is called just before the tabs are shown
8
10
  * @param builder The tab group builder object of associated tab group
@@ -1,8 +1,10 @@
1
+ import { DocumentAnnotationsListContext, ObjectsViewContext } from "../contexts";
1
2
  import { IToolbarBuilder } from "./toolbar.builder";
2
3
  /**
3
4
  * Interface that allows to add new items to the toolbar
5
+ * @exposedInterface
4
6
  */
5
- export declare abstract class IToolbar<TToolbarContext> {
7
+ export declare abstract class IToolbar<TToolbarContext extends ObjectsViewContext | DocumentAnnotationsListContext> {
6
8
  constructor();
7
9
  /**
8
10
  * The method is called just before the toolbar is created
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pilotdev/pilot-web-sdk",
3
- "version": "25.4.0",
3
+ "version": "25.6.0",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "17.3.12",
6
6
  "@angular/core": "17.3.12",
@@ -1,9 +0,0 @@
1
- export var SignatureType;
2
- (function (SignatureType) {
3
- SignatureType[SignatureType["CadesBes"] = 0] = "CadesBes";
4
- SignatureType[SignatureType["CadesT"] = 1] = "CadesT";
5
- SignatureType[SignatureType["CadesC"] = 2] = "CadesC";
6
- SignatureType[SignatureType["CadesXLong"] = 3] = "CadesXLong";
7
- SignatureType[SignatureType["CadesXLongType1"] = 4] = "CadesXLongType1";
8
- })(SignatureType || (SignatureType = {}));
9
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2lnbmF0dXJlLXR5cGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9waWxvdC13ZWItc2RrL3NyYy9saWIvZGF0YS9zaWduYXR1cmUtdHlwZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxNQUFNLENBQU4sSUFBWSxhQU1YO0FBTkQsV0FBWSxhQUFhO0lBQ3ZCLHlEQUFZLENBQUE7SUFDWixxREFBVSxDQUFBO0lBQ1YscURBQVUsQ0FBQTtJQUNWLDZEQUFjLENBQUE7SUFDZCx1RUFBbUIsQ0FBQTtBQUNyQixDQUFDLEVBTlcsYUFBYSxLQUFiLGFBQWEsUUFNeEIiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgZW51bSBTaWduYXR1cmVUeXBlIHtcbiAgQ2FkZXNCZXMgPSAwLFxuICBDYWRlc1QgPSAxLFxuICBDYWRlc0MgPSAyLFxuICBDYWRlc1hMb25nID0gMyxcbiAgQ2FkZXNYTG9uZ1R5cGUxID0gNFxufVxuIl19
@@ -1,7 +0,0 @@
1
- export declare enum SignatureType {
2
- CadesBes = 0,
3
- CadesT = 1,
4
- CadesC = 2,
5
- CadesXLong = 3,
6
- CadesXLongType1 = 4
7
- }