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