pyric 0.1.0-alpha.20 → 0.1.0-alpha.21
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/README.md +64 -89
- package/dist/ai/blocked.d.ts +52 -0
- package/dist/ai/blocked.d.ts.map +1 -0
- package/dist/ai/blocked.js +83 -0
- package/dist/ai/blocked.js.map +1 -0
- package/dist/ai/broker/broker.d.ts +49 -0
- package/dist/ai/broker/broker.d.ts.map +1 -1
- package/dist/ai/broker/broker.js +90 -0
- package/dist/ai/broker/broker.js.map +1 -1
- package/dist/ai/broker/gemini-engine.d.ts +14 -1
- package/dist/ai/broker/gemini-engine.d.ts.map +1 -1
- package/dist/ai/broker/gemini-engine.js +30 -9
- package/dist/ai/broker/gemini-engine.js.map +1 -1
- package/dist/ai/broker/index.d.ts +2 -2
- package/dist/ai/broker/index.d.ts.map +1 -1
- package/dist/ai/broker/index.js +2 -2
- package/dist/ai/broker/index.js.map +1 -1
- package/dist/ai/broker/openai-engine.d.ts +10 -1
- package/dist/ai/broker/openai-engine.d.ts.map +1 -1
- package/dist/ai/broker/openai-engine.js +26 -4
- package/dist/ai/broker/openai-engine.js.map +1 -1
- package/dist/ai/broker/synthesizer.d.ts +14 -0
- package/dist/ai/broker/synthesizer.d.ts.map +1 -1
- package/dist/ai/broker/synthesizer.js +31 -0
- package/dist/ai/broker/synthesizer.js.map +1 -1
- package/dist/ai/broker/types.d.ts +24 -0
- package/dist/ai/broker/types.d.ts.map +1 -1
- package/dist/ai/internal.d.ts +5 -0
- package/dist/ai/internal.d.ts.map +1 -1
- package/dist/ai/internal.js +5 -0
- package/dist/ai/internal.js.map +1 -1
- package/dist/ai/response-helpers.d.ts.map +1 -1
- package/dist/ai/response-helpers.js +6 -24
- package/dist/ai/response-helpers.js.map +1 -1
- package/dist/analytics/index.d.ts +40 -0
- package/dist/analytics/index.d.ts.map +1 -0
- package/dist/analytics/index.js +25 -0
- package/dist/analytics/index.js.map +1 -0
- package/dist/app-check/index.d.ts +31 -0
- package/dist/app-check/index.d.ts.map +1 -0
- package/dist/app-check/index.js +20 -0
- package/dist/app-check/index.js.map +1 -0
- package/dist/database/controls.d.ts +1 -1
- package/dist/database/controls.js +1 -1
- package/dist/database/sandbox/rules-eval.d.ts +1 -1
- package/dist/database/sandbox/rules-eval.d.ts.map +1 -1
- package/dist/database/sandbox/rules-eval.js +2 -2
- package/dist/database/sandbox/rules-eval.js.map +1 -1
- package/dist/database/sandbox/write-plane.js +2 -2
- package/dist/database/sandbox/write-plane.js.map +1 -1
- package/dist/database/sandbox-controls.d.ts +12 -5
- package/dist/database/sandbox-controls.d.ts.map +1 -1
- package/dist/database/sandbox-controls.js +20 -9
- package/dist/database/sandbox-controls.js.map +1 -1
- package/dist/deferred/entry.d.ts +75 -0
- package/dist/deferred/entry.d.ts.map +1 -0
- package/dist/deferred/entry.js +143 -0
- package/dist/deferred/entry.js.map +1 -0
- package/dist/firestore/lite.d.ts +72 -0
- package/dist/firestore/lite.d.ts.map +1 -0
- package/dist/firestore/lite.js +22 -0
- package/dist/firestore/lite.js.map +1 -0
- package/dist/firestore/persistence.d.ts +2 -2
- package/dist/firestore/persistence.js +1 -1
- package/dist/functions/index.d.ts +29 -0
- package/dist/functions/index.d.ts.map +1 -0
- package/dist/functions/index.js +20 -0
- package/dist/functions/index.js.map +1 -0
- package/dist/performance/index.d.ts +22 -0
- package/dist/performance/index.d.ts.map +1 -0
- package/dist/performance/index.js +19 -0
- package/dist/performance/index.js.map +1 -0
- package/dist/remote-config/index.d.ts +40 -0
- package/dist/remote-config/index.d.ts.map +1 -0
- package/dist/remote-config/index.js +25 -0
- package/dist/remote-config/index.js.map +1 -0
- package/dist/rules/grammar/FirestoreValidator.d.ts.map +1 -1
- package/dist/rules/grammar/FirestoreValidator.js +43 -27
- package/dist/rules/grammar/FirestoreValidator.js.map +1 -1
- package/dist/rules/grammar/document-access-count.d.ts +24 -0
- package/dist/rules/grammar/document-access-count.d.ts.map +1 -0
- package/dist/rules/grammar/document-access-count.js +100 -0
- package/dist/rules/grammar/document-access-count.js.map +1 -0
- package/dist/rules/linter/ast-utils.d.ts +2 -6
- package/dist/rules/linter/ast-utils.d.ts.map +1 -1
- package/dist/rules/linter/ast-utils.js +2 -63
- package/dist/rules/linter/ast-utils.js.map +1 -1
- package/dist/rules/linter/hallucinations.d.ts +8 -0
- package/dist/rules/linter/hallucinations.d.ts.map +1 -1
- package/dist/rules/linter/hallucinations.js +121 -31
- package/dist/rules/linter/hallucinations.js.map +1 -1
- package/dist/rules/linter/linter.d.ts +10 -1
- package/dist/rules/linter/linter.d.ts.map +1 -1
- package/dist/rules/linter/linter.js +23 -9
- package/dist/rules/linter/linter.js.map +1 -1
- package/dist/rules/rtdb/grammar/simulator.d.ts.map +1 -1
- package/dist/rules/rtdb/grammar/simulator.js +13 -13
- package/dist/rules/rtdb/grammar/simulator.js.map +1 -1
- package/dist/rules/rtdb/simulation/handler.d.ts.map +1 -1
- package/dist/rules/rtdb/simulation/handler.js +96 -35
- package/dist/rules/rtdb/simulation/handler.js.map +1 -1
- package/dist/rules/simulator/document-lookups.d.ts +4 -0
- package/dist/rules/simulator/document-lookups.d.ts.map +1 -1
- package/dist/rules/simulator/document-lookups.js +42 -3
- package/dist/rules/simulator/document-lookups.js.map +1 -1
- package/dist/rules/simulator/eval-error.d.ts +11 -0
- package/dist/rules/simulator/eval-error.d.ts.map +1 -1
- package/dist/rules/simulator/eval-error.js +14 -0
- package/dist/rules/simulator/eval-error.js.map +1 -1
- package/dist/rules/simulator/evaluation-builtins.d.ts.map +1 -1
- package/dist/rules/simulator/evaluation-builtins.js +33 -8
- package/dist/rules/simulator/evaluation-builtins.js.map +1 -1
- package/dist/rules/simulator/evaluation-context.d.ts +12 -0
- package/dist/rules/simulator/evaluation-context.d.ts.map +1 -1
- package/dist/rules/simulator/evaluator.d.ts +1 -1
- package/dist/rules/simulator/evaluator.d.ts.map +1 -1
- package/dist/rules/simulator/evaluator.js +16 -4
- package/dist/rules/simulator/evaluator.js.map +1 -1
- package/dist/rules/simulator/handler.d.ts.map +1 -1
- package/dist/rules/simulator/handler.js +52 -5
- package/dist/rules/simulator/handler.js.map +1 -1
- package/dist/rules/simulator/lookup-budget.d.ts +37 -0
- package/dist/rules/simulator/lookup-budget.d.ts.map +1 -0
- package/dist/rules/simulator/lookup-budget.js +96 -0
- package/dist/rules/simulator/lookup-budget.js.map +1 -0
- package/dist/rules/stdlib-modules.d.ts +7 -0
- package/dist/rules/stdlib-modules.d.ts.map +1 -1
- package/dist/rules/stdlib-modules.js +11 -11
- package/dist/rules/stdlib-modules.js.map +1 -1
- package/dist/sandbox/admin-firestore/get-firestore.d.ts +6 -0
- package/dist/sandbox/admin-firestore/get-firestore.d.ts.map +1 -1
- package/dist/sandbox/admin-firestore/get-firestore.js +22 -3
- package/dist/sandbox/admin-firestore/get-firestore.js.map +1 -1
- package/dist/sandbox/index.d.ts +1 -1
- package/dist/sandbox/index.d.ts.map +1 -1
- package/dist/sandbox/index.js +1 -1
- package/dist/sandbox/index.js.map +1 -1
- package/dist/sandbox/persistence/types.d.ts +1 -1
- package/dist/sandbox/remote.d.ts +2 -2
- package/dist/sandbox/sandbox-context.d.ts +8 -1
- package/dist/sandbox/sandbox-context.d.ts.map +1 -1
- package/dist/sandbox/sandbox-context.js +59 -8
- package/dist/sandbox/sandbox-context.js.map +1 -1
- package/dist/sandbox/types/auth-state.d.ts +1 -0
- package/dist/sandbox/types/auth-state.d.ts.map +1 -1
- package/dist/sandbox/types/events.d.ts +2 -1
- package/dist/sandbox/types/events.d.ts.map +1 -1
- package/dist/sandbox/types/operation.d.ts +1 -0
- package/dist/sandbox/types/operation.d.ts.map +1 -1
- package/dist/storage/enforce.d.ts +20 -1
- package/dist/storage/enforce.d.ts.map +1 -1
- package/dist/storage/enforce.js +47 -14
- package/dist/storage/enforce.js.map +1 -1
- package/dist/storage/index.d.ts +1 -1
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/list.js +1 -1
- package/dist/storage/list.js.map +1 -1
- package/dist/storage/sandbox/rules-evaluation-error.d.ts +25 -0
- package/dist/storage/sandbox/rules-evaluation-error.d.ts.map +1 -1
- package/dist/storage/sandbox/rules-evaluation-error.js +29 -0
- package/dist/storage/sandbox/rules-evaluation-error.js.map +1 -1
- package/dist/storage/sandbox/rules-evaluator.d.ts +10 -5
- package/dist/storage/sandbox/rules-evaluator.d.ts.map +1 -1
- package/dist/storage/sandbox/rules-evaluator.js +105 -33
- package/dist/storage/sandbox/rules-evaluator.js.map +1 -1
- package/dist/storage/sandbox/rules-methods.d.ts.map +1 -1
- package/dist/storage/sandbox/rules-methods.js +17 -7
- package/dist/storage/sandbox/rules-methods.js.map +1 -1
- package/dist/storage/service.d.ts +23 -2
- package/dist/storage/service.d.ts.map +1 -1
- package/dist/storage/service.js +36 -26
- package/dist/storage/service.js.map +1 -1
- package/package.json +41 -1
- package/src/ai/blocked.ts +97 -0
- package/src/ai/broker/broker.ts +88 -0
- package/src/ai/broker/gemini-engine.ts +36 -9
- package/src/ai/broker/index.ts +2 -1
- package/src/ai/broker/openai-engine.ts +31 -3
- package/src/ai/broker/synthesizer.ts +34 -0
- package/src/ai/broker/types.ts +25 -0
- package/src/ai/internal.ts +5 -0
- package/src/ai/response-helpers.ts +6 -25
- package/src/analytics/index.ts +53 -0
- package/src/app/dispatch.test.ts +3 -1
- package/src/app-check/index.ts +41 -0
- package/src/database/controls.ts +1 -1
- package/src/database/sandbox/rules-eval.ts +2 -2
- package/src/database/sandbox/write-plane.ts +2 -2
- package/src/database/sandbox-controls.ts +29 -9
- package/src/deferred/entry.ts +167 -0
- package/src/firestore/lite.ts +91 -0
- package/src/firestore/persistence.ts +2 -2
- package/src/functions/index.ts +38 -0
- package/src/performance/index.ts +31 -0
- package/src/remote-config/index.ts +53 -0
- package/src/rules/grammar/FirestoreValidator.ts +44 -28
- package/src/rules/grammar/document-access-count.ts +75 -0
- package/src/rules/linter/ast-utils.ts +2 -36
- package/src/rules/linter/hallucinations.ts +123 -25
- package/src/rules/linter/linter.ts +32 -10
- package/src/rules/rtdb/grammar/simulator.ts +12 -13
- package/src/rules/rtdb/simulation/handler.ts +149 -46
- package/src/rules/simulator/document-lookups.ts +46 -3
- package/src/rules/simulator/eval-error.ts +16 -0
- package/src/rules/simulator/evaluation-builtins.ts +35 -8
- package/src/rules/simulator/evaluation-context.ts +12 -0
- package/src/rules/simulator/evaluator.ts +14 -3
- package/src/rules/simulator/handler.ts +68 -4
- package/src/rules/simulator/lookup-budget.ts +101 -0
- package/src/rules/stdlib-modules.ts +19 -11
- package/src/sandbox/admin-firestore/get-firestore.ts +19 -3
- package/src/sandbox/index.ts +5 -1
- package/src/sandbox/persistence/types.ts +1 -1
- package/src/sandbox/remote.ts +2 -2
- package/src/sandbox/sandbox-context.ts +69 -9
- package/src/sandbox/types/auth-state.ts +1 -1
- package/src/sandbox/types/events.ts +2 -1
- package/src/sandbox/types/operation.ts +1 -1
- package/src/storage/enforce.ts +53 -14
- package/src/storage/index.ts +1 -1
- package/src/storage/list.ts +1 -1
- package/src/storage/sandbox/rules-evaluation-error.ts +32 -0
- package/src/storage/sandbox/rules-evaluator.ts +109 -32
- package/src/storage/sandbox/rules-methods.ts +21 -7
- package/src/storage/service.ts +92 -27
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The shared factory behind pyric's *deferred* Firebase Web SDK subpaths —
|
|
3
|
+
* `pyric/functions`, `pyric/analytics`, `pyric/app-check`,
|
|
4
|
+
* `pyric/firestore/lite`, `pyric/performance` and `pyric/remote-config`.
|
|
5
|
+
*
|
|
6
|
+
* WHY THESE EXIST AT ALL. pyric is a symbol-for-symbol drop-in for the
|
|
7
|
+
* Firebase Web SDK: an app swaps the `firebase` specifier for `pyric` and its
|
|
8
|
+
* module graph must keep loading. A subpath that is simply absent from the
|
|
9
|
+
* package `exports` map fails at RESOLVE time — Node raises
|
|
10
|
+
* `ERR_PACKAGE_PATH_NOT_EXPORTED`, bundlers raise their own variants — long
|
|
11
|
+
* before any pyric code runs. That error names neither pyric nor the reason,
|
|
12
|
+
* so a developer whose app merely *mentions* `firebase/functions` on a code
|
|
13
|
+
* path it never takes sees an unattributable build failure.
|
|
14
|
+
*
|
|
15
|
+
* THE CONTRACT. Resolution and linking succeed; *use* fails loudly.
|
|
16
|
+
* - The subpath resolves, so the module graph loads.
|
|
17
|
+
* - Every symbol the real Firebase entry exports is present as a value, so
|
|
18
|
+
* named-import linking (which is static in ESM — a missing name is a link
|
|
19
|
+
* error, not a runtime one) succeeds and bundlers can tree-shake.
|
|
20
|
+
* - Calling, constructing, or reading a member off one of those values
|
|
21
|
+
* throws {@link PyricDeferredApiError} with a message that names the
|
|
22
|
+
* subpath and points at the conformance matrix.
|
|
23
|
+
*
|
|
24
|
+
* An app that imports but never calls therefore runs unchanged. An app that
|
|
25
|
+
* genuinely depends on a deferred service gets one clear, attributed error at
|
|
26
|
+
* the exact call site instead of a cryptic resolver failure.
|
|
27
|
+
*
|
|
28
|
+
* NOT a mirror. These entries deliberately implement nothing. They are marked
|
|
29
|
+
* deferred in the conformance surface story and must never be counted as
|
|
30
|
+
* implemented surface.
|
|
31
|
+
*/
|
|
32
|
+
/**
|
|
33
|
+
* Compose the single user-facing message every deferred entry raises.
|
|
34
|
+
*
|
|
35
|
+
* @param subpath - The Firebase subpath *without* the `firebase/` prefix, e.g.
|
|
36
|
+
* `functions` or `firestore/lite`.
|
|
37
|
+
*/
|
|
38
|
+
function deferredApiMessage(subpath) {
|
|
39
|
+
return (`pyric: 'firebase/${subpath}' is not yet mirrored by the local sandbox. ` +
|
|
40
|
+
'This API is deferred — see the conformance matrix. Imports resolve so ' +
|
|
41
|
+
'module graphs load; calls fail with this message.');
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* The error thrown by every deferred Firebase entry. Carries the subpath and
|
|
45
|
+
* the symbol that was touched so tooling can group these without parsing the
|
|
46
|
+
* message.
|
|
47
|
+
*/
|
|
48
|
+
export class PyricDeferredApiError extends Error {
|
|
49
|
+
name = 'PyricDeferredApiError';
|
|
50
|
+
/** The Firebase subpath, without the `firebase/` prefix (e.g. `functions`). */
|
|
51
|
+
subpath;
|
|
52
|
+
/** The exported symbol whose use triggered this error (e.g. `getFunctions`). */
|
|
53
|
+
symbol;
|
|
54
|
+
constructor(subpath, symbol) {
|
|
55
|
+
super(deferredApiMessage(subpath));
|
|
56
|
+
this.subpath = subpath;
|
|
57
|
+
this.symbol = symbol;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Property reads that must NOT throw.
|
|
62
|
+
*
|
|
63
|
+
* Bundlers, test runners, `console.log`, promise adoption and React all probe
|
|
64
|
+
* values with these keys as part of ordinary machinery, never as an intent to
|
|
65
|
+
* use the API. Throwing on `then` in particular would turn `await`-ing
|
|
66
|
+
* anything holding a deferred value into this error at the wrong site, and
|
|
67
|
+
* throwing on `$$typeof` would break React's element check. They read as
|
|
68
|
+
* `undefined`, exactly as they would on a real function.
|
|
69
|
+
*/
|
|
70
|
+
const INERT_PROPERTIES = new Set([
|
|
71
|
+
'$$typeof',
|
|
72
|
+
'__esModule',
|
|
73
|
+
'constructor',
|
|
74
|
+
'displayName',
|
|
75
|
+
'inspect',
|
|
76
|
+
'length',
|
|
77
|
+
'name',
|
|
78
|
+
'nodeType',
|
|
79
|
+
'prototype',
|
|
80
|
+
'then',
|
|
81
|
+
'toJSON',
|
|
82
|
+
'toString',
|
|
83
|
+
'valueOf',
|
|
84
|
+
]);
|
|
85
|
+
/**
|
|
86
|
+
* Build one deferred export: a function that throws when called or
|
|
87
|
+
* constructed, wrapped in a proxy so member reads (the enum-constant shape)
|
|
88
|
+
* throw the same error.
|
|
89
|
+
*/
|
|
90
|
+
function deferredSymbol(subpath, symbol) {
|
|
91
|
+
const throwing = function deferred() {
|
|
92
|
+
throw new PyricDeferredApiError(subpath, symbol);
|
|
93
|
+
};
|
|
94
|
+
Object.defineProperty(throwing, 'name', { value: symbol, configurable: true });
|
|
95
|
+
return new Proxy(throwing, {
|
|
96
|
+
get(target, property, receiver) {
|
|
97
|
+
// Symbol-keyed reads are always machinery (Symbol.toPrimitive,
|
|
98
|
+
// Symbol.hasInstance, Symbol.toStringTag, the inspect hook, …) — never a
|
|
99
|
+
// user reaching for an API member.
|
|
100
|
+
if (typeof property === 'symbol' || INERT_PROPERTIES.has(property)) {
|
|
101
|
+
return Reflect.get(target, property, receiver);
|
|
102
|
+
}
|
|
103
|
+
throw new PyricDeferredApiError(subpath, `${symbol}.${property}`);
|
|
104
|
+
},
|
|
105
|
+
construct() {
|
|
106
|
+
throw new PyricDeferredApiError(subpath, symbol);
|
|
107
|
+
},
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* The lazily-materialised export bag for one deferred subpath.
|
|
112
|
+
*
|
|
113
|
+
* Each entry module destructures the symbols it needs off this object:
|
|
114
|
+
*
|
|
115
|
+
* ```ts
|
|
116
|
+
* export const { getFunctions, httpsCallable } = deferredEntry('functions');
|
|
117
|
+
* ```
|
|
118
|
+
*
|
|
119
|
+
* Destructuring is what makes the names real ESM exports (and what keeps the
|
|
120
|
+
* generated `.d.ts` honest); the proxy just mints a correctly-attributed stub
|
|
121
|
+
* for whichever name is read.
|
|
122
|
+
*
|
|
123
|
+
* @param subpath - The Firebase subpath, without the `firebase/` prefix.
|
|
124
|
+
*/
|
|
125
|
+
export function deferredEntry(subpath) {
|
|
126
|
+
const minted = new Map();
|
|
127
|
+
return new Proxy(Object.create(null), {
|
|
128
|
+
get(_target, property) {
|
|
129
|
+
if (typeof property === 'symbol')
|
|
130
|
+
return undefined;
|
|
131
|
+
let api = minted.get(property);
|
|
132
|
+
if (!api) {
|
|
133
|
+
api = deferredSymbol(subpath, property);
|
|
134
|
+
minted.set(property, api);
|
|
135
|
+
}
|
|
136
|
+
return api;
|
|
137
|
+
},
|
|
138
|
+
has() {
|
|
139
|
+
return true;
|
|
140
|
+
},
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
//# sourceMappingURL=entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entry.js","sourceRoot":"","sources":["../../src/deferred/entry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH;;;;;GAKG;AACH,SAAS,kBAAkB,CAAC,OAAe;IACzC,OAAO,CACL,oBAAoB,OAAO,8CAA8C;QACzE,wEAAwE;QACxE,mDAAmD,CACpD,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,OAAO,qBAAsB,SAAQ,KAAK;IAC5B,IAAI,GAAG,uBAAuB,CAAC;IAEjD,+EAA+E;IACtE,OAAO,CAAS;IAEzB,gFAAgF;IACvE,MAAM,CAAS;IAExB,YAAY,OAAe,EAAE,MAAc;QACzC,KAAK,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC;QACnC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;CACF;AAiBD;;;;;;;;;GASG;AACH,MAAM,gBAAgB,GAAwB,IAAI,GAAG,CAAC;IACpD,UAAU;IACV,YAAY;IACZ,aAAa;IACb,aAAa;IACb,SAAS;IACT,QAAQ;IACR,MAAM;IACN,UAAU;IACV,WAAW;IACX,MAAM;IACN,QAAQ;IACR,UAAU;IACV,SAAS;CACV,CAAC,CAAC;AAEH;;;;GAIG;AACH,SAAS,cAAc,CAAC,OAAe,EAAE,MAAc;IACrD,MAAM,QAAQ,GAAG,SAAS,QAAQ;QAChC,MAAM,IAAI,qBAAqB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACnD,CAAC,CAAC;IACF,MAAM,CAAC,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC;IAE/E,OAAO,IAAI,KAAK,CAAC,QAAQ,EAAE;QACzB,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ;YAC5B,+DAA+D;YAC/D,yEAAyE;YACzE,mCAAmC;YACnC,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,gBAAgB,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;gBACnE,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;YACjD,CAAC;YACD,MAAM,IAAI,qBAAqB,CAAC,OAAO,EAAE,GAAG,MAAM,IAAI,QAAQ,EAAE,CAAC,CAAC;QACpE,CAAC;QACD,SAAS;YACP,MAAM,IAAI,qBAAqB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QACnD,CAAC;KACF,CAA2B,CAAC;AAC/B,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,aAAa,CAAC,OAAe;IAC3C,MAAM,MAAM,GAAG,IAAI,GAAG,EAAuB,CAAC;IAC9C,OAAO,IAAI,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAgC,EAAE;QACnE,GAAG,CAAC,OAAO,EAAE,QAAQ;YACnB,IAAI,OAAO,QAAQ,KAAK,QAAQ;gBAAE,OAAO,SAAmC,CAAC;YAC7E,IAAI,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;YAC/B,IAAI,CAAC,GAAG,EAAE,CAAC;gBACT,GAAG,GAAG,cAAc,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;gBACxC,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;YAC5B,CAAC;YACD,OAAO,GAAG,CAAC;QACb,CAAC;QACD,GAAG;YACD,OAAO,IAAI,CAAC;QACd,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `pyric/firestore/lite` — a DEFERRED mirror of `firebase/firestore/lite`.
|
|
3
|
+
*
|
|
4
|
+
* The Lite SDK is a separate build of Firestore with no local cache, no
|
|
5
|
+
* listeners and no offline queue. pyric mirrors the full `firebase/firestore`
|
|
6
|
+
* surface against the in-process sandbox; the Lite build needs its own
|
|
7
|
+
* cache-free instance identity, so it is deferred rather than aliased — an
|
|
8
|
+
* alias would silently give Lite consumers listener-backed semantics the real
|
|
9
|
+
* Lite SDK does not have.
|
|
10
|
+
*
|
|
11
|
+
* Every symbol below resolves and links so an app that swaps `firebase` for
|
|
12
|
+
* `pyric` still loads; touching one throws `PyricDeferredApiError` naming this
|
|
13
|
+
* subpath. See `../deferred/entry.ts` for the full rationale.
|
|
14
|
+
*
|
|
15
|
+
* The value list is the exact public runtime surface of `firebase/firestore/lite`
|
|
16
|
+
* (Firebase Web SDK 12.13.0). Keep it in sync when this entry graduates to a
|
|
17
|
+
* real mirror.
|
|
18
|
+
*/
|
|
19
|
+
import { type DeferredApi } from '../deferred/entry.js';
|
|
20
|
+
export { PyricDeferredApiError } from '../deferred/entry.js';
|
|
21
|
+
export declare const AggregateField: DeferredApi, AggregateQuerySnapshot: DeferredApi, Bytes: DeferredApi, CollectionReference: DeferredApi, DocumentReference: DeferredApi, DocumentSnapshot: DeferredApi, FieldPath: DeferredApi, FieldValue: DeferredApi, Firestore: DeferredApi, FirestoreError: DeferredApi, GeoPoint: DeferredApi, Query: DeferredApi, QueryCompositeFilterConstraint: DeferredApi, QueryConstraint: DeferredApi, QueryDocumentSnapshot: DeferredApi, QueryEndAtConstraint: DeferredApi, QueryFieldFilterConstraint: DeferredApi, QueryLimitConstraint: DeferredApi, QueryOrderByConstraint: DeferredApi, QuerySnapshot: DeferredApi, QueryStartAtConstraint: DeferredApi, Timestamp: DeferredApi, Transaction: DeferredApi, VectorValue: DeferredApi, WriteBatch: DeferredApi, addDoc: DeferredApi, aggregateFieldEqual: DeferredApi, aggregateQuerySnapshotEqual: DeferredApi, and: DeferredApi, arrayRemove: DeferredApi, arrayUnion: DeferredApi, average: DeferredApi, collection: DeferredApi, collectionGroup: DeferredApi, connectFirestoreEmulator: DeferredApi, count: DeferredApi, deleteDoc: DeferredApi, deleteField: DeferredApi, doc: DeferredApi, documentId: DeferredApi, endAt: DeferredApi, endBefore: DeferredApi, getAggregate: DeferredApi, getCount: DeferredApi, getDoc: DeferredApi, getDocs: DeferredApi, getFirestore: DeferredApi, increment: DeferredApi, initializeFirestore: DeferredApi, limit: DeferredApi, limitToLast: DeferredApi, or: DeferredApi, orderBy: DeferredApi, query: DeferredApi, queryEqual: DeferredApi, refEqual: DeferredApi, runTransaction: DeferredApi, serverTimestamp: DeferredApi, setDoc: DeferredApi, setLogLevel: DeferredApi, snapshotEqual: DeferredApi, startAfter: DeferredApi, startAt: DeferredApi, sum: DeferredApi, terminate: DeferredApi, updateDoc: DeferredApi, vector: DeferredApi, where: DeferredApi, writeBatch: DeferredApi;
|
|
22
|
+
export type AddPrefixToKeys = DeferredApi;
|
|
23
|
+
export type AggregateField = DeferredApi;
|
|
24
|
+
export type AggregateFieldType = DeferredApi;
|
|
25
|
+
export type AggregateQuerySnapshot = DeferredApi;
|
|
26
|
+
export type AggregateSpec = DeferredApi;
|
|
27
|
+
export type AggregateSpecData = DeferredApi;
|
|
28
|
+
export type AggregateType = DeferredApi;
|
|
29
|
+
export type Bytes = DeferredApi;
|
|
30
|
+
export type ChildUpdateFields = DeferredApi;
|
|
31
|
+
export type CollectionReference = DeferredApi;
|
|
32
|
+
export type DocumentData = DeferredApi;
|
|
33
|
+
export type DocumentReference = DeferredApi;
|
|
34
|
+
export type DocumentSnapshot = DeferredApi;
|
|
35
|
+
export type EmulatorMockTokenOptions = DeferredApi;
|
|
36
|
+
export type FieldPath = DeferredApi;
|
|
37
|
+
export type FieldValue = DeferredApi;
|
|
38
|
+
export type Firestore = DeferredApi;
|
|
39
|
+
export type FirestoreDataConverter = DeferredApi;
|
|
40
|
+
export type FirestoreError = DeferredApi;
|
|
41
|
+
export type FirestoreErrorCode = DeferredApi;
|
|
42
|
+
export type GeoPoint = DeferredApi;
|
|
43
|
+
export type LogLevel = DeferredApi;
|
|
44
|
+
export type NestedUpdateFields = DeferredApi;
|
|
45
|
+
export type OrderByDirection = DeferredApi;
|
|
46
|
+
export type PartialWithFieldValue = DeferredApi;
|
|
47
|
+
export type Primitive = DeferredApi;
|
|
48
|
+
export type Query = DeferredApi;
|
|
49
|
+
export type QueryCompositeFilterConstraint = DeferredApi;
|
|
50
|
+
export type QueryConstraint = DeferredApi;
|
|
51
|
+
export type QueryConstraintType = DeferredApi;
|
|
52
|
+
export type QueryDocumentSnapshot = DeferredApi;
|
|
53
|
+
export type QueryEndAtConstraint = DeferredApi;
|
|
54
|
+
export type QueryFieldFilterConstraint = DeferredApi;
|
|
55
|
+
export type QueryFilterConstraint = DeferredApi;
|
|
56
|
+
export type QueryLimitConstraint = DeferredApi;
|
|
57
|
+
export type QueryNonFilterConstraint = DeferredApi;
|
|
58
|
+
export type QueryOrderByConstraint = DeferredApi;
|
|
59
|
+
export type QuerySnapshot = DeferredApi;
|
|
60
|
+
export type QueryStartAtConstraint = DeferredApi;
|
|
61
|
+
export type SetOptions = DeferredApi;
|
|
62
|
+
export type Settings = DeferredApi;
|
|
63
|
+
export type Timestamp = DeferredApi;
|
|
64
|
+
export type Transaction = DeferredApi;
|
|
65
|
+
export type TransactionOptions = DeferredApi;
|
|
66
|
+
export type UnionToIntersection = DeferredApi;
|
|
67
|
+
export type UpdateData = DeferredApi;
|
|
68
|
+
export type VectorValue = DeferredApi;
|
|
69
|
+
export type WhereFilterOp = DeferredApi;
|
|
70
|
+
export type WithFieldValue = DeferredApi;
|
|
71
|
+
export type WriteBatch = DeferredApi;
|
|
72
|
+
//# sourceMappingURL=lite.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lite.d.ts","sourceRoot":"","sources":["../../src/firestore/lite.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAiB,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEvE,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,eAAO,MACL,cAAc,eAAE,sBAAsB,eAAE,KAAK,eAAE,mBAAmB,eAAE,iBAAiB,eACrF,gBAAgB,eAAE,SAAS,eAAE,UAAU,eAAE,SAAS,eAAE,cAAc,eAAE,QAAQ,eAAE,KAAK,eACnF,8BAA8B,eAAE,eAAe,eAAE,qBAAqB,eAAE,oBAAoB,eAC5F,0BAA0B,eAAE,oBAAoB,eAAE,sBAAsB,eAAE,aAAa,eACvF,sBAAsB,eAAE,SAAS,eAAE,WAAW,eAAE,WAAW,eAAE,UAAU,eAAE,MAAM,eAC/E,mBAAmB,eAAE,2BAA2B,eAAE,GAAG,eAAE,WAAW,eAAE,UAAU,eAAE,OAAO,eACvF,UAAU,eAAE,eAAe,eAAE,wBAAwB,eAAE,KAAK,eAAE,SAAS,eAAE,WAAW,eAAE,GAAG,eACzF,UAAU,eAAE,KAAK,eAAE,SAAS,eAAE,YAAY,eAAE,QAAQ,eAAE,MAAM,eAAE,OAAO,eAAE,YAAY,eACnF,SAAS,eAAE,mBAAmB,eAAE,KAAK,eAAE,WAAW,eAAE,EAAE,eAAE,OAAO,eAAE,KAAK,eAAE,UAAU,eAAE,QAAQ,eAC5F,cAAc,eAAE,eAAe,eAAE,MAAM,eAAE,WAAW,eAAE,aAAa,eAAE,UAAU,eAAE,OAAO,eACxF,GAAG,eAAE,SAAS,eAAE,SAAS,eAAE,MAAM,eAAE,KAAK,eAAE,UAAU,aACnB,CAAC;AAOpC,MAAM,MAAM,eAAe,GAAG,WAAW,CAAC;AAC1C,MAAM,MAAM,cAAc,GAAG,WAAW,CAAC;AACzC,MAAM,MAAM,kBAAkB,GAAG,WAAW,CAAC;AAC7C,MAAM,MAAM,sBAAsB,GAAG,WAAW,CAAC;AACjD,MAAM,MAAM,aAAa,GAAG,WAAW,CAAC;AACxC,MAAM,MAAM,iBAAiB,GAAG,WAAW,CAAC;AAC5C,MAAM,MAAM,aAAa,GAAG,WAAW,CAAC;AACxC,MAAM,MAAM,KAAK,GAAG,WAAW,CAAC;AAChC,MAAM,MAAM,iBAAiB,GAAG,WAAW,CAAC;AAC5C,MAAM,MAAM,mBAAmB,GAAG,WAAW,CAAC;AAC9C,MAAM,MAAM,YAAY,GAAG,WAAW,CAAC;AACvC,MAAM,MAAM,iBAAiB,GAAG,WAAW,CAAC;AAC5C,MAAM,MAAM,gBAAgB,GAAG,WAAW,CAAC;AAC3C,MAAM,MAAM,wBAAwB,GAAG,WAAW,CAAC;AACnD,MAAM,MAAM,SAAS,GAAG,WAAW,CAAC;AACpC,MAAM,MAAM,UAAU,GAAG,WAAW,CAAC;AACrC,MAAM,MAAM,SAAS,GAAG,WAAW,CAAC;AACpC,MAAM,MAAM,sBAAsB,GAAG,WAAW,CAAC;AACjD,MAAM,MAAM,cAAc,GAAG,WAAW,CAAC;AACzC,MAAM,MAAM,kBAAkB,GAAG,WAAW,CAAC;AAC7C,MAAM,MAAM,QAAQ,GAAG,WAAW,CAAC;AACnC,MAAM,MAAM,QAAQ,GAAG,WAAW,CAAC;AACnC,MAAM,MAAM,kBAAkB,GAAG,WAAW,CAAC;AAC7C,MAAM,MAAM,gBAAgB,GAAG,WAAW,CAAC;AAC3C,MAAM,MAAM,qBAAqB,GAAG,WAAW,CAAC;AAChD,MAAM,MAAM,SAAS,GAAG,WAAW,CAAC;AACpC,MAAM,MAAM,KAAK,GAAG,WAAW,CAAC;AAChC,MAAM,MAAM,8BAA8B,GAAG,WAAW,CAAC;AACzD,MAAM,MAAM,eAAe,GAAG,WAAW,CAAC;AAC1C,MAAM,MAAM,mBAAmB,GAAG,WAAW,CAAC;AAC9C,MAAM,MAAM,qBAAqB,GAAG,WAAW,CAAC;AAChD,MAAM,MAAM,oBAAoB,GAAG,WAAW,CAAC;AAC/C,MAAM,MAAM,0BAA0B,GAAG,WAAW,CAAC;AACrD,MAAM,MAAM,qBAAqB,GAAG,WAAW,CAAC;AAChD,MAAM,MAAM,oBAAoB,GAAG,WAAW,CAAC;AAC/C,MAAM,MAAM,wBAAwB,GAAG,WAAW,CAAC;AACnD,MAAM,MAAM,sBAAsB,GAAG,WAAW,CAAC;AACjD,MAAM,MAAM,aAAa,GAAG,WAAW,CAAC;AACxC,MAAM,MAAM,sBAAsB,GAAG,WAAW,CAAC;AACjD,MAAM,MAAM,UAAU,GAAG,WAAW,CAAC;AACrC,MAAM,MAAM,QAAQ,GAAG,WAAW,CAAC;AACnC,MAAM,MAAM,SAAS,GAAG,WAAW,CAAC;AACpC,MAAM,MAAM,WAAW,GAAG,WAAW,CAAC;AACtC,MAAM,MAAM,kBAAkB,GAAG,WAAW,CAAC;AAC7C,MAAM,MAAM,mBAAmB,GAAG,WAAW,CAAC;AAC9C,MAAM,MAAM,UAAU,GAAG,WAAW,CAAC;AACrC,MAAM,MAAM,WAAW,GAAG,WAAW,CAAC;AACtC,MAAM,MAAM,aAAa,GAAG,WAAW,CAAC;AACxC,MAAM,MAAM,cAAc,GAAG,WAAW,CAAC;AACzC,MAAM,MAAM,UAAU,GAAG,WAAW,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `pyric/firestore/lite` — a DEFERRED mirror of `firebase/firestore/lite`.
|
|
3
|
+
*
|
|
4
|
+
* The Lite SDK is a separate build of Firestore with no local cache, no
|
|
5
|
+
* listeners and no offline queue. pyric mirrors the full `firebase/firestore`
|
|
6
|
+
* surface against the in-process sandbox; the Lite build needs its own
|
|
7
|
+
* cache-free instance identity, so it is deferred rather than aliased — an
|
|
8
|
+
* alias would silently give Lite consumers listener-backed semantics the real
|
|
9
|
+
* Lite SDK does not have.
|
|
10
|
+
*
|
|
11
|
+
* Every symbol below resolves and links so an app that swaps `firebase` for
|
|
12
|
+
* `pyric` still loads; touching one throws `PyricDeferredApiError` naming this
|
|
13
|
+
* subpath. See `../deferred/entry.ts` for the full rationale.
|
|
14
|
+
*
|
|
15
|
+
* The value list is the exact public runtime surface of `firebase/firestore/lite`
|
|
16
|
+
* (Firebase Web SDK 12.13.0). Keep it in sync when this entry graduates to a
|
|
17
|
+
* real mirror.
|
|
18
|
+
*/
|
|
19
|
+
import { deferredEntry } from '../deferred/entry.js';
|
|
20
|
+
export { PyricDeferredApiError } from '../deferred/entry.js';
|
|
21
|
+
export const { AggregateField, AggregateQuerySnapshot, Bytes, CollectionReference, DocumentReference, DocumentSnapshot, FieldPath, FieldValue, Firestore, FirestoreError, GeoPoint, Query, QueryCompositeFilterConstraint, QueryConstraint, QueryDocumentSnapshot, QueryEndAtConstraint, QueryFieldFilterConstraint, QueryLimitConstraint, QueryOrderByConstraint, QuerySnapshot, QueryStartAtConstraint, Timestamp, Transaction, VectorValue, WriteBatch, addDoc, aggregateFieldEqual, aggregateQuerySnapshotEqual, and, arrayRemove, arrayUnion, average, collection, collectionGroup, connectFirestoreEmulator, count, deleteDoc, deleteField, doc, documentId, endAt, endBefore, getAggregate, getCount, getDoc, getDocs, getFirestore, increment, initializeFirestore, limit, limitToLast, or, orderBy, query, queryEqual, refEqual, runTransaction, serverTimestamp, setDoc, setLogLevel, snapshotEqual, startAfter, startAt, sum, terminate, updateDoc, vector, where, writeBatch, } = deferredEntry('firestore/lite');
|
|
22
|
+
//# sourceMappingURL=lite.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lite.js","sourceRoot":"","sources":["../../src/firestore/lite.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,aAAa,EAAoB,MAAM,sBAAsB,CAAC;AAEvE,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,MAAM,CAAC,MAAM,EACX,cAAc,EAAE,sBAAsB,EAAE,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EACrF,gBAAgB,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,cAAc,EAAE,QAAQ,EAAE,KAAK,EACnF,8BAA8B,EAAE,eAAe,EAAE,qBAAqB,EAAE,oBAAoB,EAC5F,0BAA0B,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,aAAa,EACvF,sBAAsB,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAC/E,mBAAmB,EAAE,2BAA2B,EAAE,GAAG,EAAE,WAAW,EAAE,UAAU,EAAE,OAAO,EACvF,UAAU,EAAE,eAAe,EAAE,wBAAwB,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,GAAG,EACzF,UAAU,EAAE,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,EACnF,SAAS,EAAE,mBAAmB,EAAE,KAAK,EAAE,WAAW,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAC5F,cAAc,EAAE,eAAe,EAAE,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,UAAU,EAAE,OAAO,EACxF,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,GACrD,GAAG,aAAa,CAAC,gBAAgB,CAAC,CAAC"}
|
|
@@ -90,7 +90,7 @@ declare const TAB_MANAGER_SYMBOL: unique symbol;
|
|
|
90
90
|
* {@link memoryEagerGarbageCollector} / {@link memoryLruGarbageCollector}. */
|
|
91
91
|
declare const GC_SYMBOL: unique symbol;
|
|
92
92
|
/** Opaque tab-manager config token. Inert — persistence is always on,
|
|
93
|
-
* and the SharedWorker/`pyric
|
|
93
|
+
* and the SharedWorker/`pyric sandbox` path already is the one shared
|
|
94
94
|
* store every tab talks to, so there is no separate multi-tab mode
|
|
95
95
|
* to opt into. Carries the requested kind only for debugging. */
|
|
96
96
|
export interface PersistentTabManager {
|
|
@@ -235,7 +235,7 @@ export type LogLevel = 'debug' | 'verbose' | 'info' | 'warn' | 'error' | 'silent
|
|
|
235
235
|
/**
|
|
236
236
|
* Accepted no-op: the sandbox has no modular-SDK-style logger to wire
|
|
237
237
|
* a level into (it uses host-level `console` logging directly, gated
|
|
238
|
-
* by `pyric
|
|
238
|
+
* by `pyric sandbox`'s own flags, not this call). Exists purely so app
|
|
239
239
|
* code that calls this defensively at startup doesn't crash on a
|
|
240
240
|
* missing export.
|
|
241
241
|
*/
|
|
@@ -263,7 +263,7 @@ export function getDocsFromCache(query) {
|
|
|
263
263
|
/**
|
|
264
264
|
* Accepted no-op: the sandbox has no modular-SDK-style logger to wire
|
|
265
265
|
* a level into (it uses host-level `console` logging directly, gated
|
|
266
|
-
* by `pyric
|
|
266
|
+
* by `pyric sandbox`'s own flags, not this call). Exists purely so app
|
|
267
267
|
* code that calls this defensively at startup doesn't crash on a
|
|
268
268
|
* missing export.
|
|
269
269
|
*/
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `pyric/functions` — a DEFERRED mirror of `firebase/functions`.
|
|
3
|
+
*
|
|
4
|
+
* Callable Cloud Functions dispatch to deployed server code. Mirroring this
|
|
5
|
+
* means running the user’s functions, which is the emulator’s job, not the
|
|
6
|
+
* in-process sandbox’s — deferred pending a decision on the function-host
|
|
7
|
+
* seam.
|
|
8
|
+
*
|
|
9
|
+
* Every symbol below resolves and links so an app that swaps `firebase` for
|
|
10
|
+
* `pyric` still loads; touching one throws `PyricDeferredApiError` naming this
|
|
11
|
+
* subpath. See `../deferred/entry.ts` for the full rationale.
|
|
12
|
+
*
|
|
13
|
+
* The value list is the exact public runtime surface of `firebase/functions`
|
|
14
|
+
* (Firebase Web SDK 12.13.0). Keep it in sync when this entry graduates to a
|
|
15
|
+
* real mirror.
|
|
16
|
+
*/
|
|
17
|
+
import { type DeferredApi } from '../deferred/entry.js';
|
|
18
|
+
export { PyricDeferredApiError } from '../deferred/entry.js';
|
|
19
|
+
export declare const FunctionsError: DeferredApi, connectFunctionsEmulator: DeferredApi, getFunctions: DeferredApi, httpsCallable: DeferredApi, httpsCallableFromURL: DeferredApi;
|
|
20
|
+
export type Functions = DeferredApi;
|
|
21
|
+
export type FunctionsError = DeferredApi;
|
|
22
|
+
export type FunctionsErrorCode = DeferredApi;
|
|
23
|
+
export type FunctionsErrorCodeCore = DeferredApi;
|
|
24
|
+
export type HttpsCallable = DeferredApi;
|
|
25
|
+
export type HttpsCallableOptions = DeferredApi;
|
|
26
|
+
export type HttpsCallableResult = DeferredApi;
|
|
27
|
+
export type HttpsCallableStreamOptions = DeferredApi;
|
|
28
|
+
export type HttpsCallableStreamResult = DeferredApi;
|
|
29
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/functions/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAiB,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEvE,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,eAAO,MACL,cAAc,eAAE,wBAAwB,eAAE,YAAY,eAAE,aAAa,eAAE,oBAAoB,aAC/D,CAAC;AAO/B,MAAM,MAAM,SAAS,GAAG,WAAW,CAAC;AACpC,MAAM,MAAM,cAAc,GAAG,WAAW,CAAC;AACzC,MAAM,MAAM,kBAAkB,GAAG,WAAW,CAAC;AAC7C,MAAM,MAAM,sBAAsB,GAAG,WAAW,CAAC;AACjD,MAAM,MAAM,aAAa,GAAG,WAAW,CAAC;AACxC,MAAM,MAAM,oBAAoB,GAAG,WAAW,CAAC;AAC/C,MAAM,MAAM,mBAAmB,GAAG,WAAW,CAAC;AAC9C,MAAM,MAAM,0BAA0B,GAAG,WAAW,CAAC;AACrD,MAAM,MAAM,yBAAyB,GAAG,WAAW,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `pyric/functions` — a DEFERRED mirror of `firebase/functions`.
|
|
3
|
+
*
|
|
4
|
+
* Callable Cloud Functions dispatch to deployed server code. Mirroring this
|
|
5
|
+
* means running the user’s functions, which is the emulator’s job, not the
|
|
6
|
+
* in-process sandbox’s — deferred pending a decision on the function-host
|
|
7
|
+
* seam.
|
|
8
|
+
*
|
|
9
|
+
* Every symbol below resolves and links so an app that swaps `firebase` for
|
|
10
|
+
* `pyric` still loads; touching one throws `PyricDeferredApiError` naming this
|
|
11
|
+
* subpath. See `../deferred/entry.ts` for the full rationale.
|
|
12
|
+
*
|
|
13
|
+
* The value list is the exact public runtime surface of `firebase/functions`
|
|
14
|
+
* (Firebase Web SDK 12.13.0). Keep it in sync when this entry graduates to a
|
|
15
|
+
* real mirror.
|
|
16
|
+
*/
|
|
17
|
+
import { deferredEntry } from '../deferred/entry.js';
|
|
18
|
+
export { PyricDeferredApiError } from '../deferred/entry.js';
|
|
19
|
+
export const { FunctionsError, connectFunctionsEmulator, getFunctions, httpsCallable, httpsCallableFromURL, } = deferredEntry('functions');
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/functions/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,aAAa,EAAoB,MAAM,sBAAsB,CAAC;AAEvE,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,MAAM,CAAC,MAAM,EACX,cAAc,EAAE,wBAAwB,EAAE,YAAY,EAAE,aAAa,EAAE,oBAAoB,GAC5F,GAAG,aAAa,CAAC,WAAW,CAAC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `pyric/performance` — a DEFERRED mirror of `firebase/performance`.
|
|
3
|
+
*
|
|
4
|
+
* Performance Monitoring instruments real network and render timings and
|
|
5
|
+
* ships them to Google. Nothing about it is locally observable, so it is
|
|
6
|
+
* deferred.
|
|
7
|
+
*
|
|
8
|
+
* Every symbol below resolves and links so an app that swaps `firebase` for
|
|
9
|
+
* `pyric` still loads; touching one throws `PyricDeferredApiError` naming this
|
|
10
|
+
* subpath. See `../deferred/entry.ts` for the full rationale.
|
|
11
|
+
*
|
|
12
|
+
* The value list is the exact public runtime surface of `firebase/performance`
|
|
13
|
+
* (Firebase Web SDK 12.13.0). Keep it in sync when this entry graduates to a
|
|
14
|
+
* real mirror.
|
|
15
|
+
*/
|
|
16
|
+
import { type DeferredApi } from '../deferred/entry.js';
|
|
17
|
+
export { PyricDeferredApiError } from '../deferred/entry.js';
|
|
18
|
+
export declare const getPerformance: DeferredApi, initializePerformance: DeferredApi, trace: DeferredApi;
|
|
19
|
+
export type FirebasePerformance = DeferredApi;
|
|
20
|
+
export type PerformanceSettings = DeferredApi;
|
|
21
|
+
export type PerformanceTrace = DeferredApi;
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/performance/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAiB,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEvE,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,eAAO,MACL,cAAc,eAAE,qBAAqB,eAAE,KAAK,aACd,CAAC;AAOjC,MAAM,MAAM,mBAAmB,GAAG,WAAW,CAAC;AAC9C,MAAM,MAAM,mBAAmB,GAAG,WAAW,CAAC;AAC9C,MAAM,MAAM,gBAAgB,GAAG,WAAW,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `pyric/performance` — a DEFERRED mirror of `firebase/performance`.
|
|
3
|
+
*
|
|
4
|
+
* Performance Monitoring instruments real network and render timings and
|
|
5
|
+
* ships them to Google. Nothing about it is locally observable, so it is
|
|
6
|
+
* deferred.
|
|
7
|
+
*
|
|
8
|
+
* Every symbol below resolves and links so an app that swaps `firebase` for
|
|
9
|
+
* `pyric` still loads; touching one throws `PyricDeferredApiError` naming this
|
|
10
|
+
* subpath. See `../deferred/entry.ts` for the full rationale.
|
|
11
|
+
*
|
|
12
|
+
* The value list is the exact public runtime surface of `firebase/performance`
|
|
13
|
+
* (Firebase Web SDK 12.13.0). Keep it in sync when this entry graduates to a
|
|
14
|
+
* real mirror.
|
|
15
|
+
*/
|
|
16
|
+
import { deferredEntry } from '../deferred/entry.js';
|
|
17
|
+
export { PyricDeferredApiError } from '../deferred/entry.js';
|
|
18
|
+
export const { getPerformance, initializePerformance, trace, } = deferredEntry('performance');
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/performance/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,aAAa,EAAoB,MAAM,sBAAsB,CAAC;AAEvE,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,MAAM,CAAC,MAAM,EACX,cAAc,EAAE,qBAAqB,EAAE,KAAK,GAC7C,GAAG,aAAa,CAAC,aAAa,CAAC,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `pyric/remote-config` — a DEFERRED mirror of `firebase/remote-config`.
|
|
3
|
+
*
|
|
4
|
+
* Remote Config serves server-side parameter values with fetch/activate
|
|
5
|
+
* caching semantics. Mirroring it needs a sandbox-side config store and a
|
|
6
|
+
* model of the fetch throttle — buildable, not yet built.
|
|
7
|
+
*
|
|
8
|
+
* Every symbol below resolves and links so an app that swaps `firebase` for
|
|
9
|
+
* `pyric` still loads; touching one throws `PyricDeferredApiError` naming this
|
|
10
|
+
* subpath. See `../deferred/entry.ts` for the full rationale.
|
|
11
|
+
*
|
|
12
|
+
* The value list is the exact public runtime surface of `firebase/remote-config`
|
|
13
|
+
* (Firebase Web SDK 12.13.0). Keep it in sync when this entry graduates to a
|
|
14
|
+
* real mirror.
|
|
15
|
+
*/
|
|
16
|
+
import { type DeferredApi } from '../deferred/entry.js';
|
|
17
|
+
export { PyricDeferredApiError } from '../deferred/entry.js';
|
|
18
|
+
export declare const activate: DeferredApi, ensureInitialized: DeferredApi, fetchAndActivate: DeferredApi, fetchConfig: DeferredApi, getAll: DeferredApi, getBoolean: DeferredApi, getNumber: DeferredApi, getRemoteConfig: DeferredApi, getString: DeferredApi, getValue: DeferredApi, onConfigUpdate: DeferredApi, setCustomSignals: DeferredApi, setLogLevel: DeferredApi;
|
|
19
|
+
/**
|
|
20
|
+
* The one deferred symbol that answers instead of throwing: the real SDK
|
|
21
|
+
* resolves a boolean, and a deferred entry IS unsupported, so the standard
|
|
22
|
+
* `isSupported().then(ok => ok && get…(app))` guard must run — not crash.
|
|
23
|
+
*/
|
|
24
|
+
export declare const isSupported: () => Promise<boolean>;
|
|
25
|
+
export type ConfigUpdate = DeferredApi;
|
|
26
|
+
export type ConfigUpdateObserver = DeferredApi;
|
|
27
|
+
export type CustomSignals = DeferredApi;
|
|
28
|
+
export type FetchResponse = DeferredApi;
|
|
29
|
+
export type FetchStatus = DeferredApi;
|
|
30
|
+
export type FetchType = DeferredApi;
|
|
31
|
+
export type FirebaseExperimentDescription = DeferredApi;
|
|
32
|
+
export type FirebaseRemoteConfigObject = DeferredApi;
|
|
33
|
+
export type LogLevel = DeferredApi;
|
|
34
|
+
export type RemoteConfig = DeferredApi;
|
|
35
|
+
export type RemoteConfigOptions = DeferredApi;
|
|
36
|
+
export type RemoteConfigSettings = DeferredApi;
|
|
37
|
+
export type Unsubscribe = DeferredApi;
|
|
38
|
+
export type Value = DeferredApi;
|
|
39
|
+
export type ValueSource = DeferredApi;
|
|
40
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/remote-config/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAiB,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEvE,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,eAAO,MACL,QAAQ,eAAE,iBAAiB,eAAE,gBAAgB,eAAE,WAAW,eAAE,MAAM,eAAE,UAAU,eAAE,SAAS,eACzF,eAAe,eAAE,SAAS,eAAE,QAAQ,eAAE,cAAc,eAAE,gBAAgB,eACtE,WAAW,aACqB,CAAC;AAEnC;;;;GAIG;AACH,eAAO,MAAM,WAAW,QAAa,OAAO,CAAC,OAAO,CAAU,CAAC;AAQ/D,MAAM,MAAM,YAAY,GAAG,WAAW,CAAC;AACvC,MAAM,MAAM,oBAAoB,GAAG,WAAW,CAAC;AAC/C,MAAM,MAAM,aAAa,GAAG,WAAW,CAAC;AACxC,MAAM,MAAM,aAAa,GAAG,WAAW,CAAC;AACxC,MAAM,MAAM,WAAW,GAAG,WAAW,CAAC;AACtC,MAAM,MAAM,SAAS,GAAG,WAAW,CAAC;AACpC,MAAM,MAAM,6BAA6B,GAAG,WAAW,CAAC;AACxD,MAAM,MAAM,0BAA0B,GAAG,WAAW,CAAC;AACrD,MAAM,MAAM,QAAQ,GAAG,WAAW,CAAC;AACnC,MAAM,MAAM,YAAY,GAAG,WAAW,CAAC;AACvC,MAAM,MAAM,mBAAmB,GAAG,WAAW,CAAC;AAC9C,MAAM,MAAM,oBAAoB,GAAG,WAAW,CAAC;AAC/C,MAAM,MAAM,WAAW,GAAG,WAAW,CAAC;AACtC,MAAM,MAAM,KAAK,GAAG,WAAW,CAAC;AAChC,MAAM,MAAM,WAAW,GAAG,WAAW,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `pyric/remote-config` — a DEFERRED mirror of `firebase/remote-config`.
|
|
3
|
+
*
|
|
4
|
+
* Remote Config serves server-side parameter values with fetch/activate
|
|
5
|
+
* caching semantics. Mirroring it needs a sandbox-side config store and a
|
|
6
|
+
* model of the fetch throttle — buildable, not yet built.
|
|
7
|
+
*
|
|
8
|
+
* Every symbol below resolves and links so an app that swaps `firebase` for
|
|
9
|
+
* `pyric` still loads; touching one throws `PyricDeferredApiError` naming this
|
|
10
|
+
* subpath. See `../deferred/entry.ts` for the full rationale.
|
|
11
|
+
*
|
|
12
|
+
* The value list is the exact public runtime surface of `firebase/remote-config`
|
|
13
|
+
* (Firebase Web SDK 12.13.0). Keep it in sync when this entry graduates to a
|
|
14
|
+
* real mirror.
|
|
15
|
+
*/
|
|
16
|
+
import { deferredEntry } from '../deferred/entry.js';
|
|
17
|
+
export { PyricDeferredApiError } from '../deferred/entry.js';
|
|
18
|
+
export const { activate, ensureInitialized, fetchAndActivate, fetchConfig, getAll, getBoolean, getNumber, getRemoteConfig, getString, getValue, onConfigUpdate, setCustomSignals, setLogLevel, } = deferredEntry('remote-config');
|
|
19
|
+
/**
|
|
20
|
+
* The one deferred symbol that answers instead of throwing: the real SDK
|
|
21
|
+
* resolves a boolean, and a deferred entry IS unsupported, so the standard
|
|
22
|
+
* `isSupported().then(ok => ok && get…(app))` guard must run — not crash.
|
|
23
|
+
*/
|
|
24
|
+
export const isSupported = async () => false;
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/remote-config/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,aAAa,EAAoB,MAAM,sBAAsB,CAAC;AAEvE,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,MAAM,CAAC,MAAM,EACX,QAAQ,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EACzF,eAAe,EAAE,SAAS,EAAE,QAAQ,EAAE,cAAc,EAAE,gBAAgB,EACtE,WAAW,GACZ,GAAG,aAAa,CAAC,eAAe,CAAC,CAAC;AAEnC;;;;GAIG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,IAAsB,EAAE,CAAC,KAAK,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FirestoreValidator.d.ts","sourceRoot":"","sources":["../../../src/rules/grammar/FirestoreValidator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACf,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"FirestoreValidator.d.ts","sourceRoot":"","sources":["../../../src/rules/grammar/FirestoreValidator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACf,MAAM,mBAAmB,CAAC;AAI3B,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,UAAU,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;IACjD,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB;AAMD,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,cAAc,GAAG,iBAAiB,EAAE,CAyB/E"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { RULES_BUILTIN_FUNCTIONS } from './builtin-functions.js';
|
|
2
|
+
import { countDocumentAccessCalls } from './document-access-count.js';
|
|
2
3
|
const WRITE_OPS = new Set(['write', 'create', 'update', 'delete']);
|
|
3
4
|
const READ_OPS = new Set(['read', 'get', 'list']);
|
|
4
5
|
const DATA_WRITE_OPS = new Set(['create', 'update']);
|
|
@@ -10,8 +11,9 @@ export function validateFirestoreRules(ast) {
|
|
|
10
11
|
const allCalls = collectAllCallsInRules(rootMatch);
|
|
11
12
|
// SEC-4: Check for default deny
|
|
12
13
|
checkDefaultDeny(rootMatch, findings);
|
|
13
|
-
// QUA-3: Duplicate function names
|
|
14
|
-
|
|
14
|
+
// QUA-3: Duplicate function names in one scope (production compile
|
|
15
|
+
// rejection, so critical). Nested shadowing is legal and is not flagged.
|
|
16
|
+
checkDuplicateFunctions(ast, findings);
|
|
15
17
|
// QUA-4: Unused functions
|
|
16
18
|
checkUnusedFunctions(rootMatch, allCalls, findings);
|
|
17
19
|
// STR-3: Overlapping match paths
|
|
@@ -88,12 +90,15 @@ function walkMatch(match, findings, allFunctions, scopeFunctions) {
|
|
|
88
90
|
message: `Create rule at ${pathStr} references resource.data but document doesn't exist yet on create`,
|
|
89
91
|
});
|
|
90
92
|
}
|
|
91
|
-
// SEM-3:
|
|
92
|
-
|
|
93
|
+
// SEM-3: document access budget exceeded. Production allows exactly 10
|
|
94
|
+
// get/exists/getAfter/existsAfter reads per request evaluation; the
|
|
95
|
+
// 11th fails, so the finding fires only ABOVE 10 (same boundary as the
|
|
96
|
+
// linter's GET_COUNT error and the simulator's runtime LookupBudget).
|
|
97
|
+
const docReads = countDocumentAccessCalls(cond, fnMap);
|
|
93
98
|
if (docReads > 10) {
|
|
94
99
|
findings.push({
|
|
95
100
|
code: 'SEM-3', severity: 'high', path: pathStr, operation: opStr,
|
|
96
|
-
message: `Rule at ${pathStr}
|
|
101
|
+
message: `Rule at ${pathStr} may perform ${docReads} document access calls (get/exists/getAfter/existsAfter), which exceeds the 10-call budget`,
|
|
97
102
|
});
|
|
98
103
|
}
|
|
99
104
|
// SEM-4: Undefined function call
|
|
@@ -274,20 +279,6 @@ function referencesResourceData(expr) {
|
|
|
274
279
|
return exprContains(expr, e => e.type === 'memberAccess' && e.property === 'data' &&
|
|
275
280
|
e.object.type === 'identifier' && e.object.name === 'resource');
|
|
276
281
|
}
|
|
277
|
-
function countDocReads(expr, functions, visited = new Set()) {
|
|
278
|
-
let count = 0;
|
|
279
|
-
walkExpr(expr, e => {
|
|
280
|
-
if (e.type === 'functionCall' && (e.name === 'get' || e.name === 'exists' || e.name === 'getAfter')) {
|
|
281
|
-
count++;
|
|
282
|
-
}
|
|
283
|
-
// Follow user-defined function calls
|
|
284
|
-
if (e.type === 'functionCall' && functions.has(e.name) && !visited.has(e.name)) {
|
|
285
|
-
visited.add(e.name);
|
|
286
|
-
count += countDocReads(functions.get(e.name).body, functions, visited);
|
|
287
|
-
}
|
|
288
|
-
});
|
|
289
|
-
return count;
|
|
290
|
-
}
|
|
291
282
|
function collectFunctionCalls(expr) {
|
|
292
283
|
const calls = [];
|
|
293
284
|
walkExpr(expr, e => {
|
|
@@ -308,21 +299,46 @@ function collectAllFunctions(match) {
|
|
|
308
299
|
return names;
|
|
309
300
|
}
|
|
310
301
|
// ---- QUA-3: Duplicate functions ----
|
|
311
|
-
|
|
302
|
+
//
|
|
303
|
+
// Production REJECTS two declarations of one function name in the SAME
|
|
304
|
+
// scope at compile time, so this is severity 'critical': the write gate
|
|
305
|
+
// (`write/handler.ts`) blocks only critical validator findings, and
|
|
306
|
+
// 'medium' folded to a mere warning that deployed anyway.
|
|
307
|
+
//
|
|
308
|
+
// A scope is one declaration list: the global list above `service`, the
|
|
309
|
+
// list directly inside `service`, or one match block's own list. A nested
|
|
310
|
+
// match block that redeclares a name from an enclosing scope SHADOWS it and
|
|
311
|
+
// is legal: the simulator implements shadowing in
|
|
312
|
+
// `simulator/match-resolution.ts`, and the production capture in
|
|
313
|
+
// `conformance/rules-corpus/storage/function-scopes-and-shadowing.ts` pins
|
|
314
|
+
// inner-shadows-outer as accepted. Flagging that would block a ruleset
|
|
315
|
+
// production deploys.
|
|
316
|
+
//
|
|
317
|
+
// The code stays QUA-3 (already registered and asserted by consumers);
|
|
318
|
+
// `DUPLICATE_FUNCTION` was considered and rejected, because the module
|
|
319
|
+
// resolver already uses that name for its own error code
|
|
320
|
+
// (`modules/resolver-core.ts`), and colliding would make mixed issue
|
|
321
|
+
// lists ambiguous.
|
|
322
|
+
function checkDuplicateFunctions(ast, findings) {
|
|
323
|
+
checkDupsInScope(ast.functions ?? [], 'global scope', findings);
|
|
324
|
+
checkDupsInScope(ast.service.functions ?? [], `service ${ast.service.name}`, findings);
|
|
325
|
+
checkDupsInMatchScopes(ast.service.match, findings);
|
|
326
|
+
}
|
|
327
|
+
function checkDupsInMatchScopes(match, findings) {
|
|
312
328
|
checkDupsInScope(match.functions, match.path.raw, findings);
|
|
313
329
|
for (const child of match.children)
|
|
314
|
-
|
|
330
|
+
checkDupsInMatchScopes(child, findings);
|
|
315
331
|
}
|
|
316
|
-
function checkDupsInScope(fns,
|
|
317
|
-
const
|
|
332
|
+
function checkDupsInScope(fns, scope, findings) {
|
|
333
|
+
const declared = new Set();
|
|
318
334
|
for (const fn of fns) {
|
|
319
|
-
if (
|
|
335
|
+
if (declared.has(fn.name)) {
|
|
320
336
|
findings.push({
|
|
321
|
-
code: 'QUA-3', severity: '
|
|
322
|
-
message: `Duplicate function '${fn.name}' in scope at
|
|
337
|
+
code: 'QUA-3', severity: 'critical', path: scope,
|
|
338
|
+
message: `Duplicate function '${fn.name}' declared twice in ${scope}. Production rejects duplicate function declarations in one scope at compile time`,
|
|
323
339
|
});
|
|
324
340
|
}
|
|
325
|
-
|
|
341
|
+
declared.add(fn.name);
|
|
326
342
|
}
|
|
327
343
|
}
|
|
328
344
|
// ---- QUA-4: Unused functions ----
|