@doist/automations-mcp 1.7.3 → 1.9.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.
@@ -7012,7 +7012,9 @@ var AUTOMATION_RUN_STATUSES = [
7012
7012
  // ../../packages/core/dist/esm/constants/usage-billing.constants.js
7013
7013
  var USAGE_BILLING_DENIAL_CODES = [
7014
7014
  "usage_billing_insufficient_credit",
7015
- "usage_billing_no_billing_account"
7015
+ "usage_billing_no_billing_account",
7016
+ "usage_billing_plan_required",
7017
+ "usage_billing_billing_paused"
7016
7018
  ];
7017
7019
  var USAGE_BILLING_TEMPORARILY_UNAVAILABLE_CODE = "usage_billing_temporarily_unavailable";
7018
7020
  var USAGE_BILLING_UNAVAILABLE_CODE = "usage_billing_unavailable";
@@ -7181,6 +7183,8 @@ var admitUsersResponseSchema = z.object({
7181
7183
  welcomeCredit: z.object({
7182
7184
  granted: z.number().int().nonnegative(),
7183
7185
  alreadyGranted: z.number().int().nonnegative(),
7186
+ /** Users with no Stripe customer yet, who will get the credit when they first top-up. */
7187
+ pending: z.number().int().nonnegative().default(0),
7184
7188
  /** Users who got no credit, with the reason to show the admin. */
7185
7189
  notGranted: z.array(z.object({ userId: z.string(), reason: z.string() }))
7186
7190
  })
@@ -7194,7 +7198,9 @@ import { z as z2 } from "zod";
7194
7198
  var UsageBillingProductSchema = z2.literal("automations");
7195
7199
  var USAGE_BILLING_BLOCK_REASONS = [
7196
7200
  "insufficient_credit",
7197
- "temporarily_unavailable"
7201
+ "temporarily_unavailable",
7202
+ "plan_required",
7203
+ "billing_paused"
7198
7204
  ];
7199
7205
  var USAGE_BILLING_AUTHORIZATION_DENIAL_REASONS = [
7200
7206
  ...USAGE_BILLING_BLOCK_REASONS,
@@ -7202,6 +7208,7 @@ var USAGE_BILLING_AUTHORIZATION_DENIAL_REASONS = [
7202
7208
  ];
7203
7209
  var UsageBillingAuthorizationDenialReasonSchema = z2.enum(USAGE_BILLING_AUTHORIZATION_DENIAL_REASONS);
7204
7210
  var UsageBillingBlockReasonSchema = z2.enum(USAGE_BILLING_BLOCK_REASONS);
7211
+ var UsageBillingReasonFromTodoistSchema = z2.string().min(1);
7205
7212
  var UsageBillingAccountSchema = z2.object({
7206
7213
  id: z2.string().regex(/^[1-9]\d*$/),
7207
7214
  type: z2.literal("user")
@@ -7226,7 +7233,7 @@ var AuthorizeUsageResponseSchema = z2.discriminatedUnion("decision", [
7226
7233
  }),
7227
7234
  z2.object({
7228
7235
  decision: z2.literal("denied"),
7229
- reason: UsageBillingAuthorizationDenialReasonSchema,
7236
+ reason: UsageBillingReasonFromTodoistSchema,
7230
7237
  available_units: UsageBillingBalanceSchema
7231
7238
  })
7232
7239
  ]);
@@ -7280,7 +7287,7 @@ var ReadStateResponseSchema = z2.object({
7280
7287
  settled_units: UsageBillingBalanceSchema.optional(),
7281
7288
  settled_amount: UsageBillingBalanceSchema.optional(),
7282
7289
  is_settled_low_balance: z2.boolean().optional(),
7283
- usage_block_reason: UsageBillingBlockReasonSchema.nullable().optional()
7290
+ usage_block_reason: UsageBillingReasonFromTodoistSchema.nullable().optional()
7284
7291
  });
7285
7292
  var UsageBillingAmountSchema = UsageBillingUnitsSchema.nullable();
7286
7293
  var UsageBillingEntrySchema = z2.object({
@@ -7338,10 +7345,25 @@ var GrantWelcomeCreditRequestSchema = z2.object({
7338
7345
  account: UsageBillingAccountSchema,
7339
7346
  operator: z2.email().max(254)
7340
7347
  });
7341
- var GrantWelcomeCreditResponseSchema = z2.object({
7342
- status: z2.enum(["granted", "already_granted"]),
7343
- grant_id: z2.string().min(1)
7344
- });
7348
+ var GRANTED_WELCOME_CREDIT_STATUSES = ["granted", "already_granted"];
7349
+ var PENDING_WELCOME_CREDIT_STATUS = "pending";
7350
+ var WELCOME_CREDIT_STATUSES = [
7351
+ ...GRANTED_WELCOME_CREDIT_STATUSES,
7352
+ PENDING_WELCOME_CREDIT_STATUS
7353
+ ];
7354
+ function isKnownWelcomeCreditStatus(status) {
7355
+ return WELCOME_CREDIT_STATUSES.includes(status);
7356
+ }
7357
+ var GrantWelcomeCreditResponseSchema = z2.union([
7358
+ z2.object({
7359
+ status: z2.enum(GRANTED_WELCOME_CREDIT_STATUSES),
7360
+ grant_id: z2.string().min(1)
7361
+ }),
7362
+ z2.object({ status: z2.literal(PENDING_WELCOME_CREDIT_STATUS) }),
7363
+ z2.object({
7364
+ status: z2.string().min(1).refine((status) => !isKnownWelcomeCreditStatus(status))
7365
+ })
7366
+ ]);
7345
7367
 
7346
7368
  // ../../packages/core/dist/esm/types/failure-category.types.js
7347
7369
  var FAILURE_CATEGORIES = [
@@ -11925,7 +11947,8 @@ var workspaceAutomationsEndpoints = {
11925
11947
  visibility: (workspaceId, id) => `${root8(workspaceId)}/${encodeURIComponent(id)}/visibility`,
11926
11948
  move: (workspaceId, id) => `${root8(workspaceId)}/${encodeURIComponent(id)}/move`,
11927
11949
  trigger: (workspaceId, id) => `${root8(workspaceId)}/${encodeURIComponent(id)}/trigger`,
11928
- draft: (workspaceId, id) => `${root8(workspaceId)}/${encodeURIComponent(id)}/draft`
11950
+ draft: (workspaceId, id) => `${root8(workspaceId)}/${encodeURIComponent(id)}/draft`,
11951
+ duplicate: (workspaceId, id) => `${root8(workspaceId)}/${encodeURIComponent(id)}/duplicate`
11929
11952
  };
11930
11953
  function root8(workspaceId) {
11931
11954
  return `/workspaces/${encodeURIComponent(workspaceId)}/automations`;
@@ -12038,6 +12061,15 @@ var WorkspaceAutomationsClient = class extends BaseClient {
12038
12061
  * Opens an edit draft seeded from the published manifest. Answers 409 when
12039
12062
  * one is already open; see `getOpenDraftConflictError`.
12040
12063
  */
12064
+ /** A draft copy of the automation, in the same workspace, for the caller to edit. */
12065
+ async duplicate(workspaceId, id, options) {
12066
+ const data = await this.request({
12067
+ method: "POST",
12068
+ path: workspaceAutomationsEndpoints.duplicate(IdSchema.parse(workspaceId), IdSchema.parse(id)),
12069
+ options
12070
+ });
12071
+ return automationDraftWithValidationSchema.parse(data);
12072
+ }
12041
12073
  async createDraft(workspaceId, id, options) {
12042
12074
  const data = await this.request({
12043
12075
  method: "POST",
@@ -13957,7 +13989,7 @@ import { McpServer } from "@modelcontextprotocol/server";
13957
13989
  // package.json
13958
13990
  var package_default = {
13959
13991
  name: "@doist/automations-mcp",
13960
- version: "1.7.3",
13992
+ version: "1.9.0",
13961
13993
  description: "MCP server and importable AI tools for Todoist Automations",
13962
13994
  type: "module",
13963
13995
  main: "./dist/index.js",
@@ -16568,4 +16600,4 @@ export {
16568
16600
  DEFAULT_BASE_URL,
16569
16601
  getMcpServer
16570
16602
  };
16571
- //# sourceMappingURL=chunk-K5HPLEAY.js.map
16603
+ //# sourceMappingURL=chunk-HTBWVWMF.js.map