@faable/auth-sdk 2.6.16 → 2.6.17

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.
@@ -4285,6 +4285,7 @@ export declare abstract class GeneratedFaableAuthApi extends FaableApi {
4285
4285
  createdAt: string;
4286
4286
  expires_at: string;
4287
4287
  ttl: number;
4288
+ channel: string;
4288
4289
  link?: string | undefined;
4289
4290
  }[];
4290
4291
  }>;
@@ -4297,6 +4298,7 @@ export declare abstract class GeneratedFaableAuthApi extends FaableApi {
4297
4298
  status: "sent";
4298
4299
  credential_id: string;
4299
4300
  ticket_id: string;
4301
+ channel: "email" | "sms" | "whatsapp" | "factor";
4300
4302
  }>;
4301
4303
  /**
4302
4304
  * `POST /user/{user_id}/tickets/{ticket_id}/revoke` — operationId: `user/revokeTicket`
@@ -2793,6 +2793,46 @@ export interface paths {
2793
2793
  patch?: never;
2794
2794
  trace?: never;
2795
2795
  };
2796
+ "/reset-code/verify": {
2797
+ parameters: {
2798
+ query?: never;
2799
+ header?: never;
2800
+ path?: never;
2801
+ cookie?: never;
2802
+ };
2803
+ get?: never;
2804
+ put?: never;
2805
+ /**
2806
+ * Redeem a password-reset code sent by SMS/WhatsApp
2807
+ * @description Second entry point to the new-password screen, for a reset delivered as a 6-digit code instead of a link. Answers the same `redirect_url` that the emailed link would land on. Five wrong codes consume the ticket; the error is always `invalid_code` and reveals nothing about the account.
2808
+ */
2809
+ post: operations["reset_code_verify"];
2810
+ delete?: never;
2811
+ options?: never;
2812
+ head?: never;
2813
+ patch?: never;
2814
+ trace?: never;
2815
+ };
2816
+ "/dbconnections/recovery_options": {
2817
+ parameters: {
2818
+ query?: never;
2819
+ header?: never;
2820
+ path?: never;
2821
+ cookie?: never;
2822
+ };
2823
+ get?: never;
2824
+ put?: never;
2825
+ /**
2826
+ * Recovery channels to offer for an identifier
2827
+ * @description For the forgot-password screen. With the tenant's `visible` list empty (the default) it answers from configuration alone and never looks the account up. Otherwise it returns the channels the user can pick, with masked destinations.
2828
+ */
2829
+ post: operations["recovery_options"];
2830
+ delete?: never;
2831
+ options?: never;
2832
+ head?: never;
2833
+ patch?: never;
2834
+ trace?: never;
2835
+ };
2796
2836
  "/dbconnections/signup": {
2797
2837
  parameters: {
2798
2838
  query?: never;
@@ -7800,6 +7840,8 @@ export interface operations {
7800
7840
  "application/json": {
7801
7841
  /** @description Optional connection_name to disambiguate when the tenant has more than one database connection. Defaults to the tenant database connection. */
7802
7842
  connection?: string;
7843
+ /** @description How to deliver it: `email` (the link) or `sms` / `whatsapp` (a 6-digit code to the verified phone on file). Falls back to the tenant default when not available for this user; the response says which channel was used. */
7844
+ channel?: "email" | "sms" | "whatsapp" | "factor";
7803
7845
  };
7804
7846
  };
7805
7847
  };
@@ -7815,6 +7857,7 @@ export interface operations {
7815
7857
  status: "sent";
7816
7858
  credential_id: string;
7817
7859
  ticket_id: string;
7860
+ channel: "email" | "sms" | "whatsapp" | "factor";
7818
7861
  };
7819
7862
  };
7820
7863
  };
@@ -7846,6 +7889,8 @@ export interface operations {
7846
7889
  createdAt: string;
7847
7890
  expires_at: string;
7848
7891
  ttl: number;
7892
+ /** @description How this ticket reaches the person: `email` (the link), `sms` / `whatsapp` (a code), `factor`. Older tickets are `email`. */
7893
+ channel: string;
7849
7894
  /** @description The link from the ticket email. Present only while the ticket is usable — a dead link is noise, not a recovery path. */
7850
7895
  link?: string;
7851
7896
  }[];
