@oxy.so/contracts 4.15.0 → 4.17.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/accountEmail.js +12 -34
- package/dist/cjs/accountGraph.js +22 -320
- package/dist/cjs/agentKeys.js +11 -13
- package/dist/cjs/client/accountEmail.js +48 -0
- package/dist/cjs/client/accountGraph.js +323 -0
- package/dist/cjs/client/agentKeys.js +77 -0
- package/dist/cjs/client/check.js +466 -0
- package/dist/cjs/client/deviceBoot.js +22 -0
- package/dist/cjs/client/deviceDirectory.js +51 -0
- package/dist/cjs/client/deviceSession.js +63 -0
- package/dist/cjs/client/externalIdentity.js +19 -0
- package/dist/cjs/client/identity.js +45 -0
- package/dist/cjs/client/identityLink.js +55 -0
- package/dist/cjs/client/identityProof.js +109 -0
- package/dist/cjs/client/index.js +190 -0
- package/dist/cjs/client/organizations.js +114 -0
- package/dist/cjs/client/products.js +153 -0
- package/dist/cjs/client/recommendations.js +33 -0
- package/dist/cjs/client/reputation.js +41 -0
- package/dist/cjs/client/safety.js +15 -0
- package/dist/cjs/client/sessionStatus.js +23 -0
- package/dist/cjs/client/signIn.js +157 -0
- package/dist/cjs/client/userResponse.js +15 -0
- package/dist/cjs/client/username.js +173 -0
- package/dist/cjs/deviceSession.js +3 -16
- package/dist/cjs/identityLink.js +13 -34
- package/dist/cjs/identityProof.js +18 -106
- package/dist/cjs/index.js +15 -10
- package/dist/cjs/inference/money.js +10 -0
- package/dist/cjs/inference/version.js +1 -1
- package/dist/cjs/organizations.js +21 -41
- package/dist/cjs/products/billing.js +0 -1
- package/dist/cjs/products/checkout.js +1 -14
- package/dist/cjs/products/plans.js +2 -18
- package/dist/cjs/reputation.js +3 -34
- package/dist/cjs/signIn.js +57 -96
- package/dist/cjs/userResponse.js +1 -8
- package/dist/cjs/username.js +23 -158
- package/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/accountEmail.js +4 -32
- package/dist/esm/accountGraph.js +4 -309
- package/dist/esm/agentKeys.js +4 -10
- package/dist/esm/client/accountEmail.js +45 -0
- package/dist/esm/client/accountGraph.js +314 -0
- package/dist/esm/client/agentKeys.js +74 -0
- package/dist/esm/client/check.js +428 -0
- package/dist/esm/client/deviceBoot.js +19 -0
- package/dist/esm/client/deviceDirectory.js +48 -0
- package/dist/esm/client/deviceSession.js +60 -0
- package/dist/esm/client/externalIdentity.js +16 -0
- package/dist/esm/client/identity.js +42 -0
- package/dist/esm/client/identityLink.js +50 -0
- package/dist/esm/client/identityProof.js +104 -0
- package/dist/esm/client/index.js +37 -0
- package/dist/esm/client/organizations.js +111 -0
- package/dist/esm/client/products.js +150 -0
- package/dist/esm/client/recommendations.js +30 -0
- package/dist/esm/client/reputation.js +37 -0
- package/dist/esm/client/safety.js +12 -0
- package/dist/esm/client/sessionStatus.js +20 -0
- package/dist/esm/client/signIn.js +151 -0
- package/dist/esm/client/userResponse.js +12 -0
- package/dist/esm/client/username.js +167 -0
- package/dist/esm/deviceSession.js +1 -15
- package/dist/esm/identityLink.js +4 -27
- package/dist/esm/identityProof.js +4 -99
- package/dist/esm/index.js +2 -2
- package/dist/esm/inference/money.js +10 -0
- package/dist/esm/inference/version.js +1 -1
- package/dist/esm/organizations.js +4 -31
- package/dist/esm/products/billing.js +0 -1
- package/dist/esm/products/checkout.js +0 -13
- package/dist/esm/products/plans.js +1 -17
- package/dist/esm/reputation.js +1 -32
- package/dist/esm/signIn.js +29 -83
- package/dist/esm/userResponse.js +1 -8
- package/dist/esm/username.js +4 -148
- package/dist/types/.tsbuildinfo +1 -1
- package/dist/types/accountEmail.d.ts +2 -34
- package/dist/types/accountGraph.d.ts +12 -208
- package/dist/types/agency.d.ts +24 -24
- package/dist/types/agentKeys.d.ts +8 -6
- package/dist/types/client/accountEmail.d.ts +44 -0
- package/dist/types/client/accountGraph.d.ts +203 -0
- package/dist/types/client/agentKeys.d.ts +113 -0
- package/dist/types/client/check.d.ts +184 -0
- package/dist/types/client/deviceBoot.d.ts +6 -0
- package/dist/types/client/deviceDirectory.d.ts +134 -0
- package/dist/types/client/deviceSession.d.ts +91 -0
- package/dist/types/client/externalIdentity.d.ts +14 -0
- package/dist/types/client/identity.d.ts +8 -0
- package/dist/types/client/identityLink.d.ts +21 -0
- package/dist/types/client/identityProof.d.ts +73 -0
- package/dist/types/client/index.d.ts +37 -0
- package/dist/types/client/organizations.d.ts +167 -0
- package/dist/types/client/products.d.ts +145 -0
- package/dist/types/client/recommendations.d.ts +27 -0
- package/dist/types/client/reputation.d.ts +28 -0
- package/dist/types/client/safety.d.ts +13 -0
- package/dist/types/client/sessionStatus.d.ts +19 -0
- package/dist/types/client/signIn.d.ts +107 -0
- package/dist/types/client/userResponse.d.ts +7 -0
- package/dist/types/client/username.d.ts +126 -0
- package/dist/types/deviceDirectory.d.ts +28 -28
- package/dist/types/deviceSession.d.ts +1 -12
- package/dist/types/externalIdentity.d.ts +11 -44
- package/dist/types/identityLink.d.ts +3 -11
- package/dist/types/identityProof.d.ts +2 -65
- package/dist/types/index.d.ts +3 -3
- package/dist/types/inference/catalogue.d.ts +7 -7
- package/dist/types/inference/decisions.d.ts +41 -41
- package/dist/types/inference/economics.d.ts +5 -5
- package/dist/types/inference/embeddings.d.ts +16 -16
- package/dist/types/inference/errors.d.ts +8 -8
- package/dist/types/inference/inbox.d.ts +8 -8
- package/dist/types/inference/money.d.ts +17 -8
- package/dist/types/inference/priceVersion.d.ts +12 -12
- package/dist/types/inference/privateAutoExecution.d.ts +6 -6
- package/dist/types/inference/realtime.d.ts +54 -54
- package/dist/types/inference/request.d.ts +28 -28
- package/dist/types/inference/routingPolicy.d.ts +7 -7
- package/dist/types/inference/streamEvents.d.ts +26 -26
- package/dist/types/inference/usage.d.ts +32 -32
- package/dist/types/inference/version.d.ts +1 -1
- package/dist/types/oauth.d.ts +2 -2
- package/dist/types/organizations.d.ts +8 -10
- package/dist/types/products/billing.d.ts +3 -8
- package/dist/types/products/checkout.d.ts +0 -36
- package/dist/types/products/plans.d.ts +5 -102
- package/dist/types/reputation.d.ts +1 -11
- package/dist/types/sessionStatus.d.ts +2 -2
- package/dist/types/signIn.d.ts +74 -76
- package/dist/types/userResponse.d.ts +23 -159
- package/dist/types/username.d.ts +1 -96
- package/package.json +20 -1
|
@@ -179,8 +179,8 @@ export declare const sessionStatusSchema: z.ZodObject<{
|
|
|
179
179
|
openedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
180
180
|
}, "strip", z.ZodTypeAny, {
|
|
181
181
|
status: string;
|
|
182
|
-
purpose?: "device_sign_in" | "oauth_authorization" | undefined;
|
|
183
182
|
expiresAt?: string | undefined;
|
|
183
|
+
purpose?: "device_sign_in" | "oauth_authorization" | undefined;
|
|
184
184
|
sessionId?: string | null | undefined;
|
|
185
185
|
userId?: string | null | undefined;
|
|
186
186
|
publicKey?: string | null | undefined;
|
|
@@ -204,8 +204,8 @@ export declare const sessionStatusSchema: z.ZodObject<{
|
|
|
204
204
|
openedAt?: string | null | undefined;
|
|
205
205
|
}, {
|
|
206
206
|
status: string;
|
|
207
|
-
purpose?: "device_sign_in" | "oauth_authorization" | undefined;
|
|
208
207
|
expiresAt?: string | undefined;
|
|
208
|
+
purpose?: "device_sign_in" | "oauth_authorization" | undefined;
|
|
209
209
|
sessionId?: string | null | undefined;
|
|
210
210
|
userId?: string | null | undefined;
|
|
211
211
|
publicKey?: string | null | undefined;
|
package/dist/types/signIn.d.ts
CHANGED
|
@@ -18,6 +18,11 @@
|
|
|
18
18
|
* one-use second-factor challenge instead of a session, and
|
|
19
19
|
* `POST /auth/signin/second-factor` takes the TOTP (or a backup code).
|
|
20
20
|
*
|
|
21
|
+
* An email may hold several accounts (up to `EMAIL_ACCOUNTS_MAX`). Signing in
|
|
22
|
+
* with the email, once the code or the link proves it, answers the accounts to
|
|
23
|
+
* choose from when there are several, and `POST /auth/signin/email/choose`
|
|
24
|
+
* names one. A username always names one account.
|
|
25
|
+
*
|
|
21
26
|
* `POST /auth/signup` creates an account from a username and an email confirmed
|
|
22
27
|
* with `POST /auth/email/verify/{start,confirm}` (purpose `signup`).
|
|
23
28
|
*
|
|
@@ -26,37 +31,8 @@
|
|
|
26
31
|
*/
|
|
27
32
|
import { z } from 'zod';
|
|
28
33
|
import type { LoginResult } from './deviceBoot';
|
|
29
|
-
|
|
30
|
-
export
|
|
31
|
-
/** How long a second-factor challenge can be answered. */
|
|
32
|
-
export declare const SIGNIN_SECOND_FACTOR_TTL_MS: number;
|
|
33
|
-
/** Wrong second-factor codes one challenge accepts. */
|
|
34
|
-
export declare const SIGNIN_SECOND_FACTOR_MAX_ATTEMPTS = 5;
|
|
35
|
-
/** Shortest password Oxy accepts when one is set. */
|
|
36
|
-
export declare const PASSWORD_MIN_LENGTH = 10;
|
|
37
|
-
/** Longest password Oxy accepts (characters). */
|
|
38
|
-
export declare const PASSWORD_MAX_LENGTH = 256;
|
|
39
|
-
/** Digits in an authenticator code. */
|
|
40
|
-
export declare const TOTP_DIGITS = 6;
|
|
41
|
-
/** Seconds each authenticator code lasts. */
|
|
42
|
-
export declare const TOTP_PERIOD_SECONDS = 30;
|
|
43
|
-
/** Backup codes issued when an authenticator is enabled or they are regenerated. */
|
|
44
|
-
export declare const TOTP_BACKUP_CODE_COUNT = 10;
|
|
45
|
-
/**
|
|
46
|
-
* The long sign-in code: ten characters of Crockford base32 without the
|
|
47
|
-
* look-alikes (no 0, O, 1, I, L, U), shown as `XXXXX-XXXXX`. An account whose
|
|
48
|
-
* sign-in codes were guessed at too often today (the per-account ceiling) is
|
|
49
|
-
* sent this instead of 6 digits for the rest of the day, so its owner can still
|
|
50
|
-
* type a code while guessing one is infeasible.
|
|
51
|
-
*/
|
|
52
|
-
export declare const EMAIL_SIGNIN_LONG_CODE_ALPHABET = "23456789ABCDEFGHJKMNPQRSTVWXYZ";
|
|
53
|
-
export declare const EMAIL_SIGNIN_LONG_CODE_LENGTH = 10;
|
|
54
|
-
/**
|
|
55
|
-
* Normalise a typed sign-in code: 6 digits stay as they are; a long code is
|
|
56
|
-
* upper-cased with its dash and spaces removed. Anything else is returned
|
|
57
|
-
* trimmed (and will simply be wrong).
|
|
58
|
-
*/
|
|
59
|
-
export declare function normalizeEmailSignInCode(code: string): string;
|
|
34
|
+
export { EMAIL_SIGNIN_LINK_TTL_MS, SIGNIN_SECOND_FACTOR_TTL_MS, SIGNIN_SECOND_FACTOR_MAX_ATTEMPTS, PASSWORD_MIN_LENGTH, PASSWORD_MAX_LENGTH, TOTP_DIGITS, TOTP_PERIOD_SECONDS, TOTP_BACKUP_CODE_COUNT, EMAIL_SIGNIN_LONG_CODE_ALPHABET, EMAIL_SIGNIN_LONG_CODE_LENGTH, normalizeEmailSignInCode, EMAIL_SIGNIN_CHOICE_TTL_MS, EMAIL_ACCOUNTS_MAX, isSecondFactorRequired, isEmailSignInChooseAccount, REAUTH_ACTIONS, SIGN_IN_ERROR_CODES, } from './client/signIn';
|
|
35
|
+
export type { ReauthAction, SignInErrorCode } from './client/signIn';
|
|
60
36
|
/** A username or an email. */
|
|
61
37
|
export declare const signInIdentifierSchema: z.ZodString;
|
|
62
38
|
/** A password as typed. Its policy applies only when one is set. */
|
|
@@ -247,8 +223,8 @@ export declare const passwordSignInRequestSchema: z.ZodObject<{
|
|
|
247
223
|
identifier: z.ZodString;
|
|
248
224
|
password: z.ZodString;
|
|
249
225
|
}, "strict", z.ZodTypeAny, {
|
|
250
|
-
identifier: string;
|
|
251
226
|
password: string;
|
|
227
|
+
identifier: string;
|
|
252
228
|
device?: {
|
|
253
229
|
deviceId: string;
|
|
254
230
|
deviceSecret: string;
|
|
@@ -256,8 +232,8 @@ export declare const passwordSignInRequestSchema: z.ZodObject<{
|
|
|
256
232
|
deviceName?: string | undefined;
|
|
257
233
|
deviceFingerprint?: string | undefined;
|
|
258
234
|
}, {
|
|
259
|
-
identifier: string;
|
|
260
235
|
password: string;
|
|
236
|
+
identifier: string;
|
|
261
237
|
device?: {
|
|
262
238
|
deviceId: string;
|
|
263
239
|
deviceSecret: string;
|
|
@@ -359,14 +335,71 @@ export interface EmailSignInPending {
|
|
|
359
335
|
export declare const emailSignInPendingSchema: z.ZodType<EmailSignInPending>;
|
|
360
336
|
/** What a first factor answers: a session, or the second-factor step. */
|
|
361
337
|
export type SignInStepResult = LoginResult | SecondFactorRequired;
|
|
362
|
-
/**
|
|
363
|
-
export
|
|
338
|
+
/** One account an email holds, as the choice after proving it shows it. */
|
|
339
|
+
export interface EmailSignInAccountOption {
|
|
340
|
+
id: string;
|
|
341
|
+
username?: string;
|
|
342
|
+
/** The account's own display name; absent → show the handle. */
|
|
343
|
+
displayName?: string;
|
|
344
|
+
/** Asset id of the avatar. */
|
|
345
|
+
avatar?: string;
|
|
346
|
+
}
|
|
347
|
+
export declare const emailSignInAccountOptionSchema: z.ZodType<EmailSignInAccountOption>;
|
|
364
348
|
/**
|
|
365
|
-
*
|
|
366
|
-
*
|
|
349
|
+
* The email was signed in with, and it holds several accounts: the person
|
|
350
|
+
* chooses one (`POST /auth/signin/email/choose`) before `expiresAt`. Only the
|
|
351
|
+
* holder of the request's `requestSecret` ever sees this, after the code or
|
|
352
|
+
* the link proved the mailbox; a sign-in by username names one account and
|
|
353
|
+
* never asks.
|
|
367
354
|
*/
|
|
368
|
-
export
|
|
369
|
-
|
|
355
|
+
export interface EmailSignInChooseAccount {
|
|
356
|
+
chooseAccount: true;
|
|
357
|
+
accounts: EmailSignInAccountOption[];
|
|
358
|
+
/** Unix milliseconds. */
|
|
359
|
+
expiresAt: number;
|
|
360
|
+
}
|
|
361
|
+
export declare const emailSignInChooseAccountSchema: z.ZodType<EmailSignInChooseAccount>;
|
|
362
|
+
/** What proving an email answers: a session, the second-factor step, or the account choice. */
|
|
363
|
+
export type EmailSignInStepResult = SignInStepResult | EmailSignInChooseAccount;
|
|
364
|
+
/** `POST /auth/signin/email/choose` — the account, from those {@link EmailSignInChooseAccount} listed. */
|
|
365
|
+
export declare const emailSignInChooseRequestSchema: z.ZodObject<{
|
|
366
|
+
deviceName: z.ZodOptional<z.ZodString>;
|
|
367
|
+
deviceFingerprint: z.ZodOptional<z.ZodString>;
|
|
368
|
+
device: z.ZodOptional<z.ZodObject<{
|
|
369
|
+
deviceId: z.ZodString;
|
|
370
|
+
deviceSecret: z.ZodString;
|
|
371
|
+
}, "strip", z.ZodTypeAny, {
|
|
372
|
+
deviceId: string;
|
|
373
|
+
deviceSecret: string;
|
|
374
|
+
}, {
|
|
375
|
+
deviceId: string;
|
|
376
|
+
deviceSecret: string;
|
|
377
|
+
}>>;
|
|
378
|
+
requestId: z.ZodString;
|
|
379
|
+
requestSecret: z.ZodString;
|
|
380
|
+
userId: z.ZodString;
|
|
381
|
+
}, "strict", z.ZodTypeAny, {
|
|
382
|
+
userId: string;
|
|
383
|
+
requestId: string;
|
|
384
|
+
requestSecret: string;
|
|
385
|
+
device?: {
|
|
386
|
+
deviceId: string;
|
|
387
|
+
deviceSecret: string;
|
|
388
|
+
} | undefined;
|
|
389
|
+
deviceName?: string | undefined;
|
|
390
|
+
deviceFingerprint?: string | undefined;
|
|
391
|
+
}, {
|
|
392
|
+
userId: string;
|
|
393
|
+
requestId: string;
|
|
394
|
+
requestSecret: string;
|
|
395
|
+
device?: {
|
|
396
|
+
deviceId: string;
|
|
397
|
+
deviceSecret: string;
|
|
398
|
+
} | undefined;
|
|
399
|
+
deviceName?: string | undefined;
|
|
400
|
+
deviceFingerprint?: string | undefined;
|
|
401
|
+
}>;
|
|
402
|
+
export type EmailSignInChooseRequest = z.infer<typeof emailSignInChooseRequestSchema>;
|
|
370
403
|
/** `POST /users/me/reauth/email` */
|
|
371
404
|
export declare const reauthEmailStartRequestSchema: z.ZodObject<{
|
|
372
405
|
action: z.ZodEnum<["change_password", "totp", "link_commons", "delete_account", "credentials_manage"]>;
|
|
@@ -589,6 +622,7 @@ export declare const totpConfirmRequestSchema: z.ZodObject<{
|
|
|
589
622
|
totpCode?: string | undefined;
|
|
590
623
|
}>;
|
|
591
624
|
}, "strict", z.ZodTypeAny, {
|
|
625
|
+
code: string;
|
|
592
626
|
reauth: {
|
|
593
627
|
password?: string | undefined;
|
|
594
628
|
emailCode?: {
|
|
@@ -597,8 +631,8 @@ export declare const totpConfirmRequestSchema: z.ZodObject<{
|
|
|
597
631
|
} | undefined;
|
|
598
632
|
totpCode?: string | undefined;
|
|
599
633
|
};
|
|
600
|
-
code: string;
|
|
601
634
|
}, {
|
|
635
|
+
code: string;
|
|
602
636
|
reauth: {
|
|
603
637
|
password?: string | undefined;
|
|
604
638
|
emailCode?: {
|
|
@@ -607,7 +641,6 @@ export declare const totpConfirmRequestSchema: z.ZodObject<{
|
|
|
607
641
|
} | undefined;
|
|
608
642
|
totpCode?: string | undefined;
|
|
609
643
|
};
|
|
610
|
-
code: string;
|
|
611
644
|
}>;
|
|
612
645
|
export type TotpConfirmRequest = z.infer<typeof totpConfirmRequestSchema>;
|
|
613
646
|
/** `POST /users/me/totp/disable` and `POST /users/me/totp/backup-codes` */
|
|
@@ -680,38 +713,3 @@ export interface TotpBackupCodesResponse {
|
|
|
680
713
|
backupCodes: string[];
|
|
681
714
|
}
|
|
682
715
|
export declare const totpBackupCodesResponseSchema: z.ZodType<TotpBackupCodesResponse>;
|
|
683
|
-
/**
|
|
684
|
-
* Stable error codes (`error.code` in the API error body). Clients map these
|
|
685
|
-
* through their localization, never the English message.
|
|
686
|
-
*/
|
|
687
|
-
export declare const SIGN_IN_ERROR_CODES: {
|
|
688
|
-
/** Wrong identifier or password — never says which. */
|
|
689
|
-
readonly invalidCredentials: "SIGNIN_INVALID_CREDENTIALS";
|
|
690
|
-
/** The request is unknown, expired, spent, or its secret is wrong. */
|
|
691
|
-
readonly requestInvalid: "SIGNIN_REQUEST_INVALID";
|
|
692
|
-
/** The link is unknown, expired or already used. */
|
|
693
|
-
readonly linkInvalid: "SIGNIN_LINK_INVALID";
|
|
694
|
-
/** The link was opened in another browser: type the code in the app instead. */
|
|
695
|
-
readonly linkOtherDevice: "SIGNIN_LINK_OTHER_DEVICE";
|
|
696
|
-
/** The second-factor challenge or its code is wrong, expired or spent. */
|
|
697
|
-
readonly secondFactorInvalid: "SECOND_FACTOR_INVALID";
|
|
698
|
-
/** Too many failures for this account: wait and try again. */
|
|
699
|
-
readonly locked: "SIGNIN_LOCKED";
|
|
700
|
-
/** The step needs a fresh proof (`reauth`). */
|
|
701
|
-
readonly reauthRequired: "REAUTH_REQUIRED";
|
|
702
|
-
/** The fresh proof was wrong. */
|
|
703
|
-
readonly reauthInvalid: "REAUTH_INVALID";
|
|
704
|
-
/** The account has an authenticator: the proof must carry its code. */
|
|
705
|
-
readonly totpRequired: "TOTP_REQUIRED";
|
|
706
|
-
/** Enrolling or confirming an authenticator that is already on. */
|
|
707
|
-
readonly totpAlreadyEnabled: "TOTP_ALREADY_ENABLED";
|
|
708
|
-
/** Disabling, confirming or regenerating codes with no authenticator (or no pending one). */
|
|
709
|
-
readonly totpNotEnabled: "TOTP_NOT_ENABLED";
|
|
710
|
-
/** The code the authenticator showed at enrolment is wrong. */
|
|
711
|
-
readonly totpCodeInvalid: "TOTP_CODE_INVALID";
|
|
712
|
-
/** Only official Oxy apps and auth.oxy.so may sign people in here. */
|
|
713
|
-
readonly originNotAllowed: "SIGNIN_ORIGIN_NOT_ALLOWED";
|
|
714
|
-
/** The username is taken. */
|
|
715
|
-
readonly usernameTaken: "USERNAME_TAKEN";
|
|
716
|
-
};
|
|
717
|
-
export type SignInErrorCode = (typeof SIGN_IN_ERROR_CODES)[keyof typeof SIGN_IN_ERROR_CODES];
|