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