@magemetrics/core 0.12.0-rc1 → 0.12.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 CHANGED
@@ -152,7 +152,13 @@ declare interface components {
152
152
  [key: string]: unknown;
153
153
  }[];
154
154
  VisualizationWithData: {
155
+ /**
156
+ * @deprecated
157
+ * @description Deprecated: use uuid.
158
+ */
155
159
  id: number;
160
+ uuid: string;
161
+ report_uuid: string;
156
162
  flow_data_id: number;
157
163
  created_at: string;
158
164
  flow_data?: {
@@ -219,7 +225,13 @@ declare interface components {
219
225
  sampledCount: number;
220
226
  };
221
227
  } | {
228
+ /**
229
+ * @deprecated
230
+ * @description Deprecated: use uuid.
231
+ */
222
232
  id: number;
233
+ uuid: string;
234
+ report_uuid: string;
223
235
  flow_data_id: number;
224
236
  created_at: string;
225
237
  flow_data?: {
@@ -297,7 +309,7 @@ declare interface components {
297
309
  /** Format: uuid */
298
310
  flow_id: string | null;
299
311
  /** @enum {string} */
300
- status: "pending" | "running" | "completed" | "failed" | "cancelled";
312
+ status: "pending" | "running" | "post_processing" | "completed" | "failed" | "cancelled";
301
313
  created_at: string;
302
314
  started_at: string | null;
303
315
  completed_at: string | null;
@@ -419,6 +431,11 @@ declare interface components {
419
431
  model: "gemini-3.1-pro-preview";
420
432
  /** @enum {string} */
421
433
  thinking?: "low" | "high";
434
+ } | {
435
+ /** @enum {string} */
436
+ model: "gemini-2.5-pro";
437
+ /** @enum {string} */
438
+ thinking?: "low" | "high";
422
439
  } | {
423
440
  /** @enum {string} */
424
441
  model: "claude-sonnet-4-6" | "claude-opus-4-6";
@@ -426,7 +443,7 @@ declare interface components {
426
443
  effort?: "low" | "medium" | "high";
427
444
  } | {
428
445
  /** @enum {string} */
429
- model: "claude-haiku-4-5";
446
+ model: "claude-haiku-4-5" | "claude-opus-4-5";
430
447
  } | null;
431
448
  /** @enum {string} */
432
449
  execution_platform: "native" | "sandbox" | "sandbox_public";
@@ -735,6 +752,8 @@ export declare class MageMetricsClient {
735
752
  api: {
736
753
  getFlowVisualizations: (flowId: string) => Promise<{
737
754
  id: number;
755
+ uuid: string;
756
+ report_uuid: string;
738
757
  flow_data_id: number;
739
758
  created_at: string;
740
759
  flow_data?: {
@@ -788,6 +807,7 @@ export declare class MageMetricsClient {
788
807
  created_at: string;
789
808
  flow_id: string;
790
809
  id: number;
810
+ uuid: string;
791
811
  title: string;
792
812
  request: string | null;
793
813
  data_summary: {
@@ -1094,6 +1114,7 @@ declare interface operations {
1094
1114
  query?: never;
1095
1115
  header?: never;
1096
1116
  path: {
1117
+ /** @description Numeric legacy ID or UUID */
1097
1118
  report_id: string;
1098
1119
  canvas_id: components["schemas"]["CanvasId"];
1099
1120
  };
@@ -1146,6 +1167,7 @@ declare interface operations {
1146
1167
  };
1147
1168
  header?: never;
1148
1169
  path: {
1170
+ /** @description Numeric legacy ID or UUID */
1149
1171
  report_id: string;
1150
1172
  canvas_id: components["schemas"]["CanvasId"];
1151
1173
  };
@@ -1191,6 +1213,7 @@ declare interface operations {
1191
1213
  query?: never;
1192
1214
  header?: never;
1193
1215
  path: {
1216
+ /** @description Numeric legacy ID or UUID */
1194
1217
  report_id: string;
1195
1218
  canvas_id: components["schemas"]["CanvasId"];
1196
1219
  };
@@ -1464,7 +1487,12 @@ declare interface operations {
1464
1487
  "application/json": {
1465
1488
  created_at: string;
1466
1489
  flow_id: string;
1490
+ /**
1491
+ * @deprecated
1492
+ * @description Deprecated: use uuid.
1493
+ */
1467
1494
  id: number;
1495
+ uuid: string;
1468
1496
  title: string;
1469
1497
  request: string | null;
1470
1498
  data_summary: {
@@ -1533,6 +1561,7 @@ declare interface operations {
1533
1561
  "sp-access-token"?: string;
1534
1562
  };
1535
1563
  path: {
1564
+ /** @description Numeric legacy ID or UUID */
1536
1565
  report_id: string;
1537
1566
  };
1538
1567
  cookie?: never;
@@ -1547,6 +1576,8 @@ declare interface operations {
1547
1576
  content: {
1548
1577
  "application/json": {
1549
1578
  created_at: string;
1579
+ /** Format: uuid */
1580
+ report_id: string;
1550
1581
  flow_data_id: number;
1551
1582
  /** @enum {string} */
1552
1583
  helpfulness: "helpful" | "partially helpful" | "not helpful" | "incorrect";
@@ -1585,6 +1616,7 @@ declare interface operations {
1585
1616
  "sp-access-token"?: string;
1586
1617
  };
1587
1618
  path: {
1619
+ /** @description Numeric legacy ID or UUID */
1588
1620
  report_id: string;
1589
1621
  };
1590
1622
  cookie?: never;
@@ -1626,6 +1658,7 @@ declare interface operations {
1626
1658
  "sp-access-token"?: string;
1627
1659
  };
1628
1660
  path: {
1661
+ /** @description Numeric legacy ID or UUID */
1629
1662
  report_id: string;
1630
1663
  };
1631
1664
  cookie?: never;
@@ -1670,6 +1703,7 @@ declare interface operations {
1670
1703
  "sp-access-token"?: string;
1671
1704
  };
1672
1705
  path: {
1706
+ /** @description Numeric legacy ID or UUID */
1673
1707
  report_id: string;
1674
1708
  };
1675
1709
  cookie?: never;
@@ -1719,6 +1753,12 @@ declare interface operations {
1719
1753
  confidence_score_reason?: string;
1720
1754
  assumptions_score?: number;
1721
1755
  assumptions_score_reason?: string;
1756
+ /** Format: uuid */
1757
+ report_id: string;
1758
+ /**
1759
+ * @deprecated
1760
+ * @description Deprecated: use report_id.
1761
+ */
1722
1762
  flow_data_id: number;
1723
1763
  friendliness_score?: number;
1724
1764
  friendliness_score_reason?: string;
@@ -1883,6 +1923,7 @@ declare interface operations {
1883
1923
  "sp-access-token"?: string;
1884
1924
  };
1885
1925
  path: {
1926
+ /** @description Numeric legacy ID or UUID */
1886
1927
  report_id: string;
1887
1928
  };
1888
1929
  cookie?: never;
@@ -1929,6 +1970,7 @@ declare interface operations {
1929
1970
  "sp-access-token"?: string;
1930
1971
  };
1931
1972
  path: {
1973
+ /** @description Numeric legacy ID or UUID */
1932
1974
  report_id: string;
1933
1975
  };
1934
1976
  cookie?: never;
@@ -1984,6 +2026,7 @@ declare interface operations {
1984
2026
  "sp-access-token"?: string;
1985
2027
  };
1986
2028
  path: {
2029
+ /** @description Numeric legacy ID or UUID */
1987
2030
  report_id: string;
1988
2031
  };
1989
2032
  cookie?: never;
@@ -2030,6 +2073,7 @@ declare interface operations {
2030
2073
  "sp-access-token"?: string;
2031
2074
  };
2032
2075
  path: {
2076
+ /** @description Numeric legacy ID or UUID */
2033
2077
  report_id: string;
2034
2078
  };
2035
2079
  cookie?: never;
@@ -2079,6 +2123,7 @@ declare interface operations {
2079
2123
  "sp-access-token"?: string;
2080
2124
  };
2081
2125
  path: {
2126
+ /** @description Numeric legacy ID or UUID */
2082
2127
  report_id: string;
2083
2128
  };
2084
2129
  cookie?: never;
@@ -2094,7 +2139,12 @@ declare interface operations {
2094
2139
  "application/json": {
2095
2140
  created_at: string;
2096
2141
  flow_id: string;
2142
+ /**
2143
+ * @deprecated
2144
+ * @description Deprecated: use uuid.
2145
+ */
2097
2146
  id: number;
2147
+ uuid: string;
2098
2148
  title: string;
2099
2149
  request: string | null;
2100
2150
  data_summary: {
@@ -2231,8 +2281,8 @@ declare interface operations {
2231
2281
  requestBody: {
2232
2282
  content: {
2233
2283
  "application/json": {
2234
- /** @description List of flow_data IDs to refresh */
2235
- flow_data_ids: number[];
2284
+ /** @description List of report IDs to refresh */
2285
+ flow_data_ids: (string | number)[];
2236
2286
  };
2237
2287
  };
2238
2288
  };
@@ -2277,7 +2327,7 @@ declare interface operations {
2277
2327
  getMaterializationStatus: {
2278
2328
  parameters: {
2279
2329
  query: {
2280
- /** @description Comma-separated list of flow_data IDs */
2330
+ /** @description Comma-separated list of reports IDs */
2281
2331
  ids: string;
2282
2332
  };
2283
2333
  header?: {
@@ -2559,7 +2609,13 @@ declare interface operations {
2559
2609
  };
2560
2610
  content: {
2561
2611
  "application/json": {
2612
+ /**
2613
+ * @deprecated
2614
+ * @description Deprecated: use uuid.
2615
+ */
2562
2616
  id: number;
2617
+ uuid: string;
2618
+ report_uuid: string;
2563
2619
  flow_data_id: number;
2564
2620
  created_at: string;
2565
2621
  flow_data?: {
@@ -3047,7 +3103,7 @@ declare interface operations {
3047
3103
  listAgentRuns: {
3048
3104
  parameters: {
3049
3105
  query?: {
3050
- status?: "pending" | "running" | "completed" | "failed" | "cancelled";
3106
+ status?: "pending" | "running" | "post_processing" | "completed" | "failed" | "cancelled";
3051
3107
  agent_id?: string;
3052
3108
  limit?: number;
3053
3109
  };
@@ -3278,6 +3334,11 @@ declare interface operations {
3278
3334
  model: "gemini-3.1-pro-preview";
3279
3335
  /** @enum {string} */
3280
3336
  thinking?: "low" | "high";
3337
+ } | {
3338
+ /** @enum {string} */
3339
+ model: "gemini-2.5-pro";
3340
+ /** @enum {string} */
3341
+ thinking?: "low" | "high";
3281
3342
  } | {
3282
3343
  /** @enum {string} */
3283
3344
  model: "claude-sonnet-4-6" | "claude-opus-4-6";
@@ -3285,7 +3346,7 @@ declare interface operations {
3285
3346
  effort?: "low" | "medium" | "high";
3286
3347
  } | {
3287
3348
  /** @enum {string} */
3288
- model: "claude-haiku-4-5";
3349
+ model: "claude-haiku-4-5" | "claude-opus-4-5";
3289
3350
  };
3290
3351
  /**
3291
3352
  * @default native
@@ -3437,6 +3498,11 @@ declare interface operations {
3437
3498
  model: "gemini-3.1-pro-preview";
3438
3499
  /** @enum {string} */
3439
3500
  thinking?: "low" | "high";
3501
+ } | {
3502
+ /** @enum {string} */
3503
+ model: "gemini-2.5-pro";
3504
+ /** @enum {string} */
3505
+ thinking?: "low" | "high";
3440
3506
  } | {
3441
3507
  /** @enum {string} */
3442
3508
  model: "claude-sonnet-4-6" | "claude-opus-4-6";
@@ -3444,7 +3510,7 @@ declare interface operations {
3444
3510
  effort?: "low" | "medium" | "high";
3445
3511
  } | {
3446
3512
  /** @enum {string} */
3447
- model: "claude-haiku-4-5";
3513
+ model: "claude-haiku-4-5" | "claude-opus-4-5";
3448
3514
  } | null;
3449
3515
  /** @enum {string} */
3450
3516
  execution_platform?: "native" | "sandbox" | "sandbox_public";
package/dist/index.js CHANGED
@@ -58,7 +58,7 @@ var addApiKeyHeader = (apiKey) => {
58
58
 
59
59
  // package.json
60
60
  var package_default = {
61
- version: "0.12.0-rc1"};
61
+ version: "0.12.0"};
62
62
 
63
63
  // src/core/MageMetricsEventEmitter.ts
64
64
  var MageMetricsEventEmitter = class {
@@ -482,7 +482,7 @@ function getOpenApiConfiguration(refOrOpenapi, metadataOrOptions, options) {
482
482
  };
483
483
  }
484
484
 
485
- // ../../node_modules/.pnpm/hono@4.12.8/node_modules/hono/dist/router/reg-exp-router/node.js
485
+ // ../../node_modules/.pnpm/hono@4.12.10/node_modules/hono/dist/router/reg-exp-router/node.js
486
486
  new Set(".\\+*[^]$()");
487
487
  var createRoute = (routeConfig) => {
488
488
  const route = {
@@ -856,6 +856,7 @@ var FEEDBACK_OPTIONS = [
856
856
  ];
857
857
  var FeedbackSchema = z.object({
858
858
  created_at: z.string(),
859
+ report_id: z.uuid(),
859
860
  flow_data_id: z.number(),
860
861
  helpfulness: z.enum(FEEDBACK_OPTIONS.map((option) => option.value)),
861
862
  id: z.number()
@@ -968,7 +969,11 @@ var MaterializationFieldsSchema = z.object({
968
969
  var ReportSchema = z.object({
969
970
  created_at: z.string(),
970
971
  flow_id: z.string(),
971
- id: z.number(),
972
+ id: z.number().openapi({
973
+ description: "Deprecated: use uuid.",
974
+ deprecated: true
975
+ }),
976
+ uuid: z.string(),
972
977
  is_sample: z.boolean(),
973
978
  schema: z.string(),
974
979
  sql: z.string(),
@@ -1029,7 +1034,11 @@ var ReportExplainabilitySchema = z.object({
1029
1034
  assumptions_score: z.number().nullish(),
1030
1035
  assumptions_score_reason: z.string().nullish(),
1031
1036
  id: z.number(),
1032
- flow_data_id: z.number(),
1037
+ report_id: z.uuid(),
1038
+ flow_data_id: z.number().openapi({
1039
+ description: "Deprecated: use report_id.",
1040
+ deprecated: true
1041
+ }),
1033
1042
  created_at: z.string()
1034
1043
  });
1035
1044
  var FrontendReportExplainabilitySchema = ReportExplainabilitySchema.omit({
@@ -1216,7 +1225,18 @@ var DeleteUploadedFilePath = "/api/v1/uploaded-files/{uploadedFileId}";
1216
1225
  // ../shared/dist/src/endpoints/companion/flows.routes.js
1217
1226
  var FlowIdParam = z.object({ flowId: z.uuid() }).openapi("FlowId", { type: "string" });
1218
1227
  var FlowDataIdParam = z.object({ flowDataId: z.string().pipe(z.coerce.number()) }).openapi("FlowDataId", { type: "integer" });
1219
- var ReportId = z.string().pipe(z.coerce.number());
1228
+ var parseReportId = (val, ctx) => {
1229
+ const num = Number(val);
1230
+ if (Number.isInteger(num) && num > 0)
1231
+ return num;
1232
+ const uuidResult = z.uuid().safeParse(val);
1233
+ if (uuidResult.success)
1234
+ return val;
1235
+ ctx.addIssue("report_id must be a positive integer or a valid UUID");
1236
+ return z.NEVER;
1237
+ };
1238
+ var ReportId = z.string().transform((val, ctx) => parseReportId(val, ctx)).openapi({ type: "string", description: "Numeric legacy ID or UUID" });
1239
+ var ReportIdFromBody = z.union([z.string(), z.number()]).transform((val, ctx) => parseReportId(String(val), ctx));
1220
1240
  var ReportIdParam = z.object({ report_id: ReportId }).openapi("ReportId", { type: "integer" });
1221
1241
  var CreateFlowFileSchema = z.object({
1222
1242
  type: z.literal("file"),
@@ -1807,7 +1827,7 @@ createRoute({
1807
1827
  content: {
1808
1828
  "application/json": {
1809
1829
  schema: z.object({
1810
- flow_data_ids: z.array(z.number().int()).min(1).describe("List of flow_data IDs to refresh")
1830
+ flow_data_ids: z.array(ReportIdFromBody).min(1).describe("List of report IDs to refresh")
1811
1831
  })
1812
1832
  }
1813
1833
  }
@@ -1856,7 +1876,7 @@ createRoute({
1856
1876
  request: {
1857
1877
  headers: SupabaseHeaderSchema,
1858
1878
  query: z.object({
1859
- ids: z.string().transform((s) => s.split(",").map(Number)).describe("Comma-separated list of flow_data IDs")
1879
+ ids: z.string().transform((s) => s.split(",")).pipe(z.array(ReportId)).describe("Comma-separated list of reports IDs")
1860
1880
  })
1861
1881
  },
1862
1882
  responses: {
@@ -2861,7 +2881,12 @@ var VisualizationConfigurationSchema = z.discriminatedUnion("type", [
2861
2881
  })
2862
2882
  ]);
2863
2883
  var BaseVisualizationSchema = z.object({
2864
- id: z.number(),
2884
+ id: z.number().openapi({
2885
+ description: "Deprecated: use uuid.",
2886
+ deprecated: true
2887
+ }),
2888
+ uuid: z.string(),
2889
+ report_uuid: z.string(),
2865
2890
  flow_data_id: z.number(),
2866
2891
  created_at: z.string(),
2867
2892
  sql: z.string(),
@@ -3633,5 +3658,3 @@ var MageMetricsClient = class {
3633
3658
  };
3634
3659
 
3635
3660
  export { BrowserStorageAdapter, CHECK_KEY, DirectAuthProvider, ExternalAuthProvider, MageMetricsClient, MageMetricsEventEmitter, MemoryStorageAdapter, TOKEN_STORAGE_KEY, getPublicApiClient };
3636
- //# sourceMappingURL=index.js.map
3637
- //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@magemetrics/core",
3
3
  "type": "module",
4
- "version": "0.12.0-rc1",
4
+ "version": "0.12.0",
5
5
  "description": "MageMetrics client library",
6
6
  "main": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",
@@ -36,7 +36,7 @@
36
36
  "@noble/hashes": "^2.0.1",
37
37
  "@supabase/auth-js": "^2.97.0",
38
38
  "@xyflow/system": "^0.0.75",
39
- "ai": "6.0.137",
39
+ "ai": "6.0.145",
40
40
  "dayjs": "^1.11.20",
41
41
  "openapi-fetch": "^0.17.0",
42
42
  "type-fest": "^5.5.0",