@doist/automations-mcp 1.8.0 → 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 = [
@@ -13967,7 +13989,7 @@ import { McpServer } from "@modelcontextprotocol/server";
13967
13989
  // package.json
13968
13990
  var package_default = {
13969
13991
  name: "@doist/automations-mcp",
13970
- version: "1.8.0",
13992
+ version: "1.9.0",
13971
13993
  description: "MCP server and importable AI tools for Todoist Automations",
13972
13994
  type: "module",
13973
13995
  main: "./dist/index.js",
@@ -16578,4 +16600,4 @@ export {
16578
16600
  DEFAULT_BASE_URL,
16579
16601
  getMcpServer
16580
16602
  };
16581
- //# sourceMappingURL=chunk-MDUGN2GS.js.map
16603
+ //# sourceMappingURL=chunk-HTBWVWMF.js.map