@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
@@ -1,4 +1,8 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.inferenceStreamEventSchema = exports.inferenceStreamDoneEventSchema = exports.inferenceFinishReasonSchema = exports.inferenceStreamErrorEventSchema = exports.inferenceStreamRouteSwitchEventSchema = exports.inferenceRouteSwitchReasonSchema = exports.inferenceRouteSwitchDetailSchema = exports.inferenceStreamUsageEventSchema = exports.inferenceStreamToolCallEventSchema = exports.inferenceStreamAudioEventSchema = exports.MAX_INFERENCE_AUDIO_BYTES = exports.inferenceAudioMediaTypeSchema = exports.inferenceStreamDeltaEventSchema = exports.inferenceStreamStartEventSchema = void 0;
4
+ const numberChecks_1 = require("../numberChecks");
5
+ const stringChecks_1 = require("../stringChecks");
2
6
  /**
3
7
  * Normalized stream events — what the data plane emits and the Oxy edge
4
8
  * forwards as SSE.
@@ -21,8 +25,6 @@
21
25
  *
22
26
  * Decided in: docs/adr/0010-public-api-compatibility.md, docs/adr/0008-catalogue-concept-separation.md.
23
27
  */
24
- Object.defineProperty(exports, "__esModule", { value: true });
25
- exports.inferenceStreamEventSchema = exports.inferenceStreamDoneEventSchema = exports.inferenceFinishReasonSchema = exports.inferenceStreamErrorEventSchema = exports.inferenceStreamRouteSwitchEventSchema = exports.inferenceRouteSwitchReasonSchema = exports.inferenceRouteSwitchDetailSchema = exports.inferenceStreamUsageEventSchema = exports.inferenceStreamToolCallEventSchema = exports.inferenceStreamAudioEventSchema = exports.MAX_INFERENCE_AUDIO_BYTES = exports.inferenceAudioMediaTypeSchema = exports.inferenceStreamDeltaEventSchema = exports.inferenceStreamStartEventSchema = void 0;
26
28
  const zod_1 = require("zod");
27
29
  const identifiers_1 = require("./identifiers");
28
30
  const errors_1 = require("./errors");
@@ -40,7 +42,7 @@ exports.inferenceStreamStartEventSchema = zod_1.z.object({
40
42
  schemaVersion: zod_1.z.literal(1),
41
43
  type: zod_1.z.literal('start'),
42
44
  requestId: identifiers_1.requestIdSchema,
43
- sequence: zod_1.z.number().int().nonnegative().safe(),
45
+ sequence: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).nonnegative().check((0, numberChecks_1.safeNumberCheck)()),
44
46
  generationId: identifiers_1.generationIdSchema.optional(),
45
47
  /** Always revision-pinned, even when the request named only the model. */
46
48
  resolvedModelReference: identifiers_1.modelReferenceSchema,
@@ -59,9 +61,9 @@ exports.inferenceStreamDeltaEventSchema = zod_1.z.object({
59
61
  schemaVersion: zod_1.z.literal(1),
60
62
  type: zod_1.z.literal('delta'),
61
63
  requestId: identifiers_1.requestIdSchema,
62
- sequence: zod_1.z.number().int().nonnegative().safe(),
64
+ sequence: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).nonnegative().check((0, numberChecks_1.safeNumberCheck)()),
63
65
  /** Which output of a multi-output response this chunk belongs to. */
64
- outputIndex: zod_1.z.number().int().nonnegative().safe(),
66
+ outputIndex: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).nonnegative().check((0, numberChecks_1.safeNumberCheck)()),
65
67
  /**
66
68
  * `output_audio_transcript` (contract set 3.2.0) carries the words of spoken
67
69
  * output requested with `audioOutput`. It is its own channel for the same
@@ -87,10 +89,14 @@ exports.inferenceStreamAudioEventSchema = zod_1.z.object({
87
89
  schemaVersion: zod_1.z.literal(1),
88
90
  type: zod_1.z.literal('audio'),
89
91
  requestId: identifiers_1.requestIdSchema,
90
- sequence: zod_1.z.number().int().nonnegative().safe(),
91
- outputIndex: zod_1.z.number().int().nonnegative().safe(),
92
+ sequence: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).nonnegative().check((0, numberChecks_1.safeNumberCheck)()),
93
+ outputIndex: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).nonnegative().check((0, numberChecks_1.safeNumberCheck)()),
92
94
  mediaType: exports.inferenceAudioMediaTypeSchema,
93
- data: zod_1.z.string().min(4).max(65536).regex(identifiers_1.PADDED_BASE64_PATTERN),
95
+ data: zod_1.z
96
+ .string()
97
+ .check((0, stringChecks_1.utf16MinLength)(4))
98
+ .check((0, stringChecks_1.utf16MaxLength)(65536))
99
+ .regex(identifiers_1.PADDED_BASE64_PATTERN),
94
100
  });
95
101
  /**
96
102
  * A tool call being streamed.
@@ -103,10 +109,10 @@ exports.inferenceStreamToolCallEventSchema = zod_1.z.object({
103
109
  schemaVersion: zod_1.z.literal(1),
104
110
  type: zod_1.z.literal('tool_call'),
105
111
  requestId: identifiers_1.requestIdSchema,
106
- sequence: zod_1.z.number().int().nonnegative().safe(),
107
- toolCallId: zod_1.z.string().min(1).max(128),
112
+ sequence: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).nonnegative().check((0, numberChecks_1.safeNumberCheck)()),
113
+ toolCallId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(128)),
108
114
  /** Present on the first event of a call. */
109
- name: zod_1.z.string().min(1).max(128).optional(),
115
+ name: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(128)).optional(),
110
116
  argumentsDelta: zod_1.z.string().optional(),
