pyric 0.1.0-alpha.21 → 0.1.0-alpha.24
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 +12 -4
- package/dist/ai/activity.d.ts +9 -0
- package/dist/ai/activity.d.ts.map +1 -0
- package/dist/ai/activity.js +45 -0
- package/dist/ai/activity.js.map +1 -0
- package/dist/ai/broker/broker.d.ts +25 -0
- package/dist/ai/broker/broker.d.ts.map +1 -1
- package/dist/ai/broker/broker.js +46 -42
- package/dist/ai/broker/broker.js.map +1 -1
- package/dist/ai/broker/gemini-engine.d.ts +7 -0
- package/dist/ai/broker/gemini-engine.d.ts.map +1 -1
- package/dist/ai/broker/gemini-engine.js +15 -0
- package/dist/ai/broker/gemini-engine.js.map +1 -1
- package/dist/ai/broker/index.d.ts +1 -1
- package/dist/ai/broker/index.d.ts.map +1 -1
- package/dist/ai/broker/index.js.map +1 -1
- package/dist/ai/broker/openai-engine.d.ts.map +1 -1
- package/dist/ai/broker/openai-engine.js +7 -3
- package/dist/ai/broker/openai-engine.js.map +1 -1
- package/dist/ai/broker/scripted-engine.d.ts +9 -1
- package/dist/ai/broker/scripted-engine.d.ts.map +1 -1
- package/dist/ai/broker/scripted-engine.js +14 -5
- package/dist/ai/broker/scripted-engine.js.map +1 -1
- package/dist/ai/broker/types.d.ts +6 -2
- package/dist/ai/broker/types.d.ts.map +1 -1
- package/dist/ai/events.d.ts +12 -0
- package/dist/ai/events.d.ts.map +1 -0
- package/dist/ai/events.js +17 -0
- package/dist/ai/events.js.map +1 -0
- package/dist/ai/generation-enums.d.ts +43 -0
- package/dist/ai/generation-enums.d.ts.map +1 -0
- package/dist/ai/generation-enums.js +37 -0
- package/dist/ai/generation-enums.js.map +1 -0
- package/dist/ai/index.d.ts +1 -0
- package/dist/ai/index.d.ts.map +1 -1
- package/dist/ai/index.js +1 -0
- package/dist/ai/index.js.map +1 -1
- package/dist/ai/instances.d.ts +6 -0
- package/dist/ai/instances.d.ts.map +1 -1
- package/dist/ai/instances.js +20 -2
- package/dist/ai/instances.js.map +1 -1
- package/dist/ai/internal.d.ts +3 -0
- package/dist/ai/internal.d.ts.map +1 -1
- package/dist/ai/internal.js +3 -0
- package/dist/ai/internal.js.map +1 -1
- package/dist/ai/sandbox-plane.d.ts.map +1 -1
- package/dist/ai/sandbox-plane.js +23 -8
- package/dist/ai/sandbox-plane.js.map +1 -1
- package/dist/ai/scripting.d.ts +20 -2
- package/dist/ai/scripting.d.ts.map +1 -1
- package/dist/ai/scripting.js +30 -3
- package/dist/ai/scripting.js.map +1 -1
- package/dist/app/internal.d.ts +1 -0
- package/dist/app/internal.d.ts.map +1 -1
- package/dist/app/internal.js +1 -0
- package/dist/app/internal.js.map +1 -1
- package/dist/auth/email-link.d.ts +8 -1
- package/dist/auth/email-link.d.ts.map +1 -1
- package/dist/auth/email-link.js +29 -20
- package/dist/auth/email-link.js.map +1 -1
- package/dist/auth/events.d.ts +12 -0
- package/dist/auth/events.d.ts.map +1 -0
- package/dist/auth/events.js +18 -0
- package/dist/auth/events.js.map +1 -0
- package/dist/auth/factor-id.d.ts +7 -0
- package/dist/auth/factor-id.d.ts.map +1 -0
- package/dist/auth/factor-id.js +6 -0
- package/dist/auth/factor-id.js.map +1 -0
- package/dist/auth/index.d.ts +1 -0
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +1 -0
- package/dist/auth/index.js.map +1 -1
- package/dist/auth/instances.d.ts.map +1 -1
- package/dist/auth/instances.js +13 -1
- package/dist/auth/instances.js.map +1 -1
- package/dist/auth/internal.d.ts +20 -0
- package/dist/auth/internal.d.ts.map +1 -0
- package/dist/auth/internal.js +19 -0
- package/dist/auth/internal.js.map +1 -0
- package/dist/auth/modular.d.ts +9 -0
- package/dist/auth/modular.d.ts.map +1 -1
- package/dist/auth/modular.js +20 -0
- package/dist/auth/modular.js.map +1 -1
- package/dist/auth/reauth.js +3 -2
- package/dist/auth/reauth.js.map +1 -1
- package/dist/auth/sandbox/default-avatar.d.ts +64 -0
- package/dist/auth/sandbox/default-avatar.d.ts.map +1 -0
- package/dist/auth/sandbox/default-avatar.js +118 -0
- package/dist/auth/sandbox/default-avatar.js.map +1 -0
- package/dist/auth/sandbox/driver.d.ts +36 -0
- package/dist/auth/sandbox/driver.d.ts.map +1 -1
- package/dist/auth/sandbox/driver.js +47 -0
- package/dist/auth/sandbox/driver.js.map +1 -1
- package/dist/auth/sandbox/project-store.d.ts +0 -1
- package/dist/auth/sandbox/project-store.d.ts.map +1 -1
- package/dist/auth/sandbox/project-store.js +0 -1
- package/dist/auth/sandbox/project-store.js.map +1 -1
- package/dist/auth/sandbox-backend-types.d.ts +34 -20
- package/dist/auth/sandbox-backend-types.d.ts.map +1 -1
- package/dist/auth/sandbox-backend-types.js +2 -3
- package/dist/auth/sandbox-backend-types.js.map +1 -1
- package/dist/auth/sandbox-backend.d.ts +98 -20
- package/dist/auth/sandbox-backend.d.ts.map +1 -1
- package/dist/auth/sandbox-backend.js +403 -96
- package/dist/auth/sandbox-backend.js.map +1 -1
- package/dist/auth/seed-user.d.ts +38 -0
- package/dist/auth/seed-user.d.ts.map +1 -0
- package/dist/auth/seed-user.js +2 -0
- package/dist/auth/seed-user.js.map +1 -0
- package/dist/auth/tokens.d.ts +6 -1
- package/dist/auth/tokens.d.ts.map +1 -1
- package/dist/auth/tokens.js +19 -17
- package/dist/auth/tokens.js.map +1 -1
- package/dist/auth/types.d.ts +13 -1
- package/dist/auth/types.d.ts.map +1 -1
- package/dist/auth/types.js.map +1 -1
- package/dist/database/activity-coverage.d.ts +9 -0
- package/dist/database/activity-coverage.d.ts.map +1 -0
- package/dist/database/activity-coverage.js +11 -0
- package/dist/database/activity-coverage.js.map +1 -0
- package/dist/database/connection-lifecycle.d.ts +3 -0
- package/dist/database/connection-lifecycle.d.ts.map +1 -1
- package/dist/database/connection-lifecycle.js +54 -23
- package/dist/database/connection-lifecycle.js.map +1 -1
- package/dist/database/events.d.ts +12 -0
- package/dist/database/events.d.ts.map +1 -0
- package/dist/database/events.js +10 -0
- package/dist/database/events.js.map +1 -0
- package/dist/database/instances.d.ts +7 -7
- package/dist/database/instances.d.ts.map +1 -1
- package/dist/database/instances.js +35 -13
- package/dist/database/instances.js.map +1 -1
- package/dist/database/internal/query-projection.d.ts +102 -0
- package/dist/database/internal/query-projection.d.ts.map +1 -0
- package/dist/database/internal/query-projection.js +293 -0
- package/dist/database/internal/query-projection.js.map +1 -0
- package/dist/database/internal.d.ts +2 -0
- package/dist/database/internal.d.ts.map +1 -1
- package/dist/database/internal.js +2 -0
- package/dist/database/internal.js.map +1 -1
- package/dist/database/listeners.d.ts.map +1 -1
- package/dist/database/listeners.js +165 -37
- package/dist/database/listeners.js.map +1 -1
- package/dist/database/operations.d.ts.map +1 -1
- package/dist/database/operations.js +77 -50
- package/dist/database/operations.js.map +1 -1
- package/dist/database/replay.d.ts.map +1 -1
- package/dist/database/replay.js +6 -2
- package/dist/database/replay.js.map +1 -1
- package/dist/database/routing.d.ts +4 -0
- package/dist/database/routing.d.ts.map +1 -1
- package/dist/database/routing.js.map +1 -1
- package/dist/database/sandbox/backend-for.d.ts +4 -3
- package/dist/database/sandbox/backend-for.d.ts.map +1 -1
- package/dist/database/sandbox/backend-for.js +130 -24
- package/dist/database/sandbox/backend-for.js.map +1 -1
- package/dist/database/sandbox/backend-state.d.ts +7 -0
- package/dist/database/sandbox/backend-state.d.ts.map +1 -1
- package/dist/database/sandbox/backend-state.js +15 -1
- package/dist/database/sandbox/backend-state.js.map +1 -1
- package/dist/database/sandbox/backend.d.ts +2 -1
- package/dist/database/sandbox/backend.d.ts.map +1 -1
- package/dist/database/sandbox/backend.js +3 -3
- package/dist/database/sandbox/backend.js.map +1 -1
- package/dist/database/sandbox/child-listeners.d.ts +5 -0
- package/dist/database/sandbox/child-listeners.d.ts.map +1 -1
- package/dist/database/sandbox/child-listeners.js +34 -14
- package/dist/database/sandbox/child-listeners.js.map +1 -1
- package/dist/database/sandbox/listener-types.d.ts +5 -0
- package/dist/database/sandbox/listener-types.d.ts.map +1 -1
- package/dist/database/sandbox/operation-events.d.ts +5 -0
- package/dist/database/sandbox/operation-events.d.ts.map +1 -1
- package/dist/database/sandbox/operation-events.js +18 -3
- package/dist/database/sandbox/operation-events.js.map +1 -1
- package/dist/database/sandbox/persistence-state.d.ts.map +1 -1
- package/dist/database/sandbox/persistence-state.js +1 -8
- package/dist/database/sandbox/persistence-state.js.map +1 -1
- package/dist/database/sandbox/priority-writes.js +2 -2
- package/dist/database/sandbox/priority-writes.js.map +1 -1
- package/dist/database/sandbox/query.d.ts +2 -101
- package/dist/database/sandbox/query.d.ts.map +1 -1
- package/dist/database/sandbox/query.js +1 -225
- package/dist/database/sandbox/query.js.map +1 -1
- package/dist/database/sandbox/rules-eval.d.ts +28 -0
- package/dist/database/sandbox/rules-eval.d.ts.map +1 -1
- package/dist/database/sandbox/rules-eval.js +136 -9
- package/dist/database/sandbox/rules-eval.js.map +1 -1
- package/dist/database/sandbox/transactions.d.ts.map +1 -1
- package/dist/database/sandbox/transactions.js +17 -38
- package/dist/database/sandbox/transactions.js.map +1 -1
- package/dist/database/sandbox/value-listeners.d.ts +11 -1
- package/dist/database/sandbox/value-listeners.d.ts.map +1 -1
- package/dist/database/sandbox/value-listeners.js +65 -27
- package/dist/database/sandbox/value-listeners.js.map +1 -1
- package/dist/database/sandbox/write-plane.d.ts.map +1 -1
- package/dist/database/sandbox/write-plane.js +30 -22
- package/dist/database/sandbox/write-plane.js.map +1 -1
- package/dist/database/sdk-activity.d.ts +5 -0
- package/dist/database/sdk-activity.d.ts.map +1 -0
- package/dist/database/sdk-activity.js +20 -0
- package/dist/database/sdk-activity.js.map +1 -0
- package/dist/database/transactions.d.ts.map +1 -1
- package/dist/database/transactions.js +7 -3
- package/dist/database/transactions.js.map +1 -1
- package/dist/database/types.d.ts +9 -1
- package/dist/database/types.d.ts.map +1 -1
- package/dist/database/types.js.map +1 -1
- package/dist/deferred/entry.d.ts +6 -3
- package/dist/deferred/entry.d.ts.map +1 -1
- package/dist/deferred/entry.js +13 -10
- package/dist/deferred/entry.js.map +1 -1
- package/dist/firestore/activity-coverage.d.ts +9 -0
- package/dist/firestore/activity-coverage.d.ts.map +1 -0
- package/dist/firestore/activity-coverage.js +9 -0
- package/dist/firestore/activity-coverage.js.map +1 -0
- package/dist/firestore/aggregates.d.ts.map +1 -1
- package/dist/firestore/aggregates.js +32 -10
- package/dist/firestore/aggregates.js.map +1 -1
- package/dist/firestore/bytes.d.ts +13 -0
- package/dist/firestore/bytes.d.ts.map +1 -0
- package/dist/firestore/bytes.js +51 -0
- package/dist/firestore/bytes.js.map +1 -0
- package/dist/firestore/converter-method.d.ts +11 -0
- package/dist/firestore/converter-method.d.ts.map +1 -0
- package/dist/firestore/converter-method.js +39 -0
- package/dist/firestore/converter-method.js.map +1 -0
- package/dist/firestore/errors.d.ts.map +1 -1
- package/dist/firestore/errors.js +4 -0
- package/dist/firestore/errors.js.map +1 -1
- package/dist/firestore/field-values.d.ts +3 -36
- package/dist/firestore/field-values.d.ts.map +1 -1
- package/dist/firestore/field-values.js +3 -136
- package/dist/firestore/field-values.js.map +1 -1
- package/dist/firestore/geo-point.d.ts +15 -0
- package/dist/firestore/geo-point.d.ts.map +1 -0
- package/dist/firestore/geo-point.js +50 -0
- package/dist/firestore/geo-point.js.map +1 -0
- package/dist/firestore/index.d.ts +1 -1
- package/dist/firestore/index.d.ts.map +1 -1
- package/dist/firestore/index.js +1 -1
- package/dist/firestore/index.js.map +1 -1
- package/dist/firestore/instances.d.ts.map +1 -1
- package/dist/firestore/instances.js +23 -2
- package/dist/firestore/instances.js.map +1 -1
- package/dist/firestore/internal/document-data.d.ts +3 -0
- package/dist/firestore/internal/document-data.d.ts.map +1 -0
- package/dist/firestore/internal/document-data.js +10 -0
- package/dist/firestore/internal/document-data.js.map +1 -0
- package/dist/firestore/internal/index.d.ts +3 -0
- package/dist/firestore/internal/index.d.ts.map +1 -1
- package/dist/firestore/internal/index.js +5 -0
- package/dist/firestore/internal/index.js.map +1 -1
- package/dist/firestore/internal/value-codec.d.ts +16 -61
- package/dist/firestore/internal/value-codec.d.ts.map +1 -1
- package/dist/firestore/internal/value-codec.js +137 -82
- package/dist/firestore/internal/value-codec.js.map +1 -1
- package/dist/firestore/internal/value-depth.d.ts +3 -0
- package/dist/firestore/internal/value-depth.d.ts.map +1 -0
- package/dist/firestore/internal/value-depth.js +19 -0
- package/dist/firestore/internal/value-depth.js.map +1 -0
- package/dist/firestore/listeners.d.ts +18 -1
- package/dist/firestore/listeners.d.ts.map +1 -1
- package/dist/firestore/listeners.js +60 -21
- package/dist/firestore/listeners.js.map +1 -1
- package/dist/firestore/persistence.d.ts +0 -9
- package/dist/firestore/persistence.d.ts.map +1 -1
- package/dist/firestore/persistence.js +23 -9
- package/dist/firestore/persistence.js.map +1 -1
- package/dist/firestore/plain-object.d.ts +3 -0
- package/dist/firestore/plain-object.d.ts.map +1 -0
- package/dist/firestore/plain-object.js +9 -0
- package/dist/firestore/plain-object.js.map +1 -0
- package/dist/firestore/query-constraints.d.ts.map +1 -1
- package/dist/firestore/query-constraints.js +4 -3
- package/dist/firestore/query-constraints.js.map +1 -1
- package/dist/firestore/reads.d.ts +9 -7
- package/dist/firestore/reads.d.ts.map +1 -1
- package/dist/firestore/reads.js +74 -36
- package/dist/firestore/reads.js.map +1 -1
- package/dist/firestore/refs.d.ts +2 -1
- package/dist/firestore/refs.d.ts.map +1 -1
- package/dist/firestore/refs.js +37 -24
- package/dist/firestore/refs.js.map +1 -1
- package/dist/firestore/sandbox/activity-query-display.d.ts +67 -0
- package/dist/firestore/sandbox/activity-query-display.d.ts.map +1 -0
- package/dist/firestore/sandbox/activity-query-display.js +119 -0
- package/dist/firestore/sandbox/activity-query-display.js.map +1 -0
- package/dist/firestore/sandbox/admin-compat/batch.d.ts +4 -8
- package/dist/firestore/sandbox/admin-compat/batch.d.ts.map +1 -1
- package/dist/firestore/sandbox/admin-compat/batch.js +27 -19
- package/dist/firestore/sandbox/admin-compat/batch.js.map +1 -1
- package/dist/firestore/sandbox/admin-compat/query-comparison.d.ts.map +1 -1
- package/dist/firestore/sandbox/admin-compat/query-comparison.js +8 -3
- package/dist/firestore/sandbox/admin-compat/query-comparison.js.map +1 -1
- package/dist/firestore/sandbox/admin-compat/query.d.ts +8 -0
- package/dist/firestore/sandbox/admin-compat/query.d.ts.map +1 -1
- package/dist/firestore/sandbox/admin-compat/query.js +44 -5
- package/dist/firestore/sandbox/admin-compat/query.js.map +1 -1
- package/dist/firestore/sandbox/admin-compat/read-translation.d.ts.map +1 -1
- package/dist/firestore/sandbox/admin-compat/read-translation.js +18 -9
- package/dist/firestore/sandbox/admin-compat/read-translation.js.map +1 -1
- package/dist/firestore/sandbox/admin-compat/transaction.d.ts +2 -2
- package/dist/firestore/sandbox/admin-compat/transaction.d.ts.map +1 -1
- package/dist/firestore/sandbox/admin-compat/transaction.js +13 -4
- package/dist/firestore/sandbox/admin-compat/transaction.js.map +1 -1
- package/dist/firestore/sandbox/admin-compat/types.d.ts +6 -33
- package/dist/firestore/sandbox/admin-compat/types.d.ts.map +1 -1
- package/dist/firestore/sandbox/admin-compat/types.js +1 -76
- package/dist/firestore/sandbox/admin-compat/types.js.map +1 -1
- package/dist/firestore/sandbox/atomic-state.d.ts +4 -0
- package/dist/firestore/sandbox/atomic-state.d.ts.map +1 -0
- package/dist/firestore/sandbox/atomic-state.js +105 -0
- package/dist/firestore/sandbox/atomic-state.js.map +1 -0
- package/dist/firestore/sandbox/atomic-write-pipeline.d.ts +3 -2
- package/dist/firestore/sandbox/atomic-write-pipeline.d.ts.map +1 -1
- package/dist/firestore/sandbox/atomic-write-pipeline.js +128 -58
- package/dist/firestore/sandbox/atomic-write-pipeline.js.map +1 -1
- package/dist/firestore/sandbox/batch-write-executor.d.ts.map +1 -1
- package/dist/firestore/sandbox/batch-write-executor.js +54 -28
- package/dist/firestore/sandbox/batch-write-executor.js.map +1 -1
- package/dist/firestore/sandbox/converters/user-timestamp.d.ts +6 -40
- package/dist/firestore/sandbox/converters/user-timestamp.d.ts.map +1 -1
- package/dist/firestore/sandbox/converters/user-timestamp.js +20 -43
- package/dist/firestore/sandbox/converters/user-timestamp.js.map +1 -1
- package/dist/firestore/sandbox/document-copy.d.ts +4 -0
- package/dist/firestore/sandbox/document-copy.d.ts.map +1 -0
- package/dist/firestore/sandbox/document-copy.js +28 -0
- package/dist/firestore/sandbox/document-copy.js.map +1 -0
- package/dist/firestore/sandbox/document-store.d.ts +99 -0
- package/dist/firestore/sandbox/document-store.d.ts.map +1 -0
- package/dist/firestore/sandbox/document-store.js +2 -0
- package/dist/firestore/sandbox/document-store.js.map +1 -0
- package/dist/firestore/sandbox/errors.d.ts +4 -1
- package/dist/firestore/sandbox/errors.d.ts.map +1 -1
- package/dist/firestore/sandbox/errors.js +2 -25
- package/dist/firestore/sandbox/errors.js.map +1 -1
- package/dist/firestore/sandbox/event-log.d.ts +22 -4
- package/dist/firestore/sandbox/event-log.d.ts.map +1 -1
- package/dist/firestore/sandbox/event-log.js +66 -6
- package/dist/firestore/sandbox/event-log.js.map +1 -1
- package/dist/firestore/sandbox/field-merge.d.ts.map +1 -1
- package/dist/firestore/sandbox/field-merge.js +10 -20
- package/dist/firestore/sandbox/field-merge.js.map +1 -1
- package/dist/firestore/sandbox/history-controls.d.ts +1 -1
- package/dist/firestore/sandbox/history-controls.d.ts.map +1 -1
- package/dist/firestore/sandbox/history-controls.js +1 -1
- package/dist/firestore/sandbox/history-controls.js.map +1 -1
- package/dist/firestore/sandbox/list-query-proof.d.ts +4 -1
- package/dist/firestore/sandbox/list-query-proof.d.ts.map +1 -1
- package/dist/firestore/sandbox/list-query-proof.js +32 -96
- package/dist/firestore/sandbox/list-query-proof.js.map +1 -1
- package/dist/firestore/sandbox/listener-dispatch.d.ts +26 -1
- package/dist/firestore/sandbox/listener-dispatch.d.ts.map +1 -1
- package/dist/firestore/sandbox/listener-dispatch.js +58 -5
- package/dist/firestore/sandbox/listener-dispatch.js.map +1 -1
- package/dist/firestore/sandbox/local-environment.d.ts +16 -2
- package/dist/firestore/sandbox/local-environment.d.ts.map +1 -1
- package/dist/firestore/sandbox/local-environment.js +33 -9
- package/dist/firestore/sandbox/local-environment.js.map +1 -1
- package/dist/firestore/sandbox/local-state.d.ts +5 -99
- package/dist/firestore/sandbox/local-state.d.ts.map +1 -1
- package/dist/firestore/sandbox/local-state.js +64 -117
- package/dist/firestore/sandbox/local-state.js.map +1 -1
- package/dist/firestore/sandbox/query-execution.d.ts +4 -1
- package/dist/firestore/sandbox/query-execution.d.ts.map +1 -1
- package/dist/firestore/sandbox/query-execution.js +51 -26
- package/dist/firestore/sandbox/query-execution.js.map +1 -1
- package/dist/firestore/sandbox/query-operand-equality.d.ts.map +1 -1
- package/dist/firestore/sandbox/query-operand-equality.js +50 -14
- package/dist/firestore/sandbox/query-operand-equality.js.map +1 -1
- package/dist/firestore/sandbox/query-operators.d.ts +4 -0
- package/dist/firestore/sandbox/query-operators.d.ts.map +1 -0
- package/dist/firestore/sandbox/query-operators.js +17 -0
- package/dist/firestore/sandbox/query-operators.js.map +1 -0
- package/dist/firestore/sandbox/query-value-registry.d.ts +1 -1
- package/dist/firestore/sandbox/query-value-registry.d.ts.map +1 -1
- package/dist/firestore/sandbox/query-value-registry.js +3 -1
- package/dist/firestore/sandbox/query-value-registry.js.map +1 -1
- package/dist/firestore/sandbox/request-events.d.ts +3 -0
- package/dist/firestore/sandbox/request-events.d.ts.map +1 -1
- package/dist/firestore/sandbox/request-events.js +4 -0
- package/dist/firestore/sandbox/request-events.js.map +1 -1
- package/dist/firestore/sandbox/rules-evidence.d.ts +7 -0
- package/dist/firestore/sandbox/rules-evidence.d.ts.map +1 -0
- package/dist/firestore/sandbox/rules-evidence.js +87 -0
- package/dist/firestore/sandbox/rules-evidence.js.map +1 -0
- package/dist/firestore/sandbox/rules-list-authorizer.d.ts +13 -1
- package/dist/firestore/sandbox/rules-list-authorizer.d.ts.map +1 -1
- package/dist/firestore/sandbox/rules-list-authorizer.js +53 -74
- package/dist/firestore/sandbox/rules-list-authorizer.js.map +1 -1
- package/dist/firestore/sandbox/rules-operation-reader.d.ts +8 -1
- package/dist/firestore/sandbox/rules-operation-reader.d.ts.map +1 -1
- package/dist/firestore/sandbox/rules-operation-reader.js +13 -5
- package/dist/firestore/sandbox/rules-operation-reader.js.map +1 -1
- package/dist/firestore/sandbox/rules-read-engine.d.ts +8 -1
- package/dist/firestore/sandbox/rules-read-engine.d.ts.map +1 -1
- package/dist/firestore/sandbox/rules-read-engine.js +21 -10
- package/dist/firestore/sandbox/rules-read-engine.js.map +1 -1
- package/dist/firestore/sandbox/rules-state.d.ts +5 -0
- package/dist/firestore/sandbox/rules-state.d.ts.map +1 -1
- package/dist/firestore/sandbox/rules-state.js +16 -0
- package/dist/firestore/sandbox/rules-state.js.map +1 -1
- package/dist/firestore/sandbox/snapshot-listeners.d.ts +9 -1
- package/dist/firestore/sandbox/snapshot-listeners.d.ts.map +1 -1
- package/dist/firestore/sandbox/snapshot-listeners.js.map +1 -1
- package/dist/firestore/sandbox/transaction-merge.d.ts +2 -33
- package/dist/firestore/sandbox/transaction-merge.d.ts.map +1 -1
- package/dist/firestore/sandbox/transaction-merge.js +19 -7
- package/dist/firestore/sandbox/transaction-merge.js.map +1 -1
- package/dist/firestore/sandbox/transaction-types.d.ts +11 -21
- package/dist/firestore/sandbox/transaction-types.d.ts.map +1 -1
- package/dist/firestore/sandbox/transaction-types.js.map +1 -1
- package/dist/firestore/sandbox/transaction-write-executor.d.ts +2 -1
- package/dist/firestore/sandbox/transaction-write-executor.d.ts.map +1 -1
- package/dist/firestore/sandbox/transaction-write-executor.js +110 -69
- package/dist/firestore/sandbox/transaction-write-executor.js.map +1 -1
- package/dist/firestore/sandbox/transaction.d.ts +3 -2
- package/dist/firestore/sandbox/transaction.d.ts.map +1 -1
- package/dist/firestore/sandbox/transaction.js +23 -6
- package/dist/firestore/sandbox/transaction.js.map +1 -1
- package/dist/firestore/sandbox/value-resolver.d.ts +1 -8
- package/dist/firestore/sandbox/value-resolver.d.ts.map +1 -1
- package/dist/firestore/sandbox/value-resolver.js +2 -13
- package/dist/firestore/sandbox/value-resolver.js.map +1 -1
- package/dist/firestore/sandbox/write-engine.d.ts +5 -1
- package/dist/firestore/sandbox/write-engine.d.ts.map +1 -1
- package/dist/firestore/sandbox/write-engine.js +14 -7
- package/dist/firestore/sandbox/write-engine.js.map +1 -1
- package/dist/firestore/sandbox/write-runtime.d.ts +12 -4
- package/dist/firestore/sandbox/write-runtime.d.ts.map +1 -1
- package/dist/firestore/sandbox/write-runtime.js +72 -38
- package/dist/firestore/sandbox/write-runtime.js.map +1 -1
- package/dist/firestore/sandbox/writes.d.ts +3 -1
- package/dist/firestore/sandbox/writes.d.ts.map +1 -1
- package/dist/firestore/sdk-activity.d.ts +8 -0
- package/dist/firestore/sdk-activity.d.ts.map +1 -0
- package/dist/firestore/sdk-activity.js +23 -0
- package/dist/firestore/sdk-activity.js.map +1 -0
- package/dist/firestore/snapshots.d.ts +18 -2
- package/dist/firestore/snapshots.d.ts.map +1 -1
- package/dist/firestore/snapshots.js +69 -16
- package/dist/firestore/snapshots.js.map +1 -1
- package/dist/firestore/state.d.ts +8 -3
- package/dist/firestore/state.d.ts.map +1 -1
- package/dist/firestore/state.js +30 -13
- package/dist/firestore/state.js.map +1 -1
- package/dist/firestore/timestamp.d.ts +28 -0
- package/dist/firestore/timestamp.d.ts.map +1 -0
- package/dist/firestore/timestamp.js +80 -0
- package/dist/firestore/timestamp.js.map +1 -0
- package/dist/firestore/tools.d.ts.map +1 -1
- package/dist/firestore/tools.js +2 -4
- package/dist/firestore/tools.js.map +1 -1
- package/dist/firestore/transactions.d.ts.map +1 -1
- package/dist/firestore/transactions.js +76 -3
- package/dist/firestore/transactions.js.map +1 -1
- package/dist/firestore/types.d.ts +26 -5
- package/dist/firestore/types.d.ts.map +1 -1
- package/dist/firestore/types.js.map +1 -1
- package/dist/firestore/vector-value.d.ts +11 -0
- package/dist/firestore/vector-value.d.ts.map +1 -0
- package/dist/firestore/vector-value.js +51 -0
- package/dist/firestore/vector-value.js.map +1 -0
- package/dist/firestore/writes.d.ts +0 -7
- package/dist/firestore/writes.d.ts.map +1 -1
- package/dist/firestore/writes.js +42 -25
- package/dist/firestore/writes.js.map +1 -1
- package/dist/functions/events.d.ts +12 -0
- package/dist/functions/events.d.ts.map +1 -0
- package/dist/functions/events.js +10 -0
- package/dist/functions/events.js.map +1 -0
- package/dist/messaging/broker/broker.d.ts +43 -30
- package/dist/messaging/broker/broker.d.ts.map +1 -1
- package/dist/messaging/broker/broker.js +148 -43
- package/dist/messaging/broker/broker.js.map +1 -1
- package/dist/messaging/broker/delivery-history.d.ts +5 -0
- package/dist/messaging/broker/delivery-history.d.ts.map +1 -0
- package/dist/messaging/broker/delivery-history.js +46 -0
- package/dist/messaging/broker/delivery-history.js.map +1 -0
- package/dist/messaging/broker/index.d.ts +2 -1
- package/dist/messaging/broker/index.d.ts.map +1 -1
- package/dist/messaging/broker/index.js +7 -0
- package/dist/messaging/broker/index.js.map +1 -1
- package/dist/messaging/broker/persistence.d.ts +12 -0
- package/dist/messaging/broker/persistence.d.ts.map +1 -0
- package/dist/messaging/broker/persistence.js +42 -0
- package/dist/messaging/broker/persistence.js.map +1 -0
- package/dist/messaging/broker/types.d.ts +44 -0
- package/dist/messaging/broker/types.d.ts.map +1 -1
- package/dist/messaging/broker/types.js +10 -1
- package/dist/messaging/broker/types.js.map +1 -1
- package/dist/messaging/events.d.ts +12 -0
- package/dist/messaging/events.d.ts.map +1 -0
- package/dist/messaging/events.js +19 -0
- package/dist/messaging/events.js.map +1 -0
- package/dist/rules/api/case-types.d.ts +7 -0
- package/dist/rules/api/case-types.d.ts.map +1 -1
- package/dist/rules/api/rtdb.d.ts.map +1 -1
- package/dist/rules/api/rtdb.js +20 -7
- package/dist/rules/api/rtdb.js.map +1 -1
- package/dist/rules/grammar/parse-error-wording.d.ts +31 -0
- package/dist/rules/grammar/parse-error-wording.d.ts.map +1 -0
- package/dist/rules/grammar/parse-error-wording.js +86 -0
- package/dist/rules/grammar/parse-error-wording.js.map +1 -0
- package/dist/rules/indexes/query-analysis.d.ts +33 -0
- package/dist/rules/indexes/query-analysis.d.ts.map +1 -0
- package/dist/rules/indexes/query-analysis.js +153 -0
- package/dist/rules/indexes/query-analysis.js.map +1 -0
- package/dist/rules/indexes/service-query.d.ts +48 -0
- package/dist/rules/indexes/service-query.d.ts.map +1 -0
- package/dist/rules/indexes/service-query.js +60 -0
- package/dist/rules/indexes/service-query.js.map +1 -0
- package/dist/rules/internal/index.d.ts +4 -0
- package/dist/rules/internal/index.d.ts.map +1 -1
- package/dist/rules/internal/index.js +10 -0
- package/dist/rules/internal/index.js.map +1 -1
- package/dist/rules/modules/rules-capabilities.generated.d.ts +1 -1
- package/dist/rules/modules/rules-capabilities.generated.js +1 -1
- package/dist/rules/modules/rules-capabilities.generated.js.map +1 -1
- package/dist/rules/rtdb/constraints/atoms.d.ts.map +1 -1
- package/dist/rules/rtdb/constraints/atoms.js +7 -7
- package/dist/rules/rtdb/constraints/atoms.js.map +1 -1
- package/dist/rules/rtdb/constraints/data.d.ts +2 -2
- package/dist/rules/rtdb/constraints/data.d.ts.map +1 -1
- package/dist/rules/rtdb/constraints/data.js +4 -4
- package/dist/rules/rtdb/constraints/data.js.map +1 -1
- package/dist/rules/rtdb/constraints/document.d.ts.map +1 -1
- package/dist/rules/rtdb/constraints/document.js +6 -2
- package/dist/rules/rtdb/constraints/document.js.map +1 -1
- package/dist/rules/rtdb/constraints/policies.d.ts +2 -2
- package/dist/rules/rtdb/constraints/policies.d.ts.map +1 -1
- package/dist/rules/rtdb/constraints/policies.js +3 -3
- package/dist/rules/rtdb/constraints/policies.js.map +1 -1
- package/dist/rules/rtdb/constraints/schema.js +3 -3
- package/dist/rules/rtdb/constraints/schema.js.map +1 -1
- package/dist/rules/rtdb/grammar/RtdbExpr.ohm +1 -3
- package/dist/rules/rtdb/grammar/RtdbExpr.ohm.generated.d.ts +1 -1
- package/dist/rules/rtdb/grammar/RtdbExpr.ohm.generated.d.ts.map +1 -1
- package/dist/rules/rtdb/grammar/RtdbExpr.ohm.generated.js +1 -3
- package/dist/rules/rtdb/grammar/RtdbExpr.ohm.generated.js.map +1 -1
- package/dist/rules/rtdb/grammar/linter.d.ts.map +1 -1
- package/dist/rules/rtdb/grammar/linter.js +28 -30
- package/dist/rules/rtdb/grammar/linter.js.map +1 -1
- package/dist/rules/rtdb/grammar/simulator.d.ts +15 -1
- package/dist/rules/rtdb/grammar/simulator.d.ts.map +1 -1
- package/dist/rules/rtdb/grammar/simulator.js +93 -65
- package/dist/rules/rtdb/grammar/simulator.js.map +1 -1
- package/dist/rules/rtdb/grammar/validator.d.ts.map +1 -1
- package/dist/rules/rtdb/grammar/validator.js +25 -26
- package/dist/rules/rtdb/grammar/validator.js.map +1 -1
- package/dist/rules/rtdb/simulation/handler.d.ts.map +1 -1
- package/dist/rules/rtdb/simulation/handler.js +136 -32
- package/dist/rules/rtdb/simulation/handler.js.map +1 -1
- package/dist/rules/rtdb/simulation/spec.d.ts +95 -5
- package/dist/rules/rtdb/simulation/spec.d.ts.map +1 -1
- package/dist/rules/rtdb/simulation/spec.js +22 -1
- package/dist/rules/rtdb/simulation/spec.js.map +1 -1
- package/dist/rules/rtdb/types.d.ts +18 -18
- package/dist/rules/simulator/evaluator.js +35 -69
- 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 +12 -3
- package/dist/rules/simulator/handler.js.map +1 -1
- package/dist/rules/simulator/mapdiff.d.ts +2 -0
- package/dist/rules/simulator/mapdiff.d.ts.map +1 -1
- package/dist/rules/simulator/mapdiff.js +7 -5
- package/dist/rules/simulator/mapdiff.js.map +1 -1
- package/dist/rules/simulator/query-proof-residual.d.ts +11 -0
- package/dist/rules/simulator/query-proof-residual.d.ts.map +1 -0
- package/dist/rules/simulator/query-proof-residual.js +177 -0
- package/dist/rules/simulator/query-proof-residual.js.map +1 -0
- package/dist/rules/simulator/query-proof.d.ts +21 -47
- package/dist/rules/simulator/query-proof.d.ts.map +1 -1
- package/dist/rules/simulator/query-proof.js +78 -13
- package/dist/rules/simulator/query-proof.js.map +1 -1
- package/dist/rules/simulator/request-path.d.ts +26 -0
- package/dist/rules/simulator/request-path.d.ts.map +1 -0
- package/dist/rules/simulator/request-path.js +36 -0
- package/dist/rules/simulator/request-path.js.map +1 -0
- package/dist/rules/simulator/trace-recorder.d.ts +1 -0
- package/dist/rules/simulator/trace-recorder.d.ts.map +1 -1
- package/dist/rules/simulator/trace-recorder.js +4 -0
- package/dist/rules/simulator/trace-recorder.js.map +1 -1
- package/dist/rules/simulator/wrappers/timestamp.d.ts +6 -0
- package/dist/rules/simulator/wrappers/timestamp.d.ts.map +1 -1
- package/dist/rules/simulator/wrappers/timestamp.js +8 -1
- package/dist/rules/simulator/wrappers/timestamp.js.map +1 -1
- package/dist/rules/simulator-tools-impl.d.ts.map +1 -1
- package/dist/rules/simulator-tools-impl.js +6 -3
- package/dist/rules/simulator-tools-impl.js.map +1 -1
- package/dist/rules/stdlib-tools.js +4 -4
- package/dist/rules/stdlib-tools.js.map +1 -1
- package/dist/rules/test/spec.d.ts +4 -4
- package/dist/sandbox/active-listeners.d.ts +69 -0
- package/dist/sandbox/active-listeners.d.ts.map +1 -0
- package/dist/sandbox/active-listeners.js +159 -0
- package/dist/sandbox/active-listeners.js.map +1 -0
- package/dist/sandbox/admin-firestore/error-translation.d.ts.map +1 -1
- package/dist/sandbox/admin-firestore/error-translation.js +15 -2
- package/dist/sandbox/admin-firestore/error-translation.js.map +1 -1
- package/dist/sandbox/admin-firestore/listeners.d.ts +0 -25
- package/dist/sandbox/admin-firestore/listeners.d.ts.map +1 -1
- package/dist/sandbox/admin-firestore/listeners.js +26 -2
- package/dist/sandbox/admin-firestore/listeners.js.map +1 -1
- package/dist/sandbox/admin-firestore/remote/listeners.d.ts.map +1 -1
- package/dist/sandbox/admin-firestore/remote/listeners.js +50 -29
- package/dist/sandbox/admin-firestore/remote/listeners.js.map +1 -1
- package/dist/sandbox/admin-firestore/remote/value-codec.d.ts +5 -12
- package/dist/sandbox/admin-firestore/remote/value-codec.d.ts.map +1 -1
- package/dist/sandbox/admin-firestore/remote/value-codec.js +7 -14
- package/dist/sandbox/admin-firestore/remote/value-codec.js.map +1 -1
- package/dist/sandbox/admin-firestore/remote/wire-types.d.ts +2 -0
- package/dist/sandbox/admin-firestore/remote/wire-types.d.ts.map +1 -1
- package/dist/sandbox/attribution/attribution-mode.d.ts +36 -0
- package/dist/sandbox/attribution/attribution-mode.d.ts.map +1 -0
- package/dist/sandbox/attribution/attribution-mode.js +68 -0
- package/dist/sandbox/attribution/attribution-mode.js.map +1 -0
- package/dist/sandbox/attribution/effect-regions.d.ts +37 -0
- package/dist/sandbox/attribution/effect-regions.d.ts.map +1 -0
- package/dist/sandbox/attribution/effect-regions.js +114 -0
- package/dist/sandbox/attribution/effect-regions.js.map +1 -0
- package/dist/sandbox/attribution/element-selector.d.ts +42 -0
- package/dist/sandbox/attribution/element-selector.d.ts.map +1 -0
- package/dist/sandbox/attribution/element-selector.js +109 -0
- package/dist/sandbox/attribution/element-selector.js.map +1 -0
- package/dist/sandbox/attribution/listener-owners.d.ts +111 -0
- package/dist/sandbox/attribution/listener-owners.d.ts.map +1 -0
- package/dist/sandbox/attribution/listener-owners.js +215 -0
- package/dist/sandbox/attribution/listener-owners.js.map +1 -0
- package/dist/sandbox/branches/engine.d.ts +129 -0
- package/dist/sandbox/branches/engine.d.ts.map +1 -0
- package/dist/sandbox/branches/engine.js +280 -0
- package/dist/sandbox/branches/engine.js.map +1 -0
- package/dist/sandbox/branches/index.d.ts +12 -139
- package/dist/sandbox/branches/index.d.ts.map +1 -1
- package/dist/sandbox/branches/index.js +8 -390
- package/dist/sandbox/branches/index.js.map +1 -1
- package/dist/sandbox/branches/promotion.d.ts +27 -0
- package/dist/sandbox/branches/promotion.d.ts.map +1 -0
- package/dist/sandbox/branches/promotion.js +160 -0
- package/dist/sandbox/branches/promotion.js.map +1 -0
- package/dist/sandbox/branches/state-diff.d.ts +66 -0
- package/dist/sandbox/branches/state-diff.d.ts.map +1 -0
- package/dist/sandbox/branches/state-diff.js +270 -0
- package/dist/sandbox/branches/state-diff.js.map +1 -0
- package/dist/sandbox/branches/store.d.ts +64 -0
- package/dist/sandbox/branches/store.d.ts.map +1 -0
- package/dist/sandbox/branches/store.js +264 -0
- package/dist/sandbox/branches/store.js.map +1 -0
- package/dist/sandbox/checkpoints/capture.d.ts +39 -0
- package/dist/sandbox/checkpoints/capture.d.ts.map +1 -0
- package/dist/sandbox/checkpoints/capture.js +69 -0
- package/dist/sandbox/checkpoints/capture.js.map +1 -0
- package/dist/sandbox/checkpoints/directory-backend.d.ts +30 -0
- package/dist/sandbox/checkpoints/directory-backend.d.ts.map +1 -0
- package/dist/sandbox/checkpoints/directory-backend.js +98 -0
- package/dist/sandbox/checkpoints/directory-backend.js.map +1 -0
- package/dist/sandbox/checkpoints/index.d.ts +15 -0
- package/dist/sandbox/checkpoints/index.d.ts.map +1 -0
- package/dist/sandbox/checkpoints/index.js +13 -0
- package/dist/sandbox/checkpoints/index.js.map +1 -0
- package/dist/sandbox/checkpoints/record-backend.d.ts +25 -0
- package/dist/sandbox/checkpoints/record-backend.d.ts.map +1 -0
- package/dist/sandbox/checkpoints/record-backend.js +81 -0
- package/dist/sandbox/checkpoints/record-backend.js.map +1 -0
- package/dist/sandbox/checkpoints/saved-states.d.ts +35 -0
- package/dist/sandbox/checkpoints/saved-states.d.ts.map +1 -0
- package/dist/sandbox/checkpoints/saved-states.js +47 -0
- package/dist/sandbox/checkpoints/saved-states.js.map +1 -0
- package/dist/sandbox/checkpoints/types.d.ts +84 -0
- package/dist/sandbox/checkpoints/types.d.ts.map +1 -0
- package/dist/sandbox/checkpoints/types.js +51 -0
- package/dist/sandbox/checkpoints/types.js.map +1 -0
- package/dist/sandbox/checkpoints/validation.d.ts +3 -0
- package/dist/sandbox/checkpoints/validation.d.ts.map +1 -0
- package/dist/sandbox/checkpoints/validation.js +99 -0
- package/dist/sandbox/checkpoints/validation.js.map +1 -0
- package/dist/sandbox/clock.d.ts +121 -0
- package/dist/sandbox/clock.d.ts.map +1 -0
- package/dist/sandbox/clock.js +167 -0
- package/dist/sandbox/clock.js.map +1 -0
- package/dist/sandbox/full-state.d.ts +160 -0
- package/dist/sandbox/full-state.d.ts.map +1 -0
- package/dist/sandbox/full-state.js +267 -0
- package/dist/sandbox/full-state.js.map +1 -0
- package/dist/sandbox/index.d.ts +13 -6
- package/dist/sandbox/index.d.ts.map +1 -1
- package/dist/sandbox/index.js +23 -9
- package/dist/sandbox/index.js.map +1 -1
- package/dist/sandbox/internal/ai-evidence.d.ts +27 -0
- package/dist/sandbox/internal/ai-evidence.d.ts.map +1 -0
- package/dist/sandbox/internal/ai-evidence.js +29 -0
- package/dist/sandbox/internal/ai-evidence.js.map +1 -0
- package/dist/sandbox/internal/event-history.d.ts +32 -0
- package/dist/sandbox/internal/event-history.d.ts.map +1 -0
- package/dist/sandbox/internal/event-history.js +199 -0
- package/dist/sandbox/internal/event-history.js.map +1 -0
- package/dist/sandbox/internal/history-integrity.d.ts +3 -0
- package/dist/sandbox/internal/history-integrity.d.ts.map +1 -0
- package/dist/sandbox/internal/history-integrity.js +12 -0
- package/dist/sandbox/internal/history-integrity.js.map +1 -0
- package/dist/sandbox/internal/history-retention.d.ts +6 -0
- package/dist/sandbox/internal/history-retention.d.ts.map +1 -0
- package/dist/sandbox/internal/history-retention.js +12 -0
- package/dist/sandbox/internal/history-retention.js.map +1 -0
- package/dist/sandbox/internal/index.d.ts +27 -0
- package/dist/sandbox/internal/index.d.ts.map +1 -1
- package/dist/sandbox/internal/index.js +26 -0
- package/dist/sandbox/internal/index.js.map +1 -1
- package/dist/sandbox/internal/observation-history.d.ts +6 -0
- package/dist/sandbox/internal/observation-history.d.ts.map +1 -0
- package/dist/sandbox/internal/observation-history.js +6 -0
- package/dist/sandbox/internal/observation-history.js.map +1 -0
- package/dist/sandbox/internal/observation-payload.d.ts +6 -0
- package/dist/sandbox/internal/observation-payload.d.ts.map +1 -0
- package/dist/sandbox/internal/observation-payload.js +24 -0
- package/dist/sandbox/internal/observation-payload.js.map +1 -0
- package/dist/sandbox/internal/provenance.d.ts +0 -1
- package/dist/sandbox/internal/provenance.d.ts.map +1 -1
- package/dist/sandbox/internal/provenance.js +6 -0
- package/dist/sandbox/internal/provenance.js.map +1 -1
- package/dist/sandbox/internal/root.d.ts +2 -1
- package/dist/sandbox/internal/root.d.ts.map +1 -1
- package/dist/sandbox/internal/root.js +2 -2
- package/dist/sandbox/internal/root.js.map +1 -1
- package/dist/sandbox/internal/rules-evidence-retention.d.ts +11 -0
- package/dist/sandbox/internal/rules-evidence-retention.d.ts.map +1 -0
- package/dist/sandbox/internal/rules-evidence-retention.js +27 -0
- package/dist/sandbox/internal/rules-evidence-retention.js.map +1 -0
- package/dist/sandbox/internal/sandbox-impl.d.ts +40 -33
- package/dist/sandbox/internal/sandbox-impl.d.ts.map +1 -1
- package/dist/sandbox/internal/sandbox-impl.js +83 -40
- package/dist/sandbox/internal/sandbox-impl.js.map +1 -1
- package/dist/sandbox/internal/sdk-activity.d.ts +112 -0
- package/dist/sandbox/internal/sdk-activity.d.ts.map +1 -0
- package/dist/sandbox/internal/sdk-activity.js +240 -0
- package/dist/sandbox/internal/sdk-activity.js.map +1 -0
- package/dist/sandbox/internal/sdk-coverage.d.ts +10 -0
- package/dist/sandbox/internal/sdk-coverage.d.ts.map +1 -0
- package/dist/sandbox/internal/sdk-coverage.js +21 -0
- package/dist/sandbox/internal/sdk-coverage.js.map +1 -0
- package/dist/sandbox/internal/sdk-observation.d.ts +32 -0
- package/dist/sandbox/internal/sdk-observation.d.ts.map +1 -0
- package/dist/sandbox/internal/sdk-observation.js +29 -0
- package/dist/sandbox/internal/sdk-observation.js.map +1 -0
- package/dist/sandbox/internal/sdk-rates.d.ts +97 -0
- package/dist/sandbox/internal/sdk-rates.d.ts.map +1 -0
- package/dist/sandbox/internal/sdk-rates.js +187 -0
- package/dist/sandbox/internal/sdk-rates.js.map +1 -0
- package/dist/sandbox/internal/sdk-write-activity.d.ts +5 -0
- package/dist/sandbox/internal/sdk-write-activity.d.ts.map +1 -0
- package/dist/sandbox/internal/sdk-write-activity.js +13 -0
- package/dist/sandbox/internal/sdk-write-activity.js.map +1 -0
- package/dist/sandbox/internal/state-schemas.d.ts +120 -0
- package/dist/sandbox/internal/state-schemas.d.ts.map +1 -0
- package/dist/sandbox/internal/state-schemas.js +42 -0
- package/dist/sandbox/internal/state-schemas.js.map +1 -0
- package/dist/sandbox/internal/state-values.d.ts +6 -0
- package/dist/sandbox/internal/state-values.d.ts.map +1 -0
- package/dist/sandbox/internal/state-values.js +15 -0
- package/dist/sandbox/internal/state-values.js.map +1 -0
- package/dist/sandbox/internal/storage-activity.d.ts +13 -0
- package/dist/sandbox/internal/storage-activity.d.ts.map +1 -0
- package/dist/sandbox/internal/storage-activity.js +48 -0
- package/dist/sandbox/internal/storage-activity.js.map +1 -0
- package/dist/sandbox/internal/usage-evidence.d.ts +24 -0
- package/dist/sandbox/internal/usage-evidence.d.ts.map +1 -0
- package/dist/sandbox/internal/usage-evidence.js +56 -0
- package/dist/sandbox/internal/usage-evidence.js.map +1 -0
- package/dist/sandbox/operation-record.d.ts +20 -1
- package/dist/sandbox/operation-record.d.ts.map +1 -1
- package/dist/sandbox/operation-record.js +100 -4
- package/dist/sandbox/operation-record.js.map +1 -1
- package/dist/sandbox/persistence/changed-buckets.d.ts +19 -0
- package/dist/sandbox/persistence/changed-buckets.d.ts.map +1 -0
- package/dist/sandbox/persistence/changed-buckets.js +72 -0
- package/dist/sandbox/persistence/changed-buckets.js.map +1 -0
- package/dist/sandbox/persistence/chunk-format.d.ts +27 -1
- package/dist/sandbox/persistence/chunk-format.d.ts.map +1 -1
- package/dist/sandbox/persistence/chunk-format.js +37 -25
- package/dist/sandbox/persistence/chunk-format.js.map +1 -1
- package/dist/sandbox/persistence/controller.d.ts.map +1 -1
- package/dist/sandbox/persistence/controller.js +91 -36
- package/dist/sandbox/persistence/controller.js.map +1 -1
- package/dist/sandbox/persistence/import-bundle.d.ts +8 -0
- package/dist/sandbox/persistence/import-bundle.d.ts.map +1 -0
- package/dist/sandbox/persistence/import-bundle.js +66 -0
- package/dist/sandbox/persistence/import-bundle.js.map +1 -0
- package/dist/sandbox/persistence/serialize.d.ts +1 -1
- package/dist/sandbox/persistence/serialize.d.ts.map +1 -1
- package/dist/sandbox/persistence/serialize.js +16 -11
- package/dist/sandbox/persistence/serialize.js.map +1 -1
- package/dist/sandbox/persistence/types.d.ts +4 -0
- package/dist/sandbox/persistence/types.d.ts.map +1 -1
- package/dist/sandbox/persistence/validate-services.d.ts +7 -0
- package/dist/sandbox/persistence/validate-services.d.ts.map +1 -0
- package/dist/sandbox/persistence/validate-services.js +73 -0
- package/dist/sandbox/persistence/validate-services.js.map +1 -0
- package/dist/sandbox/remote.d.ts +6 -0
- package/dist/sandbox/remote.d.ts.map +1 -1
- package/dist/sandbox/remote.js.map +1 -1
- package/dist/sandbox/replay/index.d.ts +1 -1
- package/dist/sandbox/replay/index.d.ts.map +1 -1
- package/dist/sandbox/replay/index.js +18 -8
- package/dist/sandbox/replay/index.js.map +1 -1
- package/dist/sandbox/types/errors.d.ts +3 -1
- package/dist/sandbox/types/errors.d.ts.map +1 -1
- package/dist/sandbox/types/errors.js +0 -4
- package/dist/sandbox/types/errors.js.map +1 -1
- package/dist/sandbox/types/events.d.ts +105 -76
- package/dist/sandbox/types/events.d.ts.map +1 -1
- package/dist/sandbox/types/events.js +0 -5
- package/dist/sandbox/types/events.js.map +1 -1
- package/dist/sandbox/types/index.d.ts +2 -1
- package/dist/sandbox/types/index.d.ts.map +1 -1
- package/dist/sandbox/types/index.js +1 -0
- package/dist/sandbox/types/index.js.map +1 -1
- package/dist/sandbox/types/operation.d.ts +13 -4
- package/dist/sandbox/types/operation.d.ts.map +1 -1
- package/dist/sandbox/types/persistence.d.ts +2 -2
- package/dist/sandbox/types/query-proof.d.ts +25 -0
- package/dist/sandbox/types/query-proof.d.ts.map +1 -0
- package/dist/sandbox/types/query-proof.js +2 -0
- package/dist/sandbox/types/query-proof.js.map +1 -0
- package/dist/sandbox/types/request-observation.d.ts +19 -0
- package/dist/sandbox/types/request-observation.d.ts.map +1 -0
- package/dist/sandbox/types/request-observation.js +13 -0
- package/dist/sandbox/types/request-observation.js.map +1 -0
- package/dist/sandbox/types/rules-evidence.d.ts +48 -0
- package/dist/sandbox/types/rules-evidence.d.ts.map +1 -0
- package/dist/sandbox/types/rules-evidence.js +2 -0
- package/dist/sandbox/types/rules-evidence.js.map +1 -0
- package/dist/sandbox/types/service-event-record.d.ts +30 -0
- package/dist/sandbox/types/service-event-record.d.ts.map +1 -0
- package/dist/sandbox/types/service-event-record.js +13 -0
- package/dist/sandbox/types/service-event-record.js.map +1 -0
- package/dist/sandbox/types/service-event-records.d.ts +64 -0
- package/dist/sandbox/types/service-event-records.d.ts.map +1 -0
- package/dist/sandbox/types/service-event-records.js +31 -0
- package/dist/sandbox/types/service-event-records.js.map +1 -0
- package/dist/sandbox/types/service-mutation-event.d.ts +88 -0
- package/dist/sandbox/types/service-mutation-event.d.ts.map +1 -0
- package/dist/sandbox/types/service-mutation-event.js +2 -0
- package/dist/sandbox/types/service-mutation-event.js.map +1 -0
- package/dist/storage/activity-coverage.d.ts +9 -0
- package/dist/storage/activity-coverage.d.ts.map +1 -0
- package/dist/storage/activity-coverage.js +9 -0
- package/dist/storage/activity-coverage.js.map +1 -0
- package/dist/storage/base64.d.ts +14 -0
- package/dist/storage/base64.d.ts.map +1 -0
- package/dist/storage/base64.js +34 -0
- package/dist/storage/base64.js.map +1 -0
- package/dist/storage/download.d.ts +12 -4
- package/dist/storage/download.d.ts.map +1 -1
- package/dist/storage/download.js +19 -6
- package/dist/storage/download.js.map +1 -1
- package/dist/storage/enforce.d.ts +13 -2
- package/dist/storage/enforce.d.ts.map +1 -1
- package/dist/storage/enforce.js +21 -3
- package/dist/storage/enforce.js.map +1 -1
- package/dist/storage/errors.d.ts +29 -5
- package/dist/storage/errors.d.ts.map +1 -1
- package/dist/storage/errors.js +28 -0
- package/dist/storage/errors.js.map +1 -1
- package/dist/storage/events.d.ts +12 -0
- package/dist/storage/events.d.ts.map +1 -0
- package/dist/storage/events.js +10 -0
- package/dist/storage/events.js.map +1 -0
- package/dist/storage/index.d.ts +7 -7
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +7 -5
- package/dist/storage/index.js.map +1 -1
- package/dist/storage/internal.d.ts +10 -1
- package/dist/storage/internal.d.ts.map +1 -1
- package/dist/storage/internal.js +9 -1
- package/dist/storage/internal.js.map +1 -1
- package/dist/storage/metadata.d.ts +19 -0
- package/dist/storage/metadata.d.ts.map +1 -1
- package/dist/storage/metadata.js +50 -19
- package/dist/storage/metadata.js.map +1 -1
- package/dist/storage/observed.d.ts +16 -0
- package/dist/storage/observed.d.ts.map +1 -0
- package/dist/storage/observed.js +17 -0
- package/dist/storage/observed.js.map +1 -0
- package/dist/storage/persistence.d.ts +157 -20
- package/dist/storage/persistence.d.ts.map +1 -1
- package/dist/storage/persistence.js +423 -53
- package/dist/storage/persistence.js.map +1 -1
- package/dist/storage/reference.d.ts +3 -1
- package/dist/storage/reference.d.ts.map +1 -1
- package/dist/storage/reference.js +3 -2
- package/dist/storage/reference.js.map +1 -1
- package/dist/storage/remote-bytes.d.ts +44 -0
- package/dist/storage/remote-bytes.d.ts.map +1 -0
- package/dist/storage/remote-bytes.js +97 -0
- package/dist/storage/remote-bytes.js.map +1 -0
- package/dist/storage/resumable.d.ts.map +1 -1
- package/dist/storage/resumable.js +16 -0
- package/dist/storage/resumable.js.map +1 -1
- package/dist/storage/rules-resolution.d.ts +13 -1
- package/dist/storage/rules-resolution.d.ts.map +1 -1
- package/dist/storage/rules-resolution.js +28 -0
- package/dist/storage/rules-resolution.js.map +1 -1
- package/dist/storage/sandbox/persistence-state.d.ts +25 -0
- package/dist/storage/sandbox/persistence-state.d.ts.map +1 -0
- package/dist/storage/sandbox/persistence-state.js +53 -0
- package/dist/storage/sandbox/persistence-state.js.map +1 -0
- package/dist/storage/sandbox/rules-bindings.d.ts +15 -0
- package/dist/storage/sandbox/rules-bindings.d.ts.map +1 -0
- package/dist/storage/sandbox/rules-bindings.js +69 -0
- package/dist/storage/sandbox/rules-bindings.js.map +1 -0
- package/dist/storage/sandbox/rules-collection-methods.d.ts +3 -0
- package/dist/storage/sandbox/rules-collection-methods.d.ts.map +1 -0
- package/dist/storage/sandbox/rules-collection-methods.js +149 -0
- package/dist/storage/sandbox/rules-collection-methods.js.map +1 -0
- package/dist/storage/sandbox/rules-evaluator.d.ts +2 -2
- package/dist/storage/sandbox/rules-evaluator.d.ts.map +1 -1
- package/dist/storage/sandbox/rules-evaluator.js +51 -129
- package/dist/storage/sandbox/rules-evaluator.js.map +1 -1
- package/dist/storage/sandbox/rules-firestore-lookup.d.ts +25 -0
- package/dist/storage/sandbox/rules-firestore-lookup.d.ts.map +1 -0
- package/dist/storage/sandbox/rules-firestore-lookup.js +94 -0
- package/dist/storage/sandbox/rules-firestore-lookup.js.map +1 -0
- package/dist/storage/sandbox/rules-hashing-methods.d.ts +16 -0
- package/dist/storage/sandbox/rules-hashing-methods.d.ts.map +1 -0
- package/dist/storage/sandbox/rules-hashing-methods.js +41 -0
- package/dist/storage/sandbox/rules-hashing-methods.js.map +1 -0
- package/dist/storage/sandbox/rules-method-calls.d.ts +40 -0
- package/dist/storage/sandbox/rules-method-calls.d.ts.map +1 -0
- package/dist/storage/sandbox/rules-method-calls.js +47 -0
- package/dist/storage/sandbox/rules-method-calls.js.map +1 -0
- package/dist/storage/sandbox/rules-methods.d.ts +11 -12
- package/dist/storage/sandbox/rules-methods.d.ts.map +1 -1
- package/dist/storage/sandbox/rules-methods.js +62 -359
- package/dist/storage/sandbox/rules-methods.js.map +1 -1
- package/dist/storage/sandbox/rules-operators.d.ts +32 -0
- package/dist/storage/sandbox/rules-operators.d.ts.map +1 -0
- package/dist/storage/sandbox/rules-operators.js +85 -0
- package/dist/storage/sandbox/rules-operators.js.map +1 -0
- package/dist/storage/sandbox/rules-string-methods.d.ts +3 -0
- package/dist/storage/sandbox/rules-string-methods.d.ts.map +1 -0
- package/dist/storage/sandbox/rules-string-methods.js +199 -0
- package/dist/storage/sandbox/rules-string-methods.js.map +1 -0
- package/dist/storage/sandbox/rules-time-methods.d.ts +25 -0
- package/dist/storage/sandbox/rules-time-methods.d.ts.map +1 -0
- package/dist/storage/sandbox/rules-time-methods.js +89 -0
- package/dist/storage/sandbox/rules-time-methods.js.map +1 -0
- package/dist/storage/sandbox/rules-values.d.ts +6 -0
- package/dist/storage/sandbox/rules-values.d.ts.map +1 -1
- package/dist/storage/sandbox/rules-values.js +29 -2
- package/dist/storage/sandbox/rules-values.js.map +1 -1
- package/dist/storage/sandbox/rules.d.ts +25 -13
- package/dist/storage/sandbox/rules.d.ts.map +1 -1
- package/dist/storage/sandbox/rules.js +19 -10
- package/dist/storage/sandbox/rules.js.map +1 -1
- package/dist/storage/sandbox/running-service.d.ts +65 -0
- package/dist/storage/sandbox/running-service.d.ts.map +1 -0
- package/dist/storage/sandbox/running-service.js +30 -0
- package/dist/storage/sandbox/running-service.js.map +1 -0
- package/dist/storage/service.d.ts +46 -28
- package/dist/storage/service.d.ts.map +1 -1
- package/dist/storage/service.js +169 -57
- package/dist/storage/service.js.map +1 -1
- package/dist/storage/string-format.d.ts +9 -0
- package/dist/storage/string-format.d.ts.map +1 -0
- package/dist/storage/string-format.js +8 -0
- package/dist/storage/string-format.js.map +1 -0
- package/dist/storage/upload.d.ts +2 -1
- package/dist/storage/upload.d.ts.map +1 -1
- package/dist/storage/upload.js +6 -2
- package/dist/storage/upload.js.map +1 -1
- package/dist/storage/url.d.ts +18 -0
- package/dist/storage/url.d.ts.map +1 -0
- package/dist/storage/url.js +84 -0
- package/dist/storage/url.js.map +1 -0
- package/package.json +17 -1
- package/src/ai/activity.ts +43 -0
- package/src/ai/broker/broker.ts +59 -6
- package/src/ai/broker/gemini-engine.ts +16 -0
- package/src/ai/broker/index.ts +1 -1
- package/src/ai/broker/openai-engine.ts +6 -3
- package/src/ai/broker/scripted-engine.ts +16 -5
- package/src/ai/broker/types.ts +6 -2
- package/src/ai/events.ts +29 -0
- package/src/ai/generation-enums.ts +48 -0
- package/src/ai/index.ts +9 -0
- package/src/ai/instances.ts +22 -2
- package/src/ai/internal.ts +5 -0
- package/src/ai/sandbox-plane.ts +23 -8
- package/src/ai/scripting.ts +42 -7
- package/src/app/internal.ts +1 -0
- package/src/auth/email-link.ts +32 -21
- package/src/auth/events.ts +29 -0
- package/src/auth/factor-id.ts +7 -0
- package/src/auth/index.ts +2 -0
- package/src/auth/instances.ts +13 -1
- package/src/auth/internal.ts +24 -0
- package/src/auth/modular.ts +27 -0
- package/src/auth/reauth.ts +3 -2
- package/src/auth/sandbox/default-avatar.ts +177 -0
- package/src/auth/sandbox/driver.ts +54 -0
- package/src/auth/sandbox/project-store.ts +0 -2
- package/src/auth/sandbox-backend-types.ts +31 -20
- package/src/auth/sandbox-backend.ts +400 -94
- package/src/auth/seed-user.ts +38 -0
- package/src/auth/tokens.ts +21 -18
- package/src/auth/types.ts +13 -1
- package/src/database/activity-coverage.ts +10 -0
- package/src/database/connection-lifecycle.ts +53 -24
- package/src/database/events.ts +20 -0
- package/src/database/instances.ts +52 -21
- package/src/database/internal/query-projection.ts +333 -0
- package/src/database/internal.ts +2 -0
- package/src/database/listeners.ts +162 -44
- package/src/database/operations.ts +73 -50
- package/src/database/replay.ts +6 -2
- package/src/database/routing.ts +4 -0
- package/src/database/sandbox/backend-for.ts +145 -25
- package/src/database/sandbox/backend-state.ts +15 -1
- package/src/database/sandbox/backend.ts +4 -2
- package/src/database/sandbox/child-listeners.ts +32 -13
- package/src/database/sandbox/listener-types.ts +5 -0
- package/src/database/sandbox/operation-events.ts +23 -9
- package/src/database/sandbox/persistence-state.ts +4 -11
- package/src/database/sandbox/priority-writes.ts +2 -2
- package/src/database/sandbox/query.ts +13 -268
- package/src/database/sandbox/rules-eval.ts +144 -10
- package/src/database/sandbox/transactions.ts +17 -39
- package/src/database/sandbox/value-listeners.ts +66 -23
- package/src/database/sandbox/write-plane.ts +29 -22
- package/src/database/sdk-activity.ts +26 -0
- package/src/database/transactions.ts +15 -11
- package/src/database/types.ts +12 -1
- package/src/deferred/entry.ts +16 -10
- package/src/firestore/activity-coverage.ts +8 -0
- package/src/firestore/aggregates.ts +17 -9
- package/src/firestore/bytes.ts +56 -0
- package/src/firestore/converter-method.ts +49 -0
- package/src/firestore/errors.ts +8 -0
- package/src/firestore/field-values.ts +3 -158
- package/src/firestore/geo-point.ts +56 -0
- package/src/firestore/index.ts +1 -1
- package/src/firestore/instances.ts +23 -2
- package/src/firestore/internal/document-data.ts +9 -0
- package/src/firestore/internal/index.ts +7 -0
- package/src/firestore/internal/value-codec.ts +150 -83
- package/src/firestore/internal/value-depth.ts +19 -0
- package/src/firestore/listeners.ts +60 -18
- package/src/firestore/persistence.ts +14 -9
- package/src/firestore/plain-object.ts +7 -0
- package/src/firestore/query-constraints.ts +4 -8
- package/src/firestore/reads.ts +81 -48
- package/src/firestore/refs.ts +56 -41
- package/src/firestore/sandbox/activity-query-display.ts +138 -0
- package/src/firestore/sandbox/admin-compat/batch.ts +26 -19
- package/src/firestore/sandbox/admin-compat/query-comparison.ts +9 -8
- package/src/firestore/sandbox/admin-compat/query.ts +46 -12
- package/src/firestore/sandbox/admin-compat/read-translation.ts +18 -6
- package/src/firestore/sandbox/admin-compat/transaction.ts +14 -4
- package/src/firestore/sandbox/admin-compat/types.ts +6 -88
- package/src/firestore/sandbox/atomic-state.ts +112 -0
- package/src/firestore/sandbox/atomic-write-pipeline.ts +129 -77
- package/src/firestore/sandbox/batch-write-executor.ts +51 -29
- package/src/firestore/sandbox/converters/user-timestamp.ts +19 -42
- package/src/firestore/sandbox/document-copy.ts +27 -0
- package/src/firestore/sandbox/document-store.ts +108 -0
- package/src/firestore/sandbox/errors.ts +5 -1
- package/src/firestore/sandbox/event-log.ts +72 -7
- package/src/firestore/sandbox/field-merge.ts +10 -19
- package/src/firestore/sandbox/history-controls.ts +1 -1
- package/src/firestore/sandbox/list-query-proof.ts +43 -72
- package/src/firestore/sandbox/listener-dispatch.ts +59 -4
- package/src/firestore/sandbox/local-environment.ts +35 -7
- package/src/firestore/sandbox/local-state.ts +72 -232
- package/src/firestore/sandbox/query-execution.ts +56 -34
- package/src/firestore/sandbox/query-operand-equality.ts +57 -14
- package/src/firestore/sandbox/query-operators.ts +20 -0
- package/src/firestore/sandbox/query-value-registry.ts +3 -2
- package/src/firestore/sandbox/request-events.ts +5 -0
- package/src/firestore/sandbox/rules-evidence.ts +94 -0
- package/src/firestore/sandbox/rules-list-authorizer.ts +62 -107
- package/src/firestore/sandbox/rules-operation-reader.ts +11 -4
- package/src/firestore/sandbox/rules-read-engine.ts +19 -8
- package/src/firestore/sandbox/rules-state.ts +21 -0
- package/src/firestore/sandbox/snapshot-listeners.ts +12 -1
- package/src/firestore/sandbox/transaction-merge.ts +33 -20
- package/src/firestore/sandbox/transaction-types.ts +11 -21
- package/src/firestore/sandbox/transaction-write-executor.ts +103 -69
- package/src/firestore/sandbox/transaction.ts +24 -7
- package/src/firestore/sandbox/value-resolver.ts +2 -13
- package/src/firestore/sandbox/write-engine.ts +13 -5
- package/src/firestore/sandbox/write-runtime.ts +68 -40
- package/src/firestore/sandbox/writes.ts +3 -1
- package/src/firestore/sdk-activity.ts +31 -0
- package/src/firestore/snapshots.ts +84 -18
- package/src/firestore/state.ts +34 -14
- package/src/firestore/timestamp.ts +86 -0
- package/src/firestore/tools.ts +3 -3
- package/src/firestore/transactions.ts +88 -8
- package/src/firestore/types.ts +26 -5
- package/src/firestore/vector-value.ts +54 -0
- package/src/firestore/writes.ts +53 -43
- package/src/functions/events.ts +27 -0
- package/src/messaging/broker/broker.test.ts +114 -0
- package/src/messaging/broker/broker.ts +152 -65
- package/src/messaging/broker/delivery-history.ts +49 -0
- package/src/messaging/broker/index.ts +11 -0
- package/src/messaging/broker/persistence.ts +54 -0
- package/src/messaging/broker/types.ts +50 -0
- package/src/messaging/events.ts +29 -0
- package/src/rules/api/case-types.ts +7 -0
- package/src/rules/api/rtdb.ts +15 -7
- package/src/rules/grammar/parse-error-wording.ts +98 -0
- package/src/rules/indexes/query-analysis.ts +136 -0
- package/src/rules/indexes/service-query.ts +69 -0
- package/src/rules/internal/index.ts +16 -0
- package/src/rules/modules/rules-capabilities.generated.ts +1 -1
- package/src/rules/rtdb/constraints/atoms.spec.ts +7 -7
- package/src/rules/rtdb/constraints/atoms.ts +7 -7
- package/src/rules/rtdb/constraints/data.ts +4 -4
- package/src/rules/rtdb/constraints/document.ts +4 -2
- package/src/rules/rtdb/constraints/game.spec.ts +4 -4
- package/src/rules/rtdb/constraints/policies.spec.ts +5 -5
- package/src/rules/rtdb/constraints/policies.ts +4 -4
- package/src/rules/rtdb/constraints/schema.ts +3 -3
- package/src/rules/rtdb/grammar/RtdbExpr.ohm +1 -3
- package/src/rules/rtdb/grammar/RtdbExpr.ohm.generated.ts +1 -3
- package/src/rules/rtdb/grammar/linter.ts +34 -30
- package/src/rules/rtdb/grammar/simulator.ts +112 -74
- package/src/rules/rtdb/grammar/validator.ts +30 -26
- package/src/rules/rtdb/simulation/handler.ts +139 -36
- package/src/rules/rtdb/simulation/spec.ts +24 -1
- package/src/rules/simulator/evaluator.ts +34 -41
- package/src/rules/simulator/handler.ts +12 -3
- package/src/rules/simulator/mapdiff.ts +7 -5
- package/src/rules/simulator/query-proof-residual.ts +209 -0
- package/src/rules/simulator/query-proof.ts +53 -27
- package/src/rules/simulator/request-path.ts +39 -0
- package/src/rules/simulator/trace-recorder.ts +3 -0
- package/src/rules/simulator/wrappers/timestamp.ts +8 -1
- package/src/rules/simulator-tools-impl.ts +6 -3
- package/src/rules/stdlib-tools.ts +4 -4
- package/src/sandbox/active-listeners.ts +245 -0
- package/src/sandbox/admin-firestore/error-translation.ts +16 -2
- package/src/sandbox/admin-firestore/listeners.ts +26 -1
- package/src/sandbox/admin-firestore/remote/listeners.ts +50 -32
- package/src/sandbox/admin-firestore/remote/value-codec.ts +7 -14
- package/src/sandbox/admin-firestore/remote/wire-types.ts +3 -0
- package/src/sandbox/attribution/attribution-mode.ts +74 -0
- package/src/sandbox/attribution/effect-regions.ts +130 -0
- package/src/sandbox/attribution/element-selector.ts +118 -0
- package/src/sandbox/attribution/listener-owners.ts +277 -0
- package/src/sandbox/branches/engine.ts +362 -0
- package/src/sandbox/branches/index.ts +12 -448
- package/src/sandbox/branches/promotion.ts +207 -0
- package/src/sandbox/branches/state-diff.ts +333 -0
- package/src/sandbox/branches/store.ts +317 -0
- package/src/sandbox/checkpoints/capture.ts +77 -0
- package/src/sandbox/checkpoints/directory-backend.ts +110 -0
- package/src/sandbox/checkpoints/index.ts +32 -0
- package/src/sandbox/checkpoints/record-backend.ts +109 -0
- package/src/sandbox/checkpoints/saved-states.ts +72 -0
- package/src/sandbox/checkpoints/types.ts +115 -0
- package/src/sandbox/checkpoints/validation.ts +102 -0
- package/src/sandbox/clock.ts +205 -0
- package/src/sandbox/full-state.ts +403 -0
- package/src/sandbox/index.ts +53 -10
- package/src/sandbox/internal/ai-evidence.ts +38 -0
- package/src/sandbox/internal/event-history.ts +193 -0
- package/src/sandbox/internal/history-integrity.ts +12 -0
- package/src/sandbox/internal/history-retention.ts +16 -0
- package/src/sandbox/internal/index.ts +65 -0
- package/src/sandbox/internal/observation-history.ts +5 -0
- package/src/sandbox/internal/observation-payload.ts +18 -0
- package/src/sandbox/internal/provenance.ts +5 -0
- package/src/sandbox/internal/root.ts +3 -2
- package/src/sandbox/internal/rules-evidence-retention.ts +28 -0
- package/src/sandbox/internal/sandbox-impl.ts +91 -45
- package/src/sandbox/internal/sdk-activity.ts +291 -0
- package/src/sandbox/internal/sdk-coverage.ts +28 -0
- package/src/sandbox/internal/sdk-observation.ts +62 -0
- package/src/sandbox/internal/sdk-rates.ts +240 -0
- package/src/sandbox/internal/sdk-write-activity.ts +14 -0
- package/src/sandbox/internal/state-schemas.ts +47 -0
- package/src/sandbox/internal/state-values.ts +20 -0
- package/src/sandbox/internal/storage-activity.ts +43 -0
- package/src/sandbox/internal/usage-evidence.ts +77 -0
- package/src/sandbox/operation-record.ts +107 -4
- package/src/sandbox/persistence/changed-buckets.ts +61 -0
- package/src/sandbox/persistence/chunk-format.ts +39 -27
- package/src/sandbox/persistence/controller.ts +85 -33
- package/src/sandbox/persistence/import-bundle.ts +64 -0
- package/src/sandbox/persistence/serialize.ts +16 -10
- package/src/sandbox/persistence/types.ts +4 -0
- package/src/sandbox/persistence/validate-services.ts +70 -0
- package/src/sandbox/remote.ts +7 -0
- package/src/sandbox/replay/index.ts +15 -8
- package/src/sandbox/types/errors.ts +3 -1
- package/src/sandbox/types/events.ts +118 -75
- package/src/sandbox/types/index.ts +12 -0
- package/src/sandbox/types/operation.ts +14 -4
- package/src/sandbox/types/persistence.ts +2 -2
- package/src/sandbox/types/query-proof.ts +26 -0
- package/src/sandbox/types/request-observation.ts +25 -0
- package/src/sandbox/types/rules-evidence.ts +37 -0
- package/src/sandbox/types/service-event-record.ts +34 -0
- package/src/sandbox/types/service-event-records.ts +42 -0
- package/src/sandbox/types/service-mutation-event.ts +93 -0
- package/src/storage/activity-coverage.ts +8 -0
- package/src/storage/base64.ts +35 -0
- package/src/storage/download.ts +19 -6
- package/src/storage/enforce.ts +26 -4
- package/src/storage/errors.ts +29 -14
- package/src/storage/events.ts +21 -0
- package/src/storage/index.ts +7 -7
- package/src/storage/internal.ts +21 -0
- package/src/storage/metadata.ts +68 -19
- package/src/storage/observed.ts +16 -0
- package/src/storage/persistence.ts +574 -66
- package/src/storage/reference.ts +6 -3
- package/src/storage/remote-bytes.ts +122 -0
- package/src/storage/resumable.ts +16 -3
- package/src/storage/rules-resolution.ts +43 -1
- package/src/storage/sandbox/persistence-state.ts +71 -0
- package/src/storage/sandbox/rules-bindings.ts +69 -0
- package/src/storage/sandbox/rules-collection-methods.ts +161 -0
- package/src/storage/sandbox/rules-evaluator.ts +65 -142
- package/src/storage/sandbox/rules-firestore-lookup.ts +112 -0
- package/src/storage/sandbox/rules-hashing-methods.ts +50 -0
- package/src/storage/sandbox/rules-method-calls.ts +67 -0
- package/src/storage/sandbox/rules-methods.ts +63 -404
- package/src/storage/sandbox/rules-operators.ts +93 -0
- package/src/storage/sandbox/rules-string-methods.ts +214 -0
- package/src/storage/sandbox/rules-time-methods.ts +98 -0
- package/src/storage/sandbox/rules-values.ts +20 -1
- package/src/storage/sandbox/rules.ts +27 -14
- package/src/storage/sandbox/running-service.ts +52 -0
- package/src/storage/service.ts +196 -85
- package/src/storage/string-format.ts +8 -0
- package/src/storage/upload.ts +8 -3
- package/src/storage/url.ts +106 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { EvalCtx } from './rules-evaluator.js';
|
|
2
|
+
import { type MethodCall, type ReceiverMethods } from './rules-method-calls.js';
|
|
3
|
+
/**
|
|
4
|
+
* `hashing.md5(value)`, `hashing.sha256(value)`, `hashing.crc32(value)`, and
|
|
5
|
+
* `hashing.crc32c(value)` over a string (hashed as its UTF-8 bytes) or Bytes,
|
|
6
|
+
* returning Bytes. Another argument type is production's "Unsupported
|
|
7
|
+
* operation error", captured for `hashing.md5(int)`.
|
|
8
|
+
*/
|
|
9
|
+
export declare function evalHashingNamespace(expr: MethodCall, ctx: EvalCtx): unknown;
|
|
10
|
+
/**
|
|
11
|
+
* The Bytes encodings, answered by the value itself: `toBase64()` is padded
|
|
12
|
+
* base64url and `toHexString()` is uppercase hexadecimal. `size()` lives with
|
|
13
|
+
* the other sized types.
|
|
14
|
+
*/
|
|
15
|
+
export declare const bytesMethods: ReceiverMethods;
|
|
16
|
+
//# sourceMappingURL=rules-hashing-methods.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rules-hashing-methods.d.ts","sourceRoot":"","sources":["../../../src/storage/sandbox/rules-hashing-methods.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAEpD,OAAO,EAGL,KAAK,UAAU,EACf,KAAK,eAAe,EACrB,MAAM,yBAAyB,CAAC;AAMjC;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,OAAO,GAAG,OAAO,CAkB5E;AAED;;;;GAIG;AACH,eAAO,MAAM,YAAY,EAAE,eAG1B,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { evaluateHashingMethod } from '../../rules/simulator/hashing-builtins.js';
|
|
2
|
+
import { Bytes } from '../../rules/simulator/wrappers/bytes.js';
|
|
3
|
+
import { RuleEvalError, RuleUnsupportedError } from './rules-evaluation-error.js';
|
|
4
|
+
import { evalArguments, evalValueMethod, } from './rules-method-calls.js';
|
|
5
|
+
import { describeRulesType as describeType, isRuleError as isErr } from './rules-values.js';
|
|
6
|
+
/** The digests the `hashing` namespace defines. */
|
|
7
|
+
const HASHING_FUNCTIONS = new Set(['crc32', 'crc32c', 'md5', 'sha256']);
|
|
8
|
+
/**
|
|
9
|
+
* `hashing.md5(value)`, `hashing.sha256(value)`, `hashing.crc32(value)`, and
|
|
10
|
+
* `hashing.crc32c(value)` over a string (hashed as its UTF-8 bytes) or Bytes,
|
|
11
|
+
* returning Bytes. Another argument type is production's "Unsupported
|
|
12
|
+
* operation error", captured for `hashing.md5(int)`.
|
|
13
|
+
*/
|
|
14
|
+
export function evalHashingNamespace(expr, ctx) {
|
|
15
|
+
if (!HASHING_FUNCTIONS.has(expr.method)) {
|
|
16
|
+
// A name outside the namespace is a compile-reject class: never absorbed.
|
|
17
|
+
throw new RuleUnsupportedError(`unsupported method hashing.${expr.method}()`);
|
|
18
|
+
}
|
|
19
|
+
const args = evalArguments(expr, ctx);
|
|
20
|
+
if (isErr(args))
|
|
21
|
+
return args;
|
|
22
|
+
if (args.length !== 1) {
|
|
23
|
+
throw new RuleEvalError(`hashing.${expr.method}() expects a single string or bytes argument`);
|
|
24
|
+
}
|
|
25
|
+
const [input] = args;
|
|
26
|
+
if (typeof input !== 'string' && !(input instanceof Bytes)) {
|
|
27
|
+
throw new RuleEvalError(`Unsupported operation error. Received: hashing.${expr.method}(${describeType(input)}). `
|
|
28
|
+
+ `Expected: hashing.${expr.method}(bytes), hashing.${expr.method}(string).`);
|
|
29
|
+
}
|
|
30
|
+
return evaluateHashingMethod(expr.method, [input]);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The Bytes encodings, answered by the value itself: `toBase64()` is padded
|
|
34
|
+
* base64url and `toHexString()` is uppercase hexadecimal. `size()` lives with
|
|
35
|
+
* the other sized types.
|
|
36
|
+
*/
|
|
37
|
+
export const bytesMethods = {
|
|
38
|
+
toBase64: evalValueMethod,
|
|
39
|
+
toHexString: evalValueMethod,
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=rules-hashing-methods.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rules-hashing-methods.js","sourceRoot":"","sources":["../../../src/storage/sandbox/rules-hashing-methods.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,2CAA2C,CAAC;AAClF,OAAO,EAAE,KAAK,EAAE,MAAM,yCAAyC,CAAC;AAEhE,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAClF,OAAO,EACL,aAAa,EACb,eAAe,GAGhB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,iBAAiB,IAAI,YAAY,EAAE,WAAW,IAAI,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE5F,mDAAmD;AACnD,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC;AAExE;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAgB,EAAE,GAAY;IACjE,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;QACxC,0EAA0E;QAC1E,MAAM,IAAI,oBAAoB,CAAC,8BAA8B,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC;IAChF,CAAC;IACD,MAAM,IAAI,GAAG,aAAa,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IACtC,IAAI,KAAK,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IAC7B,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtB,MAAM,IAAI,aAAa,CAAC,WAAW,IAAI,CAAC,MAAM,8CAA8C,CAAC,CAAC;IAChG,CAAC;IACD,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;IACrB,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,CAAC,KAAK,YAAY,KAAK,CAAC,EAAE,CAAC;QAC3D,MAAM,IAAI,aAAa,CACrB,kDAAkD,IAAI,CAAC,MAAM,IAAI,YAAY,CAAC,KAAK,CAAC,KAAK;cACrF,qBAAqB,IAAI,CAAC,MAAM,oBAAoB,IAAI,CAAC,MAAM,WAAW,CAC/E,CAAC;IACJ,CAAC;IACD,OAAO,qBAAqB,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;AACrD,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,YAAY,GAAoB;IAC3C,QAAQ,EAAE,eAAe;IACzB,WAAW,EAAE,eAAe;CAC7B,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { Expr } from './rules.js';
|
|
2
|
+
import { type EvalCtx } from './rules-evaluator.js';
|
|
3
|
+
import { RuleEvalError } from './rules-evaluation-error.js';
|
|
4
|
+
import { type RuleError } from './rules-values.js';
|
|
5
|
+
export type MethodCall = Extract<Expr, {
|
|
6
|
+
kind: 'methodcall';
|
|
7
|
+
}>;
|
|
8
|
+
/**
|
|
9
|
+
* Evaluates `<receiver>.<method>(args)` for one method name. The dispatcher
|
|
10
|
+
* evaluates the receiver first and passes its value; an error receiver never
|
|
11
|
+
* reaches a method.
|
|
12
|
+
*/
|
|
13
|
+
export type ReceiverMethod = (receiver: unknown, expr: MethodCall, ctx: EvalCtx) => unknown;
|
|
14
|
+
/** Method name to evaluator, one record per concern file. */
|
|
15
|
+
export type ReceiverMethods = Readonly<Record<string, ReceiverMethod>>;
|
|
16
|
+
/**
|
|
17
|
+
* Evaluates `<namespace>.<method>(args)` for a builtin namespace such as
|
|
18
|
+
* `timestamp` or `hashing`.
|
|
19
|
+
*/
|
|
20
|
+
export type NamespaceMethod = (expr: MethodCall, ctx: EvalCtx) => unknown;
|
|
21
|
+
/**
|
|
22
|
+
* Production's error for a method its receiver type does not define, such as
|
|
23
|
+
* `resource.size.hours()`. It is an evaluation error, so a determining
|
|
24
|
+
* `&&`/`||` operand absorbs it (rules-storage-stdlib-timestamp-duration
|
|
25
|
+
* captures `resource.size.year() == 1970 || true` allowing).
|
|
26
|
+
*/
|
|
27
|
+
export declare function functionNotFound(method: string): RuleEvalError;
|
|
28
|
+
/** Deny a call that passes arguments to a method that takes none. */
|
|
29
|
+
export declare function expectNoArguments(expr: MethodCall): void;
|
|
30
|
+
/** Evaluate every argument in order; the first error value wins. */
|
|
31
|
+
export declare function evalArguments(expr: MethodCall, ctx: EvalCtx): unknown[] | RuleError;
|
|
32
|
+
/**
|
|
33
|
+
* A no-argument method a Timestamp, Duration, or Bytes value answers for
|
|
34
|
+
* itself through `callMethod`: the timestamp accessors, `seconds()` and
|
|
35
|
+
* `nanos()` on a duration, and the Bytes encodings. Any other receiver, or a
|
|
36
|
+
* value that does not define the method, is production's function-not-found
|
|
37
|
+
* error.
|
|
38
|
+
*/
|
|
39
|
+
export declare function evalValueMethod(receiver: unknown, expr: MethodCall): unknown;
|
|
40
|
+
//# sourceMappingURL=rules-method-calls.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rules-method-calls.d.ts","sourceRoot":"","sources":["../../../src/storage/sandbox/rules-method-calls.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAY,KAAK,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAwB,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEzE,MAAM,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,EAAE;IAAE,IAAI,EAAE,YAAY,CAAA;CAAE,CAAC,CAAC;AAE/D;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,OAAO,KAAK,OAAO,CAAC;AAE5F,6DAA6D;AAC7D,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC;AAEvE;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,OAAO,KAAK,OAAO,CAAC;AAE1E;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,CAE9D;AAED,qEAAqE;AACrE,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,CAIxD;AAED,oEAAoE;AACpE,wBAAgB,aAAa,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,OAAO,GAAG,OAAO,EAAE,GAAG,SAAS,CAQnF;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAO5E"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { NO_OP, RulesValue } from '../../rules/simulator/wrappers/base.js';
|
|
2
|
+
import { evalExpr } from './rules-evaluator.js';
|
|
3
|
+
import { RuleEvalError } from './rules-evaluation-error.js';
|
|
4
|
+
import { isRuleError as isErr } from './rules-values.js';
|
|
5
|
+
/**
|
|
6
|
+
* Production's error for a method its receiver type does not define, such as
|
|
7
|
+
* `resource.size.hours()`. It is an evaluation error, so a determining
|
|
8
|
+
* `&&`/`||` operand absorbs it (rules-storage-stdlib-timestamp-duration
|
|
9
|
+
* captures `resource.size.year() == 1970 || true` allowing).
|
|
10
|
+
*/
|
|
11
|
+
export function functionNotFound(method) {
|
|
12
|
+
return new RuleEvalError(`Function not found error: Name: [${method}].`);
|
|
13
|
+
}
|
|
14
|
+
/** Deny a call that passes arguments to a method that takes none. */
|
|
15
|
+
export function expectNoArguments(expr) {
|
|
16
|
+
if (expr.args.length !== 0) {
|
|
17
|
+
throw new RuleEvalError(`${expr.method}() expects no arguments`);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
/** Evaluate every argument in order; the first error value wins. */
|
|
21
|
+
export function evalArguments(expr, ctx) {
|
|
22
|
+
const values = [];
|
|
23
|
+
for (const arg of expr.args) {
|
|
24
|
+
const value = evalExpr(arg, ctx);
|
|
25
|
+
if (isErr(value))
|
|
26
|
+
return value;
|
|
27
|
+
values.push(value);
|
|
28
|
+
}
|
|
29
|
+
return values;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* A no-argument method a Timestamp, Duration, or Bytes value answers for
|
|
33
|
+
* itself through `callMethod`: the timestamp accessors, `seconds()` and
|
|
34
|
+
* `nanos()` on a duration, and the Bytes encodings. Any other receiver, or a
|
|
35
|
+
* value that does not define the method, is production's function-not-found
|
|
36
|
+
* error.
|
|
37
|
+
*/
|
|
38
|
+
export function evalValueMethod(receiver, expr) {
|
|
39
|
+
expectNoArguments(expr);
|
|
40
|
+
if (receiver instanceof RulesValue) {
|
|
41
|
+
const result = receiver.callMethod(expr.method, []);
|
|
42
|
+
if (result !== NO_OP)
|
|
43
|
+
return result;
|
|
44
|
+
}
|
|
45
|
+
throw functionNotFound(expr.method);
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=rules-method-calls.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rules-method-calls.js","sourceRoot":"","sources":["../../../src/storage/sandbox/rules-method-calls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAE3E,OAAO,EAAE,QAAQ,EAAgB,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,WAAW,IAAI,KAAK,EAAkB,MAAM,mBAAmB,CAAC;AAoBzE;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAc;IAC7C,OAAO,IAAI,aAAa,CAAC,oCAAoC,MAAM,IAAI,CAAC,CAAC;AAC3E,CAAC;AAED,qEAAqE;AACrE,MAAM,UAAU,iBAAiB,CAAC,IAAgB;IAChD,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC3B,MAAM,IAAI,aAAa,CAAC,GAAG,IAAI,CAAC,MAAM,yBAAyB,CAAC,CAAC;IACnE,CAAC;AACH,CAAC;AAED,oEAAoE;AACpE,MAAM,UAAU,aAAa,CAAC,IAAgB,EAAE,GAAY;IAC1D,MAAM,MAAM,GAAc,EAAE,CAAC;IAC7B,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;QAC5B,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QACjC,IAAI,KAAK,CAAC,KAAK,CAAC;YAAE,OAAO,KAAK,CAAC;QAC/B,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACrB,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAAC,QAAiB,EAAE,IAAgB;IACjE,iBAAiB,CAAC,IAAI,CAAC,CAAC;IACxB,IAAI,QAAQ,YAAY,UAAU,EAAE,CAAC;QACnC,MAAM,MAAM,GAAG,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QACpD,IAAI,MAAM,KAAK,KAAK;YAAE,OAAO,MAAM,CAAC;IACtC,CAAC;IACD,MAAM,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACtC,CAAC"}
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import type { Expr } from './rules.js';
|
|
2
1
|
import { type EvalCtx } from './rules-evaluator.js';
|
|
2
|
+
import type { MethodCall } from './rules-method-calls.js';
|
|
3
3
|
/**
|
|
4
|
-
* Evaluate a `<target>.<method>(args)` call.
|
|
5
|
-
* supported; everything else denies (throws `RuleEvalError`), so unknown
|
|
6
|
-
* builtins — including deliberately-out-of-scope `firestore.get`/`exists` —
|
|
7
|
-
* deny with a reason rather than ever a false allow.
|
|
4
|
+
* Evaluate a `<target>.<method>(args)` call.
|
|
8
5
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
6
|
+
* A bare `timestamp`, `duration`, `hashing`, or `firestore` identifier that
|
|
7
|
+
* no local or path parameter shadows is a builtin namespace. Otherwise the
|
|
8
|
+
* target is a receiver: it evaluates first, an error receiver propagates,
|
|
9
|
+
* and the method's evaluator checks the receiver type. A modeled method on
|
|
10
|
+
* a receiver that lacks it is production's function-not-found error, which
|
|
11
|
+
* `&&`/`||` may absorb. An unmodeled method name is either unmodeled here or
|
|
12
|
+
* rejected by production's compiler; its verdict is unknowable locally, so
|
|
13
|
+
* it is unabsorbable and fails closed even under a determining operand.
|
|
13
14
|
*/
|
|
14
|
-
export declare function evalMethodCall(expr:
|
|
15
|
-
kind: 'methodcall';
|
|
16
|
-
}>, ctx: EvalCtx): unknown;
|
|
15
|
+
export declare function evalMethodCall(expr: MethodCall, ctx: EvalCtx): unknown;
|
|
17
16
|
//# sourceMappingURL=rules-methods.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rules-methods.d.ts","sourceRoot":"","sources":["../../../src/storage/sandbox/rules-methods.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"rules-methods.d.ts","sourceRoot":"","sources":["../../../src/storage/sandbox/rules-methods.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAK9D,OAAO,KAAK,EAAE,UAAU,EAAoD,MAAM,yBAAyB,CAAC;AAqB5G;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,OAAO,GAAG,OAAO,CActE"}
|
|
@@ -1,370 +1,73 @@
|
|
|
1
1
|
import { evalExpr } from './rules-evaluator.js';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
import { RuleUnsupportedError } from './rules-evaluation-error.js';
|
|
3
|
+
import { collectionMethods } from './rules-collection-methods.js';
|
|
4
|
+
import { evalFirestoreBuiltin } from './rules-firestore-lookup.js';
|
|
5
|
+
import { bytesMethods, evalHashingNamespace } from './rules-hashing-methods.js';
|
|
6
|
+
import { stringMethods } from './rules-string-methods.js';
|
|
7
|
+
import { evalDurationNamespace, evalTimestampNamespace, timeMethods } from './rules-time-methods.js';
|
|
8
|
+
import { isRuleError as isErr } from './rules-values.js';
|
|
9
|
+
/** The builtin namespaces, keyed by the bare identifier a call names. */
|
|
10
|
+
const NAMESPACES = new Map([
|
|
11
|
+
['duration', evalDurationNamespace],
|
|
12
|
+
['firestore', evalFirestoreBuiltin],
|
|
13
|
+
['hashing', evalHashingNamespace],
|
|
14
|
+
['timestamp', evalTimestampNamespace],
|
|
15
|
+
]);
|
|
16
|
+
/** Every receiver method the evaluator models, one record per concern. */
|
|
17
|
+
const RECEIVER_METHODS = mergeReceiverMethods([
|
|
18
|
+
bytesMethods,
|
|
19
|
+
collectionMethods,
|
|
20
|
+
stringMethods,
|
|
21
|
+
timeMethods,
|
|
22
|
+
]);
|
|
7
23
|
/**
|
|
8
|
-
* Evaluate a `<target>.<method>(args)` call.
|
|
9
|
-
* supported; everything else denies (throws `RuleEvalError`), so unknown
|
|
10
|
-
* builtins — including deliberately-out-of-scope `firestore.get`/`exists` —
|
|
11
|
-
* deny with a reason rather than ever a false allow.
|
|
24
|
+
* Evaluate a `<target>.<method>(args)` call.
|
|
12
25
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
26
|
+
* A bare `timestamp`, `duration`, `hashing`, or `firestore` identifier that
|
|
27
|
+
* no local or path parameter shadows is a builtin namespace. Otherwise the
|
|
28
|
+
* target is a receiver: it evaluates first, an error receiver propagates,
|
|
29
|
+
* and the method's evaluator checks the receiver type. A modeled method on
|
|
30
|
+
* a receiver that lacks it is production's function-not-found error, which
|
|
31
|
+
* `&&`/`||` may absorb. An unmodeled method name is either unmodeled here or
|
|
32
|
+
* rejected by production's compiler; its verdict is unknowable locally, so
|
|
33
|
+
* it is unabsorbable and fails closed even under a determining operand.
|
|
17
34
|
*/
|
|
18
35
|
export function evalMethodCall(expr, ctx) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
//
|
|
29
|
-
//
|
|
30
|
-
if (
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
!(expr.target.name in ctx.params)) {
|
|
34
|
-
return evalDurationBuiltin(expr, ctx);
|
|
35
|
-
}
|
|
36
|
-
// Firestore namespace: `firestore.get(path)` / `firestore.exists(path)`.
|
|
37
|
-
// Detected on the bare `firestore` identifier (not a bound local/param) so
|
|
38
|
-
// a user value named `firestore` can't hijack it.
|
|
39
|
-
if (expr.target.kind === 'ident' &&
|
|
40
|
-
expr.target.name === 'firestore' &&
|
|
41
|
-
!(expr.target.name in ctx.locals) &&
|
|
42
|
-
!(expr.target.name in ctx.params)) {
|
|
43
|
-
return evalFirestoreBuiltin(expr, ctx);
|
|
44
|
-
}
|
|
45
|
-
if (expr.method === 'matches') {
|
|
46
|
-
return evalMatches(expr, ctx);
|
|
47
|
-
}
|
|
48
|
-
if (expr.method === 'split') {
|
|
49
|
-
return evalSplit(expr, ctx);
|
|
50
|
-
}
|
|
51
|
-
if (expr.method === 'size') {
|
|
52
|
-
return evalSize(expr, ctx);
|
|
53
|
-
}
|
|
54
|
-
if (expr.method === 'keys') {
|
|
55
|
-
return evalMapKeys(expr, ctx);
|
|
56
|
-
}
|
|
57
|
-
if (expr.method === 'hasAll') {
|
|
58
|
-
return evalHasAll(expr, ctx);
|
|
59
|
-
}
|
|
60
|
-
if (expr.method === 'get') {
|
|
61
|
-
return evalMapGet(expr, ctx);
|
|
62
|
-
}
|
|
63
|
-
// An unknown method name is either unmodeled here or rejected by
|
|
64
|
-
// production's compiler. Its verdict is unknowable locally, so it is
|
|
65
|
-
// unabsorbable (fails closed even under a determining &&/|| operand).
|
|
66
|
-
throw new RuleUnsupportedError(`unsupported method .${expr.method}()`);
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Evaluate `firestore.get(path)` / `firestore.exists(path)`.
|
|
70
|
-
*
|
|
71
|
-
* Requires an injected {@link FirestoreLookup} (the enforcement layer
|
|
72
|
-
* supplies one from the sandbox's Firestore data). With NO capability —
|
|
73
|
-
* pure/test usage without a sandbox — this denies with an "unsupported"
|
|
74
|
-
* reason rather than ever a false allow, preserving the pre-lookup posture.
|
|
75
|
-
*
|
|
76
|
-
* Semantics (production-honest, deny-on-error):
|
|
77
|
-
* - `firestore.get(path)` → a resource `{ data: <fields> }`. Member access
|
|
78
|
-
* `.data.<field>` then reads the doc's fields. On a NONEXISTENT doc,
|
|
79
|
-
* production `get()` is itself an error, so this denies with a reason.
|
|
80
|
-
* - `firestore.exists(path)` → boolean.
|
|
81
|
-
* - Malformed path (missing `/databases/<db>/documents/` prefix, odd
|
|
82
|
-
* segment count), a non-string interpolation, wrong arg count, or a
|
|
83
|
-
* non-path argument → deny with a reason.
|
|
84
|
-
*/
|
|
85
|
-
function evalFirestoreBuiltin(expr, ctx) {
|
|
86
|
-
if (expr.method !== 'get' && expr.method !== 'exists') {
|
|
87
|
-
// Unknown namespace method, compile-reject class, never absorbed.
|
|
88
|
-
throw new RuleUnsupportedError(`unsupported method firestore.${expr.method}()`);
|
|
89
|
-
}
|
|
90
|
-
if (!ctx.firestoreLookup) {
|
|
91
|
-
// No sandbox-backed capability injected — keep the deny-with-reason
|
|
92
|
-
// "unsupported" behavior; never a false allow.
|
|
93
|
-
throw new RuleEvalError(`firestore.${expr.method}() is unsupported here — no Firestore lookup capability is configured`);
|
|
94
|
-
}
|
|
95
|
-
if (expr.args.length !== 1) {
|
|
96
|
-
// Wrong call shape: production rejects at compile; never absorbed.
|
|
97
|
-
throw new RuleUnsupportedError(`firestore.${expr.method}() expects a single path argument`);
|
|
98
|
-
}
|
|
99
|
-
const arg = expr.args[0];
|
|
100
|
-
if (arg.kind !== 'path') {
|
|
101
|
-
throw new RuleUnsupportedError(`firestore.${expr.method}() requires a /databases/.../documents/... path literal`);
|
|
102
|
-
}
|
|
103
|
-
const docPath = buildFirestoreDocPath(arg, ctx);
|
|
104
|
-
if (!ctx.firestoreAccesses.has(docPath)) {
|
|
105
|
-
if (ctx.firestoreAccesses.size >= 2) {
|
|
106
|
-
// Resource-limit class, the same posture as the Firestore lookup
|
|
107
|
-
// budget: production fails the whole evaluation closed, so a
|
|
108
|
-
// determining &&/|| operand must NOT absorb this into an allow.
|
|
109
|
-
throw new RuleResourceLimitError('firestore access limit exceeded: at most two distinct documents');
|
|
110
|
-
}
|
|
111
|
-
ctx.firestoreAccesses.add(docPath);
|
|
112
|
-
}
|
|
113
|
-
if (expr.method === 'exists') {
|
|
114
|
-
return ctx.firestoreLookup.exists(docPath);
|
|
115
|
-
}
|
|
116
|
-
const fields = ctx.firestoreLookup.get(docPath);
|
|
117
|
-
if (fields === null) {
|
|
118
|
-
// A missing get is a Rules error VALUE: it denies at the allow boundary,
|
|
119
|
-
// but participates in COMMUTATIVE CEL error absorption in `&&`/`||`
|
|
120
|
-
// (`error || true` allows, and `error && false` evaluates to false,
|
|
121
|
-
// see the tri-state operand handling in rules-evaluator.ts).
|
|
122
|
-
return new RuleError(`firestore.get() targeted a nonexistent document: ${docPath}`);
|
|
123
|
-
}
|
|
124
|
-
return { data: fields };
|
|
125
|
-
}
|
|
126
|
-
/**
|
|
127
|
-
* Assemble a {@link PathArgSegment} list into the document path the
|
|
128
|
-
* {@link FirestoreLookup} expects, then validate + strip the required
|
|
129
|
-
* `/databases/<db>/documents/` prefix. Interpolations must resolve to a
|
|
130
|
-
* string or number; anything else (e.g. `request.auth.uid` when auth is
|
|
131
|
-
* null → undefined) throws → deny.
|
|
132
|
-
*/
|
|
133
|
-
function buildFirestoreDocPath(pathExpr, ctx) {
|
|
134
|
-
const parts = pathExpr.segments.map((seg) => {
|
|
135
|
-
if (seg.kind === 'literal')
|
|
136
|
-
return seg.value;
|
|
137
|
-
const v = evalExpr(seg.expr, ctx);
|
|
138
|
-
if (typeof v === 'string')
|
|
139
|
-
return v;
|
|
140
|
-
if (typeof v === 'number')
|
|
141
|
-
return String(v);
|
|
142
|
-
throw new RuleEvalError(`Firestore path interpolation resolved to ${describeType(v)} (expected a string)`);
|
|
143
|
-
});
|
|
144
|
-
// Required production shape: databases / <db> / documents / <doc path…>.
|
|
145
|
-
if (parts.length < 4 || parts[0] !== 'databases' || parts[2] !== 'documents') {
|
|
146
|
-
throw new RuleEvalError(`malformed Firestore path — expected /databases/<db>/documents/... , got /${parts.join('/')}`);
|
|
147
|
-
}
|
|
148
|
-
if (parts[1] !== '(default)') {
|
|
149
|
-
throw new RuleEvalError(`Storage rules may access only the default Firestore database, got ${parts[1]}`);
|
|
150
|
-
}
|
|
151
|
-
const docSegments = parts.slice(3);
|
|
152
|
-
// A document path is collection/doc pairs — an even, non-zero segment count.
|
|
153
|
-
if (docSegments.length === 0 || docSegments.length % 2 !== 0) {
|
|
154
|
-
throw new RuleEvalError(`Firestore path does not point at a document (needs an even segment count): ${docSegments.join('/')}`);
|
|
155
|
-
}
|
|
156
|
-
return docSegments.join('/');
|
|
36
|
+
const namespace = builtinNamespace(expr, ctx);
|
|
37
|
+
if (namespace !== undefined)
|
|
38
|
+
return namespace(expr, ctx);
|
|
39
|
+
const method = RECEIVER_METHODS.get(expr.method);
|
|
40
|
+
if (method === undefined) {
|
|
41
|
+
throw new RuleUnsupportedError(`unsupported method .${expr.method}()`);
|
|
42
|
+
}
|
|
43
|
+
const receiver = evalExpr(expr.target, ctx);
|
|
44
|
+
// `resource.name.matches(…)` on an object whose `name` is absent: the
|
|
45
|
+
// receiver is already production's absent-property error. Propagate it
|
|
46
|
+
// (→ deny) rather than recasting it as a method-specific failure.
|
|
47
|
+
if (isErr(receiver))
|
|
48
|
+
return receiver;
|
|
49
|
+
return method(receiver, expr, ctx);
|
|
157
50
|
}
|
|
158
|
-
/**
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
h: 60 * 60 * 1000,
|
|
167
|
-
m: 60 * 1000,
|
|
168
|
-
s: 1000,
|
|
169
|
-
ms: 1,
|
|
170
|
-
ns: 1e-6,
|
|
171
|
-
};
|
|
172
|
-
/**
|
|
173
|
-
* `duration.value(magnitude, unit)` — a duration, returned as milliseconds so
|
|
174
|
-
* it adds to / subtracts from the millis-modeled timestamps
|
|
175
|
-
* (`request.time`, `resource.timeCreated`). This is what makes the freshness
|
|
176
|
-
* idiom production accepts work here too:
|
|
177
|
-
*
|
|
178
|
-
* request.time < resource.timeCreated + duration.value(1, 'h')
|
|
179
|
-
*/
|
|
180
|
-
function evalDurationBuiltin(expr, ctx) {
|
|
181
|
-
if (expr.method !== 'value') {
|
|
182
|
-
throw new RuleEvalError(`unsupported duration.${expr.method}()`);
|
|
183
|
-
}
|
|
184
|
-
const args = expr.args.map((a) => evalExpr(a, ctx));
|
|
185
|
-
if (args.length !== 2 || typeof args[0] !== 'number' || typeof args[1] !== 'string') {
|
|
186
|
-
throw new RuleEvalError(`duration.value() expects (magnitude: number, unit: string)`);
|
|
187
|
-
}
|
|
188
|
-
const [magnitude, unit] = args;
|
|
189
|
-
const millis = DURATION_UNIT_MILLIS[unit];
|
|
190
|
-
if (millis === undefined) {
|
|
191
|
-
throw new RuleEvalError(`duration.value() got unknown unit "${unit}" — expected one of ${Object.keys(DURATION_UNIT_MILLIS).join(', ')}`);
|
|
192
|
-
}
|
|
193
|
-
return magnitude * millis;
|
|
51
|
+
/** The namespace a call names, when its target is an unshadowed builtin identifier. */
|
|
52
|
+
function builtinNamespace(expr, ctx) {
|
|
53
|
+
if (expr.target.kind !== 'ident')
|
|
54
|
+
return undefined;
|
|
55
|
+
const name = expr.target.name;
|
|
56
|
+
if (name in ctx.locals || name in ctx.params)
|
|
57
|
+
return undefined;
|
|
58
|
+
return NAMESPACES.get(name);
|
|
194
59
|
}
|
|
195
|
-
/**
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
const
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
60
|
+
/** One table from the concern records; a name two records claim is a wiring error. */
|
|
61
|
+
function mergeReceiverMethods(records) {
|
|
62
|
+
const merged = new Map();
|
|
63
|
+
for (const record of records) {
|
|
64
|
+
for (const [name, method] of Object.entries(record)) {
|
|
65
|
+
if (merged.has(name)) {
|
|
66
|
+
throw new Error(`storage rules method .${name}() has two evaluators`);
|
|
67
|
+
}
|
|
68
|
+
merged.set(name, method);
|
|
202
69
|
}
|
|
203
|
-
return args[0];
|
|
204
|
-
}
|
|
205
|
-
if (expr.method === 'date') {
|
|
206
|
-
if (args.length !== 3 || !args.every((a) => typeof a === 'number')) {
|
|
207
|
-
throw new RuleEvalError(`timestamp.date() expects (year, month, day) numbers`);
|
|
208
|
-
}
|
|
209
|
-
const [y, m, d] = args;
|
|
210
|
-
// Production `timestamp.date(y, m, d)` is UTC midnight; month is 1-based.
|
|
211
|
-
return Date.UTC(y, m - 1, d);
|
|
212
|
-
}
|
|
213
|
-
throw new RuleEvalError(`unsupported timestamp.${expr.method}()`);
|
|
214
|
-
}
|
|
215
|
-
/**
|
|
216
|
-
* `string.matches(re)` — regex match anchored to the WHOLE string, mirroring
|
|
217
|
-
* production Storage (which anchors implicitly, so `'abc'.matches('a')` is
|
|
218
|
-
* FALSE).
|
|
219
|
-
*
|
|
220
|
-
* RE2-vs-JS divergence (honest note): production runs RE2, we compile the
|
|
221
|
-
* pattern with JavaScript's `RegExp`. JS RegExp is a superset of RE2 —
|
|
222
|
-
* backreferences (`\1`) and lookaround (`(?=`, `(?!`, `(?<=`, `(?<!`) work in
|
|
223
|
-
* JS but are UNSUPPORTED in RE2 and would fail in production. To avoid ever
|
|
224
|
-
* false-allowing on a pattern production would reject, those constructs are
|
|
225
|
-
* detected up front and denied. Invalid patterns (that even JS won't compile)
|
|
226
|
-
* also deny. A non-string target (e.g. a missing metadata key → undefined)
|
|
227
|
-
* denies too — production would error, and an error denies.
|
|
228
|
-
*/
|
|
229
|
-
function evalMatches(expr, ctx) {
|
|
230
|
-
const subject = evalExpr(expr.target, ctx);
|
|
231
|
-
// `resource.name.matches(…)` on an object whose `name` is absent: the target
|
|
232
|
-
// is already production's absent-property error. Propagate it (→ deny)
|
|
233
|
-
// rather than recasting it as a matches()-specific failure.
|
|
234
|
-
if (isErr(subject))
|
|
235
|
-
return subject;
|
|
236
|
-
if (typeof subject !== 'string') {
|
|
237
|
-
throw new RuleEvalError(`matches() requires a string target, got ${describeType(subject)}`);
|
|
238
|
-
}
|
|
239
|
-
if (expr.args.length !== 1) {
|
|
240
|
-
throw new RuleEvalError(`matches() expects a single pattern argument`);
|
|
241
|
-
}
|
|
242
|
-
const pattern = evalExpr(expr.args[0], ctx);
|
|
243
|
-
if (typeof pattern !== 'string') {
|
|
244
|
-
throw new RuleEvalError(`matches() pattern must be a string`);
|
|
245
|
-
}
|
|
246
|
-
// Detect RE2-unsupported constructs JS would happily (mis)compile.
|
|
247
|
-
const backref = /\\[1-9]/.test(pattern);
|
|
248
|
-
const lookaround = /\(\?<?[=!]/.test(pattern);
|
|
249
|
-
if (backref || lookaround) {
|
|
250
|
-
throw new RuleEvalError(`matches() pattern uses an RE2-unsupported construct (${backref ? 'backreference' : 'lookaround'}) that production would reject`);
|
|
251
|
-
}
|
|
252
|
-
let re;
|
|
253
|
-
try {
|
|
254
|
-
// Anchor to the whole string. `(?:...)` keeps the caller's alternations
|
|
255
|
-
// from binding past the anchors.
|
|
256
|
-
re = new RegExp(`^(?:${pattern})$`);
|
|
257
|
-
}
|
|
258
|
-
catch (err) {
|
|
259
|
-
throw new RuleEvalError(`matches() invalid regex pattern: ${err.message}`);
|
|
260
|
-
}
|
|
261
|
-
return re.test(subject);
|
|
262
|
-
}
|
|
263
|
-
/**
|
|
264
|
-
* Evaluate `string.split(re)` — RE2 regex split, the storage-rules idiom for
|
|
265
|
-
* segmenting object names (`fileId.split('-')[0:2]`). Shares matches()'s
|
|
266
|
-
* RE2-vs-JS guard: constructs RE2 rejects (backreferences, lookaround) deny
|
|
267
|
-
* with a reason rather than silently (mis)compiling under JS semantics.
|
|
268
|
-
*/
|
|
269
|
-
function evalSplit(expr, ctx) {
|
|
270
|
-
const subject = evalExpr(expr.target, ctx);
|
|
271
|
-
if (isErr(subject))
|
|
272
|
-
return subject;
|
|
273
|
-
if (typeof subject !== 'string') {
|
|
274
|
-
throw new RuleEvalError(`split() requires a string target, got ${describeType(subject)}`);
|
|
275
|
-
}
|
|
276
|
-
if (expr.args.length !== 1) {
|
|
277
|
-
throw new RuleEvalError(`split() expects a single pattern argument`);
|
|
278
|
-
}
|
|
279
|
-
const pattern = evalExpr(expr.args[0], ctx);
|
|
280
|
-
if (typeof pattern !== 'string') {
|
|
281
|
-
throw new RuleEvalError(`split() pattern must be a string`);
|
|
282
|
-
}
|
|
283
|
-
const backref = /\\[1-9]/.test(pattern);
|
|
284
|
-
const lookaround = /\(\?<?[=!]/.test(pattern);
|
|
285
|
-
if (backref || lookaround) {
|
|
286
|
-
throw new RuleEvalError(`split() pattern uses an RE2-unsupported construct (${backref ? 'backreference' : 'lookaround'}) that production would reject`);
|
|
287
|
-
}
|
|
288
|
-
let re;
|
|
289
|
-
try {
|
|
290
|
-
re = new RegExp(pattern);
|
|
291
|
-
}
|
|
292
|
-
catch (err) {
|
|
293
|
-
throw new RuleEvalError(`split() invalid regex pattern: ${err.message}`);
|
|
294
|
-
}
|
|
295
|
-
return subject.split(re);
|
|
296
|
-
}
|
|
297
|
-
/**
|
|
298
|
-
* Evaluate `.size()` on the three sized types (string → length, list →
|
|
299
|
-
* element count, map → own-key count). Anything else denies with a reason.
|
|
300
|
-
*/
|
|
301
|
-
function evalSize(expr, ctx) {
|
|
302
|
-
const subject = evalExpr(expr.target, ctx);
|
|
303
|
-
if (isErr(subject))
|
|
304
|
-
return subject;
|
|
305
|
-
if (expr.args.length !== 0) {
|
|
306
|
-
throw new RuleEvalError(`size() expects no arguments`);
|
|
307
|
-
}
|
|
308
|
-
if (typeof subject === 'string' || Array.isArray(subject))
|
|
309
|
-
return subject.length;
|
|
310
|
-
if (isRulesMap(subject))
|
|
311
|
-
return Object.keys(subject).length;
|
|
312
|
-
throw new RuleEvalError(`size() requires a string, list, or map target, got ${describeType(subject)}`);
|
|
313
|
-
}
|
|
314
|
-
/** `Map.keys()` returns the map's own keys and never exposes JS prototypes. */
|
|
315
|
-
function evalMapKeys(expr, ctx) {
|
|
316
|
-
const subject = evalExpr(expr.target, ctx);
|
|
317
|
-
if (isErr(subject))
|
|
318
|
-
return subject;
|
|
319
|
-
if (expr.args.length !== 0) {
|
|
320
|
-
throw new RuleEvalError(`keys() expects no arguments`);
|
|
321
|
-
}
|
|
322
|
-
if (!isRulesMap(subject)) {
|
|
323
|
-
throw new RuleEvalError(`keys() requires a map target, got ${describeType(subject)}`);
|
|
324
|
-
}
|
|
325
|
-
return Object.keys(subject);
|
|
326
|
-
}
|
|
327
|
-
/** `List/Set.hasAll(other)` with Rules structural value equality. */
|
|
328
|
-
function evalHasAll(expr, ctx) {
|
|
329
|
-
const subject = evalExpr(expr.target, ctx);
|
|
330
|
-
if (isErr(subject))
|
|
331
|
-
return subject;
|
|
332
|
-
if (!Array.isArray(subject)) {
|
|
333
|
-
throw new RuleEvalError(`hasAll() requires a list or set target, got ${describeType(subject)}`);
|
|
334
|
-
}
|
|
335
|
-
if (expr.args.length !== 1) {
|
|
336
|
-
throw new RuleEvalError(`hasAll() expects one list or set argument`);
|
|
337
|
-
}
|
|
338
|
-
const required = evalExpr(expr.args[0], ctx);
|
|
339
|
-
if (isErr(required))
|
|
340
|
-
return required;
|
|
341
|
-
if (!Array.isArray(required)) {
|
|
342
|
-
throw new RuleEvalError(`hasAll() argument must be a list or set`);
|
|
343
|
-
}
|
|
344
|
-
return required.every((candidate) => subject.some((value) => rulesEquals(value, candidate)));
|
|
345
|
-
}
|
|
346
|
-
/** `Map.get(key, default)` for the production-probed string-key form. */
|
|
347
|
-
function evalMapGet(expr, ctx) {
|
|
348
|
-
const subject = evalExpr(expr.target, ctx);
|
|
349
|
-
if (isErr(subject))
|
|
350
|
-
return subject;
|
|
351
|
-
if (!isRulesMap(subject)) {
|
|
352
|
-
throw new RuleEvalError(`get() requires a map target, got ${describeType(subject)}`);
|
|
353
|
-
}
|
|
354
|
-
if (expr.args.length !== 2) {
|
|
355
|
-
throw new RuleEvalError(`get() expects a key and default value`);
|
|
356
|
-
}
|
|
357
|
-
const key = evalExpr(expr.args[0], ctx);
|
|
358
|
-
if (isErr(key))
|
|
359
|
-
return key;
|
|
360
|
-
if (typeof key !== 'string') {
|
|
361
|
-
throw new RuleEvalError(`get() key must be a string`);
|
|
362
70
|
}
|
|
363
|
-
|
|
364
|
-
if (isErr(fallback))
|
|
365
|
-
return fallback;
|
|
366
|
-
return Object.prototype.hasOwnProperty.call(subject, key)
|
|
367
|
-
? subject[key]
|
|
368
|
-
: fallback;
|
|
71
|
+
return merged;
|
|
369
72
|
}
|
|
370
73
|
//# sourceMappingURL=rules-methods.js.map
|