@longzai-intelligence-tenant/sdk 0.0.1
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/dist/index.d.ts +516 -0
- package/dist/index.js +1 -0
- package/package.json +38 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,516 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
//#region src/routes/tenant.routes.d.ts
|
|
4
|
+
/** 路由定义 */
|
|
5
|
+
type RouteDefinition = {
|
|
6
|
+
method: string;
|
|
7
|
+
path: string;
|
|
8
|
+
summary: string;
|
|
9
|
+
query?: z.ZodTypeAny;
|
|
10
|
+
body?: z.ZodTypeAny;
|
|
11
|
+
response?: z.ZodTypeAny;
|
|
12
|
+
};
|
|
13
|
+
/** 路由组 */
|
|
14
|
+
type RouteGroup = {
|
|
15
|
+
version: string;
|
|
16
|
+
prefix: string;
|
|
17
|
+
auth?: string;
|
|
18
|
+
tags?: string[];
|
|
19
|
+
routes: Record<string, RouteDefinition>;
|
|
20
|
+
};
|
|
21
|
+
/** 定义路由组 */
|
|
22
|
+
declare function defineRouteGroup(config: {
|
|
23
|
+
version: string;
|
|
24
|
+
prefix: string;
|
|
25
|
+
auth?: string;
|
|
26
|
+
tags?: string[];
|
|
27
|
+
routes: Record<string, RouteDefinition>;
|
|
28
|
+
}): RouteGroup;
|
|
29
|
+
/** API 响应 Schema 工厂 */
|
|
30
|
+
declare function ApiResponseSchema<T extends z.ZodTypeAny>(dataSchema: T): z.ZodObject<{
|
|
31
|
+
success: z.ZodBoolean;
|
|
32
|
+
data: T;
|
|
33
|
+
message: z.ZodOptional<z.ZodString>;
|
|
34
|
+
}, z.core.$strip>;
|
|
35
|
+
/** API 分页列表数据 Schema 工厂 */
|
|
36
|
+
declare function ApiPaginatedListDataSchema<T extends z.ZodTypeAny>(itemSchema: T): z.ZodObject<{
|
|
37
|
+
items: z.ZodArray<T>;
|
|
38
|
+
pagination: z.ZodObject<{
|
|
39
|
+
page: z.ZodNumber;
|
|
40
|
+
pageSize: z.ZodNumber;
|
|
41
|
+
total: z.ZodNumber;
|
|
42
|
+
totalPages: z.ZodNumber;
|
|
43
|
+
hasPrev: z.ZodBoolean;
|
|
44
|
+
hasNext: z.ZodBoolean;
|
|
45
|
+
}, z.core.$strip>;
|
|
46
|
+
}, z.core.$strip>;
|
|
47
|
+
declare const tenantApi: RouteGroup;
|
|
48
|
+
//#endregion
|
|
49
|
+
//#region src/routes/membership.routes.d.ts
|
|
50
|
+
declare const membershipApi: RouteGroup;
|
|
51
|
+
//#endregion
|
|
52
|
+
//#region src/routes/subscription.routes.d.ts
|
|
53
|
+
declare const subscriptionApi: RouteGroup;
|
|
54
|
+
//#endregion
|
|
55
|
+
//#region src/routes/quota.routes.d.ts
|
|
56
|
+
declare const quotaApi: RouteGroup;
|
|
57
|
+
//#endregion
|
|
58
|
+
//#region src/schemas/tenant.schema.d.ts
|
|
59
|
+
/** 租户状态 Schema */
|
|
60
|
+
declare const tenantStatusSchema: z.ZodEnum<{
|
|
61
|
+
active: "active";
|
|
62
|
+
inactive: "inactive";
|
|
63
|
+
suspended: "suspended";
|
|
64
|
+
}>;
|
|
65
|
+
/** 租户列表项 Schema */
|
|
66
|
+
declare const tenantListItemSchema: z.ZodObject<{
|
|
67
|
+
id: z.ZodString;
|
|
68
|
+
name: z.ZodString;
|
|
69
|
+
slug: z.ZodString;
|
|
70
|
+
status: z.ZodEnum<{
|
|
71
|
+
active: "active";
|
|
72
|
+
inactive: "inactive";
|
|
73
|
+
suspended: "suspended";
|
|
74
|
+
}>;
|
|
75
|
+
plan: z.ZodNullable<z.ZodString>;
|
|
76
|
+
ownerId: z.ZodString;
|
|
77
|
+
maxMembers: z.ZodNumber;
|
|
78
|
+
createdAt: z.ZodString;
|
|
79
|
+
updatedAt: z.ZodString;
|
|
80
|
+
}, z.core.$strip>;
|
|
81
|
+
/** 租户详情 Schema */
|
|
82
|
+
declare const tenantDetailSchema: z.ZodObject<{
|
|
83
|
+
id: z.ZodString;
|
|
84
|
+
name: z.ZodString;
|
|
85
|
+
slug: z.ZodString;
|
|
86
|
+
status: z.ZodEnum<{
|
|
87
|
+
active: "active";
|
|
88
|
+
inactive: "inactive";
|
|
89
|
+
suspended: "suspended";
|
|
90
|
+
}>;
|
|
91
|
+
plan: z.ZodNullable<z.ZodString>;
|
|
92
|
+
ownerId: z.ZodString;
|
|
93
|
+
maxMembers: z.ZodNumber;
|
|
94
|
+
createdAt: z.ZodString;
|
|
95
|
+
updatedAt: z.ZodString;
|
|
96
|
+
settings: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
97
|
+
}, z.core.$strip>;
|
|
98
|
+
/** 创建租户输入 Schema */
|
|
99
|
+
declare const createTenantInputSchema: z.ZodObject<{
|
|
100
|
+
id: z.ZodString;
|
|
101
|
+
name: z.ZodString;
|
|
102
|
+
slug: z.ZodString;
|
|
103
|
+
plan: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
104
|
+
ownerId: z.ZodString;
|
|
105
|
+
maxMembers: z.ZodOptional<z.ZodNumber>;
|
|
106
|
+
}, z.core.$strip>;
|
|
107
|
+
/** 更新租户输入 Schema */
|
|
108
|
+
declare const updateTenantInputSchema: z.ZodObject<{
|
|
109
|
+
name: z.ZodOptional<z.ZodString>;
|
|
110
|
+
plan: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
111
|
+
maxMembers: z.ZodOptional<z.ZodNumber>;
|
|
112
|
+
settings: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
113
|
+
}, z.core.$strip>;
|
|
114
|
+
/** 租户信息 Schema(用于上下文解析) */
|
|
115
|
+
declare const tenantInfoSchema: z.ZodObject<{
|
|
116
|
+
id: z.ZodString;
|
|
117
|
+
slug: z.ZodString;
|
|
118
|
+
name: z.ZodString;
|
|
119
|
+
status: z.ZodEnum<{
|
|
120
|
+
active: "active";
|
|
121
|
+
inactive: "inactive";
|
|
122
|
+
suspended: "suspended";
|
|
123
|
+
}>;
|
|
124
|
+
}, z.core.$strip>;
|
|
125
|
+
/** 租户验证结果 Schema */
|
|
126
|
+
declare const tenantValidationResultSchema: z.ZodObject<{
|
|
127
|
+
valid: z.ZodBoolean;
|
|
128
|
+
tenantId: z.ZodNullable<z.ZodString>;
|
|
129
|
+
error: z.ZodNullable<z.ZodString>;
|
|
130
|
+
}, z.core.$strip>;
|
|
131
|
+
/** 租户列表查询参数 Schema */
|
|
132
|
+
declare const tenantListQuerySchema: z.ZodObject<{
|
|
133
|
+
page: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
134
|
+
pageSize: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
135
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
136
|
+
active: "active";
|
|
137
|
+
inactive: "inactive";
|
|
138
|
+
suspended: "suspended";
|
|
139
|
+
}>>;
|
|
140
|
+
search: z.ZodOptional<z.ZodString>;
|
|
141
|
+
}, z.core.$strip>;
|
|
142
|
+
type TenantStatus = z.infer<typeof tenantStatusSchema>;
|
|
143
|
+
type TenantListItem = z.infer<typeof tenantListItemSchema>;
|
|
144
|
+
type TenantDetail = z.infer<typeof tenantDetailSchema>;
|
|
145
|
+
type CreateTenantInput = z.infer<typeof createTenantInputSchema>;
|
|
146
|
+
type UpdateTenantInput = z.infer<typeof updateTenantInputSchema>;
|
|
147
|
+
type TenantInfo = z.infer<typeof tenantInfoSchema>;
|
|
148
|
+
type TenantValidationResult = z.infer<typeof tenantValidationResultSchema>;
|
|
149
|
+
type TenantListQuery = z.infer<typeof tenantListQuerySchema>;
|
|
150
|
+
//#endregion
|
|
151
|
+
//#region src/schemas/membership.schema.d.ts
|
|
152
|
+
/** 成员角色 Schema */
|
|
153
|
+
declare const memberRoleSchema: z.ZodEnum<{
|
|
154
|
+
owner: "owner";
|
|
155
|
+
admin: "admin";
|
|
156
|
+
member: "member";
|
|
157
|
+
viewer: "viewer";
|
|
158
|
+
}>;
|
|
159
|
+
/** 成员状态 Schema */
|
|
160
|
+
declare const memberStatusSchema: z.ZodEnum<{
|
|
161
|
+
active: "active";
|
|
162
|
+
inactive: "inactive";
|
|
163
|
+
}>;
|
|
164
|
+
/** 邀请状态 Schema */
|
|
165
|
+
declare const invitationStatusSchema: z.ZodEnum<{
|
|
166
|
+
expired: "expired";
|
|
167
|
+
cancelled: "cancelled";
|
|
168
|
+
pending: "pending";
|
|
169
|
+
accepted: "accepted";
|
|
170
|
+
}>;
|
|
171
|
+
/** 成员项 Schema */
|
|
172
|
+
declare const memberItemSchema: z.ZodObject<{
|
|
173
|
+
id: z.ZodString;
|
|
174
|
+
tenantId: z.ZodString;
|
|
175
|
+
userId: z.ZodString;
|
|
176
|
+
role: z.ZodEnum<{
|
|
177
|
+
owner: "owner";
|
|
178
|
+
admin: "admin";
|
|
179
|
+
member: "member";
|
|
180
|
+
viewer: "viewer";
|
|
181
|
+
}>;
|
|
182
|
+
joinedAt: z.ZodString;
|
|
183
|
+
status: z.ZodEnum<{
|
|
184
|
+
active: "active";
|
|
185
|
+
inactive: "inactive";
|
|
186
|
+
}>;
|
|
187
|
+
}, z.core.$strip>;
|
|
188
|
+
/** 邀请项 Schema */
|
|
189
|
+
declare const invitationItemSchema: z.ZodObject<{
|
|
190
|
+
id: z.ZodString;
|
|
191
|
+
tenantId: z.ZodString;
|
|
192
|
+
inviteCode: z.ZodString;
|
|
193
|
+
email: z.ZodString;
|
|
194
|
+
role: z.ZodEnum<{
|
|
195
|
+
owner: "owner";
|
|
196
|
+
admin: "admin";
|
|
197
|
+
member: "member";
|
|
198
|
+
viewer: "viewer";
|
|
199
|
+
}>;
|
|
200
|
+
expiresAt: z.ZodString;
|
|
201
|
+
status: z.ZodEnum<{
|
|
202
|
+
expired: "expired";
|
|
203
|
+
cancelled: "cancelled";
|
|
204
|
+
pending: "pending";
|
|
205
|
+
accepted: "accepted";
|
|
206
|
+
}>;
|
|
207
|
+
usedBy: z.ZodNullable<z.ZodString>;
|
|
208
|
+
usedAt: z.ZodNullable<z.ZodString>;
|
|
209
|
+
}, z.core.$strip>;
|
|
210
|
+
/** 添加成员输入 Schema */
|
|
211
|
+
declare const addMemberInputSchema: z.ZodObject<{
|
|
212
|
+
userId: z.ZodString;
|
|
213
|
+
role: z.ZodEnum<{
|
|
214
|
+
owner: "owner";
|
|
215
|
+
admin: "admin";
|
|
216
|
+
member: "member";
|
|
217
|
+
viewer: "viewer";
|
|
218
|
+
}>;
|
|
219
|
+
}, z.core.$strip>;
|
|
220
|
+
/** 创建邀请输入 Schema */
|
|
221
|
+
declare const createInvitationInputSchema: z.ZodObject<{
|
|
222
|
+
email: z.ZodString;
|
|
223
|
+
role: z.ZodEnum<{
|
|
224
|
+
owner: "owner";
|
|
225
|
+
admin: "admin";
|
|
226
|
+
member: "member";
|
|
227
|
+
viewer: "viewer";
|
|
228
|
+
}>;
|
|
229
|
+
expiresInHours: z.ZodOptional<z.ZodNumber>;
|
|
230
|
+
}, z.core.$strip>;
|
|
231
|
+
/** 成员列表查询参数 Schema */
|
|
232
|
+
declare const memberListQuerySchema: z.ZodObject<{
|
|
233
|
+
page: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
234
|
+
pageSize: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
235
|
+
role: z.ZodOptional<z.ZodEnum<{
|
|
236
|
+
owner: "owner";
|
|
237
|
+
admin: "admin";
|
|
238
|
+
member: "member";
|
|
239
|
+
viewer: "viewer";
|
|
240
|
+
}>>;
|
|
241
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
242
|
+
active: "active";
|
|
243
|
+
inactive: "inactive";
|
|
244
|
+
}>>;
|
|
245
|
+
}, z.core.$strip>;
|
|
246
|
+
/** 邀请列表查询参数 Schema */
|
|
247
|
+
declare const invitationListQuerySchema: z.ZodObject<{
|
|
248
|
+
page: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
249
|
+
pageSize: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
250
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
251
|
+
expired: "expired";
|
|
252
|
+
cancelled: "cancelled";
|
|
253
|
+
pending: "pending";
|
|
254
|
+
accepted: "accepted";
|
|
255
|
+
}>>;
|
|
256
|
+
}, z.core.$strip>;
|
|
257
|
+
type MemberRole = z.infer<typeof memberRoleSchema>;
|
|
258
|
+
type MemberStatus = z.infer<typeof memberStatusSchema>;
|
|
259
|
+
type InvitationStatus = z.infer<typeof invitationStatusSchema>;
|
|
260
|
+
type MemberItem = z.infer<typeof memberItemSchema>;
|
|
261
|
+
type InvitationItem = z.infer<typeof invitationItemSchema>;
|
|
262
|
+
type AddMemberInput = z.infer<typeof addMemberInputSchema>;
|
|
263
|
+
type CreateInvitationInput = z.infer<typeof createInvitationInputSchema>;
|
|
264
|
+
type MemberListQuery = z.infer<typeof memberListQuerySchema>;
|
|
265
|
+
type InvitationListQuery = z.infer<typeof invitationListQuerySchema>;
|
|
266
|
+
//#endregion
|
|
267
|
+
//#region src/schemas/subscription.schema.d.ts
|
|
268
|
+
/** 计划状态 Schema */
|
|
269
|
+
declare const planStatusSchema: z.ZodEnum<{
|
|
270
|
+
active: "active";
|
|
271
|
+
archived: "archived";
|
|
272
|
+
}>;
|
|
273
|
+
/** 计费周期 Schema */
|
|
274
|
+
declare const billingCycleSchema: z.ZodEnum<{
|
|
275
|
+
monthly: "monthly";
|
|
276
|
+
yearly: "yearly";
|
|
277
|
+
lifetime: "lifetime";
|
|
278
|
+
}>;
|
|
279
|
+
/** 订阅状态 Schema */
|
|
280
|
+
declare const subscriptionStatusSchema: z.ZodEnum<{
|
|
281
|
+
active: "active";
|
|
282
|
+
expired: "expired";
|
|
283
|
+
cancelled: "cancelled";
|
|
284
|
+
trial: "trial";
|
|
285
|
+
}>;
|
|
286
|
+
/** 计划项 Schema */
|
|
287
|
+
declare const planItemSchema: z.ZodObject<{
|
|
288
|
+
id: z.ZodString;
|
|
289
|
+
name: z.ZodString;
|
|
290
|
+
description: z.ZodNullable<z.ZodString>;
|
|
291
|
+
features: z.ZodArray<z.ZodString>;
|
|
292
|
+
limits: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
293
|
+
price: z.ZodNumber;
|
|
294
|
+
billingCycle: z.ZodEnum<{
|
|
295
|
+
monthly: "monthly";
|
|
296
|
+
yearly: "yearly";
|
|
297
|
+
lifetime: "lifetime";
|
|
298
|
+
}>;
|
|
299
|
+
status: z.ZodEnum<{
|
|
300
|
+
active: "active";
|
|
301
|
+
archived: "archived";
|
|
302
|
+
}>;
|
|
303
|
+
}, z.core.$strip>;
|
|
304
|
+
/** 订阅项 Schema */
|
|
305
|
+
declare const subscriptionItemSchema: z.ZodObject<{
|
|
306
|
+
id: z.ZodString;
|
|
307
|
+
tenantId: z.ZodString;
|
|
308
|
+
planId: z.ZodString;
|
|
309
|
+
status: z.ZodEnum<{
|
|
310
|
+
active: "active";
|
|
311
|
+
expired: "expired";
|
|
312
|
+
cancelled: "cancelled";
|
|
313
|
+
trial: "trial";
|
|
314
|
+
}>;
|
|
315
|
+
startDate: z.ZodString;
|
|
316
|
+
endDate: z.ZodNullable<z.ZodString>;
|
|
317
|
+
trialEndAt: z.ZodNullable<z.ZodString>;
|
|
318
|
+
}, z.core.$strip>;
|
|
319
|
+
/** 创建计划输入 Schema */
|
|
320
|
+
declare const createPlanInputSchema: z.ZodObject<{
|
|
321
|
+
name: z.ZodString;
|
|
322
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
323
|
+
features: z.ZodArray<z.ZodString>;
|
|
324
|
+
limits: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
325
|
+
price: z.ZodNumber;
|
|
326
|
+
billingCycle: z.ZodEnum<{
|
|
327
|
+
monthly: "monthly";
|
|
328
|
+
yearly: "yearly";
|
|
329
|
+
lifetime: "lifetime";
|
|
330
|
+
}>;
|
|
331
|
+
}, z.core.$strip>;
|
|
332
|
+
/** 订阅输入 Schema */
|
|
333
|
+
declare const subscribeInputSchema: z.ZodObject<{
|
|
334
|
+
planId: z.ZodString;
|
|
335
|
+
trialDays: z.ZodOptional<z.ZodNumber>;
|
|
336
|
+
}, z.core.$strip>;
|
|
337
|
+
/** 计划列表查询参数 Schema */
|
|
338
|
+
declare const planListQuerySchema: z.ZodObject<{
|
|
339
|
+
page: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
340
|
+
pageSize: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
341
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
342
|
+
active: "active";
|
|
343
|
+
archived: "archived";
|
|
344
|
+
}>>;
|
|
345
|
+
billingCycle: z.ZodOptional<z.ZodEnum<{
|
|
346
|
+
monthly: "monthly";
|
|
347
|
+
yearly: "yearly";
|
|
348
|
+
lifetime: "lifetime";
|
|
349
|
+
}>>;
|
|
350
|
+
}, z.core.$strip>;
|
|
351
|
+
type PlanStatus = z.infer<typeof planStatusSchema>;
|
|
352
|
+
type BillingCycle = z.infer<typeof billingCycleSchema>;
|
|
353
|
+
type SubscriptionStatus = z.infer<typeof subscriptionStatusSchema>;
|
|
354
|
+
type PlanItem = z.infer<typeof planItemSchema>;
|
|
355
|
+
type SubscriptionItem = z.infer<typeof subscriptionItemSchema>;
|
|
356
|
+
type CreatePlanInput = z.infer<typeof createPlanInputSchema>;
|
|
357
|
+
type SubscribeInput = z.infer<typeof subscribeInputSchema>;
|
|
358
|
+
type PlanListQuery = z.infer<typeof planListQuerySchema>;
|
|
359
|
+
//#endregion
|
|
360
|
+
//#region src/schemas/quota.schema.d.ts
|
|
361
|
+
/** 资源类型 Schema */
|
|
362
|
+
declare const resourceTypeSchema: z.ZodEnum<{
|
|
363
|
+
members: "members";
|
|
364
|
+
projects: "projects";
|
|
365
|
+
storage: "storage";
|
|
366
|
+
api_calls: "api_calls";
|
|
367
|
+
}>;
|
|
368
|
+
/** 配额周期 Schema */
|
|
369
|
+
declare const quotaPeriodSchema: z.ZodEnum<{
|
|
370
|
+
total: "total";
|
|
371
|
+
monthly: "monthly";
|
|
372
|
+
yearly: "yearly";
|
|
373
|
+
}>;
|
|
374
|
+
/** 配额项 Schema */
|
|
375
|
+
declare const quotaItemSchema: z.ZodObject<{
|
|
376
|
+
id: z.ZodString;
|
|
377
|
+
tenantId: z.ZodString;
|
|
378
|
+
resourceType: z.ZodEnum<{
|
|
379
|
+
members: "members";
|
|
380
|
+
projects: "projects";
|
|
381
|
+
storage: "storage";
|
|
382
|
+
api_calls: "api_calls";
|
|
383
|
+
}>;
|
|
384
|
+
limit: z.ZodNumber;
|
|
385
|
+
used: z.ZodNumber;
|
|
386
|
+
period: z.ZodEnum<{
|
|
387
|
+
total: "total";
|
|
388
|
+
monthly: "monthly";
|
|
389
|
+
yearly: "yearly";
|
|
390
|
+
}>;
|
|
391
|
+
}, z.core.$strip>;
|
|
392
|
+
/** 配额检查结果 Schema */
|
|
393
|
+
declare const quotaCheckResultSchema: z.ZodObject<{
|
|
394
|
+
allowed: z.ZodBoolean;
|
|
395
|
+
resourceType: z.ZodEnum<{
|
|
396
|
+
members: "members";
|
|
397
|
+
projects: "projects";
|
|
398
|
+
storage: "storage";
|
|
399
|
+
api_calls: "api_calls";
|
|
400
|
+
}>;
|
|
401
|
+
current: z.ZodNumber;
|
|
402
|
+
limit: z.ZodNumber;
|
|
403
|
+
}, z.core.$strip>;
|
|
404
|
+
/** 调整配额输入 Schema */
|
|
405
|
+
declare const adjustQuotaInputSchema: z.ZodObject<{
|
|
406
|
+
resourceType: z.ZodEnum<{
|
|
407
|
+
members: "members";
|
|
408
|
+
projects: "projects";
|
|
409
|
+
storage: "storage";
|
|
410
|
+
api_calls: "api_calls";
|
|
411
|
+
}>;
|
|
412
|
+
limit: z.ZodNumber;
|
|
413
|
+
}, z.core.$strip>;
|
|
414
|
+
/** 配额列表查询参数 Schema */
|
|
415
|
+
declare const quotaListQuerySchema: z.ZodObject<{
|
|
416
|
+
page: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
417
|
+
pageSize: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
418
|
+
resourceType: z.ZodOptional<z.ZodEnum<{
|
|
419
|
+
members: "members";
|
|
420
|
+
projects: "projects";
|
|
421
|
+
storage: "storage";
|
|
422
|
+
api_calls: "api_calls";
|
|
423
|
+
}>>;
|
|
424
|
+
period: z.ZodOptional<z.ZodEnum<{
|
|
425
|
+
total: "total";
|
|
426
|
+
monthly: "monthly";
|
|
427
|
+
yearly: "yearly";
|
|
428
|
+
}>>;
|
|
429
|
+
}, z.core.$strip>;
|
|
430
|
+
type ResourceType = z.infer<typeof resourceTypeSchema>;
|
|
431
|
+
type QuotaPeriod = z.infer<typeof quotaPeriodSchema>;
|
|
432
|
+
type QuotaItem = z.infer<typeof quotaItemSchema>;
|
|
433
|
+
type QuotaCheckResult = z.infer<typeof quotaCheckResultSchema>;
|
|
434
|
+
type AdjustQuotaInput = z.infer<typeof adjustQuotaInputSchema>;
|
|
435
|
+
type QuotaListQuery = z.infer<typeof quotaListQuerySchema>;
|
|
436
|
+
//#endregion
|
|
437
|
+
//#region src/factory/create-api-functions.d.ts
|
|
438
|
+
/** HTTP 客户端配置 */
|
|
439
|
+
type HttpClientConfig = {
|
|
440
|
+
baseUrl: string;
|
|
441
|
+
headers?: Record<string, string>;
|
|
442
|
+
};
|
|
443
|
+
/** 通用 HTTP 客户端接口 */
|
|
444
|
+
type HttpClient = {
|
|
445
|
+
get<T>(path: string, params?: Record<string, unknown>): Promise<T>;
|
|
446
|
+
post<T>(path: string, body?: unknown): Promise<T>;
|
|
447
|
+
patch<T>(path: string, body?: unknown): Promise<T>;
|
|
448
|
+
delete<T>(path: string): Promise<T>;
|
|
449
|
+
};
|
|
450
|
+
/** 创建 HTTP 客户端 */
|
|
451
|
+
declare function createHttpClient(config: HttpClientConfig): HttpClient;
|
|
452
|
+
/**
|
|
453
|
+
* 从路由定义创建类型安全的 API 函数
|
|
454
|
+
*
|
|
455
|
+
* @param routeGroup - 路由定义组
|
|
456
|
+
* @param client - HTTP 客户端
|
|
457
|
+
* @returns 类型安全的 API 函数集合
|
|
458
|
+
*/
|
|
459
|
+
declare function createApiFunctions(routeGroup: RouteGroup, client: HttpClient): {
|
|
460
|
+
/** 获取租户详情 */getTenant: (id: string) => Promise<unknown>; /** 获取租户列表 */
|
|
461
|
+
listTenants: (params?: Record<string, unknown>) => Promise<unknown>; /** 创建租户 */
|
|
462
|
+
createTenant: (body: Record<string, unknown>) => Promise<unknown>; /** 更新租户 */
|
|
463
|
+
updateTenant: (id: string, body: Record<string, unknown>) => Promise<unknown>; /** 删除租户 */
|
|
464
|
+
deleteTenant: (id: string) => Promise<unknown>; /** 通过 slug 查找租户 */
|
|
465
|
+
getTenantBySlug: (slug: string) => Promise<unknown>; /** 验证租户 */
|
|
466
|
+
validateTenant: (id: string) => Promise<unknown>; /** 从请求头解析租户信息 */
|
|
467
|
+
resolveFromHeader: (body: Record<string, unknown>) => Promise<unknown>; /** 从子域名解析租户信息 */
|
|
468
|
+
resolveFromSubdomain: (body: {
|
|
469
|
+
host: string;
|
|
470
|
+
}) => Promise<unknown>; /** 从令牌解析租户信息 */
|
|
471
|
+
resolveFromToken: (body: {
|
|
472
|
+
token: string;
|
|
473
|
+
}) => Promise<unknown>;
|
|
474
|
+
};
|
|
475
|
+
/**
|
|
476
|
+
* 创建成员管理 API 函数
|
|
477
|
+
*/
|
|
478
|
+
declare function createMembershipApiFunctions(routeGroup: RouteGroup, client: HttpClient): {
|
|
479
|
+
/** 获取成员详情 */getMember: (id: string) => Promise<unknown>; /** 获取租户下的成员列表 */
|
|
480
|
+
listMembersByTenant: (tenantId: string, params?: Record<string, unknown>) => Promise<unknown>; /** 获取用户所属的成员列表 */
|
|
481
|
+
listMembersByUser: (userId: string) => Promise<unknown>; /** 查找租户下的指定用户成员 */
|
|
482
|
+
getMemberByTenantAndUser: (tenantId: string, userId: string) => Promise<unknown>; /** 添加成员 */
|
|
483
|
+
addMember: (tenantId: string, body: Record<string, unknown>) => Promise<unknown>; /** 删除成员 */
|
|
484
|
+
deleteMember: (id: string) => Promise<unknown>; /** 获取邀请详情 */
|
|
485
|
+
getInvitation: (id: string) => Promise<unknown>; /** 获取租户下的邀请列表 */
|
|
486
|
+
listInvitationsByTenant: (tenantId: string, params?: Record<string, unknown>) => Promise<unknown>; /** 通过邀请码查找邀请 */
|
|
487
|
+
getInvitationByCode: (code: string) => Promise<unknown>; /** 创建邀请 */
|
|
488
|
+
createInvitation: (tenantId: string, body: Record<string, unknown>) => Promise<unknown>; /** 删除邀请 */
|
|
489
|
+
deleteInvitation: (id: string) => Promise<unknown>;
|
|
490
|
+
};
|
|
491
|
+
/**
|
|
492
|
+
* 创建订阅管理 API 函数
|
|
493
|
+
*/
|
|
494
|
+
declare function createSubscriptionApiFunctions(routeGroup: RouteGroup, client: HttpClient): {
|
|
495
|
+
/** 获取计划详情 */getPlan: (id: string) => Promise<unknown>; /** 获取计划列表 */
|
|
496
|
+
listPlans: (params?: Record<string, unknown>) => Promise<unknown>; /** 创建计划 */
|
|
497
|
+
createPlan: (body: Record<string, unknown>) => Promise<unknown>; /** 删除计划 */
|
|
498
|
+
deletePlan: (id: string) => Promise<unknown>; /** 获取订阅详情 */
|
|
499
|
+
getSubscription: (id: string) => Promise<unknown>; /** 获取租户的订阅 */
|
|
500
|
+
getSubscriptionByTenant: (tenantId: string) => Promise<unknown>; /** 订阅计划 */
|
|
501
|
+
subscribe: (tenantId: string, body: Record<string, unknown>) => Promise<unknown>; /** 取消订阅 */
|
|
502
|
+
cancelSubscription: (id: string) => Promise<unknown>;
|
|
503
|
+
};
|
|
504
|
+
/**
|
|
505
|
+
* 创建配额管理 API 函数
|
|
506
|
+
*/
|
|
507
|
+
declare function createQuotaApiFunctions(routeGroup: RouteGroup, client: HttpClient): {
|
|
508
|
+
/** 获取配额详情 */getQuota: (id: string) => Promise<unknown>; /** 获取租户下的配额列表 */
|
|
509
|
+
listQuotasByTenant: (tenantId: string, params?: Record<string, unknown>) => Promise<unknown>; /** 获取租户指定资源类型的配额 */
|
|
510
|
+
getQuotaByTenantAndType: (tenantId: string, resourceType: string) => Promise<unknown>; /** 检查配额 */
|
|
511
|
+
checkQuota: (tenantId: string, body: Record<string, unknown>) => Promise<unknown>; /** 调整配额 */
|
|
512
|
+
adjustQuota: (id: string, body: Record<string, unknown>) => Promise<unknown>; /** 删除配额 */
|
|
513
|
+
deleteQuota: (id: string) => Promise<unknown>;
|
|
514
|
+
};
|
|
515
|
+
//#endregion
|
|
516
|
+
export { type AddMemberInput, type AdjustQuotaInput, ApiPaginatedListDataSchema, ApiResponseSchema, type BillingCycle, type CreateInvitationInput, type CreatePlanInput, type CreateTenantInput, type HttpClient, type HttpClientConfig, type InvitationItem, type InvitationListQuery, type InvitationStatus, type MemberItem, type MemberListQuery, type MemberRole, type MemberStatus, type PlanItem, type PlanListQuery, type PlanStatus, type QuotaCheckResult, type QuotaItem, type QuotaListQuery, type QuotaPeriod, type ResourceType, type RouteDefinition, type RouteGroup, type SubscribeInput, type SubscriptionItem, type SubscriptionStatus, type TenantDetail, type TenantInfo, type TenantListItem, type TenantListQuery, type TenantStatus, type TenantValidationResult, type UpdateTenantInput, addMemberInputSchema, adjustQuotaInputSchema, billingCycleSchema, createApiFunctions, createHttpClient, createInvitationInputSchema, createMembershipApiFunctions, createPlanInputSchema, createQuotaApiFunctions, createSubscriptionApiFunctions, createTenantInputSchema, defineRouteGroup, invitationItemSchema, invitationListQuerySchema, invitationStatusSchema, memberItemSchema, memberListQuerySchema, memberRoleSchema, memberStatusSchema, membershipApi, planItemSchema, planListQuerySchema, planStatusSchema, quotaApi, quotaCheckResultSchema, quotaItemSchema, quotaListQuerySchema, quotaPeriodSchema, resourceTypeSchema, subscribeInputSchema, subscriptionApi, subscriptionItemSchema, subscriptionStatusSchema, tenantApi, tenantDetailSchema, tenantInfoSchema, tenantListItemSchema, tenantListQuerySchema, tenantStatusSchema, tenantValidationResultSchema, updateTenantInputSchema };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{z as e}from"zod";const t=e.enum([`active`,`suspended`,`inactive`]),n=e.object({id:e.string(),name:e.string(),slug:e.string(),status:t,plan:e.string().nullable(),ownerId:e.string(),maxMembers:e.number(),createdAt:e.string(),updatedAt:e.string()}),r=n.extend({settings:e.record(e.string(),e.unknown())}),i=e.object({id:e.string(),name:e.string().min(1),slug:e.string().min(1),plan:e.string().nullable().optional(),ownerId:e.string().min(1),maxMembers:e.number().int().min(1).optional()}),a=e.object({name:e.string().min(1).optional(),plan:e.string().nullable().optional(),maxMembers:e.number().int().min(1).optional(),settings:e.record(e.string(),e.unknown()).optional()}),o=e.object({id:e.string(),slug:e.string(),name:e.string(),status:t}),s=e.object({valid:e.boolean(),tenantId:e.string().nullable(),error:e.string().nullable()}),c=e.object({page:e.coerce.number().min(1).optional(),pageSize:e.coerce.number().min(1).max(100).optional(),status:t.optional(),search:e.string().optional()});function l(e){return e}function u(t){return e.object({success:e.boolean(),data:t,message:e.string().optional()})}function d(t){return e.object({items:e.array(t),pagination:e.object({page:e.number(),pageSize:e.number(),total:e.number(),totalPages:e.number(),hasPrev:e.boolean(),hasNext:e.boolean()})})}const f=l({version:`v1`,prefix:`tenants`,auth:`user`,tags:[`租户`],routes:{getTenant:{method:`GET`,path:`/:id`,response:u(r),summary:`获取租户详情`},listTenants:{method:`GET`,path:`/`,query:c,response:u(d(n)),summary:`获取租户列表`},createTenant:{method:`POST`,path:`/`,body:i,response:u(r),summary:`创建租户`},updateTenant:{method:`PATCH`,path:`/:id`,body:a,response:u(r),summary:`更新租户`},deleteTenant:{method:`DELETE`,path:`/:id`,response:u(e.object({success:e.boolean()})),summary:`删除租户`},getTenantBySlug:{method:`GET`,path:`/slug/:slug`,response:u(r),summary:`通过 slug 查找租户`},validateTenant:{method:`GET`,path:`/:id/validate`,response:u(s),summary:`验证租户`},resolveFromHeader:{method:`POST`,path:`/resolve/header`,response:u(o.nullable()),summary:`从请求头解析租户信息`},resolveFromSubdomain:{method:`POST`,path:`/resolve/subdomain`,body:e.object({host:e.string()}),response:u(o.nullable()),summary:`从子域名解析租户信息`},resolveFromToken:{method:`POST`,path:`/resolve/token`,body:e.object({token:e.string()}),response:u(o.nullable()),summary:`从令牌解析租户信息`}}}),p=e.enum([`owner`,`admin`,`member`,`viewer`]),m=e.enum([`active`,`inactive`]),h=e.enum([`pending`,`accepted`,`expired`,`cancelled`]),g=e.object({id:e.string(),tenantId:e.string(),userId:e.string(),role:p,joinedAt:e.string(),status:m}),_=e.object({id:e.string(),tenantId:e.string(),inviteCode:e.string(),email:e.string().email(),role:p,expiresAt:e.string(),status:h,usedBy:e.string().nullable(),usedAt:e.string().nullable()}),v=e.object({userId:e.string().min(1),role:p}),y=e.object({email:e.string().email(),role:p,expiresInHours:e.number().int().min(1).optional()}),b=e.object({page:e.coerce.number().min(1).optional(),pageSize:e.coerce.number().min(1).max(100).optional(),role:p.optional(),status:m.optional()}),x=e.object({page:e.coerce.number().min(1).optional(),pageSize:e.coerce.number().min(1).max(100).optional(),status:h.optional()}),S=l({version:`v1`,prefix:`memberships`,auth:`user`,tags:[`成员管理`],routes:{getMember:{method:`GET`,path:`/members/:id`,response:u(g),summary:`获取成员详情`},listMembersByTenant:{method:`GET`,path:`/tenants/:tenantId/members`,query:b,response:u(e.array(g)),summary:`获取租户下的成员列表`},listMembersByUser:{method:`GET`,path:`/users/:userId/members`,response:u(e.array(g)),summary:`获取用户所属的成员列表`},getMemberByTenantAndUser:{method:`GET`,path:`/tenants/:tenantId/users/:userId/member`,response:u(g.nullable()),summary:`查找租户下的指定用户成员`},addMember:{method:`POST`,path:`/tenants/:tenantId/members`,body:v,response:u(g),summary:`添加成员`},deleteMember:{method:`DELETE`,path:`/members/:id`,response:u(e.object({success:e.boolean()})),summary:`删除成员`},getInvitation:{method:`GET`,path:`/invitations/:id`,response:u(_),summary:`获取邀请详情`},listInvitationsByTenant:{method:`GET`,path:`/tenants/:tenantId/invitations`,query:x,response:u(e.array(_)),summary:`获取租户下的邀请列表`},getInvitationByCode:{method:`GET`,path:`/invitations/code/:code`,response:u(_),summary:`通过邀请码查找邀请`},createInvitation:{method:`POST`,path:`/tenants/:tenantId/invitations`,body:y,response:u(_),summary:`创建邀请`},deleteInvitation:{method:`DELETE`,path:`/invitations/:id`,response:u(e.object({success:e.boolean()})),summary:`删除邀请`}}}),C=e.enum([`active`,`archived`]),w=e.enum([`monthly`,`yearly`,`lifetime`]),T=e.enum([`active`,`expired`,`cancelled`,`trial`]),E=e.object({id:e.string(),name:e.string(),description:e.string().nullable(),features:e.array(e.string()),limits:e.record(e.string(),e.number()),price:e.number().nonnegative(),billingCycle:w,status:C}),D=e.object({id:e.string(),tenantId:e.string(),planId:e.string(),status:T,startDate:e.string(),endDate:e.string().nullable(),trialEndAt:e.string().nullable()}),O=e.object({name:e.string().min(1),description:e.string().nullable().optional(),features:e.array(e.string()),limits:e.record(e.string(),e.number()),price:e.number().nonnegative(),billingCycle:w}),k=e.object({planId:e.string().min(1),trialDays:e.number().int().min(0).optional()}),A=e.object({page:e.coerce.number().min(1).optional(),pageSize:e.coerce.number().min(1).max(100).optional(),status:C.optional(),billingCycle:w.optional()}),j=l({version:`v1`,prefix:`subscriptions`,auth:`user`,tags:[`订阅管理`],routes:{getPlan:{method:`GET`,path:`/plans/:id`,response:u(E),summary:`获取计划详情`},listPlans:{method:`GET`,path:`/plans`,query:A,response:u(d(E)),summary:`获取计划列表`},createPlan:{method:`POST`,path:`/plans`,body:O,response:u(E),summary:`创建计划`},deletePlan:{method:`DELETE`,path:`/plans/:id`,response:u(e.object({success:e.boolean()})),summary:`删除计划`},getSubscription:{method:`GET`,path:`/subscriptions/:id`,response:u(D),summary:`获取订阅详情`},getSubscriptionByTenant:{method:`GET`,path:`/tenants/:tenantId/subscription`,response:u(D.nullable()),summary:`获取租户的订阅`},subscribe:{method:`POST`,path:`/tenants/:tenantId/subscribe`,body:k,response:u(D),summary:`订阅计划`},cancelSubscription:{method:`DELETE`,path:`/subscriptions/:id`,response:u(e.object({success:e.boolean()})),summary:`取消订阅`}}}),M=e.enum([`members`,`projects`,`storage`,`api_calls`]),N=e.enum([`monthly`,`yearly`,`total`]),P=e.object({id:e.string(),tenantId:e.string(),resourceType:M,limit:e.number().int().nonnegative(),used:e.number().int().nonnegative(),period:N}),F=e.object({allowed:e.boolean(),resourceType:M,current:e.number().int().nonnegative(),limit:e.number().int().nonnegative()}),I=e.object({resourceType:M,limit:e.number().int().min(0)}),L=e.object({page:e.coerce.number().min(1).optional(),pageSize:e.coerce.number().min(1).max(100).optional(),resourceType:M.optional(),period:N.optional()}),R=l({version:`v1`,prefix:`quotas`,auth:`user`,tags:[`配额管理`],routes:{getQuota:{method:`GET`,path:`/:id`,response:u(P),summary:`获取配额详情`},listQuotasByTenant:{method:`GET`,path:`/tenants/:tenantId`,query:L,response:u(e.array(P)),summary:`获取租户下的配额列表`},getQuotaByTenantAndType:{method:`GET`,path:`/tenants/:tenantId/type/:resourceType`,response:u(P.nullable()),summary:`获取租户指定资源类型的配额`},checkQuota:{method:`POST`,path:`/tenants/:tenantId/check`,body:e.object({resourceType:e.string()}),response:u(F),summary:`检查配额`},adjustQuota:{method:`PATCH`,path:`/:id`,body:I,response:u(P),summary:`调整配额`},deleteQuota:{method:`DELETE`,path:`/:id`,response:u(e.object({success:e.boolean()})),summary:`删除配额`}}});function z(e){return{get:async(t,n)=>{let r=new URL(t,e.baseUrl);if(n)for(let[e,t]of Object.entries(n))t!=null&&r.searchParams.set(e,String(t));let i=await(await fetch(r.toString(),{headers:{"Content-Type":`application/json`,...e.headers}})).json();return i.data??i},post:async(t,n)=>{let r=await(await fetch(new URL(t,e.baseUrl).toString(),{method:`POST`,headers:{"Content-Type":`application/json`,...e.headers},body:n?JSON.stringify(n):void 0})).json();return r.data??r},patch:async(t,n)=>{let r=await(await fetch(new URL(t,e.baseUrl).toString(),{method:`PATCH`,headers:{"Content-Type":`application/json`,...e.headers},body:n?JSON.stringify(n):void 0})).json();return r.data??r},delete:async t=>{let n=await(await fetch(new URL(t,e.baseUrl).toString(),{method:`DELETE`,headers:{"Content-Type":`application/json`,...e.headers}})).json();return n.data??n}}}function B(e,t){let n=`/api/${e.version}/${e.prefix}`;return{getTenant:e=>t.get(`${n}/${e}`),listTenants:e=>t.get(`${n}`,e),createTenant:e=>t.post(`${n}`,e),updateTenant:(e,r)=>t.patch(`${n}/${e}`,r),deleteTenant:e=>t.delete(`${n}/${e}`),getTenantBySlug:e=>t.get(`${n}/slug/${e}`),validateTenant:e=>t.get(`${n}/${e}/validate`),resolveFromHeader:e=>t.post(`${n}/resolve/header`,e),resolveFromSubdomain:e=>t.post(`${n}/resolve/subdomain`,e),resolveFromToken:e=>t.post(`${n}/resolve/token`,e)}}function V(e,t){let n=`/api/${e.version}/${e.prefix}`;return{getMember:e=>t.get(`${n}/members/${e}`),listMembersByTenant:(e,r)=>t.get(`${n}/tenants/${e}/members`,r),listMembersByUser:e=>t.get(`${n}/users/${e}/members`),getMemberByTenantAndUser:(e,r)=>t.get(`${n}/tenants/${e}/users/${r}/member`),addMember:(e,r)=>t.post(`${n}/tenants/${e}/members`,r),deleteMember:e=>t.delete(`${n}/members/${e}`),getInvitation:e=>t.get(`${n}/invitations/${e}`),listInvitationsByTenant:(e,r)=>t.get(`${n}/tenants/${e}/invitations`,r),getInvitationByCode:e=>t.get(`${n}/invitations/code/${e}`),createInvitation:(e,r)=>t.post(`${n}/tenants/${e}/invitations`,r),deleteInvitation:e=>t.delete(`${n}/invitations/${e}`)}}function H(e,t){let n=`/api/${e.version}/${e.prefix}`;return{getPlan:e=>t.get(`${n}/plans/${e}`),listPlans:e=>t.get(`${n}/plans`,e),createPlan:e=>t.post(`${n}/plans`,e),deletePlan:e=>t.delete(`${n}/plans/${e}`),getSubscription:e=>t.get(`${n}/subscriptions/${e}`),getSubscriptionByTenant:e=>t.get(`${n}/tenants/${e}/subscription`),subscribe:(e,r)=>t.post(`${n}/tenants/${e}/subscribe`,r),cancelSubscription:e=>t.delete(`${n}/subscriptions/${e}`)}}function U(e,t){let n=`/api/${e.version}/${e.prefix}`;return{getQuota:e=>t.get(`${n}/${e}`),listQuotasByTenant:(e,r)=>t.get(`${n}/tenants/${e}`,r),getQuotaByTenantAndType:(e,r)=>t.get(`${n}/tenants/${e}/type/${r}`),checkQuota:(e,r)=>t.post(`${n}/tenants/${e}/check`,r),adjustQuota:(e,r)=>t.patch(`${n}/${e}`,r),deleteQuota:e=>t.delete(`${n}/${e}`)}}export{d as ApiPaginatedListDataSchema,u as ApiResponseSchema,v as addMemberInputSchema,I as adjustQuotaInputSchema,w as billingCycleSchema,B as createApiFunctions,z as createHttpClient,y as createInvitationInputSchema,V as createMembershipApiFunctions,O as createPlanInputSchema,U as createQuotaApiFunctions,H as createSubscriptionApiFunctions,i as createTenantInputSchema,l as defineRouteGroup,_ as invitationItemSchema,x as invitationListQuerySchema,h as invitationStatusSchema,g as memberItemSchema,b as memberListQuerySchema,p as memberRoleSchema,m as memberStatusSchema,S as membershipApi,E as planItemSchema,A as planListQuerySchema,C as planStatusSchema,R as quotaApi,F as quotaCheckResultSchema,P as quotaItemSchema,L as quotaListQuerySchema,N as quotaPeriodSchema,M as resourceTypeSchema,k as subscribeInputSchema,j as subscriptionApi,D as subscriptionItemSchema,T as subscriptionStatusSchema,f as tenantApi,r as tenantDetailSchema,o as tenantInfoSchema,n as tenantListItemSchema,c as tenantListQuerySchema,t as tenantStatusSchema,s as tenantValidationResultSchema,a as updateTenantInputSchema};
|
package/package.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@longzai-intelligence-tenant/sdk",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"private": false,
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "tsgo --build tsconfig/build.json && resolve-aliases -p tsconfig/build.json",
|
|
20
|
+
"build:prod": "NODE_ENV=production tsdown",
|
|
21
|
+
"prepublishOnly": "bun run build:prod",
|
|
22
|
+
"typecheck": "bun run typecheck:app && bun run typecheck:node && bun run typecheck:test",
|
|
23
|
+
"typecheck:app": "tsgo --noEmit -p tsconfig/app.json",
|
|
24
|
+
"typecheck:node": "tsgo --noEmit -p tsconfig/node.json",
|
|
25
|
+
"typecheck:test": "tsgo --noEmit -p tsconfig/test.json",
|
|
26
|
+
"lint": "oxlint src && oxfmt --check src",
|
|
27
|
+
"lint:fix": "oxlint --fix src && oxfmt src",
|
|
28
|
+
"test": "bun test",
|
|
29
|
+
"test:watch": "bun test --watch",
|
|
30
|
+
"test:coverage": "bun test --coverage",
|
|
31
|
+
"clean": "rm -rf dist out .cache"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"@longzai-intelligence-tenant/core": "0.0.1",
|
|
35
|
+
"zod": "^4.4.3"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {}
|
|
38
|
+
}
|