@togglhq/cli 1.5.28 → 1.5.29

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/README.md CHANGED
@@ -78,7 +78,7 @@ toggl [global flags] <group> … <subcommand> [flags]
78
78
 
79
79
  Many endpoints use two segments (`toggl tasks list`). Some use nested groups, including:
80
80
 
81
- - **`toggl organization …`** — organization APIs (not `toggl org …`; there is no `org` top-level command). Examples: `toggl organization invitations list`, `toggl organization members get`, `toggl organization workspaces list`.
81
+ - **`toggl organization …`** — organization APIs (not `toggl org …`; there is no `org` top-level command). Examples: `toggl organization invitations list`, `toggl organization members get`, `toggl organization workspaces list`, `toggl organization workspaces get-timezone`, `toggl organization workspaces update-timezone`.
82
82
  - **`toggl shared …`** — shared workspace/org data routed through `@toggl/queries` helpers (status, holidays, working hours, time off). Example: `toggl shared status get`.
83
83
 
84
84
  Core resource groups still include `tasks`, `projects`, `time-blocks`, `time-entries`, `statuses`, `users`, `tags`, `clients`, and others surfaced by the public command catalog. Some low-level endpoints are omitted from the CLI and MCP. Existing public command paths and operation IDs stay stable; use `toggl --help` and `toggl <group> --help` to explore what shipped.
package/build/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { n as CommanderError, t as createProgram } from "./program-CwW_34U6.js";
2
+ import { n as CommanderError, t as createProgram } from "./program-0krLPqUR.js";
3
3
  //#region src/cli.ts
4
4
  try {
5
5
  await createProgram({ enableUpdateNotification: true }).parseAsync(process.argv);
package/build/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import { t as createProgram } from "./program-CwW_34U6.js";
1
+ import { t as createProgram } from "./program-0krLPqUR.js";
2
2
  export { createProgram };
@@ -7670,6 +7670,31 @@ function looseObject(entries$1, message$1) {
7670
7670
  };
7671
7671
  }
7672
7672
  /* @__NO_SIDE_EFFECTS__ */
