@faable/auth-sdk 2.9.42 → 2.9.44

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.
@@ -6345,6 +6345,7 @@ export declare abstract class GeneratedFaableAuthApi extends FaableApi {
6345
6345
  team_id: string;
6346
6346
  user_id: string;
6347
6347
  roles: string[];
6348
+ account_roles: string[];
6348
6349
  }>;
6349
6350
  /**
6350
6351
  * `POST /team/{team_id}/member` — operationId: `team/addMembers`
@@ -6526,7 +6527,7 @@ export declare abstract class GeneratedFaableAuthApi extends FaableApi {
6526
6527
  *
6527
6528
  * Invite a user to a Team by email
6528
6529
  *
6529
- * Invites a user by email. `mode='auto'` (default) adds the user directly when the email already corresponds to a user in this tenant and falls back to a ticketed invite + email otherwise. `mode='invite'` always issues a ticket + email even when the user exists. Re-inviting the same email to the same team invalidates the previous pending invite.
6530
+ * Invites a user by email. `mode='auto'` (default) adds the user directly when the email already corresponds to a user in this tenant and falls back to a ticketed invite + email otherwise. `mode='invite'` always issues a ticket + email even when the user exists. `roles` are team-scoped and grant no Api permissions; `account_roles` are granted as account-level roles when the user joins (needs `create:rolemembers` too). Re-inviting the same email to the same team invalidates the previous pending invite.
6530
6531
  *
6531
6532
  * @throws {FaableApiError} `invite_used` (400) — The invite was already accepted.
6532
6533
  * @throws {FaableApiError} `invalid_role` (400) — The role belongs to another account.
@@ -6555,6 +6556,7 @@ export declare abstract class GeneratedFaableAuthApi extends FaableApi {
6555
6556
  createdAt: string;
6556
6557
  updatedAt?: string | undefined;
6557
6558
  } | undefined;
6559
+ account_roles?: string[] | undefined;
6558
6560
  }>;
6559
6561
  /**
6560
6562
  * `GET /team` — operationId: `team/list`
@@ -6643,6 +6645,7 @@ export declare abstract class GeneratedFaableAuthApi extends FaableApi {
6643
6645
  team: string;
6644
6646
  inviter?: string | undefined;
6645
6647
  roles: string[];
6648
+ account_roles: string[];
6646
6649
  mode: "auto" | "invite";
6647
6650
  redirect_uri?: string | undefined;
6648
6651
  expires_at: string;
@@ -6679,6 +6682,7 @@ export declare abstract class GeneratedFaableAuthApi extends FaableApi {
6679
6682
  team: string;
6680
6683
  inviter?: string | undefined;
6681
6684
  roles: string[];
6685
+ account_roles: string[];
6682
6686
  mode: "auto" | "invite";
6683
6687
  redirect_uri?: string | undefined;
6684
6688
  expires_at: string;
@@ -2341,7 +2341,7 @@ export class GeneratedFaableAuthApi extends FaableApi {
2341
2341
  *
2342
2342
  * Invite a user to a Team by email
2343
2343
  *
2344
- * Invites a user by email. `mode='auto'` (default) adds the user directly when the email already corresponds to a user in this tenant and falls back to a ticketed invite + email otherwise. `mode='invite'` always issues a ticket + email even when the user exists. Re-inviting the same email to the same team invalidates the previous pending invite.
2344
+ * Invites a user by email. `mode='auto'` (default) adds the user directly when the email already corresponds to a user in this tenant and falls back to a ticketed invite + email otherwise. `mode='invite'` always issues a ticket + email even when the user exists. `roles` are team-scoped and grant no Api permissions; `account_roles` are granted as account-level roles when the user joins (needs `create:rolemembers` too). Re-inviting the same email to the same team invalidates the previous pending invite.
2345
2345
  *
2346
2346
  * @throws {FaableApiError} `invite_used` (400) — The invite was already accepted.
2347
2347
  * @throws {FaableApiError} `invalid_role` (400) — The role belongs to another account.
@@ -1646,7 +1646,7 @@ export interface paths {
1646
1646
  put?: never;
1647
1647
  /**
1648
1648
  * Invite a user to a Team by email
1649
- * @description Invites a user by email. `mode='auto'` (default) adds the user directly when the email already corresponds to a user in this tenant and falls back to a ticketed invite + email otherwise. `mode='invite'` always issues a ticket + email even when the user exists. Re-inviting the same email to the same team invalidates the previous pending invite.
1649
+ * @description Invites a user by email. `mode='auto'` (default) adds the user directly when the email already corresponds to a user in this tenant and falls back to a ticketed invite + email otherwise. `mode='invite'` always issues a ticket + email even when the user exists. `roles` are team-scoped and grant no Api permissions; `account_roles` are granted as account-level roles when the user joins (needs `create:rolemembers` too). Re-inviting the same email to the same team invalidates the previous pending invite.
1650
1650
  */
