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