@8wave/ai-elements 0.114.0-beta.25 → 0.114.0-beta.30
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/_chunks/{PkToolShowSources-Sc1W6WHe.js → PkToolShowSources-Bfx-Th_j.js} +2 -2
- package/dist/_chunks/{PkToolShowSources-Sc1W6WHe.js.map → PkToolShowSources-Bfx-Th_j.js.map} +1 -1
- package/dist/_chunks/{markdown-BrvkrEUr.js → markdown-BL7WANiX.js} +10 -3
- package/dist/_chunks/markdown-BL7WANiX.js.map +1 -0
- package/dist/ai-elements.es.js +792 -353
- package/dist/ai-elements.es.js.map +1 -1
- package/dist-vue/PkChatbot.js +1 -1
- package/dist-vue/PkChatbotAuth.js +1 -1
- package/dist-vue/PkChatbotMessages.js +1 -1
- package/dist-vue/PkChatbotViewChat.js +1 -1
- package/dist-vue/PkChatbotViewFiles.js +1 -1
- package/dist-vue/_chunks/{Document-p2Y_4gk8.js → Document-nCWwJC2h.js} +10 -3
- package/dist-vue/_chunks/Document-nCWwJC2h.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbot-Dn_6yrFw.js → PkChatbot-CXQzBuxy.js} +3 -3
- package/dist-vue/_chunks/{PkChatbot-Dn_6yrFw.js.map → PkChatbot-CXQzBuxy.js.map} +1 -1
- package/dist-vue/_chunks/PkChatbotAuth-jzoNJkmH.js +421 -0
- package/dist-vue/_chunks/PkChatbotAuth-jzoNJkmH.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotMessages-Yaf_5xJV.js → PkChatbotMessages-KH5RE8Dk.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotMessages-Yaf_5xJV.js.map → PkChatbotMessages-KH5RE8Dk.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewChat-DFYw4nzP.js → PkChatbotViewChat-D5sfTMCW.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotViewChat-DFYw4nzP.js.map → PkChatbotViewChat-D5sfTMCW.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewFiles-BBBO5hyd.js → PkChatbotViewFiles-Bk9-K6Hw.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewFiles-BBBO5hyd.js.map → PkChatbotViewFiles-Bk9-K6Hw.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowDiagram-WyUnnDUn.js → PkToolShowDiagram-CztnTdq2.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowDiagram-WyUnnDUn.js.map → PkToolShowDiagram-CztnTdq2.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSources-BItTltB5.js → PkToolShowSources-CyR2GTiE.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowSources-BItTltB5.js.map → PkToolShowSources-CyR2GTiE.js.map} +1 -1
- package/dist-vue/apps/web-component/src/components/EmbeddedChatWidget.ce.d.ts +4 -4
- package/dist-vue/apps/web-component/src/composables/useChatbotAuth.d.ts +53 -5
- package/dist-vue/apps/web-component/src/composables/useChatbotAuthForm.d.ts +14 -0
- package/dist-vue/composables.js +333 -32
- package/dist-vue/composables.js.map +1 -1
- package/dist-vue/index.js +395 -367
- package/dist-vue/index.js.map +1 -1
- package/dist-vue/locales.js +24 -0
- package/dist-vue/packages/auth/src/additional-fields.d.ts +48 -0
- package/dist-vue/packages/auth/src/passkey-policy-client-plugin.d.ts +31 -0
- package/dist-vue/packages/auth/src/passkey-policy-plugin.d.ts +22 -0
- package/dist-vue/packages/auth/src/two-factor-policy-client-plugin.d.ts +60 -0
- package/dist-vue/packages/auth/src/two-factor-policy-plugin.d.ts +65 -0
- package/dist-vue/packages/components/src/PkQrCode.d.ts +14 -0
- package/dist-vue/packages/components/src/chat/PkChatbotAuth.d.ts +19 -0
- package/dist-vue/packages/components/src/index.d.ts +2 -1
- package/dist-vue/packages/models/src/schema/Document.d.ts +17 -0
- package/dist-vue/packages/models/src/schema/DocumentFolder.d.ts +10 -0
- package/dist-vue/packages/models/src/schema/DocumentSyncSource.d.ts +71 -1
- package/dist-vue/packages/models/src/schema/Member.d.ts +3 -0
- package/dist-vue/packages/models/src/schema/Notification.d.ts +6 -0
- package/dist-vue/packages/models/src/schema/Organization.d.ts +1 -0
- package/dist-vue/packages/models/src/schema/User.d.ts +1 -0
- package/dist-vue/style.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/markdown-BrvkrEUr.js.map +0 -1
- package/dist-vue/_chunks/Document-p2Y_4gk8.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotAuth-Bi508F1u.js +0 -349
- package/dist-vue/_chunks/PkChatbotAuth-Bi508F1u.js.map +0 -1
package/dist-vue/locales.js
CHANGED
|
@@ -471,6 +471,18 @@ var e = {
|
|
|
471
471
|
untitled: "Untitled file",
|
|
472
472
|
exclude: "Remove file"
|
|
473
473
|
},
|
|
474
|
+
twoFactor: {
|
|
475
|
+
challengeBackup: "Enter one of the backup codes you saved.",
|
|
476
|
+
challengeEmailSent: "We sent a 6-digit code to your email. It expires in 5 minutes.",
|
|
477
|
+
challengeApp: "Enter the 6-digit code from your authenticator app.",
|
|
478
|
+
challengeTitle: "Two-step verification",
|
|
479
|
+
backupCode: "Backup code",
|
|
480
|
+
code: "6-digit code",
|
|
481
|
+
verify: "Verify",
|
|
482
|
+
useBackupCode: "Use a backup code",
|
|
483
|
+
useApp: "Use the authenticator app",
|
|
484
|
+
sendAgain: "Send a new code"
|
|
485
|
+
},
|
|
474
486
|
auth: {
|
|
475
487
|
signInTitle: "Sign in to your account",
|
|
476
488
|
signUpTitle: "Create your account",
|
|
@@ -1049,6 +1061,18 @@ var e = {
|
|
|
1049
1061
|
untitled: "File senza nome",
|
|
1050
1062
|
exclude: "Rimuovi file"
|
|
1051
1063
|
},
|
|
1064
|
+
twoFactor: {
|
|
1065
|
+
challengeBackup: "Scrivi uno dei codici di recupero che hai salvato.",
|
|
1066
|
+
challengeEmailSent: "Ti abbiamo inviato un codice a 6 cifre via email. Scade fra 5 minuti.",
|
|
1067
|
+
challengeApp: "Scrivi il codice a 6 cifre della tua app di autenticazione.",
|
|
1068
|
+
challengeTitle: "Verifica in due passaggi",
|
|
1069
|
+
backupCode: "Codice di recupero",
|
|
1070
|
+
code: "Codice a 6 cifre",
|
|
1071
|
+
verify: "Verifica",
|
|
1072
|
+
useBackupCode: "Usa un codice di recupero",
|
|
1073
|
+
useApp: "Usa l'app di autenticazione",
|
|
1074
|
+
sendAgain: "Invia un nuovo codice"
|
|
1075
|
+
},
|
|
1052
1076
|
auth: {
|
|
1053
1077
|
signInTitle: "Accedi al tuo account",
|
|
1054
1078
|
signUpTitle: "Crea il tuo account",
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/** The columns the config adds to better-auth's session. */
|
|
2
|
+
export declare const sessionAdditionalFields: {
|
|
3
|
+
activeOrganizationId: {
|
|
4
|
+
type: "string";
|
|
5
|
+
};
|
|
6
|
+
impersonatedBy: {
|
|
7
|
+
type: "string";
|
|
8
|
+
};
|
|
9
|
+
organizationRole: {
|
|
10
|
+
type: "string";
|
|
11
|
+
};
|
|
12
|
+
hardExpiresAt: {
|
|
13
|
+
type: "date";
|
|
14
|
+
required: false;
|
|
15
|
+
input: false;
|
|
16
|
+
};
|
|
17
|
+
signedInWithPasskey: {
|
|
18
|
+
type: "boolean";
|
|
19
|
+
required: false;
|
|
20
|
+
input: false;
|
|
21
|
+
defaultValue: false;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
/** The columns the config adds to better-auth's user. */
|
|
25
|
+
export declare const userAdditionalFields: {
|
|
26
|
+
media: {
|
|
27
|
+
type: "json";
|
|
28
|
+
required: false;
|
|
29
|
+
};
|
|
30
|
+
phoneNumber: {
|
|
31
|
+
type: "string";
|
|
32
|
+
required: false;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* What `inferAdditionalFields` reads of the server options, for a client that
|
|
37
|
+
* must not load the config itself. The widget's type declarations are built
|
|
38
|
+
* from its imports, and the inferred type of the config, with the two-step
|
|
39
|
+
* verification and passkey plugins, is too long to serialize (TS7056).
|
|
40
|
+
*/
|
|
41
|
+
export type AdditionalFieldsOptions = {
|
|
42
|
+
session: {
|
|
43
|
+
additionalFields: typeof sessionAdditionalFields;
|
|
44
|
+
};
|
|
45
|
+
user: {
|
|
46
|
+
additionalFields: typeof userAdditionalFields;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { BetterFetch } from 'better-auth/client';
|
|
2
|
+
/**
|
|
3
|
+
* Client counterpart of the server `passkeyPolicy()` plugin, see
|
|
4
|
+
* docs/specs/two-factor-authentication.md, D10.
|
|
5
|
+
*/
|
|
6
|
+
export declare function passkeyPolicyClient(): {
|
|
7
|
+
id: "passkey-policy";
|
|
8
|
+
getActions: ($fetch: BetterFetch) => {
|
|
9
|
+
passkeyPolicy: {
|
|
10
|
+
/** Lets the session add a passkey for the next five minutes. */
|
|
11
|
+
confirmPassword: (data: {
|
|
12
|
+
password: string;
|
|
13
|
+
}) => Promise<{
|
|
14
|
+
data: null;
|
|
15
|
+
error: {
|
|
16
|
+
message?: string | undefined;
|
|
17
|
+
status: number;
|
|
18
|
+
statusText: string;
|
|
19
|
+
};
|
|
20
|
+
} | {
|
|
21
|
+
data: {
|
|
22
|
+
status: boolean;
|
|
23
|
+
};
|
|
24
|
+
error: null;
|
|
25
|
+
}>;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
pathMethods: {
|
|
29
|
+
'/passkey-policy/confirm-password': "POST";
|
|
30
|
+
};
|
|
31
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BetterAuthPlugin } from 'better-auth';
|
|
2
|
+
/** Whether a session created on this route is opened with a passkey. */
|
|
3
|
+
export declare function isPasskeySessionPath(path: string | undefined): boolean;
|
|
4
|
+
/**
|
|
5
|
+
* Refuses a passkey that did not check who holds it (a PIN, a fingerprint, a
|
|
6
|
+
* face). With that check a passkey is two factors on its own, which is what
|
|
7
|
+
* lets it stand in for the password and the code; without it, it is a key
|
|
8
|
+
* anyone holding the device can use. better-auth leaves the check off.
|
|
9
|
+
*/
|
|
10
|
+
export declare function requirePasskeyUserVerification(userVerified: boolean | undefined): void;
|
|
11
|
+
/**
|
|
12
|
+
* The confirmation that guards adding a passkey, the announcements of D7 for
|
|
13
|
+
* passkeys and the rate limit of the confirmation.
|
|
14
|
+
*
|
|
15
|
+
* A passkey signs in without the password and without the code, so adding
|
|
16
|
+
* one is as strong as setting the password: the session alone is not enough,
|
|
17
|
+
* since a stolen one would leave a way in that outlives it (there is no
|
|
18
|
+
* freshness window, see `freshAge` in packages/auth/src/index.ts). The
|
|
19
|
+
* password is asked again, or, for an account without one, a sign-in in the
|
|
20
|
+
* last ten minutes.
|
|
21
|
+
*/
|
|
22
|
+
export declare function passkeyPolicy(): BetterAuthPlugin;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { BetterFetch } from 'better-auth/client';
|
|
2
|
+
/** What `GET /two-factor-policy/status` answers. */
|
|
3
|
+
export interface TwoFactorStatus {
|
|
4
|
+
enabled: boolean;
|
|
5
|
+
/** `totp` for an authenticator app, `otp` for the code sent by email. */
|
|
6
|
+
method: 'totp' | 'otp' | null;
|
|
7
|
+
/** The second factor protects a password: without one it is not offered. */
|
|
8
|
+
hasPassword: boolean;
|
|
9
|
+
/** An organization of the user requires it and it is not set up yet. */
|
|
10
|
+
required: boolean;
|
|
11
|
+
/** The user's organizations that require it. */
|
|
12
|
+
requiredBy: {
|
|
13
|
+
id: string;
|
|
14
|
+
name: string;
|
|
15
|
+
}[];
|
|
16
|
+
/** Backup codes left, with an authenticator app; null otherwise. */
|
|
17
|
+
backupCodesRemaining: number | null;
|
|
18
|
+
/** Passkeys of the user: a session opened with one meets the policy. */
|
|
19
|
+
passkeys: number;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Client counterpart of the server `twoFactorPolicy()` plugin, see
|
|
23
|
+
* docs/specs/two-factor-authentication.md.
|
|
24
|
+
*/
|
|
25
|
+
export declare function twoFactorPolicyClient(): {
|
|
26
|
+
id: "two-factor-policy";
|
|
27
|
+
getActions: ($fetch: BetterFetch) => {
|
|
28
|
+
twoFactorPolicy: {
|
|
29
|
+
status: () => Promise<{
|
|
30
|
+
data: null;
|
|
31
|
+
error: {
|
|
32
|
+
message?: string | undefined;
|
|
33
|
+
status: number;
|
|
34
|
+
statusText: string;
|
|
35
|
+
};
|
|
36
|
+
} | {
|
|
37
|
+
data: TwoFactorStatus;
|
|
38
|
+
error: null;
|
|
39
|
+
}>;
|
|
40
|
+
reset: (data: {
|
|
41
|
+
userId: string;
|
|
42
|
+
}) => Promise<{
|
|
43
|
+
data: null;
|
|
44
|
+
error: {
|
|
45
|
+
message?: string | undefined;
|
|
46
|
+
status: number;
|
|
47
|
+
statusText: string;
|
|
48
|
+
};
|
|
49
|
+
} | {
|
|
50
|
+
data: {
|
|
51
|
+
status: boolean;
|
|
52
|
+
};
|
|
53
|
+
error: null;
|
|
54
|
+
}>;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
pathMethods: {
|
|
58
|
+
'/two-factor-policy/reset': "POST";
|
|
59
|
+
};
|
|
60
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { BetterAuthPlugin } from 'better-auth';
|
|
2
|
+
import { createAuthMiddleware } from 'better-auth/api';
|
|
3
|
+
import { TwoFactorChange } from 'email';
|
|
4
|
+
/**
|
|
5
|
+
* Carries the challenge for a client that cannot hold the cookie: the widget,
|
|
6
|
+
* cross-origin and on bearer tokens (D4). The value is the signed cookie as
|
|
7
|
+
* the sign-in set it.
|
|
8
|
+
*/
|
|
9
|
+
export declare const TWO_FACTOR_TOKEN_HEADER = "x-two-factor-token";
|
|
10
|
+
/** Time the code sent by email stays valid, in minutes. */
|
|
11
|
+
export declare const TWO_FACTOR_OTP_PERIOD_MINUTES = 5;
|
|
12
|
+
type ChangedUser = {
|
|
13
|
+
id: string;
|
|
14
|
+
email: string;
|
|
15
|
+
name: string;
|
|
16
|
+
};
|
|
17
|
+
export type MiddlewareContext = Parameters<Parameters<typeof createAuthMiddleware>[0]>[0];
|
|
18
|
+
/**
|
|
19
|
+
* Tells the user that their second factor or their passkeys changed (D7, D10),
|
|
20
|
+
* by email and in the notification panel. Never throws: the change is already
|
|
21
|
+
* written.
|
|
22
|
+
*/
|
|
23
|
+
export declare function announceTwoFactorChange(user: ChangedUser, change: TwoFactorChange): Promise<void>;
|
|
24
|
+
type PolicyOrganization = {
|
|
25
|
+
requireTwoFactor?: boolean | null;
|
|
26
|
+
deleted?: boolean | null;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Whether the request has to stop for the organization policy (D6): the
|
|
30
|
+
* session of a member of an organization that requires a second factor, who
|
|
31
|
+
* signs in with a password and has none. `organizations` is what the caller
|
|
32
|
+
* already listed for the request, so the common case costs no query, or a
|
|
33
|
+
* loader that runs only once the cheap exemptions are past; the password
|
|
34
|
+
* check is cached, since most users have no second factor. Impersonation and
|
|
35
|
+
* anonymous sessions are exempt, and so is a deleted organization, which the
|
|
36
|
+
* status endpoint does not list either: counted here alone, it would bounce
|
|
37
|
+
* the user between the setup page and the app.
|
|
38
|
+
*
|
|
39
|
+
* A session opened with a passkey meets the policy (D10), and so does a user
|
|
40
|
+
* with a passkey where no session tells how they signed in: a Platform MCP
|
|
41
|
+
* token, whose authorization ran in a session the policy let through.
|
|
42
|
+
*/
|
|
43
|
+
export declare function isTwoFactorSetupRequiredForSession(input: {
|
|
44
|
+
user: {
|
|
45
|
+
id: string;
|
|
46
|
+
twoFactorEnabled?: boolean | null;
|
|
47
|
+
isAnonymous?: boolean | null;
|
|
48
|
+
hasPasskey?: boolean;
|
|
49
|
+
};
|
|
50
|
+
session: {
|
|
51
|
+
impersonatedBy?: string | null;
|
|
52
|
+
signedInWithPasskey?: boolean | null;
|
|
53
|
+
};
|
|
54
|
+
organizations: readonly PolicyOrganization[] | (() => Promise<readonly PolicyOrganization[]>);
|
|
55
|
+
}): Promise<boolean>;
|
|
56
|
+
/**
|
|
57
|
+
* The status endpoint, the administrator reset, the widget bridge and the
|
|
58
|
+
* announcements of docs/specs/two-factor-authentication.md.
|
|
59
|
+
*
|
|
60
|
+
* The endpoints live under `/two-factor-policy/` and not `/two-factor/` on
|
|
61
|
+
* purpose: the `twoFactor` plugin rate limits its prefix to three requests
|
|
62
|
+
* every ten seconds, which a profile page reading the status would hit.
|
|
63
|
+
*/
|
|
64
|
+
export declare function twoFactorPolicy(): BetterAuthPlugin;
|
|
65
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* A QR code drawn as inline SVG, with `qrcode` loaded on first use. The
|
|
4
|
+
* code stays dark on a white ground whatever the theme: a scanner reads
|
|
5
|
+
* the contrast, and not every one reads it inverted.
|
|
6
|
+
*/
|
|
7
|
+
type __VLS_Props = {
|
|
8
|
+
value: string;
|
|
9
|
+
/** What the code holds, for a screen reader. */
|
|
10
|
+
label: string;
|
|
11
|
+
};
|
|
12
|
+
declare const __VLS_export: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
declare const _default: typeof __VLS_export;
|
|
14
|
+
export default _default;
|
|
@@ -4,6 +4,12 @@ type __VLS_Props = {
|
|
|
4
4
|
branding?: AgentBranding;
|
|
5
5
|
authMethods?: AuthMethods;
|
|
6
6
|
loading?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Set while an email sign-in waits for its second factor: the
|
|
9
|
+
* methods the account has (`totp`, `otp`). The code step replaces
|
|
10
|
+
* the forms until it is answered or cancelled.
|
|
11
|
+
*/
|
|
12
|
+
twoFactorMethods?: string[];
|
|
7
13
|
};
|
|
8
14
|
type __VLS_ModelProps = {
|
|
9
15
|
'errorMessage'?: string | undefined;
|
|
@@ -43,6 +49,12 @@ declare const __VLS_export: DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, C
|
|
|
43
49
|
email: string;
|
|
44
50
|
}) => any;
|
|
45
51
|
social: (provider: "google" | "microsoft") => any;
|
|
52
|
+
"verify-two-factor": (payload: {
|
|
53
|
+
kind: "totp" | "otp" | "backup";
|
|
54
|
+
code: string;
|
|
55
|
+
}) => any;
|
|
56
|
+
"send-two-factor-code": () => any;
|
|
57
|
+
"cancel-two-factor": () => any;
|
|
46
58
|
}, string, PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
47
59
|
"onUpdate:errorMessage"?: ((message?: string | undefined) => any) | undefined;
|
|
48
60
|
"onUpdate:success"?: ((value?: {
|
|
@@ -63,10 +75,17 @@ declare const __VLS_export: DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, C
|
|
|
63
75
|
email: string;
|
|
64
76
|
}) => any) | undefined;
|
|
65
77
|
onSocial?: ((provider: "google" | "microsoft") => any) | undefined;
|
|
78
|
+
"onVerify-two-factor"?: ((payload: {
|
|
79
|
+
kind: "totp" | "otp" | "backup";
|
|
80
|
+
code: string;
|
|
81
|
+
}) => any) | undefined;
|
|
82
|
+
"onSend-two-factor-code"?: (() => any) | undefined;
|
|
83
|
+
"onCancel-two-factor"?: (() => any) | undefined;
|
|
66
84
|
}>, {
|
|
67
85
|
branding: AgentBranding;
|
|
68
86
|
authMethods: AuthMethods;
|
|
69
87
|
loading: boolean;
|
|
88
|
+
twoFactorMethods: string[];
|
|
70
89
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
71
90
|
declare const _default: typeof __VLS_export;
|
|
72
91
|
export default _default;
|
|
@@ -22,6 +22,7 @@ import { default as PkLoader } from './PkLoader';
|
|
|
22
22
|
import { default as PkMedia } from './PkMedia';
|
|
23
23
|
import { default as PkOfflineScreen } from './PkOfflineScreen';
|
|
24
24
|
import { default as PkPwaNotices } from './PkPwaNotices';
|
|
25
|
+
import { default as PkQrCode } from './PkQrCode';
|
|
25
26
|
import { default as PkRelativeTime } from './PkRelativeTime';
|
|
26
27
|
import { default as PkSkeleton } from './PkSkeleton';
|
|
27
28
|
import { default as PkSvgViewer } from './PkSvgViewer';
|
|
@@ -32,4 +33,4 @@ export * from './chat';
|
|
|
32
33
|
export * from './input';
|
|
33
34
|
export * from './table';
|
|
34
35
|
export * from './types';
|
|
35
|
-
export { PkBadge, PkEditorAgentType, PkEditorDocumentType, PkEditorNotificationType, PkEditorCode, PkEditorJsonSchema, PkEditorMarkdown, PkEditorMedia, PkEditorPrompt, PkEditorRadioButtons, PkEditorCheckboxButtons, PkEditorRepeater, PkEditorWyswyg, PkCheckboxField, PkFieldset, PkInfobox, PkSchemaField, PkIntegrationProvider, PkLazyImg, PkLightbox, PkLoader, PkMedia, PkOfflineScreen, PkPwaNotices, PkRelativeTime, PkSkeleton, PkSvgViewer, PkUrl, };
|
|
36
|
+
export { PkBadge, PkEditorAgentType, PkEditorDocumentType, PkEditorNotificationType, PkEditorCode, PkEditorJsonSchema, PkEditorMarkdown, PkEditorMedia, PkEditorPrompt, PkEditorRadioButtons, PkEditorCheckboxButtons, PkEditorRepeater, PkEditorWyswyg, PkCheckboxField, PkFieldset, PkInfobox, PkSchemaField, PkIntegrationProvider, PkLazyImg, PkLightbox, PkLoader, PkMedia, PkOfflineScreen, PkPwaNotices, PkQrCode, PkRelativeTime, PkSkeleton, PkSvgViewer, PkUrl, };
|
|
@@ -118,6 +118,8 @@ declare const WebDocumentSourceSchema: z.ZodObject<{
|
|
|
118
118
|
extractionInputHash: z.ZodOptional<z.ZodString>;
|
|
119
119
|
finalUrl: z.ZodOptional<z.ZodString>;
|
|
120
120
|
sourceId: z.ZodOptional<z.ZodUUID>;
|
|
121
|
+
lastSyncedAt: z.ZodOptional<z.ZodString>;
|
|
122
|
+
lastmod: z.ZodOptional<z.ZodString>;
|
|
121
123
|
}, z.core.$strip>;
|
|
122
124
|
/**
|
|
123
125
|
* `metadata.source`, discriminated on `provider`.
|
|
@@ -149,6 +151,8 @@ export declare const DocumentSourceSchema: z.ZodPreprocess<z.ZodDiscriminatedUni
|
|
|
149
151
|
extractionInputHash: z.ZodOptional<z.ZodString>;
|
|
150
152
|
finalUrl: z.ZodOptional<z.ZodString>;
|
|
151
153
|
sourceId: z.ZodOptional<z.ZodUUID>;
|
|
154
|
+
lastSyncedAt: z.ZodOptional<z.ZodString>;
|
|
155
|
+
lastmod: z.ZodOptional<z.ZodString>;
|
|
152
156
|
}, z.core.$strip>, z.ZodObject<{
|
|
153
157
|
contentHash: z.ZodOptional<z.ZodString>;
|
|
154
158
|
lastRefresh: z.ZodOptional<z.ZodObject<{
|
|
@@ -424,6 +428,14 @@ export interface DocumentProcessingJob {
|
|
|
424
428
|
* that really did get shorter, so the guard would only stand in their way.
|
|
425
429
|
*/
|
|
426
430
|
guarded?: boolean;
|
|
431
|
+
/**
|
|
432
|
+
* The web source whose sitemap asked for this early refresh. Nobody is
|
|
433
|
+
* watching it either, so it enforces the shrink guard; and it is void if
|
|
434
|
+
* the page no longer belongs to that source, which is what editing its text
|
|
435
|
+
* by hand does. Not `guarded`, which also voids a page without a trigger:
|
|
436
|
+
* a source reads its pages whether they have one or not.
|
|
437
|
+
*/
|
|
438
|
+
sourceId?: string;
|
|
427
439
|
}
|
|
428
440
|
/**
|
|
429
441
|
* Metadata structure for document.metadata column
|
|
@@ -447,6 +459,8 @@ export declare const DocumentMetadataSchema: z.ZodObject<{
|
|
|
447
459
|
extractionInputHash: z.ZodOptional<z.ZodString>;
|
|
448
460
|
finalUrl: z.ZodOptional<z.ZodString>;
|
|
449
461
|
sourceId: z.ZodOptional<z.ZodUUID>;
|
|
462
|
+
lastSyncedAt: z.ZodOptional<z.ZodString>;
|
|
463
|
+
lastmod: z.ZodOptional<z.ZodString>;
|
|
450
464
|
}, z.core.$strip>, z.ZodObject<{
|
|
451
465
|
contentHash: z.ZodOptional<z.ZodString>;
|
|
452
466
|
lastRefresh: z.ZodOptional<z.ZodObject<{
|
|
@@ -883,6 +897,8 @@ export declare const DocumentSchema: z.ZodObject<{
|
|
|
883
897
|
extractionInputHash: z.ZodOptional<z.ZodString>;
|
|
884
898
|
finalUrl: z.ZodOptional<z.ZodString>;
|
|
885
899
|
sourceId: z.ZodOptional<z.ZodUUID>;
|
|
900
|
+
lastSyncedAt: z.ZodOptional<z.ZodString>;
|
|
901
|
+
lastmod: z.ZodOptional<z.ZodString>;
|
|
886
902
|
}, z.core.$strip>, z.ZodObject<{
|
|
887
903
|
contentHash: z.ZodOptional<z.ZodString>;
|
|
888
904
|
lastRefresh: z.ZodOptional<z.ZodObject<{
|
|
@@ -1426,6 +1442,7 @@ export declare const DocumentCreateDtoSchema: z.ZodObject<{
|
|
|
1426
1442
|
pages: z.ZodOptional<z.ZodString>;
|
|
1427
1443
|
priority: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
1428
1444
|
refreshInterval: z.ZodOptional<z.ZodNullable<z.ZodEnum<typeof DocumentRefreshInterval>>>;
|
|
1445
|
+
syncSourceId: z.ZodOptional<z.ZodUUID>;
|
|
1429
1446
|
}, z.core.$strip>;
|
|
1430
1447
|
/**
|
|
1431
1448
|
* Document update schema for PUT /documents/:id endpoint
|
|
@@ -39,6 +39,16 @@ export type DocumentFolder = z.infer<typeof DocumentFolderSchema>;
|
|
|
39
39
|
* business, which is why it reads the first segment and stops.
|
|
40
40
|
*/
|
|
41
41
|
export declare function documentFolderProvider(folder: Pick<DocumentFolder, 'externalId'>): DocumentSourceProvider | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* Whether a folder is read-only because a source that owns its documents
|
|
44
|
+
* fills it.
|
|
45
|
+
*
|
|
46
|
+
* Not the same question as `documentFolderProvider`: a web source's folder has
|
|
47
|
+
* a provider, and an icon and a badge that say so, but its pages stay editable
|
|
48
|
+
* and anything can be added to it. The backend answers the same question with
|
|
49
|
+
* `owningSourceCondition`, from the same policy.
|
|
50
|
+
*/
|
|
51
|
+
export declare function documentFolderIsReadOnly(folder: Pick<DocumentFolder, 'externalId'>): boolean;
|
|
42
52
|
export type DocumentFolderCreateDto = z.infer<typeof DocumentFolderCreateDtoSchema>;
|
|
43
53
|
export type DocumentFolderUpdateDto = z.infer<typeof DocumentFolderUpdateDtoSchema>;
|
|
44
54
|
export type DocumentFolderQuerystring = z.infer<typeof DocumentFolderQuerystringSchema>;
|
|
@@ -1,5 +1,32 @@
|
|
|
1
|
-
import { DocumentSourceProvider } from './Document';
|
|
1
|
+
import { DocumentRefreshInterval, DocumentSourceProvider } from './Document';
|
|
2
2
|
import * as z from 'zod';
|
|
3
|
+
/**
|
|
4
|
+
* What a provider's sources do with the documents they bring in.
|
|
5
|
+
*
|
|
6
|
+
* - `materialize`: `download` stores the remote file in a blob and makes a
|
|
7
|
+
* `file` document of it; `url` makes a `url` document and leaves the reading
|
|
8
|
+
* to the processor, so there is nothing to download.
|
|
9
|
+
* - `ownsDocuments`: true makes the source's folder read-only and propagates
|
|
10
|
+
* remote deletions; false only discovers, and the documents stay as
|
|
11
|
+
* editable as anything a person imported.
|
|
12
|
+
*
|
|
13
|
+
* These two values are everything the backend, the sync function and the
|
|
14
|
+
* interface read to decide how a document is created and whether it can be
|
|
15
|
+
* touched by hand. A web source that removes the pages leaving its sitemap does
|
|
16
|
+
* so through an option of that source, not by owning its documents.
|
|
17
|
+
*/
|
|
18
|
+
export interface DocumentSourcePolicy {
|
|
19
|
+
materialize: 'download' | 'url';
|
|
20
|
+
ownsDocuments: boolean;
|
|
21
|
+
}
|
|
22
|
+
export declare const DOCUMENT_SOURCE_POLICIES: Record<DocumentSourceProvider, DocumentSourcePolicy>;
|
|
23
|
+
/**
|
|
24
|
+
* Whether a provider's sources govern their documents.
|
|
25
|
+
*
|
|
26
|
+
* An unknown provider counts as owning: the mistake in that direction makes a
|
|
27
|
+
* folder read-only, the other one lets people edit what a job will overwrite.
|
|
28
|
+
*/
|
|
29
|
+
export declare function sourceOwnsDocuments(provider: string): boolean;
|
|
3
30
|
/**
|
|
4
31
|
* How often a source is checked.
|
|
5
32
|
*
|
|
@@ -96,8 +123,42 @@ export declare const DocumentSyncRunStatsSchema: z.ZodObject<{
|
|
|
96
123
|
skippedUnsupported: z.ZodDefault<z.ZodNumber>;
|
|
97
124
|
skippedTooLarge: z.ZodDefault<z.ZodNumber>;
|
|
98
125
|
failed: z.ZodDefault<z.ZodNumber>;
|
|
126
|
+
capped: z.ZodDefault<z.ZodNumber>;
|
|
127
|
+
removalHeld: z.ZodDefault<z.ZodNumber>;
|
|
99
128
|
}, z.core.$strip>;
|
|
100
129
|
export type DocumentSyncRunStats = z.infer<typeof DocumentSyncRunStatsSchema>;
|
|
130
|
+
/**
|
|
131
|
+
* Where a web source reads its pages: a sitemap, or a walk from one page.
|
|
132
|
+
*
|
|
133
|
+
* The same fields as the crawler dialog's two modes, because the source is
|
|
134
|
+
* that dialog's parameters saved.
|
|
135
|
+
*/
|
|
136
|
+
export declare const WebSourceRemoteSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
137
|
+
sitemapUrl: z.ZodURL;
|
|
138
|
+
kind: z.ZodLiteral<"sitemap">;
|
|
139
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
140
|
+
startUrl: z.ZodURL;
|
|
141
|
+
maxPages: z.ZodDefault<z.ZodNumber>;
|
|
142
|
+
maxDepth: z.ZodDefault<z.ZodNumber>;
|
|
143
|
+
followExternal: z.ZodDefault<z.ZodBoolean>;
|
|
144
|
+
kind: z.ZodLiteral<"depth">;
|
|
145
|
+
}, z.core.$strip>], "kind">;
|
|
146
|
+
export type WebSourceRemote = z.infer<typeof WebSourceRemoteSchema>;
|
|
147
|
+
/**
|
|
148
|
+
* The keys of a web source's `options` that are about the source rather than
|
|
149
|
+
* about converting a page. Everything else in `options` is conversion options,
|
|
150
|
+
* handed to the processor as they are.
|
|
151
|
+
*/
|
|
152
|
+
export declare const WebSourceOptionsSchema: z.ZodObject<{
|
|
153
|
+
refreshInterval: z.ZodOptional<z.ZodNullable<z.ZodEnum<typeof DocumentRefreshInterval>>>;
|
|
154
|
+
removeMissing: z.ZodOptional<z.ZodBoolean>;
|
|
155
|
+
confirmedRemovals: z.ZodOptional<z.ZodNumber>;
|
|
156
|
+
}, z.core.$loose>;
|
|
157
|
+
export type WebSourceOptions = z.infer<typeof WebSourceOptionsSchema>;
|
|
158
|
+
/** The `options` keys that never reach the processor as conversion options. */
|
|
159
|
+
export declare const WEB_SOURCE_OWN_OPTION_KEYS: readonly ["refreshInterval", "removeMissing", "confirmedRemovals"];
|
|
160
|
+
/** The URL a web source reads, whichever mode it is in. */
|
|
161
|
+
export declare function webSourceUrl(remote: Record<string, unknown>): string;
|
|
101
162
|
export declare const DocumentSyncSourceSchema: z.ZodObject<{
|
|
102
163
|
id: z.ZodUUID;
|
|
103
164
|
organizationId: z.ZodUUID;
|
|
@@ -123,6 +184,8 @@ export declare const DocumentSyncSourceSchema: z.ZodObject<{
|
|
|
123
184
|
skippedUnsupported: z.ZodDefault<z.ZodNumber>;
|
|
124
185
|
skippedTooLarge: z.ZodDefault<z.ZodNumber>;
|
|
125
186
|
failed: z.ZodDefault<z.ZodNumber>;
|
|
187
|
+
capped: z.ZodDefault<z.ZodNumber>;
|
|
188
|
+
removalHeld: z.ZodDefault<z.ZodNumber>;
|
|
126
189
|
}, z.core.$strip>>;
|
|
127
190
|
lastSyncAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
128
191
|
lastError: z.ZodNullable<z.ZodString>;
|
|
@@ -149,13 +212,20 @@ export declare const DocumentSyncSourceCreateDtoSchema: z.ZodObject<{
|
|
|
149
212
|
remote: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
150
213
|
interval: z.ZodDefault<z.ZodEnum<typeof DocumentSyncInterval>>;
|
|
151
214
|
options: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
215
|
+
deferFirstRun: z.ZodOptional<z.ZodBoolean>;
|
|
152
216
|
}, z.core.$strip>;
|
|
153
217
|
export type DocumentSyncSourceCreateDto = z.infer<typeof DocumentSyncSourceCreateDtoSchema>;
|
|
154
218
|
export declare const DocumentSyncSourceUpdateDtoSchema: z.ZodObject<{
|
|
155
219
|
interval: z.ZodOptional<z.ZodEnum<typeof DocumentSyncInterval>>;
|
|
156
220
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
221
|
+
removeMissing: z.ZodOptional<z.ZodBoolean>;
|
|
157
222
|
}, z.core.$strip>;
|
|
158
223
|
export type DocumentSyncSourceUpdateDto = z.infer<typeof DocumentSyncSourceUpdateDtoSchema>;
|
|
224
|
+
/** "Sync now", optionally approving the removal the last run held back. */
|
|
225
|
+
export declare const DocumentSyncSourceSyncDtoSchema: z.ZodObject<{
|
|
226
|
+
confirmRemovals: z.ZodOptional<z.ZodNumber>;
|
|
227
|
+
}, z.core.$strip>;
|
|
228
|
+
export type DocumentSyncSourceSyncDto = z.infer<typeof DocumentSyncSourceSyncDtoSchema>;
|
|
159
229
|
export declare const DocumentSyncSourceQuerystringSchema: z.ZodObject<{
|
|
160
230
|
agentId: z.ZodUUID;
|
|
161
231
|
}, z.core.$strip>;
|
|
@@ -119,6 +119,9 @@ export declare const MemberSchema: z.ZodObject<{
|
|
|
119
119
|
user: "user";
|
|
120
120
|
admin: "admin";
|
|
121
121
|
}>;
|
|
122
|
+
twoFactorEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
123
|
+
hasPassword: z.ZodOptional<z.ZodBoolean>;
|
|
124
|
+
hasPasskey: z.ZodOptional<z.ZodBoolean>;
|
|
122
125
|
}, z.core.$strip>;
|
|
123
126
|
}, z.core.$strip>;
|
|
124
127
|
export type Member = z.infer<typeof MemberSchema>;
|
|
@@ -4,8 +4,14 @@ export declare const NotificationType: {
|
|
|
4
4
|
readonly ApiKeyExpiring: "api_key_expiring";
|
|
5
5
|
readonly Organization: "organization";
|
|
6
6
|
readonly PasswordResetRequested: "password_reset_requested";
|
|
7
|
+
/** Two-step verification turned on, off, or reset by an administrator. */
|
|
8
|
+
readonly TwoFactor: "two_factor";
|
|
7
9
|
/** A sync took documents out because the remote no longer has them. */
|
|
8
10
|
readonly DocumentSyncRemoved: "document_sync_removed";
|
|
11
|
+
/** A web source took out pages its sitemap no longer lists. */
|
|
12
|
+
readonly WebSourcePagesRemoved: "web_source_pages_removed";
|
|
13
|
+
/** A web source held back a removal too large to trust without a person. */
|
|
14
|
+
readonly WebSourceRemovalHeld: "web_source_removal_held";
|
|
9
15
|
readonly ChatWarning: "chat_warning";
|
|
10
16
|
readonly ChatBlocked: "chat_blocked";
|
|
11
17
|
readonly Generic: "generic";
|
|
@@ -106,6 +106,7 @@ export declare const OrganizationSchema: z.ZodObject<{
|
|
|
106
106
|
deletedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
107
107
|
deletedBy: z.ZodNullable<z.ZodString>;
|
|
108
108
|
metadata: z.ZodNullable<z.ZodString>;
|
|
109
|
+
requireTwoFactor: z.ZodOptional<z.ZodBoolean>;
|
|
109
110
|
}, z.core.$strip>;
|
|
110
111
|
export type Organization = z.infer<typeof OrganizationSchema>;
|
|
111
112
|
export declare const OrganizationDtoSchema: z.ZodObject<{
|