111
117
  complete: zod_1.z.boolean(),
112
118
  });
@@ -150,7 +156,7 @@ exports.inferenceStreamUsageEventSchema = zod_1.z.object({
150
156
  schemaVersion: zod_1.z.literal(2),
151
157
  type: zod_1.z.literal('usage'),
152
158
  requestId: identifiers_1.requestIdSchema,
153
- sequence: zod_1.z.number().int().nonnegative().safe(),
159
+ sequence: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).nonnegative().check((0, numberChecks_1.safeNumberCheck)()),
154
160
  /** Exact deployment whose metering produced these partial units. */
155
161
  deploymentId: identifiers_1.deploymentIdSchema,
156
162
  units: zod_1.z.array(money_1.usageQuantitySchema).min(1),
@@ -215,7 +221,7 @@ exports.inferenceStreamRouteSwitchEventSchema = zod_1.z.object({
215
221
  schemaVersion: zod_1.z.literal(1),
216
222
  type: zod_1.z.literal('route_switch'),
217
223
  requestId: identifiers_1.requestIdSchema,
218
- sequence: zod_1.z.number().int().nonnegative().safe(),
224
+ sequence: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).nonnegative().check((0, numberChecks_1.safeNumberCheck)()),
219
225
  reason: exports.inferenceRouteSwitchReasonSchema,
220
226
  detail: exports.inferenceRouteSwitchDetailSchema,
221
227
  occurredAt: identifiers_1.inferenceTimestampSchema,
@@ -229,7 +235,7 @@ exports.inferenceStreamErrorEventSchema = zod_1.z.object({
229
235
  schemaVersion: zod_1.z.literal(1),
230
236
  type: zod_1.z.literal('error'),
231
237
  requestId: identifiers_1.requestIdSchema,
232
- sequence: zod_1.z.number().int().nonnegative().safe(),
238
+ sequence: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).nonnegative().check((0, numberChecks_1.safeNumberCheck)()),
233
239
  /** Carries its own `schemaVersion`: the same body is returned non-streaming. */
234
240
  error: errors_1.inferenceErrorSchema,
235
241
  });
@@ -262,10 +268,10 @@ exports.inferenceStreamDoneEventSchema = zod_1.z.object({
262
268
  schemaVersion: zod_1.z.literal(1),
263
269
  type: zod_1.z.literal('done'),
264
270
  requestId: identifiers_1.requestIdSchema,
265
- sequence: zod_1.z.number().int().nonnegative().safe(),
271
+ sequence: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).nonnegative().check((0, numberChecks_1.safeNumberCheck)()),
266
272
  generationId: identifiers_1.generationIdSchema.optional(),
267
273
  finishReason: exports.inferenceFinishReasonSchema,
268
- receiptId: zod_1.z.string().min(1).max(128).optional(),
274
+ receiptId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(128)).optional(),
269
275
  completedAt: identifiers_1.inferenceTimestampSchema,
270
276
  });
