@homespunapps/core 1.6.17 → 1.6.19
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 +25 -14
- package/dist/client.js +4 -4
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -386,15 +386,15 @@ export declare class HomespunClient {
|
|
|
386
386
|
addAppMember(appId: string, opts: {
|
|
387
387
|
email: string;
|
|
388
388
|
role?: "member";
|
|
389
|
-
|
|
389
|
+
customRoles?: string[];
|
|
390
390
|
}): Promise<AddAppMemberResult>;
|
|
391
391
|
/** GET /v1/apps/:id/members — list the app's owner + member rows. */
|
|
392
392
|
listAppMembers(appId: string): Promise<{
|
|
393
393
|
members: AppMember[];
|
|
394
394
|
}>;
|
|
395
395
|
/**
|
|
396
|
-
* PATCH /v1/apps/:id/members/:humanId —
|
|
397
|
-
*
|
|
396
|
+
* PATCH /v1/apps/:id/members/:humanId — replace an existing member's declared
|
|
397
|
+
* roles in place. An empty array clears them back to a plain member. Every
|
|
398
398
|
* role must be one the app's manifest declares (a reserved base role or an
|
|
399
399
|
* undeclared name is a 400), and the app owner's own membership cannot be
|
|
400
400
|
* re-roled.
|
|
@@ -406,7 +406,7 @@ export declare class HomespunClient {
|
|
|
406
406
|
* can never escalate.
|
|
407
407
|
*/
|
|
408
408
|
setAppMemberRole(appId: string, humanId: string, opts: {
|
|
409
|
-
|
|
409
|
+
customRoles: string[];
|
|
410
410
|
}): Promise<{
|
|
411
411
|
member: AppMember;
|
|
412
412
|
}>;
|
|
@@ -755,7 +755,7 @@ export interface DeployAppResponse {
|
|
|
755
755
|
export interface RedeployAppRequest {
|
|
756
756
|
html: string;
|
|
757
757
|
manifest: unknown;
|
|
758
|
-
/** Bypass the compat gate; a
|
|
758
|
+
/** Bypass the compat gate; a removed collection is detached, not deleted. */
|
|
759
759
|
force?: boolean;
|
|
760
760
|
/**
|
|
761
761
|
* Optional asset bundle for this version. Replaces the previous version's asset
|
|
@@ -787,14 +787,16 @@ export interface RedeployAppResponse {
|
|
|
787
787
|
* redeploy) the compat gate runs against the current version.
|
|
788
788
|
*
|
|
789
789
|
* - `ok` is true when a REAL deploy with the same inputs would succeed: a
|
|
790
|
-
* clean deploy, or a
|
|
791
|
-
*
|
|
792
|
-
*
|
|
793
|
-
*
|
|
794
|
-
*
|
|
795
|
-
*
|
|
796
|
-
* deploy would
|
|
797
|
-
*
|
|
790
|
+
* clean deploy, or a gated redeploy with `force: true`. It is false when a
|
|
791
|
+
* real un-forced redeploy would be REJECTED, either for stranding rows
|
|
792
|
+
* already written or for widening what the app's install screen discloses
|
|
793
|
+
* (see `compat: "incompatible"` + `breaks`).
|
|
794
|
+
* - `compat` is present only for a redeploy check: "clean" (nothing gated),
|
|
795
|
+
* "forced" (gated, but force was set so the real deploy would proceed), or
|
|
796
|
+
* "incompatible" (gated and force was NOT set, so the real deploy would
|
|
797
|
+
* return manifest_incompatible_redeploy).
|
|
798
|
+
* - `breaks` lists what the gate found, present only when there is at least
|
|
799
|
+
* one.
|
|
798
800
|
*/
|
|
799
801
|
export interface DeployCheckResult {
|
|
800
802
|
ok: boolean;
|
|
@@ -902,7 +904,16 @@ export interface AppMember {
|
|
|
902
904
|
humanId: string;
|
|
903
905
|
email: string;
|
|
904
906
|
role: string;
|
|
905
|
-
/**
|
|
907
|
+
/**
|
|
908
|
+
* The DECLARED roles attached alongside base member powers. A member may hold
|
|
909
|
+
* several at once and holds the union of what each grants, plus everything
|
|
910
|
+
* those roles `includes`.
|
|
911
|
+
*/
|
|
912
|
+
customRoles?: string[];
|
|
913
|
+
/**
|
|
914
|
+
* The first of `customRoles`, or null. The single-role shape this API
|
|
915
|
+
* reported before a member could hold several; read `customRoles`.
|
|
916
|
+
*/
|
|
906
917
|
customRole?: string | null;
|
|
907
918
|
createdAt: string;
|
|
908
919
|
}
|
package/dist/client.js
CHANGED
|
@@ -731,7 +731,7 @@ export class HomespunClient {
|
|
|
731
731
|
* EMAIL_PROVIDER=none (no invite-email path available).
|
|
732
732
|
*/
|
|
733
733
|
async addAppMember(appId, opts) {
|
|
734
|
-
const r = await this.call("POST", `/v1/apps/${encodeURIComponent(appId)}/members`, { email: opts.email, role: opts.role,
|
|
734
|
+
const r = await this.call("POST", `/v1/apps/${encodeURIComponent(appId)}/members`, { email: opts.email, role: opts.role, custom_roles: opts.customRoles });
|
|
735
735
|
if (!r.ok)
|
|
736
736
|
this.fail(r);
|
|
737
737
|
return this.asObject(r);
|
|
@@ -744,8 +744,8 @@ export class HomespunClient {
|
|
|
744
744
|
return this.asObject(r);
|
|
745
745
|
}
|
|
746
746
|
/**
|
|
747
|
-
* PATCH /v1/apps/:id/members/:humanId —
|
|
748
|
-
*
|
|
747
|
+
* PATCH /v1/apps/:id/members/:humanId — replace an existing member's declared
|
|
748
|
+
* roles in place. An empty array clears them back to a plain member. Every
|
|
749
749
|
* role must be one the app's manifest declares (a reserved base role or an
|
|
750
750
|
* undeclared name is a 400), and the app owner's own membership cannot be
|
|
751
751
|
* re-roled.
|
|
@@ -757,7 +757,7 @@ export class HomespunClient {
|
|
|
757
757
|
* can never escalate.
|
|
758
758
|
*/
|
|
759
759
|
async setAppMemberRole(appId, humanId, opts) {
|
|
760
|
-
const r = await this.call("PATCH", `/v1/apps/${encodeURIComponent(appId)}/members/${encodeURIComponent(humanId)}`, {
|
|
760
|
+
const r = await this.call("PATCH", `/v1/apps/${encodeURIComponent(appId)}/members/${encodeURIComponent(humanId)}`, { custom_roles: opts.customRoles });
|
|
761
761
|
if (!r.ok)
|
|
762
762
|
this.fail(r);
|
|
763
763
|
return this.asObject(r);
|