@oxy.so/contracts 4.11.0-oxy-one.0 → 4.11.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/.tsbuildinfo +1 -1
- package/dist/cjs/accountGraph.js +5 -3
- package/dist/cjs/agency.js +178 -96
- package/dist/cjs/agentKeys.js +80 -26
- package/dist/cjs/capabilityBindings.js +2 -2
- package/dist/cjs/capabilityInvocation.js +3 -1
- package/dist/cjs/commonsSignIn.js +2 -2
- package/dist/cjs/deviceSession.js +5 -1
- package/dist/cjs/email/messages.js +70 -4
- package/dist/cjs/emailAgentContext.js +16 -8
- package/dist/cjs/externalIdentity.js +30 -12
- package/dist/cjs/identity.js +14 -6
- package/dist/cjs/identityLink.js +7 -2
- package/dist/cjs/identityProof.js +2 -1
- package/dist/cjs/index.js +5 -3
- package/dist/cjs/inference/catalogue.js +2 -12
- package/dist/cjs/inference/decisions.js +102 -83
- package/dist/cjs/inference/economics.js +15 -5
- package/dist/cjs/inference/embeddings.js +44 -6
- package/dist/cjs/inference/inbox.js +33 -2
- package/dist/cjs/inference/providerConnection.js +21 -6
- package/dist/cjs/inference/realtime.js +114 -107
- package/dist/cjs/inference/scopedExecution.js +12 -12
- package/dist/cjs/inference/usage.js +2 -9
- package/dist/cjs/notifications.js +25 -5
- package/dist/cjs/oauth.js +30 -14
- package/dist/cjs/oxyRecordTypes.js +2 -2
- package/dist/cjs/products/access.js +146 -57
- package/dist/cjs/products/billing.js +71 -17
- package/dist/cjs/products/checkout.js +24 -6
- package/dist/cjs/products/plans.js +22 -7
- package/dist/cjs/recommendations.js +4 -6
- package/dist/cjs/reputation.js +3 -6
- package/dist/cjs/sessionStatus.js +1 -6
- package/dist/cjs/signIn.js +17 -4
- package/dist/cjs/transparency.js +3 -1
- package/dist/cjs/updates.js +2 -4
- package/dist/cjs/userResponse.js +27 -7
- package/dist/cjs/username.js +3 -1
- package/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/accountGraph.js +5 -3
- package/dist/esm/agency.js +178 -96
- package/dist/esm/agentKeys.js +80 -26
- package/dist/esm/capabilityBindings.js +2 -2
- package/dist/esm/capabilityInvocation.js +3 -1
- package/dist/esm/commonsSignIn.js +2 -2
- package/dist/esm/deviceSession.js +5 -1
- package/dist/esm/email/messages.js +69 -3
- package/dist/esm/emailAgentContext.js +16 -8
- package/dist/esm/externalIdentity.js +30 -12
- package/dist/esm/identity.js +14 -6
- package/dist/esm/identityLink.js +7 -2
- package/dist/esm/identityProof.js +2 -1
- package/dist/esm/index.js +7 -7
- package/dist/esm/inference/aliaModelRelease.js +1 -1
- package/dist/esm/inference/catalogue.js +3 -13
- package/dist/esm/inference/decisions.js +108 -89
- package/dist/esm/inference/economics.js +16 -6
- package/dist/esm/inference/embeddings.js +44 -6
- package/dist/esm/inference/inbox.js +32 -1
- package/dist/esm/inference/providerConnection.js +21 -6
- package/dist/esm/inference/realtime.js +123 -116
- package/dist/esm/inference/scopedExecution.js +15 -15
- package/dist/esm/inference/usage.js +2 -9
- package/dist/esm/notifications.js +25 -5
- package/dist/esm/oauth.js +30 -14
- package/dist/esm/oxyRecordTypes.js +2 -2
- package/dist/esm/products/access.js +146 -57
- package/dist/esm/products/billing.js +71 -17
- package/dist/esm/products/checkout.js +24 -6
- package/dist/esm/products/plans.js +22 -7
- package/dist/esm/recommendations.js +4 -6
- package/dist/esm/reputation.js +3 -6
- package/dist/esm/sessionStatus.js +1 -6
- package/dist/esm/signIn.js +17 -4
- package/dist/esm/transparency.js +3 -1
- package/dist/esm/updates.js +2 -4
- package/dist/esm/userResponse.js +27 -7
- package/dist/esm/username.js +3 -1
- package/dist/types/.tsbuildinfo +1 -1
- package/dist/types/accountGraph.d.ts +1 -1
- package/dist/types/commonsSignIn.d.ts +2 -2
- package/dist/types/email/messages.d.ts +208 -2
- package/dist/types/identity.d.ts +1 -1
- package/dist/types/index.d.ts +8 -8
- package/dist/types/inference/decisions.d.ts +1 -1
- package/dist/types/inference/inbox.d.ts +129 -5
- package/dist/types/inference/realtime.d.ts +1 -1
- package/dist/types/inference/scopedExecution.d.ts +1 -1
- package/dist/types/moderationReputation.d.ts +1 -1
- package/dist/types/oxyRecordTypes.d.ts +2 -2
- package/dist/types/products/access.d.ts +102 -102
- package/dist/types/products/checkout.d.ts +3 -3
- package/dist/types/products/plans.d.ts +40 -40
- package/dist/types/reputation.d.ts +4 -4
- package/dist/types/updates.d.ts +1 -1
- package/dist/types/userResponse.d.ts +22 -23
- package/package.json +1 -2
|
@@ -13,11 +13,7 @@
|
|
|
13
13
|
import { z } from 'zod';
|
|
14
14
|
import { userNameSchema } from './userResponse.js';
|
|
15
15
|
/** User-type filters a caller may exclude from the recommendation surface. */
|
|
16
|
-
export const recommendationExcludeTypeSchema = z.enum([
|
|
17
|
-
'federated',
|
|
18
|
-
'agent',
|
|
19
|
-
'automated',
|
|
20
|
-
]);
|
|
16
|
+
export const recommendationExcludeTypeSchema = z.enum(['federated', 'agent', 'automated']);
|
|
21
17
|
/**
|
|
22
18
|
* A caller-supplied editorial boost. `userIds` are nudged up (or down, for a
|
|
23
19
|
* negative weight) in the ranking; the optional `reason` is for audit/telemetry
|
|
@@ -122,7 +118,9 @@ export const appUserSignalIngestSchema = z
|
|
|
122
118
|
endorsements: z.array(appEndorsementInputSchema).max(500).optional(),
|
|
123
119
|
interests: z.array(appInterestInputSchema).max(500).optional(),
|
|
124
120
|
})
|
|
125
|
-
.refine((value) => (value.endorsements?.length ?? 0) > 0 || (value.interests?.length ?? 0) > 0, {
|
|
121
|
+
.refine((value) => (value.endorsements?.length ?? 0) > 0 || (value.interests?.length ?? 0) > 0, {
|
|
122
|
+
message: 'At least one of endorsements or interests must be non-empty',
|
|
123
|
+
});
|
|
126
124
|
/**
|
|
127
125
|
* The directed interaction types a consuming app may report between two users.
|
|
128
126
|
* Each type carries a server-side default weight (see the API's
|
package/dist/esm/reputation.js
CHANGED
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
* - **The balance has two views, and the union is the contract.** See
|
|
25
25
|
* {@link ReputationBalanceView} — the compile-time assertions below are what
|
|
26
26
|
* stop the private view's fields becoming reachable on a stranger's balance.
|
|
27
|
-
* - **The closed value sets live here, not beside the
|
|
28
|
-
* API's
|
|
27
|
+
* - **The closed value sets live here, not beside the database schema.** The
|
|
28
|
+
* API's column enums and the SDK's unions are the same `as const` tuple, so a
|
|
29
29
|
* seventh category cannot be added on one side only.
|
|
30
30
|
*
|
|
31
31
|
* The response entities are declared as explicit `interface`s with their runtime
|
|
@@ -74,10 +74,7 @@ export const reputationCategorySchema = z.enum(REPUTATION_CATEGORIES);
|
|
|
74
74
|
* only by policy-driven code, never by a person); the pair nets
|
|
75
75
|
* to zero.
|
|
76
76
|
*/
|
|
77
|
-
export const REPUTATION_TRANSACTION_STATUSES = [
|
|
78
|
-
'active',
|
|
79
|
-
'reversed',
|
|
80
|
-
];
|
|
77
|
+
export const REPUTATION_TRANSACTION_STATUSES = ['active', 'reversed'];
|
|
81
78
|
export const reputationTransactionStatusSchema = z.enum(REPUTATION_TRANSACTION_STATUSES);
|
|
82
79
|
/**
|
|
83
80
|
* Trust tiers, lowest → highest trust, plus the punitive `restricted`.
|
|
@@ -40,12 +40,7 @@ import { z } from 'zod';
|
|
|
40
40
|
* `packages/api/src/models/Application.ts` (`first_party` | `third_party` |
|
|
41
41
|
* `internal` | `system`).
|
|
42
42
|
*/
|
|
43
|
-
export const applicationTypeSchema = z.enum([
|
|
44
|
-
'first_party',
|
|
45
|
-
'third_party',
|
|
46
|
-
'internal',
|
|
47
|
-
'system',
|
|
48
|
-
]);
|
|
43
|
+
export const applicationTypeSchema = z.enum(['first_party', 'third_party', 'internal', 'system']);
|
|
49
44
|
/**
|
|
50
45
|
* The display-safe public identity of a requesting application, exactly as
|
|
51
46
|
* `serializePublicApplication` emits it. Returned by the API inside
|
package/dist/esm/signIn.js
CHANGED
|
@@ -119,7 +119,9 @@ export const emailSignInCodeSchema = z
|
|
|
119
119
|
const code = normalizeEmailSignInCode(value);
|
|
120
120
|
return (new RegExp(`^\\d{${EMAIL_CODE_LENGTH}}$`).test(code) ||
|
|
121
121
|
new RegExp(`^[${EMAIL_SIGNIN_LONG_CODE_ALPHABET}]{${EMAIL_SIGNIN_LONG_CODE_LENGTH}}$`).test(code));
|
|
122
|
-
}, {
|
|
122
|
+
}, {
|
|
123
|
+
message: `code must be ${EMAIL_CODE_LENGTH} digits or the ${EMAIL_SIGNIN_LONG_CODE_LENGTH}-character code from the email`,
|
|
124
|
+
});
|
|
123
125
|
/** `POST /auth/signin/email/confirm` — the code from the email. */
|
|
124
126
|
export const emailSignInConfirmRequestSchema = z
|
|
125
127
|
.object({
|
|
@@ -194,7 +196,13 @@ export function isSecondFactorRequired(result) {
|
|
|
194
196
|
* What a re-verification email code confirms. The code is bound to it: a code
|
|
195
197
|
* asked for one change never authorises another, and the email names it.
|
|
196
198
|
*/
|
|
197
|
-
export const REAUTH_ACTIONS = [
|
|
199
|
+
export const REAUTH_ACTIONS = [
|
|
200
|
+
'change_password',
|
|
201
|
+
'totp',
|
|
202
|
+
'link_commons',
|
|
203
|
+
'delete_account',
|
|
204
|
+
'credentials_manage',
|
|
205
|
+
];
|
|
198
206
|
/** `POST /users/me/reauth/email` */
|
|
199
207
|
export const reauthEmailStartRequestSchema = z.object({ action: z.enum(REAUTH_ACTIONS) }).strict();
|
|
200
208
|
/**
|
|
@@ -254,14 +262,19 @@ export const totpEnrollResponseSchema = z.object({
|
|
|
254
262
|
/** `POST /users/me/totp/confirm` — the first code from the authenticator turns it on. */
|
|
255
263
|
export const totpConfirmRequestSchema = z
|
|
256
264
|
.object({
|
|
257
|
-
code: z
|
|
265
|
+
code: z
|
|
266
|
+
.string()
|
|
267
|
+
.trim()
|
|
268
|
+
.regex(new RegExp(`^\\d{${TOTP_DIGITS}}$`)),
|
|
258
269
|
reauth: reauthProofSchema,
|
|
259
270
|
})
|
|
260
271
|
.strict();
|
|
261
272
|
/** `POST /users/me/totp/disable` and `POST /users/me/totp/backup-codes` */
|
|
262
273
|
export const totpReauthRequestSchema = z.object({ reauth: reauthProofSchema }).strict();
|
|
263
274
|
export const totpBackupCodesResponseSchema = z.object({
|
|
264
|
-
backupCodes: z
|
|
275
|
+
backupCodes: z
|
|
276
|
+
.array(z.string().regex(/^[a-z2-9]{5}-[a-z2-9]{5}$/))
|
|
277
|
+
.length(TOTP_BACKUP_CODE_COUNT),
|
|
265
278
|
});
|
|
266
279
|
/**
|
|
267
280
|
* Stable error codes (`error.code` in the API error body). Clients map these
|
package/dist/esm/transparency.js
CHANGED
|
@@ -20,7 +20,9 @@ import { z } from 'zod';
|
|
|
20
20
|
* verification failure at a distance.
|
|
21
21
|
*/
|
|
22
22
|
/** A SHA-256 digest in the exact form the protocol emits: 64 lowercase hex chars. */
|
|
23
|
-
const hexDigestSchema = z
|
|
23
|
+
const hexDigestSchema = z
|
|
24
|
+
.string()
|
|
25
|
+
.regex(/^[0-9a-f]{64}$/, 'Expected a 64-char lowercase hex digest');
|
|
24
26
|
/**
|
|
25
27
|
* One signer's endorsement of a checkpoint's signed fields.
|
|
26
28
|
*
|
package/dist/esm/updates.js
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* CLI, the console hook) validates its INPUT against the same definitions, so
|
|
12
12
|
* producer and consumers cannot drift.
|
|
13
13
|
*
|
|
14
|
-
* Domain model (mirrors the
|
|
14
|
+
* Domain model (mirrors the update tables in `@oxy.so/api`):
|
|
15
15
|
* - A `channel` (e.g. `production`, `preview`, `pr-123`) is a named release
|
|
16
16
|
* track for one application.
|
|
17
17
|
* - An `update` is one published bundle for a single `(channel, runtimeVersion,
|
|
@@ -153,9 +153,7 @@ export const createUpdateRequestSchema = z.object({
|
|
|
153
153
|
* `expoClient` (the public expo config) so `Constants.expoConfig` resolves
|
|
154
154
|
* after an OTA update; MAY carry other third-party config.
|
|
155
155
|
*/
|
|
156
|
-
extra: z
|
|
157
|
-
.object({ expoClient: z.record(z.string(), z.unknown()) })
|
|
158
|
-
.catchall(z.unknown()),
|
|
156
|
+
extra: z.object({ expoClient: z.record(z.string(), z.unknown()) }).catchall(z.unknown()),
|
|
159
157
|
/** String→string metadata dict; filtered client-side via manifest filters. */
|
|
160
158
|
metadata: z.record(z.string(), z.string()).optional(),
|
|
161
159
|
/** Initial rollout percentage (default 100 — full rollout). */
|
package/dist/esm/userResponse.js
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
/** Canonical profile/theme preset identities accepted by Oxy writes. */
|
|
2
|
-
export const USER_PROFILE_COLOR_PRESETS = [
|
|
2
|
+
export const USER_PROFILE_COLOR_PRESETS = [
|
|
3
|
+
'teal',
|
|
4
|
+
'blue',
|
|
5
|
+
'green',
|
|
6
|
+
'amber',
|
|
7
|
+
'red',
|
|
8
|
+
'purple',
|
|
9
|
+
'pink',
|
|
10
|
+
'sky',
|
|
11
|
+
'orange',
|
|
12
|
+
'mint',
|
|
13
|
+
'mono',
|
|
14
|
+
'oxy',
|
|
15
|
+
];
|
|
3
16
|
/**
|
|
4
17
|
* Canonical API user-response contracts.
|
|
5
18
|
*
|
|
@@ -22,10 +35,10 @@ export const USER_PROFILE_COLOR_PRESETS = ['teal', 'blue', 'green', 'amber', 're
|
|
|
22
35
|
* Emits `id` (NOT `_id`), forwards `username` verbatim (may be absent), and
|
|
23
36
|
* emits `name` as the structured `{ first, last, full, displayName }`
|
|
24
37
|
* subdocument.
|
|
25
|
-
* - `packages/api/src/
|
|
26
|
-
* `
|
|
27
|
-
* responses compose both fields, while raw-document responses may omit
|
|
28
|
-
*
|
|
38
|
+
* - `packages/api/src/db/schema/users.ts` — the stored name (`first`/`last`);
|
|
39
|
+
* `full` and `displayName` have no column of their own. Formatted API
|
|
40
|
+
* responses compose both fields, while raw-document responses may omit
|
|
41
|
+
* them.
|
|
29
42
|
*
|
|
30
43
|
* Platform-agnostic — zod only, no react/react-native/expo. ESM-safe (no
|
|
31
44
|
* `require()`).
|
|
@@ -122,7 +135,7 @@ export const dateOfBirthSchema = z
|
|
|
122
135
|
*/
|
|
123
136
|
export const userResponseSchema = z
|
|
124
137
|
.object({
|
|
125
|
-
/**
|
|
138
|
+
/** The user id as a string. Present on `formatUserResponse` output. */
|
|
126
139
|
id: z.string().optional(),
|
|
127
140
|
/** Raw-document id (e.g. `GET /users/me`). Present when `id` is not. */
|
|
128
141
|
_id: z.string().optional(),
|
|
@@ -222,7 +235,14 @@ export const userResponseSchema = z
|
|
|
222
235
|
* `GET /session/user/:sessionId`) and absent until the user sets it.
|
|
223
236
|
*/
|
|
224
237
|
themePreference: themePreferenceSchema.optional(),
|
|
225
|
-
personalization: z
|
|
238
|
+
personalization: z
|
|
239
|
+
.object({
|
|
240
|
+
mentionMono: z
|
|
241
|
+
.object({ allowed: z.boolean(), expiresAt: z.string().datetime().nullable() })
|
|
242
|
+
.strict(),
|
|
243
|
+
})
|
|
244
|
+
.strict()
|
|
245
|
+
.optional(),
|
|
226
246
|
})
|
|
227
247
|
.passthrough();
|
|
228
248
|
export const userProfileUpdateSchema = z
|
package/dist/esm/username.js
CHANGED
|
@@ -210,7 +210,9 @@ export const usernameSchema = z
|
|
|
210
210
|
.regex(USERNAME_PATTERN, USERNAME_INVALID_MESSAGE)
|
|
211
211
|
.refine((username) => !/^[0-9]+$/.test(username), NUMERIC_USERNAME_MESSAGE)
|
|
212
212
|
.refine((username) => !RESERVED_USERNAMES.has(username.toLowerCase()), RESERVED_USERNAME_MESSAGE)
|
|
213
|
-
.refine((username) => !username
|
|
213
|
+
.refine((username) => !username
|
|
214
|
+
.split(/[-_]/)
|
|
215
|
+
.some((segment) => RESERVED_USERNAME_SEGMENTS.has(segment.toLowerCase())), RESERVED_USERNAME_MESSAGE);
|
|
214
216
|
/**
|
|
215
217
|
* Whether a candidate handle is storable — the boolean form, for input surfaces
|
|
216
218
|
* that show a message as somebody types rather than throwing.
|