271
277
  /**
@@ -1,4 +1,8 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.usageRefundSchema = exports.usageRefundReasonSchema = exports.usageRefundSubjectSchema = exports.usageReceiptSchema = exports.normalizedUsageReportSchema = exports.inferenceRequestOutcomeSchema = exports.usageReservationSchema = exports.usageReservationStatusSchema = exports.usageReservationRequestSchema = void 0;
4
+ const numberChecks_1 = require("../numberChecks");
5
+ const stringChecks_1 = require("../stringChecks");
2
6
  /**
3
7
  * The reserve → settle → refund protocol.
4
8
  *
@@ -29,8 +33,6 @@
29
33
  *
30
34
  * Decided in: docs/adr/0009-usage-reservation-and-settlement.md.
31
35
  */
32
- Object.defineProperty(exports, "__esModule", { value: true });
33
- exports.usageRefundSchema = exports.usageRefundReasonSchema = exports.usageRefundSubjectSchema = exports.usageReceiptSchema = exports.normalizedUsageReportSchema = exports.inferenceRequestOutcomeSchema = exports.usageReservationSchema = exports.usageReservationStatusSchema = exports.usageReservationRequestSchema = void 0;
34
36
  const zod_1 = require("zod");
35
37
  const attribution_1 = require("./attribution");
36
38
  const identifiers_1 = require("./identifiers");
@@ -57,12 +59,12 @@ exports.usageReservationRequestSchema = zod_1.z.object({
57
59
  /** Units already determined by the request itself, e.g. input tokens. */
58
60
  knownUnits: zod_1.z.array(money_1.usageQuantitySchema).default([]),
59
61
  /** The ceiling on generated output, when the request set one. */
60
- maxOutputTokens: zod_1.z.number().int().positive().safe().optional(),
62
+ maxOutputTokens: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).positive().check((0, numberChecks_1.safeNumberCheck)()).optional(),
61
63
  /** The price version of the most expensive route the policy permits. */
62
- ceilingPriceVersionId: zod_1.z.string().min(1).max(128),
64
+ ceilingPriceVersionId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(128)),
63
65
  maxAmount: money_1.exactDecimalSchema,
64
66
  currency: money_1.currencyCodeSchema,
65
- expiresInSeconds: zod_1.z.number().int().positive().max(86400),
67
+ expiresInSeconds: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).positive().max(86400),
66
68
  });
67
69
  /** Lifecycle of a hold. Terminal states are `settled`, `released`, `expired`. */
68
70
  exports.usageReservationStatusSchema = zod_1.z.enum(['held', 'settled', 'released', 'expired']);
@@ -77,17 +79,17 @@ exports.usageReservationSchema = zod_1.z
77
79
  .object({
78
80
  /** See `version.ts`: read back by the edge and the Console on its own. */
79
81
  schemaVersion: zod_1.z.literal(1),
80
- reservationId: zod_1.z.string().min(1).max(128),
82
+ reservationId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(128)),
81
83
  idempotencyKey: identifiers_1.idempotencyKeySchema,
82
84
  attribution: attribution_1.inferenceAttributionSchema,
83
85
  status: exports.usageReservationStatusSchema,
84
86
  reservedAmount: money_1.exactDecimalSchema,
85
87
  currency: money_1.currencyCodeSchema,
86
- ceilingPriceVersionId: zod_1.z.string().min(1).max(128),
88
+ ceilingPriceVersionId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(128)),
87
89
  createdAt: identifiers_1.inferenceTimestampSchema,
88
90
  expiresAt: identifiers_1.inferenceTimestampSchema,
89
91
  /** The receipt that consumed this hold. Present exactly when `settled`. */
90
- settledReceiptId: zod_1.z.string().min(1).max(128).optional(),
92
+ settledReceiptId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(128)).optional(),
91
93
  })
