@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 @@
|
|
|
1
|
+
{"version":3,"file":"ticketStatuses.d.ts","sourceRoot":"","sources":["../../src/component/ticketStatuses.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,kBAAkB;;;;;;;;;;KAS7B,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;;;KAMhC,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;UAQhC,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;iEAsB7B,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;GAiB7B,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;GAe7B,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;GAgB7B,CAAC"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { v } from 'convex/values';
|
|
2
|
+
import { query, mutation } from './_generated/server';
|
|
3
|
+
export const listTicketStatuses = query({
|
|
4
|
+
args: {},
|
|
5
|
+
handler: async (ctx) => {
|
|
6
|
+
const statuses = await ctx.db
|
|
7
|
+
.query('ticket_statuses')
|
|
8
|
+
.withIndex('by_isActive', (q) => q.eq('isActive', true))
|
|
9
|
+
.collect();
|
|
10
|
+
return statuses.sort((a, b) => a.order - b.order);
|
|
11
|
+
},
|
|
12
|
+
});
|
|
13
|
+
export const listAllTicketStatuses = query({
|
|
14
|
+
args: {},
|
|
15
|
+
handler: async (ctx) => {
|
|
16
|
+
const statuses = await ctx.db.query('ticket_statuses').collect();
|
|
17
|
+
return statuses.sort((a, b) => a.order - b.order);
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
export const getTicketStatusByName = query({
|
|
21
|
+
args: { name: v.string() },
|
|
22
|
+
handler: async (ctx, args) => {
|
|
23
|
+
return await ctx.db
|
|
24
|
+
.query('ticket_statuses')
|
|
25
|
+
.withIndex('by_name', (q) => q.eq('name', args.name))
|
|
26
|
+
.first();
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
export const createTicketStatus = mutation({
|
|
30
|
+
args: {
|
|
31
|
+
name: v.string(),
|
|
32
|
+
label: v.string(),
|
|
33
|
+
color: v.string(),
|
|
34
|
+
order: v.number(),
|
|
35
|
+
},
|
|
36
|
+
handler: async (ctx, args) => {
|
|
37
|
+
const existing = await ctx.db
|
|
38
|
+
.query('ticket_statuses')
|
|
39
|
+
.withIndex('by_name', (q) => q.eq('name', args.name))
|
|
40
|
+
.first();
|
|
41
|
+
if (existing)
|
|
42
|
+
throw new Error('Status with this name already exists');
|
|
43
|
+
return await ctx.db.insert('ticket_statuses', {
|
|
44
|
+
name: args.name,
|
|
45
|
+
label: args.label,
|
|
46
|
+
color: args.color,
|
|
47
|
+
order: args.order,
|
|
48
|
+
isActive: true,
|
|
49
|
+
createdAt: Date.now(),
|
|
50
|
+
});
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
export const updateTicketStatus = mutation({
|
|
54
|
+
args: {
|
|
55
|
+
statusId: v.id('ticket_statuses'),
|
|
56
|
+
label: v.optional(v.string()),
|
|
57
|
+
color: v.optional(v.string()),
|
|
58
|
+
order: v.optional(v.number()),
|
|
59
|
+
isActive: v.optional(v.boolean()),
|
|
60
|
+
},
|
|
61
|
+
handler: async (ctx, args) => {
|
|
62
|
+
const updates = {};
|
|
63
|
+
if (args.label !== undefined)
|
|
64
|
+
updates.label = args.label;
|
|
65
|
+
if (args.color !== undefined)
|
|
66
|
+
updates.color = args.color;
|
|
67
|
+
if (args.order !== undefined)
|
|
68
|
+
updates.order = args.order;
|
|
69
|
+
if (args.isActive !== undefined)
|
|
70
|
+
updates.isActive = args.isActive;
|
|
71
|
+
await ctx.db.patch(args.statusId, updates);
|
|
72
|
+
return { success: true };
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
export const deleteTicketStatus = mutation({
|
|
76
|
+
args: { statusId: v.id('ticket_statuses') },
|
|
77
|
+
handler: async (ctx, args) => {
|
|
78
|
+
const status = await ctx.db.get(args.statusId);
|
|
79
|
+
if (!status)
|
|
80
|
+
throw new Error('Status not found');
|
|
81
|
+
const ticketsWithStatus = await ctx.db
|
|
82
|
+
.query('maintenance_tasks')
|
|
83
|
+
.withIndex('by_status', (q) => q.eq('status', status.name))
|
|
84
|
+
.first();
|
|
85
|
+
if (ticketsWithStatus) {
|
|
86
|
+
throw new Error('Cannot delete status: tickets are using it. Deactivate it instead.');
|
|
87
|
+
}
|
|
88
|
+
await ctx.db.delete(args.statusId);
|
|
89
|
+
return { success: true };
|
|
90
|
+
},
|
|
91
|
+
});
|
|
92
|
+
export const seedTicketStatuses = mutation({
|
|
93
|
+
args: {},
|
|
94
|
+
handler: async (ctx) => {
|
|
95
|
+
const existing = await ctx.db.query('ticket_statuses').first();
|
|
96
|
+
if (existing)
|
|
97
|
+
throw new Error('Ticket statuses already seeded');
|
|
98
|
+
const defaultStatuses = [
|
|
99
|
+
{ name: 'open', label: 'Aperto', color: 'warning', order: 1 },
|
|
100
|
+
{ name: 'in_progress', label: 'In Corso', color: 'primary', order: 2 },
|
|
101
|
+
{ name: 'completed', label: 'Completato', color: 'success', order: 3 },
|
|
102
|
+
{ name: 'cancelled', label: 'Annullato', color: 'danger', order: 4 },
|
|
103
|
+
];
|
|
104
|
+
for (const status of defaultStatuses) {
|
|
105
|
+
await ctx.db.insert('ticket_statuses', { ...status, isActive: true, createdAt: Date.now() });
|
|
106
|
+
}
|
|
107
|
+
return { success: true, count: defaultStatuses.length };
|
|
108
|
+
},
|
|
109
|
+
});
|
|
110
|
+
//# sourceMappingURL=ticketStatuses.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ticketStatuses.js","sourceRoot":"","sources":["../../src/component/ticketStatuses.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,kBAAkB,GAAG,KAAK,CAAC;IACtC,IAAI,EAAE,EAAE;IACR,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE;QACrB,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,EAAE;aAC1B,KAAK,CAAC,iBAAiB,CAAC;aACxB,SAAS,CAAC,aAAa,EAAE,CAAC,CAAM,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;aAC5D,OAAO,EAAE,CAAC;QACb,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,qBAAqB,GAAG,KAAK,CAAC;IACzC,IAAI,EAAE,EAAE;IACR,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE;QACrB,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,EAAE,CAAC,KA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,CAAC,iBAAiB,CAAC,CAAC,KAAK,EAAE,CAAC;QAC/D,IAAI,QAAQ;YAAE,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;QAChE,MAAM,eAAe,GAAG;YACtB,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,EAAE;YAC7D,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,EAAE;YACtE,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,EAAE;YACtE,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,EAAE;SACrE,CAAC;QACF,KAAK,MAAM,MAAM,IAAI,eAAe,EAAE,CAAC;YACrC,MAAM,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,iBAAiB,EAAE,EAAE,GAAG,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QAC/F,CAAC;QACD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,eAAe,CAAC,MAAM,EAAE,CAAC;IAC1D,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,408 @@
|
|
|
1
|
+
export declare const listAllTriggers: import("convex/server").RegisteredQuery<"public", {}, Promise<{
|
|
2
|
+
_id: import("convex/values").GenericId<"ticket_triggers">;
|
|
3
|
+
_creationTime: number;
|
|
4
|
+
description?: string | undefined;
|
|
5
|
+
name: string;
|
|
6
|
+
createdAt: number;
|
|
7
|
+
isActive: boolean;
|
|
8
|
+
createdBy: string;
|
|
9
|
+
priority: number;
|
|
10
|
+
updatedAt: number;
|
|
11
|
+
conditions: {
|
|
12
|
+
categories?: string[] | undefined;
|
|
13
|
+
conditionLogic?: "AND" | "OR" | undefined;
|
|
14
|
+
conditionsList?: {
|
|
15
|
+
customFieldId?: import("convex/values").GenericId<"ticket_custom_fields"> | undefined;
|
|
16
|
+
customFieldOperator?: "equals" | "not_equals" | "contains" | "greater_than" | "less_than" | "is_empty" | "is_not_empty" | undefined;
|
|
17
|
+
type: "region" | "category" | "brand" | "model" | "status" | "priority" | "trigger_event" | "custom_field";
|
|
18
|
+
negated: boolean;
|
|
19
|
+
value: string | string[];
|
|
20
|
+
nextOperator: "AND" | "OR";
|
|
21
|
+
}[] | undefined;
|
|
22
|
+
regions?: string[] | undefined;
|
|
23
|
+
applyToAllRegions?: boolean | undefined;
|
|
24
|
+
brands?: string[] | undefined;
|
|
25
|
+
brandOperator?: "is" | "is_not" | undefined;
|
|
26
|
+
models?: string[] | undefined;
|
|
27
|
+
modelOperator?: "is" | "is_not" | undefined;
|
|
28
|
+
statuses?: string[] | undefined;
|
|
29
|
+
statusOperator?: "is" | "is_not" | undefined;
|
|
30
|
+
customFieldConditions?: {
|
|
31
|
+
value?: any;
|
|
32
|
+
fieldId: import("convex/values").GenericId<"ticket_custom_fields">;
|
|
33
|
+
operator: "equals" | "not_equals" | "contains" | "greater_than" | "less_than" | "is_empty" | "is_not_empty";
|
|
34
|
+
}[] | undefined;
|
|
35
|
+
sparePartOrderFilters?: {
|
|
36
|
+
statuses?: string[] | undefined;
|
|
37
|
+
supplierIds?: import("convex/values").GenericId<"suppliers">[] | undefined;
|
|
38
|
+
applyToAllSuppliers?: boolean | undefined;
|
|
39
|
+
} | undefined;
|
|
40
|
+
applyToAllCategories: boolean;
|
|
41
|
+
triggerOn: "create" | "status_change" | "update" | "sla_warning" | "sla_breach" | "spare_part_order_created" | "spare_part_order_status_change";
|
|
42
|
+
};
|
|
43
|
+
actions: {
|
|
44
|
+
changeStatus?: string | undefined;
|
|
45
|
+
assignSupplier?: import("convex/values").GenericId<"suppliers"> | undefined;
|
|
46
|
+
assignUser?: import("convex/values").GenericId<"user_profiles"> | undefined;
|
|
47
|
+
setSlaHours?: number | undefined;
|
|
48
|
+
applySlaRule?: boolean | undefined;
|
|
49
|
+
addNote?: string | undefined;
|
|
50
|
+
sendNotification?: {
|
|
51
|
+
recipients: ("admin" | "supplier" | {
|
|
52
|
+
supplierId?: import("convex/values").GenericId<"suppliers"> | undefined;
|
|
53
|
+
userId?: import("convex/values").GenericId<"user_profiles"> | undefined;
|
|
54
|
+
type: "admin" | "supplier" | "ticket_creator" | "ticket_assignee" | "specific_user" | "specific_supplier";
|
|
55
|
+
} | "clinic")[];
|
|
56
|
+
message: string;
|
|
57
|
+
} | undefined;
|
|
58
|
+
setPriority?: string | undefined;
|
|
59
|
+
requireAttachment?: boolean | undefined;
|
|
60
|
+
sparePartOrderActions?: {
|
|
61
|
+
changeOrderStatus?: string | undefined;
|
|
62
|
+
addOrderNote?: string | undefined;
|
|
63
|
+
sendOrderNotification?: {
|
|
64
|
+
recipients: ("admin" | "supplier" | "order_creator")[];
|
|
65
|
+
message: string;
|
|
66
|
+
} | undefined;
|
|
67
|
+
} | undefined;
|
|
68
|
+
};
|
|
69
|
+
}[]>>;
|
|
70
|
+
export declare const listActiveTriggers: import("convex/server").RegisteredQuery<"public", {}, Promise<{
|
|
71
|
+
_id: import("convex/values").GenericId<"ticket_triggers">;
|
|
72
|
+
_creationTime: number;
|
|
73
|
+
description?: string | undefined;
|
|
74
|
+
name: string;
|
|
75
|
+
createdAt: number;
|
|
76
|
+
isActive: boolean;
|
|
77
|
+
createdBy: string;
|
|
78
|
+
priority: number;
|
|
79
|
+
updatedAt: number;
|
|
80
|
+
conditions: {
|
|
81
|
+
categories?: string[] | undefined;
|
|
82
|
+
conditionLogic?: "AND" | "OR" | undefined;
|
|
83
|
+
conditionsList?: {
|
|
84
|
+
customFieldId?: import("convex/values").GenericId<"ticket_custom_fields"> | undefined;
|
|
85
|
+
customFieldOperator?: "equals" | "not_equals" | "contains" | "greater_than" | "less_than" | "is_empty" | "is_not_empty" | undefined;
|
|
86
|
+
type: "region" | "category" | "brand" | "model" | "status" | "priority" | "trigger_event" | "custom_field";
|
|
87
|
+
negated: boolean;
|
|
88
|
+
value: string | string[];
|
|
89
|
+
nextOperator: "AND" | "OR";
|
|
90
|
+
}[] | undefined;
|
|
91
|
+
regions?: string[] | undefined;
|
|
92
|
+
applyToAllRegions?: boolean | undefined;
|
|
93
|
+
brands?: string[] | undefined;
|
|
94
|
+
brandOperator?: "is" | "is_not" | undefined;
|
|
95
|
+
models?: string[] | undefined;
|
|
96
|
+
modelOperator?: "is" | "is_not" | undefined;
|
|
97
|
+
statuses?: string[] | undefined;
|
|
98
|
+
statusOperator?: "is" | "is_not" | undefined;
|
|
99
|
+
customFieldConditions?: {
|
|
100
|
+
value?: any;
|
|
101
|
+
fieldId: import("convex/values").GenericId<"ticket_custom_fields">;
|
|
102
|
+
operator: "equals" | "not_equals" | "contains" | "greater_than" | "less_than" | "is_empty" | "is_not_empty";
|
|
103
|
+
}[] | undefined;
|
|
104
|
+
sparePartOrderFilters?: {
|
|
105
|
+
statuses?: string[] | undefined;
|
|
106
|
+
supplierIds?: import("convex/values").GenericId<"suppliers">[] | undefined;
|
|
107
|
+
applyToAllSuppliers?: boolean | undefined;
|
|
108
|
+
} | undefined;
|
|
109
|
+
applyToAllCategories: boolean;
|
|
110
|
+
triggerOn: "create" | "status_change" | "update" | "sla_warning" | "sla_breach" | "spare_part_order_created" | "spare_part_order_status_change";
|
|
111
|
+
};
|
|
112
|
+
actions: {
|
|
113
|
+
changeStatus?: string | undefined;
|
|
114
|
+
assignSupplier?: import("convex/values").GenericId<"suppliers"> | undefined;
|
|
115
|
+
assignUser?: import("convex/values").GenericId<"user_profiles"> | undefined;
|
|
116
|
+
setSlaHours?: number | undefined;
|
|
117
|
+
applySlaRule?: boolean | undefined;
|
|
118
|
+
addNote?: string | undefined;
|
|
119
|
+
sendNotification?: {
|
|
120
|
+
recipients: ("admin" | "supplier" | {
|
|
121
|
+
supplierId?: import("convex/values").GenericId<"suppliers"> | undefined;
|
|
122
|
+
userId?: import("convex/values").GenericId<"user_profiles"> | undefined;
|
|
123
|
+
type: "admin" | "supplier" | "ticket_creator" | "ticket_assignee" | "specific_user" | "specific_supplier";
|
|
124
|
+
} | "clinic")[];
|
|
125
|
+
message: string;
|
|
126
|
+
} | undefined;
|
|
127
|
+
setPriority?: string | undefined;
|
|
128
|
+
requireAttachment?: boolean | undefined;
|
|
129
|
+
sparePartOrderActions?: {
|
|
130
|
+
changeOrderStatus?: string | undefined;
|
|
131
|
+
addOrderNote?: string | undefined;
|
|
132
|
+
sendOrderNotification?: {
|
|
133
|
+
recipients: ("admin" | "supplier" | "order_creator")[];
|
|
134
|
+
message: string;
|
|
135
|
+
} | undefined;
|
|
136
|
+
} | undefined;
|
|
137
|
+
};
|
|
138
|
+
}[]>>;
|
|
139
|
+
export declare const getTrigger: import("convex/server").RegisteredQuery<"public", {
|
|
140
|
+
triggerId: import("convex/values").GenericId<"ticket_triggers">;
|
|
141
|
+
}, Promise<{
|
|
142
|
+
_id: import("convex/values").GenericId<"ticket_triggers">;
|
|
143
|
+
_creationTime: number;
|
|
144
|
+
description?: string | undefined;
|
|
145
|
+
name: string;
|
|
146
|
+
createdAt: number;
|
|
147
|
+
isActive: boolean;
|
|
148
|
+
createdBy: string;
|
|
149
|
+
priority: number;
|
|
150
|
+
updatedAt: number;
|
|
151
|
+
conditions: {
|
|
152
|
+
categories?: string[] | undefined;
|
|
153
|
+
conditionLogic?: "AND" | "OR" | undefined;
|
|
154
|
+
conditionsList?: {
|
|
155
|
+
customFieldId?: import("convex/values").GenericId<"ticket_custom_fields"> | undefined;
|
|
156
|
+
customFieldOperator?: "equals" | "not_equals" | "contains" | "greater_than" | "less_than" | "is_empty" | "is_not_empty" | undefined;
|
|
157
|
+
type: "region" | "category" | "brand" | "model" | "status" | "priority" | "trigger_event" | "custom_field";
|
|
158
|
+
negated: boolean;
|
|
159
|
+
value: string | string[];
|
|
160
|
+
nextOperator: "AND" | "OR";
|
|
161
|
+
}[] | undefined;
|
|
162
|
+
regions?: string[] | undefined;
|
|
163
|
+
applyToAllRegions?: boolean | undefined;
|
|
164
|
+
brands?: string[] | undefined;
|
|
165
|
+
brandOperator?: "is" | "is_not" | undefined;
|
|
166
|
+
models?: string[] | undefined;
|
|
167
|
+
modelOperator?: "is" | "is_not" | undefined;
|
|
168
|
+
statuses?: string[] | undefined;
|
|
169
|
+
statusOperator?: "is" | "is_not" | undefined;
|
|
170
|
+
customFieldConditions?: {
|
|
171
|
+
value?: any;
|
|
172
|
+
fieldId: import("convex/values").GenericId<"ticket_custom_fields">;
|
|
173
|
+
operator: "equals" | "not_equals" | "contains" | "greater_than" | "less_than" | "is_empty" | "is_not_empty";
|
|
174
|
+
}[] | undefined;
|
|
175
|
+
sparePartOrderFilters?: {
|
|
176
|
+
statuses?: string[] | undefined;
|
|
177
|
+
supplierIds?: import("convex/values").GenericId<"suppliers">[] | undefined;
|
|
178
|
+
applyToAllSuppliers?: boolean | undefined;
|
|
179
|
+
} | undefined;
|
|
180
|
+
applyToAllCategories: boolean;
|
|
181
|
+
triggerOn: "create" | "status_change" | "update" | "sla_warning" | "sla_breach" | "spare_part_order_created" | "spare_part_order_status_change";
|
|
182
|
+
};
|
|
183
|
+
actions: {
|
|
184
|
+
changeStatus?: string | undefined;
|
|
185
|
+
assignSupplier?: import("convex/values").GenericId<"suppliers"> | undefined;
|
|
186
|
+
assignUser?: import("convex/values").GenericId<"user_profiles"> | undefined;
|
|
187
|
+
setSlaHours?: number | undefined;
|
|
188
|
+
applySlaRule?: boolean | undefined;
|
|
189
|
+
addNote?: string | undefined;
|
|
190
|
+
sendNotification?: {
|
|
191
|
+
recipients: ("admin" | "supplier" | {
|
|
192
|
+
supplierId?: import("convex/values").GenericId<"suppliers"> | undefined;
|
|
193
|
+
userId?: import("convex/values").GenericId<"user_profiles"> | undefined;
|
|
194
|
+
type: "admin" | "supplier" | "ticket_creator" | "ticket_assignee" | "specific_user" | "specific_supplier";
|
|
195
|
+
} | "clinic")[];
|
|
196
|
+
message: string;
|
|
197
|
+
} | undefined;
|
|
198
|
+
setPriority?: string | undefined;
|
|
199
|
+
requireAttachment?: boolean | undefined;
|
|
200
|
+
sparePartOrderActions?: {
|
|
201
|
+
changeOrderStatus?: string | undefined;
|
|
202
|
+
addOrderNote?: string | undefined;
|
|
203
|
+
sendOrderNotification?: {
|
|
204
|
+
recipients: ("admin" | "supplier" | "order_creator")[];
|
|
205
|
+
message: string;
|
|
206
|
+
} | undefined;
|
|
207
|
+
} | undefined;
|
|
208
|
+
};
|
|
209
|
+
} | null>>;
|
|
210
|
+
export declare const createTrigger: import("convex/server").RegisteredMutation<"public", {
|
|
211
|
+
description?: string | undefined;
|
|
212
|
+
priority?: number | undefined;
|
|
213
|
+
name: string;
|
|
214
|
+
createdBy: string;
|
|
215
|
+
conditions: {
|
|
216
|
+
categories?: string[] | undefined;
|
|
217
|
+
conditionLogic?: "AND" | "OR" | undefined;
|
|
218
|
+
conditionsList?: {
|
|
219
|
+
customFieldId?: import("convex/values").GenericId<"ticket_custom_fields"> | undefined;
|
|
220
|
+
customFieldOperator?: "equals" | "not_equals" | "contains" | "greater_than" | "less_than" | "is_empty" | "is_not_empty" | undefined;
|
|
221
|
+
type: "region" | "category" | "brand" | "model" | "status" | "priority" | "trigger_event" | "custom_field";
|
|
222
|
+
negated: boolean;
|
|
223
|
+
value: string | string[];
|
|
224
|
+
nextOperator: "AND" | "OR";
|
|
225
|
+
}[] | undefined;
|
|
226
|
+
regions?: string[] | undefined;
|
|
227
|
+
applyToAllRegions?: boolean | undefined;
|
|
228
|
+
brands?: string[] | undefined;
|
|
229
|
+
brandOperator?: "is" | "is_not" | undefined;
|
|
230
|
+
models?: string[] | undefined;
|
|
231
|
+
modelOperator?: "is" | "is_not" | undefined;
|
|
232
|
+
statuses?: string[] | undefined;
|
|
233
|
+
statusOperator?: "is" | "is_not" | undefined;
|
|
234
|
+
customFieldConditions?: {
|
|
235
|
+
value?: any;
|
|
236
|
+
fieldId: import("convex/values").GenericId<"ticket_custom_fields">;
|
|
237
|
+
operator: "equals" | "not_equals" | "contains" | "greater_than" | "less_than" | "is_empty" | "is_not_empty";
|
|
238
|
+
}[] | undefined;
|
|
239
|
+
sparePartOrderFilters?: {
|
|
240
|
+
statuses?: string[] | undefined;
|
|
241
|
+
supplierIds?: import("convex/values").GenericId<"suppliers">[] | undefined;
|
|
242
|
+
applyToAllSuppliers?: boolean | undefined;
|
|
243
|
+
} | undefined;
|
|
244
|
+
applyToAllCategories: boolean;
|
|
245
|
+
triggerOn: "create" | "status_change" | "update" | "sla_warning" | "sla_breach" | "spare_part_order_created" | "spare_part_order_status_change";
|
|
246
|
+
};
|
|
247
|
+
actions: {
|
|
248
|
+
changeStatus?: string | undefined;
|
|
249
|
+
assignSupplier?: import("convex/values").GenericId<"suppliers"> | undefined;
|
|
250
|
+
setSlaHours?: number | undefined;
|
|
251
|
+
applySlaRule?: boolean | undefined;
|
|
252
|
+
addNote?: string | undefined;
|
|
253
|
+
sendNotification?: {
|
|
254
|
+
recipients: {
|
|
255
|
+
supplierId?: import("convex/values").GenericId<"suppliers"> | undefined;
|
|
256
|
+
userId?: import("convex/values").GenericId<"user_profiles"> | undefined;
|
|
257
|
+
type: "admin" | "supplier" | "ticket_creator" | "ticket_assignee" | "specific_user" | "specific_supplier";
|
|
258
|
+
}[];
|
|
259
|
+
message: string;
|
|
260
|
+
} | undefined;
|
|
261
|
+
setPriority?: "low" | "medium" | "high" | undefined;
|
|
262
|
+
requireAttachment?: boolean | undefined;
|
|
263
|
+
sparePartOrderActions?: {
|
|
264
|
+
changeOrderStatus?: string | undefined;
|
|
265
|
+
addOrderNote?: string | undefined;
|
|
266
|
+
sendOrderNotification?: {
|
|
267
|
+
recipients: ("admin" | "supplier" | "order_creator")[];
|
|
268
|
+
message: string;
|
|
269
|
+
} | undefined;
|
|
270
|
+
} | undefined;
|
|
271
|
+
};
|
|
272
|
+
}, Promise<import("convex/values").GenericId<"ticket_triggers">>>;
|
|
273
|
+
export declare const updateTrigger: import("convex/server").RegisteredMutation<"public", {
|
|
274
|
+
name?: string | undefined;
|
|
275
|
+
description?: string | undefined;
|
|
276
|
+
isActive?: boolean | undefined;
|
|
277
|
+
priority?: number | undefined;
|
|
278
|
+
conditions?: {
|
|
279
|
+
categories?: string[] | undefined;
|
|
280
|
+
conditionLogic?: "AND" | "OR" | undefined;
|
|
281
|
+
conditionsList?: {
|
|
282
|
+
customFieldId?: import("convex/values").GenericId<"ticket_custom_fields"> | undefined;
|
|
283
|
+
customFieldOperator?: "equals" | "not_equals" | "contains" | "greater_than" | "less_than" | "is_empty" | "is_not_empty" | undefined;
|
|
284
|
+
type: "region" | "category" | "brand" | "model" | "status" | "priority" | "trigger_event" | "custom_field";
|
|
285
|
+
negated: boolean;
|
|
286
|
+
value: string | string[];
|
|
287
|
+
nextOperator: "AND" | "OR";
|
|
288
|
+
}[] | undefined;
|
|
289
|
+
regions?: string[] | undefined;
|
|
290
|
+
applyToAllRegions?: boolean | undefined;
|
|
291
|
+
brands?: string[] | undefined;
|
|
292
|
+
brandOperator?: "is" | "is_not" | undefined;
|
|
293
|
+
models?: string[] | undefined;
|
|
294
|
+
modelOperator?: "is" | "is_not" | undefined;
|
|
295
|
+
statuses?: string[] | undefined;
|
|
296
|
+
statusOperator?: "is" | "is_not" | undefined;
|
|
297
|
+
customFieldConditions?: {
|
|
298
|
+
value?: any;
|
|
299
|
+
fieldId: import("convex/values").GenericId<"ticket_custom_fields">;
|
|
300
|
+
operator: "equals" | "not_equals" | "contains" | "greater_than" | "less_than" | "is_empty" | "is_not_empty";
|
|
301
|
+
}[] | undefined;
|
|
302
|
+
sparePartOrderFilters?: {
|
|
303
|
+
statuses?: string[] | undefined;
|
|
304
|
+
supplierIds?: import("convex/values").GenericId<"suppliers">[] | undefined;
|
|
305
|
+
applyToAllSuppliers?: boolean | undefined;
|
|
306
|
+
} | undefined;
|
|
307
|
+
applyToAllCategories: boolean;
|
|
308
|
+
triggerOn: "create" | "status_change" | "update" | "sla_warning" | "sla_breach" | "spare_part_order_created" | "spare_part_order_status_change";
|
|
309
|
+
} | undefined;
|
|
310
|
+
actions?: {
|
|
311
|
+
changeStatus?: string | undefined;
|
|
312
|
+
assignSupplier?: import("convex/values").GenericId<"suppliers"> | undefined;
|
|
313
|
+
setSlaHours?: number | undefined;
|
|
314
|
+
applySlaRule?: boolean | undefined;
|
|
315
|
+
addNote?: string | undefined;
|
|
316
|
+
sendNotification?: {
|
|
317
|
+
recipients: {
|
|
318
|
+
supplierId?: import("convex/values").GenericId<"suppliers"> | undefined;
|
|
319
|
+
userId?: import("convex/values").GenericId<"user_profiles"> | undefined;
|
|
320
|
+
type: "admin" | "supplier" | "ticket_creator" | "ticket_assignee" | "specific_user" | "specific_supplier";
|
|
321
|
+
}[];
|
|
322
|
+
message: string;
|
|
323
|
+
} | undefined;
|
|
324
|
+
setPriority?: "low" | "medium" | "high" | undefined;
|
|
325
|
+
requireAttachment?: boolean | undefined;
|
|
326
|
+
sparePartOrderActions?: {
|
|
327
|
+
changeOrderStatus?: string | undefined;
|
|
328
|
+
addOrderNote?: string | undefined;
|
|
329
|
+
sendOrderNotification?: {
|
|
330
|
+
recipients: ("admin" | "supplier" | "order_creator")[];
|
|
331
|
+
message: string;
|
|
332
|
+
} | undefined;
|
|
333
|
+
} | undefined;
|
|
334
|
+
} | undefined;
|
|
335
|
+
triggerId: import("convex/values").GenericId<"ticket_triggers">;
|
|
336
|
+
}, Promise<import("convex/values").GenericId<"ticket_triggers">>>;
|
|
337
|
+
export declare const deleteTrigger: import("convex/server").RegisteredMutation<"public", {
|
|
338
|
+
triggerId: import("convex/values").GenericId<"ticket_triggers">;
|
|
339
|
+
}, Promise<{
|
|
340
|
+
success: boolean;
|
|
341
|
+
}>>;
|
|
342
|
+
export declare const toggleTrigger: import("convex/server").RegisteredMutation<"public", {
|
|
343
|
+
isActive: boolean;
|
|
344
|
+
triggerId: import("convex/values").GenericId<"ticket_triggers">;
|
|
345
|
+
}, Promise<{
|
|
346
|
+
success: boolean;
|
|
347
|
+
}>>;
|
|
348
|
+
export declare const duplicateTrigger: import("convex/server").RegisteredMutation<"public", {
|
|
349
|
+
newName?: string | undefined;
|
|
350
|
+
createdBy: string;
|
|
351
|
+
triggerId: import("convex/values").GenericId<"ticket_triggers">;
|
|
352
|
+
}, Promise<import("convex/values").GenericId<"ticket_triggers">>>;
|
|
353
|
+
export declare const reorderTriggers: import("convex/server").RegisteredMutation<"public", {
|
|
354
|
+
triggerOrders: {
|
|
355
|
+
priority: number;
|
|
356
|
+
triggerId: import("convex/values").GenericId<"ticket_triggers">;
|
|
357
|
+
}[];
|
|
358
|
+
}, Promise<{
|
|
359
|
+
success: boolean;
|
|
360
|
+
}>>;
|
|
361
|
+
export declare const executeTriggers: import("convex/server").RegisteredMutation<"public", {
|
|
362
|
+
oldStatus?: string | undefined;
|
|
363
|
+
ticketId: import("convex/values").GenericId<"maintenance_tasks">;
|
|
364
|
+
triggerOn: "create" | "status_change" | "update" | "sla_warning" | "sla_breach";
|
|
365
|
+
}, Promise<{
|
|
366
|
+
success: boolean;
|
|
367
|
+
}>>;
|
|
368
|
+
export declare const checkAttachmentRequired: import("convex/server").RegisteredQuery<"public", {
|
|
369
|
+
clinicId?: import("convex/values").GenericId<"clinics"> | undefined;
|
|
370
|
+
status?: string | undefined;
|
|
371
|
+
deviceId?: import("convex/values").GenericId<"devices"> | undefined;
|
|
372
|
+
priority?: "low" | "medium" | "high" | undefined;
|
|
373
|
+
customFields?: any;
|
|
374
|
+
}, Promise<{
|
|
375
|
+
required: boolean;
|
|
376
|
+
matchingTriggers: {
|
|
377
|
+
id: string;
|
|
378
|
+
name: string;
|
|
379
|
+
}[];
|
|
380
|
+
}>>;
|
|
381
|
+
export declare const simulateTrigger: import("convex/server").RegisteredQuery<"public", {
|
|
382
|
+
triggerId: import("convex/values").GenericId<"ticket_triggers">;
|
|
383
|
+
simulationData: {
|
|
384
|
+
region?: string | undefined;
|
|
385
|
+
category?: string | undefined;
|
|
386
|
+
brand?: string | undefined;
|
|
387
|
+
model?: string | undefined;
|
|
388
|
+
status?: string | undefined;
|
|
389
|
+
priority?: "low" | "medium" | "high" | undefined;
|
|
390
|
+
customFields?: any;
|
|
391
|
+
triggerOn: "create" | "status_change" | "update" | "sla_warning" | "sla_breach";
|
|
392
|
+
};
|
|
393
|
+
}, Promise<{
|
|
394
|
+
triggerId: import("convex/values").GenericId<"ticket_triggers">;
|
|
395
|
+
triggerName: string;
|
|
396
|
+
wouldTrigger: boolean;
|
|
397
|
+
conditionResults: {
|
|
398
|
+
type: string;
|
|
399
|
+
expected: any;
|
|
400
|
+
actual: any;
|
|
401
|
+
negated: boolean;
|
|
402
|
+
result: boolean;
|
|
403
|
+
description: string;
|
|
404
|
+
}[];
|
|
405
|
+
actionDescriptions: string[];
|
|
406
|
+
isActive: boolean;
|
|
407
|
+
}>>;
|
|
408
|
+
//# sourceMappingURL=ticketTriggers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ticketTriggers.d.ts","sourceRoot":"","sources":["../../src/component/ticketTriggers.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAS1B,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAU7B,CAAC;AAEH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAKrB,CAAC;AAEH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iEAyIxB,CAAC;AAEH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iEA2HxB,CAAC;AAEH,eAAO,MAAM,aAAa;;;;GAMxB,CAAC;AAEH,eAAO,MAAM,aAAa;;;;;GAaxB,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;iEAmC3B,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;;GAiB1B,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;GA2U1B,CAAC;AAEH,eAAO,MAAM,uBAAuB;;;;;;;;;YA8II,MAAM;cAAQ,MAAM;;GA8D1D,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;cA8BhB,MAAM;kBACF,GAAG;gBACL,GAAG;iBACF,OAAO;gBACR,OAAO;qBACF,MAAM;;;;GAwMvB,CAAC"}
|