@logto/cloud 0.2.5-fadb481 → 0.2.5-fd82773

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 (46) hide show
  1. package/lib/routes/index.d.ts +1442 -0
  2. package/package.json +34 -45
  3. package/build/env-set/index.d.ts +0 -5
  4. package/build/index.d.ts +0 -1
  5. package/build/libraries/services.d.ts +0 -16
  6. package/build/libraries/tenants.d.ts +0 -11
  7. package/build/middleware/with-auth.d.ts +0 -18
  8. package/build/middleware/with-error-report.d.ts +0 -5
  9. package/build/middleware/with-http-proxy.d.ts +0 -7
  10. package/build/middleware/with-pathname.d.ts +0 -11
  11. package/build/middleware/with-security-headers.d.ts +0 -2
  12. package/build/middleware/with-spa.d.ts +0 -28
  13. package/build/models/checkout-sessions.d.ts +0 -24
  14. package/build/models/consts/subscription-plan-quota.d.ts +0 -10
  15. package/build/models/subscription-plans.d.ts +0 -132
  16. package/build/models/subscriptions-usage.d.ts +0 -24
  17. package/build/models/subscriptions.d.ts +0 -31
  18. package/build/models/tenants-subscriptions.d.ts +0 -20
  19. package/build/queries/application.d.ts +0 -9
  20. package/build/queries/connector.d.ts +0 -11
  21. package/build/queries/index.d.ts +0 -104
  22. package/build/queries/roles.d.ts +0 -6
  23. package/build/queries/service-logs.d.ts +0 -10
  24. package/build/queries/system.d.ts +0 -22
  25. package/build/queries/tenants.d.ts +0 -30
  26. package/build/queries/users.d.ts +0 -7
  27. package/build/queries/utils.d.ts +0 -3
  28. package/build/routes/index.d.ts +0 -78
  29. package/build/routes/services.d.ts +0 -53
  30. package/build/routes/tenants.d.ts +0 -24
  31. package/build/routes-anonymous/index.d.ts +0 -13
  32. package/build/test-utils/context.d.ts +0 -14
  33. package/build/test-utils/function.d.ts +0 -1
  34. package/build/test-utils/libraries.d.ts +0 -26
  35. package/build/utils/connector/index.d.ts +0 -2
  36. package/build/utils/connector/seed.d.ts +0 -17
  37. package/build/utils/connector/types.d.ts +0 -11
  38. package/build/utils/email-service/index.d.ts +0 -13
  39. package/build/utils/email-service/sendgrid.d.ts +0 -6
  40. package/build/utils/email-service/utils.d.ts +0 -2
  41. package/build/utils/guard.d.ts +0 -3
  42. package/build/utils/logto.d.ts +0 -3
  43. package/build/utils/postgres.d.ts +0 -4
  44. package/build/utils/query.d.ts +0 -2
  45. package/build/utils/tenant.d.ts +0 -1
  46. package/build/utils/url.d.ts +0 -2
