@breadstone/archipel-platform-esigning 0.0.2
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 +38 -0
- package/package.json +56 -0
- package/src/EsigningModule.d.ts +46 -0
- package/src/EsigningModule.js +58 -0
- package/src/adobe-sign/env.d.ts +11 -0
- package/src/adobe-sign/env.js +28 -0
- package/src/adobe-sign/index.d.ts +1 -0
- package/src/adobe-sign/index.js +10 -0
- package/src/contracts/EsigningClientPort.d.ts +66 -0
- package/src/contracts/EsigningClientPort.js +16 -0
- package/src/contracts/EsigningPersistencePort.d.ts +31 -0
- package/src/contracts/EsigningPersistencePort.js +15 -0
- package/src/contracts/index.d.ts +2 -0
- package/src/contracts/index.js +8 -0
- package/src/docusign/env.d.ts +13 -0
- package/src/docusign/env.js +31 -0
- package/src/docusign/index.d.ts +1 -0
- package/src/docusign/index.js +11 -0
- package/src/dropbox-sign/env.d.ts +9 -0
- package/src/dropbox-sign/env.js +25 -0
- package/src/dropbox-sign/index.d.ts +1 -0
- package/src/dropbox-sign/index.js +9 -0
- package/src/env.d.ts +9 -0
- package/src/env.js +25 -0
- package/src/errors/EsigningError.d.ts +11 -0
- package/src/errors/EsigningError.js +25 -0
- package/src/errors/SigningProviderError.d.ts +15 -0
- package/src/errors/SigningProviderError.js +33 -0
- package/src/errors/SigningRequestNotFoundError.d.ts +12 -0
- package/src/errors/SigningRequestNotFoundError.js +28 -0
- package/src/errors/WebhookVerificationError.d.ts +9 -0
- package/src/errors/WebhookVerificationError.js +20 -0
- package/src/errors/index.d.ts +4 -0
- package/src/errors/index.js +12 -0
- package/src/index.d.ts +25 -0
- package/src/index.js +47 -0
- package/src/models/ICreateSigningRequest.d.ts +53 -0
- package/src/models/ICreateSigningRequest.js +4 -0
- package/src/models/ICreateSigningSessionRequest.d.ts +13 -0
- package/src/models/ICreateSigningSessionRequest.js +3 -0
- package/src/models/IEsigningWebhookEvent.d.ts +20 -0
- package/src/models/IEsigningWebhookEvent.js +4 -0
- package/src/models/ISignedDocument.d.ts +19 -0
- package/src/models/ISignedDocument.js +3 -0
- package/src/models/ISigner.d.ts +21 -0
- package/src/models/ISigner.js +4 -0
- package/src/models/ISigningDocument.d.ts +19 -0
- package/src/models/ISigningDocument.js +3 -0
- package/src/models/ISigningField.d.ts +30 -0
- package/src/models/ISigningField.js +4 -0
- package/src/models/ISigningRequest.d.ts +33 -0
- package/src/models/ISigningRequest.js +4 -0
- package/src/models/ISigningSession.d.ts +17 -0
- package/src/models/ISigningSession.js +3 -0
- package/src/models/SignerRole.d.ts +18 -0
- package/src/models/SignerRole.js +16 -0
- package/src/models/SignerStatus.d.ts +19 -0
- package/src/models/SignerStatus.js +17 -0
- package/src/models/SigningFieldType.d.ts +22 -0
- package/src/models/SigningFieldType.js +20 -0
- package/src/models/SigningRequestStatus.d.ts +21 -0
- package/src/models/SigningRequestStatus.js +19 -0
- package/src/models/WebhookEventType.d.ts +22 -0
- package/src/models/WebhookEventType.js +20 -0
- package/src/models/index.d.ts +14 -0
- package/src/models/index.js +14 -0
- package/src/providers/index.d.ts +1 -0
- package/src/providers/index.js +6 -0
- package/src/providers/internal/InternalEsigningProvider.d.ts +34 -0
- package/src/providers/internal/InternalEsigningProvider.js +171 -0
- package/src/services/EsigningService.d.ts +79 -0
- package/src/services/EsigningService.js +112 -0
- package/src/signnow/env.d.ts +13 -0
- package/src/signnow/env.js +31 -0
- package/src/signnow/index.d.ts +1 -0
- package/src/signnow/index.js +11 -0
- package/src/tokens.d.ts +2 -0
- package/src/tokens.js +8 -0
package/README.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# @breadstone/archipel-platform-esigning
|
|
2
|
+
|
|
3
|
+
Provider-agnostic e-signing infrastructure for NestJS applications.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- Abstract e-signing provider contract for multiple backends
|
|
8
|
+
- Built-in internal e-signing provider (no external dependency required)
|
|
9
|
+
- Ready-to-use adapter architecture for DocuSign, Adobe Sign, Dropbox Sign, and signNow
|
|
10
|
+
- Dynamic module registration with configurable provider selection
|
|
11
|
+
- Normalized models for signing requests, signers, documents, fields, and webhook events
|
|
12
|
+
- Persistence port for optional state tracking
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
```typescript
|
|
17
|
+
import { EsigningModule } from '@breadstone/archipel-platform-esigning';
|
|
18
|
+
import { InternalEsigningProvider } from '@breadstone/archipel-platform-esigning';
|
|
19
|
+
|
|
20
|
+
@Module({
|
|
21
|
+
imports: [
|
|
22
|
+
EsigningModule.register({
|
|
23
|
+
provider: InternalEsigningProvider,
|
|
24
|
+
isGlobal: true,
|
|
25
|
+
}),
|
|
26
|
+
],
|
|
27
|
+
})
|
|
28
|
+
export class AppModule {}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Provider Architecture
|
|
32
|
+
|
|
33
|
+
Each provider implements the `EsigningClientPort` abstract class. External providers are available as separate entry points:
|
|
34
|
+
|
|
35
|
+
- `@breadstone/archipel-platform-esigning/docusign`
|
|
36
|
+
- `@breadstone/archipel-platform-esigning/adobe-sign`
|
|
37
|
+
- `@breadstone/archipel-platform-esigning/dropbox-sign`
|
|
38
|
+
- `@breadstone/archipel-platform-esigning/signnow`
|
package/package.json
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@breadstone/archipel-platform-esigning",
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"description": "Provider-agnostic e-signing infrastructure for NestJS with support for DocuSign, Adobe Sign, Dropbox Sign, signNow, and a built-in internal provider.",
|
|
5
|
+
"type": "commonjs",
|
|
6
|
+
"main": "./src/index.js",
|
|
7
|
+
"types": "./src/index.d.ts",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "https://github.com/RueDeRennes/archipel",
|
|
12
|
+
"directory": "libs/platform-esigning"
|
|
13
|
+
},
|
|
14
|
+
"keywords": [
|
|
15
|
+
"nestjs",
|
|
16
|
+
"esigning",
|
|
17
|
+
"e-signature",
|
|
18
|
+
"docusign",
|
|
19
|
+
"adobe-sign",
|
|
20
|
+
"dropbox-sign",
|
|
21
|
+
"signnow",
|
|
22
|
+
"digital-signature",
|
|
23
|
+
"archipel"
|
|
24
|
+
],
|
|
25
|
+
"engines": {
|
|
26
|
+
"node": ">=20"
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"src/**/*.js",
|
|
30
|
+
"src/**/*.d.ts",
|
|
31
|
+
"README.md"
|
|
32
|
+
],
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"@breadstone/archipel-platform-core": "0.0.2",
|
|
35
|
+
"@nestjs/common": "11.1.18",
|
|
36
|
+
"tslib": "2.8.1"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"vitest": "4.1.2"
|
|
40
|
+
},
|
|
41
|
+
"exports": {
|
|
42
|
+
"./package.json": "./package.json",
|
|
43
|
+
".": {
|
|
44
|
+
"types": "./src/index.d.ts",
|
|
45
|
+
"default": "./src/index.js"
|
|
46
|
+
},
|
|
47
|
+
"./docusign": "./src/docusign/index.js",
|
|
48
|
+
"./docusign/index": "./src/docusign/index.js",
|
|
49
|
+
"./adobe-sign": "./src/adobe-sign/index.js",
|
|
50
|
+
"./adobe-sign/index": "./src/adobe-sign/index.js",
|
|
51
|
+
"./dropbox-sign": "./src/dropbox-sign/index.js",
|
|
52
|
+
"./dropbox-sign/index": "./src/dropbox-sign/index.js",
|
|
53
|
+
"./signnow": "./src/signnow/index.js",
|
|
54
|
+
"./signnow/index": "./src/signnow/index.js"
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { type IConfigRegistryEntry } from '@breadstone/archipel-platform-core';
|
|
2
|
+
import { type DynamicModule, type Type } from '@nestjs/common';
|
|
3
|
+
import { EsigningClientPort } from './contracts/EsigningClientPort';
|
|
4
|
+
import { EsigningPersistencePort } from './contracts/EsigningPersistencePort';
|
|
5
|
+
/**
|
|
6
|
+
* Configuration options for the {@link EsigningModule}.
|
|
7
|
+
*
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
export interface IEsigningModuleOptions {
|
|
11
|
+
/**
|
|
12
|
+
* Concrete implementation of the {@link EsigningClientPort}.
|
|
13
|
+
* For example, `InternalEsigningProvider`, `DocuSignClient`, `AdobeSignClient`, etc.
|
|
14
|
+
*/
|
|
15
|
+
provider: Type<EsigningClientPort>;
|
|
16
|
+
/**
|
|
17
|
+
* Provider-specific configuration entries to register with the config module.
|
|
18
|
+
*/
|
|
19
|
+
configEntries?: ReadonlyArray<Omit<IConfigRegistryEntry, 'module'>>;
|
|
20
|
+
/**
|
|
21
|
+
* Concrete implementation of the {@link EsigningPersistencePort}.
|
|
22
|
+
* Required when the application needs to persist signing request state.
|
|
23
|
+
*/
|
|
24
|
+
persistence?: Type<EsigningPersistencePort>;
|
|
25
|
+
/**
|
|
26
|
+
* When `true` the module is registered globally.
|
|
27
|
+
*/
|
|
28
|
+
isGlobal?: boolean;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* NestJS module providing generic e-signing infrastructure.
|
|
32
|
+
* Exposes a configurable signing client and optional persistence tracking.
|
|
33
|
+
* The specific e-signing provider is selected via the options.
|
|
34
|
+
*
|
|
35
|
+
* @public
|
|
36
|
+
*/
|
|
37
|
+
export declare class EsigningModule {
|
|
38
|
+
/**
|
|
39
|
+
* Configures the module with the specified options.
|
|
40
|
+
*
|
|
41
|
+
* @public
|
|
42
|
+
* @param options - The module configuration options.
|
|
43
|
+
* @returns Dynamic module definition.
|
|
44
|
+
*/
|
|
45
|
+
static register(options: IEsigningModuleOptions): DynamicModule;
|
|
46
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// #region Imports
|
|
3
|
+
var EsigningModule_1;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.EsigningModule = void 0;
|
|
6
|
+
const tslib_1 = require("tslib");
|
|
7
|
+
const archipel_platform_core_1 = require("@breadstone/archipel-platform-core");
|
|
8
|
+
const common_1 = require("@nestjs/common");
|
|
9
|
+
const EsigningClientPort_1 = require("./contracts/EsigningClientPort");
|
|
10
|
+
const EsigningPersistencePort_1 = require("./contracts/EsigningPersistencePort");
|
|
11
|
+
const EsigningService_1 = require("./services/EsigningService");
|
|
12
|
+
// #endregion
|
|
13
|
+
/**
|
|
14
|
+
* NestJS module providing generic e-signing infrastructure.
|
|
15
|
+
* Exposes a configurable signing client and optional persistence tracking.
|
|
16
|
+
* The specific e-signing provider is selected via the options.
|
|
17
|
+
*
|
|
18
|
+
* @public
|
|
19
|
+
*/
|
|
20
|
+
let EsigningModule = EsigningModule_1 = class EsigningModule {
|
|
21
|
+
// #region Methods
|
|
22
|
+
/**
|
|
23
|
+
* Configures the module with the specified options.
|
|
24
|
+
*
|
|
25
|
+
* @public
|
|
26
|
+
* @param options - The module configuration options.
|
|
27
|
+
* @returns Dynamic module definition.
|
|
28
|
+
*/
|
|
29
|
+
static register(options) {
|
|
30
|
+
const providers = [
|
|
31
|
+
{
|
|
32
|
+
provide: EsigningClientPort_1.EsigningClientPort,
|
|
33
|
+
useClass: options.provider,
|
|
34
|
+
},
|
|
35
|
+
EsigningService_1.EsigningService,
|
|
36
|
+
...(options.persistence
|
|
37
|
+
? [
|
|
38
|
+
{
|
|
39
|
+
provide: EsigningPersistencePort_1.EsigningPersistencePort,
|
|
40
|
+
useClass: options.persistence,
|
|
41
|
+
},
|
|
42
|
+
]
|
|
43
|
+
: []),
|
|
44
|
+
];
|
|
45
|
+
return {
|
|
46
|
+
global: options.isGlobal ?? false,
|
|
47
|
+
module: EsigningModule_1,
|
|
48
|
+
imports: [archipel_platform_core_1.ConfigModule.register('platform-esigning', options.configEntries ?? [])],
|
|
49
|
+
providers: providers,
|
|
50
|
+
exports: [EsigningClientPort_1.EsigningClientPort, EsigningService_1.EsigningService],
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
exports.EsigningModule = EsigningModule;
|
|
55
|
+
exports.EsigningModule = EsigningModule = EsigningModule_1 = tslib_1.__decorate([
|
|
56
|
+
(0, common_1.Module)({})
|
|
57
|
+
], EsigningModule);
|
|
58
|
+
//# sourceMappingURL=EsigningModule.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type IConfigRegistryEntry } from '@breadstone/archipel-platform-core';
|
|
2
|
+
/** Adobe Sign integration key. */
|
|
3
|
+
export declare const ADOBE_SIGN_INTEGRATION_KEY: import("@breadstone/archipel-platform-core").IConfigKey<string>;
|
|
4
|
+
/** Adobe Sign client secret. */
|
|
5
|
+
export declare const ADOBE_SIGN_CLIENT_SECRET: import("@breadstone/archipel-platform-core").IConfigKey<string>;
|
|
6
|
+
/** Adobe Sign base URL. */
|
|
7
|
+
export declare const ADOBE_SIGN_BASE_URL: import("@breadstone/archipel-platform-core").IConfigKey<string>;
|
|
8
|
+
/** Adobe Sign webhook client ID for verification. */
|
|
9
|
+
export declare const ADOBE_SIGN_WEBHOOK_CLIENT_ID: import("@breadstone/archipel-platform-core").IConfigKey<string>;
|
|
10
|
+
/** Configuration entries required by the Adobe Sign e-signing provider. */
|
|
11
|
+
export declare const ADOBE_SIGN_CONFIG_ENTRIES: ReadonlyArray<Omit<IConfigRegistryEntry, 'module'>>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// #region Imports
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.ADOBE_SIGN_CONFIG_ENTRIES = exports.ADOBE_SIGN_WEBHOOK_CLIENT_ID = exports.ADOBE_SIGN_BASE_URL = exports.ADOBE_SIGN_CLIENT_SECRET = exports.ADOBE_SIGN_INTEGRATION_KEY = void 0;
|
|
5
|
+
const archipel_platform_core_1 = require("@breadstone/archipel-platform-core");
|
|
6
|
+
// #endregion
|
|
7
|
+
// ──────────────────────────────────────────────────────────────
|
|
8
|
+
// Adobe Sign
|
|
9
|
+
// ──────────────────────────────────────────────────────────────
|
|
10
|
+
/** Adobe Sign integration key. */
|
|
11
|
+
exports.ADOBE_SIGN_INTEGRATION_KEY = (0, archipel_platform_core_1.createConfigKey)('ADOBE_SIGN_INTEGRATION_KEY');
|
|
12
|
+
/** Adobe Sign client secret. */
|
|
13
|
+
exports.ADOBE_SIGN_CLIENT_SECRET = (0, archipel_platform_core_1.createConfigKey)('ADOBE_SIGN_CLIENT_SECRET');
|
|
14
|
+
/** Adobe Sign base URL. */
|
|
15
|
+
exports.ADOBE_SIGN_BASE_URL = (0, archipel_platform_core_1.createConfigKey)('ADOBE_SIGN_BASE_URL');
|
|
16
|
+
/** Adobe Sign webhook client ID for verification. */
|
|
17
|
+
exports.ADOBE_SIGN_WEBHOOK_CLIENT_ID = (0, archipel_platform_core_1.createConfigKey)('ADOBE_SIGN_WEBHOOK_CLIENT_ID');
|
|
18
|
+
// ──────────────────────────────────────────────────────────────
|
|
19
|
+
// Registry entries
|
|
20
|
+
// ──────────────────────────────────────────────────────────────
|
|
21
|
+
/** Configuration entries required by the Adobe Sign e-signing provider. */
|
|
22
|
+
exports.ADOBE_SIGN_CONFIG_ENTRIES = [
|
|
23
|
+
{ key: exports.ADOBE_SIGN_INTEGRATION_KEY, required: true, description: 'Adobe Sign integration key.' },
|
|
24
|
+
{ key: exports.ADOBE_SIGN_CLIENT_SECRET, required: true, description: 'Adobe Sign client secret.' },
|
|
25
|
+
{ key: exports.ADOBE_SIGN_BASE_URL, required: true, description: 'Adobe Sign base URL.' },
|
|
26
|
+
{ key: exports.ADOBE_SIGN_WEBHOOK_CLIENT_ID, required: false, description: 'Adobe Sign webhook client ID for verification.' },
|
|
27
|
+
];
|
|
28
|
+
//# sourceMappingURL=env.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ADOBE_SIGN_BASE_URL, ADOBE_SIGN_CLIENT_SECRET, ADOBE_SIGN_CONFIG_ENTRIES, ADOBE_SIGN_INTEGRATION_KEY, ADOBE_SIGN_WEBHOOK_CLIENT_ID, } from './env';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ADOBE_SIGN_WEBHOOK_CLIENT_ID = exports.ADOBE_SIGN_INTEGRATION_KEY = exports.ADOBE_SIGN_CONFIG_ENTRIES = exports.ADOBE_SIGN_CLIENT_SECRET = exports.ADOBE_SIGN_BASE_URL = void 0;
|
|
4
|
+
var env_1 = require("./env");
|
|
5
|
+
Object.defineProperty(exports, "ADOBE_SIGN_BASE_URL", { enumerable: true, get: function () { return env_1.ADOBE_SIGN_BASE_URL; } });
|
|
6
|
+
Object.defineProperty(exports, "ADOBE_SIGN_CLIENT_SECRET", { enumerable: true, get: function () { return env_1.ADOBE_SIGN_CLIENT_SECRET; } });
|
|
7
|
+
Object.defineProperty(exports, "ADOBE_SIGN_CONFIG_ENTRIES", { enumerable: true, get: function () { return env_1.ADOBE_SIGN_CONFIG_ENTRIES; } });
|
|
8
|
+
Object.defineProperty(exports, "ADOBE_SIGN_INTEGRATION_KEY", { enumerable: true, get: function () { return env_1.ADOBE_SIGN_INTEGRATION_KEY; } });
|
|
9
|
+
Object.defineProperty(exports, "ADOBE_SIGN_WEBHOOK_CLIENT_ID", { enumerable: true, get: function () { return env_1.ADOBE_SIGN_WEBHOOK_CLIENT_ID; } });
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { ICreateSigningRequest } from '../models/ICreateSigningRequest';
|
|
2
|
+
import type { ICreateSigningSessionRequest } from '../models/ICreateSigningSessionRequest';
|
|
3
|
+
import type { IEsigningWebhookEvent } from '../models/IEsigningWebhookEvent';
|
|
4
|
+
import type { ISignedDocument } from '../models/ISignedDocument';
|
|
5
|
+
import type { ISigningRequest } from '../models/ISigningRequest';
|
|
6
|
+
import type { ISigningSession } from '../models/ISigningSession';
|
|
7
|
+
/**
|
|
8
|
+
* Abstract port for e-signing provider clients.
|
|
9
|
+
* Each provider (DocuSign, Adobe Sign, Dropbox Sign, signNow, Internal) must implement
|
|
10
|
+
* this contract so that the consuming application can switch providers without changing business logic.
|
|
11
|
+
*
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
export declare abstract class EsigningClientPort {
|
|
15
|
+
/** Unique identifier of the provider implementation. */
|
|
16
|
+
abstract readonly providerId: string;
|
|
17
|
+
/**
|
|
18
|
+
* Create a new signing request (envelope/agreement).
|
|
19
|
+
*
|
|
20
|
+
* @public
|
|
21
|
+
* @param request - The signing request creation input.
|
|
22
|
+
* @returns The created signing request with provider-assigned identifiers.
|
|
23
|
+
*/
|
|
24
|
+
abstract createSigningRequest(request: ICreateSigningRequest): Promise<ISigningRequest>;
|
|
25
|
+
/**
|
|
26
|
+
* Generate a signing session (signing link/URL) for a specific signer.
|
|
27
|
+
*
|
|
28
|
+
* @public
|
|
29
|
+
* @param request - The session creation input.
|
|
30
|
+
* @returns The signing session with the signing URL.
|
|
31
|
+
*/
|
|
32
|
+
abstract createSigningSession(request: ICreateSigningSessionRequest): Promise<ISigningSession>;
|
|
33
|
+
/**
|
|
34
|
+
* Retrieve the current status and details of a signing request.
|
|
35
|
+
*
|
|
36
|
+
* @public
|
|
37
|
+
* @param signingRequestId - The provider-specific signing request identifier.
|
|
38
|
+
* @returns The signing request with current status.
|
|
39
|
+
*/
|
|
40
|
+
abstract getSigningRequest(signingRequestId: string): Promise<ISigningRequest>;
|
|
41
|
+
/**
|
|
42
|
+
* Retrieve the final signed documents for a completed signing request.
|
|
43
|
+
*
|
|
44
|
+
* @public
|
|
45
|
+
* @param signingRequestId - The provider-specific signing request identifier.
|
|
46
|
+
* @returns Array of signed documents with their content.
|
|
47
|
+
*/
|
|
48
|
+
abstract getSignedDocuments(signingRequestId: string): Promise<Array<ISignedDocument>>;
|
|
49
|
+
/**
|
|
50
|
+
* Cancel an in-progress signing request.
|
|
51
|
+
*
|
|
52
|
+
* @public
|
|
53
|
+
* @param signingRequestId - The provider-specific signing request identifier.
|
|
54
|
+
* @param reason - Optional reason for cancellation.
|
|
55
|
+
*/
|
|
56
|
+
abstract cancelSigningRequest(signingRequestId: string, reason?: string): Promise<void>;
|
|
57
|
+
/**
|
|
58
|
+
* Verify a webhook payload signature and return a normalized event.
|
|
59
|
+
*
|
|
60
|
+
* @public
|
|
61
|
+
* @param payload - Raw webhook body.
|
|
62
|
+
* @param signature - Webhook signature header value.
|
|
63
|
+
* @returns Normalized webhook event.
|
|
64
|
+
*/
|
|
65
|
+
abstract verifyWebhook(payload: string | Buffer, signature: string): Promise<IEsigningWebhookEvent>;
|
|
66
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// #region Imports
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.EsigningClientPort = void 0;
|
|
5
|
+
// #endregion
|
|
6
|
+
/**
|
|
7
|
+
* Abstract port for e-signing provider clients.
|
|
8
|
+
* Each provider (DocuSign, Adobe Sign, Dropbox Sign, signNow, Internal) must implement
|
|
9
|
+
* this contract so that the consuming application can switch providers without changing business logic.
|
|
10
|
+
*
|
|
11
|
+
* @public
|
|
12
|
+
*/
|
|
13
|
+
class EsigningClientPort {
|
|
14
|
+
}
|
|
15
|
+
exports.EsigningClientPort = EsigningClientPort;
|
|
16
|
+
//# sourceMappingURL=EsigningClientPort.js.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { ISigningRequest } from '../models/ISigningRequest';
|
|
2
|
+
/**
|
|
3
|
+
* Abstract port for persisting signing request state.
|
|
4
|
+
* Implement this port in the consuming application to track signing requests in a database.
|
|
5
|
+
*
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
export declare abstract class EsigningPersistencePort {
|
|
9
|
+
/**
|
|
10
|
+
* Persist a newly created signing request.
|
|
11
|
+
*
|
|
12
|
+
* @public
|
|
13
|
+
* @param signingRequest - The signing request to persist.
|
|
14
|
+
*/
|
|
15
|
+
abstract onSigningRequestCreated(signingRequest: ISigningRequest): Promise<void>;
|
|
16
|
+
/**
|
|
17
|
+
* Update persisted state when a signing request status changes.
|
|
18
|
+
*
|
|
19
|
+
* @public
|
|
20
|
+
* @param signingRequestId - The provider-specific signing request identifier.
|
|
21
|
+
* @param status - The new status of the signing request.
|
|
22
|
+
*/
|
|
23
|
+
abstract onSigningRequestStatusChanged(signingRequestId: string, status: string): Promise<void>;
|
|
24
|
+
/**
|
|
25
|
+
* Update persisted state when a signing request is cancelled.
|
|
26
|
+
*
|
|
27
|
+
* @public
|
|
28
|
+
* @param signingRequestId - The provider-specific signing request identifier.
|
|
29
|
+
*/
|
|
30
|
+
abstract onSigningRequestCancelled(signingRequestId: string): Promise<void>;
|
|
31
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// #region Imports
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.EsigningPersistencePort = void 0;
|
|
5
|
+
// #endregion
|
|
6
|
+
/**
|
|
7
|
+
* Abstract port for persisting signing request state.
|
|
8
|
+
* Implement this port in the consuming application to track signing requests in a database.
|
|
9
|
+
*
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
class EsigningPersistencePort {
|
|
13
|
+
}
|
|
14
|
+
exports.EsigningPersistencePort = EsigningPersistencePort;
|
|
15
|
+
//# sourceMappingURL=EsigningPersistencePort.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EsigningPersistencePort = exports.EsigningClientPort = void 0;
|
|
4
|
+
var EsigningClientPort_1 = require("./EsigningClientPort");
|
|
5
|
+
Object.defineProperty(exports, "EsigningClientPort", { enumerable: true, get: function () { return EsigningClientPort_1.EsigningClientPort; } });
|
|
6
|
+
var EsigningPersistencePort_1 = require("./EsigningPersistencePort");
|
|
7
|
+
Object.defineProperty(exports, "EsigningPersistencePort", { enumerable: true, get: function () { return EsigningPersistencePort_1.EsigningPersistencePort; } });
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type IConfigRegistryEntry } from '@breadstone/archipel-platform-core';
|
|
2
|
+
/** DocuSign integration key (client ID). */
|
|
3
|
+
export declare const DOCUSIGN_INTEGRATION_KEY: import("@breadstone/archipel-platform-core").IConfigKey<string>;
|
|
4
|
+
/** DocuSign secret key (client secret). */
|
|
5
|
+
export declare const DOCUSIGN_SECRET_KEY: import("@breadstone/archipel-platform-core").IConfigKey<string>;
|
|
6
|
+
/** DocuSign account ID. */
|
|
7
|
+
export declare const DOCUSIGN_ACCOUNT_ID: import("@breadstone/archipel-platform-core").IConfigKey<string>;
|
|
8
|
+
/** DocuSign base URL (e.g. https://demo.docusign.net for sandbox). */
|
|
9
|
+
export declare const DOCUSIGN_BASE_URL: import("@breadstone/archipel-platform-core").IConfigKey<string>;
|
|
10
|
+
/** DocuSign webhook HMAC key. */
|
|
11
|
+
export declare const DOCUSIGN_WEBHOOK_HMAC_KEY: import("@breadstone/archipel-platform-core").IConfigKey<string>;
|
|
12
|
+
/** Configuration entries required by the DocuSign e-signing provider. */
|
|
13
|
+
export declare const DOCUSIGN_CONFIG_ENTRIES: ReadonlyArray<Omit<IConfigRegistryEntry, 'module'>>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// #region Imports
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.DOCUSIGN_CONFIG_ENTRIES = exports.DOCUSIGN_WEBHOOK_HMAC_KEY = exports.DOCUSIGN_BASE_URL = exports.DOCUSIGN_ACCOUNT_ID = exports.DOCUSIGN_SECRET_KEY = exports.DOCUSIGN_INTEGRATION_KEY = void 0;
|
|
5
|
+
const archipel_platform_core_1 = require("@breadstone/archipel-platform-core");
|
|
6
|
+
// #endregion
|
|
7
|
+
// ──────────────────────────────────────────────────────────────
|
|
8
|
+
// DocuSign
|
|
9
|
+
// ──────────────────────────────────────────────────────────────
|
|
10
|
+
/** DocuSign integration key (client ID). */
|
|
11
|
+
exports.DOCUSIGN_INTEGRATION_KEY = (0, archipel_platform_core_1.createConfigKey)('DOCUSIGN_INTEGRATION_KEY');
|
|
12
|
+
/** DocuSign secret key (client secret). */
|
|
13
|
+
exports.DOCUSIGN_SECRET_KEY = (0, archipel_platform_core_1.createConfigKey)('DOCUSIGN_SECRET_KEY');
|
|
14
|
+
/** DocuSign account ID. */
|
|
15
|
+
exports.DOCUSIGN_ACCOUNT_ID = (0, archipel_platform_core_1.createConfigKey)('DOCUSIGN_ACCOUNT_ID');
|
|
16
|
+
/** DocuSign base URL (e.g. https://demo.docusign.net for sandbox). */
|
|
17
|
+
exports.DOCUSIGN_BASE_URL = (0, archipel_platform_core_1.createConfigKey)('DOCUSIGN_BASE_URL');
|
|
18
|
+
/** DocuSign webhook HMAC key. */
|
|
19
|
+
exports.DOCUSIGN_WEBHOOK_HMAC_KEY = (0, archipel_platform_core_1.createConfigKey)('DOCUSIGN_WEBHOOK_HMAC_KEY');
|
|
20
|
+
// ──────────────────────────────────────────────────────────────
|
|
21
|
+
// Registry entries
|
|
22
|
+
// ──────────────────────────────────────────────────────────────
|
|
23
|
+
/** Configuration entries required by the DocuSign e-signing provider. */
|
|
24
|
+
exports.DOCUSIGN_CONFIG_ENTRIES = [
|
|
25
|
+
{ key: exports.DOCUSIGN_INTEGRATION_KEY, required: true, description: 'DocuSign integration key (client ID).' },
|
|
26
|
+
{ key: exports.DOCUSIGN_SECRET_KEY, required: true, description: 'DocuSign secret key (client secret).' },
|
|
27
|
+
{ key: exports.DOCUSIGN_ACCOUNT_ID, required: true, description: 'DocuSign account ID.' },
|
|
28
|
+
{ key: exports.DOCUSIGN_BASE_URL, required: true, description: 'DocuSign base URL.' },
|
|
29
|
+
{ key: exports.DOCUSIGN_WEBHOOK_HMAC_KEY, required: false, description: 'DocuSign webhook HMAC key.' },
|
|
30
|
+
];
|
|
31
|
+
//# sourceMappingURL=env.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DOCUSIGN_ACCOUNT_ID, DOCUSIGN_BASE_URL, DOCUSIGN_CONFIG_ENTRIES, DOCUSIGN_INTEGRATION_KEY, DOCUSIGN_SECRET_KEY, DOCUSIGN_WEBHOOK_HMAC_KEY, } from './env';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DOCUSIGN_WEBHOOK_HMAC_KEY = exports.DOCUSIGN_SECRET_KEY = exports.DOCUSIGN_INTEGRATION_KEY = exports.DOCUSIGN_CONFIG_ENTRIES = exports.DOCUSIGN_BASE_URL = exports.DOCUSIGN_ACCOUNT_ID = void 0;
|
|
4
|
+
var env_1 = require("./env");
|
|
5
|
+
Object.defineProperty(exports, "DOCUSIGN_ACCOUNT_ID", { enumerable: true, get: function () { return env_1.DOCUSIGN_ACCOUNT_ID; } });
|
|
6
|
+
Object.defineProperty(exports, "DOCUSIGN_BASE_URL", { enumerable: true, get: function () { return env_1.DOCUSIGN_BASE_URL; } });
|
|
7
|
+
Object.defineProperty(exports, "DOCUSIGN_CONFIG_ENTRIES", { enumerable: true, get: function () { return env_1.DOCUSIGN_CONFIG_ENTRIES; } });
|
|
8
|
+
Object.defineProperty(exports, "DOCUSIGN_INTEGRATION_KEY", { enumerable: true, get: function () { return env_1.DOCUSIGN_INTEGRATION_KEY; } });
|
|
9
|
+
Object.defineProperty(exports, "DOCUSIGN_SECRET_KEY", { enumerable: true, get: function () { return env_1.DOCUSIGN_SECRET_KEY; } });
|
|
10
|
+
Object.defineProperty(exports, "DOCUSIGN_WEBHOOK_HMAC_KEY", { enumerable: true, get: function () { return env_1.DOCUSIGN_WEBHOOK_HMAC_KEY; } });
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type IConfigRegistryEntry } from '@breadstone/archipel-platform-core';
|
|
2
|
+
/** Dropbox Sign API key. */
|
|
3
|
+
export declare const DROPBOX_SIGN_API_KEY: import("@breadstone/archipel-platform-core").IConfigKey<string>;
|
|
4
|
+
/** Dropbox Sign client ID. */
|
|
5
|
+
export declare const DROPBOX_SIGN_CLIENT_ID: import("@breadstone/archipel-platform-core").IConfigKey<string>;
|
|
6
|
+
/** Dropbox Sign webhook secret. */
|
|
7
|
+
export declare const DROPBOX_SIGN_WEBHOOK_SECRET: import("@breadstone/archipel-platform-core").IConfigKey<string>;
|
|
8
|
+
/** Configuration entries required by the Dropbox Sign e-signing provider. */
|
|
9
|
+
export declare const DROPBOX_SIGN_CONFIG_ENTRIES: ReadonlyArray<Omit<IConfigRegistryEntry, 'module'>>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// #region Imports
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.DROPBOX_SIGN_CONFIG_ENTRIES = exports.DROPBOX_SIGN_WEBHOOK_SECRET = exports.DROPBOX_SIGN_CLIENT_ID = exports.DROPBOX_SIGN_API_KEY = void 0;
|
|
5
|
+
const archipel_platform_core_1 = require("@breadstone/archipel-platform-core");
|
|
6
|
+
// #endregion
|
|
7
|
+
// ──────────────────────────────────────────────────────────────
|
|
8
|
+
// Dropbox Sign
|
|
9
|
+
// ──────────────────────────────────────────────────────────────
|
|
10
|
+
/** Dropbox Sign API key. */
|
|
11
|
+
exports.DROPBOX_SIGN_API_KEY = (0, archipel_platform_core_1.createConfigKey)('DROPBOX_SIGN_API_KEY');
|
|
12
|
+
/** Dropbox Sign client ID. */
|
|
13
|
+
exports.DROPBOX_SIGN_CLIENT_ID = (0, archipel_platform_core_1.createConfigKey)('DROPBOX_SIGN_CLIENT_ID');
|
|
14
|
+
/** Dropbox Sign webhook secret. */
|
|
15
|
+
exports.DROPBOX_SIGN_WEBHOOK_SECRET = (0, archipel_platform_core_1.createConfigKey)('DROPBOX_SIGN_WEBHOOK_SECRET');
|
|
16
|
+
// ──────────────────────────────────────────────────────────────
|
|
17
|
+
// Registry entries
|
|
18
|
+
// ──────────────────────────────────────────────────────────────
|
|
19
|
+
/** Configuration entries required by the Dropbox Sign e-signing provider. */
|
|
20
|
+
exports.DROPBOX_SIGN_CONFIG_ENTRIES = [
|
|
21
|
+
{ key: exports.DROPBOX_SIGN_API_KEY, required: true, description: 'Dropbox Sign API key.' },
|
|
22
|
+
{ key: exports.DROPBOX_SIGN_CLIENT_ID, required: true, description: 'Dropbox Sign client ID.' },
|
|
23
|
+
{ key: exports.DROPBOX_SIGN_WEBHOOK_SECRET, required: false, description: 'Dropbox Sign webhook secret.' },
|
|
24
|
+
];
|
|
25
|
+
//# sourceMappingURL=env.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DROPBOX_SIGN_API_KEY, DROPBOX_SIGN_CLIENT_ID, DROPBOX_SIGN_CONFIG_ENTRIES, DROPBOX_SIGN_WEBHOOK_SECRET, } from './env';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DROPBOX_SIGN_WEBHOOK_SECRET = exports.DROPBOX_SIGN_CONFIG_ENTRIES = exports.DROPBOX_SIGN_CLIENT_ID = exports.DROPBOX_SIGN_API_KEY = void 0;
|
|
4
|
+
var env_1 = require("./env");
|
|
5
|
+
Object.defineProperty(exports, "DROPBOX_SIGN_API_KEY", { enumerable: true, get: function () { return env_1.DROPBOX_SIGN_API_KEY; } });
|
|
6
|
+
Object.defineProperty(exports, "DROPBOX_SIGN_CLIENT_ID", { enumerable: true, get: function () { return env_1.DROPBOX_SIGN_CLIENT_ID; } });
|
|
7
|
+
Object.defineProperty(exports, "DROPBOX_SIGN_CONFIG_ENTRIES", { enumerable: true, get: function () { return env_1.DROPBOX_SIGN_CONFIG_ENTRIES; } });
|
|
8
|
+
Object.defineProperty(exports, "DROPBOX_SIGN_WEBHOOK_SECRET", { enumerable: true, get: function () { return env_1.DROPBOX_SIGN_WEBHOOK_SECRET; } });
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
package/src/env.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type IConfigRegistryEntry } from '@breadstone/archipel-platform-core';
|
|
2
|
+
/** Active e-signing provider API key. */
|
|
3
|
+
export declare const ESIGNING_API_KEY: import("@breadstone/archipel-platform-core").IConfigKey<string>;
|
|
4
|
+
/** Active e-signing provider webhook signing secret. */
|
|
5
|
+
export declare const ESIGNING_WEBHOOK_SECRET: import("@breadstone/archipel-platform-core").IConfigKey<string>;
|
|
6
|
+
/** Active e-signing provider base URL. */
|
|
7
|
+
export declare const ESIGNING_API_BASE_URL: import("@breadstone/archipel-platform-core").IConfigKey<string>;
|
|
8
|
+
/** All configuration entries required by `platform-esigning`. */
|
|
9
|
+
export declare const PLATFORM_ESIGNING_CONFIG_ENTRIES: ReadonlyArray<Omit<IConfigRegistryEntry, 'module'>>;
|
package/src/env.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// #region Imports
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.PLATFORM_ESIGNING_CONFIG_ENTRIES = exports.ESIGNING_API_BASE_URL = exports.ESIGNING_WEBHOOK_SECRET = exports.ESIGNING_API_KEY = void 0;
|
|
5
|
+
const archipel_platform_core_1 = require("@breadstone/archipel-platform-core");
|
|
6
|
+
// #endregion
|
|
7
|
+
// ──────────────────────────────────────────────────────────────
|
|
8
|
+
// Generic E-Signing Keys
|
|
9
|
+
// ──────────────────────────────────────────────────────────────
|
|
10
|
+
/** Active e-signing provider API key. */
|
|
11
|
+
exports.ESIGNING_API_KEY = (0, archipel_platform_core_1.createConfigKey)('ESIGNING_API_KEY');
|
|
12
|
+
/** Active e-signing provider webhook signing secret. */
|
|
13
|
+
exports.ESIGNING_WEBHOOK_SECRET = (0, archipel_platform_core_1.createConfigKey)('ESIGNING_WEBHOOK_SECRET');
|
|
14
|
+
/** Active e-signing provider base URL. */
|
|
15
|
+
exports.ESIGNING_API_BASE_URL = (0, archipel_platform_core_1.createConfigKey)('ESIGNING_API_BASE_URL');
|
|
16
|
+
// ──────────────────────────────────────────────────────────────
|
|
17
|
+
// Registry entries
|
|
18
|
+
// ──────────────────────────────────────────────────────────────
|
|
19
|
+
/** All configuration entries required by `platform-esigning`. */
|
|
20
|
+
exports.PLATFORM_ESIGNING_CONFIG_ENTRIES = [
|
|
21
|
+
{ key: exports.ESIGNING_API_KEY, required: false, description: 'Active e-signing provider API key.' },
|
|
22
|
+
{ key: exports.ESIGNING_WEBHOOK_SECRET, required: false, description: 'Active e-signing provider webhook signing secret.' },
|
|
23
|
+
{ key: exports.ESIGNING_API_BASE_URL, required: false, description: 'Active e-signing provider base URL.' },
|
|
24
|
+
];
|
|
25
|
+
//# sourceMappingURL=env.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base error for all e-signing related failures.
|
|
3
|
+
*
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export declare class EsigningError extends Error {
|
|
7
|
+
private readonly _code;
|
|
8
|
+
constructor(message: string, code: string);
|
|
9
|
+
/** Machine-readable error code. */
|
|
10
|
+
get code(): string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EsigningError = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Base error for all e-signing related failures.
|
|
6
|
+
*
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
class EsigningError extends Error {
|
|
10
|
+
// #endregion
|
|
11
|
+
// #region Ctor
|
|
12
|
+
constructor(message, code) {
|
|
13
|
+
super(message);
|
|
14
|
+
this.name = 'EsigningError';
|
|
15
|
+
this._code = code;
|
|
16
|
+
}
|
|
17
|
+
// #endregion
|
|
18
|
+
// #region Properties
|
|
19
|
+
/** Machine-readable error code. */
|
|
20
|
+
get code() {
|
|
21
|
+
return this._code;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.EsigningError = EsigningError;
|
|
25
|
+
//# sourceMappingURL=EsigningError.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { EsigningError } from './EsigningError';
|
|
2
|
+
/**
|
|
3
|
+
* Thrown when a provider-level operation fails.
|
|
4
|
+
*
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export declare class SigningProviderError extends EsigningError {
|
|
8
|
+
private readonly _providerId;
|
|
9
|
+
private readonly _cause;
|
|
10
|
+
constructor(providerId: string, message: string, cause?: unknown);
|
|
11
|
+
/** Identifier of the provider that failed. */
|
|
12
|
+
get providerId(): string;
|
|
13
|
+
/** Original error or cause, if available. */
|
|
14
|
+
get rootCause(): unknown;
|
|
15
|
+
}
|