@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
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();
@@ -1,13 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.productPlanCatalogueSchema = exports.personalPlanCatalogueSchema = exports.personalPlanDisplayPriceSchema = void 0;
4
+ const numberChecks_1 = require("../numberChecks");
5
+ const stringChecks_1 = require("../stringChecks");
4
6
  const zod_1 = require("zod");
5
7
  const access_1 = require("./access");
6
8
  /** Approved display terms never identify or activate a billing-provider price. */
7
9
  exports.personalPlanDisplayPriceSchema = zod_1.z
8
10
  .object({
9
11
  currency: zod_1.z.string().regex(/^[A-Z]{3}$/),
10
- amountMinorUnits: zod_1.z.number().int().positive().safe(),
12
+ amountMinorUnits: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).positive().check((0, numberChecks_1.safeNumberCheck)()),
11
13
  interval: zod_1.z.literal('month'),
12
14
  trial: zod_1.z.literal('none'),
13
15
  taxTreatment: zod_1.z.literal('inclusive'),
@@ -22,14 +24,17 @@ exports.personalPlanCatalogueSchema = zod_1.z
22
24
  purchase: zod_1.z.enum(['unavailable', 'available']),
23
25
  plans: zod_1.z.array(zod_1.z
24
26
  .object({
25
- offerId: zod_1.z.string().min(1).max(160),
26
- offerVersion: zod_1.z.number().int().positive().safe(),
27
- displayName: zod_1.z.string().min(1).max(100),
27
+ offerId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(160)),
28
+ offerVersion: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).positive().check((0, numberChecks_1.safeNumberCheck)()),
29
+ displayName: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(100)),
28
30
  audience: zod_1.z.literal('personal'),
29
31
  kind: zod_1.z.literal('oxy_one'),
30
32
  price: exports.personalPlanDisplayPriceSchema.optional(),
31
33
  benefits: zod_1.z.array(zod_1.z
32
- .object({ displayName: zod_1.z.string().min(1).max(100), benefit: access_1.productBenefitSchema })
34
+ .object({
35
+ displayName: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(100)),
36
+ benefit: access_1.productBenefitSchema,
37
+ })
33
38
  .strict()),
34
39
  })
35
40
  .strict()),
@@ -39,14 +44,14 @@ exports.personalPlanCatalogueSchema = zod_1.z
39
44
  exports.productPlanCatalogueSchema = zod_1.z
40
45
  .object({
41
46
  schemaVersion: zod_1.z.literal(1),
42
- productId: zod_1.z.string().min(1).max(160),
47
+ productId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(160)),
43
48
  purchase: zod_1.z.enum(['unavailable', 'available']),
44
49
  plans: zod_1.z.array(zod_1.z
45
50
  .object({
46
- productId: zod_1.z.string().min(1).max(160),
47
- offerId: zod_1.z.string().min(1).max(160),
48
- offerVersion: zod_1.z.number().int().positive().safe(),
49
- displayName: zod_1.z.string().min(1).max(100),
51
+ productId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(160)),
52
+ offerId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(160)),
53
+ offerVersion: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).positive().check((0, numberChecks_1.safeNumberCheck)()),
54
+ displayName: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(100)),
50
55
  price: exports.personalPlanDisplayPriceSchema.extend({ interval: zod_1.z.enum(['month', 'year']) }),
51
56
  })
52
57
  .strict()),
@@ -1,4 +1,7 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.logPageResponseSchema = exports.chainHeadResponseSchema = void 0;
4
+ const numberChecks_1 = require("./numberChecks");
2
5
  /**
3
6
  * Generic "Oxy Protocol" record surface — the app-agnostic conventions every app
4
7
  * follows to decentralize its own content on the shared signed-record substrate.
@@ -38,16 +41,14 @@
38
41
  *
39
42
  * Platform-agnostic — zod only, no react/react-native/expo, ESM-safe.
40
43
  */
41
- Object.defineProperty(exports, "__esModule", { value: true });
42
- exports.logPageResponseSchema = exports.chainHeadResponseSchema = void 0;
43
44
  const zod_1 = require("zod");
44
45
  const identity_1 = require("./identity");
