@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
@@ -2,6 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.safetyErrorSchema = exports.SAFETY_ERROR_CODES = exports.cancelPurchaseSchema = exports.confirmPurchaseSchema = exports.reservePurchaseSchema = exports.purchaseApprovalListSchema = exports.purchaseApprovalSummarySchema = exports.purchaseApprovalSchema = exports.purchaseEffectsSchema = exports.purchaseApprovalLineSchema = exports.supervisionContactsResponseSchema = exports.supervisionStateSchema = exports.supervisionContactSchema = exports.supervisionInvitationSchema = exports.supervisionSchema = exports.safetyRequesterSchema = exports.messagingSessionsResponseSchema = exports.messagingSessionsInputSchema = exports.messageAccessBatchResponseSchema = exports.deliveryAccessBatchInputSchema = exports.messageAccessBatchInputSchema = exports.deliveryAccessInputSchema = exports.contentAccessBatchResponseSchema = exports.contentAccessBatchInputSchema = exports.publicationPoliciesResponseSchema = exports.publicationPoliciesInputSchema = exports.publicationPolicySchema = exports.contentAccessInputSchema = exports.CONTENT_CLASSIFICATIONS = exports.contactAccessResponseSchema = exports.contactAccessInputSchema = exports.messageAccessInputSchema = exports.MESSAGE_ACCESS_MAX_INPUT_BYTES = exports.MESSAGE_ACCESS_MAX_PARTICIPANT_SLOTS = exports.MESSAGE_ACCESS_MAX_SUPERVISED_PARTICIPANTS = exports.MESSAGE_ACCESS_MAX_PARTICIPANTS = exports.MESSAGE_ACCESS_MAX_RESOURCES = exports.profileAccessBatchResponseSchema = exports.profileAccessBatchInputSchema = exports.safetyDecisionSchema = exports.SAFETY_DECISION_REASONS = exports.profileAccessDecisionSchema = exports.profileAccessInputSchema = exports.SUPERVISION_STATUSES = exports.SUPERVISION_INVITATION_STATUSES = exports.SUPERVISION_CONSENT_VERSION = exports.SUPERVISION_CHANGED_EVENT = exports.SUPERVISED_ACTIONS = exports.SAFETY_POLICY_VERSION = exports.PURCHASE_APPROVAL_STATUSES = void 0;
4
4
  exports.safetyOrganizationsResponseSchema = exports.safetyOrganizationsInputSchema = exports.safetyOrganizationIdentitySchema = exports.safetyPeopleResponseSchema = exports.safetyPeopleInputSchema = exports.safetyPersonSchema = exports.safetySessionValidationSchema = exports.safetySessionInputSchema = exports.purchaseReviewInputSchema = exports.supervisionReviewInputSchema = exports.supervisionContactInputSchema = exports.supervisionAcceptInputSchema = exports.supervisionInviteInputSchema = void 0;
5
+ const numberChecks_1 = require("./numberChecks");
6
+ const stringChecks_1 = require("./stringChecks");
5
7
  const zod_1 = require("zod");
6
8
  const accountSubject_1 = require("./accountSubject");
7
9
  // The Zod-free half of this contract lives in `./client/` (`@oxy.so/contracts/client`);
@@ -19,7 +21,7 @@ const signIn_1 = require("./signIn");
19
21
  const userResponse_1 = require("./userResponse");
20
22
  /** The requester is authenticated by the bearer; applications cannot submit viewer IDs. */
21
23
  exports.profileAccessInputSchema = zod_1.z
22
- .object({ subjectAccountId: zod_1.z.string().min(1).max(128) })
24
+ .object({ subjectAccountId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(128)) })
23
25
  .strict();
24
26
  exports.profileAccessDecisionSchema = zod_1.z
25
27
  .object({
@@ -41,8 +43,8 @@ exports.SAFETY_DECISION_REASONS = [
41
43
  'unrated_content',
42
44
  'approval_required',
43
45
  ];
44
- const accountId = zod_1.z.string().min(1).max(128);
45
- const resourceId = zod_1.z.string().trim().min(1).max(256);
46
+ const accountId = zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(128));
47
+ const resourceId = zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(256));
46
48
  const uniqueIds = (max, min = 1) => zod_1.z
47
49
  .array(accountId)
48
50
  .min(min)
@@ -177,7 +179,7 @@ exports.messagingSessionsInputSchema = zod_1.z
177
179
  .array(zod_1.z
178
180
  .object({
179
181
  requestId: resourceId,
180
- accessToken: zod_1.z.string().min(1).max(16384),
182
+ accessToken: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(16384)),
181
183
  })
182
184
  .strict())
183
185
  .min(1)
@@ -197,8 +199,20 @@ exports.messagingSessionsResponseSchema = zod_1.z
197
199
  })
198
200
  .strict();
199
201
  exports.safetyRequesterSchema = zod_1.z.union([
200
- zod_1.z.object({ accessToken: zod_1.z.string().min(1).max(16384).nullable() }).strict(),
201
- zod_1.z.object({ connectionToken: zod_1.z.string().min(1).max(16384) }).strict(),
202
+ zod_1.z
203
+ .object({
204
+ accessToken: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(16384)).nullable(),
205
+ })
206
+ .strict(),
207
+ zod_1.z
208
+ .object({ connectionToken: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(16384)) })
209
+ .strict(),
210
+ zod_1.z
211
+ .object({ capabilityTicket: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(16384)) })
212
+ .strict(),
213
+ zod_1.z
214
+ .object({ requesterContext: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(16384)) })
215
+ .strict(),
202
216
  ]);
