@antelopejs/dms 0.15.0 → 0.15.1
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/CHANGELOG.md +28 -0
- package/README.md +1 -1
- package/bin/control/journey.mjs +5 -0
- package/bin/control/session.mjs +1 -0
- package/bin/control/stack.mjs +1 -0
- package/dist/config/internal/state.d.ts +7 -0
- package/dist/config/internal/state.js +9 -0
- package/dist/config/internal/state.js.map +1 -1
- package/dist/config/startup-config.d.ts +1 -0
- package/dist/config/startup-config.js +11 -0
- package/dist/config/startup-config.js.map +1 -1
- package/dist/db/index.d.ts +1 -0
- package/dist/db/index.js +1 -0
- package/dist/db/index.js.map +1 -1
- package/dist/db/models/index.d.ts +1 -0
- package/dist/db/models/index.js +1 -0
- package/dist/db/models/index.js.map +1 -1
- package/dist/db/models/setupToken.model.d.ts +29 -0
- package/dist/db/models/setupToken.model.js +62 -0
- package/dist/db/models/setupToken.model.js.map +1 -0
- package/dist/db/setup-token.d.ts +2 -0
- package/dist/db/setup-token.js +28 -0
- package/dist/db/setup-token.js.map +1 -0
- package/dist/db/tables/index.d.ts +1 -0
- package/dist/db/tables/index.js +1 -0
- package/dist/db/tables/index.js.map +1 -1
- package/dist/db/tables/setupToken.table.d.ts +7 -0
- package/dist/db/tables/setupToken.table.js +34 -0
- package/dist/db/tables/setupToken.table.js.map +1 -0
- package/dist/implementations/dms/page/payloads.js +6 -10
- package/dist/implementations/dms/page/payloads.js.map +1 -1
- package/dist/implementations/dms/page/public-layout.d.ts +2 -0
- package/dist/implementations/dms/page/public-layout.js +45 -0
- package/dist/implementations/dms/page/public-layout.js.map +1 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/pages/settings/users/current-password.js +1 -1
- package/dist/pages/settings/users/current-password.js.map +1 -1
- package/dist/routes/auth/login.d.ts +1 -1
- package/dist/routes/auth/login.js +7 -2
- package/dist/routes/auth/login.js.map +1 -1
- package/dist/routes/auth/password-hash-upgrade.d.ts +2 -0
- package/dist/routes/auth/password-hash-upgrade.js +22 -0
- package/dist/routes/auth/password-hash-upgrade.js.map +1 -0
- package/dist/routes/authentication.d.ts +2 -0
- package/dist/routes/authentication.js +2 -0
- package/dist/routes/authentication.js.map +1 -1
- package/dist/routes/onboarding.d.ts +3 -1
- package/dist/routes/onboarding.js +20 -3
- package/dist/routes/onboarding.js.map +1 -1
- package/dist/utils/ensure-default-tenant.d.ts +2 -1
- package/dist/utils/ensure-default-tenant.js +126 -8
- package/dist/utils/ensure-default-tenant.js.map +1 -1
- package/dist/validation/onboarding/register-admin.schema.d.ts +5 -0
- package/dist/validation/onboarding/register-admin.schema.js +3 -0
- package/dist/validation/onboarding/register-admin.schema.js.map +1 -1
- package/frontend-vue/layers/dms-core/i18n/locales/core-en-GB.json +1 -0
- package/frontend-vue/layers/dms-core/i18n/locales/core-fr-FR.json +1 -0
- package/frontend-vue/layers/dms-core/shared/types/app-config.ts +5 -0
- package/frontend-vue/layers/dms-layout/app/app.config.ts +1 -0
- package/frontend-vue/layers/dms-layout/app/build/components/layout/DashboardSidebar.vue +9 -9
- package/frontend-vue/layers/dms-layout/app/components/layout/AppLogo.vue +1 -0
- package/frontend-vue/layers/dms-layout/app/composables/page/useInstalledModules.ts +78 -0
- package/frontend-vue/layers/dms-layout/app/custom-pages/modules.vue +5 -24
- package/frontend-vue/layers/dms-layout/i18n/locales/layout-en-GB.json +2 -1
- package/frontend-vue/layers/dms-layout/i18n/locales/layout-fr-FR.json +2 -1
- package/frontend-vue/layers/dms-onboarding/app/components/onboarding/steps/register.vue +21 -1
- package/frontend-vue/layers/dms-onboarding/app/custom-pages/onboarding.vue +14 -0
- package/frontend-vue/layers/dms-onboarding/i18n/locales/onboarding-en-GB.json +2 -0
- package/frontend-vue/layers/dms-onboarding/i18n/locales/onboarding-fr-FR.json +2 -0
- package/package.json +3 -3
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { StoreListing } from "#dms-core/app/types/module-store";
|
|
2
|
+
import type { ModuleCatalogEntry } from "#dms-core/app/types/page";
|
|
3
|
+
import type { Ref } from "vue";
|
|
4
|
+
import {
|
|
5
|
+
sortStoreModules,
|
|
6
|
+
storeOnlyModules,
|
|
7
|
+
toModuleStoreEntry,
|
|
8
|
+
withStoreDetails,
|
|
9
|
+
} from "../../build/utils/module-store-catalog";
|
|
10
|
+
import { ENDPOINT_STORE_LISTING } from "./useModuleStore";
|
|
11
|
+
import { useModulesListing } from "./useModulesListing";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The installed modules, as the Modules page lists them and the sidebar
|
|
15
|
+
* counts them: the modules that register pages, with the store's details,
|
|
16
|
+
* and the installed store modules that register none, such as the Builder.
|
|
17
|
+
* Both read it here, so the badge and the page never count differently.
|
|
18
|
+
*
|
|
19
|
+
* @param modulesListing The registered modules
|
|
20
|
+
* @param moduleStore The module store
|
|
21
|
+
*/
|
|
22
|
+
export const useInstalledModules = (
|
|
23
|
+
modulesListing: ReturnType<typeof useModulesListing>,
|
|
24
|
+
moduleStore: { listing: Readonly<Ref<StoreListing | undefined>> },
|
|
25
|
+
) => {
|
|
26
|
+
const { locale } = useI18n();
|
|
27
|
+
const { processI18n } = useTranslation();
|
|
28
|
+
|
|
29
|
+
const storeModules = computed(() =>
|
|
30
|
+
sortStoreModules(
|
|
31
|
+
(moduleStore.listing.value?.modules ?? []).map((entry) =>
|
|
32
|
+
toModuleStoreEntry(entry, modulesListing.modules.value ?? []),
|
|
33
|
+
),
|
|
34
|
+
processI18n,
|
|
35
|
+
locale.value,
|
|
36
|
+
),
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
const modules = computed<ModuleCatalogEntry[]>(() => {
|
|
40
|
+
const registered = withStoreDetails(
|
|
41
|
+
(modulesListing.modules.value ?? []).filter((entry) => entry.hasAccess),
|
|
42
|
+
storeModules.value,
|
|
43
|
+
);
|
|
44
|
+
return [...registered, ...storeOnlyModules(storeModules.value, registered)];
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
return { storeModules, modules };
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* How many modules are installed, for the sidebar's badge. The store listing
|
|
52
|
+
* waits on the npm registry, so a server render must not wait for it: the
|
|
53
|
+
* browser reads it, and the count shows once mounted and the read is over,
|
|
54
|
+
* whether it answered or failed. Until then the badge is absent, on the server
|
|
55
|
+
* and on the browser's first render, which a page that handed the listing
|
|
56
|
+
* over (the Modules page) would otherwise have filled in and mismatched, and
|
|
57
|
+
* while the read runs, so the count never shows without the store's modules.
|
|
58
|
+
*/
|
|
59
|
+
export const useInstalledModuleCount = () => {
|
|
60
|
+
const isOwner = useIsOwner();
|
|
61
|
+
const storeListing = useApiData<StoreListing>(
|
|
62
|
+
() => (isOwner.value ? ENDPOINT_STORE_LISTING : null),
|
|
63
|
+
{ server: false },
|
|
64
|
+
);
|
|
65
|
+
const { modules } = useInstalledModules(useModulesListing(), {
|
|
66
|
+
listing: computed(() => storeListing.data.value ?? undefined),
|
|
67
|
+
});
|
|
68
|
+
const isMounted = ref(false);
|
|
69
|
+
onMounted(() => (isMounted.value = true));
|
|
70
|
+
const isSettled = computed(
|
|
71
|
+
() =>
|
|
72
|
+
storeListing.status.value === "success" ||
|
|
73
|
+
storeListing.status.value === "error",
|
|
74
|
+
);
|
|
75
|
+
return computed(() =>
|
|
76
|
+
isMounted.value && isSettled.value ? modules.value.length : 0,
|
|
77
|
+
);
|
|
78
|
+
};
|
|
@@ -20,7 +20,6 @@ import {
|
|
|
20
20
|
useModulesListing,
|
|
21
21
|
} from "../composables/page/useModulesListing";
|
|
22
22
|
import { useModuleHistory } from "../composables/page/useModuleHistory";
|
|
23
|
-
import type { ModuleCatalogEntry } from "#dms-core/app/types/page";
|
|
24
23
|
import {
|
|
25
24
|
MODULE_CATEGORY_ALL,
|
|
26
25
|
MODULE_STORE_PATH,
|
|
@@ -33,13 +32,8 @@ import {
|
|
|
33
32
|
summarizeModules,
|
|
34
33
|
type ModuleSortMode,
|
|
35
34
|
} from "../build/utils/modules-catalog";
|
|
36
|
-
import {
|
|
37
|
-
|
|
38
|
-
storeOnlyModules,
|
|
39
|
-
storeOpenTarget,
|
|
40
|
-
toModuleStoreEntry,
|
|
41
|
-
withStoreDetails,
|
|
42
|
-
} from "../build/utils/module-store-catalog";
|
|
35
|
+
import { storeOpenTarget } from "../build/utils/module-store-catalog";
|
|
36
|
+
import { useInstalledModules } from "../composables/page/useInstalledModules";
|
|
43
37
|
import { useModuleStore } from "../composables/page/useModuleStore";
|
|
44
38
|
import { useModuleStoreActions } from "../composables/page/useModuleStoreActions";
|
|
45
39
|
import DmsSearchInput from "#dms-ui/app/entries/components/form/SearchInput";
|
|
@@ -123,26 +117,13 @@ const isInitiallyLoading = computed(
|
|
|
123
117
|
);
|
|
124
118
|
const isRetrying = ref(false);
|
|
125
119
|
|
|
126
|
-
const storeModules =
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
toModuleStoreEntry(entry, modulesListing.modules.value ?? []),
|
|
130
|
-
),
|
|
131
|
-
processI18n,
|
|
132
|
-
locale.value,
|
|
133
|
-
),
|
|
120
|
+
const { storeModules, modules } = useInstalledModules(
|
|
121
|
+
modulesListing,
|
|
122
|
+
moduleStore,
|
|
134
123
|
);
|
|
135
124
|
const storeEntries = computed(
|
|
136
125
|
() => new Map(storeModules.value.map((entry) => [entry.id, entry])),
|
|
137
126
|
);
|
|
138
|
-
|
|
139
|
-
const modules = computed<ModuleCatalogEntry[]>(() => {
|
|
140
|
-
const registered = withStoreDetails(
|
|
141
|
-
(modulesListing.modules.value ?? []).filter((entry) => entry.hasAccess),
|
|
142
|
-
storeModules.value,
|
|
143
|
-
);
|
|
144
|
-
return [...registered, ...storeOnlyModules(storeModules.value, registered)];
|
|
145
|
-
});
|
|
146
127
|
const summary = computed(() => summarizeModules(modules.value));
|
|
147
128
|
|
|
148
129
|
const visitedAt = computed(
|
|
@@ -23,6 +23,8 @@ import {
|
|
|
23
23
|
|
|
24
24
|
interface RegisterStepProps {
|
|
25
25
|
platform: OnboardingPlatform;
|
|
26
|
+
/** The token the address carried; empty when the wizard has to ask for it. */
|
|
27
|
+
setupToken: string;
|
|
26
28
|
}
|
|
27
29
|
|
|
28
30
|
interface RegisterStepEmits {
|
|
@@ -43,6 +45,7 @@ const MAX_NAME_PART_LENGTH = 100;
|
|
|
43
45
|
|
|
44
46
|
const isLoading = ref(false);
|
|
45
47
|
const isRegistered = ref(false);
|
|
48
|
+
const asksForSetupToken = !props.setupToken;
|
|
46
49
|
|
|
47
50
|
const namePart = z.string().trim().min(1).max(MAX_NAME_PART_LENGTH);
|
|
48
51
|
|
|
@@ -52,12 +55,14 @@ const fields = z
|
|
|
52
55
|
lastName: namePart,
|
|
53
56
|
email: z.string().trim().email(),
|
|
54
57
|
password: passwordSchema,
|
|
58
|
+
setupToken: z.string().trim().min(1),
|
|
55
59
|
})
|
|
56
60
|
.transform((data) => ({
|
|
57
61
|
firstName: striptags(data.firstName),
|
|
58
62
|
lastName: striptags(data.lastName),
|
|
59
63
|
email: striptags(data.email),
|
|
60
64
|
password: data.password,
|
|
65
|
+
setupToken: data.setupToken,
|
|
61
66
|
}));
|
|
62
67
|
|
|
63
68
|
type Schema = z.output<typeof fields>;
|
|
@@ -68,6 +73,7 @@ const state = reactive<Partial<Schema>>({
|
|
|
68
73
|
lastName: undefined,
|
|
69
74
|
email: undefined,
|
|
70
75
|
password: undefined,
|
|
76
|
+
setupToken: props.setupToken,
|
|
71
77
|
});
|
|
72
78
|
useLiveFormErrors(form, state);
|
|
73
79
|
|
|
@@ -106,7 +112,7 @@ async function onSubmit(event: FormSubmitEvent<Schema>) {
|
|
|
106
112
|
}
|
|
107
113
|
|
|
108
114
|
await showError(error, "page.onboarding.administrator.error_title", {
|
|
109
|
-
fields: ["firstName", "lastName", "email", "password"],
|
|
115
|
+
fields: ["firstName", "lastName", "email", "password", "setupToken"],
|
|
110
116
|
form,
|
|
111
117
|
});
|
|
112
118
|
} finally {
|
|
@@ -139,6 +145,20 @@ async function onSubmit(event: FormSubmitEvent<Schema>) {
|
|
|
139
145
|
>
|
|
140
146
|
<AuthFormAlert :error="formError" />
|
|
141
147
|
|
|
148
|
+
<UFormField
|
|
149
|
+
v-if="asksForSetupToken"
|
|
150
|
+
:label="$t('page.onboarding.administrator.setup_token')"
|
|
151
|
+
:help="$t('page.onboarding.administrator.setup_token_help')"
|
|
152
|
+
name="setupToken"
|
|
153
|
+
>
|
|
154
|
+
<UInput
|
|
155
|
+
v-model="state.setupToken"
|
|
156
|
+
autocomplete="off"
|
|
157
|
+
size="lg"
|
|
158
|
+
class="w-full"
|
|
159
|
+
/>
|
|
160
|
+
</UFormField>
|
|
161
|
+
|
|
142
162
|
<div class="grid gap-3 sm:grid-cols-2">
|
|
143
163
|
<UFormField
|
|
144
164
|
:label="$t('page.onboarding.administrator.first_name')"
|
|
@@ -26,6 +26,19 @@ watch(metaTitle, (title) => {
|
|
|
26
26
|
});
|
|
27
27
|
const administrator = ref<OnboardingAdministrator | null>(null);
|
|
28
28
|
|
|
29
|
+
const route = useDmsRoute();
|
|
30
|
+
const router = useDmsRouter();
|
|
31
|
+
const setupToken = ref("");
|
|
32
|
+
|
|
33
|
+
useHead({ meta: [{ name: "referrer", content: "no-referrer" }] });
|
|
34
|
+
|
|
35
|
+
onMounted(() => {
|
|
36
|
+
const { token, ...query } = route.query;
|
|
37
|
+
if (typeof token !== "string" || !token) return;
|
|
38
|
+
setupToken.value = token;
|
|
39
|
+
void router.replace({ query });
|
|
40
|
+
});
|
|
41
|
+
|
|
29
42
|
const stepLabels = computed(() =>
|
|
30
43
|
ONBOARDING_STEPS.map((id) => t(`page.onboarding.steps.${id}`)),
|
|
31
44
|
);
|
|
@@ -53,6 +66,7 @@ function onRegistered(owner: OnboardingAdministrator) {
|
|
|
53
66
|
<Register
|
|
54
67
|
v-else-if="step === 'administrator'"
|
|
55
68
|
:platform="platform"
|
|
69
|
+
:setup-token="setupToken"
|
|
56
70
|
@back="step = 'platform'"
|
|
57
71
|
@registered="onRegistered"
|
|
58
72
|
/>
|
|
@@ -28,6 +28,8 @@
|
|
|
28
28
|
"first_name": "First name",
|
|
29
29
|
"last_name": "Last name",
|
|
30
30
|
"name_required": "Required",
|
|
31
|
+
"setup_token": "Setup token",
|
|
32
|
+
"setup_token_help": "Printed in the server log when the instance started, or the value of DMS_SETUP_TOKEN.",
|
|
31
33
|
"email": "Work e-mail",
|
|
32
34
|
"submit": "Create administrator account",
|
|
33
35
|
"back": "Back to platform details",
|
|
@@ -28,6 +28,8 @@
|
|
|
28
28
|
"first_name": "Prénom",
|
|
29
29
|
"last_name": "Nom",
|
|
30
30
|
"name_required": "Obligatoire",
|
|
31
|
+
"setup_token": "Jeton d'installation",
|
|
32
|
+
"setup_token_help": "Affiché dans les logs du serveur au démarrage de l'instance, ou valeur de DMS_SETUP_TOKEN.",
|
|
31
33
|
"email": "E-mail professionnel",
|
|
32
34
|
"submit": "Créer le compte administrateur",
|
|
33
35
|
"back": "Retour aux informations de la plateforme",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antelopejs/dms",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.1",
|
|
4
4
|
"description": "AntelopeJS DMS. Plug in your PostgreSQL, MongoDB or RethinkDB database and your coding agent builds a back office and analytics dashboard as typed TypeScript. Real-time updates on the data the DMS manages.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"antelopejs",
|
|
@@ -74,8 +74,8 @@
|
|
|
74
74
|
"@antelopejs/interface-core": ">=0.2.6 <1.0.0",
|
|
75
75
|
"@antelopejs/interface-data-api": ">=0.5.0 <1.0.0",
|
|
76
76
|
"@antelopejs/interface-database": ">=0.1.11 <1.0.0",
|
|
77
|
-
"@antelopejs/interface-database-decorators": ">=0.1.
|
|
78
|
-
"@antelopejs/interface-dms": ">=0.10.
|
|
77
|
+
"@antelopejs/interface-database-decorators": ">=0.1.12 <1.0.0",
|
|
78
|
+
"@antelopejs/interface-dms": ">=0.10.4 <0.11.0",
|
|
79
79
|
"@antelopejs/interface-email": ">=0.0.6 <1.0.0",
|
|
80
80
|
"@antelopejs/interface-file-storage": ">=0.1.4 <1.0.0",
|
|
81
81
|
"archiver": "^7.0.1",
|