@faable/auth-sdk 2.6.7 → 2.6.9

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.
@@ -4156,6 +4156,23 @@ export declare abstract class GeneratedFaableAuthApi extends FaableApi {
4156
4156
  updatedAt?: string | undefined;
4157
4157
  }>>;
4158
4158
  };
4159
+ /**
4160
+ * `GET /user/{user_id}/tickets` — operationId: `user/listTickets`
4161
+ *
4162
+ * List the tickets issued for a user
4163
+ */
4164
+ userListTickets(user_id: string): Promise<{
4165
+ results: {
4166
+ id: string;
4167
+ type: string;
4168
+ status: "active" | "expired" | "used";
4169
+ email: string;
4170
+ createdAt: string;
4171
+ expires_at: string;
4172
+ ttl: number;
4173
+ link?: string | undefined;
4174
+ }[];
4175
+ }>;
4159
4176
  /**
4160
4177
  * `POST /user/{user_id}/password-setup` — operationId: `user/passwordSetup`
4161
4178
  *
@@ -4166,6 +4183,15 @@ export declare abstract class GeneratedFaableAuthApi extends FaableApi {
4166
4183
  credential_id: string;
4167
4184
  ticket_id: string;
4168
4185
  }>;
4186
+ /**
4187
+ * `POST /user/{user_id}/tickets/{ticket_id}/revoke` — operationId: `user/revokeTicket`
4188
+ *
4189
+ * Revoke a ticket issued for a user
4190
+ */
4191
+ userRevokeTicket(user_id: string, ticket_id: string): Promise<{
4192
+ status: "revoked" | "already_used";
4193
+ id: string;
4194
+ }>;
4169
4195
  /**
4170
4196
  * `POST /user/{user_id}` — operationId: `user/update`
4171
4197
  *
@@ -821,6 +821,15 @@ export class GeneratedFaableAuthApi extends FaableApi {
821
821
  userList(params) {
822
822
  return this.paginator({ url: `/user`, params });
823
823
  }
824
+ /**
825
+ * `GET /user/{user_id}/tickets` — operationId: `user/listTickets`
826
+ *
827
+ * List the tickets issued for a user
828
+ */
829
+ userListTickets(user_id) {
830
+ requireId("user_id", user_id);
831
+ return this.fetcher.get(`/user/${user_id}/tickets`);
832
+ }
824
833
  /**
825
834
  * `POST /user/{user_id}/password-setup` — operationId: `user/passwordSetup`
826
835
  *
@@ -830,6 +839,16 @@ export class GeneratedFaableAuthApi extends FaableApi {
830
839
  requireId("user_id", user_id);
831
840
  return this.fetcher.post(`/user/${user_id}/password-setup`, data);
832
841
  }
842
+ /**
843
+ * `POST /user/{user_id}/tickets/{ticket_id}/revoke` — operationId: `user/revokeTicket`
844
+ *
845
+ * Revoke a ticket issued for a user
846
+ */
847
+ userRevokeTicket(user_id, ticket_id) {
848
+ requireId("user_id", user_id);
849
+ requireId("ticket_id", ticket_id);
850
+ return this.fetcher.post(`/user/${user_id}/tickets/${ticket_id}/revoke`, {});
851
+ }
833
852
  /**
834
853
  * `POST /user/{user_id}` — operationId: `user/update`
835
854
  *
@@ -464,6 +464,46 @@ export interface paths {
464
464
  patch?: never;
465
465
  trace?: never;
466
466
  };
467
+ "/user/{user_id}/tickets": {
468
+ parameters: {
469
+ query?: never;
470
+ header?: never;
471
+ path?: never;
472
+ cookie?: never;
473
+ };
474
+ /**
475
+ * List the tickets issued for a user
476
+ * @description Returns the password-reset / verification / invitation tickets issued for this user, newest first, each with its status and — while it is still usable — the link that was emailed. Intended for handing a recovery link over by another channel when the email does not reach the person. Requires `update:credentials`: the link grants the same account access that setting a password does, and each reveal is recorded in the audit log.
477
+ */
478
+ get: operations["user/listTickets"];
479
+ put?: never;
480
+ post?: never;
481
+ delete?: never;
482
+ options?: never;
483
+ head?: never;
484
+ patch?: never;
485
+ trace?: never;
486
+ };
487
+ "/user/{user_id}/tickets/{ticket_id}/revoke": {
488
+ parameters: {
489
+ query?: never;
490
+ header?: never;
491
+ path?: never;
492
+ cookie?: never;
493
+ };
494
+ get?: never;
495
+ put?: never;
496
+ /**
497
+ * Revoke a ticket issued for a user
498
+ * @description Marks the ticket as consumed so its link stops working immediately. The counterpart of listing links: once a link has been copied out of the dashboard it can end up in the wrong chat window, and the TTL alone is too slow an answer.
499
+ */
500
+ post: operations["user/revokeTicket"];
501
+ delete?: never;
502
+ options?: never;
503
+ head?: never;
504
+ patch?: never;
505
+ trace?: never;
506
+ };
467
507
  "/user/{user_id}/factors": {
468
508
  parameters: {
469
509
  query?: never;
@@ -7515,6 +7555,66 @@ export interface operations {
7515
7555
  };
7516
7556
  };
7517
7557
  };
