@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 CHANGED
@@ -386,15 +386,15 @@ export declare class HomespunClient {
386
386
  addAppMember(appId: string, opts: {
387
387
  email: string;
388
388
  role?: "member";
389
- customRole?: string;
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 — change an existing member's custom
397
- * role in place. `customRole: null` clears it back to a plain member. The
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
- customRole: string | null;
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 narrowing collection is detached, not deleted. */
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 narrowing redeploy with `force: true`. It is false
791
- * when a real un-forced redeploy would be REJECTED for narrowing the
792
- * manifest (see `compat: "incompatible"` + `breaks`).
793
- * - `compat` is present only for a redeploy check: "clean" (no narrowing),
794
- * "forced" (narrows, but force was set so the real deploy would detach and
795
- * proceed), or "incompatible" (narrows and force was NOT set, so the real
796
- * deploy would return manifest_incompatible_redeploy).
797
- * - `breaks` lists the narrowings, present only when there is at least one.
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
- /** M5: an optional DECLARED custom role attached alongside base member powers. */
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, custom_role: opts.customRole });
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 — change an existing member's custom
748
- * role in place. `customRole: null` clears it back to a plain member. The
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)}`, { custom_role: opts.customRole });
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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homespunapps/core",
3
- "version": "1.6.17",
3
+ "version": "1.6.19",
4
4
  "description": "Homespun relay client: typed HTTP + WebSocket operations against a Homespun relay. Framework-free.",
5
5
  "license": "MIT",
6
6
  "type": "module",