@oxy.so/contracts 5.8.0 → 6.0.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 (219) 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/civic.js +10 -9
  10. package/dist/cjs/client/check.js +61 -53
  11. package/dist/cjs/consoleOnboarding.js +9 -4
  12. package/dist/cjs/contentClaims.js +23 -14
  13. package/dist/cjs/deviceDirectory.js +11 -9
  14. package/dist/cjs/deviceSession.js +27 -25
  15. package/dist/cjs/email/messages.js +20 -18
  16. package/dist/cjs/emailAgentContext.js +11 -9
  17. package/dist/cjs/externalIdentity.js +15 -11
  18. package/dist/cjs/federationInstanceFetch.js +12 -7
  19. package/dist/cjs/identity.js +19 -17
  20. package/dist/cjs/identityLink.js +6 -4
  21. package/dist/cjs/identityProof.js +6 -4
  22. package/dist/cjs/inboxPush.js +5 -4
  23. package/dist/cjs/index.js +15 -6
  24. package/dist/cjs/inference/accountBilling.js +35 -33
  25. package/dist/cjs/inference/aliaModelRelease.js +9 -7
  26. package/dist/cjs/inference/attribution.js +14 -12
  27. package/dist/cjs/inference/catalogue.js +35 -29
  28. package/dist/cjs/inference/economics.js +24 -19
  29. package/dist/cjs/inference/embeddings.js +9 -7
  30. package/dist/cjs/inference/entitlement.js +17 -15
  31. package/dist/cjs/inference/errors.js +15 -8
  32. package/dist/cjs/inference/identifiers.js +33 -21
  33. package/dist/cjs/inference/inbox.js +37 -35
  34. package/dist/cjs/inference/modelDocumentation.js +16 -14
  35. package/dist/cjs/inference/money.js +5 -4
  36. package/dist/cjs/inference/priceVersion.js +10 -5
  37. package/dist/cjs/inference/providerConnection.js +21 -14
  38. package/dist/cjs/inference/realtime.js +88 -47
  39. package/dist/cjs/inference/request.js +27 -25
  40. package/dist/cjs/inference/routingPolicy.js +12 -10
  41. package/dist/cjs/inference/streamEvents.js +22 -16
  42. package/dist/cjs/inference/usage.js +32 -15
  43. package/dist/cjs/keyRecovery.js +8 -6
  44. package/dist/cjs/keyRotation.js +5 -4
  45. package/dist/cjs/linkedAccounts.js +22 -18
  46. package/dist/cjs/moderationReputation.js +29 -27
  47. package/dist/cjs/notifications.js +25 -9
  48. package/dist/cjs/numberChecks.js +45 -0
  49. package/dist/cjs/oauth.js +14 -12
  50. package/dist/cjs/organizations.js +23 -21
  51. package/dist/cjs/products/access.js +10 -8
  52. package/dist/cjs/products/billing.js +10 -8
  53. package/dist/cjs/products/checkout.js +22 -10
  54. package/dist/cjs/products/plans.js +15 -10
  55. package/dist/cjs/protocol.js +6 -5
  56. package/dist/cjs/recommendations.js +27 -19
  57. package/dist/cjs/reputation.js +15 -13
  58. package/dist/cjs/safety.js +43 -27
  59. package/dist/cjs/serviceToken.js +81 -2
  60. package/dist/cjs/sessionRevocation.js +8 -6
  61. package/dist/cjs/signIn.js +42 -24
  62. package/dist/cjs/stickers.js +19 -15
  63. package/dist/cjs/stringChecks.js +70 -0
  64. package/dist/cjs/transparency.js +14 -12
  65. package/dist/cjs/updates.js +24 -22
  66. package/dist/cjs/userInvalidation.js +7 -5
  67. package/dist/cjs/userResponse.js +8 -7
  68. package/dist/cjs/username.js +7 -6
  69. package/dist/esm/accountAccess.js +4 -3
  70. package/dist/esm/accountEmail.js +13 -5
  71. package/dist/esm/accountGraph.js +8 -7
  72. package/dist/esm/accountName.js +3 -2
  73. package/dist/esm/agency.js +90 -33
  74. package/dist/esm/agentKeys.js +21 -17
  75. package/dist/esm/appAssertions.js +11 -10
  76. package/dist/esm/applicationRoles.js +16 -9
  77. package/dist/esm/civic.js +8 -7
  78. package/dist/esm/client/check.js +61 -53
  79. package/dist/esm/consoleOnboarding.js +7 -2
  80. package/dist/esm/contentClaims.js +23 -14
  81. package/dist/esm/deviceDirectory.js +11 -9
  82. package/dist/esm/deviceSession.js +27 -25
  83. package/dist/esm/email/messages.js +18 -16
  84. package/dist/esm/emailAgentContext.js +11 -9
  85. package/dist/esm/externalIdentity.js +15 -11
  86. package/dist/esm/federationInstanceFetch.js +10 -5
  87. package/dist/esm/identity.js +17 -15
  88. package/dist/esm/identityLink.js +6 -4
  89. package/dist/esm/identityProof.js +6 -4
  90. package/dist/esm/inboxPush.js +3 -2
  91. package/dist/esm/index.js +4 -2
  92. package/dist/esm/inference/accountBilling.js +33 -31
  93. package/dist/esm/inference/aliaModelRelease.js +7 -5
  94. package/dist/esm/inference/attribution.js +14 -12
  95. package/dist/esm/inference/catalogue.js +33 -27
  96. package/dist/esm/inference/economics.js +22 -17
  97. package/dist/esm/inference/embeddings.js +9 -7
  98. package/dist/esm/inference/entitlement.js +15 -13
  99. package/dist/esm/inference/errors.js +13 -6
  100. package/dist/esm/inference/identifiers.js +31 -19
  101. package/dist/esm/inference/inbox.js +37 -35
  102. package/dist/esm/inference/modelDocumentation.js +14 -12
  103. package/dist/esm/inference/money.js +3 -2
  104. package/dist/esm/inference/priceVersion.js +8 -3
  105. package/dist/esm/inference/providerConnection.js +19 -12
  106. package/dist/esm/inference/realtime.js +85 -44
  107. package/dist/esm/inference/request.js +25 -23
  108. package/dist/esm/inference/routingPolicy.js +9 -7
  109. package/dist/esm/inference/streamEvents.js +20 -14
  110. package/dist/esm/inference/usage.js +30 -13
  111. package/dist/esm/keyRecovery.js +8 -6
  112. package/dist/esm/keyRotation.js +5 -4
  113. package/dist/esm/linkedAccounts.js +20 -16
  114. package/dist/esm/moderationReputation.js +27 -25
  115. package/dist/esm/notifications.js +23 -7
  116. package/dist/esm/numberChecks.js +41 -0
  117. package/dist/esm/oauth.js +14 -12
  118. package/dist/esm/organizations.js +23 -21
  119. package/dist/esm/products/access.js +10 -8
  120. package/dist/esm/products/billing.js +10 -8
  121. package/dist/esm/products/checkout.js +22 -10
  122. package/dist/esm/products/plans.js +15 -10
  123. package/dist/esm/protocol.js +4 -3
  124. package/dist/esm/recommendations.js +25 -17
  125. package/dist/esm/reputation.js +13 -11
  126. package/dist/esm/safety.js +43 -27
  127. package/dist/esm/serviceToken.js +80 -1
  128. package/dist/esm/sessionRevocation.js +6 -4
  129. package/dist/esm/signIn.js +42 -24
  130. package/dist/esm/stickers.js +17 -13
  131. package/dist/esm/stringChecks.js +63 -0
  132. package/dist/esm/transparency.js +14 -12
  133. package/dist/esm/updates.js +22 -20
  134. package/dist/esm/userInvalidation.js +4 -2
  135. package/dist/esm/userResponse.js +4 -3
  136. package/dist/esm/username.js +3 -2
  137. package/dist/types/accountAccess.d.ts +29 -70
  138. package/dist/types/accountEmail.d.ts +2 -14
  139. package/dist/types/accountGraph.d.ts +179 -171
  140. package/dist/types/accountName.d.ts +1 -1
  141. package/dist/types/accountSubject.d.ts +20 -93
  142. package/dist/types/agency.d.ts +528 -2924
  143. package/dist/types/agentKeys.d.ts +48 -421
  144. package/dist/types/appAssertions.d.ts +56 -210
  145. package/dist/types/applicationRoles.d.ts +30 -276
  146. package/dist/types/avatarCharacter.d.ts +1 -1
  147. package/dist/types/civic.d.ts +1 -13
  148. package/dist/types/client/agentKeys.d.ts +18 -18
  149. package/dist/types/client/appAssertions.d.ts +3 -3
  150. package/dist/types/client/check.d.ts +13 -13
  151. package/dist/types/client/deviceDirectory.d.ts +51 -51
  152. package/dist/types/client/deviceSession.d.ts +14 -14
  153. package/dist/types/client/organizations.d.ts +25 -25
  154. package/dist/types/client/products.d.ts +33 -33
  155. package/dist/types/client/recommendations.d.ts +2 -2
  156. package/dist/types/client/safety.d.ts +45 -45
  157. package/dist/types/client/sessionStatus.d.ts +4 -4
  158. package/dist/types/client/signIn.d.ts +1 -1
  159. package/dist/types/commonsSignIn.d.ts +4 -1
  160. package/dist/types/consoleOnboarding.d.ts +24 -44
  161. package/dist/types/contentClaims.d.ts +24 -180
  162. package/dist/types/deviceDirectory.d.ts +109 -1040
  163. package/dist/types/deviceSession.d.ts +36 -298
  164. package/dist/types/email/messages.d.ts +212 -1793
  165. package/dist/types/emailAgentContext.d.ts +10 -194
  166. package/dist/types/externalIdentity.d.ts +121 -615
  167. package/dist/types/federationInstanceFetch.d.ts +3 -32
  168. package/dist/types/identity.d.ts +15 -92
  169. package/dist/types/identityLink.d.ts +6 -84
  170. package/dist/types/identityProof.d.ts +5 -17
  171. package/dist/types/inboxPush.d.ts +1 -9
  172. package/dist/types/index.d.ts +5 -3
  173. package/dist/types/inference/accountBilling.d.ts +151 -488
  174. package/dist/types/inference/aliaModelRelease.d.ts +42 -439
  175. package/dist/types/inference/attribution.d.ts +75 -104
  176. package/dist/types/inference/catalogue.d.ts +417 -1599
  177. package/dist/types/inference/economics.d.ts +69 -276
  178. package/dist/types/inference/embeddings.d.ts +110 -406
  179. package/dist/types/inference/entitlement.d.ts +80 -335
  180. package/dist/types/inference/errors.d.ts +90 -102
  181. package/dist/types/inference/identifiers.d.ts +12 -4
  182. package/dist/types/inference/inbox.d.ts +105 -420
  183. package/dist/types/inference/modelDocumentation.d.ts +201 -1390
  184. package/dist/types/inference/money.d.ts +65 -32
  185. package/dist/types/inference/priceVersion.d.ts +53 -120
  186. package/dist/types/inference/providerConnection.d.ts +253 -710
  187. package/dist/types/inference/realtime.d.ts +954 -6825
  188. package/dist/types/inference/request.d.ts +300 -2572
  189. package/dist/types/inference/routingPolicy.d.ts +95 -503
  190. package/dist/types/inference/streamEvents.d.ts +253 -721
  191. package/dist/types/inference/usage.d.ts +317 -950
  192. package/dist/types/keyRecovery.d.ts +3 -51
  193. package/dist/types/keyRotation.d.ts +3 -38
  194. package/dist/types/linkedAccounts.d.ts +50 -236
  195. package/dist/types/moderationReputation.d.ts +81 -14
  196. package/dist/types/notifications.d.ts +19 -51
  197. package/dist/types/numberChecks.d.ts +9 -0
  198. package/dist/types/oauth.d.ts +101 -809
  199. package/dist/types/organizations.d.ts +268 -921
  200. package/dist/types/oxyRecordTypes.d.ts +11 -1
  201. package/dist/types/products/access.d.ts +125 -775
  202. package/dist/types/products/billing.d.ts +67 -503
  203. package/dist/types/products/checkout.d.ts +16 -69
  204. package/dist/types/products/plans.d.ts +33 -366
  205. package/dist/types/recommendations.d.ts +76 -389
  206. package/dist/types/reputation.d.ts +37 -5
  207. package/dist/types/safety.d.ts +408 -2048
  208. package/dist/types/serviceToken.d.ts +247 -7
  209. package/dist/types/sessionRevocation.d.ts +2 -17
  210. package/dist/types/sessionStatus.d.ts +27 -115
  211. package/dist/types/signIn.d.ts +53 -553
  212. package/dist/types/stickers.d.ts +67 -819
  213. package/dist/types/stringChecks.d.ts +16 -0
  214. package/dist/types/transparency.d.ts +14 -302
  215. package/dist/types/updates.d.ts +60 -316
  216. package/dist/types/userInvalidation.d.ts +4 -13
  217. package/dist/types/userResponse.d.ts +302 -2400
  218. package/dist/types/username.d.ts +3 -3
  219. package/package.json +2 -2
