@primocaredentgroup/elettromedicali 0.1.0
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/client/index.d.ts +72 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +233 -0
- package/dist/client/index.js.map +1 -0
- package/dist/component/_generated/api.d.ts +94 -0
- package/dist/component/_generated/api.d.ts.map +1 -0
- package/dist/component/_generated/api.js +31 -0
- package/dist/component/_generated/api.js.map +1 -0
- package/dist/component/_generated/component.d.ts +1444 -0
- package/dist/component/_generated/component.d.ts.map +1 -0
- package/dist/component/_generated/component.js +11 -0
- package/dist/component/_generated/component.js.map +1 -0
- package/dist/component/_generated/dataModel.d.ts +46 -0
- package/dist/component/_generated/dataModel.d.ts.map +1 -0
- package/dist/component/_generated/dataModel.js +11 -0
- package/dist/component/_generated/dataModel.js.map +1 -0
- package/dist/component/_generated/server.d.ts +121 -0
- package/dist/component/_generated/server.d.ts.map +1 -0
- package/dist/component/_generated/server.js +78 -0
- package/dist/component/_generated/server.js.map +1 -0
- package/dist/component/apiKeys.d.ts +69 -0
- package/dist/component/apiKeys.d.ts.map +1 -0
- package/dist/component/apiKeys.js +207 -0
- package/dist/component/apiKeys.js.map +1 -0
- package/dist/component/clinics.d.ts +103 -0
- package/dist/component/clinics.d.ts.map +1 -0
- package/dist/component/clinics.js +126 -0
- package/dist/component/clinics.js.map +1 -0
- package/dist/component/contracts.d.ts +85 -0
- package/dist/component/contracts.d.ts.map +1 -0
- package/dist/component/contracts.js +115 -0
- package/dist/component/contracts.js.map +1 -0
- package/dist/component/convex.config.d.ts +3 -0
- package/dist/component/convex.config.d.ts.map +1 -0
- package/dist/component/convex.config.js +3 -0
- package/dist/component/convex.config.js.map +1 -0
- package/dist/component/crons.d.ts +3 -0
- package/dist/component/crons.d.ts.map +1 -0
- package/dist/component/crons.js +7 -0
- package/dist/component/crons.js.map +1 -0
- package/dist/component/dashboardStats.d.ts +14 -0
- package/dist/component/dashboardStats.d.ts.map +1 -0
- package/dist/component/dashboardStats.js +136 -0
- package/dist/component/dashboardStats.js.map +1 -0
- package/dist/component/dashboardStatsCache.d.ts +32 -0
- package/dist/component/dashboardStatsCache.d.ts.map +1 -0
- package/dist/component/dashboardStatsCache.js +129 -0
- package/dist/component/dashboardStatsCache.js.map +1 -0
- package/dist/component/deviceCategories.d.ts +108 -0
- package/dist/component/deviceCategories.d.ts.map +1 -0
- package/dist/component/deviceCategories.js +254 -0
- package/dist/component/deviceCategories.js.map +1 -0
- package/dist/component/deviceQuestions.d.ts +129 -0
- package/dist/component/deviceQuestions.d.ts.map +1 -0
- package/dist/component/deviceQuestions.js +175 -0
- package/dist/component/deviceQuestions.js.map +1 -0
- package/dist/component/deviceRepairHistory.d.ts +30 -0
- package/dist/component/deviceRepairHistory.d.ts.map +1 -0
- package/dist/component/deviceRepairHistory.js +84 -0
- package/dist/component/deviceRepairHistory.js.map +1 -0
- package/dist/component/deviceStatus.d.ts +63 -0
- package/dist/component/deviceStatus.d.ts.map +1 -0
- package/dist/component/deviceStatus.js +58 -0
- package/dist/component/deviceStatus.js.map +1 -0
- package/dist/component/devices.d.ts +299 -0
- package/dist/component/devices.d.ts.map +1 -0
- package/dist/component/devices.js +587 -0
- package/dist/component/devices.js.map +1 -0
- package/dist/component/emailHelpers.d.ts +17 -0
- package/dist/component/emailHelpers.d.ts.map +1 -0
- package/dist/component/emailHelpers.js +39 -0
- package/dist/component/emailHelpers.js.map +1 -0
- package/dist/component/emails.d.ts +56 -0
- package/dist/component/emails.d.ts.map +1 -0
- package/dist/component/emails.js +58 -0
- package/dist/component/emails.js.map +1 -0
- package/dist/component/http.d.ts +3 -0
- package/dist/component/http.d.ts.map +1 -0
- package/dist/component/http.js +229 -0
- package/dist/component/http.js.map +1 -0
- package/dist/component/maintenanceTasks.d.ts +733 -0
- package/dist/component/maintenanceTasks.d.ts.map +1 -0
- package/dist/component/maintenanceTasks.js +937 -0
- package/dist/component/maintenanceTasks.js.map +1 -0
- package/dist/component/roles.d.ts +75 -0
- package/dist/component/roles.d.ts.map +1 -0
- package/dist/component/roles.js +98 -0
- package/dist/component/roles.js.map +1 -0
- package/dist/component/schema.d.ts +1295 -0
- package/dist/component/schema.d.ts.map +1 -0
- package/dist/component/schema.js +724 -0
- package/dist/component/schema.js.map +1 -0
- package/dist/component/slaMonitoring.d.ts +32 -0
- package/dist/component/slaMonitoring.d.ts.map +1 -0
- package/dist/component/slaMonitoring.js +111 -0
- package/dist/component/slaMonitoring.js.map +1 -0
- package/dist/component/slaRules.d.ts +72 -0
- package/dist/component/slaRules.d.ts.map +1 -0
- package/dist/component/slaRules.js +193 -0
- package/dist/component/slaRules.js.map +1 -0
- package/dist/component/sparePartOrders.d.ts +177 -0
- package/dist/component/sparePartOrders.d.ts.map +1 -0
- package/dist/component/sparePartOrders.js +243 -0
- package/dist/component/sparePartOrders.js.map +1 -0
- package/dist/component/spareParts.d.ts +472 -0
- package/dist/component/spareParts.d.ts.map +1 -0
- package/dist/component/spareParts.js +319 -0
- package/dist/component/spareParts.js.map +1 -0
- package/dist/component/supplierCategories.d.ts +22 -0
- package/dist/component/supplierCategories.d.ts.map +1 -0
- package/dist/component/supplierCategories.js +64 -0
- package/dist/component/supplierCategories.js.map +1 -0
- package/dist/component/suppliers.d.ts +94 -0
- package/dist/component/suppliers.d.ts.map +1 -0
- package/dist/component/suppliers.js +195 -0
- package/dist/component/suppliers.js.map +1 -0
- package/dist/component/ticketComments.d.ts +89 -0
- package/dist/component/ticketComments.d.ts.map +1 -0
- package/dist/component/ticketComments.js +246 -0
- package/dist/component/ticketComments.js.map +1 -0
- package/dist/component/ticketCustomFields.d.ts +149 -0
- package/dist/component/ticketCustomFields.d.ts.map +1 -0
- package/dist/component/ticketCustomFields.js +215 -0
- package/dist/component/ticketCustomFields.js.map +1 -0
- package/dist/component/ticketExport.d.ts +83 -0
- package/dist/component/ticketExport.d.ts.map +1 -0
- package/dist/component/ticketExport.js +182 -0
- package/dist/component/ticketExport.js.map +1 -0
- package/dist/component/ticketHistory.d.ts +57 -0
- package/dist/component/ticketHistory.d.ts.map +1 -0
- package/dist/component/ticketHistory.js +81 -0
- package/dist/component/ticketHistory.js.map +1 -0
- package/dist/component/ticketMacros.d.ts +141 -0
- package/dist/component/ticketMacros.d.ts.map +1 -0
- package/dist/component/ticketMacros.js +255 -0
- package/dist/component/ticketMacros.js.map +1 -0
- package/dist/component/ticketStatuses.d.ts +60 -0
- package/dist/component/ticketStatuses.d.ts.map +1 -0
- package/dist/component/ticketStatuses.js +110 -0
- package/dist/component/ticketStatuses.js.map +1 -0
- package/dist/component/ticketTriggers.d.ts +408 -0
- package/dist/component/ticketTriggers.d.ts.map +1 -0
- package/dist/component/ticketTriggers.js +941 -0
- package/dist/component/ticketTriggers.js.map +1 -0
- package/dist/component/userProfiles.d.ts +259 -0
- package/dist/component/userProfiles.d.ts.map +1 -0
- package/dist/component/userProfiles.js +634 -0
- package/dist/component/userProfiles.js.map +1 -0
- package/dist/component/vendorArticles.d.ts +64 -0
- package/dist/component/vendorArticles.d.ts.map +1 -0
- package/dist/component/vendorArticles.js +116 -0
- package/dist/component/vendorArticles.js.map +1 -0
- package/dist/test.d.ts +1302 -0
- package/dist/test.d.ts.map +1 -0
- package/dist/test.js +7 -0
- package/dist/test.js.map +1 -0
- package/package.json +71 -0
- package/src/client/index.ts +344 -0
- package/src/component/_generated/api.ts +110 -0
- package/src/component/_generated/component.ts +2460 -0
- package/src/component/_generated/dataModel.ts +60 -0
- package/src/component/_generated/server.ts +156 -0
- package/src/component/apiKeys.ts +229 -0
- package/src/component/clinics.ts +136 -0
- package/src/component/contracts.ts +136 -0
- package/src/component/convex.config.js +2 -0
- package/src/component/convex.config.ts +3 -0
- package/src/component/crons.ts +18 -0
- package/src/component/dashboardStats.ts +141 -0
- package/src/component/dashboardStatsCache.ts +145 -0
- package/src/component/deviceCategories.ts +280 -0
- package/src/component/deviceQuestions.ts +225 -0
- package/src/component/deviceRepairHistory.ts +94 -0
- package/src/component/deviceStatus.ts +79 -0
- package/src/component/devices.ts +645 -0
- package/src/component/emailHelpers.ts +38 -0
- package/src/component/emails.ts +61 -0
- package/src/component/http.ts +231 -0
- package/src/component/maintenanceTasks.ts +1003 -0
- package/src/component/roles.ts +99 -0
- package/src/component/schema.ts +842 -0
- package/src/component/slaMonitoring.ts +125 -0
- package/src/component/slaRules.ts +231 -0
- package/src/component/sparePartOrders.ts +290 -0
- package/src/component/spareParts.ts +362 -0
- package/src/component/supplierCategories.ts +65 -0
- package/src/component/suppliers.ts +234 -0
- package/src/component/ticketComments.ts +288 -0
- package/src/component/ticketCustomFields.ts +260 -0
- package/src/component/ticketExport.ts +220 -0
- package/src/component/ticketHistory.ts +106 -0
- package/src/component/ticketMacros.ts +291 -0
- package/src/component/ticketStatuses.ts +109 -0
- package/src/component/ticketTriggers.ts +1152 -0
- package/src/component/userProfiles.ts +745 -0
- package/src/component/vendorArticles.ts +139 -0
- package/src/test.ts +15 -0
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { v } from 'convex/values';
|
|
2
|
+
import { query, mutation } from './_generated/server';
|
|
3
|
+
export const getRepairHistory = query({
|
|
4
|
+
args: {
|
|
5
|
+
deviceId: v.id('devices'),
|
|
6
|
+
},
|
|
7
|
+
handler: async (ctx, args) => {
|
|
8
|
+
const repairs = await ctx.db
|
|
9
|
+
.query('device_repair_history')
|
|
10
|
+
.withIndex('by_deviceId', (q) => q.eq('deviceId', args.deviceId))
|
|
11
|
+
.take(100);
|
|
12
|
+
return repairs.sort((a, b) => b.sentToRepairAt - a.sentToRepairAt);
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
export const sendToRepair = mutation({
|
|
16
|
+
args: {
|
|
17
|
+
deviceId: v.id('devices'),
|
|
18
|
+
ticketId: v.optional(v.id('maintenance_tasks')),
|
|
19
|
+
notes: v.optional(v.string()),
|
|
20
|
+
createdBy: v.string(),
|
|
21
|
+
},
|
|
22
|
+
handler: async (ctx, args) => {
|
|
23
|
+
const device = await ctx.db.get(args.deviceId);
|
|
24
|
+
if (!device) {
|
|
25
|
+
throw new Error('Device not found');
|
|
26
|
+
}
|
|
27
|
+
const repairId = await ctx.db.insert('device_repair_history', {
|
|
28
|
+
deviceId: args.deviceId,
|
|
29
|
+
clinicId: device.clinicId,
|
|
30
|
+
ticketId: args.ticketId,
|
|
31
|
+
sentToRepairAt: Date.now(),
|
|
32
|
+
notes: args.notes,
|
|
33
|
+
createdBy: args.createdBy,
|
|
34
|
+
});
|
|
35
|
+
await ctx.db.patch(args.deviceId, {
|
|
36
|
+
status: 'in_maintenance',
|
|
37
|
+
});
|
|
38
|
+
return repairId;
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
export const returnFromRepair = mutation({
|
|
42
|
+
args: {
|
|
43
|
+
deviceId: v.id('devices'),
|
|
44
|
+
statusAfterRepair: v.union(v.literal('active'), v.literal('out_of_service')),
|
|
45
|
+
notes: v.optional(v.string()),
|
|
46
|
+
returnedBy: v.string(),
|
|
47
|
+
},
|
|
48
|
+
handler: async (ctx, args) => {
|
|
49
|
+
const device = await ctx.db.get(args.deviceId);
|
|
50
|
+
if (!device) {
|
|
51
|
+
throw new Error('Device not found');
|
|
52
|
+
}
|
|
53
|
+
const repairs = await ctx.db
|
|
54
|
+
.query('device_repair_history')
|
|
55
|
+
.withIndex('by_deviceId', (q) => q.eq('deviceId', args.deviceId))
|
|
56
|
+
.take(100);
|
|
57
|
+
const openRepair = repairs.find((r) => !r.returnedAt);
|
|
58
|
+
if (openRepair) {
|
|
59
|
+
await ctx.db.patch(openRepair._id, {
|
|
60
|
+
returnedAt: Date.now(),
|
|
61
|
+
statusAfterRepair: args.statusAfterRepair,
|
|
62
|
+
notes: args.notes || openRepair.notes,
|
|
63
|
+
returnedBy: args.returnedBy,
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
await ctx.db.insert('device_repair_history', {
|
|
68
|
+
deviceId: args.deviceId,
|
|
69
|
+
clinicId: device.clinicId,
|
|
70
|
+
sentToRepairAt: Date.now(),
|
|
71
|
+
returnedAt: Date.now(),
|
|
72
|
+
statusAfterRepair: args.statusAfterRepair,
|
|
73
|
+
notes: args.notes,
|
|
74
|
+
createdBy: args.returnedBy,
|
|
75
|
+
returnedBy: args.returnedBy,
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
await ctx.db.patch(args.deviceId, {
|
|
79
|
+
status: args.statusAfterRepair,
|
|
80
|
+
});
|
|
81
|
+
return { success: true };
|
|
82
|
+
},
|
|
83
|
+
});
|
|
84
|
+
//# sourceMappingURL=deviceRepairHistory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deviceRepairHistory.js","sourceRoot":"","sources":["../../src/component/deviceRepairHistory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAEtD,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,CAAC;IACpC,IAAI,EAAE;QACJ,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC;KAC1B;IACD,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;QAC3B,MAAM,OAAO,GAAG,MAAM,GAAG,CAAC,EAAE;aACzB,KAAK,CAAC,uBAAuB,CAAC;aAC9B,SAAS,CAAC,aAAa,EAAE,CAAC,CAAM,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;aACrE,IAAI,CAAC,GAAG,CAAC,CAAC;QAEb,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,cAAc,GAAG,CAAC,CAAC,cAAc,CAAC,CAAC;IACrE,CAAC;CACF,CAAC,CAAC;AAE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C,uBAAuB,EAAE;gBAC3C,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,QAAQ,EAAE,MAAM,CAAC,QAAQ;gBACzB,cAAc,EAAE,IAAI,CAAC,GAAG,EAAE;gBAC1B,UAAU,EAAE,IAAI,CAAC,GAAG,EAAE;gBACtB,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;gBACzC,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,SAAS,EAAE,IAAI,CAAC,UAAU;gBAC1B,UAAU,EAAE,IAAI,CAAC,UAAU;aAC5B,CAAC,CAAC;QACL,CAAC;QAED,MAAM,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE;YAChC,MAAM,EAAE,IAAI,CAAC,iBAAiB;SAC/B,CAAC,CAAC;QAEH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC3B,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
export declare const computeDeviceStatus: import("convex/server").RegisteredQuery<"public", {
|
|
2
|
+
deviceId: import("convex/values").GenericId<"devices">;
|
|
3
|
+
}, Promise<"in_uso" | "smaltito" | "da_smaltire" | "guasto">>;
|
|
4
|
+
export declare const getDeviceTicketHistory: import("convex/server").RegisteredQuery<"public", {
|
|
5
|
+
deviceId: import("convex/values").GenericId<"devices">;
|
|
6
|
+
}, Promise<{
|
|
7
|
+
clinic: {
|
|
8
|
+
_id: import("convex/values").GenericId<"clinics">;
|
|
9
|
+
_creationTime: number;
|
|
10
|
+
region?: string | undefined;
|
|
11
|
+
primoupId?: string | undefined;
|
|
12
|
+
name: string;
|
|
13
|
+
address: string;
|
|
14
|
+
contact_email: string;
|
|
15
|
+
contact_phone: string;
|
|
16
|
+
} | null;
|
|
17
|
+
supplier: {
|
|
18
|
+
_id: import("convex/values").GenericId<"suppliers">;
|
|
19
|
+
_creationTime: number;
|
|
20
|
+
type?: string | undefined;
|
|
21
|
+
primoupId?: string | undefined;
|
|
22
|
+
notes?: string | undefined;
|
|
23
|
+
name: string;
|
|
24
|
+
contact_email: string;
|
|
25
|
+
contact_phone: string;
|
|
26
|
+
categories: string[];
|
|
27
|
+
sla_days: number;
|
|
28
|
+
} | null;
|
|
29
|
+
_id: import("convex/values").GenericId<"maintenance_tasks">;
|
|
30
|
+
_creationTime: number;
|
|
31
|
+
supplierId?: import("convex/values").GenericId<"suppliers"> | undefined;
|
|
32
|
+
notes?: string | undefined;
|
|
33
|
+
deviceId?: import("convex/values").GenericId<"devices"> | undefined;
|
|
34
|
+
priority?: "low" | "medium" | "high" | undefined;
|
|
35
|
+
ticketNumber?: string | undefined;
|
|
36
|
+
title?: string | undefined;
|
|
37
|
+
createdByEmail?: string | undefined;
|
|
38
|
+
photoStorageIds?: import("convex/values").GenericId<"_storage">[] | undefined;
|
|
39
|
+
customFields?: any;
|
|
40
|
+
deviceQuestionAnswers?: {
|
|
41
|
+
questionId: import("convex/values").GenericId<"device_questions">;
|
|
42
|
+
question: string;
|
|
43
|
+
answer: any;
|
|
44
|
+
}[] | undefined;
|
|
45
|
+
slaDeadline?: number | undefined;
|
|
46
|
+
slaBreached?: boolean | undefined;
|
|
47
|
+
slaWarningSent?: boolean | undefined;
|
|
48
|
+
externalTicketId?: string | undefined;
|
|
49
|
+
externalTicketNumber?: number | undefined;
|
|
50
|
+
importSource?: string | undefined;
|
|
51
|
+
legacyTicketId?: number | undefined;
|
|
52
|
+
isExternal?: boolean | undefined;
|
|
53
|
+
needsAssignment?: boolean | undefined;
|
|
54
|
+
closed_at?: number | undefined;
|
|
55
|
+
description: string;
|
|
56
|
+
clinicId: import("convex/values").GenericId<"clinics">;
|
|
57
|
+
status: string;
|
|
58
|
+
created_by: string;
|
|
59
|
+
photos: string[];
|
|
60
|
+
created_at: number;
|
|
61
|
+
updated_at: number;
|
|
62
|
+
}[]>>;
|
|
63
|
+
//# sourceMappingURL=deviceStatus.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deviceStatus.d.ts","sourceRoot":"","sources":["../../src/component/deviceStatus.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,mBAAmB;;6DA6C9B,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA4BjC,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { query } from './_generated/server';
|
|
2
|
+
import { v } from 'convex/values';
|
|
3
|
+
export const computeDeviceStatus = query({
|
|
4
|
+
args: { deviceId: v.id('devices') },
|
|
5
|
+
handler: async (ctx, { deviceId }) => {
|
|
6
|
+
const tickets = await ctx.db
|
|
7
|
+
.query('maintenance_tasks')
|
|
8
|
+
.withIndex('by_deviceId', (q) => q.eq('deviceId', deviceId))
|
|
9
|
+
.take(200);
|
|
10
|
+
if (tickets.length === 0) {
|
|
11
|
+
return 'in_uso';
|
|
12
|
+
}
|
|
13
|
+
const smaltito = tickets.find((t) => t.status === 'smaltito' &&
|
|
14
|
+
t.updated_at &&
|
|
15
|
+
t.created_at < t.updated_at);
|
|
16
|
+
if (smaltito) {
|
|
17
|
+
return 'smaltito';
|
|
18
|
+
}
|
|
19
|
+
const raee = tickets.find((t) => t.description?.toLowerCase().includes('raee') ||
|
|
20
|
+
t.description?.toLowerCase().includes('smaltimento'));
|
|
21
|
+
if (raee && raee.status !== 'closed' && raee.status !== 'completed') {
|
|
22
|
+
return 'da_smaltire';
|
|
23
|
+
}
|
|
24
|
+
const openTickets = tickets.filter((t) => t.status === 'open' ||
|
|
25
|
+
t.status === 'assigned_to_supplier' ||
|
|
26
|
+
t.status === 'in_progress' ||
|
|
27
|
+
t.status === 'pending');
|
|
28
|
+
if (openTickets.length > 0) {
|
|
29
|
+
return 'guasto';
|
|
30
|
+
}
|
|
31
|
+
return 'in_uso';
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
export const getDeviceTicketHistory = query({
|
|
35
|
+
args: { deviceId: v.id('devices') },
|
|
36
|
+
handler: async (ctx, { deviceId }) => {
|
|
37
|
+
const tickets = await ctx.db
|
|
38
|
+
.query('maintenance_tasks')
|
|
39
|
+
.withIndex('by_deviceId', (q) => q.eq('deviceId', deviceId))
|
|
40
|
+
.order('desc')
|
|
41
|
+
.take(50);
|
|
42
|
+
const enrichedTickets = await Promise.all(tickets.map(async (ticket) => {
|
|
43
|
+
const clinic = ticket.clinicId
|
|
44
|
+
? await ctx.db.get(ticket.clinicId)
|
|
45
|
+
: null;
|
|
46
|
+
const supplier = ticket.supplierId
|
|
47
|
+
? await ctx.db.get(ticket.supplierId)
|
|
48
|
+
: null;
|
|
49
|
+
return {
|
|
50
|
+
...ticket,
|
|
51
|
+
clinic,
|
|
52
|
+
supplier,
|
|
53
|
+
};
|
|
54
|
+
}));
|
|
55
|
+
return enrichedTickets;
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
//# sourceMappingURL=deviceStatus.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deviceStatus.js","sourceRoot":"","sources":["../../src/component/deviceStatus.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAElC,MAAM,CAAC,MAAM,mBAAmB,GAAG,KAAK,CAAC;IACvC,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,EAAE;IACnC,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;QACnC,MAAM,OAAO,GAAG,MAAM,GAAG,CAAC,EAAE;aACzB,KAAK,CAAC,mBAAmB,CAAC;aAC1B,SAAS,CAAC,aAAa,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;aAC3D,IA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CAAC,SAAS,CAAC,EAAE;IACnC,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;QACnC,MAAM,OAAO,GAAG,MAAM,GAAG,CAAC,EAAE;aACzB,KAAK,CAAC,mBAAmB,CAAC;aAC1B,SAAS,CAAC,aAAa,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;aAC3D,KAAK,CAAC,MAAM,CAAC;aACb,IAAI,CAAC,EAAE,CAAC,CAAC;QAEZ,MAAM,eAAe,GAAG,MAAM,OAAO,CAAC,GAAG,CACvC,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;YAC3B,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ;gBAC5B,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC;gBACnC,CAAC,CAAC,IAAI,CAAC;YACT,MAAM,QAAQ,GAAG,MAAM,CAAC,UAAU;gBAChC,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC;gBACrC,CAAC,CAAC,IAAI,CAAC;YAET,OAAO;gBACL,GAAG,MAAM;gBACT,MAAM;gBACN,QAAQ;aACT,CAAC;QACJ,CAAC,CAAC,CACH,CAAC;QAEF,OAAO,eAAe,CAAC;IACzB,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
export declare const listDevices: import("convex/server").RegisteredQuery<"public", {
|
|
2
|
+
clinicId?: import("convex/values").GenericId<"clinics"> | undefined;
|
|
3
|
+
userSelectedClinicId?: number | undefined;
|
|
4
|
+
userClinicId?: import("convex/values").GenericId<"clinics"> | undefined;
|
|
5
|
+
userRole?: string | undefined;
|
|
6
|
+
_triggerReload?: number | undefined;
|
|
7
|
+
paginationOpts?: {
|
|
8
|
+
cursor: string | null;
|
|
9
|
+
numItems: number;
|
|
10
|
+
} | undefined;
|
|
11
|
+
}, Promise<any[]>>;
|
|
12
|
+
export declare const listDevicesPaginated: import("convex/server").RegisteredQuery<"public", {
|
|
13
|
+
clinicId?: import("convex/values").GenericId<"clinics"> | undefined;
|
|
14
|
+
category?: string | undefined;
|
|
15
|
+
brand?: string | undefined;
|
|
16
|
+
status?: string | undefined;
|
|
17
|
+
userSelectedClinicId?: number | undefined;
|
|
18
|
+
userClinicId?: import("convex/values").GenericId<"clinics"> | undefined;
|
|
19
|
+
userRole?: string | undefined;
|
|
20
|
+
searchTerm?: string | undefined;
|
|
21
|
+
paginationOpts: {
|
|
22
|
+
cursor: string | null;
|
|
23
|
+
numItems: number;
|
|
24
|
+
};
|
|
25
|
+
}, Promise<{
|
|
26
|
+
page: {
|
|
27
|
+
_id: any;
|
|
28
|
+
name: any;
|
|
29
|
+
category: any;
|
|
30
|
+
brand: any;
|
|
31
|
+
model: any;
|
|
32
|
+
serialNumber: any;
|
|
33
|
+
internalId: any;
|
|
34
|
+
status: any;
|
|
35
|
+
clinicId: any;
|
|
36
|
+
clinicName: any;
|
|
37
|
+
photoUrl: string | null;
|
|
38
|
+
}[];
|
|
39
|
+
isDone: boolean;
|
|
40
|
+
continueCursor: string;
|
|
41
|
+
}>>;
|
|
42
|
+
export declare const getDevicesCount: import("convex/server").RegisteredQuery<"public", {
|
|
43
|
+
clinicId?: import("convex/values").GenericId<"clinics"> | undefined;
|
|
44
|
+
category?: string | undefined;
|
|
45
|
+
brand?: string | undefined;
|
|
46
|
+
status?: string | undefined;
|
|
47
|
+
userSelectedClinicId?: number | undefined;
|
|
48
|
+
userClinicId?: import("convex/values").GenericId<"clinics"> | undefined;
|
|
49
|
+
userRole?: string | undefined;
|
|
50
|
+
}, Promise<{
|
|
51
|
+
total: number;
|
|
52
|
+
}>>;
|
|
53
|
+
export declare const getDevice: import("convex/server").RegisteredQuery<"public", {
|
|
54
|
+
deviceId: import("convex/values").GenericId<"devices">;
|
|
55
|
+
}, Promise<{
|
|
56
|
+
photoUrl: any;
|
|
57
|
+
_id: import("convex/values").GenericId<"devices">;
|
|
58
|
+
_creationTime: number;
|
|
59
|
+
supplierId?: import("convex/values").GenericId<"suppliers"> | undefined;
|
|
60
|
+
metadata?: any;
|
|
61
|
+
primoupClinicId?: number | undefined;
|
|
62
|
+
photo?: string | undefined;
|
|
63
|
+
photoStorageId?: import("convex/values").GenericId<"_storage"> | undefined;
|
|
64
|
+
internalId?: string | undefined;
|
|
65
|
+
articleId?: string | undefined;
|
|
66
|
+
primoupCategoryId?: string | undefined;
|
|
67
|
+
industry40Data?: string | undefined;
|
|
68
|
+
quantity?: number | undefined;
|
|
69
|
+
purchaseDate?: number | undefined;
|
|
70
|
+
vendor?: string | undefined;
|
|
71
|
+
purchaseCost?: number | undefined;
|
|
72
|
+
warrantyEndDate?: number | undefined;
|
|
73
|
+
spareParts?: {
|
|
74
|
+
photoStorageId?: import("convex/values").GenericId<"_storage"> | undefined;
|
|
75
|
+
notes?: string | undefined;
|
|
76
|
+
name: string;
|
|
77
|
+
quantity: number;
|
|
78
|
+
code: string;
|
|
79
|
+
}[] | undefined;
|
|
80
|
+
maintenanceManualStorageId?: import("convex/values").GenericId<"_storage"> | undefined;
|
|
81
|
+
maintenanceReportsStorageIds?: import("convex/values").GenericId<"_storage">[] | undefined;
|
|
82
|
+
conformityDeclarationStorageId?: import("convex/values").GenericId<"_storage"> | undefined;
|
|
83
|
+
authorizationsStorageIds?: import("convex/values").GenericId<"_storage">[] | undefined;
|
|
84
|
+
otherAttachmentsStorageIds?: import("convex/values").GenericId<"_storage">[] | undefined;
|
|
85
|
+
name: string;
|
|
86
|
+
clinicId: import("convex/values").GenericId<"clinics">;
|
|
87
|
+
category: string;
|
|
88
|
+
brand: string;
|
|
89
|
+
model: string;
|
|
90
|
+
serial_number: string;
|
|
91
|
+
status: "active" | "in_maintenance" | "out_of_service";
|
|
92
|
+
} | null>>;
|
|
93
|
+
export declare const getById: import("convex/server").RegisteredQuery<"public", {
|
|
94
|
+
id: import("convex/values").GenericId<"devices">;
|
|
95
|
+
}, Promise<{
|
|
96
|
+
photoUrl: any;
|
|
97
|
+
_id: import("convex/values").GenericId<"devices">;
|
|
98
|
+
_creationTime: number;
|
|
99
|
+
supplierId?: import("convex/values").GenericId<"suppliers"> | undefined;
|
|
100
|
+
metadata?: any;
|
|
101
|
+
primoupClinicId?: number | undefined;
|
|
102
|
+
photo?: string | undefined;
|
|
103
|
+
photoStorageId?: import("convex/values").GenericId<"_storage"> | undefined;
|
|
104
|
+
internalId?: string | undefined;
|
|
105
|
+
articleId?: string | undefined;
|
|
106
|
+
primoupCategoryId?: string | undefined;
|
|
107
|
+
industry40Data?: string | undefined;
|
|
108
|
+
quantity?: number | undefined;
|
|
109
|
+
purchaseDate?: number | undefined;
|
|
110
|
+
vendor?: string | undefined;
|
|
111
|
+
purchaseCost?: number | undefined;
|
|
112
|
+
warrantyEndDate?: number | undefined;
|
|
113
|
+
spareParts?: {
|
|
114
|
+
photoStorageId?: import("convex/values").GenericId<"_storage"> | undefined;
|
|
115
|
+
notes?: string | undefined;
|
|
116
|
+
name: string;
|
|
117
|
+
quantity: number;
|
|
118
|
+
code: string;
|
|
119
|
+
}[] | undefined;
|
|
120
|
+
maintenanceManualStorageId?: import("convex/values").GenericId<"_storage"> | undefined;
|
|
121
|
+
maintenanceReportsStorageIds?: import("convex/values").GenericId<"_storage">[] | undefined;
|
|
122
|
+
conformityDeclarationStorageId?: import("convex/values").GenericId<"_storage"> | undefined;
|
|
123
|
+
authorizationsStorageIds?: import("convex/values").GenericId<"_storage">[] | undefined;
|
|
124
|
+
otherAttachmentsStorageIds?: import("convex/values").GenericId<"_storage">[] | undefined;
|
|
125
|
+
name: string;
|
|
126
|
+
clinicId: import("convex/values").GenericId<"clinics">;
|
|
127
|
+
category: string;
|
|
128
|
+
brand: string;
|
|
129
|
+
model: string;
|
|
130
|
+
serial_number: string;
|
|
131
|
+
status: "active" | "in_maintenance" | "out_of_service";
|
|
132
|
+
} | null>>;
|
|
133
|
+
export declare const listAllDevicesForMigration: import("convex/server").RegisteredQuery<"public", {
|
|
134
|
+
lastCreationTime?: number | undefined;
|
|
135
|
+
limit?: number | undefined;
|
|
136
|
+
}, Promise<{
|
|
137
|
+
_id: import("convex/values").GenericId<"devices">;
|
|
138
|
+
_creationTime: number;
|
|
139
|
+
supplierId?: import("convex/values").GenericId<"suppliers"> | undefined;
|
|
140
|
+
metadata?: any;
|
|
141
|
+
primoupClinicId?: number | undefined;
|
|
142
|
+
photo?: string | undefined;
|
|
143
|
+
photoStorageId?: import("convex/values").GenericId<"_storage"> | undefined;
|
|
144
|
+
internalId?: string | undefined;
|
|
145
|
+
articleId?: string | undefined;
|
|
146
|
+
primoupCategoryId?: string | undefined;
|
|
147
|
+
industry40Data?: string | undefined;
|
|
148
|
+
quantity?: number | undefined;
|
|
149
|
+
purchaseDate?: number | undefined;
|
|
150
|
+
vendor?: string | undefined;
|
|
151
|
+
purchaseCost?: number | undefined;
|
|
152
|
+
warrantyEndDate?: number | undefined;
|
|
153
|
+
spareParts?: {
|
|
154
|
+
photoStorageId?: import("convex/values").GenericId<"_storage"> | undefined;
|
|
155
|
+
notes?: string | undefined;
|
|
156
|
+
name: string;
|
|
157
|
+
quantity: number;
|
|
158
|
+
code: string;
|
|
159
|
+
}[] | undefined;
|
|
160
|
+
maintenanceManualStorageId?: import("convex/values").GenericId<"_storage"> | undefined;
|
|
161
|
+
maintenanceReportsStorageIds?: import("convex/values").GenericId<"_storage">[] | undefined;
|
|
162
|
+
conformityDeclarationStorageId?: import("convex/values").GenericId<"_storage"> | undefined;
|
|
163
|
+
authorizationsStorageIds?: import("convex/values").GenericId<"_storage">[] | undefined;
|
|
164
|
+
otherAttachmentsStorageIds?: import("convex/values").GenericId<"_storage">[] | undefined;
|
|
165
|
+
name: string;
|
|
166
|
+
clinicId: import("convex/values").GenericId<"clinics">;
|
|
167
|
+
category: string;
|
|
168
|
+
brand: string;
|
|
169
|
+
model: string;
|
|
170
|
+
serial_number: string;
|
|
171
|
+
status: "active" | "in_maintenance" | "out_of_service";
|
|
172
|
+
}[]>>;
|
|
173
|
+
export declare const generateUploadUrl: import("convex/server").RegisteredMutation<"public", {}, Promise<string>>;
|
|
174
|
+
export declare const createDevice: import("convex/server").RegisteredMutation<"public", {
|
|
175
|
+
supplierId?: import("convex/values").GenericId<"suppliers"> | undefined;
|
|
176
|
+
metadata?: any;
|
|
177
|
+
photoStorageId?: import("convex/values").GenericId<"_storage"> | undefined;
|
|
178
|
+
internalId?: string | undefined;
|
|
179
|
+
industry40Data?: string | undefined;
|
|
180
|
+
purchaseDate?: number | undefined;
|
|
181
|
+
vendor?: string | undefined;
|
|
182
|
+
purchaseCost?: number | undefined;
|
|
183
|
+
warrantyEndDate?: number | undefined;
|
|
184
|
+
spareParts?: {
|
|
185
|
+
photoStorageId?: import("convex/values").GenericId<"_storage"> | undefined;
|
|
186
|
+
notes?: string | undefined;
|
|
187
|
+
name: string;
|
|
188
|
+
quantity: number;
|
|
189
|
+
code: string;
|
|
190
|
+
}[] | undefined;
|
|
191
|
+
maintenanceManualStorageId?: import("convex/values").GenericId<"_storage"> | undefined;
|
|
192
|
+
maintenanceReportsStorageIds?: import("convex/values").GenericId<"_storage">[] | undefined;
|
|
193
|
+
conformityDeclarationStorageId?: import("convex/values").GenericId<"_storage"> | undefined;
|
|
194
|
+
authorizationsStorageIds?: import("convex/values").GenericId<"_storage">[] | undefined;
|
|
195
|
+
otherAttachmentsStorageIds?: import("convex/values").GenericId<"_storage">[] | undefined;
|
|
196
|
+
name: string;
|
|
197
|
+
clinicId: import("convex/values").GenericId<"clinics">;
|
|
198
|
+
category: string;
|
|
199
|
+
brand: string;
|
|
200
|
+
model: string;
|
|
201
|
+
serial_number: string;
|
|
202
|
+
status: "active" | "in_maintenance" | "out_of_service";
|
|
203
|
+
}, Promise<import("convex/values").GenericId<"devices">>>;
|
|
204
|
+
export declare const updateDevice: import("convex/server").RegisteredMutation<"public", {
|
|
205
|
+
name?: string | undefined;
|
|
206
|
+
clinicId?: import("convex/values").GenericId<"clinics"> | undefined;
|
|
207
|
+
supplierId?: import("convex/values").GenericId<"suppliers"> | undefined;
|
|
208
|
+
metadata?: any;
|
|
209
|
+
primoupClinicId?: number | undefined;
|
|
210
|
+
category?: string | undefined;
|
|
211
|
+
brand?: string | undefined;
|
|
212
|
+
model?: string | undefined;
|
|
213
|
+
serial_number?: string | undefined;
|
|
214
|
+
photoStorageId?: import("convex/values").GenericId<"_storage"> | undefined;
|
|
215
|
+
status?: "active" | "in_maintenance" | "out_of_service" | undefined;
|
|
216
|
+
internalId?: string | undefined;
|
|
217
|
+
primoupCategoryId?: string | undefined;
|
|
218
|
+
industry40Data?: string | undefined;
|
|
219
|
+
purchaseDate?: number | undefined;
|
|
220
|
+
vendor?: string | undefined;
|
|
221
|
+
purchaseCost?: number | undefined;
|
|
222
|
+
warrantyEndDate?: number | undefined;
|
|
223
|
+
spareParts?: {
|
|
224
|
+
photoStorageId?: import("convex/values").GenericId<"_storage"> | undefined;
|
|
225
|
+
notes?: string | undefined;
|
|
226
|
+
name: string;
|
|
227
|
+
quantity: number;
|
|
228
|
+
code: string;
|
|
229
|
+
}[] | undefined;
|
|
230
|
+
maintenanceManualStorageId?: import("convex/values").GenericId<"_storage"> | undefined;
|
|
231
|
+
maintenanceReportsStorageIds?: import("convex/values").GenericId<"_storage">[] | undefined;
|
|
232
|
+
conformityDeclarationStorageId?: import("convex/values").GenericId<"_storage"> | undefined;
|
|
233
|
+
authorizationsStorageIds?: import("convex/values").GenericId<"_storage">[] | undefined;
|
|
234
|
+
otherAttachmentsStorageIds?: import("convex/values").GenericId<"_storage">[] | undefined;
|
|
235
|
+
deviceId: import("convex/values").GenericId<"devices">;
|
|
236
|
+
}, Promise<import("convex/values").GenericId<"devices">>>;
|
|
237
|
+
export declare const updateDeviceByUser: import("convex/server").RegisteredMutation<"public", {
|
|
238
|
+
name?: string | undefined;
|
|
239
|
+
category?: string | undefined;
|
|
240
|
+
brand?: string | undefined;
|
|
241
|
+
model?: string | undefined;
|
|
242
|
+
serial_number?: string | undefined;
|
|
243
|
+
status?: "active" | "in_maintenance" | "out_of_service" | undefined;
|
|
244
|
+
industry40Data?: string | undefined;
|
|
245
|
+
userSelectedClinicId?: number | undefined;
|
|
246
|
+
userClinicId?: import("convex/values").GenericId<"clinics"> | undefined;
|
|
247
|
+
deviceId: import("convex/values").GenericId<"devices">;
|
|
248
|
+
userRole: string;
|
|
249
|
+
}, Promise<import("convex/values").GenericId<"devices">>>;
|
|
250
|
+
export declare const deleteDevice: import("convex/server").RegisteredMutation<"public", {
|
|
251
|
+
deviceId: import("convex/values").GenericId<"devices">;
|
|
252
|
+
}, Promise<{
|
|
253
|
+
success: boolean;
|
|
254
|
+
}>>;
|
|
255
|
+
export declare const getDeviceStats: import("convex/server").RegisteredQuery<"public", {
|
|
256
|
+
userClinicId?: import("convex/values").GenericId<"clinics"> | undefined;
|
|
257
|
+
userRole?: string | undefined;
|
|
258
|
+
}, Promise<{
|
|
259
|
+
total: number;
|
|
260
|
+
active: number;
|
|
261
|
+
in_maintenance: number;
|
|
262
|
+
out_of_service: number;
|
|
263
|
+
}>>;
|
|
264
|
+
export declare const getFileUrl: import("convex/server").RegisteredQuery<"public", {
|
|
265
|
+
storageId: import("convex/values").GenericId<"_storage">;
|
|
266
|
+
}, Promise<string | null>>;
|
|
267
|
+
export declare const listAllDevicesForExport: import("convex/server").RegisteredQuery<"public", {}, Promise<any[]>>;
|
|
268
|
+
export declare const getDeviceTemplates: import("convex/server").RegisteredQuery<"public", {
|
|
269
|
+
searchQuery?: string | undefined;
|
|
270
|
+
}, Promise<{
|
|
271
|
+
name: string;
|
|
272
|
+
category: string;
|
|
273
|
+
brandOptions: {
|
|
274
|
+
brand: string;
|
|
275
|
+
models: string[];
|
|
276
|
+
}[];
|
|
277
|
+
}[]>>;
|
|
278
|
+
export declare const createDeviceByUser: import("convex/server").RegisteredMutation<"public", {
|
|
279
|
+
userPrimoupClinics?: any[] | undefined;
|
|
280
|
+
name: string;
|
|
281
|
+
category: string;
|
|
282
|
+
brand: string;
|
|
283
|
+
model: string;
|
|
284
|
+
serial_number: string;
|
|
285
|
+
userSelectedClinicId: number;
|
|
286
|
+
}, Promise<import("convex/values").GenericId<"devices">>>;
|
|
287
|
+
export declare const listAllDevicesForAdmin: import("convex/server").RegisteredQuery<"public", {}, Promise<{
|
|
288
|
+
_id: import("convex/values").GenericId<"devices">;
|
|
289
|
+
name: string;
|
|
290
|
+
category: string;
|
|
291
|
+
brand: string;
|
|
292
|
+
model: string;
|
|
293
|
+
clinicId: import("convex/values").GenericId<"clinics">;
|
|
294
|
+
}[]>>;
|
|
295
|
+
export declare const getUniqueBrandsAndModels: import("convex/server").RegisteredQuery<"public", {}, Promise<{
|
|
296
|
+
brands: string[];
|
|
297
|
+
models: string[];
|
|
298
|
+
}>>;
|
|
299
|
+
//# sourceMappingURL=devices.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"devices.d.ts","sourceRoot":"","sources":["../../src/component/devices.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,WAAW;;;;;;;;;;kBAyDtB,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyG/B,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;;;;;GA2C1B,CAAC;AAEH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAWpB,CAAC;AAEH,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAWlB,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAiBrC,CAAC;AAEH,eAAO,MAAM,iBAAiB,2EAK5B,CAAC;AAEH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yDA6CvB,CAAC;AAEH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yDAkDvB,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;yDAsC7B,CAAC;AAEH,eAAO,MAAM,YAAY;;;;GAWvB,CAAC;AAEH,eAAO,MAAM,cAAc;;;;;;;;GAuCzB,CAAC;AAEH,eAAO,MAAM,UAAU;;0BAMrB,CAAC;AAEH,eAAO,MAAM,uBAAuB,uEA2BlC,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;KAiD7B,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;yDA+C7B,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;;KAcjC,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;GAsBnC,CAAC"}
|