@stackframe/stack-shared 2.7.27 → 2.7.28
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 +6 -0
- package/dist/interface/clientInterface.d.ts +1 -0
- package/dist/interface/clientInterface.js +1 -0
- package/dist/interface/crud/emails.d.ts +35 -5
- package/dist/interface/crud/emails.js +3 -2
- package/dist/interface/crud/projects.d.ts +16 -0
- package/dist/interface/crud/projects.js +1 -0
- package/dist/interface/serverInterface.d.ts +4 -0
- package/dist/interface/serverInterface.js +15 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,30 +4,60 @@ export declare const sentEmailReadSchema: import("yup").ObjectSchema<{
|
|
|
4
4
|
subject: string;
|
|
5
5
|
sent_at_millis: number;
|
|
6
6
|
to: string[] | undefined;
|
|
7
|
-
sender_config: {
|
|
7
|
+
sender_config: {
|
|
8
|
+
host?: string | undefined;
|
|
9
|
+
port?: number | undefined;
|
|
10
|
+
username?: string | undefined;
|
|
11
|
+
sender_name?: string | undefined;
|
|
12
|
+
sender_email?: string | undefined;
|
|
13
|
+
type: "shared" | "standard";
|
|
14
|
+
};
|
|
8
15
|
error: {} | null | undefined;
|
|
9
16
|
}, import("yup").AnyObject, {
|
|
10
17
|
id: undefined;
|
|
11
18
|
subject: undefined;
|
|
12
19
|
sent_at_millis: undefined;
|
|
13
20
|
to: undefined;
|
|
14
|
-
sender_config:
|
|
21
|
+
sender_config: {
|
|
22
|
+
type: undefined;
|
|
23
|
+
host: undefined;
|
|
24
|
+
port: undefined;
|
|
25
|
+
username: undefined;
|
|
26
|
+
password: undefined;
|
|
27
|
+
sender_name: undefined;
|
|
28
|
+
sender_email: undefined;
|
|
29
|
+
};
|
|
15
30
|
error: undefined;
|
|
16
31
|
}, "">;
|
|
17
32
|
export declare const internalEmailsCrud: import("../../crud").CrudSchemaFromOptions<{
|
|
18
|
-
|
|
33
|
+
adminReadSchema: import("yup").ObjectSchema<{
|
|
19
34
|
id: string;
|
|
20
35
|
subject: string;
|
|
21
36
|
sent_at_millis: number;
|
|
22
37
|
to: string[] | undefined;
|
|
23
|
-
sender_config: {
|
|
38
|
+
sender_config: {
|
|
39
|
+
host?: string | undefined;
|
|
40
|
+
port?: number | undefined;
|
|
41
|
+
username?: string | undefined;
|
|
42
|
+
sender_name?: string | undefined;
|
|
43
|
+
sender_email?: string | undefined;
|
|
44
|
+
type: "shared" | "standard";
|
|
45
|
+
};
|
|
24
46
|
error: {} | null | undefined;
|
|
25
47
|
}, import("yup").AnyObject, {
|
|
26
48
|
id: undefined;
|
|
27
49
|
subject: undefined;
|
|
28
50
|
sent_at_millis: undefined;
|
|
29
51
|
to: undefined;
|
|
30
|
-
sender_config:
|
|
52
|
+
sender_config: {
|
|
53
|
+
type: undefined;
|
|
54
|
+
host: undefined;
|
|
55
|
+
port: undefined;
|
|
56
|
+
username: undefined;
|
|
57
|
+
password: undefined;
|
|
58
|
+
sender_name: undefined;
|
|
59
|
+
sender_email: undefined;
|
|
60
|
+
};
|
|
31
61
|
error: undefined;
|
|
32
62
|
}, "">;
|
|
33
63
|
}>;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { createCrud } from "../../crud";
|
|
2
2
|
import * as fieldSchema from "../../schema-fields";
|
|
3
|
+
import { emailConfigWithoutPasswordSchema } from "./projects";
|
|
3
4
|
export const sentEmailReadSchema = fieldSchema.yupObject({
|
|
4
5
|
id: fieldSchema.yupString().defined(),
|
|
5
6
|
subject: fieldSchema.yupString().defined(),
|
|
6
7
|
sent_at_millis: fieldSchema.yupNumber().defined(),
|
|
7
8
|
to: fieldSchema.yupArray(fieldSchema.yupString().defined()),
|
|
8
|
-
sender_config:
|
|
9
|
+
sender_config: emailConfigWithoutPasswordSchema.defined(),
|
|
9
10
|
error: fieldSchema.yupMixed().nullable().optional(),
|
|
10
11
|
}).defined();
|
|
11
12
|
export const internalEmailsCrud = createCrud({
|
|
12
|
-
|
|
13
|
+
adminReadSchema: sentEmailReadSchema,
|
|
13
14
|
});
|
|
@@ -16,6 +16,22 @@ export declare const emailConfigSchema: import("yup").ObjectSchema<{
|
|
|
16
16
|
sender_name: undefined;
|
|
17
17
|
sender_email: undefined;
|
|
18
18
|
}, "">;
|
|
19
|
+
export declare const emailConfigWithoutPasswordSchema: import("yup").ObjectSchema<{
|
|
20
|
+
type: "shared" | "standard";
|
|
21
|
+
host: string | undefined;
|
|
22
|
+
port: number | undefined;
|
|
23
|
+
username: string | undefined;
|
|
24
|
+
sender_name: string | undefined;
|
|
25
|
+
sender_email: string | undefined;
|
|
26
|
+
}, import("yup").AnyObject, {
|
|
27
|
+
type: undefined;
|
|
28
|
+
host: undefined;
|
|
29
|
+
port: undefined;
|
|
30
|
+
username: undefined;
|
|
31
|
+
password: undefined;
|
|
32
|
+
sender_name: undefined;
|
|
33
|
+
sender_email: undefined;
|
|
34
|
+
}, "">;
|
|
19
35
|
export declare const projectsCrudAdminReadSchema: import("yup").ObjectSchema<{
|
|
20
36
|
id: string;
|
|
21
37
|
display_name: string;
|
|
@@ -44,6 +44,7 @@ export const emailConfigSchema = yupObject({
|
|
|
44
44
|
type: 'standard',
|
|
45
45
|
}),
|
|
46
46
|
});
|
|
47
|
+
export const emailConfigWithoutPasswordSchema = emailConfigSchema.pick(['type', 'host', 'port', 'username', 'sender_name', 'sender_email']);
|
|
47
48
|
const domainSchema = yupObject({
|
|
48
49
|
domain: schemaFields.urlSchema.defined()
|
|
49
50
|
.matches(/^https?:\/\//, 'URL must start with http:// or https://')
|
|
@@ -103,4 +103,8 @@ export declare class StackServerInterface extends StackClientInterface {
|
|
|
103
103
|
teamId: string;
|
|
104
104
|
callbackUrl: string;
|
|
105
105
|
}): Promise<void>;
|
|
106
|
+
updatePassword(options: {
|
|
107
|
+
oldPassword: string;
|
|
108
|
+
newPassword: string;
|
|
109
|
+
}): Promise<KnownErrors["PasswordConfirmationMismatch"] | KnownErrors["PasswordRequirementsNotMet"] | undefined>;
|
|
106
110
|
}
|
|
@@ -311,4 +311,19 @@ export class StackServerInterface extends StackClientInterface {
|
|
|
311
311
|
}),
|
|
312
312
|
}, null);
|
|
313
313
|
}
|
|
314
|
+
async updatePassword(options) {
|
|
315
|
+
const res = await this.sendServerRequestAndCatchKnownError("/auth/password/update", {
|
|
316
|
+
method: "POST",
|
|
317
|
+
headers: {
|
|
318
|
+
"Content-Type": "application/json"
|
|
319
|
+
},
|
|
320
|
+
body: JSON.stringify({
|
|
321
|
+
old_password: options.oldPassword,
|
|
322
|
+
new_password: options.newPassword,
|
|
323
|
+
}),
|
|
324
|
+
}, null, [KnownErrors.PasswordConfirmationMismatch, KnownErrors.PasswordRequirementsNotMet]);
|
|
325
|
+
if (res.status === "error") {
|
|
326
|
+
return res.error;
|
|
327
|
+
}
|
|
328
|
+
}
|
|
314
329
|
}
|