@thejob/schema 2.0.10 → 2.1.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.
package/dist/index.cjs CHANGED
@@ -2609,6 +2609,24 @@ var UserSchema = (0, import_yup35.object)({
2609
2609
  * Roles assigned to the user
2610
2610
  */
2611
2611
  roles: (0, import_yup35.array)().of((0, import_yup35.string)().oneOf(SupportedUserRoles)).required().default(DefaultUserRoles).label("Roles"),
2612
+ /**
2613
+ * Explicit consent to receive marketing email (newsletters, job alerts by
2614
+ * broadcast, product updates). Marketing sends are HARD-GATED on
2615
+ * `subscribed === true`: a user with no consent (existing users, anyone who
2616
+ * hasn't finished onboarding) is NOT a valid marketing recipient. Transactional
2617
+ * mail (verification, magic-link, account) is unaffected — it is not marketing.
2618
+ *
2619
+ * Captured at onboarding and flippable by the user; a one-click / footer
2620
+ * unsubscribe sets `subscribed=false` so consent and the email-service
2621
+ * suppression list stay consistent. Defaults to NOT subscribed (opt-in).
2622
+ */
2623
+ marketingConsent: (0, import_yup35.object)({
2624
+ subscribed: (0, import_yup35.boolean)().default(false).label("Subscribed to marketing email"),
2625
+ /** Epoch ms of the last consent change (opt-in or opt-out). */
2626
+ updatedAt: (0, import_yup35.number)().optional().label("Consent updated at"),
2627
+ /** Where the consent change originated, e.g. `onboarding`, `unsubscribe`, `settings`. */
2628
+ source: (0, import_yup35.string)().optional().label("Consent source")
2629
+ }).default({ subscribed: false }).label("Marketing Consent"),
2612
2630
  /**
2613
2631
  * Vector embedding of the user's profile for semantic/hybrid search.
2614
2632
  * Generated from a structured summary of skills, experience, education, etc.
package/dist/index.d.cts CHANGED
@@ -1768,6 +1768,11 @@ declare const UserSchema: yup.ObjectSchema<{
1768
1768
  }[];
1769
1769
  status: NonNullable<UserStatus | undefined>;
1770
1770
  roles: (UserRole | undefined)[];
1771
+ marketingConsent: {
1772
+ updatedAt?: number | undefined;
1773
+ source?: string | undefined;
1774
+ subscribed: boolean;
1775
+ };
1771
1776
  embedding: {
1772
1777
  vector?: number[] | undefined;
1773
1778
  model?: string | undefined;
@@ -1964,6 +1969,9 @@ declare const UserSchema: yup.ObjectSchema<{
1964
1969
  additionalInfo: never[];
1965
1970
  status: undefined;
1966
1971
  roles: UserRole[];
1972
+ marketingConsent: {
1973
+ subscribed: boolean;
1974
+ };
1967
1975
  embedding: {
1968
1976
  vector: undefined;
1969
1977
  model: undefined;
package/dist/index.d.ts CHANGED
@@ -1768,6 +1768,11 @@ declare const UserSchema: yup.ObjectSchema<{
1768
1768
  }[];
1769
1769
  status: NonNullable<UserStatus | undefined>;
1770
1770
  roles: (UserRole | undefined)[];
1771
+ marketingConsent: {
1772
+ updatedAt?: number | undefined;
1773
+ source?: string | undefined;
1774
+ subscribed: boolean;
1775
+ };
1771
1776
  embedding: {
1772
1777
  vector?: number[] | undefined;
1773
1778
  model?: string | undefined;
@@ -1964,6 +1969,9 @@ declare const UserSchema: yup.ObjectSchema<{
1964
1969
  additionalInfo: never[];
1965
1970
  status: undefined;
1966
1971
  roles: UserRole[];
1972
+ marketingConsent: {
1973
+ subscribed: boolean;
1974
+ };
1967
1975
  embedding: {
1968
1976
  vector: undefined;
1969
1977
  model: undefined;
package/dist/index.js CHANGED
@@ -2145,7 +2145,7 @@ var ReportSchema = object20({
2145
2145
  }).label("Report Schema");
2146
2146
 
2147
2147
  // src/user/user.schema.ts
2148
- import { array as array14, number as number10, object as object32, string as string30 } from "yup";
2148
+ import { array as array14, boolean as boolean15, number as number10, object as object32, string as string30 } from "yup";
2149
2149
 
2150
2150
  // src/user/work-experience.schema.ts
2151
2151
  import { boolean as boolean12, object as object21, string as string18 } from "yup";
@@ -2447,6 +2447,24 @@ var UserSchema = object32({
2447
2447
  * Roles assigned to the user
2448
2448
  */
2449
2449
  roles: array14().of(string30().oneOf(SupportedUserRoles)).required().default(DefaultUserRoles).label("Roles"),
2450
+ /**
2451
+ * Explicit consent to receive marketing email (newsletters, job alerts by
2452
+ * broadcast, product updates). Marketing sends are HARD-GATED on
2453
+ * `subscribed === true`: a user with no consent (existing users, anyone who
2454
+ * hasn't finished onboarding) is NOT a valid marketing recipient. Transactional
2455
+ * mail (verification, magic-link, account) is unaffected — it is not marketing.
2456
+ *
2457
+ * Captured at onboarding and flippable by the user; a one-click / footer
2458
+ * unsubscribe sets `subscribed=false` so consent and the email-service
2459
+ * suppression list stay consistent. Defaults to NOT subscribed (opt-in).
2460
+ */
2461
+ marketingConsent: object32({
2462
+ subscribed: boolean15().default(false).label("Subscribed to marketing email"),
2463
+ /** Epoch ms of the last consent change (opt-in or opt-out). */
2464
+ updatedAt: number10().optional().label("Consent updated at"),
2465
+ /** Where the consent change originated, e.g. `onboarding`, `unsubscribe`, `settings`. */
2466
+ source: string30().optional().label("Consent source")
2467
+ }).default({ subscribed: false }).label("Marketing Consent"),
2450
2468
  /**
2451
2469
  * Vector embedding of the user's profile for semantic/hybrid search.
2452
2470
  * Generated from a structured summary of skills, experience, education, etc.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thejob/schema",
3
- "version": "2.0.10",
3
+ "version": "2.1.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",
@@ -1,4 +1,4 @@
1
- import { array, number, object, string } from "yup";
1
+ import { array, boolean, number, object, string } from "yup";
2
2
 
3
3
  import {
4
4
  DefaultUserRoles,
@@ -110,6 +110,27 @@ export const UserSchema = object({
110
110
  .default(DefaultUserRoles)
111
111
  .label("Roles"),
112
112
 
113
+ /**
114
+ * Explicit consent to receive marketing email (newsletters, job alerts by
115
+ * broadcast, product updates). Marketing sends are HARD-GATED on
116
+ * `subscribed === true`: a user with no consent (existing users, anyone who
117
+ * hasn't finished onboarding) is NOT a valid marketing recipient. Transactional
118
+ * mail (verification, magic-link, account) is unaffected — it is not marketing.
119
+ *
120
+ * Captured at onboarding and flippable by the user; a one-click / footer
121
+ * unsubscribe sets `subscribed=false` so consent and the email-service
122
+ * suppression list stay consistent. Defaults to NOT subscribed (opt-in).
123
+ */
124
+ marketingConsent: object({
125
+ subscribed: boolean().default(false).label("Subscribed to marketing email"),
126
+ /** Epoch ms of the last consent change (opt-in or opt-out). */
127
+ updatedAt: number().optional().label("Consent updated at"),
128
+ /** Where the consent change originated, e.g. `onboarding`, `unsubscribe`, `settings`. */
129
+ source: string().optional().label("Consent source"),
130
+ })
131
+ .default({ subscribed: false })
132
+ .label("Marketing Consent"),
133
+
113
134
  /**
114
135
  * Vector embedding of the user's profile for semantic/hybrid search.
115
136
  * Generated from a structured summary of skills, experience, education, etc.