92
94
  .superRefine((reservation, ctx) => {
93
95
  if (reservation.status === 'settled' && reservation.settledReceiptId === undefined) {
@@ -172,7 +174,7 @@ exports.normalizedUsageReportSchema = zod_1.z
172
174
  /** Exact Kaana deployment that attempted the request; never inferred from names. */
173
175
  deploymentId: identifiers_1.deploymentIdSchema,
174
176
  /** How many allowed route switches occurred while serving this request. */
175
- routeSwitches: zod_1.z.number().int().nonnegative().max(100),
177
+ routeSwitches: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).nonnegative().max(100),
176
178
  /**
177
179
  * The funding tier of the platform key that served the final attempt, as
178
180
  * the data plane states it (ADR 0038). Absent when the key's economics
@@ -183,7 +185,12 @@ exports.normalizedUsageReportSchema = zod_1.z
183
185
  fundingTier: identifiers_1.inferenceFundingTierSchema.optional(),
184
186
  startedAt: identifiers_1.inferenceTimestampSchema,
185
187
  completedAt: identifiers_1.inferenceTimestampSchema,
186
- timeToFirstTokenMs: zod_1.z.number().int().nonnegative().safe().optional(),
188
+ timeToFirstTokenMs: zod_1.z
189
+ .number()
190
+ .check((0, numberChecks_1.integerCheck)())
191
+ .nonnegative()
192
+ .check((0, numberChecks_1.safeNumberCheck)())
193
+ .optional(),
187
194
  })
188
195
  .superRefine((report, ctx) => {
189
196
  // Compared as instants: two spellings of one moment sort differently as text.
@@ -229,9 +236,9 @@ exports.usageReceiptSchema = zod_1.z
229
236
  .object({
230
237
  /** See `version.ts`: returned to customers by `GET /v1/generations/:id`. */
231
238
  schemaVersion: zod_1.z.literal(1),
232
- receiptId: zod_1.z.string().min(1).max(128),
239
+ receiptId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(128)),
233
240
  /** The hold this settled against. Absent for a charge with no reservation. */
234
- reservationId: zod_1.z.string().min(1).max(128).optional(),
241
+ reservationId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(128)).optional(),
235
242
  idempotencyKey: identifiers_1.idempotencyKeySchema,
236
243
  attribution: attribution_1.inferenceAttributionSchema,
237
244
  outcome: exports.inferenceRequestOutcomeSchema,
@@ -273,8 +280,18 @@ exports.usageReceiptSchema = zod_1.z
273
280
  * ledger accounts and only the second one is visible on an invoice.
274
281
  */
275
282
  exports.usageRefundSubjectSchema = zod_1.z.discriminatedUnion('kind', [
276
- zod_1.z.object({ kind: zod_1.z.literal('reservation'), reservationId: zod_1.z.string().min(1).max(128) }).strict(),
277
- zod_1.z.object({ kind: zod_1.z.literal('receipt'), receiptId: zod_1.z.string().min(1).max(128) }).strict(),
283
+ zod_1.z
284
+ .object({
285
+ kind: zod_1.z.literal('reservation'),
286
+ reservationId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(128)),
287
+ })
288
+ .strict(),
289
+ zod_1.z
290
+ .object({
291
+ kind: zod_1.z.literal('receipt'),
292
+ receiptId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(128)),
293
+ })
294
+ .strict(),
278
295
  ]);
279
296
  /** Why money was given back or a hold was released. */