7558
+ "user/listTickets": {
7559
+ parameters: {
7560
+ query?: never;
7561
+ header?: never;
7562
+ path: {
7563
+ user_id: string;
7564
+ };
7565
+ cookie?: never;
7566
+ };
7567
+ requestBody?: never;
7568
+ responses: {
7569
+ /** @description Default Response */
7570
+ 200: {
7571
+ headers: {
7572
+ [name: string]: unknown;
7573
+ };
7574
+ content: {
7575
+ "application/json": {
7576
+ results: {
7577
+ id: string;
7578
+ type: string;
7579
+ status: "active" | "expired" | "used";
7580
+ email: string;
7581
+ createdAt: string;
7582
+ expires_at: string;
7583
+ ttl: number;
7584
+ /** @description The link from the ticket email. Present only while the ticket is usable — a dead link is noise, not a recovery path. */
7585
+ link?: string;
7586
+ }[];
7587
+ };
7588
+ };
7589
+ };
7590
+ };
7591
+ };
7592
+ "user/revokeTicket": {
7593
+ parameters: {
7594
+ query?: never;
7595
+ header?: never;
7596
+ path: {
7597
+ user_id: string;
7598
+ ticket_id: string;
7599
+ };
7600
+ cookie?: never;
7601
+ };
7602
+ requestBody?: never;
7603
+ responses: {
7604
+ /** @description Default Response */
7605
+ 200: {
7606
+ headers: {
7607
+ [name: string]: unknown;
7608
+ };
7609
+ content: {
7610
+ "application/json": {
7611
+ status: "revoked" | "already_used";
7612
+ id: string;
7613
+ };
7614
+ };
7615
+ };
7616
+ };
7617
+ };
7518
7618
  "user/factors": {
7519
7619
  parameters: {
7520
7620
  query?: never;
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.6.7";
12
+ export const version = "2.6.9";
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 = "02df4b8";
18
+ export const commit = "68c9ebc";
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.6.7",
3
+ "version": "2.6.9",
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.12.3",
6
+ "version": "2.13.0",
7
7
  "license": {
8
8
  "name": "private",
9
9
  "url": "https://faable.com/docs/platform/privacy-policy"
@@ -14704,6 +14704,179 @@
14704
14704
  }
14705
14705
  }
14706
14706
  },
