@oxy.so/contracts 5.8.0 → 6.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.
Files changed (231) hide show
  1. package/dist/cjs/accountAccess.js +6 -5
  2. package/dist/cjs/accountEmail.js +13 -5
  3. package/dist/cjs/accountGraph.js +10 -9
  4. package/dist/cjs/accountName.js +3 -2
  5. package/dist/cjs/agency.js +91 -34
  6. package/dist/cjs/agentKeys.js +21 -17
  7. package/dist/cjs/appAssertions.js +14 -13
  8. package/dist/cjs/applicationRoles.js +19 -12
  9. package/dist/cjs/campaignAttribution.js +28 -0
  10. package/dist/cjs/civic.js +10 -9
  11. package/dist/cjs/client/campaignAttribution.js +14 -0
  12. package/dist/cjs/client/check.js +61 -53
  13. package/dist/cjs/client/index.js +7 -1
  14. package/dist/cjs/client/language.js +7 -0
  15. package/dist/cjs/consoleOnboarding.js +9 -4
  16. package/dist/cjs/contentClaims.js +23 -14
  17. package/dist/cjs/deviceDirectory.js +11 -9
  18. package/dist/cjs/deviceSession.js +27 -25
  19. package/dist/cjs/email/messages.js +20 -18
  20. package/dist/cjs/emailAgentContext.js +11 -9
  21. package/dist/cjs/externalIdentity.js +15 -11
  22. package/dist/cjs/federationInstanceFetch.js +12 -7
  23. package/dist/cjs/identity.js +19 -17
  24. package/dist/cjs/identityLink.js +6 -4
  25. package/dist/cjs/identityProof.js +6 -4
  26. package/dist/cjs/inboxPush.js +5 -4
  27. package/dist/cjs/index.js +17 -6
  28. package/dist/cjs/inference/accountBilling.js +35 -33
  29. package/dist/cjs/inference/aliaModelRelease.js +9 -7
  30. package/dist/cjs/inference/attribution.js +14 -12
  31. package/dist/cjs/inference/catalogue.js +35 -29
  32. package/dist/cjs/inference/economics.js +24 -19
  33. package/dist/cjs/inference/embeddings.js +9 -7
  34. package/dist/cjs/inference/entitlement.js +17 -15
  35. package/dist/cjs/inference/errors.js +15 -8
  36. package/dist/cjs/inference/identifiers.js +33 -21
  37. package/dist/cjs/inference/inbox.js +37 -35
  38. package/dist/cjs/inference/modelDocumentation.js +16 -14
  39. package/dist/cjs/inference/money.js +5 -4
  40. package/dist/cjs/inference/priceVersion.js +10 -5
  41. package/dist/cjs/inference/providerConnection.js +21 -14
  42. package/dist/cjs/inference/realtime.js +88 -47
  43. package/dist/cjs/inference/request.js +27 -25
  44. package/dist/cjs/inference/routingPolicy.js +12 -10
  45. package/dist/cjs/inference/streamEvents.js +22 -16
  46. package/dist/cjs/inference/usage.js +32 -15
  47. package/dist/cjs/keyRecovery.js +8 -6
  48. package/dist/cjs/keyRotation.js +5 -4
  49. package/dist/cjs/linkedAccounts.js +22 -18
  50. package/dist/cjs/moderationReputation.js +29 -27
  51. package/dist/cjs/notifications.js +25 -9
  52. package/dist/cjs/numberChecks.js +45 -0
  53. package/dist/cjs/oauth.js +14 -12
  54. package/dist/cjs/organizations.js +23 -21
  55. package/dist/cjs/products/access.js +10 -8
  56. package/dist/cjs/products/billing.js +10 -8
  57. package/dist/cjs/products/checkout.js +22 -10
  58. package/dist/cjs/products/plans.js +15 -10
  59. package/dist/cjs/protocol.js +6 -5
  60. package/dist/cjs/recommendations.js +27 -19
  61. package/dist/cjs/reputation.js +15 -13
  62. package/dist/cjs/safety.js +43 -27
  63. package/dist/cjs/serviceToken.js +81 -2
  64. package/dist/cjs/sessionRevocation.js +8 -6
  65. package/dist/cjs/signIn.js +50 -24
  66. package/dist/cjs/stickers.js +19 -15
  67. package/dist/cjs/stringChecks.js +70 -0
  68. package/dist/cjs/transparency.js +14 -12
  69. package/dist/cjs/updates.js +24 -22
  70. package/dist/cjs/userInvalidation.js +7 -5
  71. package/dist/cjs/userResponse.js +8 -7
  72. package/dist/cjs/username.js +7 -6
  73. package/dist/esm/accountAccess.js +4 -3
  74. package/dist/esm/accountEmail.js +13 -5
  75. package/dist/esm/accountGraph.js +8 -7
  76. package/dist/esm/accountName.js +3 -2
  77. package/dist/esm/agency.js +90 -33
  78. package/dist/esm/agentKeys.js +21 -17
  79. package/dist/esm/appAssertions.js +11 -10
  80. package/dist/esm/applicationRoles.js +16 -9
  81. package/dist/esm/campaignAttribution.js +25 -0
  82. package/dist/esm/civic.js +8 -7
  83. package/dist/esm/client/campaignAttribution.js +10 -0
  84. package/dist/esm/client/check.js +61 -53
  85. package/dist/esm/client/index.js +2 -0
  86. package/dist/esm/client/language.js +4 -0
  87. package/dist/esm/consoleOnboarding.js +7 -2
  88. package/dist/esm/contentClaims.js +23 -14
  89. package/dist/esm/deviceDirectory.js +11 -9
  90. package/dist/esm/deviceSession.js +27 -25
  91. package/dist/esm/email/messages.js +18 -16
  92. package/dist/esm/emailAgentContext.js +11 -9
  93. package/dist/esm/externalIdentity.js +15 -11
  94. package/dist/esm/federationInstanceFetch.js +10 -5
  95. package/dist/esm/identity.js +17 -15
  96. package/dist/esm/identityLink.js +6 -4
  97. package/dist/esm/identityProof.js +6 -4
  98. package/dist/esm/inboxPush.js +3 -2
  99. package/dist/esm/index.js +5 -2
  100. package/dist/esm/inference/accountBilling.js +33 -31
  101. package/dist/esm/inference/aliaModelRelease.js +7 -5
  102. package/dist/esm/inference/attribution.js +14 -12
  103. package/dist/esm/inference/catalogue.js +33 -27
  104. package/dist/esm/inference/economics.js +22 -17
  105. package/dist/esm/inference/embeddings.js +9 -7
  106. package/dist/esm/inference/entitlement.js +15 -13
  107. package/dist/esm/inference/errors.js +13 -6
  108. package/dist/esm/inference/identifiers.js +31 -19
  109. package/dist/esm/inference/inbox.js +37 -35
  110. package/dist/esm/inference/modelDocumentation.js +14 -12
  111. package/dist/esm/inference/money.js +3 -2
  112. package/dist/esm/inference/priceVersion.js +8 -3
  113. package/dist/esm/inference/providerConnection.js +19 -12
  114. package/dist/esm/inference/realtime.js +85 -44
  115. package/dist/esm/inference/request.js +25 -23
  116. package/dist/esm/inference/routingPolicy.js +9 -7
  117. package/dist/esm/inference/streamEvents.js +20 -14
  118. package/dist/esm/inference/usage.js +30 -13
  119. package/dist/esm/keyRecovery.js +8 -6
  120. package/dist/esm/keyRotation.js +5 -4
  121. package/dist/esm/linkedAccounts.js +20 -16
  122. package/dist/esm/moderationReputation.js +27 -25
  123. package/dist/esm/notifications.js +23 -7
  124. package/dist/esm/numberChecks.js +41 -0
  125. package/dist/esm/oauth.js +14 -12
  126. package/dist/esm/organizations.js +23 -21
  127. package/dist/esm/products/access.js +10 -8
  128. package/dist/esm/products/billing.js +10 -8
  129. package/dist/esm/products/checkout.js +22 -10
  130. package/dist/esm/products/plans.js +15 -10
  131. package/dist/esm/protocol.js +4 -3
  132. package/dist/esm/recommendations.js +25 -17
  133. package/dist/esm/reputation.js +13 -11
  134. package/dist/esm/safety.js +43 -27
  135. package/dist/esm/serviceToken.js +80 -1
  136. package/dist/esm/sessionRevocation.js +6 -4
  137. package/dist/esm/signIn.js +50 -24
  138. package/dist/esm/stickers.js +17 -13
  139. package/dist/esm/stringChecks.js +63 -0
  140. package/dist/esm/transparency.js +14 -12
  141. package/dist/esm/updates.js +22 -20
  142. package/dist/esm/userInvalidation.js +4 -2
  143. package/dist/esm/userResponse.js +4 -3
  144. package/dist/esm/username.js +3 -2
  145. package/dist/types/accountAccess.d.ts +29 -70
  146. package/dist/types/accountEmail.d.ts +2 -14
  147. package/dist/types/accountGraph.d.ts +179 -171
  148. package/dist/types/accountName.d.ts +1 -1
  149. package/dist/types/accountSubject.d.ts +20 -93
  150. package/dist/types/agency.d.ts +528 -2924
  151. package/dist/types/agentKeys.d.ts +48 -421
  152. package/dist/types/appAssertions.d.ts +56 -210
  153. package/dist/types/applicationRoles.d.ts +30 -276
  154. package/dist/types/avatarCharacter.d.ts +1 -1
  155. package/dist/types/campaignAttribution.d.ts +10 -0
  156. package/dist/types/civic.d.ts +1 -13
  157. package/dist/types/client/agentKeys.d.ts +18 -18
  158. package/dist/types/client/appAssertions.d.ts +3 -3
  159. package/dist/types/client/campaignAttribution.d.ts +12 -0
  160. package/dist/types/client/check.d.ts +13 -13
  161. package/dist/types/client/deviceDirectory.d.ts +51 -51
  162. package/dist/types/client/deviceSession.d.ts +14 -14
  163. package/dist/types/client/index.d.ts +3 -0
  164. package/dist/types/client/language.d.ts +2 -0
  165. package/dist/types/client/organizations.d.ts +25 -25
  166. package/dist/types/client/products.d.ts +33 -33
  167. package/dist/types/client/recommendations.d.ts +2 -2
  168. package/dist/types/client/safety.d.ts +45 -45
  169. package/dist/types/client/sessionStatus.d.ts +4 -4
  170. package/dist/types/client/signIn.d.ts +1 -1
  171. package/dist/types/commonsSignIn.d.ts +4 -1
  172. package/dist/types/consoleOnboarding.d.ts +24 -44
  173. package/dist/types/contentClaims.d.ts +24 -180
  174. package/dist/types/deviceDirectory.d.ts +109 -1040
  175. package/dist/types/deviceSession.d.ts +36 -298
  176. package/dist/types/email/messages.d.ts +212 -1793
  177. package/dist/types/emailAgentContext.d.ts +10 -194
  178. package/dist/types/externalIdentity.d.ts +121 -615
  179. package/dist/types/federationInstanceFetch.d.ts +3 -32
  180. package/dist/types/identity.d.ts +15 -92
  181. package/dist/types/identityLink.d.ts +6 -84
  182. package/dist/types/identityProof.d.ts +5 -17
  183. package/dist/types/inboxPush.d.ts +1 -9
  184. package/dist/types/index.d.ts +7 -3
  185. package/dist/types/inference/accountBilling.d.ts +151 -488
  186. package/dist/types/inference/aliaModelRelease.d.ts +42 -439
  187. package/dist/types/inference/attribution.d.ts +75 -104
  188. package/dist/types/inference/catalogue.d.ts +417 -1599
  189. package/dist/types/inference/economics.d.ts +69 -276
  190. package/dist/types/inference/embeddings.d.ts +110 -406
  191. package/dist/types/inference/entitlement.d.ts +80 -335
  192. package/dist/types/inference/errors.d.ts +90 -102
  193. package/dist/types/inference/identifiers.d.ts +12 -4
  194. package/dist/types/inference/inbox.d.ts +105 -420
  195. package/dist/types/inference/modelDocumentation.d.ts +201 -1390
  196. package/dist/types/inference/money.d.ts +65 -32
  197. package/dist/types/inference/priceVersion.d.ts +53 -120
  198. package/dist/types/inference/providerConnection.d.ts +253 -710
  199. package/dist/types/inference/realtime.d.ts +954 -6825
  200. package/dist/types/inference/request.d.ts +300 -2572
  201. package/dist/types/inference/routingPolicy.d.ts +95 -503
  202. package/dist/types/inference/streamEvents.d.ts +253 -721
  203. package/dist/types/inference/usage.d.ts +317 -950
  204. package/dist/types/keyRecovery.d.ts +3 -51
  205. package/dist/types/keyRotation.d.ts +3 -38
  206. package/dist/types/linkedAccounts.d.ts +50 -236
  207. package/dist/types/moderationReputation.d.ts +81 -14
  208. package/dist/types/notifications.d.ts +19 -51
  209. package/dist/types/numberChecks.d.ts +9 -0
  210. package/dist/types/oauth.d.ts +101 -809
  211. package/dist/types/organizations.d.ts +268 -921
  212. package/dist/types/oxyRecordTypes.d.ts +11 -1
  213. package/dist/types/products/access.d.ts +125 -775
  214. package/dist/types/products/billing.d.ts +67 -503
  215. package/dist/types/products/checkout.d.ts +16 -69
  216. package/dist/types/products/plans.d.ts +33 -366
  217. package/dist/types/recommendations.d.ts +76 -389
  218. package/dist/types/reputation.d.ts +37 -5
  219. package/dist/types/safety.d.ts +408 -2048
  220. package/dist/types/serviceToken.d.ts +247 -7
  221. package/dist/types/sessionRevocation.d.ts +2 -17
  222. package/dist/types/sessionStatus.d.ts +27 -115
  223. package/dist/types/signIn.d.ts +62 -553
  224. package/dist/types/stickers.d.ts +67 -819
  225. package/dist/types/stringChecks.d.ts +16 -0
  226. package/dist/types/transparency.d.ts +14 -302
  227. package/dist/types/updates.d.ts +60 -316
  228. package/dist/types/userInvalidation.d.ts +4 -13
  229. package/dist/types/userResponse.d.ts +302 -2400
  230. package/dist/types/username.d.ts +3 -3
  231. package/package.json +6 -4
