@logto/cloud 0.2.5-444ed49 → 0.2.5-4917039
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/lib/routes/index.d.ts +327 -101
- package/package.json +15 -19
package/lib/routes/index.d.ts
CHANGED
|
@@ -1,54 +1,121 @@
|
|
|
1
|
-
// Generated by dts-bundle-generator
|
|
1
|
+
// Generated by dts-bundle-generator v9.3.1
|
|
2
2
|
|
|
3
|
-
import { RequestContext } from '@withtyped/server';
|
|
3
|
+
import { Json, JsonObject, RequestContext } from '@withtyped/server';
|
|
4
4
|
import { InferModelType } from '@withtyped/server/model';
|
|
5
5
|
|
|
6
6
|
export type WithAuthContext<Context = RequestContext> = Context & {
|
|
7
7
|
auth: {
|
|
8
|
+
/** The ID of the authenticated subject (`sub`). */
|
|
8
9
|
id: string;
|
|
10
|
+
/** The scopes that the subject has (`scope`). */
|
|
9
11
|
scopes: string[];
|
|
10
12
|
};
|
|
11
13
|
};
|
|
12
|
-
declare enum TenantTag {
|
|
13
|
-
Development = "development",
|
|
14
|
-
Staging = "staging",
|
|
15
|
-
Production = "production"
|
|
16
|
-
}
|
|
17
14
|
declare enum VerificationCodeType {
|
|
18
15
|
SignIn = "SignIn",
|
|
19
16
|
Register = "Register",
|
|
20
17
|
ForgotPassword = "ForgotPassword",
|
|
21
|
-
/** @deprecated */
|
|
22
|
-
Continue = "Continue",
|
|
23
18
|
Generic = "Generic",
|
|
24
19
|
/** @deprecated Use `Generic` type template for sending test sms/email use case */
|
|
25
20
|
Test = "Test"
|
|
26
21
|
}
|
|
27
|
-
declare
|
|
22
|
+
declare enum TemplateType {
|
|
23
|
+
/** The template for sending verification code when user is signing in. */
|
|
24
|
+
SignIn = "SignIn",
|
|
25
|
+
/** The template for sending verification code when user is registering. */
|
|
26
|
+
Register = "Register",
|
|
27
|
+
/** The template for sending verification code when user is resetting password. */
|
|
28
|
+
ForgotPassword = "ForgotPassword",
|
|
29
|
+
/** The template for sending organization invitation. */
|
|
30
|
+
OrganizationInvitation = "OrganizationInvitation",
|
|
31
|
+
/** The template for generic usage. */
|
|
32
|
+
Generic = "Generic"
|
|
33
|
+
}
|
|
34
|
+
declare enum OrganizationInvitationStatus {
|
|
35
|
+
Pending = "Pending",
|
|
36
|
+
Accepted = "Accepted",
|
|
37
|
+
Expired = "Expired",
|
|
38
|
+
Revoked = "Revoked"
|
|
39
|
+
}
|
|
40
|
+
/** The scopes (permissions) defined by the organization template. */
|
|
41
|
+
export type OrganizationScope = {
|
|
42
|
+
tenantId: string;
|
|
43
|
+
/** The globally unique identifier of the organization scope. */
|
|
44
|
+
id: string;
|
|
45
|
+
/** The organization scope's name, unique within the organization template. */
|
|
46
|
+
name: string;
|
|
47
|
+
/** A brief description of the organization scope. */
|
|
48
|
+
description: string | null;
|
|
49
|
+
};
|
|
50
|
+
declare enum LogtoJwtTokenKeyType {
|
|
51
|
+
AccessToken = "access-token",
|
|
52
|
+
ClientCredentials = "client-credentials"
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* The simplified organization role entity that is returned in the `roles` field
|
|
56
|
+
* of the organization.
|
|
57
|
+
*/
|
|
58
|
+
export type OrganizationRoleEntity = {
|
|
59
|
+
id: string;
|
|
60
|
+
name: string;
|
|
61
|
+
};
|
|
62
|
+
declare enum TenantTag {
|
|
63
|
+
Development = "development",
|
|
64
|
+
Production = "production"
|
|
65
|
+
}
|
|
66
|
+
declare enum TenantRole {
|
|
67
|
+
/** Admin of the tenant, who has all permissions. */
|
|
68
|
+
Admin = "admin",
|
|
69
|
+
/** Collaborator of the tenant, who has permissions to operate the tenant data, but not the tenant settings. */
|
|
70
|
+
Collaborator = "collaborator"
|
|
71
|
+
}
|
|
72
|
+
declare const AffiliateProperties: import("@withtyped/server/lib/model/index.js").default<"affiliate_properties", {
|
|
28
73
|
createdAt: Date;
|
|
29
74
|
affiliateId: string;
|
|
30
75
|
type: "hostname" | "query";
|
|
31
76
|
value: string;
|
|
32
77
|
}, "createdAt", "createdAt">;
|
|
33
78
|
export type AffiliateProperty = InferModelType<typeof AffiliateProperties>;
|
|
34
|
-
declare const Affiliates: import("@withtyped/server/model").default<"affiliates", {
|
|
35
|
-
id: string;
|
|
36
|
-
createdAt: Date;
|
|
79
|
+
declare const Affiliates: import("@withtyped/server/lib/model/index.js").default<"affiliates", {
|
|
37
80
|
name: string;
|
|
38
|
-
|
|
81
|
+
createdAt: Date;
|
|
82
|
+
id: string;
|
|
83
|
+
}, "id" | "createdAt", "id" | "createdAt">;
|
|
39
84
|
export type Affiliate = InferModelType<typeof Affiliates>;
|
|
40
85
|
export type AffiliateData = Affiliate & {
|
|
41
86
|
properties: Array<Pick<AffiliateProperty, "type" | "value">>;
|
|
42
87
|
};
|
|
43
|
-
declare const router: import("@withtyped/server").Router<
|
|
44
|
-
|
|
88
|
+
declare const router: import("@withtyped/server").Router<RequestContext, WithAuthContext<Omit<import("@withtyped/server").BaseContext & {
|
|
89
|
+
request: {
|
|
90
|
+
id?: string | undefined;
|
|
91
|
+
method?: import("@withtyped/server").RequestMethod | undefined;
|
|
92
|
+
headers: import("http").IncomingHttpHeaders;
|
|
93
|
+
url: URL;
|
|
94
|
+
body?: unknown;
|
|
95
|
+
};
|
|
96
|
+
}, "request"> & {
|
|
97
|
+
request: Record<string, unknown> & {
|
|
98
|
+
id?: string | undefined;
|
|
99
|
+
method?: import("@withtyped/server").RequestMethod | undefined;
|
|
100
|
+
headers: import("http").IncomingHttpHeaders;
|
|
101
|
+
url: URL;
|
|
102
|
+
body?: unknown;
|
|
103
|
+
} & {
|
|
104
|
+
body?: Json | undefined;
|
|
105
|
+
bodyRaw?: Buffer | undefined;
|
|
106
|
+
};
|
|
107
|
+
}>, import("@withtyped/server").MergeRoutes<import("@withtyped/server").MergeRoutes<import("@withtyped/server").MergeRoutes<import("@withtyped/server").MergeRoutes<import("@withtyped/server").MergeRoutes<import("@withtyped/server").MergeRoutes<import("@withtyped/server").MergeRoutes<import("@withtyped/server").MergeRoutes<import("@withtyped/server").BaseRoutes, import("@withtyped/server").RoutesWithPrefix<{
|
|
45
108
|
patch: {
|
|
46
109
|
"/tenants/:tenantId": import("@withtyped/server").PathGuard<"/:tenantId", unknown, {
|
|
47
110
|
name?: string | undefined;
|
|
48
|
-
tag?: TenantTag | undefined;
|
|
49
111
|
}, {
|
|
50
112
|
id: string;
|
|
51
113
|
name: string;
|
|
114
|
+
usage: {
|
|
115
|
+
activeUsers: number;
|
|
116
|
+
cost: number;
|
|
117
|
+
tokenUsage: number;
|
|
118
|
+
};
|
|
52
119
|
indicator: string;
|
|
53
120
|
isSuspended: boolean;
|
|
54
121
|
planId: string;
|
|
@@ -58,15 +125,10 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
|
|
|
58
125
|
currentPeriodStart: Date;
|
|
59
126
|
currentPeriodEnd: Date;
|
|
60
127
|
};
|
|
61
|
-
tag: TenantTag;
|
|
62
|
-
usage: {
|
|
63
|
-
activeUsers: number;
|
|
64
|
-
cost: number;
|
|
65
|
-
};
|
|
66
128
|
openInvoices: {
|
|
67
129
|
status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
|
|
68
|
-
createdAt: Date;
|
|
69
130
|
id: string;
|
|
131
|
+
createdAt: Date;
|
|
70
132
|
updatedAt: Date;
|
|
71
133
|
customerId: string | null;
|
|
72
134
|
billingReason: string | null;
|
|
@@ -78,12 +140,19 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
|
|
|
78
140
|
hostedInvoiceUrl: string | null;
|
|
79
141
|
invoicePdf: string | null;
|
|
80
142
|
}[];
|
|
143
|
+
tag: TenantTag;
|
|
81
144
|
}>;
|
|
82
145
|
};
|
|
146
|
+
options: {};
|
|
83
147
|
get: {
|
|
84
148
|
"/tenants": import("@withtyped/server").PathGuard<"/", unknown, unknown, {
|
|
85
149
|
id: string;
|
|
86
150
|
name: string;
|
|
151
|
+
usage: {
|
|
152
|
+
activeUsers: number;
|
|
153
|
+
cost: number;
|
|
154
|
+
tokenUsage: number;
|
|
155
|
+
};
|
|
87
156
|
indicator: string;
|
|
88
157
|
isSuspended: boolean;
|
|
89
158
|
planId: string;
|
|
@@ -93,15 +162,10 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
|
|
|
93
162
|
currentPeriodStart: Date;
|
|
94
163
|
currentPeriodEnd: Date;
|
|
95
164
|
};
|
|
96
|
-
tag: TenantTag;
|
|
97
|
-
usage: {
|
|
98
|
-
activeUsers: number;
|
|
99
|
-
cost: number;
|
|
100
|
-
};
|
|
101
165
|
openInvoices: {
|
|
102
166
|
status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
|
|
103
|
-
createdAt: Date;
|
|
104
167
|
id: string;
|
|
168
|
+
createdAt: Date;
|
|
105
169
|
updatedAt: Date;
|
|
106
170
|
customerId: string | null;
|
|
107
171
|
billingReason: string | null;
|
|
@@ -113,6 +177,7 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
|
|
|
113
177
|
hostedInvoiceUrl: string | null;
|
|
114
178
|
invoicePdf: string | null;
|
|
115
179
|
}[];
|
|
180
|
+
tag: TenantTag;
|
|
116
181
|
}[]>;
|
|
117
182
|
};
|
|
118
183
|
post: {
|
|
@@ -122,6 +187,11 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
|
|
|
122
187
|
}, {
|
|
123
188
|
id: string;
|
|
124
189
|
name: string;
|
|
190
|
+
usage: {
|
|
191
|
+
activeUsers: number;
|
|
192
|
+
cost: number;
|
|
193
|
+
tokenUsage: number;
|
|
194
|
+
};
|
|
125
195
|
indicator: string;
|
|
126
196
|
isSuspended: boolean;
|
|
127
197
|
planId: string;
|
|
@@ -131,15 +201,10 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
|
|
|
131
201
|
currentPeriodStart: Date;
|
|
132
202
|
currentPeriodEnd: Date;
|
|
133
203
|
};
|
|
134
|
-
tag: TenantTag;
|
|
135
|
-
usage: {
|
|
136
|
-
activeUsers: number;
|
|
137
|
-
cost: number;
|
|
138
|
-
};
|
|
139
204
|
openInvoices: {
|
|
140
205
|
status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
|
|
141
|
-
createdAt: Date;
|
|
142
206
|
id: string;
|
|
207
|
+
createdAt: Date;
|
|
143
208
|
updatedAt: Date;
|
|
144
209
|
customerId: string | null;
|
|
145
210
|
billingReason: string | null;
|
|
@@ -151,17 +216,18 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
|
|
|
151
216
|
hostedInvoiceUrl: string | null;
|
|
152
217
|
invoicePdf: string | null;
|
|
153
218
|
}[];
|
|
219
|
+
tag: TenantTag;
|
|
154
220
|
}>;
|
|
155
221
|
};
|
|
156
222
|
put: {};
|
|
157
|
-
head: {};
|
|
158
223
|
delete: {
|
|
159
224
|
"/tenants/:tenantId": import("@withtyped/server").PathGuard<"/:tenantId", unknown, unknown, unknown>;
|
|
160
225
|
};
|
|
161
226
|
copy: {};
|
|
227
|
+
head: {};
|
|
162
228
|
}, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
|
|
163
|
-
options: {};
|
|
164
229
|
patch: {};
|
|
230
|
+
options: {};
|
|
165
231
|
get: {
|
|
166
232
|
"/tenants/my/subscription": import("@withtyped/server").PathGuard<"/my/subscription", unknown, unknown, {
|
|
167
233
|
status: "incomplete" | "incomplete_expired" | "trialing" | "active" | "past_due" | "canceled" | "unpaid" | "paused";
|
|
@@ -180,8 +246,8 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
|
|
|
180
246
|
"/tenants/:tenantId/invoices": import("@withtyped/server").PathGuard<"/:tenantId/invoices", unknown, unknown, {
|
|
181
247
|
invoices: {
|
|
182
248
|
status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
|
|
183
|
-
createdAt: Date;
|
|
184
249
|
id: string;
|
|
250
|
+
createdAt: Date;
|
|
185
251
|
updatedAt: Date;
|
|
186
252
|
customerId: string | null;
|
|
187
253
|
billingReason: string | null;
|
|
@@ -195,10 +261,15 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
|
|
|
195
261
|
planName: string | null;
|
|
196
262
|
}[];
|
|
197
263
|
}>;
|
|
264
|
+
} & {
|
|
265
|
+
"/tenants/:tenantId/invoices/:invoiceId/hosted-invoice-url": import("@withtyped/server").PathGuard<"/:tenantId/invoices/:invoiceId/hosted-invoice-url", unknown, unknown, {
|
|
266
|
+
hostedInvoiceUrl: string;
|
|
267
|
+
}>;
|
|
198
268
|
} & {
|
|
199
269
|
"/tenants/:tenantId/usage": import("@withtyped/server").PathGuard<"/:tenantId/usage", unknown, unknown, {
|
|
200
270
|
activeUsers: number;
|
|
201
271
|
cost: number;
|
|
272
|
+
tokenUsage: number;
|
|
202
273
|
}>;
|
|
203
274
|
};
|
|
204
275
|
post: {
|
|
@@ -209,14 +280,14 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
|
|
|
209
280
|
}>;
|
|
210
281
|
};
|
|
211
282
|
put: {};
|
|
212
|
-
head: {};
|
|
213
283
|
delete: {
|
|
214
284
|
"/tenants/:tenantId/subscription": import("@withtyped/server").PathGuard<"/:tenantId/subscription", unknown, unknown, unknown>;
|
|
215
285
|
};
|
|
216
286
|
copy: {};
|
|
287
|
+
head: {};
|
|
217
288
|
}, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
|
|
218
|
-
options: {};
|
|
219
289
|
patch: {};
|
|
290
|
+
options: {};
|
|
220
291
|
get: {
|
|
221
292
|
"/services/mails/usage": import("@withtyped/server").PathGuard<"/mails/usage", {
|
|
222
293
|
from?: string | undefined;
|
|
@@ -227,12 +298,14 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
|
|
|
227
298
|
post: {
|
|
228
299
|
"/services/mails": import("@withtyped/server").PathGuard<"/mails", unknown, {
|
|
229
300
|
data: {
|
|
230
|
-
type: VerificationCodeType;
|
|
301
|
+
type: TemplateType | VerificationCodeType;
|
|
231
302
|
payload: {
|
|
303
|
+
code?: string | undefined;
|
|
304
|
+
link?: string | undefined;
|
|
305
|
+
} & Record<string, string> & {
|
|
232
306
|
senderName?: string | undefined;
|
|
233
307
|
companyInformation?: string | undefined;
|
|
234
308
|
appLogo?: string | undefined;
|
|
235
|
-
code: string;
|
|
236
309
|
};
|
|
237
310
|
to: string;
|
|
238
311
|
};
|
|
@@ -240,28 +313,71 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
|
|
|
240
313
|
} & {
|
|
241
314
|
"/services/send-sms": import("@withtyped/server").PathGuard<"/send-sms", unknown, {
|
|
242
315
|
data: {
|
|
243
|
-
type: VerificationCodeType;
|
|
316
|
+
type: TemplateType | VerificationCodeType;
|
|
244
317
|
to: string;
|
|
245
318
|
payload: {
|
|
246
|
-
code
|
|
247
|
-
|
|
319
|
+
code?: string | undefined;
|
|
320
|
+
link?: string | undefined;
|
|
321
|
+
} & Record<string, string>;
|
|
248
322
|
};
|
|
249
323
|
}, unknown>;
|
|
324
|
+
} & {
|
|
325
|
+
"/services/custom-jwt": import("@withtyped/server").PathGuard<"/custom-jwt", {
|
|
326
|
+
isTest?: string | undefined;
|
|
327
|
+
}, {
|
|
328
|
+
script: string;
|
|
329
|
+
tokenType: LogtoJwtTokenKeyType.AccessToken;
|
|
330
|
+
token: Record<string, Json>;
|
|
331
|
+
context: Record<string, Json>;
|
|
332
|
+
environmentVariables?: Record<string, string> | undefined;
|
|
333
|
+
} | {
|
|
334
|
+
script: string;
|
|
335
|
+
tokenType: LogtoJwtTokenKeyType.ClientCredentials;
|
|
336
|
+
token: Record<string, Json>;
|
|
337
|
+
environmentVariables?: Record<string, string> | undefined;
|
|
338
|
+
}, Record<string, unknown>>;
|
|
339
|
+
};
|
|
340
|
+
put: {
|
|
341
|
+
"/services/custom-jwt/worker": import("@withtyped/server").PathGuard<"/custom-jwt/worker", unknown, {
|
|
342
|
+
"jwt.accessToken"?: {
|
|
343
|
+
production?: string | undefined;
|
|
344
|
+
test?: string | undefined;
|
|
345
|
+
} | undefined;
|
|
346
|
+
"jwt.clientCredentials"?: {
|
|
347
|
+
production?: string | undefined;
|
|
348
|
+
test?: string | undefined;
|
|
349
|
+
} | undefined;
|
|
350
|
+
}, unknown>;
|
|
351
|
+
};
|
|
352
|
+
delete: {
|
|
353
|
+
"/services/custom-jwt/worker": import("@withtyped/server").PathGuard<"/custom-jwt/worker", unknown, unknown, unknown>;
|
|
250
354
|
};
|
|
251
|
-
put: {};
|
|
252
|
-
head: {};
|
|
253
|
-
delete: {};
|
|
254
355
|
copy: {};
|
|
356
|
+
head: {};
|
|
255
357
|
}, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
|
|
256
|
-
options: {};
|
|
257
358
|
patch: {};
|
|
359
|
+
options: {};
|
|
258
360
|
get: {
|
|
259
361
|
"/subscription-plans": import("@withtyped/server").PathGuard<"/", unknown, unknown, {
|
|
260
|
-
createdAt: Date;
|
|
261
362
|
id: string;
|
|
363
|
+
createdAt: Date;
|
|
262
364
|
name: string;
|
|
365
|
+
updatedAt: Date;
|
|
366
|
+
stripeProducts: {
|
|
367
|
+
type: "flat" | "tier1" | "tier2" | "tier3";
|
|
368
|
+
id: string;
|
|
369
|
+
name: string;
|
|
370
|
+
price: {
|
|
371
|
+
id: string;
|
|
372
|
+
unitAmountDecimal: string;
|
|
373
|
+
quantity?: 1 | undefined;
|
|
374
|
+
unitAmount?: number | null | undefined;
|
|
375
|
+
};
|
|
376
|
+
description?: string | undefined;
|
|
377
|
+
}[];
|
|
263
378
|
quota: {
|
|
264
379
|
mauLimit: number | null;
|
|
380
|
+
tokenLimit: number | null;
|
|
265
381
|
applicationsLimit: number | null;
|
|
266
382
|
machineToMachineLimit: number | null;
|
|
267
383
|
resourcesLimit: number | null;
|
|
@@ -272,82 +388,58 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
|
|
|
272
388
|
socialConnectorsLimit: number | null;
|
|
273
389
|
standardConnectorsLimit: number | null;
|
|
274
390
|
rolesLimit: number | null;
|
|
391
|
+
machineToMachineRolesLimit: number | null;
|
|
275
392
|
scopesPerRoleLimit: number | null;
|
|
276
393
|
hooksLimit: number | null;
|
|
277
394
|
auditLogsRetentionDays: number | null;
|
|
278
395
|
mfaEnabled: boolean;
|
|
396
|
+
organizationsEnabled: boolean;
|
|
397
|
+
ssoEnabled: boolean;
|
|
398
|
+
thirdPartyApplicationsLimit: number | null;
|
|
399
|
+
tenantMembersLimit: number | null;
|
|
400
|
+
customJwtEnabled: boolean;
|
|
279
401
|
};
|
|
280
|
-
stripeProducts: {
|
|
281
|
-
description?: string | undefined;
|
|
282
|
-
type: "flat" | "tier1" | "tier2" | "tier3";
|
|
283
|
-
id: string;
|
|
284
|
-
name: string;
|
|
285
|
-
price: {
|
|
286
|
-
quantity?: 1 | undefined;
|
|
287
|
-
unitAmount?: number | null | undefined;
|
|
288
|
-
id: string;
|
|
289
|
-
unitAmountDecimal: string;
|
|
290
|
-
};
|
|
291
|
-
}[];
|
|
292
|
-
updatedAt: Date;
|
|
293
402
|
}[]>;
|
|
294
403
|
};
|
|
295
404
|
post: {};
|
|
296
405
|
put: {};
|
|
297
|
-
head: {};
|
|
298
406
|
delete: {};
|
|
299
407
|
copy: {};
|
|
300
|
-
}, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
|
|
301
|
-
options: {};
|
|
302
|
-
patch: {};
|
|
303
|
-
get: {
|
|
304
|
-
"/my/tenant": import("@withtyped/server").PathGuard<"/tenant", unknown, unknown, {
|
|
305
|
-
name: string;
|
|
306
|
-
id: string;
|
|
307
|
-
indicator: string;
|
|
308
|
-
isSuspended: boolean;
|
|
309
|
-
tag: TenantTag;
|
|
310
|
-
}>;
|
|
311
|
-
};
|
|
312
|
-
post: {};
|
|
313
|
-
put: {};
|
|
314
408
|
head: {};
|
|
315
|
-
delete: {};
|
|
316
|
-
copy: {};
|
|
317
409
|
}, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
|
|
318
|
-
options: {};
|
|
319
410
|
patch: {};
|
|
411
|
+
options: {};
|
|
320
412
|
get: {
|
|
321
413
|
"/checkout-session/:id": import("@withtyped/server").PathGuard<"/:id", unknown, unknown, {
|
|
322
|
-
status: "open" | "complete" | "expired";
|
|
323
|
-
createdAt: Date;
|
|
324
414
|
id: string;
|
|
415
|
+
createdAt: Date;
|
|
325
416
|
userId: string;
|
|
326
|
-
|
|
417
|
+
status: "open" | "complete" | "expired";
|
|
327
418
|
tenantId: string | null;
|
|
419
|
+
updatedAt: Date;
|
|
328
420
|
planId: string;
|
|
329
421
|
}>;
|
|
330
422
|
};
|
|
331
423
|
post: {
|
|
332
424
|
"/checkout-session": import("@withtyped/server").PathGuard<"/", unknown, {
|
|
425
|
+
planId: string;
|
|
426
|
+
successCallbackUrl: string;
|
|
333
427
|
tenantId?: string | undefined;
|
|
428
|
+
cancelCallbackUrl?: string | undefined;
|
|
334
429
|
tenantTag?: TenantTag | undefined;
|
|
335
430
|
tenantName?: string | undefined;
|
|
336
|
-
cancelCallbackUrl?: string | undefined;
|
|
337
|
-
planId: string;
|
|
338
|
-
successCallbackUrl: string;
|
|
339
431
|
}, {
|
|
340
|
-
redirectUri?: string | null | undefined;
|
|
341
432
|
sessionId: string;
|
|
433
|
+
redirectUri?: string | null | undefined;
|
|
342
434
|
}>;
|
|
343
435
|
};
|
|
344
436
|
put: {};
|
|
345
|
-
head: {};
|
|
346
437
|
delete: {};
|
|
347
438
|
copy: {};
|
|
439
|
+
head: {};
|
|
348
440
|
}, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
|
|
349
|
-
options: {};
|
|
350
441
|
patch: {};
|
|
442
|
+
options: {};
|
|
351
443
|
get: {
|
|
352
444
|
"/affiliates": import("@withtyped/server").PathGuard<"/", unknown, unknown, AffiliateData[]>;
|
|
353
445
|
};
|
|
@@ -355,57 +447,191 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
|
|
|
355
447
|
"/affiliates": import("@withtyped/server").PathGuard<"/", unknown, {
|
|
356
448
|
name: string;
|
|
357
449
|
}, {
|
|
358
|
-
createdAt: Date;
|
|
359
450
|
id: string;
|
|
451
|
+
createdAt: Date;
|
|
360
452
|
name: string;
|
|
361
453
|
}>;
|
|
362
454
|
} & {
|
|
363
455
|
"/affiliates/:id/properties": import("@withtyped/server").PathGuard<"/:id/properties", unknown, {
|
|
364
|
-
value: string;
|
|
365
456
|
type: "hostname" | "query";
|
|
366
|
-
}, {
|
|
367
457
|
value: string;
|
|
368
|
-
|
|
458
|
+
}, {
|
|
369
459
|
createdAt: Date;
|
|
370
460
|
affiliateId: string;
|
|
461
|
+
type: "hostname" | "query";
|
|
462
|
+
value: string;
|
|
371
463
|
}>;
|
|
372
464
|
};
|
|
373
465
|
put: {};
|
|
374
|
-
head: {};
|
|
375
466
|
delete: {
|
|
376
467
|
"/affiliates/:id/properties": import("@withtyped/server").PathGuard<"/:id/properties", unknown, {
|
|
377
|
-
value: string;
|
|
378
468
|
type: "hostname" | "query";
|
|
469
|
+
value: string;
|
|
379
470
|
}, unknown>;
|
|
380
471
|
};
|
|
381
472
|
copy: {};
|
|
473
|
+
head: {};
|
|
382
474
|
}, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
|
|
383
|
-
options: {};
|
|
384
475
|
patch: {};
|
|
476
|
+
options: {};
|
|
385
477
|
get: {};
|
|
386
478
|
post: {
|
|
387
479
|
"/affiliate-logs": import("@withtyped/server").PathGuard<"/", unknown, {
|
|
388
|
-
hostname?: string | undefined;
|
|
389
|
-
query?: string | undefined;
|
|
390
480
|
createdAt: string;
|
|
391
481
|
userId: string;
|
|
482
|
+
hostname?: string | undefined;
|
|
483
|
+
query?: string | undefined;
|
|
392
484
|
}, {
|
|
393
|
-
createdAt: Date;
|
|
394
485
|
id: string;
|
|
486
|
+
createdAt: Date;
|
|
395
487
|
affiliateId: string | null;
|
|
396
488
|
userId: string;
|
|
397
489
|
createdVia: {
|
|
490
|
+
createdAt: string;
|
|
398
491
|
hostname?: string | undefined;
|
|
399
492
|
query?: string | undefined;
|
|
400
|
-
createdAt: string;
|
|
401
493
|
};
|
|
402
494
|
}>;
|
|
403
495
|
};
|
|
404
496
|
put: {};
|
|
497
|
+
delete: {};
|
|
498
|
+
copy: {};
|
|
405
499
|
head: {};
|
|
500
|
+
}, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
|
|
501
|
+
patch: {
|
|
502
|
+
"/invitations/:invitationId/status": import("@withtyped/server").PathGuard<"/:invitationId/status", unknown, {
|
|
503
|
+
status: OrganizationInvitationStatus.Accepted;
|
|
504
|
+
}, unknown>;
|
|
505
|
+
};
|
|
506
|
+
options: {};
|
|
507
|
+
get: {
|
|
508
|
+
"/invitations": import("@withtyped/server").PathGuard<"/", unknown, unknown, ({
|
|
509
|
+
id: string;
|
|
510
|
+
createdAt: number;
|
|
511
|
+
status: OrganizationInvitationStatus;
|
|
512
|
+
tenantId: string;
|
|
513
|
+
updatedAt: number;
|
|
514
|
+
inviterId: string | null;
|
|
515
|
+
invitee: string;
|
|
516
|
+
acceptedUserId: string | null;
|
|
517
|
+
organizationId: string;
|
|
518
|
+
expiresAt: number;
|
|
519
|
+
organizationRoles: OrganizationRoleEntity[];
|
|
520
|
+
} & {
|
|
521
|
+
tenantTag: TenantTag;
|
|
522
|
+
tenantName: string;
|
|
523
|
+
})[]>;
|
|
524
|
+
} & {
|
|
525
|
+
"/invitations/:invitationId": import("@withtyped/server").PathGuard<"/:invitationId", unknown, unknown, {
|
|
526
|
+
id: string;
|
|
527
|
+
createdAt: number;
|
|
528
|
+
status: OrganizationInvitationStatus;
|
|
529
|
+
tenantId: string;
|
|
530
|
+
updatedAt: number;
|
|
531
|
+
inviterId: string | null;
|
|
532
|
+
invitee: string;
|
|
533
|
+
acceptedUserId: string | null;
|
|
534
|
+
organizationId: string;
|
|
535
|
+
expiresAt: number;
|
|
536
|
+
organizationRoles: OrganizationRoleEntity[];
|
|
537
|
+
}>;
|
|
538
|
+
};
|
|
539
|
+
post: {};
|
|
540
|
+
put: {};
|
|
406
541
|
delete: {};
|
|
407
542
|
copy: {};
|
|
543
|
+
head: {};
|
|
408
544
|
}, "/api">>, "/api">;
|
|
545
|
+
export declare const tenantAuthRouter: import("@withtyped/server").Router<RequestContext, import("@withtyped/server").WithBodyContext<import("@withtyped/server").BaseContext & {
|
|
546
|
+
request: {
|
|
547
|
+
id?: string | undefined;
|
|
548
|
+
method?: import("@withtyped/server").RequestMethod | undefined;
|
|
549
|
+
headers: import("http").IncomingHttpHeaders;
|
|
550
|
+
url: URL;
|
|
551
|
+
body?: unknown;
|
|
552
|
+
};
|
|
553
|
+
}>, import("@withtyped/server").MergeRoutes<import("@withtyped/server").BaseRoutes, import("@withtyped/server").RoutesWithPrefix<{
|
|
554
|
+
patch: {
|
|
555
|
+
"/:tenantId/invitations/:invitationId/status": import("@withtyped/server").PathGuard<"/:tenantId/invitations/:invitationId/status", unknown, {
|
|
556
|
+
status: OrganizationInvitationStatus.Revoked;
|
|
557
|
+
}, {
|
|
558
|
+
id: string;
|
|
559
|
+
createdAt: number;
|
|
560
|
+
status: OrganizationInvitationStatus;
|
|
561
|
+
tenantId: string;
|
|
562
|
+
updatedAt: number;
|
|
563
|
+
inviterId: string | null;
|
|
564
|
+
invitee: string;
|
|
565
|
+
acceptedUserId: string | null;
|
|
566
|
+
organizationId: string;
|
|
567
|
+
expiresAt: number;
|
|
568
|
+
organizationRoles: OrganizationRoleEntity[];
|
|
569
|
+
}>;
|
|
570
|
+
};
|
|
571
|
+
options: {};
|
|
572
|
+
get: {
|
|
573
|
+
"/:tenantId/members": import("@withtyped/server").PathGuard<"/:tenantId/members", unknown, unknown, {
|
|
574
|
+
id: string;
|
|
575
|
+
name: string | null;
|
|
576
|
+
username: string | null;
|
|
577
|
+
primaryEmail: string | null;
|
|
578
|
+
primaryPhone: string | null;
|
|
579
|
+
avatar: string | null;
|
|
580
|
+
organizationRoles: OrganizationRoleEntity[];
|
|
581
|
+
}[]>;
|
|
582
|
+
} & {
|
|
583
|
+
"/:tenantId/members/:userId/scopes": import("@withtyped/server").PathGuard<"/:tenantId/members/:userId/scopes", unknown, unknown, OrganizationScope[]>;
|
|
584
|
+
} & {
|
|
585
|
+
"/:tenantId/invitations": import("@withtyped/server").PathGuard<"/:tenantId/invitations", unknown, unknown, ({
|
|
586
|
+
id: string;
|
|
587
|
+
createdAt: number;
|
|
588
|
+
status: OrganizationInvitationStatus;
|
|
589
|
+
tenantId: string;
|
|
590
|
+
updatedAt: number;
|
|
591
|
+
inviterId: string | null;
|
|
592
|
+
invitee: string;
|
|
593
|
+
acceptedUserId: string | null;
|
|
594
|
+
organizationId: string;
|
|
595
|
+
expiresAt: number;
|
|
596
|
+
organizationRoles: OrganizationRoleEntity[];
|
|
597
|
+
} & {
|
|
598
|
+
inviterName?: string | undefined;
|
|
599
|
+
})[]>;
|
|
600
|
+
};
|
|
601
|
+
post: {
|
|
602
|
+
"/:tenantId/invitations": import("@withtyped/server").PathGuard<"/:tenantId/invitations", unknown, {
|
|
603
|
+
invitee: string;
|
|
604
|
+
roleName: TenantRole;
|
|
605
|
+
expiresAt?: number | undefined;
|
|
606
|
+
}, {
|
|
607
|
+
id: string;
|
|
608
|
+
createdAt: number;
|
|
609
|
+
status: OrganizationInvitationStatus;
|
|
610
|
+
tenantId: string;
|
|
611
|
+
updatedAt: number;
|
|
612
|
+
inviterId: string | null;
|
|
613
|
+
invitee: string;
|
|
614
|
+
acceptedUserId: string | null;
|
|
615
|
+
organizationId: string;
|
|
616
|
+
expiresAt: number;
|
|
617
|
+
organizationRoles: OrganizationRoleEntity[];
|
|
618
|
+
}>;
|
|
619
|
+
} & {
|
|
620
|
+
"/:tenantId/invitations/:invitationId/message": import("@withtyped/server").PathGuard<"/:tenantId/invitations/:invitationId/message", unknown, unknown, unknown>;
|
|
621
|
+
};
|
|
622
|
+
put: {
|
|
623
|
+
"/:tenantId/members/:userId/roles": import("@withtyped/server").PathGuard<"/:tenantId/members/:userId/roles", unknown, {
|
|
624
|
+
roleName: TenantRole;
|
|
625
|
+
}, unknown>;
|
|
626
|
+
};
|
|
627
|
+
delete: {
|
|
628
|
+
"/:tenantId/members/:userId": import("@withtyped/server").PathGuard<"/:tenantId/members/:userId", unknown, unknown, unknown>;
|
|
629
|
+
} & {
|
|
630
|
+
"/:tenantId/invitations/:invitationId": import("@withtyped/server").PathGuard<"/:tenantId/invitations/:invitationId", unknown, unknown, unknown>;
|
|
631
|
+
};
|
|
632
|
+
copy: {};
|
|
633
|
+
head: {};
|
|
634
|
+
}, "/api/tenants">>, "/api/tenants">;
|
|
409
635
|
|
|
410
636
|
export {
|
|
411
637
|
router as default,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@logto/cloud",
|
|
3
|
-
"version": "0.2.5-
|
|
3
|
+
"version": "0.2.5-4917039",
|
|
4
4
|
"description": "Logto Cloud service.",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"author": "Silverhand Inc. <contact@silverhand.io>",
|
|
@@ -16,25 +16,24 @@
|
|
|
16
16
|
"#src/*": "./build/*"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@silverhand/eslint-config": "
|
|
20
|
-
"@silverhand/
|
|
21
|
-
"@silverhand/ts-config": "4.0.0",
|
|
19
|
+
"@silverhand/eslint-config": "6.0.1",
|
|
20
|
+
"@silverhand/ts-config": "6.0.0",
|
|
22
21
|
"@types/accepts": "^1.3.5",
|
|
23
22
|
"@types/http-proxy": "^1.17.9",
|
|
24
|
-
"@types/jest": "^29.4.0",
|
|
25
23
|
"@types/mime-types": "^2.1.1",
|
|
26
|
-
"@types/node": "^
|
|
24
|
+
"@types/node": "^20.0.0",
|
|
27
25
|
"@types/yargs": "^17.0.24",
|
|
28
|
-
"dts-bundle-generator": "^
|
|
29
|
-
"eslint": "^8.
|
|
30
|
-
"
|
|
31
|
-
"lint-staged": "^14.0.0",
|
|
26
|
+
"dts-bundle-generator": "^9.3.1",
|
|
27
|
+
"eslint": "^8.57.0",
|
|
28
|
+
"lint-staged": "^15.0.0",
|
|
32
29
|
"nodemon": "^3.0.0",
|
|
33
30
|
"prettier": "^3.0.0",
|
|
34
|
-
"typescript": "^5.
|
|
31
|
+
"typescript": "^5.3.3",
|
|
32
|
+
"vite-tsconfig-paths": "^4.3.1",
|
|
33
|
+
"vitest": "^1.5.0"
|
|
35
34
|
},
|
|
36
35
|
"engines": {
|
|
37
|
-
"node": "^
|
|
36
|
+
"node": "^20.9.0"
|
|
38
37
|
},
|
|
39
38
|
"eslintConfig": {
|
|
40
39
|
"extends": "@silverhand",
|
|
@@ -50,22 +49,19 @@
|
|
|
50
49
|
"access": "public"
|
|
51
50
|
},
|
|
52
51
|
"dependencies": {
|
|
53
|
-
"@silverhand/essentials": "^2.
|
|
54
|
-
"@withtyped/server": "^0.
|
|
52
|
+
"@silverhand/essentials": "^2.9.0",
|
|
53
|
+
"@withtyped/server": "^0.13.6"
|
|
55
54
|
},
|
|
56
55
|
"scripts": {
|
|
57
56
|
"precommit": "lint-staged",
|
|
58
57
|
"build": "rm -rf build/ && tsc -p tsconfig.build.json && pnpm build:lib",
|
|
59
58
|
"//": "It is not used to build the service itself.",
|
|
60
|
-
"build:lib": "rm -rf lib/ && dts-bundle-generator src/routes/index.ts --project tsconfig.build.json -o lib/routes/index.d.ts",
|
|
61
|
-
"build:test": "rm -rf build/ && tsc -p tsconfig.test.json --sourcemap",
|
|
59
|
+
"build:lib": "rm -rf lib/ && dts-bundle-generator src/routes/index.ts --project tsconfig.build.lib.json -o lib/routes/index.d.ts",
|
|
62
60
|
"lint": "eslint --ext .ts src",
|
|
63
61
|
"lint:report": "pnpm lint --format json --output-file report.json",
|
|
64
62
|
"dev": "rm -rf build/ && nodemon",
|
|
65
63
|
"start": "NODE_ENV=production node .",
|
|
66
|
-
"test
|
|
67
|
-
"test": "pnpm build:test && pnpm test:only && pnpm build:lib && pnpm test:types",
|
|
68
|
-
"test:ci": "pnpm test:only --coverage --silent",
|
|
64
|
+
"test": "vitest && pnpm build:lib && pnpm test:types",
|
|
69
65
|
"test:types": "tsc -p tsconfig.test.types.json",
|
|
70
66
|
"cli": "node ./build/cli/index.js"
|
|
71
67
|
}
|