@magemetrics/core 0.7.0 → 0.8.2

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 CHANGED
@@ -488,10 +488,17 @@ declare const inputSchema_6: z.ZodObject<{
488
488
  }, z.core.$strip>;
489
489
 
490
490
  declare const inputSchema_7: z.ZodObject<{
491
- query: z.ZodString;
491
+ reportId: z.ZodNumber;
492
+ limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
493
+ offset: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
494
+ skipSampleRows: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
492
495
  }, z.core.$strip>;
493
496
 
494
497
  declare const inputSchema_8: z.ZodObject<{
498
+ query: z.ZodString;
499
+ }, z.core.$strip>;
500
+
501
+ declare const inputSchema_9: z.ZodObject<{
495
502
  questions: z.ZodArray<z.ZodObject<{
496
503
  question: z.ZodString;
497
504
  header: z.ZodString;
@@ -799,8 +806,9 @@ declare type MMUiTools = {
799
806
  valueBasedColumnSearch: UiTool_4;
800
807
  getAvailableTables: UiTool_5;
801
808
  getAvailableColumnsForTable: UiTool_6;
802
- webSearch: UiTool_7;
803
- askUserQuestion: UiTool_8;
809
+ paginateDataReport: UiTool_7;
810
+ webSearch: UiTool_8;
811
+ askUserQuestion: UiTool_9;
804
812
  };
805
813
 
806
814
  declare type NoAuthPaths = Simplify<{
@@ -1612,6 +1620,85 @@ declare interface operations {
1612
1620
  };
1613
1621
  };
1614
1622
  };
1623
+ getColumnLineage: {
1624
+ parameters: {
1625
+ query?: never;
1626
+ header: {
1627
+ "sp-access-token": string;
1628
+ };
1629
+ path?: never;
1630
+ cookie?: never;
1631
+ };
1632
+ requestBody: {
1633
+ content: {
1634
+ "application/json": {
1635
+ /** @description The report id */
1636
+ report_id: number;
1637
+ /** @description The column name to get lineage for */
1638
+ column_name: string;
1639
+ };
1640
+ };
1641
+ };
1642
+ responses: {
1643
+ /** @description Column lineage data */
1644
+ 200: {
1645
+ headers: {
1646
+ [name: string]: unknown;
1647
+ };
1648
+ content: {
1649
+ "application/json": {
1650
+ column_name: string;
1651
+ lineage: {
1652
+ nodes: {
1653
+ id: string;
1654
+ /** @enum {string} */
1655
+ type: "entity" | "attribute" | "filter" | "process" | "combine" | "result";
1656
+ explanation: string;
1657
+ }[];
1658
+ edges: {
1659
+ source: string;
1660
+ target: string;
1661
+ }[];
1662
+ };
1663
+ was_cached: boolean;
1664
+ };
1665
+ };
1666
+ };
1667
+ /** @description Invalid request - column not found in query results */
1668
+ 400: {
1669
+ headers: {
1670
+ [name: string]: unknown;
1671
+ };
1672
+ content: {
1673
+ "application/json": {
1674
+ error: string;
1675
+ };
1676
+ };
1677
+ };
1678
+ /** @description report not found */
1679
+ 404: {
1680
+ headers: {
1681
+ [name: string]: unknown;
1682
+ };
1683
+ content: {
1684
+ "application/json": {
1685
+ error: string;
1686
+ };
1687
+ };
1688
+ };
1689
+ /** @description Generation failed */
1690
+ 500: {
1691
+ headers: {
1692
+ [name: string]: unknown;
1693
+ };
1694
+ content: {
1695
+ "application/json": {
1696
+ error: string;
1697
+ };
1698
+ };
1699
+ };
1700
+ };
1701
+ };
1615
1702
  toggleBookmark: {
1616
1703
  parameters: {
1617
1704
  query?: never;
@@ -3096,6 +3183,79 @@ declare interface operations {
3096
3183
  };
3097
3184
  };
3098
3185
  };
3186
+ tablePreview: {
3187
+ parameters: {
3188
+ query?: never;
3189
+ header?: never;
3190
+ path: {
3191
+ tableId: string;
3192
+ };
3193
+ cookie?: never;
3194
+ };
3195
+ requestBody?: never;
3196
+ responses: {
3197
+ /** @description Table preview executed successfully */
3198
+ 200: {
3199
+ headers: {
3200
+ [name: string]: unknown;
3201
+ };
3202
+ content: {
3203
+ "application/json": {
3204
+ columns: {
3205
+ id: string;
3206
+ accessorKey: string;
3207
+ header: string;
3208
+ cell?: unknown;
3209
+ meta?: {
3210
+ [key: string]: unknown;
3211
+ };
3212
+ }[];
3213
+ data: {
3214
+ [key: string]: unknown;
3215
+ }[];
3216
+ metadata?: {
3217
+ wasSampled: boolean;
3218
+ originalCount: number;
3219
+ sampledCount: number;
3220
+ };
3221
+ };
3222
+ };
3223
+ };
3224
+ /** @description Invalid request */
3225
+ 400: {
3226
+ headers: {
3227
+ [name: string]: unknown;
3228
+ };
3229
+ content: {
3230
+ "application/json": {
3231
+ error: string;
3232
+ };
3233
+ };
3234
+ };
3235
+ /** @description Table not found */
3236
+ 404: {
3237
+ headers: {
3238
+ [name: string]: unknown;
3239
+ };
3240
+ content: {
3241
+ "application/json": {
3242
+ error: string;
3243
+ };
3244
+ };
3245
+ };
3246
+ /** @description Internal server error */
3247
+ 500: {
3248
+ headers: {
3249
+ [name: string]: unknown;
3250
+ };
3251
+ content: {
3252
+ "application/json": {
3253
+ error: string;
3254
+ };
3255
+ };
3256
+ };
3257
+ };
3258
+ };
3099
3259
  listSankeyUserFilters: {
3100
3260
  parameters: {
3101
3261
  query?: never;
@@ -3915,6 +4075,22 @@ declare interface paths {
3915
4075
  patch?: never;
3916
4076
  trace?: never;
3917
4077
  };
4078
+ "/api/v1/workflows/column_lineage": {
4079
+ parameters: {
4080
+ query?: never;
4081
+ header?: never;
4082
+ path?: never;
4083
+ cookie?: never;
4084
+ };
4085
+ get?: never;
4086
+ put?: never;
4087
+ post: operations["getColumnLineage"];
4088
+ delete?: never;
4089
+ options?: never;
4090
+ head?: never;
4091
+ patch?: never;
4092
+ trace?: never;
4093
+ };
3918
4094
  "/api/v1/timeline/bookmark": {
3919
4095
  parameters: {
3920
4096
  query?: never;
@@ -4315,6 +4491,22 @@ declare interface paths {
4315
4491
  patch?: never;
4316
4492
  trace?: never;
4317
4493
  };
4494
+ "/api/v1/admin-console/tables/{tableId}/preview": {
4495
+ parameters: {
4496
+ query?: never;
4497
+ header?: never;
4498
+ path?: never;
4499
+ cookie?: never;
4500
+ };
4501
+ get: operations["tablePreview"];
4502
+ put?: never;
4503
+ post?: never;
4504
+ delete?: never;
4505
+ options?: never;
4506
+ head?: never;
4507
+ patch?: never;
4508
+ trace?: never;
4509
+ };
4318
4510
  "/api/v1/admin-console/usage-insights/filters": {
4319
4511
  parameters: {
4320
4512
  query?: never;
@@ -4544,6 +4736,22 @@ declare const redactedOutputSchema_5: z.ZodObject<{
4544
4736
  }, z.core.$strip>;
4545
4737
 
4546
4738
  declare const redactedOutputSchema_6: z.ZodObject<{
4739
+ tool: z.ZodLiteral<"paginateDataReport">;
4740
+ result: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
4741
+ status: z.ZodLiteral<"success">;
4742
+ public: z.ZodObject<{
4743
+ totalRows: z.ZodNumber;
4744
+ fetchedRows: z.ZodNumber;
4745
+ offset: z.ZodNumber;
4746
+ hasMore: z.ZodBoolean;
4747
+ }, z.core.$strip>;
4748
+ }, z.core.$strip>, z.ZodObject<{
4749
+ status: z.ZodLiteral<"error">;
4750
+ message: z.ZodString;
4751
+ }, z.core.$strip>], "status">>;
4752
+ }, z.core.$strip>;
4753
+
4754
+ declare const redactedOutputSchema_7: z.ZodObject<{
4547
4755
  tool: z.ZodLiteral<"search">;
4548
4756
  result: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
4549
4757
  status: z.ZodLiteral<"success">;
@@ -4636,7 +4844,9 @@ declare type UiTool_6 = InferUITool<Tool<z.infer<typeof inputSchema_6>, z.infer<
4636
4844
 
4637
4845
  declare type UiTool_7 = InferUITool<Tool<z.infer<typeof inputSchema_7>, z.infer<typeof redactedOutputSchema_6>>>;
4638
4846
 
4639
- declare type UiTool_8 = InferUITool<Tool<z.infer<typeof inputSchema_8>, z.infer<typeof RedactedAskUserQuestionResponse>>>;
4847
+ declare type UiTool_8 = InferUITool<Tool<z.infer<typeof inputSchema_8>, z.infer<typeof redactedOutputSchema_7>>>;
4848
+
4849
+ declare type UiTool_9 = InferUITool<Tool<z.infer<typeof inputSchema_9>, z.infer<typeof RedactedAskUserQuestionResponse>>>;
4640
4850
 
4641
4851
  declare const UpdateCanvasSchema: z.ZodObject<{
4642
4852
  id: z.ZodUUID;
package/dist/index.js CHANGED
@@ -57,7 +57,7 @@ var addApiKeyHeader = (apiKey) => {
57
57
 
58
58
  // package.json
59
59
  var package_default = {
60
- version: "0.7.0"};
60
+ version: "0.8.2"};
61
61
 
62
62
  // src/core/MageMetricsEventEmitter.ts
63
63
  var MageMetricsEventEmitter = class {
@@ -468,6 +468,8 @@ function getOpenApiConfiguration(refOrOpenapi, metadataOrOptions, options) {
468
468
  options: metadataOrOptions
469
469
  };
470
470
  }
471
+
472
+ // ../../node_modules/.pnpm/hono@4.11.1/node_modules/hono/dist/router/reg-exp-router/node.js
471
473
  new Set(".\\+*[^]$()");
472
474
  var createRoute = (routeConfig) => {
473
475
  const route = {
@@ -1594,6 +1596,85 @@ createRoute({
1594
1596
  }
1595
1597
  }
1596
1598
  });
1599
+ var ColumnLineageNodeSchema = z.object({
1600
+ id: z.string(),
1601
+ type: z.enum([
1602
+ "entity",
1603
+ "attribute",
1604
+ "filter",
1605
+ "process",
1606
+ "combine",
1607
+ "result"
1608
+ ]),
1609
+ explanation: z.string()
1610
+ });
1611
+ var ColumnLineageEdgeSchema = z.object({
1612
+ source: z.string(),
1613
+ target: z.string()
1614
+ });
1615
+ var ColumnLineageResponseSchema = z.object({
1616
+ column_name: z.string(),
1617
+ lineage: z.object({
1618
+ nodes: z.array(ColumnLineageNodeSchema),
1619
+ edges: z.array(ColumnLineageEdgeSchema)
1620
+ }),
1621
+ was_cached: z.boolean()
1622
+ });
1623
+ createRoute({
1624
+ method: "post",
1625
+ path: "/api/v1/workflows/column_lineage",
1626
+ operationId: "getColumnLineage",
1627
+ request: {
1628
+ headers: SupabaseHeaderSchema,
1629
+ body: {
1630
+ required: true,
1631
+ content: {
1632
+ "application/json": {
1633
+ schema: z.object({
1634
+ report_id: z.number().int().describe("The report id"),
1635
+ column_name: z.string().describe("The column name to get lineage for")
1636
+ })
1637
+ }
1638
+ }
1639
+ }
1640
+ },
1641
+ responses: {
1642
+ 200: {
1643
+ description: "Column lineage data",
1644
+ content: {
1645
+ "application/json": {
1646
+ schema: ColumnLineageResponseSchema
1647
+ }
1648
+ }
1649
+ },
1650
+ 400: {
1651
+ description: "Invalid request - column not found in query results",
1652
+ content: {
1653
+ "application/json": {
1654
+ schema: z.object({ error: z.string() })
1655
+ }
1656
+ }
1657
+ },
1658
+ 404: {
1659
+ description: "report not found",
1660
+ content: {
1661
+ "application/json": {
1662
+ schema: z.object({ error: z.string() })
1663
+ }
1664
+ }
1665
+ },
1666
+ 500: {
1667
+ description: "Generation failed",
1668
+ content: {
1669
+ "application/json": {
1670
+ schema: z.object({
1671
+ error: z.string()
1672
+ })
1673
+ }
1674
+ }
1675
+ }
1676
+ }
1677
+ });
1597
1678
  createRoute({
1598
1679
  method: "get",
1599
1680
  path: "/api/v1/data-reports/{report_id}",