@togglhq/cli 1.11.5 → 1.11.6
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/build/cli.js +1 -1
- package/build/index.js +1 -1
- package/build/{program-DA8QvT5D.js → program-Bl7GS_uC.js} +30 -118
- package/build/program.js +1 -1
- package/package.json +2 -2
package/build/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as CommanderError, i as shutdownCliTelemetry, n as captureCliException, r as initCliTelemetry, t as createProgram } from "./program-
|
|
2
|
+
import { a as CommanderError, i as shutdownCliTelemetry, n as captureCliException, r as initCliTelemetry, t as createProgram } from "./program-Bl7GS_uC.js";
|
|
3
3
|
import { readFileSync } from "node:fs";
|
|
4
4
|
import { dirname, join } from "node:path";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
package/build/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as createProgram } from "./program-
|
|
1
|
+
import { t as createProgram } from "./program-Bl7GS_uC.js";
|
|
2
2
|
export { createProgram };
|
|
@@ -5495,10 +5495,6 @@ function _joinExpects$1(values$1, separator) {
|
|
|
5495
5495
|
*/
|
|
5496
5496
|
const ISO_DATE_REGEX$1 = /^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])$/u;
|
|
5497
5497
|
/**
|
|
5498
|
-
* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time regex.
|
|
5499
|
-
*/
|
|
5500
|
-
const ISO_DATE_TIME_REGEX$1 = /^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])[T ](?:0\d|1\d|2[0-3]):[0-5]\d$/u;
|
|
5501
|
-
/**
|
|
5502
5498
|
* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp regex. Allows a
|
|
5503
5499
|
* space as a date/time separator and an optional space before the UTC offset.
|
|
5504
5500
|
*/
|
|
@@ -5552,22 +5548,6 @@ function isoDate$1(message$1) {
|
|
|
5552
5548
|
};
|
|
5553
5549
|
}
|
|
5554
5550
|
/* @__NO_SIDE_EFFECTS__ */
|
|
5555
|
-
function isoDateTime$1(message$1) {
|
|
5556
|
-
return {
|
|
5557
|
-
kind: "validation",
|
|
5558
|
-
type: "iso_date_time",
|
|
5559
|
-
reference: isoDateTime$1,
|
|
5560
|
-
async: false,
|
|
5561
|
-
expects: null,
|
|
5562
|
-
requirement: ISO_DATE_TIME_REGEX$1,
|
|
5563
|
-
message: message$1,
|
|
5564
|
-
"~run"(dataset, config$1) {
|
|
5565
|
-
if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue$1(this, "date-time", dataset, config$1);
|
|
5566
|
-
return dataset;
|
|
5567
|
-
}
|
|
5568
|
-
};
|
|
5569
|
-
}
|
|
5570
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
5571
5551
|
function isoTimestamp(message$1) {
|
|
5572
5552
|
return {
|
|
5573
5553
|
kind: "validation",
|
|
@@ -8151,14 +8131,14 @@ function isHttpError(error) {
|
|
|
8151
8131
|
}
|
|
8152
8132
|
//#endregion
|
|
8153
8133
|
//#region ../focus-queries/dist/utils/requests.ts
|
|
8154
|
-
const META_SYMBOL
|
|
8155
|
-
function withResponseMeta
|
|
8134
|
+
const META_SYMBOL = Symbol.for("querygen:response:meta");
|
|
8135
|
+
function withResponseMeta(data, headers, status) {
|
|
8156
8136
|
if (!data) return data;
|
|
8157
8137
|
const meta = {
|
|
8158
8138
|
headers: Object.fromEntries(headers.entries()),
|
|
8159
8139
|
status
|
|
8160
8140
|
};
|
|
8161
|
-
if (typeof data === "object") Object.defineProperty(data, META_SYMBOL
|
|
8141
|
+
if (typeof data === "object") Object.defineProperty(data, META_SYMBOL, {
|
|
8162
8142
|
value: meta,
|
|
8163
8143
|
enumerable: false,
|
|
8164
8144
|
writable: false,
|
|
@@ -10013,7 +9993,7 @@ async function getOrganizationUsersClassic(httpClient, organization_id, { worksp
|
|
|
10013
9993
|
include_calendar_integration
|
|
10014
9994
|
}, true)
|
|
10015
9995
|
});
|
|
10016
|
-
return withResponseMeta
|
|
9996
|
+
return withResponseMeta(await response.json(), response.headers, response.status);
|
|
10017
9997
|
}
|
|
10018
9998
|
//#endregion
|
|
10019
9999
|
//#region ../focus-queries/out/utils/requests.js
|
|
@@ -11013,7 +10993,7 @@ const PublicMeEntryRequestSchema = /* @__PURE__ */ object$2({
|
|
|
11013
10993
|
]))
|
|
11014
10994
|
});
|
|
11015
10995
|
//#endregion
|
|
11016
|
-
//#region ../../node_modules/.pnpm/@toggl+queries@2.2.
|
|
10996
|
+
//#region ../../node_modules/.pnpm/@toggl+queries@2.2.21_@tanstack+react-query@5.99.0_react@19.2.5__@toggl+sync@0.2.4_reac_0f67cdfcb189f7cb2e84dcd5c08e0ebf/node_modules/@toggl/queries/dist/org/invitation/requests.mjs
|
|
11017
10997
|
async function getInvitations(httpClient, signal) {
|
|
11018
10998
|
return (await httpClient.get(`invitations`, { signal })).json();
|
|
11019
10999
|
}
|
|
@@ -11030,22 +11010,7 @@ async function resendInvitation(httpClient, organization_id, organization_user_i
|
|
|
11030
11010
|
return (await httpClient.post(`organizations/${organization_id}/invitations/${organization_user_id}/resend`, { signal })).json();
|
|
11031
11011
|
}
|
|
11032
11012
|
//#endregion
|
|
11033
|
-
//#region ../../node_modules/.pnpm/@toggl+queries@2.2.
|
|
11034
|
-
const META_SYMBOL = Symbol.for("querygen:response:meta");
|
|
11035
|
-
function withResponseMeta(data, headers, status) {
|
|
11036
|
-
if (!data) return data;
|
|
11037
|
-
const meta = {
|
|
11038
|
-
headers: Object.fromEntries(headers.entries()),
|
|
11039
|
-
status
|
|
11040
|
-
};
|
|
11041
|
-
if (typeof data === "object") Object.defineProperty(data, META_SYMBOL, {
|
|
11042
|
-
value: meta,
|
|
11043
|
-
enumerable: false,
|
|
11044
|
-
writable: false,
|
|
11045
|
-
configurable: false
|
|
11046
|
-
});
|
|
11047
|
-
return data;
|
|
11048
|
-
}
|
|
11013
|
+
//#region ../../node_modules/.pnpm/@toggl+queries@2.2.21_@tanstack+react-query@5.99.0_react@19.2.5__@toggl+sync@0.2.4_reac_0f67cdfcb189f7cb2e84dcd5c08e0ebf/node_modules/@toggl/queries/dist/org/utils/requests.mjs
|
|
11049
11014
|
function buildSearchParams(params, flattenArrays = false) {
|
|
11050
11015
|
const searchParams = new URLSearchParams();
|
|
11051
11016
|
Object.entries(params).forEach(([key, value]) => {
|
|
@@ -11057,7 +11022,7 @@ function buildSearchParams(params, flattenArrays = false) {
|
|
|
11057
11022
|
return searchParams;
|
|
11058
11023
|
}
|
|
11059
11024
|
//#endregion
|
|
11060
|
-
//#region ../../node_modules/.pnpm/@toggl+queries@2.2.
|
|
11025
|
+
//#region ../../node_modules/.pnpm/@toggl+queries@2.2.21_@tanstack+react-query@5.99.0_react@19.2.5__@toggl+sync@0.2.4_reac_0f67cdfcb189f7cb2e84dcd5c08e0ebf/node_modules/@toggl/queries/dist/org/organization-user/requests.mjs
|
|
11061
11026
|
async function getOrganizationUser(httpClient, organization_id, organization_user_id, signal) {
|
|
11062
11027
|
return (await httpClient.get(`organizations/${organization_id}/users/${organization_user_id}`, { signal })).json();
|
|
11063
11028
|
}
|
|
@@ -11071,7 +11036,7 @@ async function patchOrganizationUserActive(httpClient, organization_id, organiza
|
|
|
11071
11036
|
return (await httpClient.patch(`organizations/${organization_id}/users/${organization_user_id}/active_status/${status}`, { signal })).json();
|
|
11072
11037
|
}
|
|
11073
11038
|
//#endregion
|
|
11074
|
-
//#region ../../node_modules/.pnpm/@toggl+queries@2.2.
|
|
11039
|
+
//#region ../../node_modules/.pnpm/@toggl+queries@2.2.21_@tanstack+react-query@5.99.0_react@19.2.5__@toggl+sync@0.2.4_reac_0f67cdfcb189f7cb2e84dcd5c08e0ebf/node_modules/@toggl/queries/dist/org/workspace/requests.mjs
|
|
11075
11040
|
async function getWorkspaces(httpClient, organization_id, signal) {
|
|
11076
11041
|
return (await httpClient.get(`organizations/${organization_id}/workspaces`, { signal })).json();
|
|
11077
11042
|
}
|
|
@@ -11091,24 +11056,23 @@ const WorkingHoursUpdateInputSchema = /* @__PURE__ */ object$2({
|
|
|
11091
11056
|
});
|
|
11092
11057
|
const StatusOKSchema = /* @__PURE__ */ object$2({ status: /* @__PURE__ */ string$1() });
|
|
11093
11058
|
//#endregion
|
|
11094
|
-
//#region ../../node_modules/.pnpm/@toggl+queries@2.2.
|
|
11095
|
-
async function
|
|
11096
|
-
|
|
11059
|
+
//#region ../../node_modules/.pnpm/@toggl+queries@2.2.21_@tanstack+react-query@5.99.0_react@19.2.5__@toggl+sync@0.2.4_reac_0f67cdfcb189f7cb2e84dcd5c08e0ebf/node_modules/@toggl/queries/dist/org/holiday-calendar/requests.mjs
|
|
11060
|
+
async function holidayListDates(httpClient, organization_id, { year, country }, signal) {
|
|
11061
|
+
return (await httpClient.get(`holidays/organizations/${organization_id}/calendar/dates`, {
|
|
11097
11062
|
signal,
|
|
11098
11063
|
searchParams: buildSearchParams({
|
|
11099
|
-
|
|
11100
|
-
|
|
11064
|
+
year,
|
|
11065
|
+
country
|
|
11101
11066
|
}, true)
|
|
11102
|
-
});
|
|
11103
|
-
return withResponseMeta(await response.json(), response.headers, response.status);
|
|
11067
|
+
})).json();
|
|
11104
11068
|
}
|
|
11105
11069
|
//#endregion
|
|
11106
|
-
//#region ../../node_modules/.pnpm/@toggl+queries@2.2.
|
|
11070
|
+
//#region ../../node_modules/.pnpm/@toggl+queries@2.2.21_@tanstack+react-query@5.99.0_react@19.2.5__@toggl+sync@0.2.4_reac_0f67cdfcb189f7cb2e84dcd5c08e0ebf/node_modules/@toggl/queries/dist/shared-data/status/requests.mjs
|
|
11107
11071
|
async function getStatus(httpClient, signal) {
|
|
11108
11072
|
return (await httpClient.get(`shared_data/api/status`, { signal })).json();
|
|
11109
11073
|
}
|
|
11110
11074
|
//#endregion
|
|
11111
|
-
//#region ../../node_modules/.pnpm/@toggl+queries@2.2.
|
|
11075
|
+
//#region ../../node_modules/.pnpm/@toggl+queries@2.2.21_@tanstack+react-query@5.99.0_react@19.2.5__@toggl+sync@0.2.4_reac_0f67cdfcb189f7cb2e84dcd5c08e0ebf/node_modules/@toggl/queries/dist/org/timeoff/requests.mjs
|
|
11112
11076
|
async function timeoffListMyEntries(httpClient, organization_id, { from, to }, signal) {
|
|
11113
11077
|
return (await httpClient.get(`timeoff/organizations/${organization_id}/me`, {
|
|
11114
11078
|
signal,
|
|
@@ -11136,7 +11100,7 @@ async function timeoffDeleteMyEntry(httpClient, organization_id, id, signal) {
|
|
|
11136
11100
|
return response.json();
|
|
11137
11101
|
}
|
|
11138
11102
|
//#endregion
|
|
11139
|
-
//#region ../../node_modules/.pnpm/@toggl+queries@2.2.
|
|
11103
|
+
//#region ../../node_modules/.pnpm/@toggl+queries@2.2.21_@tanstack+react-query@5.99.0_react@19.2.5__@toggl+sync@0.2.4_reac_0f67cdfcb189f7cb2e84dcd5c08e0ebf/node_modules/@toggl/queries/dist/shared-data/working-hours/requests.mjs
|
|
11140
11104
|
async function getMyWorkingHours(httpClient, organization_id, signal) {
|
|
11141
11105
|
return (await httpClient.get(`shared_data/api/workinghours/${organization_id}/me`, { signal })).json();
|
|
11142
11106
|
}
|
|
@@ -11161,7 +11125,7 @@ async function deleteMyWorkingHours(httpClient, organization_id, data, signal) {
|
|
|
11161
11125
|
return response.json();
|
|
11162
11126
|
}
|
|
11163
11127
|
//#endregion
|
|
11164
|
-
//#region ../cli-core/build/focus-client-
|
|
11128
|
+
//#region ../cli-core/build/focus-client-C-6hmEQA.js
|
|
11165
11129
|
/** Request header the API reads to attribute traffic to MCP or CLI. */
|
|
11166
11130
|
const TOGGL_CLIENT_HEADER = "X-Toggl-Client";
|
|
11167
11131
|
/** Header the Focus API reads for analytics and presence `platform_origin`. */
|
|
@@ -12049,11 +12013,15 @@ var FocusClient = class {
|
|
|
12049
12013
|
return this.softValidateResponse("getSharedDataStatus", StatusOKSchema, response);
|
|
12050
12014
|
}
|
|
12051
12015
|
async listPublicHolidays(year, country) {
|
|
12052
|
-
const response = await this.run("listPublicHolidays", () =>
|
|
12053
|
-
|
|
12016
|
+
const response = await this.run("listPublicHolidays", () => holidayListDates(this.orgHttp, this.organizationIdNum, country === void 0 ? { year } : {
|
|
12017
|
+
year,
|
|
12018
|
+
country
|
|
12019
|
+
}));
|
|
12020
|
+
if (!response.ok) return response;
|
|
12021
|
+
return {
|
|
12054
12022
|
ok: true,
|
|
12055
|
-
data: response.data
|
|
12056
|
-
}
|
|
12023
|
+
data: response.data.dates
|
|
12024
|
+
};
|
|
12057
12025
|
}
|
|
12058
12026
|
async getMyWorkingHoursShared() {
|
|
12059
12027
|
const response = await this.run("getMyWorkingHoursShared", () => getMyWorkingHours(this.sharedDataHttp, this.organizationIdNum));
|
|
@@ -13203,7 +13171,7 @@ async function runSkillSetup(options) {
|
|
|
13203
13171
|
});
|
|
13204
13172
|
}
|
|
13205
13173
|
//#endregion
|
|
13206
|
-
//#region ../operations/build/validation-
|
|
13174
|
+
//#region ../operations/build/validation-CvDIY-Ah.js
|
|
13207
13175
|
const optionalNumber = /* @__PURE__ */ optional$1(/* @__PURE__ */ number$2());
|
|
13208
13176
|
const perPageField = (max) => /* @__PURE__ */ optional$1(/* @__PURE__ */ pipe$2(/* @__PURE__ */ number$2(), /* @__PURE__ */ integer(), /* @__PURE__ */ minValue$1(1), /* @__PURE__ */ maxValue$1(max), /* @__PURE__ */ description$1(`Results per page (1-${max})`)));
|
|
13209
13177
|
const perPageSchema = perPageField(100);
|
|
@@ -14551,7 +14519,7 @@ const orgSharedOperations = [
|
|
|
14551
14519
|
resource: "holidays",
|
|
14552
14520
|
action: "list",
|
|
14553
14521
|
title: "List public holidays",
|
|
14554
|
-
description: "List
|
|
14522
|
+
description: "List organization holiday calendar dates for a year (optional ISO country override).",
|
|
14555
14523
|
safety: "read",
|
|
14556
14524
|
destructive: false,
|
|
14557
14525
|
cli: {
|
|
@@ -15350,7 +15318,7 @@ async function getProjectRatesSummary(httpClient, organization_id, workspace_id,
|
|
|
15350
15318
|
search
|
|
15351
15319
|
})
|
|
15352
15320
|
});
|
|
15353
|
-
return withResponseMeta
|
|
15321
|
+
return withResponseMeta(await response.json(), response.headers, response.status);
|
|
15354
15322
|
}
|
|
15355
15323
|
async function getProjectRates(httpClient, organization_id, workspace_id, project_id, { order_by } = {}, signal) {
|
|
15356
15324
|
return await httpClient.get(`organizations/${organization_id}/workspaces/${workspace_id}/projects/${project_id}/rates`, {
|
|
@@ -15969,12 +15937,6 @@ async function withdrawTimesheet(httpClient, organization_id, workspace_id, setu
|
|
|
15969
15937
|
}
|
|
15970
15938
|
//#endregion
|
|
15971
15939
|
//#region ../focus-queries/dist/user-settings/requests.ts
|
|
15972
|
-
async function emailUnsubscribePage(httpClient, token, signal) {
|
|
15973
|
-
return await httpClient.get(`email/unsubscribe/${token}`, { signal }).json();
|
|
15974
|
-
}
|
|
15975
|
-
async function emailUnsubscribe(httpClient, token, signal) {
|
|
15976
|
-
return await httpClient.post(`email/unsubscribe/${token}`, { signal }).json();
|
|
15977
|
-
}
|
|
15978
15940
|
async function getUserSettings(httpClient, signal) {
|
|
15979
15941
|
return await httpClient.get(`users/me/settings`, { signal }).json();
|
|
15980
15942
|
}
|
|
@@ -26037,56 +25999,6 @@ const generatedFocusOperations = [
|
|
|
26037
25999
|
return client.listOrgUsers(data);
|
|
26038
26000
|
}
|
|
26039
26001
|
},
|
|
26040
|
-
{
|
|
26041
|
-
id: "focus.users.settings-email-unsubscribe",
|
|
26042
|
-
family: "focus",
|
|
26043
|
-
resource: "users",
|
|
26044
|
-
action: "settings-email-unsubscribe",
|
|
26045
|
-
title: "Settings Email Unsubscribe Users",
|
|
26046
|
-
description: "Settings Email Unsubscribe Users.",
|
|
26047
|
-
safety: "update",
|
|
26048
|
-
destructive: false,
|
|
26049
|
-
cli: {
|
|
26050
|
-
group: ["users", "settings"],
|
|
26051
|
-
command: "email-unsubscribe",
|
|
26052
|
-
interactive: "default"
|
|
26053
|
-
},
|
|
26054
|
-
mcp: { entityTool: "users" },
|
|
26055
|
-
inputSchema: /* @__PURE__ */ looseObject({ token: /* @__PURE__ */ string$1() }),
|
|
26056
|
-
execute: (input, { client }) => {
|
|
26057
|
-
const data = input;
|
|
26058
|
-
return client.runGeneratedRequest("emailUnsubscribe", () => callGeneratedRequest(emailUnsubscribe, [
|
|
26059
|
-
client.httpClient,
|
|
26060
|
-
data.token,
|
|
26061
|
-
void 0
|
|
26062
|
-
]));
|
|
26063
|
-
}
|
|
26064
|
-
},
|
|
26065
|
-
{
|
|
26066
|
-
id: "focus.users.settings-email-unsubscribe-page",
|
|
26067
|
-
family: "focus",
|
|
26068
|
-
resource: "users",
|
|
26069
|
-
action: "settings-email-unsubscribe-page",
|
|
26070
|
-
title: "Settings Email Unsubscribe Page Users",
|
|
26071
|
-
description: "Settings Email Unsubscribe Page Users.",
|
|
26072
|
-
safety: "read",
|
|
26073
|
-
destructive: false,
|
|
26074
|
-
cli: {
|
|
26075
|
-
group: ["users", "settings"],
|
|
26076
|
-
command: "email-unsubscribe-page",
|
|
26077
|
-
interactive: "available"
|
|
26078
|
-
},
|
|
26079
|
-
mcp: { entityTool: "users" },
|
|
26080
|
-
inputSchema: /* @__PURE__ */ looseObject({ token: /* @__PURE__ */ string$1() }),
|
|
26081
|
-
execute: (input, { client }) => {
|
|
26082
|
-
const data = input;
|
|
26083
|
-
return client.runGeneratedRequest("emailUnsubscribePage", () => callGeneratedRequest(emailUnsubscribePage, [
|
|
26084
|
-
client.httpClient,
|
|
26085
|
-
data.token,
|
|
26086
|
-
void 0
|
|
26087
|
-
]));
|
|
26088
|
-
}
|
|
26089
|
-
},
|
|
26090
26002
|
{
|
|
26091
26003
|
id: "focus.users.settings-list",
|
|
26092
26004
|
family: "focus",
|
|
@@ -28197,4 +28109,4 @@ Common commands:
|
|
|
28197
28109
|
//#endregion
|
|
28198
28110
|
export { CommanderError as a, shutdownCliTelemetry as i, captureCliException as n, initCliTelemetry as r, createProgram as t };
|
|
28199
28111
|
|
|
28200
|
-
//# sourceMappingURL=program-
|
|
28112
|
+
//# sourceMappingURL=program-Bl7GS_uC.js.map
|
package/build/program.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as createProgram } from "./program-
|
|
1
|
+
import { t as createProgram } from "./program-Bl7GS_uC.js";
|
|
2
2
|
export { createProgram };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@togglhq/cli",
|
|
3
|
-
"version": "1.11.
|
|
3
|
+
"version": "1.11.6",
|
|
4
4
|
"description": "Toggl CLI for Toggl 2.0 API operations.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@toggl/cli-core": "workspace:^",
|
|
58
58
|
"@toggl/operations": "workspace:^",
|
|
59
|
-
"@toggl/queries": "2.2.
|
|
59
|
+
"@toggl/queries": "2.2.21",
|
|
60
60
|
"@types/node": "22.19.11",
|
|
61
61
|
"tsdown": "0.21.8",
|
|
62
62
|
"typescript": "5.9.3",
|