@secretpdf/sdk 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.d.ts +12 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +65 -17
- package/dist/client.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
package/dist/client.d.ts
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
|
-
import { AuthenticationApi } from './api/index';
|
|
1
|
+
import { AuthenticationApi, ResponseError } from './api/index';
|
|
2
2
|
import type { GenerateDocument200Response, GetGenerationStats200Response, GetUsageStats200Response, ListGenerationRecords200Response, CreateTemplate200Response, ListTemplates200Response, ListTemplates200ResponseTemplatesInner } from './api/models/index';
|
|
3
|
+
/**
|
|
4
|
+
* Enhanced error class that includes the parsed error body from the API
|
|
5
|
+
*/
|
|
6
|
+
export declare class SecretPDFError extends Error {
|
|
7
|
+
readonly status: number;
|
|
8
|
+
readonly statusText: string;
|
|
9
|
+
readonly body: any;
|
|
10
|
+
readonly errorCode?: string;
|
|
11
|
+
readonly errorMessage?: string;
|
|
12
|
+
constructor(responseError: ResponseError, body: any);
|
|
13
|
+
}
|
|
3
14
|
/**
|
|
4
15
|
* Configuration options for the Secret PDF client
|
|
5
16
|
*/
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAGjB,aAAa,EACd,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EACV,2BAA2B,EAC3B,6BAA6B,EAC7B,wBAAwB,EACxB,g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;;;;;;;;;OAWG;IACG,uBAAuB,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,yBAAyB,CAAC;IAI7E;;;;;;;;;;;;;;;;OAgBG;IACG,0BAA0B,CAAC,MAAM,EAAE;QACvC,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,GAAG,OAAO,CAAC,yBAAyB,CAAC;IAUtC;;;;OAIG;IACH,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,sBAAsB,CAAC,GAAG,IAAI;CAiB7D"}
|
package/dist/client.js
CHANGED
|
@@ -1,7 +1,55 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SecretPDFClient = void 0;
|
|
3
|
+
exports.SecretPDFClient = exports.SecretPDFError = void 0;
|
|
4
4
|
const index_1 = require("./api/index");
|
|
5
|
+
/**
|
|
6
|
+
* Enhanced error class that includes the parsed error body from the API
|
|
7
|
+
*/
|
|
8
|
+
class SecretPDFError extends Error {
|
|
9
|
+
constructor(responseError, body) {
|
|
10
|
+
const message = body?.message || body?.error || responseError.message || 'An error occurred';
|
|
11
|
+
super(message);
|
|
12
|
+
this.name = 'SecretPDFError';
|
|
13
|
+
this.status = responseError.response.status;
|
|
14
|
+
this.statusText = responseError.response.statusText;
|
|
15
|
+
this.body = body;
|
|
16
|
+
this.errorCode = body?.error || body?.code || body?.errorCode;
|
|
17
|
+
this.errorMessage = body?.message || body?.errorMessage;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.SecretPDFError = SecretPDFError;
|
|
21
|
+
/**
|
|
22
|
+
* Helper function to parse error response body
|
|
23
|
+
*/
|
|
24
|
+
async function parseErrorBody(response) {
|
|
25
|
+
try {
|
|
26
|
+
const contentType = response.headers.get('content-type');
|
|
27
|
+
if (contentType && contentType.includes('application/json')) {
|
|
28
|
+
return await response.clone().json();
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
return await response.clone().text();
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Wrapper to handle API errors and parse error bodies
|
|
40
|
+
*/
|
|
41
|
+
async function handleApiCall(apiCall) {
|
|
42
|
+
try {
|
|
43
|
+
return await apiCall;
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
if (error instanceof index_1.ResponseError) {
|
|
47
|
+
const body = await parseErrorBody(error.response);
|
|
48
|
+
throw new SecretPDFError(error, body);
|
|
49
|
+
}
|
|
50
|
+
throw error;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
5
53
|
/**
|
|
6
54
|
* Main Secret PDF SDK Client
|
|
7
55
|
*
|
|
@@ -60,7 +108,7 @@ class SecretPDFClient {
|
|
|
60
108
|
* ```
|
|
61
109
|
*/
|
|
62
110
|
async generate(params) {
|
|
63
|
-
return this.documentsApi.generateDocument({
|
|
111
|
+
return handleApiCall(this.documentsApi.generateDocument({
|
|
64
112
|
generateDocumentRequest: {
|
|
65
113
|
templateId: params.templateId,
|
|
66
114
|
data: params.data,
|
|
@@ -68,7 +116,7 @@ class SecretPDFClient {
|
|
|
68
116
|
returnFile: params.returnFile,
|
|
69
117
|
sandbox: params.sandbox,
|
|
70
118
|
}
|
|
71
|
-
});
|
|
119
|
+
}));
|
|
72
120
|
}
|
|
73
121
|
/**
|
|
74
122
|
* Get overall generation statistics
|
|
@@ -82,7 +130,7 @@ class SecretPDFClient {
|
|
|
82
130
|
* ```
|
|
83
131
|
*/
|
|
84
132
|
async getGenerationStats() {
|
|
85
|
-
return this.documentsApi.getGenerationStats();
|
|
133
|
+
return handleApiCall(this.documentsApi.getGenerationStats());
|
|
86
134
|
}
|
|
87
135
|
/**
|
|
88
136
|
* Get usage statistics
|
|
@@ -96,7 +144,7 @@ class SecretPDFClient {
|
|
|
96
144
|
* ```
|
|
97
145
|
*/
|
|
98
146
|
async getUsageStats() {
|
|
99
|
-
return this.documentsApi.getUsageStats();
|
|
147
|
+
return handleApiCall(this.documentsApi.getUsageStats());
|
|
100
148
|
}
|
|
101
149
|
/**
|
|
102
150
|
* List generation records with pagination
|
|
@@ -111,10 +159,10 @@ class SecretPDFClient {
|
|
|
111
159
|
* ```
|
|
112
160
|
*/
|
|
113
161
|
async listGenerationRecords(params) {
|
|
114
|
-
return this.documentsApi.listGenerationRecords({
|
|
162
|
+
return handleApiCall(this.documentsApi.listGenerationRecords({
|
|
115
163
|
page: params?.page,
|
|
116
164
|
limit: params?.limit,
|
|
117
|
-
});
|
|
165
|
+
}));
|
|
118
166
|
}
|
|
119
167
|
/**
|
|
120
168
|
* Create a new HTML template
|
|
@@ -134,13 +182,13 @@ class SecretPDFClient {
|
|
|
134
182
|
* ```
|
|
135
183
|
*/
|
|
136
184
|
async createTemplate(params) {
|
|
137
|
-
return this.templatesApi.createTemplate({
|
|
185
|
+
return handleApiCall(this.templatesApi.createTemplate({
|
|
138
186
|
createTemplateRequest: {
|
|
139
187
|
templateContent: params.templateContent,
|
|
140
188
|
templateName: params.templateName,
|
|
141
189
|
templateSize: params.templateSize,
|
|
142
190
|
}
|
|
143
|
-
});
|
|
191
|
+
}));
|
|
144
192
|
}
|
|
145
193
|
/**
|
|
146
194
|
* List all templates
|
|
@@ -153,7 +201,7 @@ class SecretPDFClient {
|
|
|
153
201
|
* ```
|
|
154
202
|
*/
|
|
155
203
|
async listTemplates() {
|
|
156
|
-
return this.templatesApi.listTemplates();
|
|
204
|
+
return handleApiCall(this.templatesApi.listTemplates());
|
|
157
205
|
}
|
|
158
206
|
/**
|
|
159
207
|
* Get a specific template by ID
|
|
@@ -167,7 +215,7 @@ class SecretPDFClient {
|
|
|
167
215
|
* ```
|
|
168
216
|
*/
|
|
169
217
|
async getTemplate(templateId) {
|
|
170
|
-
return this.templatesApi.getTemplate({ templateId });
|
|
218
|
+
return handleApiCall(this.templatesApi.getTemplate({ templateId }));
|
|
171
219
|
}
|
|
172
220
|
/**
|
|
173
221
|
* Update an existing template
|
|
@@ -188,14 +236,14 @@ class SecretPDFClient {
|
|
|
188
236
|
* ```
|
|
189
237
|
*/
|
|
190
238
|
async updateTemplate(params) {
|
|
191
|
-
return this.templatesApi.updateTemplate({
|
|
239
|
+
return handleApiCall(this.templatesApi.updateTemplate({
|
|
192
240
|
templateId: params.templateId,
|
|
193
241
|
updateTemplateRequest: {
|
|
194
242
|
templateContent: params.templateContent,
|
|
195
243
|
templateName: params.templateName,
|
|
196
244
|
templateSize: params.templateSize,
|
|
197
245
|
}
|
|
198
|
-
});
|
|
246
|
+
}));
|
|
199
247
|
}
|
|
200
248
|
/**
|
|
201
249
|
* Delete a template
|
|
@@ -209,7 +257,7 @@ class SecretPDFClient {
|
|
|
209
257
|
* ```
|
|
210
258
|
*/
|
|
211
259
|
async deleteTemplate(templateId) {
|
|
212
|
-
await this.templatesApi.deleteTemplate({ templateId });
|
|
260
|
+
await handleApiCall(this.templatesApi.deleteTemplate({ templateId }));
|
|
213
261
|
}
|
|
214
262
|
/**
|
|
215
263
|
* Generate a template from a PDF file
|
|
@@ -224,7 +272,7 @@ class SecretPDFClient {
|
|
|
224
272
|
* ```
|
|
225
273
|
*/
|
|
226
274
|
async generateTemplateFromPdf(file) {
|
|
227
|
-
return this.templatesApi.generateTemplateFromPdf({ file });
|
|
275
|
+
return handleApiCall(this.templatesApi.generateTemplateFromPdf({ file }));
|
|
228
276
|
}
|
|
229
277
|
/**
|
|
230
278
|
* Generate a template from a text prompt using AI
|
|
@@ -244,13 +292,13 @@ class SecretPDFClient {
|
|
|
244
292
|
* ```
|
|
245
293
|
*/
|
|
246
294
|
async generateTemplateFromPrompt(params) {
|
|
247
|
-
return this.templatesApi.generateTemplateFromPrompt({
|
|
295
|
+
return handleApiCall(this.templatesApi.generateTemplateFromPrompt({
|
|
248
296
|
generateTemplateFromPromptRequest: {
|
|
249
297
|
prompt: params.prompt,
|
|
250
298
|
params: params.params,
|
|
251
299
|
templateName: params.templateName,
|
|
252
300
|
}
|
|
253
|
-
});
|
|
301
|
+
}));
|
|
254
302
|
}
|
|
255
303
|
/**
|
|
256
304
|
* Update the client configuration
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";;;AAAA,uCAMqB;AAWrB;;GAEG;AACH,MAAa,cAAe,SAAQ,KAAK;IAOvC,YAAY,aAA4B,EAAE,IAAS;QACjD,MAAM,OAAO,GAAG,IAAI,EAAE,OAAO,IAAI,IAAI,EAAE,KAAK,IAAI,aAAa,CAAC,OAAO,IAAI,mBAAmB,CAAC;QAC7F,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;QAC7B,IAAI,CAAC,MAAM,GAAG,aAAa,CAAC,QAAQ,CAAC,MAAM,CAAC;QAC5C,IAAI,CAAC,UAAU,GAAG,aAAa,CAAC,QAAQ,CAAC,UAAU,CAAC;QACpD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,SAAS,GAAG,IAAI,EAAE,KAAK,IAAI,IAAI,EAAE,IAAI,IAAI,IAAI,EAAE,SAAS,CAAC;QAC9D,IAAI,CAAC,YAAY,GAAG,IAAI,EAAE,OAAO,IAAI,IAAI,EAAE,YAAY,CAAC;IAC1D,CAAC;CACF;AAlBD,wCAkBC;AAED;;GAEG;AACH,KAAK,UAAU,cAAc,CAAC,QAAkB;IAC9C,IAAI,CAAC;QACH,MAAM,WAAW,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QACzD,IAAI,WAAW,IAAI,W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AC;IACN,CAAC;IAED;;;;OAIG;IACH,YAAY,CAAC,OAAwC;QACnD,MAAM,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC;QAElC,IAAI,CAAC,MAAM,GAAG,IAAI,qBAAa,CAAC;YAC9B,QAAQ,EAAE,0BAA0B;YACpC,MAAM,EAAE,OAAO,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC;YAClF,WAAW,EAAE,OAAO,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,aAAa,CAAC,WAAW,EAAE,EAAE;YACpG,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,aAAa,CAAC,OAAO;YACjD,QAAQ,EAAE,OAAO,CAAC,QAAQ,IAAI,aAAa,CAAC,QAAQ;YACpD,WAAW,EAAE,OAAO,CAAC,WAAW,IAAI,aAAa,CAAC,WAAW;SAC9D,CAAC,CAAC;QAEH,gDAAgD;QAChD,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;QACzC,IAAI,CAAC,YAAY,CAAC,eAAe,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;QACjD,IAAI,CAAC,YAAY,CAAC,eAAe,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;IACnD,CAAC;CACF;AAjTD,0CAiTC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
* Generate PDFs from HTML templates with AI assistance.
|
|
6
6
|
*/
|
|
7
7
|
export * from './api/index';
|
|
8
|
-
export { SecretPDFClient } from './client';
|
|
8
|
+
export { SecretPDFClient, SecretPDFError } from './client';
|
|
9
9
|
export type { SecretPDFConfig, SecretPDFClientOptions } from './client';
|
|
10
10
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,cAAc,aAAa,CAAC;AAG5B,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,cAAc,aAAa,CAAC;AAG5B,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAG3D,YAAY,EACV,eAAe,EACf,sBAAsB,EACvB,MAAM,UAAU,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -20,10 +20,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
20
20
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
21
21
|
};
|
|
22
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
-
exports.SecretPDFClient = void 0;
|
|
23
|
+
exports.SecretPDFError = exports.SecretPDFClient = void 0;
|
|
24
24
|
// Export all API classes and types from the generated API
|
|
25
25
|
__exportStar(require("./api/index"), exports);
|
|
26
|
-
// Export the main SDK client class
|
|
26
|
+
// Export the main SDK client class and error class
|
|
27
27
|
var client_1 = require("./client");
|
|
28
28
|
Object.defineProperty(exports, "SecretPDFClient", { enumerable: true, get: function () { return client_1.SecretPDFClient; } });
|
|
29
|
+
Object.defineProperty(exports, "SecretPDFError", { enumerable: true, get: function () { return client_1.SecretPDFError; } });
|
|
29
30
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;;AAEH,0DAA0D;AAC1D,8CAA4B;AAE5B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;;AAEH,0DAA0D;AAC1D,8CAA4B;AAE5B,mDAAmD;AACnD,mCAA2D;AAAlD,yGAAA,eAAe,OAAA;AAAE,wGAAA,cAAc,OAAA"}
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@secretpdf/sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "TypeScript/JavaScript SDK for Secret PDF API - Generate PDFs from HTML templates in one api call.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": {
|
|
9
|
+
"import": "./dist/index.js",
|
|
9
10
|
"require": "./dist/index.js",
|
|
10
11
|
"types": "./dist/index.d.ts"
|
|
11
12
|
}
|