@rhc-office/sdk 6.6.259 → 6.6.266
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 +44 -5
- package/dist/api/callbacks.d.ts +0 -1
- package/dist/api/callbacks.d.ts.map +1 -1
- package/dist/api/crypto-tool.d.ts +12 -1
- package/dist/api/crypto-tool.d.ts.map +1 -1
- package/dist/api/document-sdk.d.ts +0 -10
- package/dist/api/document-sdk.d.ts.map +1 -1
- package/dist/api/sign-tool.d.ts +43 -1
- package/dist/api/sign-tool.d.ts.map +1 -1
- package/dist/browser/document-viewer.js +2 -0
- package/dist/browser/document-viewer.js.map +1 -0
- package/dist/browser.d.ts +33 -0
- package/dist/browser.d.ts.map +1 -0
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +119 -148
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +1 -1
- package/dist/index.umd.cjs.map +1 -1
- package/dist/viewer/DocumentSDK.d.ts +0 -7
- package/dist/viewer/DocumentSDK.d.ts.map +1 -1
- package/dist/viewer/ReaderConfiguration.d.ts +1 -1
- package/dist/viewer/ReaderConfiguration.d.ts.map +1 -1
- package/dist/viewer/ReaderStateStore.d.ts +0 -1
- package/dist/viewer/ReaderStateStore.d.ts.map +1 -1
- package/dist/viewer/SdkCallbackRegistry.d.ts +1 -2
- package/dist/viewer/SdkCallbackRegistry.d.ts.map +1 -1
- package/package.json +12 -2
- package/src/api/callbacks.ts +4 -17
- package/src/api/crypto-tool.ts +13 -1
- package/src/api/document-sdk.ts +0 -13
- package/src/api/sign-tool.ts +62 -1
- package/src/browser.ts +85 -0
- package/src/index.ts +0 -3
- package/src/viewer/DocumentSDK.ts +2 -45
- package/src/viewer/ReaderBridgeClient.ts +1 -1
- package/src/viewer/ReaderConfiguration.ts +2 -2
- package/src/viewer/ReaderStateStore.ts +0 -2
- package/src/viewer/SdkCallbackRegistry.ts +0 -9
- package/dist/api/ekey-tool.d.ts +0 -8
- package/dist/api/ekey-tool.d.ts.map +0 -1
- package/dist/api/extension-tool.d.ts +0 -5
- package/dist/api/extension-tool.d.ts.map +0 -1
- package/dist/api/review-tool.d.ts +0 -71
- package/dist/api/review-tool.d.ts.map +0 -1
- package/src/api/ekey-tool.ts +0 -11
- package/src/api/extension-tool.ts +0 -5
- package/src/api/review-tool.ts +0 -105
|
@@ -14,13 +14,10 @@ export declare class DocumentSDK implements IDocumentSDK {
|
|
|
14
14
|
private readonly findTool;
|
|
15
15
|
private readonly signServerTool;
|
|
16
16
|
private readonly digitalSignTool;
|
|
17
|
-
private readonly reviewTool;
|
|
18
|
-
private readonly ekeyTool;
|
|
19
17
|
private readonly symbologyTool;
|
|
20
18
|
private readonly annotationTool;
|
|
21
19
|
private readonly templateSignTool;
|
|
22
20
|
private readonly pdfFormFiller;
|
|
23
|
-
private readonly extensionTool;
|
|
24
21
|
private readonly networkingTool;
|
|
25
22
|
private readonly cryptoTool;
|
|
26
23
|
private readonly readyCallbacks;
|
|
@@ -59,19 +56,15 @@ export declare class DocumentSDK implements IDocumentSDK {
|
|
|
59
56
|
readonly getFindTool: IDocumentSDK['getFindTool'];
|
|
60
57
|
readonly getSignServerTool: IDocumentSDK['getSignServerTool'];
|
|
61
58
|
readonly getDigitalSignTool: IDocumentSDK['getDigitalSignTool'];
|
|
62
|
-
readonly getReviewTool: IDocumentSDK['getReviewTool'];
|
|
63
|
-
readonly getEkeyTool: IDocumentSDK['getEkeyTool'];
|
|
64
59
|
readonly getSymbologyTool: IDocumentSDK['getSymbologyTool'];
|
|
65
60
|
readonly getAnnotationTool: IDocumentSDK['getAnnotationTool'];
|
|
66
61
|
readonly getTemplateSignTool: IDocumentSDK['getTemplateSignTool'];
|
|
67
62
|
readonly getPdfFormFiller: IDocumentSDK['getPdfFormFiller'];
|
|
68
|
-
readonly getExtensionTool: IDocumentSDK['getExtensionTool'];
|
|
69
63
|
readonly getNetworkingTool: IDocumentSDK['getNetworkingTool'];
|
|
70
64
|
readonly getCryptoTool: IDocumentSDK['getCryptoTool'];
|
|
71
65
|
readonly createDigitalSignOptions: IDocumentSDK['createDigitalSignOptions'];
|
|
72
66
|
readonly createKVField: IDocumentSDK['createKVField'];
|
|
73
67
|
private createAnnotationTool;
|
|
74
|
-
private createExtensionTool;
|
|
75
68
|
private readonly mountReader;
|
|
76
69
|
private readonly bindNativeReaderEvents;
|
|
77
70
|
private readonly cleanupNativeEventForwarders;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentSDK.d.ts","sourceRoot":"","sources":["../../src/viewer/DocumentSDK.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DocumentSDK.d.ts","sourceRoot":"","sources":["../../src/viewer/DocumentSDK.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,YAAY,EAAuB,MAAM,qBAAqB,CAAC;AAsC7E,UAAU,yBAAyB;IACjC,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,uBAAuB,CAAC,EAAE,MAAM,CAAC;CAClC;AAyKD,qBAAa,WAAY,YAAW,YAAY;IAC9C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA4B;IACnD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA6B;IACvD,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA0B;IACtD,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAMhC;IACF,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAgD;IAC7E,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA0C;IACjE,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA4C;IACrE,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA4C;IACrE,OAAO,CAAC,QAAQ,CAAC,cAAc,CAG7B;IACF,OAAO,CAAC,QAAQ,CAAC,eAAe,CAG9B;IACF,OAAO,CAAC,QAAQ,CAAC,aAAa,CAG5B;IACF,OAAO,CAAC,QAAQ,CAAC,cAAc,CAA+B;IAC9D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B,CAAC,CAEzE;IAEF,QAAQ,CAAC,aAAa,EAAE,YAAY,CAAC,eAAe,CAAC,CAEnD;IAEF,OAAO,CAAC,oBAAoB;IAsF5B,OAAO,CAAC,QAAQ,CAAC,WAAW,CA0C1B;IAEF,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAsCrC;IAEF,OAAO,CAAC,QAAQ,CAAC,4BAA4B,CAE3C;IAEF,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAGlC;IAEF,OAAO,CAAC,QAAQ,CAAC,eAAe,CAE9B;IAEF,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAOhC;IAEF,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAMjC;CACH;AAED,eAAO,MAAM,oBAAoB,GAAI,UAAU,yBAAyB,KAAG,YAE1E,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { IReaderEmbedOptions } from '../api/document-sdk';
|
|
2
2
|
export type SupportedReaderTheme = 'light' | 'dark' | 'high-contrast' | 'auto';
|
|
3
3
|
export interface NormalizedReaderEmbedOptions extends IReaderEmbedOptions {
|
|
4
|
-
|
|
4
|
+
appUrl: string;
|
|
5
5
|
scrollIntoView: boolean;
|
|
6
6
|
theme?: SupportedReaderTheme;
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReaderConfiguration.d.ts","sourceRoot":"","sources":["../../src/viewer/ReaderConfiguration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE/D,MAAM,MAAM,oBAAoB,GAAG,OAAO,GAAG,MAAM,GAAG,eAAe,GAAG,MAAM,CAAC;AAE/E,MAAM,WAAW,4BAA6B,SAAQ,mBAAmB;IACvE,
|
|
1
|
+
{"version":3,"file":"ReaderConfiguration.d.ts","sourceRoot":"","sources":["../../src/viewer/ReaderConfiguration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE/D,MAAM,MAAM,oBAAoB,GAAG,OAAO,GAAG,MAAM,GAAG,eAAe,GAAG,MAAM,CAAC;AAE/E,MAAM,WAAW,4BAA6B,SAAQ,mBAAmB;IACvE,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,OAAO,CAAC;IACxB,KAAK,CAAC,EAAE,oBAAoB,CAAC;CAC9B;AAwBD,eAAO,MAAM,eAAe,GAAI,QAAQ,MAAM,KAAG,MAQhD,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,QAAQ,MAAM,KAAG,MAEnD,CAAC;AAEF,eAAO,MAAM,2BAA2B,GACtC,QAAQ,MAAM,EACd,eAAe,mBAAmB,KACjC,4BASF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReaderStateStore.d.ts","sourceRoot":"","sources":["../../src/viewer/ReaderStateStore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE3D,MAAM,WAAW,mBAAmB;IAClC,iBAAiB,EAAE,OAAO,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,cAAc,EAAE,OAAO,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,
|
|
1
|
+
{"version":3,"file":"ReaderStateStore.d.ts","sourceRoot":"","sources":["../../src/viewer/ReaderStateStore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE3D,MAAM,WAAW,mBAAmB;IAClC,iBAAiB,EAAE,OAAO,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,cAAc,EAAE,OAAO,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAYD,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,KAAK,CAAoD;IAEjE,KAAK,IAAI,IAAI;IAIb,MAAM,CAAC,KAAK,CAAC,EAAE,iBAAiB,GAAG,IAAI;IAWvC,iBAAiB,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI;IAOxC,QAAQ,IAAI,mBAAmB;CAGhC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AnnotationEventCallback, DigitalSignatureRetrieveCallback, DocumentClosedCallback, DocumentSavedCallback,
|
|
1
|
+
import type { AnnotationEventCallback, DigitalSignatureRetrieveCallback, DocumentClosedCallback, DocumentSavedCallback, PageChangeCallback, PageModeChangeCallback } from '../api/callbacks';
|
|
2
2
|
import type { IDigitalAnnotationInfo } from '../api/annotation-tool';
|
|
3
3
|
export declare class SdkCallbackRegistry {
|
|
4
4
|
readonly annotationEvents: AnnotationEventCallback[];
|
|
@@ -10,7 +10,6 @@ export declare class SdkCallbackRegistry {
|
|
|
10
10
|
readonly documentClosed: DocumentClosedCallback[];
|
|
11
11
|
readonly documentOpened: Array<(status: string, error: string) => void>;
|
|
12
12
|
readonly documentSaved: DocumentSavedCallback[];
|
|
13
|
-
readonly extensionStateChanged: ExtensionStateChangedCallback[];
|
|
14
13
|
readonly pageChange: PageChangeCallback[];
|
|
15
14
|
readonly pageModeChange: PageModeChangeCallback[];
|
|
16
15
|
emit(event: string, payload: unknown): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SdkCallbackRegistry.d.ts","sourceRoot":"","sources":["../../src/viewer/SdkCallbackRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,gCAAgC,EAChC,sBAAsB,EACtB,qBAAqB,EACrB,
|
|
1
|
+
{"version":3,"file":"SdkCallbackRegistry.d.ts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-
"version": "6.6.
|
|
3
|
+
"version": "6.6.266",
|
|
4
4
|
"description": "SDK for third-party integration with RHC Office Platform",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
8
|
+
"browser": "dist/browser/document-viewer.js",
|
|
9
|
+
"unpkg": "dist/browser/document-viewer.js",
|
|
10
|
+
"jsdelivr": "dist/browser/document-viewer.js",
|
|
8
11
|
"types": "dist/index.d.ts",
|
|
9
12
|
"exports": {
|
|
10
13
|
".": {
|
|
11
14
|
"import": "./dist/index.js",
|
|
12
15
|
"types": "./dist/index.d.ts"
|
|
16
|
+
},
|
|
17
|
+
"./browser": {
|
|
18
|
+
"types": "./dist/browser.d.ts",
|
|
19
|
+
"default": "./dist/browser/document-viewer.js"
|
|
13
20
|
}
|
|
14
21
|
},
|
|
15
22
|
"files": [
|
|
@@ -21,7 +28,10 @@
|
|
|
21
28
|
"registry": "https://registry.npmjs.org/"
|
|
22
29
|
},
|
|
23
30
|
"scripts": {
|
|
24
|
-
"build": "npm run clean &&
|
|
31
|
+
"build": "npm run clean && npm run build:module && npm run build:browser && npm run build:types",
|
|
32
|
+
"build:module": "vite build",
|
|
33
|
+
"build:browser": "vite build --config vite.browser.config.ts && node scripts/copy-browser-bundle.cjs",
|
|
34
|
+
"build:types": "tsc --project tsconfig.types.json",
|
|
25
35
|
"dev": "vite build --watch",
|
|
26
36
|
"clean": "rm -rf dist",
|
|
27
37
|
"prepublishOnly": "npm run build && npm pack --dry-run",
|
package/src/api/callbacks.ts
CHANGED
|
@@ -3,11 +3,7 @@ import { IDigitalAnnotationInfo, ITextAnnotationInfo } from './annotation-tool';
|
|
|
3
3
|
export type ReaderReadyCallback = () => void;
|
|
4
4
|
export type ReaderUnloadCallback = () => void;
|
|
5
5
|
|
|
6
|
-
export type DocumentOpenedCallback = (
|
|
7
|
-
status: string,
|
|
8
|
-
error?: any,
|
|
9
|
-
docInfo?: any,
|
|
10
|
-
) => void;
|
|
6
|
+
export type DocumentOpenedCallback = (status: string, error?: any, docInfo?: any) => void;
|
|
11
7
|
|
|
12
8
|
export type DocumentSavedCallback = (response?: any) => void;
|
|
13
9
|
|
|
@@ -20,10 +16,7 @@ export interface IDocumentCloseEvent {
|
|
|
20
16
|
|
|
21
17
|
export type DocumentClosedCallback = (payload?: any) => void;
|
|
22
18
|
|
|
23
|
-
export type PageChangeCallback = (
|
|
24
|
-
pageIndex: number,
|
|
25
|
-
pageCount: number,
|
|
26
|
-
) => void;
|
|
19
|
+
export type PageChangeCallback = (pageIndex: number, pageCount: number) => void;
|
|
27
20
|
|
|
28
21
|
export type PageCountCallback = (pageCount: number) => void;
|
|
29
22
|
|
|
@@ -41,13 +34,9 @@ export type DigitalAnnotationRetrieveCallback = (
|
|
|
41
34
|
digitalSignature: IDigitalAnnotationInfo[],
|
|
42
35
|
) => void;
|
|
43
36
|
|
|
44
|
-
export type DigitalSignatureRetrieveCallback = (
|
|
45
|
-
digitalSignature: any[],
|
|
46
|
-
) => void;
|
|
37
|
+
export type DigitalSignatureRetrieveCallback = (digitalSignature: any[]) => void;
|
|
47
38
|
|
|
48
|
-
export type DigitalSignatureParseCallback = (
|
|
49
|
-
digitalSignature: any[],
|
|
50
|
-
) => void;
|
|
39
|
+
export type DigitalSignatureParseCallback = (digitalSignature: any[]) => void;
|
|
51
40
|
|
|
52
41
|
export type DocumentServerAuthCallback = (credentials: string) => void;
|
|
53
42
|
|
|
@@ -55,5 +44,3 @@ export type TextAnnotationModifiedCallback = (
|
|
|
55
44
|
event: string,
|
|
56
45
|
annotation: ITextAnnotationInfo,
|
|
57
46
|
) => void;
|
|
58
|
-
|
|
59
|
-
export type ExtensionStateChangedCallback = (state: 'connected' | 'disconnected') => void;
|
package/src/api/crypto-tool.ts
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 支持的算法提供者厂商。
|
|
3
|
+
*
|
|
4
|
+
* - `CE`: 默认基础实现
|
|
5
|
+
* - `SCE`: 基于服务器软件的算法实现
|
|
6
|
+
* - `HCE:*`: 服务器加密机,冒号后为加密机类型
|
|
7
|
+
* - `BeCE`: 浏览器插件
|
|
8
|
+
* - `KolPKI`: 格尔中间件 PKI 服务,USB 硬件 Key
|
|
9
|
+
* - `BJCAPKI`: 北京 CA 中间件 PKI 服务,USB 硬件 Key
|
|
10
|
+
*/
|
|
11
|
+
export type SecurityProviderName = 'CE' | 'SCE' | `HCE:${string}` | 'BeCE' | 'KolPKI' | 'BJCAPKI';
|
|
12
|
+
|
|
1
13
|
export type SecurityProviderInfo = {
|
|
2
|
-
providerName:
|
|
14
|
+
providerName: SecurityProviderName;
|
|
3
15
|
applyFor: 'DocSign' | 'DocSignVerification';
|
|
4
16
|
};
|
|
5
17
|
|
package/src/api/document-sdk.ts
CHANGED
|
@@ -8,12 +8,9 @@ import { FindTool } from './find-tool';
|
|
|
8
8
|
import { DigitalSignTool } from './sign-tool';
|
|
9
9
|
import { SignServerTool } from './sign-server';
|
|
10
10
|
import { NetworkingTool } from './networking-tool';
|
|
11
|
-
import { EkeyTool } from './ekey-tool';
|
|
12
|
-
import { ExtensionTool } from './extension-tool';
|
|
13
11
|
import { SymbologyTool } from './symbology-tool';
|
|
14
12
|
import { TemplateSignTool } from './template-sign';
|
|
15
13
|
import { PdfFormFiller } from './pdf-formfiller';
|
|
16
|
-
import { ReviewTool } from './review-tool';
|
|
17
14
|
import { CryptoTool } from './crypto-tool';
|
|
18
15
|
|
|
19
16
|
export interface IReaderEmbedOptions {
|
|
@@ -28,10 +25,6 @@ export interface IReaderEmbedOptions {
|
|
|
28
25
|
binder?: string;
|
|
29
26
|
origin?: string;
|
|
30
27
|
|
|
31
|
-
/**
|
|
32
|
-
* 阅读器部署的地址
|
|
33
|
-
*/
|
|
34
|
-
officeServer: string;
|
|
35
28
|
/**
|
|
36
29
|
* View: 阅读模式,Annotation: 批注模式,DigitalSign: 签章模式
|
|
37
30
|
*/
|
|
@@ -128,10 +121,6 @@ export interface IDocumentSDK {
|
|
|
128
121
|
|
|
129
122
|
getDigitalSignTool(): DigitalSignTool;
|
|
130
123
|
|
|
131
|
-
getReviewTool(): ReviewTool;
|
|
132
|
-
|
|
133
|
-
getEkeyTool(): EkeyTool;
|
|
134
|
-
|
|
135
124
|
getSymbologyTool(): SymbologyTool;
|
|
136
125
|
|
|
137
126
|
getAnnotationTool(): AnnotationTool;
|
|
@@ -140,8 +129,6 @@ export interface IDocumentSDK {
|
|
|
140
129
|
|
|
141
130
|
getPdfFormFiller(): PdfFormFiller;
|
|
142
131
|
|
|
143
|
-
getExtensionTool(): ExtensionTool;
|
|
144
|
-
|
|
145
132
|
getNetworkingTool(): NetworkingTool;
|
|
146
133
|
|
|
147
134
|
getCryptoTool(): CryptoTool;
|
package/src/api/sign-tool.ts
CHANGED
|
@@ -1,12 +1,73 @@
|
|
|
1
1
|
import { DigitalSignatureRetrieveCallback, DigitalSignCallback } from './callbacks';
|
|
2
2
|
import { IDigitalSignOptions } from './common';
|
|
3
|
+
import type { SecurityProviderName } from './crypto-tool';
|
|
4
|
+
|
|
5
|
+
export type DigitalSignCryptoProviderUsage = 'DigitalSign' | 'SignatureVerification';
|
|
6
|
+
|
|
7
|
+
export type USBKeyType = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16;
|
|
8
|
+
|
|
9
|
+
export type CryptoProviderConfiguration = Record<string, unknown>;
|
|
10
|
+
|
|
11
|
+
export type BrowserCryptoProviderConfiguration = CryptoProviderConfiguration & {
|
|
12
|
+
/**
|
|
13
|
+
* 浏览器插件签章时使用的 USB 硬件 Key 类型。
|
|
14
|
+
*
|
|
15
|
+
* 1: 海泰
|
|
16
|
+
* 2: 明华
|
|
17
|
+
* 3: 大明五洲
|
|
18
|
+
* 4: 飞天 EPAS 3000
|
|
19
|
+
* 5: 飞天,深圳 CA
|
|
20
|
+
* 6: 九思泰达,深圳 CA
|
|
21
|
+
* 7: 飞天 EPAS 2000
|
|
22
|
+
* 8: 华申 华大 Key
|
|
23
|
+
* 9: 东方中讯 ekey
|
|
24
|
+
* 10: 握奇 ekey
|
|
25
|
+
* 11: 贵州黔南 HTK
|
|
26
|
+
* 12: 飞天,格尔
|
|
27
|
+
* 13: 飞天,坚石诚信
|
|
28
|
+
* 14: 龙脉科技
|
|
29
|
+
* 15: 龙脉天威定制
|
|
30
|
+
* 16: 陕西 CA
|
|
31
|
+
*/
|
|
32
|
+
usbKeyType?: USBKeyType;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export type KolPkiCryptoProviderConfiguration = CryptoProviderConfiguration & {
|
|
36
|
+
kmsAddress: string;
|
|
37
|
+
appName: string;
|
|
38
|
+
appID: string;
|
|
39
|
+
token: string;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export type HceCryptoProviderConfiguration = CryptoProviderConfiguration & {
|
|
43
|
+
kmsAddress?: string;
|
|
44
|
+
svsAddress?: string;
|
|
45
|
+
cbcKeyId?: string;
|
|
46
|
+
secretKey?: string;
|
|
47
|
+
accessKey?: string;
|
|
48
|
+
secretKeyVersion?: string;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export type DigitalSignCryptoProviderConfiguration<
|
|
52
|
+
Provider extends SecurityProviderName = SecurityProviderName,
|
|
53
|
+
> = Provider extends 'BeCE'
|
|
54
|
+
? BrowserCryptoProviderConfiguration
|
|
55
|
+
: Provider extends 'KolPKI'
|
|
56
|
+
? KolPkiCryptoProviderConfiguration
|
|
57
|
+
: Provider extends `HCE:${string}`
|
|
58
|
+
? HceCryptoProviderConfiguration
|
|
59
|
+
: CryptoProviderConfiguration;
|
|
3
60
|
|
|
4
61
|
export interface DigitalSignTool {
|
|
5
62
|
addDigitalSignatureRetrieveCallback(callback: DigitalSignatureRetrieveCallback): void;
|
|
6
63
|
|
|
7
64
|
addDigitalSignatureParseCallback(callback: (digitalSignature: any[]) => void): void;
|
|
8
65
|
|
|
9
|
-
setCryptoProvider
|
|
66
|
+
setCryptoProvider<Provider extends SecurityProviderName>(
|
|
67
|
+
usage: DigitalSignCryptoProviderUsage,
|
|
68
|
+
provider: Provider,
|
|
69
|
+
configuration?: DigitalSignCryptoProviderConfiguration<Provider>,
|
|
70
|
+
): void;
|
|
10
71
|
|
|
11
72
|
setSealSource(source: 'SignServer' | 'USBKey' | 'ExternalServer'): void;
|
|
12
73
|
|
package/src/browser.ts
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DIGITAL_SIGN_DEFAULTS,
|
|
3
|
+
DocumentSDK,
|
|
4
|
+
WatermarkDisplay,
|
|
5
|
+
createNewDocumentSdk,
|
|
6
|
+
getDigitalSignEnvironment,
|
|
7
|
+
initializeDigitalSignEnvironment,
|
|
8
|
+
patchDigitalSignEnvironment,
|
|
9
|
+
resetDigitalSignEnvironment,
|
|
10
|
+
setDigitalSignEnvironment,
|
|
11
|
+
} from './index';
|
|
12
|
+
import type { IDocumentSDK } from './api/document-sdk';
|
|
13
|
+
|
|
14
|
+
export interface RHCOfficeSDKBrowserNamespace {
|
|
15
|
+
DocumentSDK: typeof DocumentSDK;
|
|
16
|
+
WatermarkDisplay: typeof WatermarkDisplay;
|
|
17
|
+
DIGITAL_SIGN_DEFAULTS: typeof DIGITAL_SIGN_DEFAULTS;
|
|
18
|
+
createNewDocumentSdk: typeof createNewDocumentSdk;
|
|
19
|
+
newDocumentSDK: typeof createNewDocumentSdk;
|
|
20
|
+
getDigitalSignEnvironment: typeof getDigitalSignEnvironment;
|
|
21
|
+
initializeDigitalSignEnvironment: typeof initializeDigitalSignEnvironment;
|
|
22
|
+
patchDigitalSignEnvironment: typeof patchDigitalSignEnvironment;
|
|
23
|
+
resetDigitalSignEnvironment: typeof resetDigitalSignEnvironment;
|
|
24
|
+
setDigitalSignEnvironment: typeof setDigitalSignEnvironment;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export const RHCOfficeSDK: RHCOfficeSDKBrowserNamespace = {
|
|
28
|
+
DocumentSDK,
|
|
29
|
+
WatermarkDisplay,
|
|
30
|
+
DIGITAL_SIGN_DEFAULTS,
|
|
31
|
+
createNewDocumentSdk,
|
|
32
|
+
newDocumentSDK: createNewDocumentSdk,
|
|
33
|
+
getDigitalSignEnvironment,
|
|
34
|
+
initializeDigitalSignEnvironment,
|
|
35
|
+
patchDigitalSignEnvironment,
|
|
36
|
+
resetDigitalSignEnvironment,
|
|
37
|
+
setDigitalSignEnvironment,
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const installBrowserDocumentAPI = (targetDocument: Document): void => {
|
|
41
|
+
Object.entries(RHCOfficeSDK).forEach(([property, value]) => {
|
|
42
|
+
Object.defineProperty(targetDocument, property, {
|
|
43
|
+
configurable: true,
|
|
44
|
+
enumerable: true,
|
|
45
|
+
value,
|
|
46
|
+
writable: true,
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
targetDocument.RHCOfficeSDK = RHCOfficeSDK;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
if (typeof document !== 'undefined') {
|
|
54
|
+
installBrowserDocumentAPI(document);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
declare global {
|
|
58
|
+
interface Document {
|
|
59
|
+
DocumentSDK: typeof DocumentSDK;
|
|
60
|
+
WatermarkDisplay: typeof WatermarkDisplay;
|
|
61
|
+
DIGITAL_SIGN_DEFAULTS: typeof DIGITAL_SIGN_DEFAULTS;
|
|
62
|
+
createNewDocumentSdk: typeof createNewDocumentSdk;
|
|
63
|
+
newDocumentSDK(options?: ConstructorParameters<typeof DocumentSDK>[0]): IDocumentSDK;
|
|
64
|
+
getDigitalSignEnvironment: typeof getDigitalSignEnvironment;
|
|
65
|
+
initializeDigitalSignEnvironment: typeof initializeDigitalSignEnvironment;
|
|
66
|
+
patchDigitalSignEnvironment: typeof patchDigitalSignEnvironment;
|
|
67
|
+
resetDigitalSignEnvironment: typeof resetDigitalSignEnvironment;
|
|
68
|
+
setDigitalSignEnvironment: typeof setDigitalSignEnvironment;
|
|
69
|
+
RHCOfficeSDK: RHCOfficeSDKBrowserNamespace;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export {
|
|
74
|
+
DIGITAL_SIGN_DEFAULTS,
|
|
75
|
+
DocumentSDK,
|
|
76
|
+
WatermarkDisplay,
|
|
77
|
+
createNewDocumentSdk,
|
|
78
|
+
getDigitalSignEnvironment,
|
|
79
|
+
initializeDigitalSignEnvironment,
|
|
80
|
+
patchDigitalSignEnvironment,
|
|
81
|
+
resetDigitalSignEnvironment,
|
|
82
|
+
setDigitalSignEnvironment,
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export * from './index';
|
package/src/index.ts
CHANGED
|
@@ -11,12 +11,9 @@ export * from './api/sign-tool';
|
|
|
11
11
|
export * from './api/sign-server';
|
|
12
12
|
export * from './api/digital-sign-environment';
|
|
13
13
|
export * from './api/networking-tool';
|
|
14
|
-
export * from './api/ekey-tool';
|
|
15
|
-
export * from './api/extension-tool';
|
|
16
14
|
export * from './api/symbology-tool';
|
|
17
15
|
export * from './api/template-sign';
|
|
18
16
|
export * from './api/pdf-formfiller';
|
|
19
|
-
export * from './api/review-tool';
|
|
20
17
|
export * from './api/crypto-tool';
|
|
21
18
|
export * from './api/document-sdk';
|
|
22
19
|
export * from './viewer';
|
|
@@ -3,19 +3,15 @@ import type { IDigitalAnnotationInfo } from '../api/annotation-tool';
|
|
|
3
3
|
import type { CryptoTool } from '../api/crypto-tool';
|
|
4
4
|
import type {
|
|
5
5
|
AnnotationEventCallback,
|
|
6
|
-
ExtensionStateChangedCallback,
|
|
7
6
|
ReaderReadyCallback,
|
|
8
7
|
ReaderUnloadCallback,
|
|
9
8
|
} from '../api/callbacks';
|
|
10
9
|
import type { IDocumentSDK, IReaderEmbedOptions } from '../api/document-sdk';
|
|
11
10
|
import type { DocumentTool } from '../api/document-tool';
|
|
12
|
-
import type { EkeyTool } from '../api/ekey-tool';
|
|
13
|
-
import type { ExtensionTool } from '../api/extension-tool';
|
|
14
11
|
import type { FindTool } from '../api/find-tool';
|
|
15
12
|
import type { NetworkingTool } from '../api/networking-tool';
|
|
16
13
|
import type { PageTool } from '../api/page-tool';
|
|
17
14
|
import type { PdfFormFiller } from '../api/pdf-formfiller';
|
|
18
|
-
import type { ReviewTool } from '../api/review-tool';
|
|
19
15
|
import type { SignServerTool } from '../api/sign-server';
|
|
20
16
|
import type { DigitalSignTool } from '../api/sign-tool';
|
|
21
17
|
import type { SymbologyTool } from '../api/symbology-tool';
|
|
@@ -83,7 +79,7 @@ const createReaderPayload = (
|
|
|
83
79
|
configuration: NormalizedReaderEmbedOptions | null,
|
|
84
80
|
): Record<string, unknown> => {
|
|
85
81
|
return {
|
|
86
|
-
appUrl: configuration?.
|
|
82
|
+
appUrl: configuration?.appUrl ?? null,
|
|
87
83
|
configuration,
|
|
88
84
|
element: readerElement,
|
|
89
85
|
};
|
|
@@ -243,14 +239,6 @@ export class DocumentSDK implements IDocumentSDK {
|
|
|
243
239
|
'digitalSign',
|
|
244
240
|
this.bridgeToolContext,
|
|
245
241
|
);
|
|
246
|
-
private readonly reviewTool = createNotImplementedBridgeTool<ReviewTool>(
|
|
247
|
-
'review',
|
|
248
|
-
this.bridgeToolContext,
|
|
249
|
-
);
|
|
250
|
-
private readonly ekeyTool = createNotImplementedBridgeTool<EkeyTool>(
|
|
251
|
-
'ekey',
|
|
252
|
-
this.bridgeToolContext,
|
|
253
|
-
);
|
|
254
242
|
private readonly symbologyTool = createNotImplementedBridgeTool<SymbologyTool>(
|
|
255
243
|
'symbology',
|
|
256
244
|
this.bridgeToolContext,
|
|
@@ -261,7 +249,6 @@ export class DocumentSDK implements IDocumentSDK {
|
|
|
261
249
|
this.bridgeToolContext,
|
|
262
250
|
);
|
|
263
251
|
private readonly pdfFormFiller = new PdfFormFillerImpl(this.bridgeToolContext);
|
|
264
|
-
private readonly extensionTool = this.createExtensionTool();
|
|
265
252
|
private readonly networkingTool = new NetworkingToolImpl(this.bridgeToolContext);
|
|
266
253
|
private readonly cryptoTool = createNotImplementedBridgeTool<CryptoTool>(
|
|
267
254
|
'crypto',
|
|
@@ -420,14 +407,6 @@ export class DocumentSDK implements IDocumentSDK {
|
|
|
420
407
|
return this.digitalSignTool;
|
|
421
408
|
};
|
|
422
409
|
|
|
423
|
-
readonly getReviewTool: IDocumentSDK['getReviewTool'] = (): ReviewTool => {
|
|
424
|
-
return this.reviewTool;
|
|
425
|
-
};
|
|
426
|
-
|
|
427
|
-
readonly getEkeyTool: IDocumentSDK['getEkeyTool'] = (): EkeyTool => {
|
|
428
|
-
return this.ekeyTool;
|
|
429
|
-
};
|
|
430
|
-
|
|
431
410
|
readonly getSymbologyTool: IDocumentSDK['getSymbologyTool'] = (): SymbologyTool => {
|
|
432
411
|
return this.symbologyTool;
|
|
433
412
|
};
|
|
@@ -444,10 +423,6 @@ export class DocumentSDK implements IDocumentSDK {
|
|
|
444
423
|
return this.pdfFormFiller;
|
|
445
424
|
};
|
|
446
425
|
|
|
447
|
-
readonly getExtensionTool: IDocumentSDK['getExtensionTool'] = (): ExtensionTool => {
|
|
448
|
-
return this.extensionTool;
|
|
449
|
-
};
|
|
450
|
-
|
|
451
426
|
readonly getNetworkingTool: IDocumentSDK['getNetworkingTool'] = (): NetworkingTool => {
|
|
452
427
|
return this.networkingTool;
|
|
453
428
|
};
|
|
@@ -550,31 +525,13 @@ export class DocumentSDK implements IDocumentSDK {
|
|
|
550
525
|
);
|
|
551
526
|
}
|
|
552
527
|
|
|
553
|
-
private createExtensionTool(): ExtensionTool {
|
|
554
|
-
return createBridgeToolAdapter<ExtensionTool>(
|
|
555
|
-
'extension',
|
|
556
|
-
{
|
|
557
|
-
addExtensionStateChangedCallback: {
|
|
558
|
-
kind: 'callbackRegister',
|
|
559
|
-
callback: (callbacks, args) => {
|
|
560
|
-
const callback = args[0];
|
|
561
|
-
if (typeof callback === 'function') {
|
|
562
|
-
callbacks.extensionStateChanged.push(callback as ExtensionStateChangedCallback);
|
|
563
|
-
}
|
|
564
|
-
},
|
|
565
|
-
},
|
|
566
|
-
},
|
|
567
|
-
this.bridgeToolContext,
|
|
568
|
-
);
|
|
569
|
-
}
|
|
570
|
-
|
|
571
528
|
private readonly mountReader = async (
|
|
572
529
|
hostContainer: HTMLDivElement,
|
|
573
530
|
configuration: NormalizedReaderEmbedOptions,
|
|
574
531
|
mountToken: number,
|
|
575
532
|
): Promise<void> => {
|
|
576
533
|
try {
|
|
577
|
-
await ensureReaderScriptLoaded(configuration.
|
|
534
|
+
await ensureReaderScriptLoaded(configuration.appUrl);
|
|
578
535
|
if (this.mountToken !== mountToken) {
|
|
579
536
|
return;
|
|
580
537
|
}
|
|
@@ -151,7 +151,7 @@ export class ReaderBridgeClient {
|
|
|
151
151
|
}
|
|
152
152
|
|
|
153
153
|
return new Promise<AdapterGlobal | null>((resolve) => {
|
|
154
|
-
let timeoutId: ReturnType<typeof setTimeout> | undefined;
|
|
154
|
+
let timeoutId: ReturnType<typeof setTimeout> | undefined = undefined;
|
|
155
155
|
|
|
156
156
|
const cleanup = (): void => {
|
|
157
157
|
if (timeoutId) {
|
|
@@ -3,7 +3,7 @@ import type { IReaderEmbedOptions } from '../api/document-sdk';
|
|
|
3
3
|
export type SupportedReaderTheme = 'light' | 'dark' | 'high-contrast' | 'auto';
|
|
4
4
|
|
|
5
5
|
export interface NormalizedReaderEmbedOptions extends IReaderEmbedOptions {
|
|
6
|
-
|
|
6
|
+
appUrl: string;
|
|
7
7
|
scrollIntoView: boolean;
|
|
8
8
|
theme?: SupportedReaderTheme;
|
|
9
9
|
}
|
|
@@ -52,7 +52,7 @@ export const normalizeReaderEmbedOptions = (
|
|
|
52
52
|
|
|
53
53
|
return {
|
|
54
54
|
...configuration,
|
|
55
|
-
|
|
55
|
+
appUrl: normalizedAppUrl,
|
|
56
56
|
scrollIntoView: configuration.scrollIntoView ?? true,
|
|
57
57
|
theme: normalizeTheme(configuration.theme),
|
|
58
58
|
};
|
|
@@ -6,7 +6,6 @@ export interface ReaderStateSnapshot {
|
|
|
6
6
|
documentModified: boolean;
|
|
7
7
|
documentOpened: boolean;
|
|
8
8
|
documentType?: string;
|
|
9
|
-
extensionState: 'connected' | 'disconnected';
|
|
10
9
|
pageCount: number;
|
|
11
10
|
pageIndex: number;
|
|
12
11
|
pageMode: number;
|
|
@@ -17,7 +16,6 @@ const DEFAULT_READER_STATE: ReaderStateSnapshot = {
|
|
|
17
16
|
annotationEnabled: false,
|
|
18
17
|
documentModified: false,
|
|
19
18
|
documentOpened: false,
|
|
20
|
-
extensionState: 'disconnected',
|
|
21
19
|
pageCount: 0,
|
|
22
20
|
pageIndex: 1,
|
|
23
21
|
pageMode: 0,
|
|
@@ -3,7 +3,6 @@ import type {
|
|
|
3
3
|
DigitalSignatureRetrieveCallback,
|
|
4
4
|
DocumentClosedCallback,
|
|
5
5
|
DocumentSavedCallback,
|
|
6
|
-
ExtensionStateChangedCallback,
|
|
7
6
|
PageChangeCallback,
|
|
8
7
|
PageModeChangeCallback,
|
|
9
8
|
} from '../api/callbacks';
|
|
@@ -19,7 +18,6 @@ export class SdkCallbackRegistry {
|
|
|
19
18
|
readonly documentClosed: DocumentClosedCallback[] = [];
|
|
20
19
|
readonly documentOpened: Array<(status: string, error: string) => void> = [];
|
|
21
20
|
readonly documentSaved: DocumentSavedCallback[] = [];
|
|
22
|
-
readonly extensionStateChanged: ExtensionStateChangedCallback[] = [];
|
|
23
21
|
readonly pageChange: PageChangeCallback[] = [];
|
|
24
22
|
readonly pageModeChange: PageModeChangeCallback[] = [];
|
|
25
23
|
|
|
@@ -75,13 +73,6 @@ export class SdkCallbackRegistry {
|
|
|
75
73
|
callback(Array.isArray(payload) ? payload : []),
|
|
76
74
|
);
|
|
77
75
|
return;
|
|
78
|
-
case 'extensionStateChanged': {
|
|
79
|
-
const extensionPayload = payload as { state?: 'connected' | 'disconnected' };
|
|
80
|
-
this.extensionStateChanged.forEach((callback) =>
|
|
81
|
-
callback(extensionPayload.state ?? 'disconnected'),
|
|
82
|
-
);
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
76
|
default:
|
|
86
77
|
return;
|
|
87
78
|
}
|
package/dist/api/ekey-tool.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export type OnLoadEkeyCallback = (ekeyList: string[]) => void;
|
|
2
|
-
export interface EkeyTool {
|
|
3
|
-
setOperationTimeout(timeout: number): void;
|
|
4
|
-
isEkeyConnected(callback: OnLoadEkeyCallback): void;
|
|
5
|
-
setDefaultEKEYPassword(ekeyPassword: string): void;
|
|
6
|
-
setDefaultEKEYAuthentication(ekeyLogin: boolean): void;
|
|
7
|
-
}
|
|
8
|
-
//# sourceMappingURL=ekey-tool.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ekey-tool.d.ts","sourceRoot":"","sources":["../../src/api/ekey-tool.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;AAE9D,MAAM,WAAW,QAAQ;IACvB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAE3C,eAAe,CAAC,QAAQ,EAAE,kBAAkB,GAAG,IAAI,CAAC;IAEpD,sBAAsB,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAEnD,4BAA4B,CAAC,SAAS,EAAE,OAAO,GAAG,IAAI,CAAC;CACxD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extension-tool.d.ts","sourceRoot":"","sources":["../../src/api/extension-tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,aAAa,CAAC;AAE5D,MAAM,WAAW,aAAa;IAC5B,gCAAgC,CAAC,QAAQ,EAAE,6BAA6B,GAAG,IAAI,CAAC;CACjF"}
|