@vtecx/vtecxnext 3.1.0 → 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.
- package/dist/vtecxnext.d.ts +14 -0
- package/dist/vtecxnext.js +57 -0
- package/package.json +2 -2
package/dist/vtecxnext.d.ts
CHANGED
|
@@ -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
|
|
@@ -1096,6 +1105,11 @@ export declare class VtecxNext {
|
|
|
1096
1105
|
* @return storage usage
|
|
1097
1106
|
*/
|
|
1098
1107
|
storageusage: () => Promise<number>;
|
|
1108
|
+
/**
|
|
1109
|
+
* get batchjob execute time
|
|
1110
|
+
* @return batchjob execute time
|
|
1111
|
+
*/
|
|
1112
|
+
batchjobexectime: () => Promise<number>;
|
|
1099
1113
|
/**
|
|
1100
1114
|
* convert index informations to argument entry
|
|
1101
1115
|
* @param indexInfos index informations
|
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
|
|
@@ -4027,6 +4056,34 @@ class VtecxNext {
|
|
|
4027
4056
|
}
|
|
4028
4057
|
return 0;
|
|
4029
4058
|
};
|
|
4059
|
+
/**
|
|
4060
|
+
* get batchjob execute time
|
|
4061
|
+
* @return batchjob execute time
|
|
4062
|
+
*/
|
|
4063
|
+
batchjobexectime = async () => {
|
|
4064
|
+
//console.log('[vtecxnext batchjobexectime] start.')
|
|
4065
|
+
// vte.cxへリクエスト
|
|
4066
|
+
const method = 'GET';
|
|
4067
|
+
const url = `${SERVLETPATH_DATA}/?_batchjobexectime`;
|
|
4068
|
+
let response;
|
|
4069
|
+
try {
|
|
4070
|
+
response = await this.requestVtecx(method, url);
|
|
4071
|
+
}
|
|
4072
|
+
catch (e) {
|
|
4073
|
+
throw newFetchError(e, true);
|
|
4074
|
+
}
|
|
4075
|
+
//console.log(`[vtecxnext batchjobexectime] response=${response}`)
|
|
4076
|
+
// vte.cxからのset-cookieを転記
|
|
4077
|
+
this.setCookie(response);
|
|
4078
|
+
// レスポンスのエラーチェック
|
|
4079
|
+
await checkVtecxResponse(response);
|
|
4080
|
+
// 戻り値
|
|
4081
|
+
const data = await getJson(response);
|
|
4082
|
+
if (isIntegerString(data.feed.title)) {
|
|
4083
|
+
return Number(data.feed.title);
|
|
4084
|
+
}
|
|
4085
|
+
return 0;
|
|
4086
|
+
};
|
|
4030
4087
|
/**
|
|
4031
4088
|
* convert index informations to argument entry
|
|
4032
4089
|
* @param indexInfos index informations
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vtecx/vtecxnext",
|
|
3
|
-
"version": "3.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.
|
|
27
|
+
"next": "^16.2.7",
|
|
28
28
|
"sqlstring": "^2.3.3"
|
|
29
29
|
},
|
|
30
30
|
"scripts": {
|