280
297
  exports.usageRefundReasonSchema = zod_1.z.enum([
@@ -303,7 +320,7 @@ exports.usageRefundSchema = zod_1.z
303
320
  .object({
304
321
  /** See `version.ts`: a ledger record read back on its own. */
305
322
  schemaVersion: zod_1.z.literal(1),
306
- refundId: zod_1.z.string().min(1).max(128),
323
+ refundId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(128)),
307
324
  idempotencyKey: identifiers_1.idempotencyKeySchema,
308
325
  attribution: attribution_1.inferenceAttributionSchema,
309
326
  subject: exports.usageRefundSubjectSchema,
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.backupStatusResponseSchema = exports.backupUploadRequestSchema = exports.encryptedBackupEnvelopeSchema = exports.backupLookupIdSchema = void 0;
4
+ const numberChecks_1 = require("./numberChecks");
5
+ const stringChecks_1 = require("./stringChecks");
4
6
  /**
5
7
  * Encrypted off-device identity backup contract (b3 Feature 1).
6
8
  *
@@ -57,13 +59,13 @@ exports.backupLookupIdSchema = zod_1.z
57
59
  * - `createdAt` — ISO-8601 creation timestamp.
58
60
  */
59
61
  exports.encryptedBackupEnvelopeSchema = zod_1.z.object({
60
- version: zod_1.z.number().int().positive(),
62
+ version: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).positive(),
61
63
  algorithm: zod_1.z.literal('xchacha20poly1305'),
62
- kdfInfo: zod_1.z.string().min(1),
63
- nonce: zod_1.z.string().trim().min(1),
64
- ciphertext: zod_1.z.string().trim().min(1),
65
- publicKeyHint: zod_1.z.string().trim().min(1),
66
- createdAt: zod_1.z.string().trim().min(1),
64
+ kdfInfo: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)),
65
+ nonce: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)),
66
+ ciphertext: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)),
67
+ publicKeyHint: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)),
68
+ createdAt: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)),
67
69
  });
68
70
  /**
69
71
  * Request body of `POST /identity/backup` — the envelope PLUS the raw
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.rotateKeyCompleteResponseSchema = exports.rotateKeyCompleteRequestSchema = exports.rotateKeyChallengeResponseSchema = void 0;
4
+ const stringChecks_1 = require("./stringChecks");
4
5
  /**
5
6
  * Key-rotation contract (b3 Feature 3 — key rotation + last-credential replacement).
6
7
  *
@@ -54,11 +55,11 @@ exports.rotateKeyChallengeResponseSchema = zod_1.z.object({
54
55
  * key Y.
55
56
  */
56
57
  exports.rotateKeyCompleteRequestSchema = zod_1.z.object({
57
- newPublicKey: zod_1.z.string().trim().min(1),
58
- challenge: zod_1.z.string().trim().min(1),
59
- signature: zod_1.z.string().trim().min(1),
58
+ newPublicKey: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)),
59
+ challenge: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)),
60
+ signature: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)),
60
61
  /** Proof-of-possession: the NEW key signs the rotate_key_new payload. */
61
- newKeyProof: zod_1.z.string().trim().min(1),
62
+ newKeyProof: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)),
62
63
  timestamp: zod_1.z.number(),
63
64
  /**
64
65
  * When true, all OTHER active sessions for the account are revoked after a
@@ -1,4 +1,7 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.linkedAccountStartErrorDetailsSchema = exports.linkedAccountStartErrorReasonSchema = exports.LINKED_ACCOUNT_START_ERROR_REASONS = exports.LINKED_ACCOUNT_CALLBACK_ERRORS = exports.serviceLinkedAccountListResponseSchema = exports.serviceLinkedAccountSchema = exports.linkedAccountListResponseSchema = exports.completeLinkedAccountResponseSchema = exports.linkedAccountSchema = exports.completeLinkedAccountRequestSchema = exports.startLinkedAccountResponseSchema = exports.startLinkedAccountRequestSchema = exports.linkedAccountNetworkSchema = exports.LINKED_ACCOUNT_NETWORKS = void 0;
4
+ const stringChecks_1 = require("./stringChecks");
2
5
  /**
3
6
  * Wire contract for Oxy linked accounts — external accounts (any Mastodon-API
4
7
  * server, Bluesky) a LOCAL Oxy user has proven they own by completing an OAuth
@@ -10,8 +13,6 @@
10
13
  *
11
14
  * Platform-agnostic — zod only, no react/react-native/expo.
12
15
  */
13
- Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.linkedAccountStartErrorDetailsSchema = exports.linkedAccountStartErrorReasonSchema = exports.LINKED_ACCOUNT_START_ERROR_REASONS = exports.LINKED_ACCOUNT_CALLBACK_ERRORS = exports.serviceLinkedAccountListResponseSchema = exports.serviceLinkedAccountSchema = exports.linkedAccountListResponseSchema = exports.completeLinkedAccountResponseSchema = exports.linkedAccountSchema = exports.completeLinkedAccountRequestSchema = exports.startLinkedAccountResponseSchema = exports.startLinkedAccountRequestSchema = exports.linkedAccountNetworkSchema = exports.LINKED_ACCOUNT_NETWORKS = void 0;
15
16
  const zod_1 = require("zod");