@@ -13328,6 +13373,8 @@ export interface operations {
13328
13373
  content: {
13329
13374
  "application/json": {
13330
13375
  email: string;
13376
+ /** @description How to deliver the reset: `email` (link), `sms` / `whatsapp` (a 6-digit code to the verified phone on file). Silently falls back to the tenant default when the channel is not available for this user — the response never says which channels an account has. */
13377
+ channel?: "email" | "sms" | "whatsapp" | "factor";
13331
13378
  };
13332
13379
  };
13333
13380
  };
@@ -13391,6 +13438,69 @@ export interface operations {
13391
13438
  };
13392
13439
  };
13393
13440
  };
13441
+ reset_code_verify: {
13442
+ parameters: {
13443
+ query?: never;
13444
+ header?: never;
13445
+ path?: never;
13446
+ cookie?: never;
13447
+ };
13448
+ requestBody: {
13449
+ content: {
13450
+ "application/json": {
13451
+ email: string;
13452
+ code: string;
13453
+ };
13454
+ };
13455
+ };
13456
+ responses: {
13457
+ /** @description Default Response */
13458
+ 200: {
13459
+ headers: {
13460
+ [name: string]: unknown;
13461
+ };
13462
+ content: {
13463
+ "application/json": {
13464
+ redirect_url: string;
13465
+ };
13466
+ };
13467
+ };
13468
+ };
13469
+ };
13470
+ recovery_options: {
13471
+ parameters: {
13472
+ query?: never;
13473
+ header?: never;
13474
+ path?: never;
13475
+ cookie?: never;
13476
+ };
13477
+ requestBody: {
13478
+ content: {
13479
+ "application/json": {
13480
+ email: string;
13481
+ };
13482
+ };
13483
+ };
13484
+ responses: {
13485
+ /** @description Default Response */
13486
+ 200: {
13487
+ headers: {
13488
+ [name: string]: unknown;
13489
+ };
13490
+ content: {
13491
+ "application/json": {
13492
+ /** @description Whether the screen should offer a choice. False when the tenant keeps `visible` empty — then nothing here depends on the account existing. */
13493
+ picker: boolean;
13494
+ default: "email" | "sms" | "whatsapp" | "factor";
13495
+ channels: {
13496
+ channel: "email" | "sms" | "whatsapp" | "factor";
13497
+ destination_masked?: string;
13498
+ }[];
13499
+ };
13500
+ };
13501
+ };
13502
+ };
13503
+ };
13394
13504
  signup: {
13395
13505
  parameters: {
13396
13506
  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.16";
12
+ export const version = "2.6.17";
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 = "c04402e";
18
+ export const commit = "bcc574e";
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.16",
3
+ "version": "2.6.17",
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.17.0",
6
+ "version": "2.18.0",
7
7
  "license": {
8
8
  "name": "private",
9
9
  "url": "https://faable.com/docs/platform/privacy-policy"
@@ -16713,6 +16713,39 @@
16713
16713
  "connection": {
16714
16714
  "type": "string",
16715
16715
  "description": "Optional connection_name to disambiguate when the tenant has more than one database connection. Defaults to the tenant database connection."
16716
+ },
16717
+ "channel": {
16718
+ "anyOf": [
16719
+ {
16720
+ "anyOf": [
16721
+ {
16722
+ "type": "string",
16723
+ "enum": [
16724
+ "email"
16725
+ ]
16726
+ },
16727
+ {
16728
+ "type": "string",
16729
+ "enum": [
16730
+ "sms"
16731
+ ]
16732
+ },
16733
+ {
16734
+ "type": "string",
16735
+ "enum": [
16736
+ "whatsapp"
16737
+ ]
16738
+ },
16739
+ {
16740
+ "type": "string",
16741
+ "enum": [
16742
+ "factor"
16743
+ ]
16744
+ }
16745
+ ]
16746
+ }
16747
+ ],
16748
+ "description": "How to deliver it: `email` (the link) or `sms` / `whatsapp` (a 6-digit code to the verified phone on file). Falls back to the tenant default when not available for this user; the response says which channel was used."
16716
16749
  }
16717
16750
  },
16718
16751
  "additionalProperties": false
@@ -16745,7 +16778,8 @@
16745
16778
  "required": [
16746
16779
  "status",
16747
16780
  "credential_id",
16748
- "ticket_id"
16781
+ "ticket_id",
16782
+ "channel"
16749
16783
  ],
16750
16784
  "properties": {
16751
16785
  "status": {
@@ -16759,6 +16793,34 @@
16759
16793
  },
16760
16794
  "ticket_id": {
16761
16795
  "type": "string"
16796
+ },
16797
+ "channel": {
16798
+ "anyOf": [
16799
+ {
16800
+ "type": "string",
16801
+ "enum": [
16802
+ "email"
16803
+ ]
16804
+ },
16805
+ {
16806
+ "type": "string",
16807
+ "enum": [
16808
+ "sms"
16809
+ ]
16810
+ },
16811
+ {
16812
+ "type": "string",
16813
+ "enum": [
16814
+ "whatsapp"
16815
+ ]
16816
+ },
16817
+ {
16818
+ "type": "string",
16819
+ "enum": [
16820
+ "factor"
16821
+ ]
16822
+ }
16823
+ ]
16762
16824
  }
16763
16825
  }
16764
16826
  }
@@ -16813,7 +16875,8 @@
16813
16875
  "email",
16814
16876
  "createdAt",
16815
16877
  "expires_at",
16816
- "ttl"
16878
+ "ttl",
16879
+ "channel"
16817
16880
  ],
