@atscript/db 0.1.161 → 0.1.162
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/agg.cjs +1 -1
- package/dist/agg.d.cts +1 -1
- package/dist/agg.d.mts +1 -1
- package/dist/agg.mjs +1 -1
- package/dist/{aggregate-fns-B_sgl4mB.mjs → aggregate-fns-DsS9UQVB.mjs} +1 -1
- package/dist/{aggregate-fns-DFtKAv7Q.cjs → aggregate-fns-DupYzFD7.cjs} +1 -1
- package/dist/{buckets-8mG67Mtw.d.mts → buckets-DUTcrT4Z.d.mts} +475 -57
- package/dist/{buckets-B4T_alUe.d.cts → buckets-_iZV39Z3.d.cts} +475 -57
- package/dist/{column-diff-DpeUbhEI.cjs → column-diff-CZsMGQ_w.cjs} +846 -232
- package/dist/{column-diff-DR1glykD.mjs → column-diff-pdn53AIj.mjs} +829 -233
- package/dist/{validator-B3xlbrWf.d.cts → db-error-B_DRL1E9.d.cts} +18 -89
- package/dist/{validator-B3xlbrWf.d.mts → db-error-B_DRL1E9.d.mts} +18 -89
- package/dist/{db-error-JcfJqqpk.cjs → db-error-DmF1_xrz.cjs} +13 -0
- package/dist/{db-error-eSsQX7rt.mjs → db-error-hraC12B9.mjs} +8 -1
- package/dist/{db-validator-plugin-BWy60OvG.d.cts → db-validator-plugin-wRqMYNBI.d.cts} +6 -0
- package/dist/{db-validator-plugin-BWy60OvG.d.mts → db-validator-plugin-wRqMYNBI.d.mts} +6 -0
- package/dist/{fk-diff-5gX42hBt.d.mts → fk-diff-B5jW68T3.d.cts} +34 -10
- package/dist/{fk-diff-BWdQ7kRZ.d.cts → fk-diff-PhVBYohc.d.mts} +34 -10
- package/dist/index.cjs +12 -11
- package/dist/index.d.cts +24 -21
- package/dist/index.d.mts +24 -21
- package/dist/index.mjs +9 -12
- package/dist/{nested-writer-BOj_c_lI.mjs → nested-writer-ClUX0DB0.mjs} +16 -22
- package/dist/{nested-writer-Bl1SZS7x.cjs → nested-writer-yCy6wGuN.cjs} +16 -22
- package/dist/{object-CtPYTIvy.d.cts → object-Czia_qD4.d.cts} +7 -1
- package/dist/{object-CtPYTIvy.d.mts → object-Czia_qD4.d.mts} +7 -1
- package/dist/{object-Djg28csK.cjs → object-GjsuPNqo.cjs} +19 -0
- package/dist/{object-TkiJQ-Dp.mjs → object-PQ1J8jri.mjs} +14 -1
- package/dist/ops.cjs +6 -21
- package/dist/ops.mjs +6 -21
- package/dist/plugin.cjs +263 -323
- package/dist/plugin.mjs +163 -223
- package/dist/rel.cjs +2 -2
- package/dist/rel.d.cts +3 -3
- package/dist/rel.d.mts +3 -3
- package/dist/rel.mjs +2 -2
- package/dist/{relation-helpers-17_2f5hX.d.mts → relation-helpers-BAEkP4bH.d.cts} +1 -1
- package/dist/{relation-helpers-BLBrLQYi.d.cts → relation-helpers-BSYwxOSA.d.mts} +1 -1
- package/dist/{relation-loader-DeulLrAw.cjs → relation-loader-DujL_Mh9.cjs} +1 -1
- package/dist/{relation-loader-CNBMPfRr.mjs → relation-loader-Qv3LrQ42.mjs} +1 -1
- package/dist/{search-fields-CE8cmj9X.mjs → search-fields-0U0FAFGj.mjs} +47 -1
- package/dist/{search-fields-CT_UZ9fg.cjs → search-fields-Bi1n-pB1.cjs} +64 -0
- package/dist/search-fields-CHqqcC3W.d.cts +30 -0
- package/dist/search-fields-CHqqcC3W.d.mts +30 -0
- package/dist/shared.cjs +42 -26
- package/dist/shared.d.cts +98 -4
- package/dist/shared.d.mts +98 -4
- package/dist/shared.mjs +4 -2
- package/dist/sync.cjs +228 -65
- package/dist/sync.d.cts +41 -5
- package/dist/sync.d.mts +41 -5
- package/dist/sync.mjs +228 -66
- package/dist/validator-BcBtg8yW.d.cts +88 -0
- package/dist/validator-BcBtg8yW.d.mts +88 -0
- package/dist/{validator-B4YDLUkj.cjs → validator-DK9Ijpo7.cjs} +3 -2
- package/dist/{validator-B3fPJjS1.mjs → validator-DuDWsIdQ.mjs} +3 -2
- package/dist/validator.cjs +3 -3
- package/dist/validator.d.cts +4 -3
- package/dist/validator.d.mts +4 -3
- package/dist/validator.mjs +3 -3
- package/dist/{validation-utils-CtLNlBtB.cjs → view-validation-D50KWU7O.cjs} +452 -18
- package/dist/{validation-utils-BGjqc2jU.mjs → view-validation-QbqqXEAM.mjs} +364 -20
- package/package.json +6 -6
package/dist/rel.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_nested_writer = require("./nested-writer-
|
|
3
|
-
const require_relation_loader = require("./relation-loader-
|
|
2
|
+
const require_nested_writer = require("./nested-writer-yCy6wGuN.cjs");
|
|
3
|
+
const require_relation_loader = require("./relation-loader-DujL_Mh9.cjs");
|
|
4
4
|
exports.applyPatchNestedTo = require_nested_writer.applyPatchNestedTo;
|
|
5
5
|
exports.batchInsertNestedFrom = require_nested_writer.batchInsertNestedFrom;
|
|
6
6
|
exports.batchInsertNestedTo = require_nested_writer.batchInsertNestedTo;
|
package/dist/rel.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as DbValidationContext } from "./db-validator-plugin-
|
|
3
|
-
import { n as findRemoteFK, r as resolveRelationTargetTable, t as findFKForRelation } from "./relation-helpers-
|
|
1
|
+
import { Jt as TTableResolver, K as TDbForeignKey, an as TableMetadata, cr as TGenericLogger, ct as TDbRelation, en as TWriteTableResolver, fn as BaseDbAdapter, h as AtscriptDbWritable, m as AtscriptDbTableLike } from "./buckets-_iZV39Z3.cjs";
|
|
2
|
+
import { t as DbValidationContext } from "./db-validator-plugin-wRqMYNBI.cjs";
|
|
3
|
+
import { n as findRemoteFK, r as resolveRelationTargetTable, t as findFKForRelation } from "./relation-helpers-BAEkP4bH.cjs";
|
|
4
4
|
import { FilterExpr, WithRelation } from "@uniqu/core";
|
|
5
5
|
import { Validator } from "@atscript/typescript/utils";
|
|
6
6
|
|
package/dist/rel.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as DbValidationContext } from "./db-validator-plugin-
|
|
3
|
-
import { n as findRemoteFK, r as resolveRelationTargetTable, t as findFKForRelation } from "./relation-helpers-
|
|
1
|
+
import { Jt as TTableResolver, K as TDbForeignKey, an as TableMetadata, cr as TGenericLogger, ct as TDbRelation, en as TWriteTableResolver, fn as BaseDbAdapter, h as AtscriptDbWritable, m as AtscriptDbTableLike } from "./buckets-DUTcrT4Z.mjs";
|
|
2
|
+
import { t as DbValidationContext } from "./db-validator-plugin-wRqMYNBI.mjs";
|
|
3
|
+
import { n as findRemoteFK, r as resolveRelationTargetTable, t as findFKForRelation } from "./relation-helpers-BSYwxOSA.mjs";
|
|
4
4
|
import { Validator } from "@atscript/typescript/utils";
|
|
5
5
|
import { FilterExpr, WithRelation } from "@uniqu/core";
|
|
6
6
|
|
package/dist/rel.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { t as loadRelationsImpl } from "./relation-loader-
|
|
2
|
-
import { B as resolveRelationTargetTable, R as findFKForRelation, a as batchPatchNestedFrom, c as batchReplaceNestedFrom, d as checkDepthOverflow, f as planNestedFromVia, h as validateBatch, i as batchInsertNestedVia, l as batchReplaceNestedTo, m as preValidateNestedFrom, n as batchInsertNestedFrom, o as batchPatchNestedTo, p as planPatchNestedTo, r as batchInsertNestedTo, s as batchPatchNestedVia, t as applyPatchNestedTo, u as batchReplaceNestedVia, z as findRemoteFK } from "./nested-writer-
|
|
1
|
+
import { t as loadRelationsImpl } from "./relation-loader-Qv3LrQ42.mjs";
|
|
2
|
+
import { B as resolveRelationTargetTable, R as findFKForRelation, a as batchPatchNestedFrom, c as batchReplaceNestedFrom, d as checkDepthOverflow, f as planNestedFromVia, h as validateBatch, i as batchInsertNestedVia, l as batchReplaceNestedTo, m as preValidateNestedFrom, n as batchInsertNestedFrom, o as batchPatchNestedTo, p as planPatchNestedTo, r as batchInsertNestedTo, s as batchPatchNestedVia, t as applyPatchNestedTo, u as batchReplaceNestedVia, z as findRemoteFK } from "./nested-writer-ClUX0DB0.mjs";
|
|
3
3
|
export { applyPatchNestedTo, batchInsertNestedFrom, batchInsertNestedTo, batchInsertNestedVia, batchPatchNestedFrom, batchPatchNestedTo, batchPatchNestedVia, batchReplaceNestedFrom, batchReplaceNestedTo, batchReplaceNestedVia, checkDepthOverflow, findFKForRelation, findRemoteFK, loadRelationsImpl, planNestedFromVia, planPatchNestedTo, preValidateNestedFrom, resolveRelationTargetTable, validateBatch };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { K as TDbForeignKey, ct as TDbRelation } from "./buckets-_iZV39Z3.cjs";
|
|
2
2
|
import { TAtscriptAnnotatedType } from "@atscript/typescript/utils";
|
|
3
3
|
|
|
4
4
|
//#region src/rel/relation-helpers.d.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { K as TDbForeignKey, ct as TDbRelation } from "./buckets-DUTcrT4Z.mjs";
|
|
2
2
|
import { TAtscriptAnnotatedType } from "@atscript/typescript/utils";
|
|
3
3
|
|
|
4
4
|
//#region src/rel/relation-helpers.d.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_nested_writer = require("./nested-writer-
|
|
1
|
+
const require_nested_writer = require("./nested-writer-yCy6wGuN.cjs");
|
|
2
2
|
//#region src/rel/relation-loader.ts
|
|
3
3
|
var relation_loader_exports = /* @__PURE__ */ require("./plugin.cjs").__exportAll({
|
|
4
4
|
ensureSelectIncludesFields: () => ensureSelectIncludesFields,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as resolveRelationTargetTable, E as andFilters, I as compositeKey, P as relationStaticFilter, R as findFKForRelation, V as slicePerGroup, z as findRemoteFK } from "./nested-writer-
|
|
1
|
+
import { B as resolveRelationTargetTable, E as andFilters, I as compositeKey, P as relationStaticFilter, R as findFKForRelation, V as slicePerGroup, z as findRemoteFK } from "./nested-writer-ClUX0DB0.mjs";
|
|
2
2
|
//#region \0rolldown/runtime.js
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __exportAll = (all, no_symbols) => {
|
|
@@ -30,6 +30,7 @@ const DERIVED_INCOMPATIBLE = [
|
|
|
30
30
|
["db.default.uuid", "the value is computed, never defaulted"],
|
|
31
31
|
["db.default.now", "the value is computed, never defaulted"],
|
|
32
32
|
["db.onUpdate.now", "a derived column is never written"],
|
|
33
|
+
["db.onUpdate.inc", "a derived column is never written"],
|
|
33
34
|
["db.column.version", "the version column is adapter-managed"],
|
|
34
35
|
["db.column.version.exempt", "a derived column is never written"],
|
|
35
36
|
["db.encrypted", "the value is a cleartext extraction of its source"],
|
|
@@ -73,6 +74,7 @@ const SEARCH_PROBLEM = {
|
|
|
73
74
|
now: "is a timestamp (@db.default.now) — filter it by range instead",
|
|
74
75
|
precision: "has @db.column.precision (stored as a decimal)",
|
|
75
76
|
float: "is a floating-point number — declare it number.int (or a sized integer), add @expect.int, or use @db.default.increment",
|
|
77
|
+
floatViewField: "is a floating-point number — declare it number.int (or a sized integer) or add @expect.int",
|
|
76
78
|
decimal: "is a decimal"
|
|
77
79
|
};
|
|
78
80
|
/** Problem for a primitive of another base type (`boolean`, …). */
|
|
@@ -114,5 +116,49 @@ function searchMemberKind(type) {
|
|
|
114
116
|
precision: has("db.column.precision")
|
|
115
117
|
});
|
|
116
118
|
}
|
|
119
|
+
/**
|
|
120
|
+
* Field annotations of the search / index features that cannot work over
|
|
121
|
+
* ciphertext — refused on an `@db.encrypted` field, on any field inside one
|
|
122
|
+
* and on a view field over an encrypted source (compile time and metadata
|
|
123
|
+
* build).
|
|
124
|
+
* @since 0.1.162
|
|
125
|
+
*/
|
|
126
|
+
const ENCRYPTED_SEARCH_FEATURES = [
|
|
127
|
+
"db.column.searchable",
|
|
128
|
+
"db.index.fulltext",
|
|
129
|
+
"db.index.geo",
|
|
130
|
+
"db.search.vector",
|
|
131
|
+
"db.search.filter",
|
|
132
|
+
"db.mongo.search.text",
|
|
133
|
+
"db.mongo.search.autocomplete"
|
|
134
|
+
];
|
|
135
|
+
/** Why each of {@link ENCRYPTED_SEARCH_FEATURES} cannot sit on an `@db.encrypted` field. */
|
|
136
|
+
const ENCRYPTED_SEARCH_WHY = {
|
|
137
|
+
"db.column.searchable": "search over ciphertext is impossible",
|
|
138
|
+
"db.index.fulltext": "indexes over ciphertext are meaningless",
|
|
139
|
+
"db.index.geo": "geo indexes over ciphertext are meaningless",
|
|
140
|
+
"db.search.vector": "vector search over ciphertext is impossible",
|
|
141
|
+
"db.search.filter": "search filters need cleartext equality",
|
|
142
|
+
"db.mongo.search.text": "Atlas Search over ciphertext is impossible",
|
|
143
|
+
"db.mongo.search.autocomplete": "Atlas Search over ciphertext is impossible"
|
|
144
|
+
};
|
|
145
|
+
/**
|
|
146
|
+
* Annotations an `@db.encrypted` field cannot carry, with the reason — the
|
|
147
|
+
* compile-time `@db.encrypted` check and the metadata build share it (the
|
|
148
|
+
* search rows are {@link ENCRYPTED_SEARCH_FEATURES}).
|
|
149
|
+
* @since 0.1.162
|
|
150
|
+
*/
|
|
151
|
+
const ENCRYPTED_INCOMPATIBLE = [
|
|
152
|
+
["meta.id", "the primary key must be addressable"],
|
|
153
|
+
["db.rel.FK", "joins are impossible over ciphertext"],
|
|
154
|
+
["db.index.plain", "indexes over ciphertext are meaningless"],
|
|
155
|
+
["db.index.unique", "indexes over ciphertext are meaningless"],
|
|
156
|
+
...ENCRYPTED_SEARCH_FEATURES.map((key) => [key, ENCRYPTED_SEARCH_WHY[key]]),
|
|
157
|
+
["db.column.version", "the OCC filter needs cleartext equality"],
|
|
158
|
+
["db.default.increment", "engine-side defaults bypass the encryption transform"],
|
|
159
|
+
["db.default.now", "engine-side defaults bypass the encryption transform"],
|
|
160
|
+
["db.onUpdate.now", "the update time is set after the encryption transform"],
|
|
161
|
+
["db.onUpdate.inc", "the counter is incremented by the database"]
|
|
162
|
+
];
|
|
117
163
|
//#endregion
|
|
118
|
-
export {
|
|
164
|
+
export { searchMemberKind as a, DERIVED_INCOMPATIBLE as c, searchKindOf as i, JSON_LEAF_TYPES as l, ENCRYPTED_SEARCH_FEATURES as n, numericTypeProblem as o, SEARCH_PROBLEM as r, DB_ENTITY_ANNOTATIONS as s, ENCRYPTED_INCOMPATIBLE as t, isJsonLeafType as u };
|
|
@@ -30,6 +30,7 @@ const DERIVED_INCOMPATIBLE = [
|
|
|
30
30
|
["db.default.uuid", "the value is computed, never defaulted"],
|
|
31
31
|
["db.default.now", "the value is computed, never defaulted"],
|
|
32
32
|
["db.onUpdate.now", "a derived column is never written"],
|
|
33
|
+
["db.onUpdate.inc", "a derived column is never written"],
|
|
33
34
|
["db.column.version", "the version column is adapter-managed"],
|
|
34
35
|
["db.column.version.exempt", "a derived column is never written"],
|
|
35
36
|
["db.encrypted", "the value is a cleartext extraction of its source"],
|
|
@@ -73,6 +74,7 @@ const SEARCH_PROBLEM = {
|
|
|
73
74
|
now: "is a timestamp (@db.default.now) — filter it by range instead",
|
|
74
75
|
precision: "has @db.column.precision (stored as a decimal)",
|
|
75
76
|
float: "is a floating-point number — declare it number.int (or a sized integer), add @expect.int, or use @db.default.increment",
|
|
77
|
+
floatViewField: "is a floating-point number — declare it number.int (or a sized integer) or add @expect.int",
|
|
76
78
|
decimal: "is a decimal"
|
|
77
79
|
};
|
|
78
80
|
/** Problem for a primitive of another base type (`boolean`, …). */
|
|
@@ -114,6 +116,50 @@ function searchMemberKind(type) {
|
|
|
114
116
|
precision: has("db.column.precision")
|
|
115
117
|
});
|
|
116
118
|
}
|
|
119
|
+
/**
|
|
120
|
+
* Field annotations of the search / index features that cannot work over
|
|
121
|
+
* ciphertext — refused on an `@db.encrypted` field, on any field inside one
|
|
122
|
+
* and on a view field over an encrypted source (compile time and metadata
|
|
123
|
+
* build).
|
|
124
|
+
* @since 0.1.162
|
|
125
|
+
*/
|
|
126
|
+
const ENCRYPTED_SEARCH_FEATURES = [
|
|
127
|
+
"db.column.searchable",
|
|
128
|
+
"db.index.fulltext",
|
|
129
|
+
"db.index.geo",
|
|
130
|
+
"db.search.vector",
|
|
131
|
+
"db.search.filter",
|
|
132
|
+
"db.mongo.search.text",
|
|
133
|
+
"db.mongo.search.autocomplete"
|
|
134
|
+
];
|
|
135
|
+
/** Why each of {@link ENCRYPTED_SEARCH_FEATURES} cannot sit on an `@db.encrypted` field. */
|
|
136
|
+
const ENCRYPTED_SEARCH_WHY = {
|
|
137
|
+
"db.column.searchable": "search over ciphertext is impossible",
|
|
138
|
+
"db.index.fulltext": "indexes over ciphertext are meaningless",
|
|
139
|
+
"db.index.geo": "geo indexes over ciphertext are meaningless",
|
|
140
|
+
"db.search.vector": "vector search over ciphertext is impossible",
|
|
141
|
+
"db.search.filter": "search filters need cleartext equality",
|
|
142
|
+
"db.mongo.search.text": "Atlas Search over ciphertext is impossible",
|
|
143
|
+
"db.mongo.search.autocomplete": "Atlas Search over ciphertext is impossible"
|
|
144
|
+
};
|
|
145
|
+
/**
|
|
146
|
+
* Annotations an `@db.encrypted` field cannot carry, with the reason — the
|
|
147
|
+
* compile-time `@db.encrypted` check and the metadata build share it (the
|
|
148
|
+
* search rows are {@link ENCRYPTED_SEARCH_FEATURES}).
|
|
149
|
+
* @since 0.1.162
|
|
150
|
+
*/
|
|
151
|
+
const ENCRYPTED_INCOMPATIBLE = [
|
|
152
|
+
["meta.id", "the primary key must be addressable"],
|
|
153
|
+
["db.rel.FK", "joins are impossible over ciphertext"],
|
|
154
|
+
["db.index.plain", "indexes over ciphertext are meaningless"],
|
|
155
|
+
["db.index.unique", "indexes over ciphertext are meaningless"],
|
|
156
|
+
...ENCRYPTED_SEARCH_FEATURES.map((key) => [key, ENCRYPTED_SEARCH_WHY[key]]),
|
|
157
|
+
["db.column.version", "the OCC filter needs cleartext equality"],
|
|
158
|
+
["db.default.increment", "engine-side defaults bypass the encryption transform"],
|
|
159
|
+
["db.default.now", "engine-side defaults bypass the encryption transform"],
|
|
160
|
+
["db.onUpdate.now", "the update time is set after the encryption transform"],
|
|
161
|
+
["db.onUpdate.inc", "the counter is incremented by the database"]
|
|
162
|
+
];
|
|
117
163
|
//#endregion
|
|
118
164
|
Object.defineProperty(exports, "DB_ENTITY_ANNOTATIONS", {
|
|
119
165
|
enumerable: true,
|
|
@@ -127,12 +173,30 @@ Object.defineProperty(exports, "DERIVED_INCOMPATIBLE", {
|
|
|
127
173
|
return DERIVED_INCOMPATIBLE;
|
|
128
174
|
}
|
|
129
175
|
});
|
|
176
|
+
Object.defineProperty(exports, "ENCRYPTED_INCOMPATIBLE", {
|
|
177
|
+
enumerable: true,
|
|
178
|
+
get: function() {
|
|
179
|
+
return ENCRYPTED_INCOMPATIBLE;
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
Object.defineProperty(exports, "ENCRYPTED_SEARCH_FEATURES", {
|
|
183
|
+
enumerable: true,
|
|
184
|
+
get: function() {
|
|
185
|
+
return ENCRYPTED_SEARCH_FEATURES;
|
|
186
|
+
}
|
|
187
|
+
});
|
|
130
188
|
Object.defineProperty(exports, "JSON_LEAF_TYPES", {
|
|
131
189
|
enumerable: true,
|
|
132
190
|
get: function() {
|
|
133
191
|
return JSON_LEAF_TYPES;
|
|
134
192
|
}
|
|
135
193
|
});
|
|
194
|
+
Object.defineProperty(exports, "SEARCH_PROBLEM", {
|
|
195
|
+
enumerable: true,
|
|
196
|
+
get: function() {
|
|
197
|
+
return SEARCH_PROBLEM;
|
|
198
|
+
}
|
|
199
|
+
});
|
|
136
200
|
Object.defineProperty(exports, "isJsonLeafType", {
|
|
137
201
|
enumerable: true,
|
|
138
202
|
get: function() {
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { TAtscriptAnnotatedType } from "@atscript/typescript/utils";
|
|
2
|
+
|
|
3
|
+
//#region src/shared/search-fields.d.ts
|
|
4
|
+
/** How a field takes part in `$search`: matched as text, or by whole-number equality / decimal text. */
|
|
5
|
+
type TSearchMemberKind = "text" | "integer";
|
|
6
|
+
/**
|
|
7
|
+
* Runtime mirror of the plugin's verdict: how the annotated type takes part
|
|
8
|
+
* in `$search`. Structures, arrays, unions and unresolved types keep their
|
|
9
|
+
* legacy `"text"` treatment.
|
|
10
|
+
*/
|
|
11
|
+
declare function searchMemberKind(type: TAtscriptAnnotatedType | undefined): TSearchMemberKind | {
|
|
12
|
+
problem: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Field annotations of the search / index features that cannot work over
|
|
16
|
+
* ciphertext — refused on an `@db.encrypted` field, on any field inside one
|
|
17
|
+
* and on a view field over an encrypted source (compile time and metadata
|
|
18
|
+
* build).
|
|
19
|
+
* @since 0.1.162
|
|
20
|
+
*/
|
|
21
|
+
declare const ENCRYPTED_SEARCH_FEATURES: readonly ["db.column.searchable", "db.index.fulltext", "db.index.geo", "db.search.vector", "db.search.filter", "db.mongo.search.text", "db.mongo.search.autocomplete"];
|
|
22
|
+
/**
|
|
23
|
+
* Annotations an `@db.encrypted` field cannot carry, with the reason — the
|
|
24
|
+
* compile-time `@db.encrypted` check and the metadata build share it (the
|
|
25
|
+
* search rows are {@link ENCRYPTED_SEARCH_FEATURES}).
|
|
26
|
+
* @since 0.1.162
|
|
27
|
+
*/
|
|
28
|
+
declare const ENCRYPTED_INCOMPATIBLE: ReadonlyArray<[annotation: string, why: string]>;
|
|
29
|
+
//#endregion
|
|
30
|
+
export { searchMemberKind as i, ENCRYPTED_SEARCH_FEATURES as n, TSearchMemberKind as r, ENCRYPTED_INCOMPATIBLE as t };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { TAtscriptAnnotatedType } from "@atscript/typescript/utils";
|
|
2
|
+
|
|
3
|
+
//#region src/shared/search-fields.d.ts
|
|
4
|
+
/** How a field takes part in `$search`: matched as text, or by whole-number equality / decimal text. */
|
|
5
|
+
type TSearchMemberKind = "text" | "integer";
|
|
6
|
+
/**
|
|
7
|
+
* Runtime mirror of the plugin's verdict: how the annotated type takes part
|
|
8
|
+
* in `$search`. Structures, arrays, unions and unresolved types keep their
|
|
9
|
+
* legacy `"text"` treatment.
|
|
10
|
+
*/
|
|
11
|
+
declare function searchMemberKind(type: TAtscriptAnnotatedType | undefined): TSearchMemberKind | {
|
|
12
|
+
problem: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Field annotations of the search / index features that cannot work over
|
|
16
|
+
* ciphertext — refused on an `@db.encrypted` field, on any field inside one
|
|
17
|
+
* and on a view field over an encrypted source (compile time and metadata
|
|
18
|
+
* build).
|
|
19
|
+
* @since 0.1.162
|
|
20
|
+
*/
|
|
21
|
+
declare const ENCRYPTED_SEARCH_FEATURES: readonly ["db.column.searchable", "db.index.fulltext", "db.index.geo", "db.search.vector", "db.search.filter", "db.mongo.search.text", "db.mongo.search.autocomplete"];
|
|
22
|
+
/**
|
|
23
|
+
* Annotations an `@db.encrypted` field cannot carry, with the reason — the
|
|
24
|
+
* compile-time `@db.encrypted` check and the metadata build share it (the
|
|
25
|
+
* search rows are {@link ENCRYPTED_SEARCH_FEATURES}).
|
|
26
|
+
* @since 0.1.162
|
|
27
|
+
*/
|
|
28
|
+
declare const ENCRYPTED_INCOMPATIBLE: ReadonlyArray<[annotation: string, why: string]>;
|
|
29
|
+
//#endregion
|
|
30
|
+
export { searchMemberKind as i, ENCRYPTED_SEARCH_FEATURES as n, TSearchMemberKind as r, ENCRYPTED_INCOMPATIBLE as t };
|
package/dist/shared.cjs
CHANGED
|
@@ -1,30 +1,46 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_search_fields = require("./search-fields-Bi1n-pB1.cjs");
|
|
3
|
+
const require_object = require("./object-GjsuPNqo.cjs");
|
|
2
4
|
const require_aggregate_rules = require("./aggregate-rules-D_bsCpUI.cjs");
|
|
3
|
-
const
|
|
5
|
+
const require_view_validation = require("./view-validation-D50KWU7O.cjs");
|
|
6
|
+
exports.ENCRYPTED_INCOMPATIBLE = require_search_fields.ENCRYPTED_INCOMPATIBLE;
|
|
7
|
+
exports.ENCRYPTED_SEARCH_FEATURES = require_search_fields.ENCRYPTED_SEARCH_FEATURES;
|
|
8
|
+
exports.NAV_ANNOTATIONS = require_view_validation.NAV_ANNOTATIONS;
|
|
4
9
|
exports.NOT_DIMENSION_REASON = require_aggregate_rules.NOT_DIMENSION_REASON;
|
|
5
|
-
exports.earlierJoinTargets =
|
|
6
|
-
exports.
|
|
7
|
-
exports.
|
|
8
|
-
exports.
|
|
9
|
-
exports.
|
|
10
|
-
exports.
|
|
11
|
-
exports.
|
|
12
|
-
exports.
|
|
13
|
-
exports.
|
|
14
|
-
exports.
|
|
15
|
-
exports.
|
|
16
|
-
exports.
|
|
17
|
-
exports.
|
|
18
|
-
exports.
|
|
10
|
+
exports.earlierJoinTargets = require_view_validation.earlierJoinTargets;
|
|
11
|
+
exports.effectiveAnnotationNames = require_view_validation.effectiveAnnotationNames;
|
|
12
|
+
exports.encryptedAncestorName = require_view_validation.encryptedAncestorName;
|
|
13
|
+
exports.encryptedSearchProblem = require_view_validation.encryptedSearchProblem;
|
|
14
|
+
exports.encryptedTypeSearchProblem = require_view_validation.encryptedTypeSearchProblem;
|
|
15
|
+
exports.findFKFieldsPointingTo = require_view_validation.findFKFieldsPointingTo;
|
|
16
|
+
exports.findStoredField = require_view_validation.findStoredField;
|
|
17
|
+
exports.findViewCycle = require_view_validation.findViewCycle;
|
|
18
|
+
exports.forEachFieldRef = require_view_validation.forEachFieldRef;
|
|
19
|
+
exports.getAnnotationAlias = require_view_validation.getAnnotationAlias;
|
|
20
|
+
exports.getDbTableOwner = require_view_validation.getDbTableOwner;
|
|
21
|
+
exports.getNavTargetTypeName = require_view_validation.getNavTargetTypeName;
|
|
22
|
+
exports.getParentStruct = require_view_validation.getParentStruct;
|
|
23
|
+
exports.getParentTypeName = require_view_validation.getParentTypeName;
|
|
24
|
+
exports.hasAnyViewAnnotation = require_view_validation.hasAnyViewAnnotation;
|
|
25
|
+
exports.integerMemberIndexProblem = require_view_validation.integerMemberIndexProblem;
|
|
26
|
+
exports.isAliasDecl = require_view_validation.isAliasDecl;
|
|
27
|
+
exports.isDbSourceDecl = require_view_validation.isDbSourceDecl;
|
|
28
|
+
exports.isNavProp = require_view_validation.isNavProp;
|
|
29
|
+
exports.isNullableUnion = require_view_validation.isNullableUnion;
|
|
19
30
|
exports.isStrictAggregateStruct = require_aggregate_rules.isStrictAggregateStruct;
|
|
20
|
-
exports.
|
|
21
|
-
exports.
|
|
22
|
-
exports.
|
|
23
|
-
exports.
|
|
24
|
-
exports.
|
|
25
|
-
exports.
|
|
26
|
-
exports.
|
|
27
|
-
exports.
|
|
28
|
-
exports.
|
|
29
|
-
exports.
|
|
30
|
-
exports.
|
|
31
|
+
exports.isViewField = require_view_validation.isViewField;
|
|
32
|
+
exports.joinTargets = require_view_validation.joinTargets;
|
|
33
|
+
exports.primitiveBaseType = require_view_validation.primitiveBaseType;
|
|
34
|
+
exports.refActionAnnotation = require_view_validation.refActionAnnotation;
|
|
35
|
+
exports.refuseCiphertext = require_view_validation.refuseCiphertext;
|
|
36
|
+
exports.searchFieldVerdict = require_view_validation.searchFieldVerdict;
|
|
37
|
+
exports.stableJson = require_object.stableJson;
|
|
38
|
+
exports.validateExclusiveWith = require_view_validation.validateExclusiveWith;
|
|
39
|
+
exports.validateFieldBaseType = require_view_validation.validateFieldBaseType;
|
|
40
|
+
exports.validateIncompatible = require_view_validation.validateIncompatible;
|
|
41
|
+
exports.validateQueryScope = require_view_validation.validateQueryScope;
|
|
42
|
+
exports.validateRefArgument = require_view_validation.validateRefArgument;
|
|
43
|
+
exports.validateSiblingStringField = require_view_validation.validateSiblingStringField;
|
|
44
|
+
exports.viewFieldSeals = require_view_validation.viewFieldSeals;
|
|
45
|
+
exports.viewJoins = require_view_validation.viewJoins;
|
|
46
|
+
exports.viewScopeTypes = require_view_validation.viewScopeTypes;
|
package/dist/shared.d.cts
CHANGED
|
@@ -1,11 +1,35 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { s as stableJson } from "./object-Czia_qD4.cjs";
|
|
2
|
+
import { n as ENCRYPTED_SEARCH_FEATURES, t as ENCRYPTED_INCOMPATIBLE } from "./search-fields-CHqqcC3W.cjs";
|
|
3
|
+
import { AnnotationSpec, AtscriptDoc, SemanticInterfaceNode, SemanticNode, SemanticPropNode, SemanticQueryExprNode, SemanticQueryFieldRefNode, SemanticStructureNode, TAnnotationSpecConfig, TAnnotationTokens, TMessages, TQueryScope, Token } from "@atscript/core";
|
|
2
4
|
|
|
3
5
|
//#region src/shared/annotation-utils.d.ts
|
|
4
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* Names of a field's effective annotations: its own plus the ones it inherits
|
|
8
|
+
* through its type ref (`price: Order.price`), with the `passedWhenReferred:
|
|
9
|
+
* false` ones dropped — the set codegen writes into the field's runtime
|
|
10
|
+
* metadata (`AtscriptDoc.evalAnnotationsForNode`). Compile checks that mirror
|
|
11
|
+
* a runtime metadata check read this, not the own-only `countAnnotations`.
|
|
12
|
+
* @since 0.1.162
|
|
13
|
+
*/
|
|
14
|
+
declare function effectiveAnnotationNames(field: SemanticNode, doc: AtscriptDoc): Set<string>;
|
|
15
|
+
/**
|
|
16
|
+
* Asserts the field carrying this annotation does not also carry any of
|
|
17
|
+
* `others` — its own or inherited through its type ref (since 0.1.162).
|
|
18
|
+
*/
|
|
5
19
|
declare function validateExclusiveWith(token: Token, selfName: string, others: Array<{
|
|
6
20
|
key: string;
|
|
7
21
|
displayName?: string;
|
|
8
|
-
}
|
|
22
|
+
}>, doc: AtscriptDoc): TMessages;
|
|
23
|
+
/**
|
|
24
|
+
* Reports each of `pairs` (`[annotation, why]`) the field carrying `token`
|
|
25
|
+
* also carries — its own or inherited through its type ref (the field's
|
|
26
|
+
* effective annotations, what the runtime mirror reads off the metadata):
|
|
27
|
+
* `${tag} cannot coexist with @${annotation} — ${why}`.
|
|
28
|
+
* @since 0.1.162
|
|
29
|
+
*/
|
|
30
|
+
declare function validateIncompatible(token: Token, tag: string, pairs: ReadonlyArray<readonly [annotation: string, why: string]>, doc: AtscriptDoc): TMessages;
|
|
31
|
+
/** Whether a prop is a field of a view interface (`@db.view` / `@db.view.for`). */
|
|
32
|
+
declare function isViewField(field: SemanticNode): boolean;
|
|
9
33
|
/** Primitive base type (`string`, `number`, `decimal`, …) of a resolved definition, if it is a primitive. */
|
|
10
34
|
declare function primitiveBaseType(def: SemanticNode | undefined): string | undefined;
|
|
11
35
|
/**
|
|
@@ -164,4 +188,74 @@ declare const NOT_DIMENSION_REASON = "not a dimension";
|
|
|
164
188
|
*/
|
|
165
189
|
declare function isStrictAggregateStruct(struct: SemanticStructureNode): boolean;
|
|
166
190
|
//#endregion
|
|
167
|
-
|
|
191
|
+
//#region src/shared/view-validation.d.ts
|
|
192
|
+
/** Read seals of a view field ({@link viewFieldSeals}). @since 0.1.162 */
|
|
193
|
+
interface TViewFieldSeals {
|
|
194
|
+
writeOnly: boolean;
|
|
195
|
+
encrypted: boolean;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* The read seals a view field takes from the source field it reads, as the
|
|
199
|
+
* compiler sees them (compile-time mirror of the runtime `sourceFieldSeals`,
|
|
200
|
+
* which stamps them onto the view column — these annotations are
|
|
201
|
+
* `passedWhenReferred: false`, so they are not in the field's own metadata):
|
|
202
|
+
* - `writeOnly` — the source path or an ancestor object is `@db.writeOnly`;
|
|
203
|
+
* - `encrypted` — the source path or an ancestor object is `@db.encrypted`.
|
|
204
|
+
*
|
|
205
|
+
* (A `@db.json` source is no seal: a view reads a primitive JSON column's
|
|
206
|
+
* typed value, and an object one needs its own `@db.json`.)
|
|
207
|
+
*
|
|
208
|
+
* The source is the chain ref (`pin?: Account.pin`), or else the entry table's
|
|
209
|
+
* same-named field (or an aggregate's field) of a `@db.view.for` view. A source
|
|
210
|
+
* field that is itself a view field passes on its own seals. Computed fields
|
|
211
|
+
* and fields of anything but a view report no seal.
|
|
212
|
+
* @since 0.1.162
|
|
213
|
+
*/
|
|
214
|
+
declare function viewFieldSeals(field: SemanticNode, doc: AtscriptDoc, depth?: number): TViewFieldSeals;
|
|
215
|
+
/**
|
|
216
|
+
* A search / index feature (`@db.column.searchable`, `@db.index.fulltext`,
|
|
217
|
+
* `@db.index.geo`, `@db.search.vector`, `@db.search.filter`) on a field that
|
|
218
|
+
* would read ciphertext: a field inside an `@db.encrypted` object, or a view
|
|
219
|
+
* field over an encrypted source — or `undefined`. The field's own
|
|
220
|
+
* `@db.encrypted` is reported by that spec.
|
|
221
|
+
* @since 0.1.162
|
|
222
|
+
*/
|
|
223
|
+
declare function encryptedSearchProblem(token: Token, doc: AtscriptDoc, annotation: string): TMessages[number] | undefined;
|
|
224
|
+
/**
|
|
225
|
+
* An annotation's `validate` refusing it on a field that reads ciphertext
|
|
226
|
+
* ({@link encryptedSearchProblem}) — for the search features of sibling
|
|
227
|
+
* adapter plugins too.
|
|
228
|
+
* @since 0.1.162
|
|
229
|
+
*/
|
|
230
|
+
declare function refuseCiphertext(annotation: string): TAnnotationSpecConfig["validate"];
|
|
231
|
+
/**
|
|
232
|
+
* Navigation relation annotations — a navigation field holds another table's
|
|
233
|
+
* rows, never part of this table's stored value.
|
|
234
|
+
* @since 0.1.162
|
|
235
|
+
*/
|
|
236
|
+
declare const NAV_ANNOTATIONS: readonly ["db.rel.to", "db.rel.from", "db.rel.via"];
|
|
237
|
+
/** Whether a prop is a navigation field ({@link NAV_ANNOTATIONS}). */
|
|
238
|
+
declare function isNavProp(prop: SemanticNode): boolean;
|
|
239
|
+
/**
|
|
240
|
+
* Walks the fields stored in `root` (an interface, a structure or a type ref)
|
|
241
|
+
* depth-first — nested objects and type refs included, navigation fields and
|
|
242
|
+
* arrays skipped — and returns the first non-`undefined` result of `visit`.
|
|
243
|
+
* `path` is the field's dotted path below `prefix`; `viaRef` tells whether
|
|
244
|
+
* a type ref was followed to reach it.
|
|
245
|
+
* @since 0.1.162
|
|
246
|
+
*/
|
|
247
|
+
declare function findStoredField<T>(root: SemanticNode | undefined, doc: AtscriptDoc, visit: (prop: SemanticNode, path: string, viaRef: boolean) => T | undefined, prefix?: string): T | undefined;
|
|
248
|
+
/**
|
|
249
|
+
* A search feature ({@link ENCRYPTED_SEARCH_FEATURES}) declared inside the
|
|
250
|
+
* TYPE of the `@db.encrypted` field carrying `token`, reached through a type
|
|
251
|
+
* ref (`@db.encrypted profile: Address`, where `Address` has
|
|
252
|
+
* `@db.index.fulltext city`) — the shared type's own annotations cannot see
|
|
253
|
+
* that this use encrypts them. Fields declared inline are reported by their
|
|
254
|
+
* own annotation (see {@link encryptedSearchProblem}).
|
|
255
|
+
* @since 0.1.162
|
|
256
|
+
*/
|
|
257
|
+
declare function encryptedTypeSearchProblem(token: Token, doc: AtscriptDoc): TMessages[number] | undefined;
|
|
258
|
+
/** Name of the nearest `@db.encrypted` prop enclosing `field` (inline nested objects), if any. */
|
|
259
|
+
declare function encryptedAncestorName(field: SemanticNode): string | undefined;
|
|
260
|
+
//#endregion
|
|
261
|
+
export { ENCRYPTED_INCOMPATIBLE, ENCRYPTED_SEARCH_FEATURES, NAV_ANNOTATIONS, NOT_DIMENSION_REASON, TFKFieldMatch, TRefArgumentOptions, type TViewFieldSeals, earlierJoinTargets, effectiveAnnotationNames, encryptedAncestorName, encryptedSearchProblem, encryptedTypeSearchProblem, findFKFieldsPointingTo, findStoredField, findViewCycle, forEachFieldRef, getAnnotationAlias, getDbTableOwner, getNavTargetTypeName, getParentStruct, getParentTypeName, hasAnyViewAnnotation, integerMemberIndexProblem, isAliasDecl, isDbSourceDecl, isNavProp, isNullableUnion, isStrictAggregateStruct, isViewField, joinTargets, primitiveBaseType, refActionAnnotation, refuseCiphertext, searchFieldVerdict, stableJson, validateExclusiveWith, validateFieldBaseType, validateIncompatible, validateQueryScope, validateRefArgument, validateSiblingStringField, viewFieldSeals, viewJoins, viewScopeTypes };
|
package/dist/shared.d.mts
CHANGED
|
@@ -1,11 +1,35 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { s as stableJson } from "./object-Czia_qD4.mjs";
|
|
2
|
+
import { n as ENCRYPTED_SEARCH_FEATURES, t as ENCRYPTED_INCOMPATIBLE } from "./search-fields-CHqqcC3W.mjs";
|
|
3
|
+
import { AnnotationSpec, AtscriptDoc, SemanticInterfaceNode, SemanticNode, SemanticPropNode, SemanticQueryExprNode, SemanticQueryFieldRefNode, SemanticStructureNode, TAnnotationSpecConfig, TAnnotationTokens, TMessages, TQueryScope, Token } from "@atscript/core";
|
|
2
4
|
|
|
3
5
|
//#region src/shared/annotation-utils.d.ts
|
|
4
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* Names of a field's effective annotations: its own plus the ones it inherits
|
|
8
|
+
* through its type ref (`price: Order.price`), with the `passedWhenReferred:
|
|
9
|
+
* false` ones dropped — the set codegen writes into the field's runtime
|
|
10
|
+
* metadata (`AtscriptDoc.evalAnnotationsForNode`). Compile checks that mirror
|
|
11
|
+
* a runtime metadata check read this, not the own-only `countAnnotations`.
|
|
12
|
+
* @since 0.1.162
|
|
13
|
+
*/
|
|
14
|
+
declare function effectiveAnnotationNames(field: SemanticNode, doc: AtscriptDoc): Set<string>;
|
|
15
|
+
/**
|
|
16
|
+
* Asserts the field carrying this annotation does not also carry any of
|
|
17
|
+
* `others` — its own or inherited through its type ref (since 0.1.162).
|
|
18
|
+
*/
|
|
5
19
|
declare function validateExclusiveWith(token: Token, selfName: string, others: Array<{
|
|
6
20
|
key: string;
|
|
7
21
|
displayName?: string;
|
|
8
|
-
}
|
|
22
|
+
}>, doc: AtscriptDoc): TMessages;
|
|
23
|
+
/**
|
|
24
|
+
* Reports each of `pairs` (`[annotation, why]`) the field carrying `token`
|
|
25
|
+
* also carries — its own or inherited through its type ref (the field's
|
|
26
|
+
* effective annotations, what the runtime mirror reads off the metadata):
|
|
27
|
+
* `${tag} cannot coexist with @${annotation} — ${why}`.
|
|
28
|
+
* @since 0.1.162
|
|
29
|
+
*/
|
|
30
|
+
declare function validateIncompatible(token: Token, tag: string, pairs: ReadonlyArray<readonly [annotation: string, why: string]>, doc: AtscriptDoc): TMessages;
|
|
31
|
+
/** Whether a prop is a field of a view interface (`@db.view` / `@db.view.for`). */
|
|
32
|
+
declare function isViewField(field: SemanticNode): boolean;
|
|
9
33
|
/** Primitive base type (`string`, `number`, `decimal`, …) of a resolved definition, if it is a primitive. */
|
|
10
34
|
declare function primitiveBaseType(def: SemanticNode | undefined): string | undefined;
|
|
11
35
|
/**
|
|
@@ -164,4 +188,74 @@ declare const NOT_DIMENSION_REASON = "not a dimension";
|
|
|
164
188
|
*/
|
|
165
189
|
declare function isStrictAggregateStruct(struct: SemanticStructureNode): boolean;
|
|
166
190
|
//#endregion
|
|
167
|
-
|
|
191
|
+
//#region src/shared/view-validation.d.ts
|
|
192
|
+
/** Read seals of a view field ({@link viewFieldSeals}). @since 0.1.162 */
|
|
193
|
+
interface TViewFieldSeals {
|
|
194
|
+
writeOnly: boolean;
|
|
195
|
+
encrypted: boolean;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* The read seals a view field takes from the source field it reads, as the
|
|
199
|
+
* compiler sees them (compile-time mirror of the runtime `sourceFieldSeals`,
|
|
200
|
+
* which stamps them onto the view column — these annotations are
|
|
201
|
+
* `passedWhenReferred: false`, so they are not in the field's own metadata):
|
|
202
|
+
* - `writeOnly` — the source path or an ancestor object is `@db.writeOnly`;
|
|
203
|
+
* - `encrypted` — the source path or an ancestor object is `@db.encrypted`.
|
|
204
|
+
*
|
|
205
|
+
* (A `@db.json` source is no seal: a view reads a primitive JSON column's
|
|
206
|
+
* typed value, and an object one needs its own `@db.json`.)
|
|
207
|
+
*
|
|
208
|
+
* The source is the chain ref (`pin?: Account.pin`), or else the entry table's
|
|
209
|
+
* same-named field (or an aggregate's field) of a `@db.view.for` view. A source
|
|
210
|
+
* field that is itself a view field passes on its own seals. Computed fields
|
|
211
|
+
* and fields of anything but a view report no seal.
|
|
212
|
+
* @since 0.1.162
|
|
213
|
+
*/
|
|
214
|
+
declare function viewFieldSeals(field: SemanticNode, doc: AtscriptDoc, depth?: number): TViewFieldSeals;
|
|
215
|
+
/**
|
|
216
|
+
* A search / index feature (`@db.column.searchable`, `@db.index.fulltext`,
|
|
217
|
+
* `@db.index.geo`, `@db.search.vector`, `@db.search.filter`) on a field that
|
|
218
|
+
* would read ciphertext: a field inside an `@db.encrypted` object, or a view
|
|
219
|
+
* field over an encrypted source — or `undefined`. The field's own
|
|
220
|
+
* `@db.encrypted` is reported by that spec.
|
|
221
|
+
* @since 0.1.162
|
|
222
|
+
*/
|
|
223
|
+
declare function encryptedSearchProblem(token: Token, doc: AtscriptDoc, annotation: string): TMessages[number] | undefined;
|
|
224
|
+
/**
|
|
225
|
+
* An annotation's `validate` refusing it on a field that reads ciphertext
|
|
226
|
+
* ({@link encryptedSearchProblem}) — for the search features of sibling
|
|
227
|
+
* adapter plugins too.
|
|
228
|
+
* @since 0.1.162
|
|
229
|
+
*/
|
|
230
|
+
declare function refuseCiphertext(annotation: string): TAnnotationSpecConfig["validate"];
|
|
231
|
+
/**
|
|
232
|
+
* Navigation relation annotations — a navigation field holds another table's
|
|
233
|
+
* rows, never part of this table's stored value.
|
|
234
|
+
* @since 0.1.162
|
|
235
|
+
*/
|
|
236
|
+
declare const NAV_ANNOTATIONS: readonly ["db.rel.to", "db.rel.from", "db.rel.via"];
|
|
237
|
+
/** Whether a prop is a navigation field ({@link NAV_ANNOTATIONS}). */
|
|
238
|
+
declare function isNavProp(prop: SemanticNode): boolean;
|
|
239
|
+
/**
|
|
240
|
+
* Walks the fields stored in `root` (an interface, a structure or a type ref)
|
|
241
|
+
* depth-first — nested objects and type refs included, navigation fields and
|
|
242
|
+
* arrays skipped — and returns the first non-`undefined` result of `visit`.
|
|
243
|
+
* `path` is the field's dotted path below `prefix`; `viaRef` tells whether
|
|
244
|
+
* a type ref was followed to reach it.
|
|
245
|
+
* @since 0.1.162
|
|
246
|
+
*/
|
|
247
|
+
declare function findStoredField<T>(root: SemanticNode | undefined, doc: AtscriptDoc, visit: (prop: SemanticNode, path: string, viaRef: boolean) => T | undefined, prefix?: string): T | undefined;
|
|
248
|
+
/**
|
|
249
|
+
* A search feature ({@link ENCRYPTED_SEARCH_FEATURES}) declared inside the
|
|
250
|
+
* TYPE of the `@db.encrypted` field carrying `token`, reached through a type
|
|
251
|
+
* ref (`@db.encrypted profile: Address`, where `Address` has
|
|
252
|
+
* `@db.index.fulltext city`) — the shared type's own annotations cannot see
|
|
253
|
+
* that this use encrypts them. Fields declared inline are reported by their
|
|
254
|
+
* own annotation (see {@link encryptedSearchProblem}).
|
|
255
|
+
* @since 0.1.162
|
|
256
|
+
*/
|
|
257
|
+
declare function encryptedTypeSearchProblem(token: Token, doc: AtscriptDoc): TMessages[number] | undefined;
|
|
258
|
+
/** Name of the nearest `@db.encrypted` prop enclosing `field` (inline nested objects), if any. */
|
|
259
|
+
declare function encryptedAncestorName(field: SemanticNode): string | undefined;
|
|
260
|
+
//#endregion
|
|
261
|
+
export { ENCRYPTED_INCOMPATIBLE, ENCRYPTED_SEARCH_FEATURES, NAV_ANNOTATIONS, NOT_DIMENSION_REASON, TFKFieldMatch, TRefArgumentOptions, type TViewFieldSeals, earlierJoinTargets, effectiveAnnotationNames, encryptedAncestorName, encryptedSearchProblem, encryptedTypeSearchProblem, findFKFieldsPointingTo, findStoredField, findViewCycle, forEachFieldRef, getAnnotationAlias, getDbTableOwner, getNavTargetTypeName, getParentStruct, getParentTypeName, hasAnyViewAnnotation, integerMemberIndexProblem, isAliasDecl, isDbSourceDecl, isNavProp, isNullableUnion, isStrictAggregateStruct, isViewField, joinTargets, primitiveBaseType, refActionAnnotation, refuseCiphertext, searchFieldVerdict, stableJson, validateExclusiveWith, validateFieldBaseType, validateIncompatible, validateQueryScope, validateRefArgument, validateSiblingStringField, viewFieldSeals, viewJoins, viewScopeTypes };
|
package/dist/shared.mjs
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { n as ENCRYPTED_SEARCH_FEATURES, t as ENCRYPTED_INCOMPATIBLE } from "./search-fields-0U0FAFGj.mjs";
|
|
2
|
+
import { s as stableJson } from "./object-PQ1J8jri.mjs";
|
|
1
3
|
import { n as isStrictAggregateStruct, t as NOT_DIMENSION_REASON } from "./aggregate-rules-jdPrxqWa.mjs";
|
|
2
|
-
import { C as validateExclusiveWith, S as
|
|
3
|
-
export { NOT_DIMENSION_REASON, earlierJoinTargets, findFKFieldsPointingTo, findViewCycle, forEachFieldRef, getAnnotationAlias, getDbTableOwner, getNavTargetTypeName, getParentStruct, getParentTypeName, hasAnyViewAnnotation, integerMemberIndexProblem, isAliasDecl, isDbSourceDecl, isNullableUnion, isStrictAggregateStruct, joinTargets, primitiveBaseType, refActionAnnotation, searchFieldVerdict, validateExclusiveWith, validateFieldBaseType, validateQueryScope, validateRefArgument, validateSiblingStringField, viewJoins, viewScopeTypes };
|
|
4
|
+
import { A as getParentTypeName, B as validateSiblingStringField, C as viewJoins, D as getDbTableOwner, E as getAnnotationAlias, F as refActionAnnotation, I as searchFieldVerdict, L as validateExclusiveWith, M as isNullableUnion, N as isViewField, O as getNavTargetTypeName, P as primitiveBaseType, R as validateFieldBaseType, S as validateRefArgument, T as effectiveAnnotationNames, _ as hasAnyViewAnnotation, a as findStoredField, b as joinTargets, c as refuseCiphertext, d as viewFieldSeals, g as forEachFieldRef, h as findViewCycle, i as encryptedTypeSearchProblem, j as integerMemberIndexProblem, k as getParentStruct, m as findFKFieldsPointingTo, n as encryptedAncestorName, o as isNavProp, p as earlierJoinTargets, r as encryptedSearchProblem, t as NAV_ANNOTATIONS, v as isAliasDecl, w as viewScopeTypes, x as validateQueryScope, y as isDbSourceDecl, z as validateIncompatible } from "./view-validation-QbqqXEAM.mjs";
|
|
5
|
+
export { ENCRYPTED_INCOMPATIBLE, ENCRYPTED_SEARCH_FEATURES, NAV_ANNOTATIONS, NOT_DIMENSION_REASON, earlierJoinTargets, effectiveAnnotationNames, encryptedAncestorName, encryptedSearchProblem, encryptedTypeSearchProblem, findFKFieldsPointingTo, findStoredField, findViewCycle, forEachFieldRef, getAnnotationAlias, getDbTableOwner, getNavTargetTypeName, getParentStruct, getParentTypeName, hasAnyViewAnnotation, integerMemberIndexProblem, isAliasDecl, isDbSourceDecl, isNavProp, isNullableUnion, isStrictAggregateStruct, isViewField, joinTargets, primitiveBaseType, refActionAnnotation, refuseCiphertext, searchFieldVerdict, stableJson, validateExclusiveWith, validateFieldBaseType, validateIncompatible, validateQueryScope, validateRefArgument, validateSiblingStringField, viewFieldSeals, viewJoins, viewScopeTypes };
|