@vtecx/vtecxnext 3.1.1 → 3.1.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.
@@ -655,6 +655,15 @@ export declare class VtecxNext {
655
655
  * @return true
656
656
  */
657
657
  toPdf: (htmlTemplate: string, filename?: string) => Promise<boolean>;
658
+ /**
659
+ * Create PDF and put content.
660
+ * @param uri key
661
+ * @param bysize true if registering with specified size
662
+ * @param filename attachment file name
663
+ * @param arrayBuffer content (for batch or server action)
664
+ * @return message
665
+ */
666
+ putPdf: (uri: string, htmlTemplate: string) => Promise<Entry[]>;
658
667
  /**
659
668
  * put the signature of uri and revision.
660
669
  * @param uri key
package/dist/vtecxnext.js CHANGED
@@ -2068,6 +2068,35 @@ class VtecxNext {
2068
2068
  this.bufferData = await resData.arrayBuffer();
2069
2069
  return true;
2070
2070
  };
2071
+ /**
2072
+ * Create PDF and put content.
2073
+ * @param uri key
2074
+ * @param bysize true if registering with specified size
2075
+ * @param filename attachment file name
2076
+ * @param arrayBuffer content (for batch or server action)
2077
+ * @return message
2078
+ */
2079
+ putPdf = async (uri, htmlTemplate) => {
2080
+ //console.log(`[vtecxnext putPdf] start. uri=${uri}`)
2081
+ // キー入力値チェック
2082
+ checkUri(uri);
2083
+ // vte.cxへリクエスト
2084
+ const method = 'PUT';
2085
+ const url = `${SERVLETPATH_PROVIDER}${uri}?_pdf&_content`;
2086
+ let response;
2087
+ try {
2088
+ response = await this.requestVtecx(method, url, htmlTemplate);
2089
+ }
2090
+ catch (e) {
2091
+ throw newFetchError(e, true);
2092
+ }
2093
+ //console.log(`[vtecxnext putPdf] response. status=${response.status}`)
2094
+ // vte.cxからのset-cookieを転記
2095
+ this.setCookie(response);
2096
+ // レスポンスのエラーチェック
2097
+ await checkVtecxResponse(response);
2098
+ return await getJson(response);
2099
+ };
2071
2100
  /**
2072
2101
  * put the signature of uri and revision.
2073
2102
  * @param uri key
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vtecx/vtecxnext",
3
- "version": "3.1.1",
3
+ "version": "3.1.2",
4
4
  "description": "vte.cx Next.js api",
5
5
  "main": "dist/index.js",
6
6
  "files": [
@@ -24,7 +24,7 @@
24
24
  "typescript": "^6.0.3"
25
25
  },
26
26
  "dependencies": {
27
- "next": "^16.2.6",
27
+ "next": "^16.2.7",
28
28
  "sqlstring": "^2.3.3"
29
29
  },
30
30
  "scripts": {