16818
16881
  "properties": {
16819
16882
  "id": {
@@ -16856,6 +16919,10 @@
16856
16919
  "ttl": {
16857
16920
  "type": "number"
16858
16921
  },
16922
+ "channel": {
16923
+ "type": "string",
16924
+ "description": "How this ticket reaches the person: `email` (the link), `sms` / `whatsapp` (a code), `factor`. Older tickets are `email`."
16925
+ },
16859
16926
  "link": {
16860
16927
  "type": "string",
16861
16928
  "description": "The link from the ticket email. Present only while the ticket is usable — a dead link is noise, not a recovery path."
@@ -33840,6 +33907,39 @@
33840
33907
  "properties": {
33841
33908
  "email": {
33842
33909
  "type": "string"
33910
+ },
33911
+ "channel": {
33912
+ "anyOf": [
33913
+ {
33914
+ "anyOf": [
33915
+ {
33916
+ "type": "string",
33917
+ "enum": [
33918
+ "email"
33919
+ ]
33920
+ },
33921
+ {
33922
+ "type": "string",
33923
+ "enum": [
33924
+ "sms"
33925
+ ]
33926
+ },
33927
+ {
33928
+ "type": "string",
33929
+ "enum": [
33930
+ "whatsapp"
33931
+ ]
33932
+ },
33933
+ {
33934
+ "type": "string",
33935
+ "enum": [
33936
+ "factor"
33937
+ ]
33938
+ }
33939
+ ]
33940
+ }
33941
+ ],
33942
+ "description": "How to deliver the reset: `email` (link), `sms` / `whatsapp` (a 6-digit code to the verified phone on file). Silently falls back to the tenant default when the channel is not available for this user — the response never says which channels an account has."
33843
33943
  }
33844
33944
  }
33845
33945
  }
@@ -33934,6 +34034,183 @@
33934
34034
  }
33935
34035
  }
33936
34036
  },
