@apilift/cli 1.5.14 → 1.5.15

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.
@@ -164309,11 +164309,15 @@ var eventProperties = {
164309
164309
  extension_failure: ["code"],
164310
164310
  extension_interaction: ["stage", "outcome"],
164311
164311
  credential_setup_finished: ["stage", "outcome", "code"],
164312
- "$exception": ["route", "method", "exception_type", "exception_frames", "exception_handled", "exception_level"]
164312
+ "$exception": ["route", "method", "exception_type", "exception_frames", "exception_handled", "exception_level", "exception_code"]
164313
164313
  };
164314
164314
  var safeString = /^[a-zA-Z0-9_./:{} -]{1,160}$/;
164315
164315
  var uuid = /\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi;
164316
164316
  var longId = /\b[a-zA-Z0-9_-]{24,}\b/g;
164317
+ var sqlStates = new Set("08000 08001 08003 08004 08006 08007 08P01 22001 22003 22007 22008 22012 22018 22021 22023 22P02 23000 23502 23503 23505 23514 23P01 25006 25P02 28000 28P01 3D000 3F000 40001 40P01 42501 42601 42702 42703 42704 42804 42883 42P01 42P10 53300 53400 54000 54001 55000 55P03 57014 57P01 57P02 57P03 58000 58030 XX000 XX001 XX002".split(" "));
164318
+ function safeSqlState(value) {
164319
+ return typeof value === "string" && sqlStates.has(value) ? value : void 0;
164320
+ }
164317
164321
  function normalizeRoute(route) {
164318
164322
  try {
164319
164323
  const parsed = new URL(route, "https://apilift.dev");
@@ -164328,6 +164332,12 @@ function scrubEventProperties(event, input2) {
164328
164332
  for (const [key, value] of Object.entries(input2)) {
164329
164333
  if (!allowed.includes(key))
164330
164334
  continue;
164335
+ if (key === "exception_code") {
164336
+ const code = safeSqlState(value);
164337
+ if (code)
164338
+ result[key] = code;
164339
+ continue;
164340
+ }
164331
164341
  const normalized = key === "route" && typeof value === "string" ? normalizeRoute(value) : value;
164332
164342
  if (typeof normalized === "boolean" || typeof normalized === "number" && Number.isFinite(normalized) || typeof normalized === "string" && safeString.test(normalized))
164333
164343
  result[key] = normalized;
@@ -31349,11 +31349,15 @@ var eventProperties = {
31349
31349
  extension_failure: ["code"],
31350
31350
  extension_interaction: ["stage", "outcome"],
31351
31351
  credential_setup_finished: ["stage", "outcome", "code"],
31352
- "$exception": ["route", "method", "exception_type", "exception_frames", "exception_handled", "exception_level"]
31352
+ "$exception": ["route", "method", "exception_type", "exception_frames", "exception_handled", "exception_level", "exception_code"]
31353
31353
  };
31354
31354
  var safeString = /^[a-zA-Z0-9_./:{} -]{1,160}$/;
31355
31355
  var uuid5 = /\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi;
31356
31356
  var longId = /\b[a-zA-Z0-9_-]{24,}\b/g;
31357
+ var sqlStates = new Set("08000 08001 08003 08004 08006 08007 08P01 22001 22003 22007 22008 22012 22018 22021 22023 22P02 23000 23502 23503 23505 23514 23P01 25006 25P02 28000 28P01 3D000 3F000 40001 40P01 42501 42601 42702 42703 42704 42804 42883 42P01 42P10 53300 53400 54000 54001 55000 55P03 57014 57P01 57P02 57P03 58000 58030 XX000 XX001 XX002".split(" "));
31358
+ function safeSqlState(value) {
31359
+ return typeof value === "string" && sqlStates.has(value) ? value : void 0;
31360
+ }
31357
31361
  function normalizeRoute(route) {
31358
31362
  try {
31359
31363
  const parsed = new URL(route, "https://apilift.dev");
@@ -31368,6 +31372,12 @@ function scrubEventProperties(event, input2) {
31368
31372
  for (const [key, value] of Object.entries(input2)) {
31369
31373
  if (!allowed.includes(key))
31370
31374
  continue;
31375
+ if (key === "exception_code") {
31376
+ const code = safeSqlState(value);
31377
+ if (code)
31378
+ result[key] = code;
31379
+ continue;
31380
+ }
31371
31381
  const normalized = key === "route" && typeof value === "string" ? normalizeRoute(value) : value;
31372
31382
  if (typeof normalized === "boolean" || typeof normalized === "number" && Number.isFinite(normalized) || typeof normalized === "string" && safeString.test(normalized))
31373
31383
  result[key] = normalized;
package/dist/apilift.js CHANGED
@@ -43478,6 +43478,9 @@ var init_plugin = __esm({
43478
43478
  });
43479
43479
 
43480
43480
  // ../../packages/core/dist/analytics/index.js
43481
+ function safeSqlState(value) {
43482
+ return typeof value === "string" && sqlStates.has(value) ? value : void 0;
43483
+ }
43481
43484
  function normalizeRoute(route) {
43482
43485
  try {
43483
43486
  const parsed = new URL(route, "https://apilift.dev");
@@ -43492,13 +43495,19 @@ function scrubEventProperties(event, input2) {
43492
43495
  for (const [key, value] of Object.entries(input2)) {
43493
43496
  if (!allowed.includes(key))
43494
43497
  continue;
43498
+ if (key === "exception_code") {
43499
+ const code = safeSqlState(value);
43500
+ if (code)
43501
+ result3[key] = code;
43502
+ continue;
43503
+ }
43495
43504
  const normalized = key === "route" && typeof value === "string" ? normalizeRoute(value) : value;
43496
43505
  if (typeof normalized === "boolean" || typeof normalized === "number" && Number.isFinite(normalized) || typeof normalized === "string" && safeString.test(normalized))
43497
43506
  result3[key] = normalized;
43498
43507
  }
43499
43508
  return result3;
43500
43509
  }
43501
- var eventProperties, safeString, uuid5, longId;
43510
+ var eventProperties, safeString, uuid5, longId, sqlStates;
43502
43511
  var init_analytics = __esm({
43503
43512
  "../../packages/core/dist/analytics/index.js"() {
43504
43513
  "use strict";
@@ -43559,11 +43568,12 @@ var init_analytics = __esm({
43559
43568
  extension_failure: ["code"],
43560
43569
  extension_interaction: ["stage", "outcome"],
43561
43570
  credential_setup_finished: ["stage", "outcome", "code"],
43562
- "$exception": ["route", "method", "exception_type", "exception_frames", "exception_handled", "exception_level"]
43571
+ "$exception": ["route", "method", "exception_type", "exception_frames", "exception_handled", "exception_level", "exception_code"]
43563
43572
  };
43564
43573
  safeString = /^[a-zA-Z0-9_./:{} -]{1,160}$/;
43565
43574
  uuid5 = /\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi;
43566
43575
  longId = /\b[a-zA-Z0-9_-]{24,}\b/g;
43576
+ sqlStates = new Set("08000 08001 08003 08004 08006 08007 08P01 22001 22003 22007 22008 22012 22018 22021 22023 22P02 23000 23502 23503 23505 23514 23P01 25006 25P02 28000 28P01 3D000 3F000 40001 40P01 42501 42601 42702 42703 42704 42804 42883 42P01 42P10 53300 53400 54000 54001 55000 55P03 57014 57P01 57P02 57P03 58000 58030 XX000 XX001 XX002".split(" "));
43567
43577
  }
43568
43578
  });
43569
43579
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apilift",
3
- "version": "1.5.14",
3
+ "version": "1.5.15",
4
4
  "description": "Use logged-in apps and discover missing actions with Apilift.",
5
5
  "author": {
6
6
  "name": "Apilift"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apilift",
3
- "version": "1.5.14",
3
+ "version": "1.5.15",
4
4
  "description": "Use logged-in apps and discover missing actions with Apilift.",
5
5
  "author": {
6
6
  "name": "Apilift"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apilift/cli",
3
- "version": "1.5.14",
3
+ "version": "1.5.15",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "bin": {
@@ -37,7 +37,7 @@
37
37
  "engines": {
38
38
  "node": ">=24.16.0 <27"
39
39
  },
40
- "gitHead": "74f177d77f68a31b81741e277ce3d6e6add05622",
40
+ "gitHead": "4479fd2220127a61138ac778c0928ae5591cd98f",
41
41
  "repository": {
42
42
  "type": "git",
43
43
  "url": "git+https://github.com/egor-sergeev/apilift.git",