@logto/cloud 0.2.5-71b7fea → 0.2.5-72891e6
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 +337 -102
- package/package.json +15 -19
package/lib/routes/index.d.ts
CHANGED
|
@@ -1,54 +1,126 @@
|
|
|
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>;
|
|
85
|
+
declare enum RegionName {
|
|
86
|
+
EU = "EU",
|
|
87
|
+
US = "US"
|
|
88
|
+
}
|
|
40
89
|
export type AffiliateData = Affiliate & {
|
|
41
90
|
properties: Array<Pick<AffiliateProperty, "type" | "value">>;
|
|
42
91
|
};
|
|
43
|
-
declare const router: import("@withtyped/server").Router<
|
|
44
|
-
|
|
92
|
+
declare const router: import("@withtyped/server").Router<RequestContext, WithAuthContext<Omit<import("@withtyped/server").BaseContext & {
|
|
93
|
+
request: {
|
|
94
|
+
id?: string | undefined;
|
|
95
|
+
method?: import("@withtyped/server").RequestMethod | undefined;
|
|
96
|
+
headers: import("http").IncomingHttpHeaders;
|
|
97
|
+
url: URL;
|
|
98
|
+
body?: unknown;
|
|
99
|
+
};
|
|
100
|
+
}, "request"> & {
|
|
101
|
+
request: Record<string, unknown> & {
|
|
102
|
+
id?: string | undefined;
|
|
103
|
+
method?: import("@withtyped/server").RequestMethod | undefined;
|
|
104
|
+
headers: import("http").IncomingHttpHeaders;
|
|
105
|
+
url: URL;
|
|
106
|
+
body?: unknown;
|
|
107
|
+
} & {
|
|
108
|
+
body?: Json | undefined;
|
|
109
|
+
bodyRaw?: Buffer | undefined;
|
|
110
|
+
};
|
|
111
|
+
}>, 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
112
|
patch: {
|
|
46
113
|
"/tenants/:tenantId": import("@withtyped/server").PathGuard<"/:tenantId", unknown, {
|
|
47
114
|
name?: string | undefined;
|
|
48
|
-
tag?: TenantTag | undefined;
|
|
49
115
|
}, {
|
|
50
116
|
id: string;
|
|
51
117
|
name: string;
|
|
118
|
+
createdAt: Date;
|
|
119
|
+
usage: {
|
|
120
|
+
activeUsers: number;
|
|
121
|
+
cost: number;
|
|
122
|
+
tokenUsage: number;
|
|
123
|
+
};
|
|
52
124
|
indicator: string;
|
|
53
125
|
isSuspended: boolean;
|
|
54
126
|
planId: string;
|
|
@@ -58,15 +130,12 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
|
|
|
58
130
|
currentPeriodStart: Date;
|
|
59
131
|
currentPeriodEnd: Date;
|
|
60
132
|
};
|
|
133
|
+
regionName: RegionName;
|
|
61
134
|
tag: TenantTag;
|
|
62
|
-
usage: {
|
|
63
|
-
activeUsers: number;
|
|
64
|
-
cost: number;
|
|
65
|
-
};
|
|
66
135
|
openInvoices: {
|
|
67
136
|
status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
|
|
68
|
-
createdAt: Date;
|
|
69
137
|
id: string;
|
|
138
|
+
createdAt: Date;
|
|
70
139
|
updatedAt: Date;
|
|
71
140
|
customerId: string | null;
|
|
72
141
|
billingReason: string | null;
|
|
@@ -80,10 +149,17 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
|
|
|
80
149
|
}[];
|
|
81
150
|
}>;
|
|
82
151
|
};
|
|
152
|
+
options: {};
|
|
83
153
|
get: {
|
|
84
154
|
"/tenants": import("@withtyped/server").PathGuard<"/", unknown, unknown, {
|
|
85
155
|
id: string;
|
|
86
156
|
name: string;
|
|
157
|
+
createdAt: Date;
|
|
158
|
+
usage: {
|
|
159
|
+
activeUsers: number;
|
|
160
|
+
cost: number;
|
|
161
|
+
tokenUsage: number;
|
|
162
|
+
};
|
|
87
163
|
indicator: string;
|
|
88
164
|
isSuspended: boolean;
|
|
89
165
|
planId: string;
|
|
@@ -93,15 +169,12 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
|
|
|
93
169
|
currentPeriodStart: Date;
|
|
94
170
|
currentPeriodEnd: Date;
|
|
95
171
|
};
|
|
172
|
+
regionName: RegionName;
|
|
96
173
|
tag: TenantTag;
|
|
97
|
-
usage: {
|
|
98
|
-
activeUsers: number;
|
|
99
|
-
cost: number;
|
|
100
|
-
};
|
|
101
174
|
openInvoices: {
|
|
102
175
|
status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
|
|
103
|
-
createdAt: Date;
|
|
104
176
|
id: string;
|
|
177
|
+
createdAt: Date;
|
|
105
178
|
updatedAt: Date;
|
|
106
179
|
customerId: string | null;
|
|
107
180
|
billingReason: string | null;
|
|
@@ -119,9 +192,16 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
|
|
|
119
192
|
"/tenants": import("@withtyped/server").PathGuard<"/", unknown, {
|
|
120
193
|
name?: string | undefined;
|
|
121
194
|
tag?: TenantTag | undefined;
|
|
195
|
+
regionName?: RegionName | undefined;
|
|
122
196
|
}, {
|
|
123
197
|
id: string;
|
|
124
198
|
name: string;
|
|
199
|
+
createdAt: Date;
|
|
200
|
+
usage: {
|
|
201
|
+
activeUsers: number;
|
|
202
|
+
cost: number;
|
|
203
|
+
tokenUsage: number;
|
|
204
|
+
};
|
|
125
205
|
indicator: string;
|
|
126
206
|
isSuspended: boolean;
|
|
127
207
|
planId: string;
|
|
@@ -131,15 +211,12 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
|
|
|
131
211
|
currentPeriodStart: Date;
|
|
132
212
|
currentPeriodEnd: Date;
|
|
133
213
|
};
|
|
214
|
+
regionName: RegionName;
|
|
134
215
|
tag: TenantTag;
|
|
135
|
-
usage: {
|
|
136
|
-
activeUsers: number;
|
|
137
|
-
cost: number;
|
|
138
|
-
};
|
|
139
216
|
openInvoices: {
|
|
140
217
|
status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
|
|
141
|
-
createdAt: Date;
|
|
142
218
|
id: string;
|
|
219
|
+
createdAt: Date;
|
|
143
220
|
updatedAt: Date;
|
|
144
221
|
customerId: string | null;
|
|
145
222
|
billingReason: string | null;
|
|
@@ -154,14 +231,14 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
|
|
|
154
231
|
}>;
|
|
155
232
|
};
|
|
156
233
|
put: {};
|
|
157
|
-
head: {};
|
|
158
234
|
delete: {
|
|
159
235
|
"/tenants/:tenantId": import("@withtyped/server").PathGuard<"/:tenantId", unknown, unknown, unknown>;
|
|
160
236
|
};
|
|
161
237
|
copy: {};
|
|
238
|
+
head: {};
|
|
162
239
|
}, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
|
|
163
|
-
options: {};
|
|
164
240
|
patch: {};
|
|
241
|
+
options: {};
|
|
165
242
|
get: {
|
|
166
243
|
"/tenants/my/subscription": import("@withtyped/server").PathGuard<"/my/subscription", unknown, unknown, {
|
|
167
244
|
status: "incomplete" | "incomplete_expired" | "trialing" | "active" | "past_due" | "canceled" | "unpaid" | "paused";
|
|
@@ -180,8 +257,8 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
|
|
|
180
257
|
"/tenants/:tenantId/invoices": import("@withtyped/server").PathGuard<"/:tenantId/invoices", unknown, unknown, {
|
|
181
258
|
invoices: {
|
|
182
259
|
status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
|
|
183
|
-
createdAt: Date;
|
|
184
260
|
id: string;
|
|
261
|
+
createdAt: Date;
|
|
185
262
|
updatedAt: Date;
|
|
186
263
|
customerId: string | null;
|
|
187
264
|
billingReason: string | null;
|
|
@@ -195,10 +272,15 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
|
|
|
195
272
|
planName: string | null;
|
|
196
273
|
}[];
|
|
197
274
|
}>;
|
|
275
|
+
} & {
|
|
276
|
+
"/tenants/:tenantId/invoices/:invoiceId/hosted-invoice-url": import("@withtyped/server").PathGuard<"/:tenantId/invoices/:invoiceId/hosted-invoice-url", unknown, unknown, {
|
|
277
|
+
hostedInvoiceUrl: string;
|
|
278
|
+
}>;
|
|
198
279
|
} & {
|
|
199
280
|
"/tenants/:tenantId/usage": import("@withtyped/server").PathGuard<"/:tenantId/usage", unknown, unknown, {
|
|
200
281
|
activeUsers: number;
|
|
201
282
|
cost: number;
|
|
283
|
+
tokenUsage: number;
|
|
202
284
|
}>;
|
|
203
285
|
};
|
|
204
286
|
post: {
|
|
@@ -209,14 +291,14 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
|
|
|
209
291
|
}>;
|
|
210
292
|
};
|
|
211
293
|
put: {};
|
|
212
|
-
head: {};
|
|
213
294
|
delete: {
|
|
214
295
|
"/tenants/:tenantId/subscription": import("@withtyped/server").PathGuard<"/:tenantId/subscription", unknown, unknown, unknown>;
|
|
215
296
|
};
|
|
216
297
|
copy: {};
|
|
298
|
+
head: {};
|
|
217
299
|
}, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
|
|
218
|
-
options: {};
|
|
219
300
|
patch: {};
|
|
301
|
+
options: {};
|
|
220
302
|
get: {
|
|
221
303
|
"/services/mails/usage": import("@withtyped/server").PathGuard<"/mails/usage", {
|
|
222
304
|
from?: string | undefined;
|
|
@@ -227,44 +309,86 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
|
|
|
227
309
|
post: {
|
|
228
310
|
"/services/mails": import("@withtyped/server").PathGuard<"/mails", unknown, {
|
|
229
311
|
data: {
|
|
230
|
-
type: VerificationCodeType;
|
|
231
|
-
to: string;
|
|
312
|
+
type: TemplateType | VerificationCodeType;
|
|
232
313
|
payload: {
|
|
314
|
+
code?: string | undefined;
|
|
315
|
+
link?: string | undefined;
|
|
316
|
+
} & Record<string, string> & {
|
|
233
317
|
senderName?: string | undefined;
|
|
234
318
|
companyInformation?: string | undefined;
|
|
235
319
|
appLogo?: string | undefined;
|
|
236
|
-
code: string;
|
|
237
320
|
};
|
|
321
|
+
to: string;
|
|
238
322
|
};
|
|
239
323
|
}, unknown>;
|
|
240
324
|
} & {
|
|
241
325
|
"/services/send-sms": import("@withtyped/server").PathGuard<"/send-sms", unknown, {
|
|
242
326
|
data: {
|
|
243
|
-
type: VerificationCodeType;
|
|
327
|
+
type: TemplateType | VerificationCodeType;
|
|
244
328
|
to: string;
|
|
245
329
|
payload: {
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
code: string;
|
|
250
|
-
};
|
|
330
|
+
code?: string | undefined;
|
|
331
|
+
link?: string | undefined;
|
|
332
|
+
} & Record<string, string>;
|
|
251
333
|
};
|
|
252
334
|
}, unknown>;
|
|
335
|
+
} & {
|
|
336
|
+
"/services/custom-jwt": import("@withtyped/server").PathGuard<"/custom-jwt", {
|
|
337
|
+
isTest?: string | undefined;
|
|
338
|
+
}, {
|
|
339
|
+
script: string;
|
|
340
|
+
tokenType: LogtoJwtTokenKeyType.AccessToken;
|
|
341
|
+
token: Record<string, Json>;
|
|
342
|
+
context: Record<string, Json>;
|
|
343
|
+
environmentVariables?: Record<string, string> | undefined;
|
|
344
|
+
} | {
|
|
345
|
+
script: string;
|
|
346
|
+
tokenType: LogtoJwtTokenKeyType.ClientCredentials;
|
|
347
|
+
token: Record<string, Json>;
|
|
348
|
+
environmentVariables?: Record<string, string> | undefined;
|
|
349
|
+
}, Record<string, unknown>>;
|
|
350
|
+
};
|
|
351
|
+
put: {
|
|
352
|
+
"/services/custom-jwt/worker": import("@withtyped/server").PathGuard<"/custom-jwt/worker", unknown, {
|
|
353
|
+
"jwt.accessToken"?: {
|
|
354
|
+
production?: string | undefined;
|
|
355
|
+
test?: string | undefined;
|
|
356
|
+
} | undefined;
|
|
357
|
+
"jwt.clientCredentials"?: {
|
|
358
|
+
production?: string | undefined;
|
|
359
|
+
test?: string | undefined;
|
|
360
|
+
} | undefined;
|
|
361
|
+
}, unknown>;
|
|
362
|
+
};
|
|
363
|
+
delete: {
|
|
364
|
+
"/services/custom-jwt/worker": import("@withtyped/server").PathGuard<"/custom-jwt/worker", unknown, unknown, unknown>;
|
|
253
365
|
};
|
|
254
|
-
put: {};
|
|
255
|
-
head: {};
|
|
256
|
-
delete: {};
|
|
257
366
|
copy: {};
|
|
367
|
+
head: {};
|
|
258
368
|
}, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
|
|
259
|
-
options: {};
|
|
260
369
|
patch: {};
|
|
370
|
+
options: {};
|
|
261
371
|
get: {
|
|
262
372
|
"/subscription-plans": import("@withtyped/server").PathGuard<"/", unknown, unknown, {
|
|
263
|
-
createdAt: Date;
|
|
264
373
|
id: string;
|
|
374
|
+
createdAt: Date;
|
|
265
375
|
name: string;
|
|
376
|
+
updatedAt: Date;
|
|
377
|
+
stripeProducts: {
|
|
378
|
+
type: "flat" | "tier1" | "tier2" | "tier3";
|
|
379
|
+
id: string;
|
|
380
|
+
name: string;
|
|
381
|
+
price: {
|
|
382
|
+
id: string;
|
|
383
|
+
unitAmountDecimal: string;
|
|
384
|
+
quantity?: 1 | undefined;
|
|
385
|
+
unitAmount?: number | null | undefined;
|
|
386
|
+
};
|
|
387
|
+
description?: string | undefined;
|
|
388
|
+
}[];
|
|
266
389
|
quota: {
|
|
267
390
|
mauLimit: number | null;
|
|
391
|
+
tokenLimit: number | null;
|
|
268
392
|
applicationsLimit: number | null;
|
|
269
393
|
machineToMachineLimit: number | null;
|
|
270
394
|
resourcesLimit: number | null;
|
|
@@ -275,81 +399,58 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
|
|
|
275
399
|
socialConnectorsLimit: number | null;
|
|
276
400
|
standardConnectorsLimit: number | null;
|
|
277
401
|
rolesLimit: number | null;
|
|
402
|
+
machineToMachineRolesLimit: number | null;
|
|
278
403
|
scopesPerRoleLimit: number | null;
|
|
279
404
|
hooksLimit: number | null;
|
|
280
405
|
auditLogsRetentionDays: number | null;
|
|
406
|
+
mfaEnabled: boolean;
|
|
407
|
+
organizationsEnabled: boolean;
|
|
408
|
+
ssoEnabled: boolean;
|
|
409
|
+
thirdPartyApplicationsLimit: number | null;
|
|
410
|
+
tenantMembersLimit: number | null;
|
|
411
|
+
customJwtEnabled: boolean;
|
|
281
412
|
};
|
|
282
|
-
stripeProducts: {
|
|
283
|
-
description?: string | undefined;
|
|
284
|
-
type: "flat" | "tier1" | "tier2" | "tier3";
|
|
285
|
-
id: string;
|
|
286
|
-
name: string;
|
|
287
|
-
price: {
|
|
288
|
-
quantity?: 1 | undefined;
|
|
289
|
-
unitAmount?: number | null | undefined;
|
|
290
|
-
id: string;
|
|
291
|
-
unitAmountDecimal: string;
|
|
292
|
-
};
|
|
293
|
-
}[];
|
|
294
|
-
updatedAt: Date;
|
|
295
413
|
}[]>;
|
|
296
414
|
};
|
|
297
415
|
post: {};
|
|
298
416
|
put: {};
|
|
299
|
-
head: {};
|
|
300
417
|
delete: {};
|
|
301
418
|
copy: {};
|
|
302
|
-
}, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
|
|
303
|
-
options: {};
|
|
304
|
-
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
419
|
head: {};
|
|
317
|
-
delete: {};
|
|
318
|
-
copy: {};
|
|
319
420
|
}, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
|
|
320
|
-
options: {};
|
|
321
421
|
patch: {};
|
|
422
|
+
options: {};
|
|
322
423
|
get: {
|
|
323
424
|
"/checkout-session/:id": import("@withtyped/server").PathGuard<"/:id", unknown, unknown, {
|
|
324
|
-
status: "open" | "complete" | "expired";
|
|
325
|
-
createdAt: Date;
|
|
326
425
|
id: string;
|
|
426
|
+
createdAt: Date;
|
|
327
427
|
userId: string;
|
|
328
|
-
|
|
428
|
+
status: "open" | "complete" | "expired";
|
|
329
429
|
tenantId: string | null;
|
|
430
|
+
updatedAt: Date;
|
|
330
431
|
planId: string;
|
|
331
432
|
}>;
|
|
332
433
|
};
|
|
333
434
|
post: {
|
|
334
435
|
"/checkout-session": import("@withtyped/server").PathGuard<"/", unknown, {
|
|
436
|
+
planId: string;
|
|
437
|
+
successCallbackUrl: string;
|
|
335
438
|
tenantId?: string | undefined;
|
|
439
|
+
cancelCallbackUrl?: string | undefined;
|
|
336
440
|
tenantTag?: TenantTag | undefined;
|
|
337
441
|
tenantName?: string | undefined;
|
|
338
|
-
cancelCallbackUrl?: string | undefined;
|
|
339
|
-
planId: string;
|
|
340
|
-
successCallbackUrl: string;
|
|
341
442
|
}, {
|
|
342
|
-
redirectUri?: string | null | undefined;
|
|
343
443
|
sessionId: string;
|
|
444
|
+
redirectUri?: string | null | undefined;
|
|
344
445
|
}>;
|
|
345
446
|
};
|
|
346
447
|
put: {};
|
|
347
|
-
head: {};
|
|
348
448
|
delete: {};
|
|
349
449
|
copy: {};
|
|
450
|
+
head: {};
|
|
350
451
|
}, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
|
|
351
|
-
options: {};
|
|
352
452
|
patch: {};
|
|
453
|
+
options: {};
|
|
353
454
|
get: {
|
|
354
455
|
"/affiliates": import("@withtyped/server").PathGuard<"/", unknown, unknown, AffiliateData[]>;
|
|
355
456
|
};
|
|
@@ -357,57 +458,191 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
|
|
|
357
458
|
"/affiliates": import("@withtyped/server").PathGuard<"/", unknown, {
|
|
358
459
|
name: string;
|
|
359
460
|
}, {
|
|
360
|
-
createdAt: Date;
|
|
361
461
|
id: string;
|
|
462
|
+
createdAt: Date;
|
|
362
463
|
name: string;
|
|
363
464
|
}>;
|
|
364
465
|
} & {
|
|
365
466
|
"/affiliates/:id/properties": import("@withtyped/server").PathGuard<"/:id/properties", unknown, {
|
|
366
|
-
value: string;
|
|
367
467
|
type: "hostname" | "query";
|
|
368
|
-
}, {
|
|
369
468
|
value: string;
|
|
370
|
-
|
|
469
|
+
}, {
|
|
371
470
|
createdAt: Date;
|
|
372
471
|
affiliateId: string;
|
|
472
|
+
type: "hostname" | "query";
|
|
473
|
+
value: string;
|
|
373
474
|
}>;
|
|
374
475
|
};
|
|
375
476
|
put: {};
|
|
376
|
-
head: {};
|
|
377
477
|
delete: {
|
|
378
478
|
"/affiliates/:id/properties": import("@withtyped/server").PathGuard<"/:id/properties", unknown, {
|
|
379
|
-
value: string;
|
|
380
479
|
type: "hostname" | "query";
|
|
480
|
+
value: string;
|
|
381
481
|
}, unknown>;
|
|
382
482
|
};
|
|
383
483
|
copy: {};
|
|
484
|
+
head: {};
|
|
384
485
|
}, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
|
|
385
|
-
options: {};
|
|
386
486
|
patch: {};
|
|
487
|
+
options: {};
|
|
387
488
|
get: {};
|
|
388
489
|
post: {
|
|
389
490
|
"/affiliate-logs": import("@withtyped/server").PathGuard<"/", unknown, {
|
|
390
|
-
hostname?: string | undefined;
|
|
391
|
-
query?: string | undefined;
|
|
392
491
|
createdAt: string;
|
|
393
492
|
userId: string;
|
|
493
|
+
hostname?: string | undefined;
|
|
494
|
+
query?: string | undefined;
|
|
394
495
|
}, {
|
|
395
|
-
createdAt: Date;
|
|
396
496
|
id: string;
|
|
497
|
+
createdAt: Date;
|
|
397
498
|
affiliateId: string | null;
|
|
398
499
|
userId: string;
|
|
399
500
|
createdVia: {
|
|
501
|
+
createdAt: string;
|
|
400
502
|
hostname?: string | undefined;
|
|
401
503
|
query?: string | undefined;
|
|
402
|
-
createdAt: string;
|
|
403
504
|
};
|
|
404
505
|
}>;
|
|
405
506
|
};
|
|
406
507
|
put: {};
|
|
508
|
+
delete: {};
|
|
509
|
+
copy: {};
|
|
407
510
|
head: {};
|
|
511
|
+
}, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
|
|
512
|
+
patch: {
|
|
513
|
+
"/invitations/:invitationId/status": import("@withtyped/server").PathGuard<"/:invitationId/status", unknown, {
|
|
514
|
+
status: OrganizationInvitationStatus.Accepted;
|
|
515
|
+
}, unknown>;
|
|
516
|
+
};
|
|
517
|
+
options: {};
|
|
518
|
+
get: {
|
|
519
|
+
"/invitations": import("@withtyped/server").PathGuard<"/", unknown, unknown, ({
|
|
520
|
+
id: string;
|
|
521
|
+
createdAt: number;
|
|
522
|
+
status: OrganizationInvitationStatus;
|
|
523
|
+
tenantId: string;
|
|
524
|
+
updatedAt: number;
|
|
525
|
+
inviterId: string | null;
|
|
526
|
+
invitee: string;
|
|
527
|
+
acceptedUserId: string | null;
|
|
528
|
+
organizationId: string;
|
|
529
|
+
expiresAt: number;
|
|
530
|
+
organizationRoles: OrganizationRoleEntity[];
|
|
531
|
+
} & {
|
|
532
|
+
tenantName: string;
|
|
533
|
+
tenantTag: TenantTag;
|
|
534
|
+
})[]>;
|
|
535
|
+
} & {
|
|
536
|
+
"/invitations/:invitationId": import("@withtyped/server").PathGuard<"/:invitationId", unknown, unknown, {
|
|
537
|
+
id: string;
|
|
538
|
+
createdAt: number;
|
|
539
|
+
status: OrganizationInvitationStatus;
|
|
540
|
+
tenantId: string;
|
|
541
|
+
updatedAt: number;
|
|
542
|
+
inviterId: string | null;
|
|
543
|
+
invitee: string;
|
|
544
|
+
acceptedUserId: string | null;
|
|
545
|
+
organizationId: string;
|
|
546
|
+
expiresAt: number;
|
|
547
|
+
organizationRoles: OrganizationRoleEntity[];
|
|
548
|
+
}>;
|
|
549
|
+
};
|
|
550
|
+
post: {};
|
|
551
|
+
put: {};
|
|
408
552
|
delete: {};
|
|
409
553
|
copy: {};
|
|
554
|
+
head: {};
|
|
410
555
|
}, "/api">>, "/api">;
|
|
556
|
+
export declare const tenantAuthRouter: import("@withtyped/server").Router<RequestContext, import("@withtyped/server").WithBodyContext<import("@withtyped/server").BaseContext & {
|
|
557
|
+
request: {
|
|
558
|
+
id?: string | undefined;
|
|
559
|
+
method?: import("@withtyped/server").RequestMethod | undefined;
|
|
560
|
+
headers: import("http").IncomingHttpHeaders;
|
|
561
|
+
url: URL;
|
|
562
|
+
body?: unknown;
|
|
563
|
+
};
|
|
564
|
+
}>, import("@withtyped/server").MergeRoutes<import("@withtyped/server").BaseRoutes, import("@withtyped/server").RoutesWithPrefix<{
|
|
565
|
+
patch: {
|
|
566
|
+
"/:tenantId/invitations/:invitationId/status": import("@withtyped/server").PathGuard<"/:tenantId/invitations/:invitationId/status", unknown, {
|
|
567
|
+
status: OrganizationInvitationStatus.Revoked;
|
|
568
|
+
}, {
|
|
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
|
+
};
|
|
582
|
+
options: {};
|
|
583
|
+
get: {
|
|
584
|
+
"/:tenantId/members": import("@withtyped/server").PathGuard<"/:tenantId/members", unknown, unknown, {
|
|
585
|
+
id: string;
|
|
586
|
+
name: string | null;
|
|
587
|
+
username: string | null;
|
|
588
|
+
primaryEmail: string | null;
|
|
589
|
+
primaryPhone: string | null;
|
|
590
|
+
avatar: string | null;
|
|
591
|
+
organizationRoles: OrganizationRoleEntity[];
|
|
592
|
+
}[]>;
|
|
593
|
+
} & {
|
|
594
|
+
"/:tenantId/members/:userId/scopes": import("@withtyped/server").PathGuard<"/:tenantId/members/:userId/scopes", unknown, unknown, OrganizationScope[]>;
|
|
595
|
+
} & {
|
|
596
|
+
"/:tenantId/invitations": import("@withtyped/server").PathGuard<"/:tenantId/invitations", unknown, unknown, ({
|
|
597
|
+
id: string;
|
|
598
|
+
createdAt: number;
|
|
599
|
+
status: OrganizationInvitationStatus;
|
|
600
|
+
tenantId: string;
|
|
601
|
+
updatedAt: number;
|
|
602
|
+
inviterId: string | null;
|
|
603
|
+
invitee: string;
|
|
604
|
+
acceptedUserId: string | null;
|
|
605
|
+
organizationId: string;
|
|
606
|
+
expiresAt: number;
|
|
607
|
+
organizationRoles: OrganizationRoleEntity[];
|
|
608
|
+
} & {
|
|
609
|
+
inviterName?: string | undefined;
|
|
610
|
+
})[]>;
|
|
611
|
+
};
|
|
612
|
+
post: {
|
|
613
|
+
"/:tenantId/invitations": import("@withtyped/server").PathGuard<"/:tenantId/invitations", unknown, {
|
|
614
|
+
invitee: string;
|
|
615
|
+
roleName: TenantRole;
|
|
616
|
+
expiresAt?: number | undefined;
|
|
617
|
+
}, {
|
|
618
|
+
id: string;
|
|
619
|
+
createdAt: number;
|
|
620
|
+
status: OrganizationInvitationStatus;
|
|
621
|
+
tenantId: string;
|
|
622
|
+
updatedAt: number;
|
|
623
|
+
inviterId: string | null;
|
|
624
|
+
invitee: string;
|
|
625
|
+
acceptedUserId: string | null;
|
|
626
|
+
organizationId: string;
|
|
627
|
+
expiresAt: number;
|
|
628
|
+
organizationRoles: OrganizationRoleEntity[];
|
|
629
|
+
}>;
|
|
630
|
+
} & {
|
|
631
|
+
"/:tenantId/invitations/:invitationId/message": import("@withtyped/server").PathGuard<"/:tenantId/invitations/:invitationId/message", unknown, unknown, unknown>;
|
|
632
|
+
};
|
|
633
|
+
put: {
|
|
634
|
+
"/:tenantId/members/:userId/roles": import("@withtyped/server").PathGuard<"/:tenantId/members/:userId/roles", unknown, {
|
|
635
|
+
roleName: TenantRole;
|
|
636
|
+
}, unknown>;
|
|
637
|
+
};
|
|
638
|
+
delete: {
|
|
639
|
+
"/:tenantId/members/:userId": import("@withtyped/server").PathGuard<"/:tenantId/members/:userId", unknown, unknown, unknown>;
|
|
640
|
+
} & {
|
|
641
|
+
"/:tenantId/invitations/:invitationId": import("@withtyped/server").PathGuard<"/:tenantId/invitations/:invitationId", unknown, unknown, unknown>;
|
|
642
|
+
};
|
|
643
|
+
copy: {};
|
|
644
|
+
head: {};
|
|
645
|
+
}, "/api/tenants">>, "/api/tenants">;
|
|
411
646
|
|
|
412
647
|
export {
|
|
413
648
|
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-72891e6",
|
|
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
|
}
|