203
217
  exports.supervisionSchema = zod_1.z
204
218
  .object({
@@ -207,7 +221,7 @@ exports.supervisionSchema = zod_1.z
207
221
  status: zod_1.z.enum(safety_1.SUPERVISION_STATUSES),
208
222
  policyVersion: zod_1.z.literal(safety_1.SAFETY_POLICY_VERSION),
209
223
  consentVersion: zod_1.z.literal(safety_1.SUPERVISION_CONSENT_VERSION),
210
- createdAt: zod_1.z.string().datetime(),
224
+ createdAt: zod_1.z.string().check((0, stringChecks_1.isoDateTime)()),
211
225
  })
212
226
  .strict();
213
227
  exports.supervisionInvitationSchema = zod_1.z
@@ -216,16 +230,16 @@ exports.supervisionInvitationSchema = zod_1.z
216
230
  childAccountId: accountId,
217
231
  guardianAccountId: accountId,
218
232
  status: zod_1.z.enum(safety_1.SUPERVISION_INVITATION_STATUSES),
219
- expiresAt: zod_1.z.string().datetime(),
233
+ expiresAt: zod_1.z.string().check((0, stringChecks_1.isoDateTime)()),
220
234
  consentVersion: zod_1.z.literal(safety_1.SUPERVISION_CONSENT_VERSION),
221
- createdAt: zod_1.z.string().datetime(),
235
+ createdAt: zod_1.z.string().check((0, stringChecks_1.isoDateTime)()),
222
236
  })
223
237
  .strict();
224
238
  exports.supervisionContactSchema = zod_1.z
225
239
  .object({
226
240
  childAccountId: accountId,
227
241
  contactAccountId: accountId,
228
- approvedAt: zod_1.z.string().datetime(),
242
+ approvedAt: zod_1.z.string().check((0, stringChecks_1.isoDateTime)()),
229
243
  })
230
244
  .strict();
231
245
  exports.supervisionStateSchema = zod_1.z
@@ -239,14 +253,14 @@ exports.supervisionContactsResponseSchema = zod_1.z
239
253
  .object({ items: zod_1.z.array(exports.supervisionContactSchema).max(1000) })
240
254
  .strict();
241
255
  const fingerprint = zod_1.z.string().regex(/^[a-f0-9]{64}$/);
242
- const minorUnits = zod_1.z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
256
+ const minorUnits = zod_1.z.number().check((0, numberChecks_1.integerCheck)()).nonnegative().max(Number.MAX_SAFE_INTEGER);
243
257
  exports.purchaseApprovalLineSchema = zod_1.z
244
258
  .object({
245
259
  itemReference: resourceId,
246
- title: zod_1.z.string().trim().min(1).max(300),
247
- optionsText: zod_1.z.string().trim().max(300),
260
+ title: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(300)),
261
+ optionsText: zod_1.z.string().trim().check((0, stringChecks_1.utf16MaxLength)(300)),
248
262
  merchantAccountId: accountId,
249
- quantity: zod_1.z.number().int().min(1).max(1000000),
263
+ quantity: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).min(1).max(1000000),
250
264
  unitAmountMinor: minorUnits,
251
265
  lineAmountMinor: minorUnits,
252
266
  })
@@ -256,7 +270,7 @@ const purchaseEffectsObject = zod_1.z
256
270
  operationId: resourceId,
257
271
  resourceId,
258
272
  cartFingerprint: fingerprint,
259
- summary: zod_1.z.string().trim().min(1).max(300),
273
+ summary: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(300)),
260
274
  merchantAccountIds: zod_1.z
261
275
  .array(accountId)
262
276
  .min(1)
@@ -269,13 +283,13 @@ const purchaseEffectsObject = zod_1.z
269
283
  discountMinor: minorUnits,
270
284
  roundingAdjustmentMinor: zod_1.z
271
285
  .number()
272
- .int()
286
+ .check((0, numberChecks_1.integerCheck)())
273
287
  .min(-Number.MAX_SAFE_INTEGER)
274
288
  .max(Number.MAX_SAFE_INTEGER),
275
289
  paymentFingerprint: fingerprint,
276
290
  amountMinor: minorUnits,
277
291
  currency: zod_1.z.string().regex(/^[A-Z]{3}$/),
278
- expiresAt: zod_1.z.string().datetime(),
292
+ expiresAt: zod_1.z.string().check((0, stringChecks_1.isoDateTime)()),
279
293
  })
280
294
  .strict();