@@ -7,25 +7,25 @@
7
7
  * that bundles the SDK (~120 KB before compression, evaluated at startup). The
8
8
  * checks here give the client the same answers in plain TypeScript.
9
9
  *
10
- * Every check mirrors one Zod 3 schema in this package, and
10
+ * Every check mirrors one Zod 4 schema in this package, and
11
11
  * `__tests__/clientChecks.parity.test.ts` runs both over the same inputs and
12
12
  * requires the same verdict, the same output and the same failing path. The
13
- * rules follow Zod 3 exactly:
13
+ * rules follow Zod 4 exactly:
14
14
  *
15
15
  * string(...rules) a string; `trim`/`toLowerCase` rewrite it, the other
16
16
  * rules test it, in the order given
17
- * number(...rules) a number that is not NaN (Infinity passes, as in Zod)
17
+ * number(...rules) a finite number
18
18
  * literal(v) / oneOf `===` one value / one of a fixed set of strings
19
19
  * optional(c) `undefined` (or an absent key) passes; `null` does not
20
20
  * nullable(c) `null` passes and is kept
21
21
  * withDefault(c, v) `undefined` becomes `v`, which is then checked
22
- * array(c, ...rules) the size rules first, then every element in order
22
+ * array(c, ...rules) upper bounds before elements, lower bounds afterwards
23
23
  * object(shape) unknown keys are DROPPED (Zod's default "strip")
24
24
  * strictObject(shape) unknown keys FAIL (`.strict()`)
25
25
  * looseObject(shape) unknown keys are KEPT (`.passthrough()`)
26
26
  * refine(c, test) a further condition, run once `c` passes
27
27
  * transform(c, f) `f` rewrites the value once `c` passes
28
- * union / discriminatedUnion as Zod 3 reports them
28
+ * union / discriminatedUnion as Zod 4 reports them
29
29
  *
30
30
  * A failure carries the first issue Zod would report and whether Zod would have
31
31
  * stopped there (`fatal`: the type was wrong) or kept checking (`fatal: false`:
@@ -47,13 +47,15 @@ function describe(input) {
47
47
  if (Array.isArray(input))
48
48
  return 'array';
49
49
  if (typeof input === 'number' && Number.isNaN(input))
50
- return 'nan';
50
+ return 'NaN';
51
+ if (typeof input === 'number' && !Number.isFinite(input))
52
+ return String(input);
51
53
  return typeof input;
52
54
  }
53
55
  /** Zod's wording for a value of the wrong type. */
54
56
  function wrongType(path, expected, input) {
55
57
  const received = describe(input);
56
- const message = input === undefined ? 'Required' : `Expected ${expected}, received ${received}`;
58
+ const message = `Invalid input: expected ${expected}, received ${received === 'object' ? 'Object' : received}`;
57
59
  return fail(path, { code: 'invalid_type', message, expected, received }, true);
58
60
  }
59
61
  /** `'a' | 'b'` — how Zod lists allowed values. */
@@ -71,14 +73,14 @@ export function minLength(min, message) {
71
73
  return {
72
74
  test: (value) => value.length >= min,
73
75
  code: 'too_small',
74
- message: message ?? `String must contain at least ${min} character(s)`,
76
+ message: message ?? `Too small: expected string to have >=${min} characters`,
75
77
  };
76
78
  }
77
79
  export function maxLength(max, message) {
78
80
  return {
79
81
  test: (value) => value.length <= max,
80
82
  code: 'too_big',
81
- message: message ?? `String must contain at most ${max} character(s)`,
83
+ message: message ?? `Too big: expected string to have <=${max} characters`,
82
84
  };
83
85
  }
84
86
  export function pattern(regex, message) {
@@ -87,21 +89,21 @@ export function pattern(regex, message) {
87
89
  regex.lastIndex = 0;
88
90
  return regex.test(value);
89
91
  },
90
- code: 'invalid_string',
91
- message: message ?? 'Invalid',
92
+ code: 'invalid_format',
93
+ message: message ?? `Invalid string: must match pattern ${regex}`,
92
94
  };
93
95
  }
94
96
  export function startsWith(prefix) {
95
97
  return {
96
98
  test: (value) => value.startsWith(prefix),
97
- code: 'invalid_string',
98
- message: `Invalid input: must start with "${prefix}"`,
99
+ code: 'invalid_format',
100
+ message: `Invalid string: must start with "${prefix}"`,
99
101
  };
100
102
  }
101
- /** Zod 3's `.email()`. */
103
+ /** Zod 4's `.email()`. */
102
104
  const EMAIL = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9-]*\.)+[A-Z]{2,}$/i;
