@oneclick.dev/cms-core-modules 0.0.123 → 0.0.124
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/{ContentEditor-C-Wm48ai.js → ContentEditor-BcIUumah.js} +39 -39
- package/dist/{ContentEditor-MDGolnIP.mjs → ContentEditor-DX1bTQKs.mjs} +4910 -4793
- package/dist/{Detail-Dk8E6_uF.mjs → Detail-B7pe808q.mjs} +15 -14
- package/dist/Detail-BESGmY7z.js +1 -0
- package/dist/{Detail-Cn9Bk0u0.mjs → Detail-B_Q7Qkuz.mjs} +26 -25
- package/dist/Detail-CNiLIEh9.js +1 -0
- package/dist/{Detail-B_scnidb.mjs → Detail-DNxAzeCs.mjs} +35 -34
- package/dist/Detail-t3tOcy3X.js +1 -0
- package/dist/Editor-D4evcdhv.mjs +768 -0
- package/dist/Editor-gLLtuJbY.js +1 -0
- package/dist/FormStatusBadge.vue_vue_type_script_setup_true_lang-BjKpsqT9.js +1 -0
- package/dist/FormStatusBadge.vue_vue_type_script_setup_true_lang-D5v5AhLe.mjs +76 -0
- package/dist/Knowledge-B66vxz--.js +1 -0
- package/dist/Knowledge-BnMTTuJ7.mjs +742 -0
- package/dist/Overview-BE4uYPx0.mjs +745 -0
- package/dist/Overview-CQRpFhbJ.mjs +286 -0
- package/dist/Overview-CTs7sX4d.js +1 -0
- package/dist/Overview-Cj89XXKN.js +1 -0
- package/dist/Overview-D_c18mbR.mjs +248 -0
- package/dist/Overview-g4Rcj245.js +1 -0
- package/dist/TableView-6mdrL3zx.js +4 -0
- package/dist/{TableView-C4Zyp8d7.mjs → TableView-Du5nOE6R.mjs} +2 -2
- package/dist/Test-CzmOmi53.mjs +447 -0
- package/dist/Test-USDtNFY1.js +1 -0
- package/dist/UserDetail-DpUL3mhk.mjs +1483 -0
- package/dist/UserDetail-KRIfxaYd.js +1 -0
- package/dist/cms-core-modules.css +1 -1
- package/dist/index-CQuN5rKx.js +1 -0
- package/dist/index-CnDGeInm.js +1 -0
- package/dist/index-CqDTc5Ig.mjs +20 -0
- package/dist/index-CyvvAdt4.js +1 -0
- package/dist/index-DIRD7t5_.mjs +20 -0
- package/dist/index-OJuBYR60.mjs +57 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.mjs +327 -84
- package/dist/server-handlers.cjs.js +1 -1
- package/dist/server-handlers.mjs +1764 -605
- package/dist/src/contentManager/components/content-editor/tiptap-extensions/Container.d.ts +1 -1
- package/dist/src/contentManager/components/content-editor/tiptap-extensions/Row.d.ts +7 -0
- package/dist/src/contentManager/components/content-editor/tiptap-extensions/Stack.d.ts +7 -0
- package/dist/src/contentManager/components/content-editor/tiptap-extensions/helpers/resizeHistory.d.ts +9 -0
- package/dist/src/contentManager/components/content-editor/tiptap-menus/ElementEditorMenu.vue.d.ts +3 -1
- package/dist/src/firebaseAuthManager/components/DeleteUserDialog.vue.d.ts +25 -0
- package/dist/src/firebaseAuthManager/components/ReasonActionDialog.vue.d.ts +23 -0
- package/dist/src/firebaseAuthManager/components/UserStatusBadge.vue.d.ts +5 -0
- package/dist/src/firebaseAuthManager/config.d.ts +151 -0
- package/dist/src/firebaseAuthManager/index.d.ts +163 -0
- package/dist/src/firebaseAuthManager/index.vue.d.ts +14 -0
- package/dist/src/firebaseAuthManager/metadata.d.ts +2 -0
- package/dist/src/firebaseAuthManager/pages/Overview.vue.d.ts +2 -0
- package/dist/src/firebaseAuthManager/pages/UserDetail.vue.d.ts +2 -0
- package/dist/src/firebaseAuthManager/permissions.d.ts +5 -0
- package/dist/src/firebaseAuthManager/routes.d.ts +5 -0
- package/dist/src/firebaseAuthManager/server.d.ts +162 -0
- package/dist/src/firebaseAuthManager/types.d.ts +84 -0
- package/dist/src/formBuilder/components/FormPreviewDialog.vue.d.ts +12 -0
- package/dist/src/formBuilder/components/FormStatusBadge.vue.d.ts +9 -0
- package/dist/src/formBuilder/config.d.ts +31 -0
- package/dist/src/formBuilder/index.d.ts +44 -0
- package/dist/src/formBuilder/index.vue.d.ts +14 -0
- package/dist/src/formBuilder/lib/forms.d.ts +11 -0
- package/dist/src/formBuilder/metadata.d.ts +2 -0
- package/dist/src/formBuilder/pages/Editor.vue.d.ts +2 -0
- package/dist/src/formBuilder/pages/Overview.vue.d.ts +2 -0
- package/dist/src/formBuilder/permissions.d.ts +5 -0
- package/dist/src/formBuilder/routes.d.ts +5 -0
- package/dist/src/formBuilder/server.d.ts +87 -0
- package/dist/src/formBuilder/tools.d.ts +1 -0
- package/dist/src/formBuilder/types.d.ts +46 -0
- package/dist/src/helpbot/composables/useHelpbotApi.d.ts +18 -0
- package/dist/src/helpbot/config.d.ts +17 -0
- package/dist/src/helpbot/index.d.ts +29 -0
- package/dist/src/helpbot/index.vue.d.ts +2 -0
- package/dist/src/helpbot/metadata.d.ts +2 -0
- package/dist/src/helpbot/pages/Knowledge.vue.d.ts +4 -0
- package/dist/src/helpbot/pages/Overview.vue.d.ts +2 -0
- package/dist/src/helpbot/pages/Test.vue.d.ts +4 -0
- package/dist/src/helpbot/permissions.d.ts +5 -0
- package/dist/src/helpbot/routes.d.ts +5 -0
- package/dist/src/helpbot/types.d.ts +42 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/src/server-handlers.d.ts +2 -0
- package/dist/types-9N-DKxNj.mjs +250 -0
- package/dist/types-BMraG1kN.js +1 -0
- package/dist/types-Cem0vPo_.js +1 -0
- package/dist/types-ibC3-e1N.mjs +2630 -0
- package/dist/useHelpbotApi-BIIungOh.js +1 -0
- package/dist/useHelpbotApi-HC9JSiSn.mjs +229 -0
- package/dist/vee-validate-zod-BQElPD0m.js +1 -0
- package/dist/vee-validate-zod-CN16K2x9.mjs +1780 -0
- package/package.json +2 -2
- package/src/formBuilder/tools.ts +1 -0
- package/dist/Detail-BCUUNWvp.js +0 -1
- package/dist/Detail-DGg_xXZc.js +0 -1
- package/dist/Detail-Sc2qZdxj.js +0 -1
- package/dist/TableView-BkwoKREo.js +0 -4
- package/dist/vee-validate-zod-SjDT8X35.mjs +0 -4404
- package/dist/vee-validate-zod-VCmLnrtQ.js +0 -1
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
export interface FirebaseAuthProfile {
|
|
2
|
+
enabled: boolean;
|
|
3
|
+
exists: boolean;
|
|
4
|
+
name: string | null;
|
|
5
|
+
email: string | null;
|
|
6
|
+
role: string | null;
|
|
7
|
+
status: string | null;
|
|
8
|
+
}
|
|
9
|
+
export interface FirebaseAuthUser {
|
|
10
|
+
uid: string;
|
|
11
|
+
displayName: string | null;
|
|
12
|
+
email: string | null;
|
|
13
|
+
phoneNumber: string | null;
|
|
14
|
+
photoURL: string | null;
|
|
15
|
+
emailVerified: boolean;
|
|
16
|
+
disabled: boolean;
|
|
17
|
+
providers: string[];
|
|
18
|
+
createdAt: string | null;
|
|
19
|
+
lastSignInAt: string | null;
|
|
20
|
+
lastRefreshAt: string | null;
|
|
21
|
+
mfaFactorCount: number;
|
|
22
|
+
role: string | null;
|
|
23
|
+
profile: FirebaseAuthProfile | null;
|
|
24
|
+
}
|
|
25
|
+
export interface FirebaseAuthManagerConfig {
|
|
26
|
+
project: string;
|
|
27
|
+
pageSize: number;
|
|
28
|
+
linkFirestoreProfiles: boolean;
|
|
29
|
+
profileCollection: string;
|
|
30
|
+
profileUidField: string;
|
|
31
|
+
profileNameField: string;
|
|
32
|
+
profileEmailField: string;
|
|
33
|
+
profileRoleField: string;
|
|
34
|
+
profileStatusField: string;
|
|
35
|
+
manageRoleClaim: boolean;
|
|
36
|
+
roleClaimKey: string;
|
|
37
|
+
roleOptions: string | string[];
|
|
38
|
+
}
|
|
39
|
+
export interface FirebaseAuthUserEnvelope {
|
|
40
|
+
user: FirebaseAuthUser;
|
|
41
|
+
auditRecorded?: boolean;
|
|
42
|
+
profileCreated?: boolean;
|
|
43
|
+
profileError?: string | null;
|
|
44
|
+
}
|
|
45
|
+
export interface FirebaseAuthUserListResponse {
|
|
46
|
+
users: FirebaseAuthUser[];
|
|
47
|
+
nextPageToken: string | null;
|
|
48
|
+
}
|
|
49
|
+
export type FirebaseAuthUserSearchKind = 'uid' | 'email' | 'phone';
|
|
50
|
+
export interface CreateFirebaseAuthUserInput {
|
|
51
|
+
email: string;
|
|
52
|
+
password: string;
|
|
53
|
+
uid?: string;
|
|
54
|
+
displayName?: string;
|
|
55
|
+
phoneNumber?: string;
|
|
56
|
+
emailVerified?: boolean;
|
|
57
|
+
disabled?: boolean;
|
|
58
|
+
createProfile?: boolean;
|
|
59
|
+
}
|
|
60
|
+
export interface UpdateFirebaseAuthUserInput {
|
|
61
|
+
reason: string;
|
|
62
|
+
displayName?: string | null;
|
|
63
|
+
email?: string;
|
|
64
|
+
phoneNumber?: string | null;
|
|
65
|
+
emailVerified?: boolean;
|
|
66
|
+
}
|
|
67
|
+
export type UserActionKind = 'status' | 'sessions' | 'mfa' | 'role' | 'profile';
|
|
68
|
+
export interface UserActionPresentation {
|
|
69
|
+
kind: UserActionKind;
|
|
70
|
+
title: string;
|
|
71
|
+
description: string;
|
|
72
|
+
confirmLabel: string;
|
|
73
|
+
destructive?: boolean;
|
|
74
|
+
}
|
|
75
|
+
export declare function getReadableError(error: unknown, fallback: string): string;
|
|
76
|
+
export declare function unwrapFirebaseAuthUser(response: FirebaseAuthUserEnvelope | FirebaseAuthUser): FirebaseAuthUser;
|
|
77
|
+
export declare function mutationAuditWasNotRecorded(response: unknown): boolean;
|
|
78
|
+
export declare function encodeFirebaseUid(uid: string): string;
|
|
79
|
+
export declare function decodeFirebaseUid(token: string): string;
|
|
80
|
+
export declare function firebaseAuthUserPath(uid: string): string;
|
|
81
|
+
export declare function parseRoleOptions(value: string | string[] | null | undefined): string[];
|
|
82
|
+
export declare function formatFirebaseDate(value: string | null | undefined): string;
|
|
83
|
+
export declare function formatProvider(provider: string): string;
|
|
84
|
+
export declare function getUserInitials(user: FirebaseAuthUser): string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FormDefinition } from '../types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
open: boolean;
|
|
4
|
+
name: string;
|
|
5
|
+
definition: FormDefinition;
|
|
6
|
+
};
|
|
7
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
8
|
+
"update:open": (value: boolean) => any;
|
|
9
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
10
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
11
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FormStatus } from '../types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
status: FormStatus;
|
|
4
|
+
hasUnpublishedChanges?: boolean;
|
|
5
|
+
};
|
|
6
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
7
|
+
hasUnpublishedChanges: boolean;
|
|
8
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLSpanElement>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ResolveConfig } from '@oneclick.dev/cms-kit';
|
|
2
|
+
export declare const config: {
|
|
3
|
+
readonly databaseIntegration: {
|
|
4
|
+
readonly label: "Firebase database";
|
|
5
|
+
readonly type: "resource";
|
|
6
|
+
readonly accept: ["FIREBASE"];
|
|
7
|
+
readonly required: true;
|
|
8
|
+
};
|
|
9
|
+
readonly formsCollection: {
|
|
10
|
+
readonly label: "Forms root collection";
|
|
11
|
+
readonly description: "Each Form Builder module gets an isolated namespace inside this Firestore collection.";
|
|
12
|
+
readonly type: "input";
|
|
13
|
+
readonly default: "studio_forms";
|
|
14
|
+
readonly required: true;
|
|
15
|
+
};
|
|
16
|
+
} & {
|
|
17
|
+
readonly databaseIntegration: {
|
|
18
|
+
readonly label: "Firebase database";
|
|
19
|
+
readonly type: "resource";
|
|
20
|
+
readonly accept: ["FIREBASE"];
|
|
21
|
+
readonly required: true;
|
|
22
|
+
};
|
|
23
|
+
readonly formsCollection: {
|
|
24
|
+
readonly label: "Forms root collection";
|
|
25
|
+
readonly description: "Each Form Builder module gets an isolated namespace inside this Firestore collection.";
|
|
26
|
+
readonly type: "input";
|
|
27
|
+
readonly default: "studio_forms";
|
|
28
|
+
readonly required: true;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export type ConfigValues = ResolveConfig<typeof config>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
component: () => Promise<typeof import("./index.vue")>;
|
|
3
|
+
metadata: import('@oneclick.dev/cms-kit').ModuleMetadata;
|
|
4
|
+
config: {
|
|
5
|
+
readonly databaseIntegration: {
|
|
6
|
+
readonly label: "Firebase database";
|
|
7
|
+
readonly type: "resource";
|
|
8
|
+
readonly accept: ["FIREBASE"];
|
|
9
|
+
readonly required: true;
|
|
10
|
+
};
|
|
11
|
+
readonly formsCollection: {
|
|
12
|
+
readonly label: "Forms root collection";
|
|
13
|
+
readonly description: "Each Form Builder module gets an isolated namespace inside this Firestore collection.";
|
|
14
|
+
readonly type: "input";
|
|
15
|
+
readonly default: "studio_forms";
|
|
16
|
+
readonly required: true;
|
|
17
|
+
};
|
|
18
|
+
} & {
|
|
19
|
+
readonly databaseIntegration: {
|
|
20
|
+
readonly label: "Firebase database";
|
|
21
|
+
readonly type: "resource";
|
|
22
|
+
readonly accept: ["FIREBASE"];
|
|
23
|
+
readonly required: true;
|
|
24
|
+
};
|
|
25
|
+
readonly formsCollection: {
|
|
26
|
+
readonly label: "Forms root collection";
|
|
27
|
+
readonly description: "Each Form Builder module gets an isolated namespace inside this Firestore collection.";
|
|
28
|
+
readonly type: "input";
|
|
29
|
+
readonly default: "studio_forms";
|
|
30
|
+
readonly required: true;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
routes: {
|
|
34
|
+
path: string;
|
|
35
|
+
component: () => Promise<typeof import("./pages/Overview.vue")>;
|
|
36
|
+
}[];
|
|
37
|
+
permissions: {
|
|
38
|
+
key: string;
|
|
39
|
+
name: string;
|
|
40
|
+
description: string;
|
|
41
|
+
}[];
|
|
42
|
+
tools: any[];
|
|
43
|
+
};
|
|
44
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { ConfigValues } from './config';
|
|
3
|
+
declare const _default: import('vue').DefineComponent<globalThis.ExtractPropTypes<{
|
|
4
|
+
config: {
|
|
5
|
+
type: PropType<ConfigValues>;
|
|
6
|
+
required: true;
|
|
7
|
+
};
|
|
8
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<{
|
|
9
|
+
config: {
|
|
10
|
+
type: PropType<ConfigValues>;
|
|
11
|
+
required: true;
|
|
12
|
+
};
|
|
13
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FormDefinition, FormListResponse, FormResponse, StudioForm, StudioFormSummary } from '../types';
|
|
2
|
+
export declare function unwrapForms(payload: FormListResponse | StudioFormSummary[]): StudioFormSummary[];
|
|
3
|
+
export declare function unwrapForm(payload: FormResponse | StudioForm): StudioForm;
|
|
4
|
+
export declare function readableError(error: unknown, fallback: string): string;
|
|
5
|
+
export declare function toFormKey(value: string): string;
|
|
6
|
+
export declare function isValidFormKey(value: string): boolean;
|
|
7
|
+
export declare function hasFormDefinition(definition: FormDefinition | undefined): boolean;
|
|
8
|
+
export declare function definitionFieldCount(definition: FormDefinition | undefined): number;
|
|
9
|
+
export declare function createEmptyFormDefinition(): FormDefinition;
|
|
10
|
+
export declare function cloneDefinition(definition: FormDefinition): FormDefinition;
|
|
11
|
+
export declare function formatFormDate(value: StudioFormSummary['updatedAt']): string;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLElement>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLElement>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
export declare const FORM_SCHEMA_VERSION = 1;
|
|
2
|
+
export declare const MAX_FORM_DEFINITION_BYTES: number;
|
|
3
|
+
export declare const MAX_FORM_DEFINITION_DEPTH = 20;
|
|
4
|
+
type FormStatus = 'draft' | 'published' | 'archived';
|
|
5
|
+
type FormDefinition = Record<string, unknown> | unknown[];
|
|
6
|
+
interface ModuleHandlerDeps {
|
|
7
|
+
initFirebase: (event: any, integrationId: string) => Promise<any>;
|
|
8
|
+
normalizeTimestamps?: (data: any) => any;
|
|
9
|
+
}
|
|
10
|
+
interface NormalizedFormFields {
|
|
11
|
+
name: string;
|
|
12
|
+
key: string;
|
|
13
|
+
description: string;
|
|
14
|
+
definition: FormDefinition;
|
|
15
|
+
}
|
|
16
|
+
interface NormalizedDraftPayload extends NormalizedFormFields {
|
|
17
|
+
expectedRevision: number;
|
|
18
|
+
}
|
|
19
|
+
interface StoredForm {
|
|
20
|
+
name: string;
|
|
21
|
+
key: string;
|
|
22
|
+
description?: string;
|
|
23
|
+
status: FormStatus;
|
|
24
|
+
draftDefinition: FormDefinition;
|
|
25
|
+
schemaVersion: number;
|
|
26
|
+
revision: number;
|
|
27
|
+
draftRevision: number;
|
|
28
|
+
publishedRevision?: number | null;
|
|
29
|
+
publishedRevisionId?: string | null;
|
|
30
|
+
publishedDraftRevision?: number | null;
|
|
31
|
+
createdAt: string;
|
|
32
|
+
createdBy?: string | null;
|
|
33
|
+
updatedAt: string;
|
|
34
|
+
updatedBy?: string | null;
|
|
35
|
+
draftUpdatedAt?: string | null;
|
|
36
|
+
draftUpdatedBy?: string | null;
|
|
37
|
+
publishedAt?: string | null;
|
|
38
|
+
publishedBy?: string | null;
|
|
39
|
+
archivedAt?: string | null;
|
|
40
|
+
archivedBy?: string | null;
|
|
41
|
+
statusBeforeArchive?: Exclude<FormStatus, 'archived'> | null;
|
|
42
|
+
}
|
|
43
|
+
interface PublishedRevisionInput {
|
|
44
|
+
formId: string;
|
|
45
|
+
form: StoredForm;
|
|
46
|
+
revision: number;
|
|
47
|
+
revisionId: string;
|
|
48
|
+
publishedAt: string;
|
|
49
|
+
publishedBy: string | null;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Normalize and validate the public, stable machine key used by consumers.
|
|
53
|
+
*/
|
|
54
|
+
export declare function normalizeFormKey(value: unknown): string;
|
|
55
|
+
/**
|
|
56
|
+
* Keep collection selection server-controlled while allowing a safe nested
|
|
57
|
+
* Firestore collection path such as `sites/site-id/forms`.
|
|
58
|
+
*/
|
|
59
|
+
export declare function normalizeFormsCollection(value: unknown): string;
|
|
60
|
+
/**
|
|
61
|
+
* Validate that a definition is safe to serialize into a Firestore map.
|
|
62
|
+
*/
|
|
63
|
+
export declare function validateFormDefinition(definition: unknown): asserts definition is FormDefinition;
|
|
64
|
+
export declare function normalizeCreateFormPayload(input: unknown): NormalizedFormFields;
|
|
65
|
+
export declare function normalizeUpdateDraftPayload(input: unknown): NormalizedDraftPayload;
|
|
66
|
+
export declare function normalizeExpectedRevisionPayload(input: unknown): {
|
|
67
|
+
expectedRevision: number;
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* Build the immutable snapshot stored in `/revisions/:revisionId` on publish.
|
|
71
|
+
*/
|
|
72
|
+
export declare function buildPublishedRevision(input: PublishedRevisionInput): {
|
|
73
|
+
id: string;
|
|
74
|
+
formId: string;
|
|
75
|
+
key: string;
|
|
76
|
+
name: string;
|
|
77
|
+
description: string;
|
|
78
|
+
definition: FormDefinition;
|
|
79
|
+
schemaVersion: number;
|
|
80
|
+
revision: number;
|
|
81
|
+
draftRevision: number;
|
|
82
|
+
previousRevisionId: string | null;
|
|
83
|
+
publishedAt: string;
|
|
84
|
+
publishedBy: string | null;
|
|
85
|
+
};
|
|
86
|
+
export declare function createServerHandler(deps: ModuleHandlerDeps): import('h3').EventHandler<import('h3').EventHandlerRequest, any>;
|
|
87
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const tools: any[];
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export type FormStatus = 'draft' | 'published' | 'archived';
|
|
2
|
+
/** Serialisable state returned by the CMS-kit form builder. */
|
|
3
|
+
export interface FormDefinition extends Record<string, unknown> {
|
|
4
|
+
layout?: unknown[];
|
|
5
|
+
variables?: unknown[];
|
|
6
|
+
transformers?: unknown[];
|
|
7
|
+
apiActions?: unknown[];
|
|
8
|
+
outputConfig?: Record<string, unknown>;
|
|
9
|
+
startupScript?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface StudioForm {
|
|
12
|
+
id: string;
|
|
13
|
+
name: string;
|
|
14
|
+
key: string;
|
|
15
|
+
description: string;
|
|
16
|
+
definition: FormDefinition;
|
|
17
|
+
status: FormStatus;
|
|
18
|
+
revision: number;
|
|
19
|
+
draftRevision?: number;
|
|
20
|
+
publishedRevision?: number | null;
|
|
21
|
+
publishedRevisionId?: string | null;
|
|
22
|
+
hasUnpublishedChanges?: boolean;
|
|
23
|
+
schemaVersion?: number;
|
|
24
|
+
createdAt?: string | number | null;
|
|
25
|
+
updatedAt?: string | number | null;
|
|
26
|
+
publishedAt?: string | number | null;
|
|
27
|
+
archivedAt?: string | number | null;
|
|
28
|
+
}
|
|
29
|
+
export type StudioFormSummary = Omit<StudioForm, 'definition'> & {
|
|
30
|
+
definition?: FormDefinition;
|
|
31
|
+
};
|
|
32
|
+
export interface CreateFormInput {
|
|
33
|
+
name: string;
|
|
34
|
+
key: string;
|
|
35
|
+
description: string;
|
|
36
|
+
definition: FormDefinition;
|
|
37
|
+
}
|
|
38
|
+
export interface SaveDraftInput extends CreateFormInput {
|
|
39
|
+
expectedRevision: number;
|
|
40
|
+
}
|
|
41
|
+
export interface FormListResponse {
|
|
42
|
+
forms: StudioFormSummary[];
|
|
43
|
+
}
|
|
44
|
+
export interface FormResponse {
|
|
45
|
+
form: StudioForm;
|
|
46
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { HelpbotChatTurn, HelpbotConnectionStatus, HelpbotFileEntry, HelpbotSource, HelpbotTextEntry } from '../types';
|
|
2
|
+
export declare function getHelpbotErrorMessage(error: unknown, fallback?: string): string;
|
|
3
|
+
export declare function useHelpbotApi(): {
|
|
4
|
+
getStatus: () => Promise<HelpbotConnectionStatus>;
|
|
5
|
+
listTexts: () => Promise<HelpbotTextEntry[]>;
|
|
6
|
+
getText: (title: string) => Promise<HelpbotTextEntry>;
|
|
7
|
+
createText: (title: string, content: string) => Promise<any>;
|
|
8
|
+
updateText: (originalTitle: string, title: string, content: string) => Promise<any>;
|
|
9
|
+
deleteText: (title: string) => Promise<any>;
|
|
10
|
+
listFiles: () => Promise<HelpbotFileEntry[]>;
|
|
11
|
+
uploadFile: (file: File) => Promise<any>;
|
|
12
|
+
deleteFile: (filename: string) => Promise<any>;
|
|
13
|
+
query: (question: string) => Promise<HelpbotSource[]>;
|
|
14
|
+
chat: (message: string, history: HelpbotChatTurn[]) => Promise<{
|
|
15
|
+
answer: string;
|
|
16
|
+
sources: HelpbotSource[];
|
|
17
|
+
}>;
|
|
18
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ResolveConfig } from '@oneclick.dev/cms-kit';
|
|
2
|
+
export declare const config: {
|
|
3
|
+
readonly agentId: {
|
|
4
|
+
readonly label: "Helpbot assignment";
|
|
5
|
+
readonly description: "Agency-managed assignment that connects this module to the helpbot on your website.";
|
|
6
|
+
readonly type: "input";
|
|
7
|
+
readonly required: true;
|
|
8
|
+
};
|
|
9
|
+
} & {
|
|
10
|
+
readonly agentId: {
|
|
11
|
+
readonly label: "Helpbot assignment";
|
|
12
|
+
readonly description: "Agency-managed assignment that connects this module to the helpbot on your website.";
|
|
13
|
+
readonly type: "input";
|
|
14
|
+
readonly required: true;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export type ConfigValues = ResolveConfig<typeof config>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
component: () => Promise<typeof import("./index.vue")>;
|
|
3
|
+
metadata: import('@oneclick.dev/cms-kit').ModuleMetadata;
|
|
4
|
+
config: {
|
|
5
|
+
readonly agentId: {
|
|
6
|
+
readonly label: "Helpbot assignment";
|
|
7
|
+
readonly description: "Agency-managed assignment that connects this module to the helpbot on your website.";
|
|
8
|
+
readonly type: "input";
|
|
9
|
+
readonly required: true;
|
|
10
|
+
};
|
|
11
|
+
} & {
|
|
12
|
+
readonly agentId: {
|
|
13
|
+
readonly label: "Helpbot assignment";
|
|
14
|
+
readonly description: "Agency-managed assignment that connects this module to the helpbot on your website.";
|
|
15
|
+
readonly type: "input";
|
|
16
|
+
readonly required: true;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
routes: {
|
|
20
|
+
path: string;
|
|
21
|
+
component: () => Promise<typeof import("./pages/Overview.vue")>;
|
|
22
|
+
}[];
|
|
23
|
+
permissions: {
|
|
24
|
+
key: string;
|
|
25
|
+
name: string;
|
|
26
|
+
description: string;
|
|
27
|
+
}[];
|
|
28
|
+
};
|
|
29
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
|
|
2
|
+
uploadInput: HTMLInputElement;
|
|
3
|
+
}, HTMLElement>;
|
|
4
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLElement>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
|
|
2
|
+
chatContainer: HTMLDivElement;
|
|
3
|
+
}, HTMLElement>;
|
|
4
|
+
export default _default;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export type HelpbotSourceStatus = 'available' | 'processing' | 'failed' | 'unknown';
|
|
2
|
+
export interface HelpbotTextEntry {
|
|
3
|
+
title: string;
|
|
4
|
+
preview: string;
|
|
5
|
+
content?: string;
|
|
6
|
+
status: HelpbotSourceStatus;
|
|
7
|
+
updatedAt?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface HelpbotFileEntry {
|
|
10
|
+
filename: string;
|
|
11
|
+
status: HelpbotSourceStatus;
|
|
12
|
+
size?: number;
|
|
13
|
+
pages?: number;
|
|
14
|
+
updatedAt?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface HelpbotSource {
|
|
17
|
+
title: string;
|
|
18
|
+
excerpt: string;
|
|
19
|
+
kind?: 'answer' | 'pdf';
|
|
20
|
+
}
|
|
21
|
+
export interface HelpbotChatTurn {
|
|
22
|
+
role: 'user' | 'assistant';
|
|
23
|
+
content: string;
|
|
24
|
+
sources?: HelpbotSource[];
|
|
25
|
+
}
|
|
26
|
+
export interface HelpbotConnectionStatus {
|
|
27
|
+
configured: boolean;
|
|
28
|
+
connected: boolean | null;
|
|
29
|
+
health?: string;
|
|
30
|
+
helpbotName?: string;
|
|
31
|
+
connectionName?: string;
|
|
32
|
+
message?: string;
|
|
33
|
+
sourceCounts: {
|
|
34
|
+
texts?: number;
|
|
35
|
+
pdfs?: number;
|
|
36
|
+
chunks?: number;
|
|
37
|
+
};
|
|
38
|
+
permissions: {
|
|
39
|
+
canManageKnowledge: boolean;
|
|
40
|
+
canTestHelpbot: boolean;
|
|
41
|
+
};
|
|
42
|
+
}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -9,3 +9,6 @@ export { default as contentManager } from './contentManager';
|
|
|
9
9
|
export { default as mailTemplates } from './mailTemplates';
|
|
10
10
|
export { default as appointments } from './appointments';
|
|
11
11
|
export { default as pushNotifications } from './push-notifications';
|
|
12
|
+
export { default as firebaseAuthManager } from './firebaseAuthManager';
|
|
13
|
+
export { default as helpbot } from './helpbot';
|
|
14
|
+
export { default as formBuilder } from './formBuilder';
|
|
@@ -8,3 +8,5 @@ export { createServerHandler as products } from './products/server';
|
|
|
8
8
|
export { createServerHandler as appointments } from './appointments/server';
|
|
9
9
|
export { createServerHandler as googleAnalytics } from './googleAnalytics/server';
|
|
10
10
|
export { createServerHandler as contentManager } from './contentManager/server';
|
|
11
|
+
export { createServerHandler as firebaseAuthManager } from './firebaseAuthManager/server';
|
|
12
|
+
export { createServerHandler as formBuilder } from './formBuilder/server';
|