@naturali/cli 0.29.1 → 0.31.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.
- package/dist/index.mjs +5 -168
- 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.
|
|
17
|
+
var version = "0.31.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) };
|
|
@@ -766,37 +766,6 @@ var ApiKeys = class {
|
|
|
766
766
|
}
|
|
767
767
|
};
|
|
768
768
|
var Auth = class {
|
|
769
|
-
/**
|
|
770
|
-
* Create an account
|
|
771
|
-
*
|
|
772
|
-
* Creates a user and opens a session. A verification email is sent separately; unverified accounts may be limited until verified.
|
|
773
|
-
*
|
|
774
|
-
*/
|
|
775
|
-
static signup(options) {
|
|
776
|
-
return (options.client ?? client).post({
|
|
777
|
-
url: "/v1/auth/signup",
|
|
778
|
-
...options,
|
|
779
|
-
headers: {
|
|
780
|
-
"Content-Type": "application/json",
|
|
781
|
-
...options.headers
|
|
782
|
-
}
|
|
783
|
-
});
|
|
784
|
-
}
|
|
785
|
-
/**
|
|
786
|
-
* Log in
|
|
787
|
-
*
|
|
788
|
-
* Exchanges email + password for an access JWT and a refresh token.
|
|
789
|
-
*/
|
|
790
|
-
static login(options) {
|
|
791
|
-
return (options.client ?? client).post({
|
|
792
|
-
url: "/v1/auth/login",
|
|
793
|
-
...options,
|
|
794
|
-
headers: {
|
|
795
|
-
"Content-Type": "application/json",
|
|
796
|
-
...options.headers
|
|
797
|
-
}
|
|
798
|
-
});
|
|
799
|
-
}
|
|
800
769
|
/**
|
|
801
770
|
* Email a sign-in code
|
|
802
771
|
*
|
|
@@ -832,7 +801,7 @@ var Auth = class {
|
|
|
832
801
|
/**
|
|
833
802
|
* Refresh a session
|
|
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).
|
|
804
|
+
* Exchanges a valid refresh token for a new access JWT and a rotated refresh token, taken from the body or from the `refresh_token` cookie set at sign-in — a browser sends an empty body and the cookie carries the credential. Refresh tokens are single-use; presenting a previously-rotated token is treated as reuse and revokes the whole session family (createRefreshRotation reuse detection), except within a few seconds of the rotation, where it is treated as two tabs racing on one cookie and rotated again.
|
|
836
805
|
*
|
|
837
806
|
*/
|
|
838
807
|
static refreshSession(options) {
|
|
@@ -848,7 +817,7 @@ var Auth = class {
|
|
|
848
817
|
/**
|
|
849
818
|
* Log out
|
|
850
819
|
*
|
|
851
|
-
* Revokes the current refresh token (and its rotation family). Pass `all: true` to revoke every active session for the user.
|
|
820
|
+
* Revokes the current refresh token (and its rotation family) and clears the `refresh_token` cookie. Pass `all: true` to revoke every active session for the user.
|
|
852
821
|
*
|
|
853
822
|
*/
|
|
854
823
|
static logout(options) {
|
|
@@ -862,52 +831,6 @@ var Auth = class {
|
|
|
862
831
|
});
|
|
863
832
|
}
|
|
864
833
|
/**
|
|
865
|
-
* Request a password reset
|
|
866
|
-
*
|
|
867
|
-
* Sends a password-reset email if the address has an account. Always responds 202 so account existence is never leaked.
|
|
868
|
-
*
|
|
869
|
-
*/
|
|
870
|
-
static requestPasswordReset(options) {
|
|
871
|
-
return (options.client ?? client).post({
|
|
872
|
-
url: "/v1/auth/password/reset-request",
|
|
873
|
-
...options,
|
|
874
|
-
headers: {
|
|
875
|
-
"Content-Type": "application/json",
|
|
876
|
-
...options.headers
|
|
877
|
-
}
|
|
878
|
-
});
|
|
879
|
-
}
|
|
880
|
-
/**
|
|
881
|
-
* Complete a password reset
|
|
882
|
-
*
|
|
883
|
-
* Sets a new password using a valid one-time reset token, then revokes existing sessions.
|
|
884
|
-
*/
|
|
885
|
-
static confirmPasswordReset(options) {
|
|
886
|
-
return (options.client ?? client).post({
|
|
887
|
-
url: "/v1/auth/password/reset",
|
|
888
|
-
...options,
|
|
889
|
-
headers: {
|
|
890
|
-
"Content-Type": "application/json",
|
|
891
|
-
...options.headers
|
|
892
|
-
}
|
|
893
|
-
});
|
|
894
|
-
}
|
|
895
|
-
/**
|
|
896
|
-
* Verify an email address
|
|
897
|
-
*
|
|
898
|
-
* Confirms an email address using a one-time verification token.
|
|
899
|
-
*/
|
|
900
|
-
static verifyEmail(options) {
|
|
901
|
-
return (options.client ?? client).post({
|
|
902
|
-
url: "/v1/auth/verify-email",
|
|
903
|
-
...options,
|
|
904
|
-
headers: {
|
|
905
|
-
"Content-Type": "application/json",
|
|
906
|
-
...options.headers
|
|
907
|
-
}
|
|
908
|
-
});
|
|
909
|
-
}
|
|
910
|
-
/**
|
|
911
834
|
* Get the current identity
|
|
912
835
|
*
|
|
913
836
|
* Returns the user behind the presented access token.
|
|
@@ -2605,38 +2528,6 @@ const routes = {
|
|
|
2605
2528
|
"in": "path"
|
|
2606
2529
|
}]
|
|
2607
2530
|
},
|
|
2608
|
-
"signup": {
|
|
2609
|
-
serviceClass: "Auth",
|
|
2610
|
-
operationId: "signup",
|
|
2611
|
-
description: "Creates a user and opens a session. A verification email is sent separately; unverified accounts may be limited until verified.",
|
|
2612
|
-
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/auth",
|
|
2613
|
-
httpMethod: "post",
|
|
2614
|
-
pathParams: [],
|
|
2615
|
-
queryParams: [],
|
|
2616
|
-
flags: []
|
|
2617
|
-
},
|
|
2618
|
-
"login": {
|
|
2619
|
-
serviceClass: "Auth",
|
|
2620
|
-
operationId: "login",
|
|
2621
|
-
description: "Exchanges email + password for an access JWT and a refresh token.",
|
|
2622
|
-
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/auth",
|
|
2623
|
-
httpMethod: "post",
|
|
2624
|
-
pathParams: [],
|
|
2625
|
-
queryParams: [],
|
|
2626
|
-
flags: [{
|
|
2627
|
-
"name": "email",
|
|
2628
|
-
"description": "",
|
|
2629
|
-
"required": true,
|
|
2630
|
-
"type": "string",
|
|
2631
|
-
"in": "body"
|
|
2632
|
-
}, {
|
|
2633
|
-
"name": "password",
|
|
2634
|
-
"description": "",
|
|
2635
|
-
"required": true,
|
|
2636
|
-
"type": "string",
|
|
2637
|
-
"in": "body"
|
|
2638
|
-
}]
|
|
2639
|
-
},
|
|
2640
2531
|
"request-sign-in-code": {
|
|
2641
2532
|
serviceClass: "Auth",
|
|
2642
2533
|
operationId: "requestSignInCode",
|
|
@@ -2678,7 +2569,7 @@ const routes = {
|
|
|
2678
2569
|
"refresh-session": {
|
|
2679
2570
|
serviceClass: "Auth",
|
|
2680
2571
|
operationId: "refreshSession",
|
|
2681
|
-
description: "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).",
|
|
2572
|
+
description: "Exchanges a valid refresh token for a new access JWT and a rotated refresh token, taken from the body or from the `refresh_token` cookie set at sign-in — a browser sends an empty body and the cookie carries the credential. Refresh tokens are single-use; presenting a previously-rotated token is treated as reuse and revokes the whole session family (createRefreshRotation reuse detection), except within a few seconds of the rotation, where it is treated as two tabs racing on one cookie and rotated again.",
|
|
2682
2573
|
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/auth",
|
|
2683
2574
|
httpMethod: "post",
|
|
2684
2575
|
pathParams: [],
|
|
@@ -2694,7 +2585,7 @@ const routes = {
|
|
|
2694
2585
|
"logout": {
|
|
2695
2586
|
serviceClass: "Auth",
|
|
2696
2587
|
operationId: "logout",
|
|
2697
|
-
description: "Revokes the current refresh token (and its rotation family). Pass `all: true` to revoke every active session for the user.",
|
|
2588
|
+
description: "Revokes the current refresh token (and its rotation family) and clears the `refresh_token` cookie. Pass `all: true` to revoke every active session for the user.",
|
|
2698
2589
|
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/auth",
|
|
2699
2590
|
httpMethod: "post",
|
|
2700
2591
|
pathParams: [],
|
|
@@ -2713,60 +2604,6 @@ const routes = {
|
|
|
2713
2604
|
"in": "body"
|
|
2714
2605
|
}]
|
|
2715
2606
|
},
|
|
2716
|
-
"request-password-reset": {
|
|
2717
|
-
serviceClass: "Auth",
|
|
2718
|
-
operationId: "requestPasswordReset",
|
|
2719
|
-
description: "Sends a password-reset email if the address has an account. Always responds 202 so account existence is never leaked.",
|
|
2720
|
-
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/auth",
|
|
2721
|
-
httpMethod: "post",
|
|
2722
|
-
pathParams: [],
|
|
2723
|
-
queryParams: [],
|
|
2724
|
-
flags: [{
|
|
2725
|
-
"name": "email",
|
|
2726
|
-
"description": "",
|
|
2727
|
-
"required": true,
|
|
2728
|
-
"type": "string",
|
|
2729
|
-
"in": "body"
|
|
2730
|
-
}]
|
|
2731
|
-
},
|
|
2732
|
-
"confirm-password-reset": {
|
|
2733
|
-
serviceClass: "Auth",
|
|
2734
|
-
operationId: "confirmPasswordReset",
|
|
2735
|
-
description: "Sets a new password using a valid one-time reset token, then revokes existing sessions.",
|
|
2736
|
-
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/auth",
|
|
2737
|
-
httpMethod: "post",
|
|
2738
|
-
pathParams: [],
|
|
2739
|
-
queryParams: [],
|
|
2740
|
-
flags: [{
|
|
2741
|
-
"name": "token",
|
|
2742
|
-
"description": "One-time reset token from the email link.",
|
|
2743
|
-
"required": true,
|
|
2744
|
-
"type": "string",
|
|
2745
|
-
"in": "body"
|
|
2746
|
-
}, {
|
|
2747
|
-
"name": "new_password",
|
|
2748
|
-
"description": "",
|
|
2749
|
-
"required": true,
|
|
2750
|
-
"type": "string",
|
|
2751
|
-
"in": "body"
|
|
2752
|
-
}]
|
|
2753
|
-
},
|
|
2754
|
-
"verify-email": {
|
|
2755
|
-
serviceClass: "Auth",
|
|
2756
|
-
operationId: "verifyEmail",
|
|
2757
|
-
description: "Confirms an email address using a one-time verification token.",
|
|
2758
|
-
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/auth",
|
|
2759
|
-
httpMethod: "post",
|
|
2760
|
-
pathParams: [],
|
|
2761
|
-
queryParams: [],
|
|
2762
|
-
flags: [{
|
|
2763
|
-
"name": "token",
|
|
2764
|
-
"description": "One-time verification token from the email link.",
|
|
2765
|
-
"required": true,
|
|
2766
|
-
"type": "string",
|
|
2767
|
-
"in": "body"
|
|
2768
|
-
}]
|
|
2769
|
-
},
|
|
2770
2607
|
"get-current-user": {
|
|
2771
2608
|
serviceClass: "Auth",
|
|
2772
2609
|
operationId: "getCurrentUser",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@naturali/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.31.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.
|
|
33
|
+
"@naturali/sdk": "0.31.0"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"generate": "tsx scripts/generate.ts",
|