@@ -1,4 +1,8 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.applicationModerationTrustSchema = exports.reputationContextualInfluenceSchema = exports.reputationReviewingSchema = exports.reputationReportingSchema = exports.reputationConductSchema = exports.reputationContributionSchema = exports.reputationPersonhoodSchema = exports.identityBindingSchema = exports.registerIdentityBindingSchema = exports.reverseModerationEffectResultSchema = exports.applyModerationDecisionResultSchema = exports.moderationEffectSchema = exports.reverseModerationEffectSchema = exports.finalizeModerationDecisionSchema = exports.moderationDecisionEventSchema = exports.moderationPolicyVersionsSchema = exports.moderationDecisionEventSubjectSchema = exports.moderationFindingSchema = exports.moderationEffectSkipReasonSchema = exports.MODERATION_EFFECT_SKIP_REASONS = exports.applicationModerationStandingSchema = exports.APPLICATION_MODERATION_STANDINGS = exports.identityBindingStatusSchema = exports.IDENTITY_BINDING_STATUSES = exports.identityBindingTypeSchema = exports.IDENTITY_BINDING_TYPES = exports.personhoodStatusSchema = exports.PERSONHOOD_STATUSES = exports.contributionTierSchema = exports.CONTRIBUTION_TIERS = exports.conductStandingSchema = exports.CONDUCT_STANDINGS = exports.conductStrikeStatusSchema = exports.CONDUCT_STRIKE_STATUSES = exports.moderationEffectStatusSchema = exports.MODERATION_EFFECT_STATUSES = exports.moderationEffectTypeSchema = exports.MODERATION_EFFECT_TYPES = exports.moderationDecisionStatusSchema = exports.MODERATION_DECISION_STATUSES = exports.moderationAttributionSchema = exports.MODERATION_ATTRIBUTIONS = exports.moderationFindingScopeSchema = exports.MODERATION_FINDING_SCOPES = exports.moderationSeveritySchema = exports.MODERATION_SEVERITIES = void 0;
4
+ const numberChecks_1 = require("./numberChecks");
5
+ const stringChecks_1 = require("./stringChecks");
2
6
  /**
3
7
  * Oxy Trust — the moderation reputation bridge (CrowdSource → Oxy Trust).
4
8
  *
@@ -35,8 +39,6 @@
35
39
  *
36
40
  * Platform-agnostic — zod only. ESM-safe (no `require()`).
37
41
  */
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.applicationModerationTrustSchema = exports.reputationContextualInfluenceSchema = exports.reputationReviewingSchema = exports.reputationReportingSchema = exports.reputationConductSchema = exports.reputationContributionSchema = exports.reputationPersonhoodSchema = exports.identityBindingSchema = exports.registerIdentityBindingSchema = exports.reverseModerationEffectResultSchema = exports.applyModerationDecisionResultSchema = exports.moderationEffectSchema = exports.reverseModerationEffectSchema = exports.finalizeModerationDecisionSchema = exports.moderationDecisionEventSchema = exports.moderationPolicyVersionsSchema = exports.moderationDecisionEventSubjectSchema = exports.moderationFindingSchema = exports.moderationEffectSkipReasonSchema = exports.MODERATION_EFFECT_SKIP_REASONS = exports.applicationModerationStandingSchema = exports.APPLICATION_MODERATION_STANDINGS = exports.identityBindingStatusSchema = exports.IDENTITY_BINDING_STATUSES = exports.identityBindingTypeSchema = exports.IDENTITY_BINDING_TYPES = exports.personhoodStatusSchema = exports.PERSONHOOD_STATUSES = exports.contributionTierSchema = exports.CONTRIBUTION_TIERS = exports.conductStandingSchema = exports.CONDUCT_STANDINGS = exports.conductStrikeStatusSchema = exports.CONDUCT_STRIKE_STATUSES = exports.moderationEffectStatusSchema = exports.MODERATION_EFFECT_STATUSES = exports.moderationEffectTypeSchema = exports.MODERATION_EFFECT_TYPES = exports.moderationDecisionStatusSchema = exports.MODERATION_DECISION_STATUSES = exports.moderationAttributionSchema = exports.MODERATION_ATTRIBUTIONS = exports.moderationFindingScopeSchema = exports.MODERATION_FINDING_SCOPES = exports.moderationSeveritySchema = exports.MODERATION_SEVERITIES = void 0;
40
42
  const zod_1 = require("zod");
