@burdenoff/be-sdk 2026.1102.2 → 2026.1103.1
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/EventQueueFactory-72BYG5I4.js +8 -0
- package/dist/{EventQueueFactory-CWHCJP34.js.map → EventQueueFactory-72BYG5I4.js.map} +1 -1
- package/dist/{chunk-I57LWBZU.js → chunk-2Q6RH3GE.js} +61 -3
- package/dist/chunk-2Q6RH3GE.js.map +1 -0
- package/dist/{chunk-3MEZRD4Z.js → chunk-4XY2WVFN.js} +3 -3
- package/dist/{chunk-3MEZRD4Z.js.map → chunk-4XY2WVFN.js.map} +1 -1
- package/dist/{chunk-QCOC2SF3.js → chunk-OI52XCEA.js} +4 -4
- package/dist/{chunk-QCOC2SF3.js.map → chunk-OI52XCEA.js.map} +1 -1
- package/dist/{chunk-NGAGKLAM.js → chunk-QRTWLYEZ.js} +3 -3
- package/dist/{chunk-NGAGKLAM.js.map → chunk-QRTWLYEZ.js.map} +1 -1
- package/dist/{chunk-K52ICDCP.js → chunk-S6AWJDMK.js} +3 -3
- package/dist/{chunk-K52ICDCP.js.map → chunk-S6AWJDMK.js.map} +1 -1
- package/dist/{chunk-ENEDTQET.js → chunk-SKJ7YMR4.js} +53 -4
- package/dist/chunk-SKJ7YMR4.js.map +1 -0
- package/dist/{chunk-TX2GDIWP.js → chunk-T35GNWFS.js} +3 -3
- package/dist/{chunk-TX2GDIWP.js.map → chunk-T35GNWFS.js.map} +1 -1
- package/dist/{chunk-7TOWWNHR.js → chunk-VE6B4DZ4.js} +4 -4
- package/dist/{chunk-7TOWWNHR.js.map → chunk-VE6B4DZ4.js.map} +1 -1
- package/dist/{chunk-5ENWB2S6.js → chunk-XCWVNVMG.js} +3 -3
- package/dist/{chunk-5ENWB2S6.js.map → chunk-XCWVNVMG.js.map} +1 -1
- package/dist/{chunk-SIAOIYHW.js → chunk-XLBKAYP4.js} +3 -3
- package/dist/{chunk-SIAOIYHW.js.map → chunk-XLBKAYP4.js.map} +1 -1
- package/dist/{chunk-5M77HKFT.js → chunk-ZRMIAURC.js} +5 -5
- package/dist/{chunk-5M77HKFT.js.map → chunk-ZRMIAURC.js.map} +1 -1
- package/dist/event-queue/index.d.ts +1 -1
- package/dist/event-queue/index.js +4 -4
- package/dist/graph/index.js +6 -6
- package/dist/graphql/index.js +2 -2
- package/dist/{index-B7dknayX.d.ts → index-BkeOYZye.d.ts} +22 -2
- package/dist/{index-zCx_euvK.d.ts → index-Bzk62f5n.d.ts} +3 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.js +16 -16
- package/dist/init/index.js +1 -1
- package/dist/prisma/index.js +5 -5
- package/dist/tracker/index.js +2 -2
- package/dist/validation/index.d.ts +1 -1
- package/dist/validation/index.js +1 -1
- package/package.json +1 -1
- package/dist/EventQueueFactory-CWHCJP34.js +0 -8
- package/dist/chunk-ENEDTQET.js.map +0 -1
- package/dist/chunk-I57LWBZU.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as AcknowledgeableEvent, B as BaseQueueConfig, a as BulkEventPayload, C as ConsumerConfig, b as ConsumerOptions, D as DefinedEventTaxonomy, c as EVENT_STREAMS_URL_ENV_KEYS, d as EVENT_TAXONOMY_BRAND, e as EventHandler, f as EventMessage, g as EventMetadata, h as EventPriority, j as EventQueueFactory, k as EventQueueHealthCheckResult, l as EventSpec, m as EventTaxonomy, n as EventsManager, o as EventsManagerHandler, p as EventsManagerMessage, q as EventsManagerOptions, r as EventsManagerSingleton, s as EventsManagerStreamRoute, t as EventsManagerSubscribeOptions, E as EventsModule, G as GRAPH_EVENTS_URL_ENV_KEYS, u as GraphEntityEventPayload, v as GraphQLEventMessage, k as HealthCheckResult, w as IEventConsumer, I as IEventPublisher, x as IEventQueue, y as ISubscription, L as LIFECYCLE_SUBJECTS, z as LifecycleConsumer, F as LifecycleConsumerOptions, H as LifecycleEventContext, J as LifecycleEventSource, K as LifecycleHandlers, M as MemoryEventBus, N as MemoryEventConsumer, O as MemoryEventPublisher, P as MemoryEventQueue, Q as ModuleEventPayload, R as ModuleEventsConfig, S as ModuleEventsService, T as OrganizationDeletedFact, U as OrganizationDeletedPayload, V as PLATFORM_EVENT_TAXONOMY, W as PublishEventOptions, X as PublishOptions, Y as PublishResult, Z as PublishableEventName, _ as PublisherConfig, $ as QueueStatistics, a0 as QueueType, a1 as REFERENCE_PRODUCT_EVENT_TAXONOMY, a2 as RedisStreamsConnection, a3 as RedisStreamsEventConsumer, a4 as RedisStreamsEventPublisher, a5 as StreamConfig, a6 as StreamInfo, a7 as SubscribeOptions, a8 as SubscriptionChangedPayload, a9 as SubscriptionOptions, aa as TaxonomyEventKind, ab as TaxonomyEventLayer, ac as TaxonomyEventPii, ad as TaxonomyEventStatus, ae as TaxonomyPayload, af as TaxonomyPublishMetadata, ag as UserDeletedPayload, ah as VibecontrolsAgentConnectedPayload, ai as VibecontrolsAgentDisconnectedPayload, aj as VibecontrolsSessionEndedPayload, ak as VibecontrolsSessionStartedPayload, al as WSPACE_GRAPH_EVENTS_STREAM, am as WorkflowRunCompletedPayload, an as WorkflowRunFailedPayload, ao as WorkflowRunStartedPayload, ap as WorkspaceCreatedPayload, aq as WorkspaceDeletedFact, ar as WorkspaceDeletedPayload, as as WorkspaceMemberAddedPayload, at as WorkspaceMemberRemovedFact, au as WorkspaceMemberRemovedPayload, av as WorkspaceMemberRoleUpdatedPayload, aw as buildConsumerGroupName, ax as createConsumer, ay as createEventsManagerSingleton, az as createLifecycleConsumer, aA as createMemoryConsumer, aB as createMemoryGraphEventEmitter, aC as createMemoryPublisher, aD as createModuleEventsService, aE as createPublisher, aF as defineEventTaxonomy, aG as eventKeyScopeForUrl, aH as eventSpec, aI as isDefinedEventTaxonomy, aJ as mergeEventTaxonomies, aK as parseOrganizationDeleted, aL as parseWorkspaceDeletedGraph, aM as parseWorkspaceDeletedStream, aN as parseWorkspaceMemberRemoved, aO as publishTaxonomyEvent, aP as redisDlqKey, aQ as redisStreamKey, aR as resolveEventStreamsUrl, aS as resolveEventStreamsUrlSource, aT as resolveGraphEventsUrl, aU as resolveGraphEventsUrlSource, aV as taxonomyEventNames, aW as taxonomyNameViolation } from '../index-
|
|
1
|
+
export { A as AcknowledgeableEvent, B as BaseQueueConfig, a as BulkEventPayload, C as ConsumerConfig, b as ConsumerOptions, D as DefinedEventTaxonomy, c as EVENT_STREAMS_URL_ENV_KEYS, d as EVENT_TAXONOMY_BRAND, e as EventHandler, f as EventMessage, g as EventMetadata, h as EventPriority, j as EventQueueFactory, k as EventQueueHealthCheckResult, l as EventSpec, m as EventTaxonomy, n as EventsManager, o as EventsManagerHandler, p as EventsManagerMessage, q as EventsManagerOptions, r as EventsManagerSingleton, s as EventsManagerStreamRoute, t as EventsManagerSubscribeOptions, E as EventsModule, G as GRAPH_EVENTS_URL_ENV_KEYS, u as GraphEntityEventPayload, v as GraphQLEventMessage, k as HealthCheckResult, w as IEventConsumer, I as IEventPublisher, x as IEventQueue, y as ISubscription, L as LIFECYCLE_SUBJECTS, z as LifecycleConsumer, F as LifecycleConsumerOptions, H as LifecycleEventContext, J as LifecycleEventSource, K as LifecycleHandlers, M as MemoryEventBus, N as MemoryEventConsumer, O as MemoryEventPublisher, P as MemoryEventQueue, Q as ModuleEventPayload, R as ModuleEventsConfig, S as ModuleEventsService, T as OrganizationDeletedFact, U as OrganizationDeletedPayload, V as PLATFORM_EVENT_TAXONOMY, W as PublishEventOptions, X as PublishOptions, Y as PublishResult, Z as PublishableEventName, _ as PublisherConfig, $ as QueueStatistics, a0 as QueueType, a1 as REFERENCE_PRODUCT_EVENT_TAXONOMY, a2 as RedisStreamsConnection, a3 as RedisStreamsEventConsumer, a4 as RedisStreamsEventPublisher, a5 as StreamConfig, a6 as StreamInfo, a7 as SubscribeOptions, a8 as SubscriptionChangedPayload, a9 as SubscriptionOptions, aa as TaxonomyEventKind, ab as TaxonomyEventLayer, ac as TaxonomyEventPii, ad as TaxonomyEventStatus, ae as TaxonomyPayload, af as TaxonomyPublishMetadata, ag as UserDeletedPayload, ah as VibecontrolsAgentConnectedPayload, ai as VibecontrolsAgentDisconnectedPayload, aj as VibecontrolsSessionEndedPayload, ak as VibecontrolsSessionStartedPayload, al as WSPACE_GRAPH_EVENTS_STREAM, am as WorkflowRunCompletedPayload, an as WorkflowRunFailedPayload, ao as WorkflowRunStartedPayload, ap as WorkspaceCreatedPayload, aq as WorkspaceDeletedFact, ar as WorkspaceDeletedPayload, as as WorkspaceMemberAddedPayload, at as WorkspaceMemberRemovedFact, au as WorkspaceMemberRemovedPayload, av as WorkspaceMemberRoleUpdatedPayload, aw as buildConsumerGroupName, ax as createConsumer, ay as createEventsManagerSingleton, az as createLifecycleConsumer, aA as createMemoryConsumer, aB as createMemoryGraphEventEmitter, aC as createMemoryPublisher, aD as createModuleEventsService, aE as createPublisher, aF as defineEventTaxonomy, aG as eventKeyScopeForUrl, aH as eventSpec, aI as isDefinedEventTaxonomy, aJ as mergeEventTaxonomies, aK as parseOrganizationDeleted, aL as parseWorkspaceDeletedGraph, aM as parseWorkspaceDeletedStream, aN as parseWorkspaceMemberRemoved, aO as publishTaxonomyEvent, aP as redisDlqKey, aQ as redisStreamKey, aR as resolveEventStreamsUrl, aS as resolveEventStreamsUrlSource, aT as resolveGraphEventsUrl, aU as resolveGraphEventsUrlSource, aV as taxonomyEventNames, aW as taxonomyNameViolation } from '../index-Bzk62f5n.js';
|
|
2
2
|
export { E as EntityEventRbacMetadata, a as EntityEventType, b as GraphEventEmitter, G as GraphEventEmitterImpl, c as createGraphEventEmitter, g as getGraphEventEmitter, r as resetGraphEventEmitter } from '../graph-emitter-r5TylDBm.js';
|
|
3
3
|
import '../layer-Cv9vSwBx.js';
|
|
4
4
|
import '../shutdown-registry-CW9LryO8.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { EVENT_TAXONOMY_BRAND, EventPriority, EventsManager, EventsModule, LIFECYCLE_SUBJECTS, ModuleEventsService, PLATFORM_EVENT_TAXONOMY, REFERENCE_PRODUCT_EVENT_TAXONOMY, WSPACE_GRAPH_EVENTS_STREAM, buildConsumerGroupName, createConsumer, createEventsManagerSingleton, createLifecycleConsumer, createModuleEventsService, createPublisher, defineEventTaxonomy, eventSpec, isDefinedEventTaxonomy, mergeEventTaxonomies, parseOrganizationDeleted, parseWorkspaceDeletedGraph, parseWorkspaceDeletedStream, parseWorkspaceMemberRemoved, publishTaxonomyEvent, taxonomyEventNames, taxonomyNameViolation } from '../chunk-
|
|
2
|
-
export { GraphEventEmitterImpl, MemoryEventBus, MemoryEventConsumer, MemoryEventPublisher, MemoryEventQueue, createGraphEventEmitter2 as createGraphEventEmitter, createMemoryConsumer, createGraphEventEmitter as createMemoryGraphEventEmitter, createMemoryPublisher, getGraphEventEmitter, resetGraphEventEmitter } from '../chunk-
|
|
3
|
-
export { EventQueueFactory, QueueType, RedisStreamsEventConsumer, RedisStreamsEventPublisher } from '../chunk-
|
|
1
|
+
export { EVENT_TAXONOMY_BRAND, EventPriority, EventsManager, EventsModule, LIFECYCLE_SUBJECTS, ModuleEventsService, PLATFORM_EVENT_TAXONOMY, REFERENCE_PRODUCT_EVENT_TAXONOMY, WSPACE_GRAPH_EVENTS_STREAM, buildConsumerGroupName, createConsumer, createEventsManagerSingleton, createLifecycleConsumer, createModuleEventsService, createPublisher, defineEventTaxonomy, eventSpec, isDefinedEventTaxonomy, mergeEventTaxonomies, parseOrganizationDeleted, parseWorkspaceDeletedGraph, parseWorkspaceDeletedStream, parseWorkspaceMemberRemoved, publishTaxonomyEvent, taxonomyEventNames, taxonomyNameViolation } from '../chunk-ZRMIAURC.js';
|
|
2
|
+
export { GraphEventEmitterImpl, MemoryEventBus, MemoryEventConsumer, MemoryEventPublisher, MemoryEventQueue, createGraphEventEmitter2 as createGraphEventEmitter, createMemoryConsumer, createGraphEventEmitter as createMemoryGraphEventEmitter, createMemoryPublisher, getGraphEventEmitter, resetGraphEventEmitter } from '../chunk-T35GNWFS.js';
|
|
3
|
+
export { EventQueueFactory, QueueType, RedisStreamsEventConsumer, RedisStreamsEventPublisher } from '../chunk-XLBKAYP4.js';
|
|
4
4
|
export { EVENT_STREAMS_URL_ENV_KEYS, GRAPH_EVENTS_URL_ENV_KEYS, eventKeyScopeForUrl, resolveEventStreamsUrl, resolveEventStreamsUrlSource, resolveGraphEventsUrl, resolveGraphEventsUrlSource } from '../chunk-KS2HQCJR.js';
|
|
5
|
-
export { RedisStreamsConnection, dlqKey as redisDlqKey, streamKey as redisStreamKey } from '../chunk-
|
|
5
|
+
export { RedisStreamsConnection, dlqKey as redisDlqKey, streamKey as redisStreamKey } from '../chunk-SKJ7YMR4.js';
|
|
6
6
|
import '../chunk-KO2ZXZ7W.js';
|
|
7
7
|
import '../chunk-RU266375.js';
|
|
8
8
|
import '../chunk-XE4OXN2W.js';
|
package/dist/graph/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export { AUDIT_FIELDS, GraphEventsPublisher, GraphExportService, GraphModule, SOFT_DELETE_FIELDS, STANDARD_FIELDS, TENANT_FIELDS, createGraphEventsHelper, createGraphExportService, createPrismaGraphIntegration, createRelationshipFromEntity, defineEntity, defineGraphConfig, defineModuleGraph, defineRelationship, getGraphEventsPublisher, getGraphStats, initializeGraph, isGraphInitialized } from '../chunk-
|
|
2
|
-
export { GraphRegistry, addGraphExtension, createEntityEvent, createRelationshipEvent, extractEntityTitle, extractMinimalFields, getCollectionForEntity, parseRelationship, shouldSyncEntity, shouldSyncRelationship, withDeferredGraphEvents } from '../chunk-
|
|
3
|
-
import '../chunk-
|
|
4
|
-
import '../chunk-
|
|
5
|
-
import '../chunk-
|
|
1
|
+
export { AUDIT_FIELDS, GraphEventsPublisher, GraphExportService, GraphModule, SOFT_DELETE_FIELDS, STANDARD_FIELDS, TENANT_FIELDS, createGraphEventsHelper, createGraphExportService, createPrismaGraphIntegration, createRelationshipFromEntity, defineEntity, defineGraphConfig, defineModuleGraph, defineRelationship, getGraphEventsPublisher, getGraphStats, initializeGraph, isGraphInitialized } from '../chunk-VE6B4DZ4.js';
|
|
2
|
+
export { GraphRegistry, addGraphExtension, createEntityEvent, createRelationshipEvent, extractEntityTitle, extractMinimalFields, getCollectionForEntity, parseRelationship, shouldSyncEntity, shouldSyncRelationship, withDeferredGraphEvents } from '../chunk-S6AWJDMK.js';
|
|
3
|
+
import '../chunk-ZRMIAURC.js';
|
|
4
|
+
import '../chunk-T35GNWFS.js';
|
|
5
|
+
import '../chunk-XLBKAYP4.js';
|
|
6
6
|
import '../chunk-KS2HQCJR.js';
|
|
7
|
-
import '../chunk-
|
|
7
|
+
import '../chunk-SKJ7YMR4.js';
|
|
8
8
|
import '../chunk-KO2ZXZ7W.js';
|
|
9
9
|
import '../chunk-5SIL5AG2.js';
|
|
10
10
|
import '../chunk-5CAFHK2Z.js';
|
package/dist/graphql/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { createRedisStreamsEventTarget } from '../chunk-
|
|
1
|
+
export { createRedisStreamsEventTarget } from '../chunk-QRTWLYEZ.js';
|
|
2
2
|
export { Logger, createDatabaseService } from '../chunk-MWPYA2HD.js';
|
|
3
|
-
import '../chunk-
|
|
3
|
+
import '../chunk-SKJ7YMR4.js';
|
|
4
4
|
import '../chunk-RU266375.js';
|
|
5
5
|
import '../chunk-XE4OXN2W.js';
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -128,9 +128,27 @@ type BillingAmountValidationResult = {
|
|
|
128
128
|
declare function validateBillingAmount(amount: unknown, options?: {
|
|
129
129
|
allowZero?: boolean;
|
|
130
130
|
}): BillingAmountValidationResult;
|
|
131
|
+
declare function convertBillingToMinorUnits(amount: number, currency: string): number;
|
|
132
|
+
type BillingMoneyErrorCode = BillingAmountErrorCode | 'unsupported_currency' | 'minor_unit_precision';
|
|
133
|
+
type BillingMoneyValidationResult = {
|
|
134
|
+
valid: true;
|
|
135
|
+
value: {
|
|
136
|
+
amount: number;
|
|
137
|
+
currency: SupportedBillingCurrency;
|
|
138
|
+
minorUnits: number;
|
|
139
|
+
};
|
|
140
|
+
} | {
|
|
141
|
+
valid: false;
|
|
142
|
+
code: BillingMoneyErrorCode;
|
|
143
|
+
};
|
|
144
|
+
declare function validateBillingMoney(amount: unknown, currency: unknown, options?: {
|
|
145
|
+
allowZero?: boolean;
|
|
146
|
+
}): BillingMoneyValidationResult;
|
|
131
147
|
|
|
132
148
|
type index_BillingAmountErrorCode = BillingAmountErrorCode;
|
|
133
149
|
type index_BillingAmountValidationResult = BillingAmountValidationResult;
|
|
150
|
+
type index_BillingMoneyErrorCode = BillingMoneyErrorCode;
|
|
151
|
+
type index_BillingMoneyValidationResult = BillingMoneyValidationResult;
|
|
134
152
|
declare const index_DEFAULT_MAX_RBAC_ARG_PATH_SEGMENTS: typeof DEFAULT_MAX_RBAC_ARG_PATH_SEGMENTS;
|
|
135
153
|
declare const index_DEFAULT_RBAC_ROOT_TYPES: typeof DEFAULT_RBAC_ROOT_TYPES;
|
|
136
154
|
declare const index_MAX_BILLING_AMOUNT: typeof MAX_BILLING_AMOUNT;
|
|
@@ -162,17 +180,19 @@ type index_UsernameValidationResult = UsernameValidationResult;
|
|
|
162
180
|
type index_ValidatedUserFields = ValidatedUserFields;
|
|
163
181
|
declare const index_analyzeRbacCoverage: typeof analyzeRbacCoverage;
|
|
164
182
|
declare const index_assertRbacCoverage: typeof assertRbacCoverage;
|
|
183
|
+
declare const index_convertBillingToMinorUnits: typeof convertBillingToMinorUnits;
|
|
165
184
|
declare const index_isSupportedBillingCurrency: typeof isSupportedBillingCurrency;
|
|
166
185
|
declare const index_lengthInCodePoints: typeof lengthInCodePoints;
|
|
167
186
|
declare const index_loadRbacSchemaDocuments: typeof loadRbacSchemaDocuments;
|
|
168
187
|
declare const index_rbacArgPathProblem: typeof rbacArgPathProblem;
|
|
169
188
|
declare const index_readRbacDirectiveArgs: typeof readRbacDirectiveArgs;
|
|
170
189
|
declare const index_validateBillingAmount: typeof validateBillingAmount;
|
|
190
|
+
declare const index_validateBillingMoney: typeof validateBillingMoney;
|
|
171
191
|
declare const index_validateName: typeof validateName;
|
|
172
192
|
declare const index_validateUserFields: typeof validateUserFields;
|
|
173
193
|
declare const index_validateUsername: typeof validateUsername;
|
|
174
194
|
declare namespace index {
|
|
175
|
-
export { type index_BillingAmountErrorCode as BillingAmountErrorCode, type index_BillingAmountValidationResult as BillingAmountValidationResult, index_DEFAULT_MAX_RBAC_ARG_PATH_SEGMENTS as DEFAULT_MAX_RBAC_ARG_PATH_SEGMENTS, index_DEFAULT_RBAC_ROOT_TYPES as DEFAULT_RBAC_ROOT_TYPES, index_MAX_BILLING_AMOUNT as MAX_BILLING_AMOUNT, index_NAME_MAX_LENGTH as NAME_MAX_LENGTH, index_NAME_MIN_LENGTH as NAME_MIN_LENGTH, type index_NameErrorCode as NameErrorCode, type index_NameValidationResult as NameValidationResult, index_RBAC_GATED_SCOPE_TYPES as RBAC_GATED_SCOPE_TYPES, index_RBAC_SCOPE_TYPES as RBAC_SCOPE_TYPES, index_RbacCoverageError as RbacCoverageError, type index_RbacCoverageOptions as RbacCoverageOptions, type index_RbacCoverageReport as RbacCoverageReport, type index_RbacCoverageSource as RbacCoverageSource, type index_RbacDirectiveArgs as RbacDirectiveArgs, type index_RbacFieldPin as RbacFieldPin, type index_RbacRootField as RbacRootField, type index_RbacSchemaDocument as RbacSchemaDocument, type index_RbacScopeType as RbacScopeType, index_SUPPORTED_BILLING_CURRENCIES as SUPPORTED_BILLING_CURRENCIES, type index_SupportedBillingCurrency as SupportedBillingCurrency, index_USERNAME_MAX_LENGTH as USERNAME_MAX_LENGTH, index_USERNAME_MIN_LENGTH as USERNAME_MIN_LENGTH, type index_UserFieldError as UserFieldError, type index_UserFieldKey as UserFieldKey, type index_UserFieldsValidationResult as UserFieldsValidationResult, type index_UsernameErrorCode as UsernameErrorCode, type index_UsernameValidationResult as UsernameValidationResult, type index_ValidatedUserFields as ValidatedUserFields, index_analyzeRbacCoverage as analyzeRbacCoverage, index_assertRbacCoverage as assertRbacCoverage, index_isSupportedBillingCurrency as isSupportedBillingCurrency, index_lengthInCodePoints as lengthInCodePoints, index_loadRbacSchemaDocuments as loadRbacSchemaDocuments, index_rbacArgPathProblem as rbacArgPathProblem, index_readRbacDirectiveArgs as readRbacDirectiveArgs, index_validateBillingAmount as validateBillingAmount, index_validateName as validateName, index_validateUserFields as validateUserFields, index_validateUsername as validateUsername };
|
|
195
|
+
export { type index_BillingAmountErrorCode as BillingAmountErrorCode, type index_BillingAmountValidationResult as BillingAmountValidationResult, type index_BillingMoneyErrorCode as BillingMoneyErrorCode, type index_BillingMoneyValidationResult as BillingMoneyValidationResult, index_DEFAULT_MAX_RBAC_ARG_PATH_SEGMENTS as DEFAULT_MAX_RBAC_ARG_PATH_SEGMENTS, index_DEFAULT_RBAC_ROOT_TYPES as DEFAULT_RBAC_ROOT_TYPES, index_MAX_BILLING_AMOUNT as MAX_BILLING_AMOUNT, index_NAME_MAX_LENGTH as NAME_MAX_LENGTH, index_NAME_MIN_LENGTH as NAME_MIN_LENGTH, type index_NameErrorCode as NameErrorCode, type index_NameValidationResult as NameValidationResult, index_RBAC_GATED_SCOPE_TYPES as RBAC_GATED_SCOPE_TYPES, index_RBAC_SCOPE_TYPES as RBAC_SCOPE_TYPES, index_RbacCoverageError as RbacCoverageError, type index_RbacCoverageOptions as RbacCoverageOptions, type index_RbacCoverageReport as RbacCoverageReport, type index_RbacCoverageSource as RbacCoverageSource, type index_RbacDirectiveArgs as RbacDirectiveArgs, type index_RbacFieldPin as RbacFieldPin, type index_RbacRootField as RbacRootField, type index_RbacSchemaDocument as RbacSchemaDocument, type index_RbacScopeType as RbacScopeType, index_SUPPORTED_BILLING_CURRENCIES as SUPPORTED_BILLING_CURRENCIES, type index_SupportedBillingCurrency as SupportedBillingCurrency, index_USERNAME_MAX_LENGTH as USERNAME_MAX_LENGTH, index_USERNAME_MIN_LENGTH as USERNAME_MIN_LENGTH, type index_UserFieldError as UserFieldError, type index_UserFieldKey as UserFieldKey, type index_UserFieldsValidationResult as UserFieldsValidationResult, type index_UsernameErrorCode as UsernameErrorCode, type index_UsernameValidationResult as UsernameValidationResult, type index_ValidatedUserFields as ValidatedUserFields, index_analyzeRbacCoverage as analyzeRbacCoverage, index_assertRbacCoverage as assertRbacCoverage, index_convertBillingToMinorUnits as convertBillingToMinorUnits, index_isSupportedBillingCurrency as isSupportedBillingCurrency, index_lengthInCodePoints as lengthInCodePoints, index_loadRbacSchemaDocuments as loadRbacSchemaDocuments, index_rbacArgPathProblem as rbacArgPathProblem, index_readRbacDirectiveArgs as readRbacDirectiveArgs, index_validateBillingAmount as validateBillingAmount, index_validateBillingMoney as validateBillingMoney, index_validateName as validateName, index_validateUserFields as validateUserFields, index_validateUsername as validateUsername };
|
|
176
196
|
}
|
|
177
197
|
|
|
178
|
-
export { type
|
|
198
|
+
export { type RbacFieldPin as A, type BillingAmountErrorCode as B, type RbacRootField as C, DEFAULT_MAX_RBAC_ARG_PATH_SEGMENTS as D, type RbacSchemaDocument as E, type RbacScopeType as F, type SupportedBillingCurrency as G, convertBillingToMinorUnits as H, isSupportedBillingCurrency as I, loadRbacSchemaDocuments as J, rbacArgPathProblem as K, readRbacDirectiveArgs as L, MAX_BILLING_AMOUNT as M, NAME_MAX_LENGTH as N, validateBillingAmount as O, validateBillingMoney as P, RbacCoverageError as R, SUPPORTED_BILLING_CURRENCIES as S, USERNAME_MAX_LENGTH as U, type ValidatedUserFields as V, NAME_MIN_LENGTH as a, type NameErrorCode as b, type NameValidationResult as c, type RbacCoverageOptions as d, type RbacCoverageReport as e, type RbacCoverageSource as f, USERNAME_MIN_LENGTH as g, type UserFieldError as h, type UserFieldKey as i, type UserFieldsValidationResult as j, type UsernameErrorCode as k, type UsernameValidationResult as l, index as m, analyzeRbacCoverage as n, assertRbacCoverage as o, lengthInCodePoints as p, validateUserFields as q, validateUsername as r, type BillingAmountValidationResult as s, type BillingMoneyErrorCode as t, type BillingMoneyValidationResult as u, validateName as v, DEFAULT_RBAC_ROOT_TYPES as w, RBAC_GATED_SCOPE_TYPES as x, RBAC_SCOPE_TYPES as y, type RbacDirectiveArgs as z };
|
|
@@ -221,6 +221,8 @@ type IoRedis = {
|
|
|
221
221
|
quit: () => Promise<unknown>;
|
|
222
222
|
ping: () => Promise<string>;
|
|
223
223
|
on: (event: string, handler: (...args: unknown[]) => void) => void;
|
|
224
|
+
once: (event: string, handler: (...args: unknown[]) => void) => void;
|
|
225
|
+
removeListener: (event: string, handler: (...args: unknown[]) => void) => void;
|
|
224
226
|
duplicate: () => IoRedis;
|
|
225
227
|
xadd: (...args: unknown[]) => Promise<string>;
|
|
226
228
|
xack: (...args: unknown[]) => Promise<number>;
|
|
@@ -258,6 +260,7 @@ declare class RedisStreamsConnection {
|
|
|
258
260
|
constructor(config: BaseQueueConfig);
|
|
259
261
|
isConnected(): boolean;
|
|
260
262
|
connect(): Promise<void>;
|
|
263
|
+
private waitForReady;
|
|
261
264
|
private doConnect;
|
|
262
265
|
disconnect(): Promise<void>;
|
|
263
266
|
getClient(): IoRedis;
|
package/dist/index.d.ts
CHANGED
|
@@ -11,8 +11,8 @@ import { A as ActivityModule, T as TrackerModule } from './index-BV8hveh_.js';
|
|
|
11
11
|
import { UsageModule } from './usage/index.js';
|
|
12
12
|
export { BillingUsageClient, BillingUsageClientConfig, BillingUsageOperationInput, OrgBillingUsageOperationInput, QuotaLimit, WorkspaceBillingUsageOperationInput } from './usage/index.js';
|
|
13
13
|
import { DatabaseConfig, DatabaseModule } from './database/index.js';
|
|
14
|
-
import { E as EventsModule, I as IEventPublisher } from './index-
|
|
15
|
-
export { i as EventQueue } from './index-
|
|
14
|
+
import { E as EventsModule, I as IEventPublisher } from './index-Bzk62f5n.js';
|
|
15
|
+
export { i as EventQueue } from './index-Bzk62f5n.js';
|
|
16
16
|
import { G as GraphModule } from './index-XzbbMKe4.js';
|
|
17
17
|
export { i as Graph } from './index-XzbbMKe4.js';
|
|
18
18
|
import { B as BurdenoffGraphQLClient } from './graphql-CEblo7lw.js';
|
|
@@ -42,7 +42,7 @@ export { i as Gateway } from './index-BejbszA7.js';
|
|
|
42
42
|
export { i as FeatureFlags } from './index--yvpa6ay.js';
|
|
43
43
|
export { i as Captcha, R as RecaptchaVerifyOptions, a as RecaptchaVerifyResult, b as isCaptchaEnabled, v as verifyCaptcha, c as verifyCaptchaIfEnabled } from './index-B70b5mYS.js';
|
|
44
44
|
export { i as Platform } from './index-D8HGwglK.js';
|
|
45
|
-
export { N as NAME_MAX_LENGTH, a as NAME_MIN_LENGTH, b as NameErrorCode, c as NameValidationResult, R as RbacCoverageError, d as RbacCoverageOptions, e as RbacCoverageReport, f as RbacCoverageSource, U as USERNAME_MAX_LENGTH, g as USERNAME_MIN_LENGTH, h as UserFieldError, i as UserFieldKey, j as UserFieldsValidationResult, k as UsernameErrorCode, l as UsernameValidationResult, V as ValidatedUserFields, m as Validation, n as analyzeRbacCoverage, o as assertRbacCoverage, p as lengthInCodePoints, v as validateName, q as validateUserFields, r as validateUsername } from './index-
|
|
45
|
+
export { N as NAME_MAX_LENGTH, a as NAME_MIN_LENGTH, b as NameErrorCode, c as NameValidationResult, R as RbacCoverageError, d as RbacCoverageOptions, e as RbacCoverageReport, f as RbacCoverageSource, U as USERNAME_MAX_LENGTH, g as USERNAME_MIN_LENGTH, h as UserFieldError, i as UserFieldKey, j as UserFieldsValidationResult, k as UsernameErrorCode, l as UsernameValidationResult, V as ValidatedUserFields, m as Validation, n as analyzeRbacCoverage, o as assertRbacCoverage, p as lengthInCodePoints, v as validateName, q as validateUserFields, r as validateUsername } from './index-BkeOYZye.js';
|
|
46
46
|
export { E as EmitGeneration, P as PRODUCT_RENAMES, a as PRODUCT_RENAME_EMIT, b as PRODUCT_SLUG_ALIASES, i as ProductAlias, c as ProductRename, R as RENAME_CONCERNS, d as RenameConcern, e as billingIdVariants, f as emitBillingId, g as emitName, h as emitProductSlug, j as emitQuotaKey, k as emitRbacResource, l as emitTemplateKey, m as isLegacyName, n as isSameBillingId, o as isSameGraphQLName, p as isSameName, q as isSameProductSlug, r as isSameQuotaKey, s as isSameRbacResource, t as isSameTemplateKey, u as nameVariants, v as normalizeBillingId, w as normalizeGraphQLName, x as normalizeProductSlug, y as normalizeQuotaKey, z as normalizeRbacResource, A as normalizeTemplateKey, B as productSlugVariants, C as quotaKeyVariants, D as rbacResourceVariants, F as readRenamedEnv, G as templateKeyVariants, H as toCurrentName, I as toLegacyName } from './index-BuAj5nXg.js';
|
|
47
47
|
export { C as CircuitBreakerConfig, h as DEFAULT_CIRCUIT_BREAKER_CONFIG, i as DEFAULT_GATEWAY_RETRY_CONFIG, D as DEFAULT_GATEWAY_ROUTING, b as DEFAULT_LAYER_RESOURCES, c as DEFAULT_LAYER_STREAMS, f as GatewayRequestHeaders, g as GatewayRetryConfig, G as GatewayRoutingConfig, L as LayerConfig, a as LayerFullConfig, d as LayerGatewayConfig, e as LayerResourceUrls, S as ServiceLayer } from './layer-Cv9vSwBx.js';
|
|
48
48
|
export { S as ShutdownDisposable, d as disposeAll, g as getRegisteredDisposableCount, r as registerDisposable, u as unregisterDisposable } from './shutdown-registry-CW9LryO8.js';
|
package/dist/index.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
export { NAME_MAX_LENGTH, NAME_MIN_LENGTH, RbacCoverageError, USERNAME_MAX_LENGTH, USERNAME_MIN_LENGTH, validation_exports as Validation, analyzeRbacCoverage, assertRbacCoverage, lengthInCodePoints, validateName, validateUserFields, validateUsername } from './chunk-
|
|
1
|
+
export { NAME_MAX_LENGTH, NAME_MIN_LENGTH, RbacCoverageError, USERNAME_MAX_LENGTH, USERNAME_MIN_LENGTH, validation_exports as Validation, analyzeRbacCoverage, assertRbacCoverage, lengthInCodePoints, validateName, validateUserFields, validateUsername } from './chunk-2Q6RH3GE.js';
|
|
2
2
|
export { sharing_exports as Sharing } from './chunk-DS3YMJ4X.js';
|
|
3
3
|
export { tags_exports as Tags } from './chunk-OHUBPOZ6.js';
|
|
4
4
|
export { TemporalClient, TemporalClientFactory, TemporalModule, TemporalWorker, TemporalWorkerFactory, TemporalWorkerManager } from './chunk-VXVLKRU6.js';
|
|
5
|
-
import { ActivityModule, TrackerModule } from './chunk-
|
|
6
|
-
export { ActivityModule, TrackerModule } from './chunk-
|
|
5
|
+
import { ActivityModule, TrackerModule } from './chunk-XCWVNVMG.js';
|
|
6
|
+
export { ActivityModule, TrackerModule } from './chunk-XCWVNVMG.js';
|
|
7
|
+
import './chunk-TANAOLAV.js';
|
|
7
8
|
import { UsageModule } from './chunk-64QUSPYG.js';
|
|
8
9
|
export { BillingUsageClient, UsageModule } from './chunk-64QUSPYG.js';
|
|
9
|
-
import './chunk-TANAOLAV.js';
|
|
10
10
|
export { middleware_exports as Middleware } from './chunk-ELU7VL3E.js';
|
|
11
11
|
import { TenantNotificationsModule, NotificationsModule } from './chunk-23WAZL7I.js';
|
|
12
12
|
export { tenant_notifications_exports as Notifications, NotificationsModule } from './chunk-23WAZL7I.js';
|
|
13
13
|
export { observability_exports as Observability } from './chunk-VAT66FJA.js';
|
|
14
14
|
export { platform_exports as Platform } from './chunk-XXNT4VCM.js';
|
|
15
|
-
export { prisma_exports as Prisma } from './chunk-
|
|
15
|
+
export { prisma_exports as Prisma } from './chunk-OI52XCEA.js';
|
|
16
16
|
import './chunk-E4QNLVY4.js';
|
|
17
17
|
export { PRODUCT_RENAMES, PRODUCT_RENAME_EMIT, PRODUCT_SLUG_ALIASES, product_alias_exports as ProductAlias, RENAME_CONCERNS, billingIdVariants, emitBillingId, emitName, emitProductSlug, emitQuotaKey, emitRbacResource, emitTemplateKey, isLegacyName, isSameBillingId, isSameGraphQLName, isSameName, isSameProductSlug, isSameQuotaKey, isSameRbacResource, isSameTemplateKey, nameVariants, normalizeBillingId, normalizeGraphQLName, normalizeProductSlug, normalizeQuotaKey, normalizeRbacResource, normalizeTemplateKey, productSlugVariants, quotaKeyVariants, rbacResourceVariants, readRenamedEnv, templateKeyVariants, toCurrentName, toLegacyName } from './chunk-OBBCR6WY.js';
|
|
18
18
|
import { RBACModule } from './chunk-Y4N7N2G4.js';
|
|
19
19
|
export { RBACModule, createRBACDirective, createRBACDirectiveForLayer, createRBACDirectiveFromEnv } from './chunk-Y4N7N2G4.js';
|
|
20
|
-
export {
|
|
21
|
-
export { init_exports as Init } from './chunk-3MEZRD4Z.js';
|
|
20
|
+
export { init_exports as Init } from './chunk-4XY2WVFN.js';
|
|
22
21
|
export { RESOURCE_CAP_DEFAULTS, ResourceCapExceededError, ResourceCapsModule, configureResourceCaps, getResourceCaps } from './chunk-MZCBEJ67.js';
|
|
23
22
|
export { instrumentation_exports as Instrumentation } from './chunk-E5DTAGCA.js';
|
|
23
|
+
export { i18n_exports as I18n, createTranslator, getLanguage, getLocale, hasI18n, t } from './chunk-EBDHIL7V.js';
|
|
24
24
|
import './chunk-AWPNRV3L.js';
|
|
25
25
|
export { dataloader_exports as DataLoader } from './chunk-NUB5GQTU.js';
|
|
26
26
|
export { export_exports as Export } from './chunk-3YG5JRS5.js';
|
|
@@ -35,17 +35,17 @@ import './chunk-VFCMR5GX.js';
|
|
|
35
35
|
import { ContextManager } from './chunk-RZOFS2BQ.js';
|
|
36
36
|
export { ContextManager } from './chunk-RZOFS2BQ.js';
|
|
37
37
|
import { GatewayError, GatewayErrorType } from './chunk-4KK6YJ46.js';
|
|
38
|
-
import { GraphModule } from './chunk-
|
|
39
|
-
export { graph_exports as Graph, GraphModule } from './chunk-
|
|
40
|
-
import './chunk-
|
|
41
|
-
import { EventsModule } from './chunk-
|
|
42
|
-
export { event_queue_exports as EventQueue, EventsModule } from './chunk-
|
|
43
|
-
import './chunk-
|
|
44
|
-
import { QueueType, EventQueueFactory } from './chunk-
|
|
38
|
+
import { GraphModule } from './chunk-VE6B4DZ4.js';
|
|
39
|
+
export { graph_exports as Graph, GraphModule } from './chunk-VE6B4DZ4.js';
|
|
40
|
+
import './chunk-S6AWJDMK.js';
|
|
41
|
+
import { EventsModule } from './chunk-ZRMIAURC.js';
|
|
42
|
+
export { event_queue_exports as EventQueue, EventsModule } from './chunk-ZRMIAURC.js';
|
|
43
|
+
import './chunk-T35GNWFS.js';
|
|
44
|
+
import { QueueType, EventQueueFactory } from './chunk-XLBKAYP4.js';
|
|
45
45
|
import { resolveEventStreamsUrl } from './chunk-KS2HQCJR.js';
|
|
46
|
-
export { graphql_exports as GraphQL } from './chunk-
|
|
46
|
+
export { graphql_exports as GraphQL } from './chunk-QRTWLYEZ.js';
|
|
47
47
|
import './chunk-MWPYA2HD.js';
|
|
48
|
-
import './chunk-
|
|
48
|
+
import './chunk-SKJ7YMR4.js';
|
|
49
49
|
export { ai_credits_exports as AiCredits } from './chunk-JSEG3G5L.js';
|
|
50
50
|
import { AuthModule } from './chunk-YZIWBUIN.js';
|
|
51
51
|
export { AuthModule } from './chunk-YZIWBUIN.js';
|
package/dist/init/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { getSDKState, initializeBurdenoffSDK, isSDKInitialized, resetSDK } from '../chunk-
|
|
1
|
+
export { getSDKState, initializeBurdenoffSDK, isSDKInitialized, resetSDK } from '../chunk-4XY2WVFN.js';
|
|
2
2
|
import '../chunk-MZCBEJ67.js';
|
|
3
3
|
import '../chunk-AWPNRV3L.js';
|
|
4
4
|
import '../chunk-Q5H45UXV.js';
|
package/dist/prisma/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { buildContextWhereClause, buildContextWhereConditions, checkDatabaseHealth, contextMatches, createContextFromSDK, createDatabaseClient, createDatabaseClientFromEnv, extractFieldsFromModel, getAllModelNames, getDatabaseManager, getDatabaseProductName, getDatabaseStats, getDatabaseVersion, getDb, getModelFields, hasModel, initializeDatabase, initializeDatabaseWithConfig, isDatabaseInitialized, loadGeneratedFields, mergeContext, parseContext, resetDatabaseManager, resolvePoolTuningFromEnv, testConnection, toContextJson } from '../chunk-
|
|
1
|
+
export { buildContextWhereClause, buildContextWhereConditions, checkDatabaseHealth, contextMatches, createContextFromSDK, createDatabaseClient, createDatabaseClientFromEnv, extractFieldsFromModel, getAllModelNames, getDatabaseManager, getDatabaseProductName, getDatabaseStats, getDatabaseVersion, getDb, getModelFields, hasModel, initializeDatabase, initializeDatabaseWithConfig, isDatabaseInitialized, loadGeneratedFields, mergeContext, parseContext, resetDatabaseManager, resolvePoolTuningFromEnv, testConnection, toContextJson } from '../chunk-OI52XCEA.js';
|
|
2
2
|
export { addWorkspaceExtension, buildTransactionContextStatement, defaultWorkspaceExtensionConfig, getCallerTransaction, getScopedWorkspaceContext, getWorkspaceContext, injectCreateFields, injectWhereWorkspaceId, maybeSetRlsGuc, maybeTagConnection, resetCallerTransactionStateForTests, runOperationInCallerTransaction, runOperationWithRlsGuc, setWorkspaceContext, withWorkspaceContext, withWorkspaceContextSync } from '../chunk-E4QNLVY4.js';
|
|
3
3
|
import '../chunk-OBBCR6WY.js';
|
|
4
|
-
export { PrismaClientWrapper, configurePrismaLogging, createConnectionPool, createPrismaAdapter, createPrismaClient, ensureServiceApplicationName, installAcquireRetry, isTransientAcquireError } from '../chunk-
|
|
5
|
-
import '../chunk-
|
|
6
|
-
import '../chunk-
|
|
4
|
+
export { PrismaClientWrapper, configurePrismaLogging, createConnectionPool, createPrismaAdapter, createPrismaClient, ensureServiceApplicationName, installAcquireRetry, isTransientAcquireError } from '../chunk-S6AWJDMK.js';
|
|
5
|
+
import '../chunk-T35GNWFS.js';
|
|
6
|
+
import '../chunk-XLBKAYP4.js';
|
|
7
7
|
import '../chunk-KS2HQCJR.js';
|
|
8
|
-
import '../chunk-
|
|
8
|
+
import '../chunk-SKJ7YMR4.js';
|
|
9
9
|
import '../chunk-KO2ZXZ7W.js';
|
|
10
10
|
import '../chunk-RU266375.js';
|
|
11
11
|
import '../chunk-XE4OXN2W.js';
|
package/dist/tracker/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { AGENT_ACTIVITY_ACTIONS, AGENT_ACTIVITY_RESOURCE_TYPE, TrackerModule, trackAgentActivity } from '../chunk-
|
|
2
|
-
export { UsageMetricType } from '../chunk-64QUSPYG.js';
|
|
1
|
+
export { AGENT_ACTIVITY_ACTIONS, AGENT_ACTIVITY_RESOURCE_TYPE, TrackerModule, trackAgentActivity } from '../chunk-XCWVNVMG.js';
|
|
3
2
|
export { AI_ASSISTANT_ACTOR_ORIGIN, UNIFIED_TRACKER_CONSTANTS, UnifiedTrackerStub, createProductTracker, isTrackedActorType, resolveAssistantSession, suppressMutationAudit, trackOperation, trackerStub } from '../chunk-TANAOLAV.js';
|
|
3
|
+
export { UsageMetricType } from '../chunk-64QUSPYG.js';
|
|
4
4
|
import '../chunk-23WAZL7I.js';
|
|
5
5
|
import '../chunk-E4QNLVY4.js';
|
|
6
6
|
import '../chunk-Y4N7N2G4.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { B as BillingAmountErrorCode, s as BillingAmountValidationResult, D as DEFAULT_MAX_RBAC_ARG_PATH_SEGMENTS,
|
|
1
|
+
export { B as BillingAmountErrorCode, s as BillingAmountValidationResult, t as BillingMoneyErrorCode, u as BillingMoneyValidationResult, D as DEFAULT_MAX_RBAC_ARG_PATH_SEGMENTS, w as DEFAULT_RBAC_ROOT_TYPES, M as MAX_BILLING_AMOUNT, N as NAME_MAX_LENGTH, a as NAME_MIN_LENGTH, b as NameErrorCode, c as NameValidationResult, x as RBAC_GATED_SCOPE_TYPES, y as RBAC_SCOPE_TYPES, R as RbacCoverageError, d as RbacCoverageOptions, e as RbacCoverageReport, f as RbacCoverageSource, z as RbacDirectiveArgs, A as RbacFieldPin, C as RbacRootField, E as RbacSchemaDocument, F as RbacScopeType, S as SUPPORTED_BILLING_CURRENCIES, G as SupportedBillingCurrency, U as USERNAME_MAX_LENGTH, g as USERNAME_MIN_LENGTH, h as UserFieldError, i as UserFieldKey, j as UserFieldsValidationResult, k as UsernameErrorCode, l as UsernameValidationResult, V as ValidatedUserFields, n as analyzeRbacCoverage, o as assertRbacCoverage, H as convertBillingToMinorUnits, I as isSupportedBillingCurrency, p as lengthInCodePoints, J as loadRbacSchemaDocuments, K as rbacArgPathProblem, L as readRbacDirectiveArgs, O as validateBillingAmount, P as validateBillingMoney, v as validateName, q as validateUserFields, r as validateUsername } from '../index-BkeOYZye.js';
|
|
2
2
|
import 'graphql';
|
package/dist/validation/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
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, isSupportedBillingCurrency, lengthInCodePoints, loadRbacSchemaDocuments, rbacArgPathProblem, readRbacDirectiveArgs, validateBillingAmount, validateName, validateUserFields, validateUsername } from '../chunk-
|
|
1
|
+
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 } from '../chunk-2Q6RH3GE.js';
|
|
2
2
|
import '../chunk-XE4OXN2W.js';
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@burdenoff/be-sdk",
|
|
3
|
-
"version": "2026.
|
|
3
|
+
"version": "2026.1103.1",
|
|
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",
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export { EventQueueFactory, resolveQueueType } from './chunk-SIAOIYHW.js';
|
|
2
|
-
import './chunk-KS2HQCJR.js';
|
|
3
|
-
import './chunk-ENEDTQET.js';
|
|
4
|
-
import './chunk-KO2ZXZ7W.js';
|
|
5
|
-
import './chunk-RU266375.js';
|
|
6
|
-
import './chunk-XE4OXN2W.js';
|
|
7
|
-
//# sourceMappingURL=EventQueueFactory-CWHCJP34.js.map
|
|
8
|
-
//# sourceMappingURL=EventQueueFactory-CWHCJP34.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/event-queue/implementations/redis-streams/keyspace.ts","../src/event-queue/implementations/redis-streams/RedisStreamsConnection.ts"],"names":["DEFAULT_PREFIX","REGISTRY_PREFIX","DELAYQ_PREFIX","DELAYQ_LOCK_PREFIX","DLQ_PREFIX","DEDUP_PREFIX","REPLY_PREFIX","currentScope","setKeyScope","scope","scoped","prefix","subjectToKey","subject","replace","streamKey","opts","registryKey","boundary","boundaryOf","first","split","delayQueueKey","stream","delayLockKey","dlqKey","dedupKey","msgId","replyKey","correlationId","matchSubject","pattern","pParts","sParts","last","length","i","isWildcard","includes","ioredisModulePromise","loadIoRedis","mod","default","Redis","err","logger","error","Error","message","String","ctor","normaliseUrl","rawUrl","url","tls","test","host","dbIndex","parsed","URL","hostname","pathDb","pathname","parseInt","toString","RedisStreamsConnection","client","connecting","normalisedUrl","config","process","env","isConnected","status","connect","doConnect","finally","keepAlive","lazyConnect","maxRetriesPerRequest","enableReadyCheck","connectTimeout","connectionTimeout","reconnectOnError","retryStrategy","times","Math","min","Number","isFinite","password","user","servername","on","args","warn","info","keyScope","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F,SAAAA,EAAS,CAAGG,SAAAA,EAAS;AACtC,IAAA,IAAI,SAAA,IAAaD,GAAAA,IAAO,OAAOA,GAAAA,CAAI5B,YAAY,UAAA,EAAY;AACzD,MAAA,IAAI;AACF,QAAA,MAAM4B,IAAI5B,OAAAA,EAAO;MACnB,CAAA,CAAA,MAAQ;AAER,MAAA;AACF,IAAA;AACA,IAAA,OAAO4B,GAAAA;AACT,EAAA;AAEA,EAAA,MAAME,IAAAA,GAAwB;AAC5B,IAAA,MAAM,KAAK9B,OAAAA,EAAO;AAClB,IAAA,OAAO,IAAA,CAAK0B,SAAAA,EAAS,CAAGI,IAAAA,EAAI;AAC9B,EAAA;AACF","file":"chunk-ENEDTQET.js","sourcesContent":["/**\n * Redis Streams key namespace helpers.\n *\n * All keys are prefixed with `boff:` because DB 0 of Azure Managed Redis is\n * shared with the be-sdk cache provider.\n */\n\nexport interface KeyspaceOptions {\n /** Top-level prefix for event streams. Defaults to `boff:events`. */\n prefix?: string;\n}\n\nconst DEFAULT_PREFIX = 'boff:events';\nconst REGISTRY_PREFIX = 'boff:registry:subjects';\nconst DELAYQ_PREFIX = 'boff:delayq';\nconst DELAYQ_LOCK_PREFIX = 'boff:lock:delayq';\nconst DLQ_PREFIX = 'boff:dlq';\nconst DEDUP_PREFIX = 'boff:dedup';\nconst REPLY_PREFIX = 'boff:replies';\n\n// ── Process-wide key scope (DB-as-prefix) ────────────────────────────────\n//\n// Azure Managed Redis Balanced/B0 only exposes DB 0. Services that used to\n// rely on a non-zero DB index in their REDIS_URL (e.g. `…/4`) for namespace\n// isolation now share DB 0 — RedisStreamsConnection strips the path, pins\n// the connection to DB 0, and calls `setKeyScope(\"db4:\")` so every key that\n// flows through this module is automatically prefixed with `db4:`. That\n// preserves the per-service isolation the DB number used to give us without\n// any of the callers having to change.\n//\n// Default scope is empty (back-compat for services on classic Redis or\n// already using DB 0). Set once at connection time; reads are O(1).\nlet currentScope = '';\n\nexport function setKeyScope(scope: string): void {\n currentScope = scope ?? '';\n}\n\nexport function getKeyScope(): string {\n return currentScope;\n}\n\nfunction scoped(prefix: string): string {\n return currentScope ? `${currentScope}${prefix}` : prefix;\n}\n\n/** Convert a NATS-style subject to a Redis key segment (`.` → `:`). */\nexport function subjectToKey(subject: string): string {\n return subject.replace(/\\./g, ':');\n}\n\n/** Build the stream key for a given subject. */\nexport function streamKey(subject: string, opts: KeyspaceOptions = {}): string {\n const prefix = opts.prefix ?? DEFAULT_PREFIX;\n return `${scoped(prefix)}:${subjectToKey(subject)}`;\n}\n\n/** Stream key from a NATS-style wildcard prefix (e.g. `wspace`). */\nexport function registryKey(boundary: string): string {\n return `${scoped(REGISTRY_PREFIX)}:${boundary}`;\n}\n\n/** Extract the leading boundary (`x` in `x.y.z`). */\nexport function boundaryOf(subject: string): string {\n const first = subject.split('.')[0];\n return first ?? subject;\n}\n\n/** Sorted-set key for delayed-NAK re-delivery, scoped per stream. */\nexport function delayQueueKey(stream: string): string {\n return `${scoped(DELAYQ_PREFIX)}:${stream}`;\n}\n\n/** Lock key the delay-queue worker uses to serialise across replicas. */\nexport function delayLockKey(stream: string): string {\n return `${scoped(DELAYQ_LOCK_PREFIX)}:${stream}`;\n}\n\n/** Per-stream dead-letter queue. */\nexport function dlqKey(stream: string): string {\n return `${scoped(DLQ_PREFIX)}:${stream}`;\n}\n\n/** Per-message dedup marker key. */\nexport function dedupKey(stream: string, msgId: string): string {\n return `${scoped(DEDUP_PREFIX)}:${stream}:${msgId}`;\n}\n\n/** Reply-stream key for request/response emulation. */\nexport function replyKey(correlationId: string): string {\n return `${scoped(REPLY_PREFIX)}:${correlationId}`;\n}\n\n/**\n * Resolve a NATS-style subject pattern to a concrete list of stream keys, using\n * a registry of known subjects.\n *\n * Patterns supported:\n * - `x.y.z` — exact subject, returns single stream\n * - `x.>` — all subjects starting with `x.`\n * - `x.*` — all subjects with exactly one more segment after `x.`\n * - `x.*.z` — single-segment wildcard at position\n */\nexport function matchSubject(pattern: string, subject: string): boolean {\n if (pattern === subject) return true;\n const pParts = pattern.split('.');\n const sParts = subject.split('.');\n const last = pParts[pParts.length - 1];\n if (last === '>') {\n if (sParts.length < pParts.length) return false;\n for (let i = 0; i < pParts.length - 1; i++) {\n if (pParts[i] !== sParts[i]) return false;\n }\n return true;\n }\n if (pParts.length !== sParts.length) return false;\n for (let i = 0; i < pParts.length; i++) {\n if (pParts[i] !== '*' && pParts[i] !== sParts[i]) return false;\n }\n return true;\n}\n\n/** True if subject pattern contains a wildcard token. */\nexport function isWildcard(pattern: string): boolean {\n return pattern.includes('*') || pattern.includes('>');\n}\n","/**\n * Manages a single ioredis client (or cluster) for the Redis Streams backend.\n *\n * Connection URL conventions:\n * - `redis://host:port` — plaintext\n * - `rediss://host:port` — TLS (Azure Managed Redis uses port 10000)\n * - `valkey://`/`valkeys://` — accepted as aliases, normalised internally\n *\n * Hostname → SNI is set automatically for TLS endpoints so Azure-managed certs\n * validate.\n */\nimport { logger } from '../../../logger/index.js';\nimport type { BaseQueueConfig } from '../../types/config.js';\nimport { setKeyScope } from './keyspace.js';\n\ntype IoRedis = {\n status: string;\n connect: () => Promise<void>;\n disconnect: () => void;\n quit: () => Promise<unknown>;\n ping: () => Promise<string>;\n on: (event: string, handler: (...args: unknown[]) => void) => void;\n duplicate: () => IoRedis;\n // Stream + key commands used by publisher/consumer/sweeper\n xadd: (...args: unknown[]) => Promise<string>;\n xack: (...args: unknown[]) => Promise<number>;\n xreadgroup: (...args: unknown[]) => Promise<unknown>;\n xgroup: (...args: unknown[]) => Promise<unknown>;\n xautoclaim: (...args: unknown[]) => Promise<unknown>;\n xclaim: (...args: unknown[]) => Promise<unknown>;\n xpending: (...args: unknown[]) => Promise<unknown>;\n xlen: (key: string) => Promise<number>;\n xinfo: (...args: unknown[]) => Promise<unknown>;\n xrevrange: (...args: unknown[]) => Promise<unknown>;\n xrange: (...args: unknown[]) => Promise<unknown>;\n xdel: (key: string, ...ids: string[]) => Promise<number>;\n set: (...args: unknown[]) => Promise<string | null>;\n expire: (key: string, seconds: number) => Promise<number>;\n del: (...keys: string[]) => Promise<number>;\n sadd: (key: string, ...members: string[]) => Promise<number>;\n smembers: (key: string) => Promise<string[]>;\n zadd: (...args: unknown[]) => Promise<number>;\n zrangebyscore: (...args: unknown[]) => Promise<string[]>;\n zrem: (key: string, ...members: string[]) => Promise<number>;\n pipeline: () => { xadd: (...args: unknown[]) => unknown; exec: () => Promise<Array<[Error | null, unknown]>> };\n};\n\ntype IoRedisCtor = new (url: string, opts: Record<string, unknown>) => IoRedis;\n\nlet ioredisModulePromise: Promise<IoRedisCtor | null> | null = null;\n\nasync function loadIoRedis(): Promise<IoRedisCtor> {\n if (!ioredisModulePromise) {\n ioredisModulePromise = (async () => {\n try {\n const mod = (await import('ioredis')) as unknown as { default?: IoRedisCtor; Redis?: IoRedisCtor };\n return mod.default ?? mod.Redis ?? null;\n } catch (err) {\n logger.error('[RedisStreamsConnection] ioredis not installed', {\n error: err instanceof Error ? err.message : String(err),\n });\n return null;\n }\n })();\n }\n const ctor = await ioredisModulePromise;\n if (!ctor) {\n throw new Error(\n '[RedisStreamsConnection] ioredis is required for the redis-streams event-queue backend. ' +\n 'Install it with: bun add ioredis (or npm i ioredis)'\n );\n }\n return ctor;\n}\n\nfunction normaliseUrl(rawUrl: string): { url: string; tls: boolean; host: string; dbIndex: number } {\n let url = rawUrl;\n let tls = false;\n if (/^valkeys:\\/\\//.test(url)) {\n tls = true;\n url = url.replace(/^valkeys:\\/\\//, 'rediss://');\n } else if (/^valkey:\\/\\//.test(url)) {\n url = url.replace(/^valkey:\\/\\//, 'redis://');\n } else if (/^rediss:\\/\\//.test(url)) {\n tls = true;\n }\n let host = 'localhost';\n let dbIndex = 0;\n try {\n const parsed = new URL(url);\n host = parsed.hostname || host;\n // Azure Managed Redis Balanced/B0 only exposes DB 0. If the URL pins a\n // non-zero DB in its path (e.g. `…/4`), ioredis would issue `SELECT 4`\n // on every reconnect and the server returns `ERR DB index is out of\n // range` in a tight loop that pegs the event loop. Strip the path here\n // so the connection lands on DB 0, then surface the original index to\n // the caller — we use it as a key-prefix scope so the per-service\n // isolation the DB number used to give us is preserved.\n const pathDb = parsed.pathname.replace(/^\\//, '');\n if (pathDb && /^\\d+$/.test(pathDb)) {\n dbIndex = parseInt(pathDb, 10);\n parsed.pathname = '';\n url = parsed.toString();\n }\n } catch {\n /* keep defaults */\n }\n return { url, tls, host, dbIndex };\n}\n\nexport class RedisStreamsConnection {\n private client: IoRedis | null = null;\n private connecting: Promise<void> | null = null;\n private readonly tls: boolean;\n private readonly host: string;\n private readonly normalisedUrl: string;\n private readonly dbIndex: number;\n\n constructor(private readonly config: BaseQueueConfig) {\n const { url, tls, host, dbIndex } = normaliseUrl(config.url);\n this.normalisedUrl = url;\n this.tls = tls || process.env['REDIS_TLS'] === 'true';\n this.host = host;\n this.dbIndex = dbIndex;\n // Install the DB-as-prefix scope before the first publish/consume runs.\n // Safe to call at construction: keyspace.setKeyScope is process-wide and\n // every key produced after this point will be prefixed with `db{N}:`.\n if (dbIndex > 0) {\n setKeyScope(`db${String(dbIndex)}:`);\n }\n }\n\n /** True once `connect()` has resolved and ioredis is in `ready` state. */\n isConnected(): boolean {\n return this.client !== null && this.client.status === 'ready';\n }\n\n /** Connect lazily; subsequent calls await the in-flight promise. */\n async connect(): Promise<void> {\n if (this.isConnected()) return;\n if (this.connecting) {\n await this.connecting;\n return;\n }\n this.connecting = this.doConnect().finally(() => {\n this.connecting = null;\n });\n await this.connecting;\n }\n\n private async doConnect(): Promise<void> {\n const Redis = await loadIoRedis();\n // Enable TCP keep-alive so half-open / stale sockets are detected and reclaimed\n // promptly instead of lingering server-side. Blocking XREAD connections (one per\n // subscribed stream) sit idle for long periods; without keep-alive, a connection\n // orphaned by a proxy failover, network drop, or Redis reprovision (e.g. a tier\n // scale) is not noticed until the next command, so stale sockets accumulate against\n // the server's connection cap during churn. 30s default; set REDIS_STREAMS_KEEPALIVE=0\n // to disable. ioredis passes this to socket.setKeepAlive(true, <ms>).\n const keepAlive = parseInt(process.env['REDIS_STREAMS_KEEPALIVE'] ?? '30000', 10);\n const opts: Record<string, unknown> = {\n lazyConnect: true,\n maxRetriesPerRequest: null,\n enableReadyCheck: true,\n connectTimeout: this.config.connectionTimeout ?? 15000,\n reconnectOnError: () => true,\n retryStrategy: (times: number): number => Math.min(times * 200, 2000),\n };\n if (Number.isFinite(keepAlive) && keepAlive > 0) opts['keepAlive'] = keepAlive;\n if (this.config.password) opts['password'] = this.config.password;\n if (this.config.user) opts['username'] = this.config.user;\n if (this.tls) {\n opts['tls'] = { servername: this.host };\n }\n this.client = new Redis(this.normalisedUrl, opts);\n this.client.on('error', (...args: unknown[]) => {\n const err = args[0] as Error | undefined;\n logger.warn('[RedisStreamsConnection] redis error', {\n error: err?.message ?? 'unknown',\n });\n });\n this.client.on('reconnecting', () => {\n logger.info('[RedisStreamsConnection] reconnecting');\n });\n await this.client.connect();\n logger.info('[RedisStreamsConnection] connected', {\n url: this.normalisedUrl.replace(/:[^:@/]*@/, ':***@'),\n tls: this.tls,\n dbIndex: this.dbIndex,\n keyScope: this.dbIndex > 0 ? `db${String(this.dbIndex)}:` : '',\n });\n }\n\n async disconnect(): Promise<void> {\n if (!this.client) return;\n try {\n await this.client.quit();\n } catch {\n this.client.disconnect();\n }\n this.client = null;\n }\n\n /** The shared command client. Throws if not connected. */\n getClient(): IoRedis {\n if (!this.client) {\n throw new Error('[RedisStreamsConnection] not connected — call connect() first');\n }\n return this.client;\n }\n\n /** Make a dedicated client (e.g. for a blocking XREADGROUP loop). */\n async makeBlockingClient(): Promise<IoRedis> {\n await this.connect();\n const dup = this.getClient().duplicate();\n if ('connect' in dup && typeof dup.connect === 'function') {\n try {\n await dup.connect();\n } catch {\n /* ioredis auto-connects in some versions */\n }\n }\n return dup;\n }\n\n async ping(): Promise<string> {\n await this.connect();\n return this.getClient().ping();\n }\n}\n\nexport type { IoRedis };\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/validation/index.ts","../src/validation/name.ts","../src/validation/username.ts","../src/validation/userFields.ts","../src/validation/rbac-coverage.ts","../src/validation/billing.ts"],"names":["NAME_MIN_LENGTH","NAME_MAX_LENGTH","NAME_ALLOWED_CHARS","TYPOGRAPHIC_APOSTROPHES","TYPOGRAPHIC_HYPHENS","lengthInCodePoints","s","length","validateName","name","trimmed","normalize","replace","trim","valid","code","message","test","value","USERNAME_MIN_LENGTH","USERNAME_MAX_LENGTH","USERNAME_ALLOWED_CHARS","validateUsername","username","errors","push","validateUserFields","input","options","requireAll","isBlank","v","firstName","field","lastName","e","valueOr","result","fallback","values","RBAC_GATED_SCOPE_TYPES","RBAC_SCOPE_TYPES","DEFAULT_RBAC_ROOT_TYPES","DEFAULT_MAX_RBAC_ARG_PATH_SEGMENTS","DEFAULT_BILLING_SCOPE_ARG","DEFAULT_ID_SCALARS","SCHEMA_EXTENSIONS","Set","SKIPPED_DIRECTORIES","PLACEHOLDER_FIELD","RbacCoverageError","Error","report","problems","join","collectSchemaFiles","path","statSync","isDirectory","out","entries","readdirSync","withFileTypes","sort","a","b","localeCompare","entry","full","has","startsWith","extname","loadRbacSchemaDocuments","paths","files","flatMap","map","file","document","parse","readFileSync","error","String","cause","isDocumentNode","kind","Kind","DOCUMENT","toSchemaDocuments","source","items","every","item","TypeError","rbacDirective","directives","find","d","readRbacDirectiveArgs","directive","args","arg","arguments","BOOLEAN","public","LIST","actorTypes","STRING","rootTypeNames","docs","configured","names","def","definitions","SCHEMA_DEFINITION","SCHEMA_EXTENSION","op","operationTypes","add","type","inputFieldsByType","Map","INPUT_OBJECT_TYPE_DEFINITION","INPUT_OBJECT_TYPE_EXTENSION","existing","get","fields","set","unwrapSingular","NON_NULL_TYPE","LIST_TYPE","rbacArgPathProblem","inputs","maxSegments","idScalars","segments","split","some","head","rest","typeName","walked","segment","next","f","malformedReason","rbac","scopeType","hasActionResource","Boolean","action","resource","includes","scopeArg","pinEntries","pin","Array","isArray","Object","keys","matchesEntry","coordinate","sortLines","lines","collectRootFields","roots","exempt","OBJECT_TYPE_DEFINITION","OBJECT_TYPE_EXTENSION","definition","root","scopeArgPath","undefined","argPathProblems","context","checks","label","resourceIdArg","problem","selfScopedPinProblems","rootFields","unreviewed","stale","selfScoped","filter","analyzeRbacCoverage","collected","rootTypes","exemptFields","pathContext","maxArgPathSegments","missing","malformed","unresolvedArgPaths","reason","pins","selfScopedFields","unreviewedSelfScoped","staleSelfScoped","minRootFields","c","m","p","ok","assertRbacCoverage","SUPPORTED_BILLING_CURRENCIES","freeze","supportedCurrencies","MAX_BILLING_AMOUNT","isSupportedBillingCurrency","currency","toUpperCase","validateBillingAmount","amount","Number","isFinite","allowZero"],"mappings":";;;;;;AAAA,IAAA,kBAAA,GAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;ACwCO,IAAMA,eAAAA,GAAkB;AACxB,IAAMC,eAAAA,GAAkB;AAc/B,IAAMC,kBAAAA,GAAqB,+CAAA;AAC3B,IAAMC,uBAAAA,GAA0B,uBAAA;AAChC,IAAMC,mBAAAA,GAAsB,iBAAA;AAarB,SAASC,mBAAmBC,CAAAA,EAAS;AAC1C,EAAA,OAAO;AAAIA,IAAAA,GAAAA;AAAGC,GAAAA,CAAAA,MAAAA;AAChB;AAFgBF,MAAAA,CAAAA,kBAAAA,EAAAA,oBAAAA,CAAAA;AAIT,SAASG,aAAaC,IAAAA,EAA+B;AAC1D,EAAA,MAAMC,OAAAA,GAAAA,CAAWD,IAAAA,IAAQ,EAAA,EACtBE,SAAAA,CAAU,KAAA,CAAA,CACVC,OAAAA,CAAQT,uBAAAA,EAAyB,GAAA,CAAA,CACjCS,OAAAA,CAAQR,mBAAAA,EAAqB,GAAA,EAC7BS,IAAAA,EAAI;AAEP,EAAA,IAAIR,kBAAAA,CAAmBK,OAAAA,CAAAA,GAAWV,eAAAA,EAAiB;AACjD,IAAA,OAAO;MAAEc,KAAAA,EAAO,KAAA;MAAOC,IAAAA,EAAM,UAAA;MAAYC,OAAAA,EAAS;AAA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EAAA,KAAA;AACA,EAAA,KAAA;AACA,EAAA,KAAA;AACA,EAAA,KAAA;AACA,EAAA,KAAA;AACA,EAAA,KAAA;AACA,EAAA,KAAA;AACA,EAAA,KAAA;AACA,EAAA;AACD,CAAA;AAED,IAAMC,mBAAAA,GAA2C,IAAIhK,GAAAA,CAAI8J,4BAAAA,CAAAA;AAClD,IAAMG,kBAAAA,GAAqB;AAG3B,SAASC,2BAA2BC,QAAAA,EAAiB;AAC1D,EAAA,OAAO,OAAOA,QAAAA,KAAa,QAAA,IAAYH,oBAAoB1I,GAAAA,CAAI6I,QAAAA,CAASC,aAAW,CAAA;AACrF;AAFgBF,MAAAA,CAAAA,0BAAAA,EAAAA,4BAAAA,CAAAA;AAUT,SAASG,qBAAAA,CACdC,MAAAA,EACAzL,OAAAA,GAAmC,EAAC,EAAC;AAErC,EAAA,IAAI,OAAOyL,WAAW,QAAA,IAAY,CAACC,OAAOC,QAAAA,CAASF,MAAAA,GAAS,OAAO;IAAEvM,KAAAA,EAAO,KAAA;IAAOC,IAAAA,EAAM;AAAa,GAAA;AACtG,EAAA,IAAIa,QAAQ4L,SAAAA,KAAc,IAAA,GAAOH,MAAAA,GAAS,CAAA,GAAIA,UAAU,CAAA,EAAG;AACzD,IAAA,OAAO;MAAEvM,KAAAA,EAAO,KAAA;MAAOC,IAAAA,EAAMa,OAAAA,CAAQ4L,SAAAA,KAAc,IAAA,GAAO,UAAA,GAAa;AAAe,KAAA;AACxF,EAAA;AACA,EAAA,IAAIH,MAAAA,GAASL,oBAAoB,OAAO;IAAElM,KAAAA,EAAO,KAAA;IAAOC,IAAAA,EAAM;AAAkB,GAAA;AAChF,EAAA,OAAO;IAAED,KAAAA,EAAO,IAAA;IAAMI,KAAAA,EAAOmM;AAAO,GAAA;AACtC;AAVgBD,MAAAA,CAAAA,qBAAAA,EAAAA,uBAAAA,CAAAA","file":"chunk-I57LWBZU.js","sourcesContent":["/**\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} from './billing.js';\nexport type { SupportedBillingCurrency, BillingAmountErrorCode, BillingAmountValidationResult } from './billing.js';\n","/**\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 }\n | { 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 }\n | { 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\n | readonly string[]\n | DocumentNode\n | readonly DocumentNode[]\n | 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 }\n | { 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"]}
|