blodemd 0.0.15 → 0.2.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/README.md +26 -1
- package/dist/cli.mjs +217 -217
- package/dist/cli.mjs.map +1 -1
- package/package.json +3 -36
- package/dev-server/app/[[...slug]]/page.tsx +0 -140
- package/dev-server/app/blodemd-dev/invalidate/route.ts +0 -12
- package/dev-server/app/blodemd-dev/static/[...path]/route.ts +0 -32
- package/dev-server/app/blodemd-dev/version/route.ts +0 -14
- package/dev-server/app/blodemd-internal/proxy/route.ts +0 -86
- package/dev-server/app/error.tsx +0 -24
- package/dev-server/app/favicon.ico +0 -0
- package/dev-server/app/globals.css +0 -4
- package/dev-server/app/layout.tsx +0 -38
- package/dev-server/app/not-found.tsx +0 -18
- package/dev-server/app/search/route.ts +0 -17
- package/dev-server/components/dev-reload-script.tsx +0 -86
- package/dev-server/components/providers.tsx +0 -15
- package/dev-server/lib/dev-state.ts +0 -8
- package/dev-server/lib/local-content-source.ts +0 -103
- package/dev-server/lib/local-runtime.tsx +0 -555
- package/dev-server/next-env.d.ts +0 -5
- package/dev-server/next.config.js +0 -54
- package/dev-server/package.json +0 -61
- package/dev-server/postcss.config.mjs +0 -7
- package/dev-server/public/glide-variable.woff2 +0 -0
- package/dev-server/tsconfig.json +0 -50
- package/docs/app/globals.css +0 -471
- package/docs/components/animate-ui/primitives/buttons/button.tsx +0 -14
- package/docs/components/api/api-playground.tsx +0 -467
- package/docs/components/api/api-reference.tsx +0 -157
- package/docs/components/content/collection-index.tsx +0 -114
- package/docs/components/docs/contextual-menu.tsx +0 -495
- package/docs/components/docs/copy-page-menu.tsx +0 -364
- package/docs/components/docs/doc-header.tsx +0 -223
- package/docs/components/docs/doc-shell.tsx +0 -355
- package/docs/components/docs/doc-sidebar.tsx +0 -256
- package/docs/components/docs/doc-toc.tsx +0 -46
- package/docs/components/docs/mobile-nav.tsx +0 -195
- package/docs/components/docs/sidebar-active-highlight.tsx +0 -34
- package/docs/components/docs/sidebar-scroll-area.tsx +0 -63
- package/docs/components/git/repo-picker.tsx +0 -529
- package/docs/components/icons/doc-icon.tsx +0 -96
- package/docs/components/mdx/accordion.tsx +0 -83
- package/docs/components/mdx/agent-instructions.tsx +0 -17
- package/docs/components/mdx/badge.tsx +0 -79
- package/docs/components/mdx/callout.tsx +0 -88
- package/docs/components/mdx/card.tsx +0 -110
- package/docs/components/mdx/code-block.tsx +0 -80
- package/docs/components/mdx/code-group.tsx +0 -203
- package/docs/components/mdx/color.tsx +0 -87
- package/docs/components/mdx/columns.tsx +0 -25
- package/docs/components/mdx/expandable.tsx +0 -45
- package/docs/components/mdx/field-layout.tsx +0 -77
- package/docs/components/mdx/frame.tsx +0 -23
- package/docs/components/mdx/get-text-content.ts +0 -18
- package/docs/components/mdx/icon.tsx +0 -12
- package/docs/components/mdx/iframe.tsx +0 -62
- package/docs/components/mdx/index.tsx +0 -121
- package/docs/components/mdx/installer.tsx +0 -20
- package/docs/components/mdx/panel.tsx +0 -11
- package/docs/components/mdx/param-field.tsx +0 -56
- package/docs/components/mdx/preview.tsx +0 -36
- package/docs/components/mdx/prompt.tsx +0 -63
- package/docs/components/mdx/request-example.tsx +0 -27
- package/docs/components/mdx/response-field.tsx +0 -42
- package/docs/components/mdx/steps.tsx +0 -92
- package/docs/components/mdx/tabs.tsx +0 -193
- package/docs/components/mdx/tile.tsx +0 -43
- package/docs/components/mdx/tooltip.tsx +0 -71
- package/docs/components/mdx/tree.tsx +0 -120
- package/docs/components/mdx/type-table.tsx +0 -71
- package/docs/components/mdx/update.tsx +0 -44
- package/docs/components/mdx/video.tsx +0 -45
- package/docs/components/mdx/view.tsx +0 -66
- package/docs/components/posthog-provider.tsx +0 -42
- package/docs/components/providers.tsx +0 -15
- package/docs/components/tenant-analytics.tsx +0 -49
- package/docs/components/third-parties.tsx +0 -32
- package/docs/components/ui/badge.tsx +0 -61
- package/docs/components/ui/breadcrumb.tsx +0 -112
- package/docs/components/ui/button-group.tsx +0 -83
- package/docs/components/ui/button.tsx +0 -65
- package/docs/components/ui/card.tsx +0 -92
- package/docs/components/ui/command.tsx +0 -167
- package/docs/components/ui/copy-button.tsx +0 -129
- package/docs/components/ui/dialog.tsx +0 -146
- package/docs/components/ui/field.tsx +0 -237
- package/docs/components/ui/input.tsx +0 -23
- package/docs/components/ui/kbd.tsx +0 -98
- package/docs/components/ui/label.tsx +0 -22
- package/docs/components/ui/morph-icon.tsx +0 -79
- package/docs/components/ui/popover.tsx +0 -267
- package/docs/components/ui/search-dialog.tsx +0 -431
- package/docs/components/ui/search.tsx +0 -101
- package/docs/components/ui/separator.tsx +0 -26
- package/docs/components/ui/sheet.tsx +0 -133
- package/docs/components/ui/sidebar.tsx +0 -758
- package/docs/components/ui/skeleton.tsx +0 -11
- package/docs/components/ui/switch.tsx +0 -32
- package/docs/components/ui/tabs.tsx +0 -138
- package/docs/components/ui/theme-toggle.tsx +0 -62
- package/docs/components/ui/tooltip.tsx +0 -53
- package/docs/components/web-mcp.tsx +0 -115
- package/docs/lib/agent-skills.ts +0 -48
- package/docs/lib/api-client.ts +0 -72
- package/docs/lib/config.ts +0 -6
- package/docs/lib/content-root.ts +0 -33
- package/docs/lib/content-source.ts +0 -70
- package/docs/lib/contextual-options.ts +0 -222
- package/docs/lib/dashboard-session.ts +0 -167
- package/docs/lib/db.ts +0 -13
- package/docs/lib/docs-collection.ts +0 -7
- package/docs/lib/docs-runtime.tsx +0 -745
- package/docs/lib/edge-config.ts +0 -95
- package/docs/lib/env.ts +0 -23
- package/docs/lib/etag.ts +0 -22
- package/docs/lib/github-install.ts +0 -33
- package/docs/lib/llms-full.ts +0 -82
- package/docs/lib/marketing-markdown.ts +0 -79
- package/docs/lib/marketing-site.ts +0 -31
- package/docs/lib/mdx.ts +0 -98
- package/docs/lib/navigation.ts +0 -288
- package/docs/lib/openapi-proxy.ts +0 -88
- package/docs/lib/openapi.ts +0 -158
- package/docs/lib/platform-config.ts +0 -6
- package/docs/lib/project-authz.ts +0 -46
- package/docs/lib/routes.ts +0 -103
- package/docs/lib/server-cache.ts +0 -83
- package/docs/lib/shiki.ts +0 -44
- package/docs/lib/supabase.ts +0 -37
- package/docs/lib/tenancy.ts +0 -364
- package/docs/lib/tenant-headers.ts +0 -43
- package/docs/lib/tenant-static.ts +0 -705
- package/docs/lib/tenant-utility-context.ts +0 -62
- package/docs/lib/tenants.ts +0 -72
- package/docs/lib/theme.ts +0 -29
- package/docs/lib/time-ago.ts +0 -24
- package/docs/lib/toc.ts +0 -2
- package/docs/lib/use-mobile.ts +0 -19
- package/docs/lib/use-tab-observer.ts +0 -71
- package/docs/lib/utils.ts +0 -5
- package/packages/@repo/common/dist/index.d.ts +0 -16
- package/packages/@repo/common/dist/index.d.ts.map +0 -1
- package/packages/@repo/common/dist/index.js +0 -84
- package/packages/@repo/common/package.json +0 -34
- package/packages/@repo/common/src/index.ts +0 -101
- package/packages/@repo/contracts/dist/analytics.d.ts +0 -21
- package/packages/@repo/contracts/dist/analytics.d.ts.map +0 -1
- package/packages/@repo/contracts/dist/analytics.js +0 -18
- package/packages/@repo/contracts/dist/dates.d.ts +0 -4
- package/packages/@repo/contracts/dist/dates.d.ts.map +0 -1
- package/packages/@repo/contracts/dist/dates.js +0 -2
- package/packages/@repo/contracts/dist/deployment.d.ts +0 -71
- package/packages/@repo/contracts/dist/deployment.d.ts.map +0 -1
- package/packages/@repo/contracts/dist/deployment.js +0 -46
- package/packages/@repo/contracts/dist/domain.d.ts +0 -94
- package/packages/@repo/contracts/dist/domain.d.ts.map +0 -1
- package/packages/@repo/contracts/dist/domain.js +0 -36
- package/packages/@repo/contracts/dist/git.d.ts +0 -28
- package/packages/@repo/contracts/dist/git.d.ts.map +0 -1
- package/packages/@repo/contracts/dist/git.js +0 -24
- package/packages/@repo/contracts/dist/ids.d.ts +0 -14
- package/packages/@repo/contracts/dist/ids.d.ts.map +0 -1
- package/packages/@repo/contracts/dist/ids.js +0 -11
- package/packages/@repo/contracts/dist/index.d.ts +0 -11
- package/packages/@repo/contracts/dist/index.d.ts.map +0 -1
- package/packages/@repo/contracts/dist/index.js +0 -12
- package/packages/@repo/contracts/dist/pagination.d.ts +0 -23
- package/packages/@repo/contracts/dist/pagination.d.ts.map +0 -1
- package/packages/@repo/contracts/dist/pagination.js +0 -15
- package/packages/@repo/contracts/dist/project.d.ts +0 -42
- package/packages/@repo/contracts/dist/project.d.ts.map +0 -1
- package/packages/@repo/contracts/dist/project.js +0 -25
- package/packages/@repo/contracts/dist/tenant.d.ts +0 -147
- package/packages/@repo/contracts/dist/tenant.d.ts.map +0 -1
- package/packages/@repo/contracts/dist/tenant.js +0 -58
- package/packages/@repo/contracts/dist/user.d.ts +0 -9
- package/packages/@repo/contracts/dist/user.d.ts.map +0 -1
- package/packages/@repo/contracts/dist/user.js +0 -9
- package/packages/@repo/contracts/package.json +0 -37
- package/packages/@repo/contracts/src/analytics.ts +0 -33
- package/packages/@repo/contracts/src/dates.ts +0 -4
- package/packages/@repo/contracts/src/deployment.ts +0 -73
- package/packages/@repo/contracts/src/domain.ts +0 -51
- package/packages/@repo/contracts/src/git.ts +0 -31
- package/packages/@repo/contracts/src/ids.ts +0 -23
- package/packages/@repo/contracts/src/index.ts +0 -12
- package/packages/@repo/contracts/src/pagination.ts +0 -21
- package/packages/@repo/contracts/src/project.ts +0 -32
- package/packages/@repo/contracts/src/tenant.ts +0 -94
- package/packages/@repo/contracts/src/user.ts +0 -12
- package/packages/@repo/models/dist/docs-config.d.ts +0 -961
- package/packages/@repo/models/dist/docs-config.d.ts.map +0 -1
- package/packages/@repo/models/dist/docs-config.js +0 -531
- package/packages/@repo/models/dist/index.d.ts +0 -3
- package/packages/@repo/models/dist/index.d.ts.map +0 -1
- package/packages/@repo/models/dist/index.js +0 -3
- package/packages/@repo/models/dist/tenant.d.ts +0 -37
- package/packages/@repo/models/dist/tenant.d.ts.map +0 -1
- package/packages/@repo/models/dist/tenant.js +0 -1
- package/packages/@repo/models/package.json +0 -37
- package/packages/@repo/models/src/docs-config.ts +0 -629
- package/packages/@repo/models/src/index.ts +0 -3
- package/packages/@repo/models/src/tenant.ts +0 -44
- package/packages/@repo/prebuild/dist/index.d.ts +0 -2
- package/packages/@repo/prebuild/dist/index.d.ts.map +0 -1
- package/packages/@repo/prebuild/dist/index.js +0 -2
- package/packages/@repo/prebuild/dist/openapi.d.ts +0 -43
- package/packages/@repo/prebuild/dist/openapi.d.ts.map +0 -1
- package/packages/@repo/prebuild/dist/openapi.js +0 -86
- package/packages/@repo/prebuild/package.json +0 -39
- package/packages/@repo/prebuild/src/index.ts +0 -2
- package/packages/@repo/prebuild/src/openapi.ts +0 -154
- package/packages/@repo/previewing/dist/blob-source.d.ts +0 -16
- package/packages/@repo/previewing/dist/blob-source.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/blob-source.js +0 -128
- package/packages/@repo/previewing/dist/config-loader.d.ts +0 -134
- package/packages/@repo/previewing/dist/config-loader.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/config-loader.js +0 -231
- package/packages/@repo/previewing/dist/constants.d.ts +0 -15
- package/packages/@repo/previewing/dist/constants.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/constants.js +0 -14
- package/packages/@repo/previewing/dist/content-index.d.ts +0 -7
- package/packages/@repo/previewing/dist/content-index.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/content-index.js +0 -291
- package/packages/@repo/previewing/dist/content-source.d.ts +0 -12
- package/packages/@repo/previewing/dist/content-source.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/content-source.js +0 -1
- package/packages/@repo/previewing/dist/fs-source.d.ts +0 -11
- package/packages/@repo/previewing/dist/fs-source.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/fs-source.js +0 -71
- package/packages/@repo/previewing/dist/index.d.ts +0 -16
- package/packages/@repo/previewing/dist/index.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/index.js +0 -13
- package/packages/@repo/previewing/dist/markdown/agent-markdown.d.ts +0 -3
- package/packages/@repo/previewing/dist/markdown/agent-markdown.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/markdown/agent-markdown.js +0 -176
- package/packages/@repo/previewing/dist/markdown/format.d.ts +0 -8
- package/packages/@repo/previewing/dist/markdown/format.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/markdown/format.js +0 -43
- package/packages/@repo/previewing/dist/markdown/links.d.ts +0 -3
- package/packages/@repo/previewing/dist/markdown/links.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/markdown/links.js +0 -31
- package/packages/@repo/previewing/dist/openapi-pages.d.ts +0 -7
- package/packages/@repo/previewing/dist/openapi-pages.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/openapi-pages.js +0 -200
- package/packages/@repo/previewing/dist/search-index.d.ts +0 -4
- package/packages/@repo/previewing/dist/search-index.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/search-index.js +0 -23
- package/packages/@repo/previewing/dist/serialization.d.ts +0 -13
- package/packages/@repo/previewing/dist/serialization.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/serialization.js +0 -108
- package/packages/@repo/previewing/dist/toc-index.d.ts +0 -5
- package/packages/@repo/previewing/dist/toc-index.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/toc-index.js +0 -53
- package/packages/@repo/previewing/dist/types.d.ts +0 -92
- package/packages/@repo/previewing/dist/types.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/types.js +0 -1
- package/packages/@repo/previewing/dist/utility-index.d.ts +0 -7
- package/packages/@repo/previewing/dist/utility-index.d.ts.map +0 -1
- package/packages/@repo/previewing/dist/utility-index.js +0 -201
- package/packages/@repo/previewing/package.json +0 -41
- package/packages/@repo/previewing/src/blob-source.ts +0 -185
- package/packages/@repo/previewing/src/config-loader.ts +0 -316
- package/packages/@repo/previewing/src/constants.ts +0 -16
- package/packages/@repo/previewing/src/content-index.ts +0 -384
- package/packages/@repo/previewing/src/content-source.ts +0 -12
- package/packages/@repo/previewing/src/fs-source.ts +0 -103
- package/packages/@repo/previewing/src/index.ts +0 -71
- package/packages/@repo/previewing/src/markdown/agent-markdown.ts +0 -254
- package/packages/@repo/previewing/src/markdown/format.ts +0 -63
- package/packages/@repo/previewing/src/markdown/links.ts +0 -46
- package/packages/@repo/previewing/src/openapi-pages.ts +0 -319
- package/packages/@repo/previewing/src/search-index.ts +0 -38
- package/packages/@repo/previewing/src/serialization.ts +0 -191
- package/packages/@repo/previewing/src/toc-index.ts +0 -72
- package/packages/@repo/previewing/src/types.ts +0 -105
- package/packages/@repo/previewing/src/utility-index.ts +0 -304
- package/packages/@repo/validation/dist/index.d.ts +0 -12
- package/packages/@repo/validation/dist/index.d.ts.map +0 -1
- package/packages/@repo/validation/dist/index.js +0 -30
- package/packages/@repo/validation/package.json +0 -38
- package/packages/@repo/validation/src/blodemd-docs-schema.json +0 -3575
- package/packages/@repo/validation/src/index.ts +0 -59
- package/scripts/prepare-package.mjs +0 -53
- package/scripts/repo-packages.mjs +0 -8
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import type { TenantResolution } from "@repo/contracts";
|
|
2
|
-
|
|
3
|
-
export interface TenantRequestContext {
|
|
4
|
-
basePath?: string;
|
|
5
|
-
protocol?: string;
|
|
6
|
-
requestedHost?: string;
|
|
7
|
-
strategy?: TenantResolution["strategy"] | null;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
const TENANT_UTILITY_CONTEXT_PARAMS = {
|
|
11
|
-
basePath: "__blodemd_base_path",
|
|
12
|
-
host: "__blodemd_host",
|
|
13
|
-
protocol: "__blodemd_protocol",
|
|
14
|
-
strategy: "__blodemd_strategy",
|
|
15
|
-
} as const;
|
|
16
|
-
|
|
17
|
-
export const applyTenantUtilityContextSearchParams = (
|
|
18
|
-
url: URL,
|
|
19
|
-
context: TenantRequestContext
|
|
20
|
-
) => {
|
|
21
|
-
if (context.requestedHost) {
|
|
22
|
-
url.searchParams.set(
|
|
23
|
-
TENANT_UTILITY_CONTEXT_PARAMS.host,
|
|
24
|
-
context.requestedHost
|
|
25
|
-
);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
url.searchParams.set(
|
|
29
|
-
TENANT_UTILITY_CONTEXT_PARAMS.basePath,
|
|
30
|
-
context.basePath ?? ""
|
|
31
|
-
);
|
|
32
|
-
url.searchParams.set(
|
|
33
|
-
TENANT_UTILITY_CONTEXT_PARAMS.protocol,
|
|
34
|
-
context.protocol ?? "https"
|
|
35
|
-
);
|
|
36
|
-
url.searchParams.set(
|
|
37
|
-
TENANT_UTILITY_CONTEXT_PARAMS.strategy,
|
|
38
|
-
context.strategy ?? ""
|
|
39
|
-
);
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export const getTenantRequestContextFromUrl = (
|
|
43
|
-
url: URL
|
|
44
|
-
): TenantRequestContext | null => {
|
|
45
|
-
const requestedHost = url.searchParams.get(
|
|
46
|
-
TENANT_UTILITY_CONTEXT_PARAMS.host
|
|
47
|
-
);
|
|
48
|
-
const basePath = url.searchParams.get(TENANT_UTILITY_CONTEXT_PARAMS.basePath);
|
|
49
|
-
const protocol = url.searchParams.get(TENANT_UTILITY_CONTEXT_PARAMS.protocol);
|
|
50
|
-
const strategy = url.searchParams.get(TENANT_UTILITY_CONTEXT_PARAMS.strategy);
|
|
51
|
-
|
|
52
|
-
if (!(requestedHost || basePath !== null || protocol || strategy)) {
|
|
53
|
-
return null;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
return {
|
|
57
|
-
basePath: basePath ?? undefined,
|
|
58
|
-
protocol: protocol || undefined,
|
|
59
|
-
requestedHost: requestedHost || undefined,
|
|
60
|
-
strategy: (strategy || null) as TenantRequestContext["strategy"],
|
|
61
|
-
};
|
|
62
|
-
};
|
package/docs/lib/tenants.ts
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { TenantSchema } from "@repo/contracts";
|
|
2
|
-
import type { Tenant } from "@repo/models";
|
|
3
|
-
|
|
4
|
-
import { getTenantDocsPath } from "./content-root";
|
|
5
|
-
import { getTenantEdgeSlugRecord, isEdgeConfigEnabled } from "./edge-config";
|
|
6
|
-
import { docsApiBase } from "./env";
|
|
7
|
-
import { createTimedPromiseCache } from "./server-cache";
|
|
8
|
-
|
|
9
|
-
export const getProjectTag = (slug: string) => `project:${slug}`;
|
|
10
|
-
|
|
11
|
-
const TENANT_REVALIDATE_SECONDS = 3600;
|
|
12
|
-
const TENANT_CACHE_TTL_MS = 5 * 1000;
|
|
13
|
-
|
|
14
|
-
const mapTenant = (tenant: {
|
|
15
|
-
activeDeploymentId?: string;
|
|
16
|
-
activeDeploymentManifestUrl?: string;
|
|
17
|
-
id: string;
|
|
18
|
-
slug: string;
|
|
19
|
-
name: string;
|
|
20
|
-
description?: string;
|
|
21
|
-
primaryDomain: string;
|
|
22
|
-
subdomain: string;
|
|
23
|
-
customDomains: string[];
|
|
24
|
-
pathPrefix?: string;
|
|
25
|
-
status: "active" | "disabled";
|
|
26
|
-
}): Tenant => ({
|
|
27
|
-
...tenant,
|
|
28
|
-
docsPath: getTenantDocsPath(tenant.slug),
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
const tenantCache = createTimedPromiseCache<string, Tenant | null>({
|
|
32
|
-
maxEntries: 512,
|
|
33
|
-
// Keep the process-local cache short. Tag/path revalidation only clears the
|
|
34
|
-
// instance that handles the request, so long-lived in-memory entries can pin
|
|
35
|
-
// warm instances to an old deployment manifest after a publish.
|
|
36
|
-
ttlMs: TENANT_CACHE_TTL_MS,
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
const fetchTenantFromApi = async (slug: string): Promise<Tenant | null> => {
|
|
40
|
-
const url = new URL(`/tenants/${slug}`, docsApiBase);
|
|
41
|
-
const response = await fetch(url.toString(), {
|
|
42
|
-
next: {
|
|
43
|
-
revalidate: TENANT_REVALIDATE_SECONDS,
|
|
44
|
-
tags: [getProjectTag(slug), "tenants"],
|
|
45
|
-
},
|
|
46
|
-
});
|
|
47
|
-
if (!response.ok) {
|
|
48
|
-
return null;
|
|
49
|
-
}
|
|
50
|
-
const json = (await response.json()) as unknown;
|
|
51
|
-
const parsed = TenantSchema.safeParse(json);
|
|
52
|
-
if (!parsed.success) {
|
|
53
|
-
return null;
|
|
54
|
-
}
|
|
55
|
-
return mapTenant(parsed.data);
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
const fetchTenant = async (slug: string): Promise<Tenant | null> => {
|
|
59
|
-
if (isEdgeConfigEnabled()) {
|
|
60
|
-
const edgeRecord = await getTenantEdgeSlugRecord(slug);
|
|
61
|
-
return edgeRecord ? mapTenant(edgeRecord.tenant) : null;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
return await fetchTenantFromApi(slug);
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
export const clearTenantCache = () => {
|
|
68
|
-
tenantCache.clear();
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
export const getTenantBySlug = async (slug: string) =>
|
|
72
|
-
await tenantCache.getOrCreate(slug, async () => await fetchTenant(slug));
|
package/docs/lib/theme.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { SiteConfig } from "@repo/models";
|
|
2
|
-
import type { CSSProperties } from "react";
|
|
3
|
-
|
|
4
|
-
export const themeStylesFromConfig = (config: SiteConfig): CSSProperties => {
|
|
5
|
-
const { colors } = config;
|
|
6
|
-
if (!colors) {
|
|
7
|
-
return {};
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
const styles: Record<string, string> = {};
|
|
11
|
-
|
|
12
|
-
if (colors.primary) {
|
|
13
|
-
styles["--color-primary"] = colors.primary;
|
|
14
|
-
}
|
|
15
|
-
if (colors.border) {
|
|
16
|
-
styles["--color-border"] = colors.border;
|
|
17
|
-
}
|
|
18
|
-
if (colors.muted) {
|
|
19
|
-
styles["--color-muted"] = colors.muted;
|
|
20
|
-
}
|
|
21
|
-
if (colors.surface) {
|
|
22
|
-
styles["--color-surface"] = colors.surface;
|
|
23
|
-
}
|
|
24
|
-
if (colors.background) {
|
|
25
|
-
styles["--color-background"] = colors.background;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
return styles as CSSProperties;
|
|
29
|
-
};
|
package/docs/lib/time-ago.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
const units: [Intl.RelativeTimeFormatUnit, number][] = [
|
|
2
|
-
["year", 31_536_000],
|
|
3
|
-
["month", 2_592_000],
|
|
4
|
-
["week", 604_800],
|
|
5
|
-
["day", 86_400],
|
|
6
|
-
["hour", 3600],
|
|
7
|
-
["minute", 60],
|
|
8
|
-
["second", 1],
|
|
9
|
-
];
|
|
10
|
-
|
|
11
|
-
const rtf = new Intl.RelativeTimeFormat("en", { numeric: "auto" });
|
|
12
|
-
|
|
13
|
-
export const timeAgo = (iso: string | null): string => {
|
|
14
|
-
if (!iso) {
|
|
15
|
-
return "";
|
|
16
|
-
}
|
|
17
|
-
const seconds = Math.round((Date.now() - new Date(iso).getTime()) / 1000);
|
|
18
|
-
for (const [unit, secs] of units) {
|
|
19
|
-
if (Math.abs(seconds) >= secs || unit === "second") {
|
|
20
|
-
return rtf.format(-Math.round(seconds / secs), unit);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
return "";
|
|
24
|
-
};
|
package/docs/lib/toc.ts
DELETED
package/docs/lib/use-mobile.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { useEffect, useState } from "react";
|
|
2
|
-
|
|
3
|
-
const MOBILE_BREAKPOINT = 768;
|
|
4
|
-
|
|
5
|
-
export const useIsMobile = () => {
|
|
6
|
-
const [isMobile, setIsMobile] = useState<boolean | undefined>();
|
|
7
|
-
|
|
8
|
-
useEffect(() => {
|
|
9
|
-
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
|
|
10
|
-
const onChange = () => {
|
|
11
|
-
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
12
|
-
};
|
|
13
|
-
mql.addEventListener("change", onChange);
|
|
14
|
-
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
15
|
-
return () => mql.removeEventListener("change", onChange);
|
|
16
|
-
}, []);
|
|
17
|
-
|
|
18
|
-
return !!isMobile;
|
|
19
|
-
};
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
|
|
3
|
-
interface TabObserverOptions {
|
|
4
|
-
onActiveTabChange?: (index: number, element: HTMLElement) => void;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export const useTabObserver = ({
|
|
8
|
-
onActiveTabChange,
|
|
9
|
-
}: TabObserverOptions = {}) => {
|
|
10
|
-
const listRef = React.useRef<HTMLDivElement>(null);
|
|
11
|
-
const onActiveTabChangeRef = React.useRef(onActiveTabChange);
|
|
12
|
-
|
|
13
|
-
React.useEffect(() => {
|
|
14
|
-
onActiveTabChangeRef.current = onActiveTabChange;
|
|
15
|
-
}, [onActiveTabChange]);
|
|
16
|
-
|
|
17
|
-
const handleUpdate = React.useCallback(() => {
|
|
18
|
-
if (listRef.current) {
|
|
19
|
-
const tabs = listRef.current.querySelectorAll('[role="tab"]');
|
|
20
|
-
for (let i = 0; i < tabs.length; i += 1) {
|
|
21
|
-
const el = tabs[i];
|
|
22
|
-
if (!(el instanceof HTMLElement)) {
|
|
23
|
-
continue;
|
|
24
|
-
}
|
|
25
|
-
const isActive =
|
|
26
|
-
Object.hasOwn(el.dataset, "active") ||
|
|
27
|
-
el.dataset.state === "active" ||
|
|
28
|
-
el.getAttribute("aria-selected") === "true";
|
|
29
|
-
|
|
30
|
-
if (isActive) {
|
|
31
|
-
onActiveTabChangeRef.current?.(i, el);
|
|
32
|
-
break;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}, []);
|
|
37
|
-
|
|
38
|
-
React.useEffect(() => {
|
|
39
|
-
const resizeObserver = new ResizeObserver(handleUpdate);
|
|
40
|
-
const mutationObserver = new MutationObserver(handleUpdate);
|
|
41
|
-
|
|
42
|
-
if (listRef.current) {
|
|
43
|
-
resizeObserver.observe(listRef.current);
|
|
44
|
-
mutationObserver.observe(listRef.current, {
|
|
45
|
-
attributes: true,
|
|
46
|
-
childList: true,
|
|
47
|
-
subtree: true,
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const handleWindowUpdate = () => {
|
|
52
|
-
handleUpdate();
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
window.addEventListener("resize", handleWindowUpdate);
|
|
56
|
-
window.addEventListener("orientationchange", handleWindowUpdate);
|
|
57
|
-
document.fonts?.addEventListener?.("loadingdone", handleWindowUpdate);
|
|
58
|
-
|
|
59
|
-
handleUpdate();
|
|
60
|
-
|
|
61
|
-
return () => {
|
|
62
|
-
resizeObserver.disconnect();
|
|
63
|
-
mutationObserver.disconnect();
|
|
64
|
-
window.removeEventListener("resize", handleWindowUpdate);
|
|
65
|
-
window.removeEventListener("orientationchange", handleWindowUpdate);
|
|
66
|
-
document.fonts?.removeEventListener?.("loadingdone", handleWindowUpdate);
|
|
67
|
-
};
|
|
68
|
-
}, [handleUpdate]);
|
|
69
|
-
|
|
70
|
-
return { listRef };
|
|
71
|
-
};
|
package/docs/lib/utils.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
type EnvLike = Record<string, string | undefined>;
|
|
2
|
-
export declare const LOCAL_ROOT_HOSTS: readonly ["localhost", "127.0.0.1", "docs.localhost"];
|
|
3
|
-
export declare const normalizePath: (value: string) => string;
|
|
4
|
-
export declare const normalizeHost: (value: string) => string;
|
|
5
|
-
export declare const getPortlessHostFromEnv: (env: EnvLike) => string | null;
|
|
6
|
-
export declare const getLocalRootHostsFromEnv: (env: EnvLike) => Set<string>;
|
|
7
|
-
export declare const withLeadingSlash: (value: string) => string;
|
|
8
|
-
export declare const withoutLeadingSlash: (value: string) => string;
|
|
9
|
-
export declare const slugify: (value: string) => string;
|
|
10
|
-
export declare const shouldIgnoreRootDocsFile: (value: string) => boolean;
|
|
11
|
-
export declare const ensureArray: <T>(value?: T | T[]) => T[];
|
|
12
|
-
export declare const uniq: <T>(values: T[]) => T[];
|
|
13
|
-
export declare const safeJsonParse: <T>(value: string) => T | null;
|
|
14
|
-
export declare const clamp: (value: number, min: number, max: number) => number;
|
|
15
|
-
export {};
|
|
16
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,KAAK,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;AAElD,eAAO,MAAM,gBAAgB,uDAInB,CAAC;AAEX,eAAO,MAAM,aAAa,GAAI,OAAO,MAAM,WAK1C,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,OAAO,MAAM,WACS,CAAC;AAErD,eAAO,MAAM,sBAAsB,GAAI,KAAK,OAAO,kBAWlD,CAAC;AAEF,eAAO,MAAM,wBAAwB,GAAI,KAAK,OAAO,gBAOpD,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,OAAO,MAAM,WAK7C,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,OAAO,MAAM,WAKhD,CAAC;AAEF,eAAO,MAAM,OAAO,GAAI,OAAO,MAAM,WAKL,CAAC;AAWjC,eAAO,MAAM,wBAAwB,GAAI,OAAO,MAAM,YAMrD,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,CAAC,EAAE,QAAQ,CAAC,GAAG,CAAC,EAAE,QAK7C,CAAC;AAEF,eAAO,MAAM,IAAI,GAAI,CAAC,EAAE,QAAQ,CAAC,EAAE,QAAyB,CAAC;AAE7D,eAAO,MAAM,aAAa,GAAI,CAAC,EAAE,OAAO,MAAM,KAAG,CAAC,GAAG,IAMpD,CAAC;AAEF,eAAO,MAAM,KAAK,GAAI,OAAO,MAAM,EAAE,KAAK,MAAM,EAAE,KAAK,MAAM,WACxB,CAAC"}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
const BACKSLASH_TO_SLASH_REGEX = /\\/g;
|
|
2
|
-
const TRAILING_SLASHES_REGEX = /\/+$/g;
|
|
3
|
-
const LEADING_SLASHES_REGEX = /^\/+/;
|
|
4
|
-
const PORT_REGEX = /:\d+$/;
|
|
5
|
-
export const LOCAL_ROOT_HOSTS = [
|
|
6
|
-
"localhost",
|
|
7
|
-
"127.0.0.1",
|
|
8
|
-
"docs.localhost",
|
|
9
|
-
];
|
|
10
|
-
export const normalizePath = (value) => {
|
|
11
|
-
const trimmed = value
|
|
12
|
-
.replace(BACKSLASH_TO_SLASH_REGEX, "/")
|
|
13
|
-
.replace(TRAILING_SLASHES_REGEX, "");
|
|
14
|
-
return trimmed.replace(LEADING_SLASHES_REGEX, "");
|
|
15
|
-
};
|
|
16
|
-
export const normalizeHost = (value) => value.trim().replace(PORT_REGEX, "").toLowerCase();
|
|
17
|
-
export const getPortlessHostFromEnv = (env) => {
|
|
18
|
-
const portlessUrl = env.PORTLESS_URL?.trim();
|
|
19
|
-
if (!portlessUrl) {
|
|
20
|
-
return null;
|
|
21
|
-
}
|
|
22
|
-
try {
|
|
23
|
-
return normalizeHost(new URL(portlessUrl).host);
|
|
24
|
-
}
|
|
25
|
-
catch {
|
|
26
|
-
return normalizeHost(portlessUrl);
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
export const getLocalRootHostsFromEnv = (env) => {
|
|
30
|
-
const hosts = new Set(LOCAL_ROOT_HOSTS);
|
|
31
|
-
const portlessHost = getPortlessHostFromEnv(env);
|
|
32
|
-
if (portlessHost) {
|
|
33
|
-
hosts.add(portlessHost);
|
|
34
|
-
}
|
|
35
|
-
return hosts;
|
|
36
|
-
};
|
|
37
|
-
export const withLeadingSlash = (value) => {
|
|
38
|
-
if (!value) {
|
|
39
|
-
return "/";
|
|
40
|
-
}
|
|
41
|
-
return value.startsWith("/") ? value : `/${value}`;
|
|
42
|
-
};
|
|
43
|
-
export const withoutLeadingSlash = (value) => {
|
|
44
|
-
if (!value) {
|
|
45
|
-
return "";
|
|
46
|
-
}
|
|
47
|
-
return value.startsWith("/") ? value.slice(1) : value;
|
|
48
|
-
};
|
|
49
|
-
export const slugify = (value) => value
|
|
50
|
-
.toLowerCase()
|
|
51
|
-
.trim()
|
|
52
|
-
.replaceAll(/[^a-z0-9]+/g, "-")
|
|
53
|
-
.replaceAll(/(^-|-$)+/g, "");
|
|
54
|
-
const IGNORED_ROOT_DOCS_FILES = new Set([
|
|
55
|
-
".gitignore",
|
|
56
|
-
"AGENTS.md",
|
|
57
|
-
"CLAUDE.md",
|
|
58
|
-
"LICENSE",
|
|
59
|
-
"LICENSE.md",
|
|
60
|
-
"README.md",
|
|
61
|
-
]);
|
|
62
|
-
export const shouldIgnoreRootDocsFile = (value) => {
|
|
63
|
-
const normalized = normalizePath(value);
|
|
64
|
-
if (!normalized || normalized.includes("/")) {
|
|
65
|
-
return false;
|
|
66
|
-
}
|
|
67
|
-
return IGNORED_ROOT_DOCS_FILES.has(normalized);
|
|
68
|
-
};
|
|
69
|
-
export const ensureArray = (value) => {
|
|
70
|
-
if (value === undefined) {
|
|
71
|
-
return [];
|
|
72
|
-
}
|
|
73
|
-
return Array.isArray(value) ? value : [value];
|
|
74
|
-
};
|
|
75
|
-
export const uniq = (values) => [...new Set(values)];
|
|
76
|
-
export const safeJsonParse = (value) => {
|
|
77
|
-
try {
|
|
78
|
-
return JSON.parse(value);
|
|
79
|
-
}
|
|
80
|
-
catch {
|
|
81
|
-
return null;
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
export const clamp = (value, min, max) => Math.min(Math.max(value, min), max);
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@repo/common",
|
|
3
|
-
"version": "0.0.0",
|
|
4
|
-
"private": true,
|
|
5
|
-
"type": "module",
|
|
6
|
-
"exports": {
|
|
7
|
-
".": {
|
|
8
|
-
"types": "./dist/index.d.ts",
|
|
9
|
-
"import": "./dist/index.js",
|
|
10
|
-
"default": "./dist/index.js"
|
|
11
|
-
},
|
|
12
|
-
"./*": {
|
|
13
|
-
"types": "./dist/*.d.ts",
|
|
14
|
-
"import": "./dist/*.js",
|
|
15
|
-
"default": "./dist/*.js"
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
"scripts": {
|
|
19
|
-
"build": "rm -rf dist && tsc",
|
|
20
|
-
"check-types": "tsc --noEmit",
|
|
21
|
-
"lint": "oxlint .",
|
|
22
|
-
"lint:fix": "oxlint --fix .",
|
|
23
|
-
"format": "oxfmt --write .",
|
|
24
|
-
"format:check": "oxfmt ."
|
|
25
|
-
},
|
|
26
|
-
"devDependencies": {
|
|
27
|
-
"@repo/typescript-config": "*",
|
|
28
|
-
"@types/node": "^24.12.2",
|
|
29
|
-
"oxfmt": "^0.42.0",
|
|
30
|
-
"oxlint": "^1.57.0",
|
|
31
|
-
"typescript": "6.0.2",
|
|
32
|
-
"ultracite": "^7.3.2"
|
|
33
|
-
}
|
|
34
|
-
}
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
const BACKSLASH_TO_SLASH_REGEX = /\\/g;
|
|
2
|
-
const TRAILING_SLASHES_REGEX = /\/+$/g;
|
|
3
|
-
const LEADING_SLASHES_REGEX = /^\/+/;
|
|
4
|
-
const PORT_REGEX = /:\d+$/;
|
|
5
|
-
type EnvLike = Record<string, string | undefined>;
|
|
6
|
-
|
|
7
|
-
export const LOCAL_ROOT_HOSTS = [
|
|
8
|
-
"localhost",
|
|
9
|
-
"127.0.0.1",
|
|
10
|
-
"docs.localhost",
|
|
11
|
-
] as const;
|
|
12
|
-
|
|
13
|
-
export const normalizePath = (value: string) => {
|
|
14
|
-
const trimmed = value
|
|
15
|
-
.replace(BACKSLASH_TO_SLASH_REGEX, "/")
|
|
16
|
-
.replace(TRAILING_SLASHES_REGEX, "");
|
|
17
|
-
return trimmed.replace(LEADING_SLASHES_REGEX, "");
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export const normalizeHost = (value: string) =>
|
|
21
|
-
value.trim().replace(PORT_REGEX, "").toLowerCase();
|
|
22
|
-
|
|
23
|
-
export const getPortlessHostFromEnv = (env: EnvLike) => {
|
|
24
|
-
const portlessUrl = env.PORTLESS_URL?.trim();
|
|
25
|
-
if (!portlessUrl) {
|
|
26
|
-
return null;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
try {
|
|
30
|
-
return normalizeHost(new URL(portlessUrl).host);
|
|
31
|
-
} catch {
|
|
32
|
-
return normalizeHost(portlessUrl);
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export const getLocalRootHostsFromEnv = (env: EnvLike) => {
|
|
37
|
-
const hosts = new Set<string>(LOCAL_ROOT_HOSTS);
|
|
38
|
-
const portlessHost = getPortlessHostFromEnv(env);
|
|
39
|
-
if (portlessHost) {
|
|
40
|
-
hosts.add(portlessHost);
|
|
41
|
-
}
|
|
42
|
-
return hosts;
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
export const withLeadingSlash = (value: string) => {
|
|
46
|
-
if (!value) {
|
|
47
|
-
return "/";
|
|
48
|
-
}
|
|
49
|
-
return value.startsWith("/") ? value : `/${value}`;
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
export const withoutLeadingSlash = (value: string) => {
|
|
53
|
-
if (!value) {
|
|
54
|
-
return "";
|
|
55
|
-
}
|
|
56
|
-
return value.startsWith("/") ? value.slice(1) : value;
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
export const slugify = (value: string) =>
|
|
60
|
-
value
|
|
61
|
-
.toLowerCase()
|
|
62
|
-
.trim()
|
|
63
|
-
.replaceAll(/[^a-z0-9]+/g, "-")
|
|
64
|
-
.replaceAll(/(^-|-$)+/g, "");
|
|
65
|
-
|
|
66
|
-
const IGNORED_ROOT_DOCS_FILES = new Set([
|
|
67
|
-
".gitignore",
|
|
68
|
-
"AGENTS.md",
|
|
69
|
-
"CLAUDE.md",
|
|
70
|
-
"LICENSE",
|
|
71
|
-
"LICENSE.md",
|
|
72
|
-
"README.md",
|
|
73
|
-
]);
|
|
74
|
-
|
|
75
|
-
export const shouldIgnoreRootDocsFile = (value: string) => {
|
|
76
|
-
const normalized = normalizePath(value);
|
|
77
|
-
if (!normalized || normalized.includes("/")) {
|
|
78
|
-
return false;
|
|
79
|
-
}
|
|
80
|
-
return IGNORED_ROOT_DOCS_FILES.has(normalized);
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
export const ensureArray = <T>(value?: T | T[]) => {
|
|
84
|
-
if (value === undefined) {
|
|
85
|
-
return [] as T[];
|
|
86
|
-
}
|
|
87
|
-
return Array.isArray(value) ? value : [value];
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
export const uniq = <T>(values: T[]) => [...new Set(values)];
|
|
91
|
-
|
|
92
|
-
export const safeJsonParse = <T>(value: string): T | null => {
|
|
93
|
-
try {
|
|
94
|
-
return JSON.parse(value) as T;
|
|
95
|
-
} catch {
|
|
96
|
-
return null;
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
export const clamp = (value: number, min: number, max: number) =>
|
|
101
|
-
Math.min(Math.max(value, min), max);
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export declare const ProjectAnalyticsGa4Schema: z.ZodObject<{
|
|
3
|
-
measurementId: z.ZodString;
|
|
4
|
-
}, z.core.$strip>;
|
|
5
|
-
export type ProjectAnalyticsGa4 = z.infer<typeof ProjectAnalyticsGa4Schema>;
|
|
6
|
-
export declare const ProjectAnalyticsPosthogSchema: z.ZodObject<{
|
|
7
|
-
host: z.ZodOptional<z.ZodString>;
|
|
8
|
-
projectKey: z.ZodString;
|
|
9
|
-
}, z.core.$strip>;
|
|
10
|
-
export type ProjectAnalyticsPosthog = z.infer<typeof ProjectAnalyticsPosthogSchema>;
|
|
11
|
-
export declare const ProjectAnalyticsSchema: z.ZodObject<{
|
|
12
|
-
ga4: z.ZodOptional<z.ZodObject<{
|
|
13
|
-
measurementId: z.ZodString;
|
|
14
|
-
}, z.core.$strip>>;
|
|
15
|
-
posthog: z.ZodOptional<z.ZodObject<{
|
|
16
|
-
host: z.ZodOptional<z.ZodString>;
|
|
17
|
-
projectKey: z.ZodString;
|
|
18
|
-
}, z.core.$strip>>;
|
|
19
|
-
}, z.core.$strip>;
|
|
20
|
-
export type ProjectAnalytics = z.infer<typeof ProjectAnalyticsSchema>;
|
|
21
|
-
//# sourceMappingURL=analytics.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../src/analytics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,yBAAyB;;iBAOpC,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E,eAAO,MAAM,6BAA6B;;;iBAQxC,CAAC;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAC3C,OAAO,6BAA6B,CACrC,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;;;;;;iBAGjC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
const GA4_MEASUREMENT_ID_REGEX = /^G-[A-Z0-9]{4,20}$/;
|
|
3
|
-
const POSTHOG_PROJECT_KEY_REGEX = /^phc_[A-Za-z0-9]{20,}$/;
|
|
4
|
-
export const ProjectAnalyticsGa4Schema = z.object({
|
|
5
|
-
measurementId: z
|
|
6
|
-
.string()
|
|
7
|
-
.regex(GA4_MEASUREMENT_ID_REGEX, "GA4 measurement IDs look like G-XXXXXXXXXX."),
|
|
8
|
-
});
|
|
9
|
-
export const ProjectAnalyticsPosthogSchema = z.object({
|
|
10
|
-
host: z.string().url().optional(),
|
|
11
|
-
projectKey: z
|
|
12
|
-
.string()
|
|
13
|
-
.regex(POSTHOG_PROJECT_KEY_REGEX, "PostHog project keys start with phc_. Personal API keys (phx_) are not supported."),
|
|
14
|
-
});
|
|
15
|
-
export const ProjectAnalyticsSchema = z.object({
|
|
16
|
-
ga4: ProjectAnalyticsGa4Schema.optional(),
|
|
17
|
-
posthog: ProjectAnalyticsPosthogSchema.optional(),
|
|
18
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dates.d.ts","sourceRoot":"","sources":["../src/dates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,aAAa,aAAwB,CAAC;AACnD,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC"}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export declare const DeploymentStatusSchema: z.ZodEnum<{
|
|
3
|
-
Queued: "Queued";
|
|
4
|
-
Building: "Building";
|
|
5
|
-
Successful: "Successful";
|
|
6
|
-
Failed: "Failed";
|
|
7
|
-
}>;
|
|
8
|
-
export type DeploymentStatus = z.infer<typeof DeploymentStatusSchema>;
|
|
9
|
-
export declare const DeploymentEnvironmentSchema: z.ZodEnum<{
|
|
10
|
-
production: "production";
|
|
11
|
-
preview: "preview";
|
|
12
|
-
}>;
|
|
13
|
-
export type DeploymentEnvironment = z.infer<typeof DeploymentEnvironmentSchema>;
|
|
14
|
-
export declare const DeploymentSchema: z.ZodObject<{
|
|
15
|
-
branch: z.ZodString;
|
|
16
|
-
changes: z.ZodOptional<z.ZodString>;
|
|
17
|
-
commitMessage: z.ZodOptional<z.ZodString>;
|
|
18
|
-
createdAt: z.ZodString;
|
|
19
|
-
environment: z.ZodEnum<{
|
|
20
|
-
production: "production";
|
|
21
|
-
preview: "preview";
|
|
22
|
-
}>;
|
|
23
|
-
fileCount: z.ZodOptional<z.ZodNumber>;
|
|
24
|
-
id: z.ZodString;
|
|
25
|
-
manifestUrl: z.ZodOptional<z.ZodString>;
|
|
26
|
-
previewUrl: z.ZodOptional<z.ZodString>;
|
|
27
|
-
projectId: z.ZodString;
|
|
28
|
-
promotedAt: z.ZodOptional<z.ZodString>;
|
|
29
|
-
status: z.ZodEnum<{
|
|
30
|
-
Queued: "Queued";
|
|
31
|
-
Building: "Building";
|
|
32
|
-
Successful: "Successful";
|
|
33
|
-
Failed: "Failed";
|
|
34
|
-
}>;
|
|
35
|
-
updatedAt: z.ZodString;
|
|
36
|
-
}, z.core.$strip>;
|
|
37
|
-
export type Deployment = z.infer<typeof DeploymentSchema>;
|
|
38
|
-
export declare const PublishDeploymentCreateSchema: z.ZodObject<{
|
|
39
|
-
branch: z.ZodOptional<z.ZodString>;
|
|
40
|
-
changes: z.ZodOptional<z.ZodString>;
|
|
41
|
-
commitMessage: z.ZodOptional<z.ZodString>;
|
|
42
|
-
environment: z.ZodOptional<z.ZodEnum<{
|
|
43
|
-
production: "production";
|
|
44
|
-
preview: "preview";
|
|
45
|
-
}>>;
|
|
46
|
-
}, z.core.$strip>;
|
|
47
|
-
export type PublishDeploymentCreateInput = z.infer<typeof PublishDeploymentCreateSchema>;
|
|
48
|
-
export declare const PublishDeploymentFileSchema: z.ZodObject<{
|
|
49
|
-
contentBase64: z.ZodString;
|
|
50
|
-
contentType: z.ZodOptional<z.ZodString>;
|
|
51
|
-
path: z.ZodString;
|
|
52
|
-
}, z.core.$strip>;
|
|
53
|
-
export type PublishDeploymentFileInput = z.infer<typeof PublishDeploymentFileSchema>;
|
|
54
|
-
export declare const PublishDeploymentFileResponseSchema: z.ZodObject<{
|
|
55
|
-
path: z.ZodString;
|
|
56
|
-
url: z.ZodString;
|
|
57
|
-
}, z.core.$strip>;
|
|
58
|
-
export type PublishDeploymentFileResponse = z.infer<typeof PublishDeploymentFileResponseSchema>;
|
|
59
|
-
export declare const PublishDeploymentFilesBatchSchema: z.ZodObject<{
|
|
60
|
-
files: z.ZodArray<z.ZodObject<{
|
|
61
|
-
contentBase64: z.ZodString;
|
|
62
|
-
contentType: z.ZodOptional<z.ZodString>;
|
|
63
|
-
path: z.ZodString;
|
|
64
|
-
}, z.core.$strip>>;
|
|
65
|
-
}, z.core.$strip>;
|
|
66
|
-
export type PublishDeploymentFilesBatchInput = z.infer<typeof PublishDeploymentFilesBatchSchema>;
|
|
67
|
-
export declare const PublishDeploymentFinalizeSchema: z.ZodObject<{
|
|
68
|
-
promote: z.ZodOptional<z.ZodBoolean>;
|
|
69
|
-
}, z.core.$strip>;
|
|
70
|
-
export type PublishDeploymentFinalizeInput = z.infer<typeof PublishDeploymentFinalizeSchema>;
|
|
71
|
-
//# sourceMappingURL=deployment.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deployment.d.ts","sourceRoot":"","sources":["../src/deployment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,sBAAsB;;;;;EAKjC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE,eAAO,MAAM,2BAA2B;;;EAAoC,CAAC;AAC7E,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;iBAc3B,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D,eAAO,MAAM,6BAA6B;;;;;;;;iBAKxC,CAAC;AACH,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAChD,OAAO,6BAA6B,CACrC,CAAC;AAEF,eAAO,MAAM,2BAA2B;;;;iBAItC,CAAC;AACH,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAC9C,OAAO,2BAA2B,CACnC,CAAC;AAEF,eAAO,MAAM,mCAAmC;;;iBAG9C,CAAC;AACH,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CACjD,OAAO,mCAAmC,CAC3C,CAAC;AAEF,eAAO,MAAM,iCAAiC;;;;;;iBAE5C,CAAC;AACH,MAAM,MAAM,gCAAgC,GAAG,CAAC,CAAC,KAAK,CACpD,OAAO,iCAAiC,CACzC,CAAC;AAEF,eAAO,MAAM,+BAA+B;;iBAE1C,CAAC;AACH,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAClD,OAAO,+BAA+B,CACvC,CAAC"}
|