@magemetrics/core 0.1.8 → 0.3.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/index.d.ts +548 -258
- package/dist/index.js +543 -105
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -385,7 +385,8 @@ var ReportSchema = z.object({
|
|
|
385
385
|
columns: z.record(z.string(), ReportColumnSchema)
|
|
386
386
|
}).passthrough(),
|
|
387
387
|
bookmarked: z.boolean(),
|
|
388
|
-
status: z.string().nullable()
|
|
388
|
+
status: z.string().nullable(),
|
|
389
|
+
is_removed: z.boolean()
|
|
389
390
|
});
|
|
390
391
|
var FrontendReportSchema = ReportSchema.omit({
|
|
391
392
|
sql: true,
|
|
@@ -745,11 +746,11 @@ var VisualizationMetadataSchema = z.object({
|
|
|
745
746
|
originalCount: z.number(),
|
|
746
747
|
sampledCount: z.number()
|
|
747
748
|
}).optional();
|
|
748
|
-
V1FrontendVisualizationSchema.extend({
|
|
749
|
+
var V1FrontendVisualizationWithDataSchema = V1FrontendVisualizationSchema.extend({
|
|
749
750
|
data: VisualizationDataSchema,
|
|
750
751
|
_metadata: VisualizationMetadataSchema
|
|
751
752
|
});
|
|
752
|
-
FrontendVisualizationSchema.extend({
|
|
753
|
+
var FrontendVisualizationWithDataSchema = FrontendVisualizationSchema.extend({
|
|
753
754
|
data: VisualizationDataSchema,
|
|
754
755
|
_metadata: VisualizationMetadataSchema
|
|
755
756
|
});
|
|
@@ -759,7 +760,7 @@ var FlowIdParam = z.object({ flowId: z.string().uuid() }).openapi("FlowId", { ty
|
|
|
759
760
|
var FlowDataIdParam = z.object({ flowDataId: z.string().pipe(z.coerce.number()) }).openapi("FlowDataId", { type: "integer" });
|
|
760
761
|
var ReportId = z.string().pipe(z.coerce.number());
|
|
761
762
|
var ReportIdParam = z.object({ report_id: ReportId }).openapi("ReportId", { type: "integer" });
|
|
762
|
-
createRoute({
|
|
763
|
+
var RetrieveFlowDataReports = createRoute({
|
|
763
764
|
method: "get",
|
|
764
765
|
path: "/api/v1/flows/{flowId}/data-reports",
|
|
765
766
|
operationId: "retrieveFlowDataReports",
|
|
@@ -2080,89 +2081,6 @@ var ExchangeExternalToken = createRoute({
|
|
|
2080
2081
|
}
|
|
2081
2082
|
});
|
|
2082
2083
|
|
|
2083
|
-
// ../shared/dist/src/schemas/dashboard.js
|
|
2084
|
-
var DashboardTileSchema = z.discriminatedUnion("type", [
|
|
2085
|
-
z.object({
|
|
2086
|
-
type: z.literal("data-report"),
|
|
2087
|
-
flowId: z.string(),
|
|
2088
|
-
flowDataId: z.number(),
|
|
2089
|
-
title: z.string(),
|
|
2090
|
-
col: z.number(),
|
|
2091
|
-
colSpan: z.number(),
|
|
2092
|
-
rowSpan: z.number()
|
|
2093
|
-
}),
|
|
2094
|
-
z.object({
|
|
2095
|
-
type: z.literal("visualization"),
|
|
2096
|
-
visualizationId: z.number(),
|
|
2097
|
-
title: z.string(),
|
|
2098
|
-
col: z.number(),
|
|
2099
|
-
colSpan: z.number(),
|
|
2100
|
-
rowSpan: z.number()
|
|
2101
|
-
})
|
|
2102
|
-
]);
|
|
2103
|
-
var DashboardSchema = z.object({
|
|
2104
|
-
company_id: z.number(),
|
|
2105
|
-
created_at: z.string(),
|
|
2106
|
-
description: z.string().nullable(),
|
|
2107
|
-
id: z.string().uuid(),
|
|
2108
|
-
name: z.string(),
|
|
2109
|
-
positions: z.array(DashboardTileSchema),
|
|
2110
|
-
updated_at: z.string(),
|
|
2111
|
-
is_removed: z.boolean(),
|
|
2112
|
-
is_public: z.boolean()
|
|
2113
|
-
});
|
|
2114
|
-
var DashboardIdParam = DashboardSchema.shape.id.openapi("DashboardId", {
|
|
2115
|
-
type: "string",
|
|
2116
|
-
format: "uuid"
|
|
2117
|
-
});
|
|
2118
|
-
var FrontendDashboardSchema = DashboardSchema.omit({
|
|
2119
|
-
company_id: true,
|
|
2120
|
-
created_at: true,
|
|
2121
|
-
updated_at: true,
|
|
2122
|
-
is_removed: true
|
|
2123
|
-
});
|
|
2124
|
-
|
|
2125
|
-
// ../shared/dist/src/endpoints/companion/dashboards.routes.js
|
|
2126
|
-
var RetrieveDashboard = createRoute({
|
|
2127
|
-
method: "get",
|
|
2128
|
-
path: "/api/v1/dashboard/{dashboard_id}",
|
|
2129
|
-
operationId: "retrieveDashboard",
|
|
2130
|
-
request: {
|
|
2131
|
-
headers: SupabaseHeaderSchema,
|
|
2132
|
-
params: z.object({
|
|
2133
|
-
dashboard_id: DashboardIdParam
|
|
2134
|
-
})
|
|
2135
|
-
},
|
|
2136
|
-
responses: {
|
|
2137
|
-
200: {
|
|
2138
|
-
description: "The dashboard with the given id",
|
|
2139
|
-
content: {
|
|
2140
|
-
"application/json": {
|
|
2141
|
-
schema: FrontendDashboardSchema
|
|
2142
|
-
}
|
|
2143
|
-
}
|
|
2144
|
-
},
|
|
2145
|
-
404: {
|
|
2146
|
-
content: {
|
|
2147
|
-
"application/json": {
|
|
2148
|
-
schema: z.object({ error: z.string() })
|
|
2149
|
-
}
|
|
2150
|
-
},
|
|
2151
|
-
description: "Unable to retrieve dashboard with this id"
|
|
2152
|
-
},
|
|
2153
|
-
500: {
|
|
2154
|
-
description: "Something wrong happened",
|
|
2155
|
-
content: {
|
|
2156
|
-
"application/json": {
|
|
2157
|
-
schema: z.object({
|
|
2158
|
-
error: z.string()
|
|
2159
|
-
})
|
|
2160
|
-
}
|
|
2161
|
-
}
|
|
2162
|
-
}
|
|
2163
|
-
}
|
|
2164
|
-
});
|
|
2165
|
-
|
|
2166
2084
|
// ../shared/dist/src/endpoints/end2end/run.routes.js
|
|
2167
2085
|
var End2EndApiResponseSchema = z.discriminatedUnion("status", [
|
|
2168
2086
|
z.object({
|
|
@@ -2363,6 +2281,289 @@ var hashString = (value) => {
|
|
|
2363
2281
|
const hash = sha256(data);
|
|
2364
2282
|
return Array.from(hash).map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
2365
2283
|
};
|
|
2284
|
+
|
|
2285
|
+
// ../shared/dist/src/schemas/canvas.js
|
|
2286
|
+
var CanvasSchema = z.object({
|
|
2287
|
+
company_id: z.number(),
|
|
2288
|
+
created_at: z.string(),
|
|
2289
|
+
id: z.string().uuid(),
|
|
2290
|
+
title: z.string().nullable(),
|
|
2291
|
+
updated_at: z.string(),
|
|
2292
|
+
is_removed: z.boolean(),
|
|
2293
|
+
is_public: z.boolean(),
|
|
2294
|
+
nodes: z.array(z.any()),
|
|
2295
|
+
edges: z.array(z.any())
|
|
2296
|
+
});
|
|
2297
|
+
var FrontendCanvasSchema = CanvasSchema.omit({
|
|
2298
|
+
company_id: true,
|
|
2299
|
+
created_at: true,
|
|
2300
|
+
updated_at: true,
|
|
2301
|
+
is_removed: true
|
|
2302
|
+
});
|
|
2303
|
+
var UpdateCanvasSchema = z.object({
|
|
2304
|
+
id: CanvasSchema.shape.id,
|
|
2305
|
+
title: CanvasSchema.shape.title.optional(),
|
|
2306
|
+
nodes: CanvasSchema.shape.nodes.optional(),
|
|
2307
|
+
edges: CanvasSchema.shape.edges.optional(),
|
|
2308
|
+
is_public: CanvasSchema.shape.is_public.optional()
|
|
2309
|
+
});
|
|
2310
|
+
var CreateCanvasSchema = CanvasSchema.omit({
|
|
2311
|
+
id: true,
|
|
2312
|
+
created_at: true,
|
|
2313
|
+
updated_at: true,
|
|
2314
|
+
company_id: true,
|
|
2315
|
+
is_removed: true
|
|
2316
|
+
}).extend({
|
|
2317
|
+
flow_id: z.string().optional()
|
|
2318
|
+
});
|
|
2319
|
+
var CanvasIdParam = CanvasSchema.shape.id.openapi("CanvasId", {
|
|
2320
|
+
type: "string",
|
|
2321
|
+
format: "uuid"
|
|
2322
|
+
});
|
|
2323
|
+
|
|
2324
|
+
// ../shared/dist/src/endpoints/companion/canvas.routes.js
|
|
2325
|
+
var ListCanvases = createRoute({
|
|
2326
|
+
method: "get",
|
|
2327
|
+
path: "/api/v1/canvases",
|
|
2328
|
+
operationId: "listCanvases",
|
|
2329
|
+
request: {
|
|
2330
|
+
headers: SupabaseHeaderSchema,
|
|
2331
|
+
query: z.object({
|
|
2332
|
+
search: z.string().optional()
|
|
2333
|
+
})
|
|
2334
|
+
},
|
|
2335
|
+
responses: {
|
|
2336
|
+
200: {
|
|
2337
|
+
description: "A list of canvases",
|
|
2338
|
+
content: {
|
|
2339
|
+
"application/json": {
|
|
2340
|
+
schema: z.array(FrontendCanvasSchema.extend({
|
|
2341
|
+
canvas_flows: z.object({
|
|
2342
|
+
flow_id: z.string()
|
|
2343
|
+
}).array()
|
|
2344
|
+
}))
|
|
2345
|
+
}
|
|
2346
|
+
}
|
|
2347
|
+
},
|
|
2348
|
+
500: {
|
|
2349
|
+
description: "Something wrong happened",
|
|
2350
|
+
content: {
|
|
2351
|
+
"application/json": {
|
|
2352
|
+
schema: z.object({
|
|
2353
|
+
error: z.string()
|
|
2354
|
+
})
|
|
2355
|
+
}
|
|
2356
|
+
}
|
|
2357
|
+
}
|
|
2358
|
+
}
|
|
2359
|
+
});
|
|
2360
|
+
var RetrieveCanvas = createRoute({
|
|
2361
|
+
method: "get",
|
|
2362
|
+
path: "/api/v1/canvas/{canvas_id}",
|
|
2363
|
+
operationId: "retrieveCanvas",
|
|
2364
|
+
request: {
|
|
2365
|
+
headers: SupabaseHeaderSchema,
|
|
2366
|
+
params: z.object({
|
|
2367
|
+
canvas_id: CanvasIdParam
|
|
2368
|
+
})
|
|
2369
|
+
},
|
|
2370
|
+
responses: {
|
|
2371
|
+
200: {
|
|
2372
|
+
description: "The canvas with the given id",
|
|
2373
|
+
content: {
|
|
2374
|
+
"application/json": {
|
|
2375
|
+
schema: FrontendCanvasSchema
|
|
2376
|
+
}
|
|
2377
|
+
}
|
|
2378
|
+
},
|
|
2379
|
+
404: {
|
|
2380
|
+
content: {
|
|
2381
|
+
"application/json": {
|
|
2382
|
+
schema: z.object({ error: z.string() })
|
|
2383
|
+
}
|
|
2384
|
+
},
|
|
2385
|
+
description: "Unable to retrieve canvas with this id"
|
|
2386
|
+
},
|
|
2387
|
+
500: {
|
|
2388
|
+
description: "Something wrong happened",
|
|
2389
|
+
content: {
|
|
2390
|
+
"application/json": {
|
|
2391
|
+
schema: z.object({
|
|
2392
|
+
error: z.string()
|
|
2393
|
+
})
|
|
2394
|
+
}
|
|
2395
|
+
}
|
|
2396
|
+
}
|
|
2397
|
+
}
|
|
2398
|
+
});
|
|
2399
|
+
var CreateCanvas = createRoute({
|
|
2400
|
+
method: "post",
|
|
2401
|
+
path: "/api/v1/canvas/",
|
|
2402
|
+
operationId: "createCanvas",
|
|
2403
|
+
request: {
|
|
2404
|
+
headers: SupabaseHeaderSchema,
|
|
2405
|
+
body: {
|
|
2406
|
+
required: true,
|
|
2407
|
+
content: {
|
|
2408
|
+
"application/json": {
|
|
2409
|
+
schema: CreateCanvasSchema
|
|
2410
|
+
}
|
|
2411
|
+
}
|
|
2412
|
+
}
|
|
2413
|
+
},
|
|
2414
|
+
responses: {
|
|
2415
|
+
201: {
|
|
2416
|
+
description: "The created canvas",
|
|
2417
|
+
content: {
|
|
2418
|
+
"application/json": {
|
|
2419
|
+
schema: z.object({
|
|
2420
|
+
id: z.string()
|
|
2421
|
+
})
|
|
2422
|
+
}
|
|
2423
|
+
}
|
|
2424
|
+
},
|
|
2425
|
+
400: {
|
|
2426
|
+
content: {
|
|
2427
|
+
"application/json": {
|
|
2428
|
+
schema: z.object({ error: z.string() })
|
|
2429
|
+
}
|
|
2430
|
+
},
|
|
2431
|
+
description: "Invalid request"
|
|
2432
|
+
},
|
|
2433
|
+
500: {
|
|
2434
|
+
description: "Something wrong happened",
|
|
2435
|
+
content: {
|
|
2436
|
+
"application/json": {
|
|
2437
|
+
schema: z.object({
|
|
2438
|
+
error: z.string()
|
|
2439
|
+
})
|
|
2440
|
+
}
|
|
2441
|
+
}
|
|
2442
|
+
}
|
|
2443
|
+
}
|
|
2444
|
+
});
|
|
2445
|
+
var UpdateCanvas = createRoute({
|
|
2446
|
+
method: "put",
|
|
2447
|
+
path: "/api/v1/canvas/{canvas_id}",
|
|
2448
|
+
operationId: "updateCanvas",
|
|
2449
|
+
request: {
|
|
2450
|
+
headers: SupabaseHeaderSchema,
|
|
2451
|
+
params: z.object({
|
|
2452
|
+
canvas_id: CanvasIdParam
|
|
2453
|
+
}),
|
|
2454
|
+
body: {
|
|
2455
|
+
required: true,
|
|
2456
|
+
content: {
|
|
2457
|
+
"application/json": {
|
|
2458
|
+
schema: UpdateCanvasSchema.omit({ id: true })
|
|
2459
|
+
}
|
|
2460
|
+
}
|
|
2461
|
+
}
|
|
2462
|
+
},
|
|
2463
|
+
responses: {
|
|
2464
|
+
200: {
|
|
2465
|
+
description: "The updated canvas",
|
|
2466
|
+
content: {
|
|
2467
|
+
"application/json": {
|
|
2468
|
+
schema: z.object({
|
|
2469
|
+
success: z.literal(true)
|
|
2470
|
+
})
|
|
2471
|
+
}
|
|
2472
|
+
}
|
|
2473
|
+
},
|
|
2474
|
+
404: {
|
|
2475
|
+
content: {
|
|
2476
|
+
"application/json": {
|
|
2477
|
+
schema: z.object({ error: z.string() })
|
|
2478
|
+
}
|
|
2479
|
+
},
|
|
2480
|
+
description: "Unable to retrieve canvas with this id"
|
|
2481
|
+
},
|
|
2482
|
+
500: {
|
|
2483
|
+
description: "Something wrong happened",
|
|
2484
|
+
content: {
|
|
2485
|
+
"application/json": {
|
|
2486
|
+
schema: z.object({
|
|
2487
|
+
error: z.string()
|
|
2488
|
+
})
|
|
2489
|
+
}
|
|
2490
|
+
}
|
|
2491
|
+
}
|
|
2492
|
+
}
|
|
2493
|
+
});
|
|
2494
|
+
var DeleteCanvas = createRoute({
|
|
2495
|
+
method: "delete",
|
|
2496
|
+
path: "/api/v1/canvas/{canvas_id}",
|
|
2497
|
+
operationId: "deleteCanvas",
|
|
2498
|
+
request: {
|
|
2499
|
+
headers: SupabaseHeaderSchema,
|
|
2500
|
+
params: z.object({
|
|
2501
|
+
canvas_id: CanvasIdParam
|
|
2502
|
+
})
|
|
2503
|
+
},
|
|
2504
|
+
responses: {
|
|
2505
|
+
204: {
|
|
2506
|
+
description: "Canvas deleted successfully"
|
|
2507
|
+
},
|
|
2508
|
+
404: {
|
|
2509
|
+
content: {
|
|
2510
|
+
"application/json": {
|
|
2511
|
+
schema: z.object({ error: z.string() })
|
|
2512
|
+
}
|
|
2513
|
+
},
|
|
2514
|
+
description: "Unable to delete canvas with this id"
|
|
2515
|
+
},
|
|
2516
|
+
500: {
|
|
2517
|
+
description: "Something wrong happened",
|
|
2518
|
+
content: {
|
|
2519
|
+
"application/json": {
|
|
2520
|
+
schema: z.object({
|
|
2521
|
+
error: z.string()
|
|
2522
|
+
})
|
|
2523
|
+
}
|
|
2524
|
+
}
|
|
2525
|
+
}
|
|
2526
|
+
}
|
|
2527
|
+
});
|
|
2528
|
+
var GetCanvasForFlow = createRoute({
|
|
2529
|
+
method: "get",
|
|
2530
|
+
path: "/api/v1/canvas/flow/{flow_id}",
|
|
2531
|
+
operationId: "getCanvasForFlow",
|
|
2532
|
+
request: {
|
|
2533
|
+
headers: SupabaseHeaderSchema,
|
|
2534
|
+
params: z.object({
|
|
2535
|
+
flow_id: z.string().uuid()
|
|
2536
|
+
})
|
|
2537
|
+
},
|
|
2538
|
+
responses: {
|
|
2539
|
+
200: {
|
|
2540
|
+
description: "The canvas for the given flow",
|
|
2541
|
+
content: {
|
|
2542
|
+
"application/json": {
|
|
2543
|
+
schema: FrontendCanvasSchema
|
|
2544
|
+
}
|
|
2545
|
+
}
|
|
2546
|
+
},
|
|
2547
|
+
404: {
|
|
2548
|
+
content: {
|
|
2549
|
+
"application/json": {
|
|
2550
|
+
schema: z.object({ error: z.string() })
|
|
2551
|
+
}
|
|
2552
|
+
},
|
|
2553
|
+
description: "Unable to retrieve canvas for this flow"
|
|
2554
|
+
},
|
|
2555
|
+
500: {
|
|
2556
|
+
description: "Something wrong happened",
|
|
2557
|
+
content: {
|
|
2558
|
+
"application/json": {
|
|
2559
|
+
schema: z.object({
|
|
2560
|
+
error: z.string()
|
|
2561
|
+
})
|
|
2562
|
+
}
|
|
2563
|
+
}
|
|
2564
|
+
}
|
|
2565
|
+
}
|
|
2566
|
+
});
|
|
2366
2567
|
var QuickActionSchema = z.object({
|
|
2367
2568
|
label: z.string(),
|
|
2368
2569
|
explanation: z.string()
|
|
@@ -2521,6 +2722,103 @@ createRoute({
|
|
|
2521
2722
|
}
|
|
2522
2723
|
}
|
|
2523
2724
|
});
|
|
2725
|
+
|
|
2726
|
+
// ../shared/dist/src/endpoints/visualizations.routes.js
|
|
2727
|
+
var VisualizationWithDataResponse = z.union([
|
|
2728
|
+
FrontendVisualizationWithDataSchema,
|
|
2729
|
+
V1FrontendVisualizationWithDataSchema
|
|
2730
|
+
]).openapi("VisualizationWithData");
|
|
2731
|
+
createRoute({
|
|
2732
|
+
method: "get",
|
|
2733
|
+
path: "/api/v1/visualizations/{visualization_id}",
|
|
2734
|
+
operationId: "fetchVisualization",
|
|
2735
|
+
request: {
|
|
2736
|
+
headers: SupabaseHeaderSchema,
|
|
2737
|
+
params: z.object({ visualization_id: z.string().pipe(z.coerce.number()) }).openapi("VisualizationId", { type: "number" })
|
|
2738
|
+
},
|
|
2739
|
+
responses: {
|
|
2740
|
+
200: {
|
|
2741
|
+
description: "The content of the visualization",
|
|
2742
|
+
content: {
|
|
2743
|
+
"application/json": {
|
|
2744
|
+
schema: VisualizationWithDataResponse
|
|
2745
|
+
}
|
|
2746
|
+
}
|
|
2747
|
+
},
|
|
2748
|
+
400: {
|
|
2749
|
+
content: {
|
|
2750
|
+
"application/json": {
|
|
2751
|
+
schema: z.object({ error: z.string() })
|
|
2752
|
+
}
|
|
2753
|
+
},
|
|
2754
|
+
description: "Invalid arguments to fetch visualization"
|
|
2755
|
+
},
|
|
2756
|
+
404: {
|
|
2757
|
+
content: {
|
|
2758
|
+
"application/json": {
|
|
2759
|
+
schema: z.object({ error: z.string() })
|
|
2760
|
+
}
|
|
2761
|
+
},
|
|
2762
|
+
description: "Unable to fetch visualization with this id"
|
|
2763
|
+
},
|
|
2764
|
+
500: {
|
|
2765
|
+
description: "Something wrong happened",
|
|
2766
|
+
content: {
|
|
2767
|
+
"application/json": {
|
|
2768
|
+
schema: z.object({
|
|
2769
|
+
error: z.string()
|
|
2770
|
+
})
|
|
2771
|
+
}
|
|
2772
|
+
}
|
|
2773
|
+
}
|
|
2774
|
+
}
|
|
2775
|
+
});
|
|
2776
|
+
var ListVisualizationsForFlow = createRoute({
|
|
2777
|
+
method: "get",
|
|
2778
|
+
path: "/api/v1/flows/{flowId}/visualizations",
|
|
2779
|
+
operationId: "listVisualizationsForFlow",
|
|
2780
|
+
request: {
|
|
2781
|
+
headers: SupabaseHeaderSchema,
|
|
2782
|
+
params: FlowIdParam,
|
|
2783
|
+
query: FlowDataIdParam.partial()
|
|
2784
|
+
},
|
|
2785
|
+
responses: {
|
|
2786
|
+
200: {
|
|
2787
|
+
description: "List visualizations for a given flow. Can be filtered by flow data id as well",
|
|
2788
|
+
content: {
|
|
2789
|
+
"application/json": {
|
|
2790
|
+
schema: FrontendVisualizationSchema.array()
|
|
2791
|
+
}
|
|
2792
|
+
}
|
|
2793
|
+
},
|
|
2794
|
+
400: {
|
|
2795
|
+
content: {
|
|
2796
|
+
"application/json": {
|
|
2797
|
+
schema: z.object({ error: z.string() })
|
|
2798
|
+
}
|
|
2799
|
+
},
|
|
2800
|
+
description: "Invalid arguments to fetch visualization"
|
|
2801
|
+
},
|
|
2802
|
+
404: {
|
|
2803
|
+
content: {
|
|
2804
|
+
"application/json": {
|
|
2805
|
+
schema: z.object({ error: z.string() })
|
|
2806
|
+
}
|
|
2807
|
+
},
|
|
2808
|
+
description: "Unable to list visualizations"
|
|
2809
|
+
},
|
|
2810
|
+
500: {
|
|
2811
|
+
description: "Something wrong happened",
|
|
2812
|
+
content: {
|
|
2813
|
+
"application/json": {
|
|
2814
|
+
schema: z.object({
|
|
2815
|
+
error: z.string()
|
|
2816
|
+
})
|
|
2817
|
+
}
|
|
2818
|
+
}
|
|
2819
|
+
}
|
|
2820
|
+
}
|
|
2821
|
+
});
|
|
2524
2822
|
var DataTableSchema = z.object({
|
|
2525
2823
|
id: z.number(),
|
|
2526
2824
|
dataset: z.string(),
|
|
@@ -2572,7 +2870,7 @@ var toSearchParams = ({ cursor, filters, sorting, limit }) => {
|
|
|
2572
2870
|
|
|
2573
2871
|
// package.json
|
|
2574
2872
|
var package_default = {
|
|
2575
|
-
version: "0.
|
|
2873
|
+
version: "0.3.0"};
|
|
2576
2874
|
var MageMetricsChatTransport = class extends DefaultChatTransport {
|
|
2577
2875
|
constructor(apiUrl, flowId, options) {
|
|
2578
2876
|
super({
|
|
@@ -2757,6 +3055,38 @@ var MageMetricsClient = class {
|
|
|
2757
3055
|
* Public API methods that automatically wait for authentication
|
|
2758
3056
|
*/
|
|
2759
3057
|
api = {
|
|
3058
|
+
getFlowVisualizations: async (flowId) => {
|
|
3059
|
+
await this.waitForAuth();
|
|
3060
|
+
const { data, error, response } = await this.internalApiClient.GET(
|
|
3061
|
+
ListVisualizationsForFlow.path,
|
|
3062
|
+
{ params: { path: { flowId } } }
|
|
3063
|
+
);
|
|
3064
|
+
if (error) {
|
|
3065
|
+
throw new ApiError(error.error, response, {
|
|
3066
|
+
status: response.status,
|
|
3067
|
+
statusText: response.statusText,
|
|
3068
|
+
url: response.url,
|
|
3069
|
+
method: "GET"
|
|
3070
|
+
});
|
|
3071
|
+
}
|
|
3072
|
+
return data;
|
|
3073
|
+
},
|
|
3074
|
+
getFlowDataReports: async (flowId) => {
|
|
3075
|
+
await this.waitForAuth();
|
|
3076
|
+
const { data, error, response } = await this.internalApiClient.GET(
|
|
3077
|
+
RetrieveFlowDataReports.path,
|
|
3078
|
+
{ params: { path: { flowId } } }
|
|
3079
|
+
);
|
|
3080
|
+
if (error) {
|
|
3081
|
+
throw new ApiError(error.error, response, {
|
|
3082
|
+
status: response.status,
|
|
3083
|
+
statusText: response.statusText,
|
|
3084
|
+
url: response.url,
|
|
3085
|
+
method: "GET"
|
|
3086
|
+
});
|
|
3087
|
+
}
|
|
3088
|
+
return data;
|
|
3089
|
+
},
|
|
2760
3090
|
getRecentFlows: async (params = {}) => {
|
|
2761
3091
|
await this.waitForAuth();
|
|
2762
3092
|
const { data, error, response } = await this.internalApiClient.GET(
|
|
@@ -2825,27 +3155,135 @@ var MageMetricsClient = class {
|
|
|
2825
3155
|
return { flowId: data.flowId };
|
|
2826
3156
|
}
|
|
2827
3157
|
},
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
3158
|
+
canvas: {
|
|
3159
|
+
list: async (query) => {
|
|
3160
|
+
await this.waitForAuth();
|
|
3161
|
+
const { data, error, response } = await this.internalApiClient.GET(
|
|
3162
|
+
ListCanvases.path,
|
|
3163
|
+
{
|
|
3164
|
+
params: {
|
|
3165
|
+
query: {
|
|
3166
|
+
search: query
|
|
3167
|
+
}
|
|
2836
3168
|
}
|
|
2837
3169
|
}
|
|
3170
|
+
);
|
|
3171
|
+
if (error) {
|
|
3172
|
+
throw new ApiError(error.error, response, {
|
|
3173
|
+
status: response.status,
|
|
3174
|
+
statusText: response.statusText,
|
|
3175
|
+
url: response.url,
|
|
3176
|
+
method: "GET"
|
|
3177
|
+
});
|
|
2838
3178
|
}
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
3179
|
+
return FrontendCanvasSchema.extend({
|
|
3180
|
+
canvas_flows: z.object({
|
|
3181
|
+
flow_id: z.string()
|
|
3182
|
+
}).array()
|
|
3183
|
+
}).array().parse(data);
|
|
3184
|
+
},
|
|
3185
|
+
get: async (canvasId) => {
|
|
3186
|
+
await this.waitForAuth();
|
|
3187
|
+
const { data, error, response } = await this.internalApiClient.GET(
|
|
3188
|
+
RetrieveCanvas.path,
|
|
3189
|
+
{
|
|
3190
|
+
params: {
|
|
3191
|
+
path: {
|
|
3192
|
+
canvas_id: canvasId
|
|
3193
|
+
}
|
|
3194
|
+
}
|
|
3195
|
+
}
|
|
3196
|
+
);
|
|
3197
|
+
if (error) {
|
|
3198
|
+
throw new ApiError(error.error, response, {
|
|
3199
|
+
status: response.status,
|
|
3200
|
+
statusText: response.statusText,
|
|
3201
|
+
url: response.url,
|
|
3202
|
+
method: "GET"
|
|
3203
|
+
});
|
|
3204
|
+
}
|
|
3205
|
+
return FrontendCanvasSchema.parse(data);
|
|
3206
|
+
},
|
|
3207
|
+
create: async (body) => {
|
|
3208
|
+
await this.waitForAuth();
|
|
3209
|
+
const { data, error, response } = await this.internalApiClient.POST(
|
|
3210
|
+
CreateCanvas.path,
|
|
3211
|
+
{
|
|
3212
|
+
body
|
|
3213
|
+
}
|
|
3214
|
+
);
|
|
3215
|
+
if (!data) {
|
|
3216
|
+
throw new ApiError(error.error, response, {
|
|
3217
|
+
status: response.status,
|
|
3218
|
+
statusText: response.statusText,
|
|
3219
|
+
url: response.url,
|
|
3220
|
+
method: "POST"
|
|
3221
|
+
});
|
|
3222
|
+
}
|
|
3223
|
+
return data;
|
|
3224
|
+
},
|
|
3225
|
+
update: async (body) => {
|
|
3226
|
+
await this.waitForAuth();
|
|
3227
|
+
const { data, error, response } = await this.internalApiClient.PUT(
|
|
3228
|
+
UpdateCanvas.path,
|
|
3229
|
+
{
|
|
3230
|
+
params: {
|
|
3231
|
+
path: {
|
|
3232
|
+
canvas_id: String(body.id)
|
|
3233
|
+
}
|
|
3234
|
+
},
|
|
3235
|
+
body
|
|
3236
|
+
}
|
|
3237
|
+
);
|
|
3238
|
+
if (!data) {
|
|
3239
|
+
throw new ApiError(error.error, response, {
|
|
3240
|
+
status: response.status,
|
|
3241
|
+
statusText: response.statusText,
|
|
3242
|
+
url: response.url,
|
|
3243
|
+
method: "PUT"
|
|
3244
|
+
});
|
|
3245
|
+
}
|
|
3246
|
+
return data;
|
|
3247
|
+
},
|
|
3248
|
+
delete: async (canvasId) => {
|
|
3249
|
+
await this.waitForAuth();
|
|
3250
|
+
const { error, response } = await this.internalApiClient.DELETE(
|
|
3251
|
+
DeleteCanvas.path,
|
|
3252
|
+
{
|
|
3253
|
+
params: { path: { canvas_id: canvasId } }
|
|
3254
|
+
}
|
|
3255
|
+
);
|
|
3256
|
+
if (error) {
|
|
3257
|
+
throw new ApiError(error.error, response, {
|
|
3258
|
+
status: response.status,
|
|
3259
|
+
statusText: response.statusText,
|
|
3260
|
+
url: response.url,
|
|
3261
|
+
method: "DELETE"
|
|
3262
|
+
});
|
|
3263
|
+
}
|
|
3264
|
+
},
|
|
3265
|
+
getForFlow: async (flowId) => {
|
|
3266
|
+
await this.waitForAuth();
|
|
3267
|
+
const { data, error, response } = await this.internalApiClient.GET(
|
|
3268
|
+
GetCanvasForFlow.path,
|
|
3269
|
+
{
|
|
3270
|
+
params: {
|
|
3271
|
+
path: {
|
|
3272
|
+
flow_id: flowId
|
|
3273
|
+
}
|
|
3274
|
+
}
|
|
3275
|
+
}
|
|
3276
|
+
);
|
|
3277
|
+
if (error) {
|
|
3278
|
+
throw new ApiError(error.error, response, {
|
|
3279
|
+
status: response.status,
|
|
3280
|
+
statusText: response.statusText,
|
|
3281
|
+
url: response.url,
|
|
3282
|
+
method: "GET"
|
|
3283
|
+
});
|
|
3284
|
+
}
|
|
3285
|
+
return FrontendCanvasSchema.parse(data);
|
|
2847
3286
|
}
|
|
2848
|
-
return data;
|
|
2849
3287
|
},
|
|
2850
3288
|
exportReportData: async (reportId, format = "blob") => {
|
|
2851
3289
|
await this.waitForAuth();
|