1651
1651
  post: operations["team/invite"];
1652
1652
  delete?: never;
@@ -26245,6 +26245,8 @@ export interface operations {
26245
26245
  inviter?: string;
26246
26246
  /** @description Role ids that will be applied to the new TeamMember on acceptance. */
26247
26247
  roles: string[];
26248
+ /** @description Account-level role ids (whose Api permissions reach the tokens) that will be granted to the user on acceptance. */
26249
+ account_roles: string[];
26248
26250
  /** @description `auto` adds the user directly if they already exist in the tenant and only falls back to a ticketed invite when the email is unknown. `invite` always issues a ticket + email regardless of whether the user exists. */
26249
26251
  mode: "auto" | "invite";
26250
26252
  /** @description URI to redirect the invitee to after a successful accept. */
@@ -26373,6 +26375,14 @@ export interface operations {
26373
26375
  * @default []
26374
26376
  */
26375
26377
  roles?: string[];
26378
+ /**
26379
+ * @description Account-level role ids of this tenant granted to the user when they join — on accept, or right away when `mode='auto'` adds an existing user. These are the roles whose Api permissions reach the user's tokens (as with `POST /user/{user_id}/roles`); `roles` are team-scoped and grant none. Additive: roles the user already holds are kept. Needs the `create:rolemembers` scope besides `create:teammembers`. An unknown id fails the invite with `invalid_role`; a role deleted before the invite is accepted is skipped.
26380
+ * @default []
26381
+ * @example [
26382
+ * "role_6555fd293acc2f0fac0e3452"
26383
+ * ]
26384
+ */
26385
+ account_roles?: string[];
26376
26386
  /** @description `auto` adds the user directly if they already exist in the tenant and only falls back to a ticketed invite when the email is unknown. `invite` always issues a ticket + email regardless of whether the user exists. */
26377
26387
  mode?: "auto" | "invite";
26378
26388
  /** @description Where the invitee goes once in: `/invite-verify` redirects there after a successful accept, and it is the button of the "you were added" email (otherwise your auth domain). Must be at an origin of one of this tenant's client callbacks or `callback_hostnames`. */
@@ -26381,6 +26391,11 @@ export interface operations {
26381
26391
  inviter_user_id?: string;
26382
26392
  /** @description Your own page for accepting the invite. The emailed link becomes `<accept_url>#<token>`; the page reads the token from the fragment, signs the user in, and calls `POST /team/invite/accept` with the token and the signed-in user's id. Must be at an origin of one of this tenant's client callbacks or `callback_hostnames`. Without it the link is auth's own `/invite-verify`. */
26383
26393
  accept_url?: string;
26394
+ /**
26395
+ * @description The invitee's language (`es`, `en`…): the invitation's emails go out in it when the tenant enables it, and the user created on accepting keeps it as their `locale`. Without it, the tenant's first enabled locale.
26396
+ * @example es
26397
+ */
26398
+ locale?: string;
26384
26399
  };
26385
26400
  };
26386
26401
  };
