@logto/schemas 1.23.1 → 1.24.1
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/alterations/1.24.1-1738828268-add-email-templates-table.ts +40 -0
- package/alterations-js/1.24.1-1738828268-add-email-templates-table.js +34 -0
- package/lib/db-entries/email-template.d.ts +24 -0
- package/lib/db-entries/email-template.js +42 -0
- package/lib/db-entries/index.d.ts +1 -0
- package/lib/db-entries/index.js +1 -0
- package/lib/foundations/jsonb-types/email-templates.d.ts +48 -0
- package/lib/foundations/jsonb-types/email-templates.js +9 -0
- package/lib/foundations/jsonb-types/index.d.ts +1 -0
- package/lib/foundations/jsonb-types/index.js +1 -0
- package/lib/foundations/jsonb-types/saml-application-configs.d.ts +2 -2
- package/lib/foundations/jsonb-types/saml-application-configs.js +2 -2
- package/lib/foundations/jsonb-types/saml-application-sessions.d.ts +6 -6
- package/lib/foundations/jsonb-types/saml-application-sessions.js +1 -1
- package/lib/types/saml-application.d.ts +7 -7
- package/package.json +9 -9
- package/tables/email_templates.sql +18 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { sql } from '@silverhand/slonik';
|
|
2
|
+
|
|
3
|
+
import type { AlterationScript } from '../lib/types/alteration.js';
|
|
4
|
+
|
|
5
|
+
import { applyTableRls, dropTableRls } from './utils/1704934999-tables.js';
|
|
6
|
+
|
|
7
|
+
const alteration: AlterationScript = {
|
|
8
|
+
up: async (pool) => {
|
|
9
|
+
await pool.query(sql`
|
|
10
|
+
create table email_templates (
|
|
11
|
+
tenant_id varchar(21) not null
|
|
12
|
+
references tenants (id) on update cascade on delete cascade,
|
|
13
|
+
id varchar(21) not null,
|
|
14
|
+
language_tag varchar(16) not null,
|
|
15
|
+
template_type varchar(64) not null,
|
|
16
|
+
details jsonb not null,
|
|
17
|
+
created_at timestamptz not null default now(),
|
|
18
|
+
primary key (tenant_id, id),
|
|
19
|
+
constraint email_templates__tenant_id__language_tag__template_type
|
|
20
|
+
unique (tenant_id, language_tag, template_type)
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
create index email_templates__tenant_id__language_tag
|
|
24
|
+
on email_templates (tenant_id, language_tag);
|
|
25
|
+
|
|
26
|
+
create index email_templates__tenant_id__template_type
|
|
27
|
+
on email_templates (tenant_id, template_type);
|
|
28
|
+
`);
|
|
29
|
+
|
|
30
|
+
await applyTableRls(pool, 'email_templates');
|
|
31
|
+
},
|
|
32
|
+
down: async (pool) => {
|
|
33
|
+
await dropTableRls(pool, 'email_templates');
|
|
34
|
+
await pool.query(sql`
|
|
35
|
+
drop table if exists email_templates;
|
|
36
|
+
`);
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export default alteration;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { sql } from '@silverhand/slonik';
|
|
2
|
+
import { applyTableRls, dropTableRls } from './utils/1704934999-tables.js';
|
|
3
|
+
const alteration = {
|
|
4
|
+
up: async (pool) => {
|
|
5
|
+
await pool.query(sql `
|
|
6
|
+
create table email_templates (
|
|
7
|
+
tenant_id varchar(21) not null
|
|
8
|
+
references tenants (id) on update cascade on delete cascade,
|
|
9
|
+
id varchar(21) not null,
|
|
10
|
+
language_tag varchar(16) not null,
|
|
11
|
+
template_type varchar(64) not null,
|
|
12
|
+
details jsonb not null,
|
|
13
|
+
created_at timestamptz not null default now(),
|
|
14
|
+
primary key (tenant_id, id),
|
|
15
|
+
constraint email_templates__tenant_id__language_tag__template_type
|
|
16
|
+
unique (tenant_id, language_tag, template_type)
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
create index email_templates__tenant_id__language_tag
|
|
20
|
+
on email_templates (tenant_id, language_tag);
|
|
21
|
+
|
|
22
|
+
create index email_templates__tenant_id__template_type
|
|
23
|
+
on email_templates (tenant_id, template_type);
|
|
24
|
+
`);
|
|
25
|
+
await applyTableRls(pool, 'email_templates');
|
|
26
|
+
},
|
|
27
|
+
down: async (pool) => {
|
|
28
|
+
await dropTableRls(pool, 'email_templates');
|
|
29
|
+
await pool.query(sql `
|
|
30
|
+
drop table if exists email_templates;
|
|
31
|
+
`);
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
export default alteration;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { TemplateType, EmailTemplateDetails, GeneratedSchema } from './../foundations/index.js';
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* @remarks This is a type for database creation.
|
|
5
|
+
* @see {@link EmailTemplate} for the original type.
|
|
6
|
+
*/
|
|
7
|
+
export type CreateEmailTemplate = {
|
|
8
|
+
tenantId?: string;
|
|
9
|
+
id: string;
|
|
10
|
+
languageTag: string;
|
|
11
|
+
templateType: TemplateType;
|
|
12
|
+
details: EmailTemplateDetails;
|
|
13
|
+
createdAt?: number;
|
|
14
|
+
};
|
|
15
|
+
export type EmailTemplate = {
|
|
16
|
+
tenantId: string;
|
|
17
|
+
id: string;
|
|
18
|
+
languageTag: string;
|
|
19
|
+
templateType: TemplateType;
|
|
20
|
+
details: EmailTemplateDetails;
|
|
21
|
+
createdAt: number;
|
|
22
|
+
};
|
|
23
|
+
export type EmailTemplateKeys = 'tenantId' | 'id' | 'languageTag' | 'templateType' | 'details' | 'createdAt';
|
|
24
|
+
export declare const EmailTemplates: GeneratedSchema<EmailTemplateKeys, CreateEmailTemplate, EmailTemplate, 'email_templates', 'email_template'>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { templateTypeGuard, emailTemplateDetailsGuard } from './../foundations/index.js';
|
|
4
|
+
const createGuard = z.object({
|
|
5
|
+
tenantId: z.string().max(21).optional(),
|
|
6
|
+
id: z.string().min(1).max(21),
|
|
7
|
+
languageTag: z.string().min(1).max(16),
|
|
8
|
+
templateType: templateTypeGuard,
|
|
9
|
+
details: emailTemplateDetailsGuard,
|
|
10
|
+
createdAt: z.number().optional(),
|
|
11
|
+
});
|
|
12
|
+
const guard = z.object({
|
|
13
|
+
tenantId: z.string().max(21),
|
|
14
|
+
id: z.string().min(1).max(21),
|
|
15
|
+
languageTag: z.string().min(1).max(16),
|
|
16
|
+
templateType: templateTypeGuard,
|
|
17
|
+
details: emailTemplateDetailsGuard,
|
|
18
|
+
createdAt: z.number(),
|
|
19
|
+
});
|
|
20
|
+
export const EmailTemplates = Object.freeze({
|
|
21
|
+
table: 'email_templates',
|
|
22
|
+
tableSingular: 'email_template',
|
|
23
|
+
fields: {
|
|
24
|
+
tenantId: 'tenant_id',
|
|
25
|
+
id: 'id',
|
|
26
|
+
languageTag: 'language_tag',
|
|
27
|
+
templateType: 'template_type',
|
|
28
|
+
details: 'details',
|
|
29
|
+
createdAt: 'created_at',
|
|
30
|
+
},
|
|
31
|
+
fieldKeys: [
|
|
32
|
+
'tenantId',
|
|
33
|
+
'id',
|
|
34
|
+
'languageTag',
|
|
35
|
+
'templateType',
|
|
36
|
+
'details',
|
|
37
|
+
'createdAt',
|
|
38
|
+
],
|
|
39
|
+
createGuard,
|
|
40
|
+
guard,
|
|
41
|
+
updateGuard: guard.partial(),
|
|
42
|
+
});
|
|
@@ -18,6 +18,7 @@ export * from './custom-phrase.js';
|
|
|
18
18
|
export * from './daily-active-user.js';
|
|
19
19
|
export * from './daily-token-usage.js';
|
|
20
20
|
export * from './domain.js';
|
|
21
|
+
export * from './email-template.js';
|
|
21
22
|
export * from './hook.js';
|
|
22
23
|
export * from './idp-initiated-saml-sso-session.js';
|
|
23
24
|
export * from './log.js';
|
package/lib/db-entries/index.js
CHANGED
|
@@ -19,6 +19,7 @@ export * from './custom-phrase.js';
|
|
|
19
19
|
export * from './daily-active-user.js';
|
|
20
20
|
export * from './daily-token-usage.js';
|
|
21
21
|
export * from './domain.js';
|
|
22
|
+
export * from './email-template.js';
|
|
22
23
|
export * from './hook.js';
|
|
23
24
|
export * from './idp-initiated-saml-sso-session.js';
|
|
24
25
|
export * from './log.js';
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export { TemplateType, templateTypeGuard } from '@logto/connector-kit';
|
|
3
|
+
export type EmailTemplateDetails = {
|
|
4
|
+
subject: string;
|
|
5
|
+
content: string;
|
|
6
|
+
/**
|
|
7
|
+
* OPTIONAL: The content type of the email template.
|
|
8
|
+
*
|
|
9
|
+
* Some email clients may render email templates differently based on the content type. (e.g. Sendgrid, Mailgun)
|
|
10
|
+
* Use this field to specify the content type of the email template.
|
|
11
|
+
*/
|
|
12
|
+
contentType?: 'text/html' | 'text/plain';
|
|
13
|
+
/**
|
|
14
|
+
* OPTIONAL: Custom replyTo template.
|
|
15
|
+
*
|
|
16
|
+
* Based on the email client, the replyTo field may be used to customize the reply-to field of the email.
|
|
17
|
+
* @remarks
|
|
18
|
+
* The original reply email value can be found in the template variables.
|
|
19
|
+
*/
|
|
20
|
+
replyTo?: string;
|
|
21
|
+
/**
|
|
22
|
+
* OPTIONAL: Custom from template.
|
|
23
|
+
*
|
|
24
|
+
* Based on the email client, the sendFrom field may be used to customize the from field of the email.
|
|
25
|
+
* @remarks
|
|
26
|
+
* The sender email value can be found in the template variables.
|
|
27
|
+
*/
|
|
28
|
+
sendFrom?: string;
|
|
29
|
+
};
|
|
30
|
+
export declare const emailTemplateDetailsGuard: z.ZodObject<{
|
|
31
|
+
subject: z.ZodString;
|
|
32
|
+
content: z.ZodString;
|
|
33
|
+
contentType: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"text/html">, z.ZodLiteral<"text/plain">]>>;
|
|
34
|
+
replyTo: z.ZodOptional<z.ZodString>;
|
|
35
|
+
sendFrom: z.ZodOptional<z.ZodString>;
|
|
36
|
+
}, "strip", z.ZodTypeAny, {
|
|
37
|
+
subject: string;
|
|
38
|
+
content: string;
|
|
39
|
+
contentType?: "text/html" | "text/plain" | undefined;
|
|
40
|
+
replyTo?: string | undefined;
|
|
41
|
+
sendFrom?: string | undefined;
|
|
42
|
+
}, {
|
|
43
|
+
subject: string;
|
|
44
|
+
content: string;
|
|
45
|
+
contentType?: "text/html" | "text/plain" | undefined;
|
|
46
|
+
replyTo?: string | undefined;
|
|
47
|
+
sendFrom?: string | undefined;
|
|
48
|
+
}>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export { TemplateType, templateTypeGuard } from '@logto/connector-kit';
|
|
3
|
+
export const emailTemplateDetailsGuard = z.object({
|
|
4
|
+
subject: z.string(),
|
|
5
|
+
content: z.string(),
|
|
6
|
+
contentType: z.union([z.literal('text/html'), z.literal('text/plain')]).optional(),
|
|
7
|
+
replyTo: z.string().optional(),
|
|
8
|
+
sendFrom: z.string().optional(),
|
|
9
|
+
});
|
|
@@ -12,5 +12,6 @@ export * from './verification-records.js';
|
|
|
12
12
|
export * from './account-centers.js';
|
|
13
13
|
export * from './saml-application-configs.js';
|
|
14
14
|
export * from './saml-application-sessions.js';
|
|
15
|
+
export * from './email-templates.js';
|
|
15
16
|
export { configurableConnectorMetadataGuard, type ConfigurableConnectorMetadata, jsonGuard, jsonObjectGuard, } from '@logto/connector-kit';
|
|
16
17
|
export type { Json, JsonObject } from '@withtyped/server';
|
|
@@ -12,4 +12,5 @@ export * from './verification-records.js';
|
|
|
12
12
|
export * from './account-centers.js';
|
|
13
13
|
export * from './saml-application-configs.js';
|
|
14
14
|
export * from './saml-application-sessions.js';
|
|
15
|
+
export * from './email-templates.js';
|
|
15
16
|
export { configurableConnectorMetadataGuard, jsonGuard, jsonObjectGuard, } from '@logto/connector-kit';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type UserClaim } from '@logto/core-kit';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
export type SamlAttributeMapping = Partial<Record<UserClaim | '
|
|
4
|
-
export declare const samlAttributeMappingKeys: readonly ("name" | "
|
|
3
|
+
export type SamlAttributeMapping = Partial<Record<UserClaim | 'sub', string>>;
|
|
4
|
+
export declare const samlAttributeMappingKeys: readonly ("name" | "username" | "email" | "nickname" | "profile" | "website" | "gender" | "birthdate" | "zoneinfo" | "locale" | "address" | "given_name" | "family_name" | "middle_name" | "preferred_username" | "picture" | "email_verified" | "phone_number" | "phone_number_verified" | "updated_at" | "roles" | "organizations" | "organization_data" | "organization_roles" | "custom_data" | "identities" | "sso_identities" | "created_at" | "sub")[];
|
|
5
5
|
export declare const samlAttributeMappingGuard: z.ZodObject<{
|
|
6
6
|
[x: string]: z.ZodOptional<z.ZodString>;
|
|
7
7
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { userClaimsList } from '@logto/core-kit';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
export const samlAttributeMappingKeys = Object.freeze(['
|
|
3
|
+
export const samlAttributeMappingKeys = Object.freeze(['sub', ...userClaimsList]);
|
|
4
4
|
export const samlAttributeMappingGuard = z
|
|
5
5
|
.object(Object.fromEntries(samlAttributeMappingKeys.map((claim) => [claim, z.string()])))
|
|
6
6
|
.partial();
|
|
@@ -3,7 +3,7 @@ export type AuthRequestInfo = {
|
|
|
3
3
|
issuer: string;
|
|
4
4
|
request: {
|
|
5
5
|
id: string;
|
|
6
|
-
destination
|
|
6
|
+
destination?: string;
|
|
7
7
|
issueInstant: string;
|
|
8
8
|
assertionConsumerServiceUrl: string;
|
|
9
9
|
};
|
|
@@ -12,34 +12,34 @@ export declare const authRequestInfoGuard: z.ZodObject<{
|
|
|
12
12
|
issuer: z.ZodString;
|
|
13
13
|
request: z.ZodObject<{
|
|
14
14
|
id: z.ZodString;
|
|
15
|
-
destination: z.ZodString
|
|
15
|
+
destination: z.ZodOptional<z.ZodString>;
|
|
16
16
|
issueInstant: z.ZodString;
|
|
17
17
|
assertionConsumerServiceUrl: z.ZodString;
|
|
18
18
|
}, "strip", z.ZodTypeAny, {
|
|
19
19
|
id: string;
|
|
20
|
-
destination: string;
|
|
21
20
|
issueInstant: string;
|
|
22
21
|
assertionConsumerServiceUrl: string;
|
|
22
|
+
destination?: string | undefined;
|
|
23
23
|
}, {
|
|
24
24
|
id: string;
|
|
25
|
-
destination: string;
|
|
26
25
|
issueInstant: string;
|
|
27
26
|
assertionConsumerServiceUrl: string;
|
|
27
|
+
destination?: string | undefined;
|
|
28
28
|
}>;
|
|
29
29
|
}, "strip", z.ZodTypeAny, {
|
|
30
30
|
issuer: string;
|
|
31
31
|
request: {
|
|
32
32
|
id: string;
|
|
33
|
-
destination: string;
|
|
34
33
|
issueInstant: string;
|
|
35
34
|
assertionConsumerServiceUrl: string;
|
|
35
|
+
destination?: string | undefined;
|
|
36
36
|
};
|
|
37
37
|
}, {
|
|
38
38
|
issuer: string;
|
|
39
39
|
request: {
|
|
40
40
|
id: string;
|
|
41
|
-
destination: string;
|
|
42
41
|
issueInstant: string;
|
|
43
42
|
assertionConsumerServiceUrl: string;
|
|
43
|
+
destination?: string | undefined;
|
|
44
44
|
};
|
|
45
45
|
}>;
|
|
@@ -167,7 +167,7 @@ export declare const samlApplicationCreateGuard: z.ZodObject<z.objectUtil.extend
|
|
|
167
167
|
isThirdParty: z.ZodOptional<z.ZodType<boolean, z.ZodTypeDef, boolean>>;
|
|
168
168
|
createdAt: z.ZodOptional<z.ZodType<number, z.ZodTypeDef, number>>;
|
|
169
169
|
}, "type" | "name">>, "name" | "customData" | "description">, {
|
|
170
|
-
attributeMapping: z.ZodOptional<z.ZodType<Partial<Record<"name" | "
|
|
170
|
+
attributeMapping: z.ZodOptional<z.ZodType<Partial<Record<"name" | "username" | "email" | "nickname" | "profile" | "website" | "gender" | "birthdate" | "zoneinfo" | "locale" | "address" | "given_name" | "family_name" | "middle_name" | "preferred_username" | "picture" | "email_verified" | "phone_number" | "phone_number_verified" | "updated_at" | "roles" | "organizations" | "organization_data" | "organization_roles" | "custom_data" | "identities" | "sso_identities" | "created_at" | "sub", string>>, z.ZodTypeDef, Partial<Record<"name" | "username" | "email" | "nickname" | "profile" | "website" | "gender" | "birthdate" | "zoneinfo" | "locale" | "address" | "given_name" | "family_name" | "middle_name" | "preferred_username" | "picture" | "email_verified" | "phone_number" | "phone_number_verified" | "updated_at" | "roles" | "organizations" | "organization_data" | "organization_roles" | "custom_data" | "identities" | "sso_identities" | "created_at" | "sub", string>>>>;
|
|
171
171
|
entityId: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
|
|
172
172
|
acsUrl: z.ZodOptional<z.ZodType<import("../foundations/index.js").SamlAcsUrl | null, z.ZodTypeDef, import("../foundations/index.js").SamlAcsUrl | null>>;
|
|
173
173
|
encryption: z.ZodOptional<z.ZodType<{
|
|
@@ -187,7 +187,7 @@ export declare const samlApplicationCreateGuard: z.ZodObject<z.objectUtil.extend
|
|
|
187
187
|
nameIdFormat: NameIdFormat;
|
|
188
188
|
customData?: import("@withtyped/server/lib/types.js").JsonObject;
|
|
189
189
|
description?: string | null;
|
|
190
|
-
attributeMapping?: Partial<Record<"name" | "
|
|
190
|
+
attributeMapping?: Partial<Record<"name" | "username" | "email" | "nickname" | "profile" | "website" | "gender" | "birthdate" | "zoneinfo" | "locale" | "address" | "given_name" | "family_name" | "middle_name" | "preferred_username" | "picture" | "email_verified" | "phone_number" | "phone_number_verified" | "updated_at" | "roles" | "organizations" | "organization_data" | "organization_roles" | "custom_data" | "identities" | "sso_identities" | "created_at" | "sub", string>> | undefined;
|
|
191
191
|
entityId?: string | null | undefined;
|
|
192
192
|
acsUrl?: import("../foundations/index.js").SamlAcsUrl | null | undefined;
|
|
193
193
|
encryption?: {
|
|
@@ -199,7 +199,7 @@ export declare const samlApplicationCreateGuard: z.ZodObject<z.objectUtil.extend
|
|
|
199
199
|
name: string;
|
|
200
200
|
customData?: import("@withtyped/server/lib/types.js").JsonObject;
|
|
201
201
|
description?: string | null;
|
|
202
|
-
attributeMapping?: Partial<Record<"name" | "
|
|
202
|
+
attributeMapping?: Partial<Record<"name" | "username" | "email" | "nickname" | "profile" | "website" | "gender" | "birthdate" | "zoneinfo" | "locale" | "address" | "given_name" | "family_name" | "middle_name" | "preferred_username" | "picture" | "email_verified" | "phone_number" | "phone_number_verified" | "updated_at" | "roles" | "organizations" | "organization_data" | "organization_roles" | "custom_data" | "identities" | "sso_identities" | "created_at" | "sub", string>> | undefined;
|
|
203
203
|
entityId?: string | null | undefined;
|
|
204
204
|
acsUrl?: import("../foundations/index.js").SamlAcsUrl | null | undefined;
|
|
205
205
|
encryption?: {
|
|
@@ -292,7 +292,7 @@ export declare const samlApplicationPatchGuard: z.ZodObject<z.objectUtil.extendS
|
|
|
292
292
|
type: z.ZodOptional<z.ZodType<import("../index.js").ApplicationType, z.ZodTypeDef, import("../index.js").ApplicationType>>;
|
|
293
293
|
name: z.ZodOptional<z.ZodType<string, z.ZodTypeDef, string>>;
|
|
294
294
|
}, "type" | "isThirdParty">, "name" | "customData" | "description">, {
|
|
295
|
-
attributeMapping: z.ZodOptional<z.ZodType<Partial<Record<"name" | "
|
|
295
|
+
attributeMapping: z.ZodOptional<z.ZodType<Partial<Record<"name" | "username" | "email" | "nickname" | "profile" | "website" | "gender" | "birthdate" | "zoneinfo" | "locale" | "address" | "given_name" | "family_name" | "middle_name" | "preferred_username" | "picture" | "email_verified" | "phone_number" | "phone_number_verified" | "updated_at" | "roles" | "organizations" | "organization_data" | "organization_roles" | "custom_data" | "identities" | "sso_identities" | "created_at" | "sub", string>>, z.ZodTypeDef, Partial<Record<"name" | "username" | "email" | "nickname" | "profile" | "website" | "gender" | "birthdate" | "zoneinfo" | "locale" | "address" | "given_name" | "family_name" | "middle_name" | "preferred_username" | "picture" | "email_verified" | "phone_number" | "phone_number_verified" | "updated_at" | "roles" | "organizations" | "organization_data" | "organization_roles" | "custom_data" | "identities" | "sso_identities" | "created_at" | "sub", string>>>>;
|
|
296
296
|
entityId: z.ZodOptional<z.ZodType<string | null, z.ZodTypeDef, string | null>>;
|
|
297
297
|
acsUrl: z.ZodOptional<z.ZodType<import("../foundations/index.js").SamlAcsUrl | null, z.ZodTypeDef, import("../foundations/index.js").SamlAcsUrl | null>>;
|
|
298
298
|
encryption: z.ZodOptional<z.ZodType<{
|
|
@@ -311,7 +311,7 @@ export declare const samlApplicationPatchGuard: z.ZodObject<z.objectUtil.extendS
|
|
|
311
311
|
name?: string | undefined;
|
|
312
312
|
customData?: import("@withtyped/server/lib/types.js").JsonObject;
|
|
313
313
|
description?: string | null;
|
|
314
|
-
attributeMapping?: Partial<Record<"name" | "
|
|
314
|
+
attributeMapping?: Partial<Record<"name" | "username" | "email" | "nickname" | "profile" | "website" | "gender" | "birthdate" | "zoneinfo" | "locale" | "address" | "given_name" | "family_name" | "middle_name" | "preferred_username" | "picture" | "email_verified" | "phone_number" | "phone_number_verified" | "updated_at" | "roles" | "organizations" | "organization_data" | "organization_roles" | "custom_data" | "identities" | "sso_identities" | "created_at" | "sub", string>> | undefined;
|
|
315
315
|
entityId?: string | null | undefined;
|
|
316
316
|
acsUrl?: import("../foundations/index.js").SamlAcsUrl | null | undefined;
|
|
317
317
|
encryption?: {
|
|
@@ -324,7 +324,7 @@ export declare const samlApplicationPatchGuard: z.ZodObject<z.objectUtil.extendS
|
|
|
324
324
|
name?: string | undefined;
|
|
325
325
|
customData?: import("@withtyped/server/lib/types.js").JsonObject;
|
|
326
326
|
description?: string | null;
|
|
327
|
-
attributeMapping?: Partial<Record<"name" | "
|
|
327
|
+
attributeMapping?: Partial<Record<"name" | "username" | "email" | "nickname" | "profile" | "website" | "gender" | "birthdate" | "zoneinfo" | "locale" | "address" | "given_name" | "family_name" | "middle_name" | "preferred_username" | "picture" | "email_verified" | "phone_number" | "phone_number_verified" | "updated_at" | "roles" | "organizations" | "organization_data" | "organization_roles" | "custom_data" | "identities" | "sso_identities" | "created_at" | "sub", string>> | undefined;
|
|
328
328
|
entityId?: string | null | undefined;
|
|
329
329
|
acsUrl?: import("../foundations/index.js").SamlAcsUrl | null | undefined;
|
|
330
330
|
encryption?: {
|
|
@@ -423,7 +423,7 @@ export declare const samlApplicationResponseGuard: z.ZodObject<z.objectUtil.exte
|
|
|
423
423
|
}, "secret" | "oidcClientMetadata" | "customClientMetadata" | "protectedAppMetadata">, Pick<{
|
|
424
424
|
applicationId: z.ZodType<string, z.ZodTypeDef, string>;
|
|
425
425
|
tenantId: z.ZodType<string, z.ZodTypeDef, string>;
|
|
426
|
-
attributeMapping: z.ZodType<Partial<Record<"name" | "
|
|
426
|
+
attributeMapping: z.ZodType<Partial<Record<"name" | "username" | "email" | "nickname" | "profile" | "website" | "gender" | "birthdate" | "zoneinfo" | "locale" | "address" | "given_name" | "family_name" | "middle_name" | "preferred_username" | "picture" | "email_verified" | "phone_number" | "phone_number_verified" | "updated_at" | "roles" | "organizations" | "organization_data" | "organization_roles" | "custom_data" | "identities" | "sso_identities" | "created_at" | "sub", string>>, z.ZodTypeDef, Partial<Record<"name" | "username" | "email" | "nickname" | "profile" | "website" | "gender" | "birthdate" | "zoneinfo" | "locale" | "address" | "given_name" | "family_name" | "middle_name" | "preferred_username" | "picture" | "email_verified" | "phone_number" | "phone_number_verified" | "updated_at" | "roles" | "organizations" | "organization_data" | "organization_roles" | "custom_data" | "identities" | "sso_identities" | "created_at" | "sub", string>>>;
|
|
427
427
|
entityId: z.ZodType<string | null, z.ZodTypeDef, string | null>;
|
|
428
428
|
acsUrl: z.ZodType<import("../foundations/index.js").SamlAcsUrl | null, z.ZodTypeDef, import("../foundations/index.js").SamlAcsUrl | null>;
|
|
429
429
|
encryption: z.ZodType<{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@logto/schemas",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.24.1",
|
|
4
4
|
"author": "Silverhand Inc. <contact@silverhand.io>",
|
|
5
5
|
"license": "MPL-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@types/inquirer": "^9.0.0",
|
|
32
32
|
"@types/node": "^20.9.5",
|
|
33
33
|
"@types/pluralize": "^0.0.33",
|
|
34
|
-
"@vitest/coverage-v8": "^2.1.
|
|
34
|
+
"@vitest/coverage-v8": "^2.1.9",
|
|
35
35
|
"camelcase": "^8.0.0",
|
|
36
36
|
"chalk": "^5.3.0",
|
|
37
37
|
"eslint": "^8.56.0",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"prettier": "^3.0.0",
|
|
41
41
|
"roarr": "^7.11.0",
|
|
42
42
|
"typescript": "^5.5.3",
|
|
43
|
-
"vitest": "^2.1.
|
|
43
|
+
"vitest": "^2.1.9"
|
|
44
44
|
},
|
|
45
45
|
"eslintConfig": {
|
|
46
46
|
"extends": "@silverhand",
|
|
@@ -63,12 +63,12 @@
|
|
|
63
63
|
},
|
|
64
64
|
"prettier": "@silverhand/eslint-config/.prettierrc",
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@logto/connector-kit": "^4.1.
|
|
67
|
-
"@logto/core-kit": "^2.5.
|
|
68
|
-
"@logto/language-kit": "^1.1.
|
|
69
|
-
"@logto/phrases": "^1.
|
|
70
|
-
"@logto/phrases-experience": "^1.9.
|
|
71
|
-
"@logto/shared": "^3.1.
|
|
66
|
+
"@logto/connector-kit": "^4.1.1",
|
|
67
|
+
"@logto/core-kit": "^2.5.4",
|
|
68
|
+
"@logto/language-kit": "^1.1.1",
|
|
69
|
+
"@logto/phrases": "^1.18.0",
|
|
70
|
+
"@logto/phrases-experience": "^1.9.1",
|
|
71
|
+
"@logto/shared": "^3.1.4",
|
|
72
72
|
"@withtyped/server": "^0.14.0",
|
|
73
73
|
"nanoid": "^5.0.9"
|
|
74
74
|
},
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
create table email_templates (
|
|
2
|
+
tenant_id varchar(21) not null
|
|
3
|
+
references tenants (id) on update cascade on delete cascade,
|
|
4
|
+
id varchar(21) not null,
|
|
5
|
+
language_tag varchar(16) not null,
|
|
6
|
+
template_type varchar(64) /* @use TemplateType */ not null,
|
|
7
|
+
details jsonb /* @use EmailTemplateDetails */ not null,
|
|
8
|
+
created_at timestamptz not null default now(),
|
|
9
|
+
primary key (tenant_id, id),
|
|
10
|
+
constraint email_templates__tenant_id__language_tag__template_type
|
|
11
|
+
unique (tenant_id, language_tag, template_type)
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
create index email_templates__tenant_id__language_tag
|
|
15
|
+
on email_templates (tenant_id, language_tag);
|
|
16
|
+
|
|
17
|
+
create index email_templates__tenant_id__template_type
|
|
18
|
+
on email_templates (tenant_id, template_type);
|