@kintone/cli
Advanced tools
Comparing version 1.13.0 to 1.14.0
@@ -6,2 +6,10 @@ # Change Log | ||
## [1.14.0](https://github.com/kintone/cli-kintone/compare/v1.13.0...v1.14.0) (2025-02-19) | ||
### Features | ||
* retry API request on 5xx errors ([#1013](https://github.com/kintone/cli-kintone/issues/1013)) ([f3d19ae](https://github.com/kintone/cli-kintone/commit/f3d19ae207c7711ee4b5e26486754507ee0c9fa6)) | ||
* Support three new locales ([#996](https://github.com/kintone/cli-kintone/issues/996)) ([709bc6c](https://github.com/kintone/cli-kintone/commit/709bc6cc11c0627b76a2f55d27cf2e9d3ecacb33)) | ||
## [1.13.0](https://github.com/kintone/cli-kintone/compare/v1.12.3...v1.13.0) (2025-01-16) | ||
@@ -8,0 +16,0 @@ |
{ | ||
"name": "@kintone/cli", | ||
"version": "1.13.0", | ||
"version": "1.14.0", | ||
"publishConfig": { | ||
@@ -72,11 +72,11 @@ "access": "public" | ||
"@actions/core": "^1.11.1", | ||
"@babel/core": "^7.26.0", | ||
"@babel/preset-env": "^7.26.0", | ||
"@babel/core": "^7.26.9", | ||
"@babel/preset-env": "^7.26.9", | ||
"@babel/preset-typescript": "^7.26.0", | ||
"@cucumber/cucumber": "^11.2.0", | ||
"@cybozu/eslint-config": "^24.0.0-beta.1", | ||
"@cybozu/eslint-config": "^24.0.0", | ||
"@cybozu/license-manager": "^1.2.1", | ||
"@octokit/rest": "^20.1.1", | ||
"@types/jest": "^29.5.14", | ||
"@types/node": "^18.19.70", | ||
"@types/node": "^18.19.76", | ||
"@types/node-rsa": "^1.1.4", | ||
@@ -86,12 +86,12 @@ "@types/rollup-plugin-auto-external": "^2.0.5", | ||
"@types/yauzl": "^2.10.3", | ||
"@types/yazl": "^2.4.5", | ||
"@types/yazl": "^2.4.6", | ||
"@vercel/ncc": "^0.38.3", | ||
"ajv": "^8.17.1", | ||
"allure-commandline": "^2.32.0", | ||
"allure-commandline": "^2.32.2", | ||
"allure-cucumberjs": "^2.15.1", | ||
"allure-jest": "^3.0.9", | ||
"allure-js-commons": "^3.0.9", | ||
"allure-jest": "^3.2.0", | ||
"allure-js-commons": "^3.1.0", | ||
"babel-jest": "^29.7.0", | ||
"cross-env": "^7.0.3", | ||
"eslint": "^9.18.0", | ||
"eslint": "^9.20.1", | ||
"glob": "^10.4.5", | ||
@@ -101,12 +101,12 @@ "jest": "^29.7.0", | ||
"pkg": "^5.8.1", | ||
"prettier": "^3.4.2", | ||
"prettier": "^3.5.1", | ||
"rimraf": "^5.0.10", | ||
"ts-node": "^10.9.2", | ||
"typescript": "^5.7.3", | ||
"zx": "^8.3.0" | ||
"zx": "^8.3.2" | ||
}, | ||
"dependencies": { | ||
"@inquirer/prompts": "^5.5.0", | ||
"@kintone/plugin-manifest-validator": "^10.2.2", | ||
"@kintone/rest-api-client": "^5.7.0", | ||
"@kintone/plugin-manifest-validator": "^10.3.0", | ||
"@kintone/rest-api-client": "^5.7.1", | ||
"chalk": "4.1.2", | ||
@@ -127,3 +127,3 @@ "chokidar": "^4.0.3", | ||
"braces": ">=3.0.3", | ||
"undici": ">=7.2.2", | ||
"undici": ">=7.2.3", | ||
"ws": ">=8.18.0" | ||
@@ -130,0 +130,0 @@ } |
@@ -28,2 +28,6 @@ import type { ManifestInterface } from "../interface"; | ||
zh?: string; | ||
"zh-TW"?: string; | ||
es?: string; | ||
"pt-BR"?: string; | ||
th?: string; | ||
}; | ||
@@ -34,2 +38,6 @@ description?: { | ||
zh?: string; | ||
"zh-TW"?: string; | ||
es?: string; | ||
"pt-BR"?: string; | ||
th?: string; | ||
}; | ||
@@ -41,2 +49,6 @@ icon: string; | ||
zh: string; | ||
"zh-TW"?: string; | ||
es?: string; | ||
"pt-BR"?: string; | ||
th?: string; | ||
}; | ||
@@ -43,0 +55,0 @@ desktop?: { |
@@ -31,2 +31,6 @@ import type { ManifestInterface } from "../interface"; | ||
zh?: string; | ||
"zh-TW"?: string; | ||
es?: string; | ||
"pt-BR"?: string; | ||
th?: string; | ||
}; | ||
@@ -37,2 +41,6 @@ description?: { | ||
zh?: string; | ||
"zh-TW"?: string; | ||
es?: string; | ||
"pt-BR"?: string; | ||
th?: string; | ||
}; | ||
@@ -44,2 +52,6 @@ icon: string; | ||
zh: string; | ||
"zh-TW"?: string; | ||
es?: string; | ||
"pt-BR"?: string; | ||
th?: string; | ||
}; | ||
@@ -46,0 +58,0 @@ components?: [ |
@@ -7,2 +7,3 @@ "use strict"; | ||
exports.getRecords = exports.NO_RECORDS_WARNING = void 0; | ||
const rest_api_client_1 = require("@kintone/rest-api-client"); | ||
const path_1 = __importDefault(require("path")); | ||
@@ -13,2 +14,3 @@ const fs_1 = require("fs"); | ||
const log_1 = require("../../../utils/log"); | ||
const retry_1 = require("../../../utils/retry"); | ||
exports.NO_RECORDS_WARNING = "No records exist in the app or match the condition."; | ||
@@ -124,4 +126,19 @@ const getRecords = async (apiClient, app, recordDestination, schema, options, getAllRecordsFn = getAllRecords_1.getAllRecords) => { | ||
const downloadAndSaveFile = async (apiClient, fileKey, localFilePath) => { | ||
const file = await apiClient.file.downloadFile({ | ||
const file = await (0, retry_1.retry)(() => apiClient.file.downloadFile({ | ||
fileKey, | ||
}), { | ||
onError: (e, attemptCount, toRetry, nextDelay, config) => { | ||
log_1.logger.warn("Failed to download attachment file due to an error on kintone"); | ||
log_1.logger.warn(`fileKey: ${fileKey}, path: ${localFilePath}`); | ||
log_1.logger.warn(e); | ||
if (toRetry) { | ||
if (attemptCount === config.maxAttempt) { | ||
log_1.logger.error(`Retry limit reached (count: ${attemptCount}), limit: ${config.maxAttempt}`); | ||
} | ||
else { | ||
log_1.logger.warn(`Retrying request after ${nextDelay} milliseconds... (count: ${attemptCount}, limit: ${config.maxAttempt})`); | ||
} | ||
} | ||
}, | ||
retryCondition: (e) => e instanceof rest_api_client_1.KintoneRestAPIError && e.status >= 500 && e.status < 600, | ||
}); | ||
@@ -128,0 +145,0 @@ return saveFileWithoutOverwrite(localFilePath, file); |
@@ -7,3 +7,6 @@ "use strict"; | ||
exports.fieldProcessor = void 0; | ||
const rest_api_client_1 = require("@kintone/rest-api-client"); | ||
const path_1 = __importDefault(require("path")); | ||
const retry_1 = require("../../../../utils/retry"); | ||
const log_1 = require("../../../../utils/log"); | ||
const fieldProcessor = async (apiClient, field, fieldSchema, { attachmentsDir, skipMissingFields }) => { | ||
@@ -31,6 +34,19 @@ switch (fieldSchema.type) { | ||
} | ||
const { fileKey } = await apiClient.file.uploadFile({ | ||
const { fileKey } = await (0, retry_1.retry)(() => apiClient.file.uploadFile({ | ||
file: { | ||
path: path_1.default.join(attachmentsDir, fileInfo.localFilePath), | ||
}, | ||
}), { | ||
onError: (e, attemptCount, toRetry, nextDelay, config) => { | ||
log_1.logger.warn("Failed to upload attachment file due to an error on kintone"); | ||
log_1.logger.warn(`path: ${fileInfo.localFilePath}`); | ||
log_1.logger.warn(e); | ||
if (toRetry) { | ||
if (attemptCount === config.maxAttempt) { | ||
log_1.logger.error(`Retry limit reached (count: ${attemptCount}), limit: ${config.maxAttempt}`); | ||
} | ||
log_1.logger.warn(`Retrying request after ${nextDelay} milliseconds... (count: ${attemptCount}, limit: ${config.maxAttempt})`); | ||
} | ||
}, | ||
retryCondition: (e) => e instanceof rest_api_client_1.KintoneRestAPIError && e.status >= 500 && e.status < 600, | ||
}); | ||
@@ -37,0 +53,0 @@ uploadedList.push({ |
{ | ||
"name": "@kintone/cli", | ||
"version": "1.13.0", | ||
"version": "1.14.0", | ||
"publishConfig": { | ||
@@ -38,11 +38,11 @@ "access": "public" | ||
"@actions/core": "^1.11.1", | ||
"@babel/core": "^7.26.0", | ||
"@babel/preset-env": "^7.26.0", | ||
"@babel/core": "^7.26.9", | ||
"@babel/preset-env": "^7.26.9", | ||
"@babel/preset-typescript": "^7.26.0", | ||
"@cucumber/cucumber": "^11.2.0", | ||
"@cybozu/eslint-config": "^24.0.0-beta.1", | ||
"@cybozu/eslint-config": "^24.0.0", | ||
"@cybozu/license-manager": "^1.2.1", | ||
"@octokit/rest": "^20.1.1", | ||
"@types/jest": "^29.5.14", | ||
"@types/node": "^18.19.70", | ||
"@types/node": "^18.19.76", | ||
"@types/node-rsa": "^1.1.4", | ||
@@ -52,12 +52,12 @@ "@types/rollup-plugin-auto-external": "^2.0.5", | ||
"@types/yauzl": "^2.10.3", | ||
"@types/yazl": "^2.4.5", | ||
"@types/yazl": "^2.4.6", | ||
"@vercel/ncc": "^0.38.3", | ||
"ajv": "^8.17.1", | ||
"allure-commandline": "^2.32.0", | ||
"allure-commandline": "^2.32.2", | ||
"allure-cucumberjs": "^2.15.1", | ||
"allure-jest": "^3.0.9", | ||
"allure-js-commons": "^3.0.9", | ||
"allure-jest": "^3.2.0", | ||
"allure-js-commons": "^3.1.0", | ||
"babel-jest": "^29.7.0", | ||
"cross-env": "^7.0.3", | ||
"eslint": "^9.18.0", | ||
"eslint": "^9.20.1", | ||
"glob": "^10.4.5", | ||
@@ -67,12 +67,12 @@ "jest": "^29.7.0", | ||
"pkg": "^5.8.1", | ||
"prettier": "^3.4.2", | ||
"prettier": "^3.5.1", | ||
"rimraf": "^5.0.10", | ||
"ts-node": "^10.9.2", | ||
"typescript": "^5.7.3", | ||
"zx": "^8.3.0" | ||
"zx": "^8.3.2" | ||
}, | ||
"dependencies": { | ||
"@inquirer/prompts": "^5.5.0", | ||
"@kintone/plugin-manifest-validator": "^10.2.2", | ||
"@kintone/rest-api-client": "^5.7.0", | ||
"@kintone/plugin-manifest-validator": "^10.3.0", | ||
"@kintone/rest-api-client": "^5.7.1", | ||
"chalk": "4.1.2", | ||
@@ -79,0 +79,0 @@ "chokidar": "^4.0.3", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
433071
348
6243