41
43
  /* -------------------------------------------------------------------------- */
42
44
  /* Closed value sets */
@@ -170,45 +172,45 @@ exports.MODERATION_EFFECT_SKIP_REASONS = [
170
172
  ];
171
173
  exports.moderationEffectSkipReasonSchema = zod_1.z.enum(exports.MODERATION_EFFECT_SKIP_REASONS);
172
174
  exports.moderationFindingSchema = zod_1.z.object({
173
- code: zod_1.z.string().trim().min(1).max(200),
175
+ code: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(200)),
174
176
  severity: exports.moderationSeveritySchema,
175
177
  scope: exports.moderationFindingScopeSchema,
176
178
  attribution: exports.moderationAttributionSchema,
177
- family: zod_1.z.string().trim().min(1).max(100),
179
+ family: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(100)),
178
180
  });
179
181
  exports.moderationDecisionEventSubjectSchema = zod_1.z.object({
180
182
  principalType: zod_1.z.literal('oxy_user'),
181
- principalId: zod_1.z.string().trim().min(1),
182
- bindingProofId: zod_1.z.string().trim().min(1),
183
+ principalId: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)),
184
+ bindingProofId: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)),
183
185
  });
184
186
  exports.moderationPolicyVersionsSchema = zod_1.z.object({
185
- universal: zod_1.z.string().trim().min(1).max(100),
186
- application: zod_1.z.string().trim().min(1).max(100),
187
- oxyConduct: zod_1.z.string().trim().min(1).max(100),
187
+ universal: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(100)),
188
+ application: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(100)),
189
+ oxyConduct: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(100)),
188
190
  });
189
191
  exports.moderationDecisionEventSchema = zod_1.z.object({
190
- eventId: zod_1.z.string().trim().min(1).max(200),
191
- reportedApplicationId: zod_1.z.string().trim().min(1).max(200),
192
- type: zod_1.z.string().trim().min(1).max(200),
193
- caseId: zod_1.z.string().trim().min(1).max(200),
194
- incidentId: zod_1.z.string().trim().min(1).max(200),
195
- decisionId: zod_1.z.string().trim().min(1).max(200),
196
- decisionRevision: zod_1.z.number().int().min(1),
192
+ eventId: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(200)),
193
+ reportedApplicationId: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(200)),
194
+ type: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(200)),
195
+ caseId: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(200)),
196
+ incidentId: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(200)),
197
+ decisionId: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(200)),
198
+ decisionRevision: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).min(1),
197
199
  subject: exports.moderationDecisionEventSubjectSchema,
