@burdenoff/be-sdk 2026.1130.2 → 2026.1130.3
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-CIgoeobA.d.ts → index-Bnz5Bqtl.d.ts} +14 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/validation/index.d.ts +2 -2
- package/dist/validation/index.js +2 -2
- package/dist/{validation-CPUITdMk.js → validation-bwJzOytZ.js} +66 -97
- package/dist/{validation-CPUITdMk.js.map → validation-bwJzOytZ.js.map} +1 -1
- package/package.json +1 -1
|
@@ -108,8 +108,19 @@ declare function rbacArgPathProblem(field: FieldDefinitionNode, path: string, in
|
|
|
108
108
|
}): string | null;
|
|
109
109
|
declare function analyzeRbacCoverage(source: RbacCoverageSource, options?: RbacCoverageOptions): RbacCoverageReport;
|
|
110
110
|
declare function assertRbacCoverage(source: RbacCoverageSource, options?: RbacCoverageOptions): RbacCoverageReport;
|
|
111
|
-
declare const SUPPORTED_BILLING_CURRENCIES: readonly ["USD", "
|
|
111
|
+
declare const SUPPORTED_BILLING_CURRENCIES: readonly ["USD", "INR", "EUR", "GBP", "AUD"];
|
|
112
112
|
type SupportedBillingCurrency = (typeof SUPPORTED_BILLING_CURRENCIES)[number];
|
|
113
|
+
type BillingCurrencyPaymentProvider = 'STRIPE' | 'RAZORPAY';
|
|
114
|
+
interface SupportedBillingCurrencyInfo {
|
|
115
|
+
readonly code: SupportedBillingCurrency;
|
|
116
|
+
readonly name: string;
|
|
117
|
+
readonly symbol: string;
|
|
118
|
+
readonly minorUnits: number;
|
|
119
|
+
readonly paymentProvider: BillingCurrencyPaymentProvider;
|
|
120
|
+
}
|
|
121
|
+
declare const SUPPORTED_BILLING_CURRENCY_INFO: Readonly<Record<SupportedBillingCurrency, SupportedBillingCurrencyInfo>>;
|
|
122
|
+
declare function toSupportedBillingCurrency(currency: unknown): SupportedBillingCurrency | null;
|
|
123
|
+
declare function getSupportedBillingCurrencyInfo(currency: unknown): SupportedBillingCurrencyInfo | null;
|
|
113
124
|
declare const MAX_BILLING_AMOUNT = 1000000000;
|
|
114
125
|
declare function isSupportedBillingCurrency(currency: unknown): boolean;
|
|
115
126
|
type BillingAmountErrorCode = 'not_finite' | 'not_positive' | 'negative' | 'exceeds_maximum';
|
|
@@ -140,6 +151,6 @@ declare function validateBillingMoney(amount: unknown, currency: unknown, option
|
|
|
140
151
|
allowZero?: boolean;
|
|
141
152
|
}): BillingMoneyValidationResult;
|
|
142
153
|
declare namespace index_d_exports {
|
|
143
|
-
export { BillingAmountErrorCode, BillingAmountValidationResult, BillingMoneyErrorCode, BillingMoneyValidationResult, DEFAULT_MAX_RBAC_ARG_PATH_SEGMENTS, DEFAULT_RBAC_ROOT_TYPES, MAX_BILLING_AMOUNT, NAME_MAX_LENGTH, NAME_MIN_LENGTH, NameErrorCode, NameValidationResult, RBAC_GATED_SCOPE_TYPES, RBAC_SCOPE_TYPES, RbacCoverageError, RbacCoverageOptions, RbacCoverageReport, RbacCoverageSource, RbacDirectiveArgs, RbacFieldPin, RbacRootField, RbacSchemaDocument, RbacScopeType, SUPPORTED_BILLING_CURRENCIES, SupportedBillingCurrency, USERNAME_MAX_LENGTH, USERNAME_MIN_LENGTH, UserFieldError, UserFieldKey, UserFieldsValidationResult, UsernameErrorCode, UsernameValidationResult, ValidatedUserFields, analyzeRbacCoverage, assertRbacCoverage, convertBillingToMinorUnits, isSupportedBillingCurrency, lengthInCodePoints, loadRbacSchemaDocuments, rbacArgPathProblem, readRbacDirectiveArgs, validateBillingAmount, validateBillingMoney, validateName, validateUserFields, validateUsername };
|
|
154
|
+
export { BillingAmountErrorCode, BillingAmountValidationResult, BillingCurrencyPaymentProvider, BillingMoneyErrorCode, BillingMoneyValidationResult, DEFAULT_MAX_RBAC_ARG_PATH_SEGMENTS, DEFAULT_RBAC_ROOT_TYPES, MAX_BILLING_AMOUNT, NAME_MAX_LENGTH, NAME_MIN_LENGTH, NameErrorCode, NameValidationResult, RBAC_GATED_SCOPE_TYPES, RBAC_SCOPE_TYPES, RbacCoverageError, RbacCoverageOptions, RbacCoverageReport, RbacCoverageSource, RbacDirectiveArgs, RbacFieldPin, RbacRootField, RbacSchemaDocument, RbacScopeType, SUPPORTED_BILLING_CURRENCIES, SUPPORTED_BILLING_CURRENCY_INFO, SupportedBillingCurrency, SupportedBillingCurrencyInfo, USERNAME_MAX_LENGTH, USERNAME_MIN_LENGTH, UserFieldError, UserFieldKey, UserFieldsValidationResult, UsernameErrorCode, UsernameValidationResult, ValidatedUserFields, analyzeRbacCoverage, assertRbacCoverage, convertBillingToMinorUnits, getSupportedBillingCurrencyInfo, isSupportedBillingCurrency, lengthInCodePoints, loadRbacSchemaDocuments, rbacArgPathProblem, readRbacDirectiveArgs, toSupportedBillingCurrency, validateBillingAmount, validateBillingMoney, validateName, validateUserFields, validateUsername };
|
|
144
155
|
}
|
|
145
|
-
export {
|
|
156
|
+
export { RbacScopeType as A, validateUserFields as B, RbacCoverageOptions as C, RbacFieldPin as D, RbacDirectiveArgs as E, readRbacDirectiveArgs as F, validateUsername as G, USERNAME_MIN_LENGTH as H, UserFieldError as I, NameErrorCode as J, NAME_MAX_LENGTH as K, UserFieldKey as L, assertRbacCoverage as M, loadRbacSchemaDocuments as N, RbacRootField as O, rbacArgPathProblem as P, UserFieldsValidationResult as R, RbacCoverageError as S, RbacCoverageSource as T, UsernameErrorCode as U, USERNAME_MAX_LENGTH as V, UsernameValidationResult as W, lengthInCodePoints as X, NameValidationResult as Y, validateName as Z, validateBillingMoney as _, BillingMoneyErrorCode as a, RBAC_GATED_SCOPE_TYPES as b, SUPPORTED_BILLING_CURRENCIES as c, SupportedBillingCurrencyInfo as d, convertBillingToMinorUnits as f, validateBillingAmount as g, toSupportedBillingCurrency as h, BillingCurrencyPaymentProvider as i, analyzeRbacCoverage as j, RbacSchemaDocument as k, SUPPORTED_BILLING_CURRENCY_INFO as l, isSupportedBillingCurrency as m, BillingAmountErrorCode as n, BillingMoneyValidationResult as o, getSupportedBillingCurrencyInfo as p, NAME_MIN_LENGTH as q, BillingAmountValidationResult as r, MAX_BILLING_AMOUNT as s, index_d_exports as t, SupportedBillingCurrency as u, DEFAULT_MAX_RBAC_ARG_PATH_SEGMENTS as v, RbacCoverageReport as w, RBAC_SCOPE_TYPES as x, DEFAULT_RBAC_ROOT_TYPES as y, ValidatedUserFields as z };
|
package/dist/index.d.ts
CHANGED
|
@@ -41,7 +41,7 @@ import { t as index_d_exports$9 } from "./index-XkPephwV.js";
|
|
|
41
41
|
import { t as index_d_exports$7 } from "./index-Cl3Xiw1O.js";
|
|
42
42
|
import { a as index_d_exports$2, c as verifyCaptchaIfEnabled, n as RecaptchaVerifyResult, o as isCaptchaEnabled, s as verifyCaptcha, t as RecaptchaVerifyOptions } from "./index-yBSjMY32.js";
|
|
43
43
|
import { t as index_d_exports$20 } from "./index-DY3dNhMN.js";
|
|
44
|
-
import { B as
|
|
44
|
+
import { B as validateUserFields, C as RbacCoverageOptions, G as validateUsername, H as USERNAME_MIN_LENGTH, I as UserFieldError, J as NameErrorCode, K as NAME_MAX_LENGTH, L as UserFieldKey, M as assertRbacCoverage, R as UserFieldsValidationResult, S as RbacCoverageError, T as RbacCoverageSource, U as UsernameErrorCode, V as USERNAME_MAX_LENGTH, W as UsernameValidationResult, X as lengthInCodePoints, Y as NameValidationResult, Z as validateName, j as analyzeRbacCoverage, q as NAME_MIN_LENGTH, t as index_d_exports$26, w as RbacCoverageReport, z as ValidatedUserFields } from "./index-Bnz5Bqtl.js";
|
|
45
45
|
import { A as normalizeTemplateKey, C as isSameTemplateKey, D as normalizeProductSlug, E as normalizeGraphQLName, F as templateKeyVariants, I as toCurrentName, L as toLegacyName, M as quotaKeyVariants, N as rbacResourceVariants, O as normalizeQuotaKey, P as readRenamedEnv, S as isSameRbacResource, T as normalizeBillingId, _ as isSameBillingId, a as ProductRename, b as isSameProductSlug, c as billingIdVariants, d as emitProductSlug, f as emitQuotaKey, g as isLegacyName, h as index_d_exports$22, i as PRODUCT_SLUG_ALIASES, j as productSlugVariants, k as normalizeRbacResource, l as emitBillingId, m as emitTemplateKey, n as PRODUCT_RENAMES, o as RENAME_CONCERNS, p as emitRbacResource, r as PRODUCT_RENAME_EMIT, s as RenameConcern, t as EmitGeneration, u as emitName, v as isSameGraphQLName, w as nameVariants, x as isSameQuotaKey, y as isSameName } from "./index-BBqooJ52.js";
|
|
46
46
|
import { A as assertDsarOrchestrator, C as DSAR_REQUIRE_VERIFIED_SERVICE_TOKEN_ENV, D as DsarOrchestratorRejectionReason, E as DsarOrchestratorOptions, M as isDsarOrchestratorActor, N as resolveDsarCallerIdentity, O as ResolvedDsarCaller, S as DSAR_ALLOWED_ORCHESTRATORS_ENV, T as DsarOrchestratorForbiddenError, j as getAllowedDsarOrchestrators, k as VERIFIED_SERVICE_IDENTITY_HEADER, w as DsarOrchestratorContext, x as DEFAULT_DSAR_ORCHESTRATOR_ID } from "./index-C4hRRihw.js";
|
|
47
47
|
interface TenantBackendClientConfig {
|
package/dist/index.js
CHANGED
|
@@ -44,7 +44,7 @@ import { t as gateway_exports } from "./gateway-B9p8PD82.js";
|
|
|
44
44
|
import { t as feature_flags_exports } from "./feature-flags-CP1KRgwD.js";
|
|
45
45
|
import { i as verifyCaptchaIfEnabled, n as isCaptchaEnabled, r as verifyCaptcha, t as captcha_exports } from "./captcha-BT7yh1YS.js";
|
|
46
46
|
import { t as platform_exports } from "./platform-DZwczW7v.js";
|
|
47
|
-
import { C as
|
|
47
|
+
import { C as USERNAME_MIN_LENGTH, D as lengthInCodePoints, E as NAME_MIN_LENGTH, O as validateName, S as USERNAME_MAX_LENGTH, T as NAME_MAX_LENGTH, _ as assertRbacCoverage, g as analyzeRbacCoverage, h as RbacCoverageError, t as validation_exports, w as validateUsername, x as validateUserFields } from "./validation-bwJzOytZ.js";
|
|
48
48
|
import { A as rbacResourceVariants, C as normalizeProductSlug, D as productSlugVariants, E as normalizeTemplateKey, M as templateKeyVariants, N as toCurrentName, O as product_alias_exports, P as toLegacyName, S as normalizeGraphQLName, T as normalizeRbacResource, _ as isSameQuotaKey, a as billingIdVariants, b as nameVariants, c as emitProductSlug, d as emitTemplateKey, f as isLegacyName, g as isSameProductSlug, h as isSameName, i as RENAME_CONCERNS, j as readRenamedEnv, k as quotaKeyVariants, l as emitQuotaKey, m as isSameGraphQLName, n as PRODUCT_RENAME_EMIT, o as emitBillingId, p as isSameBillingId, r as PRODUCT_SLUG_ALIASES, s as emitName, t as PRODUCT_RENAMES, u as emitRbacResource, v as isSameRbacResource, w as normalizeQuotaKey, x as normalizeBillingId, y as isSameTemplateKey } from "./product-alias-BPqtskMq.js";
|
|
49
49
|
import { a as VERIFIED_SERVICE_IDENTITY_HEADER, c as isDsarOrchestratorActor, i as DsarOrchestratorForbiddenError, l as resolveDsarCallerIdentity, n as DSAR_ALLOWED_ORCHESTRATORS_ENV, o as assertDsarOrchestrator, r as DSAR_REQUIRE_VERIFIED_SERVICE_TOKEN_ENV, s as getAllowedDsarOrchestrators, t as DEFAULT_DSAR_ORCHESTRATOR_ID } from "./dsar-orchestrator-BlOSa9A_.js";
|
|
50
50
|
import { GraphQLClient } from "graphql-request";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
export { type BillingAmountErrorCode, type BillingAmountValidationResult, type BillingMoneyErrorCode, type BillingMoneyValidationResult, DEFAULT_MAX_RBAC_ARG_PATH_SEGMENTS, DEFAULT_RBAC_ROOT_TYPES, MAX_BILLING_AMOUNT, NAME_MAX_LENGTH, NAME_MIN_LENGTH, type NameErrorCode, type NameValidationResult, RBAC_GATED_SCOPE_TYPES, RBAC_SCOPE_TYPES, RbacCoverageError, type RbacCoverageOptions, type RbacCoverageReport, type RbacCoverageSource, type RbacDirectiveArgs, type RbacFieldPin, type RbacRootField, type RbacSchemaDocument, type RbacScopeType, SUPPORTED_BILLING_CURRENCIES, type SupportedBillingCurrency, USERNAME_MAX_LENGTH, USERNAME_MIN_LENGTH, type UserFieldError, type UserFieldKey, type UserFieldsValidationResult, type UsernameErrorCode, type UsernameValidationResult, type ValidatedUserFields, analyzeRbacCoverage, assertRbacCoverage, convertBillingToMinorUnits, isSupportedBillingCurrency, lengthInCodePoints, loadRbacSchemaDocuments, rbacArgPathProblem, readRbacDirectiveArgs, validateBillingAmount, validateBillingMoney, validateName, validateUserFields, validateUsername };
|
|
1
|
+
import { A as RbacScopeType, B as validateUserFields, C as RbacCoverageOptions, D as RbacFieldPin, E as RbacDirectiveArgs, F as readRbacDirectiveArgs, G as validateUsername, H as USERNAME_MIN_LENGTH, I as UserFieldError, J as NameErrorCode, K as NAME_MAX_LENGTH, L as UserFieldKey, M as assertRbacCoverage, N as loadRbacSchemaDocuments, O as RbacRootField, P as rbacArgPathProblem, R as UserFieldsValidationResult, S as RbacCoverageError, T as RbacCoverageSource, U as UsernameErrorCode, V as USERNAME_MAX_LENGTH, W as UsernameValidationResult, X as lengthInCodePoints, Y as NameValidationResult, Z as validateName, _ as validateBillingMoney, a as BillingMoneyErrorCode, b as RBAC_GATED_SCOPE_TYPES, c as SUPPORTED_BILLING_CURRENCIES, d as SupportedBillingCurrencyInfo, f as convertBillingToMinorUnits, g as validateBillingAmount, h as toSupportedBillingCurrency, i as BillingCurrencyPaymentProvider, j as analyzeRbacCoverage, k as RbacSchemaDocument, l as SUPPORTED_BILLING_CURRENCY_INFO, m as isSupportedBillingCurrency, n as BillingAmountErrorCode, o as BillingMoneyValidationResult, p as getSupportedBillingCurrencyInfo, q as NAME_MIN_LENGTH, r as BillingAmountValidationResult, s as MAX_BILLING_AMOUNT, u as SupportedBillingCurrency, v as DEFAULT_MAX_RBAC_ARG_PATH_SEGMENTS, w as RbacCoverageReport, x as RBAC_SCOPE_TYPES, y as DEFAULT_RBAC_ROOT_TYPES, z as ValidatedUserFields } from "../index-Bnz5Bqtl.js";
|
|
2
|
+
export { type BillingAmountErrorCode, type BillingAmountValidationResult, type BillingCurrencyPaymentProvider, type BillingMoneyErrorCode, type BillingMoneyValidationResult, DEFAULT_MAX_RBAC_ARG_PATH_SEGMENTS, DEFAULT_RBAC_ROOT_TYPES, MAX_BILLING_AMOUNT, NAME_MAX_LENGTH, NAME_MIN_LENGTH, type NameErrorCode, type NameValidationResult, RBAC_GATED_SCOPE_TYPES, RBAC_SCOPE_TYPES, RbacCoverageError, type RbacCoverageOptions, type RbacCoverageReport, type RbacCoverageSource, type RbacDirectiveArgs, type RbacFieldPin, type RbacRootField, type RbacSchemaDocument, type RbacScopeType, SUPPORTED_BILLING_CURRENCIES, SUPPORTED_BILLING_CURRENCY_INFO, type SupportedBillingCurrency, type SupportedBillingCurrencyInfo, USERNAME_MAX_LENGTH, USERNAME_MIN_LENGTH, type UserFieldError, type UserFieldKey, type UserFieldsValidationResult, type UsernameErrorCode, type UsernameValidationResult, type ValidatedUserFields, analyzeRbacCoverage, assertRbacCoverage, convertBillingToMinorUnits, getSupportedBillingCurrencyInfo, isSupportedBillingCurrency, lengthInCodePoints, loadRbacSchemaDocuments, rbacArgPathProblem, readRbacDirectiveArgs, toSupportedBillingCurrency, validateBillingAmount, validateBillingMoney, validateName, validateUserFields, validateUsername };
|
package/dist/validation/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as NAME_MIN_LENGTH, S as
|
|
1
|
+
import { C as USERNAME_MIN_LENGTH, D as lengthInCodePoints, E as NAME_MIN_LENGTH, O as validateName, S as USERNAME_MAX_LENGTH, T as NAME_MAX_LENGTH, _ as assertRbacCoverage, a as convertBillingToMinorUnits, b as readRbacDirectiveArgs, c as toSupportedBillingCurrency, d as DEFAULT_MAX_RBAC_ARG_PATH_SEGMENTS, f as DEFAULT_RBAC_ROOT_TYPES, g as analyzeRbacCoverage, h as RbacCoverageError, i as SUPPORTED_BILLING_CURRENCY_INFO, l as validateBillingAmount, m as RBAC_SCOPE_TYPES, n as MAX_BILLING_AMOUNT, o as getSupportedBillingCurrencyInfo, p as RBAC_GATED_SCOPE_TYPES, r as SUPPORTED_BILLING_CURRENCIES, s as isSupportedBillingCurrency, u as validateBillingMoney, v as loadRbacSchemaDocuments, w as validateUsername, x as validateUserFields, y as rbacArgPathProblem } from "../validation-bwJzOytZ.js";
|
|
2
2
|
|
|
3
|
-
export { DEFAULT_MAX_RBAC_ARG_PATH_SEGMENTS, DEFAULT_RBAC_ROOT_TYPES, MAX_BILLING_AMOUNT, NAME_MAX_LENGTH, NAME_MIN_LENGTH, RBAC_GATED_SCOPE_TYPES, RBAC_SCOPE_TYPES, RbacCoverageError, SUPPORTED_BILLING_CURRENCIES, USERNAME_MAX_LENGTH, USERNAME_MIN_LENGTH, analyzeRbacCoverage, assertRbacCoverage, convertBillingToMinorUnits, isSupportedBillingCurrency, lengthInCodePoints, loadRbacSchemaDocuments, rbacArgPathProblem, readRbacDirectiveArgs, validateBillingAmount, validateBillingMoney, validateName, validateUserFields, validateUsername };
|
|
3
|
+
export { DEFAULT_MAX_RBAC_ARG_PATH_SEGMENTS, DEFAULT_RBAC_ROOT_TYPES, MAX_BILLING_AMOUNT, NAME_MAX_LENGTH, NAME_MIN_LENGTH, RBAC_GATED_SCOPE_TYPES, RBAC_SCOPE_TYPES, RbacCoverageError, SUPPORTED_BILLING_CURRENCIES, SUPPORTED_BILLING_CURRENCY_INFO, USERNAME_MAX_LENGTH, USERNAME_MIN_LENGTH, analyzeRbacCoverage, assertRbacCoverage, convertBillingToMinorUnits, getSupportedBillingCurrencyInfo, isSupportedBillingCurrency, lengthInCodePoints, loadRbacSchemaDocuments, rbacArgPathProblem, readRbacDirectiveArgs, toSupportedBillingCurrency, validateBillingAmount, validateBillingMoney, validateName, validateUserFields, validateUsername };
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -547,102 +547,73 @@ function assertRbacCoverage(source, options = {}) {
|
|
|
547
547
|
|
|
548
548
|
// src/validation/billing.ts
|
|
549
549
|
/** Canonical billing policy extracted from global-billing input validation (BOFF-10764).
|
|
550
|
-
*
|
|
551
|
-
*
|
|
550
|
+
* This validates major-unit values only; it does not round, convert FX or authorize payment.
|
|
551
|
+
*
|
|
552
|
+
* The supported currencies mirror global-billing's single list
|
|
553
|
+
* (`global-billing-svc/src/modules/currency/supported-currencies.ts`, BOFF-17385):
|
|
554
|
+
* exactly USD, INR, EUR, GBP and AUD, in that order (BOFF-17446). Any other code is
|
|
555
|
+
* rejected here because billing rejects it at payment. Keep both lists identical.
|
|
552
556
|
*/
|
|
553
557
|
const SUPPORTED_BILLING_CURRENCIES = Object.freeze([
|
|
554
558
|
"USD",
|
|
559
|
+
"INR",
|
|
555
560
|
"EUR",
|
|
556
561
|
"GBP",
|
|
557
|
-
"
|
|
558
|
-
"AUD",
|
|
559
|
-
"CAD",
|
|
560
|
-
"SGD",
|
|
561
|
-
"JPY",
|
|
562
|
-
"CNY",
|
|
563
|
-
"BRL",
|
|
564
|
-
"MXN",
|
|
565
|
-
"KRW",
|
|
566
|
-
"HKD",
|
|
567
|
-
"NOK",
|
|
568
|
-
"SEK",
|
|
569
|
-
"DKK",
|
|
570
|
-
"CHF",
|
|
571
|
-
"NZD",
|
|
572
|
-
"ZAR",
|
|
573
|
-
"AED",
|
|
574
|
-
"SAR",
|
|
575
|
-
"QAR",
|
|
576
|
-
"OMR",
|
|
577
|
-
"BHD",
|
|
578
|
-
"KWD",
|
|
579
|
-
"JOD",
|
|
580
|
-
"EGP",
|
|
581
|
-
"PKR",
|
|
582
|
-
"BDT",
|
|
583
|
-
"LKR",
|
|
584
|
-
"THB",
|
|
585
|
-
"MYR",
|
|
586
|
-
"IDR",
|
|
587
|
-
"PHP",
|
|
588
|
-
"VND",
|
|
589
|
-
"TWD",
|
|
590
|
-
"CZK",
|
|
591
|
-
"HUF",
|
|
592
|
-
"PLN",
|
|
593
|
-
"RON",
|
|
594
|
-
"RUB",
|
|
595
|
-
"TRY",
|
|
596
|
-
"ILS",
|
|
597
|
-
"NGN",
|
|
598
|
-
"GHS",
|
|
599
|
-
"KES",
|
|
600
|
-
"TZS",
|
|
601
|
-
"UGX",
|
|
602
|
-
"ETB",
|
|
603
|
-
"MAD",
|
|
604
|
-
"DZD",
|
|
605
|
-
"TND",
|
|
606
|
-
"BWP",
|
|
607
|
-
"MUR",
|
|
608
|
-
"MVR",
|
|
609
|
-
"BND",
|
|
610
|
-
"KHR",
|
|
611
|
-
"MMK",
|
|
612
|
-
"KZT",
|
|
613
|
-
"UZS",
|
|
614
|
-
"AZN",
|
|
615
|
-
"GEL",
|
|
616
|
-
"AMD",
|
|
617
|
-
"UAH",
|
|
618
|
-
"BGN",
|
|
619
|
-
"HRK",
|
|
620
|
-
"MKD",
|
|
621
|
-
"ALL",
|
|
622
|
-
"RSD",
|
|
623
|
-
"CLP",
|
|
624
|
-
"COP",
|
|
625
|
-
"PEN",
|
|
626
|
-
"ARS",
|
|
627
|
-
"BOB",
|
|
628
|
-
"PYG",
|
|
629
|
-
"UYU",
|
|
630
|
-
"GTQ",
|
|
631
|
-
"HNL",
|
|
632
|
-
"NIO",
|
|
633
|
-
"CRC",
|
|
634
|
-
"DOP",
|
|
635
|
-
"TTD",
|
|
636
|
-
"JMD",
|
|
637
|
-
"BBD",
|
|
638
|
-
"HTG",
|
|
639
|
-
"BZD",
|
|
640
|
-
"GYD",
|
|
641
|
-
"SRD",
|
|
642
|
-
"XCD",
|
|
643
|
-
"PAB"
|
|
562
|
+
"AUD"
|
|
644
563
|
]);
|
|
645
564
|
const supportedCurrencies = new Set(SUPPORTED_BILLING_CURRENCIES);
|
|
565
|
+
/** Metadata for every supported currency, identical to global-billing's `SUPPORTED_CURRENCY_INFO`. */
|
|
566
|
+
const SUPPORTED_BILLING_CURRENCY_INFO = Object.freeze({
|
|
567
|
+
USD: Object.freeze({
|
|
568
|
+
code: "USD",
|
|
569
|
+
name: "US Dollar",
|
|
570
|
+
symbol: "$",
|
|
571
|
+
minorUnits: 2,
|
|
572
|
+
paymentProvider: "STRIPE"
|
|
573
|
+
}),
|
|
574
|
+
INR: Object.freeze({
|
|
575
|
+
code: "INR",
|
|
576
|
+
name: "Indian Rupee",
|
|
577
|
+
symbol: "₹",
|
|
578
|
+
minorUnits: 2,
|
|
579
|
+
paymentProvider: "RAZORPAY"
|
|
580
|
+
}),
|
|
581
|
+
EUR: Object.freeze({
|
|
582
|
+
code: "EUR",
|
|
583
|
+
name: "Euro",
|
|
584
|
+
symbol: "€",
|
|
585
|
+
minorUnits: 2,
|
|
586
|
+
paymentProvider: "STRIPE"
|
|
587
|
+
}),
|
|
588
|
+
GBP: Object.freeze({
|
|
589
|
+
code: "GBP",
|
|
590
|
+
name: "British Pound",
|
|
591
|
+
symbol: "£",
|
|
592
|
+
minorUnits: 2,
|
|
593
|
+
paymentProvider: "STRIPE"
|
|
594
|
+
}),
|
|
595
|
+
AUD: Object.freeze({
|
|
596
|
+
code: "AUD",
|
|
597
|
+
name: "Australian Dollar",
|
|
598
|
+
symbol: "A$",
|
|
599
|
+
minorUnits: 2,
|
|
600
|
+
paymentProvider: "STRIPE"
|
|
601
|
+
})
|
|
602
|
+
});
|
|
603
|
+
/**
|
|
604
|
+
* The canonical supported code for a value, or null. Case-insensitive, as in
|
|
605
|
+
* billing. Whitespace is not silently accepted.
|
|
606
|
+
*/
|
|
607
|
+
function toSupportedBillingCurrency(currency) {
|
|
608
|
+
if (typeof currency !== "string") return null;
|
|
609
|
+
const normalized = currency.toUpperCase();
|
|
610
|
+
return SUPPORTED_BILLING_CURRENCIES.find((code) => code === normalized) ?? null;
|
|
611
|
+
}
|
|
612
|
+
/** Metadata for a supported currency, or null when the code is not supported. */
|
|
613
|
+
function getSupportedBillingCurrencyInfo(currency) {
|
|
614
|
+
const code = toSupportedBillingCurrency(currency);
|
|
615
|
+
return code ? SUPPORTED_BILLING_CURRENCY_INFO[code] : null;
|
|
616
|
+
}
|
|
646
617
|
const MAX_BILLING_AMOUNT = 1e9;
|
|
647
618
|
/** Case-insensitive, as in billing. Whitespace is not silently accepted. */
|
|
648
619
|
function isSupportedBillingCurrency(currency) {
|
|
@@ -705,12 +676,7 @@ function convertBillingToMinorUnits(amount, currency) {
|
|
|
705
676
|
function validateBillingMoney(amount, currency, options = {}) {
|
|
706
677
|
const validated = validateBillingAmount(amount, options);
|
|
707
678
|
if (!validated.valid) return validated;
|
|
708
|
-
|
|
709
|
-
valid: false,
|
|
710
|
-
code: "unsupported_currency"
|
|
711
|
-
};
|
|
712
|
-
const normalized = currency.toUpperCase();
|
|
713
|
-
const supported = SUPPORTED_BILLING_CURRENCIES.find((code) => code === normalized);
|
|
679
|
+
const supported = toSupportedBillingCurrency(currency);
|
|
714
680
|
if (!supported) return {
|
|
715
681
|
valid: false,
|
|
716
682
|
code: "unsupported_currency"
|
|
@@ -741,16 +707,19 @@ var validation_exports = /* @__PURE__ */ __exportAll({
|
|
|
741
707
|
RBAC_SCOPE_TYPES: () => RBAC_SCOPE_TYPES,
|
|
742
708
|
RbacCoverageError: () => RbacCoverageError,
|
|
743
709
|
SUPPORTED_BILLING_CURRENCIES: () => SUPPORTED_BILLING_CURRENCIES,
|
|
710
|
+
SUPPORTED_BILLING_CURRENCY_INFO: () => SUPPORTED_BILLING_CURRENCY_INFO,
|
|
744
711
|
USERNAME_MAX_LENGTH: () => 30,
|
|
745
712
|
USERNAME_MIN_LENGTH: () => 3,
|
|
746
713
|
analyzeRbacCoverage: () => analyzeRbacCoverage,
|
|
747
714
|
assertRbacCoverage: () => assertRbacCoverage,
|
|
748
715
|
convertBillingToMinorUnits: () => convertBillingToMinorUnits,
|
|
716
|
+
getSupportedBillingCurrencyInfo: () => getSupportedBillingCurrencyInfo,
|
|
749
717
|
isSupportedBillingCurrency: () => isSupportedBillingCurrency,
|
|
750
718
|
lengthInCodePoints: () => lengthInCodePoints,
|
|
751
719
|
loadRbacSchemaDocuments: () => loadRbacSchemaDocuments,
|
|
752
720
|
rbacArgPathProblem: () => rbacArgPathProblem,
|
|
753
721
|
readRbacDirectiveArgs: () => readRbacDirectiveArgs,
|
|
722
|
+
toSupportedBillingCurrency: () => toSupportedBillingCurrency,
|
|
754
723
|
validateBillingAmount: () => validateBillingAmount,
|
|
755
724
|
validateBillingMoney: () => validateBillingMoney,
|
|
756
725
|
validateName: () => validateName,
|
|
@@ -758,5 +727,5 @@ var validation_exports = /* @__PURE__ */ __exportAll({
|
|
|
758
727
|
validateUsername: () => validateUsername
|
|
759
728
|
});
|
|
760
729
|
|
|
761
|
-
export {
|
|
762
|
-
//# sourceMappingURL=validation-
|
|
730
|
+
export { USERNAME_MIN_LENGTH as C, lengthInCodePoints as D, NAME_MIN_LENGTH as E, validateName as O, USERNAME_MAX_LENGTH as S, NAME_MAX_LENGTH as T, assertRbacCoverage as _, convertBillingToMinorUnits as a, readRbacDirectiveArgs as b, toSupportedBillingCurrency as c, DEFAULT_MAX_RBAC_ARG_PATH_SEGMENTS as d, DEFAULT_RBAC_ROOT_TYPES as f, analyzeRbacCoverage as g, RbacCoverageError as h, SUPPORTED_BILLING_CURRENCY_INFO as i, validateBillingAmount as l, RBAC_SCOPE_TYPES as m, MAX_BILLING_AMOUNT as n, getSupportedBillingCurrencyInfo as o, RBAC_GATED_SCOPE_TYPES as p, SUPPORTED_BILLING_CURRENCIES as r, isSupportedBillingCurrency as s, validation_exports as t, validateBillingMoney as u, loadRbacSchemaDocuments as v, validateUsername as w, validateUserFields as x, rbacArgPathProblem as y };
|
|
731
|
+
//# sourceMappingURL=validation-bwJzOytZ.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation-CPUITdMk.js","names":[],"sources":["../src/validation/name.ts","../src/validation/username.ts","../src/validation/userFields.ts","../src/validation/rbac-coverage.ts","../src/validation/billing.ts","../src/validation/index.ts"],"sourcesContent":["/**\n * Validate a person's name (first or last).\n *\n * Mirrors `microfe-auth/src/auth/utils/validation.ts:validateName` from\n * the BOFF-7214 client-side PR (#59) so the server and the client apply\n * the same invariant. Do not edit one without editing the other — the\n * two must stay byte-identical or client-passes-but-server-rejects errors\n * will surface in production (BOFF-7261 acceptance criteria).\n *\n * Rules:\n * - 1–100 Unicode code points (NOT JavaScript `.length`, which counts\n * UTF-16 code units — see `lengthInCodePoints`).\n * - must contain at least one letter (`\\p{L}`)\n * - allowed characters: letters, marks, literal space, hyphen,\n * apostrophe, period, middle-dot (U+00B7, U+30FB), and zero-width\n * join controls (U+200C, U+200D)\n * - typographic apostrophes (U+2018 / U+2019 / U+02BC) and\n * typographic hyphens (U+2010 / U+2011) are folded to their ASCII\n * equivalents before storage\n * - NFC normalisation runs before trim/length so combining-mark\n * sequences (e.g. `e\\u0301` for `é`) fold to their precomposed form\n *\n * Accepts `string | undefined | null` because the GraphQL input types\n * declare these fields as optional. An absent value fails validation.\n *\n * On success the result carries the canonicalised `value` (NFC,\n * typographic apostrophes folded to ASCII, trimmed) so the caller can\n * persist the exact same string the validator approved — otherwise the\n * validated string and the value written to the database would diverge.\n *\n * Returns a structured result so the caller can map each error code to\n * a distinct i18n key.\n */\n\nexport type NameErrorCode = 'required' | 'too_long' | 'no_letter' | 'invalid_chars';\n\nexport type NameValidationResult =\n { valid: true; value: string } | { valid: false; code: NameErrorCode; message: string };\n\nexport const NAME_MIN_LENGTH = 1;\nexport const NAME_MAX_LENGTH = 100;\n\n/**\n * Allowed characters for a name. Every character must be a letter,\n * mark, literal space, hyphen, apostrophe, period, middle-dot, or join\n * control. Must contain at least one letter.\n *\n * Note: a literal space, not `\\s` — `\\s` matches tabs/newlines/other\n * Unicode whitespace which has no business being inside a person's name.\n *\n * Middle-dot codepoints U+00B7 and U+30FB are allowed as-is, NOT folded\n * to `.` — they're orthographically distinct and silently rewriting the\n * user's name would corrupt their identity.\n */\nconst NAME_ALLOWED_CHARS = /^[\\p{L}\\p{M} '.\\-\\u00B7\\u30FB\\u200C\\u200D]+$/u;\nconst TYPOGRAPHIC_APOSTROPHES = /[\\u2018\\u2019\\u02BC]/g;\nconst TYPOGRAPHIC_HYPHENS = /[\\u2010\\u2011]/g;\n\n/**\n * Count Unicode code points in `s` instead of UTF-16 code units. Names\n * written in scripts that live in the supplementary plane (Adlam 𞤁𞤔𞤣,\n * many CJK extensions, etc.) have each letter encoded as two UTF-16 units,\n * so a 51-letter Adlam name would otherwise be miscounted as 102 and\n * rejected as too long.\n *\n * Code-point counting is sufficient for the name validator — grapheme-\n * cluster counting would also handle emoji ZWJ sequences, but the name\n * regex already disallows emoji.\n */\nexport function lengthInCodePoints(s: string): number {\n return [...s].length;\n}\n\nexport function validateName(name: string | undefined | null): NameValidationResult {\n const trimmed = (name ?? '')\n .normalize('NFC')\n .replace(TYPOGRAPHIC_APOSTROPHES, \"'\")\n .replace(TYPOGRAPHIC_HYPHENS, '-')\n .trim();\n\n if (lengthInCodePoints(trimmed) < NAME_MIN_LENGTH) {\n return { valid: false, code: 'required', message: 'Name is required' };\n }\n\n if (lengthInCodePoints(trimmed) > NAME_MAX_LENGTH) {\n return {\n valid: false,\n code: 'too_long',\n message: `Name must be ${NAME_MAX_LENGTH} characters or fewer`,\n };\n }\n\n if (!NAME_ALLOWED_CHARS.test(trimmed) || !/\\p{L}/u.test(trimmed)) {\n if (!/\\p{L}/u.test(trimmed)) {\n return {\n valid: false,\n code: 'no_letter',\n message: 'Name must contain at least one letter',\n };\n }\n return {\n valid: false,\n code: 'invalid_chars',\n message: 'Name can only contain letters, spaces, periods, hyphens, and apostrophes',\n };\n }\n\n return { valid: true, value: trimmed };\n}\n","/**\n * Validate a username.\n *\n * Mirrors `microfe-auth/src/auth/utils/validation.ts:validateUsername`\n * from the BOFF-7214 client-side PR (#59). Do not edit one without\n * editing the other.\n *\n * Rules:\n * - 3–30 Unicode code points (NOT JavaScript `.length`)\n * - allow-list `[a-zA-Z0-9_-]`\n * - must contain at least one letter (so `12345` fails — this is the\n * specific BOFF-7214 invariant; a pure-numeric username used to\n * pass the character allow-list alone)\n * - surrounding whitespace is trimmed before validation so a pasted\n * `\" alice_01 \"` doesn't fail with a misleading \"invalid chars\"\n * error\n *\n * On success the result carries the trimmed `value` so the caller\n * persists the same string the validator approved.\n *\n * Returns a structured result with a list of errors so the caller can\n * render every failing rule at once.\n */\n\nimport { lengthInCodePoints } from './name.js';\n\nexport type UsernameErrorCode = 'required' | 'too_short' | 'too_long' | 'invalid_chars' | 'no_letter';\n\nexport type UsernameValidationResult =\n | { valid: true; value: string }\n | {\n valid: false;\n errors: Array<{ code: UsernameErrorCode; message: string }>;\n };\n\nexport const USERNAME_MIN_LENGTH = 3;\nexport const USERNAME_MAX_LENGTH = 30;\nconst USERNAME_ALLOWED_CHARS = /^[a-zA-Z0-9_-]+$/;\n\nexport function validateUsername(username: string | undefined | null): UsernameValidationResult {\n const errors: Array<{ code: UsernameErrorCode; message: string }> = [];\n const value = (username ?? '').trim();\n\n if (lengthInCodePoints(value) === 0) {\n errors.push({ code: 'required', message: 'Username is required' });\n return { valid: false, errors };\n }\n\n if (lengthInCodePoints(value) < USERNAME_MIN_LENGTH) {\n errors.push({\n code: 'too_short',\n message: `Username must be at least ${USERNAME_MIN_LENGTH} characters`,\n });\n }\n\n if (lengthInCodePoints(value) > USERNAME_MAX_LENGTH) {\n errors.push({\n code: 'too_long',\n message: `Username must be ${USERNAME_MAX_LENGTH} characters or fewer`,\n });\n }\n\n if (!USERNAME_ALLOWED_CHARS.test(value)) {\n errors.push({\n code: 'invalid_chars',\n message: 'Username can only contain letters, numbers, underscores, and hyphens',\n });\n }\n\n // Must contain at least one letter — guards against all-numeric or\n // all-symbol usernames slipping through. Pure numeric values like\n // \"12345\" previously passed the character allow-list alone. Only\n // check this when the length is in range so a too-short value doesn't\n // get two errors.\n if (\n lengthInCodePoints(value) >= USERNAME_MIN_LENGTH &&\n lengthInCodePoints(value) <= USERNAME_MAX_LENGTH &&\n !/[a-zA-Z]/.test(value)\n ) {\n errors.push({\n code: 'no_letter',\n message: 'Username must contain at least one letter',\n });\n }\n\n return errors.length === 0 ? { valid: true, value } : { valid: false, errors };\n}\n","/**\n * Bundle validation across all three user-identity fields.\n *\n * Mirrors `microfe-auth/src/auth/utils/validation.ts:validateUserFields`\n * from the BOFF-7214 client-side PR (#59). Do not edit one without\n * editing the other.\n *\n * Use this on the server in `signUp`, `updateCurrentUserProfile`, and\n * `updateUser` so the BOFF-7214 invariant — `firstName` / `lastName`\n * contain a letter, `username` contains a letter — holds at every\n * mutation surface, not just signup (BOFF-7261).\n *\n * `requireAll` controls how blank fields are treated:\n * - `true` (default): used by `signUp` — every field must validate.\n * An empty field fails with `code: \"required\"`.\n * - `false`: used by `updateCurrentUserProfile` / `updateUser` — an\n * existing user whose optional `firstName` / `lastName` is unset\n * (e.g. provisioned via an identity provider) can still update\n * unrelated fields like phone or role. Blank fields are skipped.\n *\n * On success, the result carries the canonicalised values from each\n * individual validator (NFC, typographic apostrophes folded to ASCII,\n * trimmed) so the caller writes the same strings the validators approved\n * — no validate/submit divergence.\n */\n\nimport { validateName } from './name.js';\nimport { validateUsername } from './username.js';\n\nexport type UserFieldKey = 'firstName' | 'lastName' | 'username';\n\nexport interface UserFieldError {\n field: UserFieldKey;\n code: string;\n message: string;\n}\n\nexport interface ValidatedUserFields {\n firstName: string;\n lastName: string;\n username: string;\n}\n\nexport type UserFieldsValidationResult =\n { valid: true; values: ValidatedUserFields } | { valid: false; errors: UserFieldError[] };\n\nexport function validateUserFields(\n input: {\n firstName?: string | null;\n lastName?: string | null;\n username?: string | null;\n },\n options: { requireAll?: boolean } = {}\n): UserFieldsValidationResult {\n const requireAll = options.requireAll ?? true;\n const errors: UserFieldError[] = [];\n\n const isBlank = (v: string | null | undefined): boolean => !v || v.trim().length === 0;\n\n const firstName = !isBlank(input.firstName) || requireAll ? validateName(input.firstName) : null;\n if (firstName && !firstName.valid) {\n errors.push({\n field: 'firstName',\n code: firstName.code,\n message: firstName.message,\n });\n }\n\n const lastName = !isBlank(input.lastName) || requireAll ? validateName(input.lastName) : null;\n if (lastName && !lastName.valid) {\n errors.push({\n field: 'lastName',\n code: lastName.code,\n message: lastName.message,\n });\n }\n\n const username = !isBlank(input.username) || requireAll ? validateUsername(input.username) : null;\n if (username && !username.valid) {\n for (const e of username.errors) {\n errors.push({ field: 'username', code: e.code, message: e.message });\n }\n }\n\n if (errors.length > 0) return { valid: false, errors };\n\n const valueOr = (result: { valid: true; value: string } | null, fallback: string | null | undefined): string =>\n result ? result.value : (fallback ?? '').trim();\n\n return {\n valid: true,\n values: {\n firstName: valueOr(firstName as { valid: true; value: string } | null, input.firstName),\n lastName: valueOr(lastName as { valid: true; value: string } | null, input.lastName),\n username: valueOr(username as { valid: true; value: string } | null, input.username),\n },\n };\n}\n","/**\n * Whole-schema `@rbac` coverage guard for subgraph services.\n *\n * Authorization on the platform is enforced at the API gateway, driven entirely by the\n * `@rbac` directive on each root-operation field (see\n * `~/products/dev/platform/context/identity/rbac/`). The gateway's rbac-middleware\n * fails CLOSED for HTTP Query/Mutation traffic, so a field without a usable `@rbac`\n * is denied for every caller (\"Field X is missing @rbac directive\"): an outage.\n * Subscriptions over the WebSocket transport are let through with only a warning,\n * so a missing `@rbac` there is a silent authorization hole.\n *\n * `assertRbacCoverage` is meant to be called from one unit test per svc. It parses\n * the svc's real SDL into a GraphQL AST (no regex) and checks, for every\n * Query/Mutation/Subscription field:\n *\n * 1. it carries an `@rbac` directive;\n * 2. the directive is well-formed the way the gateway reads it: `public: true`,\n * `scopeType: \"self\"`, an `actorTypes`-only gate, or `action` + `resource` +\n * a known `scopeType` (`entity` additionally needs `scopeArg`);\n * 3. `resourceIdArg` (and the `scopeArg` of `entity`/`billing` scopes) resolves to a\n * single ID/String through the field's arguments and input objects, at most two\n * segments deep — anything else silently degrades to a type-wide check or a deny;\n * 4. optionally, the set of `scopeType: \"self\"` fields equals a pinned, reviewed list,\n * because \"self\" is an authentication gate only and the resolver alone must scope\n * the data to the caller.\n *\n * Lifted from wspace-healthybowl-svc `src/__tests__/rbac-coverage.test.ts`\n * (BOFF-6052, BOFF-7476) so every svc runs one implementation.\n *\n * @example\n * ```ts\n * import { assertRbacCoverage } from '@burdenoff/be-sdk/validation';\n *\n * it('gates every root field with a well-formed @rbac', () => {\n * const report = assertRbacCoverage(join(__dirname, '../modules'), {\n * selfScopedFields: { myAgents: 'resolver filters by ctx.actorId' },\n * minRootFields: 200,\n * });\n * expect(report.rootFields.length).toBeGreaterThan(200);\n * });\n * ```\n */\nimport { readdirSync, readFileSync, statSync } from 'node:fs';\nimport { extname, join } from 'node:path';\nimport {\n Kind,\n parse,\n type DirectiveNode,\n type DocumentNode,\n type FieldDefinitionNode,\n type InputObjectTypeDefinitionNode,\n type InputObjectTypeExtensionNode,\n type InputValueDefinitionNode,\n type TypeNode,\n} from 'graphql';\n\n/** Scope types the gateway rbac-middleware understands for an action+resource check. */\nexport const RBAC_GATED_SCOPE_TYPES = ['wspace', 'global', 'entity', 'billing', 'organization'] as const;\n\n/** Every `scopeType` value the gateway accepts (the gated ones plus the `self` authentication gate). */\nexport const RBAC_SCOPE_TYPES = [...RBAC_GATED_SCOPE_TYPES, 'self'] as const;\n\nexport type RbacScopeType = (typeof RBAC_SCOPE_TYPES)[number];\n\n/** Default root operation types whose every field must be RBAC-gated. */\nexport const DEFAULT_RBAC_ROOT_TYPES = ['Query', 'Mutation', 'Subscription'] as const;\n\n/**\n * The most segments a `resourceIdArg`/`scopeArg` path can have and still resolve however\n * the client writes the request. The gateway's `extractFieldArguments` copies an inline\n * object argument one level deep and skips a nested object literal inside it, so\n * `input.nested.id` resolves only when `input` arrives as a variable.\n */\nexport const DEFAULT_MAX_RBAC_ARG_PATH_SEGMENTS = 2;\n\n/** The billing scope reads this argument when the directive sets no `scopeArg`. */\nconst DEFAULT_BILLING_SCOPE_ARG = 'billingAccountId';\n\nconst DEFAULT_ID_SCALARS = ['ID', 'String'] as const;\nconst SCHEMA_EXTENSIONS = new Set(['.gql', '.graphql']);\nconst SKIPPED_DIRECTORIES = new Set(['node_modules', 'dist', 'build', 'coverage']);\n\n/**\n * Placeholder root fields (`_empty`, `_emptyVibecontrols`, …) keep an otherwise-empty\n * root type valid SDL. They expose no data and need no gate.\n */\nconst PLACEHOLDER_FIELD = /^_empty[A-Za-z0-9]*$/;\n\n/** The `@rbac` arguments the gateway reads, as written in the SDL. */\nexport interface RbacDirectiveArgs {\n action?: string;\n resource?: string;\n resourceIdArg?: string;\n scopeType?: string;\n scopeArg?: string;\n public?: boolean;\n actorTypes?: string[];\n}\n\n/** One root-operation field found in the schema. */\nexport interface RbacRootField {\n /** Root type name, e.g. `Query`. */\n type: string;\n /** Field name, e.g. `myAgents`. */\n name: string;\n /** `Type.field`. */\n coordinate: string;\n /** Source file the field was parsed from, when the input came from disk. */\n file?: string;\n /** Parsed `@rbac` arguments, or `null` when the field has no `@rbac`. */\n rbac: RbacDirectiveArgs | null;\n}\n\n/** A pinned list of reviewed fields: field names or `Type.field` coordinates, optionally with the reason. */\nexport type RbacFieldPin = readonly string[] | Readonly<Record<string, string>>;\n\nexport interface RbacCoverageOptions {\n /** Root types to check. Defaults to Query/Mutation/Subscription plus any names a `schema { … }` block maps. */\n rootTypes?: readonly string[];\n /** Extra field names or `Type.field` coordinates to skip. `_empty*` placeholders are always skipped. */\n exemptFields?: readonly string[];\n /**\n * The reviewed set of `scopeType: \"self\"` fields. When given, every self-scoped field must\n * be listed and every entry must match a self-scoped field. Omit to skip the pin check.\n */\n selfScopedFields?: RbacFieldPin;\n /** Fail when fewer root fields than this are found (guards a wrong path \"passing\"). Default 1. */\n minRootFields?: number;\n /** Maximum `resourceIdArg`/`scopeArg` path segments. Default {@link DEFAULT_MAX_RBAC_ARG_PATH_SEGMENTS}. */\n maxArgPathSegments?: number;\n /** Scalars an id path may end on. Default `ID`, `String`. */\n idScalars?: readonly string[];\n}\n\n/** A schema loaded for analysis: the parsed document plus where it came from. */\nexport interface RbacSchemaDocument {\n document: DocumentNode;\n file?: string;\n}\n\nexport interface RbacCoverageReport {\n /** Every checked root field (placeholders and exemptions removed). */\n rootFields: RbacRootField[];\n /** `Type.field` of root fields without `@rbac`. */\n missing: string[];\n /** `Type.field: reason` for directives the gateway would deny as invalid. */\n malformed: string[];\n /** `Type.field: reason` for `resourceIdArg`/`scopeArg` paths that do not resolve to one id. */\n unresolvedArgPaths: string[];\n /** `Type.field` of self-scoped fields missing from `selfScopedFields`. */\n unreviewedSelfScoped: string[];\n /** Entries of `selfScopedFields` that match no self-scoped field. */\n staleSelfScoped: string[];\n /** Every problem above, one line each, plus a too-few-fields problem when applicable. */\n problems: string[];\n ok: boolean;\n}\n\n/** Thrown by {@link assertRbacCoverage}; carries the full report. */\nexport class RbacCoverageError extends Error {\n readonly report: RbacCoverageReport;\n\n constructor(report: RbacCoverageReport) {\n super(`RBAC coverage check failed (${report.problems.length} problem(s)):\\n - ${report.problems.join('\\n - ')}`);\n this.name = 'RbacCoverageError';\n this.report = report;\n }\n}\n\n/** Accepted inputs: schema file/directory paths, or already-parsed documents. */\nexport type RbacCoverageSource =\n string | readonly string[] | DocumentNode | readonly DocumentNode[] | readonly RbacSchemaDocument[];\n\nfunction collectSchemaFiles(path: string): string[] {\n if (!statSync(path).isDirectory()) return [path];\n const out: string[] = [];\n const entries = readdirSync(path, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name, 'en'));\n for (const entry of entries) {\n const full = join(path, entry.name);\n if (entry.isDirectory()) {\n if (!SKIPPED_DIRECTORIES.has(entry.name) && !entry.name.startsWith('.')) out.push(...collectSchemaFiles(full));\n } else if (SCHEMA_EXTENSIONS.has(extname(entry.name))) {\n out.push(full);\n }\n }\n return out;\n}\n\n/**\n * Parse every `.gql`/`.graphql` file under the given paths. A path may be a single SDL file\n * (e.g. `.hive-schema.graphql`) or a directory, which is walked recursively (skipping\n * dot-directories, `node_modules`, `dist`, `build` and `coverage`).\n */\nexport function loadRbacSchemaDocuments(paths: string | readonly string[]): RbacSchemaDocument[] {\n const files = (typeof paths === 'string' ? [paths] : paths).flatMap(collectSchemaFiles);\n return files.map((file) => {\n try {\n return { file, document: parse(readFileSync(file, 'utf8')) };\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n throw new Error(`Failed to parse GraphQL schema ${file}: ${message}`, { cause: error });\n }\n });\n}\n\nfunction isDocumentNode(value: unknown): value is DocumentNode {\n return typeof value === 'object' && value !== null && (value as { kind?: unknown }).kind === Kind.DOCUMENT;\n}\n\nfunction toSchemaDocuments(source: RbacCoverageSource): RbacSchemaDocument[] {\n if (typeof source === 'string') return loadRbacSchemaDocuments(source);\n if (isDocumentNode(source)) return [{ document: source }];\n const items: readonly unknown[] = source;\n if (items.every((item): item is string => typeof item === 'string')) return loadRbacSchemaDocuments(items);\n return items.map((item) => {\n if (isDocumentNode(item)) return { document: item };\n if (typeof item === 'object' && item !== null && isDocumentNode((item as RbacSchemaDocument).document)) {\n return item as RbacSchemaDocument;\n }\n throw new TypeError('RbacCoverageSource arrays must contain only paths, DocumentNodes or RbacSchemaDocuments');\n });\n}\n\nfunction rbacDirective(field: FieldDefinitionNode): DirectiveNode | undefined {\n return (field.directives ?? []).find((d) => d.name.value === 'rbac');\n}\n\n/** Read the `@rbac` arguments of a field definition the way the gateway does (literal values only). */\nexport function readRbacDirectiveArgs(field: FieldDefinitionNode): RbacDirectiveArgs | null {\n const directive = rbacDirective(field);\n if (!directive) return null;\n const args: RbacDirectiveArgs = {};\n for (const arg of directive.arguments ?? []) {\n const name = arg.name.value;\n const value = arg.value;\n if (name === 'public') {\n if (value.kind === Kind.BOOLEAN) args.public = value.value;\n } else if (name === 'actorTypes') {\n if (value.kind === Kind.LIST) {\n args.actorTypes = value.values.flatMap((v) => (v.kind === Kind.STRING ? [v.value] : []));\n } else if (value.kind === Kind.STRING) {\n args.actorTypes = [value.value];\n }\n } else if (\n value.kind === Kind.STRING &&\n (name === 'action' ||\n name === 'resource' ||\n name === 'resourceIdArg' ||\n name === 'scopeType' ||\n name === 'scopeArg')\n ) {\n args[name] = value.value;\n }\n }\n return args;\n}\n\nfunction rootTypeNames(docs: readonly RbacSchemaDocument[], configured?: readonly string[]): Set<string> {\n if (configured) return new Set(configured);\n const names = new Set<string>(DEFAULT_RBAC_ROOT_TYPES);\n for (const { document } of docs) {\n for (const def of document.definitions) {\n if (def.kind === Kind.SCHEMA_DEFINITION || def.kind === Kind.SCHEMA_EXTENSION) {\n for (const op of def.operationTypes ?? []) names.add(op.type.name.value);\n }\n }\n }\n return names;\n}\n\nfunction inputFieldsByType(docs: readonly RbacSchemaDocument[]): Map<string, InputValueDefinitionNode[]> {\n const out = new Map<string, InputValueDefinitionNode[]>();\n for (const { document } of docs) {\n for (const def of document.definitions) {\n if (def.kind === Kind.INPUT_OBJECT_TYPE_DEFINITION || def.kind === Kind.INPUT_OBJECT_TYPE_EXTENSION) {\n const input: InputObjectTypeDefinitionNode | InputObjectTypeExtensionNode = def;\n const existing = out.get(input.name.value) ?? [];\n existing.push(...(input.fields ?? []));\n out.set(input.name.value, existing);\n }\n }\n }\n return out;\n}\n\n/** The named type under any NonNull wrappers, or null when a List sits anywhere in between. */\nfunction unwrapSingular(type: TypeNode): string | null {\n if (type.kind === Kind.NON_NULL_TYPE) return unwrapSingular(type.type);\n if (type.kind === Kind.LIST_TYPE) return null;\n return type.name.value;\n}\n\ninterface PathContext {\n inputs: Map<string, InputValueDefinitionNode[]>;\n maxSegments: number;\n idScalars: ReadonlySet<string>;\n}\n\n/**\n * Mirrors the gateway's `extractFieldArguments` + `getValueAtPath`: the path is split on '.',\n * walked from the field's arguments through input objects, and used only when it lands on a\n * string. Returns why the path cannot resolve for every request shape, or null when it does.\n */\nexport function rbacArgPathProblem(\n field: FieldDefinitionNode,\n path: string,\n inputs: Map<string, readonly InputValueDefinitionNode[]>,\n options: { maxSegments?: number; idScalars?: readonly string[] } = {}\n): string | null {\n const maxSegments = options.maxSegments ?? DEFAULT_MAX_RBAC_ARG_PATH_SEGMENTS;\n const idScalars = new Set(options.idScalars ?? DEFAULT_ID_SCALARS);\n const segments = path.split('.');\n if (segments.some((s) => s.length === 0)) return `\"${path}\" has an empty segment`;\n if (segments.length > maxSegments) {\n return `\"${path}\" has ${segments.length} segments; the gateway reads at most ${maxSegments} (it drops nested object literals)`;\n }\n const [head, ...rest] = segments;\n const arg = (field.arguments ?? []).find((a) => a.name.value === head);\n if (!arg) return `no argument \"${head}\"`;\n let typeName = unwrapSingular(arg.type);\n let walked = head;\n for (const segment of rest) {\n if (typeName === null) return `\"${walked}\" is a list`;\n const fields = inputs.get(typeName);\n if (!fields) return `\"${walked}\" is ${typeName}, not an input object`;\n const next = fields.find((f) => f.name.value === segment);\n if (!next) return `${typeName} has no field \"${segment}\"`;\n typeName = unwrapSingular(next.type);\n walked = `${walked}.${segment}`;\n }\n if (typeName === null) return `\"${walked}\" is a list`;\n if (!idScalars.has(typeName)) return `\"${walked}\" is ${typeName}, not ${[...idScalars].join('/')}`;\n return null;\n}\n\n/** Why the gateway would deny this directive as invalid, or null when it is well-formed. */\nfunction malformedReason(rbac: RbacDirectiveArgs): string | null {\n if (rbac.public === true) return null;\n if (rbac.scopeType === 'self') return null;\n const hasActionResource = Boolean(rbac.action) && Boolean(rbac.resource);\n // An actorTypes-only gate is allowed by the gateway without an RBAC round-trip.\n if (!hasActionResource && rbac.actorTypes && rbac.actorTypes.length > 0) {\n if (rbac.action || rbac.resource) return 'actorTypes gate sets only one of action/resource';\n return null;\n }\n if (!hasActionResource) return 'missing action or resource (and not public, self or actorTypes-only)';\n if (!rbac.scopeType) return 'missing scopeType';\n if (!(RBAC_GATED_SCOPE_TYPES as readonly string[]).includes(rbac.scopeType)) {\n return `unknown scopeType \"${rbac.scopeType}\"`;\n }\n if (rbac.scopeType === 'entity' && !rbac.scopeArg) return 'entity scope requires scopeArg';\n return null;\n}\n\nfunction pinEntries(pin: RbacFieldPin): string[] {\n return Array.isArray(pin) ? [...(pin as readonly string[])] : Object.keys(pin);\n}\n\nfunction matchesEntry(field: RbacRootField, entry: string): boolean {\n return entry === field.name || entry === field.coordinate;\n}\n\n/** Deterministic, locale-independent ordering for report lines. */\nfunction sortLines(lines: string[]): string[] {\n return lines.sort((a, b) => a.localeCompare(b, 'en'));\n}\n\ninterface CollectedRootField {\n root: RbacRootField;\n definition: FieldDefinitionNode;\n}\n\nfunction collectRootFields(\n docs: readonly RbacSchemaDocument[],\n roots: ReadonlySet<string>,\n exempt: ReadonlySet<string>\n): CollectedRootField[] {\n const out: CollectedRootField[] = [];\n for (const { document, file } of docs) {\n for (const def of document.definitions) {\n if (def.kind !== Kind.OBJECT_TYPE_DEFINITION && def.kind !== Kind.OBJECT_TYPE_EXTENSION) continue;\n const type = def.name.value;\n if (!roots.has(type)) continue;\n for (const definition of def.fields ?? []) {\n const name = definition.name.value;\n const coordinate = `${type}.${name}`;\n if (PLACEHOLDER_FIELD.test(name) || exempt.has(name) || exempt.has(coordinate)) continue;\n const root: RbacRootField = { type, name, coordinate, rbac: readRbacDirectiveArgs(definition) };\n if (file) root.file = file;\n out.push({ root, definition });\n }\n }\n }\n return out;\n}\n\n/** The argument path a gated scope reads its scope id from; only `entity` and `billing` read one. */\nfunction scopeArgPath(rbac: RbacDirectiveArgs): string | undefined {\n if (rbac.public === true) return undefined;\n if (rbac.scopeType === 'entity') return rbac.scopeArg;\n if (rbac.scopeType === 'billing') return rbac.scopeArg ?? DEFAULT_BILLING_SCOPE_ARG;\n return undefined;\n}\n\nfunction argPathProblems(\n definition: FieldDefinitionNode,\n rbac: RbacDirectiveArgs,\n context: PathContext\n): { label: string; problem: string }[] {\n const options = { maxSegments: context.maxSegments, idScalars: [...context.idScalars] };\n const checks: { label: string; path: string | undefined }[] = [\n { label: 'resourceIdArg', path: rbac.resourceIdArg },\n { label: 'scopeArg', path: scopeArgPath(rbac) },\n ];\n return checks.flatMap(({ label, path }) => {\n if (path === undefined) return [];\n const problem = rbacArgPathProblem(definition, path, context.inputs, options);\n return problem ? [{ label, problem }] : [];\n });\n}\n\nfunction selfScopedPinProblems(\n rootFields: readonly RbacRootField[],\n pin: RbacFieldPin | undefined\n): { unreviewed: string[]; stale: string[] } {\n if (!pin) return { unreviewed: [], stale: [] };\n const entries = pinEntries(pin);\n const selfScoped = rootFields.filter((f) => f.rbac?.scopeType === 'self' && f.rbac.public !== true);\n return {\n unreviewed: selfScoped\n .filter((field) => !entries.some((entry) => matchesEntry(field, entry)))\n .map((field) => field.coordinate),\n stale: entries.filter((entry) => !selfScoped.some((field) => matchesEntry(field, entry))),\n };\n}\n\n/** Analyse the schema and return every coverage problem without throwing. */\nexport function analyzeRbacCoverage(source: RbacCoverageSource, options: RbacCoverageOptions = {}): RbacCoverageReport {\n const docs = toSchemaDocuments(source);\n const collected = collectRootFields(docs, rootTypeNames(docs, options.rootTypes), new Set(options.exemptFields));\n const pathContext: PathContext = {\n inputs: inputFieldsByType(docs),\n maxSegments: options.maxArgPathSegments ?? DEFAULT_MAX_RBAC_ARG_PATH_SEGMENTS,\n idScalars: new Set(options.idScalars ?? DEFAULT_ID_SCALARS),\n };\n\n const missing: string[] = [];\n const malformed: string[] = [];\n const unresolvedArgPaths: string[] = [];\n for (const { root, definition } of collected) {\n const { rbac, coordinate } = root;\n if (!rbac) {\n missing.push(coordinate);\n continue;\n }\n const reason = malformedReason(rbac);\n if (reason) malformed.push(`${coordinate}: ${reason}`);\n for (const { label, problem } of argPathProblems(definition, rbac, pathContext)) {\n unresolvedArgPaths.push(`${coordinate}: ${label} ${problem}`);\n }\n }\n\n const rootFields = collected.map(({ root }) => root);\n const pins = selfScopedPinProblems(rootFields, options.selfScopedFields);\n const unreviewedSelfScoped = sortLines(pins.unreviewed);\n const staleSelfScoped = sortLines(pins.stale);\n sortLines(missing);\n sortLines(malformed);\n sortLines(unresolvedArgPaths);\n\n const minRootFields = options.minRootFields ?? 1;\n const problems = [\n ...(rootFields.length < minRootFields\n ? [`found ${rootFields.length} root field(s), expected at least ${minRootFields} (wrong schema path?)`]\n : []),\n ...missing.map((c) => `${c}: missing @rbac directive`),\n ...malformed.map((m) => `malformed @rbac on ${m}`),\n ...unresolvedArgPaths.map((p) => `unresolvable @rbac path on ${p}`),\n ...unreviewedSelfScoped.map((c) => `${c}: scopeType \"self\" is not in the reviewed selfScopedFields list`),\n ...staleSelfScoped.map((e) => `selfScopedFields entry \"${e}\" matches no self-scoped root field (stale)`),\n ];\n\n return {\n rootFields,\n missing,\n malformed,\n unresolvedArgPaths,\n unreviewedSelfScoped,\n staleSelfScoped,\n problems,\n ok: problems.length === 0,\n };\n}\n\n/**\n * Assert full `@rbac` coverage. Throws {@link RbacCoverageError} listing every problem;\n * returns the report on success so callers can make further assertions on `rootFields`.\n */\nexport function assertRbacCoverage(source: RbacCoverageSource, options: RbacCoverageOptions = {}): RbacCoverageReport {\n const report = analyzeRbacCoverage(source, options);\n if (!report.ok) throw new RbacCoverageError(report);\n return report;\n}\n","/** Canonical billing policy extracted from global-billing input validation (BOFF-10764).\n * Currency support and the existing 1e9 ceiling are unchanged. This validates\n * major-unit values only; it does not round, convert FX or authorize payment.\n */\nexport const SUPPORTED_BILLING_CURRENCIES = Object.freeze([\n 'USD',\n 'EUR',\n 'GBP',\n 'INR',\n 'AUD',\n 'CAD',\n 'SGD',\n 'JPY',\n 'CNY',\n 'BRL',\n 'MXN',\n 'KRW',\n 'HKD',\n 'NOK',\n 'SEK',\n 'DKK',\n 'CHF',\n 'NZD',\n 'ZAR',\n 'AED',\n 'SAR',\n 'QAR',\n 'OMR',\n 'BHD',\n 'KWD',\n 'JOD',\n 'EGP',\n 'PKR',\n 'BDT',\n 'LKR',\n 'THB',\n 'MYR',\n 'IDR',\n 'PHP',\n 'VND',\n 'TWD',\n 'CZK',\n 'HUF',\n 'PLN',\n 'RON',\n 'RUB',\n 'TRY',\n 'ILS',\n 'NGN',\n 'GHS',\n 'KES',\n 'TZS',\n 'UGX',\n 'ETB',\n 'MAD',\n 'DZD',\n 'TND',\n 'BWP',\n 'MUR',\n 'MVR',\n 'BND',\n 'KHR',\n 'MMK',\n 'KZT',\n 'UZS',\n 'AZN',\n 'GEL',\n 'AMD',\n 'UAH',\n 'BGN',\n 'HRK',\n 'MKD',\n 'ALL',\n 'RSD',\n 'CLP',\n 'COP',\n 'PEN',\n 'ARS',\n 'BOB',\n 'PYG',\n 'UYU',\n 'GTQ',\n 'HNL',\n 'NIO',\n 'CRC',\n 'DOP',\n 'TTD',\n 'JMD',\n 'BBD',\n 'HTG',\n 'BZD',\n 'GYD',\n 'SRD',\n 'XCD',\n 'PAB',\n] as const);\nexport type SupportedBillingCurrency = (typeof SUPPORTED_BILLING_CURRENCIES)[number];\nconst supportedCurrencies: ReadonlySet<string> = new Set(SUPPORTED_BILLING_CURRENCIES);\nexport const MAX_BILLING_AMOUNT = 1_000_000_000;\n\n/** Case-insensitive, as in billing. Whitespace is not silently accepted. */\nexport function isSupportedBillingCurrency(currency: unknown): boolean {\n return typeof currency === 'string' && supportedCurrencies.has(currency.toUpperCase());\n}\n\nexport type BillingAmountErrorCode = 'not_finite' | 'not_positive' | 'negative' | 'exceeds_maximum';\nexport type BillingAmountValidationResult =\n { valid: true; value: number } | { valid: false; code: BillingAmountErrorCode };\n\n/** Zero is rejected by default. Callers may explicitly permit unpaid amounts. */\nexport function validateBillingAmount(\n amount: unknown,\n options: { allowZero?: boolean } = {}\n): BillingAmountValidationResult {\n if (typeof amount !== 'number' || !Number.isFinite(amount)) return { valid: false, code: 'not_finite' };\n if (options.allowZero === true ? amount < 0 : amount <= 0) {\n return { valid: false, code: options.allowZero === true ? 'negative' : 'not_positive' };\n }\n if (amount > MAX_BILLING_AMOUNT) return { valid: false, code: 'exceeds_maximum' };\n return { valid: true, value: amount };\n}\n\n/** Existing global billing provider-conversion policy, not an ISO currency registry.\n * Other legacy converter callers may use codes outside the supported billing set.\n */\nconst ZERO_DECIMAL_PROVIDER_CURRENCIES: ReadonlySet<string> = new Set([\n 'BIF',\n 'CLP',\n 'DJF',\n 'GNF',\n 'JPY',\n 'KMF',\n 'KRW',\n 'MGA',\n 'PYG',\n 'RWF',\n 'UGX',\n 'VND',\n 'VUV',\n 'XAF',\n 'XOF',\n 'XPF',\n]);\n\nfunction providerUnitScale(currency: string): number {\n return ZERO_DECIMAL_PROVIDER_CURRENCIES.has(currency.toUpperCase()) ? 1 : 100;\n}\n\n/** Preserve global billing's existing rounding conversion exactly. This does not\n * validate amount/currency or imply that a provider supports a particular code.\n * New financial terms should use validateBillingMoney before converting them.\n */\nexport function convertBillingToMinorUnits(amount: number, currency: string): number {\n return Math.round(amount * providerUnitScale(currency));\n}\n\nexport type BillingMoneyErrorCode = BillingAmountErrorCode | 'unsupported_currency' | 'minor_unit_precision';\nexport type BillingMoneyValidationResult =\n | { valid: true; value: { amount: number; currency: SupportedBillingCurrency; minorUnits: number } }\n | { valid: false; code: BillingMoneyErrorCode };\n\n/** Validate terms that must survive current provider conversion without rounding.\n * It deliberately does not tighten validateBillingAmount's legacy major-unit API.\n * No tolerance is used: accepting a changed amount would alter agreed terms.\n */\nexport function validateBillingMoney(\n amount: unknown,\n currency: unknown,\n options: { allowZero?: boolean } = {}\n): BillingMoneyValidationResult {\n const validated = validateBillingAmount(amount, options);\n if (!validated.valid) return validated;\n if (typeof currency !== 'string') return { valid: false, code: 'unsupported_currency' };\n const normalized = currency.toUpperCase();\n // Looking up the literal union supplies a typed canonical code without a cast.\n const supported = SUPPORTED_BILLING_CURRENCIES.find((code) => code === normalized);\n if (!supported) return { valid: false, code: 'unsupported_currency' };\n const minorUnits = convertBillingToMinorUnits(validated.value, supported);\n if (!Number.isSafeInteger(minorUnits) || minorUnits / providerUnitScale(supported) !== validated.value) {\n return { valid: false, code: 'minor_unit_precision' };\n }\n return { valid: true, value: { amount: validated.value, currency: supported, minorUnits } };\n}\n","/**\n * Shared server-side identity and billing input validators.\n * Identity invariants mirror microfe-auth (BOFF-7261); billing currency support\n * and finite amount bounds originate in global-billing (BOFF-10764).\n */\n\nexport { validateName, lengthInCodePoints, NAME_MIN_LENGTH, NAME_MAX_LENGTH } from './name.js';\nexport type { NameErrorCode, NameValidationResult } from './name.js';\n\nexport { validateUsername, USERNAME_MIN_LENGTH, USERNAME_MAX_LENGTH } from './username.js';\nexport type { UsernameErrorCode, UsernameValidationResult } from './username.js';\n\nexport { validateUserFields } from './userFields.js';\nexport type { UserFieldKey, UserFieldError, ValidatedUserFields, UserFieldsValidationResult } from './userFields.js';\n\nexport {\n assertRbacCoverage,\n analyzeRbacCoverage,\n loadRbacSchemaDocuments,\n readRbacDirectiveArgs,\n rbacArgPathProblem,\n RbacCoverageError,\n RBAC_SCOPE_TYPES,\n RBAC_GATED_SCOPE_TYPES,\n DEFAULT_RBAC_ROOT_TYPES,\n DEFAULT_MAX_RBAC_ARG_PATH_SEGMENTS,\n} from './rbac-coverage.js';\nexport type {\n RbacCoverageOptions,\n RbacCoverageReport,\n RbacCoverageSource,\n RbacDirectiveArgs,\n RbacFieldPin,\n RbacRootField,\n RbacSchemaDocument,\n RbacScopeType,\n} from './rbac-coverage.js';\n\nexport {\n SUPPORTED_BILLING_CURRENCIES,\n MAX_BILLING_AMOUNT,\n isSupportedBillingCurrency,\n validateBillingAmount,\n convertBillingToMinorUnits,\n validateBillingMoney,\n} from './billing.js';\nexport type {\n SupportedBillingCurrency,\n BillingAmountErrorCode,\n BillingAmountValidationResult,\n BillingMoneyErrorCode,\n BillingMoneyValidationResult,\n} from './billing.js';\n"],"mappings":";;;;;;AAuCA,MAAa,kBAAkB;AAC/B,MAAa,kBAAkB;;;;;;;;;;;;;AAc/B,MAAM,qBAAqB;AAC3B,MAAM,0BAA0B;AAChC,MAAM,sBAAsB;;;;;;;;;;;;AAa5B,SAAgB,mBAAmB,GAAmB;CACpD,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;AAChB;AAEA,SAAgB,aAAa,MAAuD;CAClF,MAAM,WAAW,QAAQ,GAAE,CACxB,UAAU,KAAK,CAAC,CAChB,QAAQ,yBAAyB,GAAG,CAAC,CACrC,QAAQ,qBAAqB,GAAG,CAAC,CACjC,KAAK;CAER,IAAI,mBAAmB,OAAO,OAC5B,OAAO;EAAE,OAAO;EAAO,MAAM;EAAY,SAAS;CAAmB;CAGvE,IAAI,mBAAmB,OAAO,SAC5B,OAAO;EACL,OAAO;EACP,MAAM;EACN,SAAS,oBAAgC;CAC3C;CAGF,IAAI,CAAC,mBAAmB,K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AAO;CAClD,IAAI,CAAC,OAAO,IAAI,MAAM,IAAI,kBAAkB,MAAM;CAClD,OAAO;AACT;;;;;;;AClfA,MAAa,+BAA+B,OAAO,OAAO;CACxD;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAU;AAEV,MAAM,sBAA2C,IAAI,IAAI,4BAA4B;AACrF,MAAa,qBAAqB;;AAGlC,SAAgB,2BAA2B,UAA4B;CACrE,OAAO,OAAO,aAAa,YAAY,oBAAoB,IAAI,SAAS,YAAY,CAAC;AACvF;;AAOA,SAAgB,sBACd,QACA,UAAmC,CAAC,GACL;CAC/B,IAAI,OAAO,WAAW,YAAY,CAAC,OAAO,SAAS,MAAM,GAAG,OAAO;EAAE,OAAO;EAAO,MAAM;CAAa;CACtG,IAAI,QAAQ,cAAc,OAAO,SAAS,IAAI,UAAU,GACtD,OAAO;EAAE,OAAO;EAAO,MAAM,QAAQ,cAAc,OAAO,aAAa;CAAe;CAExF,IAAI,cAA6B,OAAO;EAAE,OAAO;EAAO,MAAM;CAAkB;CAChF,OAAO;EAAE,OAAO;EAAM,OAAO;CAAO;AACtC;;;;AAKA,MAAM,mDAAwD,IAAI,IAAI;CACpE;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAED,SAAS,kBAAkB,UAA0B;CACnD,OAAO,iCAAiC,IAAI,SAAS,YAAY,CAAC,IAAI,IAAI;AAC5E;;;;;AAMA,SAAgB,2BAA2B,QAAgB,UAA0B;CACnF,OAAO,KAAK,MAAM,SAAS,kBAAkB,QAAQ,CAAC;AACxD;;;;;AAWA,SAAgB,qBACd,QACA,UACA,UAAmC,CAAC,GACN;CAC9B,MAAM,YAAY,sBAAsB,QAAQ,OAAO;CACvD,IAAI,CAAC,UAAU,OAAO,OAAO;CAC7B,IAAI,OAAO,aAAa,UAAU,OAAO;EAAE,OAAO;EAAO,MAAM;CAAuB;CACtF,MAAM,aAAa,SAAS,YAAY;CAExC,MAAM,YAAY,6BAA6B,MAAM,SAAS,SAAS,UAAU;CACjF,IAAI,CAAC,WAAW,OAAO;EAAE,OAAO;EAAO,MAAM;CAAuB;CACpE,MAAM,aAAa,2BAA2B,UAAU,OAAO,SAAS;CACxE,IAAI,CAAC,OAAO,cAAc,UAAU,KAAK,aAAa,kBAAkB,SAAS,MAAM,UAAU,OAC/F,OAAO;EAAE,OAAO;EAAO,MAAM;CAAuB;CAEtD,OAAO;EAAE,OAAO;EAAM,OAAO;GAAE,QAAQ,UAAU;GAAO,UAAU;GAAW;EAAW;CAAE;AAC5F"}
|
|
1
|
+
{"version":3,"file":"validation-bwJzOytZ.js","names":[],"sources":["../src/validation/name.ts","../src/validation/username.ts","../src/validation/userFields.ts","../src/validation/rbac-coverage.ts","../src/validation/billing.ts","../src/validation/index.ts"],"sourcesContent":["/**\n * Validate a person's name (first or last).\n *\n * Mirrors `microfe-auth/src/auth/utils/validation.ts:validateName` from\n * the BOFF-7214 client-side PR (#59) so the server and the client apply\n * the same invariant. Do not edit one without editing the other — the\n * two must stay byte-identical or client-passes-but-server-rejects errors\n * will surface in production (BOFF-7261 acceptance criteria).\n *\n * Rules:\n * - 1–100 Unicode code points (NOT JavaScript `.length`, which counts\n * UTF-16 code units — see `lengthInCodePoints`).\n * - must contain at least one letter (`\\p{L}`)\n * - allowed characters: letters, marks, literal space, hyphen,\n * apostrophe, period, middle-dot (U+00B7, U+30FB), and zero-width\n * join controls (U+200C, U+200D)\n * - typographic apostrophes (U+2018 / U+2019 / U+02BC) and\n * typographic hyphens (U+2010 / U+2011) are folded to their ASCII\n * equivalents before storage\n * - NFC normalisation runs before trim/length so combining-mark\n * sequences (e.g. `e\\u0301` for `é`) fold to their precomposed form\n *\n * Accepts `string | undefined | null` because the GraphQL input types\n * declare these fields as optional. An absent value fails validation.\n *\n * On success the result carries the canonicalised `value` (NFC,\n * typographic apostrophes folded to ASCII, trimmed) so the caller can\n * persist the exact same string the validator approved — otherwise the\n * validated string and the value written to the database would diverge.\n *\n * Returns a structured result so the caller can map each error code to\n * a distinct i18n key.\n */\n\nexport type NameErrorCode = 'required' | 'too_long' | 'no_letter' | 'invalid_chars';\n\nexport type NameValidationResult =\n { valid: true; value: string } | { valid: false; code: NameErrorCode; message: string };\n\nexport const NAME_MIN_LENGTH = 1;\nexport const NAME_MAX_LENGTH = 100;\n\n/**\n * Allowed characters for a name. Every character must be a letter,\n * mark, literal space, hyphen, apostrophe, period, middle-dot, or join\n * control. Must contain at least one letter.\n *\n * Note: a literal space, not `\\s` — `\\s` matches tabs/newlines/other\n * Unicode whitespace which has no business being inside a person's name.\n *\n * Middle-dot codepoints U+00B7 and U+30FB are allowed as-is, NOT folded\n * to `.` — they're orthographically distinct and silently rewriting the\n * user's name would corrupt their identity.\n */\nconst NAME_ALLOWED_CHARS = /^[\\p{L}\\p{M} '.\\-\\u00B7\\u30FB\\u200C\\u200D]+$/u;\nconst TYPOGRAPHIC_APOSTROPHES = /[\\u2018\\u2019\\u02BC]/g;\nconst TYPOGRAPHIC_HYPHENS = /[\\u2010\\u2011]/g;\n\n/**\n * Count Unicode code points in `s` instead of UTF-16 code units. Names\n * written in scripts that live in the supplementary plane (Adlam 𞤁𞤔𞤣,\n * many CJK extensions, etc.) have each letter encoded as two UTF-16 units,\n * so a 51-letter Adlam name would otherwise be miscounted as 102 and\n * rejected as too long.\n *\n * Code-point counting is sufficient for the name validator — grapheme-\n * cluster counting would also handle emoji ZWJ sequences, but the name\n * regex already disallows emoji.\n */\nexport function lengthInCodePoints(s: string): number {\n return [...s].length;\n}\n\nexport function validateName(name: string | undefined | null): NameValidationResult {\n const trimmed = (name ?? '')\n .normalize('NFC')\n .replace(TYPOGRAPHIC_APOSTROPHES, \"'\")\n .replace(TYPOGRAPHIC_HYPHENS, '-')\n .trim();\n\n if (lengthInCodePoints(trimmed) < NAME_MIN_LENGTH) {\n return { valid: false, code: 'required', message: 'Name is required' };\n }\n\n if (lengthInCodePoints(trimmed) > NAME_MAX_LENGTH) {\n return {\n valid: false,\n code: 'too_long',\n message: `Name must be ${NAME_MAX_LENGTH} characters or fewer`,\n };\n }\n\n if (!NAME_ALLOWED_CHARS.test(trimmed) || !/\\p{L}/u.test(trimmed)) {\n if (!/\\p{L}/u.test(trimmed)) {\n return {\n valid: false,\n code: 'no_letter',\n message: 'Name must contain at least one letter',\n };\n }\n return {\n valid: false,\n code: 'invalid_chars',\n message: 'Name can only contain letters, spaces, periods, hyphens, and apostrophes',\n };\n }\n\n return { valid: true, value: trimmed };\n}\n","/**\n * Validate a username.\n *\n * Mirrors `microfe-auth/src/auth/utils/validation.ts:validateUsername`\n * from the BOFF-7214 client-side PR (#59). Do not edit one without\n * editing the other.\n *\n * Rules:\n * - 3–30 Unicode code points (NOT JavaScript `.length`)\n * - allow-list `[a-zA-Z0-9_-]`\n * - must contain at least one letter (so `12345` fails — this is the\n * specific BOFF-7214 invariant; a pure-numeric username used to\n * pass the character allow-list alone)\n * - surrounding whitespace is trimmed before validation so a pasted\n * `\" alice_01 \"` doesn't fail with a misleading \"invalid chars\"\n * error\n *\n * On success the result carries the trimmed `value` so the caller\n * persists the same string the validator approved.\n *\n * Returns a structured result with a list of errors so the caller can\n * render every failing rule at once.\n */\n\nimport { lengthInCodePoints } from './name.js';\n\nexport type UsernameErrorCode = 'required' | 'too_short' | 'too_long' | 'invalid_chars' | 'no_letter';\n\nexport type UsernameValidationResult =\n | { valid: true; value: string }\n | {\n valid: false;\n errors: Array<{ code: UsernameErrorCode; message: string }>;\n };\n\nexport const USERNAME_MIN_LENGTH = 3;\nexport const USERNAME_MAX_LENGTH = 30;\nconst USERNAME_ALLOWED_CHARS = /^[a-zA-Z0-9_-]+$/;\n\nexport function validateUsername(username: string | undefined | null): UsernameValidationResult {\n const errors: Array<{ code: UsernameErrorCode; message: string }> = [];\n const value = (username ?? '').trim();\n\n if (lengthInCodePoints(value) === 0) {\n errors.push({ code: 'required', message: 'Username is required' });\n return { valid: false, errors };\n }\n\n if (lengthInCodePoints(value) < USERNAME_MIN_LENGTH) {\n errors.push({\n code: 'too_short',\n message: `Username must be at least ${USERNAME_MIN_LENGTH} characters`,\n });\n }\n\n if (lengthInCodePoints(value) > USERNAME_MAX_LENGTH) {\n errors.push({\n code: 'too_long',\n message: `Username must be ${USERNAME_MAX_LENGTH} characters or fewer`,\n });\n }\n\n if (!USERNAME_ALLOWED_CHARS.test(value)) {\n errors.push({\n code: 'invalid_chars',\n message: 'Username can only contain letters, numbers, underscores, and hyphens',\n });\n }\n\n // Must contain at least one letter — guards against all-numeric or\n // all-symbol usernames slipping through. Pure numeric values like\n // \"12345\" previously passed the character allow-list alone. Only\n // check this when the length is in range so a too-short value doesn't\n // get two errors.\n if (\n lengthInCodePoints(value) >= USERNAME_MIN_LENGTH &&\n lengthInCodePoints(value) <= USERNAME_MAX_LENGTH &&\n !/[a-zA-Z]/.test(value)\n ) {\n errors.push({\n code: 'no_letter',\n message: 'Username must contain at least one letter',\n });\n }\n\n return errors.length === 0 ? { valid: true, value } : { valid: false, errors };\n}\n","/**\n * Bundle validation across all three user-identity fields.\n *\n * Mirrors `microfe-auth/src/auth/utils/validation.ts:validateUserFields`\n * from the BOFF-7214 client-side PR (#59). Do not edit one without\n * editing the other.\n *\n * Use this on the server in `signUp`, `updateCurrentUserProfile`, and\n * `updateUser` so the BOFF-7214 invariant — `firstName` / `lastName`\n * contain a letter, `username` contains a letter — holds at every\n * mutation surface, not just signup (BOFF-7261).\n *\n * `requireAll` controls how blank fields are treated:\n * - `true` (default): used by `signUp` — every field must validate.\n * An empty field fails with `code: \"required\"`.\n * - `false`: used by `updateCurrentUserProfile` / `updateUser` — an\n * existing user whose optional `firstName` / `lastName` is unset\n * (e.g. provisioned via an identity provider) can still update\n * unrelated fields like phone or role. Blank fields are skipped.\n *\n * On success, the result carries the canonicalised values from each\n * individual validator (NFC, typographic apostrophes folded to ASCII,\n * trimmed) so the caller writes the same strings the validators approved\n * — no validate/submit divergence.\n */\n\nimport { validateName } from './name.js';\nimport { validateUsername } from './username.js';\n\nexport type UserFieldKey = 'firstName' | 'lastName' | 'username';\n\nexport interface UserFieldError {\n field: UserFieldKey;\n code: string;\n message: string;\n}\n\nexport interface ValidatedUserFields {\n firstName: string;\n lastName: string;\n username: string;\n}\n\nexport type UserFieldsValidationResult =\n { valid: true; values: ValidatedUserFields } | { valid: false; errors: UserFieldError[] };\n\nexport function validateUserFields(\n input: {\n firstName?: string | null;\n lastName?: string | null;\n username?: string | null;\n },\n options: { requireAll?: boolean } = {}\n): UserFieldsValidationResult {\n const requireAll = options.requireAll ?? true;\n const errors: UserFieldError[] = [];\n\n const isBlank = (v: string | null | undefined): boolean => !v || v.trim().length === 0;\n\n const firstName = !isBlank(input.firstName) || requireAll ? validateName(input.firstName) : null;\n if (firstName && !firstName.valid) {\n errors.push({\n field: 'firstName',\n code: firstName.code,\n message: firstName.message,\n });\n }\n\n const lastName = !isBlank(input.lastName) || requireAll ? validateName(input.lastName) : null;\n if (lastName && !lastName.valid) {\n errors.push({\n field: 'lastName',\n code: lastName.code,\n message: lastName.message,\n });\n }\n\n const username = !isBlank(input.username) || requireAll ? validateUsername(input.username) : null;\n if (username && !username.valid) {\n for (const e of username.errors) {\n errors.push({ field: 'username', code: e.code, message: e.message });\n }\n }\n\n if (errors.length > 0) return { valid: false, errors };\n\n const valueOr = (result: { valid: true; value: string } | null, fallback: string | null | undefined): string =>\n result ? result.value : (fallback ?? '').trim();\n\n return {\n valid: true,\n values: {\n firstName: valueOr(firstName as { valid: true; value: string } | null, input.firstName),\n lastName: valueOr(lastName as { valid: true; value: string } | null, input.lastName),\n username: valueOr(username as { valid: true; value: string } | null, input.username),\n },\n };\n}\n","/**\n * Whole-schema `@rbac` coverage guard for subgraph services.\n *\n * Authorization on the platform is enforced at the API gateway, driven entirely by the\n * `@rbac` directive on each root-operation field (see\n * `~/products/dev/platform/context/identity/rbac/`). The gateway's rbac-middleware\n * fails CLOSED for HTTP Query/Mutation traffic, so a field without a usable `@rbac`\n * is denied for every caller (\"Field X is missing @rbac directive\"): an outage.\n * Subscriptions over the WebSocket transport are let through with only a warning,\n * so a missing `@rbac` there is a silent authorization hole.\n *\n * `assertRbacCoverage` is meant to be called from one unit test per svc. It parses\n * the svc's real SDL into a GraphQL AST (no regex) and checks, for every\n * Query/Mutation/Subscription field:\n *\n * 1. it carries an `@rbac` directive;\n * 2. the directive is well-formed the way the gateway reads it: `public: true`,\n * `scopeType: \"self\"`, an `actorTypes`-only gate, or `action` + `resource` +\n * a known `scopeType` (`entity` additionally needs `scopeArg`);\n * 3. `resourceIdArg` (and the `scopeArg` of `entity`/`billing` scopes) resolves to a\n * single ID/String through the field's arguments and input objects, at most two\n * segments deep — anything else silently degrades to a type-wide check or a deny;\n * 4. optionally, the set of `scopeType: \"self\"` fields equals a pinned, reviewed list,\n * because \"self\" is an authentication gate only and the resolver alone must scope\n * the data to the caller.\n *\n * Lifted from wspace-healthybowl-svc `src/__tests__/rbac-coverage.test.ts`\n * (BOFF-6052, BOFF-7476) so every svc runs one implementation.\n *\n * @example\n * ```ts\n * import { assertRbacCoverage } from '@burdenoff/be-sdk/validation';\n *\n * it('gates every root field with a well-formed @rbac', () => {\n * const report = assertRbacCoverage(join(__dirname, '../modules'), {\n * selfScopedFields: { myAgents: 'resolver filters by ctx.actorId' },\n * minRootFields: 200,\n * });\n * expect(report.rootFields.length).toBeGreaterThan(200);\n * });\n * ```\n */\nimport { readdirSync, readFileSync, statSync } from 'node:fs';\nimport { extname, join } from 'node:path';\nimport {\n Kind,\n parse,\n type DirectiveNode,\n type DocumentNode,\n type FieldDefinitionNode,\n type InputObjectTypeDefinitionNode,\n type InputObjectTypeExtensionNode,\n type InputValueDefinitionNode,\n type TypeNode,\n} from 'graphql';\n\n/** Scope types the gateway rbac-middleware understands for an action+resource check. */\nexport const RBAC_GATED_SCOPE_TYPES = ['wspace', 'global', 'entity', 'billing', 'organization'] as const;\n\n/** Every `scopeType` value the gateway accepts (the gated ones plus the `self` authentication gate). */\nexport const RBAC_SCOPE_TYPES = [...RBAC_GATED_SCOPE_TYPES, 'self'] as const;\n\nexport type RbacScopeType = (typeof RBAC_SCOPE_TYPES)[number];\n\n/** Default root operation types whose every field must be RBAC-gated. */\nexport const DEFAULT_RBAC_ROOT_TYPES = ['Query', 'Mutation', 'Subscription'] as const;\n\n/**\n * The most segments a `resourceIdArg`/`scopeArg` path can have and still resolve however\n * the client writes the request. The gateway's `extractFieldArguments` copies an inline\n * object argument one level deep and skips a nested object literal inside it, so\n * `input.nested.id` resolves only when `input` arrives as a variable.\n */\nexport const DEFAULT_MAX_RBAC_ARG_PATH_SEGMENTS = 2;\n\n/** The billing scope reads this argument when the directive sets no `scopeArg`. */\nconst DEFAULT_BILLING_SCOPE_ARG = 'billingAccountId';\n\nconst DEFAULT_ID_SCALARS = ['ID', 'String'] as const;\nconst SCHEMA_EXTENSIONS = new Set(['.gql', '.graphql']);\nconst SKIPPED_DIRECTORIES = new Set(['node_modules', 'dist', 'build', 'coverage']);\n\n/**\n * Placeholder root fields (`_empty`, `_emptyVibecontrols`, …) keep an otherwise-empty\n * root type valid SDL. They expose no data and need no gate.\n */\nconst PLACEHOLDER_FIELD = /^_empty[A-Za-z0-9]*$/;\n\n/** The `@rbac` arguments the gateway reads, as written in the SDL. */\nexport interface RbacDirectiveArgs {\n action?: string;\n resource?: string;\n resourceIdArg?: string;\n scopeType?: string;\n scopeArg?: string;\n public?: boolean;\n actorTypes?: string[];\n}\n\n/** One root-operation field found in the schema. */\nexport interface RbacRootField {\n /** Root type name, e.g. `Query`. */\n type: string;\n /** Field name, e.g. `myAgents`. */\n name: string;\n /** `Type.field`. */\n coordinate: string;\n /** Source file the field was parsed from, when the input came from disk. */\n file?: string;\n /** Parsed `@rbac` arguments, or `null` when the field has no `@rbac`. */\n rbac: RbacDirectiveArgs | null;\n}\n\n/** A pinned list of reviewed fields: field names or `Type.field` coordinates, optionally with the reason. */\nexport type RbacFieldPin = readonly string[] | Readonly<Record<string, string>>;\n\nexport interface RbacCoverageOptions {\n /** Root types to check. Defaults to Query/Mutation/Subscription plus any names a `schema { … }` block maps. */\n rootTypes?: readonly string[];\n /** Extra field names or `Type.field` coordinates to skip. `_empty*` placeholders are always skipped. */\n exemptFields?: readonly string[];\n /**\n * The reviewed set of `scopeType: \"self\"` fields. When given, every self-scoped field must\n * be listed and every entry must match a self-scoped field. Omit to skip the pin check.\n */\n selfScopedFields?: RbacFieldPin;\n /** Fail when fewer root fields than this are found (guards a wrong path \"passing\"). Default 1. */\n minRootFields?: number;\n /** Maximum `resourceIdArg`/`scopeArg` path segments. Default {@link DEFAULT_MAX_RBAC_ARG_PATH_SEGMENTS}. */\n maxArgPathSegments?: number;\n /** Scalars an id path may end on. Default `ID`, `String`. */\n idScalars?: readonly string[];\n}\n\n/** A schema loaded for analysis: the parsed document plus where it came from. */\nexport interface RbacSchemaDocument {\n document: DocumentNode;\n file?: string;\n}\n\nexport interface RbacCoverageReport {\n /** Every checked root field (placeholders and exemptions removed). */\n rootFields: RbacRootField[];\n /** `Type.field` of root fields without `@rbac`. */\n missing: string[];\n /** `Type.field: reason` for directives the gateway would deny as invalid. */\n malformed: string[];\n /** `Type.field: reason` for `resourceIdArg`/`scopeArg` paths that do not resolve to one id. */\n unresolvedArgPaths: string[];\n /** `Type.field` of self-scoped fields missing from `selfScopedFields`. */\n unreviewedSelfScoped: string[];\n /** Entries of `selfScopedFields` that match no self-scoped field. */\n staleSelfScoped: string[];\n /** Every problem above, one line each, plus a too-few-fields problem when applicable. */\n problems: string[];\n ok: boolean;\n}\n\n/** Thrown by {@link assertRbacCoverage}; carries the full report. */\nexport class RbacCoverageError extends Error {\n readonly report: RbacCoverageReport;\n\n constructor(report: RbacCoverageReport) {\n super(`RBAC coverage check failed (${report.problems.length} problem(s)):\\n - ${report.problems.join('\\n - ')}`);\n this.name = 'RbacCoverageError';\n this.report = report;\n }\n}\n\n/** Accepted inputs: schema file/directory paths, or already-parsed documents. */\nexport type RbacCoverageSource =\n string | readonly string[] | DocumentNode | readonly DocumentNode[] | readonly RbacSchemaDocument[];\n\nfunction collectSchemaFiles(path: string): string[] {\n if (!statSync(path).isDirectory()) return [path];\n const out: string[] = [];\n const entries = readdirSync(path, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name, 'en'));\n for (const entry of entries) {\n const full = join(path, entry.name);\n if (entry.isDirectory()) {\n if (!SKIPPED_DIRECTORIES.has(entry.name) && !entry.name.startsWith('.')) out.push(...collectSchemaFiles(full));\n } else if (SCHEMA_EXTENSIONS.has(extname(entry.name))) {\n out.push(full);\n }\n }\n return out;\n}\n\n/**\n * Parse every `.gql`/`.graphql` file under the given paths. A path may be a single SDL file\n * (e.g. `.hive-schema.graphql`) or a directory, which is walked recursively (skipping\n * dot-directories, `node_modules`, `dist`, `build` and `coverage`).\n */\nexport function loadRbacSchemaDocuments(paths: string | readonly string[]): RbacSchemaDocument[] {\n const files = (typeof paths === 'string' ? [paths] : paths).flatMap(collectSchemaFiles);\n return files.map((file) => {\n try {\n return { file, document: parse(readFileSync(file, 'utf8')) };\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n throw new Error(`Failed to parse GraphQL schema ${file}: ${message}`, { cause: error });\n }\n });\n}\n\nfunction isDocumentNode(value: unknown): value is DocumentNode {\n return typeof value === 'object' && value !== null && (value as { kind?: unknown }).kind === Kind.DOCUMENT;\n}\n\nfunction toSchemaDocuments(source: RbacCoverageSource): RbacSchemaDocument[] {\n if (typeof source === 'string') return loadRbacSchemaDocuments(source);\n if (isDocumentNode(source)) return [{ document: source }];\n const items: readonly unknown[] = source;\n if (items.every((item): item is string => typeof item === 'string')) return loadRbacSchemaDocuments(items);\n return items.map((item) => {\n if (isDocumentNode(item)) return { document: item };\n if (typeof item === 'object' && item !== null && isDocumentNode((item as RbacSchemaDocument).document)) {\n return item as RbacSchemaDocument;\n }\n throw new TypeError('RbacCoverageSource arrays must contain only paths, DocumentNodes or RbacSchemaDocuments');\n });\n}\n\nfunction rbacDirective(field: FieldDefinitionNode): DirectiveNode | undefined {\n return (field.directives ?? []).find((d) => d.name.value === 'rbac');\n}\n\n/** Read the `@rbac` arguments of a field definition the way the gateway does (literal values only). */\nexport function readRbacDirectiveArgs(field: FieldDefinitionNode): RbacDirectiveArgs | null {\n const directive = rbacDirective(field);\n if (!directive) return null;\n const args: RbacDirectiveArgs = {};\n for (const arg of directive.arguments ?? []) {\n const name = arg.name.value;\n const value = arg.value;\n if (name === 'public') {\n if (value.kind === Kind.BOOLEAN) args.public = value.value;\n } else if (name === 'actorTypes') {\n if (value.kind === Kind.LIST) {\n args.actorTypes = value.values.flatMap((v) => (v.kind === Kind.STRING ? [v.value] : []));\n } else if (value.kind === Kind.STRING) {\n args.actorTypes = [value.value];\n }\n } else if (\n value.kind === Kind.STRING &&\n (name === 'action' ||\n name === 'resource' ||\n name === 'resourceIdArg' ||\n name === 'scopeType' ||\n name === 'scopeArg')\n ) {\n args[name] = value.value;\n }\n }\n return args;\n}\n\nfunction rootTypeNames(docs: readonly RbacSchemaDocument[], configured?: readonly string[]): Set<string> {\n if (configured) return new Set(configured);\n const names = new Set<string>(DEFAULT_RBAC_ROOT_TYPES);\n for (const { document } of docs) {\n for (const def of document.definitions) {\n if (def.kind === Kind.SCHEMA_DEFINITION || def.kind === Kind.SCHEMA_EXTENSION) {\n for (const op of def.operationTypes ?? []) names.add(op.type.name.value);\n }\n }\n }\n return names;\n}\n\nfunction inputFieldsByType(docs: readonly RbacSchemaDocument[]): Map<string, InputValueDefinitionNode[]> {\n const out = new Map<string, InputValueDefinitionNode[]>();\n for (const { document } of docs) {\n for (const def of document.definitions) {\n if (def.kind === Kind.INPUT_OBJECT_TYPE_DEFINITION || def.kind === Kind.INPUT_OBJECT_TYPE_EXTENSION) {\n const input: InputObjectTypeDefinitionNode | InputObjectTypeExtensionNode = def;\n const existing = out.get(input.name.value) ?? [];\n existing.push(...(input.fields ?? []));\n out.set(input.name.value, existing);\n }\n }\n }\n return out;\n}\n\n/** The named type under any NonNull wrappers, or null when a List sits anywhere in between. */\nfunction unwrapSingular(type: TypeNode): string | null {\n if (type.kind === Kind.NON_NULL_TYPE) return unwrapSingular(type.type);\n if (type.kind === Kind.LIST_TYPE) return null;\n return type.name.value;\n}\n\ninterface PathContext {\n inputs: Map<string, InputValueDefinitionNode[]>;\n maxSegments: number;\n idScalars: ReadonlySet<string>;\n}\n\n/**\n * Mirrors the gateway's `extractFieldArguments` + `getValueAtPath`: the path is split on '.',\n * walked from the field's arguments through input objects, and used only when it lands on a\n * string. Returns why the path cannot resolve for every request shape, or null when it does.\n */\nexport function rbacArgPathProblem(\n field: FieldDefinitionNode,\n path: string,\n inputs: Map<string, readonly InputValueDefinitionNode[]>,\n options: { maxSegments?: number; idScalars?: readonly string[] } = {}\n): string | null {\n const maxSegments = options.maxSegments ?? DEFAULT_MAX_RBAC_ARG_PATH_SEGMENTS;\n const idScalars = new Set(options.idScalars ?? DEFAULT_ID_SCALARS);\n const segments = path.split('.');\n if (segments.some((s) => s.length === 0)) return `\"${path}\" has an empty segment`;\n if (segments.length > maxSegments) {\n return `\"${path}\" has ${segments.length} segments; the gateway reads at most ${maxSegments} (it drops nested object literals)`;\n }\n const [head, ...rest] = segments;\n const arg = (field.arguments ?? []).find((a) => a.name.value === head);\n if (!arg) return `no argument \"${head}\"`;\n let typeName = unwrapSingular(arg.type);\n let walked = head;\n for (const segment of rest) {\n if (typeName === null) return `\"${walked}\" is a list`;\n const fields = inputs.get(typeName);\n if (!fields) return `\"${walked}\" is ${typeName}, not an input object`;\n const next = fields.find((f) => f.name.value === segment);\n if (!next) return `${typeName} has no field \"${segment}\"`;\n typeName = unwrapSingular(next.type);\n walked = `${walked}.${segment}`;\n }\n if (typeName === null) return `\"${walked}\" is a list`;\n if (!idScalars.has(typeName)) return `\"${walked}\" is ${typeName}, not ${[...idScalars].join('/')}`;\n return null;\n}\n\n/** Why the gateway would deny this directive as invalid, or null when it is well-formed. */\nfunction malformedReason(rbac: RbacDirectiveArgs): string | null {\n if (rbac.public === true) return null;\n if (rbac.scopeType === 'self') return null;\n const hasActionResource = Boolean(rbac.action) && Boolean(rbac.resource);\n // An actorTypes-only gate is allowed by the gateway without an RBAC round-trip.\n if (!hasActionResource && rbac.actorTypes && rbac.actorTypes.length > 0) {\n if (rbac.action || rbac.resource) return 'actorTypes gate sets only one of action/resource';\n return null;\n }\n if (!hasActionResource) return 'missing action or resource (and not public, self or actorTypes-only)';\n if (!rbac.scopeType) return 'missing scopeType';\n if (!(RBAC_GATED_SCOPE_TYPES as readonly string[]).includes(rbac.scopeType)) {\n return `unknown scopeType \"${rbac.scopeType}\"`;\n }\n if (rbac.scopeType === 'entity' && !rbac.scopeArg) return 'entity scope requires scopeArg';\n return null;\n}\n\nfunction pinEntries(pin: RbacFieldPin): string[] {\n return Array.isArray(pin) ? [...(pin as readonly string[])] : Object.keys(pin);\n}\n\nfunction matchesEntry(field: RbacRootField, entry: string): boolean {\n return entry === field.name || entry === field.coordinate;\n}\n\n/** Deterministic, locale-independent ordering for report lines. */\nfunction sortLines(lines: string[]): string[] {\n return lines.sort((a, b) => a.localeCompare(b, 'en'));\n}\n\ninterface CollectedRootField {\n root: RbacRootField;\n definition: FieldDefinitionNode;\n}\n\nfunction collectRootFields(\n docs: readonly RbacSchemaDocument[],\n roots: ReadonlySet<string>,\n exempt: ReadonlySet<string>\n): CollectedRootField[] {\n const out: CollectedRootField[] = [];\n for (const { document, file } of docs) {\n for (const def of document.definitions) {\n if (def.kind !== Kind.OBJECT_TYPE_DEFINITION && def.kind !== Kind.OBJECT_TYPE_EXTENSION) continue;\n const type = def.name.value;\n if (!roots.has(type)) continue;\n for (const definition of def.fields ?? []) {\n const name = definition.name.value;\n const coordinate = `${type}.${name}`;\n if (PLACEHOLDER_FIELD.test(name) || exempt.has(name) || exempt.has(coordinate)) continue;\n const root: RbacRootField = { type, name, coordinate, rbac: readRbacDirectiveArgs(definition) };\n if (file) root.file = file;\n out.push({ root, definition });\n }\n }\n }\n return out;\n}\n\n/** The argument path a gated scope reads its scope id from; only `entity` and `billing` read one. */\nfunction scopeArgPath(rbac: RbacDirectiveArgs): string | undefined {\n if (rbac.public === true) return undefined;\n if (rbac.scopeType === 'entity') return rbac.scopeArg;\n if (rbac.scopeType === 'billing') return rbac.scopeArg ?? DEFAULT_BILLING_SCOPE_ARG;\n return undefined;\n}\n\nfunction argPathProblems(\n definition: FieldDefinitionNode,\n rbac: RbacDirectiveArgs,\n context: PathContext\n): { label: string; problem: string }[] {\n const options = { maxSegments: context.maxSegments, idScalars: [...context.idScalars] };\n const checks: { label: string; path: string | undefined }[] = [\n { label: 'resourceIdArg', path: rbac.resourceIdArg },\n { label: 'scopeArg', path: scopeArgPath(rbac) },\n ];\n return checks.flatMap(({ label, path }) => {\n if (path === undefined) return [];\n const problem = rbacArgPathProblem(definition, path, context.inputs, options);\n return problem ? [{ label, problem }] : [];\n });\n}\n\nfunction selfScopedPinProblems(\n rootFields: readonly RbacRootField[],\n pin: RbacFieldPin | undefined\n): { unreviewed: string[]; stale: string[] } {\n if (!pin) return { unreviewed: [], stale: [] };\n const entries = pinEntries(pin);\n const selfScoped = rootFields.filter((f) => f.rbac?.scopeType === 'self' && f.rbac.public !== true);\n return {\n unreviewed: selfScoped\n .filter((field) => !entries.some((entry) => matchesEntry(field, entry)))\n .map((field) => field.coordinate),\n stale: entries.filter((entry) => !selfScoped.some((field) => matchesEntry(field, entry))),\n };\n}\n\n/** Analyse the schema and return every coverage problem without throwing. */\nexport function analyzeRbacCoverage(source: RbacCoverageSource, options: RbacCoverageOptions = {}): RbacCoverageReport {\n const docs = toSchemaDocuments(source);\n const collected = collectRootFields(docs, rootTypeNames(docs, options.rootTypes), new Set(options.exemptFields));\n const pathContext: PathContext = {\n inputs: inputFieldsByType(docs),\n maxSegments: options.maxArgPathSegments ?? DEFAULT_MAX_RBAC_ARG_PATH_SEGMENTS,\n idScalars: new Set(options.idScalars ?? DEFAULT_ID_SCALARS),\n };\n\n const missing: string[] = [];\n const malformed: string[] = [];\n const unresolvedArgPaths: string[] = [];\n for (const { root, definition } of collected) {\n const { rbac, coordinate } = root;\n if (!rbac) {\n missing.push(coordinate);\n continue;\n }\n const reason = malformedReason(rbac);\n if (reason) malformed.push(`${coordinate}: ${reason}`);\n for (const { label, problem } of argPathProblems(definition, rbac, pathContext)) {\n unresolvedArgPaths.push(`${coordinate}: ${label} ${problem}`);\n }\n }\n\n const rootFields = collected.map(({ root }) => root);\n const pins = selfScopedPinProblems(rootFields, options.selfScopedFields);\n const unreviewedSelfScoped = sortLines(pins.unreviewed);\n const staleSelfScoped = sortLines(pins.stale);\n sortLines(missing);\n sortLines(malformed);\n sortLines(unresolvedArgPaths);\n\n const minRootFields = options.minRootFields ?? 1;\n const problems = [\n ...(rootFields.length < minRootFields\n ? [`found ${rootFields.length} root field(s), expected at least ${minRootFields} (wrong schema path?)`]\n : []),\n ...missing.map((c) => `${c}: missing @rbac directive`),\n ...malformed.map((m) => `malformed @rbac on ${m}`),\n ...unresolvedArgPaths.map((p) => `unresolvable @rbac path on ${p}`),\n ...unreviewedSelfScoped.map((c) => `${c}: scopeType \"self\" is not in the reviewed selfScopedFields list`),\n ...staleSelfScoped.map((e) => `selfScopedFields entry \"${e}\" matches no self-scoped root field (stale)`),\n ];\n\n return {\n rootFields,\n missing,\n malformed,\n unresolvedArgPaths,\n unreviewedSelfScoped,\n staleSelfScoped,\n problems,\n ok: problems.length === 0,\n };\n}\n\n/**\n * Assert full `@rbac` coverage. Throws {@link RbacCoverageError} listing every problem;\n * returns the report on success so callers can make further assertions on `rootFields`.\n */\nexport function assertRbacCoverage(source: RbacCoverageSource, options: RbacCoverageOptions = {}): RbacCoverageReport {\n const report = analyzeRbacCoverage(source, options);\n if (!report.ok) throw new RbacCoverageError(report);\n return report;\n}\n","/** Canonical billing policy extracted from global-billing input validation (BOFF-10764).\n * This validates major-unit values only; it does not round, convert FX or authorize payment.\n *\n * The supported currencies mirror global-billing's single list\n * (`global-billing-svc/src/modules/currency/supported-currencies.ts`, BOFF-17385):\n * exactly USD, INR, EUR, GBP and AUD, in that order (BOFF-17446). Any other code is\n * rejected here because billing rejects it at payment. Keep both lists identical.\n */\nexport const SUPPORTED_BILLING_CURRENCIES = Object.freeze(['USD', 'INR', 'EUR', 'GBP', 'AUD'] as const);\nexport type SupportedBillingCurrency = (typeof SUPPORTED_BILLING_CURRENCIES)[number];\nconst supportedCurrencies: ReadonlySet<string> = new Set(SUPPORTED_BILLING_CURRENCIES);\n\n/** The card provider billing charges a currency through: INR via Razorpay, every other currency via Stripe. */\nexport type BillingCurrencyPaymentProvider = 'STRIPE' | 'RAZORPAY';\n\nexport interface SupportedBillingCurrencyInfo {\n readonly code: SupportedBillingCurrency;\n readonly name: string;\n readonly symbol: string;\n /** Digits after the decimal point in the currency's minor unit. */\n readonly minorUnits: number;\n readonly paymentProvider: BillingCurrencyPaymentProvider;\n}\n\n/** Metadata for every supported currency, identical to global-billing's `SUPPORTED_CURRENCY_INFO`. */\nexport const SUPPORTED_BILLING_CURRENCY_INFO: Readonly<Record<SupportedBillingCurrency, SupportedBillingCurrencyInfo>> =\n Object.freeze({\n USD: Object.freeze({ code: 'USD', name: 'US Dollar', symbol: '$', minorUnits: 2, paymentProvider: 'STRIPE' }),\n INR: Object.freeze({ code: 'INR', name: 'Indian Rupee', symbol: '₹', minorUnits: 2, paymentProvider: 'RAZORPAY' }),\n EUR: Object.freeze({ code: 'EUR', name: 'Euro', symbol: '€', minorUnits: 2, paymentProvider: 'STRIPE' }),\n GBP: Object.freeze({ code: 'GBP', name: 'British Pound', symbol: '£', minorUnits: 2, paymentProvider: 'STRIPE' }),\n AUD: Object.freeze({\n code: 'AUD',\n name: 'Australian Dollar',\n symbol: 'A$',\n minorUnits: 2,\n paymentProvider: 'STRIPE',\n }),\n } as const);\n\n/**\n * The canonical supported code for a value, or null. Case-insensitive, as in\n * billing. Whitespace is not silently accepted.\n */\nexport function toSupportedBillingCurrency(currency: unknown): SupportedBillingCurrency | null {\n if (typeof currency !== 'string') return null;\n const normalized = currency.toUpperCase();\n // Looking up the literal union supplies a typed canonical code without a cast.\n return SUPPORTED_BILLING_CURRENCIES.find((code) => code === normalized) ?? null;\n}\n\n/** Metadata for a supported currency, or null when the code is not supported. */\nexport function getSupportedBillingCurrencyInfo(currency: unknown): SupportedBillingCurrencyInfo | null {\n const code = toSupportedBillingCurrency(currency);\n return code ? SUPPORTED_BILLING_CURRENCY_INFO[code] : null;\n}\n\nexport const MAX_BILLING_AMOUNT = 1_000_000_000;\n\n/** Case-insensitive, as in billing. Whitespace is not silently accepted. */\nexport function isSupportedBillingCurrency(currency: unknown): boolean {\n return typeof currency === 'string' && supportedCurrencies.has(currency.toUpperCase());\n}\n\nexport type BillingAmountErrorCode = 'not_finite' | 'not_positive' | 'negative' | 'exceeds_maximum';\nexport type BillingAmountValidationResult =\n { valid: true; value: number } | { valid: false; code: BillingAmountErrorCode };\n\n/** Zero is rejected by default. Callers may explicitly permit unpaid amounts. */\nexport function validateBillingAmount(\n amount: unknown,\n options: { allowZero?: boolean } = {}\n): BillingAmountValidationResult {\n if (typeof amount !== 'number' || !Number.isFinite(amount)) return { valid: false, code: 'not_finite' };\n if (options.allowZero === true ? amount < 0 : amount <= 0) {\n return { valid: false, code: options.allowZero === true ? 'negative' : 'not_positive' };\n }\n if (amount > MAX_BILLING_AMOUNT) return { valid: false, code: 'exceeds_maximum' };\n return { valid: true, value: amount };\n}\n\n/** Existing global billing provider-conversion policy, not an ISO currency registry.\n * Other legacy converter callers may use codes outside the supported billing set.\n */\nconst ZERO_DECIMAL_PROVIDER_CURRENCIES: ReadonlySet<string> = new Set([\n 'BIF',\n 'CLP',\n 'DJF',\n 'GNF',\n 'JPY',\n 'KMF',\n 'KRW',\n 'MGA',\n 'PYG',\n 'RWF',\n 'UGX',\n 'VND',\n 'VUV',\n 'XAF',\n 'XOF',\n 'XPF',\n]);\n\nfunction providerUnitScale(currency: string): number {\n return ZERO_DECIMAL_PROVIDER_CURRENCIES.has(currency.toUpperCase()) ? 1 : 100;\n}\n\n/** Preserve global billing's existing rounding conversion exactly. This does not\n * validate amount/currency or imply that a provider supports a particular code.\n * New financial terms should use validateBillingMoney before converting them.\n */\nexport function convertBillingToMinorUnits(amount: number, currency: string): number {\n return Math.round(amount * providerUnitScale(currency));\n}\n\nexport type BillingMoneyErrorCode = BillingAmountErrorCode | 'unsupported_currency' | 'minor_unit_precision';\nexport type BillingMoneyValidationResult =\n | { valid: true; value: { amount: number; currency: SupportedBillingCurrency; minorUnits: number } }\n | { valid: false; code: BillingMoneyErrorCode };\n\n/** Validate terms that must survive current provider conversion without rounding.\n * It deliberately does not tighten validateBillingAmount's legacy major-unit API.\n * No tolerance is used: accepting a changed amount would alter agreed terms.\n */\nexport function validateBillingMoney(\n amount: unknown,\n currency: unknown,\n options: { allowZero?: boolean } = {}\n): BillingMoneyValidationResult {\n const validated = validateBillingAmount(amount, options);\n if (!validated.valid) return validated;\n const supported = toSupportedBillingCurrency(currency);\n if (!supported) return { valid: false, code: 'unsupported_currency' };\n const minorUnits = convertBillingToMinorUnits(validated.value, supported);\n if (!Number.isSafeInteger(minorUnits) || minorUnits / providerUnitScale(supported) !== validated.value) {\n return { valid: false, code: 'minor_unit_precision' };\n }\n return { valid: true, value: { amount: validated.value, currency: supported, minorUnits } };\n}\n","/**\n * Shared server-side identity and billing input validators.\n * Identity invariants mirror microfe-auth (BOFF-7261); billing currency support\n * and finite amount bounds originate in global-billing (BOFF-10764).\n */\n\nexport { validateName, lengthInCodePoints, NAME_MIN_LENGTH, NAME_MAX_LENGTH } from './name.js';\nexport type { NameErrorCode, NameValidationResult } from './name.js';\n\nexport { validateUsername, USERNAME_MIN_LENGTH, USERNAME_MAX_LENGTH } from './username.js';\nexport type { UsernameErrorCode, UsernameValidationResult } from './username.js';\n\nexport { validateUserFields } from './userFields.js';\nexport type { UserFieldKey, UserFieldError, ValidatedUserFields, UserFieldsValidationResult } from './userFields.js';\n\nexport {\n assertRbacCoverage,\n analyzeRbacCoverage,\n loadRbacSchemaDocuments,\n readRbacDirectiveArgs,\n rbacArgPathProblem,\n RbacCoverageError,\n RBAC_SCOPE_TYPES,\n RBAC_GATED_SCOPE_TYPES,\n DEFAULT_RBAC_ROOT_TYPES,\n DEFAULT_MAX_RBAC_ARG_PATH_SEGMENTS,\n} from './rbac-coverage.js';\nexport type {\n RbacCoverageOptions,\n RbacCoverageReport,\n RbacCoverageSource,\n RbacDirectiveArgs,\n RbacFieldPin,\n RbacRootField,\n RbacSchemaDocument,\n RbacScopeType,\n} from './rbac-coverage.js';\n\nexport {\n SUPPORTED_BILLING_CURRENCIES,\n SUPPORTED_BILLING_CURRENCY_INFO,\n toSupportedBillingCurrency,\n getSupportedBillingCurrencyInfo,\n MAX_BILLING_AMOUNT,\n isSupportedBillingCurrency,\n validateBillingAmount,\n convertBillingToMinorUnits,\n validateBillingMoney,\n} from './billing.js';\nexport type {\n SupportedBillingCurrency,\n SupportedBillingCurrencyInfo,\n BillingCurrencyPaymentProvider,\n BillingAmountErrorCode,\n BillingAmountValidationResult,\n BillingMoneyErrorCode,\n BillingMoneyValidationResult,\n} from './billing.js';\n"],"mappings":";;;;;;AAuCA,MAAa,kBAAkB;AAC/B,MAAa,kBAAkB;;;;;;;;;;;;;AAc/B,MAAM,qBAAqB;AAC3B,MAAM,0BAA0B;AAChC,MAAM,sBAAsB;;;;;;;;;;;;AAa5B,SAAgB,mB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AAM,aAAa,2BAA2B,UAAU,OAAO,SAAS;CACxE,IAAI,CAAC,OAAO,cAAc,UAAU,KAAK,aAAa,kBAAkB,SAAS,MAAM,UAAU,OAC/F,OAAO;EAAE,OAAO;EAAO,MAAM;CAAuB;CAEtD,OAAO;EAAE,OAAO;EAAM,OAAO;GAAE,QAAQ,UAAU;GAAO,UAAU;GAAW;EAAW;CAAE;AAC5F"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@burdenoff/be-sdk",
|
|
3
|
-
"version": "2026.1130.
|
|
3
|
+
"version": "2026.1130.3",
|
|
4
4
|
"description": "Backend SDK for Burdenoff products providing unified access to notifications, RBAC, activity tracking, usage monitoring, and more",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|