103
- export const email = pattern(EMAIL, 'Invalid email');
104
- /** Zod 3's `.url()`: anything `new URL()` accepts. */
105
+ export const email = pattern(EMAIL, 'Invalid email address');
106
+ /** The contract's URL check validates with `new URL()` and preserves the original value. */
105
107
  export const url = {
106
108
  test: (value) => {
107
109
  try {
@@ -112,13 +114,13 @@ export const url = {
112
114
  return false;
113
115
  }
114
116
  },
115
- code: 'invalid_string',
116
- message: 'Invalid url',
117
+ code: 'invalid_format',
118
+ message: 'Invalid URL',
117
119
  };
118
- /** Zod 3's `.datetime()`: ISO 8601 in UTC (`Z`), any sub-second precision, leap days checked. */
120
+ /** Zod 4's `.datetime()`: ISO 8601 in UTC (`Z`), any sub-second precision, leap days checked. */
119
121
  const DATETIME = new RegExp('^((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))' +
120
122
  'T([01]\\d|2[0-3]):[0-5]\\d(:[0-5]\\d(\\.\\d+)?)?(Z)$');
121
- export const datetime = pattern(DATETIME, 'Invalid datetime');
123
+ export const datetime = pattern(DATETIME, 'Invalid ISO datetime');
122
124
  export function string(...rules) {
123
125
  return (input, path) => {
124
126
  if (typeof input !== 'string')
@@ -128,41 +130,41 @@ export function string(...rules) {
128
130
  for (const rule of rules) {
129
131
  if ('rewrite' in rule)
130
132
  value = rule.rewrite(value);
131
- else if (firstFailure === null && !rule.test(value)) {
133
+ if ('test' in rule && firstFailure === null && !rule.test(value)) {
132
134
  firstFailure = { code: rule.code, message: rule.message };
133
135
  }
134
136
  }
135
137
  return firstFailure === null ? ok(value) : fail(path, firstFailure, false);
136
138
  };
137
139
  }
138
- /** Zod's `.int()` — reported, as Zod does, as an `invalid_type` that does not stop the parse. */
140
+ /** Integer validation, separate from the contract's optional safe bounds. */
139
141
  export const int = (value) => Number.isInteger(value)
140
142
  ? undefined
141
143
  : {
142
144
  code: 'invalid_type',
143
- message: 'Expected integer, received float',
144
- expected: 'integer',
145
- received: 'float',
145
+ message: 'Invalid input: expected int, received number',
146
+ expected: 'int',
147
+ received: 'number',
146
148
  };
147
149
  export function atLeast(min) {
148
150
  return (value) => value >= min
149
151
  ? undefined
150
- : { code: 'too_small', message: `Number must be greater than or equal to ${min}` };
152
+ : { code: 'too_small', message: `Too small: expected number to be >=${min}` };
151
153
  }
152
154
  export function atMost(max) {
153
155
  return (value) => value <= max
154
156
  ? undefined
155
- : { code: 'too_big', message: `Number must be less than or equal to ${max}` };
157
+ : { code: 'too_big', message: `Too big: expected number to be <=${max}` };
156
158
  }
157
159
  /** Zod's `.positive()`. */
158
- export const positive = (value) => value > 0 ? undefined : { code: 'too_small', message: 'Number must be greater than 0' };
160
+ export const positive = (value) => value > 0 ? undefined : { code: 'too_small', message: 'Too small: expected number to be >0' };
159
161
  /** Zod's `.nonnegative()` (and `.min(0)`). */
160
162
  export const nonnegative = atLeast(0);
161
- /** Zod's `.safe()`: both bounds, low first. */
163
+ /** The contract's explicit safe-number bounds. */
162
164
  export const safe = (value) => atLeast(Number.MIN_SAFE_INTEGER)(value) ?? atMost(Number.MAX_SAFE_INTEGER)(value);
163
165
  export function number(...rules) {
164
166
  return (input, path) => {
165
- if (typeof input !== 'number' || Number.isNaN(input))
167
+ if (typeof input !== 'number' || !Number.isFinite(input))
166
168
  return wrongType(path, 'number', input);
167
169
  for (const rule of rules) {
168
170
  const problem = rule(input);
@@ -177,20 +179,20 @@ export function literal(expected) {
177
179
  return (input, path) => input === expected
178
180
  ? ok(expected)
179
181
  : fail(path, {
180
- code: 'invalid_literal',
181
- message: `Invalid literal value, expected ${JSON.stringify(expected)}`,
182
+ code: 'invalid_value',
183
+ message: `Invalid input: expected ${JSON.stringify(expected)}`,
182
184
  }, true);
183
185
  }
184
186
  /** One of a fixed set of strings — Zod's `z.enum`. */
185
187
  export function oneOf(values) {
186
188
  return (input, path) => {
187
- if (typeof input !== 'string')
188
- return wrongType(path, listValues(values), input);
189
- return values.includes(input)
189
+ return typeof input === 'string' && values.includes(input)
190
190
  ? ok(input)
191
191
  : fail(path, {
192
- code: 'invalid_enum_value',
193
- message: `Invalid enum value. Expected ${listValues(values)}, received '${input}'`,
192
+ code: 'invalid_value',
193
+ message: values.length === 1
194
+ ? `Invalid input: expected ${JSON.stringify(values[0])}`
195
+ : `Invalid option: expected one of ${values.map((value) => JSON.stringify(value)).join('|')}`,
194
196
  }, true);
195
197
  };
196
198
  }
@@ -242,7 +244,7 @@ export function branded(inner) {
242
244
  return inner;
243
245
  }
244
246
  /**
245
- * The issues of a container, as Zod 3 orders them: the first one is reported,
247
+ * The issues of a container, as Zod 4 orders them: the first one is reported,
246
248
  * and the container is fatal when any part of it was.
247
249
  */
248
250
  class Failures {
@@ -262,22 +264,21 @@ export function minItems(min) {
262
264
  return {
263
265
  test: (length) => length >= min,
264
266
  code: 'too_small',
265
- message: `Array must contain at least ${min} element(s)`,
267
+ message: `Too small: expected array to have >=${min} items`,
266
268
  };
267
269
  }
268
270
  export function maxItems(max) {
269
271
  return {
270
272
  test: (length) => length <= max,
271
273
  code: 'too_big',
272
- message: `Array must contain at most ${max} element(s)`,
274
+ message: `Too big: expected array to have <=${max} items`,
273
275
  };
274
276
  }
275
277
  /** Zod's `.length(n)`: `too_big` or `too_small`, by which side it missed. */
276
278
  export function exactItems(count) {
277
- const message = `Array must contain exactly ${count} element(s)`;
278
279
  return [
279
- { test: (length) => length <= count, code: 'too_big', message },
280
- { test: (length) => length >= count, code: 'too_small', message },
280
+ { ...maxItems(count), message: `Too big: expected array to have exactly ${count} items` },
281
+ { ...minItems(count), message: `Too small: expected array to have exactly ${count} items` },
281
282
  ];
282
283
  }
283
284
  export function array(inner, ...rules) {
@@ -285,9 +286,12 @@ export function array(inner, ...rules) {
285
286
  return (input, path) => {
286
287
  if (!Array.isArray(input))
287
288
  return wrongType(path, 'array', input);
288
- // Zod reports the size before any element, then every element in order.
289
+ // Oversized collections abort before walking any element. Lower bounds
290
+ // are checked after elements, matching the patched Zod parser.
289
291
  const size = sizeRules.find((rule) => !rule.test(input.length));
290
- const failures = new Failures(size ? { path, code: size.code, message: size.message } : null);
292
+ if (size?.code === 'too_big')
293
+ return fail(path, { code: size.code, message: size.message }, true);
294
+ const failures = new Failures(null);
291
295
  const out = [];
292
296
  for (let index = 0; index < input.length; index++) {
293
297
  const checked = inner(input[index], [...path, index]);
@@ -296,6 +300,8 @@ export function array(inner, ...rules) {
296
300
  else
297
301
  failures.add(checked);
298
302
  }
303
+ if (size)
304
+ failures.add({ issue: { path, code: size.code, message: size.message }, fatal: false });
299
305
  return failures.result() ?? ok(out);
300
306
  };
301
307
  }
@@ -327,7 +333,7 @@ function objectWith(shape, unknownKeys) {
327
333
  }
328
334
  }
329
335
  if (unknownKeys === 'strict' && unknown.length > 0) {
330
- const message = `Unrecognized key(s) in object: ${listValues(unknown, ', ')}`;
336
+ const message = `Unrecognized key${unknown.length === 1 ? '' : 's'}: ${unknown.map((key) => JSON.stringify(key)).join(', ')}`;
331
337
  failures.add({ issue: { path, code: 'unrecognized_keys', message }, fatal: false });
332
338
  }
333
339
  }
@@ -349,7 +355,7 @@ export function looseObject(shape) {
349
355
  /** Any object, every value kept — Zod's `z.record(z.unknown())`. */
350
356
  export const unknownRecord = (input, path) => {
351
357
  if (!isRecord(input))
352
- return wrongType(path, 'object', input);
358
+ return wrongType(path, 'record', input);
353
359
  const out = {};
354
360
  for (const key in input)
355
361
  if (key !== '__proto__')
@@ -359,21 +365,23 @@ export const unknownRecord = (input, path) => {
359
365
  /* -------------------------------------------------------------------------- */
360
366
  /* Unions */
361
367
  /* -------------------------------------------------------------------------- */
362
- /** The first option that passes; else Zod 3's report (the first option that only failed a rule). */
368
+ /** The first passing option, or the sole non-aborted option's issue; otherwise a union issue. */
363
369
  export function union(...options) {
364
370
  return (input, path) => {
365
- let ruleFailure = null;
371
+ const ruleFailures = [];
366
372
  for (const option of options) {
367
373
  const checked = option(input, path);
368
374
  if (checked.ok)
369
375
  return checked;
370
376
  if (!checked.fatal)
371
- ruleFailure ?? (ruleFailure = checked);
377
+ ruleFailures.push(checked);
372
378
  }
373
- return ruleFailure ?? fail(path, { code: 'invalid_union', message: 'Invalid input' }, true);
379
+ return ruleFailures.length === 1
380
+ ? ruleFailures[0]
381
+ : fail(path, { code: 'invalid_union', message: 'Invalid input' }, true);
374
382
  };
375
383
  }
376
- /** Zod 3's `z.discriminatedUnion(key, options)`, with the options keyed by their tag. */
384
+ /** Zod 4's `z.discriminatedUnion(key, options)`, with the options keyed by their tag. */
377
385
  export function discriminatedUnion(key, options) {
378
386
  return (input, path) => {
379
387
  if (!isRecord(input))
@@ -384,7 +392,7 @@ export function discriminatedUnion(key, options) {
384
392
  : undefined;
385
393
  if (!option) {
386
394
  const message = `Invalid discriminator value. Expected ${listValues(Object.keys(options))}`;
387
- return fail([...path, key], { code: 'invalid_union_discriminator', message }, true);
395
+ return fail([...path, key], { code: 'invalid_union', message }, true);
388
396
  }
389
397
  return option(input, path);
390
398
  };
@@ -41,3 +41,5 @@ export { CLAIMANT_RELATIONSHIPS, CLOSED_CONTENT_CLAIM_STATES, CONTENT_CLAIM_COUN
41
41
  export { APP_ASSERTION_CHALLENGE_PURPOSES, APP_ASSERTION_ERROR_CODES, APP_ASSERTION_PLATFORMS, OXY_APP_ASSERTION_AUDIENCE, OXY_APP_ASSERTION_HEADER, OXY_APP_ASSERTION_TTL_SECONDS, OXY_APP_ASSERTION_TYPE, appAssertionChallengeResponseCheck, appAssertionResponseCheck, appAttestKeyResponseCheck, } from './appAssertions.js';
42
42
  export { USER_PROFILE_COLORS, USER_PROFILE_COLOR_PRESETS, FREE_USER_PROFILE_COLOR_PRESETS, } from '../profileColors.generated.js';
43
43
  export * from '../products/one.js';
44
+ export { CAMPAIGN_LABEL_MAX_LENGTH, CAMPAIGN_CLICK_ID_MAX_LENGTH, hasCampaignControlCharacters, } from './campaignAttribution.js';
45
+ export { isLanguageTag } from './language.js';
@@ -0,0 +1,4 @@
1
+ /** Bounded BCP-47-shaped input; the API resolves supported canonical locales. */
2
+ export function isLanguageTag(value) {
3
+ return value.length <= 64 && /^[a-z]{2,3}(?:-[a-z0-9]{2,8})*$/i.test(value);
4
+ }
@@ -1,3 +1,4 @@
1
+ import { utf16MaxLength, utf16MinLength } from './stringChecks.js';
1
2
  /**
2
3
  * Oxy Console first-run onboarding — the wire contract.
3
4
  *
@@ -28,7 +29,7 @@ export const consoleOnboardingStateSchema = z.object({
28
29
  });
29
30
  /** `POST /console/onboarding/terms`. */
30
31
  export const acceptConsoleTermsInputSchema = z.object({
31
- version: z.string().min(1).max(64),
32
+ version: z.string().check(utf16MinLength(1)).check(utf16MaxLength(64)),
32
33
  adultAcknowledged: z.literal(true),
33
34
  /** Understands the account may be suspended or terminated for violating the AUP/Terms. */
34
35
  aupAcknowledged: z.literal(true),
@@ -38,7 +39,11 @@ export const acceptConsoleTermsInputSchema = z.object({
38
39
  export const CONSOLE_USE_CASE_DESCRIPTION_MAX_LENGTH = 2000;
39
40
  export const saveConsoleUseCasesInputSchema = z.object({
40
41
  /** Optional free text; trimmed, and blank counts as absent. */
41
- description: z.string().trim().max(CONSOLE_USE_CASE_DESCRIPTION_MAX_LENGTH).optional(),
42
+ description: z
43
+ .string()
44
+ .trim()
45
+ .check(utf16MaxLength(CONSOLE_USE_CASE_DESCRIPTION_MAX_LENGTH))
46
+ .optional(),
42
47
  useCases: z
43
48
  .array(consoleUseCaseIdSchema)
44
49
  .max(CONSOLE_USE_CASES.length)
@@ -1,3 +1,4 @@
1
+ import { utf16MaxLength, utf16MinLength } from './stringChecks.js';
1
2
  /**
2
3
  * Content claims (ADR 0043 D10): the public "Report content / rights claim"
3
4
  * intake, `POST /content-claims`, and the staff review of a claim.
@@ -41,7 +42,11 @@ function isHttpsUrl(value) {
41
42
  return false;
42
43
  }
43
44
  }
44
- const httpsUrl = (message) => z.string().trim().max(CONTENT_CLAIM_LIMITS.maxUrlLength, message).refine(isHttpsUrl, message);
45
+ const httpsUrl = (message) => z
46
+ .string()
47
+ .trim()
48
+ .check(utf16MaxLength(CONTENT_CLAIM_LIMITS.maxUrlLength, message))
49
+ .refine(isHttpsUrl, message);
45
50
  /**
46
51
  * `POST /content-claims` — a claim, as the claimant sends it. Strict: an
47
52
  * unknown key is refused rather than dropped.
@@ -58,25 +63,25 @@ export const contentClaimSubmissionSchema = z
58
63
  description: z
59
64
  .string({ message: 'contentClaim.errors.descriptionShort' })
60
65
  .trim()
61
- .min(CONTENT_CLAIM_LIMITS.minDescription, 'contentClaim.errors.descriptionShort')
62
- .max(CONTENT_CLAIM_LIMITS.maxDescription, 'contentClaim.errors.descriptionLong'),
66
+ .check(utf16MinLength(CONTENT_CLAIM_LIMITS.minDescription, 'contentClaim.errors.descriptionShort'))
67
+ .check(utf16MaxLength(CONTENT_CLAIM_LIMITS.maxDescription, 'contentClaim.errors.descriptionLong')),
63
68
  originalWorkUrl: httpsUrl('contentClaim.errors.originalWorkUrl').optional(),
64
69
  claimant: z
65
70
  .object({
66
71
  name: z
67
72
  .string({ message: 'contentClaim.errors.name' })
68
73
  .trim()
69
- .min(1, 'contentClaim.errors.name')
70
- .max(CONTENT_CLAIM_LIMITS.maxName, 'contentClaim.errors.name'),
74
+ .check(utf16MinLength(1, 'contentClaim.errors.name'))
75
+ .check(utf16MaxLength(CONTENT_CLAIM_LIMITS.maxName, 'contentClaim.errors.name')),
71
76
  email: z
72
77
  .string({ message: 'contentClaim.errors.email' })
73
78
  .trim()
74
79
  .email('contentClaim.errors.email')
75
- .max(CONTENT_CLAIM_LIMITS.maxEmail, 'contentClaim.errors.email'),
80
+ .check(utf16MaxLength(CONTENT_CLAIM_LIMITS.maxEmail, 'contentClaim.errors.email')),
76
81
  organization: z
77
82
  .string({ message: 'contentClaim.errors.organization' })
78
83
  .trim()
79
- .max(CONTENT_CLAIM_LIMITS.maxOrganization, 'contentClaim.errors.organization')
84
+ .check(utf16MaxLength(CONTENT_CLAIM_LIMITS.maxOrganization, 'contentClaim.errors.organization'))
80
85
  .optional(),
81
86
  relationship: z.enum(CLAIMANT_RELATIONSHIPS, {
82
87
  message: 'contentClaim.errors.relationship',
@@ -86,18 +91,18 @@ export const contentClaimSubmissionSchema = z
86
91
  statements: z
87
92
  .object({
88
93
  goodFaith: z.literal(true, {
89
- errorMap: () => ({ message: 'contentClaim.errors.goodFaith' }),
94
+ error: () => ({ message: 'contentClaim.errors.goodFaith' }),
90
95
  }),
91
96
  accurate: z.literal(true, {
92
- errorMap: () => ({ message: 'contentClaim.errors.accurate' }),
97
+ error: () => ({ message: 'contentClaim.errors.accurate' }),
93
98
  }),
94
99
  }, { message: 'contentClaim.errors.goodFaith' })
95
100
  .strict(),
96
101
  signature: z
97
102
  .string({ message: 'contentClaim.errors.signature' })
98
103
  .trim()
99
- .min(1, 'contentClaim.errors.signature')
100
- .max(CONTENT_CLAIM_LIMITS.maxName, 'contentClaim.errors.signature'),
104
+ .check(utf16MinLength(1, 'contentClaim.errors.signature'))
105
+ .check(utf16MaxLength(CONTENT_CLAIM_LIMITS.maxName, 'contentClaim.errors.signature')),
101
106
  })
102
107
  .strict();
103
108
  // ---------------------------------------------------------------------------
@@ -149,8 +154,12 @@ export const CONTENT_CLAIM_COUNTER_NOTICE_VALIDATION_KEYS = [
149
154
  'contentClaim.counterNotice.errors.signature',
150
155
  ];
151
156
  const N = CONTENT_CLAIM_COUNTER_NOTICE_LIMITS;
152
- const boundedText = (min, max, message) => z.string({ message }).trim().min(min, message).max(max, message);
153
- const affirmed = (message) => z.literal(true, { errorMap: () => ({ message }) });
157
+ const boundedText = (min, max, message) => z
158
+ .string({ message })
159
+ .trim()
160
+ .check(utf16MinLength(min, message))
161
+ .check(utf16MaxLength(max, message));
162
+ const affirmed = (message) => z.literal(true, { error: () => ({ message }) });
154
163
  /**
155
164
  * `POST /content-claims/counter-notices` — the owner of content a claim took
156
165
  * down disputes it (17 U.S.C. § 512(g)(3)). Signed in: the API answers only
@@ -190,7 +199,7 @@ export const contentClaimCounterNoticeSchema = z
190
199
  .string({ message: 'contentClaim.counterNotice.errors.email' })
191
200
  .trim()
192
201
  .email('contentClaim.counterNotice.errors.email')
193
- .max(N.maxEmail, 'contentClaim.counterNotice.errors.email'),
202
+ .check(utf16MaxLength(N.maxEmail, 'contentClaim.counterNotice.errors.email')),
194
203
  }, { message: 'contentClaim.counterNotice.errors.name' })
195
204
  .strict(),
196
205
  material: z
@@ -1,3 +1,5 @@
1
+ import { integerCheck } from './numberChecks.js';
2
+ import { utf16MinLength } from './stringChecks.js';
1
3
  import { z } from 'zod';
2
4
  import { accountKindSchema } from './accountGraph.js';
3
5
  import { activeTokenSchema, deviceSessionStateSchema } from './deviceSession.js';
@@ -45,7 +47,7 @@ export const deviceContextRelationshipSchema = z.enum(['self', 'owner', 'member'
45
47
  * every installed app reads would widen the profile for no rendering gain.
46
48
  */
47
49
  export const deviceDirectoryProfileSchema = z.object({
48
- id: z.string().min(1),
50
+ id: z.string().check(utf16MinLength(1)),
49
51
  username: z.string(),
50
52
  name: userNameSchema.optional(),
51
53
  avatar: z.string().nullable().optional(),
@@ -87,8 +89,8 @@ export const deviceDirectoryProfileSchema = z.object({
87
89
  * recomputes, so it is spelled out here in full.)
88
90
  */
89
91
  export const deviceAccountContextSchema = z.object({
90
- id: z.string().min(1),
91
- accountId: z.string().min(1),
92
+ id: z.string().check(utf16MinLength(1)),
93
+ accountId: z.string().check(utf16MinLength(1)),
92
94
  kind: accountKindSchema,
93
95
  relationship: deviceContextRelationshipSchema,
94
96
  account: deviceDirectoryProfileSchema,
@@ -106,9 +108,9 @@ export const deviceAccountContextSchema = z.object({
106
108
  * an organization must never consume one.
107
109
  */
108
110
  export const devicePrincipalSchema = z.object({
109
- id: z.string().min(1),
110
- userId: z.string().min(1),
111
- authuser: z.number().int().nonnegative(),
111
+ id: z.string().check(utf16MinLength(1)),
112
+ userId: z.string().check(utf16MinLength(1)),
113
+ authuser: z.number().check(integerCheck()).nonnegative(),
112
114
  user: deviceDirectoryProfileSchema,
113
115
  contexts: z.array(deviceAccountContextSchema),
114
116
  });
@@ -121,8 +123,8 @@ export const devicePrincipalSchema = z.object({
121
123
  * away), not an error.
122
124
  */
123
125
  export const deviceDirectorySchema = z.object({
124
- deviceId: z.string().min(1),
125
- revision: z.number().int().nonnegative(),
126
+ deviceId: z.string().check(utf16MinLength(1)),
127
+ revision: z.number().check(integerCheck()).nonnegative(),
126
128
  activeContextId: z.string().nullable(),
127
129
  principals: z.array(devicePrincipalSchema),
128
130
  updatedAt: z.number(),
@@ -135,7 +137,7 @@ export const deviceDirectorySchema = z.object({
135
137
  * that ambiguity server-side would mean guessing inside an authorization path.
136
138
  */
137
139
  export const deviceActivateRequestSchema = z.object({
138
- contextId: z.string().min(1),
140
+ contextId: z.string().check(utf16MinLength(1)),
139
141
  });
140
142
  /**
141
143
  * Response of `POST /session/device/activate`.
@@ -1,16 +1,18 @@
1
+ import { integerCheck } from './numberChecks.js';
2
+ import { urlCheck, utf16MaxLength, utf16MinLength } from './stringChecks.js';
1
3
  import { z } from 'zod';
2
4
  export { SESSION_ACCOUNTS_CHANGED_EVENT } from './client/deviceSession.js';
3
5
  export const sessionAccountSchema = z.object({
4
6
  accountId: z.string(),
5
7
  sessionId: z.string(),
6
- authuser: z.number().int().nonnegative(),
8
+ authuser: z.number().check(integerCheck()).nonnegative(),
7
9
  operatedByUserId: z.string().optional(),
8
10
  });
9
11
  export const deviceSessionStateSchema = z.object({
10
12
  deviceId: z.string(),
11
13
  accounts: z.array(sessionAccountSchema),
12
14
  activeAccountId: z.string().nullable(),
13
- revision: z.number().int().nonnegative(),
15
+ revision: z.number().check(integerCheck()).nonnegative(),
14
16
  updatedAt: z.number(),
15
17
  });
16
18
  export const activeTokenSchema = z.object({
@@ -41,9 +43,9 @@ export const deviceSessionSyncSchema = z.object({
41
43
  * state every other app observes.
42
44
  */
43
45
  export const deviceTokenMintRequestSchema = z.object({
44
- deviceId: z.string().min(1),
45
- deviceSecret: z.string().min(1),
46
- accountId: z.string().min(1).optional(),
46
+ deviceId: z.string().check(utf16MinLength(1)),
47
+ deviceSecret: z.string().check(utf16MinLength(1)),
48
+ accountId: z.string().check(utf16MinLength(1)).optional(),
47
49
  });
48
50
  /**
49
51
  * Wire shape of a successful `POST /session/device/token`: the freshly-minted
@@ -82,7 +84,7 @@ export const sessionAccountsChangedReasonSchema = z.enum([
82
84
  */
83
85
  export const sessionAccountsChangedEventSchema = z.object({
84
86
  userId: z.string(),
85
- revision: z.number().int().nonnegative(),
87
+ revision: z.number().check(integerCheck()).nonnegative(),
86
88
  reason: sessionAccountsChangedReasonSchema,
87
89
  });
88
90
  /* -------------------------------------------------------------------------- */
@@ -111,9 +113,9 @@ export const sessionAccountsChangedEventSchema = z.object({
111
113
  * the API's serializers checked against it — the producer is the same server.
112
114
  */
113
115
  export const deviceBackgroundCredentialResponseSchema = z.object({
114
- deviceId: z.string().min(1),
115
- secret: z.string().min(1),
116
- accountId: z.string().min(1),
116
+ deviceId: z.string().check(utf16MinLength(1)),
117
+ secret: z.string().check(utf16MinLength(1)),
118
+ accountId: z.string().check(utf16MinLength(1)),
117
119
  expiresAt: z.string(),
118
120
  });
119
121
  /**
@@ -127,8 +129,8 @@ export const deviceBackgroundCredentialResponseSchema = z.object({
127
129
  * run.
128
130
  */
129
131
  export const deviceBackgroundTokenRequestSchema = z.object({
130
- deviceId: z.string().min(1),
131
- secret: z.string().min(1),
132
+ deviceId: z.string().check(utf16MinLength(1)),
133
+ secret: z.string().check(utf16MinLength(1)),
132
134
  });
133
135
  /**
134
136
  * Wire shape of a successful `POST /session/device/background-token`: the short
@@ -143,7 +145,7 @@ export const deviceBackgroundTokenRequestSchema = z.object({
143
145
  export const deviceBackgroundTokenResponseSchema = z.object({
144
146
  accessToken: z.string(),
145
147
  expiresAt: z.string(),
146
- accountId: z.string().min(1),
148
+ accountId: z.string().check(utf16MinLength(1)),
147
149
  });
148
150
  /* -------------------------------------------------------------------------- */
149
151
  /* The browser bridge — joining the browser's DeviceSession (ADR 0029 D2) */
@@ -157,8 +159,8 @@ export const deviceBackgroundTokenResponseSchema = z.object({
157
159
  * the account. An invalid proof on a sign-in is ignored, never an error.
158
160
  */
159
161
  export const deviceProofSchema = z.object({
160
- deviceId: z.string().min(1).max(128),
161
- deviceSecret: z.string().min(1).max(256),
162
+ deviceId: z.string().check(utf16MinLength(1)).check(utf16MaxLength(128)),
163
+ deviceSecret: z.string().check(utf16MinLength(1)).check(utf16MaxLength(256)),
162
164
  });
163
165
  /**
164
166
  * `POST /session/device/register` — auth.oxy.so only. No body. A new, empty
@@ -166,8 +168,8 @@ export const deviceProofSchema = z.object({
166
168
  * auth.oxy.so. The raw secret is returned exactly once.
167
169
  */
168
170
  export const deviceRegisterResponseSchema = z.object({
169
- deviceId: z.string().min(1),
170
- deviceSecret: z.string().min(1),
171
+ deviceId: z.string().check(utf16MinLength(1)),
172
+ deviceSecret: z.string().check(utf16MinLength(1)),
171
173
  });
172
174
  /** PKCE S256 challenge: base64url of a SHA-256 digest (43 characters). */
173
175
  const pkceS256ChallengeSchema = z.string().regex(/^[A-Za-z0-9_-]{43}$/);
@@ -179,15 +181,15 @@ const pkceS256ChallengeSchema = z.string().regex(/^[A-Za-z0-9_-]{43}$/);
179
181
  * minute.
180
182
  */
181
183
  export const deviceJoinCodeRequestSchema = deviceProofSchema.extend({
182
- clientId: z.string().min(1).max(256),
183
- redirectUri: z.string().url().max(2048),
184
+ clientId: z.string().check(utf16MinLength(1)).check(utf16MaxLength(256)),
185
+ redirectUri: z.string().check(urlCheck()).check(utf16MaxLength(2048)),
184
186
  codeChallenge: pkceS256ChallengeSchema,
185
187
  codeChallengeMethod: z.literal('S256'),
186
188
  });
187
189
  export const deviceJoinCodeResponseSchema = z.object({
188
- code: z.string().min(1),
190
+ code: z.string().check(utf16MinLength(1)),
189
191
  /** Seconds until the code expires. */
190
- expiresIn: z.number().int().positive(),
192
+ expiresIn: z.number().check(integerCheck()).positive(),
191
193
  });
192
194
  /**
193
195
  * `POST /session/device/join` — called by the app's own origin with the code the
@@ -196,13 +198,13 @@ export const deviceJoinCodeResponseSchema = z.object({
196
198
  * ordinary `POST /session/device/token`.
197
199
  */
198
200
  export const deviceJoinRequestSchema = z.object({
199
- code: z.string().min(1).max(256),
201
+ code: z.string().check(utf16MinLength(1)).check(utf16MaxLength(256)),
200
202
  codeVerifier: z
201
203
  .string()
202
- .min(43)
203
- .max(128)
204
+ .check(utf16MinLength(43))
205
+ .check(utf16MaxLength(128))
204
206
  .regex(/^[A-Za-z0-9._~-]+$/),
205
- clientId: z.string().min(1).max(256),
206
- redirectUri: z.string().url().max(2048),
207
+ clientId: z.string().check(utf16MinLength(1)).check(utf16MaxLength(256)),
208
+ redirectUri: z.string().check(urlCheck()).check(utf16MaxLength(2048)),
207
209
  });
208
210
  export const deviceJoinResponseSchema = deviceRegisterResponseSchema;