281
295
  function validatePurchaseEvidence(value, ctx) {
@@ -318,8 +332,8 @@ const purchaseApprovalFields = {
318
332
  childAccountId: accountId,
319
333
  applicationId: accountId,
320
334
  status: zod_1.z.enum(safety_1.PURCHASE_APPROVAL_STATUSES),
321
- createdAt: zod_1.z.string().datetime(),
322
- receiptReference: zod_1.z.string().max(512).nullable(),
335
+ createdAt: zod_1.z.string().check((0, stringChecks_1.isoDateTime)()),
336
+ receiptReference: zod_1.z.string().check((0, stringChecks_1.utf16MaxLength)(512)).nullable(),
323
337
  };
324
338
  exports.purchaseApprovalSchema = purchaseEffectsObject
325
339
  .extend(purchaseApprovalFields)
@@ -343,7 +357,7 @@ exports.confirmPurchaseSchema = zod_1.z
343
357
  .object({
344
358
  approvalId: accountId,
345
359
  operationId: resourceId,
346
- receiptReference: zod_1.z.string().trim().min(1).max(512),
360
+ receiptReference: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(512)),
347
361
  })
348
362
  .strict();
349
363
  exports.cancelPurchaseSchema = exports.confirmPurchaseSchema.omit({ receiptReference: true });
@@ -380,7 +394,7 @@ exports.supervisionReviewInputSchema = zod_1.z
380
394
  childAccountId: accountId,
381
395
  action: zod_1.z.enum(['end', 'transfer']),
382
396
  guardianAccountId: accountId.optional(),
383
- evidenceReference: zod_1.z.string().trim().min(1).max(2048),
397
+ evidenceReference: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(2048)),
384
398
  reauth: signIn_1.reauthProofSchema,
385
399
  })
386
400
  .strict();
@@ -390,7 +404,7 @@ exports.purchaseReviewInputSchema = zod_1.z
390
404
  exports.safetySessionInputSchema = zod_1.z
391
405
  .object({
392
406
  sessionId: accountId,
393
- accessToken: zod_1.z.string().min(1).max(16384),
407
+ accessToken: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(16384)),
394
408
  action: zod_1.z.enum(safety_1.SUPERVISED_ACTIONS),
395
409
  })
396
410
  .strict();
@@ -398,8 +412,8 @@ exports.safetySessionValidationSchema = zod_1.z
398
412
  .object({
399
413
  valid: zod_1.z.literal(true),
400
414
  sessionId: accountId,
401
- expiresAt: zod_1.z.string().datetime(),
402
- lastActivity: zod_1.z.string().datetime(),
415
+ expiresAt: zod_1.z.string().check((0, stringChecks_1.isoDateTime)()),
416
+ lastActivity: zod_1.z.string().check((0, stringChecks_1.isoDateTime)()),
403
417
  user: userResponse_1.userResponseSchema,
404
418
  actor: accountSubject_1.accountActorChainSchema,
405
419
  })
@@ -409,7 +423,9 @@ exports.safetyPersonSchema = zod_1.z
409
423
  .object({ accountId, username: zod_1.z.string().nullable(), displayName: zod_1.z.string().nullable() })
410
424
  .strict();
411
425
  exports.safetyPeopleInputSchema = zod_1.z.union([
412
- zod_1.z.object({ query: zod_1.z.string().trim().min(2).max(100) }).strict(),
426
+ zod_1.z
427
+ .object({ query: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(2)).check((0, stringChecks_1.utf16MaxLength)(100)) })
428
+ .strict(),
413
429
  zod_1.z.object({ accountIds: uniqueIds(100) }).strict(),
414
430
  ]);
415
431
  exports.safetyPeopleResponseSchema = zod_1.z
@@ -427,8 +443,8 @@ exports.safetyOrganizationIdentitySchema = zod_1.z
427
443
  exports.safetyOrganizationsInputSchema = zod_1.z.union([
428
444
  zod_1.z
429
445
  .object({
430
- query: zod_1.z.string().trim().min(1).max(100),
431
- limit: zod_1.z.number().int().min(1).max(20).optional(),
446
+ query: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(100)),
447
+ limit: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).min(1).max(20).optional(),
432
448
  })
433
449
  .strict(),
434
450
  zod_1.z.object({ ids: uniqueIds(100) }).strict(),
@@ -1,10 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.serviceTokenOptionsSchema = exports.serviceTokenScopesSchema = void 0;
3
+ exports.resourceIntrospectionSchema = exports.resourcePrincipalSchema = exports.serviceIntrospectionSchema = exports.servicePrincipalSchema = exports.externalServicePrincipalSchema = exports.firstPartyServicePrincipalSchema = exports.serviceAuthoritySchema = exports.serviceTokenOptionsSchema = exports.serviceTokenScopesSchema = void 0;
4
+ const stringChecks_1 = require("./stringChecks");
4
5
  const zod_1 = require("zod");
5
6
  /** Omitted means the existing grant; an explicit set only narrows that authority. */
6
7
  exports.serviceTokenScopesSchema = zod_1.z
7
- .array(zod_1.z.string().trim().min(1).max(128))
8
+ .array(zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(128)))
8
9
  .min(1)
9
10
  .max(100)
10
11
  .refine((scopes) => new Set(scopes).size === scopes.length, 'Requested scopes must be unique')
@@ -12,3 +13,81 @@ exports.serviceTokenScopesSchema = zod_1.z
12
13
  exports.serviceTokenOptionsSchema = zod_1.z
13
14
  .object({ scopes: exports.serviceTokenScopesSchema.optional() })
14
15
  .strict();