45
46
  exports.chainHeadResponseSchema = zod_1.z.object({
46
47
  headRecordId: zod_1.z.string().nullable(),
47
- seq: zod_1.z.number().int(),
48
- recordCount: zod_1.z.number().int().nonnegative(),
48
+ seq: zod_1.z.number().check((0, numberChecks_1.integerCheck)()),
49
+ recordCount: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).nonnegative(),
49
50
  });
50
51
  exports.logPageResponseSchema = zod_1.z.object({
51
52
  records: zod_1.z.array(identity_1.signedRecordEnvelopeSchema),
52
- count: zod_1.z.number().int().nonnegative(),
53
+ count: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).nonnegative(),
53
54
  });
@@ -1,4 +1,8 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.appAffinityEventsIngestSchema = exports.appAffinityEventSchema = exports.appAffinityEventTypeSchema = exports.appUserSignalIngestSchema = exports.appInterestInputSchema = exports.appEndorsementInputSchema = exports.recommendationResponseSchema = exports.recommendationItemSchema = exports.recommendationCountSchema = exports.recommendationRequestSchema = exports.recommendationSignalWeightsSchema = exports.recommendationBoostSchema = exports.recommendationExcludeTypeSchema = void 0;
4
+ const numberChecks_1 = require("./numberChecks");
5
+ const stringChecks_1 = require("./stringChecks");
2
6
  /**
3
7
  * Recommendation-engine API contracts.
4
8
  *
@@ -11,8 +15,6 @@
11
15
  * Platform-agnostic — zod is the only runtime dependency (no react / react-native
12
16
  * / expo, ESM-safe).
13
17
  */
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.appAffinityEventsIngestSchema = exports.appAffinityEventSchema = exports.appAffinityEventTypeSchema = exports.appUserSignalIngestSchema = exports.appInterestInputSchema = exports.appEndorsementInputSchema = exports.recommendationResponseSchema = exports.recommendationItemSchema = exports.recommendationCountSchema = exports.recommendationRequestSchema = exports.recommendationSignalWeightsSchema = exports.recommendationBoostSchema = exports.recommendationExcludeTypeSchema = void 0;
16
18
  const zod_1 = require("zod");
17
19
  const avatarCharacter_1 = require("./avatarCharacter");
18
20
  const userResponse_1 = require("./userResponse");
@@ -25,9 +27,12 @@ exports.recommendationExcludeTypeSchema = zod_1.z.enum(['federated', 'agent', 'a
25
27
  * gate — a boost cannot resurrect a private/restricted/ineligible account.
26
28
  */
27
29
  exports.recommendationBoostSchema = zod_1.z.object({
28
- userIds: zod_1.z.array(zod_1.z.string().trim().min(1)).min(1).max(200),
30
+ userIds: zod_1.z
31
+ .array(zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)))
32
+ .min(1)
33
+ .max(200),
29
34
  weight: zod_1.z.number().min(-5).max(5),
30
- reason: zod_1.z.string().trim().max(120).optional(),
35
+ reason: zod_1.z.string().trim().check((0, stringChecks_1.utf16MaxLength)(120)).optional(),
31
36
  });
32
37
  /**
33
38
  * Per-request overrides for the scoring signal weights. Every key is optional
@@ -55,18 +60,21 @@ exports.recommendationSignalWeightsSchema = zod_1.z
55
60
  * ranking within server-enforced bounds.
56
61
  */
57
62
  exports.recommendationRequestSchema = zod_1.z.object({
58
- clientId: zod_1.z.string().trim().min(1).optional(),
59
- limit: zod_1.z.number().int().min(1).max(100).optional(),
60
- offset: zod_1.z.number().int().min(0).optional(),
63
+ clientId: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)).optional(),
64
+ limit: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).min(1).max(100).optional(),
65
+ offset: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).min(0).optional(),
61
66
  excludeTypes: zod_1.z.array(exports.recommendationExcludeTypeSchema).optional(),
62
- excludeIds: zod_1.z.array(zod_1.z.string().trim().min(1)).max(500).optional(),
67
+ excludeIds: zod_1.z
68
+ .array(zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)))
69
+ .max(500)
70
+ .optional(),
63
71
  boosts: zod_1.z.array(exports.recommendationBoostSchema).max(50).optional(),
64
72
  signalWeights: exports.recommendationSignalWeightsSchema.optional(),
65
73
  });