14707
+ "/user/{user_id}/tickets": {
14708
+ "get": {
14709
+ "operationId": "user/listTickets",
14710
+ "summary": "List the tickets issued for a user",
14711
+ "tags": [
14712
+ "user"
14713
+ ],
14714
+ "description": "Returns the password-reset / verification / invitation tickets issued for this user, newest first, each with its status and — while it is still usable — the link that was emailed. Intended for handing a recovery link over by another channel when the email does not reach the person. Requires `update:credentials`: the link grants the same account access that setting a password does, and each reveal is recorded in the audit log.",
14715
+ "parameters": [
14716
+ {
14717
+ "schema": {
14718
+ "type": "string"
14719
+ },
14720
+ "in": "path",
14721
+ "name": "user_id",
14722
+ "required": true
14723
+ }
14724
+ ],
14725
+ "security": [
14726
+ {
14727
+ "bearerAuth": []
14728
+ }
14729
+ ],
14730
+ "responses": {
14731
+ "200": {
14732
+ "description": "Default Response",
14733
+ "content": {
14734
+ "application/json": {
14735
+ "schema": {
14736
+ "type": "object",
14737
+ "required": [
14738
+ "results"
14739
+ ],
14740
+ "properties": {
14741
+ "results": {
14742
+ "type": "array",
14743
+ "items": {
14744
+ "type": "object",
14745
+ "required": [
14746
+ "id",
14747
+ "type",
14748
+ "status",
14749
+ "email",
14750
+ "createdAt",
14751
+ "expires_at",
14752
+ "ttl"
14753
+ ],
14754
+ "properties": {
14755
+ "id": {
14756
+ "type": "string"
14757
+ },
14758
+ "type": {
14759
+ "type": "string"
14760
+ },
14761
+ "status": {
14762
+ "anyOf": [
14763
+ {
14764
+ "type": "string",
14765
+ "enum": [
14766
+ "active"
14767
+ ]
14768
+ },
14769
+ {
14770
+ "type": "string",
14771
+ "enum": [
14772
+ "expired"
14773
+ ]
14774
+ },
14775
+ {
14776
+ "type": "string",
14777
+ "enum": [
14778
+ "used"
14779
+ ]
14780
+ }
14781
+ ]
14782
+ },
14783
+ "email": {
14784
+ "type": "string"
14785
+ },
14786
+ "createdAt": {
14787
+ "type": "string"
14788
+ },
14789
+ "expires_at": {
14790
+ "type": "string"
14791
+ },
14792
+ "ttl": {
14793
+ "type": "number"
14794
+ },
14795
+ "link": {
14796
+ "type": "string",
14797
+ "description": "The link from the ticket email. Present only while the ticket is usable — a dead link is noise, not a recovery path."
14798
+ }
14799
+ }
14800
+ }
14801
+ }
14802
+ }
14803
+ }
14804
+ }
14805
+ }
14806
+ }
14807
+ }
14808
+ }
14809
+ },
14810
+ "/user/{user_id}/tickets/{ticket_id}/revoke": {
14811
+ "post": {
14812
+ "operationId": "user/revokeTicket",
14813
+ "summary": "Revoke a ticket issued for a user",
14814
+ "tags": [
14815
+ "user"
14816
+ ],
14817
+ "description": "Marks the ticket as consumed so its link stops working immediately. The counterpart of listing links: once a link has been copied out of the dashboard it can end up in the wrong chat window, and the TTL alone is too slow an answer.",
14818
+ "parameters": [
14819
+ {
14820
+ "schema": {
14821
+ "type": "string"
14822
+ },
14823
+ "in": "path",
14824
+ "name": "user_id",
14825
+ "required": true
14826
+ },
14827
+ {
14828
+ "schema": {
14829
+ "type": "string"
14830
+ },
14831
+ "in": "path",
14832
+ "name": "ticket_id",
14833
+ "required": true
14834
+ }
14835
+ ],
14836
+ "security": [
14837
+ {
14838
+ "bearerAuth": []
14839
+ }
14840
+ ],
14841
+ "responses": {
14842
+ "200": {
14843
+ "description": "Default Response",
14844
+ "content": {
14845
+ "application/json": {
14846
+ "schema": {
14847
+ "type": "object",
14848
+ "required": [
14849
+ "status",
14850
+ "id"
14851
+ ],
14852
+ "properties": {
14853
+ "status": {
14854
+ "anyOf": [
14855
+ {
14856
+ "type": "string",
14857
+ "enum": [
14858
+ "revoked"
14859
+ ]
14860
+ },
14861
+ {
14862
+ "type": "string",
14863
+ "enum": [
14864
+ "already_used"
14865
+ ]
14866
+ }
14867
+ ]
14868
+ },
14869
+ "id": {
14870
+ "type": "string"
14871
+ }
14872
+ }
14873
+ }
14874
+ }
14875
+ }
14876
+ }
14877
+ }
14878
+ }
14879
+ },
14707
14880
  "/user/{user_id}/factors": {
14708
14881
  "get": {
14709
14882
  "operationId": "user/factors",