@naturali/cli 0.28.2 → 0.29.0

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.
Files changed (2) hide show
  1. package/dist/index.mjs +71 -1
  2. package/package.json +2 -2
package/dist/index.mjs CHANGED
@@ -14,7 +14,7 @@ var __exportAll = (all, no_symbols) => {
14
14
  };
15
15
  //#endregion
16
16
  //#region package.json
17
- var version = "0.28.2";
17
+ var version = "0.29.0";
18
18
  //#endregion
19
19
  //#region ../sdk/src/generated/core/bodySerializer.gen.ts
20
20
  const jsonBodySerializer = { bodySerializer: (body) => JSON.stringify(body, (_key, value) => typeof value === "bigint" ? value.toString() : value) };
@@ -798,6 +798,38 @@ var Auth = class {
798
798
  });
799
799
  }
800
800
  /**
801
+ * Email a sign-in code
802
+ *
803
+ * Emails a short numeric code to the address. Always responds 200 with the same body whether or not the address has an account, so it never leaks existence. A first-time address gets an account on its first successful verification, so this is both sign-up and log-in. Issuing a code invalidates any previous one for the same address.
804
+ *
805
+ */
806
+ static requestSignInCode(options) {
807
+ return (options.client ?? client).post({
808
+ url: "/v1/auth/code",
809
+ ...options,
810
+ headers: {
811
+ "Content-Type": "application/json",
812
+ ...options.headers
813
+ }
814
+ });
815
+ }
816
+ /**
817
+ * Redeem a sign-in code
818
+ *
819
+ * Exchanges an emailed code for a session, creating the account if the address is new. The code is single-use and short-lived. A code is destroyed after too many wrong guesses, since six digits is small enough to guess given unlimited attempts — the client must then request a new one rather than retry.
820
+ *
821
+ */
822
+ static verifySignInCode(options) {
823
+ return (options.client ?? client).post({
824
+ url: "/v1/auth/code/verify",
825
+ ...options,
826
+ headers: {
827
+ "Content-Type": "application/json",
828
+ ...options.headers
829
+ }
830
+ });
831
+ }
832
+ /**
801
833
  * Refresh a session
802
834
  *
803
835
  * Exchanges a valid refresh token for a new access JWT and a rotated refresh token. Refresh tokens are single-use; presenting a previously-rotated token is treated as reuse and revokes the whole session family (createRefreshRotation reuse detection).
@@ -2605,6 +2637,44 @@ const routes = {
2605
2637
  "in": "body"
2606
2638
  }]
2607
2639
  },
2640
+ "request-sign-in-code": {
2641
+ serviceClass: "Auth",
2642
+ operationId: "requestSignInCode",
2643
+ description: "Emails a short numeric code to the address. Always responds 200 with the same body whether or not the address has an account, so it never leaks existence. A first-time address gets an account on its first successful verification, so this is both sign-up and log-in. Issuing a code invalidates any previous one for the same address.",
2644
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/auth",
2645
+ httpMethod: "post",
2646
+ pathParams: [],
2647
+ queryParams: [],
2648
+ flags: [{
2649
+ "name": "email",
2650
+ "description": "",
2651
+ "required": true,
2652
+ "type": "string",
2653
+ "in": "body"
2654
+ }]
2655
+ },
2656
+ "verify-sign-in-code": {
2657
+ serviceClass: "Auth",
2658
+ operationId: "verifySignInCode",
2659
+ description: "Exchanges an emailed code for a session, creating the account if the address is new. The code is single-use and short-lived. A code is destroyed after too many wrong guesses, since six digits is small enough to guess given unlimited attempts — the client must then request a new one rather than retry.",
2660
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/auth",
2661
+ httpMethod: "post",
2662
+ pathParams: [],
2663
+ queryParams: [],
2664
+ flags: [{
2665
+ "name": "email",
2666
+ "description": "",
2667
+ "required": true,
2668
+ "type": "string",
2669
+ "in": "body"
2670
+ }, {
2671
+ "name": "code",
2672
+ "description": "The code from the email, as sent — digits only.",
2673
+ "required": true,
2674
+ "type": "string",
2675
+ "in": "body"
2676
+ }]
2677
+ },
2608
2678
  "refresh-session": {
2609
2679
  serviceClass: "Auth",
2610
2680
  operationId: "refreshSession",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturali/cli",
3
- "version": "0.28.2",
3
+ "version": "0.29.0",
4
4
  "description": "Command-line interface for the naturali.ai API, generated from its OpenAPI specs",
5
5
  "type": "module",
6
6
  "bin": {
@@ -30,7 +30,7 @@
30
30
  "tsx": "^4.23.1",
31
31
  "typescript": "~6.0.3",
32
32
  "vitest": "^4.1.10",
33
- "@naturali/sdk": "0.28.2"
33
+ "@naturali/sdk": "0.29.0"
34
34
  },
35
35
  "scripts": {
36
36
  "generate": "tsx scripts/generate.ts",