@doist/todoist-api-typescript 5.1.0 → 5.1.1
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/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.1",
|
|
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"
|