16
+ /** First-party authority is issued only to an attested, live Oxy workload. */
17
+ exports.serviceAuthoritySchema = zod_1.z.enum(['first_party', 'external']);
18
+ const resourceIdentity = {
19
+ active: zod_1.z.literal(true),
20
+ accountId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)),
21
+ applicationId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)),
22
+ credentialId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)),
23
+ environment: zod_1.z.enum(['production', 'staging', 'development']),
24
+ audience: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)),
25
+ expiresAt: zod_1.z.string().check((0, stringChecks_1.isoDateTime)()),
26
+ };
27
+ /** No scope list exists in the internal authority variant. */
28
+ exports.firstPartyServicePrincipalSchema = zod_1.z.object({
29
+ ...resourceIdentity,
30
+ authority: zod_1.z.literal('first_party'),
31
+ scopes: zod_1.z.never().optional(),
32
+ });
33
+ exports.externalServicePrincipalSchema = zod_1.z.object({
34
+ ...resourceIdentity,
35
+ authority: zod_1.z.literal('external'),
36
+ scopes: zod_1.z.array(zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1))),
37
+ });
38
+ exports.servicePrincipalSchema = zod_1.z.discriminatedUnion('authority', [
39
+ exports.firstPartyServicePrincipalSchema,
40
+ exports.externalServicePrincipalSchema,
41
+ ]);
42
+ exports.serviceIntrospectionSchema = zod_1.z.union([
43
+ zod_1.z.object({ active: zod_1.z.literal(false) }),
44
+ exports.servicePrincipalSchema,
45
+ ]);
46
+ /** A resource receiver introspects services, external keys and human sessions distinctly. */
47
+ const sessionIdentity = {
48
+ active: zod_1.z.literal(true),
49
+ kind: zod_1.z.literal('session'),
50
+ permissions: zod_1.z.array(zod_1.z.string()),
51
+ accountId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)),
52
+ requesterAccountId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)),
53
+ effectiveAccountId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)),
54
+ expiresAt: zod_1.z.string().check((0, stringChecks_1.isoDateTime)()),
55
+ };
56
+ exports.resourcePrincipalSchema = zod_1.z.union([
57
+ exports.firstPartyServicePrincipalSchema.extend({
58
+ kind: zod_1.z.literal('service'),
59
+ permissions: zod_1.z.array(zod_1.z.string()),
60
+ }),
61
+ exports.externalServicePrincipalSchema.extend({
62
+ kind: zod_1.z.literal('service'),
63
+ permissions: zod_1.z.array(zod_1.z.string()),
64
+ }),
65
+ zod_1.z.object({
66
+ active: zod_1.z.literal(true),
67
+ kind: zod_1.z.literal('key'),
68
+ expiresAt: zod_1.z.string().check((0, stringChecks_1.isoDateTime)()).optional(),
69
+ permissions: zod_1.z.array(zod_1.z.string()),
70
+ authority: zod_1.z.literal('external'),
71
+ accountId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)),
72
+ applicationId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)),
73
+ credentialId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)),
74
+ environment: zod_1.z.enum(['production', 'staging', 'development']),
75
+ scopes: zod_1.z.array(zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1))),
76
+ }),
77
+ zod_1.z.object({
78
+ ...sessionIdentity,
79
+ authority: zod_1.z.literal('first_party'),
80
+ applicationId: zod_1.z.null(),
81
+ scopes: zod_1.z.never().optional(),
82
+ }),
83
+ zod_1.z.object({
84
+ ...sessionIdentity,
85
+ authority: zod_1.z.literal('external'),
86
+ applicationId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)),
87
+ scopes: zod_1.z.array(zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1))),
88
+ }),
89
+ ]);
90
+ exports.resourceIntrospectionSchema = zod_1.z.union([
91
+ zod_1.z.object({ active: zod_1.z.literal(false) }),
92
+ exports.resourcePrincipalSchema,
93
+ ]);
@@ -1,4 +1,8 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.oxyServiceEventsHeartbeatSchema = exports.oxySessionRevocationEventSchema = exports.OXY_SERVICE_EVENTS_FORBIDDEN = exports.OXY_SERVICE_EVENTS_STALE_AFTER_MS = exports.OXY_SERVICE_EVENTS_HEARTBEAT_MS = exports.OXY_SERVICE_EVENTS_HEARTBEAT_EVENT = exports.OXY_SESSION_REVOKED_EVENT = exports.OXY_SERVICE_EVENTS_NAMESPACE = void 0;
4
+ const numberChecks_1 = require("./numberChecks");
5
+ const stringChecks_1 = require("./stringChecks");
2
6
  /**
3
7
  * Canonical contract for the session-revocation feed: oxy-api telling every
4
8
  * connected Oxy backend that a session stopped being valid.
@@ -35,8 +39,6 @@
35
39
  *
36
40
  * Platform-agnostic — zod only, no react/react-native/expo.
37
41
  */
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.oxyServiceEventsHeartbeatSchema = exports.oxySessionRevocationEventSchema = exports.OXY_SERVICE_EVENTS_FORBIDDEN = exports.OXY_SERVICE_EVENTS_STALE_AFTER_MS = exports.OXY_SERVICE_EVENTS_HEARTBEAT_MS = exports.OXY_SERVICE_EVENTS_HEARTBEAT_EVENT = exports.OXY_SESSION_REVOKED_EVENT = exports.OXY_SERVICE_EVENTS_NAMESPACE = void 0;
40
42
  const zod_1 = require("zod");