198
200
  findings: zod_1.z.array(exports.moderationFindingSchema).min(1).max(20),
199
201
  decisionStatus: exports.moderationDecisionStatusSchema,
200
202
  policyVersions: exports.moderationPolicyVersionsSchema,
201
- occurredAt: zod_1.z.string().trim().min(1),
202
- proofHash: zod_1.z.string().trim().min(1).max(200),
203
+ occurredAt: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)),
204
+ proofHash: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(200)),
203
205
  });
204
206
  exports.finalizeModerationDecisionSchema = zod_1.z.object({
205
- decisionId: zod_1.z.string().trim().min(1).max(200),
206
- decisionRevision: zod_1.z.number().int().min(1),
207
+ decisionId: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(200)),
208
+ decisionRevision: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).min(1),
207
209
  });
208
210
  exports.reverseModerationEffectSchema = zod_1.z.object({
209
- decisionId: zod_1.z.string().trim().min(1).max(200),
210
- decisionRevision: zod_1.z.number().int().min(1),
211
- reason: zod_1.z.string().trim().min(1).max(500),
211
+ decisionId: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(200)),
212
+ decisionRevision: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).min(1),
213
+ reason: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(500)),
212
214
  });
213
215
  exports.moderationEffectSchema = zod_1.z.object({
214
216
  id: zod_1.z.string(),
@@ -243,8 +245,8 @@ exports.reverseModerationEffectResultSchema = zod_1.z.object({
243
245
  idempotent: zod_1.z.boolean(),
244
246
  });
245
247
  exports.registerIdentityBindingSchema = zod_1.z.object({
246
- localPrincipalId: zod_1.z.string().trim().min(1).max(200),
247
- userProofToken: zod_1.z.string().trim().min(1),
248
+ localPrincipalId: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(200)),
249
+ userProofToken: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)),
248
250
  });
249
251
  exports.identityBindingSchema = zod_1.z.object({
250
252
  id: zod_1.z.string(),
@@ -279,8 +281,8 @@ exports.reputationReportingSchema = zod_1.z.object({
279
281
  });
280
282
  exports.reputationReviewingSchema = zod_1.z.object({
281
283
  globalReliability: zod_1.z.number(),
282
- categoryReliability: zod_1.z.record(zod_1.z.number()),
283
- languageReliability: zod_1.z.record(zod_1.z.number()),
284
+ categoryReliability: zod_1.z.record(zod_1.z.string(), zod_1.z.number()),
285
+ languageReliability: zod_1.z.record(zod_1.z.string(), zod_1.z.number()),
284
286
  });
285
287
  exports.reputationContextualInfluenceSchema = zod_1.z.object({
286
288
  reportPriorityWeight: zod_1.z.number(),
@@ -1,4 +1,7 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.oxySystemNotificationPushDataSchema = exports.OXY_SYSTEM_NOTIFICATION_PUSH_TYPE = exports.OXY_ACCOUNT_PUSH_CHANNEL = exports.createOxyNotificationRequestSchema = exports.OXY_NOTIFICATION_URL_MAX = exports.OXY_SYSTEM_NOTIFICATION_MESSAGE_MAX = exports.OXY_SYSTEM_NOTIFICATION_TITLE_MAX = exports.OXY_NOTIFICATION_ENTITY_TYPES = exports.OXY_NOTIFICATION_TYPES = void 0;
4
+ const stringChecks_1 = require("./stringChecks");
2
5
  /**
3
6
  * The closed set of Oxy in-app notification types — owned here so the API's
4
7
  * CHECK constraint (`notifications.type`), its request validation and the SDK
@@ -11,8 +14,6 @@
11
14
  *
12
15
  * Platform-agnostic — zod only, no react/react-native/expo.
13
16
  */
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.oxySystemNotificationPushDataSchema = exports.OXY_SYSTEM_NOTIFICATION_PUSH_TYPE = exports.OXY_ACCOUNT_PUSH_CHANNEL = exports.createOxyNotificationRequestSchema = exports.OXY_NOTIFICATION_URL_MAX = exports.OXY_SYSTEM_NOTIFICATION_MESSAGE_MAX = exports.OXY_SYSTEM_NOTIFICATION_TITLE_MAX = exports.OXY_NOTIFICATION_ENTITY_TYPES = exports.OXY_NOTIFICATION_TYPES = void 0;
16
17
  const zod_1 = require("zod");
17
18
  exports.OXY_NOTIFICATION_TYPES = [
18
19
  'like',
@@ -51,14 +52,29 @@ exports.OXY_NOTIFICATION_URL_MAX = 2048;
51
52
  */
52
53
  exports.createOxyNotificationRequestSchema = zod_1.z
53
54
  .object({
54
- recipientId: zod_1.z.string().min(1),
55
- actorId: zod_1.z.string().min(1),
55
+ recipientId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)),
56
+ actorId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)),
56
57
  type: zod_1.z.enum(exports.OXY_NOTIFICATION_TYPES),
57
- entityId: zod_1.z.string().min(1),
58
+ entityId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)),
58
59
  entityType: zod_1.z.enum(exports.OXY_NOTIFICATION_ENTITY_TYPES),
59
- title: zod_1.z.string().trim().min(1).max(exports.OXY_SYSTEM_NOTIFICATION_TITLE_MAX).optional(),
60
- message: zod_1.z.string().trim().min(1).max(exports.OXY_SYSTEM_NOTIFICATION_MESSAGE_MAX).optional(),
61
- url: zod_1.z.string().trim().min(1).max(exports.OXY_NOTIFICATION_URL_MAX).optional(),
60
+ title: zod_1.z
61
+ .string()
62
+ .trim()
63
+ .check((0, stringChecks_1.utf16MinLength)(1))
64
+ .check((0, stringChecks_1.utf16MaxLength)(exports.OXY_SYSTEM_NOTIFICATION_TITLE_MAX))
65
+ .optional(),
66
+ message: zod_1.z
67
+ .string()
68
+ .trim()
69
+ .check((0, stringChecks_1.utf16MinLength)(1))
70
+ .check((0, stringChecks_1.utf16MaxLength)(exports.OXY_SYSTEM_NOTIFICATION_MESSAGE_MAX))
71
+ .optional(),
72
+ url: zod_1.z
73
+ .string()
74
+ .trim()
75
+ .check((0, stringChecks_1.utf16MinLength)(1))
76
+ .check((0, stringChecks_1.utf16MaxLength)(exports.OXY_NOTIFICATION_URL_MAX))
77
+ .optional(),
62
78
  data: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).optional(),
