@oxy.so/contracts 5.0.0 → 5.2.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.
@@ -402,11 +402,11 @@ export declare const emailSignInChooseRequestSchema: z.ZodObject<{
402
402
  export type EmailSignInChooseRequest = z.infer<typeof emailSignInChooseRequestSchema>;
403
403
  /** `POST /users/me/reauth/email` */
404
404
  export declare const reauthEmailStartRequestSchema: z.ZodObject<{
405
- action: z.ZodEnum<["change_password", "totp", "link_commons", "delete_account", "credentials_manage", "supervision", "supervision_purchase"]>;
405
+ action: z.ZodEnum<["change_password", "change_email", "totp", "link_commons", "delete_account", "credentials_manage", "supervision", "supervision_purchase"]>;
406
406
  }, "strict", z.ZodTypeAny, {
407
- action: "change_password" | "totp" | "link_commons" | "delete_account" | "credentials_manage" | "supervision" | "supervision_purchase";
407
+ action: "change_password" | "change_email" | "totp" | "link_commons" | "delete_account" | "credentials_manage" | "supervision" | "supervision_purchase";
408
408
  }, {
409
- action: "change_password" | "totp" | "link_commons" | "delete_account" | "credentials_manage" | "supervision" | "supervision_purchase";
409
+ action: "change_password" | "change_email" | "totp" | "link_commons" | "delete_account" | "credentials_manage" | "supervision" | "supervision_purchase";
410
410
  }>;
411
411
  export type ReauthEmailStartRequest = z.infer<typeof reauthEmailStartRequestSchema>;
412
412
  /**
@@ -459,33 +459,6 @@ export declare const reauthProofSchema: z.ZodEffects<z.ZodObject<{
459
459
  totpCode?: string | undefined;
460
460
  }>;
461
461
  export type ReauthProof = z.infer<typeof reauthProofSchema>;
462
- /** A proof by email code only (+ TOTP): deleting an account, linking Commons. */
463
- export declare const emailReauthProofSchema: z.ZodObject<{
464
- emailCode: z.ZodObject<{
465
- verificationId: z.ZodString;
466
- code: z.ZodString;
467
- }, "strict", z.ZodTypeAny, {
468
- code: string;
469
- verificationId: string;
470
- }, {
471
- code: string;
472
- verificationId: string;
473
- }>;
474
- totpCode: z.ZodOptional<z.ZodString>;
475
- }, "strict", z.ZodTypeAny, {
476
- emailCode: {
477
- code: string;
478
- verificationId: string;
479
- };
480
- totpCode?: string | undefined;
481
- }, {
482
- emailCode: {
483
- code: string;
484
- verificationId: string;
485
- };
486
- totpCode?: string | undefined;
487
- }>;
488
- export type EmailReauthProof = z.infer<typeof emailReauthProofSchema>;
489
462
  /** `PUT /users/me/password` — set or change the password. */
490
463
  export declare const passwordSetRequestSchema: z.ZodObject<{
491
464
  newPassword: z.ZodString;
@@ -558,6 +531,162 @@ export declare const passwordSetRequestSchema: z.ZodObject<{
558
531
  revokeOtherSessions?: boolean | undefined;
559
532
  }>;
560
533
  export type PasswordSetRequest = z.infer<typeof passwordSetRequestSchema>;
534
+ /**
535
+ * `DELETE /users/me/password` — only while the account has an email to sign
536
+ * in with; `DELETE /users/me/email` — only while it has a password, and
537
+ * confirmed with that password.
538
+ */
539
+ export declare const signInMethodRemoveRequestSchema: z.ZodObject<{
540
+ reauth: z.ZodEffects<z.ZodObject<{
541
+ password: z.ZodOptional<z.ZodString>;
542
+ emailCode: z.ZodOptional<z.ZodObject<{
543
+ verificationId: z.ZodString;
544
+ code: z.ZodString;
545
+ }, "strict", z.ZodTypeAny, {
546
+ code: string;
547
+ verificationId: string;
548
+ }, {
549
+ code: string;
550
+ verificationId: string;
551
+ }>>;
552
+ /** Required when the account has an authenticator: its code or a backup code. */
553
+ totpCode: z.ZodOptional<z.ZodString>;
554
+ }, "strict", z.ZodTypeAny, {
555
+ password?: string | undefined;
556
+ emailCode?: {
557
+ code: string;
558
+ verificationId: string;
559
+ } | undefined;
560
+ totpCode?: string | undefined;
561
+ }, {
562
+ password?: string | undefined;
563
+ emailCode?: {
564
+ code: string;
565
+ verificationId: string;
566
+ } | undefined;
567
+ totpCode?: string | undefined;
568
+ }>, {
569
+ password?: string | undefined;
570
+ emailCode?: {
571
+ code: string;
572
+ verificationId: string;
573
+ } | undefined;
574
+ totpCode?: string | undefined;
575
+ }, {
576
+ password?: string | undefined;
577
+ emailCode?: {
578
+ code: string;
579
+ verificationId: string;
580
+ } | undefined;
581
+ totpCode?: string | undefined;
582
+ }>;
583
+ }, "strict", z.ZodTypeAny, {
584
+ reauth: {
585
+ password?: string | undefined;
586
+ emailCode?: {
587
+ code: string;
588
+ verificationId: string;
589
+ } | undefined;
590
+ totpCode?: string | undefined;
591
+ };
592
+ }, {
593
+ reauth: {
594
+ password?: string | undefined;
595
+ emailCode?: {
596
+ code: string;
597
+ verificationId: string;
598
+ } | undefined;
599
+ totpCode?: string | undefined;
600
+ };
601
+ }>;
602
+ export type SignInMethodRemoveRequest = z.infer<typeof signInMethodRemoveRequestSchema>;
603
+ /** `POST /users/me/email/verify/start` — a code to the address the account moves to. */
604
+ export declare const emailChangeStartRequestSchema: z.ZodObject<{
605
+ email: z.ZodString;
606
+ }, "strict", z.ZodTypeAny, {
607
+ email: string;
608
+ }, {
609
+ email: string;
610
+ }>;
611
+ export type EmailChangeStartRequest = z.infer<typeof emailChangeStartRequestSchema>;
612
+ /**
613
+ * `PUT /users/me/email` — add or change the email: the NEW address and the
614
+ * code it got (`verificationId`, `code`), and the proof it is the person (the
615
+ * password, or a code to the current email; plus the authenticator's).
616
+ */
617
+ export declare const emailSetRequestSchema: z.ZodObject<{
618
+ email: z.ZodString;
619
+ verificationId: z.ZodString;
620
+ code: z.ZodString;
621
+ reauth: z.ZodEffects<z.ZodObject<{
622
+ password: z.ZodOptional<z.ZodString>;
623
+ emailCode: z.ZodOptional<z.ZodObject<{
624
+ verificationId: z.ZodString;
625
+ code: z.ZodString;
626
+ }, "strict", z.ZodTypeAny, {
627
+ code: string;
628
+ verificationId: string;
629
+ }, {
630
+ code: string;
631
+ verificationId: string;
632
+ }>>;
633
+ /** Required when the account has an authenticator: its code or a backup code. */
634
+ totpCode: z.ZodOptional<z.ZodString>;
635
+ }, "strict", z.ZodTypeAny, {
636
+ password?: string | undefined;
637
+ emailCode?: {
638
+ code: string;
639
+ verificationId: string;
640
+ } | undefined;
641
+ totpCode?: string | undefined;
642
+ }, {
643
+ password?: string | undefined;
644
+ emailCode?: {
645
+ code: string;
646
+ verificationId: string;
647
+ } | undefined;
648
+ totpCode?: string | undefined;
649
+ }>, {
650
+ password?: string | undefined;
651
+ emailCode?: {
652
+ code: string;
653
+ verificationId: string;
654
+ } | undefined;
655
+ totpCode?: string | undefined;
656
+ }, {
657
+ password?: string | undefined;
658
+ emailCode?: {
659
+ code: string;
660
+ verificationId: string;
661
+ } | undefined;
662
+ totpCode?: string | undefined;
663
+ }>;
664
+ }, "strict", z.ZodTypeAny, {
665
+ code: string;
666
+ email: string;
667
+ reauth: {
668
+ password?: string | undefined;
669
+ emailCode?: {
670
+ code: string;
671
+ verificationId: string;
672
+ } | undefined;
673
+ totpCode?: string | undefined;
674
+ };
675
+ verificationId: string;
676
+ }, {
677
+ code: string;
678
+ email: string;
679
+ reauth: {
680
+ password?: string | undefined;
681
+ emailCode?: {
682
+ code: string;
683
+ verificationId: string;
684
+ } | undefined;
685
+ totpCode?: string | undefined;
686
+ };
687
+ verificationId: string;
688
+ }>;
689
+ export type EmailSetRequest = z.infer<typeof emailSetRequestSchema>;
561
690
  /** `GET /users/me/sign-in-methods` */
562
691
  export interface SignInMethods {
563
692
  hasEmail: boolean;
@@ -1,5 +1,3 @@
1
- /** Canonical profile/theme preset identities accepted by Oxy writes. */
2
- export declare const USER_PROFILE_COLOR_PRESETS: readonly ["teal", "blue", "green", "amber", "red", "purple", "pink", "sky", "orange", "mint", "mono", "oxy"];
3
1
  /**
4
2
  * Canonical API user-response contracts.
5
3
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxy.so/contracts",
3
- "version": "5.0.0",
3
+ "version": "5.2.0",
4
4
  "description": "OxyHQ API contracts — single source of truth for request/response Zod schemas and inferred types, shared by the backend and the client SDKs",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -69,7 +69,7 @@
69
69
  "node": ">=18.0.0"
70
70
  },
71
71
  "scripts": {
72
- "build": "bun run build:cjs && bun run build:esm && bun run build:types",
72
+ "build": "bun run check:profile-colors && bun run build:cjs && bun run build:esm && bun run build:types",
73
73
  "build:cjs": "tsc -p tsconfig.cjs.json",
74
74
  "build:esm": "tsc -p tsconfig.esm.json && node scripts/fix-esm-imports.mjs",
75
75
  "build:types": "tsc -p tsconfig.types.json",
@@ -77,7 +77,9 @@
77
77
  "typescript": "tsc --noEmit",
78
78
  "test": "jest --passWithNoTests",
79
79
  "lint": "biome lint --error-on-warnings ./src",
80
- "prepublishOnly": "node ../../scripts/assert-bun-publish.mjs && bun run clean && bun run build"
80
+ "prepublishOnly": "node ../../scripts/assert-bun-publish.mjs && bun run clean && bun run build",
81
+ "generate:profile-colors": "node scripts/generate-profile-colors.mjs",
82
+ "check:profile-colors": "node scripts/generate-profile-colors.mjs --check"
81
83
  },
82
84
  "dependencies": {
83
85
  "zod": "^3.25.64"
@@ -85,6 +87,7 @@
85
87
  "devDependencies": {
86
88
  "@types/node": "^20.19.43",
87
89
  "jest": "^30.5.1",
88
- "typescript": "^5.9.2"
90
+ "typescript": "^5.9.2",
91
+ "@oxy.so/bloom": "12.0.0"
89
92
  }
90
93
  }