41
43
  /** The Socket.IO namespace on oxy-api that carries service events. */
42
44
  exports.OXY_SERVICE_EVENTS_NAMESPACE = '/service-events';
@@ -77,13 +79,13 @@ exports.OXY_SERVICE_EVENTS_FORBIDDEN = 'service_events_forbidden';
77
79
  */
78
80
  exports.oxySessionRevocationEventSchema = zod_1.z.object({
79
81
  /** The session that ended; absent for a revocation of every session of `userId`. */
80
- sessionId: zod_1.z.string().min(1).max(256).optional(),
82
+ sessionId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(256)).optional(),
81
83
  /** The account the session (or sessions) spoke as. */
82
- userId: zod_1.z.string().min(1).max(256),
84
+ userId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(256)),
83
85
  /** Publisher's epoch-ms timestamp. Diagnostic only. */
84
- at: zod_1.z.number().int().nonnegative(),
86
+ at: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).nonnegative(),
85
87
  });
86
88
  /** The heartbeat payload. */
87
89
  exports.oxyServiceEventsHeartbeatSchema = zod_1.z.object({
88
- at: zod_1.z.number().int().nonnegative(),
90
+ at: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).nonnegative(),
89
91
  });
@@ -1,6 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.totpBackupCodesResponseSchema = exports.totpReauthRequestSchema = exports.totpConfirmRequestSchema = exports.totpEnrollResponseSchema = exports.signInMethodsSchema = exports.emailSetRequestSchema = exports.emailChangeStartRequestSchema = exports.signInMethodRemoveRequestSchema = exports.passwordSetRequestSchema = exports.reauthProofSchema = exports.reauthEmailStartRequestSchema = exports.emailSignInChooseRequestSchema = exports.emailSignInChooseAccountSchema = exports.emailSignInAccountOptionSchema = exports.emailSignInPendingSchema = exports.secondFactorRequiredSchema = exports.signUpRequestSchema = exports.secondFactorSignInRequestSchema = exports.passwordSignInRequestSchema = exports.emailSignInLinkResponseSchema = exports.emailSignInLinkRequestSchema = exports.emailSignInCollectRequestSchema = exports.emailSignInConfirmRequestSchema = exports.emailSignInCodeSchema = exports.emailSignInStartResponseSchema = exports.emailSignInStartRequestSchema = exports.secondFactorCodeSchema = exports.newPasswordSchema = exports.passwordInputSchema = exports.signInIdentifierSchema = exports.SIGN_IN_ERROR_CODES = exports.REAUTH_ACTIONS = exports.isEmailSignInChooseAccount = exports.isSecondFactorRequired = exports.EMAIL_ACCOUNTS_MAX = exports.EMAIL_SIGNIN_CHOICE_TTL_MS = exports.normalizeEmailSignInCode = exports.EMAIL_SIGNIN_LONG_CODE_LENGTH = exports.EMAIL_SIGNIN_LONG_CODE_ALPHABET = exports.TOTP_BACKUP_CODE_COUNT = exports.TOTP_PERIOD_SECONDS = exports.TOTP_DIGITS = exports.PASSWORD_MAX_LENGTH = exports.PASSWORD_MIN_LENGTH = exports.SIGNIN_SECOND_FACTOR_MAX_ATTEMPTS = exports.SIGNIN_SECOND_FACTOR_TTL_MS = exports.EMAIL_SIGNIN_LINK_TTL_MS = void 0;
4
+ const language_1 = require("./client/language");
5
+ const campaignAttribution_1 = require("./campaignAttribution");
6
+ const numberChecks_1 = require("./numberChecks");
7
+ const stringChecks_1 = require("./stringChecks");
4
8
  /**
5
9
  * Signing in: an email code or link, an optional password,
6
10
  * and an optional authenticator app (TOTP) as a second factor.
@@ -66,23 +70,39 @@ const sixDigits = zod_1.z
66
70
  */
67
71
  const opaqueTokenSchema = accountEmail_1.emailTicketSchema;
68
72
  /** A username or an email. */
69
- exports.signInIdentifierSchema = zod_1.z.string().trim().min(1).max(254);
73
+ exports.signInIdentifierSchema = zod_1.z
74
+ .string()
75
+ .trim()
76
+ .check((0, stringChecks_1.utf16MinLength)(1))
77
+ .check((0, stringChecks_1.utf16MaxLength)(254));
70
78
  /** A password as typed. Its policy applies only when one is set. */
71
- exports.passwordInputSchema = zod_1.z.string().min(1).max(signIn_1.PASSWORD_MAX_LENGTH);
79
+ exports.passwordInputSchema = zod_1.z
80
+ .string()
81
+ .check((0, stringChecks_1.utf16MinLength)(1))
82
+ .check((0, stringChecks_1.utf16MaxLength)(signIn_1.PASSWORD_MAX_LENGTH));
72
83
  /** A new password. */
73
84
  exports.newPasswordSchema = zod_1.z
