@homespunapps/core 1.6.89 → 1.6.91
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/dist/client.d.ts +22 -1
- package/dist/client.js +10 -0
- package/dist/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -287,6 +287,12 @@ export declare class HomespunClient {
|
|
|
287
287
|
* PUT -> finalize flow, named to match the MCP `attachments` action.
|
|
288
288
|
*/
|
|
289
289
|
finalizeBlob(attachmentId: string): Promise<AttachmentRef>;
|
|
290
|
+
/** POST /v1/deploy-documents — create a short-lived HTML document upload. */
|
|
291
|
+
createDocumentUpload(req: {
|
|
292
|
+
size: number;
|
|
293
|
+
sha256: string;
|
|
294
|
+
app_id?: string;
|
|
295
|
+
}): Promise<DocumentUploadSession>;
|
|
290
296
|
/** POST /v1/apps — create (deploy) a new App + its first AppVersion. */
|
|
291
297
|
deployApp(req: DeployAppRequest): Promise<DeployAppResponse>;
|
|
292
298
|
/**
|
|
@@ -1017,9 +1023,20 @@ export interface AppAssetRef {
|
|
|
1017
1023
|
}
|
|
1018
1024
|
/** A multi-file-deploy asset: inline bytes OR a by-reference attachment id. */
|
|
1019
1025
|
export type AppAsset = AppAssetInline | AppAssetRef;
|
|
1026
|
+
/** Short-lived capability for uploading an authored HTML document. */
|
|
1027
|
+
export interface DocumentUploadSession {
|
|
1028
|
+
document_id: string;
|
|
1029
|
+
upload_url: string;
|
|
1030
|
+
/** Scoped only to PUT the declared document bytes to `upload_url`. */
|
|
1031
|
+
upload_token: string;
|
|
1032
|
+
expires_at: string;
|
|
1033
|
+
}
|
|
1020
1034
|
/** Request body for `POST /v1/apps` — create (deploy) a new App. */
|
|
1021
1035
|
export interface DeployAppRequest {
|
|
1022
|
-
|
|
1036
|
+
/** Inline HTML, mutually exclusive with `document_id`. */
|
|
1037
|
+
html?: string;
|
|
1038
|
+
/** Reference to an uploaded HTML document, mutually exclusive with `html`. */
|
|
1039
|
+
document_id?: string;
|
|
1023
1040
|
manifest: unknown;
|
|
1024
1041
|
/** Defaults to "private" server-side when omitted. */
|
|
1025
1042
|
visibility?: "private" | "link" | "public";
|
|
@@ -1091,6 +1108,8 @@ export interface DeployAppResponse {
|
|
|
1091
1108
|
export interface RedeployAppRequest {
|
|
1092
1109
|
/** Omit to keep the live document (a manifest-only change needs no HTML). */
|
|
1093
1110
|
html?: string;
|
|
1111
|
+
/** Uploaded replacement document, mutually exclusive with `html`. */
|
|
1112
|
+
document_id?: string;
|
|
1094
1113
|
/** Omit to keep the live manifest (an HTML-only change needs no manifest). */
|
|
1095
1114
|
manifest?: unknown;
|
|
1096
1115
|
/** Bypass the compat gate; a removed collection is detached, not deleted. */
|
|
@@ -1178,6 +1197,8 @@ export interface DeployCheckRequest {
|
|
|
1178
1197
|
app_id?: string;
|
|
1179
1198
|
/** Required to check a create; omit on a redeploy check to inherit the live document. */
|
|
1180
1199
|
html?: string;
|
|
1200
|
+
/** Uploaded replacement document, mutually exclusive with `html`. */
|
|
1201
|
+
document_id?: string;
|
|
1181
1202
|
/** Required to check a create; omit on a redeploy check to inherit the live manifest. */
|
|
1182
1203
|
manifest?: unknown;
|
|
1183
1204
|
force?: boolean;
|
package/dist/client.js
CHANGED
|
@@ -531,10 +531,18 @@ export class HomespunClient {
|
|
|
531
531
|
// App.id (cuid) — a slug is resolved to an id via `listApps({ slug })`
|
|
532
532
|
// first (the CLI's `resolveAppId` helper does this transparently).
|
|
533
533
|
// -------------------------------------------------------------------------
|
|
534
|
+
/** POST /v1/deploy-documents — create a short-lived HTML document upload. */
|
|
535
|
+
async createDocumentUpload(req) {
|
|
536
|
+
const r = await this.call("POST", "/v1/deploy-documents", req);
|
|
537
|
+
if (!r.ok)
|
|
538
|
+
this.fail(r);
|
|
539
|
+
return this.asObject(r);
|
|
540
|
+
}
|
|
534
541
|
/** POST /v1/apps — create (deploy) a new App + its first AppVersion. */
|
|
535
542
|
async deployApp(req) {
|
|
536
543
|
const r = await this.call("POST", "/v1/apps", {
|
|
537
544
|
html: req.html,
|
|
545
|
+
document_id: req.document_id,
|
|
538
546
|
manifest: req.manifest,
|
|
539
547
|
visibility: req.visibility,
|
|
540
548
|
slug: req.slug,
|
|
@@ -554,6 +562,7 @@ export class HomespunClient {
|
|
|
554
562
|
async redeployApp(appId, req) {
|
|
555
563
|
const r = await this.call("POST", `/v1/apps/${encodeURIComponent(appId)}/versions`, {
|
|
556
564
|
html: req.html,
|
|
565
|
+
document_id: req.document_id,
|
|
557
566
|
manifest: req.manifest,
|
|
558
567
|
force: req.force,
|
|
559
568
|
assets: req.assets,
|
|
@@ -577,6 +586,7 @@ export class HomespunClient {
|
|
|
577
586
|
: "/v1/apps";
|
|
578
587
|
const body = {
|
|
579
588
|
html: req.html,
|
|
589
|
+
document_id: req.document_id,
|
|
580
590
|
manifest: req.manifest,
|
|
581
591
|
dry_run: true,
|
|
582
592
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { HomespunClient, HomespunApiError, putPresigned } from "./client.js";
|
|
2
|
-
export type { ClientOptions, RelayResponse, AttachmentRef, UploadBlobOptions, PresignBlobOptions, AttachmentTokenMintResponse, ListBlobsOptions, AttachmentTokenAuditEntry, AttachmentTokenListResponse, QueryResponse, AppAsset, DeployAppRequest, DeployAppResponse, RedeployAppRequest, RedeployAppResponse, DeployCheckRequest, DeployCheckResult, MissingConnection, KeyMintResult, AppSummary, AppDetail, AppsPage, AppDomain, AppDomainDnsRecord, AppMember, AddAppMemberResult, AppTransfer, AppRow, AppRowsPage, ListScalar, ListWhereCondition, ListSortSpec, BatchRowInput, BatchRowResult, BatchResult, BatchWriteOptions, AppFeedEntry, AppFeedPage, CommunitySetupStep, RetentionAxes, CollectionRetentionView, ServiceCredentialGrant, MintAppCredentialResult, AppCredentialSummary, RotateAppCredentialResult, ConnectionSummary, } from "./client.js";
|
|
2
|
+
export type { ClientOptions, RelayResponse, AttachmentRef, UploadBlobOptions, PresignBlobOptions, AttachmentTokenMintResponse, ListBlobsOptions, AttachmentTokenAuditEntry, AttachmentTokenListResponse, QueryResponse, AppAsset, DeployAppRequest, DeployAppResponse, DocumentUploadSession, RedeployAppRequest, RedeployAppResponse, DeployCheckRequest, DeployCheckResult, MissingConnection, KeyMintResult, AppSummary, AppDetail, AppsPage, AppDomain, AppDomainDnsRecord, AppMember, AddAppMemberResult, AppTransfer, AppRow, AppRowsPage, ListScalar, ListWhereCondition, ListSortSpec, BatchRowInput, BatchRowResult, BatchResult, BatchWriteOptions, AppFeedEntry, AppFeedPage, CommunitySetupStep, RetentionAxes, CollectionRetentionView, ServiceCredentialGrant, MintAppCredentialResult, AppCredentialSummary, RotateAppCredentialResult, ConnectionSummary, } from "./client.js";
|
|
3
3
|
export { openStream } from "./stream.js";
|
|
4
4
|
export type { OpenStreamOptions, StreamHandlers, StreamHandle, } from "./stream.js";
|
|
5
5
|
export { openAppStream, appWsUrlFromAppUrl } from "./app-stream.js";
|