@stackframe/stack-shared 2.6.20 → 2.6.23
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/CHANGELOG.md +24 -0
- package/dist/hooks/use-hash.d.ts +1 -1
- package/dist/hooks/use-hash.js +7 -7
- package/dist/interface/clientInterface.d.ts +1 -1
- package/dist/interface/serverInterface.d.ts +5 -0
- package/dist/interface/serverInterface.js +13 -0
- package/dist/known-errors.js +1 -1
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @stackframe/stack-shared
|
|
2
2
|
|
|
3
|
+
## 2.6.23
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Bugfixes
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @stackframe/stack-sc@2.6.23
|
|
10
|
+
|
|
11
|
+
## 2.6.22
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Bugfixes
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
- @stackframe/stack-sc@2.6.22
|
|
18
|
+
|
|
19
|
+
## 2.6.21
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- Fixed inviteUser
|
|
24
|
+
- Updated dependencies
|
|
25
|
+
- @stackframe/stack-sc@2.6.21
|
|
26
|
+
|
|
3
27
|
## 2.6.20
|
|
4
28
|
|
|
5
29
|
### Patch Changes
|
package/dist/hooks/use-hash.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useHash: () => string
|
|
1
|
+
export declare const useHash: () => string;
|
package/dist/hooks/use-hash.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
const getHash = () => typeof window === "undefined" ? undefined : window.location.hash.substring(1);
|
|
1
|
+
import { useSyncExternalStore } from "react";
|
|
2
|
+
import { suspendIfSsr } from "../utils/react";
|
|
4
3
|
export const useHash = () => {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
suspendIfSsr("useHash");
|
|
5
|
+
return useSyncExternalStore((onChange) => {
|
|
6
|
+
const interval = setInterval(() => onChange(), 10);
|
|
7
|
+
return () => clearInterval(interval);
|
|
8
|
+
}, () => window.location.hash.substring(1));
|
|
9
9
|
};
|
|
@@ -90,7 +90,7 @@ export declare class StackClientInterface {
|
|
|
90
90
|
email: string;
|
|
91
91
|
teamId: string;
|
|
92
92
|
callbackUrl: string;
|
|
93
|
-
session: InternalSession
|
|
93
|
+
session: InternalSession;
|
|
94
94
|
}): Promise<void>;
|
|
95
95
|
acceptTeamInvitation<T extends 'use' | 'details' | 'check'>(options: {
|
|
96
96
|
code: string;
|
|
@@ -90,4 +90,9 @@ export declare class StackServerInterface extends StackClientInterface {
|
|
|
90
90
|
deleteServerContactChannel(userId: string, contactChannelId: string): Promise<void>;
|
|
91
91
|
listServerContactChannels(userId: string): Promise<ContactChannelsCrud['Server']['Read'][]>;
|
|
92
92
|
sendServerContactChannelVerificationEmail(userId: string, contactChannelId: string, callbackUrl: string): Promise<void>;
|
|
93
|
+
sendServerTeamInvitation(options: {
|
|
94
|
+
email: string;
|
|
95
|
+
teamId: string;
|
|
96
|
+
callbackUrl: string;
|
|
97
|
+
}): Promise<void>;
|
|
93
98
|
}
|
|
@@ -276,4 +276,17 @@ export class StackServerInterface extends StackClientInterface {
|
|
|
276
276
|
body: JSON.stringify({ callback_url: callbackUrl }),
|
|
277
277
|
}, null);
|
|
278
278
|
}
|
|
279
|
+
async sendServerTeamInvitation(options) {
|
|
280
|
+
await this.sendServerRequest("/team-invitations/send-code", {
|
|
281
|
+
method: "POST",
|
|
282
|
+
headers: {
|
|
283
|
+
"Content-Type": "application/json"
|
|
284
|
+
},
|
|
285
|
+
body: JSON.stringify({
|
|
286
|
+
email: options.email,
|
|
287
|
+
team_id: options.teamId,
|
|
288
|
+
callback_url: options.callbackUrl,
|
|
289
|
+
}),
|
|
290
|
+
}, null);
|
|
291
|
+
}
|
|
279
292
|
}
|
package/dist/known-errors.js
CHANGED
|
@@ -338,7 +338,7 @@ const EmailPasswordMismatch = createKnownErrorConstructor(KnownError, "EMAIL_PAS
|
|
|
338
338
|
], () => []);
|
|
339
339
|
const RedirectUrlNotWhitelisted = createKnownErrorConstructor(KnownError, "REDIRECT_URL_NOT_WHITELISTED", () => [
|
|
340
340
|
400,
|
|
341
|
-
"Redirect URL not whitelisted.",
|
|
341
|
+
"Redirect URL not whitelisted. Did you forget to add this domain to the trusted domains list on the Stack Auth dashboard?",
|
|
342
342
|
], () => []);
|
|
343
343
|
const PasswordRequirementsNotMet = createKnownErrorConstructor(KnownError, "PASSWORD_REQUIREMENTS_NOT_MET", "inherit", "inherit");
|
|
344
344
|
const PasswordTooShort = createKnownErrorConstructor(PasswordRequirementsNotMet, "PASSWORD_TOO_SHORT", (minLength) => [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stackframe/stack-shared",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.23",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -20,11 +20,11 @@
|
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
|
-
"react": ">=18.2",
|
|
24
|
-
"react-dom": ">=18.2",
|
|
25
|
-
"@types/react": ">=18.2",
|
|
26
|
-
"@types/react-dom": ">=18.2",
|
|
27
|
-
"next": ">=14.1.0",
|
|
23
|
+
"react": ">=18.2 || >=19.0.0-rc.0",
|
|
24
|
+
"react-dom": ">=18.2 || >=19.0.0-rc.0",
|
|
25
|
+
"@types/react": ">=18.2 || >=19.0.0-rc.0",
|
|
26
|
+
"@types/react-dom": ">=18.2 || >=19.0.0-rc.0",
|
|
27
|
+
"next": ">=14.1.0 || >=15.0.0-rc.0",
|
|
28
28
|
"yup": "^1.4.0"
|
|
29
29
|
},
|
|
30
30
|
"peerDependenciesMeta": {
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"oauth4webapi": "^2.10.3",
|
|
50
50
|
"semver": "^7.6.3",
|
|
51
51
|
"uuid": "^9.0.1",
|
|
52
|
-
"@stackframe/stack-sc": "2.6.
|
|
52
|
+
"@stackframe/stack-sc": "2.6.23"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@simplewebauthn/types": "^11.0.0",
|