16
17
  exports.LINKED_ACCOUNT_NETWORKS = ['activitypub', 'atproto'];
17
18
  exports.linkedAccountNetworkSchema = zod_1.z.enum(exports.LINKED_ACCOUNT_NETWORKS);
@@ -27,16 +28,16 @@ exports.linkedAccountNetworkSchema = zod_1.z.enum(exports.LINKED_ACCOUNT_NETWORK
27
28
  */
28
29
  exports.startLinkedAccountRequestSchema = zod_1.z
29
30
  .object({
30
- instance: zod_1.z.string().trim().min(1).max(320).optional(),
31
- handle: zod_1.z.string().trim().min(1).max(320).optional(),
32
- clientId: zod_1.z.string().trim().min(1).max(256),
33
- returnTo: zod_1.z.string().trim().min(1).max(2048),
31
+ instance: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(320)).optional(),
32
+ handle: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(320)).optional(),
33
+ clientId: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(256)),
34
+ returnTo: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(2048)),
34
35
  })
35
36
  .strict();
36
37
  exports.startLinkedAccountResponseSchema = zod_1.z
37
38
  .object({
38
- authorizeUrl: zod_1.z.string().url(),
39
- expiresAt: zod_1.z.string().datetime(),
39
+ authorizeUrl: zod_1.z.string().check((0, stringChecks_1.urlCheck)()),
40
+ expiresAt: zod_1.z.string().check((0, stringChecks_1.isoDateTime)()),
40
41
  })
41
42
  .strict();
42
43
  /**
@@ -46,22 +47,22 @@ exports.startLinkedAccountResponseSchema = zod_1.z
46
47
  * other user it is refused (403) and burned.
47
48
  */
48
49
  exports.completeLinkedAccountRequestSchema = zod_1.z
49
- .object({ code: zod_1.z.string().trim().min(1).max(256) })
50
+ .object({ code: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(256)) })
50
51
  .strict();
51
52
  /** One live linked account, as its owner sees it. */
52
53
  exports.linkedAccountSchema = zod_1.z
53
54
  .object({
54
- id: zod_1.z.string().min(1),
55
+ id: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)),
55
56
  network: exports.linkedAccountNetworkSchema,
56
57
  /** `username@domain` for ActivityPub; the DID for atproto. */
57
- accountKey: zod_1.z.string().min(1),
58
+ accountKey: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)),
58
59
  /** ActivityPub actor id, or the DID for atproto. */
59
- actorUri: zod_1.z.string().min(1),
60
- handle: zod_1.z.string().min(1),
61
- host: zod_1.z.string().min(1),
60
+ actorUri: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)),
61
+ handle: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)),
62
+ host: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)),
62
63
  proofMethod: zod_1.z.literal('oauth'),
63
- verifiedAt: zod_1.z.string().datetime(),
64
- createdAt: zod_1.z.string().datetime(),
64
+ verifiedAt: zod_1.z.string().check((0, stringChecks_1.isoDateTime)()),
65
+ createdAt: zod_1.z.string().check((0, stringChecks_1.isoDateTime)()),
65
66
  })
66
67
  .strict();
67
68
  exports.completeLinkedAccountResponseSchema = zod_1.z
@@ -77,10 +78,13 @@ exports.linkedAccountListResponseSchema = zod_1.z
77
78
  * content Oxy federated in before the account was linked.
78
79
  */
79
80
  exports.serviceLinkedAccountSchema = exports.linkedAccountSchema
80
- .extend({ federatedUserId: zod_1.z.string().min(1).nullable() })
81
+ .extend({ federatedUserId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).nullable() })
81
82
  .strict();
82
83
  exports.serviceLinkedAccountListResponseSchema = zod_1.z
83
- .object({ userId: zod_1.z.string().min(1), linkedAccounts: zod_1.z.array(exports.serviceLinkedAccountSchema) })
84
+ .object({
85
+ userId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)),
86
+ linkedAccounts: zod_1.z.array(exports.serviceLinkedAccountSchema),
87
+ })
84
88
  .strict();
85
89
  /**
86
90
  * Error codes the callback appends as `?link_error=<code>` to `returnTo`. An
@@ -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
+ }