74
85
  .string()
75
- .min(signIn_1.PASSWORD_MIN_LENGTH, `password must be at least ${signIn_1.PASSWORD_MIN_LENGTH} characters`)
76
- .max(signIn_1.PASSWORD_MAX_LENGTH, `password must be at most ${signIn_1.PASSWORD_MAX_LENGTH} characters`);
86
+ .check((0, stringChecks_1.utf16MinLength)(signIn_1.PASSWORD_MIN_LENGTH, `password must be at least ${signIn_1.PASSWORD_MIN_LENGTH} characters`))
87
+ .check((0, stringChecks_1.utf16MaxLength)(signIn_1.PASSWORD_MAX_LENGTH, `password must be at most ${signIn_1.PASSWORD_MAX_LENGTH} characters`));
77
88
  /**
78
89
  * An authenticator code (6 digits) or a backup code (10 characters, with or
79
90
  * without its dash). Normalised server-side.
80
91
  */
81
- exports.secondFactorCodeSchema = zod_1.z.string().trim().min(signIn_1.TOTP_DIGITS).max(16);
92
+ exports.secondFactorCodeSchema = zod_1.z
93
+ .string()
94
+ .trim()
95
+ .check((0, stringChecks_1.utf16MinLength)(signIn_1.TOTP_DIGITS))
96
+ .check((0, stringChecks_1.utf16MaxLength)(16));
82
97
  /** The device-session fields every body that ends in a session may carry. */
83
98
  const sessionEnvelope = {
84
- deviceName: zod_1.z.string().trim().min(1).max(120).optional(),
85
- deviceFingerprint: zod_1.z.string().trim().min(1).max(256).optional(),
99
+ deviceName: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(120)).optional(),
100
+ deviceFingerprint: zod_1.z
101
+ .string()
102
+ .trim()
103
+ .check((0, stringChecks_1.utf16MinLength)(1))
104
+ .check((0, stringChecks_1.utf16MaxLength)(256))
105
+ .optional(),
86
106
  /** Proof of the browser's shared device; invalid → the session gets its own. */
87
107
  device: deviceSession_1.deviceProofSchema.optional(),
88
108
  };
@@ -95,9 +115,9 @@ exports.emailSignInStartRequestSchema = zod_1.z
95
115
  })
96
116
  .strict();
97
117
  exports.emailSignInStartResponseSchema = zod_1.z.object({
98
- requestId: zod_1.z.string().min(1).max(64),
118
+ requestId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(64)),
99
119
  requestSecret: opaqueTokenSchema,
100
- expiresAt: zod_1.z.number().int().positive(),
120
+ expiresAt: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).positive(),
101
121
  retryLater: zod_1.z.literal(true).optional(),
102
122
  });
103
123
  /**
@@ -120,7 +140,7 @@ exports.emailSignInCodeSchema = zod_1.z
120
140
  /** `POST /auth/signin/email/confirm` — the code from the email. */
121
141
  exports.emailSignInConfirmRequestSchema = zod_1.z
122
142
  .object({
123
- requestId: zod_1.z.string().trim().min(1).max(64),
143
+ requestId: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(64)),
124
144
  requestSecret: opaqueTokenSchema,
125
145
  code: exports.emailSignInCodeSchema,
126
146
  ...sessionEnvelope,
@@ -129,7 +149,7 @@ exports.emailSignInConfirmRequestSchema = zod_1.z
129
149
  /** `POST /auth/signin/email/collect` — the dialog asks whether its link was opened. */
130
150
  exports.emailSignInCollectRequestSchema = zod_1.z
131
151
  .object({
132
- requestId: zod_1.z.string().trim().min(1).max(64),
152
+ requestId: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(64)),
133
153
  requestSecret: opaqueTokenSchema,
134
154
  ...sessionEnvelope,
135
155
  })
@@ -167,39 +187,45 @@ exports.secondFactorSignInRequestSchema = zod_1.z
167
187
  /** `POST /auth/signup` — the account, from a username and a confirmed email. */
168
188
  exports.signUpRequestSchema = zod_1.z
169
189
  .object({
170
- username: zod_1.z.string().trim().min(1).max(60),
190
+ username: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(60)),
171
191
  email: accountEmail_1.emailAddressSchema,
172
192
  /** The ticket `POST /auth/email/verify/confirm` (purpose `signup`) returned. */
173
193
  emailTicket: accountEmail_1.emailTicketSchema,
194
+ languages: zod_1.z
195
+ .array(zod_1.z.string().refine(language_1.isLanguageTag, 'Invalid language tag'))
196
+ .min(1)
197
+ .max(10)
198
+ .optional(),
199
+ campaignAttribution: campaignAttribution_1.campaignAttributionSchema.optional(),
174
200
  ...sessionEnvelope,
175
201
  })
176
202
  .strict();
177
203
  exports.secondFactorRequiredSchema = zod_1.z.object({
178
204
  secondFactorRequired: zod_1.z.literal(true),
179
205
  challengeId: opaqueTokenSchema,
180
- expiresAt: zod_1.z.number().int().positive(),
206
+ expiresAt: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).positive(),
181
207
  });
