@oxy.so/contracts 4.10.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 +23 -15
- 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 +161 -41
- package/dist/cjs/products/billing.js +71 -17
- package/dist/cjs/products/checkout.js +35 -0
- package/dist/cjs/products/plans.js +38 -0
- 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 +32 -9
- 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 +10 -8
- 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 +160 -40
- package/dist/esm/products/billing.js +71 -17
- package/dist/esm/products/checkout.js +32 -0
- package/dist/esm/products/plans.js +35 -0
- 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 +28 -5
- 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/externalIdentity.d.ts +90 -0
- package/dist/types/identity.d.ts +1 -1
- package/dist/types/index.d.ts +12 -10
- 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 +405 -0
- package/dist/types/products/billing.d.ts +3 -0
- package/dist/types/products/checkout.d.ts +60 -0
- package/dist/types/products/plans.d.ts +319 -0
- package/dist/types/reputation.d.ts +4 -4
- package/dist/types/updates.d.ts +1 -1
- package/dist/types/userResponse.d.ts +388 -23
- package/package.json +1 -2
package/dist/cjs/signIn.js
CHANGED
|
@@ -124,7 +124,9 @@ exports.emailSignInCodeSchema = zod_1.z
|
|
|
124
124
|
const code = normalizeEmailSignInCode(value);
|
|
125
125
|
return (new RegExp(`^\\d{${accountEmail_1.EMAIL_CODE_LENGTH}}$`).test(code) ||
|
|
126
126
|
new RegExp(`^[${exports.EMAIL_SIGNIN_LONG_CODE_ALPHABET}]{${exports.EMAIL_SIGNIN_LONG_CODE_LENGTH}}$`).test(code));
|
|
127
|
-
}, {
|
|
127
|
+
}, {
|
|
128
|
+
message: `code must be ${accountEmail_1.EMAIL_CODE_LENGTH} digits or the ${exports.EMAIL_SIGNIN_LONG_CODE_LENGTH}-character code from the email`,
|
|
129
|
+
});
|
|
128
130
|
/** `POST /auth/signin/email/confirm` — the code from the email. */
|
|
129
131
|
exports.emailSignInConfirmRequestSchema = zod_1.z
|
|
130
132
|
.object({
|
|
@@ -199,7 +201,13 @@ function isSecondFactorRequired(result) {
|
|
|
199
201
|
* What a re-verification email code confirms. The code is bound to it: a code
|
|
200
202
|
* asked for one change never authorises another, and the email names it.
|
|
201
203
|
*/
|
|
202
|
-
exports.REAUTH_ACTIONS = [
|
|
204
|
+
exports.REAUTH_ACTIONS = [
|
|
205
|
+
'change_password',
|
|
206
|
+
'totp',
|
|
207
|
+
'link_commons',
|
|
208
|
+
'delete_account',
|
|
209
|
+
'credentials_manage',
|
|
210
|
+
];
|
|
203
211
|
/** `POST /users/me/reauth/email` */
|
|
204
212
|
exports.reauthEmailStartRequestSchema = zod_1.z.object({ action: zod_1.z.enum(exports.REAUTH_ACTIONS) }).strict();
|
|
205
213
|
/**
|
|
@@ -259,14 +267,19 @@ exports.totpEnrollResponseSchema = zod_1.z.object({
|
|
|
259
267
|
/** `POST /users/me/totp/confirm` — the first code from the authenticator turns it on. */
|
|
260
268
|
exports.totpConfirmRequestSchema = zod_1.z
|
|
261
269
|
.object({
|
|
262
|
-
code: zod_1.z
|
|
270
|
+
code: zod_1.z
|
|
271
|
+
.string()
|
|
272
|
+
.trim()
|
|
273
|
+
.regex(new RegExp(`^\\d{${exports.TOTP_DIGITS}}$`)),
|
|
263
274
|
reauth: exports.reauthProofSchema,
|
|
264
275
|
})
|
|
265
276
|
.strict();
|
|
266
277
|
/** `POST /users/me/totp/disable` and `POST /users/me/totp/backup-codes` */
|
|
267
278
|
exports.totpReauthRequestSchema = zod_1.z.object({ reauth: exports.reauthProofSchema }).strict();
|
|
268
279
|
exports.totpBackupCodesResponseSchema = zod_1.z.object({
|
|
269
|
-
backupCodes: zod_1.z
|
|
280
|
+
backupCodes: zod_1.z
|
|
281
|
+
.array(zod_1.z.string().regex(/^[a-z2-9]{5}-[a-z2-9]{5}$/))
|
|
282
|
+
.length(exports.TOTP_BACKUP_CODE_COUNT),
|
|
270
283
|
});
|
|
271
284
|
/**
|
|
272
285
|
* Stable error codes (`error.code` in the API error body). Clients map these
|
package/dist/cjs/transparency.js
CHANGED
|
@@ -23,7 +23,9 @@ const zod_1 = require("zod");
|
|
|
23
23
|
* verification failure at a distance.
|
|
24
24
|
*/
|
|
25
25
|
/** A SHA-256 digest in the exact form the protocol emits: 64 lowercase hex chars. */
|
|
26
|
-
const hexDigestSchema = zod_1.z
|
|
26
|
+
const hexDigestSchema = zod_1.z
|
|
27
|
+
.string()
|
|
28
|
+
.regex(/^[0-9a-f]{64}$/, 'Expected a 64-char lowercase hex digest');
|
|
27
29
|
/**
|
|
28
30
|
* One signer's endorsement of a checkpoint's signed fields.
|
|
29
31
|
*
|
package/dist/cjs/updates.js
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* CLI, the console hook) validates its INPUT against the same definitions, so
|
|
13
13
|
* producer and consumers cannot drift.
|
|
14
14
|
*
|
|
15
|
-
* Domain model (mirrors the
|
|
15
|
+
* Domain model (mirrors the update tables in `@oxy.so/api`):
|
|
16
16
|
* - A `channel` (e.g. `production`, `preview`, `pr-123`) is a named release
|
|
17
17
|
* track for one application.
|
|
18
18
|
* - An `update` is one published bundle for a single `(channel, runtimeVersion,
|
|
@@ -156,9 +156,7 @@ exports.createUpdateRequestSchema = zod_1.z.object({
|
|
|
156
156
|
* `expoClient` (the public expo config) so `Constants.expoConfig` resolves
|
|
157
157
|
* after an OTA update; MAY carry other third-party config.
|
|
158
158
|
*/
|
|
159
|
-
extra: zod_1.z
|
|
160
|
-
.object({ expoClient: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()) })
|
|
161
|
-
.catchall(zod_1.z.unknown()),
|
|
159
|
+
extra: zod_1.z.object({ expoClient: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()) }).catchall(zod_1.z.unknown()),
|
|
162
160
|
/** String→string metadata dict; filtered client-side via manifest filters. */
|
|
163
161
|
metadata: zod_1.z.record(zod_1.z.string(), zod_1.z.string()).optional(),
|
|
164
162
|
/** Initial rollout percentage (default 100 — full rollout). */
|
package/dist/cjs/userResponse.js
CHANGED
|
@@ -1,4 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deviceLinkedSessionsResponseSchema = exports.deviceLinkedSessionSchema = exports.currentUserResponseSchema = exports.userProfileUpdateSchema = exports.userResponseSchema = exports.dateOfBirthSchema = exports.themePreferenceSchema = exports.userRelationshipSchema = exports.userNameSchema = exports.USER_PROFILE_COLOR_PRESETS = void 0;
|
|
4
|
+
exports.resolveUserId = resolveUserId;
|
|
5
|
+
exports.safeParseContract = safeParseContract;
|
|
6
|
+
/** Canonical profile/theme preset identities accepted by Oxy writes. */
|
|
7
|
+
exports.USER_PROFILE_COLOR_PRESETS = [
|
|
8
|
+
'teal',
|
|
9
|
+
'blue',
|
|
10
|
+
'green',
|
|
11
|
+
'amber',
|
|
12
|
+
'red',
|
|
13
|
+
'purple',
|
|
14
|
+
'pink',
|
|
15
|
+
'sky',
|
|
16
|
+
'orange',
|
|
17
|
+
'mint',
|
|
18
|
+
'mono',
|
|
19
|
+
'oxy',
|
|
20
|
+
];
|
|
2
21
|
/**
|
|
3
22
|
* Canonical API user-response contracts.
|
|
4
23
|
*
|
|
@@ -21,18 +40,14 @@
|
|
|
21
40
|
* Emits `id` (NOT `_id`), forwards `username` verbatim (may be absent), and
|
|
22
41
|
* emits `name` as the structured `{ first, last, full, displayName }`
|
|
23
42
|
* subdocument.
|
|
24
|
-
* - `packages/api/src/
|
|
25
|
-
* `
|
|
26
|
-
* responses compose both fields, while raw-document responses may omit
|
|
27
|
-
*
|
|
43
|
+
* - `packages/api/src/db/schema/users.ts` — the stored name (`first`/`last`);
|
|
44
|
+
* `full` and `displayName` have no column of their own. Formatted API
|
|
45
|
+
* responses compose both fields, while raw-document responses may omit
|
|
46
|
+
* them.
|
|
28
47
|
*
|
|
29
48
|
* Platform-agnostic — zod only, no react/react-native/expo. ESM-safe (no
|
|
30
49
|
* `require()`).
|
|
31
50
|
*/
|
|
32
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
-
exports.deviceLinkedSessionsResponseSchema = exports.deviceLinkedSessionSchema = exports.currentUserResponseSchema = exports.userProfileUpdateSchema = exports.userResponseSchema = exports.dateOfBirthSchema = exports.themePreferenceSchema = exports.userRelationshipSchema = exports.userNameSchema = void 0;
|
|
34
|
-
exports.resolveUserId = resolveUserId;
|
|
35
|
-
exports.safeParseContract = safeParseContract;
|
|
36
51
|
const zod_1 = require("zod");
|
|
37
52
|
const identity_1 = require("./identity");
|
|
38
53
|
const accountGraph_1 = require("./accountGraph");
|
|
@@ -125,7 +140,7 @@ exports.dateOfBirthSchema = zod_1.z
|
|
|
125
140
|
*/
|
|
126
141
|
exports.userResponseSchema = zod_1.z
|
|
127
142
|
.object({
|
|
128
|
-
/**
|
|
143
|
+
/** The user id as a string. Present on `formatUserResponse` output. */
|
|
129
144
|
id: zod_1.z.string().optional(),
|
|
130
145
|
/** Raw-document id (e.g. `GET /users/me`). Present when `id` is not. */
|
|
131
146
|
_id: zod_1.z.string().optional(),
|
|
@@ -225,6 +240,14 @@ exports.userResponseSchema = zod_1.z
|
|
|
225
240
|
* `GET /session/user/:sessionId`) and absent until the user sets it.
|
|
226
241
|
*/
|
|
227
242
|
themePreference: exports.themePreferenceSchema.optional(),
|
|
243
|
+
personalization: zod_1.z
|
|
244
|
+
.object({
|
|
245
|
+
mentionMono: zod_1.z
|
|
246
|
+
.object({ allowed: zod_1.z.boolean(), expiresAt: zod_1.z.string().datetime().nullable() })
|
|
247
|
+
.strict(),
|
|
248
|
+
})
|
|
249
|
+
.strict()
|
|
250
|
+
.optional(),
|
|
228
251
|
})
|
|
229
252
|
.passthrough();
|
|
230
253
|
exports.userProfileUpdateSchema = zod_1.z
|
package/dist/cjs/username.js
CHANGED
|
@@ -217,7 +217,9 @@ exports.usernameSchema = zod_1.z
|
|
|
217
217
|
.regex(USERNAME_PATTERN, exports.USERNAME_INVALID_MESSAGE)
|
|
218
218
|
.refine((username) => !/^[0-9]+$/.test(username), exports.NUMERIC_USERNAME_MESSAGE)
|
|
219
219
|
.refine((username) => !exports.RESERVED_USERNAMES.has(username.toLowerCase()), exports.RESERVED_USERNAME_MESSAGE)
|
|
220
|
-
.refine((username) => !username
|
|
220
|
+
.refine((username) => !username
|
|
221
|
+
.split(/[-_]/)
|
|
222
|
+
.some((segment) => RESERVED_USERNAME_SEGMENTS.has(segment.toLowerCase())), exports.RESERVED_USERNAME_MESSAGE);
|
|
221
223
|
/**
|
|
222
224
|
* Whether a candidate handle is storable — the boolean form, for input surfaces
|
|
223
225
|
* that show a message as somebody types rather than throwing.
|