@@ -26396,30 +26411,9 @@ export interface operations {
26396
26411
  status: "invited" | "added";
26397
26412
  /** @description ID of the issued invite ticket (when status=invited). */
26398
26413
  ticket_id?: string;
26399
- /** @description TeamMember */
26400
- member?: {
26401
- /** @description TeamMember ID */
26402
- id: string;
26403
- /** @description User that belongs to the team. Returned as an id by default; pass `?expand=user` to inline the full User object. */
26404
- user: components["schemas"]["User"] | string | unknown;
26405
- /** @description Team the user belongs to. Returned as an id by default; pass `?expand=team` to inline the full Team object. */
26406
- team: components["schemas"]["Team"] | string | unknown;
26407
- /** @description Roles granted to the user *within this team*. Distinct from account-wide RoleMember grants — these only apply in the scope of the team. Each entry is an id by default; pass `?expand=roles` to inline. */
26408
- roles: (components["schemas"]["Role"] | string | unknown)[];
26409
- /** @description Object is related with this account */
26410
- account: string;
26411
- /**
26412
- * @description TeamMemberMetadata
26413
- * @default {}
26414
- */
26415
- metadata: {
26416
- [key: string]: unknown;
26417
- };
26418
- /** @description TeamMember creation date */
26419
- createdAt: string;
26420
- /** @description TeamMember updated date */
26421
- updatedAt?: string;
26422
- };
26414
+ member?: components["schemas"]["TeamMember"];
26415
+ /** @description Account-level roles of the invite that the user holds now (when status=added). */
26416
+ account_roles?: string[];
26423
26417
  };
26424
26418
  };
26425
26419
  };
@@ -26731,7 +26725,10 @@ export interface operations {
26731
26725
  status: "accepted" | "already_member";
26732
26726
  team_id: string;
26733
26727
  user_id: string;
26728
+ /** @description Team roles of the membership created by the invite. */
26734
26729
  roles: string[];
26730
+ /** @description The invite's account-level roles, which the user holds now (granted even when they were already a member). */
26731
+ account_roles: string[];
26735
26732
  };
26736
26733
  };
26737
26734
  };
