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