@schematichq/schematic-vue 1.5.0 → 1.6.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.
@@ -36,7 +36,7 @@ __export(index_exports, {
36
36
  });
37
37
  module.exports = __toCommonJS(index_exports);
38
38
 
39
- // node_modules/@schematichq/schematic-js/dist/schematic.esm.js
39
+ // node_modules/.pnpm/@schematichq+schematic-js@1.8.0/node_modules/@schematichq/schematic-js/dist/schematic.esm.js
40
40
  var __create = Object.create;
41
41
  var __defProp2 = Object.defineProperty;
42
42
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -50,6 +50,10 @@ var __commonJS = (cb, mod) => function __require() {
50
50
  throw mod = 0, e;
51
51
  }
52
52
  };
53
+ var __export2 = (target, all) => {
54
+ for (var name in all)
55
+ __defProp2(target, name, { get: all[name], enumerable: true });
56
+ };
53
57
  var __copyProps2 = (to, from, except, desc) => {
54
58
  if (from && typeof from === "object" || typeof from === "function") {
55
59
  for (let key of __getOwnPropNames2(from))
@@ -67,7 +71,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
67
71
  mod
68
72
  ));
69
73
  var require_browser_polyfill = __commonJS({
70
- "node_modules/cross-fetch/dist/browser-polyfill.js"(exports) {
74
+ "node_modules/.pnpm/cross-fetch@4.1.0/node_modules/cross-fetch/dist/browser-polyfill.js"(exports) {
71
75
  (function(self2) {
72
76
  var irrelevant = (function(exports2) {
73
77
  var g = typeof globalThis !== "undefined" && globalThis || typeof self2 !== "undefined" && self2 || // eslint-disable-next-line no-undef
@@ -651,6 +655,18 @@ function MetricPeriodMonthResetFromJSON(json) {
651
655
  function MetricPeriodMonthResetFromJSONTyped(json, ignoreDiscriminator) {
652
656
  return json;
653
657
  }
658
+ function WarningTierFromJSON(json) {
659
+ return WarningTierFromJSONTyped(json, false);
660
+ }
661
+ function WarningTierFromJSONTyped(json, ignoreDiscriminator) {
662
+ if (json == null) {
663
+ return json;
664
+ }
665
+ return {
666
+ key: json["key"],
667
+ value: json["value"]
668
+ };
669
+ }
654
670
  function MetricPeriodFromJSON(json) {
655
671
  return MetricPeriodFromJSONTyped(json, false);
656
672
  }
@@ -682,7 +698,8 @@ function FeatureEntitlementFromJSONTyped(json, ignoreDiscriminator) {
682
698
  monthReset: json["month_reset"] == null ? void 0 : MetricPeriodMonthResetFromJSON(json["month_reset"]),
683
699
  softLimit: json["soft_limit"] == null ? void 0 : json["soft_limit"],
684
700
  usage: json["usage"] == null ? void 0 : json["usage"],
685
- valueType: EntitlementValueTypeFromJSON(json["value_type"])
701
+ valueType: EntitlementValueTypeFromJSON(json["value_type"]),
702
+ warningTiers: json["warning_tiers"] == null ? void 0 : json["warning_tiers"].map(WarningTierFromJSON)
686
703
  };
687
704
  }
688
705
  function RuleTypeFromJSON(json) {
@@ -1047,6 +1064,7 @@ function EventBodyFlagCheckToJSONTyped(value, ignoreDiscriminator = false) {
1047
1064
  error: value["error"],
1048
1065
  flag_id: value["flagId"],
1049
1066
  flag_key: value["flagKey"],
1067
+ preflight: value["preflight"],
1050
1068
  reason: value["reason"],
1051
1069
  req_company: value["reqCompany"],
1052
1070
  req_user: value["reqUser"],
@@ -1118,7 +1136,8 @@ var CheckFlagReturnFromJSON = (json) => {
1118
1136
  ruleType: ruleType == null ? void 0 : ruleType,
1119
1137
  softLimit: entitlement?.softLimit == null ? void 0 : entitlement.softLimit,
1120
1138
  userId: userId == null ? void 0 : userId,
1121
- value
1139
+ value,
1140
+ warningTiers: entitlement?.warningTiers == null ? void 0 : entitlement.warningTiers
1122
1141
  };
1123
1142
  };
1124
1143
  var CheckPlanReturnFromJSON = (json) => {
@@ -1145,7 +1164,7 @@ var CreditBalancesFromJSON = (json) => {
1145
1164
  }
1146
1165
  return balances;
1147
1166
  };
1148
- var cacheVersion = "bb56e75d";
1167
+ var cacheVersion = "7b920cf4";
1149
1168
  function contextString(context) {
1150
1169
  const sortedContext = Object.keys(context).reduce((acc, key) => {
1151
1170
  const sortedKeys = Object.keys(
@@ -1160,16 +1179,370 @@ function contextString(context) {
1160
1179
  }, {});
1161
1180
  return JSON.stringify(sortedContext);
1162
1181
  }
1163
- var version = "1.5.0";
1182
+ var version = "1.8.0";
1183
+ var models_exports = {};
1184
+ __export2(models_exports, {
1185
+ ApiErrorFromJSON: () => ApiErrorFromJSON,
1186
+ ApiErrorFromJSONTyped: () => ApiErrorFromJSONTyped,
1187
+ ApiErrorToJSON: () => ApiErrorToJSON,
1188
+ ApiErrorToJSONTyped: () => ApiErrorToJSONTyped,
1189
+ CompanyDiscountResponseDataFromJSON: () => CompanyDiscountResponseDataFromJSON,
1190
+ CompanyDiscountResponseDataFromJSONTyped: () => CompanyDiscountResponseDataFromJSONTyped,
1191
+ CompanyDiscountResponseDataToJSON: () => CompanyDiscountResponseDataToJSON,
1192
+ CompanyDiscountResponseDataToJSONTyped: () => CompanyDiscountResponseDataToJSONTyped,
1193
+ CompanyInvoiceResponseDataFromJSON: () => CompanyInvoiceResponseDataFromJSON,
1194
+ CompanyInvoiceResponseDataFromJSONTyped: () => CompanyInvoiceResponseDataFromJSONTyped,
1195
+ CompanyInvoiceResponseDataToJSON: () => CompanyInvoiceResponseDataToJSON,
1196
+ CompanyInvoiceResponseDataToJSONTyped: () => CompanyInvoiceResponseDataToJSONTyped,
1197
+ CompanyInvoicesResponseDataFromJSON: () => CompanyInvoicesResponseDataFromJSON,
1198
+ CompanyInvoicesResponseDataFromJSONTyped: () => CompanyInvoicesResponseDataFromJSONTyped,
1199
+ CompanyInvoicesResponseDataToJSON: () => CompanyInvoicesResponseDataToJSON,
1200
+ CompanyInvoicesResponseDataToJSONTyped: () => CompanyInvoicesResponseDataToJSONTyped,
1201
+ CompanyUpcomingInvoiceResponseDataFromJSON: () => CompanyUpcomingInvoiceResponseDataFromJSON,
1202
+ CompanyUpcomingInvoiceResponseDataFromJSONTyped: () => CompanyUpcomingInvoiceResponseDataFromJSONTyped,
1203
+ CompanyUpcomingInvoiceResponseDataToJSON: () => CompanyUpcomingInvoiceResponseDataToJSON,
1204
+ CompanyUpcomingInvoiceResponseDataToJSONTyped: () => CompanyUpcomingInvoiceResponseDataToJSONTyped,
1205
+ GetCompanyInvoicesParamsFromJSON: () => GetCompanyInvoicesParamsFromJSON,
1206
+ GetCompanyInvoicesParamsFromJSONTyped: () => GetCompanyInvoicesParamsFromJSONTyped,
1207
+ GetCompanyInvoicesParamsToJSON: () => GetCompanyInvoicesParamsToJSON,
1208
+ GetCompanyInvoicesParamsToJSONTyped: () => GetCompanyInvoicesParamsToJSONTyped,
1209
+ GetCompanyInvoicesResponseFromJSON: () => GetCompanyInvoicesResponseFromJSON,
1210
+ GetCompanyInvoicesResponseFromJSONTyped: () => GetCompanyInvoicesResponseFromJSONTyped,
1211
+ GetCompanyInvoicesResponseToJSON: () => GetCompanyInvoicesResponseToJSON,
1212
+ GetCompanyInvoicesResponseToJSONTyped: () => GetCompanyInvoicesResponseToJSONTyped,
1213
+ GetCompanyUpcomingInvoiceResponseFromJSON: () => GetCompanyUpcomingInvoiceResponseFromJSON,
1214
+ GetCompanyUpcomingInvoiceResponseFromJSONTyped: () => GetCompanyUpcomingInvoiceResponseFromJSONTyped,
1215
+ GetCompanyUpcomingInvoiceResponseToJSON: () => GetCompanyUpcomingInvoiceResponseToJSON,
1216
+ GetCompanyUpcomingInvoiceResponseToJSONTyped: () => GetCompanyUpcomingInvoiceResponseToJSONTyped,
1217
+ InvoiceStatus: () => InvoiceStatus,
1218
+ InvoiceStatusFromJSON: () => InvoiceStatusFromJSON,
1219
+ InvoiceStatusFromJSONTyped: () => InvoiceStatusFromJSONTyped,
1220
+ InvoiceStatusToJSON: () => InvoiceStatusToJSON,
1221
+ InvoiceStatusToJSONTyped: () => InvoiceStatusToJSONTyped,
1222
+ instanceOfApiError: () => instanceOfApiError,
1223
+ instanceOfCompanyDiscountResponseData: () => instanceOfCompanyDiscountResponseData,
1224
+ instanceOfCompanyInvoiceResponseData: () => instanceOfCompanyInvoiceResponseData,
1225
+ instanceOfCompanyInvoicesResponseData: () => instanceOfCompanyInvoicesResponseData,
1226
+ instanceOfCompanyUpcomingInvoiceResponseData: () => instanceOfCompanyUpcomingInvoiceResponseData,
1227
+ instanceOfGetCompanyInvoicesParams: () => instanceOfGetCompanyInvoicesParams,
1228
+ instanceOfGetCompanyInvoicesResponse: () => instanceOfGetCompanyInvoicesResponse,
1229
+ instanceOfGetCompanyUpcomingInvoiceResponse: () => instanceOfGetCompanyUpcomingInvoiceResponse,
1230
+ instanceOfInvoiceStatus: () => instanceOfInvoiceStatus
1231
+ });
1232
+ function instanceOfApiError(value) {
1233
+ if (!("error" in value) || value["error"] === void 0) return false;
1234
+ return true;
1235
+ }
1236
+ function ApiErrorFromJSON(json) {
1237
+ return ApiErrorFromJSONTyped(json, false);
1238
+ }
1239
+ function ApiErrorFromJSONTyped(json, ignoreDiscriminator) {
1240
+ if (json == null) {
1241
+ return json;
1242
+ }
1243
+ return {
1244
+ error: json["error"]
1245
+ };
1246
+ }
1247
+ function ApiErrorToJSON(json) {
1248
+ return ApiErrorToJSONTyped(json, false);
1249
+ }
1250
+ function ApiErrorToJSONTyped(value, ignoreDiscriminator = false) {
1251
+ if (value == null) {
1252
+ return value;
1253
+ }
1254
+ return {
1255
+ error: value["error"]
1256
+ };
1257
+ }
1258
+ function instanceOfCompanyDiscountResponseData(value) {
1259
+ if (!("couponName" in value) || value["couponName"] === void 0)
1260
+ return false;
1261
+ if (!("duration" in value) || value["duration"] === void 0) return false;
1262
+ return true;
1263
+ }
1264
+ function CompanyDiscountResponseDataFromJSON(json) {
1265
+ return CompanyDiscountResponseDataFromJSONTyped(json, false);
1266
+ }
1267
+ function CompanyDiscountResponseDataFromJSONTyped(json, ignoreDiscriminator) {
1268
+ if (json == null) {
1269
+ return json;
1270
+ }
1271
+ return {
1272
+ amountOff: json["amount_off"] == null ? void 0 : json["amount_off"],
1273
+ couponName: json["coupon_name"],
1274
+ currency: json["currency"] == null ? void 0 : json["currency"],
1275
+ customerFacingCode: json["customer_facing_code"] == null ? void 0 : json["customer_facing_code"],
1276
+ duration: json["duration"],
1277
+ durationInMonths: json["duration_in_months"] == null ? void 0 : json["duration_in_months"],
1278
+ percentOff: json["percent_off"] == null ? void 0 : json["percent_off"]
1279
+ };
1280
+ }
1281
+ function CompanyDiscountResponseDataToJSON(json) {
1282
+ return CompanyDiscountResponseDataToJSONTyped(json, false);
1283
+ }
1284
+ function CompanyDiscountResponseDataToJSONTyped(value, ignoreDiscriminator = false) {
1285
+ if (value == null) {
1286
+ return value;
1287
+ }
1288
+ return {
1289
+ amount_off: value["amountOff"],
1290
+ coupon_name: value["couponName"],
1291
+ currency: value["currency"],
1292
+ customer_facing_code: value["customerFacingCode"],
1293
+ duration: value["duration"],
1294
+ duration_in_months: value["durationInMonths"],
1295
+ percent_off: value["percentOff"]
1296
+ };
1297
+ }
1298
+ var InvoiceStatus = {
1299
+ Draft: "draft",
1300
+ Open: "open",
1301
+ Paid: "paid",
1302
+ Uncollectible: "uncollectible",
1303
+ Void: "void"
1304
+ };
1305
+ function instanceOfInvoiceStatus(value) {
1306
+ for (const key in InvoiceStatus) {
1307
+ if (Object.prototype.hasOwnProperty.call(InvoiceStatus, key)) {
1308
+ if (InvoiceStatus[key] === value) {
1309
+ return true;
1310
+ }
1311
+ }
1312
+ }
1313
+ return false;
1314
+ }
1315
+ function InvoiceStatusFromJSON(json) {
1316
+ return InvoiceStatusFromJSONTyped(json, false);
1317
+ }
1318
+ function InvoiceStatusFromJSONTyped(json, ignoreDiscriminator) {
1319
+ return json;
1320
+ }
1321
+ function InvoiceStatusToJSON(value) {
1322
+ return value;
1323
+ }
1324
+ function InvoiceStatusToJSONTyped(value, ignoreDiscriminator) {
1325
+ return value;
1326
+ }
1327
+ function instanceOfCompanyInvoiceResponseData(value) {
1328
+ if (!("amountDue" in value) || value["amountDue"] === void 0) return false;
1329
+ if (!("createdAt" in value) || value["createdAt"] === void 0) return false;
1330
+ if (!("currency" in value) || value["currency"] === void 0) return false;
1331
+ if (!("id" in value) || value["id"] === void 0) return false;
1332
+ return true;
1333
+ }
1334
+ function CompanyInvoiceResponseDataFromJSON(json) {
1335
+ return CompanyInvoiceResponseDataFromJSONTyped(json, false);
1336
+ }
1337
+ function CompanyInvoiceResponseDataFromJSONTyped(json, ignoreDiscriminator) {
1338
+ if (json == null) {
1339
+ return json;
1340
+ }
1341
+ return {
1342
+ amountDue: json["amount_due"],
1343
+ createdAt: new Date(json["created_at"]),
1344
+ currency: json["currency"],
1345
+ dueDate: json["due_date"] == null ? void 0 : new Date(json["due_date"]),
1346
+ id: json["id"],
1347
+ status: json["status"] == null ? void 0 : InvoiceStatusFromJSON(json["status"]),
1348
+ url: json["url"] == null ? void 0 : json["url"]
1349
+ };
1350
+ }
1351
+ function CompanyInvoiceResponseDataToJSON(json) {
1352
+ return CompanyInvoiceResponseDataToJSONTyped(json, false);
1353
+ }
1354
+ function CompanyInvoiceResponseDataToJSONTyped(value, ignoreDiscriminator = false) {
1355
+ if (value == null) {
1356
+ return value;
1357
+ }
1358
+ return {
1359
+ amount_due: value["amountDue"],
1360
+ created_at: value["createdAt"].toISOString(),
1361
+ currency: value["currency"],
1362
+ due_date: value["dueDate"] == null ? void 0 : value["dueDate"].toISOString(),
1363
+ id: value["id"],
1364
+ status: InvoiceStatusToJSON(value["status"]),
1365
+ url: value["url"]
1366
+ };
1367
+ }
1368
+ function instanceOfCompanyInvoicesResponseData(value) {
1369
+ if (!("count" in value) || value["count"] === void 0) return false;
1370
+ if (!("invoices" in value) || value["invoices"] === void 0) return false;
1371
+ return true;
1372
+ }
1373
+ function CompanyInvoicesResponseDataFromJSON(json) {
1374
+ return CompanyInvoicesResponseDataFromJSONTyped(json, false);
1375
+ }
1376
+ function CompanyInvoicesResponseDataFromJSONTyped(json, ignoreDiscriminator) {
1377
+ if (json == null) {
1378
+ return json;
1379
+ }
1380
+ return {
1381
+ count: json["count"],
1382
+ invoices: json["invoices"].map(
1383
+ CompanyInvoiceResponseDataFromJSON
1384
+ )
1385
+ };
1386
+ }
1387
+ function CompanyInvoicesResponseDataToJSON(json) {
1388
+ return CompanyInvoicesResponseDataToJSONTyped(json, false);
1389
+ }
1390
+ function CompanyInvoicesResponseDataToJSONTyped(value, ignoreDiscriminator = false) {
1391
+ if (value == null) {
1392
+ return value;
1393
+ }
1394
+ return {
1395
+ count: value["count"],
1396
+ invoices: value["invoices"].map(
1397
+ CompanyInvoiceResponseDataToJSON
1398
+ )
1399
+ };
1400
+ }
1401
+ function instanceOfCompanyUpcomingInvoiceResponseData(value) {
1402
+ if (!("amountDue" in value) || value["amountDue"] === void 0) return false;
1403
+ if (!("currency" in value) || value["currency"] === void 0) return false;
1404
+ if (!("customerBalanceApplied" in value) || value["customerBalanceApplied"] === void 0)
1405
+ return false;
1406
+ if (!("customerBalanceRemaining" in value) || value["customerBalanceRemaining"] === void 0)
1407
+ return false;
1408
+ if (!("discounts" in value) || value["discounts"] === void 0) return false;
1409
+ if (!("subtotal" in value) || value["subtotal"] === void 0) return false;
1410
+ return true;
1411
+ }
1412
+ function CompanyUpcomingInvoiceResponseDataFromJSON(json) {
1413
+ return CompanyUpcomingInvoiceResponseDataFromJSONTyped(json, false);
1414
+ }
1415
+ function CompanyUpcomingInvoiceResponseDataFromJSONTyped(json, ignoreDiscriminator) {
1416
+ if (json == null) {
1417
+ return json;
1418
+ }
1419
+ return {
1420
+ amountDue: json["amount_due"],
1421
+ currency: json["currency"],
1422
+ customerBalanceApplied: json["customer_balance_applied"],
1423
+ customerBalanceRemaining: json["customer_balance_remaining"],
1424
+ discounts: json["discounts"].map(
1425
+ CompanyDiscountResponseDataFromJSON
1426
+ ),
1427
+ dueDate: json["due_date"] == null ? void 0 : new Date(json["due_date"]),
1428
+ subtotal: json["subtotal"]
1429
+ };
1430
+ }
1431
+ function CompanyUpcomingInvoiceResponseDataToJSON(json) {
1432
+ return CompanyUpcomingInvoiceResponseDataToJSONTyped(json, false);
1433
+ }
1434
+ function CompanyUpcomingInvoiceResponseDataToJSONTyped(value, ignoreDiscriminator = false) {
1435
+ if (value == null) {
1436
+ return value;
1437
+ }
1438
+ return {
1439
+ amount_due: value["amountDue"],
1440
+ currency: value["currency"],
1441
+ customer_balance_applied: value["customerBalanceApplied"],
1442
+ customer_balance_remaining: value["customerBalanceRemaining"],
1443
+ discounts: value["discounts"].map(
1444
+ CompanyDiscountResponseDataToJSON
1445
+ ),
1446
+ due_date: value["dueDate"] == null ? void 0 : value["dueDate"].toISOString(),
1447
+ subtotal: value["subtotal"]
1448
+ };
1449
+ }
1450
+ function instanceOfGetCompanyInvoicesParams(value) {
1451
+ return true;
1452
+ }
1453
+ function GetCompanyInvoicesParamsFromJSON(json) {
1454
+ return GetCompanyInvoicesParamsFromJSONTyped(json, false);
1455
+ }
1456
+ function GetCompanyInvoicesParamsFromJSONTyped(json, ignoreDiscriminator) {
1457
+ if (json == null) {
1458
+ return json;
1459
+ }
1460
+ return {
1461
+ includePending: json["include_pending"] == null ? void 0 : json["include_pending"],
1462
+ limit: json["limit"] == null ? void 0 : json["limit"],
1463
+ offset: json["offset"] == null ? void 0 : json["offset"]
1464
+ };
1465
+ }
1466
+ function GetCompanyInvoicesParamsToJSON(json) {
1467
+ return GetCompanyInvoicesParamsToJSONTyped(json, false);
1468
+ }
1469
+ function GetCompanyInvoicesParamsToJSONTyped(value, ignoreDiscriminator = false) {
1470
+ if (value == null) {
1471
+ return value;
1472
+ }
1473
+ return {
1474
+ include_pending: value["includePending"],
1475
+ limit: value["limit"],
1476
+ offset: value["offset"]
1477
+ };
1478
+ }
1479
+ function instanceOfGetCompanyInvoicesResponse(value) {
1480
+ if (!("data" in value) || value["data"] === void 0) return false;
1481
+ if (!("params" in value) || value["params"] === void 0) return false;
1482
+ return true;
1483
+ }
1484
+ function GetCompanyInvoicesResponseFromJSON(json) {
1485
+ return GetCompanyInvoicesResponseFromJSONTyped(json, false);
1486
+ }
1487
+ function GetCompanyInvoicesResponseFromJSONTyped(json, ignoreDiscriminator) {
1488
+ if (json == null) {
1489
+ return json;
1490
+ }
1491
+ return {
1492
+ data: CompanyInvoicesResponseDataFromJSON(json["data"]),
1493
+ params: GetCompanyInvoicesParamsFromJSON(json["params"])
1494
+ };
1495
+ }
1496
+ function GetCompanyInvoicesResponseToJSON(json) {
1497
+ return GetCompanyInvoicesResponseToJSONTyped(json, false);
1498
+ }
1499
+ function GetCompanyInvoicesResponseToJSONTyped(value, ignoreDiscriminator = false) {
1500
+ if (value == null) {
1501
+ return value;
1502
+ }
1503
+ return {
1504
+ data: CompanyInvoicesResponseDataToJSON(value["data"]),
1505
+ params: GetCompanyInvoicesParamsToJSON(value["params"])
1506
+ };
1507
+ }
1508
+ function instanceOfGetCompanyUpcomingInvoiceResponse(value) {
1509
+ if (!("data" in value) || value["data"] === void 0) return false;
1510
+ if (!("params" in value) || value["params"] === void 0) return false;
1511
+ return true;
1512
+ }
1513
+ function GetCompanyUpcomingInvoiceResponseFromJSON(json) {
1514
+ return GetCompanyUpcomingInvoiceResponseFromJSONTyped(json, false);
1515
+ }
1516
+ function GetCompanyUpcomingInvoiceResponseFromJSONTyped(json, ignoreDiscriminator) {
1517
+ if (json == null) {
1518
+ return json;
1519
+ }
1520
+ return {
1521
+ data: CompanyUpcomingInvoiceResponseDataFromJSON(json["data"]),
1522
+ params: json["params"]
1523
+ };
1524
+ }
1525
+ function GetCompanyUpcomingInvoiceResponseToJSON(json) {
1526
+ return GetCompanyUpcomingInvoiceResponseToJSONTyped(json, false);
1527
+ }
1528
+ function GetCompanyUpcomingInvoiceResponseToJSONTyped(value, ignoreDiscriminator = false) {
1529
+ if (value == null) {
1530
+ return value;
1531
+ }
1532
+ return {
1533
+ data: CompanyUpcomingInvoiceResponseDataToJSON(value["data"]),
1534
+ params: value["params"]
1535
+ };
1536
+ }
1164
1537
  var anonymousIdKey = "schematicId";
1165
1538
  var flagStateCachePrefix = "schematicCache";
1166
1539
  var flagStateCacheMaxContexts = 10;
1167
1540
  var flagStateCacheDefaultMaxAgeMs = 7 * 24 * 60 * 60 * 1e3;
1168
1541
  var emptyCreditBalances = Object.freeze({});
1169
1542
  var Schematic = class {
1170
- additionalHeaders = {};
1543
+ _additionalHeaders = {};
1171
1544
  apiKey;
1172
- apiUrl = "https://api.schematichq.com";
1545
+ _apiUrl = "https://api.schematichq.com";
1173
1546
  conn = null;
1174
1547
  context = {};
1175
1548
  debugEnabled = false;
@@ -1249,7 +1622,7 @@ var Schematic = class {
1249
1622
  if (this.offlineEnabled) {
1250
1623
  this.setIsPending(false);
1251
1624
  }
1252
- this.additionalHeaders = {
1625
+ this._additionalHeaders = {
1253
1626
  "X-Schematic-Client-Version": `schematic-js@${version}`,
1254
1627
  ...options?.additionalHeaders ?? {}
1255
1628
  };
@@ -1265,7 +1638,7 @@ var Schematic = class {
1265
1638
  }
1266
1639
  this.hydrateFlagStateFromCache();
1267
1640
  if (options?.apiUrl !== void 0) {
1268
- this.apiUrl = options.apiUrl;
1641
+ this._apiUrl = options.apiUrl;
1269
1642
  }
1270
1643
  if (options?.eventUrl !== void 0) {
1271
1644
  this.eventUrl = options.eventUrl;
@@ -1330,6 +1703,12 @@ var Schematic = class {
1330
1703
  this.debug("Initialized with debug mode enabled");
1331
1704
  }
1332
1705
  }
1706
+ get apiUrl() {
1707
+ return this._apiUrl;
1708
+ }
1709
+ get additionalHeaders() {
1710
+ return { ...this._additionalHeaders };
1711
+ }
1333
1712
  /**
1334
1713
  * Resolve fallback value according to priority order:
1335
1714
  * 1. Callsite fallback value (if provided)
@@ -1415,11 +1794,11 @@ var Schematic = class {
1415
1794
  return resolvedFallbackResult.value;
1416
1795
  }
1417
1796
  if (!this.useWebSocket) {
1418
- const requestUrl = `${this.apiUrl}/flags/${key}/check`;
1797
+ const requestUrl = `${this._apiUrl}/flags/${key}/check`;
1419
1798
  return fetch(requestUrl, {
1420
1799
  method: "POST",
1421
1800
  headers: {
1422
- ...this.additionalHeaders ?? {},
1801
+ ...this._additionalHeaders ?? {},
1423
1802
  "Content-Type": "application/json;charset=UTF-8",
1424
1803
  "X-Schematic-Api-Key": this.apiKey
1425
1804
  },
@@ -1622,12 +2001,12 @@ var Schematic = class {
1622
2001
  this.debug(`checkFlags offline result: returning empty object`);
1623
2002
  return {};
1624
2003
  }
1625
- const requestUrl = `${this.apiUrl}/flags/check`;
2004
+ const requestUrl = `${this._apiUrl}/flags/check`;
1626
2005
  const requestBody = JSON.stringify(context);
1627
2006
  return fetch(requestUrl, {
1628
2007
  method: "POST",
1629
2008
  headers: {
1630
- ...this.additionalHeaders ?? {},
2009
+ ...this._additionalHeaders ?? {},
1631
2010
  "Content-Type": "application/json;charset=UTF-8",
1632
2011
  "X-Schematic-Api-Key": this.apiKey
1633
2012
  },
@@ -2174,7 +2553,7 @@ var Schematic = class {
2174
2553
  const response = await fetch(captureUrl, {
2175
2554
  method: "POST",
2176
2555
  headers: {
2177
- ...this.additionalHeaders ?? {},
2556
+ ...this._additionalHeaders ?? {},
2178
2557
  "Content-Type": "application/json;charset=UTF-8"
2179
2558
  },
2180
2559
  body: payload
@@ -2670,7 +3049,7 @@ var Schematic = class {
2670
3049
  }
2671
3050
  });
2672
3051
  this.currentWebSocket = socket;
2673
- const clientVersion = this.additionalHeaders["X-Schematic-Client-Version"] ?? `schematic-js@${version}`;
3052
+ const clientVersion = this._additionalHeaders["X-Schematic-Client-Version"] ?? `schematic-js@${version}`;
2674
3053
  const messagePayload = {
2675
3054
  apiKey: this.apiKey,
2676
3055
  clientVersion,
@@ -2907,10 +3286,10 @@ var notifyCreditBalanceListener = (listener, value) => {
2907
3286
  var import_vue = require("vue");
2908
3287
 
2909
3288
  // src/version.ts
2910
- var version2 = "1.5.0";
3289
+ var version2 = "1.6.0";
2911
3290
 
2912
3291
  // src/context/schematic.ts
2913
- var SchematicSymbol = Symbol("schematic");
3292
+ var SchematicSymbol = /* @__PURE__ */ Symbol("schematic");
2914
3293
  var SchematicPlugin = {
2915
3294
  install(app, options) {
2916
3295
  let client;
@@ -3017,10 +3396,17 @@ var useSchematicEntitlement = (key, opts) => {
3017
3396
  featureUsageExceeded: (0, import_vue2.computed)(() => flagCheck.value.featureUsageExceeded),
3018
3397
  featureUsageEvent: (0, import_vue2.computed)(() => flagCheck.value.featureUsageEvent),
3019
3398
  featureUsagePeriod: (0, import_vue2.computed)(() => flagCheck.value.featureUsagePeriod),
3399
+ softLimit: (0, import_vue2.computed)(() => flagCheck.value.softLimit),
3400
+ warningTiers: (0, import_vue2.computed)(() => flagCheck.value.warningTiers),
3020
3401
  flagId: (0, import_vue2.computed)(() => flagCheck.value.flagId),
3021
3402
  ruleId: (0, import_vue2.computed)(() => flagCheck.value.ruleId),
3022
3403
  companyId: (0, import_vue2.computed)(() => flagCheck.value.companyId),
3023
- userId: (0, import_vue2.computed)(() => flagCheck.value.userId)
3404
+ userId: (0, import_vue2.computed)(() => flagCheck.value.userId),
3405
+ // Credit fields, populated for features metered by credit burndown
3406
+ creditId: (0, import_vue2.computed)(() => flagCheck.value.creditId),
3407
+ creditSettled: (0, import_vue2.computed)(() => flagCheck.value.creditSettled),
3408
+ creditRemaining: (0, import_vue2.computed)(() => flagCheck.value.creditRemaining),
3409
+ creditReserved: (0, import_vue2.computed)(() => flagCheck.value.creditReserved)
3024
3410
  };
3025
3411
  };
3026
3412
  var useSchematicPlan = (opts) => {
@@ -3042,15 +3428,24 @@ var useSchematicPlan = (opts) => {
3042
3428
  };
3043
3429
  var useSchematicCreditBalance = (creditId, opts) => {
3044
3430
  const client = useSchematicClient(opts);
3431
+ const resolvedCreditId = (0, import_vue2.computed)(() => (0, import_vue2.toValue)(creditId));
3432
+ const readBalance = () => {
3433
+ const id = resolvedCreditId.value;
3434
+ return id === void 0 ? void 0 : client.getCreditBalance(id);
3435
+ };
3045
3436
  const creditBalance = (0, import_vue2.ref)(
3046
- client.getCreditBalance(creditId)
3437
+ readBalance()
3047
3438
  );
3048
3439
  const isPending = (0, import_vue2.ref)(client.getIsPending());
3440
+ (0, import_vue2.watch)(resolvedCreditId, () => {
3441
+ creditBalance.value = readBalance();
3442
+ });
3049
3443
  let unsubscribeBalance = null;
3050
3444
  let unsubscribePending = null;
3051
3445
  (0, import_vue2.onMounted)(() => {
3446
+ creditBalance.value = readBalance();
3052
3447
  unsubscribeBalance = client.addCreditBalanceListener(() => {
3053
- creditBalance.value = client.getCreditBalance(creditId);
3448
+ creditBalance.value = readBalance();
3054
3449
  });
3055
3450
  unsubscribePending = client.addIsPendingListener(() => {
3056
3451
  isPending.value = client.getIsPending();