@doist/todoist-api-typescript 7.0.0 → 7.1.0
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/cjs/todoist-api.js
CHANGED
|
@@ -322,13 +322,16 @@ class TodoistApi {
|
|
|
322
322
|
// Process content if both content and isUncompletable are provided
|
|
323
323
|
const processedArgs = normalizedArgs.content && normalizedArgs.isUncompletable !== undefined
|
|
324
324
|
? Object.assign(Object.assign({}, normalizedArgs), { content: (0, uncompletable_helpers_1.processTaskContent)(normalizedArgs.content, normalizedArgs.isUncompletable) }) : normalizedArgs;
|
|
325
|
+
// Remap `order` → `childOrder` so snakeCaseKeys() produces `child_order`
|
|
326
|
+
const { order } = processedArgs, argsWithoutOrder = __rest(processedArgs, ["order"]);
|
|
327
|
+
const remappedArgs = order !== undefined ? Object.assign(Object.assign({}, argsWithoutOrder), { childOrder: order }) : argsWithoutOrder;
|
|
325
328
|
const response = await (0, rest_client_1.request)({
|
|
326
329
|
httpMethod: 'POST',
|
|
327
330
|
baseUri: this.syncApiBase,
|
|
328
331
|
relativePath: generatePath(endpoints_1.ENDPOINT_REST_TASKS, id),
|
|
329
332
|
apiToken: this.authToken,
|
|
330
333
|
customFetch: this.customFetch,
|
|
331
|
-
payload:
|
|
334
|
+
payload: remappedArgs,
|
|
332
335
|
requestId: requestId,
|
|
333
336
|
});
|
|
334
337
|
return (0, validators_1.validateTask)(response.data);
|
package/dist/esm/todoist-api.js
CHANGED
|
@@ -319,13 +319,16 @@ export class TodoistApi {
|
|
|
319
319
|
// Process content if both content and isUncompletable are provided
|
|
320
320
|
const processedArgs = normalizedArgs.content && normalizedArgs.isUncompletable !== undefined
|
|
321
321
|
? Object.assign(Object.assign({}, normalizedArgs), { content: processTaskContent(normalizedArgs.content, normalizedArgs.isUncompletable) }) : normalizedArgs;
|
|
322
|
+
// Remap `order` → `childOrder` so snakeCaseKeys() produces `child_order`
|
|
323
|
+
const { order } = processedArgs, argsWithoutOrder = __rest(processedArgs, ["order"]);
|
|
324
|
+
const remappedArgs = order !== undefined ? Object.assign(Object.assign({}, argsWithoutOrder), { childOrder: order }) : argsWithoutOrder;
|
|
322
325
|
const response = await request({
|
|
323
326
|
httpMethod: 'POST',
|
|
324
327
|
baseUri: this.syncApiBase,
|
|
325
328
|
relativePath: generatePath(ENDPOINT_REST_TASKS, id),
|
|
326
329
|
apiToken: this.authToken,
|
|
327
330
|
customFetch: this.customFetch,
|
|
328
|
-
payload:
|
|
331
|
+
payload: remappedArgs,
|
|
329
332
|
requestId: requestId,
|
|
330
333
|
});
|
|
331
334
|
return validateTask(response.data);
|
|
@@ -115,6 +115,11 @@ export type UpdateTaskArgs = {
|
|
|
115
115
|
description?: string;
|
|
116
116
|
labels?: string[];
|
|
117
117
|
priority?: number;
|
|
118
|
+
/**
|
|
119
|
+
* Sort order of the task within its parent/project.
|
|
120
|
+
* Internally mapped to `child_order` in the API payload.
|
|
121
|
+
*/
|
|
122
|
+
order?: number;
|
|
118
123
|
/**
|
|
119
124
|
* Natural language due date.
|
|
120
125
|
* Use `"no date"` to clear a due date, or `null` as an SDK alias for the same behavior.
|
package/package.json
CHANGED