66
74
  /** Follower/following counts attached to a recommendation item. */
67
75
  exports.recommendationCountSchema = zod_1.z.object({
68
- followers: zod_1.z.number().int().nonnegative(),
69
- following: zod_1.z.number().int().nonnegative(),
76
+ followers: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).nonnegative(),
77
+ following: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).nonnegative(),
70
78
  });
71
79
  /**
72
80
  * A single recommended profile.
@@ -88,7 +96,7 @@ exports.recommendationItemSchema = zod_1.z
88
96
  description: zod_1.z.string().nullable().optional(),
89
97
  verified: zod_1.z.boolean().optional(),
90
98
  trustTier: zod_1.z.string().optional(),
91
- mutualCount: zod_1.z.number().int().nonnegative(),
99
+ mutualCount: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).nonnegative(),
92
100
  score: zod_1.z.number().optional(),
93
101
  matchedSignals: zod_1.z.array(zod_1.z.string()).optional(),
94
102
  isFederated: zod_1.z.boolean().optional(),
@@ -102,14 +110,14 @@ exports.recommendationItemSchema = zod_1.z
102
110
  exports.recommendationResponseSchema = zod_1.z.array(exports.recommendationItemSchema);
103
111
  /** One endorsement edge an app reports: `ownerId` endorses `memberId`. */
104
112
  exports.appEndorsementInputSchema = zod_1.z.object({
105
- ownerId: zod_1.z.string().trim().min(1),
106
- memberId: zod_1.z.string().trim().min(1),
113
+ ownerId: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)),
114
+ memberId: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)),
107
115
  op: zod_1.z.enum(['add', 'remove']).default('add'),
108
- sourceId: zod_1.z.string().trim().min(1).optional(),
116
+ sourceId: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)).optional(),
109
117
  });
110
118
  /** One interest signal an app reports: how interested `userId` is in a topic. */
111
119
  exports.appInterestInputSchema = zod_1.z.object({
112
- userId: zod_1.z.string().trim().min(1),
120
+ userId: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)),
113
121
  interestScore: zod_1.z.number().min(0).max(1),
114
122
  });
115
123
  /**
@@ -153,12 +161,12 @@ exports.appAffinityEventTypeSchema = zod_1.z.enum([
153
161
  * same application is folded at most once (bounded dedup window).
154
162
  */
155
163
  exports.appAffinityEventSchema = zod_1.z.object({
156
- fromUserId: zod_1.z.string().trim().min(1),
157
- toUserId: zod_1.z.string().trim().min(1),
164
+ fromUserId: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)),
165
+ toUserId: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)),
158
166
  type: exports.appAffinityEventTypeSchema,
159
167
  weight: zod_1.z.number().min(0).max(100).optional(),
160
- occurredAt: zod_1.z.string().datetime().optional(),
161
- eventId: zod_1.z.string().trim().min(1).max(200).optional(),
168
+ occurredAt: zod_1.z.string().check((0, stringChecks_1.isoDateTime)()).optional(),
169
+ eventId: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(200)).optional(),
162
170
  });
163
171
  /**
164
172
  * Request body for `POST /app-signals/events` (service token, `signals:write`).
@@ -1,4 +1,8 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.awardReputationSchema = exports.reputationInfluenceResultSchema = exports.reputationLeaderboardEntrySchema = exports.reputationLeaderboardUserSchema = exports.reputationRulesResponseSchema = exports.reputationRuleSchema = exports.reputationBalanceSchema = exports.reputationBalanceSummarySchema = exports.reputationReliabilitySchema = exports.reputationInfluenceSchema = exports.reputationBalanceBreakdownSchema = exports.reputationTransactionSchema = exports.reputationInfluenceContextSchema = exports.REPUTATION_INFLUENCE_CONTEXTS = exports.reputationTargetEntityTypeSchema = exports.REPUTATION_TARGET_ENTITY_TYPES = exports.trustTierSchema = exports.TRUST_TIERS = exports.reputationTransactionStatusSchema = exports.REPUTATION_TRANSACTION_STATUSES = exports.reputationCategorySchema = exports.REPUTATION_CATEGORIES = exports.isFullReputationBalance = void 0;
4
+ const numberChecks_1 = require("./numberChecks");
5
+ const stringChecks_1 = require("./stringChecks");
2
6
  /**
3
7
  * Oxy Trust — reputation API contracts.
4
8
  *
@@ -39,8 +43,6 @@
39
43
  * Platform-agnostic — zod only, no react/react-native/expo. ESM-safe (no
40
44
  * `require()`).
41
45
  */
