@venizia/ignis-kernel 0.2.0-1 → 0.2.0-10
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/cjs/base/auth/authenticate/common/constants.d.ts +28 -1
- package/dist/cjs/base/auth/authenticate/common/constants.d.ts.map +1 -1
- package/dist/cjs/base/auth/authenticate/common/constants.js +29 -2
- package/dist/cjs/base/auth/authenticate/common/constants.js.map +1 -1
- package/dist/cjs/base/auth/authenticate/common/errors.d.ts +40 -1
- package/dist/cjs/base/auth/authenticate/common/errors.d.ts.map +1 -1
- package/dist/cjs/base/auth/authenticate/common/errors.js +41 -1
- package/dist/cjs/base/auth/authenticate/common/errors.js.map +1 -1
- package/dist/cjs/base/auth/authenticate/common/keys.d.ts +2 -0
- package/dist/cjs/base/auth/authenticate/common/keys.d.ts.map +1 -1
- package/dist/cjs/base/auth/authenticate/common/keys.js +2 -0
- package/dist/cjs/base/auth/authenticate/common/keys.js.map +1 -1
- package/dist/cjs/base/auth/authenticate/common/types.d.ts +147 -1
- package/dist/cjs/base/auth/authenticate/common/types.d.ts.map +1 -1
- package/dist/cjs/base/auth/authenticate/strategies/strategy-registry.d.ts +37 -0
- package/dist/cjs/base/auth/authenticate/strategies/strategy-registry.d.ts.map +1 -1
- package/dist/cjs/base/auth/authenticate/strategies/strategy-registry.js +54 -0
- package/dist/cjs/base/auth/authenticate/strategies/strategy-registry.js.map +1 -1
- package/dist/cjs/base/auth/authorize/builders/policy.builder.d.ts +28 -33
- package/dist/cjs/base/auth/authorize/builders/policy.builder.d.ts.map +1 -1
- package/dist/cjs/base/auth/authorize/builders/policy.builder.js.map +1 -1
- package/dist/cjs/base/auth/authorize/common/constants.d.ts +25 -1
- package/dist/cjs/base/auth/authorize/common/constants.d.ts.map +1 -1
- package/dist/cjs/base/auth/authorize/common/constants.js +12 -18
- package/dist/cjs/base/auth/authorize/common/constants.js.map +1 -1
- package/dist/cjs/base/auth/authorize/common/errors.d.ts +9 -0
- package/dist/cjs/base/auth/authorize/common/errors.d.ts.map +1 -1
- package/dist/cjs/base/auth/authorize/common/errors.js +9 -0
- package/dist/cjs/base/auth/authorize/common/errors.js.map +1 -1
- package/dist/cjs/base/auth/authorize/common/types.d.ts +1 -1
- package/dist/cjs/base/auth/authorize/common/types.d.ts.map +1 -1
- package/dist/cjs/base/auth/authorize/enforcers/enforcer-registry.d.ts +17 -0
- package/dist/cjs/base/auth/authorize/enforcers/enforcer-registry.d.ts.map +1 -1
- package/dist/cjs/base/auth/authorize/enforcers/enforcer-registry.js +39 -3
- package/dist/cjs/base/auth/authorize/enforcers/enforcer-registry.js.map +1 -1
- package/dist/cjs/base/auth/authorize/providers/authorization.provider.d.ts.map +1 -1
- package/dist/cjs/base/auth/authorize/providers/authorization.provider.js +33 -10
- package/dist/cjs/base/auth/authorize/providers/authorization.provider.js.map +1 -1
- package/dist/cjs/base/auth/base/abstract-auth-registry.d.ts +10 -0
- package/dist/cjs/base/auth/base/abstract-auth-registry.d.ts.map +1 -1
- package/dist/cjs/base/auth/base/abstract-auth-registry.js +12 -0
- package/dist/cjs/base/auth/base/abstract-auth-registry.js.map +1 -1
- package/dist/cjs/base/auth/context-variables.d.ts +7 -1
- package/dist/cjs/base/auth/context-variables.d.ts.map +1 -1
- package/dist/cjs/base/controllers/factory/controller.d.ts +1 -1
- package/dist/cjs/base/controllers/factory/controller.d.ts.map +1 -1
- package/dist/cjs/base/controllers/factory/definition.d.ts +1 -1
- package/dist/cjs/base/controllers/factory/definition.d.ts.map +1 -1
- package/dist/cjs/base/controllers/factory/definition.js +3 -5
- package/dist/cjs/base/controllers/factory/definition.js.map +1 -1
- package/dist/cjs/base/controllers/rest/abstract.d.ts.map +1 -1
- package/dist/cjs/base/controllers/rest/abstract.js +10 -0
- package/dist/cjs/base/controllers/rest/abstract.js.map +1 -1
- package/dist/cjs/base/events/common/constants.d.ts +5 -0
- package/dist/cjs/base/events/common/constants.d.ts.map +1 -0
- package/dist/cjs/base/events/common/constants.js +9 -0
- package/dist/cjs/base/events/common/constants.js.map +1 -0
- package/dist/cjs/base/events/common/index.d.ts +3 -0
- package/dist/cjs/base/events/common/index.d.ts.map +1 -0
- package/dist/cjs/base/events/common/index.js +19 -0
- package/dist/cjs/base/events/common/index.js.map +1 -0
- package/dist/cjs/base/events/common/types.d.ts +26 -0
- package/dist/cjs/base/events/common/types.d.ts.map +1 -0
- package/dist/cjs/base/events/common/types.js +3 -0
- package/dist/cjs/base/events/common/types.js.map +1 -0
- package/dist/cjs/base/events/event-bus.d.ts +41 -0
- package/dist/cjs/base/events/event-bus.d.ts.map +1 -0
- package/dist/cjs/base/events/event-bus.js +100 -0
- package/dist/cjs/base/events/event-bus.js.map +1 -0
- package/dist/cjs/base/events/index.d.ts +3 -0
- package/dist/cjs/base/events/index.d.ts.map +1 -0
- package/dist/cjs/base/events/index.js +19 -0
- package/dist/cjs/base/events/index.js.map +1 -0
- package/dist/cjs/base/index.d.ts +1 -0
- package/dist/cjs/base/index.d.ts.map +1 -1
- package/dist/cjs/base/index.js +1 -5
- package/dist/cjs/base/index.js.map +1 -1
- package/dist/cjs/base/metadata/persistents.js +1 -1
- package/dist/cjs/base/metadata/persistents.js.map +1 -1
- package/dist/cjs/base/middlewares/not-found/not-found.middleware.d.ts.map +1 -1
- package/dist/cjs/base/middlewares/not-found/not-found.middleware.js +4 -1
- package/dist/cjs/base/middlewares/not-found/not-found.middleware.js.map +1 -1
- package/dist/cjs/base/repositories/common/constants.d.ts +26 -0
- package/dist/cjs/base/repositories/common/constants.d.ts.map +1 -1
- package/dist/cjs/base/repositories/common/constants.js +29 -1
- package/dist/cjs/base/repositories/common/constants.js.map +1 -1
- package/dist/cjs/base/repositories/core/abstract.d.ts +29 -0
- package/dist/cjs/base/repositories/core/abstract.d.ts.map +1 -1
- package/dist/cjs/base/repositories/core/abstract.js +71 -1
- package/dist/cjs/base/repositories/core/abstract.js.map +1 -1
- package/dist/cjs/base/repositories/index.d.ts +1 -0
- package/dist/cjs/base/repositories/index.d.ts.map +1 -1
- package/dist/cjs/base/repositories/index.js +1 -0
- package/dist/cjs/base/repositories/index.js.map +1 -1
- package/dist/cjs/base/repositories/query-schemas/index.d.ts +26 -3
- package/dist/cjs/base/repositories/query-schemas/index.d.ts.map +1 -1
- package/dist/cjs/base/repositories/query-schemas/index.js +26 -3
- package/dist/cjs/base/repositories/query-schemas/index.js.map +1 -1
- package/dist/cjs/base/repositories/sqls/index.d.ts +2 -0
- package/dist/cjs/base/repositories/sqls/index.d.ts.map +1 -0
- package/dist/cjs/base/repositories/sqls/index.js +18 -0
- package/dist/cjs/base/repositories/sqls/index.js.map +1 -0
- package/dist/cjs/base/repositories/sqls/recursive-tree.d.ts +56 -0
- package/dist/cjs/base/repositories/sqls/recursive-tree.d.ts.map +1 -0
- package/dist/cjs/base/repositories/sqls/recursive-tree.js +148 -0
- package/dist/cjs/base/repositories/sqls/recursive-tree.js.map +1 -0
- package/dist/cjs/helpers/inversion/common/types.d.ts +34 -4
- package/dist/cjs/helpers/inversion/common/types.d.ts.map +1 -1
- package/dist/esm/base/auth/authenticate/common/constants.d.ts +28 -1
- package/dist/esm/base/auth/authenticate/common/constants.d.ts.map +1 -1
- package/dist/esm/base/auth/authenticate/common/constants.js +27 -1
- package/dist/esm/base/auth/authenticate/common/constants.js.map +1 -1
- package/dist/esm/base/auth/authenticate/common/errors.d.ts +40 -1
- package/dist/esm/base/auth/authenticate/common/errors.d.ts.map +1 -1
- package/dist/esm/base/auth/authenticate/common/errors.js +41 -1
- package/dist/esm/base/auth/authenticate/common/errors.js.map +1 -1
- package/dist/esm/base/auth/authenticate/common/keys.d.ts +2 -0
- package/dist/esm/base/auth/authenticate/common/keys.d.ts.map +1 -1
- package/dist/esm/base/auth/authenticate/common/keys.js +2 -0
- package/dist/esm/base/auth/authenticate/common/keys.js.map +1 -1
- package/dist/esm/base/auth/authenticate/common/types.d.ts +147 -1
- package/dist/esm/base/auth/authenticate/common/types.d.ts.map +1 -1
- package/dist/esm/base/auth/authenticate/strategies/strategy-registry.d.ts +37 -0
- package/dist/esm/base/auth/authenticate/strategies/strategy-registry.d.ts.map +1 -1
- package/dist/esm/base/auth/authenticate/strategies/strategy-registry.js +54 -0
- package/dist/esm/base/auth/authenticate/strategies/strategy-registry.js.map +1 -1
- package/dist/esm/base/auth/authorize/builders/policy.builder.d.ts +28 -33
- package/dist/esm/base/auth/authorize/builders/policy.builder.d.ts.map +1 -1
- package/dist/esm/base/auth/authorize/builders/policy.builder.js.map +1 -1
- package/dist/esm/base/auth/authorize/common/constants.d.ts +25 -1
- package/dist/esm/base/auth/authorize/common/constants.d.ts.map +1 -1
- package/dist/esm/base/auth/authorize/common/constants.js +12 -18
- package/dist/esm/base/auth/authorize/common/constants.js.map +1 -1
- package/dist/esm/base/auth/authorize/common/errors.d.ts +9 -0
- package/dist/esm/base/auth/authorize/common/errors.d.ts.map +1 -1
- package/dist/esm/base/auth/authorize/common/errors.js +9 -0
- package/dist/esm/base/auth/authorize/common/errors.js.map +1 -1
- package/dist/esm/base/auth/authorize/common/types.d.ts +1 -1
- package/dist/esm/base/auth/authorize/common/types.d.ts.map +1 -1
- package/dist/esm/base/auth/authorize/enforcers/enforcer-registry.d.ts +17 -0
- package/dist/esm/base/auth/authorize/enforcers/enforcer-registry.d.ts.map +1 -1
- package/dist/esm/base/auth/authorize/enforcers/enforcer-registry.js +39 -3
- package/dist/esm/base/auth/authorize/enforcers/enforcer-registry.js.map +1 -1
- package/dist/esm/base/auth/authorize/providers/authorization.provider.d.ts.map +1 -1
- package/dist/esm/base/auth/authorize/providers/authorization.provider.js +33 -10
- package/dist/esm/base/auth/authorize/providers/authorization.provider.js.map +1 -1
- package/dist/esm/base/auth/base/abstract-auth-registry.d.ts +10 -0
- package/dist/esm/base/auth/base/abstract-auth-registry.d.ts.map +1 -1
- package/dist/esm/base/auth/base/abstract-auth-registry.js +12 -0
- package/dist/esm/base/auth/base/abstract-auth-registry.js.map +1 -1
- package/dist/esm/base/auth/context-variables.d.ts +7 -1
- package/dist/esm/base/auth/context-variables.d.ts.map +1 -1
- package/dist/esm/base/controllers/factory/controller.d.ts +1 -1
- package/dist/esm/base/controllers/factory/controller.d.ts.map +1 -1
- package/dist/esm/base/controllers/factory/definition.d.ts +1 -1
- package/dist/esm/base/controllers/factory/definition.d.ts.map +1 -1
- package/dist/esm/base/controllers/factory/definition.js +4 -6
- package/dist/esm/base/controllers/factory/definition.js.map +1 -1
- package/dist/esm/base/controllers/rest/abstract.d.ts.map +1 -1
- package/dist/esm/base/controllers/rest/abstract.js +10 -0
- package/dist/esm/base/controllers/rest/abstract.js.map +1 -1
- package/dist/esm/base/events/common/constants.d.ts +5 -0
- package/dist/esm/base/events/common/constants.d.ts.map +1 -0
- package/dist/esm/base/events/common/constants.js +5 -0
- package/dist/esm/base/events/common/constants.js.map +1 -0
- package/dist/esm/base/events/common/index.d.ts +3 -0
- package/dist/esm/base/events/common/index.d.ts.map +1 -0
- package/dist/esm/base/events/common/index.js +3 -0
- package/dist/esm/base/events/common/index.js.map +1 -0
- package/dist/esm/base/events/common/types.d.ts +26 -0
- package/dist/esm/base/events/common/types.d.ts.map +1 -0
- package/dist/esm/base/events/common/types.js +2 -0
- package/dist/esm/base/events/common/types.js.map +1 -0
- package/dist/esm/base/events/event-bus.d.ts +41 -0
- package/dist/esm/base/events/event-bus.d.ts.map +1 -0
- package/dist/esm/base/events/event-bus.js +93 -0
- package/dist/esm/base/events/event-bus.js.map +1 -0
- package/dist/esm/base/events/index.d.ts +3 -0
- package/dist/esm/base/events/index.d.ts.map +1 -0
- package/dist/esm/base/events/index.js +3 -0
- package/dist/esm/base/events/index.js.map +1 -0
- package/dist/esm/base/index.d.ts +1 -0
- package/dist/esm/base/index.d.ts.map +1 -1
- package/dist/esm/base/index.js +1 -5
- package/dist/esm/base/index.js.map +1 -1
- package/dist/esm/base/metadata/persistents.js +1 -1
- package/dist/esm/base/metadata/persistents.js.map +1 -1
- package/dist/esm/base/middlewares/not-found/not-found.middleware.d.ts.map +1 -1
- package/dist/esm/base/middlewares/not-found/not-found.middleware.js +4 -1
- package/dist/esm/base/middlewares/not-found/not-found.middleware.js.map +1 -1
- package/dist/esm/base/repositories/common/constants.d.ts +26 -0
- package/dist/esm/base/repositories/common/constants.d.ts.map +1 -1
- package/dist/esm/base/repositories/common/constants.js +26 -0
- package/dist/esm/base/repositories/common/constants.js.map +1 -1
- package/dist/esm/base/repositories/core/abstract.d.ts +29 -0
- package/dist/esm/base/repositories/core/abstract.d.ts.map +1 -1
- package/dist/esm/base/repositories/core/abstract.js +73 -3
- package/dist/esm/base/repositories/core/abstract.js.map +1 -1
- package/dist/esm/base/repositories/index.d.ts +1 -0
- package/dist/esm/base/repositories/index.d.ts.map +1 -1
- package/dist/esm/base/repositories/index.js +1 -0
- package/dist/esm/base/repositories/index.js.map +1 -1
- package/dist/esm/base/repositories/query-schemas/index.d.ts +26 -3
- package/dist/esm/base/repositories/query-schemas/index.d.ts.map +1 -1
- package/dist/esm/base/repositories/query-schemas/index.js +25 -2
- package/dist/esm/base/repositories/query-schemas/index.js.map +1 -1
- package/dist/esm/base/repositories/sqls/index.d.ts +2 -0
- package/dist/esm/base/repositories/sqls/index.d.ts.map +1 -0
- package/dist/esm/base/repositories/sqls/index.js +2 -0
- package/dist/esm/base/repositories/sqls/index.js.map +1 -0
- package/dist/esm/base/repositories/sqls/recursive-tree.d.ts +56 -0
- package/dist/esm/base/repositories/sqls/recursive-tree.d.ts.map +1 -0
- package/dist/esm/base/repositories/sqls/recursive-tree.js +143 -0
- package/dist/esm/base/repositories/sqls/recursive-tree.js.map +1 -0
- package/dist/esm/helpers/inversion/common/types.d.ts +34 -4
- package/dist/esm/helpers/inversion/common/types.d.ts.map +1 -1
- package/package.json +5 -5
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { MetadataRegistry } from '../../../helpers/inversion/index.js';
|
|
2
2
|
import { BaseHelper, getError } from '@venizia/ignis-helpers/core';
|
|
3
3
|
import { resolveValue } from '@venizia/ignis-helpers/common';
|
|
4
|
-
import {
|
|
5
|
-
import { RepositoryErrorCodes, RepositoryOperationScopes } from '../common/index.js';
|
|
4
|
+
import { RetryBackoffStrategies, RetryHelper, RetryJitterModes } from '@venizia/ignis-helpers/core';
|
|
5
|
+
import { DEFAULT_MAX_LIMIT, RepositoryErrorCodes, RepositoryOperationScopes } from '../common/index.js';
|
|
6
6
|
/**
|
|
7
7
|
* Engine-neutral repository plumbing - lazy dataSource/entity resolution, class-keyed `@model`
|
|
8
8
|
* settings, operation scope. `TOptions` defaults to `IExtraOptions` so connectors can narrow it
|
|
@@ -81,6 +81,76 @@ export class AbstractRepository extends BaseHelper {
|
|
|
81
81
|
get maxLimit() {
|
|
82
82
|
return this.modelSettings?.maxLimit;
|
|
83
83
|
}
|
|
84
|
+
/**
|
|
85
|
+
* Both bounds, in one place, for every tier.
|
|
86
|
+
*
|
|
87
|
+
* The upper bound is the point: `@model({ settings: { maxLimit } })` is public and validated at
|
|
88
|
+
* decoration time, but the relational tier read it nowhere, so `maxLimit: 2` still issued
|
|
89
|
+
* `LIMIT 50000000`.
|
|
90
|
+
*
|
|
91
|
+
* The lower bound matters just as much and is easy to miss: a NEGATIVE limit is not a smaller
|
|
92
|
+
* page. Drizzle renders the LIMIT clause only when the value is `>= 0`, so a negative one removes
|
|
93
|
+
* the clause and returns the whole table. The wire schema now rejects it too, but a server-side
|
|
94
|
+
* caller reaches this method without passing through the schema at all.
|
|
95
|
+
*/
|
|
96
|
+
assertLimitWithinCeiling(opts) {
|
|
97
|
+
const { limit, scope = 'find' } = opts;
|
|
98
|
+
if (limit === undefined) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
// The shape check first, because it needs no metadata at all.
|
|
102
|
+
if (!Number.isInteger(limit) || limit < 0) {
|
|
103
|
+
throw getError({
|
|
104
|
+
message: `[${this.constructor.name}][${scope}] Invalid 'limit' | Expected a non-negative integer | Got: ${limit}`,
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
// `maxLimit` reaches `modelSettings`, which resolves the entity - and THAT throws for a
|
|
108
|
+
// repository with no `@repository` model binding. Such a repository is a misconfiguration this
|
|
109
|
+
// method has no business reporting, and the caller path that used to reach `getDefaultLimit()`
|
|
110
|
+
// never touched it either, because `??` short-circuits when a limit is given. So the ceiling is
|
|
111
|
+
// consulted only when the binding that makes it resolvable is actually present.
|
|
112
|
+
const hasModelBinding = Boolean(MetadataRegistry.getInstance().getRepositoryBinding({ name: this.constructor.name })?.model);
|
|
113
|
+
const ceiling = (hasModelBinding ? this.maxLimit : undefined) ?? DEFAULT_MAX_LIMIT;
|
|
114
|
+
if (limit > ceiling) {
|
|
115
|
+
throw getError({
|
|
116
|
+
message: `[${this.constructor.name}][${scope}] Requested page exceeds this model's limit | requested: ${limit} | maximum: ${ceiling} | raise it with @model settings.maxLimit if larger pages are genuinely needed`,
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* The whole filter, relations included. Checking only the top-level `limit` left the identical
|
|
122
|
+
* defect reachable one level down: a relation scope's negative limit drops Drizzle's LIMIT clause
|
|
123
|
+
* for that relation and loads the entire related table.
|
|
124
|
+
*
|
|
125
|
+
* A relation's limit gets the SHAPE check only, not a ceiling. The ceiling belongs to the
|
|
126
|
+
* relation's own model, which this repository cannot resolve - claiming otherwise would enforce
|
|
127
|
+
* the parent's `maxLimit` on a different entity.
|
|
128
|
+
*/
|
|
129
|
+
assertFilterLimits(opts) {
|
|
130
|
+
const { filter, scope = 'find' } = opts;
|
|
131
|
+
if (!filter) {
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
this.assertLimitWithinCeiling({ limit: filter.limit, scope });
|
|
135
|
+
const walk = (inclusions, path) => {
|
|
136
|
+
for (const inclusion of inclusions ?? []) {
|
|
137
|
+
const relationScope = inclusion.scope;
|
|
138
|
+
if (!relationScope) {
|
|
139
|
+
continue;
|
|
140
|
+
}
|
|
141
|
+
const relationPath = `${path}.${inclusion.relation}`;
|
|
142
|
+
const relationLimit = relationScope.limit;
|
|
143
|
+
if (relationLimit !== undefined &&
|
|
144
|
+
(!Number.isInteger(relationLimit) || relationLimit < 0)) {
|
|
145
|
+
throw getError({
|
|
146
|
+
message: `[${this.constructor.name}][${scope}] Invalid 'limit' on relation scope | relation: ${relationPath} | Expected a non-negative integer | Got: ${relationLimit}`,
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
walk(relationScope.include, relationPath);
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
walk(filter.include, scope);
|
|
153
|
+
}
|
|
84
154
|
/** Resolves the entity instance from @repository metadata on first access. */
|
|
85
155
|
resolveEntity() {
|
|
86
156
|
const registry = MetadataRegistry.getInstance();
|
|
@@ -116,7 +186,7 @@ export class AbstractRepository extends BaseHelper {
|
|
|
116
186
|
return execution();
|
|
117
187
|
}
|
|
118
188
|
const { maxAttempts, maxTotalMs, signal, backoff, until } = options.retry;
|
|
119
|
-
return executeWithRetryUntil({
|
|
189
|
+
return RetryHelper.executeWithRetryUntil({
|
|
120
190
|
operation: [this.constructor.name, operation].join('.'),
|
|
121
191
|
execution,
|
|
122
192
|
until: until ?? defaultUntil,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abstract.js","sourceRoot":"","sources":["../../../../../src/base/repositories/core/abstract.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,
|
|
1
|
+
{"version":3,"file":"abstract.js","sourceRoot":"","sources":["../../../../../src/base/repositories/core/abstract.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,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AC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/base/repositories/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/base/repositories/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/base/repositories/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC"}
|
|
@@ -1,4 +1,27 @@
|
|
|
1
|
-
/**
|
|
2
|
-
import '@hono/zod-openapi';
|
|
3
|
-
export declare const FieldsSchema:
|
|
1
|
+
/** Load order is the point: `@hono/zod-openapi` peers on `zod`, so importing it patches `.openapi()` onto the shared `ZodType` prototype. `buildQuerySchemas` runs at module scope below, and ESM evaluates imports first, so the method exists by the time the decorator is called. Without this import the schemas silently build undecorated whenever this module happens to load before anything else pulls in the OpenAPI layer. */
|
|
2
|
+
import { z } from '@hono/zod-openapi';
|
|
3
|
+
export declare const FieldsSchema: z.ZodOptional<z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodBoolean>, z.ZodArray<z.ZodString>]>>, FilterSchema: any, InclusionSchema: any, LimitSchema: z.ZodOptional<z.ZodNumber>, OffsetSchema: z.ZodOptional<z.ZodNumber>, OrderBySchema: z.ZodOptional<z.ZodArray<z.ZodString>>, SkipSchema: z.ZodOptional<z.ZodNumber>, WhereSchema: z.ZodUnion<readonly [z.ZodType<any, unknown, z.core.$ZodTypeInternals<any, unknown>>, z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<any, string>>, z.ZodType<any, unknown, z.core.$ZodTypeInternals<any, unknown>>>]>;
|
|
4
|
+
/**
|
|
5
|
+
* The query shape of a route that accepts a `filter`. The framework's own `find`, `findById` and
|
|
6
|
+
* `findOne` use it, and a hand-written route gets the same contract by naming it.
|
|
7
|
+
*
|
|
8
|
+
* `filter` needs no `.optional()` at the call site - {@link FilterSchema} already carries one, so a
|
|
9
|
+
* second is a no-op and so is a trailing `.partial()`.
|
|
10
|
+
*
|
|
11
|
+
* Extend it rather than rebuilding it when a route takes more than `filter`:
|
|
12
|
+
* `FilterQuerySchema.extend({ q: z.string().optional() })`.
|
|
13
|
+
*/
|
|
14
|
+
export declare const FilterQuerySchema: z.ZodObject<{
|
|
15
|
+
filter: any;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
/**
|
|
18
|
+
* The query shape of a route that accepts conditions and nothing else - `count` and anything shaped
|
|
19
|
+
* like it. `where` is OPTIONAL here.
|
|
20
|
+
*
|
|
21
|
+
* `updateBy` and `deleteBy` deliberately do not use this. They require `where`, because a missing
|
|
22
|
+
* one there rewrites or deletes every row in the table.
|
|
23
|
+
*/
|
|
24
|
+
export declare const WhereQuerySchema: z.ZodObject<{
|
|
25
|
+
where: z.ZodOptional<z.ZodUnion<readonly [z.ZodType<any, unknown, z.core.$ZodTypeInternals<any, unknown>>, z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<any, string>>, z.ZodType<any, unknown, z.core.$ZodTypeInternals<any, unknown>>>]>>;
|
|
26
|
+
}, z.core.$strip>;
|
|
4
27
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/base/repositories/query-schemas/index.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/base/repositories/query-schemas/index.ts"],"names":[],"mappings":"AAEA,yaAAya;AACza,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAOtC,eAAO,MACL,YAAY,gGACZ,YAAY,OACZ,eAAe,OACf,WAAW,8BACX,YAAY,8BACZ,aAAa,0CACb,UAAU,8BACV,WAAW,yNACwC,CAAC;AAEtD;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB;;iBAE5B,CAAC;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB;;iBAE3B,CAAC"}
|
|
@@ -1,9 +1,32 @@
|
|
|
1
1
|
import { buildQuerySchemas } from '@venizia/ignis-filter/schemas';
|
|
2
|
-
/**
|
|
3
|
-
import '@hono/zod-openapi';
|
|
2
|
+
/** Load order is the point: `@hono/zod-openapi` peers on `zod`, so importing it patches `.openapi()` onto the shared `ZodType` prototype. `buildQuerySchemas` runs at module scope below, and ESM evaluates imports first, so the method exists by the time the decorator is called. Without this import the schemas silently build undecorated whenever this module happens to load before anything else pulls in the OpenAPI layer. */
|
|
3
|
+
import { z } from '@hono/zod-openapi';
|
|
4
4
|
/** The schemas themselves live in `@venizia/ignis-filter`, built with plain `zod` so a browser can use them. Documentation metadata is injected here because it is a server concern - `.openapi()` returns a new schema rather than mutating, and three of the decorations sit on inner nodes, so they cannot be applied after the tree is composed. */
|
|
5
5
|
const openApiDecorator = (schema, metadata) => {
|
|
6
6
|
return schema.openapi(metadata);
|
|
7
7
|
};
|
|
8
8
|
export const { FieldsSchema, FilterSchema, InclusionSchema, LimitSchema, OffsetSchema, OrderBySchema, SkipSchema, WhereSchema, } = buildQuerySchemas({ decorate: openApiDecorator });
|
|
9
|
+
/**
|
|
10
|
+
* The query shape of a route that accepts a `filter`. The framework's own `find`, `findById` and
|
|
11
|
+
* `findOne` use it, and a hand-written route gets the same contract by naming it.
|
|
12
|
+
*
|
|
13
|
+
* `filter` needs no `.optional()` at the call site - {@link FilterSchema} already carries one, so a
|
|
14
|
+
* second is a no-op and so is a trailing `.partial()`.
|
|
15
|
+
*
|
|
16
|
+
* Extend it rather than rebuilding it when a route takes more than `filter`:
|
|
17
|
+
* `FilterQuerySchema.extend({ q: z.string().optional() })`.
|
|
18
|
+
*/
|
|
19
|
+
export const FilterQuerySchema = z.object({ filter: FilterSchema }).openapi({
|
|
20
|
+
description: 'Filter with where, fields, limit, skip, order, include',
|
|
21
|
+
});
|
|
22
|
+
/**
|
|
23
|
+
* The query shape of a route that accepts conditions and nothing else - `count` and anything shaped
|
|
24
|
+
* like it. `where` is OPTIONAL here.
|
|
25
|
+
*
|
|
26
|
+
* `updateBy` and `deleteBy` deliberately do not use this. They require `where`, because a missing
|
|
27
|
+
* one there rewrites or deletes every row in the table.
|
|
28
|
+
*/
|
|
29
|
+
export const WhereQuerySchema = z.object({ where: WhereSchema.optional() }).openapi({
|
|
30
|
+
description: 'Filter conditions',
|
|
31
|
+
});
|
|
9
32
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/base/repositories/query-schemas/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAyB,MAAM,+BAA+B,CAAC;AAEzF
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/base/repositories/query-schemas/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAyB,MAAM,+BAA+B,CAAC;AAEzF,yaAAya;AACza,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAEtC,wVAAwV;AACxV,MAAM,gBAAgB,GAAqB,CAAC,MAAM,EAAE,QAAQ,EAAE,EAAE;IAC9D,OAAQ,MAAc,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC3C,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,EACX,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,WAAW,EACX,YAAY,EACZ,aAAa,EACb,UAAU,EACV,WAAW,GACZ,GAAG,iBAAiB,CAAC,EAAE,QAAQ,EAAE,gBAAgB,EAAE,CAAC,CAAC;AAEtD;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC,OAAO,CAAC;IAC1E,WAAW,EAAE,wDAAwD;CACtE,CAAC,CAAC;AAEH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,WAAW,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC;IAClF,WAAW,EAAE,mBAAmB;CACjC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/base/repositories/sqls/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/base/repositories/sqls/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { TConstValue } from '@venizia/ignis-helpers/common';
|
|
2
|
+
import type { SQL } from 'drizzle-orm';
|
|
3
|
+
/** Walk direction relative to `rootId`: DOWN follows `parentColumn -> idColumn` (descendants), UP follows the reverse (ancestors). */
|
|
4
|
+
export declare class RecursiveTreeDirections {
|
|
5
|
+
static readonly UP = "UP";
|
|
6
|
+
static readonly DOWN = "DOWN";
|
|
7
|
+
static readonly SCHEME_SET: Set<string>;
|
|
8
|
+
static isValid(direction: string): boolean;
|
|
9
|
+
}
|
|
10
|
+
export type TRecursiveTreeDirection = TConstValue<typeof RecursiveTreeDirections>;
|
|
11
|
+
export interface IRecursiveTreeOptions {
|
|
12
|
+
/** CTE name the caller references in the SELECT it writes around this fragment. */
|
|
13
|
+
name: string;
|
|
14
|
+
/** Runtime-checked with `is(table, Table)`; also the sole dialect selector (Postgres vs SQLite) - see {@link RecursiveTreeSql}. */
|
|
15
|
+
table: unknown;
|
|
16
|
+
rootId: string;
|
|
17
|
+
direction: TRecursiveTreeDirection;
|
|
18
|
+
/**
|
|
19
|
+
* Counts EDGES, not rows: the root is at depth 0, so `N` returns up to `N+1` rows.
|
|
20
|
+
* No default - `0` type-checks but silently produces an empty result, so `walk` throws at
|
|
21
|
+
* runtime for `maxDepth <= 0`.
|
|
22
|
+
*/
|
|
23
|
+
maxDepth: number;
|
|
24
|
+
idColumn?: string;
|
|
25
|
+
parentColumn?: string;
|
|
26
|
+
/** Extra columns, beyond `idColumn`/`parentColumn`, carried into every row of the walk. */
|
|
27
|
+
columns?: string[];
|
|
28
|
+
/** ANDed into the recursive term's WHERE clause - build it with Drizzle's own `sql` tag. */
|
|
29
|
+
recursiveFilter?: SQL;
|
|
30
|
+
/**
|
|
31
|
+
* Emits `path`/`is_cycle` and stops expanding once a row re-visits an id in its own path. Row
|
|
32
|
+
* shape differs per engine and nothing in this signature shows it: Postgres returns a real array
|
|
33
|
+
* and boolean; SQLite returns delimited text and `1`/`0` - so `row.path.length` throws on SQLite
|
|
34
|
+
* and `row.is_cycle === true` is always false there.
|
|
35
|
+
*/
|
|
36
|
+
trackPath?: boolean;
|
|
37
|
+
startDepth?: number;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Returns the CTE definition only - the caller writes its own `SELECT ... FROM <name>` around it.
|
|
41
|
+
* Engine is read off `table`, never asked of the caller, so no option can disagree with the schema.
|
|
42
|
+
* SQLite's `path` is `char(31)`-delimited text, not an array: exact unless an id contains that byte,
|
|
43
|
+
* which this class does not reject. Identifiers cannot be parameterized, so `name`/`idColumn`/
|
|
44
|
+
* `parentColumn`/`columns` are allowlist-checked before reaching a template.
|
|
45
|
+
*/
|
|
46
|
+
export declare class RecursiveTreeSql {
|
|
47
|
+
private static assertValidIdentifier;
|
|
48
|
+
static walk(opts: IRecursiveTreeOptions): SQL;
|
|
49
|
+
/** See {@link RecursiveTreeSql} for why there is no separate `engine` option. */
|
|
50
|
+
private static detectEngine;
|
|
51
|
+
/** Postgres needs an explicit cast so the base and recursive terms agree on the `depth` column's type; SQLite's looser typing does not, but casts anyway for parity and to fail loudly on a non-numeric `startDepth`. */
|
|
52
|
+
private static compileDepthCast;
|
|
53
|
+
/** See {@link RecursiveTreeSql} for why Postgres and SQLite need different `path`/`is_cycle` shapes. */
|
|
54
|
+
private static compileCycleGuardFragments;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=recursive-tree.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recursive-tree.d.ts","sourceRoot":"","sources":["../../../../../src/base/repositories/sqls/recursive-tree.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAEjE,OAAO,KAAK,EAAQ,GAAG,EAAE,MAAM,aAAa,CAAC;AAK7C,sIAAsI;AACtI,qBAAa,uBAAuB;IAClC,MAAM,CAAC,QAAQ,CAAC,EAAE,QAAQ;IAC1B,MAAM,CAAC,QAAQ,CAAC,IAAI,UAAU;IAC9B,MAAM,CAAC,QAAQ,CAAC,UAAU,cAAiC;IAE3D,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO;CAG3C;AAED,MAAM,MAAM,uBAAuB,GAAG,WAAW,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAoBlF,MAAM,WAAW,qBAAqB;IACpC,mFAAmF;IACnF,IAAI,EAAE,MAAM,CAAC;IAEb,mIAAmI;IACnI,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,uBAAuB,CAAC;IAEnC;;;;OAIG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,2FAA2F;IAC3F,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IAEnB,4FAA4F;IAC5F,eAAe,CAAC,EAAE,GAAG,CAAC;IAEtB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;GAMG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,MAAM,CAAC,qBAAqB;IAUpC,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,qBAAqB,GAAG,GAAG;IAgF7C,iFAAiF;IACjF,OAAO,CAAC,MAAM,CAAC,YAAY;IAc3B,yNAAyN;IACzN,OAAO,CAAC,MAAM,CAAC,gBAAgB;IAkB/B,wGAAwG;IACxG,OAAO,CAAC,MAAM,CAAC,0BAA0B;CA0B1C"}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { getError } from '@venizia/ignis-helpers/core';
|
|
2
|
+
import { getTableName, is, sql, Table } from 'drizzle-orm';
|
|
3
|
+
import { PgTable } from 'drizzle-orm/pg-core';
|
|
4
|
+
import { SQLiteTable } from 'drizzle-orm/sqlite-core';
|
|
5
|
+
/** Walk direction relative to `rootId`: DOWN follows `parentColumn -> idColumn` (descendants), UP follows the reverse (ancestors). */
|
|
6
|
+
export class RecursiveTreeDirections {
|
|
7
|
+
static { this.UP = 'UP'; }
|
|
8
|
+
static { this.DOWN = 'DOWN'; }
|
|
9
|
+
static { this.SCHEME_SET = new Set([this.UP, this.DOWN]); }
|
|
10
|
+
static isValid(direction) {
|
|
11
|
+
return this.SCHEME_SET.has(direction);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
/** Internal only - not part of {@link IRecursiveTreeOptions}. Derived from `table`, never accepted as an option. */
|
|
15
|
+
class RecursiveTreeEngines {
|
|
16
|
+
static { this.POSTGRES = 'POSTGRES'; }
|
|
17
|
+
static { this.SQLITE = 'SQLITE'; }
|
|
18
|
+
static { this.SCHEME_SET = new Set([this.POSTGRES, this.SQLITE]); }
|
|
19
|
+
}
|
|
20
|
+
/** A SQL identifier is safe to splice only after it matches this allowlist - see {@link RecursiveTreeSql.assertValidIdentifier}. */
|
|
21
|
+
const IDENTIFIER_PATTERN = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
22
|
+
/**
|
|
23
|
+
* ASCII Unit Separator (0x1F) - chosen because it does not occur in real ids, unlike `/` or `,`.
|
|
24
|
+
* See {@link RecursiveTreeSql} for the exactness limitation this relies on.
|
|
25
|
+
*/
|
|
26
|
+
const SQLITE_PATH_DELIMITER = sql.raw('char(31)');
|
|
27
|
+
/**
|
|
28
|
+
* Returns the CTE definition only - the caller writes its own `SELECT ... FROM <name>` around it.
|
|
29
|
+
* Engine is read off `table`, never asked of the caller, so no option can disagree with the schema.
|
|
30
|
+
* SQLite's `path` is `char(31)`-delimited text, not an array: exact unless an id contains that byte,
|
|
31
|
+
* which this class does not reject. Identifiers cannot be parameterized, so `name`/`idColumn`/
|
|
32
|
+
* `parentColumn`/`columns` are allowlist-checked before reaching a template.
|
|
33
|
+
*/
|
|
34
|
+
export class RecursiveTreeSql {
|
|
35
|
+
static assertValidIdentifier(opts) {
|
|
36
|
+
const { field, value } = opts;
|
|
37
|
+
if (!IDENTIFIER_PATTERN.test(value)) {
|
|
38
|
+
throw getError({
|
|
39
|
+
message: `[RecursiveTreeSql.walk] Invalid '${field}' | Expected letters, digits and underscores only, not starting with a digit | Got: ${value}`,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
static walk(opts) {
|
|
44
|
+
const { name, table, rootId, direction, maxDepth, idColumn = 'id', parentColumn = 'parent_id', columns = [], recursiveFilter, trackPath = false, startDepth = 0, } = opts;
|
|
45
|
+
RecursiveTreeSql.assertValidIdentifier({ field: 'name', value: name });
|
|
46
|
+
RecursiveTreeSql.assertValidIdentifier({ field: 'idColumn', value: idColumn });
|
|
47
|
+
RecursiveTreeSql.assertValidIdentifier({ field: 'parentColumn', value: parentColumn });
|
|
48
|
+
columns.forEach(column => RecursiveTreeSql.assertValidIdentifier({ field: 'columns', value: column }));
|
|
49
|
+
if (!RecursiveTreeDirections.isValid(direction)) {
|
|
50
|
+
throw getError({
|
|
51
|
+
message: `[RecursiveTreeSql.walk] Invalid 'direction' | Expected ${RecursiveTreeDirections.UP} or ${RecursiveTreeDirections.DOWN} | Got: ${direction}`,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
if (!Number.isInteger(maxDepth) || maxDepth <= 0) {
|
|
55
|
+
throw getError({
|
|
56
|
+
message: `[RecursiveTreeSql.walk] Invalid 'maxDepth' | Expected a positive integer | Got: ${maxDepth}`,
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
if (!is(table, Table)) {
|
|
60
|
+
throw getError({
|
|
61
|
+
message: `[RecursiveTreeSql.walk] Invalid 'table' | Expected a Drizzle table | Got: ${typeof table}`,
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
const engine = RecursiveTreeSql.detectEngine(table);
|
|
65
|
+
const tableName = getTableName(table);
|
|
66
|
+
RecursiveTreeSql.assertValidIdentifier({ field: 'table', value: tableName });
|
|
67
|
+
const tableIdentifier = sql.identifier(tableName);
|
|
68
|
+
const cteIdentifier = sql.identifier(name);
|
|
69
|
+
const idIdentifier = sql.identifier(idColumn);
|
|
70
|
+
const parentIdentifier = sql.identifier(parentColumn);
|
|
71
|
+
const extraIdentifiers = columns.map(column => sql.identifier(column));
|
|
72
|
+
const baseColumnList = sql.join([idIdentifier, parentIdentifier, ...extraIdentifiers], sql `, `);
|
|
73
|
+
const recursiveColumnList = sql.join([idIdentifier, parentIdentifier, ...extraIdentifiers].map(identifier => sql `t.${identifier}`), sql `, `);
|
|
74
|
+
const depthCast = RecursiveTreeSql.compileDepthCast({ engine, depth: startDepth });
|
|
75
|
+
const { basePathColumns, recursivePathColumns } = trackPath
|
|
76
|
+
? RecursiveTreeSql.compileCycleGuardFragments({ engine, idIdentifier })
|
|
77
|
+
: { basePathColumns: sql ``, recursivePathColumns: sql `` };
|
|
78
|
+
const baseCase = sql `SELECT ${baseColumnList}, ${depthCast} AS depth${basePathColumns} FROM ${tableIdentifier} WHERE ${idIdentifier} = ${rootId}`;
|
|
79
|
+
// DOWN walks parent -> children (t.parentColumn = r.idColumn); UP walks child -> parent (t.idColumn = r.parentColumn).
|
|
80
|
+
const joinCondition = direction === RecursiveTreeDirections.DOWN
|
|
81
|
+
? sql `t.${parentIdentifier} = r.${idIdentifier}`
|
|
82
|
+
: sql `t.${idIdentifier} = r.${parentIdentifier}`;
|
|
83
|
+
// `NOT r.is_cycle` stops expanding a row already flagged cyclic - the row itself stays in the
|
|
84
|
+
// result set with is_cycle = true, only its own children are cut off.
|
|
85
|
+
const cycleGuard = trackPath ? sql ` AND NOT r.is_cycle` : sql ``;
|
|
86
|
+
const extraFilter = recursiveFilter ? sql ` AND (${recursiveFilter})` : sql ``;
|
|
87
|
+
const recursiveCase = sql `SELECT ${recursiveColumnList}, r.depth + 1${recursivePathColumns} FROM ${tableIdentifier} t JOIN ${cteIdentifier} r ON ${joinCondition} WHERE r.depth + 1 <= ${maxDepth}${cycleGuard}${extraFilter}`;
|
|
88
|
+
return sql `WITH RECURSIVE ${cteIdentifier} AS (${baseCase} UNION ALL ${recursiveCase})`;
|
|
89
|
+
}
|
|
90
|
+
/** See {@link RecursiveTreeSql} for why there is no separate `engine` option. */
|
|
91
|
+
static detectEngine(table) {
|
|
92
|
+
if (is(table, PgTable)) {
|
|
93
|
+
return RecursiveTreeEngines.POSTGRES;
|
|
94
|
+
}
|
|
95
|
+
if (is(table, SQLiteTable)) {
|
|
96
|
+
return RecursiveTreeEngines.SQLITE;
|
|
97
|
+
}
|
|
98
|
+
throw getError({
|
|
99
|
+
message: `[RecursiveTreeSql.walk] Invalid 'table' | Expected a Postgres or SQLite Drizzle table | Got: ${getTableName(table)}`,
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
/** Postgres needs an explicit cast so the base and recursive terms agree on the `depth` column's type; SQLite's looser typing does not, but casts anyway for parity and to fail loudly on a non-numeric `startDepth`. */
|
|
103
|
+
static compileDepthCast(opts) {
|
|
104
|
+
const { engine, depth } = opts;
|
|
105
|
+
switch (engine) {
|
|
106
|
+
case RecursiveTreeEngines.POSTGRES: {
|
|
107
|
+
return sql `${depth}::int`;
|
|
108
|
+
}
|
|
109
|
+
case RecursiveTreeEngines.SQLITE: {
|
|
110
|
+
return sql `CAST(${depth} AS INTEGER)`;
|
|
111
|
+
}
|
|
112
|
+
default: {
|
|
113
|
+
throw getError({
|
|
114
|
+
message: `[RecursiveTreeSql.walk] Invalid 'engine' | Got: ${engine}`,
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
/** See {@link RecursiveTreeSql} for why Postgres and SQLite need different `path`/`is_cycle` shapes. */
|
|
120
|
+
static compileCycleGuardFragments(opts) {
|
|
121
|
+
const { engine, idIdentifier } = opts;
|
|
122
|
+
switch (engine) {
|
|
123
|
+
case RecursiveTreeEngines.POSTGRES: {
|
|
124
|
+
return {
|
|
125
|
+
basePathColumns: sql `, ARRAY[${idIdentifier}] AS path, false AS is_cycle`,
|
|
126
|
+
recursivePathColumns: sql `, r.path || t.${idIdentifier} AS path, t.${idIdentifier} = ANY(r.path) AS is_cycle`,
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
case RecursiveTreeEngines.SQLITE: {
|
|
130
|
+
return {
|
|
131
|
+
basePathColumns: sql `, ${SQLITE_PATH_DELIMITER} || ${idIdentifier} || ${SQLITE_PATH_DELIMITER} AS path, 0 AS is_cycle`,
|
|
132
|
+
recursivePathColumns: sql `, r.path || t.${idIdentifier} || ${SQLITE_PATH_DELIMITER} AS path, instr(r.path, ${SQLITE_PATH_DELIMITER} || t.${idIdentifier} || ${SQLITE_PATH_DELIMITER}) > 0 AS is_cycle`,
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
default: {
|
|
136
|
+
throw getError({
|
|
137
|
+
message: `[RecursiveTreeSql.walk] Invalid 'engine' | Got: ${engine}`,
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
//# sourceMappingURL=recursive-tree.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recursive-tree.js","sourceRoot":"","sources":["../../../../../src/base/repositories/sqls/recursive-tree.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAEvD,OAAO,EAAE,YAAY,EAAE,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,sIAAsI;AACtI,MAAM,OAAO,uBAAuB;aAClB,OAAE,GAAG,IAAI,CAAC;aACV,SAAI,GAAG,MAAM,CAAC;aACd,eAAU,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAE3D,MAAM,CAAC,OAAO,CAAC,SAAiB;QAC9B,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IACxC,CAAC;;AAKH,oHAAoH;AACpH,MAAM,oBAAoB;aACR,aAAQ,GAAG,UAAU,CAAC;aACtB,WAAM,GAAG,QAAQ,CAAC;aAClB,eAAU,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;;AAKrE,oIAAoI;AACpI,MAAM,kBAAkB,GAAG,0BAA0B,CAAC;AAEtD;;;GAGG;AACH,MAAM,qBAAqB,GAAG,GAAG,CAAC,GAAG,CAAC,UAAU,CAA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W,YAAY,8BAA8B;oBACzE,oBAAoB,EAAE,GAAG,CAAA,iBAAiB,YAAY,eAAe,YAAY,4BAA4B;iBAC9G,CAAC;YACJ,CAAC;YACD,KAAK,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC;gBACjC,OAAO;oBACL,eAAe,EAAE,GAAG,CAAA,KAAK,qBAAqB,OAAO,YAAY,OAAO,qBAAqB,yBAAyB;oBACtH,oBAAoB,EAAE,GAAG,CAAA,iBAAiB,YAAY,OAAO,qBAAqB,2BAA2B,qBAAqB,SAAS,YAAY,OAAO,qBAAqB,mBAAmB;iBACvM,CAAC;YACJ,CAAC;YACD,OAAO,CAAC,CAAC,CAAC;gBACR,MAAM,QAAQ,CAAC;oBACb,OAAO,EAAE,mDAAmD,MAAM,EAAE;iBACrE,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC;CACF"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import type { TAuthMode, TAuthStrategy } from '../../../base/auth/authenticate/common/index.js';
|
|
2
|
+
import type { IAuthorizationSpec } from '../../../base/auth/authorize/common/types.js';
|
|
1
3
|
import type { ControllerTransports } from '../../../base/controllers/common/constants.js';
|
|
2
4
|
import type { IDataSource, TDataSourceDriverClass } from '../../../base/datasources/index.js';
|
|
3
5
|
import type { AbstractEntity } from '../../../base/models/index.js';
|
|
4
|
-
import type { IRepository, TFilter, TRepositoryOperationScope } from '../../../base/repositories/index.js';
|
|
5
|
-
import type {
|
|
6
|
-
import type { IAuthorizationSpec } from '../../../base/auth/authorize/common/types.js';
|
|
7
|
-
import type { TClass, TGrpcMethod, TValueOrResolver } from '@venizia/ignis-helpers/common';
|
|
6
|
+
import type { IRepository, ScopeFilters, TFilter, TRepositoryOperationScope, TScopeFilterMissingBehavior, TWhere } from '../../../base/repositories/index.js';
|
|
7
|
+
import type { TClass, TGrpcMethod, TNullable, TValueOrResolver } from '@venizia/ignis-helpers/common';
|
|
8
8
|
import { type IInjectMetadata as _IInjectMetadata, type IPropertyMetadata as _IPropertyMetadata } from '@venizia/ignis-inversion';
|
|
9
9
|
interface IBaseControllerMetadata {
|
|
10
10
|
path: string;
|
|
@@ -44,11 +44,41 @@ export interface IModelAuthorizeSettings {
|
|
|
44
44
|
/** Extensible - consumers can add any extra authorization metadata. */
|
|
45
45
|
[extra: string | symbol]: any;
|
|
46
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* Row-scope resolver for `@model` settings.scopeFilter - resolved per query, so it can depend on
|
|
49
|
+
* the current request (tenant, org, membership). Framework-internal escape hatches aside, nothing
|
|
50
|
+
* short of removing this setting from the model turns scoping off.
|
|
51
|
+
*/
|
|
52
|
+
export interface IScopeFilterSettings {
|
|
53
|
+
/**
|
|
54
|
+
* Returns the scope `where`; `ScopeFilters.UNRESTRICTED` to apply no scope for THIS call (an
|
|
55
|
+
* internal operator, a caller the application has decided sees everything); or null/undefined
|
|
56
|
+
* when this caller's scope cannot be determined at all.
|
|
57
|
+
*/
|
|
58
|
+
resolve: () => TNullable<TWhere> | typeof ScopeFilters.UNRESTRICTED;
|
|
59
|
+
/**
|
|
60
|
+
* What `applyScopeFilter` does when `resolve()` returns null/undefined - no request context, no
|
|
61
|
+
* tenant, a background job. Defaults to `deny`: an unresolved scope matches zero rows, never
|
|
62
|
+
* every row. `allow` is an explicit, reviewed opt-out for migrations and background jobs, declared
|
|
63
|
+
* per MODEL - it cannot express a per-USER bypass; use `ScopeFilters.UNRESTRICTED` for that.
|
|
64
|
+
*/
|
|
65
|
+
onMissing?: TScopeFilterMissingBehavior;
|
|
66
|
+
}
|
|
47
67
|
export interface IModelSettings {
|
|
48
68
|
/** Properties excluded from all query results at SQL level. */
|
|
49
69
|
hiddenProperties?: string[];
|
|
50
70
|
/** Default filter auto-applied to all repository operations. Bypassable via shouldSkipDefaultFilter. */
|
|
51
71
|
defaultFilter?: TFilter;
|
|
72
|
+
/**
|
|
73
|
+
* Row scope: ANDed into every read and write whose scope is expressible as a filter clause, and
|
|
74
|
+
* NOT removable by `shouldSkipDefaultFilter`. Resolved per query, so it can depend on the current
|
|
75
|
+
* request. Ownership resolved per row or through a polymorphic reference is NOT expressible here -
|
|
76
|
+
* that check is still the application's to perform.
|
|
77
|
+
*
|
|
78
|
+
* Relational repositories only - a search-backed model (Typesense, Meilisearch) never reads
|
|
79
|
+
* this setting, so mirroring a scoped entity into a search index needs its own query-time scope.
|
|
80
|
+
*/
|
|
81
|
+
scopeFilter?: IScopeFilterSettings;
|
|
52
82
|
/** Default row limit when a query omits `limit`. Must be a positive integer. Falls back to DEFAULT_LIMIT (10). */
|
|
53
83
|
defaultLimit?: number;
|
|
54
84
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/helpers/inversion/common/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/helpers/inversion/common/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAChF,OAAO,KAAK,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,KAAK,EACV,WAAW,EACX,YAAY,EACZ,OAAO,EACP,yBAAyB,EACzB,2BAA2B,EAC3B,MAAM,EACP,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EACV,MAAM,EACN,WAAW,EACX,SAAS,EACT,gBAAgB,EACjB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,KAAK,eAAe,IAAI,gBAAgB,EACxC,KAAK,iBAAiB,IAAI,kBAAkB,EAC7C,MAAM,0BAA0B,CAAC;AA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
|
|
1
1
|
{
|
|
2
2
|
"name": "@venizia/ignis-kernel",
|
|
3
|
-
"version": "0.2.0-
|
|
3
|
+
"version": "0.2.0-10",
|
|
4
4
|
"description": "Browser-pure kernel of the IGNIS framework: dependency injection, lifecycle, REST controllers, repository and datasource abstractions, and the authentication and authorization seams. No node builtin and no server-only peer, so the same kernel serves a Bun server and a browser Worker.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"authentication",
|
|
@@ -79,9 +79,9 @@
|
|
|
79
79
|
"prepublishOnly": "bun run rebuild"
|
|
80
80
|
},
|
|
81
81
|
"dependencies": {
|
|
82
|
-
"@venizia/ignis-filter": "^0.2.0-
|
|
83
|
-
"@venizia/ignis-helpers": "^0.2.0-
|
|
84
|
-
"@venizia/ignis-inversion": "^0.2.0-
|
|
82
|
+
"@venizia/ignis-filter": "^0.2.0-5",
|
|
83
|
+
"@venizia/ignis-helpers": "^0.2.0-8",
|
|
84
|
+
"@venizia/ignis-inversion": "^0.2.0-3",
|
|
85
85
|
"lodash": "^4.18.1",
|
|
86
86
|
"reflect-metadata": "^0.2.2",
|
|
87
87
|
"zod": "^4.4.3"
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
"devDependencies": {
|
|
108
108
|
"@types/bun": "^1.3.14",
|
|
109
109
|
"@types/lodash": "^4.17.23",
|
|
110
|
-
"@venizia/dev-configs": "^0.2.0-
|
|
110
|
+
"@venizia/dev-configs": "^0.2.0-3",
|
|
111
111
|
"casbin": "^5.51.1",
|
|
112
112
|
"eslint": "^10.7.0",
|
|
113
113
|
"prettier": "^3.9.5",
|