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
|
@@ -1,215 +1,226 @@
|
|
|
1
|
-
import
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
* ```ts
|
|
154
|
-
* policy:[
|
|
155
|
-
* {
|
|
156
|
-
* cleanParam: [
|
|
157
|
-
* "sid /index.php",
|
|
158
|
-
* ]
|
|
159
|
-
* }
|
|
160
|
-
* ]
|
|
161
|
-
* ```
|
|
162
|
-
* For additional examples, please consult
|
|
163
|
-
* Yandex's [SYNTAX](https://yandex.com/support/webmaster/robot-workings/clean-param.html#clean-param__additional) guide.
|
|
164
|
-
*/
|
|
165
|
-
cleanParam: StringArrayUnion.optional()
|
|
1
|
+
import * as Schema from "effect/Schema";
|
|
2
|
+
const Spider360 = Schema.Literal("360Spider", "360Spider-Image", "360Spider-Video");
|
|
3
|
+
const HaoSouSpider = Schema.Literal("HaoSouSpider");
|
|
4
|
+
const AdsBotGoogle = Schema.Literal(
|
|
5
|
+
"AdsBot-Google",
|
|
6
|
+
"AdsBot-Google-Mobile",
|
|
7
|
+
"AdsBot-Google-Mobile-Apps"
|
|
8
|
+
);
|
|
9
|
+
const Googlebot = Schema.Literal(
|
|
10
|
+
"Googlebot",
|
|
11
|
+
"Googlebot-Image",
|
|
12
|
+
"Googlebot-Mobile",
|
|
13
|
+
"Googlebot-News",
|
|
14
|
+
"Googlebot-Video"
|
|
15
|
+
);
|
|
16
|
+
const MediapartnersGoogle = Schema.Literal("Mediapartners-Google");
|
|
17
|
+
const adidxbot = Schema.Literal("adidxbot");
|
|
18
|
+
const bingbot = Schema.Literal("bingbot");
|
|
19
|
+
const BingPreview = Schema.Literal("BingPreview");
|
|
20
|
+
const MicrosoftPreview = Schema.Literal("MicrosoftPreview");
|
|
21
|
+
const msnbot = Schema.Literal("msnbot", "msnbot-media");
|
|
22
|
+
const Applebot = Schema.Literal("Applebot", "AppleNewsBot");
|
|
23
|
+
const Baiduspider = Schema.Literal(
|
|
24
|
+
"Baiduspider",
|
|
25
|
+
"Baiduspider-image",
|
|
26
|
+
"Baiduspider-mobile",
|
|
27
|
+
"Baiduspider-news",
|
|
28
|
+
"Baiduspider-video"
|
|
29
|
+
);
|
|
30
|
+
const coccoc = Schema.Literal("coccoc", "coccocbot-image", "coccocbot-web");
|
|
31
|
+
const DuckDuckBot = Schema.Literal("DuckDuckBot", "DuckDuckGo-Favicons-Bot");
|
|
32
|
+
const facebook = Schema.Literal("facebookcatalog", "facebookexternalhit", "Facebot");
|
|
33
|
+
const gooblog = Schema.Literal("gooblog");
|
|
34
|
+
const ichiro = Schema.Literal("ichiro");
|
|
35
|
+
const Sogou = Schema.Literal(
|
|
36
|
+
"Sogou blog",
|
|
37
|
+
"Sogou inst spider",
|
|
38
|
+
"Sogou News Spider",
|
|
39
|
+
"Sogou Orion spider",
|
|
40
|
+
"Sogou spider2",
|
|
41
|
+
"Sogou web spider"
|
|
42
|
+
);
|
|
43
|
+
const Yandex = Schema.Literal("Yandex", "YandexMobileBot");
|
|
44
|
+
const AlgoliaCrawler = Schema.Literal("Algolia Crawler");
|
|
45
|
+
const BublupBot = Schema.Literal("BublupBot");
|
|
46
|
+
const CCBot = Schema.Literal("CCBot");
|
|
47
|
+
const Cliqzbot = Schema.Literal("Cliqzbot");
|
|
48
|
+
const Daumoa = Schema.Literal("Daumoa");
|
|
49
|
+
const DeuSu = Schema.Literal("DeuSu");
|
|
50
|
+
const EuripBot = Schema.Literal("EuripBot");
|
|
51
|
+
const Exploratodo = Schema.Literal("Exploratodo");
|
|
52
|
+
const Feedly = Schema.Literal("Feedly");
|
|
53
|
+
const Findxbot = Schema.Literal("Findxbot");
|
|
54
|
+
const istellabot = Schema.Literal("istellabot");
|
|
55
|
+
const JikeSpider = Schema.Literal("JikeSpider");
|
|
56
|
+
const Lycos = Schema.Literal("Lycos");
|
|
57
|
+
const MailRu = Schema.Literal("Mail.Ru");
|
|
58
|
+
const MojeekBot = Schema.Literal("MojeekBot");
|
|
59
|
+
const OrangeBot = Schema.Literal("OrangeBot");
|
|
60
|
+
const Pinterest = Schema.Literal("Pinterest");
|
|
61
|
+
const Plukkie = Schema.Literal("Plukkie");
|
|
62
|
+
const Qwantify = Schema.Literal("Qwantify");
|
|
63
|
+
const Rambler = Schema.Literal("Rambler");
|
|
64
|
+
const SemanticScholarBot = Schema.Literal("SemanticScholarBot");
|
|
65
|
+
const SeSchemanamBot = Schema.Literal("SeSchemanamBot");
|
|
66
|
+
const Sosospider = Schema.Literal("Sosospider");
|
|
67
|
+
const Slurp = Schema.Literal("Slurp");
|
|
68
|
+
const Twitterbot = Schema.Literal("Twitterbot");
|
|
69
|
+
const WhatsApp = Schema.Literal("WhatsApp");
|
|
70
|
+
const yacybot = Schema.Literal("yacybot");
|
|
71
|
+
const YepBot = Schema.Literal("YepBot");
|
|
72
|
+
const Yeti = Schema.Literal("Yeti");
|
|
73
|
+
const YioopBot = Schema.Literal("YioopBot");
|
|
74
|
+
const yooSchemaBot = Schema.Literal("yooSchemaBot");
|
|
75
|
+
const YoudaoBot = Schema.Literal("YoudaoBot");
|
|
76
|
+
const SearchEngines = Schema.Union(
|
|
77
|
+
Spider360,
|
|
78
|
+
HaoSouSpider,
|
|
79
|
+
AdsBotGoogle,
|
|
80
|
+
Googlebot,
|
|
81
|
+
MediapartnersGoogle,
|
|
82
|
+
adidxbot,
|
|
83
|
+
bingbot,
|
|
84
|
+
BingPreview,
|
|
85
|
+
MicrosoftPreview,
|
|
86
|
+
msnbot,
|
|
87
|
+
Applebot,
|
|
88
|
+
Baiduspider,
|
|
89
|
+
coccoc,
|
|
90
|
+
DuckDuckBot,
|
|
91
|
+
facebook,
|
|
92
|
+
gooblog,
|
|
93
|
+
ichiro,
|
|
94
|
+
Sogou,
|
|
95
|
+
Yandex,
|
|
96
|
+
AlgoliaCrawler,
|
|
97
|
+
BublupBot,
|
|
98
|
+
CCBot,
|
|
99
|
+
Cliqzbot,
|
|
100
|
+
Daumoa,
|
|
101
|
+
DeuSu,
|
|
102
|
+
EuripBot,
|
|
103
|
+
Exploratodo,
|
|
104
|
+
Feedly,
|
|
105
|
+
Findxbot,
|
|
106
|
+
istellabot,
|
|
107
|
+
JikeSpider,
|
|
108
|
+
Lycos,
|
|
109
|
+
MailRu,
|
|
110
|
+
MojeekBot,
|
|
111
|
+
OrangeBot,
|
|
112
|
+
Pinterest,
|
|
113
|
+
Plukkie,
|
|
114
|
+
Qwantify,
|
|
115
|
+
Rambler,
|
|
116
|
+
SemanticScholarBot,
|
|
117
|
+
SeSchemanamBot,
|
|
118
|
+
Sosospider,
|
|
119
|
+
Slurp,
|
|
120
|
+
Twitterbot,
|
|
121
|
+
WhatsApp,
|
|
122
|
+
yacybot,
|
|
123
|
+
YepBot,
|
|
124
|
+
Yeti,
|
|
125
|
+
YioopBot,
|
|
126
|
+
yooSchemaBot,
|
|
127
|
+
YoudaoBot
|
|
128
|
+
);
|
|
129
|
+
const StringArrayUnion = Schema.Union(Schema.String, Schema.Array(Schema.String));
|
|
130
|
+
const UserAgentSchema = Schema.Union(Schema.Literal("*"), SearchEngines);
|
|
131
|
+
const PolicyOptionsSchema = Schema.Struct({
|
|
132
|
+
userAgent: Schema.optional(
|
|
133
|
+
Schema.Union(UserAgentSchema, Schema.Array(UserAgentSchema))
|
|
134
|
+
).annotations({
|
|
135
|
+
description: 'User Agent - Specify the user agent(s) that the policy applies to. This can be a single user agent, an array of user agents, or the wildcard "*" to apply to all user agents.'
|
|
136
|
+
}),
|
|
137
|
+
allow: Schema.optional(StringArrayUnion).annotations({
|
|
138
|
+
description: "Allow - Specify the paths that are allowed for the specified user agents. This can be a single path or an array of paths."
|
|
139
|
+
}),
|
|
140
|
+
disallow: Schema.optional(StringArrayUnion).annotations({
|
|
141
|
+
description: "Disallow - Specify the paths that are disallowed for the specified user agents. This can be a single path or an array of paths."
|
|
142
|
+
}),
|
|
143
|
+
crawlDelay: Schema.optional(Schema.Number).annotations({
|
|
144
|
+
description: "Crawl Delay - Specify the crawl delay in seconds for the specified user agents. This tells search engine bots how many seconds to wait between requests to the server."
|
|
145
|
+
}),
|
|
146
|
+
cleanParam: Schema.optional(StringArrayUnion).annotations({
|
|
147
|
+
description: "Clean Param - Specify URL parameters that should be ignored by search engine bots when crawling the site. This can help prevent duplicate content issues caused by URL parameters."
|
|
148
|
+
})
|
|
149
|
+
}).annotations({
|
|
150
|
+
title: "Policy Options Schema",
|
|
151
|
+
description: "Schema for defining the options for a robots.txt policy, including user agents, allowed and disallowed paths, crawl delay, and clean parameters.",
|
|
152
|
+
identifier: "PolicyOptions"
|
|
166
153
|
});
|
|
167
|
-
const RobotsTXTConfigSchema =
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
host: StringBooleanUnion.optional(),
|
|
182
|
-
/**
|
|
183
|
-
* @description
|
|
184
|
-
* [ Optional, zero or more per file ] The location of a sitemap for this website.
|
|
185
|
-
* @example
|
|
186
|
-
* ```ts
|
|
187
|
-
* sitemap: [
|
|
188
|
-
* "https://example.com/sitemap.xml",
|
|
189
|
-
* "https://www.example.com/sitemap.xml"
|
|
190
|
-
* ]
|
|
191
|
-
* ```
|
|
192
|
-
* The value of the [SITEMAP](https://developers.google.com/search/docs/crawling-indexing/robots/robots_txt#sitemap) field is case-sensitive.
|
|
193
|
-
*/
|
|
194
|
-
sitemap: StringArrayBooleanUnion.optional(),
|
|
195
|
-
/**
|
|
196
|
-
* @description
|
|
197
|
-
* [ Optional ] List of `policy` rules.
|
|
198
|
-
* @default
|
|
199
|
-
* ```ts
|
|
200
|
-
* policy:[
|
|
201
|
-
* {
|
|
202
|
-
* userAgent: "*",
|
|
203
|
-
* allow: "/"
|
|
204
|
-
* }
|
|
205
|
-
* ]
|
|
206
|
-
* ```
|
|
207
|
-
* For more help, refer to [SYNTAX](https://yandex.com/support/webmaster/controlling-robot/robots-txt.html#recommend) by Yandex.
|
|
208
|
-
*/
|
|
209
|
-
policy: z.array(PolicyOptionsSchema).optional()
|
|
154
|
+
const RobotsTXTConfigSchema = Schema.Struct({
|
|
155
|
+
host: Schema.optional(Schema.Union(Schema.String, Schema.Boolean)).annotations({
|
|
156
|
+
description: 'Host - Specify the preferred domain for the site. This can be a string (e.g., "www.example.com") or a boolean (true to use the current domain, false to omit the Host directive).'
|
|
157
|
+
}),
|
|
158
|
+
sitemap: Schema.optional(Schema.Union(StringArrayUnion, Schema.Boolean)).annotations({
|
|
159
|
+
description: "Sitemap - Specify the URL(s) of the sitemap(s) for the site. This can be a single URL, an array of URLs, or a boolean (true to use the default sitemap location, false to omit the Sitemap directive)."
|
|
160
|
+
}),
|
|
161
|
+
policy: Schema.optional(Schema.Array(PolicyOptionsSchema)).annotations({
|
|
162
|
+
description: "Policy - An array of policy objects that define the rules for different user agents. Each policy object can specify the user agents it applies to, allowed and disallowed paths, crawl delay, and clean parameters."
|
|
163
|
+
})
|
|
164
|
+
}).annotations({
|
|
165
|
+
title: "Robots.txt Configuration Schema",
|
|
166
|
+
description: "Schema for configuring the robots.txt file, including host, sitemap, and policy options.",
|
|
167
|
+
identifier: "RobotsTXTConfig"
|
|
210
168
|
});
|
|
211
169
|
export {
|
|
170
|
+
AdsBotGoogle,
|
|
171
|
+
AlgoliaCrawler,
|
|
172
|
+
Applebot,
|
|
173
|
+
Baiduspider,
|
|
174
|
+
BingPreview,
|
|
175
|
+
BublupBot,
|
|
176
|
+
CCBot,
|
|
177
|
+
Cliqzbot,
|
|
178
|
+
Daumoa,
|
|
179
|
+
DeuSu,
|
|
180
|
+
DuckDuckBot,
|
|
181
|
+
EuripBot,
|
|
182
|
+
Exploratodo,
|
|
183
|
+
Feedly,
|
|
184
|
+
Findxbot,
|
|
185
|
+
Googlebot,
|
|
186
|
+
HaoSouSpider,
|
|
187
|
+
JikeSpider,
|
|
188
|
+
Lycos,
|
|
189
|
+
MailRu,
|
|
190
|
+
MediapartnersGoogle,
|
|
191
|
+
MicrosoftPreview,
|
|
192
|
+
MojeekBot,
|
|
193
|
+
OrangeBot,
|
|
194
|
+
Pinterest,
|
|
195
|
+
Plukkie,
|
|
212
196
|
PolicyOptionsSchema,
|
|
197
|
+
Qwantify,
|
|
198
|
+
Rambler,
|
|
213
199
|
RobotsTXTConfigSchema,
|
|
214
|
-
|
|
200
|
+
SeSchemanamBot,
|
|
201
|
+
SearchEngines,
|
|
202
|
+
SemanticScholarBot,
|
|
203
|
+
Slurp,
|
|
204
|
+
Sogou,
|
|
205
|
+
Sosospider,
|
|
206
|
+
Spider360,
|
|
207
|
+
StringArrayUnion,
|
|
208
|
+
Twitterbot,
|
|
209
|
+
UserAgentSchema,
|
|
210
|
+
WhatsApp,
|
|
211
|
+
Yandex,
|
|
212
|
+
YepBot,
|
|
213
|
+
Yeti,
|
|
214
|
+
YioopBot,
|
|
215
|
+
YoudaoBot,
|
|
216
|
+
adidxbot,
|
|
217
|
+
bingbot,
|
|
218
|
+
coccoc,
|
|
219
|
+
facebook,
|
|
220
|
+
gooblog,
|
|
221
|
+
ichiro,
|
|
222
|
+
istellabot,
|
|
223
|
+
msnbot,
|
|
224
|
+
yacybot,
|
|
225
|
+
yooSchemaBot
|
|
215
226
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Schema } from 'effect';
|
|
2
|
+
import { RatingSchema } from '../schemas.js';
|
|
2
3
|
/**
|
|
3
4
|
* Enum schema for Web Vitals rating.
|
|
4
5
|
*
|
|
@@ -7,12 +8,12 @@ import { z } from 'astro/zod';
|
|
|
7
8
|
* - 'needs-improvement': Indicates that the web vitals need improvement.
|
|
8
9
|
* - 'poor': Indicates that the web vitals are performing poorly.
|
|
9
10
|
*/
|
|
10
|
-
export declare const WebVitalsRatingSchema:
|
|
11
|
+
export declare const WebVitalsRatingSchema: Schema.Literal<["good", "needs-improvement", "poor"]>;
|
|
11
12
|
/**
|
|
12
13
|
* Type representing the inferred type of the WebVitalsRatingSchema.
|
|
13
14
|
* This type is generated using the `z.infer` utility from the `zod` library.
|
|
14
15
|
*/
|
|
15
|
-
export type WebVitalsRating =
|
|
16
|
+
export type WebVitalsRating = typeof RatingSchema.Type;
|
|
16
17
|
/**
|
|
17
18
|
* Enum schema for Core Web Vitals metric types.
|
|
18
19
|
*
|
|
@@ -23,7 +24,7 @@ export type WebVitalsRating = z.infer<typeof WebVitalsRatingSchema>;
|
|
|
23
24
|
*
|
|
24
25
|
* These metrics are used to measure the performance and user experience of web pages.
|
|
25
26
|
*/
|
|
26
|
-
export declare const CoreWebVitalsMetricTypeSchema:
|
|
27
|
+
export declare const CoreWebVitalsMetricTypeSchema: Schema.Literal<["CLS", "INP", "LCP"]>;
|
|
27
28
|
/**
|
|
28
29
|
* Type definition for Core Web Vitals metrics.
|
|
29
30
|
*
|
|
@@ -31,7 +32,7 @@ export declare const CoreWebVitalsMetricTypeSchema: z.ZodEnum<["CLS", "INP", "LC
|
|
|
31
32
|
* It represents the structure of the core web vitals metrics used in the application.
|
|
32
33
|
*
|
|
33
34
|
*/
|
|
34
|
-
export type CoreWebVitalsMetricType =
|
|
35
|
+
export type CoreWebVitalsMetricType = typeof CoreWebVitalsMetricTypeSchema.Type;
|
|
35
36
|
/**
|
|
36
37
|
* Schema for Web Vitals Metric Types.
|
|
37
38
|
*
|
|
@@ -42,7 +43,7 @@ export type CoreWebVitalsMetricType = z.infer<typeof CoreWebVitalsMetricTypeSche
|
|
|
42
43
|
* - `FID`: First Input Delay
|
|
43
44
|
* - `TTFB`: Time to First Byte
|
|
44
45
|
*/
|
|
45
|
-
export declare const WebVitalsMetricTypeSchema:
|
|
46
|
+
export declare const WebVitalsMetricTypeSchema: Schema.Union<[Schema.Literal<["CLS", "INP", "LCP"]>, Schema.Literal<["FCP", "FID", "TTFB"]>]>;
|
|
46
47
|
/**
|
|
47
48
|
* Represents the type for Web Vitals metrics.
|
|
48
49
|
*
|
|
@@ -51,7 +52,7 @@ export declare const WebVitalsMetricTypeSchema: z.ZodUnion<[z.ZodEnum<["CLS", "I
|
|
|
51
52
|
*
|
|
52
53
|
* @see WebVitalsMetricTypeSchema
|
|
53
54
|
*/
|
|
54
|
-
export type WebVitalsMetricType =
|
|
55
|
+
export type WebVitalsMetricType = typeof WebVitalsMetricTypeSchema.Type;
|
|
55
56
|
/**
|
|
56
57
|
* Schema for summarizing route metrics.
|
|
57
58
|
*
|
|
@@ -62,7 +63,11 @@ export type WebVitalsMetricType = z.infer<typeof WebVitalsMetricTypeSchema>;
|
|
|
62
63
|
* 4. Value (number, must be greater than or equal to 0)
|
|
63
64
|
* 5. Sample size (number)
|
|
64
65
|
*/
|
|
65
|
-
export declare const RouteSummaryRowSchema:
|
|
66
|
+
export declare const RouteSummaryRowSchema: Schema.Tuple<[typeof Schema.String, Schema.Literal<["CLS", "INP", "LCP"]>, Schema.Literal<["good", "needs-improvement", "poor"]>, Schema.filter<typeof Schema.Number>, typeof Schema.Number]>;
|
|
67
|
+
/**
|
|
68
|
+
* Type representing a summary row of route metrics.
|
|
69
|
+
*/
|
|
70
|
+
export declare const RatingEndSchema: Schema.transform<Schema.Literal<[0, 1]>, typeof Schema.Boolean>;
|
|
66
71
|
/**
|
|
67
72
|
* Schema for a summary row of web vitals metrics.
|
|
68
73
|
*
|
|
@@ -75,4 +80,4 @@ export declare const RouteSummaryRowSchema: z.ZodTuple<[z.ZodString, z.ZodEnum<[
|
|
|
75
80
|
* - `percentile`: A number representing the percentile of the metric, or null.
|
|
76
81
|
* - `sample size`: A number representing the sample size.
|
|
77
82
|
*/
|
|
78
|
-
export declare const MetricSummaryRowSchema:
|
|
83
|
+
export declare const MetricSummaryRowSchema: Schema.Tuple<[Schema.Union<[Schema.Literal<["CLS", "INP", "LCP"]>, Schema.Literal<["FCP", "FID", "TTFB"]>]>, Schema.Literal<["good", "needs-improvement", "poor"]>, Schema.filter<typeof Schema.Number>, Schema.filter<typeof Schema.Number>, Schema.transform<Schema.Literal<[0, 1]>, typeof Schema.Boolean>, Schema.NullOr<typeof Schema.Number>, typeof Schema.Number]>;
|
|
@@ -1,36 +1,44 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { RatingSchema } from "../schemas.js";
|
|
3
|
+
const WebVitalsRatingSchema = RatingSchema;
|
|
4
|
+
const CoreWebVitalsMetricTypeSchema = Schema.Literal("CLS", "INP", "LCP");
|
|
5
|
+
const WebVitalsMetricTypeSchema = Schema.Union(
|
|
6
|
+
CoreWebVitalsMetricTypeSchema,
|
|
7
|
+
Schema.Literal("FCP", "FID", "TTFB")
|
|
6
8
|
);
|
|
7
|
-
const RouteSummaryRowSchema =
|
|
9
|
+
const RouteSummaryRowSchema = Schema.Tuple(
|
|
8
10
|
// route path
|
|
9
|
-
|
|
11
|
+
Schema.String,
|
|
10
12
|
CoreWebVitalsMetricTypeSchema,
|
|
11
13
|
WebVitalsRatingSchema,
|
|
12
14
|
// value
|
|
13
|
-
|
|
15
|
+
Schema.Number.pipe(Schema.greaterThanOrEqualTo(0)),
|
|
14
16
|
// sample size
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const
|
|
17
|
+
Schema.Number
|
|
18
|
+
);
|
|
19
|
+
const RatingEndSchema = Schema.transform(Schema.Literal(0, 1), Schema.Boolean, {
|
|
20
|
+
strict: true,
|
|
21
|
+
decode: (input) => input === 1,
|
|
22
|
+
encode: (input) => input ? 1 : 0
|
|
23
|
+
});
|
|
24
|
+
const MetricSummaryRowSchema = Schema.Tuple(
|
|
18
25
|
WebVitalsMetricTypeSchema,
|
|
19
26
|
WebVitalsRatingSchema,
|
|
20
27
|
// value
|
|
21
|
-
|
|
28
|
+
Schema.Number.pipe(Schema.greaterThanOrEqualTo(0)),
|
|
22
29
|
// density
|
|
23
|
-
|
|
30
|
+
Schema.Number.pipe(Schema.greaterThanOrEqualTo(0)),
|
|
24
31
|
// rating end
|
|
25
|
-
|
|
32
|
+
RatingEndSchema,
|
|
26
33
|
// percentile
|
|
27
|
-
|
|
34
|
+
Schema.NullOr(Schema.Number),
|
|
28
35
|
// sample size
|
|
29
|
-
|
|
30
|
-
|
|
36
|
+
Schema.Number
|
|
37
|
+
);
|
|
31
38
|
export {
|
|
32
39
|
CoreWebVitalsMetricTypeSchema,
|
|
33
40
|
MetricSummaryRowSchema,
|
|
41
|
+
RatingEndSchema,
|
|
34
42
|
RouteSummaryRowSchema,
|
|
35
43
|
WebVitalsMetricTypeSchema,
|
|
36
44
|
WebVitalsRatingSchema
|
|
@@ -125,8 +125,8 @@ export declare const getAnalyticsDbClient: (driverDialect: DbDialectType) => imp
|
|
|
125
125
|
};
|
|
126
126
|
} & {
|
|
127
127
|
readonly StudioCMSMetric: {
|
|
128
|
-
readonly value: number;
|
|
129
128
|
readonly name: "CLS" | "INP" | "LCP" | "FCP" | "TTFB";
|
|
129
|
+
readonly value: number;
|
|
130
130
|
readonly route: string;
|
|
131
131
|
readonly id: string;
|
|
132
132
|
readonly timestamp: import("kysely").ColumnType<string, string, string>;
|