@@ -1,22 +0,0 @@
1
- import type { PostgreSql } from '@withtyped/postgres';
2
- import type { Queryable } from '@withtyped/server';
3
- export type SystemsQuery = ReturnType<typeof createSystemsQuery>;
4
- export declare const createSystemsQuery: (client: Queryable<PostgreSql>) => {
5
- getDemoSocialValue: () => Promise<{
6
- name: string;
7
- logo: string;
8
- logoDark: string;
9
- provider: import("@logto/schemas").DemoSocialProvider;
10
- clientId: string;
11
- }[] | undefined>;
12
- getEmailServiceConfig: () => Promise<{
13
- provider: import("@logto/schemas").EmailServiceProvider;
14
- apiKey: string;
15
- fromName: string;
16
- fromEmail: string;
17
- templates: Partial<Record<import("@logto/schemas").OtherEmailTemplate | import("@logto/connector-kit").VerificationCodeType, {
18
- subject: string;
19
- content: string;
20
- }>>;
21
- } | undefined>;
22
- };
@@ -1,30 +0,0 @@
1
- import { type AdminData } from '@logto/schemas';
2
- import type { TenantModel } from '@logto/schemas/models';
3
- import { type PostgreSql } from '@withtyped/postgres';
4
- import type { Queryable } from '@withtyped/server';
5
- export type TenantsQueries = ReturnType<typeof createTenantsQueries>;
6
- export declare const createTenantsQueries: (client: Queryable<PostgreSql>) => {
7
- getManagementApiLikeIndicatorsForUser: (userId: string) => Promise<import("@withtyped/server").QueryResult<{
8
- indicator: string;
9
- }>>;
10
- insertTenant: (tenant: Pick<TenantModel, 'id' | 'dbUser' | 'dbUserPassword'> & Partial<Pick<TenantModel, 'name' | 'tag'>>) => Promise<import("@withtyped/server").QueryResult<Record<string, unknown>>>;
11
- updateTenantById: (tenantId: string, payload: Partial<Pick<TenantModel, 'name' | 'tag'>>) => Promise<{
12
- id: string;
13
- dbUser: string | null;
14
- dbUserPassword: string | null;
15
- name: string;
16
- tag: import("@logto/schemas/models").TenantTag;
17
- createdAt: Date;
18
- }>;
19
- createTenantRole: (parentRole: string, role: string, password: string) => Promise<import("@withtyped/server").QueryResult<Record<string, unknown>>>;
20
- deleteDatabaseRoleForTenant: (role: string) => Promise<import("@withtyped/server").QueryResult<Record<string, unknown>>>;
21
- insertAdminData: (data: AdminData) => Promise<void>;
22
- getTenantById: (id: string) => Promise<Pick<TenantModel, 'dbUser' | 'name' | 'tag'>>;
23
- getTenantsByIds: (tenantIds: string[]) => Promise<Array<Pick<TenantModel, 'id' | 'name' | 'tag'>>>;
24
- deleteClientTenantManagementApplicationById: (tenantId: string) => Promise<void>;
25
- deleteClientTenantManagementApiResourceByTenantId: (tenantId: string) => Promise<void>;
26
- deleteClientTenantRoleById: (tenantId: string) => Promise<void>;
27
- deleteTenantById: (id: string) => Promise<void>;
28
- appendAdminConsoleRedirectUris: (...urls: URL[]) => Promise<void>;
29
- removeUrisFromAdminConsoleRedirectUris: (...urls: URL[]) => Promise<void>;
30
- };
@@ -1,7 +0,0 @@
1
- import type { UsersRole } from '@logto/schemas';
2
- import type { PostgreSql } from '@withtyped/postgres';
3
- import type { Queryable } from '@withtyped/server';
4
- export type UsersQueries = ReturnType<typeof createUsersQueries>;
5
- export declare const createUsersQueries: (client: Queryable<PostgreSql>) => {
6
- assignRoleToUser: (data: UsersRole) => Promise<import("@withtyped/server").QueryResult<Record<string, unknown>>>;
7
- };
@@ -1,3 +0,0 @@
1
- import type { PostgreSql } from '@withtyped/postgres';
2
- import type { Queryable } from '@withtyped/server';
3
- export declare const getDatabaseName: (client: Queryable<PostgreSql>) => Promise<string>;
@@ -1,78 +0,0 @@
1
- import type { WithAuthContext } from '#src/middleware/with-auth.js';
2
- declare const router: import("@withtyped/server").Router<WithAuthContext, import("@withtyped/server").MergeRoutes<import("@withtyped/server").MergeRoutes<import("@withtyped/server").BaseRoutes, import("@withtyped/server").RoutesWithPrefix<{
3
- options: {};
4
- patch: {
5
- "/tenants/:tenantId": import("@withtyped/server").PathGuard<"/:tenantId", unknown, {
6
- name?: string | undefined;
7
- tag?: import("@logto/schemas/lib/models/tenants.js").TenantTag | undefined;
8
- }, import("@logto/schemas/lib/models/tenants.js").TenantInfo>;
9
- };
10
- get: {
11
- "/tenants": import("@withtyped/server").PathGuard<"/", unknown, unknown, import("@logto/schemas/lib/models/tenants.js").TenantInfo[]>;
12
- };
13
- post: {
14
- "/tenants": import("@withtyped/server").PathGuard<"/", unknown, {
15
- name?: string | undefined;
16
- tag?: import("@logto/schemas/lib/models/tenants.js").TenantTag | undefined;
17
- }, import("@logto/schemas/lib/models/tenants.js").TenantInfo>;
18
- };
19
- put: {};
20
- head: {};
21
- delete: {
22
- "/tenants/:tenantId": import("@withtyped/server").PathGuard<"/:tenantId", unknown, unknown, unknown>;
23
- };
24
- copy: {};
25
- }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
26
- options: {};
27
- patch: {};
28
- get: {
29
- "/services/mails/usage": import("@withtyped/server").PathGuard<"/mails/usage", {
30
- from?: string | undefined;
31
- }, unknown, unknown>;
32
- };
33
- post: {
34
- "/services/send-email": import("@withtyped/server").PathGuard<"/send-email", unknown, {
35
- data: {
36
- type: import("@logto/connector-kit").VerificationCodeType;
37
- to: string;
38
- payload: {
39
- fromName?: string | undefined;
40
- companyAddress?: string | undefined;
41
- appLogo?: string | undefined;
42
- code: string;
43
- };
44
- };
45
- }, unknown>;
46
- } & {
47
- "/services/mails": import("@withtyped/server").PathGuard<"/mails", unknown, {
48
- data: {
49
- type: import("@logto/connector-kit").VerificationCodeType;
50
- to: string;
51
- payload: {
52
- fromName?: string | undefined;
53
- companyAddress?: string | undefined;
54
- appLogo?: string | undefined;
55
- code: string;
56
- };
57
- };
58
- }, unknown>;
59
- } & {
60
- "/services/send-sms": import("@withtyped/server").PathGuard<"/send-sms", unknown, {
61
- data: {
62
- type: import("@logto/connector-kit").VerificationCodeType;
63
- to: string;
64
- payload: {
65
- fromName?: string | undefined;
66
- companyAddress?: string | undefined;
67
- appLogo?: string | undefined;
68
- code: string;
69
- };
70
- };
71
- }, unknown>;
72
- };
73
- put: {};
74
- head: {};
75
- delete: {};
76
- copy: {};
77
- }, "/api">>, "/api">;
78
- export default router;
@@ -1,53 +0,0 @@
1
- import type { ServicesLibrary } from '#src/libraries/services.js';
2
- import type { WithAuthContext } from '#src/middleware/with-auth.js';
3
- export declare const servicesRoutes: (library: ServicesLibrary) => import("@withtyped/server").RouterWithRoute<WithAuthContext, {
4
- options: {};
5
- patch: {};
6
- get: {
7
- "/services/mails/usage": import("@withtyped/server").PathGuard<"/mails/usage", {
8
- from?: string | undefined;
9
- }, unknown, unknown>;
10
- };
11
- post: {
12
- "/services/send-email": import("@withtyped/server").PathGuard<"/send-email", unknown, {
13
- data: {
14
- type: import("@logto/connector-kit").VerificationCodeType;
15
- to: string;
16
- payload: {
17
- fromName?: string | undefined;
18
- companyAddress?: string | undefined;
19
- appLogo?: string | undefined;
20
- code: string;
21
- };
22
- };
23
- }, unknown>;
24
- } & {
25
- "/services/mails": import("@withtyped/server").PathGuard<"/mails", unknown, {
26
- data: {
27
- type: import("@logto/connector-kit").VerificationCodeType;
28
- to: string;
29
- payload: {
30
- fromName?: string | undefined;
31
- companyAddress?: string | undefined;
32
- appLogo?: string | undefined;
33
- code: string;
34
- };
35
- };
36
- }, unknown>;
37
- };
38
- put: {};
39
- head: {};
40
- delete: {};
41
- copy: {};
42
- }, "/services", "post", "/send-sms", unknown, {
43
- data: {
44
- type: import("@logto/connector-kit").VerificationCodeType;
45
- to: string;
46
- payload: {
47
- fromName?: string | undefined;
48
- companyAddress?: string | undefined;
49
- appLogo?: string | undefined;
50
- code: string;
51
- };
52
- };
53
- }, unknown>;
@@ -1,24 +0,0 @@
1
- import type { TenantsLibrary } from '#src/libraries/tenants.js';
2
- import type { WithAuthContext } from '#src/middleware/with-auth.js';
3
- export declare const tenantsRoutes: (library: TenantsLibrary) => import("@withtyped/server").RouterWithRoute<WithAuthContext, {
4
- options: {};
5
- patch: {
6
- "/tenants/:tenantId": import("@withtyped/server").PathGuard<"/:tenantId", unknown, {
7
- name?: string | undefined;
8
- tag?: import("@logto/schemas/models").TenantTag | undefined;
9
- }, import("@logto/schemas/models").TenantInfo>;
10
- };
11
- get: {
12
- "/tenants": import("@withtyped/server").PathGuard<"/", unknown, unknown, import("@logto/schemas/models").TenantInfo[]>;
13
- };
14
- post: {
15
- "/tenants": import("@withtyped/server").PathGuard<"/", unknown, {
16
- name?: string | undefined;
17
- tag?: import("@logto/schemas/models").TenantTag | undefined;
18
- }, import("@logto/schemas/models").TenantInfo>;
19
- };
20
- put: {};
21
- head: {};
22
- delete: {};
23
- copy: {};
24
- }, "/tenants", "delete", "/:tenantId", unknown, unknown, unknown>;
@@ -1,13 +0,0 @@
1
- declare const router: import("@withtyped/server").RouterWithRoute<import("@withtyped/server").RequestContext, {
2
- options: {};
3
- patch: {};
4
- get: {
5
- "/api/status": import("@withtyped/server").PathGuard<"/status", unknown, unknown, unknown>;
6
- };
7
- post: {};
8
- put: {};
9
- head: {};
10
- delete: {};
11
- copy: {};
12
- }, "/api", "get", "/teapot", unknown, unknown, unknown>;
13
- export default router;
@@ -1,14 +0,0 @@
1
- /// <reference types="node" resolution-mode="require"/>
2
- /// <reference types="node/http.js" />
3
- import type { HttpContext, RequestContext, RequestMethod } from '@withtyped/server';
4
- import type { WithAuthContext } from '#src/middleware/with-auth.js';
5
- export declare const createHttpContext: (isHttps?: boolean) => HttpContext;
6
- type BuildRequestContext = Partial<RequestContext['request']>;
7
- export declare const buildRequestContext: <Path extends `GET ${string}` | `POST ${string}` | `PUT ${string}` | `PATCH ${string}` | `DELETE ${string}` | `COPY ${string}` | `HEAD ${string}` | `OPTIONS ${string}`>(path: Path, { headers, body }?: BuildRequestContext) => RequestContext;
8
- export declare const buildRequestAuthContext: <Path extends `GET ${string}` | `POST ${string}` | `PUT ${string}` | `PATCH ${string}` | `DELETE ${string}` | `COPY ${string}` | `HEAD ${string}` | `OPTIONS ${string}`>(args_0: Path, args_1?: Partial<Record<string, unknown> & {
9
- method?: RequestMethod | undefined;
10
- headers: import("http").IncomingHttpHeaders;
11
- url: URL;
12
- body?: unknown;
13
- }> | undefined) => (scopes?: string[]) => WithAuthContext;
14
- export {};
@@ -1 +0,0 @@
1
- export declare const noop: () => Promise<void>;
@@ -1,26 +0,0 @@
1
- /// <reference types="jest" />
2
- import type { ServiceLogType } from '@logto/schemas';
3
- import type { TenantInfo, TenantTag } from '@logto/schemas/models';
4
- import type { ServicesLibrary } from '#src/libraries/services.js';
5
- import type { TenantsLibrary } from '#src/libraries/tenants.js';
6
- import type { Queries } from '#src/queries/index.js';
7
- export declare class MockTenantsLibrary implements TenantsLibrary {
8
- get queries(): Queries;
9
- getAvailableTenants: jest.Mock<Promise<TenantInfo[]>, [string], any>;
10
- createNewTenant: jest.Mock<Promise<TenantInfo>, [string, Record<string, unknown>], any>;
11
- updateTenantById: jest.Mock<Promise<TenantInfo>, [string, {
12
- name?: string | undefined;
13
- tag?: TenantTag | undefined;
14
- }], any>;
15
- deleteTenantById: jest.Mock<Promise<void>, [string], any>;
16
- }
17
- export declare class MockServicesLibrary implements ServicesLibrary {
18
- get queries(): Queries;
19
- getTenantIdFromApplicationId: jest.Mock<Promise<string>, [string], any>;
20
- sendMessage: jest.Mock<any, any, any>;
21
- sendEmail: jest.Mock<any, any, any>;
22
- getAdminTenantLogtoConnectors: jest.Mock<any, any, any>;
23
- addLog: jest.Mock<any, any, any>;
24
- getTenantBalanceForType: jest.Mock<Promise<number>, [string, ServiceLogType], any>;
25
- getTenantUsageByTypeFrom: jest.Mock<Promise<number>, [string, ServiceLogType, Date], any>;
26
- }
@@ -1,2 +0,0 @@
1
- export * from './types.js';
2
- export declare const loadConnectorFactories: () => Promise<import("@logto/cli/lib/connector/types.js").ConnectorFactory[]>;
@@ -1,17 +0,0 @@
1
- export declare const createCloudServiceConnector: (data: {
2
- tenantId: string;
3
- connectorId: string;
4
- appId: string;
5
- appSecret: string;
6
- }) => {
7
- id: string;
8
- tenantId: string;
9
- connectorId: string;
10
- config: {
11
- appId: string;
12
- appSecret: string;
13
- tokenEndpoint: string;
14
- endpoint: string;
15
- resource: string;
16
- };
17
- };
@@ -1,11 +0,0 @@
1
- import type { AllConnector } from '@logto/connector-kit';
2
- import type { Connector } from '@logto/schemas';
3
- export { ConnectorType } from '@logto/schemas';
4
- /**
5
- * The connector type with full context.
6
- */
7
- export type LogtoConnector<T extends AllConnector = AllConnector> = T & {
8
- validateConfig: (config: unknown) => void;
9
- } & {
10
- dbEntry: Connector;
11
- };
@@ -1,13 +0,0 @@
1
- import { type EmailServiceData } from '@logto/schemas';
2
- export declare const buildEmailService: (config: EmailServiceData) => {
3
- send: (sendMessagePayload: {
4
- type: import("@logto/connector-kit").VerificationCodeType;
5
- to: string;
6
- payload: {
7
- fromName?: string | undefined;
8
- companyAddress?: string | undefined;
9
- appLogo?: string | undefined;
10
- code: string;
11
- };
12
- }) => Promise<import("got").Response<string>>;
13
- };
@@ -1,6 +0,0 @@
1
- import type { SendMessagePayload } from '@logto/connector-kit';
2
- import { type SendgridEmailServiceData } from '@logto/schemas';
3
- export declare const sendgridEndpoint = "https://api.sendgrid.com/v3/mail/send";
4
- export declare const buildSendgridEmailService: (config: SendgridEmailServiceData) => {
5
- send: (sendMessagePayload: SendMessagePayload) => Promise<import("got").Response<string>>;
6
- };
@@ -1,2 +0,0 @@
1
- import { type Optional } from '@silverhand/essentials';
2
- export declare const replacePlaceholders: (rawContent: string, patterns: Record<string, Optional<string>>) => string;
@@ -1,3 +0,0 @@
1
- import type { Json } from '@withtyped/server';
2
- import { z } from 'zod';
3
- export declare const jsonObjectGuard: z.ZodRecord<z.ZodString, z.ZodType<Json, z.ZodTypeDef, Json>>;
@@ -1,3 +0,0 @@
1
- export declare const findLogtoInstanceDirectory: () => Promise<string>;
2
- export declare const getLogtoConsoleAppDirectory: () => Promise<string>;
3
- export declare const getLogtoCoreConnectorsDirectory: () => Promise<string>;
@@ -1,4 +0,0 @@
1
- import type { createQueryClient } from '@withtyped/postgres';
2
- type CreateClientConfig = Parameters<typeof createQueryClient>[0];
3
- export declare const parseDsn: (dsn?: string) => CreateClientConfig;
4
- export {};
@@ -1,2 +0,0 @@
1
- import type { JsonObject } from '@withtyped/server';
2
- export declare const insertInto: <T extends JsonObject>(object: T, table: string) => import("@withtyped/postgres").PostgreSql;
@@ -1 +0,0 @@
1
- export declare const getTenantIdFromManagementApiIndicator: (indicator: string) => string | undefined;
@@ -1,2 +0,0 @@
1
- export declare const normalizePath: (pathLike: string) => string;
2
- export declare const matchPathname: (toMatch: string, pathname: string, ignorePathnames?: string[]) => string | false;