7673
+ function nullable$1(wrapped, default_) {
7674
+ return {
7675
+ kind: "schema",
7676
+ type: "nullable",
7677
+ reference: nullable$1,
7678
+ expects: `(${wrapped.expects} | null)`,
7679
+ async: false,
7680
+ wrapped,
7681
+ default: default_,
7682
+ get "~standard"() {
7683
+ return /* @__PURE__ */ _getStandardProps$1(this);
7684
+ },
7685
+ "~run"(dataset, config$1) {
7686
+ if (dataset.value === null) {
7687
+ if (this.default !== void 0) dataset.value = /* @__PURE__ */ getDefault$1(this, dataset, config$1);
7688
+ if (dataset.value === null) {
7689
+ dataset.typed = true;
7690
+ return dataset;
7691
+ }
7692
+ }
7693
+ return this.wrapped["~run"](dataset, config$1);
7694
+ }
7695
+ };
7696
+ }
7697
+ /* @__NO_SIDE_EFFECTS__ */
7673
7698
  function number$2(message$1) {
7674
7699
  return {
7675
7700
  kind: "schema",
@@ -10592,6 +10617,15 @@ async function patchOrganizationUserActive(httpClient, organization_id, organiza
10592
10617
  async function getWorkspaces(httpClient, organization_id, signal) {
10593
10618
  return (await httpClient.get(`organizations/${organization_id}/workspaces`, { signal })).json();
10594
10619
  }
10620
+ async function getWorkspaceTimezone(httpClient, organization_id, workspace_id, signal) {
10621
+ return (await httpClient.get(`organizations/${organization_id}/workspaces/${workspace_id}/settings/timezone`, { signal })).json();
10622
+ }
10623
+ async function putWorkspaceTimezone(httpClient, organization_id, workspace_id, data, signal) {
10624
+ return (await httpClient.put(`organizations/${organization_id}/workspaces/${workspace_id}/settings/timezone`, {
10625
+ signal,
10626
+ json: data
10627
+ })).json();
10628
+ }
10595
10629
  async function getWorkspaceUserMeRoles(httpClient, organization_id, workspace_id, signal) {
10596
10630
  return (await httpClient.get(`organizations/${organization_id}/workspaces/${workspace_id}/users/me/roles`, { signal })).json();
10597
10631
  }
@@ -10702,7 +10736,7 @@ async function deleteMyWorkingHours(httpClient, organization_id, data, signal) {
10702
10736
  return response.json();
10703
10737
  }
10704
10738
  //#endregion
10705
- //#region ../cli-core/build/focus-client-7dpDsjfZ.js
10739
+ //#region ../cli-core/build/focus-client-BTk5v8IS.js
10706
10740
  const DATE_ONLY_RE = /^\d{4}-\d{2}-\d{2}$/;
10707
10741
  function normalizeDateFrom(value) {
10708
10742
  return DATE_ONLY_RE.test(value) ? `${value}T00:00:00Z` : value;
@@ -11500,6 +11534,20 @@ var FocusClient = class {
11500
11534
  data: response.data
11501
11535
  } : response;
11502
11536
  }
11537
+ async getOrgWorkspaceTimezone(workspaceId) {
11538
+ const response = await this.run("getOrgWorkspaceTimezone", () => getWorkspaceTimezone(this.orgHttp, this.organizationIdNum, workspaceId));
11539
+ return response.ok ? {
11540
+ ok: true,
11541
+ data: response.data
11542
+ } : response;
11543
+ }
11544
+ async updateOrgWorkspaceTimezone(workspaceId, payload) {
11545
+ const response = await this.run("updateOrgWorkspaceTimezone", () => putWorkspaceTimezone(this.orgHttp, this.organizationIdNum, workspaceId, payload));
11546
+ return response.ok ? {
11547
+ ok: true,
11548
+ data: response.data
11549
+ } : response;
11550
+ }
11503
11551
  async getSharedDataStatus() {
11504
11552
  const response = await this.run("getSharedDataStatus", () => getStatus(this.sharedDataHttp));
11505
11553
  return this.softValidateResponse("getSharedDataStatus", StatusOKSchema, response);
@@ -12390,7 +12438,7 @@ async function runSkillSetup(options) {
12390
12438
  });
12391
12439
  }
12392
12440
  //#endregion
12393
- //#region ../operations/build/safety-BSD7hS5Z.js
12441
+ //#region ../operations/build/safety-B7a8yXtb.js
12394
12442
  const optionalNumber = /* @__PURE__ */ optional$1(/* @__PURE__ */ number$2());
12395
12443
  const DATE_FIELD_RE = /^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:\d{2}))?$/;
12396
12444
  const dateField = (description) => /* @__PURE__ */ pipe$2(/* @__PURE__ */ string$1(), /* @__PURE__ */ regex(DATE_FIELD_RE, "must be YYYY-MM-DD or RFC3339 datetime (e.g. '2025-01-01' or '2025-01-01T00:00:00Z')"), /* @__PURE__ */ description$1(description));
@@ -13538,6 +13586,71 @@ const orgSharedOperations = [
13538
13586
  return client.getMyWorkspaceRoles(body.workspace_id ?? Number.parseInt(client.workspaceId, 10));
13539
13587
  }
13540
13588
  },