34037
+ "/reset-code/verify": {
34038
+ "post": {
34039
+ "operationId": "reset_code_verify",
34040
+ "summary": "Redeem a password-reset code sent by SMS/WhatsApp",
34041
+ "tags": [
34042
+ "dbconnection"
34043
+ ],
34044
+ "description": "Second entry point to the new-password screen, for a reset delivered as a 6-digit code instead of a link. Answers the same `redirect_url` that the emailed link would land on. Five wrong codes consume the ticket; the error is always `invalid_code` and reveals nothing about the account.",
34045
+ "requestBody": {
34046
+ "required": true,
34047
+ "content": {
34048
+ "application/json": {
34049
+ "schema": {
34050
+ "type": "object",
34051
+ "required": [
34052
+ "email",
34053
+ "code"
34054
+ ],
34055
+ "properties": {
34056
+ "email": {
34057
+ "type": "string"
34058
+ },
34059
+ "code": {
34060
+ "type": "string",
34061
+ "minLength": 4,
34062
+ "maxLength": 12
34063
+ }
34064
+ },
34065
+ "additionalProperties": false
34066
+ }
34067
+ }
34068
+ }
34069
+ },
34070
+ "responses": {
34071
+ "200": {
34072
+ "description": "Default Response",
34073
+ "content": {
34074
+ "application/json": {
34075
+ "schema": {
34076
+ "type": "object",
34077
+ "required": [
34078
+ "redirect_url"
34079
+ ],
34080
+ "properties": {
34081
+ "redirect_url": {
34082
+ "type": "string"
34083
+ }
34084
+ }
34085
+ }
34086
+ }
34087
+ }
34088
+ }
34089
+ }
34090
+ }
34091
+ },
34092
+ "/dbconnections/recovery_options": {
34093
+ "post": {
34094
+ "operationId": "recovery_options",
34095
+ "summary": "Recovery channels to offer for an identifier",
34096
+ "tags": [
34097
+ "dbconnection"
34098
+ ],
34099
+ "description": "For the forgot-password screen. With the tenant's `visible` list empty (the default) it answers from configuration alone and never looks the account up. Otherwise it returns the channels the user can pick, with masked destinations.",
34100
+ "requestBody": {
34101
+ "required": true,
34102
+ "content": {
34103
+ "application/json": {
34104
+ "schema": {
34105
+ "type": "object",
34106
+ "required": [
34107
+ "email"
34108
+ ],
34109
+ "properties": {
34110
+ "email": {
34111
+ "type": "string"
34112
+ }
34113
+ },
34114
+ "additionalProperties": false
34115
+ }
34116
+ }
34117
+ }
34118
+ },
34119
+ "responses": {
34120
+ "200": {
34121
+ "description": "Default Response",
34122
+ "content": {
34123
+ "application/json": {
34124
+ "schema": {
34125
+ "type": "object",
34126
+ "required": [
34127
+ "picker",
34128
+ "default",
34129
+ "channels"
34130
+ ],
34131
+ "properties": {
34132
+ "picker": {
34133
+ "type": "boolean",
34134
+ "description": "Whether the screen should offer a choice. False when the tenant keeps `visible` empty — then nothing here depends on the account existing."
34135
+ },
34136
+ "default": {
34137
+ "anyOf": [
34138
+ {
34139
+ "type": "string",
34140
+ "enum": [
34141
+ "email"
34142
+ ]
34143
+ },
34144
+ {
34145
+ "type": "string",
34146
+ "enum": [
34147
+ "sms"
34148
+ ]
34149
+ },
34150
+ {
34151
+ "type": "string",
34152
+ "enum": [
34153
+ "whatsapp"
34154
+ ]
34155
+ },
34156
+ {
34157
+ "type": "string",
34158
+ "enum": [
34159
+ "factor"
34160
+ ]
34161
+ }
34162
+ ]
34163
+ },
34164
+ "channels": {
34165
+ "type": "array",
34166
+ "items": {
34167
+ "type": "object",
34168
+ "required": [
34169
+ "channel"
34170
+ ],
34171
+ "properties": {
34172
+ "channel": {
34173
+ "anyOf": [
34174
+ {
34175
+ "type": "string",
34176
+ "enum": [
34177
+ "email"
34178
+ ]
34179
+ },
34180
+ {
34181
+ "type": "string",
34182
+ "enum": [
34183
+ "sms"
34184
+ ]
34185
+ },
34186
+ {
34187
+ "type": "string",
34188
+ "enum": [
34189
+ "whatsapp"
34190
+ ]
34191
+ },
34192
+ {
34193
+ "type": "string",
34194
+ "enum": [
34195
+ "factor"
34196
+ ]
34197
+ }
34198
+ ]
34199
+ },
34200
+ "destination_masked": {
34201
+ "type": "string"
34202
+ }
34203
+ }
34204
+ }
34205
+ }
34206
+ }
34207
+ }
34208
+ }
34209
+ }
34210
+ }
34211
+ }
34212
+ }
34213
+ },
33937
34214
  "/dbconnections/signup": {
33938
34215
  "post": {
33939
34216
  "operationId": "signup",