@lunora/codegen 1.0.0-alpha.39 → 1.0.0-alpha.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +61 -2
- package/dist/index.d.ts +61 -2
- package/dist/index.mjs +23 -23
- package/dist/packem_shared/{FLAGS_FILENAME-BjpS5w08.mjs → FLAGS_FILENAME-fEZtzWXi.mjs} +1 -1
- package/dist/packem_shared/{GENERATED_HEADER-x-bzN9wy.mjs → GENERATED_HEADER-cUyu5VOU.mjs} +1 -1
- package/dist/packem_shared/{LUNORA_ERROR_CODES-CySpQPD3.mjs → LUNORA_ERROR_CODES-DvTLozCu.mjs} +8 -1
- package/dist/packem_shared/{OPENRPC_VERSION-Ca1zCt-A.mjs → OPENRPC_VERSION-DxbqafcJ.mjs} +2 -2
- package/dist/packem_shared/{QUEUES_FILENAME-BF0iUmx7.mjs → QUEUES_FILENAME-Xv6Vy-Ku.mjs} +26 -0
- package/dist/packem_shared/{SCHEMA_SNAPSHOT_FILENAME-CTuUa9Ox.mjs → SCHEMA_SNAPSHOT_FILENAME-C1yHg38Z.mjs} +92 -83
- package/dist/packem_shared/{WORKFLOWS_FILENAME-CCC_42o3.mjs → WORKFLOWS_FILENAME-B2By8S4s.mjs} +28 -0
- package/dist/packem_shared/{buildOpenApiDocument-Bfq9qaTd.mjs → buildOpenApiDocument-_mwWOc2N.mjs} +2 -2
- package/dist/packem_shared/{discoverAuthApiCalls-URDoTADN.mjs → discoverAuthApiCalls-WMx8L2FG.mjs} +1 -1
- package/dist/packem_shared/{discoverCrons-BNL5hAPv.mjs → discoverCrons-D-jrpm97.mjs} +1 -1
- package/dist/packem_shared/{discoverFunctions-BJdF7lRs.mjs → discoverFunctions-CZ91aenA.mjs} +10 -6
- package/dist/packem_shared/{discoverHttpRoutes-CcwP-Rkr.mjs → discoverHttpRoutes-DNZLDCmm.mjs} +2 -2
- package/dist/packem_shared/{discoverInserts-BpFhM32L.mjs → discoverInserts-DFRJhmCv.mjs} +1 -1
- package/dist/packem_shared/{discoverMaskProcedures-DT-v8wvj.mjs → discoverMaskProcedures-B5iFnZ-X.mjs} +1 -1
- package/dist/packem_shared/{discoverMigrations-cG1idBVM.mjs → discoverMigrations-CdKtMlBc.mjs} +1 -1
- package/dist/packem_shared/{discoverNondeterministicCalls-CEOjmfk4.mjs → discoverNondeterministicCalls-C_PrQPkA.mjs} +1 -1
- package/dist/packem_shared/{discoverQueries-DeVBQVAG.mjs → discoverQueries-B8W9UPrt.mjs} +1 -1
- package/dist/packem_shared/{discoverR2sqlCalls-CWCAU-xJ.mjs → discoverR2sqlCalls-Bm7Rfnf4.mjs} +1 -1
- package/dist/packem_shared/{discoverRlsMetadata-BL0oukaK.mjs → discoverRlsMetadata-B4GL4ZKm.mjs} +1 -1
- package/dist/packem_shared/{discoverSchema-CeXJWVKV.mjs → discoverSchema-DFWVgU5o.mjs} +1 -1
- package/dist/packem_shared/{discoverStorageRulesMetadata-CFHByjIl.mjs → discoverStorageRulesMetadata-nosjYcvN.mjs} +1 -1
- package/dist/packem_shared/{emit-G43y_pKR.mjs → emit-CFz-9dcD.mjs} +1 -1
- package/dist/packem_shared/{emitApp-BgyRbMJU.mjs → emitApp-D8rVuM__.mjs} +1 -1
- package/dist/packem_shared/{formatAdvisories-DLIqHq5l.mjs → formatAdvisories-DRhEiJUz.mjs} +49 -49
- package/dist/packem_shared/{parse-validator-D6zI2i85.mjs → parse-validator-BSJo1HGP.mjs} +13 -3
- package/package.json +8 -8
package/dist/index.d.mts
CHANGED
|
@@ -1598,7 +1598,66 @@ interface ProjectIR {
|
|
|
1598
1598
|
* pass straight through without conversion. Returns the findings; surfacing them
|
|
1599
1599
|
* (console, error overlay, studio Advisors table) is the caller's choice.
|
|
1600
1600
|
*/
|
|
1601
|
-
|
|
1601
|
+
/**
|
|
1602
|
+
* Named inputs for {@link lintSchema}. Every feeder is a discrete key rather than
|
|
1603
|
+
* a positional argument: the feeder list grows every few releases and many IR
|
|
1604
|
+
* types are structurally similar (`{file, exportName, line}`-shaped evidence),
|
|
1605
|
+
* so a positional call was a silent-transposition hazard — swapping two adjacent
|
|
1606
|
+
* arguments could typecheck yet feed the wrong evidence to the wrong lint and
|
|
1607
|
+
* corrupt a security advisory. `schema` is the only required field; every other
|
|
1608
|
+
* feeder defaults to "not analyzed" when omitted.
|
|
1609
|
+
*/
|
|
1610
|
+
interface LintSchemaOptions {
|
|
1611
|
+
adminRoutes?: ReadonlyArray<AdminRouteIR>;
|
|
1612
|
+
aiRawRuns?: ReadonlyArray<AiRawRunIR>;
|
|
1613
|
+
aiToolSideEffects?: ReadonlyArray<AiToolSideEffectIR>;
|
|
1614
|
+
argumentDerivedFetches?: ReadonlyArray<ArgumentDerivedFetchIR>;
|
|
1615
|
+
argumentValidators?: ReadonlyArray<ArgumentValidatorIR>;
|
|
1616
|
+
authApiCalls?: ReadonlyArray<AuthApiCallIR>;
|
|
1617
|
+
authConfigs?: ReadonlyArray<AuthConfigIR>;
|
|
1618
|
+
browserUrlAccesses?: ReadonlyArray<BrowserUrlAccessIR>;
|
|
1619
|
+
configCalls?: ReadonlyArray<ConfigCallIR>;
|
|
1620
|
+
containerKeyAccesses?: ReadonlyArray<ContainerKeyAccessIR>;
|
|
1621
|
+
containerOverrides?: ReadonlyArray<ContainerOverrideIR>;
|
|
1622
|
+
containers?: ReadonlyArray<ContainerIR>;
|
|
1623
|
+
failOpenGuards?: ReadonlyArray<FailOpenGuardIR>;
|
|
1624
|
+
flagSecurityDefaults?: ReadonlyArray<FlagSecurityDefaultIR>;
|
|
1625
|
+
httpActionGuards?: ReadonlyArray<HttpActionGuardIR>;
|
|
1626
|
+
httpHeaderWrites?: ReadonlyArray<HttpHeaderWriteIR>;
|
|
1627
|
+
identityClaimReads?: ReadonlyArray<IdentityClaimReadIR>;
|
|
1628
|
+
imageDeliveryUrlAccesses?: ReadonlyArray<ImageDeliveryUrlAccessIR>;
|
|
1629
|
+
inserts?: ReadonlyArray<InsertWriteIR>;
|
|
1630
|
+
kvKeyAccesses?: ReadonlyArray<KvKeyAccessIR>;
|
|
1631
|
+
mailRecipientAccesses?: ReadonlyArray<MailRecipientAccessIR>;
|
|
1632
|
+
maskProcedures?: ReadonlyArray<MaskProcedureIR>;
|
|
1633
|
+
maskStrategies?: ReadonlyArray<MaskStrategyIR>;
|
|
1634
|
+
mutatorWrites?: ReadonlyArray<MutatorWriteIR>;
|
|
1635
|
+
nondeterministicCalls?: ReadonlyArray<NondeterministicCallIR>;
|
|
1636
|
+
normalizeIdAuthorizations?: ReadonlyArray<NormalizeIdAuthorizationIR>;
|
|
1637
|
+
ownerFieldWrites?: ReadonlyArray<OwnerFieldWriteIR>;
|
|
1638
|
+
paymentWebhooks?: ReadonlyArray<PaymentWebhookIR>;
|
|
1639
|
+
privilegedDispatches?: ReadonlyArray<PrivilegedDispatchIR>;
|
|
1640
|
+
procedureProtections?: ReadonlyArray<ProcedureMiddlewareIR>;
|
|
1641
|
+
queries?: ReadonlyArray<QueryReadIR>;
|
|
1642
|
+
queues?: ReadonlyArray<QueueIR>;
|
|
1643
|
+
r2sqlCalls?: ReadonlyArray<R2sqlCallIR>;
|
|
1644
|
+
ratelimitKeySelectors?: ReadonlyArray<RatelimitKeySelectorIR>;
|
|
1645
|
+
rawRowReturns?: ReadonlyArray<RawRowReturnIR>;
|
|
1646
|
+
relationLoads?: ReadonlyArray<RelationLoadIR>;
|
|
1647
|
+
rlsProcedures?: ReadonlyArray<RlsProcedureIR>;
|
|
1648
|
+
schema: SchemaIR;
|
|
1649
|
+
secretLiterals?: ReadonlyArray<SecretLiteralIR>;
|
|
1650
|
+
shapes?: ReadonlyArray<ShapeIR>;
|
|
1651
|
+
softDeleteReads?: ReadonlyArray<SoftDeleteReadIR>;
|
|
1652
|
+
sqlInterpolations?: ReadonlyArray<SqlInterpolationIR>;
|
|
1653
|
+
storageKeyAccesses?: ReadonlyArray<StorageKeyAccessIR>;
|
|
1654
|
+
storageUploads?: ReadonlyArray<StorageUploadIR>;
|
|
1655
|
+
vectorNamespaceAccesses?: ReadonlyArray<VectorNamespaceAccessIR>;
|
|
1656
|
+
workflowCalls?: ReadonlyArray<WorkflowCallIR>;
|
|
1657
|
+
workflows?: ReadonlyArray<WorkflowIR>;
|
|
1658
|
+
wranglerVariables?: ReadonlyArray<WranglerVariableIR>;
|
|
1659
|
+
}
|
|
1660
|
+
declare const lintSchema: (options: LintSchemaOptions) => Finding[];
|
|
1602
1661
|
/**
|
|
1603
1662
|
* Render advisor findings as a single multi-line string for console surfacing:
|
|
1604
1663
|
* a one-line summary header followed by one `[LEVEL] name: detail` line per
|
|
@@ -2602,4 +2661,4 @@ declare const secretKindOf: (value: string) => string | undefined;
|
|
|
2602
2661
|
/** A redacted preview of a secret value — first 4 chars plus its length, never the full value. */
|
|
2603
2662
|
declare const redact: (value: string) => string;
|
|
2604
2663
|
declare const VERSION = "0.0.0";
|
|
2605
|
-
export { type AuthApiCallIR, CONTAINERS_FILENAME, CodegenDiagnosticError, type CodegenOptions, type CodegenResult, type ContainerIR, type CronJobIR, type DriftChange, type EmitAppOptions, FLAGS_FILENAME, type FieldSnapshot, type FlagsIR, type FunctionIR, GENERATED_HEADER, type HttpRouteIR, type IndexIR, type IndexSnapshot, type InsertWriteIR, LUNORA_ERROR_CODES, MUTATORS_FILENAME, type MaskProcedureIR, type MigrationIR, type MutatorIR, OPENRPC_VERSION, type OpenApiEmitInput, type OpenRpcEmitInput, type ProjectIR, QUEUES_FILENAME, type QueryReadIR, type QueueIR, type R2sqlCallIR, type RelationSnapshot, type RlsMetadataIR, type RlsPolicyIR, type RlsProcedureIR, type RlsRoleIR, SCHEMA_SNAPSHOT_FILENAME, SCHEMA_SNAPSHOT_VERSION, SHAPES_FILENAME, type SchemaDrift, type SchemaDriftDecision, type SchemaIR, type SchemaSnapshot, SchemaSnapshotParseError, type ShapeIR, type StorageRuleIR, type StorageRulesMetadataIR, type TableIR, type TableSnapshot, VERSION, type ValidatorIR, type VectorIndexIR, WORKFLOWS_FILENAME, type WorkflowIR, type WranglerVariableIR, buildOpenApiDocument, buildOpenRpcDocument, buildSchemaSnapshot, createCodegenProject, diagnosticAt, diffSchemaSnapshots, discoverAuthApiCalls, discoverContainers, discoverCrons, discoverFlags, discoverFunctions, discoverHttpRoutes, discoverInserts, discoverMaskProcedures, discoverMigrations, discoverMutators, discoverNondeterministicCalls, discoverQueries, discoverQueues, discoverR2sqlCalls, discoverRlsMetadata, discoverRlsProcedures, discoverSchema, discoverShapes, discoverStorageRulesMetadata, discoverWorkflows, emitApi, emitApp, emitCollections, emitContainers, emitCrons, emitDataModel, emitDrizzleSchema, emitFunctions, emitOpenApi, emitOpenApiModule, emitOpenRpc, emitOpenRpcModule, emitServer, emitShard, emitVectors, emitWorkflows, emitWranglerCronTriggers, evaluateSchemaDrift, formatAdvisories, lintSchema, parseSchemaSnapshot, redact, refreshCodegenProject, runCodegen, schemaFromIr, secretKindOf, serializeSchemaSnapshot, validatorIrToJsonSchema };
|
|
2664
|
+
export { type AuthApiCallIR, CONTAINERS_FILENAME, CodegenDiagnosticError, type CodegenOptions, type CodegenResult, type ContainerIR, type CronJobIR, type DriftChange, type EmitAppOptions, FLAGS_FILENAME, type FieldSnapshot, type FlagsIR, type FunctionIR, GENERATED_HEADER, type HttpRouteIR, type IndexIR, type IndexSnapshot, type InsertWriteIR, LUNORA_ERROR_CODES, type LintSchemaOptions, MUTATORS_FILENAME, type MaskProcedureIR, type MigrationIR, type MutatorIR, OPENRPC_VERSION, type OpenApiEmitInput, type OpenRpcEmitInput, type ProjectIR, QUEUES_FILENAME, type QueryReadIR, type QueueIR, type R2sqlCallIR, type RelationSnapshot, type RlsMetadataIR, type RlsPolicyIR, type RlsProcedureIR, type RlsRoleIR, SCHEMA_SNAPSHOT_FILENAME, SCHEMA_SNAPSHOT_VERSION, SHAPES_FILENAME, type SchemaDrift, type SchemaDriftDecision, type SchemaIR, type SchemaSnapshot, SchemaSnapshotParseError, type ShapeIR, type StorageRuleIR, type StorageRulesMetadataIR, type TableIR, type TableSnapshot, VERSION, type ValidatorIR, type VectorIndexIR, WORKFLOWS_FILENAME, type WorkflowIR, type WranglerVariableIR, buildOpenApiDocument, buildOpenRpcDocument, buildSchemaSnapshot, createCodegenProject, diagnosticAt, diffSchemaSnapshots, discoverAuthApiCalls, discoverContainers, discoverCrons, discoverFlags, discoverFunctions, discoverHttpRoutes, discoverInserts, discoverMaskProcedures, discoverMigrations, discoverMutators, discoverNondeterministicCalls, discoverQueries, discoverQueues, discoverR2sqlCalls, discoverRlsMetadata, discoverRlsProcedures, discoverSchema, discoverShapes, discoverStorageRulesMetadata, discoverWorkflows, emitApi, emitApp, emitCollections, emitContainers, emitCrons, emitDataModel, emitDrizzleSchema, emitFunctions, emitOpenApi, emitOpenApiModule, emitOpenRpc, emitOpenRpcModule, emitServer, emitShard, emitVectors, emitWorkflows, emitWranglerCronTriggers, evaluateSchemaDrift, formatAdvisories, lintSchema, parseSchemaSnapshot, redact, refreshCodegenProject, runCodegen, schemaFromIr, secretKindOf, serializeSchemaSnapshot, validatorIrToJsonSchema };
|
package/dist/index.d.ts
CHANGED
|
@@ -1598,7 +1598,66 @@ interface ProjectIR {
|
|
|
1598
1598
|
* pass straight through without conversion. Returns the findings; surfacing them
|
|
1599
1599
|
* (console, error overlay, studio Advisors table) is the caller's choice.
|
|
1600
1600
|
*/
|
|
1601
|
-
|
|
1601
|
+
/**
|
|
1602
|
+
* Named inputs for {@link lintSchema}. Every feeder is a discrete key rather than
|
|
1603
|
+
* a positional argument: the feeder list grows every few releases and many IR
|
|
1604
|
+
* types are structurally similar (`{file, exportName, line}`-shaped evidence),
|
|
1605
|
+
* so a positional call was a silent-transposition hazard — swapping two adjacent
|
|
1606
|
+
* arguments could typecheck yet feed the wrong evidence to the wrong lint and
|
|
1607
|
+
* corrupt a security advisory. `schema` is the only required field; every other
|
|
1608
|
+
* feeder defaults to "not analyzed" when omitted.
|
|
1609
|
+
*/
|
|
1610
|
+
interface LintSchemaOptions {
|
|
1611
|
+
adminRoutes?: ReadonlyArray<AdminRouteIR>;
|
|
1612
|
+
aiRawRuns?: ReadonlyArray<AiRawRunIR>;
|
|
1613
|
+
aiToolSideEffects?: ReadonlyArray<AiToolSideEffectIR>;
|
|
1614
|
+
argumentDerivedFetches?: ReadonlyArray<ArgumentDerivedFetchIR>;
|
|
1615
|
+
argumentValidators?: ReadonlyArray<ArgumentValidatorIR>;
|
|
1616
|
+
authApiCalls?: ReadonlyArray<AuthApiCallIR>;
|
|
1617
|
+
authConfigs?: ReadonlyArray<AuthConfigIR>;
|
|
1618
|
+
browserUrlAccesses?: ReadonlyArray<BrowserUrlAccessIR>;
|
|
1619
|
+
configCalls?: ReadonlyArray<ConfigCallIR>;
|
|
1620
|
+
containerKeyAccesses?: ReadonlyArray<ContainerKeyAccessIR>;
|
|
1621
|
+
containerOverrides?: ReadonlyArray<ContainerOverrideIR>;
|
|
1622
|
+
containers?: ReadonlyArray<ContainerIR>;
|
|
1623
|
+
failOpenGuards?: ReadonlyArray<FailOpenGuardIR>;
|
|
1624
|
+
flagSecurityDefaults?: ReadonlyArray<FlagSecurityDefaultIR>;
|
|
1625
|
+
httpActionGuards?: ReadonlyArray<HttpActionGuardIR>;
|
|
1626
|
+
httpHeaderWrites?: ReadonlyArray<HttpHeaderWriteIR>;
|
|
1627
|
+
identityClaimReads?: ReadonlyArray<IdentityClaimReadIR>;
|
|
1628
|
+
imageDeliveryUrlAccesses?: ReadonlyArray<ImageDeliveryUrlAccessIR>;
|
|
1629
|
+
inserts?: ReadonlyArray<InsertWriteIR>;
|
|
1630
|
+
kvKeyAccesses?: ReadonlyArray<KvKeyAccessIR>;
|
|
1631
|
+
mailRecipientAccesses?: ReadonlyArray<MailRecipientAccessIR>;
|
|
1632
|
+
maskProcedures?: ReadonlyArray<MaskProcedureIR>;
|
|
1633
|
+
maskStrategies?: ReadonlyArray<MaskStrategyIR>;
|
|
1634
|
+
mutatorWrites?: ReadonlyArray<MutatorWriteIR>;
|
|
1635
|
+
nondeterministicCalls?: ReadonlyArray<NondeterministicCallIR>;
|
|
1636
|
+
normalizeIdAuthorizations?: ReadonlyArray<NormalizeIdAuthorizationIR>;
|
|
1637
|
+
ownerFieldWrites?: ReadonlyArray<OwnerFieldWriteIR>;
|
|
1638
|
+
paymentWebhooks?: ReadonlyArray<PaymentWebhookIR>;
|
|
1639
|
+
privilegedDispatches?: ReadonlyArray<PrivilegedDispatchIR>;
|
|
1640
|
+
procedureProtections?: ReadonlyArray<ProcedureMiddlewareIR>;
|
|
1641
|
+
queries?: ReadonlyArray<QueryReadIR>;
|
|
1642
|
+
queues?: ReadonlyArray<QueueIR>;
|
|
1643
|
+
r2sqlCalls?: ReadonlyArray<R2sqlCallIR>;
|
|
1644
|
+
ratelimitKeySelectors?: ReadonlyArray<RatelimitKeySelectorIR>;
|
|
1645
|
+
rawRowReturns?: ReadonlyArray<RawRowReturnIR>;
|
|
1646
|
+
relationLoads?: ReadonlyArray<RelationLoadIR>;
|
|
1647
|
+
rlsProcedures?: ReadonlyArray<RlsProcedureIR>;
|
|
1648
|
+
schema: SchemaIR;
|
|
1649
|
+
secretLiterals?: ReadonlyArray<SecretLiteralIR>;
|
|
1650
|
+
shapes?: ReadonlyArray<ShapeIR>;
|
|
1651
|
+
softDeleteReads?: ReadonlyArray<SoftDeleteReadIR>;
|
|
1652
|
+
sqlInterpolations?: ReadonlyArray<SqlInterpolationIR>;
|
|
1653
|
+
storageKeyAccesses?: ReadonlyArray<StorageKeyAccessIR>;
|
|
1654
|
+
storageUploads?: ReadonlyArray<StorageUploadIR>;
|
|
1655
|
+
vectorNamespaceAccesses?: ReadonlyArray<VectorNamespaceAccessIR>;
|
|
1656
|
+
workflowCalls?: ReadonlyArray<WorkflowCallIR>;
|
|
1657
|
+
workflows?: ReadonlyArray<WorkflowIR>;
|
|
1658
|
+
wranglerVariables?: ReadonlyArray<WranglerVariableIR>;
|
|
1659
|
+
}
|
|
1660
|
+
declare const lintSchema: (options: LintSchemaOptions) => Finding[];
|
|
1602
1661
|
/**
|
|
1603
1662
|
* Render advisor findings as a single multi-line string for console surfacing:
|
|
1604
1663
|
* a one-line summary header followed by one `[LEVEL] name: detail` line per
|
|
@@ -2602,4 +2661,4 @@ declare const secretKindOf: (value: string) => string | undefined;
|
|
|
2602
2661
|
/** A redacted preview of a secret value — first 4 chars plus its length, never the full value. */
|
|
2603
2662
|
declare const redact: (value: string) => string;
|
|
2604
2663
|
declare const VERSION = "0.0.0";
|
|
2605
|
-
export { type AuthApiCallIR, CONTAINERS_FILENAME, CodegenDiagnosticError, type CodegenOptions, type CodegenResult, type ContainerIR, type CronJobIR, type DriftChange, type EmitAppOptions, FLAGS_FILENAME, type FieldSnapshot, type FlagsIR, type FunctionIR, GENERATED_HEADER, type HttpRouteIR, type IndexIR, type IndexSnapshot, type InsertWriteIR, LUNORA_ERROR_CODES, MUTATORS_FILENAME, type MaskProcedureIR, type MigrationIR, type MutatorIR, OPENRPC_VERSION, type OpenApiEmitInput, type OpenRpcEmitInput, type ProjectIR, QUEUES_FILENAME, type QueryReadIR, type QueueIR, type R2sqlCallIR, type RelationSnapshot, type RlsMetadataIR, type RlsPolicyIR, type RlsProcedureIR, type RlsRoleIR, SCHEMA_SNAPSHOT_FILENAME, SCHEMA_SNAPSHOT_VERSION, SHAPES_FILENAME, type SchemaDrift, type SchemaDriftDecision, type SchemaIR, type SchemaSnapshot, SchemaSnapshotParseError, type ShapeIR, type StorageRuleIR, type StorageRulesMetadataIR, type TableIR, type TableSnapshot, VERSION, type ValidatorIR, type VectorIndexIR, WORKFLOWS_FILENAME, type WorkflowIR, type WranglerVariableIR, buildOpenApiDocument, buildOpenRpcDocument, buildSchemaSnapshot, createCodegenProject, diagnosticAt, diffSchemaSnapshots, discoverAuthApiCalls, discoverContainers, discoverCrons, discoverFlags, discoverFunctions, discoverHttpRoutes, discoverInserts, discoverMaskProcedures, discoverMigrations, discoverMutators, discoverNondeterministicCalls, discoverQueries, discoverQueues, discoverR2sqlCalls, discoverRlsMetadata, discoverRlsProcedures, discoverSchema, discoverShapes, discoverStorageRulesMetadata, discoverWorkflows, emitApi, emitApp, emitCollections, emitContainers, emitCrons, emitDataModel, emitDrizzleSchema, emitFunctions, emitOpenApi, emitOpenApiModule, emitOpenRpc, emitOpenRpcModule, emitServer, emitShard, emitVectors, emitWorkflows, emitWranglerCronTriggers, evaluateSchemaDrift, formatAdvisories, lintSchema, parseSchemaSnapshot, redact, refreshCodegenProject, runCodegen, schemaFromIr, secretKindOf, serializeSchemaSnapshot, validatorIrToJsonSchema };
|
|
2664
|
+
export { type AuthApiCallIR, CONTAINERS_FILENAME, CodegenDiagnosticError, type CodegenOptions, type CodegenResult, type ContainerIR, type CronJobIR, type DriftChange, type EmitAppOptions, FLAGS_FILENAME, type FieldSnapshot, type FlagsIR, type FunctionIR, GENERATED_HEADER, type HttpRouteIR, type IndexIR, type IndexSnapshot, type InsertWriteIR, LUNORA_ERROR_CODES, type LintSchemaOptions, MUTATORS_FILENAME, type MaskProcedureIR, type MigrationIR, type MutatorIR, OPENRPC_VERSION, type OpenApiEmitInput, type OpenRpcEmitInput, type ProjectIR, QUEUES_FILENAME, type QueryReadIR, type QueueIR, type R2sqlCallIR, type RelationSnapshot, type RlsMetadataIR, type RlsPolicyIR, type RlsProcedureIR, type RlsRoleIR, SCHEMA_SNAPSHOT_FILENAME, SCHEMA_SNAPSHOT_VERSION, SHAPES_FILENAME, type SchemaDrift, type SchemaDriftDecision, type SchemaIR, type SchemaSnapshot, SchemaSnapshotParseError, type ShapeIR, type StorageRuleIR, type StorageRulesMetadataIR, type TableIR, type TableSnapshot, VERSION, type ValidatorIR, type VectorIndexIR, WORKFLOWS_FILENAME, type WorkflowIR, type WranglerVariableIR, buildOpenApiDocument, buildOpenRpcDocument, buildSchemaSnapshot, createCodegenProject, diagnosticAt, diffSchemaSnapshots, discoverAuthApiCalls, discoverContainers, discoverCrons, discoverFlags, discoverFunctions, discoverHttpRoutes, discoverInserts, discoverMaskProcedures, discoverMigrations, discoverMutators, discoverNondeterministicCalls, discoverQueries, discoverQueues, discoverR2sqlCalls, discoverRlsMetadata, discoverRlsProcedures, discoverSchema, discoverShapes, discoverStorageRulesMetadata, discoverWorkflows, emitApi, emitApp, emitCollections, emitContainers, emitCrons, emitDataModel, emitDrizzleSchema, emitFunctions, emitOpenApi, emitOpenApiModule, emitOpenRpc, emitOpenRpcModule, emitServer, emitShard, emitVectors, emitWorkflows, emitWranglerCronTriggers, evaluateSchemaDrift, formatAdvisories, lintSchema, parseSchemaSnapshot, redact, refreshCodegenProject, runCodegen, schemaFromIr, secretKindOf, serializeSchemaSnapshot, validatorIrToJsonSchema };
|
package/dist/index.mjs
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
export { formatAdvisories, lintSchema } from './packem_shared/formatAdvisories-
|
|
1
|
+
export { formatAdvisories, lintSchema } from './packem_shared/formatAdvisories-DRhEiJUz.mjs';
|
|
2
2
|
export { CodegenDiagnosticError, diagnosticAt } from './packem_shared/CodegenDiagnosticError-DyQ5FwkM.mjs';
|
|
3
|
-
export { default as discoverAuthApiCalls } from './packem_shared/discoverAuthApiCalls-
|
|
3
|
+
export { default as discoverAuthApiCalls } from './packem_shared/discoverAuthApiCalls-WMx8L2FG.mjs';
|
|
4
4
|
export { CONTAINERS_FILENAME, discoverContainers } from './packem_shared/CONTAINERS_FILENAME-DjpXMqhp.mjs';
|
|
5
|
-
export { default as discoverCrons } from './packem_shared/discoverCrons-
|
|
6
|
-
export { FLAGS_FILENAME, discoverFlags } from './packem_shared/FLAGS_FILENAME-
|
|
7
|
-
export { discoverFunctions } from './packem_shared/discoverFunctions-
|
|
8
|
-
export { default as discoverHttpRoutes } from './packem_shared/discoverHttpRoutes-
|
|
9
|
-
export { default as discoverInserts } from './packem_shared/discoverInserts-
|
|
10
|
-
export { default as discoverMaskProcedures } from './packem_shared/discoverMaskProcedures-
|
|
11
|
-
export { default as discoverMigrations } from './packem_shared/discoverMigrations-
|
|
5
|
+
export { default as discoverCrons } from './packem_shared/discoverCrons-D-jrpm97.mjs';
|
|
6
|
+
export { FLAGS_FILENAME, discoverFlags } from './packem_shared/FLAGS_FILENAME-fEZtzWXi.mjs';
|
|
7
|
+
export { discoverFunctions } from './packem_shared/discoverFunctions-CZ91aenA.mjs';
|
|
8
|
+
export { default as discoverHttpRoutes } from './packem_shared/discoverHttpRoutes-DNZLDCmm.mjs';
|
|
9
|
+
export { default as discoverInserts } from './packem_shared/discoverInserts-DFRJhmCv.mjs';
|
|
10
|
+
export { default as discoverMaskProcedures } from './packem_shared/discoverMaskProcedures-B5iFnZ-X.mjs';
|
|
11
|
+
export { default as discoverMigrations } from './packem_shared/discoverMigrations-CdKtMlBc.mjs';
|
|
12
12
|
export { MUTATORS_FILENAME, discoverMutators } from './packem_shared/MUTATORS_FILENAME-BZOfUhlY.mjs';
|
|
13
|
-
export { default as discoverNondeterministicCalls } from './packem_shared/discoverNondeterministicCalls-
|
|
14
|
-
export { default as discoverQueries } from './packem_shared/discoverQueries-
|
|
15
|
-
export { QUEUES_FILENAME, discoverQueues } from './packem_shared/QUEUES_FILENAME-
|
|
16
|
-
export { default as discoverR2sqlCalls } from './packem_shared/discoverR2sqlCalls-
|
|
17
|
-
export { discoverRlsMetadata, default as discoverRlsProcedures } from './packem_shared/discoverRlsMetadata-
|
|
18
|
-
export { default as discoverSchema } from './packem_shared/discoverSchema-
|
|
13
|
+
export { default as discoverNondeterministicCalls } from './packem_shared/discoverNondeterministicCalls-C_PrQPkA.mjs';
|
|
14
|
+
export { default as discoverQueries } from './packem_shared/discoverQueries-B8W9UPrt.mjs';
|
|
15
|
+
export { QUEUES_FILENAME, discoverQueues } from './packem_shared/QUEUES_FILENAME-Xv6Vy-Ku.mjs';
|
|
16
|
+
export { default as discoverR2sqlCalls } from './packem_shared/discoverR2sqlCalls-Bm7Rfnf4.mjs';
|
|
17
|
+
export { discoverRlsMetadata, default as discoverRlsProcedures } from './packem_shared/discoverRlsMetadata-B4GL4ZKm.mjs';
|
|
18
|
+
export { default as discoverSchema } from './packem_shared/discoverSchema-DFWVgU5o.mjs';
|
|
19
19
|
export { SHAPES_FILENAME, discoverShapes } from './packem_shared/SHAPES_FILENAME-DOhPGi-6.mjs';
|
|
20
|
-
export { default as discoverStorageRulesMetadata } from './packem_shared/discoverStorageRulesMetadata-
|
|
21
|
-
export { WORKFLOWS_FILENAME, discoverWorkflows } from './packem_shared/WORKFLOWS_FILENAME-
|
|
22
|
-
export { G as GENERATED_HEADER, e as emitApi, a as emitCollections, b as emitContainers, c as emitCrons, d as emitDataModel, f as emitDrizzleSchema, g as emitFunctions, h as emitServer, i as emitShard, j as emitVectors, k as emitWorkflows, l as emitWranglerCronTriggers } from './packem_shared/emit-
|
|
23
|
-
export { emitApp } from './packem_shared/emitApp-
|
|
24
|
-
export { buildOpenApiDocument, emitOpenApi, emitOpenApiModule } from './packem_shared/buildOpenApiDocument-
|
|
25
|
-
export { OPENRPC_VERSION, buildOpenRpcDocument, emitOpenRpc, emitOpenRpcModule } from './packem_shared/OPENRPC_VERSION-
|
|
26
|
-
export { SCHEMA_SNAPSHOT_FILENAME, createCodegenProject, refreshCodegenProject, runCodegen } from './packem_shared/SCHEMA_SNAPSHOT_FILENAME-
|
|
20
|
+
export { default as discoverStorageRulesMetadata } from './packem_shared/discoverStorageRulesMetadata-nosjYcvN.mjs';
|
|
21
|
+
export { WORKFLOWS_FILENAME, discoverWorkflows } from './packem_shared/WORKFLOWS_FILENAME-B2By8S4s.mjs';
|
|
22
|
+
export { G as GENERATED_HEADER, e as emitApi, a as emitCollections, b as emitContainers, c as emitCrons, d as emitDataModel, f as emitDrizzleSchema, g as emitFunctions, h as emitServer, i as emitShard, j as emitVectors, k as emitWorkflows, l as emitWranglerCronTriggers } from './packem_shared/emit-CFz-9dcD.mjs';
|
|
23
|
+
export { emitApp } from './packem_shared/emitApp-D8rVuM__.mjs';
|
|
24
|
+
export { buildOpenApiDocument, emitOpenApi, emitOpenApiModule } from './packem_shared/buildOpenApiDocument-_mwWOc2N.mjs';
|
|
25
|
+
export { OPENRPC_VERSION, buildOpenRpcDocument, emitOpenRpc, emitOpenRpcModule } from './packem_shared/OPENRPC_VERSION-DxbqafcJ.mjs';
|
|
26
|
+
export { SCHEMA_SNAPSHOT_FILENAME, createCodegenProject, refreshCodegenProject, runCodegen } from './packem_shared/SCHEMA_SNAPSHOT_FILENAME-C1yHg38Z.mjs';
|
|
27
27
|
export { SCHEMA_SNAPSHOT_VERSION, SchemaSnapshotParseError, buildSchemaSnapshot, diffSchemaSnapshots, evaluateSchemaDrift, parseSchemaSnapshot, serializeSchemaSnapshot } from './packem_shared/SCHEMA_SNAPSHOT_VERSION-D0ARY6rL.mjs';
|
|
28
28
|
export { schemaFromIr } from './packem_shared/schemaFromIr-DTYsLBaA.mjs';
|
|
29
|
-
export { LUNORA_ERROR_CODES, validatorIrToJsonSchema } from './packem_shared/LUNORA_ERROR_CODES-
|
|
29
|
+
export { LUNORA_ERROR_CODES, validatorIrToJsonSchema } from './packem_shared/LUNORA_ERROR_CODES-DvTLozCu.mjs';
|
|
30
30
|
export { redact, secretKindOf } from './packem_shared/redact-oTmsol5A.mjs';
|
|
31
31
|
export { MESSAGE_SOLUTIONS as LUNORA_SOLUTION_RULES, findSolutionByMessage as findLunoraSolution } from '@lunora/errors';
|
|
32
32
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { existsSync } from 'node:fs';
|
|
2
2
|
import { join } from 'node:path';
|
|
3
3
|
import { SyntaxKind, Node } from 'ts-morph';
|
|
4
|
-
import { listLunoraSourceFiles } from './discoverFunctions-
|
|
4
|
+
import { listLunoraSourceFiles } from './discoverFunctions-CZ91aenA.mjs';
|
|
5
5
|
|
|
6
6
|
const FLAGS_FILENAME = "flags.ts";
|
|
7
7
|
const FLAG_TYPES = /* @__PURE__ */ new Set(["boolean", "number", "object", "string"]);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import '@lunora/errors';
|
|
2
|
-
export { G as GENERATED_HEADER, m as buildStorageColumns, e as emitApi, a as emitCollections, b as emitContainers, c as emitCrons, d as emitDataModel, f as emitDrizzleSchema, g as emitFunctions, n as emitQueues, o as emitSeed, h as emitServer, i as emitShard, j as emitVectors, k as emitWorkflows, l as emitWranglerCronTriggers } from './emit-
|
|
2
|
+
export { G as GENERATED_HEADER, m as buildStorageColumns, e as emitApi, a as emitCollections, b as emitContainers, c as emitCrons, d as emitDataModel, f as emitDrizzleSchema, g as emitFunctions, n as emitQueues, o as emitSeed, h as emitServer, i as emitShard, j as emitVectors, k as emitWorkflows, l as emitWranglerCronTriggers } from './emit-CFz-9dcD.mjs';
|
|
3
3
|
import './paths-BRd6JHuF.mjs';
|
package/dist/packem_shared/{LUNORA_ERROR_CODES-CySpQPD3.mjs → LUNORA_ERROR_CODES-DvTLozCu.mjs}
RENAMED
|
@@ -14,7 +14,14 @@ const literalConst = (literalValue) => {
|
|
|
14
14
|
if (trimmed === "null") {
|
|
15
15
|
return { const: null, type: "null" };
|
|
16
16
|
}
|
|
17
|
-
if (trimmed.startsWith('"') && trimmed.endsWith('"')
|
|
17
|
+
if (trimmed.startsWith('"') && trimmed.endsWith('"')) {
|
|
18
|
+
try {
|
|
19
|
+
return { const: JSON.parse(trimmed), type: "string" };
|
|
20
|
+
} catch {
|
|
21
|
+
return { const: trimmed.slice(1, -1), type: "string" };
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
if (trimmed.startsWith("'") && trimmed.endsWith("'")) {
|
|
18
25
|
return { const: trimmed.slice(1, -1), type: "string" };
|
|
19
26
|
}
|
|
20
27
|
const asNumber = Number(trimmed);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { G as GENERATED_HEADER } from './emit-
|
|
1
|
+
import { G as GENERATED_HEADER } from './emit-CFz-9dcD.mjs';
|
|
2
2
|
import { s as sanitizeNamespace } from './paths-BRd6JHuF.mjs';
|
|
3
|
-
import { argsObjectSchema, LUNORA_ERROR_CODES } from './LUNORA_ERROR_CODES-
|
|
3
|
+
import { argsObjectSchema, LUNORA_ERROR_CODES } from './LUNORA_ERROR_CODES-DvTLozCu.mjs';
|
|
4
4
|
|
|
5
5
|
const OPENRPC_VERSION = "1.3.2";
|
|
6
6
|
const inferredResultSchema = () => {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { existsSync } from 'node:fs';
|
|
2
2
|
import { join } from 'node:path';
|
|
3
|
+
import { LunoraError } from '@lunora/errors';
|
|
3
4
|
import { queueDefaultName, queueBindingName } from '@lunora/queue';
|
|
4
5
|
import { SyntaxKind, Node } from 'ts-morph';
|
|
5
6
|
import { diagnosticAt } from './CodegenDiagnosticError-DyQ5FwkM.mjs';
|
|
@@ -105,6 +106,30 @@ const queuesFromSource = (source) => {
|
|
|
105
106
|
}
|
|
106
107
|
return queues;
|
|
107
108
|
};
|
|
109
|
+
const assertUniqueNames = (queues) => {
|
|
110
|
+
const seenNames = /* @__PURE__ */ new Map();
|
|
111
|
+
const seenBindings = /* @__PURE__ */ new Map();
|
|
112
|
+
for (const queue of queues) {
|
|
113
|
+
const priorName = seenNames.get(queue.name);
|
|
114
|
+
if (priorName !== void 0) {
|
|
115
|
+
throw new LunoraError(
|
|
116
|
+
"DUPLICATE_QUEUE_NAME",
|
|
117
|
+
`Duplicate queue name "${queue.name}": produced by both "${priorName}" and "${queue.exportName}". Deployed queue names must be unique across the project.`,
|
|
118
|
+
{ status: 500 }
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
seenNames.set(queue.name, queue.exportName);
|
|
122
|
+
const priorBinding = seenBindings.get(queue.bindingName);
|
|
123
|
+
if (priorBinding !== void 0) {
|
|
124
|
+
throw new LunoraError(
|
|
125
|
+
"DUPLICATE_QUEUE_BINDING",
|
|
126
|
+
`Duplicate queue binding "${queue.bindingName}": produced by both "${priorBinding}" and "${queue.exportName}". Queue export names must yield unique binding names.`,
|
|
127
|
+
{ status: 500 }
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
seenBindings.set(queue.bindingName, queue.exportName);
|
|
131
|
+
}
|
|
132
|
+
};
|
|
108
133
|
const discoverQueues = (project, lunoraDirectory) => {
|
|
109
134
|
const queuesPath = join(lunoraDirectory, QUEUES_FILENAME);
|
|
110
135
|
if (!existsSync(queuesPath)) {
|
|
@@ -113,6 +138,7 @@ const discoverQueues = (project, lunoraDirectory) => {
|
|
|
113
138
|
const source = project.getSourceFile(queuesPath) ?? project.addSourceFileAtPath(queuesPath);
|
|
114
139
|
const queues = queuesFromSource(source);
|
|
115
140
|
queues.sort((a, b) => a.exportName.localeCompare(b.exportName));
|
|
141
|
+
assertUniqueNames(queues);
|
|
116
142
|
return queues;
|
|
117
143
|
};
|
|
118
144
|
|
|
@@ -3,33 +3,33 @@ import { join, dirname } from 'node:path';
|
|
|
3
3
|
import { performance } from 'node:perf_hooks';
|
|
4
4
|
import { LunoraError } from '@lunora/errors';
|
|
5
5
|
import { Node, SyntaxKind, Project } from 'ts-morph';
|
|
6
|
-
import { lintSchema } from './formatAdvisories-
|
|
7
|
-
import { listLunoraSourceFiles, lunoraRelativePath, classifyProcedureCall, inlineHandler as inlineHandler$1, procedureHandler, chainUsesWrappedCall, isDatabaseAccessor, chainHasStep, discoverFunctions } from './discoverFunctions-
|
|
8
|
-
import discoverAuthApiCalls from './discoverAuthApiCalls-
|
|
6
|
+
import { lintSchema } from './formatAdvisories-DRhEiJUz.mjs';
|
|
7
|
+
import { listLunoraSourceFiles, lunoraRelativePath, classifyProcedureCall, inlineHandler as inlineHandler$1, procedureHandler, chainUsesWrappedCall, isDatabaseAccessor, chainHasStep, discoverFunctions } from './discoverFunctions-CZ91aenA.mjs';
|
|
8
|
+
import discoverAuthApiCalls from './discoverAuthApiCalls-WMx8L2FG.mjs';
|
|
9
9
|
import { discoverContainers } from './CONTAINERS_FILENAME-DjpXMqhp.mjs';
|
|
10
|
-
import discoverCrons from './discoverCrons-
|
|
10
|
+
import discoverCrons from './discoverCrons-D-jrpm97.mjs';
|
|
11
11
|
import { diagnosticAt } from './CodegenDiagnosticError-DyQ5FwkM.mjs';
|
|
12
|
-
import { C as CAPABILITIES, m as buildStorageColumns, d as emitDataModel, e as emitApi, h as emitServer, g as emitFunctions, i as emitShard, a as emitCollections, b as emitContainers, k as emitWorkflows, n as emitQueues, c as emitCrons, j as emitVectors, f as emitDrizzleSchema, o as emitSeed, l as emitWranglerCronTriggers } from './emit-
|
|
13
|
-
import { discoverFlagKeys } from './FLAGS_FILENAME-
|
|
14
|
-
import discoverHttpRoutes from './discoverHttpRoutes-
|
|
15
|
-
import discoverInserts from './discoverInserts-
|
|
16
|
-
import discoverMaskProcedures, { discoverMaskStrategies, discoverMaskMetadata } from './discoverMaskProcedures-
|
|
17
|
-
import discoverMigrations from './discoverMigrations-
|
|
12
|
+
import { C as CAPABILITIES, m as buildStorageColumns, d as emitDataModel, e as emitApi, h as emitServer, g as emitFunctions, i as emitShard, a as emitCollections, b as emitContainers, k as emitWorkflows, n as emitQueues, c as emitCrons, j as emitVectors, f as emitDrizzleSchema, o as emitSeed, l as emitWranglerCronTriggers } from './emit-CFz-9dcD.mjs';
|
|
13
|
+
import { discoverFlagKeys } from './FLAGS_FILENAME-fEZtzWXi.mjs';
|
|
14
|
+
import discoverHttpRoutes from './discoverHttpRoutes-DNZLDCmm.mjs';
|
|
15
|
+
import discoverInserts from './discoverInserts-DFRJhmCv.mjs';
|
|
16
|
+
import discoverMaskProcedures, { discoverMaskStrategies, discoverMaskMetadata } from './discoverMaskProcedures-B5iFnZ-X.mjs';
|
|
17
|
+
import discoverMigrations from './discoverMigrations-CdKtMlBc.mjs';
|
|
18
18
|
import { MUTATORS_FILENAME, isDefineMutatorCallee, discoverMutators } from './MUTATORS_FILENAME-BZOfUhlY.mjs';
|
|
19
|
-
import discoverNondeterministicCalls from './discoverNondeterministicCalls-
|
|
20
|
-
import discoverQueries from './discoverQueries-
|
|
21
|
-
import { discoverQueues } from './QUEUES_FILENAME-
|
|
22
|
-
import discoverR2sqlCalls from './discoverR2sqlCalls-
|
|
23
|
-
import discoverRlsProcedures, { discoverRlsMetadata } from './discoverRlsMetadata-
|
|
24
|
-
import discoverSchema from './discoverSchema-
|
|
19
|
+
import discoverNondeterministicCalls from './discoverNondeterministicCalls-C_PrQPkA.mjs';
|
|
20
|
+
import discoverQueries from './discoverQueries-B8W9UPrt.mjs';
|
|
21
|
+
import { discoverQueues } from './QUEUES_FILENAME-Xv6Vy-Ku.mjs';
|
|
22
|
+
import discoverR2sqlCalls from './discoverR2sqlCalls-Bm7Rfnf4.mjs';
|
|
23
|
+
import discoverRlsProcedures, { discoverRlsMetadata } from './discoverRlsMetadata-B4GL4ZKm.mjs';
|
|
24
|
+
import discoverSchema from './discoverSchema-DFWVgU5o.mjs';
|
|
25
25
|
import { secretKindOf, redact } from './redact-oTmsol5A.mjs';
|
|
26
26
|
import { discoverShapes } from './SHAPES_FILENAME-DOhPGi-6.mjs';
|
|
27
|
-
import discoverStorageRulesMetadata from './discoverStorageRulesMetadata-
|
|
27
|
+
import discoverStorageRulesMetadata from './discoverStorageRulesMetadata-nosjYcvN.mjs';
|
|
28
28
|
import { e as enclosingExportName$2 } from './discover-ast-CT6BgBr4.mjs';
|
|
29
|
-
import { discoverWorkflows } from './WORKFLOWS_FILENAME-
|
|
30
|
-
import { emitApp } from './emitApp-
|
|
31
|
-
import { buildOpenApiDocument, emitOpenApiModule } from './buildOpenApiDocument-
|
|
32
|
-
import { buildOpenRpcDocument, emitOpenRpcModule } from './OPENRPC_VERSION-
|
|
29
|
+
import { discoverWorkflows } from './WORKFLOWS_FILENAME-B2By8S4s.mjs';
|
|
30
|
+
import { emitApp } from './emitApp-D8rVuM__.mjs';
|
|
31
|
+
import { buildOpenApiDocument, emitOpenApiModule } from './buildOpenApiDocument-_mwWOc2N.mjs';
|
|
32
|
+
import { buildOpenRpcDocument, emitOpenRpcModule } from './OPENRPC_VERSION-DxbqafcJ.mjs';
|
|
33
33
|
import { buildSchemaSnapshot, serializeSchemaSnapshot } from './SCHEMA_SNAPSHOT_VERSION-D0ARY6rL.mjs';
|
|
34
34
|
|
|
35
35
|
const HTTP_VERBS$1 = /* @__PURE__ */ new Set(["delete", "get", "head", "options", "patch", "post", "put"]);
|
|
@@ -2709,9 +2709,14 @@ const literalValueOf = (node) => {
|
|
|
2709
2709
|
}
|
|
2710
2710
|
return void 0;
|
|
2711
2711
|
};
|
|
2712
|
-
const
|
|
2713
|
-
|
|
2714
|
-
|
|
2712
|
+
const isFoldedConcatenationOperand = (node) => {
|
|
2713
|
+
let root = node;
|
|
2714
|
+
let parent = root.getParent();
|
|
2715
|
+
while (parent !== void 0 && Node.isBinaryExpression(parent) && parent.getOperatorToken().getKind() === SyntaxKind.PlusToken) {
|
|
2716
|
+
root = parent;
|
|
2717
|
+
parent = root.getParent();
|
|
2718
|
+
}
|
|
2719
|
+
return root !== node && literalValueOf(root) !== void 0;
|
|
2715
2720
|
};
|
|
2716
2721
|
const secretsInSourceFile = (sourceFile, relativePath) => {
|
|
2717
2722
|
const found = [];
|
|
@@ -2722,8 +2727,9 @@ const secretsInSourceFile = (sourceFile, relativePath) => {
|
|
|
2722
2727
|
...sourceFile.getDescendantsOfKind(SyntaxKind.StringLiteral),
|
|
2723
2728
|
...sourceFile.getDescendantsOfKind(SyntaxKind.NoSubstitutionTemplateLiteral)
|
|
2724
2729
|
];
|
|
2730
|
+
const seen = /* @__PURE__ */ new Set();
|
|
2725
2731
|
for (const node of nodes) {
|
|
2726
|
-
if (
|
|
2732
|
+
if (isFoldedConcatenationOperand(node)) {
|
|
2727
2733
|
continue;
|
|
2728
2734
|
}
|
|
2729
2735
|
const value = literalValueOf(node);
|
|
@@ -2731,9 +2737,16 @@ const secretsInSourceFile = (sourceFile, relativePath) => {
|
|
|
2731
2737
|
continue;
|
|
2732
2738
|
}
|
|
2733
2739
|
const kind = secretKindOf(value);
|
|
2734
|
-
if (kind
|
|
2735
|
-
|
|
2740
|
+
if (kind === void 0) {
|
|
2741
|
+
continue;
|
|
2736
2742
|
}
|
|
2743
|
+
const line = node.getStartLineNumber();
|
|
2744
|
+
const dedupeKey = `${String(line)}:${kind}`;
|
|
2745
|
+
if (seen.has(dedupeKey)) {
|
|
2746
|
+
continue;
|
|
2747
|
+
}
|
|
2748
|
+
seen.add(dedupeKey);
|
|
2749
|
+
found.push({ file: relativePath, kind, line, preview: redact(value) });
|
|
2737
2750
|
}
|
|
2738
2751
|
return found;
|
|
2739
2752
|
};
|
|
@@ -3155,56 +3168,56 @@ const runCodegen = (options) => {
|
|
|
3155
3168
|
const queues = discoverQueues(project, lunoraDirectory);
|
|
3156
3169
|
const crons = discoverCrons(project, lunoraDirectory, workflows);
|
|
3157
3170
|
const containers = discoverContainers(project, lunoraDirectory);
|
|
3158
|
-
const advisories = options.lint === false ? [] : lintSchema(
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3171
|
+
const advisories = options.lint === false ? [] : lintSchema({
|
|
3172
|
+
adminRoutes: discoverAdminRoutes(project, lunoraDirectory),
|
|
3173
|
+
aiRawRuns: discoverAiRawRuns(project, lunoraDirectory),
|
|
3174
|
+
aiToolSideEffects: discoverAiToolSideEffects(project, lunoraDirectory),
|
|
3175
|
+
argumentDerivedFetches: discoverArgumentDerivedFetches(project, lunoraDirectory),
|
|
3176
|
+
argumentValidators: discoverArgumentValidators(project, lunoraDirectory),
|
|
3177
|
+
authApiCalls: discoverAuthApiCalls(project, lunoraDirectory),
|
|
3178
|
+
authConfigs: discoverAuthConfig(project, lunoraDirectory),
|
|
3179
|
+
browserUrlAccesses: discoverBrowserUrlAccesses(project, lunoraDirectory),
|
|
3180
|
+
configCalls: discoverConfigCalls(project, lunoraDirectory),
|
|
3181
|
+
containerKeyAccesses: discoverContainerKeyAccesses(project, lunoraDirectory),
|
|
3182
|
+
containerOverrides: discoverContainerOverrides(project, lunoraDirectory),
|
|
3164
3183
|
containers,
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3184
|
+
failOpenGuards: discoverFailOpenGuards(project, lunoraDirectory),
|
|
3185
|
+
flagSecurityDefaults: discoverFlagSecurityDefaults(project, lunoraDirectory),
|
|
3186
|
+
httpActionGuards: discoverHttpActionGuards(project, lunoraDirectory),
|
|
3187
|
+
httpHeaderWrites: discoverHttpHeaderWrites(project, lunoraDirectory),
|
|
3188
|
+
identityClaimReads: discoverIdentityClaimReads(project, lunoraDirectory),
|
|
3189
|
+
imageDeliveryUrlAccesses: discoverImageDeliveryUrlAccesses(project, lunoraDirectory),
|
|
3190
|
+
inserts: discoverInserts(project, lunoraDirectory),
|
|
3191
|
+
kvKeyAccesses: discoverKvKeyAccesses(project, lunoraDirectory),
|
|
3192
|
+
mailRecipientAccesses: discoverMailRecipientAccesses(project, lunoraDirectory),
|
|
3193
|
+
maskProcedures: discoverMaskProcedures(project, lunoraDirectory),
|
|
3194
|
+
maskStrategies: discoverMaskStrategies(project, lunoraDirectory),
|
|
3195
|
+
mutatorWrites: discoverMutatorWrites(project, lunoraDirectory),
|
|
3196
|
+
nondeterministicCalls: discoverNondeterministicCalls(project, lunoraDirectory),
|
|
3197
|
+
normalizeIdAuthorizations: discoverNormalizeIdAuthorization(project, lunoraDirectory),
|
|
3198
|
+
ownerFieldWrites: discoverOwnerFieldWrites(project, lunoraDirectory),
|
|
3199
|
+
paymentWebhooks: discoverPaymentWebhooks(project, lunoraDirectory),
|
|
3200
|
+
privilegedDispatches: discoverPrivilegedDispatches(project, lunoraDirectory),
|
|
3201
|
+
procedureProtections: discoverProcedureMiddleware(project, lunoraDirectory),
|
|
3202
|
+
queries: discoverQueries(project, lunoraDirectory),
|
|
3203
|
+
queues,
|
|
3204
|
+
r2sqlCalls: discoverR2sqlCalls(project, lunoraDirectory),
|
|
3205
|
+
ratelimitKeySelectors: discoverRatelimitKeySelectors(project, lunoraDirectory),
|
|
3206
|
+
rawRowReturns: discoverRawRowReturns(project, lunoraDirectory),
|
|
3207
|
+
relationLoads: discoverRelationLoads(project, lunoraDirectory),
|
|
3208
|
+
rlsProcedures: discoverRlsProcedures(project, lunoraDirectory),
|
|
3209
|
+
schema,
|
|
3210
|
+
secretLiterals: discoverSecrets(project, lunoraDirectory),
|
|
3175
3211
|
shapes,
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
|
|
3182
|
-
|
|
3183
|
-
|
|
3184
|
-
|
|
3185
|
-
discoverVectorNamespaceAccesses(project, lunoraDirectory),
|
|
3186
|
-
discoverBrowserUrlAccesses(project, lunoraDirectory),
|
|
3187
|
-
discoverPrivilegedDispatches(project, lunoraDirectory),
|
|
3188
|
-
discoverContainerOverrides(project, lunoraDirectory),
|
|
3189
|
-
discoverAuthConfig(project, lunoraDirectory),
|
|
3190
|
-
discoverMaskStrategies(project, lunoraDirectory),
|
|
3191
|
-
discoverImageDeliveryUrlAccesses(project, lunoraDirectory),
|
|
3192
|
-
discoverRatelimitKeySelectors(project, lunoraDirectory),
|
|
3193
|
-
discoverStorageUploads(project, lunoraDirectory),
|
|
3194
|
-
discoverHttpActionGuards(project, lunoraDirectory),
|
|
3195
|
-
discoverHttpHeaderWrites(project, lunoraDirectory),
|
|
3196
|
-
discoverFailOpenGuards(project, lunoraDirectory),
|
|
3197
|
-
discoverFlagSecurityDefaults(project, lunoraDirectory),
|
|
3198
|
-
discoverAiToolSideEffects(project, lunoraDirectory),
|
|
3199
|
-
discoverIdentityClaimReads(project, lunoraDirectory),
|
|
3200
|
-
discoverPaymentWebhooks(project, lunoraDirectory),
|
|
3201
|
-
discoverSoftDeleteReads(project, lunoraDirectory),
|
|
3202
|
-
discoverRelationLoads(project, lunoraDirectory),
|
|
3203
|
-
discoverRawRowReturns(project, lunoraDirectory),
|
|
3204
|
-
discoverNormalizeIdAuthorization(project, lunoraDirectory),
|
|
3205
|
-
options.wranglerVariables,
|
|
3206
|
-
queues
|
|
3207
|
-
);
|
|
3212
|
+
softDeleteReads: discoverSoftDeleteReads(project, lunoraDirectory),
|
|
3213
|
+
sqlInterpolations: discoverSqlInterpolation(project, lunoraDirectory),
|
|
3214
|
+
storageKeyAccesses: discoverStorageKeyAccesses(project, lunoraDirectory),
|
|
3215
|
+
storageUploads: discoverStorageUploads(project, lunoraDirectory),
|
|
3216
|
+
vectorNamespaceAccesses: discoverVectorNamespaceAccesses(project, lunoraDirectory),
|
|
3217
|
+
workflowCalls: discoverWorkflowCalls(project, lunoraDirectory),
|
|
3218
|
+
workflows,
|
|
3219
|
+
wranglerVariables: options.wranglerVariables
|
|
3220
|
+
});
|
|
3208
3221
|
const rlsMetadata = discoverRlsMetadata(project, lunoraDirectory);
|
|
3209
3222
|
const maskMetadata = discoverMaskMetadata(project, lunoraDirectory);
|
|
3210
3223
|
const storageRulesMetadata = discoverStorageRulesMetadata(project, lunoraDirectory);
|
|
@@ -3374,14 +3387,10 @@ const runCodegen = (options) => {
|
|
|
3374
3387
|
writeIfPresent(join(outputDirectory, "queues.ts"), queuesContent);
|
|
3375
3388
|
writeIfPresent(join(outputDirectory, "seed.ts"), seedContent);
|
|
3376
3389
|
writeIfPresent(join(outputDirectory, "collections.ts"), collectionsContent);
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
if (wantsOpenRpc) {
|
|
3382
|
-
writeIfChanged(join(outputDirectory, "openrpc.json"), openRpcContent);
|
|
3383
|
-
writeIfChanged(join(outputDirectory, "openrpc.ts"), openRpcModuleContent);
|
|
3384
|
-
}
|
|
3390
|
+
writeIfPresent(join(outputDirectory, "openapi.json"), wantsOpenApi ? openApiContent : "");
|
|
3391
|
+
writeIfPresent(join(outputDirectory, "openapi.ts"), wantsOpenApi ? openApiModuleContent : "");
|
|
3392
|
+
writeIfPresent(join(outputDirectory, "openrpc.json"), wantsOpenRpc ? openRpcContent : "");
|
|
3393
|
+
writeIfPresent(join(outputDirectory, "openrpc.ts"), wantsOpenRpc ? openRpcModuleContent : "");
|
|
3385
3394
|
if (!schemaSnapshotExists || options.updateSchemaBaseline === true) {
|
|
3386
3395
|
writeIfChanged(schemaSnapshotPath, serializeSchemaSnapshot(schemaSnapshot));
|
|
3387
3396
|
}
|
package/dist/packem_shared/{WORKFLOWS_FILENAME-CCC_42o3.mjs → WORKFLOWS_FILENAME-B2By8S4s.mjs}
RENAMED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { existsSync } from 'node:fs';
|
|
2
2
|
import { join } from 'node:path';
|
|
3
|
+
import { LunoraError } from '@lunora/errors';
|
|
3
4
|
import { workflowDefaultName, workflowClassName, workflowBindingName } from '@lunora/workflow';
|
|
4
5
|
import { SyntaxKind, Node } from 'ts-morph';
|
|
5
6
|
import { diagnosticAt } from './CodegenDiagnosticError-DyQ5FwkM.mjs';
|
|
@@ -110,6 +111,32 @@ const workflowsFromSource = (source) => {
|
|
|
110
111
|
}
|
|
111
112
|
return workflows;
|
|
112
113
|
};
|
|
114
|
+
const assertUniqueNames = (workflows) => {
|
|
115
|
+
const seenNames = /* @__PURE__ */ new Map();
|
|
116
|
+
const seenBindings = /* @__PURE__ */ new Map();
|
|
117
|
+
for (const workflow of workflows) {
|
|
118
|
+
const priorName = seenNames.get(workflow.name);
|
|
119
|
+
if (priorName !== void 0) {
|
|
120
|
+
throw new LunoraError(
|
|
121
|
+
// eslint-disable-next-line no-secrets/no-secrets -- an error code, not a secret
|
|
122
|
+
"DUPLICATE_WORKFLOW_NAME",
|
|
123
|
+
`Duplicate workflow name "${workflow.name}": produced by both "${priorName}" and "${workflow.exportName}". Deployed workflow names must be unique across the project.`,
|
|
124
|
+
{ status: 500 }
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
seenNames.set(workflow.name, workflow.exportName);
|
|
128
|
+
const priorBinding = seenBindings.get(workflow.bindingName);
|
|
129
|
+
if (priorBinding !== void 0) {
|
|
130
|
+
throw new LunoraError(
|
|
131
|
+
// eslint-disable-next-line no-secrets/no-secrets -- an error code, not a secret
|
|
132
|
+
"DUPLICATE_WORKFLOW_BINDING",
|
|
133
|
+
`Duplicate workflow binding "${workflow.bindingName}": produced by both "${priorBinding}" and "${workflow.exportName}". Workflow export names must yield unique binding names.`,
|
|
134
|
+
{ status: 500 }
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
seenBindings.set(workflow.bindingName, workflow.exportName);
|
|
138
|
+
}
|
|
139
|
+
};
|
|
113
140
|
const discoverWorkflows = (project, lunoraDirectory) => {
|
|
114
141
|
const workflowsPath = join(lunoraDirectory, WORKFLOWS_FILENAME);
|
|
115
142
|
if (!existsSync(workflowsPath)) {
|
|
@@ -118,6 +145,7 @@ const discoverWorkflows = (project, lunoraDirectory) => {
|
|
|
118
145
|
const source = project.getSourceFile(workflowsPath) ?? project.addSourceFileAtPath(workflowsPath);
|
|
119
146
|
const workflows = workflowsFromSource(source);
|
|
120
147
|
workflows.sort((a, b) => a.exportName.localeCompare(b.exportName));
|
|
148
|
+
assertUniqueNames(workflows);
|
|
121
149
|
return workflows;
|
|
122
150
|
};
|
|
123
151
|
|
package/dist/packem_shared/{buildOpenApiDocument-Bfq9qaTd.mjs → buildOpenApiDocument-_mwWOc2N.mjs}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { G as GENERATED_HEADER } from './emit-
|
|
1
|
+
import { G as GENERATED_HEADER } from './emit-CFz-9dcD.mjs';
|
|
2
2
|
import { s as sanitizeNamespace } from './paths-BRd6JHuF.mjs';
|
|
3
|
-
import { LUNORA_ERROR_CODES, objectSchema, argsObjectSchema, validatorIrToJsonSchema } from './LUNORA_ERROR_CODES-
|
|
3
|
+
import { LUNORA_ERROR_CODES, objectSchema, argsObjectSchema, validatorIrToJsonSchema } from './LUNORA_ERROR_CODES-DvTLozCu.mjs';
|
|
4
4
|
|
|
5
5
|
const ERROR_COMPONENT_REF = "#/components/responses/LunoraError";
|
|
6
6
|
const ROUTE_PARAM_RE = /:([A-Za-z_$][\w$]*)/gu;
|
package/dist/packem_shared/{discoverAuthApiCalls-URDoTADN.mjs → discoverAuthApiCalls-WMx8L2FG.mjs}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { relative, sep } from 'node:path';
|
|
2
2
|
import { SyntaxKind, Node } from 'ts-morph';
|
|
3
3
|
import { T as TS_EXTENSION_RE, e as enclosingExportName } from './discover-ast-CT6BgBr4.mjs';
|
|
4
|
-
import { listLunoraSourceFiles } from './discoverFunctions-
|
|
4
|
+
import { listLunoraSourceFiles } from './discoverFunctions-CZ91aenA.mjs';
|
|
5
5
|
|
|
6
6
|
const isAuthApiCall = (call) => {
|
|
7
7
|
const callee = call.getExpression();
|
|
@@ -2,7 +2,7 @@ import { LunoraError } from '@lunora/errors';
|
|
|
2
2
|
import { isValidCronExpression, compileCronSchedule, CRON_SCHEDULE_KINDS } from '@lunora/scheduler';
|
|
3
3
|
import { SyntaxKind, Node } from 'ts-morph';
|
|
4
4
|
import { diagnosticAt } from './CodegenDiagnosticError-DyQ5FwkM.mjs';
|
|
5
|
-
import { listLunoraSourceFiles } from './discoverFunctions-
|
|
5
|
+
import { listLunoraSourceFiles } from './discoverFunctions-CZ91aenA.mjs';
|
|
6
6
|
import { s as sanitizeNamespace } from './paths-BRd6JHuF.mjs';
|
|
7
7
|
|
|
8
8
|
const CRON_METHODS = /* @__PURE__ */ new Set([...CRON_SCHEDULE_KINDS, "cron"]);
|
package/dist/packem_shared/{discoverFunctions-BJdF7lRs.mjs → discoverFunctions-CZ91aenA.mjs}
RENAMED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { readdirSync, lstatSync } from 'node:fs';
|
|
2
2
|
import { join, extname, relative, sep } from 'node:path';
|
|
3
3
|
import { Node, SyntaxKind } from 'ts-morph';
|
|
4
|
-
import { a as parseObjectShape } from './parse-validator-
|
|
4
|
+
import { a as parseObjectShape } from './parse-validator-BSJo1HGP.mjs';
|
|
5
5
|
import { s as sanitizeNamespace } from './paths-BRd6JHuF.mjs';
|
|
6
6
|
|
|
7
7
|
const FUNCTION_KINDS = /* @__PURE__ */ new Set(["action", "mutation", "query", "stream"]);
|
|
8
|
-
const ANY_TOKEN_RE = /\bany\b/u;
|
|
8
|
+
const ANY_TOKEN_RE = /\bany\b(?!\s*(?:\?\s*)?:)/u;
|
|
9
|
+
const STRING_LITERAL_SPAN_RE = /"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'|`(?:[^`\\]|\\.)*`/gu;
|
|
9
10
|
const IDENTIFIER_RE = /^[A-Za-z_$][\w$]*$/u;
|
|
10
11
|
const renderExpandedPropertyKey = (propertyName) => IDENTIFIER_RE.test(propertyName) ? propertyName : JSON.stringify(propertyName);
|
|
11
12
|
const TS_EXTENSION_RE = /\.ts$/u;
|
|
@@ -221,7 +222,7 @@ const unwrapHandlerReturn = (handler) => {
|
|
|
221
222
|
if (!rendered || rendered === "any" || rendered === "never") {
|
|
222
223
|
return "unknown";
|
|
223
224
|
}
|
|
224
|
-
if (ANY_TOKEN_RE.test(rendered)) {
|
|
225
|
+
if (ANY_TOKEN_RE.test(rendered.replaceAll(STRING_LITERAL_SPAN_RE, ""))) {
|
|
225
226
|
return "unknown";
|
|
226
227
|
}
|
|
227
228
|
const handlerFilePath = handler.getSourceFile().getFilePath();
|
|
@@ -356,7 +357,7 @@ const chainUsesWrappedCall = (receiver, method, wrappedCallee) => {
|
|
|
356
357
|
}
|
|
357
358
|
return false;
|
|
358
359
|
};
|
|
359
|
-
const listLunoraSourceFiles = (directory, accumulator = []) => {
|
|
360
|
+
const listLunoraSourceFiles = (directory, accumulator = [], root = directory) => {
|
|
360
361
|
let entries;
|
|
361
362
|
try {
|
|
362
363
|
entries = readdirSync(directory);
|
|
@@ -370,8 +371,11 @@ const listLunoraSourceFiles = (directory, accumulator = []) => {
|
|
|
370
371
|
if (entry === "_generated" || entry === "node_modules") {
|
|
371
372
|
continue;
|
|
372
373
|
}
|
|
373
|
-
listLunoraSourceFiles(full, accumulator);
|
|
374
|
-
} else if (info.isFile() && extname(entry) === ".ts"
|
|
374
|
+
listLunoraSourceFiles(full, accumulator, root);
|
|
375
|
+
} else if (info.isFile() && extname(entry) === ".ts") {
|
|
376
|
+
if (entry === "schema.ts" && directory === root) {
|
|
377
|
+
continue;
|
|
378
|
+
}
|
|
375
379
|
accumulator.push(full);
|
|
376
380
|
}
|
|
377
381
|
}
|
package/dist/packem_shared/{discoverHttpRoutes-CcwP-Rkr.mjs → discoverHttpRoutes-DNZLDCmm.mjs}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { relative, sep } from 'node:path';
|
|
2
2
|
import { Node } from 'ts-morph';
|
|
3
|
-
import { listLunoraSourceFiles } from './discoverFunctions-
|
|
4
|
-
import { p as parseValidator, a as parseObjectShape } from './parse-validator-
|
|
3
|
+
import { listLunoraSourceFiles } from './discoverFunctions-CZ91aenA.mjs';
|
|
4
|
+
import { p as parseValidator, a as parseObjectShape } from './parse-validator-BSJo1HGP.mjs';
|
|
5
5
|
|
|
6
6
|
const TS_EXTENSION_RE = /\.ts$/u;
|
|
7
7
|
const HTTP_VERBS = /* @__PURE__ */ new Set(["delete", "get", "head", "options", "patch", "post", "put"]);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SyntaxKind, Node } from 'ts-morph';
|
|
2
2
|
import { e as enclosingExportName } from './discover-ast-CT6BgBr4.mjs';
|
|
3
|
-
import { listLunoraSourceFiles, lunoraRelativePath } from './discoverFunctions-
|
|
3
|
+
import { listLunoraSourceFiles, lunoraRelativePath } from './discoverFunctions-CZ91aenA.mjs';
|
|
4
4
|
|
|
5
5
|
const isDatabaseInsertCall = (call) => {
|
|
6
6
|
const callee = call.getExpression();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Node, SyntaxKind } from 'ts-morph';
|
|
2
|
-
import { listLunoraSourceFiles, lunoraRelativePath, classifyProcedureCall } from './discoverFunctions-
|
|
2
|
+
import { listLunoraSourceFiles, lunoraRelativePath, classifyProcedureCall } from './discoverFunctions-CZ91aenA.mjs';
|
|
3
3
|
|
|
4
4
|
const isMaskCall = (node) => {
|
|
5
5
|
if (!Node.isCallExpression(node)) {
|
package/dist/packem_shared/{discoverMigrations-cG1idBVM.mjs → discoverMigrations-CdKtMlBc.mjs}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { relative, sep } from 'node:path';
|
|
2
2
|
import { SyntaxKind, Node } from 'ts-morph';
|
|
3
3
|
import { diagnosticAt } from './CodegenDiagnosticError-DyQ5FwkM.mjs';
|
|
4
|
-
import { listLunoraSourceFiles } from './discoverFunctions-
|
|
4
|
+
import { listLunoraSourceFiles } from './discoverFunctions-CZ91aenA.mjs';
|
|
5
5
|
|
|
6
6
|
const TS_EXTENSION_RE = /\.ts$/u;
|
|
7
7
|
const isDefineMigration = (identifier) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Node, SyntaxKind } from 'ts-morph';
|
|
2
|
-
import { listLunoraSourceFiles, lunoraRelativePath, classifyProcedureCall } from './discoverFunctions-
|
|
2
|
+
import { listLunoraSourceFiles, lunoraRelativePath, classifyProcedureCall } from './discoverFunctions-CZ91aenA.mjs';
|
|
3
3
|
|
|
4
4
|
const PROPERTY_CALLS = {
|
|
5
5
|
"crypto.getRandomValues": "crypto.getRandomValues",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SyntaxKind, Node } from 'ts-morph';
|
|
2
|
-
import { listLunoraSourceFiles, lunoraRelativePath } from './discoverFunctions-
|
|
2
|
+
import { listLunoraSourceFiles, lunoraRelativePath } from './discoverFunctions-CZ91aenA.mjs';
|
|
3
3
|
|
|
4
4
|
const INDEX_METHODS = /* @__PURE__ */ new Set(["withIndex", "withSearchIndex"]);
|
|
5
5
|
const isDatabaseQueryCall = (call) => {
|
package/dist/packem_shared/{discoverR2sqlCalls-CWCAU-xJ.mjs → discoverR2sqlCalls-Bm7Rfnf4.mjs}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Node, SyntaxKind } from 'ts-morph';
|
|
2
|
-
import { listLunoraSourceFiles, lunoraRelativePath, classifyProcedureCall } from './discoverFunctions-
|
|
2
|
+
import { listLunoraSourceFiles, lunoraRelativePath, classifyProcedureCall } from './discoverFunctions-CZ91aenA.mjs';
|
|
3
3
|
|
|
4
4
|
const handlerOf = (call, receiver) => {
|
|
5
5
|
if (receiver) {
|
package/dist/packem_shared/{discoverRlsMetadata-BL0oukaK.mjs → discoverRlsMetadata-B4GL4ZKm.mjs}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Node, SyntaxKind } from 'ts-morph';
|
|
2
|
-
import { listLunoraSourceFiles, lunoraRelativePath, classifyProcedureCall } from './discoverFunctions-
|
|
2
|
+
import { listLunoraSourceFiles, lunoraRelativePath, classifyProcedureCall } from './discoverFunctions-CZ91aenA.mjs';
|
|
3
3
|
|
|
4
4
|
const isRlsCall = (node) => {
|
|
5
5
|
if (!Node.isCallExpression(node)) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LunoraError } from '@lunora/errors';
|
|
2
2
|
import { Node, SyntaxKind } from 'ts-morph';
|
|
3
3
|
import { diagnosticAt } from './CodegenDiagnosticError-DyQ5FwkM.mjs';
|
|
4
|
-
import { a as parseObjectShape } from './parse-validator-
|
|
4
|
+
import { a as parseObjectShape } from './parse-validator-BSJo1HGP.mjs';
|
|
5
5
|
import { createRequire } from 'node:module';
|
|
6
6
|
import { join } from 'node:path';
|
|
7
7
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Node } from 'ts-morph';
|
|
2
|
-
import { listLunoraSourceFiles, lunoraRelativePath, classifyProcedureCall } from './discoverFunctions-
|
|
2
|
+
import { listLunoraSourceFiles, lunoraRelativePath, classifyProcedureCall } from './discoverFunctions-CZ91aenA.mjs';
|
|
3
3
|
|
|
4
4
|
const STORAGE_OPERATIONS = /* @__PURE__ */ new Set(["delete", "list", "read", "write"]);
|
|
5
5
|
const isStorageRulesCall = (node) => {
|
|
@@ -179,7 +179,7 @@ const APP_METHOD_CAPABILITIES = CAPABILITY_ROWS.flatMap(
|
|
|
179
179
|
(capability) => "appMethod" in capability ? [{ appMethod: capability.appMethod, key: capability.key }] : []
|
|
180
180
|
);
|
|
181
181
|
|
|
182
|
-
const LITERAL_VALUE_RE = /^(?:"[^"\\]*"|'[^'\\]*'|-?\d+(?:\.\d+)?|true|false|null)$/u;
|
|
182
|
+
const LITERAL_VALUE_RE = /^(?:"(?:[^"\\]|\\(?:["\\/bfnrt]|u[0-9A-Fa-f]{4}))*"|'[^'\\]*'|-?\d+(?:\.\d+)?|true|false|null)$/u;
|
|
183
183
|
|
|
184
184
|
const PASS_THROUGH_KINDS = /* @__PURE__ */ new Set(["any", "bigint", "boolean", "date", "id", "null", "number", "storage", "string", "timestamp"]);
|
|
185
185
|
const hasColumnModifier = (node) => node.column !== void 0;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as APP_METHOD_CAPABILITIES, G as GENERATED_HEADER } from './emit-
|
|
1
|
+
import { A as APP_METHOD_CAPABILITIES, G as GENERATED_HEADER } from './emit-CFz-9dcD.mjs';
|
|
2
2
|
|
|
3
3
|
const hasFlagKey = (key) => `has${key.charAt(0).toUpperCase()}${key.slice(1)}`;
|
|
4
4
|
const LONG_TAIL = APP_METHOD_CAPABILITIES.map(
|
|
@@ -49,56 +49,56 @@ const toAdvisorSchema = (schema) => {
|
|
|
49
49
|
const toAdvisorShapes = (shapes) => shapes.map((shape) => {
|
|
50
50
|
return { exportName: shape.exportName, file: `lunora/${shape.filePath}.ts`, table: shape.table };
|
|
51
51
|
});
|
|
52
|
-
const lintSchema = (
|
|
52
|
+
const lintSchema = (options) => runAdvisor(
|
|
53
53
|
{
|
|
54
|
-
adminRoutes,
|
|
55
|
-
aiRawRuns,
|
|
56
|
-
aiToolSideEffects,
|
|
57
|
-
argumentDerivedFetches,
|
|
58
|
-
argValidators: argumentValidators,
|
|
59
|
-
authApiCalls,
|
|
60
|
-
authConfigs,
|
|
61
|
-
browserUrlAccesses,
|
|
62
|
-
configCalls,
|
|
63
|
-
containerKeyAccesses,
|
|
64
|
-
containerOverrides,
|
|
65
|
-
containers,
|
|
66
|
-
failOpenGuards,
|
|
67
|
-
flagSecurityDefaults,
|
|
68
|
-
httpActionGuards,
|
|
69
|
-
httpHeaderWrites,
|
|
70
|
-
identityClaimReads,
|
|
71
|
-
imageDeliveryUrlAccesses,
|
|
72
|
-
inserts,
|
|
73
|
-
kvKeyAccesses,
|
|
74
|
-
mailRecipientAccesses,
|
|
75
|
-
maskProcedures,
|
|
76
|
-
maskStrategies,
|
|
77
|
-
mutatorWrites,
|
|
78
|
-
nondeterministicCalls,
|
|
79
|
-
normalizeIdAuthorizations,
|
|
80
|
-
ownerFieldWrites,
|
|
81
|
-
paymentWebhooks,
|
|
82
|
-
privilegedDispatches,
|
|
83
|
-
procedureProtections,
|
|
84
|
-
queries,
|
|
85
|
-
queues,
|
|
86
|
-
r2sqlCalls,
|
|
87
|
-
ratelimitKeySelectors,
|
|
88
|
-
rawRowReturns,
|
|
89
|
-
relationLoads,
|
|
90
|
-
rlsProcedures,
|
|
91
|
-
schema: toAdvisorSchema(schema),
|
|
92
|
-
secretLiterals,
|
|
93
|
-
shapes: shapes === void 0 ? void 0 : toAdvisorShapes(shapes),
|
|
94
|
-
softDeleteReads,
|
|
95
|
-
sqlInterpolations,
|
|
96
|
-
storageKeyAccesses,
|
|
97
|
-
storageUploads,
|
|
98
|
-
vectorNamespaceAccesses,
|
|
99
|
-
workflowCalls,
|
|
100
|
-
workflows,
|
|
101
|
-
wranglerVariables
|
|
54
|
+
adminRoutes: options.adminRoutes,
|
|
55
|
+
aiRawRuns: options.aiRawRuns,
|
|
56
|
+
aiToolSideEffects: options.aiToolSideEffects,
|
|
57
|
+
argumentDerivedFetches: options.argumentDerivedFetches,
|
|
58
|
+
argValidators: options.argumentValidators,
|
|
59
|
+
authApiCalls: options.authApiCalls,
|
|
60
|
+
authConfigs: options.authConfigs,
|
|
61
|
+
browserUrlAccesses: options.browserUrlAccesses,
|
|
62
|
+
configCalls: options.configCalls,
|
|
63
|
+
containerKeyAccesses: options.containerKeyAccesses,
|
|
64
|
+
containerOverrides: options.containerOverrides,
|
|
65
|
+
containers: options.containers,
|
|
66
|
+
failOpenGuards: options.failOpenGuards,
|
|
67
|
+
flagSecurityDefaults: options.flagSecurityDefaults,
|
|
68
|
+
httpActionGuards: options.httpActionGuards,
|
|
69
|
+
httpHeaderWrites: options.httpHeaderWrites,
|
|
70
|
+
identityClaimReads: options.identityClaimReads,
|
|
71
|
+
imageDeliveryUrlAccesses: options.imageDeliveryUrlAccesses,
|
|
72
|
+
inserts: options.inserts,
|
|
73
|
+
kvKeyAccesses: options.kvKeyAccesses,
|
|
74
|
+
mailRecipientAccesses: options.mailRecipientAccesses,
|
|
75
|
+
maskProcedures: options.maskProcedures,
|
|
76
|
+
maskStrategies: options.maskStrategies,
|
|
77
|
+
mutatorWrites: options.mutatorWrites,
|
|
78
|
+
nondeterministicCalls: options.nondeterministicCalls,
|
|
79
|
+
normalizeIdAuthorizations: options.normalizeIdAuthorizations,
|
|
80
|
+
ownerFieldWrites: options.ownerFieldWrites,
|
|
81
|
+
paymentWebhooks: options.paymentWebhooks,
|
|
82
|
+
privilegedDispatches: options.privilegedDispatches,
|
|
83
|
+
procedureProtections: options.procedureProtections,
|
|
84
|
+
queries: options.queries ?? [],
|
|
85
|
+
queues: options.queues,
|
|
86
|
+
r2sqlCalls: options.r2sqlCalls,
|
|
87
|
+
ratelimitKeySelectors: options.ratelimitKeySelectors,
|
|
88
|
+
rawRowReturns: options.rawRowReturns,
|
|
89
|
+
relationLoads: options.relationLoads,
|
|
90
|
+
rlsProcedures: options.rlsProcedures,
|
|
91
|
+
schema: toAdvisorSchema(options.schema),
|
|
92
|
+
secretLiterals: options.secretLiterals,
|
|
93
|
+
shapes: options.shapes === void 0 ? void 0 : toAdvisorShapes(options.shapes),
|
|
94
|
+
softDeleteReads: options.softDeleteReads,
|
|
95
|
+
sqlInterpolations: options.sqlInterpolations,
|
|
96
|
+
storageKeyAccesses: options.storageKeyAccesses,
|
|
97
|
+
storageUploads: options.storageUploads,
|
|
98
|
+
vectorNamespaceAccesses: options.vectorNamespaceAccesses,
|
|
99
|
+
workflowCalls: options.workflowCalls,
|
|
100
|
+
workflows: options.workflows,
|
|
101
|
+
wranglerVariables: options.wranglerVariables
|
|
102
102
|
},
|
|
103
103
|
{ source: "static" }
|
|
104
104
|
);
|
|
@@ -61,6 +61,15 @@ const parseObjectShape = (object) => {
|
|
|
61
61
|
return out;
|
|
62
62
|
};
|
|
63
63
|
const parseArgument = (argument, fallback) => argument && Node.isExpression(argument) ? parseValidator(argument) : fallback;
|
|
64
|
+
const renderLiteralSource = (node) => {
|
|
65
|
+
if (node === void 0) {
|
|
66
|
+
return "undefined";
|
|
67
|
+
}
|
|
68
|
+
if (Node.isStringLiteral(node) || Node.isNoSubstitutionTemplateLiteral(node)) {
|
|
69
|
+
return JSON.stringify(node.getLiteralValue());
|
|
70
|
+
}
|
|
71
|
+
return node.getText();
|
|
72
|
+
};
|
|
64
73
|
const parseBuilderMember = (member, args) => {
|
|
65
74
|
if (SCALAR_KINDS.has(member)) {
|
|
66
75
|
return { kind: member };
|
|
@@ -79,9 +88,10 @@ const parseBuilderMember = (member, args) => {
|
|
|
79
88
|
case "literal": {
|
|
80
89
|
return {
|
|
81
90
|
kind: "literal",
|
|
82
|
-
//
|
|
83
|
-
//
|
|
84
|
-
|
|
91
|
+
// Canonical source text — strings/templates are re-encoded via
|
|
92
|
+
// JSON.stringify (see renderLiteralSource) so escapes/backticks
|
|
93
|
+
// survive; numbers/booleans/null keep their verbatim text.
|
|
94
|
+
literalValue: renderLiteralSource(first)
|
|
85
95
|
};
|
|
86
96
|
}
|
|
87
97
|
case "object": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lunora/codegen",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.40",
|
|
4
4
|
"description": "Code generator for Lunora: emits _generated/{api,server,dataModel}.ts from your schema",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cloudflare",
|
|
@@ -46,13 +46,13 @@
|
|
|
46
46
|
"access": "public"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@lunora/advisor": "1.0.0-alpha.
|
|
50
|
-
"@lunora/container": "1.0.0-alpha.
|
|
51
|
-
"@lunora/errors": "1.0.0-alpha.
|
|
52
|
-
"@lunora/queue": "1.0.0-alpha.
|
|
53
|
-
"@lunora/scheduler": "1.0.0-alpha.
|
|
54
|
-
"@lunora/values": "1.0.0-alpha.
|
|
55
|
-
"@lunora/workflow": "1.0.0-alpha.
|
|
49
|
+
"@lunora/advisor": "1.0.0-alpha.26",
|
|
50
|
+
"@lunora/container": "1.0.0-alpha.9",
|
|
51
|
+
"@lunora/errors": "1.0.0-alpha.4",
|
|
52
|
+
"@lunora/queue": "1.0.0-alpha.7",
|
|
53
|
+
"@lunora/scheduler": "1.0.0-alpha.8",
|
|
54
|
+
"@lunora/values": "1.0.0-alpha.7",
|
|
55
|
+
"@lunora/workflow": "1.0.0-alpha.9",
|
|
56
56
|
"ts-morph": "^28.0.0"
|
|
57
57
|
},
|
|
58
58
|
"engines": {
|