@@ -26862,6 +26859,8 @@ export interface operations {
26862
26859
  inviter?: string;
26863
26860
  /** @description Role ids that will be applied to the new TeamMember on acceptance. */
26864
26861
  roles: string[];
26862
+ /** @description Account-level role ids (whose Api permissions reach the tokens) that will be granted to the user on acceptance. */
26863
+ account_roles: string[];
26865
26864
  /** @description `auto` adds the user directly if they already exist in the tenant and only falls back to a ticketed invite when the email is unknown. `invite` always issues a ticket + email regardless of whether the user exists. */
26866
26865
  mode: "auto" | "invite";
26867
26866
  /** @description URI to redirect the invitee to after a successful accept. */
package/dist/version.js CHANGED
@@ -9,13 +9,13 @@
9
9
  // login pages could not import the SDK at all. Same pattern as auth-js.
10
10
  //
11
11
  // The sentinels MUST stay byte-identical to the `from` values in `.releaserc`.
12
- export const version = "2.9.42";
12
+ export const version = "2.9.44";
13
13
  // Short git SHA of the released commit. The version dates a build; this names
14
14
  // the exact tree, so a canonical log line or an audit entry leads straight to
15
15
  // `git show <sha>`. Deliberately NOT hex: an unreleased build (dev, a local
16
16
  // link) cannot be mistaken for a real commit — auth only records values that
17
17
  // look like a SHA, and this one never will.
18
- export const commit = "a832303";
18
+ export const commit = "de53d4b";
19
19
  // What this SDK writes in `x-faable-client`. Exported for a consumer that
20
20
  // builds a strategy on its own (outside `FaableAuthApi`) and still wants the
21
21
  // token request attributed — a bare `authClientCredentials` stamps only what
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faable/auth-sdk",
3
- "version": "2.9.42",
3
+ "version": "2.9.44",
4
4
  "author": "Marc Pomar <marc@faable.com>",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/spec/openapi.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "info": {
4
4
  "title": "@faablecloud/auth",
5
5
  "description": "Auth Platform made by Faable. Manage Users and Roles",
6
- "version": "2.116.2",
6
+ "version": "2.118.0",
7
7
  "license": {
8
8
  "name": "private",
9
9
  "url": "https://faable.com/docs/platform/privacy-policy"
@@ -50796,7 +50796,7 @@
50796
50796
  "tags": [
50797
50797
  "team"
50798
50798
  ],
50799
- "description": "Invites a user by email. `mode='auto'` (default) adds the user directly when the email already corresponds to a user in this tenant and falls back to a ticketed invite + email otherwise. `mode='invite'` always issues a ticket + email even when the user exists. Re-inviting the same email to the same team invalidates the previous pending invite.",
50799
+ "description": "Invites a user by email. `mode='auto'` (default) adds the user directly when the email already corresponds to a user in this tenant and falls back to a ticketed invite + email otherwise. `mode='invite'` always issues a ticket + email even when the user exists. `roles` are team-scoped and grant no Api permissions; `account_roles` are granted as account-level roles when the user joins (needs `create:rolemembers` too). Re-inviting the same email to the same team invalidates the previous pending invite.",
50800
50800
  "requestBody": {
50801
50801
  "required": true,
50802
50802
  "content": {
@@ -50820,6 +50820,17 @@
50820
50820
  "description": "Role ids granted to the resulting TeamMember within the scope of this team.",
50821
50821
  "default": []
50822
50822
  },
50823
+ "account_roles": {
50824
+ "type": "array",
50825
+ "items": {
50826
+ "type": "string"
50827
+ },
50828
+ "description": "Account-level role ids of this tenant granted to the user when they join — on accept, or right away when `mode='auto'` adds an existing user. These are the roles whose Api permissions reach the user's tokens (as with `POST /user/{user_id}/roles`); `roles` are team-scoped and grant none. Additive: roles the user already holds are kept. Needs the `create:rolemembers` scope besides `create:teammembers`. An unknown id fails the invite with `invalid_role`; a role deleted before the invite is accepted is skipped.",
50829
+ "default": [],
50830
+ "example": [
50831
+ "role_6555fd293acc2f0fac0e3452"
50832
+ ]
50833
+ },
50823
50834
  "mode": {
50824
50835
  "anyOf": [
50825
50836
  {
@@ -50848,6 +50859,12 @@
50848
50859
  "accept_url": {
50849
50860
  "type": "string",
50850
50861
  "description": "Your own page for accepting the invite. The emailed link becomes `<accept_url>#<token>`; the page reads the token from the fragment, signs the user in, and calls `POST /team/invite/accept` with the token and the signed-in user's id. Must be at an origin of one of this tenant's client callbacks or `callback_hostnames`. Without it the link is auth's own `/invite-verify`."
50862
+ },
50863
+ "locale": {
50864
+ "type": "string",
50865
+ "pattern": "^[a-z]{2}(-[A-Z]{2})?$",
50866
+ "description": "The invitee's language (`es`, `en`…): the invitation's emails go out in it when the tenant enables it, and the user created on accepting keeps it as their `locale`. Without it, the tenant's first enabled locale.",
50867
+ "example": "es"
50851
50868
  }
50852
50869
  },
50853
50870
  "additionalProperties": false,
@@ -50905,80 +50922,14 @@
50905
50922
  "description": "ID of the issued invite ticket (when status=invited)."
50906
50923
  },
50907
50924
  "member": {
50908
- "type": "object",
50909
- "required": [
50910
- "id",
50911
- "user",
50912
- "team",
50913
- "roles",
50914
- "account",
50915
- "createdAt"
50916
- ],
50917
- "properties": {
50918
- "id": {
50919
- "type": "string",
50920
- "description": "TeamMember ID"
50921
- },
50922
- "user": {
50923
- "anyOf": [
50924
- {
50925
- "$ref": "#/components/schemas/User"
50926
- },
50927
- {
50928
- "type": "string"
50929
- },
50930
- {}
50931
- ],
50932
- "description": "User that belongs to the team. Returned as an id by default; pass `?expand=user` to inline the full User object."
50933
- },
50934
- "team": {
50935
- "anyOf": [
50936
- {
50937
- "$ref": "#/components/schemas/Team"
50938
- },
50939
- {
50940
- "type": "string"
50941
- },
50942
- {}
50943
- ],
50944
- "description": "Team the user belongs to. Returned as an id by default; pass `?expand=team` to inline the full Team object."
50945
- },
50946
- "roles": {
50947
- "type": "array",
50948
- "items": {
50949
- "anyOf": [
50950
- {
50951
- "$ref": "#/components/schemas/Role"
50952
- },
50953
- {
50954
- "type": "string"
50955
- },
50956
- {}
50957
- ]
50958
- },
50959
- "description": "Roles granted to the user *within this team*. Distinct from account-wide RoleMember grants — these only apply in the scope of the team. Each entry is an id by default; pass `?expand=roles` to inline."
50960
- },
50961
- "account": {
50962
- "type": "string",
50963
- "description": "Object is related with this account"
50964
- },
50965
- "metadata": {
50966
- "type": "object",
50967
- "properties": {},
50968
- "additionalProperties": true,
50969
- "description": "TeamMemberMetadata",
50970
- "default": {}
50971
- },
50972
- "createdAt": {
50973
- "type": "string",
50974
- "description": "TeamMember creation date"
50975
- },
50976
- "updatedAt": {
50977
- "type": "string",
50978
- "description": "TeamMember updated date"
50979
- }
50925
+ "$ref": "#/components/schemas/TeamMember"
50926
+ },
50927
+ "account_roles": {
50928
+ "type": "array",
50929
+ "items": {
50930
+ "type": "string"
50980
50931
  },
50981
- "description": "TeamMember"
50932
+ "description": "Account-level roles of the invite that the user holds now (when status=added)."
50982
50933
  }
50983
50934
  },
50984
50935
  "additionalProperties": false
@@ -51194,6 +51145,7 @@
51194
51145
  "email",
51195
51146
  "team",
51196
51147
  "roles",
51148
+ "account_roles",
51197
51149
  "mode",
51198
51150
  "expires_at",
51199
51151
  "account",
@@ -51223,6 +51175,13 @@
51223
51175
  },
51224
51176
  "description": "Role ids that will be applied to the new TeamMember on acceptance."
51225
51177
  },
51178
+ "account_roles": {
51179
+ "type": "array",
51180
+ "items": {
51181
+ "type": "string"
51182
+ },
51183
+ "description": "Account-level role ids (whose Api permissions reach the tokens) that will be granted to the user on acceptance."
51184
+ },
51226
51185
  "mode": {
51227
51186
  "anyOf": [
51228
51187
  {
@@ -51837,7 +51796,8 @@
51837
51796
  "status",
51838
51797
  "team_id",
51839
51798
  "user_id",
51840
- "roles"
51799
+ "roles",
51800
+ "account_roles"
51841
51801
  ],
51842
51802
  "properties": {
51843
51803
  "status": {
@@ -51867,7 +51827,15 @@
51867
51827
  "type": "array",
51868
51828
  "items": {
51869
51829
  "type": "string"
51870
- }
51830
+ },
51831
+ "description": "Team roles of the membership created by the invite."
51832
+ },
51833
+ "account_roles": {
51834
+ "type": "array",
51835
+ "items": {
51836
+ "type": "string"
51837
+ },
51838
+ "description": "The invite's account-level roles, which the user holds now (granted even when they were already a member)."
51871
51839
  }
51872
51840
  },
51873
51841
  "additionalProperties": false
@@ -52084,6 +52052,7 @@
52084
52052
  "email",
52085
52053
  "team",
52086
52054
  "roles",
52055
+ "account_roles",
52087
52056
  "mode",
52088
52057
  "expires_at",
52089
52058
  "account",
@@ -52113,6 +52082,13 @@
52113
52082
  },
52114
52083
  "description": "Role ids that will be applied to the new TeamMember on acceptance."
52115
52084
  },
52085
+ "account_roles": {
52086
+ "type": "array",
52087
+ "items": {
52088
+ "type": "string"
52089
+ },
52090
+ "description": "Account-level role ids (whose Api permissions reach the tokens) that will be granted to the user on acceptance."
52091
+ },
52116
52092
  "mode": {
52117
52093
  "anyOf": [
52118
52094
  {