@homespunapps/core 1.6.78 → 1.6.79
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 +40 -0
- package/dist/client.js +41 -0
- package/dist/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -487,6 +487,33 @@ export declare class HomespunClient {
|
|
|
487
487
|
* be removed — the relay refuses with a 409 conflict.
|
|
488
488
|
*/
|
|
489
489
|
removeAppMember(appId: string, humanId: string): Promise<void>;
|
|
490
|
+
/**
|
|
491
|
+
* POST /v1/apps/:id/transfer: invite `opts.email` to take ownership of the
|
|
492
|
+
* app. Nothing moves yet: the relay mints a pending transfer and emails the
|
|
493
|
+
* recipient an accept link, and ownership only changes hands once they
|
|
494
|
+
* accept it. `keepAsMember` (default true) decides whether the current
|
|
495
|
+
* owner stays on as a plain member afterward, or is removed the moment the
|
|
496
|
+
* transfer is accepted. 409s when a transfer is already pending for this
|
|
497
|
+
* app, or when the target is already the owner.
|
|
498
|
+
*/
|
|
499
|
+
createAppTransfer(appId: string, opts: {
|
|
500
|
+
email: string;
|
|
501
|
+
keepAsMember?: boolean;
|
|
502
|
+
}): Promise<{
|
|
503
|
+
transfer: AppTransfer;
|
|
504
|
+
}>;
|
|
505
|
+
/**
|
|
506
|
+
* GET /v1/apps/:id/transfer: the app's pending transfer, or `null` when
|
|
507
|
+
* none is pending.
|
|
508
|
+
*/
|
|
509
|
+
getAppTransfer(appId: string): Promise<{
|
|
510
|
+
transfer: AppTransfer | null;
|
|
511
|
+
}>;
|
|
512
|
+
/**
|
|
513
|
+
* DELETE /v1/apps/:id/transfer: withdraw the app's pending transfer.
|
|
514
|
+
* Idempotent: a 204 comes back even when nothing was pending.
|
|
515
|
+
*/
|
|
516
|
+
cancelAppTransfer(appId: string): Promise<void>;
|
|
490
517
|
/**
|
|
491
518
|
* GET /v1/apps/:id/collections/:name/retention returns the collection's
|
|
492
519
|
* effective retention (the bounds in force), the author default, the raw owner
|
|
@@ -1316,6 +1343,19 @@ export interface AppMember {
|
|
|
1316
1343
|
customRole?: string | null;
|
|
1317
1344
|
createdAt: string;
|
|
1318
1345
|
}
|
|
1346
|
+
/**
|
|
1347
|
+
* A pending app ownership transfer (issue #1847): the shape `createAppTransfer`
|
|
1348
|
+
* and `getAppTransfer` return. Fields are camelCase on the wire, matching the
|
|
1349
|
+
* app-membership shapes above rather than the usual snake_case convention.
|
|
1350
|
+
*/
|
|
1351
|
+
export interface AppTransfer {
|
|
1352
|
+
id: string;
|
|
1353
|
+
appId: string;
|
|
1354
|
+
toEmail: string;
|
|
1355
|
+
keepAsMember: boolean;
|
|
1356
|
+
expiresAt: string;
|
|
1357
|
+
createdAt: string;
|
|
1358
|
+
}
|
|
1319
1359
|
/**
|
|
1320
1360
|
* One inbound catch-hook row from `listIngestHooks`. `url` is the full secret
|
|
1321
1361
|
* ingest URL to hand a sender. Rule-derived fields (collection/mode/wake/
|
package/dist/client.js
CHANGED
|
@@ -864,6 +864,47 @@ export class HomespunClient {
|
|
|
864
864
|
this.fail(r);
|
|
865
865
|
}
|
|
866
866
|
// -------------------------------------------------------------------------
|
|
867
|
+
// App ownership transfer (issue #1847). Moving an app to another human is a
|
|
868
|
+
// two-party job, same shape as custom domains above: this side mints a
|
|
869
|
+
// pending transfer and emails the recipient, and ownership only actually
|
|
870
|
+
// moves once THEY accept it from that email, by verified address. An app
|
|
871
|
+
// holds at most one pending transfer at a time.
|
|
872
|
+
// -------------------------------------------------------------------------
|
|
873
|
+
/**
|
|
874
|
+
* POST /v1/apps/:id/transfer: invite `opts.email` to take ownership of the
|
|
875
|
+
* app. Nothing moves yet: the relay mints a pending transfer and emails the
|
|
876
|
+
* recipient an accept link, and ownership only changes hands once they
|
|
877
|
+
* accept it. `keepAsMember` (default true) decides whether the current
|
|
878
|
+
* owner stays on as a plain member afterward, or is removed the moment the
|
|
879
|
+
* transfer is accepted. 409s when a transfer is already pending for this
|
|
880
|
+
* app, or when the target is already the owner.
|
|
881
|
+
*/
|
|
882
|
+
async createAppTransfer(appId, opts) {
|
|
883
|
+
const r = await this.call("POST", `/v1/apps/${encodeURIComponent(appId)}/transfer`, { email: opts.email, keepAsMember: opts.keepAsMember });
|
|
884
|
+
if (!r.ok)
|
|
885
|
+
this.fail(r);
|
|
886
|
+
return this.asObject(r);
|
|
887
|
+
}
|
|
888
|
+
/**
|
|
889
|
+
* GET /v1/apps/:id/transfer: the app's pending transfer, or `null` when
|
|
890
|
+
* none is pending.
|
|
891
|
+
*/
|
|
892
|
+
async getAppTransfer(appId) {
|
|
893
|
+
const r = await this.call("GET", `/v1/apps/${encodeURIComponent(appId)}/transfer`);
|
|
894
|
+
if (!r.ok)
|
|
895
|
+
this.fail(r);
|
|
896
|
+
return this.asObject(r);
|
|
897
|
+
}
|
|
898
|
+
/**
|
|
899
|
+
* DELETE /v1/apps/:id/transfer: withdraw the app's pending transfer.
|
|
900
|
+
* Idempotent: a 204 comes back even when nothing was pending.
|
|
901
|
+
*/
|
|
902
|
+
async cancelAppTransfer(appId) {
|
|
903
|
+
const r = await this.call("DELETE", `/v1/apps/${encodeURIComponent(appId)}/transfer`);
|
|
904
|
+
if (!r.ok)
|
|
905
|
+
this.fail(r);
|
|
906
|
+
}
|
|
907
|
+
// -------------------------------------------------------------------------
|
|
867
908
|
// Collection retention override (issue #956). The author declares default
|
|
868
909
|
// retention in the manifest; this lets the OWNER tighten or loosen it per
|
|
869
910
|
// collection at runtime, without a redeploy. Effective retention is per-axis
|
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, 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, 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";
|