@tapizlabs/sdk 0.1.2 → 0.1.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"documentPdfService.d.ts","sourceRoot":"","sources":["../../../src/resources/documents/documentPdfService.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"documentPdfService.d.ts","sourceRoot":"","sources":["../../../src/resources/documents/documentPdfService.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,iDAAiD,CAAC;AAClG,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kDAAkD,CAAC;AAElF,UAAU,kBAAkB;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,SAAS,CAAC;IACnB,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB;AAED,wBAAsB,mBAAmB,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CAiBpF"}
|
|
@@ -1,17 +1,10 @@
|
|
|
1
|
-
import { ensureFreshToken } from "../../client/apiClient";
|
|
2
1
|
import { getTapizSdkConfig } from "../../config/sdkConfig";
|
|
3
2
|
import { TapizApiError } from "../../errors/TapizApiError";
|
|
4
3
|
export async function downloadDocumentPdf(payload) {
|
|
5
|
-
const token = await ensureFreshToken();
|
|
6
4
|
const { baseUrls, downloads } = getTapizSdkConfig();
|
|
7
|
-
// Calls the PDF service directly with the user's JWT (rest-api/pdf-api "decision 10").
|
|
8
|
-
// The pdf-api `document` route is gated by requireAssistant, so the token is required.
|
|
9
5
|
const response = await fetch(`${baseUrls.pdfApi.replace(/\/$/, "")}/api/pdf/document`, {
|
|
10
6
|
method: "POST",
|
|
11
|
-
headers: {
|
|
12
|
-
"Content-Type": "application/json",
|
|
13
|
-
...(token ? { Authorization: `Bearer ${token}` } : {}),
|
|
14
|
-
},
|
|
7
|
+
headers: { "Content-Type": "application/json" },
|
|
15
8
|
body: JSON.stringify(payload),
|
|
16
9
|
});
|
|
17
10
|
if (!response.ok) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"documentPdfService.js","sourceRoot":"","sources":["../../../src/resources/documents/documentPdfService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"documentPdfService.js","sourceRoot":"","sources":["../../../src/resources/documents/documentPdfService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAW3D,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,OAA2B;IACnE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,iBAAiB,EAAE,CAAC;IACpD,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,mBAAmB,EAAE;QACrF,MAAM,EAAE,MAAM;QACd,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;QAC/C,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;KAC9B,CAAC,CAAC;IAEH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QACjB,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;QAC7D,MAAM,OAAO,GAAG,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAQ,OAA+B,CAAC,KAAK,KAAK,QAAQ;YAClH,CAAC,CAAE,OAA6B,CAAC,KAAK;YACtC,CAAC,CAAC,gDAAgD,QAAQ,CAAC,MAAM,EAAE,CAAC;QACtE,MAAM,IAAI,aAAa,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;IACzE,CAAC;IAED,MAAM,SAAS,CAAC,YAAY,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,IAAI,UAAU,MAAM,CAAC,CAAC;AAC5F,CAAC"}
|