63
79
  })
64
80
  .superRefine((value, context) => {
@@ -116,5 +132,5 @@ exports.OXY_SYSTEM_NOTIFICATION_PUSH_TYPE = 'oxy_system_notification';
116
132
  */
117
133
  exports.oxySystemNotificationPushDataSchema = zod_1.z.object({
118
134
  type: zod_1.z.literal(exports.OXY_SYSTEM_NOTIFICATION_PUSH_TYPE),
119
- notificationId: zod_1.z.string().min(1).max(64),
135
+ notificationId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(64)),
120
136
  });
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.integerCheck = integerCheck;
4
+ exports.safeNumberCheck = safeNumberCheck;
5
+ const zod_1 = require("zod");
6
+ /** Integer validation does not add a safe-number ceiling unless the contract requests one. */
7
+ function integerCheck(message) {
8
+ const check = zod_1.z.check((context) => {
9
+ if (Number.isInteger(context.value))
10
+ return;
11
+ context.issues.push({
12
+ code: 'invalid_type',
13
+ expected: 'int',
14
+ input: context.value,
15
+ continue: true,
16
+ ...(message ? { message: typeof message === 'string' ? message : message.message } : {}),
17
+ });
18
+ });
19
+ check._zod.onattach.push((schema) => {
20
+ schema._zod.bag.format = 'integer';
21
+ });
22
+ return check;
23
+ }
24
+ /** Existing `.safe()` contracts bound a number independently of integer validation. */
25
+ function safeNumberCheck(message) {
26
+ const check = zod_1.z.check((context) => {
27
+ const common = {
28
+ origin: 'number',
29
+ input: context.value,
30
+ inclusive: true,
31
+ continue: true,
32
+ ...(message ? { message: typeof message === 'string' ? message : message.message } : {}),
33
+ };
34
+ if (context.value < Number.MIN_SAFE_INTEGER)
35
+ context.issues.push({ ...common, code: 'too_small', minimum: Number.MIN_SAFE_INTEGER });
36
+ if (context.value > Number.MAX_SAFE_INTEGER)
37
+ context.issues.push({ ...common, code: 'too_big', maximum: Number.MAX_SAFE_INTEGER });
38
+ });
39
+ check._zod.onattach.push((schema) => {
40
+ const bag = schema._zod.bag;
41
+ bag.minimum = Math.max(typeof bag.minimum === 'number' ? bag.minimum : -Infinity, Number.MIN_SAFE_INTEGER);
42
+ bag.maximum = Math.min(typeof bag.maximum === 'number' ? bag.maximum : Infinity, Number.MAX_SAFE_INTEGER);
43
+ });
44
+ return check;
45
+ }
package/dist/cjs/oauth.js CHANGED
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.mcpOAuthConsentResponseSchema = exports.mcpOAuthClientInfoResponseSchema = exports.mcpOAuthConsentContextSchema = exports.mcpOAuthWriteActionSchema = exports.mcpOAuthClientApplicationSchema = exports.oauthAuthorizeCodeResponseSchema = exports.oauthConsentDecisionSchema = void 0;
4
+ const numberChecks_1 = require("./numberChecks");
5
+ const stringChecks_1 = require("./stringChecks");
4
6
  const zod_1 = require("zod");
5
7
  const agency_1 = require("./agency");
6
8
  const sessionStatus_1 = require("./sessionStatus");
@@ -61,10 +63,10 @@ exports.oauthConsentDecisionSchema = zod_1.z.discriminatedUnion('consentRequired
61
63
  * code was issued against is the one it registered.
62
64
  */
63
65
  exports.oauthAuthorizeCodeResponseSchema = zod_1.z.object({
64
- code: zod_1.z.string().min(1),
66
+ code: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)),
65
67
  state: zod_1.z.string().nullable(),
66
68
  redirectUri: zod_1.z.string(),
67
- expiresIn: zod_1.z.number().int().positive(),
69
+ expiresIn: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).positive(),
68
70
  });
69
71
  /**
70
72
  * Display-safe identity of a dynamically registered external MCP client.
@@ -73,7 +75,7 @@ exports.oauthAuthorizeCodeResponseSchema = zod_1.z.object({
73
75
  */
74
76
  exports.mcpOAuthClientApplicationSchema = sessionStatus_1.publicApplicationSchema
75
77
  .extend({
76
- clientId: zod_1.z.string().min(1),
78
+ clientId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)),
77
79
  })
78
80
  .strict();
79
81
  /**
@@ -81,8 +83,8 @@ exports.mcpOAuthClientApplicationSchema = sessionStatus_1.publicApplicationSchem
81
83
  * Every field is picked from the canonical catalog tool schema so consent can
82
84
  * never maintain a second tool description or effect classification.
83
85
  */
84
- exports.mcpOAuthWriteActionSchema = agency_1.catalogToolSchema
85
- .innerType()
86
+ exports.mcpOAuthWriteActionSchema = zod_1.z
87
+ .object(agency_1.catalogToolSchema.shape)
86
88
  .pick({
87
89
  name: true,
88
90
  version: true,
@@ -101,20 +103,20 @@ exports.mcpOAuthConsentContextSchema = zod_1.z
101
103
  client: exports.mcpOAuthClientApplicationSchema,
102
104
  account: zod_1.z
103
105
  .object({
104
- id: zod_1.z.string().min(1),
105
- displayName: zod_1.z.string().min(1).optional(),
106
- handle: zod_1.z.string().min(1).optional(),
107
- avatar: zod_1.z.string().min(1).optional(),
106
+ id: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)),
107
+ displayName: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).optional(),
108
+ handle: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).optional(),
109
+ avatar: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).optional(),
108
110
  })
109
111
  .strict(),
110
112
  resource: zod_1.z
111
113
  .object({
112
- appId: zod_1.z.string().min(1),
113
- uri: zod_1.z.string().url(),
114
+ appId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)),
115
+ uri: zod_1.z.string().check((0, stringChecks_1.urlCheck)()),
114
116
  application: sessionStatus_1.publicApplicationSchema,
115
117
  })
116
118
  .strict(),
117
- capabilities: zod_1.z.array(zod_1.z.string().min(1)).min(1),
119
+ capabilities: zod_1.z.array(zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1))).min(1),
118
120
  writeActions: zod_1.z.array(exports.mcpOAuthWriteActionSchema),
119
121
  })
