@doist/todoist-api-typescript 5.1.0 → 5.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/TodoistApi.js
CHANGED
|
@@ -284,17 +284,16 @@ var TodoistApi = /** @class */ (function () {
|
|
|
284
284
|
TodoistApi.prototype.moveTasks = function (ids, args, requestId) {
|
|
285
285
|
var _a;
|
|
286
286
|
return __awaiter(this, void 0, void 0, function () {
|
|
287
|
-
var
|
|
287
|
+
var commands, syncRequest, response, syncTasks;
|
|
288
288
|
return __generator(this, function (_b) {
|
|
289
289
|
switch (_b.label) {
|
|
290
290
|
case 0:
|
|
291
291
|
if (ids.length > MAX_COMMAND_COUNT) {
|
|
292
292
|
throw new types_1.TodoistRequestError("Maximum number of items is ".concat(MAX_COMMAND_COUNT), 400);
|
|
293
293
|
}
|
|
294
|
-
uuid = (0, uuid_1.v4)();
|
|
295
294
|
commands = ids.map(function (id) { return ({
|
|
296
295
|
type: 'item_move',
|
|
297
|
-
uuid:
|
|
296
|
+
uuid: (0, uuid_1.v4)(),
|
|
298
297
|
args: __assign(__assign(__assign({ id: id }, (args.projectId && { project_id: args.projectId })), (args.sectionId && { section_id: args.sectionId })), (args.parentId && { parent_id: args.parentId })),
|
|
299
298
|
}); });
|
|
300
299
|
syncRequest = {
|
package/dist/restClient.js
CHANGED
|
@@ -58,6 +58,7 @@ var errors_1 = require("./types/errors");
|
|
|
58
58
|
var uuid_1 = require("uuid");
|
|
59
59
|
var axios_retry_1 = __importDefault(require("axios-retry"));
|
|
60
60
|
var endpoints_1 = require("./consts/endpoints");
|
|
61
|
+
var processing_helpers_1 = require("./utils/processing-helpers");
|
|
61
62
|
function paramsSerializer(params) {
|
|
62
63
|
var qs = new URLSearchParams();
|
|
63
64
|
Object.keys(params).forEach(function (key) {
|
|
@@ -106,7 +107,11 @@ function getRequestConfiguration(baseURL, apiToken, requestId) {
|
|
|
106
107
|
}
|
|
107
108
|
function getAxiosClient(baseURL, apiToken, requestId) {
|
|
108
109
|
var configuration = getRequestConfiguration(baseURL, apiToken, requestId);
|
|
109
|
-
var client = (0, axios_case_converter_1.default)(axios_1.default.create(configuration)
|
|
110
|
+
var client = (0, axios_case_converter_1.default)(axios_1.default.create(configuration), {
|
|
111
|
+
caseFunctions: {
|
|
112
|
+
camel: processing_helpers_1.customCamelCase,
|
|
113
|
+
},
|
|
114
|
+
});
|
|
110
115
|
(0, axios_retry_1.default)(client, {
|
|
111
116
|
retries: 3,
|
|
112
117
|
retryCondition: isNetworkError,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function customCamelCase(input: string): string;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.customCamelCase = void 0;
|
|
7
|
+
var camelcase_1 = __importDefault(require("camelcase"));
|
|
8
|
+
var emoji_regex_1 = __importDefault(require("emoji-regex"));
|
|
9
|
+
function isEmojiKey(key) {
|
|
10
|
+
var regex = (0, emoji_regex_1.default)();
|
|
11
|
+
return regex.test(key);
|
|
12
|
+
}
|
|
13
|
+
function customCamelCase(input) {
|
|
14
|
+
// If the value is a solitary emoji string, return the key as-is
|
|
15
|
+
if (isEmojiKey(input))
|
|
16
|
+
return input;
|
|
17
|
+
return (0, camelcase_1.default)(input);
|
|
18
|
+
}
|
|
19
|
+
exports.customCamelCase = customCamelCase;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@doist/todoist-api-typescript",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.2",
|
|
4
4
|
"description": "A typescript wrapper for the Todoist REST API.",
|
|
5
5
|
"author": "Doist developers",
|
|
6
6
|
"repository": "git@github.com:doist/todoist-api-typescript.git",
|
|
@@ -27,6 +27,8 @@
|
|
|
27
27
|
"axios": "^1.0.0",
|
|
28
28
|
"axios-case-converter": "^1.0.0",
|
|
29
29
|
"axios-retry": "^3.1.9",
|
|
30
|
+
"camelcase": "6.3.0",
|
|
31
|
+
"emoji-regex": "10.4.0",
|
|
30
32
|
"ts-custom-error": "^3.2.0",
|
|
31
33
|
"uuid": "^9.0.0",
|
|
32
34
|
"zod": "^3.24.1"
|
|
@@ -46,7 +48,7 @@
|
|
|
46
48
|
"husky": "8.0.3",
|
|
47
49
|
"jest": "29.5.0",
|
|
48
50
|
"lint-staged": "13.1.4",
|
|
49
|
-
"npm-run-
|
|
51
|
+
"npm-run-all2": "5.0.0",
|
|
50
52
|
"prettier": "3.3.2",
|
|
51
53
|
"rimraf": "3.0.2",
|
|
52
54
|
"ts-jest": "29.0.5",
|