42
- Object.defineProperty(exports, "__esModule", { value: true });
43
- exports.awardReputationSchema = exports.reputationInfluenceResultSchema = exports.reputationLeaderboardEntrySchema = exports.reputationLeaderboardUserSchema = exports.reputationRulesResponseSchema = exports.reputationRuleSchema = exports.reputationBalanceSchema = exports.reputationBalanceSummarySchema = exports.reputationReliabilitySchema = exports.reputationInfluenceSchema = exports.reputationBalanceBreakdownSchema = exports.reputationTransactionSchema = exports.reputationInfluenceContextSchema = exports.REPUTATION_INFLUENCE_CONTEXTS = exports.reputationTargetEntityTypeSchema = exports.REPUTATION_TARGET_ENTITY_TYPES = exports.trustTierSchema = exports.TRUST_TIERS = exports.reputationTransactionStatusSchema = exports.REPUTATION_TRANSACTION_STATUSES = exports.reputationCategorySchema = exports.REPUTATION_CATEGORIES = exports.isFullReputationBalance = void 0;
44
46
  const zod_1 = require("zod");
45
47
  const userResponse_1 = require("./userResponse");
46
48
  const moderationReputation_1 = require("./moderationReputation");
@@ -125,7 +127,7 @@ exports.reputationTransactionSchema = zod_1.z.object({
125
127
  status: exports.reputationTransactionStatusSchema,
126
128
  reversedTransactionId: zod_1.z.string().optional(),
127
129
  reason: zod_1.z.string().optional(),
128
- metadata: zod_1.z.record(zod_1.z.unknown()).optional(),
130
+ metadata: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).optional(),
129
131
  createdByUserId: zod_1.z.string().optional(),
130
132
  reviewedByUserId: zod_1.z.string().optional(),
131
133
  reviewedAt: zod_1.z.string().optional(),
@@ -183,7 +185,7 @@ exports.reputationRuleSchema = zod_1.z.object({
183
185
  cooldownInMinutes: zod_1.z.number(),
184
186
  });
185
187
  exports.reputationRulesResponseSchema = zod_1.z.object({
186
- version: zod_1.z.number().int(),
188
+ version: zod_1.z.number().check((0, numberChecks_1.integerCheck)()),
187
189
  rules: zod_1.z.array(exports.reputationRuleSchema),
188
190
  });
189
191
  exports.reputationLeaderboardUserSchema = zod_1.z.object({
@@ -205,14 +207,14 @@ exports.reputationInfluenceResultSchema = zod_1.z.object({
205
207
  influence: exports.reputationInfluenceSchema,
206
208
  });
207
209
  exports.awardReputationSchema = zod_1.z.object({
208
- userId: zod_1.z.string().trim().min(1),
209
- actionType: zod_1.z.string().trim().min(1),
210
- applicationId: zod_1.z.string().trim().min(1).optional(),
211
- credentialId: zod_1.z.string().trim().min(1).optional(),
212
- sourceActionId: zod_1.z.string().trim().min(1).optional(),
213
- sourceActionType: zod_1.z.string().trim().min(1).optional(),
214
- targetEntityId: zod_1.z.string().trim().min(1).optional(),
210
+ userId: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)),
211
+ actionType: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)),
212
+ applicationId: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)).optional(),
213
+ credentialId: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)).optional(),
214
+ sourceActionId: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)).optional(),
215
+ sourceActionType: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)).optional(),
216
+ targetEntityId: zod_1.z.string().trim().check((0, stringChecks_1.utf16MinLength)(1)).optional(),
215
217
  targetEntityType: exports.reputationTargetEntityTypeSchema.optional(),
216
- reason: zod_1.z.string().trim().max(500).optional(),
217
- metadata: zod_1.z.record(zod_1.z.unknown()).optional(),
218
+ reason: zod_1.z.string().trim().check((0, stringChecks_1.utf16MaxLength)(500)).optional(),
219
+ metadata: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).optional(),
218
220
  });