120
122
  .strict();
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.organizationCurationResultSchema = exports.organizationCurationSchema = exports.organizationErrorSchema = exports.organizationMergeSchema = exports.organizationExternalResolutionSchema = exports.organizationExternalSchema = exports.organizationImportBatchResultSchema = exports.organizationImportBatchSchema = exports.organizationExternalInputSchema = exports.organizationClaimReviewSchema = exports.organizationClaimListSchema = exports.organizationClaimListQuerySchema = exports.organizationClaimDetailSchema = exports.organizationClaimSchema = exports.organizationClaimInputSchema = exports.organizationBatchSchema = exports.organizationBatchInputSchema = exports.organizationListSchema = exports.organizationSearchSchema = exports.organizationSchema = exports.updateOrganizationSchema = exports.createOrganizationSchema = exports.organizationNameSchema = exports.organizationAliasSchema = exports.ORGANIZATION_ERROR_CODES = exports.ORGANIZATION_NAME_MAX_LENGTH = exports.ORGANIZATION_CLAIM_DECISIONS = exports.ORGANIZATION_ALIAS_KINDS = exports.ORGANIZATION_CLAIM_STATUSES = exports.ORGANIZATION_STATUSES = exports.ORGANIZATION_TYPES = void 0;
4
+ const numberChecks_1 = require("./numberChecks");
5
+ const stringChecks_1 = require("./stringChecks");
4
6
  const zod_1 = require("zod");
5
7
  const accountName_1 = require("./accountName");
6
8
  // The Zod-free half of this contract lives in `./client/` (`@oxy.so/contracts/client`);
@@ -14,13 +16,13 @@ Object.defineProperty(exports, "ORGANIZATION_ALIAS_KINDS", { enumerable: true, g
14
16
  Object.defineProperty(exports, "ORGANIZATION_CLAIM_DECISIONS", { enumerable: true, get: function () { return organizations_2.ORGANIZATION_CLAIM_DECISIONS; } });
15
17
  Object.defineProperty(exports, "ORGANIZATION_NAME_MAX_LENGTH", { enumerable: true, get: function () { return organizations_2.ORGANIZATION_NAME_MAX_LENGTH; } });
16
18
  Object.defineProperty(exports, "ORGANIZATION_ERROR_CODES", { enumerable: true, get: function () { return organizations_2.ORGANIZATION_ERROR_CODES; } });
17
- const id = zod_1.z.string().min(1).max(128);
18
- const optionalText = (max) => zod_1.z.string().trim().min(1).max(max).nullable().optional();
19
+ const id = zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(128));
20
+ const optionalText = (max) => zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(max)).nullable().optional();
19
21
  exports.organizationAliasSchema = zod_1.z
20
22
  .object({
21
- alias: zod_1.z.string().trim().min(1).max(300),
23
+ alias: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(300)),
22
24
  kind: zod_1.z.enum(organizations_1.ORGANIZATION_ALIAS_KINDS),
23
- language: zod_1.z.string().min(2).max(35).optional(),
25
+ language: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(2)).check((0, stringChecks_1.utf16MaxLength)(35)).optional(),
24
26
  })
25
27
  .strict();
26
28
  /** An organization is named by the title policy every non-personal account uses. */
@@ -32,8 +34,8 @@ exports.createOrganizationSchema = zod_1.z
32
34
  legalName: optionalText(300),
33
35
  websiteUrl: zod_1.z
34
36
  .string()
35
- .url()
36
- .max(2048)
37
+ .check((0, stringChecks_1.urlCheck)())
38
+ .check((0, stringChecks_1.utf16MaxLength)(2048))
37
39
  .refine((value) => /^https?:\/\//.test(value), 'Use HTTP or HTTPS')
38
40
  .nullable()
39
41
  .optional(),
@@ -59,16 +61,16 @@ exports.organizationSchema = exports.createOrganizationSchema
59
61
  claimStatus: zod_1.z.enum(organizations_1.ORGANIZATION_CLAIM_STATUSES),
60
62
  status: zod_1.z.enum(organizations_1.ORGANIZATION_STATUSES),
61
63
  mergedIntoAccountId: id.nullable(),
62
- createdAt: zod_1.z.string().datetime(),
63
- updatedAt: zod_1.z.string().datetime(),
64
+ createdAt: zod_1.z.string().check((0, stringChecks_1.isoDateTime)()),
65
+ updatedAt: zod_1.z.string().check((0, stringChecks_1.isoDateTime)()),
64
66
  })
65
67
  .strict();
66
68
  exports.organizationSearchSchema = zod_1.z
67
69
  .object({
68
- query: zod_1.z.string().trim().max(200).default(''),
70
+ query: zod_1.z.string().trim().check((0, stringChecks_1.utf16MaxLength)(200)).default(''),
69
71
  organizationType: zod_1.z.enum(organizations_1.ORGANIZATION_TYPES).optional(),
70
- limit: zod_1.z.coerce.number().int().min(1).max(50).default(20),
71
- cursor: zod_1.z.string().min(1).max(2048).optional(),
72
+ limit: zod_1.z.coerce.number().check((0, numberChecks_1.integerCheck)()).min(1).max(50).default(20),
73
+ cursor: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(2048)).optional(),
72
74
  })
73
75
  .strict();
74
76
  exports.organizationListSchema = zod_1.z
@@ -83,7 +85,7 @@ exports.organizationBatchSchema = zod_1.z
83
85
  .strict();
84
86
  exports.organizationClaimInputSchema = zod_1.z
85
87
  .object({
86
- evidenceReference: zod_1.z.string().trim().min(1).max(1000),
88
+ evidenceReference: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(1000)),
87
89
  })
88
90
  .strict();
89
91
  exports.organizationClaimSchema = zod_1.z
@@ -92,21 +94,21 @@ exports.organizationClaimSchema = zod_1.z
92
94
  accountId: id,
93
95
  claimantUserId: id,
94
96
  status: zod_1.z.enum(organizations_1.ORGANIZATION_CLAIM_DECISIONS),
95
- createdAt: zod_1.z.string().datetime(),
97
+ createdAt: zod_1.z.string().check((0, stringChecks_1.isoDateTime)()),
96
98
  })
97
99
  .strict();
98
100
  exports.organizationClaimDetailSchema = exports.organizationClaimSchema
99
101
  .extend({
100
102
  evidenceReference: zod_1.z.string(),
101
103
  reviewEvidenceReference: zod_1.z.string().nullable(),
102
- reviewedAt: zod_1.z.string().datetime().nullable(),
104
+ reviewedAt: zod_1.z.string().check((0, stringChecks_1.isoDateTime)()).nullable(),
103
105
  })
104
106
  .strict();
