@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.
- package/dist/cjs/accountAccess.js +6 -5
- package/dist/cjs/accountEmail.js +13 -5
- package/dist/cjs/accountGraph.js +10 -9
- package/dist/cjs/accountName.js +3 -2
- package/dist/cjs/agency.js +91 -34
- package/dist/cjs/agentKeys.js +21 -17
- package/dist/cjs/appAssertions.js +14 -13
- package/dist/cjs/applicationRoles.js +19 -12
- package/dist/cjs/campaignAttribution.js +28 -0
- package/dist/cjs/civic.js +10 -9
- package/dist/cjs/client/campaignAttribution.js +14 -0
- package/dist/cjs/client/check.js +61 -53
- package/dist/cjs/client/index.js +7 -1
- package/dist/cjs/client/language.js +7 -0
- package/dist/cjs/consoleOnboarding.js +9 -4
- package/dist/cjs/contentClaims.js +23 -14
- package/dist/cjs/deviceDirectory.js +11 -9
- package/dist/cjs/deviceSession.js +27 -25
- package/dist/cjs/email/messages.js +20 -18
- package/dist/cjs/emailAgentContext.js +11 -9
- package/dist/cjs/externalIdentity.js +15 -11
- package/dist/cjs/federationInstanceFetch.js +12 -7
- package/dist/cjs/identity.js +19 -17
- package/dist/cjs/identityLink.js +6 -4
- package/dist/cjs/identityProof.js +6 -4
- package/dist/cjs/inboxPush.js +5 -4
- package/dist/cjs/index.js +17 -6
- package/dist/cjs/inference/accountBilling.js +35 -33
- package/dist/cjs/inference/aliaModelRelease.js +9 -7
- package/dist/cjs/inference/attribution.js +14 -12
- package/dist/cjs/inference/catalogue.js +35 -29
- package/dist/cjs/inference/economics.js +24 -19
- package/dist/cjs/inference/embeddings.js +9 -7
- package/dist/cjs/inference/entitlement.js +17 -15
- package/dist/cjs/inference/errors.js +15 -8
- package/dist/cjs/inference/identifiers.js +33 -21
- package/dist/cjs/inference/inbox.js +37 -35
- package/dist/cjs/inference/modelDocumentation.js +16 -14
- package/dist/cjs/inference/money.js +5 -4
- package/dist/cjs/inference/priceVersion.js +10 -5
- package/dist/cjs/inference/providerConnection.js +21 -14
- package/dist/cjs/inference/realtime.js +88 -47
- package/dist/cjs/inference/request.js +27 -25
- package/dist/cjs/inference/routingPolicy.js +12 -10
- package/dist/cjs/inference/streamEvents.js +22 -16
- package/dist/cjs/inference/usage.js +32 -15
- package/dist/cjs/keyRecovery.js +8 -6
- package/dist/cjs/keyRotation.js +5 -4
- package/dist/cjs/linkedAccounts.js +22 -18
- package/dist/cjs/moderationReputation.js +29 -27
- package/dist/cjs/notifications.js +25 -9
- package/dist/cjs/numberChecks.js +45 -0
- package/dist/cjs/oauth.js +14 -12
- package/dist/cjs/organizations.js +23 -21
- package/dist/cjs/products/access.js +10 -8
- package/dist/cjs/products/billing.js +10 -8
- package/dist/cjs/products/checkout.js +22 -10
- package/dist/cjs/products/plans.js +15 -10
- package/dist/cjs/protocol.js +6 -5
- package/dist/cjs/recommendations.js +27 -19
- package/dist/cjs/reputation.js +15 -13
- package/dist/cjs/safety.js +43 -27
- package/dist/cjs/serviceToken.js +81 -2
- package/dist/cjs/sessionRevocation.js +8 -6
- package/dist/cjs/signIn.js +50 -24
- package/dist/cjs/stickers.js +19 -15
- package/dist/cjs/stringChecks.js +70 -0
- package/dist/cjs/transparency.js +14 -12
- package/dist/cjs/updates.js +24 -22
- package/dist/cjs/userInvalidation.js +7 -5
- package/dist/cjs/userResponse.js +8 -7
- package/dist/cjs/username.js +7 -6
- package/dist/esm/accountAccess.js +4 -3
- package/dist/esm/accountEmail.js +13 -5
- package/dist/esm/accountGraph.js +8 -7
- package/dist/esm/accountName.js +3 -2
- package/dist/esm/agency.js +90 -33
- package/dist/esm/agentKeys.js +21 -17
- package/dist/esm/appAssertions.js +11 -10
- package/dist/esm/applicationRoles.js +16 -9
- package/dist/esm/campaignAttribution.js +25 -0
- package/dist/esm/civic.js +8 -7
- package/dist/esm/client/campaignAttribution.js +10 -0
- package/dist/esm/client/check.js +61 -53
- package/dist/esm/client/index.js +2 -0
- package/dist/esm/client/language.js +4 -0
- package/dist/esm/consoleOnboarding.js +7 -2
- package/dist/esm/contentClaims.js +23 -14
- package/dist/esm/deviceDirectory.js +11 -9
- package/dist/esm/deviceSession.js +27 -25
- package/dist/esm/email/messages.js +18 -16
- package/dist/esm/emailAgentContext.js +11 -9
- package/dist/esm/externalIdentity.js +15 -11
- package/dist/esm/federationInstanceFetch.js +10 -5
- package/dist/esm/identity.js +17 -15
- package/dist/esm/identityLink.js +6 -4
- package/dist/esm/identityProof.js +6 -4
- package/dist/esm/inboxPush.js +3 -2
- package/dist/esm/index.js +5 -2
- package/dist/esm/inference/accountBilling.js +33 -31
- package/dist/esm/inference/aliaModelRelease.js +7 -5
- package/dist/esm/inference/attribution.js +14 -12
- package/dist/esm/inference/catalogue.js +33 -27
- package/dist/esm/inference/economics.js +22 -17
- package/dist/esm/inference/embeddings.js +9 -7
- package/dist/esm/inference/entitlement.js +15 -13
- package/dist/esm/inference/errors.js +13 -6
- package/dist/esm/inference/identifiers.js +31 -19
- package/dist/esm/inference/inbox.js +37 -35
- package/dist/esm/inference/modelDocumentation.js +14 -12
- package/dist/esm/inference/money.js +3 -2
- package/dist/esm/inference/priceVersion.js +8 -3
- package/dist/esm/inference/providerConnection.js +19 -12
- package/dist/esm/inference/realtime.js +85 -44
- package/dist/esm/inference/request.js +25 -23
- package/dist/esm/inference/routingPolicy.js +9 -7
- package/dist/esm/inference/streamEvents.js +20 -14
- package/dist/esm/inference/usage.js +30 -13
- package/dist/esm/keyRecovery.js +8 -6
- package/dist/esm/keyRotation.js +5 -4
- package/dist/esm/linkedAccounts.js +20 -16
- package/dist/esm/moderationReputation.js +27 -25
- package/dist/esm/notifications.js +23 -7
- package/dist/esm/numberChecks.js +41 -0
- package/dist/esm/oauth.js +14 -12
- package/dist/esm/organizations.js +23 -21
- package/dist/esm/products/access.js +10 -8
- package/dist/esm/products/billing.js +10 -8
- package/dist/esm/products/checkout.js +22 -10
- package/dist/esm/products/plans.js +15 -10
- package/dist/esm/protocol.js +4 -3
- package/dist/esm/recommendations.js +25 -17
- package/dist/esm/reputation.js +13 -11
- package/dist/esm/safety.js +43 -27
- package/dist/esm/serviceToken.js +80 -1
- package/dist/esm/sessionRevocation.js +6 -4
- package/dist/esm/signIn.js +50 -24
- package/dist/esm/stickers.js +17 -13
- package/dist/esm/stringChecks.js +63 -0
- package/dist/esm/transparency.js +14 -12
- package/dist/esm/updates.js +22 -20
- package/dist/esm/userInvalidation.js +4 -2
- package/dist/esm/userResponse.js +4 -3
- package/dist/esm/username.js +3 -2
- package/dist/types/accountAccess.d.ts +29 -70
- package/dist/types/accountEmail.d.ts +2 -14
- package/dist/types/accountGraph.d.ts +179 -171
- package/dist/types/accountName.d.ts +1 -1
- package/dist/types/accountSubject.d.ts +20 -93
- package/dist/types/agency.d.ts +528 -2924
- package/dist/types/agentKeys.d.ts +48 -421
- package/dist/types/appAssertions.d.ts +56 -210
- package/dist/types/applicationRoles.d.ts +30 -276
- package/dist/types/avatarCharacter.d.ts +1 -1
- package/dist/types/campaignAttribution.d.ts +10 -0
- package/dist/types/civic.d.ts +1 -13
- package/dist/types/client/agentKeys.d.ts +18 -18
- package/dist/types/client/appAssertions.d.ts +3 -3
- package/dist/types/client/campaignAttribution.d.ts +12 -0
- package/dist/types/client/check.d.ts +13 -13
- package/dist/types/client/deviceDirectory.d.ts +51 -51
- package/dist/types/client/deviceSession.d.ts +14 -14
- package/dist/types/client/index.d.ts +3 -0
- package/dist/types/client/language.d.ts +2 -0
- package/dist/types/client/organizations.d.ts +25 -25
- package/dist/types/client/products.d.ts +33 -33
- package/dist/types/client/recommendations.d.ts +2 -2
- package/dist/types/client/safety.d.ts +45 -45
- package/dist/types/client/sessionStatus.d.ts +4 -4
- package/dist/types/client/signIn.d.ts +1 -1
- package/dist/types/commonsSignIn.d.ts +4 -1
- package/dist/types/consoleOnboarding.d.ts +24 -44
- package/dist/types/contentClaims.d.ts +24 -180
- package/dist/types/deviceDirectory.d.ts +109 -1040
- package/dist/types/deviceSession.d.ts +36 -298
- package/dist/types/email/messages.d.ts +212 -1793
- package/dist/types/emailAgentContext.d.ts +10 -194
- package/dist/types/externalIdentity.d.ts +121 -615
- package/dist/types/federationInstanceFetch.d.ts +3 -32
- package/dist/types/identity.d.ts +15 -92
- package/dist/types/identityLink.d.ts +6 -84
- package/dist/types/identityProof.d.ts +5 -17
- package/dist/types/inboxPush.d.ts +1 -9
- package/dist/types/index.d.ts +7 -3
- package/dist/types/inference/accountBilling.d.ts +151 -488
- package/dist/types/inference/aliaModelRelease.d.ts +42 -439
- package/dist/types/inference/attribution.d.ts +75 -104
- package/dist/types/inference/catalogue.d.ts +417 -1599
- package/dist/types/inference/economics.d.ts +69 -276
- package/dist/types/inference/embeddings.d.ts +110 -406
- package/dist/types/inference/entitlement.d.ts +80 -335
- package/dist/types/inference/errors.d.ts +90 -102
- package/dist/types/inference/identifiers.d.ts +12 -4
- package/dist/types/inference/inbox.d.ts +105 -420
- package/dist/types/inference/modelDocumentation.d.ts +201 -1390
- package/dist/types/inference/money.d.ts +65 -32
- package/dist/types/inference/priceVersion.d.ts +53 -120
- package/dist/types/inference/providerConnection.d.ts +253 -710
- package/dist/types/inference/realtime.d.ts +954 -6825
- package/dist/types/inference/request.d.ts +300 -2572
- package/dist/types/inference/routingPolicy.d.ts +95 -503
- package/dist/types/inference/streamEvents.d.ts +253 -721
- package/dist/types/inference/usage.d.ts +317 -950
- package/dist/types/keyRecovery.d.ts +3 -51
- package/dist/types/keyRotation.d.ts +3 -38
- package/dist/types/linkedAccounts.d.ts +50 -236
- package/dist/types/moderationReputation.d.ts +81 -14
- package/dist/types/notifications.d.ts +19 -51
- package/dist/types/numberChecks.d.ts +9 -0
- package/dist/types/oauth.d.ts +101 -809
- package/dist/types/organizations.d.ts +268 -921
- package/dist/types/oxyRecordTypes.d.ts +11 -1
- package/dist/types/products/access.d.ts +125 -775
- package/dist/types/products/billing.d.ts +67 -503
- package/dist/types/products/checkout.d.ts +16 -69
- package/dist/types/products/plans.d.ts +33 -366
- package/dist/types/recommendations.d.ts +76 -389
- package/dist/types/reputation.d.ts +37 -5
- package/dist/types/safety.d.ts +408 -2048
- package/dist/types/serviceToken.d.ts +247 -7
- package/dist/types/sessionRevocation.d.ts +2 -17
- package/dist/types/sessionStatus.d.ts +27 -115
- package/dist/types/signIn.d.ts +62 -553
- package/dist/types/stickers.d.ts +67 -819
- package/dist/types/stringChecks.d.ts +16 -0
- package/dist/types/transparency.d.ts +14 -302
- package/dist/types/updates.d.ts +60 -316
- package/dist/types/userInvalidation.d.ts +4 -13
- package/dist/types/userResponse.d.ts +302 -2400
- package/dist/types/username.d.ts +3 -3
- package/package.json +6 -4
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.modelCatalogueEntrySchema = exports.catalogueServingProviderSummarySchema = exports.cataloguePublisherSummarySchema = exports.routingProfileSchema = exports.routingProfileCandidateSchema = exports.modelDeploymentSchema = exports.inferenceProviderSchema = exports.modelRevisionSchema = exports.catalogueModelSchema = exports.modelPublisherSchema = exports.modelSafetyMetadataSchema = exports.modelEvaluationResultSchema = exports.modelDeprecationSchema = exports.commercialPermissionSchema = exports.availabilityScopeSchema = exports.inferenceDataPolicySchema = exports.modelProvenanceSchema = exports.modelLicenseSchema = exports.modelCapabilitiesSchema = exports.modelRealtimeCapabilitiesSchema = exports.realtimeSessionTransportSchema = exports.realtimeSessionKindSchema = exports.inferenceApiFormatSchema = exports.modelPowerClassSchema = exports.powerLevelSchema = exports.reasoningEffortSchema = exports.inferenceOutputModalitySchema = exports.inferenceModalitySchema = void 0;
|
|
4
|
+
const numberChecks_1 = require("../numberChecks");
|
|
5
|
+
const stringChecks_1 = require("../stringChecks");
|
|
2
6
|
/**
|
|
3
7
|
* The canonical model catalogue.
|
|
4
8
|
*
|
|
@@ -27,8 +31,6 @@
|
|
|
27
31
|
*
|
|
28
32
|
* Decided in: docs/adr/0008-catalogue-concept-separation.md.
|
|
29
33
|
*/
|
|
30
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
-
exports.modelCatalogueEntrySchema = exports.catalogueServingProviderSummarySchema = exports.cataloguePublisherSummarySchema = exports.routingProfileSchema = exports.routingProfileCandidateSchema = exports.modelDeploymentSchema = exports.inferenceProviderSchema = exports.modelRevisionSchema = exports.catalogueModelSchema = exports.modelPublisherSchema = exports.modelSafetyMetadataSchema = exports.modelEvaluationResultSchema = exports.modelDeprecationSchema = exports.commercialPermissionSchema = exports.availabilityScopeSchema = exports.inferenceDataPolicySchema = exports.modelProvenanceSchema = exports.modelLicenseSchema = exports.modelCapabilitiesSchema = exports.modelRealtimeCapabilitiesSchema = exports.realtimeSessionTransportSchema = exports.realtimeSessionKindSchema = exports.inferenceApiFormatSchema = exports.modelPowerClassSchema = exports.powerLevelSchema = exports.reasoningEffortSchema = exports.inferenceOutputModalitySchema = exports.inferenceModalitySchema = void 0;
|
|
32
34
|
const zod_1 = require("zod");
|
|
33
35
|
const identifiers_1 = require("./identifiers");
|
|
34
36
|
const priceVersion_1 = require("./priceVersion");
|
|
@@ -155,8 +157,8 @@ exports.modelCapabilitiesSchema = zod_1.z
|
|
|
155
157
|
reasoningEfforts: zod_1.z.array(exports.reasoningEffortSchema).default([]),
|
|
156
158
|
streaming: zod_1.z.boolean(),
|
|
157
159
|
promptCaching: zod_1.z.boolean(),
|
|
158
|
-
maxContextTokens: zod_1.z.number().
|
|
159
|
-
maxOutputTokens: zod_1.z.number().
|
|
160
|
+
maxContextTokens: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).positive().check((0, numberChecks_1.safeNumberCheck)()),
|
|
161
|
+
maxOutputTokens: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).positive().check((0, numberChecks_1.safeNumberCheck)()),
|
|
160
162
|
/**
|
|
161
163
|
* The request dialects a route to this model can EXECUTE. Modalities say
|
|
162
164
|
* what a model consumes and produces; they do not say which request shape a
|
|
@@ -219,8 +221,8 @@ exports.modelCapabilitiesSchema = zod_1.z
|
|
|
219
221
|
exports.modelLicenseSchema = zod_1.z
|
|
220
222
|
.object({
|
|
221
223
|
/** SPDX identifier where one exists, otherwise the publisher's own name. */
|
|
222
|
-
licenseId: zod_1.z.string().
|
|
223
|
-
displayName: zod_1.z.string().
|
|
224
|
+
licenseId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(128)),
|
|
225
|
+
displayName: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(200)),
|
|
224
226
|
url: identifiers_1.inferenceHttpsUrlSchema.optional(),
|
|
225
227
|
commercialUseAllowed: zod_1.z.boolean(),
|
|
226
228
|
requiresAttribution: zod_1.z.boolean(),
|
|
@@ -244,7 +246,7 @@ exports.modelProvenanceSchema = zod_1.z
|
|
|
244
246
|
]),
|
|
245
247
|
/** The model this one was derived/fine-tuned from, where there is one. */
|
|
246
248
|
baseModelId: identifiers_1.modelIdSchema.optional(),
|
|
247
|
-
trainingOrganization: zod_1.z.string().
|
|
249
|
+
trainingOrganization: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(200)).optional(),
|
|
248
250
|
})
|
|
249
251
|
.strict();
|
|
250
252
|
/**
|
|
@@ -257,11 +259,13 @@ exports.inferenceDataPolicySchema = zod_1.z
|
|
|
257
259
|
.object({
|
|
258
260
|
retainsPayloads: zod_1.z.boolean(),
|
|
259
261
|
/** Zero when nothing is retained. */
|
|
260
|
-
retentionDays: zod_1.z.number().
|
|
262
|
+
retentionDays: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).nonnegative().max(3650),
|
|
261
263
|
trainsOnCustomerData: zod_1.z.boolean(),
|
|
262
264
|
zeroDataRetentionAvailable: zod_1.z.boolean(),
|
|
263
265
|
/** Named subprocessors a payload may pass through, for compliance review. */
|
|
264
|
-
subprocessors: zod_1.z
|
|
266
|
+
subprocessors: zod_1.z
|
|
267
|
+
.array(zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(200)))
|
|
268
|
+
.default([]),
|
|
265
269
|
policyUrl: identifiers_1.inferenceHttpsUrlSchema.optional(),
|
|
266
270
|
})
|
|
267
271
|
.strict()
|
|
@@ -326,10 +330,10 @@ exports.modelDeprecationSchema = zod_1.z
|
|
|
326
330
|
/** One published evaluation result for a revision. */
|
|
327
331
|
exports.modelEvaluationResultSchema = zod_1.z
|
|
328
332
|
.object({
|
|
329
|
-
suite: zod_1.z.string().
|
|
330
|
-
metric: zod_1.z.string().
|
|
333
|
+
suite: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(128)),
|
|
334
|
+
metric: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(128)),
|
|
331
335
|
/** Kept as a string: an eval score is published text, not arithmetic. */
|
|
332
|
-
score: zod_1.z.string().
|
|
336
|
+
score: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(64)),
|
|
333
337
|
evaluatedAt: identifiers_1.inferenceTimestampSchema.optional(),
|
|
334
338
|
reportUrl: identifiers_1.inferenceHttpsUrlSchema.optional(),
|
|
335
339
|
})
|
|
@@ -342,7 +346,9 @@ exports.modelSafetyMetadataSchema = zod_1.z
|
|
|
342
346
|
.object({
|
|
343
347
|
safetyCardUrl: identifiers_1.inferenceHttpsUrlSchema.optional(),
|
|
344
348
|
contentFilteringDefault: zod_1.z.enum(['none', 'provider_default', 'strict']),
|
|
345
|
-
knownLimitations: zod_1.z
|
|
349
|
+
knownLimitations: zod_1.z
|
|
350
|
+
.array(zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(500)))
|
|
351
|
+
.default([]),
|
|
346
352
|
/** Content-provenance marking the modality requires, where it requires one. */
|
|
347
353
|
provenanceMarking: zod_1.z.enum(['none', 'visible_watermark', 'invisible_watermark', 'c2pa']),
|
|
348
354
|
})
|
|
@@ -354,10 +360,10 @@ exports.modelSafetyMetadataSchema = zod_1.z
|
|
|
354
360
|
exports.modelPublisherSchema = zod_1.z.object({
|
|
355
361
|
/** See `version.ts`: served on its own by the catalogue, so it is versioned. */
|
|
356
362
|
schemaVersion: zod_1.z.literal(1),
|
|
357
|
-
publisherId: zod_1.z.string().
|
|
363
|
+
publisherId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(128)),
|
|
358
364
|
slug: identifiers_1.publisherSlugSchema,
|
|
359
|
-
displayName: zod_1.z.string().
|
|
360
|
-
description: zod_1.z.string().
|
|
365
|
+
displayName: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(200)),
|
|
366
|
+
description: zod_1.z.string().check((0, stringChecks_1.utf16MaxLength)(2000)).optional(),
|
|
361
367
|
websiteUrl: identifiers_1.inferenceHttpsUrlSchema.optional(),
|
|
362
368
|
});
|
|
363
369
|
/* -------------------------------------------------------------------------- */
|
|
@@ -377,8 +383,8 @@ exports.catalogueModelSchema = zod_1.z
|
|
|
377
383
|
modelId: identifiers_1.modelIdSchema,
|
|
378
384
|
publisher: identifiers_1.publisherSlugSchema,
|
|
379
385
|
slug: identifiers_1.modelSlugSchema,
|
|
380
|
-
displayName: zod_1.z.string().
|
|
381
|
-
description: zod_1.z.string().
|
|
386
|
+
displayName: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(200)),
|
|
387
|
+
description: zod_1.z.string().check((0, stringChecks_1.utf16MaxLength)(4000)).optional(),
|
|
382
388
|
capabilities: exports.modelCapabilitiesSchema,
|
|
383
389
|
license: exports.modelLicenseSchema,
|
|
384
390
|
provenance: exports.modelProvenanceSchema,
|
|
@@ -424,7 +430,7 @@ exports.modelRevisionSchema = zod_1.z
|
|
|
424
430
|
.object({
|
|
425
431
|
/** See `version.ts`: served on its own by the catalogue, so it is versioned. */
|
|
426
432
|
schemaVersion: zod_1.z.literal(1),
|
|
427
|
-
revisionId: zod_1.z.string().
|
|
433
|
+
revisionId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(128)),
|
|
428
434
|
modelId: identifiers_1.modelIdSchema,
|
|
429
435
|
revision: identifiers_1.modelRevisionLabelSchema,
|
|
430
436
|
reference: identifiers_1.modelReferenceSchema,
|
|
@@ -452,9 +458,9 @@ exports.modelRevisionSchema = zod_1.z
|
|
|
452
458
|
exports.inferenceProviderSchema = zod_1.z.object({
|
|
453
459
|
/** See `version.ts`: served on its own by the catalogue, so it is versioned. */
|
|
454
460
|
schemaVersion: zod_1.z.literal(1),
|
|
455
|
-
providerId: zod_1.z.string().
|
|
461
|
+
providerId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(128)),
|
|
456
462
|
slug: identifiers_1.inferenceProviderSlugSchema,
|
|
457
|
-
displayName: zod_1.z.string().
|
|
463
|
+
displayName: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(200)),
|
|
458
464
|
/**
|
|
459
465
|
* `customer_byok` means the customer's own upstream account is billed
|
|
460
466
|
* directly by the provider and Oxy charges only its platform fee.
|
|
@@ -497,7 +503,7 @@ exports.modelDeploymentSchema = zod_1.z
|
|
|
497
503
|
/** Reserved capacity for one enterprise account rather than shared. */
|
|
498
504
|
dedicatedCapacity: zod_1.z.boolean(),
|
|
499
505
|
/** The price version customers are charged under on this route. */
|
|
500
|
-
priceVersionId: zod_1.z.string().
|
|
506
|
+
priceVersionId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(128)).optional(),
|
|
501
507
|
})
|
|
502
508
|
.superRefine((deployment, ctx) => {
|
|
503
509
|
if (!deployment.modelReference.includes('@')) {
|
|
@@ -548,7 +554,7 @@ exports.routingProfileCandidateSchema = zod_1.z
|
|
|
548
554
|
.object({
|
|
549
555
|
modelReference: identifiers_1.modelReferenceSchema,
|
|
550
556
|
/** Lower sorts first. Ties are broken by the profile's optimisation target. */
|
|
551
|
-
priority: zod_1.z.number().
|
|
557
|
+
priority: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).nonnegative().max(1000),
|
|
552
558
|
})
|
|
553
559
|
.strict();
|
|
554
560
|
/**
|
|
@@ -564,8 +570,8 @@ exports.routingProfileSchema = zod_1.z.object({
|
|
|
564
570
|
schemaVersion: zod_1.z.literal(1),
|
|
565
571
|
routingProfileId: identifiers_1.routingProfileIdSchema,
|
|
566
572
|
slug: identifiers_1.routingProfileSlugSchema,
|
|
567
|
-
displayName: zod_1.z.string().
|
|
568
|
-
description: zod_1.z.string().
|
|
573
|
+
displayName: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(200)),
|
|
574
|
+
description: zod_1.z.string().check((0, stringChecks_1.utf16MaxLength)(2000)).optional(),
|
|
569
575
|
/** What the profile optimises for when several candidates qualify. */
|
|
570
576
|
optimiseFor: zod_1.z.enum(['price', 'latency', 'throughput', 'quality', 'balanced']),
|
|
571
577
|
candidates: zod_1.z.array(exports.routingProfileCandidateSchema).min(1),
|
|
@@ -593,7 +599,7 @@ exports.routingProfileSchema = zod_1.z.object({
|
|
|
593
599
|
exports.cataloguePublisherSummarySchema = zod_1.z
|
|
594
600
|
.object({
|
|
595
601
|
slug: identifiers_1.publisherSlugSchema,
|
|
596
|
-
displayName: zod_1.z.string().
|
|
602
|
+
displayName: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(200)),
|
|
597
603
|
websiteUrl: identifiers_1.inferenceHttpsUrlSchema.optional(),
|
|
598
604
|
})
|
|
599
605
|
.strict();
|
|
@@ -607,7 +613,7 @@ exports.cataloguePublisherSummarySchema = zod_1.z
|
|
|
607
613
|
exports.catalogueServingProviderSummarySchema = zod_1.z
|
|
608
614
|
.object({
|
|
609
615
|
slug: identifiers_1.inferenceProviderSlugSchema,
|
|
610
|
-
displayName: zod_1.z.string().
|
|
616
|
+
displayName: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(200)),
|
|
611
617
|
regions: zod_1.z.array(identifiers_1.inferenceRegionSchema).default([]),
|
|
612
618
|
dataPolicy: exports.inferenceDataPolicySchema,
|
|
613
619
|
})
|
|
@@ -624,8 +630,8 @@ exports.modelCatalogueEntrySchema = zod_1.z.object({
|
|
|
624
630
|
schemaVersion: zod_1.z.literal(3),
|
|
625
631
|
modelId: identifiers_1.modelIdSchema,
|
|
626
632
|
publisher: exports.cataloguePublisherSummarySchema,
|
|
627
|
-
displayName: zod_1.z.string().
|
|
628
|
-
description: zod_1.z.string().
|
|
633
|
+
displayName: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(200)),
|
|
634
|
+
description: zod_1.z.string().check((0, stringChecks_1.utf16MaxLength)(4000)).optional(),
|
|
629
635
|
currentRevision: identifiers_1.modelRevisionLabelSchema,
|
|
630
636
|
/** Revisions a customer may pin today, newest first. */
|
|
631
637
|
availableRevisions: zod_1.z.array(identifiers_1.modelRevisionLabelSchema).min(1),
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.meteredGenerationSchema = exports.costCenterUsageSchema = exports.providerCostSourceSchema = exports.PROVIDER_COST_SOURCES = exports.inferenceEconomicTreatmentSchema = exports.INFERENCE_ECONOMIC_TREATMENTS = void 0;
|
|
4
|
+
const numberChecks_1 = require("../numberChecks");
|
|
5
|
+
const stringChecks_1 = require("../stringChecks");
|
|
2
6
|
/**
|
|
3
7
|
* Economic treatment and durable usage/cost reporting for inference
|
|
4
8
|
* (issue #1526, plan item I09).
|
|
@@ -27,8 +31,6 @@
|
|
|
27
31
|
* (`customerCharge`, from settled receipts only). A tariff is not a cost, and an
|
|
28
32
|
* UNKNOWN cost is reported as unknown — counted, never summed as zero.
|
|
29
33
|
*/
|
|
30
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
-
exports.meteredGenerationSchema = exports.costCenterUsageSchema = exports.providerCostSourceSchema = exports.PROVIDER_COST_SOURCES = exports.inferenceEconomicTreatmentSchema = exports.INFERENCE_ECONOMIC_TREATMENTS = void 0;
|
|
32
34
|
const zod_1 = require("zod");
|
|
33
35
|
const entitlement_1 = require("./entitlement");
|
|
34
36
|
const money_1 = require("./money");
|
|
@@ -44,7 +46,7 @@ exports.inferenceEconomicTreatmentSchema = zod_1.z.enum(exports.INFERENCE_ECONOM
|
|
|
44
46
|
*/
|
|
45
47
|
exports.PROVIDER_COST_SOURCES = ['provider_reported', 'rate_card', 'unknown'];
|
|
46
48
|
exports.providerCostSourceSchema = zod_1.z.enum(exports.PROVIDER_COST_SOURCES);
|
|
47
|
-
const nonNegativeCount = zod_1.z.number().
|
|
49
|
+
const nonNegativeCount = zod_1.z.number().check((0, numberChecks_1.integerCheck)()).nonnegative().check((0, numberChecks_1.safeNumberCheck)());
|
|
48
50
|
/** One amount family, with the rows it could not include counted beside it. */
|
|
49
51
|
const knownAmountSchema = zod_1.z
|
|
50
52
|
.object({
|
|
@@ -69,8 +71,8 @@ exports.costCenterUsageSchema = zod_1.z
|
|
|
69
71
|
costCenter: entitlement_1.costCenterSchema.nullable(),
|
|
70
72
|
treatment: exports.inferenceEconomicTreatmentSchema,
|
|
71
73
|
currency: money_1.currencyCodeSchema,
|
|
72
|
-
periodStart: zod_1.z.string().
|
|
73
|
-
periodEnd: zod_1.z.string().
|
|
74
|
+
periodStart: zod_1.z.string().check((0, stringChecks_1.isoDateTime)()),
|
|
75
|
+
periodEnd: zod_1.z.string().check((0, stringChecks_1.isoDateTime)()),
|
|
74
76
|
/** Requests settled in the window (completed, failed, cancelled or partial). */
|
|
75
77
|
requestCount: nonNegativeCount,
|
|
76
78
|
/** Requests admitted and not yet settled when the report was read. */
|
|
@@ -90,10 +92,10 @@ exports.costCenterUsageSchema = zod_1.z
|
|
|
90
92
|
/** Attempts priced in a different currency, excluded without currency conversion. */
|
|
91
93
|
otherCurrencyCount: nonNegativeCount.default(0),
|
|
92
94
|
/** Amount stated by the provider; this is not a copy of its invoice. */
|
|
93
|
-
providerReportedAmount: money_1.exactDecimalSchema.
|
|
95
|
+
providerReportedAmount: money_1.exactDecimalSchema.prefault('0'),
|
|
94
96
|
providerReportedCount: nonNegativeCount.default(0),
|
|
95
97
|
/** Amount estimated from Kaana's immutable rate card, never described as invoiced. */
|
|
96
|
-
estimatedAmount: money_1.exactDecimalSchema.
|
|
98
|
+
estimatedAmount: money_1.exactDecimalSchema.prefault('0'),
|
|
97
99
|
estimatedCount: nonNegativeCount.default(0),
|
|
98
100
|
}),
|
|
99
101
|
/**
|
|
@@ -111,35 +113,38 @@ exports.meteredGenerationSchema = zod_1.z
|
|
|
111
113
|
.object({
|
|
112
114
|
schemaVersion: zod_1.z.literal(2),
|
|
113
115
|
kind: zod_1.z.literal('metered_usage'),
|
|
114
|
-
meteredUsageId: zod_1.z.string().
|
|
115
|
-
requestId: zod_1.z.string().
|
|
116
|
-
generationId: zod_1.z.string().
|
|
117
|
-
parentRequestId: zod_1.z.string().
|
|
118
|
-
applicationId: zod_1.z.string().
|
|
119
|
-
credentialId: zod_1.z.string().
|
|
120
|
-
delegatedUserId: zod_1.z.string().
|
|
116
|
+
meteredUsageId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)),
|
|
117
|
+
requestId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)),
|
|
118
|
+
generationId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).optional(),
|
|
119
|
+
parentRequestId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).optional(),
|
|
120
|
+
applicationId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)),
|
|
121
|
+
credentialId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)),
|
|
122
|
+
delegatedUserId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).optional(),
|
|
121
123
|
environment: identifiers_1.inferenceEnvironmentSchema,
|
|
122
124
|
economicTreatment: zod_1.z.literal('internal_metered'),
|
|
123
|
-
economicPolicyVersion: zod_1.z.string().
|
|
125
|
+
economicPolicyVersion: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)),
|
|
124
126
|
outcome: usage_1.inferenceRequestOutcomeSchema,
|
|
125
127
|
usageSource: money_1.usageSourceSchema,
|
|
126
128
|
units: zod_1.z.array(money_1.usageQuantitySchema),
|
|
127
129
|
resolvedModelReference: identifiers_1.modelReferenceSchema,
|
|
128
|
-
servingProvider: zod_1.z.string().
|
|
130
|
+
servingProvider: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)),
|
|
129
131
|
tariff: zod_1.z.discriminatedUnion('status', [
|
|
130
132
|
zod_1.z
|
|
131
133
|
.object({
|
|
132
134
|
status: zod_1.z.literal('quoted'),
|
|
133
135
|
amount: money_1.exactDecimalSchema,
|
|
134
136
|
currency: money_1.currencyCodeSchema,
|
|
135
|
-
priceVersionId: zod_1.z.string().
|
|
137
|
+
priceVersionId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)),
|
|
136
138
|
})
|
|
137
139
|
.strict(),
|
|
138
140
|
zod_1.z
|
|
139
|
-
.object({
|
|
141
|
+
.object({
|
|
142
|
+
status: zod_1.z.literal('unpriced'),
|
|
143
|
+
priceVersionId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).nullable(),
|
|
144
|
+
})
|
|
140
145
|
.strict(),
|
|
141
146
|
]),
|
|
142
147
|
customerCharge: zod_1.z.object({ status: zod_1.z.literal('not_charged') }).strict(),
|
|
143
|
-
settledAt: zod_1.z.string().
|
|
148
|
+
settledAt: zod_1.z.string().check((0, stringChecks_1.isoDateTime)()),
|
|
144
149
|
})
|
|
145
150
|
.strict();
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.embeddingResponseSchema = exports.embeddingFailureSchema = exports.embeddingSuccessSchema = exports.embeddingUsageSchema = exports.embeddingVectorSchema = void 0;
|
|
4
|
+
const numberChecks_1 = require("../numberChecks");
|
|
5
|
+
const stringChecks_1 = require("../stringChecks");
|
|
4
6
|
const zod_1 = require("zod");
|
|
5
7
|
const errors_1 = require("./errors");
|
|
6
8
|
exports.embeddingVectorSchema = zod_1.z
|
|
7
9
|
.object({
|
|
8
|
-
index: zod_1.z.number().
|
|
10
|
+
index: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).nonnegative(),
|
|
9
11
|
embedding: zod_1.z.array(zod_1.z.number().finite()).min(1).max(1024),
|
|
10
12
|
})
|
|
11
13
|
.strict();
|
|
12
14
|
exports.embeddingUsageSchema = zod_1.z
|
|
13
15
|
.object({
|
|
14
|
-
inputTokens: zod_1.z.number().
|
|
15
|
-
totalTokens: zod_1.z.number().
|
|
16
|
+
inputTokens: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).nonnegative(),
|
|
17
|
+
totalTokens: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).nonnegative(),
|
|
16
18
|
})
|
|
17
19
|
.strict()
|
|
18
20
|
.refine((usage) => usage.totalTokens >= usage.inputTokens, {
|
|
@@ -22,9 +24,9 @@ exports.embeddingUsageSchema = zod_1.z
|
|
|
22
24
|
exports.embeddingSuccessSchema = zod_1.z
|
|
23
25
|
.object({
|
|
24
26
|
schemaVersion: zod_1.z.literal(1),
|
|
25
|
-
requestId: zod_1.z.string().
|
|
26
|
-
model: zod_1.z.string().
|
|
27
|
-
dimension: zod_1.z.number().
|
|
27
|
+
requestId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(128)),
|
|
28
|
+
model: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(255)),
|
|
29
|
+
dimension: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).positive().max(1024),
|
|
28
30
|
data: zod_1.z.array(exports.embeddingVectorSchema).min(1).max(2048),
|
|
29
31
|
usage: exports.embeddingUsageSchema,
|
|
30
32
|
})
|
|
@@ -50,7 +52,7 @@ exports.embeddingSuccessSchema = zod_1.z
|
|
|
50
52
|
exports.embeddingFailureSchema = zod_1.z
|
|
51
53
|
.object({
|
|
52
54
|
schemaVersion: zod_1.z.literal(1),
|
|
53
|
-
requestId: zod_1.z.string().
|
|
55
|
+
requestId: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(128)),
|
|
54
56
|
error: errors_1.inferenceErrorSchema,
|
|
55
57
|
})
|
|
56
58
|
.strict();
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.productEntitlementSchema = exports.costCenterSpendSchema = exports.costCenterSchema = exports.costCenterStatusSchema = exports.COST_CENTER_STATUSES = exports.payAsYouGoEntitlementSchema = exports.productPlanSchema = exports.planAllowanceSchema = exports.LIVE_PRODUCT_PLAN_STATUSES = exports.productPlanStatusSchema = exports.PRODUCT_PLAN_STATUSES = void 0;
|
|
4
|
+
const numberChecks_1 = require("../numberChecks");
|
|
5
|
+
const stringChecks_1 = require("../stringChecks");
|
|
2
6
|
/**
|
|
3
7
|
* Product entitlements — the interface a first-party product (Alia) queries to
|
|
4
8
|
* learn what an account is entitled to, WITHOUT learning anything it could
|
|
@@ -42,8 +46,6 @@
|
|
|
42
46
|
*
|
|
43
47
|
* Decided in: docs/adr/0014-account-billing-and-entitlements.md.
|
|
44
48
|
*/
|
|
45
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
|
-
exports.productEntitlementSchema = exports.costCenterSpendSchema = exports.costCenterSchema = exports.costCenterStatusSchema = exports.COST_CENTER_STATUSES = exports.payAsYouGoEntitlementSchema = exports.productPlanSchema = exports.planAllowanceSchema = exports.LIVE_PRODUCT_PLAN_STATUSES = exports.productPlanStatusSchema = exports.PRODUCT_PLAN_STATUSES = void 0;
|
|
47
49
|
const zod_1 = require("zod");
|
|
48
50
|
const identifiers_1 = require("./identifiers");
|
|
49
51
|
const accountBilling_1 = require("./accountBilling");
|
|
@@ -90,8 +92,8 @@ exports.planAllowanceSchema = zod_1.z
|
|
|
90
92
|
/** A stable machine name, e.g. `api_credits_per_month`. */
|
|
91
93
|
key: zod_1.z.string().regex(/^[a-z][a-z0-9_]{0,62}$/),
|
|
92
94
|
/** Whole units included per period. Never money. */
|
|
93
|
-
included: zod_1.z.number().
|
|
94
|
-
remaining: zod_1.z.number().
|
|
95
|
+
included: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).nonnegative().check((0, numberChecks_1.safeNumberCheck)()),
|
|
96
|
+
remaining: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).nonnegative().check((0, numberChecks_1.safeNumberCheck)()).optional(),
|
|
95
97
|
})
|
|
96
98
|
.strict();
|
|
97
99
|
/**
|
|
@@ -104,12 +106,12 @@ exports.planAllowanceSchema = zod_1.z
|
|
|
104
106
|
*/
|
|
105
107
|
exports.productPlanSchema = zod_1.z
|
|
106
108
|
.object({
|
|
107
|
-
id: zod_1.z.string().
|
|
108
|
-
name: zod_1.z.string().
|
|
109
|
+
id: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(64)),
|
|
110
|
+
name: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(120)),
|
|
109
111
|
status: exports.productPlanStatusSchema,
|
|
110
112
|
live: zod_1.z.boolean(),
|
|
111
|
-
currentPeriodStart: zod_1.z.string().
|
|
112
|
-
currentPeriodEnd: zod_1.z.string().
|
|
113
|
+
currentPeriodStart: zod_1.z.string().check((0, stringChecks_1.isoDateTime)()),
|
|
114
|
+
currentPeriodEnd: zod_1.z.string().check((0, stringChecks_1.isoDateTime)()),
|
|
113
115
|
cancelAtPeriodEnd: zod_1.z.boolean(),
|
|
114
116
|
allowances: zod_1.z.array(exports.planAllowanceSchema),
|
|
115
117
|
})
|
|
@@ -159,10 +161,10 @@ exports.costCenterSchema = zod_1.z
|
|
|
159
161
|
schemaVersion: zod_1.z.literal(1),
|
|
160
162
|
accountId: identifiers_1.oxyAccountIdSchema,
|
|
161
163
|
slug: zod_1.z.string().regex(/^[a-z0-9][a-z0-9-]{0,62}$/),
|
|
162
|
-
label: zod_1.z.string().
|
|
164
|
+
label: zod_1.z.string().check((0, stringChecks_1.utf16MinLength)(1)).check((0, stringChecks_1.utf16MaxLength)(120)),
|
|
163
165
|
status: exports.costCenterStatusSchema,
|
|
164
|
-
createdAt: zod_1.z.string().
|
|
165
|
-
updatedAt: zod_1.z.string().
|
|
166
|
+
createdAt: zod_1.z.string().check((0, stringChecks_1.isoDateTime)()),
|
|
167
|
+
updatedAt: zod_1.z.string().check((0, stringChecks_1.isoDateTime)()),
|
|
166
168
|
})
|
|
167
169
|
.strict();
|
|
168
170
|
/**
|
|
@@ -178,10 +180,10 @@ exports.costCenterSpendSchema = zod_1.z
|
|
|
178
180
|
schemaVersion: zod_1.z.literal(1),
|
|
179
181
|
costCenter: exports.costCenterSchema,
|
|
180
182
|
currency: money_1.currencyCodeSchema,
|
|
181
|
-
periodStart: zod_1.z.string().
|
|
182
|
-
periodEnd: zod_1.z.string().
|
|
183
|
+
periodStart: zod_1.z.string().check((0, stringChecks_1.isoDateTime)()),
|
|
184
|
+
periodEnd: zod_1.z.string().check((0, stringChecks_1.isoDateTime)()),
|
|
183
185
|
billedAmount: money_1.exactDecimalSchema,
|
|
184
|
-
requestCount: zod_1.z.number().
|
|
186
|
+
requestCount: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).nonnegative().check((0, numberChecks_1.safeNumberCheck)()),
|
|
185
187
|
})
|
|
186
188
|
.strict();
|
|
187
189
|
/* -------------------------------------------------------------------------- */
|
|
@@ -212,6 +214,6 @@ exports.productEntitlementSchema = zod_1.z
|
|
|
212
214
|
payAsYouGo: exports.payAsYouGoEntitlementSchema.nullable(),
|
|
213
215
|
costCenter: exports.costCenterSchema.nullable(),
|
|
214
216
|
/** When this view was computed. Entitlements are eventually consistent. */
|
|
215
|
-
resolvedAt: zod_1.z.string().
|
|
217
|
+
resolvedAt: zod_1.z.string().check((0, stringChecks_1.isoDateTime)()),
|
|
216
218
|
})
|
|
217
219
|
.strict();
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.inferenceErrorSchema = exports.providerErrorPassthroughSchema = exports.upstreamErrorCategorySchema = exports.safeErrorTextSchema = exports.NON_RETRYABLE_INFERENCE_ERROR_CODES = exports.inferenceErrorCodeSchema = exports.INFERENCE_ERROR_CODES = void 0;
|
|
4
|
+
const numberChecks_1 = require("../numberChecks");
|
|
5
|
+
const stringChecks_1 = require("../stringChecks");
|
|
2
6
|
/**
|
|
3
7
|
* Inference errors and retryability.
|
|
4
8
|
*
|
|
@@ -23,8 +27,6 @@
|
|
|
23
27
|
*
|
|
24
28
|
* Decided in: docs/adr/0010-public-api-compatibility.md.
|
|
25
29
|
*/
|
|
26
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
-
exports.inferenceErrorSchema = exports.providerErrorPassthroughSchema = exports.upstreamErrorCategorySchema = exports.safeErrorTextSchema = exports.NON_RETRYABLE_INFERENCE_ERROR_CODES = exports.inferenceErrorCodeSchema = exports.INFERENCE_ERROR_CODES = void 0;
|
|
28
30
|
const zod_1 = require("zod");
|
|
29
31
|
const identifiers_1 = require("./identifiers");
|
|
30
32
|
/**
|
|
@@ -226,8 +228,8 @@ const CREDENTIAL_PATTERNS = [
|
|
|
226
228
|
*/
|
|
227
229
|
exports.safeErrorTextSchema = zod_1.z
|
|
228
230
|
.string()
|
|
229
|
-
.
|
|
230
|
-
.
|
|
231
|
+
.check((0, stringChecks_1.utf16MinLength)(1))
|
|
232
|
+
.check((0, stringChecks_1.utf16MaxLength)(2000))
|
|
231
233
|
.refine((value) => !CREDENTIAL_PATTERNS.some((pattern) => pattern.test(value)), 'error text must not contain credential-shaped material');
|
|
232
234
|
/**
|
|
233
235
|
* A coarse classification of an upstream failure (ADR 0010's `upstreamCategory`).
|
|
@@ -261,9 +263,9 @@ exports.providerErrorPassthroughSchema = zod_1.z
|
|
|
261
263
|
.object({
|
|
262
264
|
provider: identifiers_1.inferenceProviderSlugSchema,
|
|
263
265
|
/** The upstream HTTP status, when the upstream spoke HTTP. */
|
|
264
|
-
status: zod_1.z.number().
|
|
266
|
+
status: zod_1.z.number().check((0, numberChecks_1.integerCheck)()).min(100).max(599).optional(),
|
|
265
267
|
/** The upstream's own error code, verbatim and uninterpreted. */
|
|
266
|
-
code: zod_1.z.string().
|
|
268
|
+
code: zod_1.z.string().check((0, stringChecks_1.utf16MaxLength)(128)).optional(),
|
|
267
269
|
/** The upstream's message, subject to the same credential refusal. */
|
|
268
270
|
message: exports.safeErrorTextSchema.optional(),
|
|
269
271
|
})
|
|
@@ -284,9 +286,14 @@ exports.inferenceErrorSchema = zod_1.z
|
|
|
284
286
|
retryable: zod_1.z.boolean(),
|
|
285
287
|
requestId: identifiers_1.requestIdSchema,
|
|
286
288
|
/** How long to wait before retrying. Only meaningful when `retryable`. */
|
|
287
|
-
retryAfterMs: zod_1.z
|
|
289
|
+
retryAfterMs: zod_1.z
|
|
290
|
+
.number()
|
|
291
|
+
.check((0, numberChecks_1.integerCheck)())
|
|
292
|
+
.nonnegative()
|
|
293
|
+
.check((0, numberChecks_1.safeNumberCheck)())
|
|
294
|
+
.optional(),
|
|
288
295
|
/** The request field at fault, for `invalid_request`. */
|
|
289
|
-
param: zod_1.z.string().
|
|
296
|
+
param: zod_1.z.string().check((0, stringChecks_1.utf16MaxLength)(128)).optional(),
|
|
290
297
|
/** Present only when an upstream provider was reached and failed. */
|
|
291
298
|
upstreamCategory: exports.upstreamErrorCategorySchema.optional(),
|
|
292
299
|
providerError: exports.providerErrorPassthroughSchema.optional(),
|