studiocms 0.2.0 → 0.4.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/CHANGELOG.md +122 -0
- package/dist/cli/add/index.d.ts +2 -2
- package/dist/cli/add/index.js +4 -3
- package/dist/cli/add/npm-utils.d.ts +6 -6
- package/dist/cli/add/tryToInstallPlugins.d.ts +1 -1
- package/dist/cli/add/tryToInstallPlugins.js +6 -5
- package/dist/cli/add/updateStudioCMSConfig.d.ts +1 -1
- package/dist/cli/add/updateStudioCMSConfig.js +3 -4
- package/dist/cli/add/validatePlugins.d.ts +1 -2
- package/dist/cli/add/validatePlugins.js +15 -9
- package/dist/cli/crypto/genJWT/index.d.ts +1 -1
- package/dist/cli/crypto/genJWT/index.js +8 -9
- package/dist/cli/crypto/index.d.ts +1 -1
- package/dist/cli/init/steps/env.js +14 -4
- package/dist/cli/init/steps/next.d.ts +1 -1
- package/dist/cli/init/steps/next.js +6 -5
- package/dist/cli/migrator/index.d.ts +1 -1
- package/dist/cli/migrator/index.js +2 -2
- package/dist/cli/users/index.d.ts +1 -1
- package/dist/cli/users/shared.js +2 -2
- package/dist/cli/users/steps/createUsers.js +7 -7
- package/dist/cli/users/steps/modifyUsers.js +2 -2
- package/dist/cli/users/steps/next.d.ts +1 -1
- package/dist/cli/utils/checkRequiredEnvVars.js +2 -2
- package/dist/cli/utils/context.d.ts +2 -4
- package/dist/cli/utils/context.js +1 -3
- package/dist/cli/utils/getCliDbClient.d.ts +1 -1
- package/dist/cli/utils/intro.d.ts +1 -1
- package/dist/cli/utils/loadConfig.d.ts +54 -49
- package/dist/cli/utils/loadConfig.js +5 -8
- package/dist/cli/utils/logger.js +3 -3
- package/dist/cli/utils/user-utils.d.ts +1 -1
- package/dist/cli/utils/user-utils.js +4 -3
- package/dist/client/apiClient.d.ts +4923 -0
- package/dist/client/apiClient.js +72 -0
- package/dist/config.d.ts +1734 -1
- package/dist/consts.d.ts +5 -5
- package/dist/consts.js +3 -2
- package/dist/db/plugins.d.ts +1 -1
- package/dist/db/plugins.js +5 -8
- package/dist/handlers/frontend/routes.d.ts +4 -18
- package/dist/handlers/frontend/routes.js +13 -152
- package/dist/handlers/frontend/types.d.ts +1 -1
- package/dist/handlers/frontend/utils.js +0 -18
- package/dist/handlers/pluginHandler.d.ts +34 -257
- package/dist/handlers/pluginHandler.js +92 -46
- package/dist/handlers/routeHandler.js +32 -11
- package/dist/handlers/setupDbStudio.d.ts +3 -1
- package/dist/handlers/setupDbStudio.js +19 -10
- package/dist/handlers/storage-manager/core/effectify-astro-context.d.ts +25 -0
- package/dist/handlers/storage-manager/core/effectify-astro-context.js +78 -0
- package/dist/handlers/storage-manager/no-op.d.ts +2 -2
- package/dist/handlers/storage-manager/no-op.js +2 -3
- package/dist/index.d.ts +0 -1
- package/dist/index.js +10 -20
- package/dist/integrations/robots/index.d.ts +2 -2
- package/dist/integrations/robots/index.js +1 -3
- package/dist/integrations/robots/schema.d.ts +102 -273
- package/dist/integrations/robots/schema.js +220 -209
- package/dist/plugins/analytics/assets/schemas.d.ts +14 -9
- package/dist/plugins/analytics/assets/schemas.js +25 -17
- package/dist/plugins/analytics/db-client.d.ts +1 -1
- package/dist/plugins/analytics/index.d.ts +823 -3
- package/dist/plugins/analytics/index.js +4 -5
- package/dist/plugins/analytics/schemas.d.ts +54 -62
- package/dist/plugins/analytics/schemas.js +64 -13
- package/dist/plugins/analytics/table.d.ts +1 -1
- package/dist/plugins.d.ts +0 -1
- package/dist/schemas/config/api.d.ts +17 -0
- package/dist/schemas/config/api.js +14 -0
- package/dist/schemas/config/auth.d.ts +55 -59
- package/dist/schemas/config/auth.js +34 -11
- package/dist/schemas/config/dashboard.d.ts +43 -79
- package/dist/schemas/config/dashboard.js +43 -12
- package/dist/schemas/config/db.d.ts +15 -17
- package/dist/schemas/config/db.js +13 -5
- package/dist/schemas/config/developer.d.ts +33 -45
- package/dist/schemas/config/developer.js +22 -5
- package/dist/schemas/config/index.d.ts +398 -521
- package/dist/schemas/config/index.js +115 -57
- package/dist/schemas/config/sdk.d.ts +50 -196
- package/dist/schemas/config/sdk.js +61 -73
- package/dist/schemas/custom.d.ts +40 -0
- package/dist/schemas/custom.js +41 -0
- package/dist/schemas/external-schemas.d.ts +171 -0
- package/dist/schemas/external-schemas.js +179 -0
- package/dist/schemas/index.d.ts +2 -0
- package/dist/schemas/index.js +2 -0
- package/dist/schemas/plugins/i18n.d.ts +59 -39
- package/dist/schemas/plugins/i18n.js +42 -5
- package/dist/schemas/plugins/index.d.ts +7126 -10296
- package/dist/schemas/plugins/index.js +260 -276
- package/dist/schemas/plugins/shared.d.ts +1293 -3718
- package/dist/schemas/plugins/shared.js +320 -329
- package/dist/test-utils.d.ts +15 -4
- package/dist/test-utils.js +27 -11
- package/dist/toolbar/db-viewer/db-shared-types.d.ts +6 -6
- package/dist/toolbar/db-viewer/studio/connection.d.ts +8 -4
- package/dist/toolbar/db-viewer/studio/connection.js +2 -28
- package/dist/toolbar/db-viewer/studio/env/libsql.d.ts +7 -0
- package/dist/toolbar/db-viewer/studio/env/libsql.js +17 -0
- package/dist/toolbar/db-viewer/studio/env/mysql.d.ts +7 -0
- package/dist/toolbar/db-viewer/studio/env/mysql.js +23 -0
- package/dist/toolbar/db-viewer/studio/env/postgres.d.ts +7 -0
- package/dist/toolbar/db-viewer/studio/env/postgres.js +23 -0
- package/dist/toolbar/db-viewer/studio/index.js +20 -56
- package/dist/toolbar/db-viewer/studio/type.d.ts +1 -2
- package/dist/toolbar/db-viewer/studio/virtual-connection/libsql.d.ts +3 -0
- package/dist/toolbar/db-viewer/studio/virtual-connection/libsql.js +24 -0
- package/dist/toolbar/db-viewer/studio/virtual-connection/mysql.d.ts +3 -0
- package/dist/toolbar/db-viewer/studio/virtual-connection/mysql.js +9 -0
- package/dist/toolbar/db-viewer/studio/virtual-connection/postgres.d.ts +3 -0
- package/dist/toolbar/db-viewer/studio/virtual-connection/postgres.js +9 -0
- package/dist/toolbar/db-viewer/viewer.js +20 -21
- package/dist/types.d.ts +30 -0
- package/dist/utils/effects/smtp.d.ts +1 -1
- package/dist/utils/lang-helper.d.ts +10 -2
- package/dist/virtual.d.ts +35 -28
- package/dist/virtuals/auth/core.d.ts +5 -5
- package/dist/virtuals/auth/verify-email.d.ts +6 -6
- package/dist/virtuals/components/Generator.astro +2 -2
- package/dist/virtuals/components/Renderer.astro +9 -1
- package/dist/virtuals/components/renderFn.d.ts +3 -1
- package/dist/virtuals/components/renderFn.js +18 -0
- package/dist/virtuals/lib/headDefaults.d.ts +4 -2
- package/dist/virtuals/lib/headDefaults.js +0 -2
- package/dist/virtuals/lib/routeMap.d.ts +0 -12
- package/dist/virtuals/lib/routeMap.js +2 -14
- package/dist/virtuals/mailer/index.d.ts +3 -3
- package/dist/virtuals/notifier/index.d.ts +5 -5
- package/dist/virtuals/plugins/dashboard-pages.d.ts +2 -64
- package/dist/virtuals/scripts/StorageFileBrowser.d.ts +1 -172
- package/dist/virtuals/scripts/StorageFileBrowser.js +216 -119
- package/dist/virtuals/template-engine/index.d.ts +4 -4
- package/frontend/components/dashboard/configuration/ConfigForm.astro +218 -110
- package/frontend/components/dashboard/content-mgmt/ContentSearch.astro +21 -22
- package/frontend/components/dashboard/content-mgmt/CreateFolder.astro +66 -54
- package/frontend/components/dashboard/content-mgmt/CreatePage.astro +58 -104
- package/frontend/components/dashboard/content-mgmt/EditFolder.astro +65 -67
- package/frontend/components/dashboard/content-mgmt/EditPage.astro +86 -134
- package/frontend/components/dashboard/content-mgmt/InnerSidebarElement.astro +0 -1
- package/frontend/components/dashboard/content-mgmt/PageHeader.astro +33 -52
- package/frontend/components/dashboard/content-mgmt/PageTypeHandler.astro +2 -2
- package/frontend/components/dashboard/profile/APITokens.astro +219 -158
- package/frontend/components/dashboard/profile/BasicInfo.astro +165 -106
- package/frontend/components/dashboard/profile/Notifications.astro +27 -18
- package/frontend/components/dashboard/profile/UpdatePassword.astro +134 -94
- package/frontend/components/dashboard/sidebar/VersionCheck.astro +31 -16
- package/frontend/components/dashboard/sidebar/VersionCheckChangelog.astro +18 -11
- package/frontend/components/dashboard/sidebar-modals/VersionModal.astro +2 -2
- package/frontend/components/dashboard/smtp-config/TemplateEditor.astro +14 -14
- package/frontend/components/dashboard/taxonomy/InnerSidebarElement.astro +0 -1
- package/frontend/components/dashboard/taxonomy/MetaContainer.astro +0 -2
- package/frontend/components/dashboard/taxonomy/PageHeader.astro +16 -24
- package/frontend/components/dashboard/taxonomy/TaxonomySearch.astro +23 -27
- package/frontend/components/dashboard/user-mgmt/InnerSidebarElement.astro +111 -104
- package/frontend/components/dashboard/user-mgmt/UserListItem.astro +9 -22
- package/frontend/components/dashboard/user-mgmt/UserListItems.astro +18 -0
- package/frontend/components/first-time-setup/snippets/{opt2-studiocms.config.diff → studiocms.config.diff} +1 -0
- package/frontend/components/shared/Code.astro +1 -4
- package/frontend/components/shared/DynamicSettingsRenderer.astro +1 -1
- package/frontend/components/shared/SSRUser.astro +2 -4
- package/frontend/components/shared/foldertree/FolderTreeNode.astro +0 -6
- package/frontend/components/shared/storage-manager/StorageCopyOutput.astro +0 -1
- package/frontend/components/shared/taxonomy/TaxonomyTreeNode.astro +0 -6
- package/frontend/layouts/DashboardLayout.astro +1 -10
- package/frontend/layouts/TaxonomyLayout.astro +0 -1
- package/frontend/middleware/index.ts +102 -61
- package/frontend/pages/404.astro +5 -9
- package/frontend/pages/[dashboard]/[...pluginPage].astro +10 -1
- package/frontend/pages/[dashboard]/configuration.astro +10 -1
- package/frontend/pages/[dashboard]/content-management/createfolder.astro +10 -1
- package/frontend/pages/[dashboard]/content-management/createpage.astro +10 -1
- package/frontend/pages/[dashboard]/content-management/diff.astro +39 -14
- package/frontend/pages/[dashboard]/content-management/editfolder.astro +10 -1
- package/frontend/pages/[dashboard]/content-management/editpage.astro +10 -1
- package/frontend/pages/[dashboard]/content-management/index.astro +10 -1
- package/frontend/pages/[dashboard]/index.astro +10 -1
- package/frontend/pages/[dashboard]/login.astro +86 -25
- package/frontend/pages/[dashboard]/password-reset.astro +22 -16
- package/frontend/pages/[dashboard]/plugins/[plugin].astro +10 -1
- package/frontend/pages/[dashboard]/profile.astro +10 -1
- package/frontend/pages/[dashboard]/signup.astro +153 -52
- package/frontend/pages/[dashboard]/smtp-configuration.astro +77 -75
- package/frontend/pages/[dashboard]/system-management.astro +10 -1
- package/frontend/pages/[dashboard]/taxonomy/categories.astro +30 -41
- package/frontend/pages/[dashboard]/taxonomy/index.astro +10 -0
- package/frontend/pages/[dashboard]/taxonomy/tags.astro +33 -43
- package/frontend/pages/[dashboard]/unverified-email.astro +29 -21
- package/frontend/pages/[dashboard]/user-management/edit.astro +170 -90
- package/frontend/pages/[dashboard]/user-management/index.astro +10 -1
- package/frontend/pages/studiocms_api/[...all].ts +106 -0
- package/frontend/pages/studiocms_api/_handlers/_utils/auth.ts +26 -0
- package/frontend/pages/studiocms_api/_handlers/_utils/changelog.ts +147 -0
- package/frontend/pages/studiocms_api/_handlers/_utils/db-studio-driver.ts +46 -0
- package/frontend/pages/studiocms_api/_handlers/_utils/parseLogLevel.ts +27 -0
- package/frontend/pages/studiocms_api/_handlers/auth/auth.ts +459 -0
- package/frontend/pages/studiocms_api/_handlers/auth/index.ts +17 -0
- package/frontend/pages/studiocms_api/_handlers/auth/oauth.ts +91 -0
- package/frontend/pages/studiocms_api/_handlers/dashboard/_shared.ts +57 -0
- package/frontend/pages/studiocms_api/_handlers/dashboard/apiTokens.ts +134 -0
- package/frontend/pages/studiocms_api/_handlers/dashboard/config.ts +64 -0
- package/frontend/pages/studiocms_api/_handlers/dashboard/content.ts +741 -0
- package/frontend/pages/studiocms_api/_handlers/dashboard/create.ts +480 -0
- package/frontend/pages/studiocms_api/_handlers/dashboard/emailNotifications.ts +49 -0
- package/frontend/pages/studiocms_api/_handlers/dashboard/index.ts +45 -0
- package/frontend/pages/studiocms_api/_handlers/dashboard/mailer.ts +136 -0
- package/frontend/pages/studiocms_api/_handlers/dashboard/plugins.ts +80 -0
- package/frontend/pages/studiocms_api/_handlers/dashboard/profile.ts +275 -0
- package/frontend/pages/studiocms_api/_handlers/dashboard/resetPassword.ts +140 -0
- package/frontend/pages/studiocms_api/_handlers/dashboard/search.ts +63 -0
- package/frontend/pages/studiocms_api/_handlers/dashboard/taxonomy.ts +285 -0
- package/frontend/pages/studiocms_api/_handlers/dashboard/templates.ts +75 -0
- package/frontend/pages/studiocms_api/_handlers/dashboard/users.ts +312 -0
- package/frontend/pages/studiocms_api/_handlers/dashboard/verifyEndpoints.ts +307 -0
- package/frontend/pages/studiocms_api/_handlers/integration/dbStudio.ts +98 -0
- package/frontend/pages/studiocms_api/_handlers/integration/index.ts +17 -0
- package/frontend/pages/studiocms_api/_handlers/integration/storageManager.ts +107 -0
- package/frontend/pages/studiocms_api/_handlers/rest-api/index.ts +8 -0
- package/frontend/pages/studiocms_api/_handlers/rest-api/v1/_shared.ts +41 -0
- package/frontend/pages/studiocms_api/_handlers/rest-api/v1/index.ts +17 -0
- package/frontend/pages/studiocms_api/_handlers/rest-api/v1/public.ts +195 -0
- package/frontend/pages/studiocms_api/_handlers/rest-api/v1/secure.ts +1726 -0
- package/frontend/pages/studiocms_api/_handlers/sdk.ts +129 -0
- package/frontend/pages/studiocms_api/_middleware/astroLocals.ts +36 -0
- package/frontend/pages/studiocms_api/_middleware/restApi.ts +56 -0
- package/frontend/pages/studiocms_api/integrations/[...all].ts +8 -0
- package/frontend/scripts/formdata.ts +219 -0
- package/frontend/setup-pages/3-done.astro +4 -20
- package/frontend/setup-pages/studiocms_api/dashboard/step-2.ts +3 -6
- package/frontend/styles/dashboard-base.css +0 -1
- package/frontend/web-vitals/endpoint.ts +2 -1
- package/package.json +35 -31
- package/dist/global.d.ts +0 -9
- package/frontend/components/dashboard/LoginChecker.astro +0 -68
- package/frontend/components/dashboard/user-mgmt/RankCheck.astro +0 -57
- package/frontend/components/first-time-setup/snippets/opt1-astro.config.diff +0 -14
- package/frontend/components/first-time-setup/snippets/opt2-astro.config.diff +0 -9
- package/frontend/middleware/_authmap.ts +0 -63
- package/frontend/pages/studiocms_api/auth/[path].ts +0 -390
- package/frontend/pages/studiocms_api/auth/[provider]/[...id].ts +0 -64
- package/frontend/pages/studiocms_api/auth/[provider]/_effects/index.ts +0 -101
- package/frontend/pages/studiocms_api/auth/_shared.ts +0 -52
- package/frontend/pages/studiocms_api/dashboard/api-tokens.ts +0 -115
- package/frontend/pages/studiocms_api/dashboard/config.ts +0 -74
- package/frontend/pages/studiocms_api/dashboard/content/diff.ts +0 -73
- package/frontend/pages/studiocms_api/dashboard/content/folder.ts +0 -220
- package/frontend/pages/studiocms_api/dashboard/content/page.ts +0 -359
- package/frontend/pages/studiocms_api/dashboard/create-reset-link.ts +0 -77
- package/frontend/pages/studiocms_api/dashboard/create-user-invite.ts +0 -231
- package/frontend/pages/studiocms_api/dashboard/create-user.ts +0 -186
- package/frontend/pages/studiocms_api/dashboard/email-notification-settings-site.ts +0 -74
- package/frontend/pages/studiocms_api/dashboard/mailer/check-email.ts +0 -75
- package/frontend/pages/studiocms_api/dashboard/mailer/config.ts +0 -136
- package/frontend/pages/studiocms_api/dashboard/plugins/[plugin].ts +0 -80
- package/frontend/pages/studiocms_api/dashboard/profile.ts +0 -245
- package/frontend/pages/studiocms_api/dashboard/resend-verify-email.ts +0 -77
- package/frontend/pages/studiocms_api/dashboard/reset-password.ts +0 -124
- package/frontend/pages/studiocms_api/dashboard/search-list.ts +0 -59
- package/frontend/pages/studiocms_api/dashboard/taxonomy-search.ts +0 -47
- package/frontend/pages/studiocms_api/dashboard/taxonomy.ts +0 -230
- package/frontend/pages/studiocms_api/dashboard/templates.ts +0 -74
- package/frontend/pages/studiocms_api/dashboard/update-user-notifications.ts +0 -86
- package/frontend/pages/studiocms_api/dashboard/users.ts +0 -236
- package/frontend/pages/studiocms_api/dashboard/verify-email.ts +0 -83
- package/frontend/pages/studiocms_api/dashboard/verify-session.ts +0 -187
- package/frontend/pages/studiocms_api/integrations/[type]/[...id].ts +0 -15
- package/frontend/pages/studiocms_api/integrations/[type]/_routes/db-studio.ts +0 -173
- package/frontend/pages/studiocms_api/integrations/[type]/_routes/storage.ts +0 -88
- package/frontend/pages/studiocms_api/partials/editor.astro +0 -74
- package/frontend/pages/studiocms_api/partials/render.astro +0 -39
- package/frontend/pages/studiocms_api/partials/user-list-items.astro +0 -43
- package/frontend/pages/studiocms_api/rest/utils/auth-token.ts +0 -59
- package/frontend/pages/studiocms_api/rest/v1/[type]/[...id].ts +0 -23
- package/frontend/pages/studiocms_api/rest/v1/[type]/_routes/categories.ts +0 -267
- package/frontend/pages/studiocms_api/rest/v1/[type]/_routes/folders.ts +0 -283
- package/frontend/pages/studiocms_api/rest/v1/[type]/_routes/pages.ts +0 -505
- package/frontend/pages/studiocms_api/rest/v1/[type]/_routes/settings.ts +0 -100
- package/frontend/pages/studiocms_api/rest/v1/[type]/_routes/tags.ts +0 -229
- package/frontend/pages/studiocms_api/rest/v1/[type]/_routes/users.ts +0 -553
- package/frontend/pages/studiocms_api/rest/v1/public/[type]/[...id].ts +0 -19
- package/frontend/pages/studiocms_api/rest/v1/public/[type]/_routes/categories.ts +0 -74
- package/frontend/pages/studiocms_api/rest/v1/public/[type]/_routes/folders.ts +0 -85
- package/frontend/pages/studiocms_api/rest/v1/public/[type]/_routes/pages.ts +0 -103
- package/frontend/pages/studiocms_api/rest/v1/public/[type]/_routes/tags.ts +0 -67
- package/frontend/pages/studiocms_api/sdk/[...path].ts +0 -97
- package/frontend/pages/studiocms_api/sdk/utils/changelog.ts +0 -119
- package/frontend/scripts/auth/formListener.ts +0 -81
- package/frontend/scripts/formdata-utils.ts +0 -116
- package/frontend/utils/build-partial-schema.ts +0 -46
- package/frontend/utils/errors.ts +0 -6
- package/frontend/utils/param-extractor.ts +0 -83
- package/frontend/utils/rest-router.ts +0 -444
package/dist/consts.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type uiIntegration from '@studiocms/ui';
|
|
2
2
|
import { type AvailablePermissionRanks } from '@withstudiocms/auth-kit/types';
|
|
3
3
|
import type { AstroConfig } from 'astro';
|
|
4
|
+
import { Duration } from 'effect';
|
|
4
5
|
import type { RobotsConfig } from './integrations/robots/schema.js';
|
|
5
|
-
import type { TimeString } from './schemas/config/sdk.js';
|
|
6
6
|
/**
|
|
7
7
|
* Paths to search for the StudioCMS config file,
|
|
8
8
|
* sorted by how likely they're to appear.
|
|
@@ -25,11 +25,11 @@ export declare const CMSNotificationSettingsId: string;
|
|
|
25
25
|
export declare const Next_NotificationSettingsId: string;
|
|
26
26
|
export declare const TemplateConfigId: string;
|
|
27
27
|
/**
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
* This
|
|
28
|
+
* Utility Constant for Default Cache Lifetime
|
|
29
|
+
*
|
|
30
|
+
* This constant represents the default cache lifetime as a Duration object, which can be used throughout the codebase for consistency when referring to the default cache lifetime.
|
|
31
31
|
*/
|
|
32
|
-
export declare const
|
|
32
|
+
export declare const DefaultCacheLifetime: Duration.Duration;
|
|
33
33
|
/**
|
|
34
34
|
* The default lifetime for cached items in milliseconds.
|
|
35
35
|
* This value is used to determine how long an item should remain in the cache before it is considered expired.
|
package/dist/consts.js
CHANGED
|
@@ -4,6 +4,7 @@ import { icons as simpleIcons } from "@iconify-json/simple-icons";
|
|
|
4
4
|
import {
|
|
5
5
|
availablePermissionRanks
|
|
6
6
|
} from "@withstudiocms/auth-kit/types";
|
|
7
|
+
import { Duration } from "effect";
|
|
7
8
|
import { stripIconify } from "./utils/stripIconify.js";
|
|
8
9
|
import { makeAPIRoute } from "./virtuals/lib/makeAPIRoute.js";
|
|
9
10
|
import { stripLeadingAndTrailingSlashes } from "./virtuals/lib/pathGenerators.js";
|
|
@@ -22,7 +23,7 @@ const Next_MailerConfigId = "SCMS_MAILER_CONFIG_1";
|
|
|
22
23
|
const CMSNotificationSettingsId = "1";
|
|
23
24
|
const Next_NotificationSettingsId = "SCMS_NOTIFICATION_SETTINGS_1";
|
|
24
25
|
const TemplateConfigId = "SCMS_EMAIL_TEMPLATES_1";
|
|
25
|
-
const
|
|
26
|
+
const DefaultCacheLifetime = Duration.minutes(5);
|
|
26
27
|
const OneDay = 1e3 * 60 * 60 * 24;
|
|
27
28
|
const versionCacheLifetime = OneDay * 7;
|
|
28
29
|
const currentRESTAPIVersions = ["v1"];
|
|
@@ -175,6 +176,7 @@ export {
|
|
|
175
176
|
CMSMailerConfigId,
|
|
176
177
|
CMSNotificationSettingsId,
|
|
177
178
|
CMSSiteConfigId,
|
|
179
|
+
DefaultCacheLifetime,
|
|
178
180
|
FAVICON_ASSETS,
|
|
179
181
|
GhostUserDefaults,
|
|
180
182
|
LinkNewOAuthCookieName,
|
|
@@ -193,7 +195,6 @@ export {
|
|
|
193
195
|
configPaths,
|
|
194
196
|
currentRESTAPIVersions,
|
|
195
197
|
dashboardAPIRoute,
|
|
196
|
-
defaultCacheLifeTime,
|
|
197
198
|
getUiOpts,
|
|
198
199
|
makeDashboardRoute,
|
|
199
200
|
routesDir,
|
package/dist/db/plugins.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export * from '@withstudiocms/kysely/plugin';
|
|
|
7
7
|
* @param root - The root URL to load the configuration from
|
|
8
8
|
* - Root URL can be obtained via the `config.root` property from the `astro:config:setup` integration hook
|
|
9
9
|
*/
|
|
10
|
-
export declare const getDBClientDialect: (root: URL) => Effect.Effect<DbDialectType, import("effect/Cause").UnknownException, never>;
|
|
10
|
+
export declare const getDBClientDialect: (root: URL) => Effect.Effect<DbDialectType, import("effect/ParseResult").ParseError | import("effect/Cause").UnknownException, never>;
|
|
11
11
|
/**
|
|
12
12
|
* Get a Kysely DB Plugin Client for the specified dialect
|
|
13
13
|
*/
|
package/dist/db/plugins.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
loadConfigFile as _loadConfigFile,
|
|
3
|
-
parseAndMerge as _parseAndMerge
|
|
4
|
-
} from "@withstudiocms/config-utils";
|
|
1
|
+
import { loadConfigFile as _loadConfigFile } from "@withstudiocms/config-utils";
|
|
5
2
|
import { getDBClientLive } from "@withstudiocms/kysely/client";
|
|
6
3
|
import { configPaths } from "../consts.js";
|
|
7
|
-
import { Effect } from "../effect.js";
|
|
4
|
+
import { Effect, Schema } from "../effect.js";
|
|
8
5
|
import { StudioCMSOptionsSchema } from "../schemas/index.js";
|
|
9
6
|
import { getDbDriver, parseDbDialect } from "./index.js";
|
|
10
7
|
export * from "@withstudiocms/kysely/plugin";
|
|
@@ -13,10 +10,10 @@ const loadConfigFile = Effect.fn(
|
|
|
13
10
|
() => _loadConfigFile(root, configPaths, "studiocms-db-plugin")
|
|
14
11
|
)
|
|
15
12
|
);
|
|
16
|
-
const
|
|
17
|
-
(config) =>
|
|
13
|
+
const parse = Effect.fn(
|
|
14
|
+
(config) => Schema.decode(StudioCMSOptionsSchema)(config ?? {})
|
|
18
15
|
);
|
|
19
|
-
const loadConfig = (root) => loadConfigFile(root).pipe(Effect.flatMap(
|
|
16
|
+
const loadConfig = (root) => loadConfigFile(root).pipe(Effect.flatMap(parse));
|
|
20
17
|
const getDBClientDialect = Effect.fn(
|
|
21
18
|
(root) => loadConfig(root).pipe(Effect.map((config) => config.db.dialect))
|
|
22
19
|
);
|
|
@@ -18,18 +18,6 @@ export declare const setupRoutes: InjectedRoute[];
|
|
|
18
18
|
* These routes include SDK API endpoints and the renderer service.
|
|
19
19
|
*/
|
|
20
20
|
export declare const noDbSetupRoutes: InjectedRoute[];
|
|
21
|
-
/**
|
|
22
|
-
* REST API routes for StudioCMS.
|
|
23
|
-
*
|
|
24
|
-
* These routes cover folders, pages, settings, users, and public access.
|
|
25
|
-
*/
|
|
26
|
-
export declare const restRoutes: InjectedRoute[];
|
|
27
|
-
/**
|
|
28
|
-
* OAuth Enabled Routes
|
|
29
|
-
*
|
|
30
|
-
* Injected when oAuthEnabled is true.
|
|
31
|
-
*/
|
|
32
|
-
export declare const oAuthEnabledRoutes: InjectedRoute[];
|
|
33
21
|
/**
|
|
34
22
|
* User Registration Enabled Routes
|
|
35
23
|
*
|
|
@@ -42,12 +30,6 @@ export declare const userRegistrationEnabledRoutes: (dashboardRoute: (path: stri
|
|
|
42
30
|
* Injected when dashboardEnabled is true.
|
|
43
31
|
*/
|
|
44
32
|
export declare const dashboardEnabledRoutes: (dashboardRoute: (path: string) => string) => InjectedRoute[];
|
|
45
|
-
/**
|
|
46
|
-
* Dashboard API Enabled Routes
|
|
47
|
-
*
|
|
48
|
-
* Injected when dashboardAPIEnabled is true.
|
|
49
|
-
*/
|
|
50
|
-
export declare const dashboardAPIEnabledRoutes: (dashboardRoute: (path: string) => string) => InjectedRoute[];
|
|
51
33
|
/**
|
|
52
34
|
* 404 Error Page Route
|
|
53
35
|
*
|
|
@@ -71,3 +53,7 @@ export declare const middleware: (dbStartPage: boolean) => AstroIntegrationMiddl
|
|
|
71
53
|
* and middleware to be injected.
|
|
72
54
|
*/
|
|
73
55
|
export declare const getAstroProject: Effect.Effect<import("./types.js").InjectedRoutesWithMiddleware, never, StudioCMSRouteConfig>;
|
|
56
|
+
/**
|
|
57
|
+
* Get route configuration for StudioCMS.
|
|
58
|
+
*/
|
|
59
|
+
export declare const getRouteConfig: Effect.Effect<import("./types.js").ProcessedRouteConfig, never, StudioCMSRouteConfig>;
|
|
@@ -41,47 +41,18 @@ const setupRoutes = [
|
|
|
41
41
|
pattern: "/studiocms_api/dashboard/step-2",
|
|
42
42
|
entrypoint: "setup-pages/studiocms_api/dashboard/step-2.ts"
|
|
43
43
|
},
|
|
44
|
-
{
|
|
45
|
-
pattern: "/studiocms_api/integrations/[type]/[...id]",
|
|
46
|
-
entrypoint: "pages/studiocms_api/integrations/[type]/[...id].ts"
|
|
47
|
-
},
|
|
48
|
-
// Renderer service routes
|
|
49
|
-
{
|
|
50
|
-
pattern: "/studiocms_api/partials/render",
|
|
51
|
-
entrypoint: "pages/studiocms_api/partials/render.astro"
|
|
52
|
-
}
|
|
53
|
-
];
|
|
54
|
-
const noDbSetupRoutes = [
|
|
55
|
-
// SDK API routes
|
|
56
|
-
{
|
|
57
|
-
pattern: "/studiocms_api/sdk/[...path]",
|
|
58
|
-
entrypoint: "pages/studiocms_api/sdk/[...path].ts"
|
|
59
|
-
},
|
|
60
|
-
// Renderer service routes
|
|
61
|
-
{
|
|
62
|
-
pattern: "/studiocms_api/partials/render",
|
|
63
|
-
entrypoint: "pages/studiocms_api/partials/render.astro"
|
|
64
|
-
},
|
|
65
44
|
// Integration routes
|
|
66
45
|
{
|
|
67
|
-
|
|
68
|
-
|
|
46
|
+
// This will also be joining the combined API route, but will also remain it's own dedicated route for the db setup stage.
|
|
47
|
+
pattern: "/studiocms_api/integrations/[...all]",
|
|
48
|
+
entrypoint: "pages/studiocms_api/integrations/[...all].ts"
|
|
69
49
|
}
|
|
70
50
|
];
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
pattern: "/studiocms_api/rest/v1/[type]/[...id]",
|
|
74
|
-
entrypoint: "pages/studiocms_api/rest/v1/[type]/[...id].ts"
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
pattern: "/studiocms_api/rest/v1/public/[type]/[...id]",
|
|
78
|
-
entrypoint: "pages/studiocms_api/rest/v1/public/[type]/[...id].ts"
|
|
79
|
-
}
|
|
80
|
-
];
|
|
81
|
-
const oAuthEnabledRoutes = [
|
|
51
|
+
const noDbSetupRoutes = [
|
|
52
|
+
// StudioCMS Primary API routes
|
|
82
53
|
{
|
|
83
|
-
pattern: "/studiocms_api/
|
|
84
|
-
entrypoint: "pages/studiocms_api/
|
|
54
|
+
pattern: "/studiocms_api/[...all]",
|
|
55
|
+
entrypoint: "pages/studiocms_api/[...all].ts"
|
|
85
56
|
}
|
|
86
57
|
];
|
|
87
58
|
const userRegistrationEnabledRoutes = (dashboardRoute) => [
|
|
@@ -91,27 +62,6 @@ const userRegistrationEnabledRoutes = (dashboardRoute) => [
|
|
|
91
62
|
}
|
|
92
63
|
];
|
|
93
64
|
const dashboardEnabledRoutes = (dashboardRoute) => [
|
|
94
|
-
// Dashboard API Routes
|
|
95
|
-
{
|
|
96
|
-
pattern: "/studiocms_api/dashboard/templates",
|
|
97
|
-
entrypoint: "pages/studiocms_api/dashboard/templates.ts"
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
pattern: "/studiocms_api/partials/editor",
|
|
101
|
-
entrypoint: "pages/studiocms_api/partials/editor.astro"
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
pattern: "/studiocms_api/partials/user-list-items",
|
|
105
|
-
entrypoint: "pages/studiocms_api/partials/user-list-items.astro"
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
pattern: "/studiocms_api/dashboard/search-list",
|
|
109
|
-
entrypoint: "pages/studiocms_api/dashboard/search-list.ts"
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
pattern: "/studiocms_api/auth/[path]",
|
|
113
|
-
entrypoint: "pages/studiocms_api/auth/[path].ts"
|
|
114
|
-
},
|
|
115
65
|
// Dashboard Frontend Route
|
|
116
66
|
...[
|
|
117
67
|
{
|
|
@@ -193,6 +143,10 @@ const dashboardEnabledRoutes = (dashboardRoute) => [
|
|
|
193
143
|
{
|
|
194
144
|
pattern: "system-management",
|
|
195
145
|
entrypoint: "pages/[dashboard]/system-management.astro"
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
pattern: "password-reset",
|
|
149
|
+
entrypoint: "pages/[dashboard]/password-reset.astro"
|
|
196
150
|
}
|
|
197
151
|
].map(({ entrypoint, pattern }) => ({
|
|
198
152
|
// Remap pattern to include dashboard base path
|
|
@@ -200,98 +154,6 @@ const dashboardEnabledRoutes = (dashboardRoute) => [
|
|
|
200
154
|
entrypoint
|
|
201
155
|
}))
|
|
202
156
|
];
|
|
203
|
-
const dashboardAPIEnabledRoutes = (dashboardRoute) => [
|
|
204
|
-
// Dashboard page routes
|
|
205
|
-
{
|
|
206
|
-
pattern: dashboardRoute("password-reset"),
|
|
207
|
-
entrypoint: "pages/[dashboard]/password-reset.astro"
|
|
208
|
-
},
|
|
209
|
-
// API Routes
|
|
210
|
-
{
|
|
211
|
-
pattern: "/studiocms_api/dashboard/config",
|
|
212
|
-
entrypoint: "pages/studiocms_api/dashboard/config.ts"
|
|
213
|
-
},
|
|
214
|
-
{
|
|
215
|
-
pattern: "/studiocms_api/dashboard/profile",
|
|
216
|
-
entrypoint: "pages/studiocms_api/dashboard/profile.ts"
|
|
217
|
-
},
|
|
218
|
-
{
|
|
219
|
-
pattern: "/studiocms_api/dashboard/users",
|
|
220
|
-
entrypoint: "pages/studiocms_api/dashboard/users.ts"
|
|
221
|
-
},
|
|
222
|
-
{
|
|
223
|
-
pattern: "/studiocms_api/dashboard/content/page",
|
|
224
|
-
entrypoint: "pages/studiocms_api/dashboard/content/page.ts"
|
|
225
|
-
},
|
|
226
|
-
{
|
|
227
|
-
pattern: "/studiocms_api/dashboard/content/folder",
|
|
228
|
-
entrypoint: "pages/studiocms_api/dashboard/content/folder.ts"
|
|
229
|
-
},
|
|
230
|
-
{
|
|
231
|
-
pattern: "/studiocms_api/dashboard/content/diff",
|
|
232
|
-
entrypoint: "pages/studiocms_api/dashboard/content/diff.ts"
|
|
233
|
-
},
|
|
234
|
-
{
|
|
235
|
-
pattern: "/studiocms_api/dashboard/taxonomy",
|
|
236
|
-
entrypoint: "pages/studiocms_api/dashboard/taxonomy.ts"
|
|
237
|
-
},
|
|
238
|
-
{
|
|
239
|
-
pattern: "/studiocms_api/dashboard/taxonomy-search",
|
|
240
|
-
entrypoint: "pages/studiocms_api/dashboard/taxonomy-search.ts"
|
|
241
|
-
},
|
|
242
|
-
{
|
|
243
|
-
pattern: "/studiocms_api/dashboard/create-reset-link",
|
|
244
|
-
entrypoint: "pages/studiocms_api/dashboard/create-reset-link.ts"
|
|
245
|
-
},
|
|
246
|
-
{
|
|
247
|
-
pattern: "/studiocms_api/dashboard/reset-password",
|
|
248
|
-
entrypoint: "pages/studiocms_api/dashboard/reset-password.ts"
|
|
249
|
-
},
|
|
250
|
-
{
|
|
251
|
-
pattern: "/studiocms_api/dashboard/plugins/[plugin]",
|
|
252
|
-
entrypoint: "pages/studiocms_api/dashboard/plugins/[plugin].ts"
|
|
253
|
-
},
|
|
254
|
-
{
|
|
255
|
-
pattern: "/studiocms_api/dashboard/create-user",
|
|
256
|
-
entrypoint: "pages/studiocms_api/dashboard/create-user.ts"
|
|
257
|
-
},
|
|
258
|
-
{
|
|
259
|
-
pattern: "/studiocms_api/dashboard/create-user-invite",
|
|
260
|
-
entrypoint: "pages/studiocms_api/dashboard/create-user-invite.ts"
|
|
261
|
-
},
|
|
262
|
-
{
|
|
263
|
-
pattern: "/studiocms_api/dashboard/api-tokens",
|
|
264
|
-
entrypoint: "pages/studiocms_api/dashboard/api-tokens.ts"
|
|
265
|
-
},
|
|
266
|
-
{
|
|
267
|
-
pattern: "/studiocms_api/dashboard/verify-session",
|
|
268
|
-
entrypoint: "pages/studiocms_api/dashboard/verify-session.ts"
|
|
269
|
-
},
|
|
270
|
-
{
|
|
271
|
-
pattern: "/studiocms_api/dashboard/mailer/config",
|
|
272
|
-
entrypoint: "pages/studiocms_api/dashboard/mailer/config.ts"
|
|
273
|
-
},
|
|
274
|
-
{
|
|
275
|
-
pattern: "/studiocms_api/dashboard/mailer/test-email",
|
|
276
|
-
entrypoint: "pages/studiocms_api/dashboard/mailer/check-email.ts"
|
|
277
|
-
},
|
|
278
|
-
{
|
|
279
|
-
pattern: "/studiocms_api/dashboard/verify-email",
|
|
280
|
-
entrypoint: "pages/studiocms_api/dashboard/verify-email.ts"
|
|
281
|
-
},
|
|
282
|
-
{
|
|
283
|
-
pattern: "/studiocms_api/dashboard/email-notification-settings-site",
|
|
284
|
-
entrypoint: "pages/studiocms_api/dashboard/email-notification-settings-site.ts"
|
|
285
|
-
},
|
|
286
|
-
{
|
|
287
|
-
pattern: "/studiocms_api/dashboard/resend-verify-email",
|
|
288
|
-
entrypoint: "pages/studiocms_api/dashboard/resend-verify-email.ts"
|
|
289
|
-
},
|
|
290
|
-
{
|
|
291
|
-
pattern: "/studiocms_api/dashboard/update-user-notifications",
|
|
292
|
-
entrypoint: "pages/studiocms_api/dashboard/update-user-notifications.ts"
|
|
293
|
-
}
|
|
294
|
-
];
|
|
295
157
|
const error404Route = {
|
|
296
158
|
pattern: "/404",
|
|
297
159
|
entrypoint: "pages/404.astro"
|
|
@@ -326,15 +188,14 @@ const getAstroProject = Effect.gen(function* () {
|
|
|
326
188
|
Effect.flatMap(injectMiddleware(config))
|
|
327
189
|
);
|
|
328
190
|
});
|
|
191
|
+
const getRouteConfig = StudioCMSRouteConfig.pipe(Effect.flatMap(processedConfig));
|
|
329
192
|
export {
|
|
330
|
-
dashboardAPIEnabledRoutes,
|
|
331
193
|
dashboardEnabledRoutes,
|
|
332
194
|
error404Route,
|
|
333
195
|
getAstroProject,
|
|
196
|
+
getRouteConfig,
|
|
334
197
|
middleware,
|
|
335
198
|
noDbSetupRoutes,
|
|
336
|
-
oAuthEnabledRoutes,
|
|
337
|
-
restRoutes,
|
|
338
199
|
setupRoutes,
|
|
339
200
|
userRegistrationEnabledRoutes
|
|
340
201
|
};
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import { Context, Effect, Layer } from "@withstudiocms/effect";
|
|
2
2
|
import {
|
|
3
|
-
dashboardAPIEnabledRoutes,
|
|
4
3
|
dashboardEnabledRoutes,
|
|
5
4
|
error404Route,
|
|
6
5
|
middleware,
|
|
7
6
|
noDbSetupRoutes,
|
|
8
|
-
oAuthEnabledRoutes,
|
|
9
|
-
restRoutes,
|
|
10
7
|
setupRoutes,
|
|
11
8
|
userRegistrationEnabledRoutes
|
|
12
9
|
} from "./routes.js";
|
|
@@ -43,11 +40,8 @@ const setPrerenderFalse = (items) => {
|
|
|
43
40
|
};
|
|
44
41
|
const mapProcessedConfig = Effect.fn(
|
|
45
42
|
({
|
|
46
|
-
dashboardAPIEnabled,
|
|
47
43
|
dashboardEnabled,
|
|
48
44
|
dbStartPage,
|
|
49
|
-
oAuthEnabled,
|
|
50
|
-
restAPIEnabled,
|
|
51
45
|
shouldInject404Route,
|
|
52
46
|
userRegistrationEnabled,
|
|
53
47
|
dashboardRoute
|
|
@@ -64,14 +58,6 @@ const mapProcessedConfig = Effect.fn(
|
|
|
64
58
|
enabled: shouldInject404Route,
|
|
65
59
|
routes: setPrerenderFalse(error404Route)
|
|
66
60
|
},
|
|
67
|
-
{
|
|
68
|
-
enabled: restAPIEnabled,
|
|
69
|
-
routes: setPrerenderFalse(restRoutes)
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
enabled: oAuthEnabled,
|
|
73
|
-
routes: setPrerenderFalse(oAuthEnabledRoutes)
|
|
74
|
-
},
|
|
75
61
|
{
|
|
76
62
|
enabled: userRegistrationEnabled,
|
|
77
63
|
routes: setPrerenderFalse(userRegistrationEnabledRoutes(dashboardRoute))
|
|
@@ -79,10 +65,6 @@ const mapProcessedConfig = Effect.fn(
|
|
|
79
65
|
{
|
|
80
66
|
enabled: dashboardEnabled,
|
|
81
67
|
routes: setPrerenderFalse(dashboardEnabledRoutes(dashboardRoute))
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
enabled: dashboardAPIEnabled,
|
|
85
|
-
routes: setPrerenderFalse(dashboardAPIEnabledRoutes(dashboardRoute))
|
|
86
68
|
}
|
|
87
69
|
])
|
|
88
70
|
);
|