182
208
  exports.emailSignInPendingSchema = zod_1.z.object({
183
209
  status: zod_1.z.literal('pending'),
184
- expiresAt: zod_1.z.number().int().positive(),
210
+ expiresAt: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).positive(),
185
211
  });
186
212
  exports.emailSignInAccountOptionSchema = zod_1.z.object({
187
- id: zod_1.z.string().min(1).max(64),
188
- username: zod_1.z.string().min(1).optional(),
189
- displayName: zod_1.z.string().min(1).optional(),
190
- avatar: zod_1.z.string().min(1).optional(),
213
+ id: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(64)),
214
+ username: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).optional(),
215
+ displayName: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).optional(),
216
+ avatar: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).optional(),
191
217
  });
192
218
  exports.emailSignInChooseAccountSchema = zod_1.z.object({
193
219
  chooseAccount: zod_1.z.literal(true),
194
220
  accounts: zod_1.z.array(exports.emailSignInAccountOptionSchema).min(2).max(signIn_1.EMAIL_ACCOUNTS_MAX),
195
- expiresAt: zod_1.z.number().int().positive(),
221
+ expiresAt: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).positive(),
196
222
  });
197
223
  /** `POST /auth/signin/email/choose` — the account, from those {@link EmailSignInChooseAccount} listed. */
198
224
  exports.emailSignInChooseRequestSchema = zod_1.z
199
225
  .object({
200
- requestId: zod_1.z.string().trim().min(1).max(64),
226
+ requestId: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(64)),
201
227
  requestSecret: opaqueTokenSchema,
202
- userId: zod_1.z.string().trim().min(1).max(64),
228
+ userId: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(64)),
203
229
  ...sessionEnvelope,
204
230
  })
205
231
  .strict();
@@ -216,7 +242,7 @@ exports.reauthProofSchema = zod_1.z
216
242
  password: exports.passwordInputSchema.optional(),
217
243
  emailCode: zod_1.z
218
244
  .object({
219
- verificationId: zod_1.z.string().trim().min(1).max(64),
245
+ verificationId: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(64)),
220
246
  code: sixDigits,
221
247
  })
222
248
  .strict()
@@ -253,7 +279,7 @@ exports.emailChangeStartRequestSchema = zod_1.z.object({ email: accountEmail_1.e
253
279
  exports.emailSetRequestSchema = zod_1.z
254
280
  .object({
255
281
  email: accountEmail_1.emailAddressSchema,
256
- verificationId: zod_1.z.string().trim().min(1).max(64),
282
+ verificationId: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(64)),
257
283
  code: sixDigits,
258
284
  reauth: exports.reauthProofSchema,
259
285
  })
@@ -262,7 +288,7 @@ exports.signInMethodsSchema = zod_1.z.object({
262
288
  hasEmail: zod_1.z.boolean(),
263
289
  hasPassword: zod_1.z.boolean(),
264
290
  totpEnabled: zod_1.z.boolean(),
265
- backupCodesRemaining: zod_1.z.number().int().min(0),
291
+ backupCodesRemaining: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).min(0),
266
292
  });
267
293
  exports.totpEnrollResponseSchema = zod_1.z.object({
268
294
  secret: zod_1.z.string().regex(/^[A-Z2-7]+$/),
@@ -1,4 +1,8 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.updateStickerPackRequestSchema = exports.createStickerPackRequestSchema = exports.reorderStickerPacksRequestSchema = exports.resolveStickersResponseSchema = exports.resolveStickersRequestSchema = exports.stickerRefSchema = exports.installedStickerPackSchema = exports.stickerPackSchema = exports.stickerPackSummarySchema = exports.stickerSchema = exports.stickerFileSchema = exports.stickerPackStatusSchema = exports.stickerIdSchema = exports.stickerPackSlugSchema = exports.stickerSha256Schema = exports.STICKER_RESOLVE_MAX_IDS = exports.STICKER_MAX_INSTALLED_PACKS = exports.STICKER_PACK_MAX_STICKERS = exports.STICKER_MAX_FALLBACK_BYTES = exports.STICKER_MAX_ANIMATION_BYTES = exports.STICKER_MAX_UPLOAD_BYTES = exports.STICKER_MAX_FRAME_RATE = exports.STICKER_MAX_DURATION_MS = exports.STICKER_FALLBACK_SIZE = exports.STICKER_CANVAS_SIZES = void 0;
4
+ const numberChecks_1 = require("./numberChecks");
5
+ const stringChecks_1 = require("./stringChecks");
2
6
  /**
3
7
  * Stickers — the wire shape of Oxy's shared sticker catalogue.
4
8
  *
@@ -14,8 +18,6 @@
14
18
  *
15
19
  * Platform-agnostic — zod only. ESM-safe (no `require()`).
16
20
  */
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.updateStickerPackRequestSchema = exports.createStickerPackRequestSchema = exports.reorderStickerPacksRequestSchema = exports.resolveStickersResponseSchema = exports.resolveStickersRequestSchema = exports.stickerRefSchema = exports.installedStickerPackSchema = exports.stickerPackSchema = exports.stickerPackSummarySchema = exports.stickerSchema = exports.stickerFileSchema = exports.stickerPackStatusSchema = exports.stickerIdSchema = exports.stickerPackSlugSchema = exports.stickerSha256Schema = exports.STICKER_RESOLVE_MAX_IDS = exports.STICKER_MAX_INSTALLED_PACKS = exports.STICKER_PACK_MAX_STICKERS = exports.STICKER_MAX_FALLBACK_BYTES = exports.STICKER_MAX_ANIMATION_BYTES = exports.STICKER_MAX_UPLOAD_BYTES = exports.STICKER_MAX_FRAME_RATE = exports.STICKER_MAX_DURATION_MS = exports.STICKER_FALLBACK_SIZE = exports.STICKER_CANVAS_SIZES = void 0;
19
21
  const zod_1 = require("zod");
20
22
  /* -------------------------------------------------------------------------- */
21
23
  /* Limits */
@@ -62,17 +64,17 @@ exports.stickerSha256Schema = zod_1.z
62
64
  /** A pack's public URL segment. */
63
65
  exports.stickerPackSlugSchema = zod_1.z
64
66
  .string()
65
- .min(2)
66
- .max(64)
67
+ .check((0, stringChecks_1.utf16MinLength)(2))
68
+ .check((0, stringChecks_1.utf16MaxLength)(64))
67
69
  .regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/, 'slug must be lowercase words joined by hyphens');
68
- exports.stickerIdSchema = zod_1.z.string().min(1).max(64);
70
+ exports.stickerIdSchema = zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(64));
69
71
  exports.stickerPackStatusSchema = zod_1.z.enum(['draft', 'published', 'archived']);
