@xbg.solutions/utils-document-connector 1.0.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.
- package/lib/document-connector.d.ts +83 -0
- package/lib/document-connector.d.ts.map +1 -0
- package/lib/document-connector.js +196 -0
- package/lib/document-connector.js.map +1 -0
- package/lib/index.d.ts +11 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +59 -0
- package/lib/index.js.map +1 -0
- package/lib/providers/pandadoc-provider.d.ts +38 -0
- package/lib/providers/pandadoc-provider.d.ts.map +1 -0
- package/lib/providers/pandadoc-provider.js +216 -0
- package/lib/providers/pandadoc-provider.js.map +1 -0
- package/lib/types.d.ts +108 -0
- package/lib/types.d.ts.map +1 -0
- package/lib/types.js +7 -0
- package/lib/types.js.map +1 -0
- package/package.json +30 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Document Connector
|
|
3
|
+
* Document creation, management, and e-signature
|
|
4
|
+
*/
|
|
5
|
+
import { Document, CreateDocumentRequest, SendDocumentRequest, DocumentTemplate, DownloadOptions, DocumentQueryOptions, DocumentResponse } from './types';
|
|
6
|
+
/**
|
|
7
|
+
* Document Provider Interface
|
|
8
|
+
*/
|
|
9
|
+
export interface DocumentProvider {
|
|
10
|
+
/**
|
|
11
|
+
* Get document by ID
|
|
12
|
+
*/
|
|
13
|
+
getDocument(documentId: string): Promise<Document>;
|
|
14
|
+
/**
|
|
15
|
+
* Get documents with filtering
|
|
16
|
+
*/
|
|
17
|
+
getDocuments(options?: DocumentQueryOptions): Promise<Document[]>;
|
|
18
|
+
/**
|
|
19
|
+
* Create document from template or scratch
|
|
20
|
+
*/
|
|
21
|
+
createDocument(request: CreateDocumentRequest): Promise<Document>;
|
|
22
|
+
/**
|
|
23
|
+
* Send document to recipients
|
|
24
|
+
*/
|
|
25
|
+
sendDocument(request: SendDocumentRequest): Promise<Document>;
|
|
26
|
+
/**
|
|
27
|
+
* Download document
|
|
28
|
+
*/
|
|
29
|
+
downloadDocument(documentId: string, options?: DownloadOptions): Promise<Buffer>;
|
|
30
|
+
/**
|
|
31
|
+
* Void/cancel document
|
|
32
|
+
*/
|
|
33
|
+
voidDocument(documentId: string, reason?: string): Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* Get templates
|
|
36
|
+
*/
|
|
37
|
+
getTemplates(): Promise<DocumentTemplate[]>;
|
|
38
|
+
/**
|
|
39
|
+
* Get template by ID
|
|
40
|
+
*/
|
|
41
|
+
getTemplate(templateId: string): Promise<DocumentTemplate>;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Document Connector
|
|
45
|
+
* Unified interface for document management platforms
|
|
46
|
+
*/
|
|
47
|
+
export declare class DocumentConnector {
|
|
48
|
+
private provider;
|
|
49
|
+
constructor(provider: DocumentProvider);
|
|
50
|
+
/**
|
|
51
|
+
* Get document by ID
|
|
52
|
+
*/
|
|
53
|
+
getDocument(documentId: string): Promise<DocumentResponse<Document>>;
|
|
54
|
+
/**
|
|
55
|
+
* Get documents
|
|
56
|
+
*/
|
|
57
|
+
getDocuments(options?: DocumentQueryOptions): Promise<DocumentResponse<Document[]>>;
|
|
58
|
+
/**
|
|
59
|
+
* Create document
|
|
60
|
+
*/
|
|
61
|
+
createDocument(request: CreateDocumentRequest): Promise<DocumentResponse<Document>>;
|
|
62
|
+
/**
|
|
63
|
+
* Send document to recipients
|
|
64
|
+
*/
|
|
65
|
+
sendDocument(request: SendDocumentRequest): Promise<DocumentResponse<Document>>;
|
|
66
|
+
/**
|
|
67
|
+
* Download document
|
|
68
|
+
*/
|
|
69
|
+
downloadDocument(documentId: string, options?: DownloadOptions): Promise<DocumentResponse<Buffer>>;
|
|
70
|
+
/**
|
|
71
|
+
* Void document
|
|
72
|
+
*/
|
|
73
|
+
voidDocument(documentId: string, reason?: string): Promise<DocumentResponse<void>>;
|
|
74
|
+
/**
|
|
75
|
+
* Get templates
|
|
76
|
+
*/
|
|
77
|
+
getTemplates(): Promise<DocumentResponse<DocumentTemplate[]>>;
|
|
78
|
+
/**
|
|
79
|
+
* Get template by ID
|
|
80
|
+
*/
|
|
81
|
+
getTemplate(templateId: string): Promise<DocumentResponse<DocumentTemplate>>;
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=document-connector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-connector.d.ts","sourceRoot":"","sources":["../src/document-connector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,QAAQ,EACR,qBAAqB,EACrB,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,EACf,oBAAoB,EACpB,gBAAgB,EACjB,MAAM,SAAS,CAAC;AAGjB;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IAEnD;;OAEG;IACH,YAAY,CAAC,OAAO,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IAElE;;OAEG;IACH,cAAc,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IAElE;;OAEG;IACH,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IAE9D;;OAEG;IACH,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEjF;;OAEG;IACH,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjE;;OAEG;IACH,YAAY,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAE5C;;OAEG;IACH,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;CAC5D;AAED;;;GAGG;AACH,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,QAAQ,CAAmB;gBAEvB,QAAQ,EAAE,gBAAgB;IAItC;;OAEG;IACG,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAoB1E;;OAEG;IACG,YAAY,CAAC,OAAO,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,gBAAgB,CAAC,QAAQ,EAAE,CAAC,CAAC;IAkBzF;;OAEG;IACG,cAAc,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAsBzF;;OAEG;IACG,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAuBrF;;OAEG;IACG,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAoBxG;;OAEG;IACG,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAoBxF;;OAEG;IACG,YAAY,IAAI,OAAO,CAAC,gBAAgB,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAkBnE;;OAEG;IACG,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;CAmBnF"}
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Document Connector
|
|
4
|
+
* Document creation, management, and e-signature
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.DocumentConnector = void 0;
|
|
8
|
+
const utils_logger_1 = require("@xbg/utils-logger");
|
|
9
|
+
/**
|
|
10
|
+
* Document Connector
|
|
11
|
+
* Unified interface for document management platforms
|
|
12
|
+
*/
|
|
13
|
+
class DocumentConnector {
|
|
14
|
+
constructor(provider) {
|
|
15
|
+
this.provider = provider;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Get document by ID
|
|
19
|
+
*/
|
|
20
|
+
async getDocument(documentId) {
|
|
21
|
+
utils_logger_1.logger.info('Fetching document', { documentId });
|
|
22
|
+
try {
|
|
23
|
+
const document = await this.provider.getDocument(documentId);
|
|
24
|
+
return { success: true, data: document };
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
utils_logger_1.logger.error('Error fetching document', error instanceof Error ? error : new Error('Unknown error'), {
|
|
28
|
+
documentId,
|
|
29
|
+
});
|
|
30
|
+
return {
|
|
31
|
+
success: false,
|
|
32
|
+
error: {
|
|
33
|
+
code: 'FETCH_ERROR',
|
|
34
|
+
message: 'Failed to fetch document',
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Get documents
|
|
41
|
+
*/
|
|
42
|
+
async getDocuments(options) {
|
|
43
|
+
utils_logger_1.logger.info('Fetching documents', { options });
|
|
44
|
+
try {
|
|
45
|
+
const documents = await this.provider.getDocuments(options);
|
|
46
|
+
return { success: true, data: documents };
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
utils_logger_1.logger.error('Error fetching documents', error instanceof Error ? error : new Error('Unknown error'));
|
|
50
|
+
return {
|
|
51
|
+
success: false,
|
|
52
|
+
error: {
|
|
53
|
+
code: 'FETCH_ERROR',
|
|
54
|
+
message: 'Failed to fetch documents',
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Create document
|
|
61
|
+
*/
|
|
62
|
+
async createDocument(request) {
|
|
63
|
+
utils_logger_1.logger.info('Creating document', {
|
|
64
|
+
name: request.name,
|
|
65
|
+
templateId: request.templateId,
|
|
66
|
+
recipientCount: request.recipients.length,
|
|
67
|
+
});
|
|
68
|
+
try {
|
|
69
|
+
const document = await this.provider.createDocument(request);
|
|
70
|
+
return { success: true, data: document };
|
|
71
|
+
}
|
|
72
|
+
catch (error) {
|
|
73
|
+
utils_logger_1.logger.error('Error creating document', error instanceof Error ? error : new Error('Unknown error'));
|
|
74
|
+
return {
|
|
75
|
+
success: false,
|
|
76
|
+
error: {
|
|
77
|
+
code: 'CREATE_ERROR',
|
|
78
|
+
message: 'Failed to create document',
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Send document to recipients
|
|
85
|
+
*/
|
|
86
|
+
async sendDocument(request) {
|
|
87
|
+
utils_logger_1.logger.info('Sending document', {
|
|
88
|
+
documentId: request.documentId,
|
|
89
|
+
silent: request.silent,
|
|
90
|
+
});
|
|
91
|
+
try {
|
|
92
|
+
const document = await this.provider.sendDocument(request);
|
|
93
|
+
return { success: true, data: document };
|
|
94
|
+
}
|
|
95
|
+
catch (error) {
|
|
96
|
+
utils_logger_1.logger.error('Error sending document', error instanceof Error ? error : new Error('Unknown error'), {
|
|
97
|
+
documentId: request.documentId,
|
|
98
|
+
});
|
|
99
|
+
return {
|
|
100
|
+
success: false,
|
|
101
|
+
error: {
|
|
102
|
+
code: 'SEND_ERROR',
|
|
103
|
+
message: 'Failed to send document',
|
|
104
|
+
},
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Download document
|
|
110
|
+
*/
|
|
111
|
+
async downloadDocument(documentId, options) {
|
|
112
|
+
utils_logger_1.logger.info('Downloading document', { documentId, options });
|
|
113
|
+
try {
|
|
114
|
+
const buffer = await this.provider.downloadDocument(documentId, options);
|
|
115
|
+
return { success: true, data: buffer };
|
|
116
|
+
}
|
|
117
|
+
catch (error) {
|
|
118
|
+
utils_logger_1.logger.error('Error downloading document', error instanceof Error ? error : new Error('Unknown error'), {
|
|
119
|
+
documentId,
|
|
120
|
+
});
|
|
121
|
+
return {
|
|
122
|
+
success: false,
|
|
123
|
+
error: {
|
|
124
|
+
code: 'DOWNLOAD_ERROR',
|
|
125
|
+
message: 'Failed to download document',
|
|
126
|
+
},
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Void document
|
|
132
|
+
*/
|
|
133
|
+
async voidDocument(documentId, reason) {
|
|
134
|
+
utils_logger_1.logger.info('Voiding document', { documentId, reason });
|
|
135
|
+
try {
|
|
136
|
+
await this.provider.voidDocument(documentId, reason);
|
|
137
|
+
return { success: true };
|
|
138
|
+
}
|
|
139
|
+
catch (error) {
|
|
140
|
+
utils_logger_1.logger.error('Error voiding document', error instanceof Error ? error : new Error('Unknown error'), {
|
|
141
|
+
documentId,
|
|
142
|
+
});
|
|
143
|
+
return {
|
|
144
|
+
success: false,
|
|
145
|
+
error: {
|
|
146
|
+
code: 'VOID_ERROR',
|
|
147
|
+
message: 'Failed to void document',
|
|
148
|
+
},
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Get templates
|
|
154
|
+
*/
|
|
155
|
+
async getTemplates() {
|
|
156
|
+
utils_logger_1.logger.info('Fetching document templates');
|
|
157
|
+
try {
|
|
158
|
+
const templates = await this.provider.getTemplates();
|
|
159
|
+
return { success: true, data: templates };
|
|
160
|
+
}
|
|
161
|
+
catch (error) {
|
|
162
|
+
utils_logger_1.logger.error('Error fetching templates', error instanceof Error ? error : new Error('Unknown error'));
|
|
163
|
+
return {
|
|
164
|
+
success: false,
|
|
165
|
+
error: {
|
|
166
|
+
code: 'FETCH_ERROR',
|
|
167
|
+
message: 'Failed to fetch document templates',
|
|
168
|
+
},
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Get template by ID
|
|
174
|
+
*/
|
|
175
|
+
async getTemplate(templateId) {
|
|
176
|
+
utils_logger_1.logger.info('Fetching template', { templateId });
|
|
177
|
+
try {
|
|
178
|
+
const template = await this.provider.getTemplate(templateId);
|
|
179
|
+
return { success: true, data: template };
|
|
180
|
+
}
|
|
181
|
+
catch (error) {
|
|
182
|
+
utils_logger_1.logger.error('Error fetching template', error instanceof Error ? error : new Error('Unknown error'), {
|
|
183
|
+
templateId,
|
|
184
|
+
});
|
|
185
|
+
return {
|
|
186
|
+
success: false,
|
|
187
|
+
error: {
|
|
188
|
+
code: 'FETCH_ERROR',
|
|
189
|
+
message: 'Failed to fetch document template',
|
|
190
|
+
},
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
exports.DocumentConnector = DocumentConnector;
|
|
196
|
+
//# sourceMappingURL=document-connector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-connector.js","sourceRoot":"","sources":["../src/document-connector.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAWH,oDAA2C;AA+C3C;;;GAGG;AACH,MAAa,iBAAiB;IAG5B,YAAY,QAA0B;QACpC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,WAAW,CAAC,UAAkB;QAClC,qBAAM,CAAC,IAAI,CAAC,mBAAmB,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC;QAEjD,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;YAC7D,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;QAC3C,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,qBAAM,CAAC,KAAK,CAAC,yBAAyB,EAAE,KAAK,YAAY,KAA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,aAAa;oBACnB,OAAO,EAAE,mCAAmC;iBAC7C;aACF,CAAC;QACJ,CAAC;IACH,CAAC;CACF;AA/LD,8CA+LC"}
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Document Connector Barrel Export
|
|
3
|
+
*/
|
|
4
|
+
export * from './types';
|
|
5
|
+
export * from './document-connector';
|
|
6
|
+
export * from './providers/pandadoc-provider';
|
|
7
|
+
import { DocumentConnector } from './document-connector';
|
|
8
|
+
export declare function initializeDocumentConnector(config: any): void;
|
|
9
|
+
export declare function createDocumentConnector(): DocumentConnector | null;
|
|
10
|
+
export declare function getDocumentConnector(): DocumentConnector | null;
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,SAAS,CAAC;AACxB,cAAc,sBAAsB,CAAC;AACrC,cAAc,+BAA+B,CAAC;AAE9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAMzD,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,GAAG,GAAG,IAAI,CAI7D;AAED,wBAAgB,uBAAuB,IAAI,iBAAiB,GAAG,IAAI,CAoBlE;AAID,wBAAgB,oBAAoB,IAAI,iBAAiB,GAAG,IAAI,CAK/D"}
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Document Connector Barrel Export
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
17
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.initializeDocumentConnector = initializeDocumentConnector;
|
|
21
|
+
exports.createDocumentConnector = createDocumentConnector;
|
|
22
|
+
exports.getDocumentConnector = getDocumentConnector;
|
|
23
|
+
__exportStar(require("./types"), exports);
|
|
24
|
+
__exportStar(require("./document-connector"), exports);
|
|
25
|
+
__exportStar(require("./providers/pandadoc-provider"), exports);
|
|
26
|
+
const document_connector_1 = require("./document-connector");
|
|
27
|
+
const pandadoc_provider_1 = require("./providers/pandadoc-provider");
|
|
28
|
+
// Config is provided via initializeDocumentConnector() at app startup
|
|
29
|
+
let connectorConfig = null;
|
|
30
|
+
function initializeDocumentConnector(config) {
|
|
31
|
+
connectorConfig = config;
|
|
32
|
+
// Reset singleton so it gets re-created with new config
|
|
33
|
+
documentConnectorInstance = undefined;
|
|
34
|
+
}
|
|
35
|
+
function createDocumentConnector() {
|
|
36
|
+
if (!connectorConfig) {
|
|
37
|
+
throw new Error('Document connector not initialized. Call initializeDocumentConnector() first.');
|
|
38
|
+
}
|
|
39
|
+
if (!connectorConfig.document.enabled) {
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
const provider = connectorConfig.document.provider;
|
|
43
|
+
if (provider === 'pandadoc') {
|
|
44
|
+
const config = connectorConfig.document.providers.pandadoc;
|
|
45
|
+
if (!(config === null || config === void 0 ? void 0 : config.apiKey)) {
|
|
46
|
+
throw new Error('PandaDoc API key is required');
|
|
47
|
+
}
|
|
48
|
+
return new document_connector_1.DocumentConnector(new pandadoc_provider_1.PandaDocProvider(config));
|
|
49
|
+
}
|
|
50
|
+
throw new Error(`Unsupported document provider: ${provider}`);
|
|
51
|
+
}
|
|
52
|
+
let documentConnectorInstance;
|
|
53
|
+
function getDocumentConnector() {
|
|
54
|
+
if (documentConnectorInstance === undefined) {
|
|
55
|
+
documentConnectorInstance = createDocumentConnector();
|
|
56
|
+
}
|
|
57
|
+
return documentConnectorInstance;
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;AAYH,kEAIC;AAED,0DAoBC;AAID,oDAKC;AA7CD,0CAAwB;AACxB,uDAAqC;AACrC,gEAA8C;AAE9C,6DAAyD;AACzD,qEAAiE;AAEjE,sEAAsE;AACtE,IAAI,eAAe,GAAQ,IAAI,CAAC;AAEhC,SAAgB,2BAA2B,CAAC,MAAW;IACrD,eAAe,GAAG,MAAM,CAAC;IACzB,wDAAwD;IACxD,yBAAyB,GAAG,SAAS,CAAC;AACxC,CAAC;AAED,SAAgB,uBAAuB;IACrC,IAAI,CAAC,eAAe,EAAE,CAAC;QACrB,MAAM,IAAI,KAAK,CAAC,+EAA+E,CAAC,CAAC;IACnG,CAAC;IAED,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;QACtC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,QAAQ,GAAG,eAAe,CAAC,QAAQ,CAAC,QAAQ,CAAC;IAEnD,IAAI,QAAQ,KAAK,UAAU,EAAE,CAAC;QAC5B,MAAM,MAAM,GAAG,eAAe,CAAC,QAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC;QAC3D,IAAI,CAAC,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,CAAA,EAAE,CAAC;YACpB,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;QAClD,CAAC;QACD,OAAO,IAAI,sCAAiB,CAAC,IAAI,oCAAgB,CAAC,MAAM,CAAC,CAAC,CAAC;IAC7D,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,kCAAkC,QAAQ,EAAE,CAAC,CAAC;AAChE,CAAC;AAED,IAAI,yBAA+D,CAAC;AAEpE,SAAgB,oBAAoB;IAClC,IAAI,yBAAyB,KAAK,SAAS,EAAE,CAAC;QAC5C,yBAAyB,GAAG,uBAAuB,EAAE,CAAC;IACxD,CAAC;IACD,OAAO,yBAAyB,CAAC;AACnC,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PandaDoc Provider for Document Connector
|
|
3
|
+
* https://developers.pandadoc.com/reference/about
|
|
4
|
+
*/
|
|
5
|
+
import { DocumentProvider } from '../document-connector';
|
|
6
|
+
import { Document, CreateDocumentRequest, SendDocumentRequest, DocumentTemplate, DownloadOptions, DocumentQueryOptions } from '../types';
|
|
7
|
+
export interface PandaDocProviderConfig {
|
|
8
|
+
apiKey: string;
|
|
9
|
+
}
|
|
10
|
+
export declare class PandaDocProvider implements DocumentProvider {
|
|
11
|
+
private client;
|
|
12
|
+
constructor(config: PandaDocProviderConfig);
|
|
13
|
+
getDocument(documentId: string): Promise<Document>;
|
|
14
|
+
getDocuments(options?: DocumentQueryOptions): Promise<Document[]>;
|
|
15
|
+
createDocument(request: CreateDocumentRequest): Promise<Document>;
|
|
16
|
+
sendDocument(request: SendDocumentRequest): Promise<Document>;
|
|
17
|
+
downloadDocument(documentId: string, options?: DownloadOptions): Promise<Buffer>;
|
|
18
|
+
voidDocument(documentId: string, reason?: string): Promise<void>;
|
|
19
|
+
getTemplates(): Promise<DocumentTemplate[]>;
|
|
20
|
+
getTemplate(templateId: string): Promise<DocumentTemplate>;
|
|
21
|
+
/**
|
|
22
|
+
* Wait for document to be ready for sending
|
|
23
|
+
*/
|
|
24
|
+
private waitForDocumentReady;
|
|
25
|
+
/**
|
|
26
|
+
* Map PandaDoc document to Document
|
|
27
|
+
*/
|
|
28
|
+
private mapPandaDocToDocument;
|
|
29
|
+
/**
|
|
30
|
+
* Map PandaDoc status to standard status
|
|
31
|
+
*/
|
|
32
|
+
private mapPandaDocStatus;
|
|
33
|
+
/**
|
|
34
|
+
* Map standard status to PandaDoc status
|
|
35
|
+
*/
|
|
36
|
+
private mapStatusToPandaDoc;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=pandadoc-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pandadoc-provider.d.ts","sourceRoot":"","sources":["../../src/providers/pandadoc-provider.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EACL,QAAQ,EACR,qBAAqB,EACrB,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,EACf,oBAAoB,EAErB,MAAM,UAAU,CAAC;AAElB,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,qBAAa,gBAAiB,YAAW,gBAAgB;IACvD,OAAO,CAAC,MAAM,CAAgB;gBAElB,MAAM,EAAE,sBAAsB;IAUpC,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;IASlD,YAAY,CAAC,OAAO,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IAmBjE,cAAc,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,QAAQ,CAAC;IAoCjE,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,QAAQ,CAAC;IAmB7D,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC;IAYhF,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAUhE,YAAY,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAe3C,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAoBhE;;OAEG;YACW,oBAAoB;IAUlC;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAqB7B;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAazB;;OAEG;IACH,OAAO,CAAC,mBAAmB;CAY5B"}
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* PandaDoc Provider for Document Connector
|
|
4
|
+
* https://developers.pandadoc.com/reference/about
|
|
5
|
+
*/
|
|
6
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.PandaDocProvider = void 0;
|
|
11
|
+
const axios_1 = __importDefault(require("axios"));
|
|
12
|
+
class PandaDocProvider {
|
|
13
|
+
constructor(config) {
|
|
14
|
+
this.client = axios_1.default.create({
|
|
15
|
+
baseURL: 'https://api.pandadoc.com/public/v1',
|
|
16
|
+
headers: {
|
|
17
|
+
'Authorization': `API-Key ${config.apiKey}`,
|
|
18
|
+
'Content-Type': 'application/json',
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
async getDocument(documentId) {
|
|
23
|
+
try {
|
|
24
|
+
const response = await this.client.get(`/documents/${documentId}/details`);
|
|
25
|
+
return this.mapPandaDocToDocument(response.data);
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
throw new Error(`Failed to get document: ${error.message}`);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
async getDocuments(options) {
|
|
32
|
+
try {
|
|
33
|
+
const params = {
|
|
34
|
+
count: (options === null || options === void 0 ? void 0 : options.limit) || 100,
|
|
35
|
+
page: (options === null || options === void 0 ? void 0 : options.page) || 1,
|
|
36
|
+
};
|
|
37
|
+
if (options === null || options === void 0 ? void 0 : options.status) {
|
|
38
|
+
params.status = this.mapStatusToPandaDoc(options.status);
|
|
39
|
+
}
|
|
40
|
+
const response = await this.client.get('/documents', { params });
|
|
41
|
+
return response.data.results.map((doc) => this.mapPandaDocToDocument(doc));
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
throw new Error(`Failed to get documents: ${error.message}`);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
async createDocument(request) {
|
|
48
|
+
try {
|
|
49
|
+
const payload = {
|
|
50
|
+
name: request.name,
|
|
51
|
+
recipients: request.recipients.map((r, idx) => ({
|
|
52
|
+
email: r.email,
|
|
53
|
+
first_name: r.firstName,
|
|
54
|
+
last_name: r.lastName,
|
|
55
|
+
role: r.role || 'signer',
|
|
56
|
+
signing_order: idx + 1,
|
|
57
|
+
})),
|
|
58
|
+
};
|
|
59
|
+
if (request.templateId) {
|
|
60
|
+
payload.template_uuid = request.templateId;
|
|
61
|
+
}
|
|
62
|
+
if (request.fields) {
|
|
63
|
+
payload.fields = request.fields;
|
|
64
|
+
}
|
|
65
|
+
if (request.message) {
|
|
66
|
+
payload.message = request.message;
|
|
67
|
+
}
|
|
68
|
+
const response = await this.client.post('/documents', payload);
|
|
69
|
+
// Wait for document to be ready
|
|
70
|
+
await this.waitForDocumentReady(response.data.id);
|
|
71
|
+
return this.getDocument(response.data.id);
|
|
72
|
+
}
|
|
73
|
+
catch (error) {
|
|
74
|
+
throw new Error(`Failed to create document: ${error.message}`);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
async sendDocument(request) {
|
|
78
|
+
try {
|
|
79
|
+
const payload = {
|
|
80
|
+
silent: request.silent || false,
|
|
81
|
+
};
|
|
82
|
+
if (request.message) {
|
|
83
|
+
payload.subject = 'Document for signature';
|
|
84
|
+
payload.message = request.message;
|
|
85
|
+
}
|
|
86
|
+
await this.client.post(`/documents/${request.documentId}/send`, payload);
|
|
87
|
+
return this.getDocument(request.documentId);
|
|
88
|
+
}
|
|
89
|
+
catch (error) {
|
|
90
|
+
throw new Error(`Failed to send document: ${error.message}`);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
async downloadDocument(documentId, options) {
|
|
94
|
+
try {
|
|
95
|
+
const response = await this.client.get(`/documents/${documentId}/download`, {
|
|
96
|
+
responseType: 'arraybuffer',
|
|
97
|
+
});
|
|
98
|
+
return Buffer.from(response.data);
|
|
99
|
+
}
|
|
100
|
+
catch (error) {
|
|
101
|
+
throw new Error(`Failed to download document: ${error.message}`);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
async voidDocument(documentId, reason) {
|
|
105
|
+
try {
|
|
106
|
+
await this.client.post(`/documents/${documentId}/void`, {
|
|
107
|
+
reason: reason || 'Voided by user',
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
catch (error) {
|
|
111
|
+
throw new Error(`Failed to void document: ${error.message}`);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
async getTemplates() {
|
|
115
|
+
try {
|
|
116
|
+
const response = await this.client.get('/templates');
|
|
117
|
+
return response.data.results.map((template) => ({
|
|
118
|
+
id: template.id,
|
|
119
|
+
name: template.name,
|
|
120
|
+
description: template.description,
|
|
121
|
+
createdAt: new Date(template.date_created),
|
|
122
|
+
}));
|
|
123
|
+
}
|
|
124
|
+
catch (error) {
|
|
125
|
+
throw new Error(`Failed to get templates: ${error.message}`);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
async getTemplate(templateId) {
|
|
129
|
+
var _a;
|
|
130
|
+
try {
|
|
131
|
+
const response = await this.client.get(`/templates/${templateId}/details`);
|
|
132
|
+
return {
|
|
133
|
+
id: response.data.id,
|
|
134
|
+
name: response.data.name,
|
|
135
|
+
description: response.data.description,
|
|
136
|
+
fields: (_a = response.data.fields) === null || _a === void 0 ? void 0 : _a.map((field) => ({
|
|
137
|
+
name: field.name,
|
|
138
|
+
type: field.type,
|
|
139
|
+
required: field.required,
|
|
140
|
+
})),
|
|
141
|
+
createdAt: new Date(response.data.date_created),
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
catch (error) {
|
|
145
|
+
throw new Error(`Failed to get template: ${error.message}`);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Wait for document to be ready for sending
|
|
150
|
+
*/
|
|
151
|
+
async waitForDocumentReady(documentId, maxAttempts = 10) {
|
|
152
|
+
for (let i = 0; i < maxAttempts; i++) {
|
|
153
|
+
const doc = await this.getDocument(documentId);
|
|
154
|
+
if (doc.status !== 'draft' || i === maxAttempts - 1) {
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
await new Promise(resolve => setTimeout(resolve, 2000));
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Map PandaDoc document to Document
|
|
162
|
+
*/
|
|
163
|
+
mapPandaDocToDocument(doc) {
|
|
164
|
+
var _a;
|
|
165
|
+
return {
|
|
166
|
+
id: doc.id,
|
|
167
|
+
name: doc.name,
|
|
168
|
+
status: this.mapPandaDocStatus(doc.status),
|
|
169
|
+
dateCreated: new Date(doc.date_created),
|
|
170
|
+
dateModified: new Date(doc.date_modified),
|
|
171
|
+
dateCompleted: doc.date_completed ? new Date(doc.date_completed) : undefined,
|
|
172
|
+
expirationDate: doc.expiration_date ? new Date(doc.expiration_date) : undefined,
|
|
173
|
+
recipients: (_a = doc.recipients) === null || _a === void 0 ? void 0 : _a.map((r) => ({
|
|
174
|
+
email: r.email,
|
|
175
|
+
firstName: r.first_name,
|
|
176
|
+
lastName: r.last_name,
|
|
177
|
+
role: r.role,
|
|
178
|
+
signedDate: r.date_signed ? new Date(r.date_signed) : undefined,
|
|
179
|
+
status: r.has_completed ? 'completed' : 'pending',
|
|
180
|
+
})),
|
|
181
|
+
url: doc.session_url,
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Map PandaDoc status to standard status
|
|
186
|
+
*/
|
|
187
|
+
mapPandaDocStatus(status) {
|
|
188
|
+
const map = {
|
|
189
|
+
'document.draft': 'draft',
|
|
190
|
+
'document.sent': 'sent',
|
|
191
|
+
'document.viewed': 'viewed',
|
|
192
|
+
'document.completed': 'completed',
|
|
193
|
+
'document.voided': 'voided',
|
|
194
|
+
'document.declined': 'declined',
|
|
195
|
+
'document.expired': 'expired',
|
|
196
|
+
};
|
|
197
|
+
return map[status] || 'draft';
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Map standard status to PandaDoc status
|
|
201
|
+
*/
|
|
202
|
+
mapStatusToPandaDoc(status) {
|
|
203
|
+
const map = {
|
|
204
|
+
'draft': 'document.draft',
|
|
205
|
+
'sent': 'document.sent',
|
|
206
|
+
'viewed': 'document.viewed',
|
|
207
|
+
'completed': 'document.completed',
|
|
208
|
+
'voided': 'document.voided',
|
|
209
|
+
'declined': 'document.declined',
|
|
210
|
+
'expired': 'document.expired',
|
|
211
|
+
};
|
|
212
|
+
return map[status] || 'document.draft';
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
exports.PandaDocProvider = PandaDocProvider;
|
|
216
|
+
//# sourceMappingURL=pandadoc-provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pandadoc-provider.js","sourceRoot":"","sources":["../../src/providers/pandadoc-provider.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;AAEH,kDAA6C;AAgB7C,MAAa,gBAAgB;IAG3B,YAAY,MAA8B;QACxC,IAAI,CAAC,MAAM,GAAG,eAAK,CAAC,MAAM,CAAC;YACzB,OAAO,EAAE,oCAAoC;YAC7C,OAAO,EAAE;gBACP,eAAe,EAAE,WAAW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;CACF;AA7ND,4CA6NC"}
|
package/lib/types.d.ts
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Document Connector Types
|
|
3
|
+
* Document creation, management, and e-signature
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Document status
|
|
7
|
+
*/
|
|
8
|
+
export type DocumentStatus = 'draft' | 'sent' | 'viewed' | 'completed' | 'voided' | 'declined' | 'expired';
|
|
9
|
+
/**
|
|
10
|
+
* Document
|
|
11
|
+
*/
|
|
12
|
+
export interface Document {
|
|
13
|
+
id: string;
|
|
14
|
+
name: string;
|
|
15
|
+
status: DocumentStatus;
|
|
16
|
+
dateCreated?: Date;
|
|
17
|
+
dateModified?: Date;
|
|
18
|
+
dateCompleted?: Date;
|
|
19
|
+
expirationDate?: Date;
|
|
20
|
+
recipients?: DocumentRecipient[];
|
|
21
|
+
url?: string;
|
|
22
|
+
downloadUrl?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Document recipient
|
|
26
|
+
*/
|
|
27
|
+
export interface DocumentRecipient {
|
|
28
|
+
email: string;
|
|
29
|
+
firstName?: string;
|
|
30
|
+
lastName?: string;
|
|
31
|
+
role?: 'signer' | 'approver' | 'cc';
|
|
32
|
+
signedDate?: Date;
|
|
33
|
+
viewedDate?: Date;
|
|
34
|
+
status?: 'pending' | 'viewed' | 'completed' | 'declined';
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Create document request
|
|
38
|
+
*/
|
|
39
|
+
export interface CreateDocumentRequest {
|
|
40
|
+
name: string;
|
|
41
|
+
templateId?: string;
|
|
42
|
+
recipients: DocumentRecipient[];
|
|
43
|
+
fields?: Record<string, any>;
|
|
44
|
+
expirationDate?: Date;
|
|
45
|
+
message?: string;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Send document request
|
|
49
|
+
*/
|
|
50
|
+
export interface SendDocumentRequest {
|
|
51
|
+
documentId: string;
|
|
52
|
+
message?: string;
|
|
53
|
+
silent?: boolean;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Document template
|
|
57
|
+
*/
|
|
58
|
+
export interface DocumentTemplate {
|
|
59
|
+
id: string;
|
|
60
|
+
name: string;
|
|
61
|
+
description?: string;
|
|
62
|
+
fields?: Array<{
|
|
63
|
+
name: string;
|
|
64
|
+
type: string;
|
|
65
|
+
required?: boolean;
|
|
66
|
+
}>;
|
|
67
|
+
createdAt?: Date;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Download options
|
|
71
|
+
*/
|
|
72
|
+
export interface DownloadOptions {
|
|
73
|
+
format?: 'pdf' | 'original';
|
|
74
|
+
watermark?: boolean;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Document field
|
|
78
|
+
*/
|
|
79
|
+
export interface DocumentField {
|
|
80
|
+
name: string;
|
|
81
|
+
value: any;
|
|
82
|
+
type?: 'text' | 'signature' | 'date' | 'checkbox';
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Query options
|
|
86
|
+
*/
|
|
87
|
+
export interface DocumentQueryOptions {
|
|
88
|
+
page?: number;
|
|
89
|
+
limit?: number;
|
|
90
|
+
status?: DocumentStatus;
|
|
91
|
+
sort?: {
|
|
92
|
+
field: string;
|
|
93
|
+
order: 'asc' | 'desc';
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Response wrapper
|
|
98
|
+
*/
|
|
99
|
+
export interface DocumentResponse<T> {
|
|
100
|
+
success: boolean;
|
|
101
|
+
data?: T;
|
|
102
|
+
error?: {
|
|
103
|
+
code: string;
|
|
104
|
+
message: string;
|
|
105
|
+
details?: any;
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAA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map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
|
package/package.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@xbg.solutions/utils-document-connector",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Document processing",
|
|
5
|
+
"main": "lib/index.js",
|
|
6
|
+
"types": "lib/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"lib"
|
|
9
|
+
],
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "tsc",
|
|
12
|
+
"build:watch": "tsc --watch",
|
|
13
|
+
"clean": "rm -rf lib",
|
|
14
|
+
"prepublishOnly": "npm run build"
|
|
15
|
+
},
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@xbg/utils-logger": "^1.0.0",
|
|
18
|
+
"axios": "^1.6.2"
|
|
19
|
+
},
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"@types/node": "^20.11.0",
|
|
22
|
+
"typescript": "^5.3.3"
|
|
23
|
+
},
|
|
24
|
+
"engines": {
|
|
25
|
+
"node": "22"
|
|
26
|
+
},
|
|
27
|
+
"publishConfig": {
|
|
28
|
+
"access": "public"
|
|
29
|
+
}
|
|
30
|
+
}
|