@logto/cloud 0.2.5-9257c0d → 0.2.5-94f7bcc
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 +288 -81
- 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 LogtoJwtTokenKeyType {
|
|
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,28 +301,69 @@ 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: LogtoJwtTokenKeyType.AccessToken;
|
|
316
|
+
token: Record<string, Json>;
|
|
317
|
+
context: Record<string, Json>;
|
|
318
|
+
environmentVariables?: Record<string, string> | undefined;
|
|
319
|
+
} | {
|
|
320
|
+
script: string;
|
|
321
|
+
tokenType: LogtoJwtTokenKeyType.ClientCredentials;
|
|
322
|
+
token: Record<string, Json>;
|
|
323
|
+
environmentVariables?: Record<string, string> | undefined;
|
|
324
|
+
}, Record<string, unknown>>;
|
|
325
|
+
};
|
|
326
|
+
put: {
|
|
327
|
+
"/services/custom-jwt/worker": import("@withtyped/server").PathGuard<"/custom-jwt/worker", unknown, {
|
|
328
|
+
production?: {
|
|
329
|
+
"jwt.accessToken"?: string | undefined;
|
|
330
|
+
"jwt.clientCredentials"?: string | undefined;
|
|
331
|
+
} | undefined;
|
|
332
|
+
test?: {
|
|
333
|
+
"jwt.accessToken"?: string | undefined;
|
|
334
|
+
"jwt.clientCredentials"?: string | undefined;
|
|
335
|
+
} | undefined;
|
|
336
|
+
}, unknown>;
|
|
337
|
+
};
|
|
338
|
+
delete: {
|
|
339
|
+
"/services/custom-jwt/worker": import("@withtyped/server").PathGuard<"/custom-jwt/worker", unknown, unknown, unknown>;
|
|
251
340
|
};
|
|
252
|
-
put: {};
|
|
253
|
-
delete: {};
|
|
254
341
|
copy: {};
|
|
255
342
|
head: {};
|
|
256
343
|
}, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
|
|
257
|
-
options: {};
|
|
258
344
|
patch: {};
|
|
345
|
+
options: {};
|
|
259
346
|
get: {
|
|
260
347
|
"/subscription-plans": import("@withtyped/server").PathGuard<"/", unknown, unknown, {
|
|
261
|
-
createdAt: Date;
|
|
262
348
|
id: string;
|
|
349
|
+
createdAt: Date;
|
|
263
350
|
name: string;
|
|
351
|
+
updatedAt: Date;
|
|
352
|
+
stripeProducts: {
|
|
353
|
+
type: "flat" | "tier1" | "tier2" | "tier3";
|
|
354
|
+
id: string;
|
|
355
|
+
name: string;
|
|
356
|
+
price: {
|
|
357
|
+
id: string;
|
|
358
|
+
unitAmountDecimal: string;
|
|
359
|
+
quantity?: 1 | undefined;
|
|
360
|
+
unitAmount?: number | null | undefined;
|
|
361
|
+
};
|
|
362
|
+
description?: string | undefined;
|
|
363
|
+
}[];
|
|
264
364
|
quota: {
|
|
265
365
|
mauLimit: number | null;
|
|
366
|
+
tokenLimit: number | null;
|
|
266
367
|
applicationsLimit: number | null;
|
|
267
368
|
machineToMachineLimit: number | null;
|
|
268
369
|
resourcesLimit: number | null;
|
|
@@ -273,25 +374,17 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
|
|
|
273
374
|
socialConnectorsLimit: number | null;
|
|
274
375
|
standardConnectorsLimit: number | null;
|
|
275
376
|
rolesLimit: number | null;
|
|
377
|
+
machineToMachineRolesLimit: number | null;
|
|
276
378
|
scopesPerRoleLimit: number | null;
|
|
277
379
|
hooksLimit: number | null;
|
|
278
380
|
auditLogsRetentionDays: number | null;
|
|
279
381
|
mfaEnabled: boolean;
|
|
280
382
|
organizationsEnabled: boolean;
|
|
383
|
+
ssoEnabled: boolean;
|
|
384
|
+
thirdPartyApplicationsLimit: number | null;
|
|
385
|
+
tenantMembersLimit: number | null;
|
|
386
|
+
customJwtEnabled: boolean;
|
|
281
387
|
};
|
|
282
|
-
stripeProducts: {
|
|
283
|
-
type: "flat" | "tier1" | "tier2" | "tier3";
|
|
284
|
-
id: string;
|
|
285
|
-
name: string;
|
|
286
|
-
price: {
|
|
287
|
-
id: string;
|
|
288
|
-
unitAmountDecimal: string;
|
|
289
|
-
quantity?: 1 | undefined;
|
|
290
|
-
unitAmount?: number | null | undefined;
|
|
291
|
-
};
|
|
292
|
-
description?: string | undefined;
|
|
293
|
-
}[];
|
|
294
|
-
updatedAt: Date;
|
|
295
388
|
}[]>;
|
|
296
389
|
};
|
|
297
390
|
post: {};
|
|
@@ -300,33 +393,16 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
|
|
|
300
393
|
copy: {};
|
|
301
394
|
head: {};
|
|
302
395
|
}, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
|
|
303
|
-
options: {};
|
|
304
396
|
patch: {};
|
|
305
|
-
get: {
|
|
306
|
-
"/my/tenant": import("@withtyped/server").PathGuard<"/tenant", unknown, unknown, {
|
|
307
|
-
name: string;
|
|
308
|
-
id: string;
|
|
309
|
-
indicator: string;
|
|
310
|
-
isSuspended: boolean;
|
|
311
|
-
tag: TenantTag;
|
|
312
|
-
}>;
|
|
313
|
-
};
|
|
314
|
-
post: {};
|
|
315
|
-
put: {};
|
|
316
|
-
delete: {};
|
|
317
|
-
copy: {};
|
|
318
|
-
head: {};
|
|
319
|
-
}, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
|
|
320
397
|
options: {};
|
|
321
|
-
patch: {};
|
|
322
398
|
get: {
|
|
323
399
|
"/checkout-session/:id": import("@withtyped/server").PathGuard<"/:id", unknown, unknown, {
|
|
324
|
-
status: "open" | "complete" | "expired";
|
|
325
|
-
createdAt: Date;
|
|
326
400
|
id: string;
|
|
401
|
+
createdAt: Date;
|
|
327
402
|
userId: string;
|
|
328
|
-
|
|
403
|
+
status: "open" | "complete" | "expired";
|
|
329
404
|
tenantId: string | null;
|
|
405
|
+
updatedAt: Date;
|
|
330
406
|
planId: string;
|
|
331
407
|
}>;
|
|
332
408
|
};
|
|
@@ -348,8 +424,8 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
|
|
|
348
424
|
copy: {};
|
|
349
425
|
head: {};
|
|
350
426
|
}, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
|
|
351
|
-
options: {};
|
|
352
427
|
patch: {};
|
|
428
|
+
options: {};
|
|
353
429
|
get: {
|
|
354
430
|
"/affiliates": import("@withtyped/server").PathGuard<"/", unknown, unknown, AffiliateData[]>;
|
|
355
431
|
};
|
|
@@ -357,33 +433,33 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
|
|
|
357
433
|
"/affiliates": import("@withtyped/server").PathGuard<"/", unknown, {
|
|
358
434
|
name: string;
|
|
359
435
|
}, {
|
|
360
|
-
createdAt: Date;
|
|
361
436
|
id: string;
|
|
437
|
+
createdAt: Date;
|
|
362
438
|
name: string;
|
|
363
439
|
}>;
|
|
364
440
|
} & {
|
|
365
441
|
"/affiliates/:id/properties": import("@withtyped/server").PathGuard<"/:id/properties", unknown, {
|
|
366
|
-
value: string;
|
|
367
442
|
type: "hostname" | "query";
|
|
368
|
-
}, {
|
|
369
443
|
value: string;
|
|
370
|
-
|
|
444
|
+
}, {
|
|
371
445
|
createdAt: Date;
|
|
372
446
|
affiliateId: string;
|
|
447
|
+
type: "hostname" | "query";
|
|
448
|
+
value: string;
|
|
373
449
|
}>;
|
|
374
450
|
};
|
|
375
451
|
put: {};
|
|
376
452
|
delete: {
|
|
377
453
|
"/affiliates/:id/properties": import("@withtyped/server").PathGuard<"/:id/properties", unknown, {
|
|
378
|
-
value: string;
|
|
379
454
|
type: "hostname" | "query";
|
|
455
|
+
value: string;
|
|
380
456
|
}, unknown>;
|
|
381
457
|
};
|
|
382
458
|
copy: {};
|
|
383
459
|
head: {};
|
|
384
460
|
}, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
|
|
385
|
-
options: {};
|
|
386
461
|
patch: {};
|
|
462
|
+
options: {};
|
|
387
463
|
get: {};
|
|
388
464
|
post: {
|
|
389
465
|
"/affiliate-logs": import("@withtyped/server").PathGuard<"/", unknown, {
|
|
@@ -392,8 +468,8 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
|
|
|
392
468
|
hostname?: string | undefined;
|
|
393
469
|
query?: string | undefined;
|
|
394
470
|
}, {
|
|
395
|
-
createdAt: Date;
|
|
396
471
|
id: string;
|
|
472
|
+
createdAt: Date;
|
|
397
473
|
affiliateId: string | null;
|
|
398
474
|
userId: string;
|
|
399
475
|
createdVia: {
|
|
@@ -407,7 +483,138 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
|
|
|
407
483
|
delete: {};
|
|
408
484
|
copy: {};
|
|
409
485
|
head: {};
|
|
486
|
+
}, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
|
|
487
|
+
patch: {
|
|
488
|
+
"/invitations/:invitationId/status": import("@withtyped/server").PathGuard<"/:invitationId/status", unknown, {
|
|
489
|
+
status: OrganizationInvitationStatus.Accepted;
|
|
490
|
+
}, unknown>;
|
|
491
|
+
};
|
|
492
|
+
options: {};
|
|
493
|
+
get: {
|
|
494
|
+
"/invitations": import("@withtyped/server").PathGuard<"/", unknown, unknown, ({
|
|
495
|
+
id: string;
|
|
496
|
+
createdAt: number;
|
|
497
|
+
status: OrganizationInvitationStatus;
|
|
498
|
+
tenantId: string;
|
|
499
|
+
updatedAt: number;
|
|
500
|
+
inviterId: string | null;
|
|
501
|
+
invitee: string;
|
|
502
|
+
acceptedUserId: string | null;
|
|
503
|
+
organizationId: string;
|
|
504
|
+
expiresAt: number;
|
|
505
|
+
organizationRoles: OrganizationRoleEntity[];
|
|
506
|
+
} & {
|
|
507
|
+
tenantTag: TenantTag;
|
|
508
|
+
tenantName: string;
|
|
509
|
+
})[]>;
|
|
510
|
+
} & {
|
|
511
|
+
"/invitations/:invitationId": import("@withtyped/server").PathGuard<"/:invitationId", unknown, unknown, {
|
|
512
|
+
id: string;
|
|
513
|
+
createdAt: number;
|
|
514
|
+
status: OrganizationInvitationStatus;
|
|
515
|
+
tenantId: string;
|
|
516
|
+
updatedAt: number;
|
|
517
|
+
inviterId: string | null;
|
|
518
|
+
invitee: string;
|
|
519
|
+
acceptedUserId: string | null;
|
|
520
|
+
organizationId: string;
|
|
521
|
+
expiresAt: number;
|
|
522
|
+
organizationRoles: OrganizationRoleEntity[];
|
|
523
|
+
}>;
|
|
524
|
+
};
|
|
525
|
+
post: {};
|
|
526
|
+
put: {};
|
|
527
|
+
delete: {};
|
|
528
|
+
copy: {};
|
|
529
|
+
head: {};
|
|
410
530
|
}, "/api">>, "/api">;
|
|
531
|
+
export declare const tenantAuthRouter: import("@withtyped/server").Router<RequestContext, import("@withtyped/server").WithBodyContext<import("@withtyped/server").BaseContext & {
|
|
532
|
+
request: {
|
|
533
|
+
method?: import("@withtyped/server").RequestMethod | undefined;
|
|
534
|
+
headers: import("http").IncomingHttpHeaders;
|
|
535
|
+
url: URL;
|
|
536
|
+
body?: unknown;
|
|
537
|
+
};
|
|
538
|
+
}>, import("@withtyped/server").MergeRoutes<import("@withtyped/server").BaseRoutes, import("@withtyped/server").RoutesWithPrefix<{
|
|
539
|
+
patch: {
|
|
540
|
+
"/:tenantId/invitations/:invitationId/status": import("@withtyped/server").PathGuard<"/:tenantId/invitations/:invitationId/status", unknown, {
|
|
541
|
+
status: OrganizationInvitationStatus.Revoked;
|
|
542
|
+
}, {
|
|
543
|
+
id: string;
|
|
544
|
+
createdAt: number;
|
|
545
|
+
status: OrganizationInvitationStatus;
|
|
546
|
+
tenantId: string;
|
|
547
|
+
updatedAt: number;
|
|
548
|
+
inviterId: string | null;
|
|
549
|
+
invitee: string;
|
|
550
|
+
acceptedUserId: string | null;
|
|
551
|
+
organizationId: string;
|
|
552
|
+
expiresAt: number;
|
|
553
|
+
organizationRoles: OrganizationRoleEntity[];
|
|
554
|
+
}>;
|
|
555
|
+
};
|
|
556
|
+
options: {};
|
|
557
|
+
get: {
|
|
558
|
+
"/:tenantId/members": import("@withtyped/server").PathGuard<"/:tenantId/members", unknown, unknown, {
|
|
559
|
+
id: string;
|
|
560
|
+
name: string | null;
|
|
561
|
+
username: string | null;
|
|
562
|
+
primaryEmail: string | null;
|
|
563
|
+
primaryPhone: string | null;
|
|
564
|
+
avatar: string | null;
|
|
565
|
+
organizationRoles: OrganizationRoleEntity[];
|
|
566
|
+
}[]>;
|
|
567
|
+
} & {
|
|
568
|
+
"/:tenantId/invitations": import("@withtyped/server").PathGuard<"/:tenantId/invitations", unknown, unknown, ({
|
|
569
|
+
id: string;
|
|
570
|
+
createdAt: number;
|
|
571
|
+
status: OrganizationInvitationStatus;
|
|
572
|
+
tenantId: string;
|
|
573
|
+
updatedAt: number;
|
|
574
|
+
inviterId: string | null;
|
|
575
|
+
invitee: string;
|
|
576
|
+
acceptedUserId: string | null;
|
|
577
|
+
organizationId: string;
|
|
578
|
+
expiresAt: number;
|
|
579
|
+
organizationRoles: OrganizationRoleEntity[];
|
|
580
|
+
} & {
|
|
581
|
+
inviterName?: string | undefined;
|
|
582
|
+
})[]>;
|
|
583
|
+
};
|
|
584
|
+
post: {
|
|
585
|
+
"/:tenantId/invitations": import("@withtyped/server").PathGuard<"/:tenantId/invitations", unknown, {
|
|
586
|
+
invitee: string;
|
|
587
|
+
roleName: TenantRole;
|
|
588
|
+
expiresAt?: number | undefined;
|
|
589
|
+
}, {
|
|
590
|
+
id: string;
|
|
591
|
+
createdAt: number;
|
|
592
|
+
status: OrganizationInvitationStatus;
|
|
593
|
+
tenantId: string;
|
|
594
|
+
updatedAt: number;
|
|
595
|
+
inviterId: string | null;
|
|
596
|
+
invitee: string;
|
|
597
|
+
acceptedUserId: string | null;
|
|
598
|
+
organizationId: string;
|
|
599
|
+
expiresAt: number;
|
|
600
|
+
organizationRoles: OrganizationRoleEntity[];
|
|
601
|
+
}>;
|
|
602
|
+
} & {
|
|
603
|
+
"/:tenantId/invitations/:invitationId/message": import("@withtyped/server").PathGuard<"/:tenantId/invitations/:invitationId/message", unknown, unknown, unknown>;
|
|
604
|
+
};
|
|
605
|
+
put: {
|
|
606
|
+
"/:tenantId/members/:userId/roles": import("@withtyped/server").PathGuard<"/:tenantId/members/:userId/roles", unknown, {
|
|
607
|
+
roleName: TenantRole;
|
|
608
|
+
}, unknown>;
|
|
609
|
+
};
|
|
610
|
+
delete: {
|
|
611
|
+
"/:tenantId/members/:userId": import("@withtyped/server").PathGuard<"/:tenantId/members/:userId", unknown, unknown, unknown>;
|
|
612
|
+
} & {
|
|
613
|
+
"/:tenantId/invitations/:invitationId": import("@withtyped/server").PathGuard<"/:tenantId/invitations/:invitationId", unknown, unknown, unknown>;
|
|
614
|
+
};
|
|
615
|
+
copy: {};
|
|
616
|
+
head: {};
|
|
617
|
+
}, "/api/tenants">>, "/api/tenants">;
|
|
411
618
|
|
|
412
619
|
export {
|
|
413
620
|
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-94f7bcc",
|
|
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
|
}
|