13589
+ {
13590
+ id: "org.workspaces.get-timezone",
13591
+ family: "org",
13592
+ resource: "workspaces",
13593
+ action: "get-timezone",
13594
+ title: "Get workspace timezone",
13595
+ description: "Get the workspace-level default timezone (null when unset). Requires organization admin.",
13596
+ agentGuidance: "Use when you need the org-wide default timezone for a workspace. When timezone is null, members use their personal timezones.",
13597
+ safety: "read",
13598
+ destructive: false,
13599
+ cli: {
13600
+ group: ["organization", "workspaces"],
13601
+ command: "get-timezone",
13602
+ examples: [{
13603
+ description: "Get timezone for the active workspace",
13604
+ data: {}
13605
+ }, {
13606
+ description: "Get timezone for a specific workspace",
13607
+ data: { workspace_id: 40770900 }
13608
+ }]
13609
+ },
13610
+ mcp: { entityTool: "org-workspaces" },
13611
+ inputSchema: /* @__PURE__ */ object$2({ workspace_id: /* @__PURE__ */ optional$1(/* @__PURE__ */ pipe$2(/* @__PURE__ */ number$2(), /* @__PURE__ */ description$1("Workspace ID (defaults to profile)"))) }),
13612
+ execute: (input, { client }) => {
13613
+ const body = input;
13614
+ return client.getOrgWorkspaceTimezone(body.workspace_id ?? client.workspaceIdNumber);
13615
+ }
13616
+ },
13617
+ {
13618
+ id: "org.workspaces.update-timezone",
13619
+ family: "org",
13620
+ resource: "workspaces",
13621
+ action: "update-timezone",
13622
+ title: "Update workspace timezone",
13623
+ description: "Set or clear the workspace-level default timezone. Requires organization admin.",
13624
+ agentGuidance: "Set timezone to an IANA name (e.g. Europe/London) or clear with clear: true / timezone: null so members fall back to personal timezones.",
13625
+ safety: "update",
13626
+ destructive: false,
13627
+ cli: {
13628
+ group: ["organization", "workspaces"],
13629
+ command: "update-timezone",
13630
+ examples: [{
13631
+ description: "Set default timezone for the active workspace",
13632
+ data: { timezone: "Europe/London" }
13633
+ }, {
13634
+ description: "Clear workspace default timezone",
13635
+ data: { clear: true }
13636
+ }]
13637
+ },
13638
+ mcp: { entityTool: "org-workspaces" },
13639
+ inputSchema: /* @__PURE__ */ object$2({
13640
+ workspace_id: /* @__PURE__ */ optional$1(/* @__PURE__ */ pipe$2(/* @__PURE__ */ number$2(), /* @__PURE__ */ description$1("Workspace ID (defaults to profile)"))),
13641
+ timezone: /* @__PURE__ */ optional$1(/* @__PURE__ */ nullable$1(/* @__PURE__ */ pipe$2(/* @__PURE__ */ string$1(), /* @__PURE__ */ description$1("IANA timezone (e.g. \"Europe/London\"), or null to clear")))),
13642
+ clear: /* @__PURE__ */ optional$1(/* @__PURE__ */ pipe$2(/* @__PURE__ */ boolean$1(), /* @__PURE__ */ description$1("Clear workspace default timezone")))
13643
+ }),
13644
+ execute: (input, { client }) => {
13645
+ const body = input;
13646
+ const workspaceId = body.workspace_id ?? client.workspaceIdNumber;
13647
+ const clearsTimezone = body.clear === true || body.timezone === null;
13648
+ if (clearsTimezone && typeof body.timezone === "string") throw new Error("Pass either a timezone string or clear/null, not both");
13649
+ if (clearsTimezone) return client.updateOrgWorkspaceTimezone(workspaceId, { timezone: null });
13650
+ if (body.timezone === void 0) throw new Error("Pass --timezone <IANA>, --clear true, or timezone: null to remove the default");
13651
+ return client.updateOrgWorkspaceTimezone(workspaceId, { timezone: body.timezone });
13652
+ }
13653
+ },
13541
13654
  {
13542
13655
  id: "shared.status.get",
13543
13656
  family: "shared",
@@ -25339,4 +25452,4 @@ Common commands:
25339
25452
  //#endregion
25340
25453
  export { CommanderError as n, createProgram as t };
25341
25454
 
25342
- //# sourceMappingURL=program-CwW_34U6.js.map
25455
+ //# sourceMappingURL=program-0krLPqUR.js.map
package/build/program.js CHANGED
@@ -1,2 +1,2 @@
1
- import { t as createProgram } from "./program-CwW_34U6.js";
1
+ import { t as createProgram } from "./program-0krLPqUR.js";
2
2
  export { createProgram };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@togglhq/cli",
3
- "version": "1.5.28",
3
+ "version": "1.5.29",
4
4
  "description": "Toggl CLI for Toggl 2.0 API operations.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -21,6 +21,9 @@ toggl --workspace-id 789012 tasks list --project-id 123456
21
21
  ```bash
22
22
  toggl organization invitations list
23
23
  toggl organization workspaces list
24
+ toggl organization workspaces get-timezone
25
+ toggl organization workspaces update-timezone --timezone Europe/London
26
+ toggl organization workspaces update-timezone --clear true
24
27
  toggl shared status get
25
28
  toggl shared holidays list
26
29
  ```