@burdenoff/be-sdk 2026.706.1 → 2026.709.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-AG6LQF77.js +6 -0
- package/dist/{EventQueueFactory-2I4WASUN.js.map → EventQueueFactory-AG6LQF77.js.map} +1 -1
- package/dist/chunk-32KT5RF2.js +53 -0
- package/dist/chunk-32KT5RF2.js.map +1 -0
- package/dist/{chunk-4ALVWJTM.js → chunk-HDB3UKUN.js} +3 -3
- package/dist/{chunk-4ALVWJTM.js.map → chunk-HDB3UKUN.js.map} +1 -1
- package/dist/{chunk-3EGNCMUX.js → chunk-IDJ7P2O3.js} +3 -3
- package/dist/{chunk-3EGNCMUX.js.map → chunk-IDJ7P2O3.js.map} +1 -1
- package/dist/{chunk-MQCVQCFA.js → chunk-NKLJMTAT.js} +23 -4
- package/dist/chunk-NKLJMTAT.js.map +1 -0
- package/dist/{chunk-4FJR2BZ7.js → chunk-OIBCAEQJ.js} +4 -4
- package/dist/{chunk-4FJR2BZ7.js.map → chunk-OIBCAEQJ.js.map} +1 -1
- package/dist/{chunk-5WRBQUS3.js → chunk-OOHO33FX.js} +3 -3
- package/dist/{chunk-5WRBQUS3.js.map → chunk-OOHO33FX.js.map} +1 -1
- package/dist/{chunk-QPL6BOLH.js → chunk-ROKCS4QL.js} +3 -3
- package/dist/{chunk-QPL6BOLH.js.map → chunk-ROKCS4QL.js.map} +1 -1
- package/dist/event-queue/index.js +3 -3
- package/dist/graph/index.js +4 -4
- package/dist/index.js +10 -10
- package/dist/init/index.js +1 -1
- package/dist/metrics/index.js +3 -51
- package/dist/metrics/index.js.map +1 -1
- package/dist/prisma/generator/index.js.map +1 -1
- package/dist/prisma/index.js +3 -3
- package/dist/server/index.js +15 -2
- package/dist/server/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/EventQueueFactory-2I4WASUN.js +0 -6
- package/dist/chunk-MQCVQCFA.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { EventPriority, EventsModule, ModuleEventsService, createConsumer, createModuleEventsService, createPublisher } 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 { EventPriority, EventsModule, ModuleEventsService, createConsumer, createModuleEventsService, createPublisher } from '../chunk-OIBCAEQJ.js';
|
|
2
|
+
export { GraphEventEmitterImpl, MemoryEventBus, MemoryEventConsumer, MemoryEventPublisher, MemoryEventQueue, createGraphEventEmitter2 as createGraphEventEmitter, createMemoryConsumer, createGraphEventEmitter as createMemoryGraphEventEmitter, createMemoryPublisher, getGraphEventEmitter, resetGraphEventEmitter } from '../chunk-HDB3UKUN.js';
|
|
3
|
+
export { EventQueueFactory, QueueType, RedisStreamsEventConsumer, RedisStreamsEventPublisher } from '../chunk-NKLJMTAT.js';
|
|
4
4
|
export { RedisStreamsConnection, dlqKey as redisDlqKey, streamKey as redisStreamKey } from '../chunk-MHNA7IS7.js';
|
|
5
5
|
import '../chunk-CBZNP6RF.js';
|
|
6
6
|
import '../chunk-XE4OXN2W.js';
|
package/dist/graph/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
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-
|
|
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-ROKCS4QL.js';
|
|
2
2
|
export { GraphRegistry, addGraphExtension, createEntityEvent, createRelationshipEvent, extractEntityTitle, extractMinimalFields, getCollectionForEntity, parseRelationship, shouldSyncEntity, shouldSyncRelationship } from '../chunk-Q23NPVWQ.js';
|
|
3
|
-
import '../chunk-
|
|
4
|
-
import '../chunk-
|
|
5
|
-
import '../chunk-
|
|
3
|
+
import '../chunk-OIBCAEQJ.js';
|
|
4
|
+
import '../chunk-HDB3UKUN.js';
|
|
5
|
+
import '../chunk-NKLJMTAT.js';
|
|
6
6
|
import '../chunk-MHNA7IS7.js';
|
|
7
7
|
import '../chunk-QGBXVNRM.js';
|
|
8
8
|
import '../chunk-YFOHAHZE.js';
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { ActivityModule, UsageModule, TrackerModule } from './chunk-XN3DNXXV.js';
|
|
2
2
|
export { ActivityModule, TrackerModule, UsageModule } from './chunk-XN3DNXXV.js';
|
|
3
|
-
export {
|
|
3
|
+
export { platform_exports as Platform } from './chunk-YCKM7FS7.js';
|
|
4
4
|
import { RBACModule } from './chunk-S32JOMMW.js';
|
|
5
5
|
export { RBACModule, createRBACDirective, createRBACDirectiveForLayer, createRBACDirectiveFromEnv } from './chunk-S32JOMMW.js';
|
|
6
6
|
export { RESOURCE_CAP_DEFAULTS, ResourceCapExceededError, ResourceCapsModule, getResourceCaps } from './chunk-VDDOGIWY.js';
|
|
7
|
-
import './chunk-MXLCLLCI.js';
|
|
8
7
|
export { sharing_exports as Sharing } from './chunk-XD5ZK727.js';
|
|
9
8
|
export { TemporalClient, TemporalClientFactory, TemporalModule, TemporalWorker, TemporalWorkerFactory, TemporalWorkerManager } from './chunk-IC7YDBGE.js';
|
|
10
9
|
export { instrumentation_exports as Instrumentation } from './chunk-ACYGOENW.js';
|
|
@@ -13,21 +12,22 @@ export { middleware_exports as Middleware } from './chunk-2HANKZZM.js';
|
|
|
13
12
|
import { TenantNotificationsModule, NotificationsModule } from './chunk-ZMCD5XAK.js';
|
|
14
13
|
export { tenant_notifications_exports as Notifications, NotificationsModule } from './chunk-ZMCD5XAK.js';
|
|
15
14
|
export { observability_exports as Observability } from './chunk-5LXDPGDH.js';
|
|
16
|
-
export {
|
|
15
|
+
export { prisma_exports as Prisma } from './chunk-IDJ7P2O3.js';
|
|
16
|
+
import './chunk-MXLCLLCI.js';
|
|
17
17
|
export { export_exports as Export } from './chunk-5BCCI2FV.js';
|
|
18
18
|
export { feature_flags_exports as FeatureFlags } from './chunk-MNKU7I2G.js';
|
|
19
|
-
import { GraphModule } from './chunk-
|
|
20
|
-
export { graph_exports as Graph, GraphModule } from './chunk-
|
|
19
|
+
import { GraphModule } from './chunk-ROKCS4QL.js';
|
|
20
|
+
export { graph_exports as Graph, GraphModule } from './chunk-ROKCS4QL.js';
|
|
21
21
|
import './chunk-Q23NPVWQ.js';
|
|
22
|
-
import { EventsModule } from './chunk-
|
|
23
|
-
export { event_queue_exports as EventQueue, EventsModule } from './chunk-
|
|
24
|
-
import './chunk-
|
|
25
|
-
import { QueueType, EventQueueFactory } from './chunk-
|
|
22
|
+
import { EventsModule } from './chunk-OIBCAEQJ.js';
|
|
23
|
+
export { event_queue_exports as EventQueue, EventsModule } from './chunk-OIBCAEQJ.js';
|
|
24
|
+
import './chunk-HDB3UKUN.js';
|
|
25
|
+
import { QueueType, EventQueueFactory } from './chunk-NKLJMTAT.js';
|
|
26
26
|
export { graphql_exports as GraphQL } from './chunk-X4NELQLV.js';
|
|
27
27
|
import './chunk-QLVKMWFA.js';
|
|
28
28
|
import './chunk-MHNA7IS7.js';
|
|
29
29
|
export { i18n_exports as I18n, createTranslator, getLanguage, getLocale, hasI18n, t } from './chunk-ULFFX3YE.js';
|
|
30
|
-
export { init_exports as Init } from './chunk-
|
|
30
|
+
export { init_exports as Init } from './chunk-OOHO33FX.js';
|
|
31
31
|
import { GatewayClient, GatewayError, GatewayErrorType } from './chunk-IDKU7OGF.js';
|
|
32
32
|
export { gateway_exports as Gateway } from './chunk-IDKU7OGF.js';
|
|
33
33
|
import './chunk-WHSIZCJX.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-OOHO33FX.js';
|
|
2
2
|
import '../chunk-IDKU7OGF.js';
|
|
3
3
|
import '../chunk-WHSIZCJX.js';
|
|
4
4
|
import '../chunk-UIMPJNWC.js';
|
package/dist/metrics/index.js
CHANGED
|
@@ -1,53 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
// src/metrics/workspace-quota-metrics.ts
|
|
5
|
-
var WorkspaceQuotaRegistry = class WorkspaceQuotaRegistry2 {
|
|
6
|
-
static {
|
|
7
|
-
__name(this, "WorkspaceQuotaRegistry");
|
|
8
|
-
}
|
|
9
|
-
collectors = [];
|
|
10
|
-
gauges = /* @__PURE__ */ new Map();
|
|
11
|
-
register(collector) {
|
|
12
|
-
this.collectors.push(collector);
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Runs all registered collectors and updates their gauges with fresh values.
|
|
16
|
-
* Gauges are created lazily on first collectAll() to ensure MetricsRegistry
|
|
17
|
-
* is initialized before gauge creation (instrumentation must be set up first).
|
|
18
|
-
*/
|
|
19
|
-
async collectAll() {
|
|
20
|
-
await Promise.allSettled(this.collectors.map(async (collector) => {
|
|
21
|
-
if (!this.gauges.has(collector.metricName)) {
|
|
22
|
-
this.gauges.set(collector.metricName, getMetricsRegistry().createGauge(collector.metricName, collector.help));
|
|
23
|
-
}
|
|
24
|
-
const gauge = this.gauges.get(collector.metricName);
|
|
25
|
-
if (!gauge) return;
|
|
26
|
-
const values = await collector.collect();
|
|
27
|
-
for (const [workspaceId, value] of values) {
|
|
28
|
-
gauge.set(value, {
|
|
29
|
-
workspace_id: workspaceId,
|
|
30
|
-
quota_name: collector.quotaName
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
}));
|
|
34
|
-
}
|
|
35
|
-
/** Returns registered collectors — useful for activity-svc to discover tracked quota names. */
|
|
36
|
-
getCollectors() {
|
|
37
|
-
return this.collectors;
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
var _registry = null;
|
|
41
|
-
function getWorkspaceQuotaRegistry() {
|
|
42
|
-
if (!_registry) _registry = new WorkspaceQuotaRegistry();
|
|
43
|
-
return _registry;
|
|
44
|
-
}
|
|
45
|
-
__name(getWorkspaceQuotaRegistry, "getWorkspaceQuotaRegistry");
|
|
46
|
-
function resetWorkspaceQuotaRegistry() {
|
|
47
|
-
_registry = null;
|
|
48
|
-
}
|
|
49
|
-
__name(resetWorkspaceQuotaRegistry, "resetWorkspaceQuotaRegistry");
|
|
50
|
-
|
|
51
|
-
export { getWorkspaceQuotaRegistry, resetWorkspaceQuotaRegistry };
|
|
1
|
+
export { getWorkspaceQuotaRegistry, resetWorkspaceQuotaRegistry } from '../chunk-32KT5RF2.js';
|
|
2
|
+
import '../chunk-REF7PANB.js';
|
|
3
|
+
import '../chunk-XE4OXN2W.js';
|
|
52
4
|
//# sourceMappingURL=index.js.map
|
|
53
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/prisma/generator/index.ts"],"names":["generatorHandler","generatorHelperPkg","validateOutputPath","outputPath","resolvedPath","resolve","endsWith","Error","dangerousPaths","some","dangerous","startsWith","safeMkdirSync","dirPath","mkdirSync","recursive","safeWriteFileSync","filePath","content","validatedPath","writeFileSync","onManifest","defaultOutput","prettyName","onGenerate","options","dmmf","generator","configuredPath","output","value","modelFieldsMap","model","datamodel","models","scalarFields","relationFields","field","fields","kind","push","name","relations","fileContent","generateTypeScriptFile","outputDir","dirname","modelCount","Object","keys","length","totalFields","values","reduce","sum","m","totalRelations","Date","toISOString","JSON","stringify"],"mappings":";;;;;;AAsBA,IAAM,EAAEA,kBAAgB,GAAKC,kBAAAA;AAS7B,SAASC,mBAAmBC,UAAAA,EAAkB;AAE5C,EAAA,MAAMC,YAAAA,GAAeC,QAAQF,UAAAA,CAAAA;AAG7B,EAAA,IAAI,CAACC,YAAAA,CAAaE,QAAAA,CAAS,KAAA,CAAA,EAAQ;AACjC,IAAA,MAAM,IAAIC,KAAAA,CAAM,CAAA,qBAAA,EAAwBJ,UAAAA,CAAAA,mBAAAA,CAA+B,CAAA;AACzE,EAAA;AAGA,EAAA,MAAMK,cAAAA,GAAiB;AAAC,IAAA,OAAA;AAAS,IAAA,OAAA;AAAS,IAAA,OAAA;AAAS,IAAA,QAAA;AAAU,IAAA,OAAA;AAAS,IAAA,QAAA;AAAU,IAAA,QAAA;AAAU,IAAA,OAAA;AAAS,IAAA;;AACnG,EAAA,IAAIA,cAAAA,CAAeC,KAAK,CAACC,SAAAA,KAAcN,aAAaO,UAAAA,CAAWD,SAAAA,CAAAA,CAAAA,EAAa;AAC1E,IAAA,MAAM,IAAIH,KAAAA,CAAM,CAAA,qBAAA,EAAwBJ,UAAAA,CAAAA,mCAAAA,CAA+C,CAAA;AACzF,EAAA;AAEA,EAAA,OAAOC,YAAAA;AACT;AAhBSF,MAAAA,CAAAA,kBAAAA,EAAAA,oBAAAA,CAAAA;AAsBT,SAASU,cAAcC,OAAAA,EAAe;AACpC,EAAA,MAAMT,YAAAA,GAAeC,QAAQQ,OAAAA,CAAA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AMD,GAAAA,GAAMC,CAAAA,CAAEb,SAAAA,CAAUQ,QAAQ,CAAA,CAAA;AAElG,EAAA,OAAO,CAAA;;;;;;oCAMU,IAAIO,IAAAA,EAAAA,EAAOC,WAAAA,EAAW;mBACtBX,UAAAA;0BACOI,WAAAA;4BACEK,cAAAA;;;;;;;;;;;;;;;;;;;;;;;;AAwBiBG,2CAAAA,EAAAA,IAAAA,CAAKC,SAAAA,CAAU7B,cAAAA,EAAgB,IAAA,EAAM,CAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4FlF;AAlISa,MAAAA,CAAAA,sBAAAA,EAAAA,wBAAAA,CAAAA","file":"index.js","sourcesContent":["#!/usr/bin/env node\n/**\n * Prisma Field Generator\n *\n * Generates a TypeScript file containing all model fields from Prisma schema.\n * This generator extracts DMMF information at build time and creates a static\n * mapping of model names to their fields, which can be used at runtime.\n *\n * Usage in schema.prisma:\n * ```prisma\n * generator fieldGenerator {\n * provider = \"burdenoff-prisma-field-generator\"\n * output = \"./src/generated/prisma-fields.ts\"\n * }\n * ```\n */\n\nimport generatorHelperPkg from '@prisma/generator-helper';\nimport { writeFileSync, mkdirSync } from 'node:fs';\nimport { dirname, resolve } from 'node:path';\nimport type { GeneratorOptions } from '@prisma/generator-helper';\n\nconst { generatorHandler } = generatorHelperPkg;\n\n/**\n * Validate and resolve output path from generator config\n * Ensures the path is safe and within expected boundaries\n *\n * @param outputPath The output path from generator config\n * @returns Resolved absolute path\n */\nfunction validateOutputPath(outputPath: string): string {\n // Resolve to absolute path\n const resolvedPath = resolve(outputPath);\n\n // Basic validation: ensure it's a TypeScript file\n if (!resolvedPath.endsWith('.ts')) {\n throw new Error(`Invalid output path: ${outputPath} must be a .ts file`);\n }\n\n // Ensure it doesn't try to write to system directories\n const dangerousPaths = ['/etc/', '/usr/', '/bin/', '/sbin/', '/var/', '/root/', '/boot/', '/sys/', '/proc/'];\n if (dangerousPaths.some((dangerous) => resolvedPath.startsWith(dangerous))) {\n throw new Error(`Invalid output path: ${outputPath} cannot write to system directories`);\n }\n\n return resolvedPath;\n}\n\n/**\n * Safely create directory with validated path\n * Path validation prevents directory traversal attacks\n */\nfunction safeMkdirSync(dirPath: string): void {\n const resolvedPath = resolve(dirPath);\n // Validate it's not a system directory\n const dangerousPaths = ['/etc/', '/usr/', '/bin/', '/sbin/', '/var/', '/root/', '/boot/', '/sys/', '/proc/'];\n if (dangerousPaths.some((dangerous) => resolvedPath.startsWith(dangerous))) {\n throw new Error(`Cannot create directory in system path: ${dirPath}`);\n }\n mkdirSync(resolvedPath, { recursive: true });\n}\n\n/**\n * Safely write file with validated path\n * Path validation prevents directory traversal attacks\n */\nfunction safeWriteFileSync(filePath: string, content: string): void {\n const validatedPath = validateOutputPath(filePath);\n writeFileSync(validatedPath, content, 'utf-8');\n}\n\ngeneratorHandler({\n onManifest() {\n return {\n defaultOutput: './src/generated/prisma-fields.ts',\n prettyName: 'Burdenoff Prisma Field Generator',\n };\n },\n\n async onGenerate(options: GeneratorOptions) {\n const { dmmf, generator } = options;\n const configuredPath = generator.output?.value || './src/generated/prisma-fields.ts';\n const outputPath = validateOutputPath(configuredPath);\n\n // Extract models and their fields\n const modelFieldsMap: Record<string, { fields: string[]; relations: string[] }> = {};\n\n for (const model of dmmf.datamodel.models) {\n const scalarFields: string[] = [];\n const relationFields: string[] = [];\n\n for (const field of model.fields) {\n if (field.kind === 'object') {\n // Relation field\n relationFields.push(field.name);\n } else {\n // Scalar field (string, int, DateTime, etc.)\n scalarFields.push(field.name);\n }\n }\n\n modelFieldsMap[model.name] = {\n fields: scalarFields,\n relations: relationFields,\n };\n }\n\n // Generate TypeScript file content\n const fileContent = generateTypeScriptFile(modelFieldsMap);\n\n // Ensure output directory exists (use validated path)\n const outputDir = dirname(outputPath);\n safeMkdirSync(outputDir);\n\n // Write file (use validated path)\n safeWriteFileSync(outputPath, fileContent);\n\n },\n});\n\n/**\n * Generate TypeScript file content\n */\nfunction generateTypeScriptFile(modelFieldsMap: Record<string, { fields: string[]; relations: string[] }>): string {\n const modelCount = Object.keys(modelFieldsMap).length;\n const totalFields = Object.values(modelFieldsMap).reduce((sum, m) => sum + m.fields.length, 0);\n const totalRelations = Object.values(modelFieldsMap).reduce((sum, m) => sum + m.relations.length, 0);\n\n return `/**\n * Auto-generated Prisma Model Fields\n *\n * This file is automatically generated by @burdenoff/be-sdk Prisma Field Generator\n * DO NOT EDIT MANUALLY - Changes will be overwritten on next generation\n *\n * Generated at: ${new Date().toISOString()}\n * Total models: ${modelCount}\n * Total scalar fields: ${totalFields}\n * Total relation fields: ${totalRelations}\n *\n * @packageDocumentation\n */\n\n/**\n * Type definition for model fields mapping\n */\nexport type ModelFieldsMap = Record<\n string,\n {\n /** Scalar fields (string, number, Date, etc.) */\n fields: string[];\n /** Relation fields (references to other models) */\n relations: string[];\n }\n>;\n\n/**\n * Mapping of all Prisma models to their fields\n *\n * This mapping is generated at build time from your Prisma schema\n * and contains all models with their scalar and relation fields.\n */\nexport const modelFields: ModelFieldsMap = ${JSON.stringify(modelFieldsMap, null, 2)} as const;\n\n/**\n * Get all scalar fields for a model\n *\n * @param modelName - Name of the Prisma model\n * @param includeRelations - Whether to include relation fields (default: false)\n * @returns Array of field names\n * @throws Error if model is not found\n *\n * @example\n * \\`\\`\\`typescript\n * const userFields = getModelFields('User');\n * // Returns: ['id', 'email', 'name', 'createdAt', 'updatedAt']\n *\n * const userFieldsWithRelations = getModelFields('User', true);\n * // Returns: ['id', 'email', 'name', 'createdAt', 'updatedAt', 'posts', 'profile']\n * \\`\\`\\`\n */\nexport function getModelFields(modelName: string, includeRelations = false): string[] {\n const model = modelFields[modelName];\n if (!model) {\n const available = Object.keys(modelFields).join(', ');\n throw new Error(\n \\`Model \"\\${modelName}\" not found in generated fields. Available models: \\${available}\\`\n );\n }\n\n return includeRelations ? [...model.fields, ...model.relations] : model.fields;\n}\n\n/**\n * Get all model names\n *\n * @returns Array of all available model names\n *\n * @example\n * \\`\\`\\`typescript\n * const models = getAllModelNames();\n * // Returns: ['User', 'Post', 'Comment', 'Tag', ...]\n * \\`\\`\\`\n */\nexport function getAllModelNames(): string[] {\n return Object.keys(modelFields);\n}\n\n/**\n * Check if a model exists in the schema\n *\n * @param modelName - Name of the model to check\n * @returns True if model exists, false otherwise\n *\n * @example\n * \\`\\`\\`typescript\n * if (hasModel('User')) {\n * const fields = getModelFields('User');\n * }\n * \\`\\`\\`\n */\nexport function hasModel(modelName: string): boolean {\n return modelName in modelFields;\n}\n\n/**\n * Get only scalar fields (excludes relations)\n *\n * @param modelName - Name of the Prisma model\n * @returns Array of scalar field names\n */\nexport function getScalarFields(modelName: string): string[] {\n return getModelFields(modelName, false);\n}\n\n/**\n * Get only relation fields\n *\n * @param modelName - Name of the Prisma model\n * @returns Array of relation field names\n */\nexport function getRelationFields(modelName: string): string[] {\n const model = modelFields[modelName];\n if (!model) {\n throw new Error(\\`Model \"\\${modelName}\" not found\\`);\n }\n return model.relations;\n}\n\n/**\n * Default export for convenience\n */\nexport default modelFields;\n`;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/prisma/generator/index.ts"],"names":["generatorHandler","generatorHelperPkg","validateOutputPath","outputPath","resolvedPath","resolve","endsWith","Error","dangerousPaths","some","dangerous","startsWith","safeMkdirSync","dirPath","mkdirSync","recursive","safeWriteFileSync","filePath","content","validatedPath","writeFileSync","onManifest","defaultOutput","prettyName","onGenerate","options","dmmf","generator","configuredPath","output","value","modelFieldsMap","model","datamodel","models","scalarFields","relationFields","field","fields","kind","push","name","relations","fileContent","generateTypeScriptFile","outputDir","dirname","modelCount","Object","keys","length","totalFields","values","reduce","sum","m","totalRelations","Date","toISOString","JSON","stringify"],"mappings":";;;;;;AAsBA,IAAM,EAAEA,kBAAgB,GAAKC,kBAAAA;AAS7B,SAASC,mBAAmBC,UAAAA,EAAkB;AAE5C,EAAA,MA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;;;AA4FlF;AAlISa,MAAAA,CAAAA,sBAAAA,EAAAA,wBAAAA,CAAAA","file":"index.js","sourcesContent":["#!/usr/bin/env node\n/**\n * Prisma Field Generator\n *\n * Generates a TypeScript file containing all model fields from Prisma schema.\n * This generator extracts DMMF information at build time and creates a static\n * mapping of model names to their fields, which can be used at runtime.\n *\n * Usage in schema.prisma:\n * ```prisma\n * generator fieldGenerator {\n * provider = \"burdenoff-prisma-field-generator\"\n * output = \"./src/generated/prisma-fields.ts\"\n * }\n * ```\n */\n\nimport generatorHelperPkg from '@prisma/generator-helper';\nimport { writeFileSync, mkdirSync } from 'node:fs';\nimport { dirname, resolve } from 'node:path';\nimport type { GeneratorOptions } from '@prisma/generator-helper';\n\nconst { generatorHandler } = generatorHelperPkg;\n\n/**\n * Validate and resolve output path from generator config\n * Ensures the path is safe and within expected boundaries\n *\n * @param outputPath The output path from generator config\n * @returns Resolved absolute path\n */\nfunction validateOutputPath(outputPath: string): string {\n // Resolve to absolute path\n const resolvedPath = resolve(outputPath);\n\n // Basic validation: ensure it's a TypeScript file\n if (!resolvedPath.endsWith('.ts')) {\n throw new Error(`Invalid output path: ${outputPath} must be a .ts file`);\n }\n\n // Ensure it doesn't try to write to system directories\n const dangerousPaths = ['/etc/', '/usr/', '/bin/', '/sbin/', '/var/', '/root/', '/boot/', '/sys/', '/proc/'];\n if (dangerousPaths.some((dangerous) => resolvedPath.startsWith(dangerous))) {\n throw new Error(`Invalid output path: ${outputPath} cannot write to system directories`);\n }\n\n return resolvedPath;\n}\n\n/**\n * Safely create directory with validated path\n * Path validation prevents directory traversal attacks\n */\nfunction safeMkdirSync(dirPath: string): void {\n const resolvedPath = resolve(dirPath);\n // Validate it's not a system directory\n const dangerousPaths = ['/etc/', '/usr/', '/bin/', '/sbin/', '/var/', '/root/', '/boot/', '/sys/', '/proc/'];\n if (dangerousPaths.some((dangerous) => resolvedPath.startsWith(dangerous))) {\n throw new Error(`Cannot create directory in system path: ${dirPath}`);\n }\n mkdirSync(resolvedPath, { recursive: true });\n}\n\n/**\n * Safely write file with validated path\n * Path validation prevents directory traversal attacks\n */\nfunction safeWriteFileSync(filePath: string, content: string): void {\n const validatedPath = validateOutputPath(filePath);\n writeFileSync(validatedPath, content, 'utf-8');\n}\n\ngeneratorHandler({\n onManifest() {\n return {\n defaultOutput: './src/generated/prisma-fields.ts',\n prettyName: 'Burdenoff Prisma Field Generator',\n };\n },\n\n async onGenerate(options: GeneratorOptions) {\n const { dmmf, generator } = options;\n const configuredPath = generator.output?.value || './src/generated/prisma-fields.ts';\n const outputPath = validateOutputPath(configuredPath);\n\n // Extract models and their fields\n const modelFieldsMap: Record<string, { fields: string[]; relations: string[] }> = {};\n\n for (const model of dmmf.datamodel.models) {\n const scalarFields: string[] = [];\n const relationFields: string[] = [];\n\n for (const field of model.fields) {\n if (field.kind === 'object') {\n // Relation field\n relationFields.push(field.name);\n } else {\n // Scalar field (string, int, DateTime, etc.)\n scalarFields.push(field.name);\n }\n }\n\n modelFieldsMap[model.name] = {\n fields: scalarFields,\n relations: relationFields,\n };\n }\n\n // Generate TypeScript file content\n const fileContent = generateTypeScriptFile(modelFieldsMap);\n\n // Ensure output directory exists (use validated path)\n const outputDir = dirname(outputPath);\n safeMkdirSync(outputDir);\n\n // Write file (use validated path)\n safeWriteFileSync(outputPath, fileContent);\n },\n});\n\n/**\n * Generate TypeScript file content\n */\nfunction generateTypeScriptFile(modelFieldsMap: Record<string, { fields: string[]; relations: string[] }>): string {\n const modelCount = Object.keys(modelFieldsMap).length;\n const totalFields = Object.values(modelFieldsMap).reduce((sum, m) => sum + m.fields.length, 0);\n const totalRelations = Object.values(modelFieldsMap).reduce((sum, m) => sum + m.relations.length, 0);\n\n return `/**\n * Auto-generated Prisma Model Fields\n *\n * This file is automatically generated by @burdenoff/be-sdk Prisma Field Generator\n * DO NOT EDIT MANUALLY - Changes will be overwritten on next generation\n *\n * Generated at: ${new Date().toISOString()}\n * Total models: ${modelCount}\n * Total scalar fields: ${totalFields}\n * Total relation fields: ${totalRelations}\n *\n * @packageDocumentation\n */\n\n/**\n * Type definition for model fields mapping\n */\nexport type ModelFieldsMap = Record<\n string,\n {\n /** Scalar fields (string, number, Date, etc.) */\n fields: string[];\n /** Relation fields (references to other models) */\n relations: string[];\n }\n>;\n\n/**\n * Mapping of all Prisma models to their fields\n *\n * This mapping is generated at build time from your Prisma schema\n * and contains all models with their scalar and relation fields.\n */\nexport const modelFields: ModelFieldsMap = ${JSON.stringify(modelFieldsMap, null, 2)} as const;\n\n/**\n * Get all scalar fields for a model\n *\n * @param modelName - Name of the Prisma model\n * @param includeRelations - Whether to include relation fields (default: false)\n * @returns Array of field names\n * @throws Error if model is not found\n *\n * @example\n * \\`\\`\\`typescript\n * const userFields = getModelFields('User');\n * // Returns: ['id', 'email', 'name', 'createdAt', 'updatedAt']\n *\n * const userFieldsWithRelations = getModelFields('User', true);\n * // Returns: ['id', 'email', 'name', 'createdAt', 'updatedAt', 'posts', 'profile']\n * \\`\\`\\`\n */\nexport function getModelFields(modelName: string, includeRelations = false): string[] {\n const model = modelFields[modelName];\n if (!model) {\n const available = Object.keys(modelFields).join(', ');\n throw new Error(\n \\`Model \"\\${modelName}\" not found in generated fields. Available models: \\${available}\\`\n );\n }\n\n return includeRelations ? [...model.fields, ...model.relations] : model.fields;\n}\n\n/**\n * Get all model names\n *\n * @returns Array of all available model names\n *\n * @example\n * \\`\\`\\`typescript\n * const models = getAllModelNames();\n * // Returns: ['User', 'Post', 'Comment', 'Tag', ...]\n * \\`\\`\\`\n */\nexport function getAllModelNames(): string[] {\n return Object.keys(modelFields);\n}\n\n/**\n * Check if a model exists in the schema\n *\n * @param modelName - Name of the model to check\n * @returns True if model exists, false otherwise\n *\n * @example\n * \\`\\`\\`typescript\n * if (hasModel('User')) {\n * const fields = getModelFields('User');\n * }\n * \\`\\`\\`\n */\nexport function hasModel(modelName: string): boolean {\n return modelName in modelFields;\n}\n\n/**\n * Get only scalar fields (excludes relations)\n *\n * @param modelName - Name of the Prisma model\n * @returns Array of scalar field names\n */\nexport function getScalarFields(modelName: string): string[] {\n return getModelFields(modelName, false);\n}\n\n/**\n * Get only relation fields\n *\n * @param modelName - Name of the Prisma model\n * @returns Array of relation field names\n */\nexport function getRelationFields(modelName: string): string[] {\n const model = modelFields[modelName];\n if (!model) {\n throw new Error(\\`Model \"\\${modelName}\" not found\\`);\n }\n return model.relations;\n}\n\n/**\n * Default export for convenience\n */\nexport default modelFields;\n`;\n}\n"]}
|
package/dist/prisma/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
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-IDJ7P2O3.js';
|
|
2
2
|
export { addWorkspaceExtension, getWorkspaceContext, injectWhereWorkspaceId, maybeSetRlsGuc, maybeTagConnection, setWorkspaceContext, withWorkspaceContext, withWorkspaceContextSync } from '../chunk-MXLCLLCI.js';
|
|
3
3
|
export { PrismaClientWrapper, configurePrismaLogging, createConnectionPool, createPrismaAdapter, createPrismaClient, ensureServiceApplicationName } from '../chunk-Q23NPVWQ.js';
|
|
4
|
-
import '../chunk-
|
|
5
|
-
import '../chunk-
|
|
4
|
+
import '../chunk-HDB3UKUN.js';
|
|
5
|
+
import '../chunk-NKLJMTAT.js';
|
|
6
6
|
import '../chunk-MHNA7IS7.js';
|
|
7
7
|
import '../chunk-CBZNP6RF.js';
|
|
8
8
|
import '../chunk-XE4OXN2W.js';
|
package/dist/server/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { createHumanReadableErrorPlugin, formatHttpError, normalizeGraphQLResponse, createHttpErrorResponse } from '../chunk-OQLDXOZ3.js';
|
|
2
2
|
export { UserFacingGraphQLError, createHttpErrorResponse, createHumanReadableErrorPlugin, createWorkspaceGuardPlugin, formatHttpError, normalizeError, normalizeExecutionResultErrors, normalizeGraphQLResponse, normalizeGraphQLResponsePayload, toUserFacingGraphQLError } from '../chunk-OQLDXOZ3.js';
|
|
3
|
+
import { getWorkspaceQuotaRegistry } from '../chunk-32KT5RF2.js';
|
|
4
|
+
import { getMetricsRegistry } from '../chunk-REF7PANB.js';
|
|
3
5
|
import { setWorkspaceContext } from '../chunk-MXLCLLCI.js';
|
|
4
6
|
import { I18n } from '../chunk-ULFFX3YE.js';
|
|
5
7
|
import { ContextManager } from '../chunk-RZOFS2BQ.js';
|
|
@@ -711,8 +713,19 @@ async function createServer(definition) {
|
|
|
711
713
|
});
|
|
712
714
|
} catch {
|
|
713
715
|
}
|
|
714
|
-
const
|
|
715
|
-
|
|
716
|
+
const promBody = await prom.register.metrics();
|
|
717
|
+
let sdkBody = "";
|
|
718
|
+
try {
|
|
719
|
+
await getWorkspaceQuotaRegistry().collectAll();
|
|
720
|
+
} catch {
|
|
721
|
+
}
|
|
722
|
+
try {
|
|
723
|
+
sdkBody = getMetricsRegistry().toPrometheusFormat();
|
|
724
|
+
} catch {
|
|
725
|
+
}
|
|
726
|
+
const combined = sdkBody ? `${promBody}
|
|
727
|
+
${sdkBody}` : promBody;
|
|
728
|
+
return new Response(combined, {
|
|
716
729
|
status: 200,
|
|
717
730
|
headers: {
|
|
718
731
|
"Content-Type": prom.register.contentType ?? "text/plain; version=0.0.4; charset=utf-8"
|