@company-semantics/contracts 13.1.0 → 13.2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@company-semantics/contracts",
3
- "version": "13.1.0",
3
+ "version": "13.2.1",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,3 +1,3 @@
1
1
  // AUTO-GENERATED — do not edit. Run pnpm generate:spec-hash to regenerate.
2
- export const SPEC_HASH = 'dd85c63b3fd6' as const;
3
- export const SPEC_HASH_FULL = 'dd85c63b3fd6d351429bf5f601815dea1e6b22e52f31f467c7d1df4616d0b03f' as const;
2
+ export const SPEC_HASH = '4dd221ddc8fd' as const;
3
+ export const SPEC_HASH_FULL = '4dd221ddc8fd1a1ff75153543db47c0e2c5a667d1f428e855026a035cdc3b3c6' as const;
@@ -4868,6 +4868,8 @@ export interface components {
4868
4868
  AclGrantRequest: {
4869
4869
  /** @enum {string} */
4870
4870
  access_level: "editor" | "commenter" | "viewer";
4871
+ note?: string;
4872
+ notify?: boolean;
4871
4873
  };
4872
4874
  VisibilityPatchRequest: {
4873
4875
  /** @enum {string} */
@@ -32,6 +32,18 @@ describe("EMAIL_KINDS golden snapshot", () => {
32
32
  plainTextRequired: true,
33
33
  htmlSupported: true,
34
34
  },
35
+ "org.ownership_transfer": {
36
+ kind: "org.ownership_transfer",
37
+ subject: "You've been invited to become a workspace owner",
38
+ plainTextRequired: true,
39
+ htmlSupported: false,
40
+ },
41
+ "org.ownership_transfer_completed": {
42
+ kind: "org.ownership_transfer_completed",
43
+ subject: "Workspace ownership has been transferred",
44
+ plainTextRequired: true,
45
+ htmlSupported: false,
46
+ },
35
47
  "security.alert": {
36
48
  kind: "security.alert",
37
49
  subject: "Security alert for your account",
@@ -44,6 +56,12 @@ describe("EMAIL_KINDS golden snapshot", () => {
44
56
  plainTextRequired: true,
45
57
  htmlSupported: true,
46
58
  },
59
+ "share.granted": {
60
+ kind: "share.granted",
61
+ subject: "Something has been shared with you",
62
+ plainTextRequired: true,
63
+ htmlSupported: true,
64
+ },
47
65
  });
48
66
  });
49
67
  });
@@ -82,6 +82,18 @@ export const EMAIL_KINDS = {
82
82
  plainTextRequired: true,
83
83
  htmlSupported: true,
84
84
  },
85
+ "org.ownership_transfer": {
86
+ kind: "org.ownership_transfer",
87
+ subject: "You've been invited to become a workspace owner",
88
+ plainTextRequired: true,
89
+ htmlSupported: false,
90
+ },
91
+ "org.ownership_transfer_completed": {
92
+ kind: "org.ownership_transfer_completed",
93
+ subject: "Workspace ownership has been transferred",
94
+ plainTextRequired: true,
95
+ htmlSupported: false,
96
+ },
85
97
  "security.alert": {
86
98
  kind: "security.alert",
87
99
  subject: "Security alert for your account",
@@ -94,6 +106,12 @@ export const EMAIL_KINDS = {
94
106
  plainTextRequired: true,
95
107
  htmlSupported: true,
96
108
  },
109
+ "share.granted": {
110
+ kind: "share.granted",
111
+ subject: "Something has been shared with you",
112
+ plainTextRequired: true,
113
+ htmlSupported: true,
114
+ },
97
115
  } as const satisfies Record<EmailKind, EmailKindDefinition>;
98
116
 
99
117
  // =============================================================================
@@ -28,8 +28,11 @@ export type EmailKind =
28
28
  | "auth.magic_link" // future
29
29
  | "org.invite" // future
30
30
  | "org.leadership_granted"
31
+ | "org.ownership_transfer"
32
+ | "org.ownership_transfer_completed"
31
33
  | "security.alert" // future
32
- | "chat.shared";
34
+ | "chat.shared"
35
+ | "share.granted";
33
36
 
34
37
  // =============================================================================
35
38
  // Email Payloads
@@ -73,6 +76,22 @@ export interface EmailPayloads {
73
76
  /** Optional message from the granter, shown in the email and recorded with the grant */
74
77
  message?: string;
75
78
  };
79
+ "org.ownership_transfer": {
80
+ /** Name of the organization being transferred (subject is static; org name renders in the body) */
81
+ orgName: string;
82
+ /** Full URL to accept the transfer (token-bearing) */
83
+ acceptUrl: string;
84
+ /** How long until the invitation expires */
85
+ expiresInDays: number;
86
+ /** Optional message from the current owner */
87
+ note?: string;
88
+ };
89
+ "org.ownership_transfer_completed": {
90
+ /** Name of the organization that was transferred */
91
+ orgName: string;
92
+ /** Email address of the new owner */
93
+ newOwnerEmail: string;
94
+ };
76
95
  "security.alert": {
77
96
  /** Type of security alert */
78
97
  alertType: "excessive_otp_requests" | "unusual_login_location";
@@ -93,6 +112,22 @@ export interface EmailPayloads {
93
112
  /** First ~200 chars of chat content for email preview. Generated server-side from snapshot. */
94
113
  previewText?: string;
95
114
  };
115
+ "share.granted": {
116
+ /** Display name of the person who shared */
117
+ granterName: string;
118
+ /** Display name of the recipient (optional; falls back to a neutral greeting) */
119
+ recipientName?: string;
120
+ /** Human-readable entity label, e.g. "document" | "work item" | "meeting" */
121
+ entityLabel: string;
122
+ /** Title of the shared entity (absent for entities without titles, e.g. meetings) */
123
+ entityTitle?: string;
124
+ /** Access level the recipient was granted */
125
+ accessLevel: "editor" | "commenter" | "viewer";
126
+ /** Full URL to view the shared entity in the app */
127
+ ctaUrl: string;
128
+ /** Optional message from the granter, included in the email only (not persisted) */
129
+ message?: string;
130
+ };
96
131
  }
97
132
 
98
133
  // =============================================================================
@@ -34,6 +34,18 @@ export type EntityVisibility = z.infer<typeof EntityVisibilitySchema>;
34
34
 
35
35
  export const AclGrantRequestSchema = z.object({
36
36
  access_level: GrantableAccessLevelSchema,
37
+ /**
38
+ * Optional message from the granter, included in the notify email only.
39
+ * Ephemeral notification-event metadata — never persisted on the grant.
40
+ * Bound matches the leadership note/reason fields (2000).
41
+ */
42
+ note: z.string().max(2000).optional(),
43
+ /**
44
+ * When true, email the grantee(s) about the new grant. Gates the email
45
+ * side-effect only; omitted is treated as false (no .default(), mirrors
46
+ * CreateDelegationRequestSchema).
47
+ */
48
+ notify: z.boolean().optional(),
37
49
  });
38
50
  export type AclGrantRequest = z.infer<typeof AclGrantRequestSchema>;
39
51