105
107
  exports.organizationClaimListQuerySchema = zod_1.z
106
108
  .object({
107
109
  status: zod_1.z.enum(organizations_1.ORGANIZATION_CLAIM_DECISIONS).optional(),
108
- limit: zod_1.z.coerce.number().int().min(1).max(50).default(20),
109
- cursor: zod_1.z.string().min(1).max(2048).optional(),
110
+ limit: zod_1.z.coerce.number().check((0, numberChecks_1.integerCheck)()).min(1).max(50).default(20),
111
+ cursor: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(2048)).optional(),
110
112
  })
111
113
  .strict();
112
114
  exports.organizationClaimListSchema = zod_1.z
@@ -115,16 +117,16 @@ exports.organizationClaimListSchema = zod_1.z
115
117
  exports.organizationClaimReviewSchema = zod_1.z
116
118
  .object({
117
119
  decision: zod_1.z.enum(['approved', 'rejected']),
118
- evidenceReference: zod_1.z.string().trim().min(1).max(1000),
120
+ evidenceReference: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(1000)),
119
121
  })
120
122
  .strict();
121
123
  exports.organizationExternalInputSchema = zod_1.z
122
124
  .object({
123
125
  namespace: zod_1.z.string().regex(/^[a-z][a-z0-9_-]{0,63}$/),
124
- externalId: zod_1.z.string().min(1).max(256),
126
+ externalId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(256)),
125
127
  accountId: id.optional(),
126
128
  organization: exports.createOrganizationSchema,
127
- evidenceReference: zod_1.z.string().trim().min(1).max(1000),
129
+ evidenceReference: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(1000)),
128
130
  avatarFileId: id.optional(),
129
131
  })
130
132
  .strict();
@@ -156,7 +158,7 @@ exports.organizationExternalResolutionSchema = zod_1.z.object({ accountId: id })
156
158
  exports.organizationMergeSchema = zod_1.z
157
159
  .object({
158
160
  targetAccountId: id,
159
- evidenceReference: zod_1.z.string().trim().min(1).max(1000),
161
+ evidenceReference: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(1000)),
160
162
  })
161
163
  .strict();
162
164
  exports.organizationErrorSchema = zod_1.z
@@ -177,7 +179,7 @@ exports.organizationCurationSchema = zod_1.z
177
179
  .object({
178
180
  changes: exports.updateOrganizationSchema.optional(),
179
181
  status: zod_1.z.enum(['active', 'inactive', 'suppressed']).optional(),
180
- evidenceReference: zod_1.z.string().trim().min(1).max(1000),
182
+ evidenceReference: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(1000)),
181
183
  })
182
184
  .strict()
183
185
  .refine((input) => input.changes !== undefined || input.status !== undefined, 'At least one change is required');
@@ -1,12 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.subjectProductGrantSnapshotSchema = exports.subjectProductAccessSchema = exports.productAccessGrantSchema = exports.productOfferSegmentSchema = exports.productSubscriptionSourceSchema = exports.productOfferSchema = exports.productBenefitSchema = exports.subjectProductAccessQuerySchema = exports.productDefinitionSchema = void 0;
4
+ const numberChecks_1 = require("../numberChecks");
5
+ const stringChecks_1 = require("../stringChecks");
4
6
  const zod_1 = require("zod");
5
7
  const identifiers_1 = require("../inference/identifiers");
6
- const identifier = zod_1.z.string().min(1).max(160);
7
- const count = zod_1.z.number().int().nonnegative().safe();
8
+ const identifier = zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(160));
9
+ const count = zod_1.z.number().check((0, numberChecks_1.integerCheck)()).nonnegative().check((0, numberChecks_1.safeNumberCheck)());
8
10
  const period = zod_1.z
9
- .object({ start: zod_1.z.string().datetime(), end: zod_1.z.string().datetime() })
11
+ .object({ start: zod_1.z.string().check((0, stringChecks_1.isoDateTime)()), end: zod_1.z.string().check((0, stringChecks_1.isoDateTime)()) })
10
12
  .strict()
11
13
  .refine((value) => Date.parse(value.end) > Date.parse(value.start), 'period end must follow start');
12
14
  /** Product ownership and audience are registered together; branding grants no trust. */
@@ -44,7 +46,7 @@ exports.productOfferSchema = zod_1.z
44
46
  .object({
45
47
  schemaVersion: zod_1.z.literal(1),
46
48
  id: identifier,
47
- version: zod_1.z.number().int().positive().safe(),
49
+ version: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).positive().check((0, numberChecks_1.safeNumberCheck)()),
48
50
  kind: zod_1.z.enum(['individual', 'bundle']),
49
51
  benefits: zod_1.z.array(exports.productBenefitSchema),
50
52
  })
@@ -81,7 +83,7 @@ exports.productOfferSegmentSchema = zod_1.z
81
83
  subscriptionId: identifier,
82
84
  beneficiaryAccountId: identifiers_1.oxyAccountIdSchema,
83
85
  offerId: identifier,
84
- offerVersion: zod_1.z.number().int().positive().safe(),
86
+ offerVersion: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).positive().check((0, numberChecks_1.safeNumberCheck)()),
85
87
  origin: zod_1.z.enum(['individual', 'bundle']),
86
88
  period,
87
89
  })
@@ -94,11 +96,11 @@ exports.productAccessGrantSchema = zod_1.z
94
96
  sourceSegmentId: identifier,
95
97
  beneficiaryAccountId: identifiers_1.oxyAccountIdSchema,
96
98
  offerId: identifier,
97
- offerVersion: zod_1.z.number().int().positive().safe(),
99
+ offerVersion: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).positive().check((0, numberChecks_1.safeNumberCheck)()),
98
100
  origin: zod_1.z.enum(['individual', 'bundle']),
99
101
  benefit: exports.productBenefitSchema,
100
102
  period,
101
- revokedAt: zod_1.z.string().datetime().nullable(),
103
+ revokedAt: zod_1.z.string().check((0, stringChecks_1.isoDateTime)()).nullable(),
102
104
  })
103
105
  .strict();
104
106
  /** Access answers contain no payer, provider reference, price or account balance. */
@@ -107,7 +109,7 @@ exports.subjectProductAccessSchema = zod_1.z
107
109
  schemaVersion: zod_1.z.literal(1),
108
110
  subjectAccountId: identifiers_1.oxyAccountIdSchema,
109
111
  productId: identifier,
110
- evaluatedAt: zod_1.z.string().datetime(),
112
+ evaluatedAt: zod_1.z.string().check((0, stringChecks_1.isoDateTime)()),
111
113
  capabilities: zod_1.z.array(zod_1.z.object({ key: identifier, grantIds: zod_1.z.array(identifier) }).strict()),
