@treeseed/sdk 0.4.8 → 0.4.10
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 +1 -1
- package/dist/control-plane-client.d.ts +45 -0
- package/dist/control-plane-client.js +229 -0
- package/dist/control-plane.d.ts +94 -0
- package/dist/control-plane.js +125 -0
- package/dist/d1-store.d.ts +56 -1
- package/dist/d1-store.js +132 -0
- package/dist/dispatch.d.ts +4 -0
- package/dist/dispatch.js +180 -0
- package/dist/index.d.ts +14 -2
- package/dist/index.js +94 -4
- package/dist/operations/services/config-runtime.d.ts +10 -0
- package/dist/operations/services/config-runtime.js +62 -4
- package/dist/operations/services/deploy.d.ts +95 -3
- package/dist/operations/services/deploy.js +351 -10
- package/dist/operations/services/github-automation.d.ts +37 -1
- package/dist/operations/services/github-automation.js +71 -14
- package/dist/operations/services/project-platform.d.ts +835 -0
- package/dist/operations/services/project-platform.js +782 -0
- package/dist/operations/services/railway-deploy.d.ts +113 -18
- package/dist/operations/services/railway-deploy.js +357 -8
- package/dist/operations/services/runtime-tools.d.ts +25 -1
- package/dist/operations/services/runtime-tools.js +66 -5
- package/dist/operations/services/template-registry.d.ts +1 -1
- package/dist/operations/services/template-registry.js +17 -3
- package/dist/platform/books-data.d.ts +3 -4
- package/dist/platform/books-data.js +30 -4
- package/dist/platform/contracts.d.ts +56 -4
- package/dist/platform/deploy-config.js +109 -4
- package/dist/platform/deploy-runtime.d.ts +2 -0
- package/dist/platform/deploy-runtime.js +9 -1
- package/dist/platform/env.yaml +677 -0
- package/dist/platform/environment.js +57 -2
- package/dist/platform/plugin.d.ts +8 -0
- package/dist/platform/plugins/constants.d.ts +2 -0
- package/dist/platform/plugins/constants.js +2 -0
- package/dist/platform/plugins/runtime.d.ts +2 -0
- package/dist/platform/plugins/runtime.js +9 -1
- package/dist/platform/plugins.d.ts +1 -1
- package/dist/platform/plugins.js +4 -0
- package/dist/platform/published-content-pipeline.d.ts +84 -0
- package/dist/platform/published-content-pipeline.js +543 -0
- package/dist/platform/published-content.d.ts +223 -0
- package/dist/platform/published-content.js +588 -0
- package/dist/platform/tenant/runtime-config.d.ts +1 -1
- package/dist/platform/tenant/runtime-config.js +34 -1
- package/dist/platform/tenant-config.d.ts +2 -1
- package/dist/platform/tenant-config.js +17 -1
- package/dist/platform/utils/site-config-schema.js +104 -0
- package/dist/plugin-default.d.ts +2 -0
- package/dist/plugin-default.js +2 -0
- package/dist/remote.d.ts +65 -9
- package/dist/remote.js +104 -28
- package/dist/scripts/check-build-warnings.js +50 -0
- package/dist/scripts/config-treeseed.js +7 -0
- package/dist/scripts/tenant-workflow-action.js +71 -0
- package/dist/sdk-dispatch.d.ts +12 -0
- package/dist/sdk-dispatch.js +142 -0
- package/dist/sdk-types.d.ts +579 -7
- package/dist/sdk-types.js +53 -1
- package/dist/sdk.d.ts +17 -1
- package/dist/sdk.js +109 -0
- package/dist/stores/operational-store.d.ts +22 -2
- package/dist/stores/operational-store.js +235 -0
- package/dist/template-catalog.js +8 -1
- package/dist/treeseed/template-catalog/templates/starter-basic/template/treeseed.site.yaml +20 -0
- package/dist/types/cloudflare.d.ts +23 -0
- package/dist/workflow/operations.d.ts +12 -3
- package/dist/workflow/policy.d.ts +1 -1
- package/dist/workflow-state.js +2 -1
- package/package.json +7 -2
- package/templates/github/deploy.workflow.yml +442 -0
- package/templates/github/hosted-project.workflow.yml +77 -0
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import type { TreeseedDeployConfig } from './contracts.ts';
|
|
2
|
+
import type { CloudflareRuntime, R2BucketLike } from '../types/cloudflare.ts';
|
|
3
|
+
export declare const PUBLISHED_CONTENT_MANIFEST_SCHEMA_VERSION = 2;
|
|
4
|
+
export declare const EDITORIAL_PREVIEW_COOKIE = "treeseed-content-preview";
|
|
5
|
+
export type PublishedContentVisibility = 'public' | 'authenticated' | 'team' | 'private';
|
|
6
|
+
export type HostedContentMode = 'production' | 'editorial_overlay';
|
|
7
|
+
export interface PublishedContentObjectPointer {
|
|
8
|
+
objectKey: string;
|
|
9
|
+
sha256: string;
|
|
10
|
+
size?: number;
|
|
11
|
+
contentType?: string;
|
|
12
|
+
publicUrl?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface PublishedContentEntry {
|
|
15
|
+
id: string;
|
|
16
|
+
model: string;
|
|
17
|
+
slug: string;
|
|
18
|
+
title?: string;
|
|
19
|
+
summary?: string;
|
|
20
|
+
status?: string;
|
|
21
|
+
visibility?: PublishedContentVisibility;
|
|
22
|
+
teamId?: string;
|
|
23
|
+
publishedAt?: string;
|
|
24
|
+
updatedAt?: string;
|
|
25
|
+
content: PublishedContentObjectPointer;
|
|
26
|
+
rendered?: PublishedContentObjectPointer;
|
|
27
|
+
search?: PublishedContentObjectPointer;
|
|
28
|
+
metadata?: Record<string, unknown>;
|
|
29
|
+
}
|
|
30
|
+
export interface PublishedCollectionIndex {
|
|
31
|
+
model: string;
|
|
32
|
+
generatedAt: string;
|
|
33
|
+
count?: number;
|
|
34
|
+
entries: PublishedContentEntry[];
|
|
35
|
+
}
|
|
36
|
+
export interface PublishedArtifactVersion {
|
|
37
|
+
id: string;
|
|
38
|
+
itemId: string;
|
|
39
|
+
kind: string;
|
|
40
|
+
version: string;
|
|
41
|
+
label?: string;
|
|
42
|
+
visibility?: PublishedContentVisibility;
|
|
43
|
+
teamId?: string;
|
|
44
|
+
publishedAt: string;
|
|
45
|
+
content: PublishedContentObjectPointer;
|
|
46
|
+
metadata?: Record<string, unknown>;
|
|
47
|
+
}
|
|
48
|
+
export interface PublishedManifestTombstone {
|
|
49
|
+
path: string;
|
|
50
|
+
removedAt: string;
|
|
51
|
+
previousSha256?: string;
|
|
52
|
+
}
|
|
53
|
+
export interface TeamScopedContentLocator {
|
|
54
|
+
teamId: string;
|
|
55
|
+
manifestKey: string;
|
|
56
|
+
previewRoot: string;
|
|
57
|
+
overlayKey?: string;
|
|
58
|
+
previewId?: string;
|
|
59
|
+
mode?: HostedContentMode;
|
|
60
|
+
}
|
|
61
|
+
export interface CatalogIndexEntry {
|
|
62
|
+
id: string;
|
|
63
|
+
teamId: string;
|
|
64
|
+
kind: string;
|
|
65
|
+
slug: string;
|
|
66
|
+
title: string;
|
|
67
|
+
summary?: string;
|
|
68
|
+
visibility?: PublishedContentVisibility;
|
|
69
|
+
listingEnabled?: boolean;
|
|
70
|
+
offerMode?: 'free' | 'paid' | 'contact' | 'one_time_current_version' | 'subscription_updates' | 'private';
|
|
71
|
+
manifestKey?: string;
|
|
72
|
+
artifactKey?: string;
|
|
73
|
+
updatedAt: string;
|
|
74
|
+
searchText?: string;
|
|
75
|
+
metadata?: Record<string, unknown>;
|
|
76
|
+
}
|
|
77
|
+
export type PublishedRuntimePointers = {
|
|
78
|
+
docsHomePath?: string;
|
|
79
|
+
booksRuntime?: PublishedContentObjectPointer;
|
|
80
|
+
docsTree?: PublishedContentObjectPointer;
|
|
81
|
+
searchIndex?: PublishedContentObjectPointer;
|
|
82
|
+
};
|
|
83
|
+
export interface PublishedContentManifest {
|
|
84
|
+
schemaVersion: number;
|
|
85
|
+
siteSlug: string;
|
|
86
|
+
teamId: string;
|
|
87
|
+
revision: string;
|
|
88
|
+
generatedAt: string;
|
|
89
|
+
mode?: HostedContentMode;
|
|
90
|
+
sourceCommit?: string;
|
|
91
|
+
appRevision?: string;
|
|
92
|
+
appCompatibility?: {
|
|
93
|
+
min?: string;
|
|
94
|
+
max?: string;
|
|
95
|
+
lastKnownCompatibleRevision?: string;
|
|
96
|
+
};
|
|
97
|
+
locator?: TeamScopedContentLocator;
|
|
98
|
+
collections?: Record<string, PublishedContentObjectPointer>;
|
|
99
|
+
entries: PublishedContentEntry[];
|
|
100
|
+
artifacts?: PublishedArtifactVersion[];
|
|
101
|
+
runtime?: PublishedRuntimePointers;
|
|
102
|
+
tombstones?: PublishedManifestTombstone[];
|
|
103
|
+
metadata?: Record<string, unknown>;
|
|
104
|
+
}
|
|
105
|
+
export interface PublishedOverlayManifest {
|
|
106
|
+
schemaVersion: number;
|
|
107
|
+
siteSlug: string;
|
|
108
|
+
teamId: string;
|
|
109
|
+
previewId: string;
|
|
110
|
+
generatedAt: string;
|
|
111
|
+
mode?: HostedContentMode;
|
|
112
|
+
baseManifestKey: string;
|
|
113
|
+
baseRevision?: string;
|
|
114
|
+
sourceCommit?: string;
|
|
115
|
+
expiresAt?: string;
|
|
116
|
+
locator?: TeamScopedContentLocator;
|
|
117
|
+
collections?: Record<string, PublishedContentObjectPointer>;
|
|
118
|
+
entries?: PublishedContentEntry[];
|
|
119
|
+
artifacts?: PublishedArtifactVersion[];
|
|
120
|
+
runtime?: PublishedRuntimePointers;
|
|
121
|
+
tombstones?: PublishedManifestTombstone[];
|
|
122
|
+
metadata?: Record<string, unknown>;
|
|
123
|
+
}
|
|
124
|
+
export interface ContentRuntimeProvider {
|
|
125
|
+
getManifest(): Promise<PublishedContentManifest>;
|
|
126
|
+
getProductionManifest(): Promise<PublishedContentManifest>;
|
|
127
|
+
getOverlayManifest(): Promise<PublishedOverlayManifest | null>;
|
|
128
|
+
getCollectionIndex(model: string): Promise<PublishedCollectionIndex>;
|
|
129
|
+
listCollection(model: string): Promise<PublishedContentEntry[]>;
|
|
130
|
+
getEntry(model: string, slugOrId: string): Promise<PublishedContentEntry | null>;
|
|
131
|
+
getArtifactVersion(itemId: string, version?: string): Promise<PublishedArtifactVersion | null>;
|
|
132
|
+
getObject<T = unknown>(pointer: string | PublishedContentObjectPointer): Promise<T | null>;
|
|
133
|
+
}
|
|
134
|
+
export interface PublishContentObjectInput {
|
|
135
|
+
pointer: PublishedContentObjectPointer;
|
|
136
|
+
body: string | ArrayBuffer | ArrayBufferView;
|
|
137
|
+
httpMetadata?: Record<string, unknown>;
|
|
138
|
+
customMetadata?: Record<string, string>;
|
|
139
|
+
}
|
|
140
|
+
export interface PublishContentRevisionInput {
|
|
141
|
+
manifest: PublishedContentManifest;
|
|
142
|
+
objects: PublishContentObjectInput[];
|
|
143
|
+
}
|
|
144
|
+
export interface PublishOverlayInput {
|
|
145
|
+
overlay: PublishedOverlayManifest;
|
|
146
|
+
objects: PublishContentObjectInput[];
|
|
147
|
+
}
|
|
148
|
+
export interface PublishContentRevisionResult {
|
|
149
|
+
revision: string;
|
|
150
|
+
manifestKey: string;
|
|
151
|
+
}
|
|
152
|
+
export interface PublishOverlayResult {
|
|
153
|
+
previewId: string;
|
|
154
|
+
overlayKey: string;
|
|
155
|
+
}
|
|
156
|
+
export interface PromoteOverlayInput {
|
|
157
|
+
previewId: string;
|
|
158
|
+
revision?: string;
|
|
159
|
+
generatedAt?: string;
|
|
160
|
+
sourceCommit?: string;
|
|
161
|
+
appRevision?: string;
|
|
162
|
+
}
|
|
163
|
+
export interface ContentPublishProvider {
|
|
164
|
+
publishRevision(input: PublishContentRevisionInput): Promise<PublishContentRevisionResult>;
|
|
165
|
+
publishOverlay(input: PublishOverlayInput): Promise<PublishOverlayResult>;
|
|
166
|
+
promoteOverlay(input: PromoteOverlayInput): Promise<PublishContentRevisionResult>;
|
|
167
|
+
rollbackRevision(snapshotKey: string): Promise<PublishContentRevisionResult>;
|
|
168
|
+
deleteOverlay(previewId: string, overlay?: PublishedOverlayManifest | null): Promise<void>;
|
|
169
|
+
}
|
|
170
|
+
export interface EditorialPreviewTokenPayload {
|
|
171
|
+
teamId: string;
|
|
172
|
+
previewId: string;
|
|
173
|
+
expiresAt: string;
|
|
174
|
+
}
|
|
175
|
+
export declare function parsePublishedContentManifest(value: unknown): PublishedContentManifest;
|
|
176
|
+
export declare function parsePublishedOverlayManifest(value: unknown): PublishedOverlayManifest;
|
|
177
|
+
export declare function parsePublishedCollectionIndex(value: unknown): PublishedCollectionIndex;
|
|
178
|
+
export declare function resolvePublishedContentBucketBinding(config: Pick<TreeseedDeployConfig, 'cloudflare'>): string;
|
|
179
|
+
export declare function resolvePublishedContentManifestKey(config: Pick<TreeseedDeployConfig, 'cloudflare'> & Partial<Pick<TreeseedDeployConfig, 'slug'>>, teamId?: string): string;
|
|
180
|
+
export declare function resolvePublishedContentPreviewRoot(config: Pick<TreeseedDeployConfig, 'cloudflare'> & Partial<Pick<TreeseedDeployConfig, 'slug'>>, teamId?: string): string;
|
|
181
|
+
export declare function resolvePublishedContentPreviewTtlHours(config: Pick<TreeseedDeployConfig, 'cloudflare'>): number;
|
|
182
|
+
export declare function resolveTeamScopedContentLocator(config: Pick<TreeseedDeployConfig, 'cloudflare'>, teamId: string, previewId?: string): TeamScopedContentLocator;
|
|
183
|
+
export declare function isTeamScopedR2ContentEnabled(config: Pick<TreeseedDeployConfig, 'providers' | 'cloudflare'>): boolean;
|
|
184
|
+
export declare function signEditorialPreviewToken(payload: EditorialPreviewTokenPayload, secret: string): string;
|
|
185
|
+
export declare function verifyEditorialPreviewToken(token: string, secret: string): EditorialPreviewTokenPayload | null;
|
|
186
|
+
export declare function resolveCloudflareR2Bucket(runtime: CloudflareRuntime | null | undefined, binding: string): R2BucketLike | null;
|
|
187
|
+
export declare function readPublishedContentManifest(bucket: R2BucketLike, manifestKey: string): Promise<PublishedContentManifest | null>;
|
|
188
|
+
export declare function readPublishedOverlayManifest(bucket: R2BucketLike, overlayKey: string): Promise<PublishedOverlayManifest | null>;
|
|
189
|
+
export declare class TeamScopedR2OverlayContentRuntimeProvider implements ContentRuntimeProvider {
|
|
190
|
+
private readonly bucket;
|
|
191
|
+
private readonly locator;
|
|
192
|
+
private productionManifestPromise;
|
|
193
|
+
private overlayManifestPromise;
|
|
194
|
+
private manifestPromise;
|
|
195
|
+
private readonly collectionCache;
|
|
196
|
+
constructor(bucket: R2BucketLike, locator: TeamScopedContentLocator);
|
|
197
|
+
getProductionManifest(): Promise<PublishedContentManifest>;
|
|
198
|
+
getOverlayManifest(): Promise<PublishedOverlayManifest | null>;
|
|
199
|
+
getManifest(): Promise<PublishedContentManifest>;
|
|
200
|
+
getCollectionIndex(model: string): Promise<PublishedCollectionIndex>;
|
|
201
|
+
listCollection(model: string): Promise<PublishedContentEntry[]>;
|
|
202
|
+
getEntry(model: string, slugOrId: string): Promise<PublishedContentEntry | null>;
|
|
203
|
+
getArtifactVersion(itemId: string, version?: string): Promise<PublishedArtifactVersion | null>;
|
|
204
|
+
getObject<T = unknown>(pointer: string | PublishedContentObjectPointer): Promise<T | null>;
|
|
205
|
+
}
|
|
206
|
+
export declare class TeamScopedR2OverlayContentPublishProvider implements ContentPublishProvider {
|
|
207
|
+
private readonly bucket;
|
|
208
|
+
private readonly locator;
|
|
209
|
+
constructor(bucket: R2BucketLike, locator: TeamScopedContentLocator);
|
|
210
|
+
publishRevision(input: PublishContentRevisionInput): Promise<PublishContentRevisionResult>;
|
|
211
|
+
publishOverlay(input: PublishOverlayInput): Promise<PublishOverlayResult>;
|
|
212
|
+
promoteOverlay(input: PromoteOverlayInput): Promise<PublishContentRevisionResult>;
|
|
213
|
+
rollbackRevision(snapshotKey: string): Promise<PublishContentRevisionResult>;
|
|
214
|
+
deleteOverlay(previewId: string, overlay?: PublishedOverlayManifest | null): Promise<void>;
|
|
215
|
+
}
|
|
216
|
+
export declare function createTeamScopedR2OverlayContentRuntimeProvider(options: {
|
|
217
|
+
bucket: R2BucketLike;
|
|
218
|
+
locator: TeamScopedContentLocator;
|
|
219
|
+
}): TeamScopedR2OverlayContentRuntimeProvider;
|
|
220
|
+
export declare function createTeamScopedR2OverlayContentPublishProvider(options: {
|
|
221
|
+
bucket: R2BucketLike;
|
|
222
|
+
locator: TeamScopedContentLocator;
|
|
223
|
+
}): TeamScopedR2OverlayContentPublishProvider;
|