70
72
  /** One stored file: where to fetch it and the hash its bytes must have. */
71
73
  exports.stickerFileSchema = zod_1.z.object({
72
- url: zod_1.z.string().url(),
74
+ url: zod_1.z.string().check((0, stringChecks_1.urlCheck)()),
73
75
  sha256: exports.stickerSha256Schema,
74
76
  mime: zod_1.z.string(),
75
- bytes: zod_1.z.number().int().nonnegative(),
77
+ bytes: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).nonnegative(),
76
78
  });
77
79
  /* -------------------------------------------------------------------------- */
78
80
  /* Catalogue */
@@ -82,8 +84,8 @@ exports.stickerSchema = zod_1.z.object({
82
84
  packId: zod_1.z.string(),
83
85
  emoji: zod_1.z.array(zod_1.z.string()).min(1),
84
86
  keywords: zod_1.z.array(zod_1.z.string()),
85
- size: zod_1.z.number().int().positive(),
86
- durationMs: zod_1.z.number().int().positive(),
87
+ size: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).positive(),
88
+ durationMs: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).positive(),
87
89
  /** The Lottie JSON. */
88
90
  animation: exports.stickerFileSchema,
89
91
  /** A static image of the same sticker. */
@@ -98,7 +100,7 @@ exports.stickerPackSummarySchema = zod_1.z.object({
98
100
  author: zod_1.z.string().nullable(),
99
101
  status: exports.stickerPackStatusSchema,
100
102
  publishedAt: zod_1.z.string().nullable(),
101
- stickerCount: zod_1.z.number().int().nonnegative(),
103
+ stickerCount: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).nonnegative(),
102
104
  /** The first sticker, drawn as the pack's cover. Null for an empty draft. */
103
105
  cover: exports.stickerSchema.nullable(),
104
106
  });
@@ -120,7 +122,7 @@ exports.installedStickerPackSchema = exports.stickerPackSchema.extend({
120
122
  */
121
123
  exports.stickerRefSchema = zod_1.z.object({
122
124
  stickerId: exports.stickerIdSchema,
123
- packId: zod_1.z.string().min(1).max(64),
125
+ packId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(64)),
124
126
  sha256: exports.stickerSha256Schema,
125
127
  });
126
128
  /* -------------------------------------------------------------------------- */
@@ -136,14 +138,16 @@ exports.resolveStickersResponseSchema = zod_1.z.object({
136
138
  });
137
139
  /** PATCH /stickers/me/packs/order — the installed pack ids, first to last. */
138
140
  exports.reorderStickerPacksRequestSchema = zod_1.z.object({
139
- packIds: zod_1.z.array(zod_1.z.string().min(1).max(64)).max(exports.STICKER_MAX_INSTALLED_PACKS),
141
+ packIds: zod_1.z
142
+ .array(zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(64)))
143
+ .max(exports.STICKER_MAX_INSTALLED_PACKS),
140
144
  });
141
145
  /** POST /stickers/admin/packs */
142
146
  exports.createStickerPackRequestSchema = zod_1.z.object({
143
147
  slug: exports.stickerPackSlugSchema,
144
- title: zod_1.z.string().trim().min(1).max(64),
145
- description: zod_1.z.string().trim().max(500).nullish(),
146
- author: zod_1.z.string().trim().max(64).nullish(),
148
+ title: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(64)),
149
+ description: zod_1.z.string().trim().check((0, stringChecks_1.utf16MaxLength)(500)).nullish(),
150
+ author: zod_1.z.string().trim().check((0, stringChecks_1.utf16MaxLength)(64)).nullish(),
147
151
  });
148
152
  /** PATCH /stickers/admin/packs/:packId */
149
153
  exports.updateStickerPackRequestSchema = exports.createStickerPackRequestSchema