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