112
114
  quotas: zod_1.z.array(zod_1.z
113
115
  .object({
@@ -1,13 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.productSubscriptionCancellationResultSchema = exports.cancelProductSubscriptionSchema = exports.subscriptionCreditGrantsResponseSchema = exports.subscriptionCreditGrantSchema = exports.productSubscriptionsResponseSchema = exports.productSubscriptionSummarySchema = void 0;
4
+ const numberChecks_1 = require("../numberChecks");
5
+ const stringChecks_1 = require("../stringChecks");
4
6
  const zod_1 = require("zod");
5
7
  const identifiers_1 = require("../inference/identifiers");
6
- const id = zod_1.z.string().min(1).max(160);
7
- const name = zod_1.z.string().min(1).max(100);
8
- const count = zod_1.z.number().int().nonnegative().safe();
8
+ const id = zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(160));
9
+ const name = zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(100));
10
+ const count = zod_1.z.number().check((0, numberChecks_1.integerCheck)()).nonnegative().check((0, numberChecks_1.safeNumberCheck)());
9
11
  const period = zod_1.z
10
- .object({ start: zod_1.z.string().datetime(), end: zod_1.z.string().datetime() })
12
+ .object({ start: zod_1.z.string().check((0, stringChecks_1.isoDateTime)()), end: zod_1.z.string().check((0, stringChecks_1.isoDateTime)()) })
11
13
  .strict()
12
14
  .refine((value) => Date.parse(value.end) > Date.parse(value.start), 'Period end must follow start');
13
15
  /** Self-service provenance; no payer/provider identifiers or balances in access metadata. */
@@ -32,7 +34,7 @@ exports.productSubscriptionSummarySchema = zod_1.z
32
34
  .object({
33
35
  segmentId: id,
34
36
  offerId: id,
35
- offerVersion: zod_1.z.number().int().positive().safe(),
37
+ offerVersion: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).positive().check((0, numberChecks_1.safeNumberCheck)()),
36
38
  displayName: name,
37
39
  origin: zod_1.z.enum(['individual', 'bundle']),
38
40
  period,
@@ -60,7 +62,7 @@ exports.subscriptionCreditGrantSchema = zod_1.z
60
62
  clawed: count,
61
63
  remaining: count,
62
64
  promotionId: id.nullable(),
63
- createdAt: zod_1.z.string().datetime(),
65
+ createdAt: zod_1.z.string().check((0, stringChecks_1.isoDateTime)()),
64
66
  })
65
67
  .strict()
66
68
  .refine((value) => BigInt(value.consumed) + BigInt(value.clawed) + BigInt(value.remaining) ===
@@ -73,8 +75,8 @@ exports.cancelProductSubscriptionSchema = zod_1.z
73
75
  sourceId: id,
74
76
  actionId: zod_1.z
75
77
  .string()
76
- .min(8)
77
- .max(160)
78
+ .check((0, stringChecks_1.utf16MinLength)(8))
79
+ .check((0, stringChecks_1.utf16MaxLength)(160))
78
80
  .regex(/^[a-zA-Z0-9_-]+$/)
79
81
  .optional(),
80
82
  expectedSubjectAccountId: identifiers_1.oxyAccountIdSchema.optional(),
@@ -1,17 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.productSubscriptionRenewalRequestSchema = exports.productPlanCheckoutRequestSchema = exports.personalPlanCheckoutResultSchema = exports.personalPlanCheckoutRequestSchema = void 0;
4
+ const numberChecks_1 = require("../numberChecks");
5
+ const stringChecks_1 = require("../stringChecks");
4
6
  const zod_1 = require("zod");
5
7
  const identifiers_1 = require("../inference/identifiers");
6
8
  exports.personalPlanCheckoutRequestSchema = zod_1.z
7
9
  .object({
8
10
  expectedSubjectAccountId: identifiers_1.oxyAccountIdSchema,
9
- offerId: zod_1.z.string().min(1).max(160),
10
- offerVersion: zod_1.z.number().int().positive().safe(),
11
+ offerId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(160)),
12
+ offerVersion: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).positive().check((0, numberChecks_1.safeNumberCheck)()),
11
13
  idempotencyKey: zod_1.z
12
14
  .string()
13
- .min(8)
14
- .max(160)
15
+ .check((0, stringChecks_1.utf16MinLength)(8))
16
+ .check((0, stringChecks_1.utf16MaxLength)(160))
15
17
  .regex(/^[a-zA-Z0-9_-]+$/),
16
18
  })
17
19
  .strict();
@@ -26,23 +28,33 @@ exports.personalPlanCheckoutResultSchema = zod_1.z.discriminatedUnion('state', [
26
28
  zod_1.z
27
29
  .object({
28
30
  state: zod_1.z.literal('pending'),
29
- intentId: zod_1.z.string().min(1).max(160),
30
- checkoutUrl: zod_1.z.string().url().startsWith('https://').optional(),
31
+ intentId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(160)),
32
+ checkoutUrl: zod_1.z.string().check((0, stringChecks_1.urlCheck)()).startsWith('https://').optional(),
33
+ })
34
+ .strict(),
35
+ zod_1.z
36
+ .object({
37
+ state: zod_1.z.literal('closed'),
38
+ intentId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(160)),
39
+ })
40
+ .strict(),
41
+ zod_1.z
42
+ .object({
43
+ state: zod_1.z.literal('fulfilled'),
44
+ intentId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(160)),
31
45
  })
32
46
  .strict(),
33
- zod_1.z.object({ state: zod_1.z.literal('closed'), intentId: zod_1.z.string().min(1).max(160) }).strict(),
34
- zod_1.z.object({ state: zod_1.z.literal('fulfilled'), intentId: zod_1.z.string().min(1).max(160) }).strict(),
35
47
  ]);
36
48
  /** Explicit individual product offer; still owned and paid through Oxy. */
37
49
  exports.productPlanCheckoutRequestSchema = exports.personalPlanCheckoutRequestSchema
38
50
  .extend({
39
- productId: zod_1.z.string().min(1).max(160),
51
+ productId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(160)),
40
52
  })
41
53
  .strict();
42
54
  exports.productSubscriptionRenewalRequestSchema = zod_1.z
43
55
  .object({
44
56
  expectedSubjectAccountId: identifiers_1.oxyAccountIdSchema,
45
- sourceId: zod_1.z.string().min(1).max(160),
57
+ sourceId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(160)),
46
58
  idempotencyKey: exports.personalPlanCheckoutRequestSchema.shape.idempotencyKey,
47
59
  })
48
60
  .strict();