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