@todoist/automations-cli 2.3.0 → 2.3.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/index.js CHANGED
@@ -8553,7 +8553,7 @@ import { fileURLToPath } from "node:url";
8553
8553
  // package.json
8554
8554
  var package_default = {
8555
8555
  name: "@todoist/automations-cli",
8556
- version: "2.3.0",
8556
+ version: "2.3.1",
8557
8557
  description: "Command-line client for Todoist Automations",
8558
8558
  type: "module",
8559
8559
  bin: {
@@ -8598,7 +8598,7 @@ var package_default = {
8598
8598
  },
8599
8599
  dependencies: {
8600
8600
  "@napi-rs/keyring": "2.1.2",
8601
- "@todoist/cli-core": "2.0.0",
8601
+ "@todoist/cli-core": "2.0.1",
8602
8602
  ai: "7.0.163",
8603
8603
  commander: "15.0.0",
8604
8604
  oauth4webapi: "3.8.8",
@@ -32937,6 +32937,7 @@ var AutomationCreatedEventSchema = external_exports.object({
32937
32937
  // ../../packages/sdk/dist/core/dist/esm/schemas/webhook-events/automation-deleted.event.js
32938
32938
  var AutomationDeletedDataSchema = external_exports.object({
32939
32939
  automationId: external_exports.string(),
32940
+ name: external_exports.string().describe("The automation name at the time it was deleted"),
32940
32941
  deletedAt: external_exports.iso.datetime()
32941
32942
  });
32942
32943
  var AutomationDeletedEventSchema = external_exports.object({
@@ -32948,7 +32949,8 @@ var AutomationDeletedEventSchema = external_exports.object({
32948
32949
  // ../../packages/sdk/dist/core/dist/esm/schemas/webhook-events/automation-disabled.event.js
32949
32950
  var AutomationDisabledDataSchema = external_exports.object({
32950
32951
  automationId: external_exports.string(),
32951
- disabledAt: external_exports.iso.datetime()
32952
+ disabledAt: external_exports.iso.datetime(),
32953
+ disabledReason: external_exports.enum(AUTOMATION_DISABLED_REASONS).nullable().default(null).describe("Why the system stopped the automation. null means a person turned it off and can turn it back on.")
32952
32954
  });
32953
32955
  var AutomationDisabledEventSchema = external_exports.object({
32954
32956
  type: external_exports.literal("automation:disabled"),
@@ -37277,7 +37279,11 @@ function createAutomationsAuthProvider() {
37277
37279
  throw new Error("createAutomationsAuthProvider: validate() must be overridden");
37278
37280
  }
37279
37281
  }),
37280
- async validateToken({ token, handshake }) {
37282
+ async validateToken({
37283
+ token,
37284
+ handshake,
37285
+ scope
37286
+ }) {
37281
37287
  const environment = getEnvironment();
37282
37288
  const flags = handshake.flags ?? {};
37283
37289
  const readOnly = Boolean(handshake.readOnly);
@@ -37286,7 +37292,9 @@ function createAutomationsAuthProvider() {
37286
37292
  environment: environment.name,
37287
37293
  userId: user.id,
37288
37294
  email: user.email,
37289
- scope: resolveScopes({ readOnly, flags }).join(" ")
37295
+ // Todoist can grant less than was asked for: the user may choose
37296
+ // read-only access on the consent screen.
37297
+ scope: scope ?? resolveScopes({ readOnly, flags }).join(" ")
37290
37298
  });
37291
37299
  }
37292
37300
  };