Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@eventual/core-runtime

Package Overview
Dependencies
Maintainers
2
Versions
100
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@eventual/core-runtime - npm Package Compare versions

Comparing version 0.37.3 to 0.38.0

9

lib/cjs/local/stores/entity-store.d.ts

@@ -1,2 +0,2 @@

import { Entity, Attributes, EntityConsistencyOptions, EntityQueryOptions, EntityQueryResult, EntitySetOptions, EntityWithMetadata } from "@eventual/core";
import { Attributes, Entity, EntityConsistencyOptions, EntityIndex, EntityQueryOptions, EntityQueryResult, EntitySetOptions, EntityWithMetadata, KeyValue } from "@eventual/core";
import { EntityProvider } from "../../providers/entity-provider.js";

@@ -9,2 +9,6 @@ import { EntityStore, NormalizedEntityCompositeKey, NormalizedEntityCompositeKeyComplete, NormalizedEntityKeyCompletePart, NormalizedEntityTransactItem } from "../../stores/entity-store.js";

}
export interface LocalEntity {
data: Map<KeyValue, Map<KeyValue, EntityWithMetadata>>;
indices: Record<string, Map<KeyValue, Map<KeyValue, EntityWithMetadata>>>;
}
export declare class LocalEntityStore extends EntityStore {

@@ -19,6 +23,7 @@ private props;

protected _delete(entity: Entity, key: NormalizedEntityCompositeKeyComplete, options?: EntityConsistencyOptions | undefined): Promise<void>;
protected _query(entity: Entity, queryKey: NormalizedEntityCompositeKey<NormalizedEntityKeyCompletePart>, options?: EntityQueryOptions): Promise<EntityQueryResult>;
protected _query(entity: Entity | EntityIndex, queryKey: NormalizedEntityCompositeKey<NormalizedEntityKeyCompletePart>, options?: EntityQueryOptions): Promise<EntityQueryResult>;
protected _transactWrite(items: NormalizedEntityTransactItem[]): Promise<void>;
private getLocalEntity;
private getPartitionMap;
}
//# sourceMappingURL=entity-store.d.ts.map

@@ -25,6 +25,7 @@ "use strict";

const newVersion = options?.incrementVersion === false ? version : version + 1;
this.getPartitionMap(entity, key.partition).set(key.sort?.keyValue ?? "default", {
const newValue = {
value,
version: newVersion,
});
};
setLocalEntity(this.getLocalEntity(entity), newValue, key, entity);
this.props.localConnector.pushWorkflowTask({

@@ -49,13 +50,11 @@ entityName: entity.name,

}
if (!(0, entity_store_js_1.isCompleteKey)(key)) {
throw new Error("Entity key cannot be partial for delete");
if (deleteLocalEntity(this.getLocalEntity(entity), key, entity)) {
this.props.localConnector.pushWorkflowTask({
entityName: entity.name,
key: (0, entity_store_js_1.convertNormalizedEntityKeyToMap)(key),
operation: "remove",
oldValue: item.value,
oldVersion: item.version,
});
}
this.getPartitionMap(entity, key.partition).delete(key.sort?.keyValue ?? "default");
this.props.localConnector.pushWorkflowTask({
entityName: entity.name,
key: (0, entity_store_js_1.convertNormalizedEntityKeyToMap)(key),
operation: "remove",
oldValue: item.value,
oldVersion: item.version,
});
}

@@ -127,8 +126,21 @@ }

}
getPartitionMap(entity, partitionKey) {
const _entity = (this.entities[entity.name] ??= new Map());
let partitionMap = _entity.get(partitionKey.keyValue);
getLocalEntity(entityOrIndex) {
const entity = entityOrIndex.kind === "Entity"
? entityOrIndex
: this.getEntity(entityOrIndex.entityName);
const _entity = (this.entities[entity.name] ??=
initializeLocalEntity(entity));
return _entity;
}
getPartitionMap(entityOrIndex, partitionKey) {
const index = entityOrIndex.kind === "EntityIndex" ? entityOrIndex : undefined;
const _entity = this.getLocalEntity(entityOrIndex);
const table = index ? _entity.indices[index.name] : _entity.data;
if (!table) {
throw new Error(`Index ${index?.name} not found`);
}
let partitionMap = table.get(partitionKey.keyValue);
if (!partitionMap) {
partitionMap = new Map();
_entity.set(partitionKey.keyValue, partitionMap);
table.set(partitionKey.keyValue, partitionMap);
}

@@ -139,2 +151,61 @@ return partitionMap;

exports.LocalEntityStore = LocalEntityStore;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW50aXR5LXN0b3JlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL2xv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9uTWFwID0gbmV3IE1hcDxLZXlWYWx1ZSwgRW50aXR5V2l0aE1ldGFkYXRhPigpO1xuICAgICAgX2VudGl0eS5zZXQocGFydGl0aW9uS2V5LmtleVZhbHVlLCBwYXJ0aXRpb25NYXApO1xuICAgIH1cbiAgICByZXR1cm4gcGFydGl0aW9uTWFwO1xuICB9XG59XG4iXX0=
function initializeLocalEntity(entity) {
return {
data: new Map(),
indices: Object.fromEntries(entity.indices.map((i) => [
i.name,
new Map(),
])),
};
}
function setLocalEntity(localEntity, value, key, entity) {
updatePartitionEntry(localEntity.data, key, value);
entity.indices.forEach((i) => {
const localIndex = localEntity.indices[i.name];
if (!localIndex) {
return;
}
const normalizedKey = (0, entity_store_js_1.normalizeCompositeKey)(i.key, value.value);
// if the key isn't complete (missing parts of the index composite key), ignore this item
if ((0, entity_store_js_1.isCompleteKey)(normalizedKey)) {
updatePartitionEntry(localIndex, normalizedKey, value);
}
});
function updatePartitionEntry(store, key, value) {
let partitionMap = store.get(key.partition.keyValue);
if (!partitionMap) {
partitionMap = new Map();
store.set(key.partition.keyValue, partitionMap);
}
partitionMap.set(key.sort?.keyValue ?? "default", value);
}
}
function deleteLocalEntity(localEntity, key, entity) {
const value = localEntity.data
.get(key.partition.keyValue)
?.get(key.sort?.keyValue ?? "default");
if (!value) {
return false;
}
const deleted = deletePartitionEntry(localEntity.data, key);
entity.indices.forEach((i) => {
const localIndex = localEntity.indices[i.name];
if (!localIndex) {
return;
}
const normalizedKey = (0, entity_store_js_1.normalizeCompositeKey)(i.key, value.value);
// if the key isn't complete (missing parts of the index composite key), ignore this item
if ((0, entity_store_js_1.isCompleteKey)(normalizedKey)) {
deletePartitionEntry(localIndex, normalizedKey);
}
});
return deleted;
function deletePartitionEntry(store, key) {
const partitionMap = store.get(key.partition.keyValue);
if (partitionMap) {
return partitionMap.delete(key.sort?.keyValue ?? "default");
}
return false;
}
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ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gcGFydGl0aW9uTWFwID0gc3RvcmUuZ2V0KGtleS5wYXJ0aXRpb24ua2V5VmFsdWUpO1xuICAgIGlmIChwYXJ0aXRpb25NYXApIHtcbiAgICAgIHJldHVybiBwYXJ0aXRpb25NYXAuZGVsZXRlKGtleS5zb3J0Py5rZXlWYWx1ZSA/PyBcImRlZmF1bHRcIik7XG4gICAgfVxuICAgIHJldHVybiBmYWxzZTtcbiAgfVxufVxuIl19

@@ -1,2 +0,2 @@

import type { Entity, Attributes, CompositeKey, EntityConsistencyOptions, KeyMap, KeyValue, QueryKey, EntityQueryOptions, EntityQueryResult, EntitySetOptions, EntityTransactItem, EntityWithMetadata } from "@eventual/core";
import type { Entity, Attributes, CompositeKey, EntityConsistencyOptions, KeyMap, KeyValue, QueryKey, EntityQueryOptions, EntityQueryResult, EntitySetOptions, EntityTransactItem, EntityWithMetadata, EntityIndex } from "@eventual/core";
import type { EntityHook, KeyDefinition, KeyDefinitionPart } from "@eventual/core/internal";

@@ -19,3 +19,4 @@ import { EntityProvider } from "../providers/entity-provider.js";

query(entityName: string, queryKey: QueryKey, options?: EntityQueryOptions | undefined): Promise<EntityQueryResult>;
protected abstract _query(entity: Entity, queryKey: NormalizedEntityCompositeKey<NormalizedEntityKeyCompletePart>, options: EntityQueryOptions | undefined): Promise<EntityQueryResult>;
queryIndex(entityName: string, indexName: string, queryKey: QueryKey, options?: EntityQueryOptions | undefined): Promise<EntityQueryOptions>;
protected abstract _query(entity: Entity | EntityIndex, queryKey: NormalizedEntityCompositeKey<NormalizedEntityKeyCompletePart>, options: EntityQueryOptions | undefined): Promise<EntityQueryResult>;
transactWrite(items: EntityTransactItem[]): Promise<void>;

@@ -22,0 +23,0 @@ protected abstract _transactWrite(items: NormalizedEntityTransactItem[]): Promise<void>;

@@ -43,2 +43,13 @@ "use strict";

}
queryIndex(entityName, indexName, queryKey, options) {
const index = this.getEntity(entityName).indices.find((i) => i.name === indexName);
if (!index) {
throw new Error(`Index ${indexName} was not found on entity ${entityName}`);
}
const normalizedKey = normalizeCompositeKey(index.key, queryKey);
if (!isCompleteKeyPart(normalizedKey.partition)) {
throw new Error("Entity Index partition key cannot be partial for query.");
}
return this._query(index, normalizedKey, options);
}
async transactWrite(items) {

@@ -147,2 +158,2 @@ return this._transactWrite(items.map((item) => {

exports.convertNormalizedEntityKeyToMap = convertNormalizedEntityKeyToMap;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW50aXR5LXN0b3JlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3N0b3Jlcy9lbnRpdHktc3RvcmUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBcUJBLE1BQXNCLFdBQVc7SUFDL0IsWUFBb0IsY0FBOEI7UUFBOUIsbUJBQWMsR0FBZCxjQUFjLENBQWdCO0lBQUcsQ0FBQztJQUUvQyxLQUFLLENBQUMsR0FBRyxDQUFDLFVBQWtCLEVBQUUsR0FBaUI7UUFDcEQsT0FBTyxDQUFDLE1BQU0sSUFBSSxDQUFDLGVBQWUsQ0FBQyxVQUFVLEVBQUUsR0FBRyxDQUFDLENBQUMsRUFBRSxLQUFLLENBQUM7SUFDOUQsQ0FBQztJQUVNLEtBQUssQ0FBQyxlQUFlLENBQzFCLFVBQWtCLEVBQ2xCLEdBQWlCO1FBRWpCLE1BQU0sTUFBTSxHQUFHLElBQUksQ0FBQyxTQUFTLENBQUMsVUFBVSxDQUFDLENBQUM7UUFDMUMsTUFBTSxzQkFBc0IsR0FBRyxxQkFBcUIsQ0FBQyxNQUFNLEVBQUUsR0FBRyxDQUFDLENBQUM7UUFFbEUsSUFBSSxDQUFDLGFBQWEsQ0FBQyxzQkFBc0IsQ0FBQyxFQUFFO1lBQzFDLE1BQU0sSUFBSSxLQUFLLENBQUMsbURBQW1ELENBQUMsQ0FBQztTQUN0RTtRQUVELE9BQU8sSUFBSSxDQUFDLGdCQUFnQixDQU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RcIixcbiAgICAgICAgICAgICAgZW50aXR5LFxuICAgICAgICAgICAgICBrZXksXG4gICAgICAgICAgICAgIHZhbHVlOiBpdGVtLnZhbHVlLFxuICAgICAgICAgICAgICBvcHRpb25zOiBpdGVtLm9wdGlvbnMsXG4gICAgICAgICAgICB9XG4gICAgICAgICAgOiBpdGVtLm9wZXJhdGlvbiA9PT0gXCJkZWxldGVcIlxuICAgICAgICAgID8ge1xuICAgICAgICAgICAgICBvcGVyYXRpb246IFwiZGVsZXRlXCIsXG4gICAgICAgICAgICAgIGVudGl0eSxcbiAgICAgICAgICAgICAga2V5LFxuICAgICAgICAgICAgICBvcHRpb25zOiBpdGVtLm9wdGlvbnMsXG4gICAgICAgICAgICB9XG4gICAgICAgICAgOiB7XG4gICAgICAgICAgICAgIG9wZXJhdGlvbjogXCJjb25kaXRpb25cIixcbiAgICAgICAgICAgICAgZW50aXR5LFxuICAgICAgICAgICAgICBrZXksXG4gICAgICAgICAgICAgIHZlcnNpb246IGl0ZW0udmVyc2lvbixcbiAgICAgICAgICAgIH07XG4gICAgICB9KVxuICAgICk7XG4gIH1cblxuICBwcm90ZWN0ZWQgYWJzdHJhY3QgX3RyYW5zYWN0V3JpdGUoXG4gICAgaXRlbXM6IE5vcm1hbGl6ZWRFbnRpdHlUcmFuc2FjdEl0ZW1bXVxuICApOiBQcm9taXNlPHZvaWQ+O1xuXG4gIHByb3RlY3RlZCBnZXRFbnRpdHkoZW50aXR5TmFtZTogc3RyaW5nKSB7XG4gICAgY29uc3QgZW50aXR5ID0gdGhpcy5lbnRpdHlQcm92aWRlci5nZXRFbnRpdHkoZW50aXR5TmFtZSk7XG5cbiAgICBpZiAoIWVudGl0eSkge1xuICAgICAgdGhyb3cgbmV3IEVycm9yKGBFbnRpdHkgJHtlbnRpdHlOYW1lfSB3YXMgbm90IGZvdW5kLmApO1xuICAgIH1cbiAgICByZXR1cm4gZW50aXR5O1xuICB9XG59XG5cbmV4cG9ydCB0eXBlIE5vcm1hbGl6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ICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcbiAgICAgICAgICAgIFwiRW50aXR5IGtleSBjYW5ub3QgYmUgcGFydGlhbCBmb3Igc2V0LCBkZWxldGUsIG9yIGNvbmRpdGlvbiBvcGVyYXRpb25zLlwiXG4gICAgICAgICAgKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBpdGVtLm9wZXJhdGlvbiA9PT0gXCJzZXRcIlxuICAgICAgICAgID8ge1xuICAgICAgICAgICAgICBvcGVyYXRpb246IFwic2V0XCIsXG4gICAgICAgICAgICAgIGVudGl0eSxcbiAgICAgICAgICAgICAga2V5LFxuICAgICAgICAgICAgICB2YWx1ZTogaXRlbS52YWx1ZSxcbiAgICAgICAgICAgICAgb3B0aW9uczogaXRlbS5vcHRpb25zLFxuICAgICAgICAgICAgfVxuICAgICAgICAgIDogaXRlbS5vcGVyYXRpb24gPT09IFwiZGVsZXRlXCJcbiAgICAgICAgICA/IHtcbiAgICAgICAgICAgICAgb3BlcmF0aW9uOiBcImRlbGV0ZVwiLFxuICAgICAgICAgICAgICBlbnRpdHksXG4gICAgICAgICAgICAgIGtleSxcbiAgICAgICAgICAgICAgb3B0aW9uczogaXRlbS5vcHRpb25zLFxuICAgICAgICAgICAgfVxuICAgICAgICAgIDoge1xuICAgICAgICAgICAgICBvcGVyYXRpb246IFwiY29uZGl0aW9uXCIsXG4gICAgICAgICAgICAgIGVudGl0eSxcbiAgICAgICAgICAgICAga2V5LFxuICAgICAgICAgICAgICB2ZXJzaW9uOiBpdGVtLnZlcnNpb24sXG4gICAgICAgICAgICB9O1xuICAgICAgfSlcbiAgICApO1xuICB9XG5cbiAgcHJvdGVjdGVkIGFic3RyYWN0IF90cmFuc2FjdFdyaXRlKFxuICAgIGl0ZW1zOiBOb3JtYWxpemVkRW50aXR5VHJhbnNhY3RJdGVtW11cbiAgKTogUHJvbWlzZTx2b2lkPjtcblxuICBwcm90ZWN0ZWQgZ2V0RW50aXR5KGVudGl0eU5hbWU6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ZEtleTtcbn1cbiJdfQ==

@@ -162,2 +162,5 @@ "use strict";

}
else if ((0, internal_1.isEntityOperationOfType)("queryIndex", operation)) {
return self.props.entityStore.queryIndex(operation.entityName, operation.indexName, ...operation.params);
}
return self.props.entityStore[operation.operation](operation.entityName,

@@ -303,2 +306,2 @@ // @ts-ignore

}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid29ya2Zsb3ctY2FsbC1leGVjdXRvci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy93b3JrZmxvdy1jYWxsLWV4ZWN1dG9yLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUNBLHNEQTJDaUM7QUFRakMsaURBQTZFO0FBQzdFLDJDQUE2QztBQUM3QywrQ0FBb0Q7QUFHcEQsNkRBQW1EO0FBY25EOztHQUVHO0FBQ0gsTUFBYSxvQkFBb0I7SUFDL0IsWUFBb0IsS0FBZ0M7UUFBaEMsVUFBSyxHQUFMLEtBQUssQ0FBMkI7SUFBRyxDQUFDO0lBRWpELEtBQUssQ0FBQyxXQUFXLENBQ3RCLFFBQWtCLEVBQ2xCLFdBQXdCLEVBQ3hCLElBQWtCLEVBQ2xCLFFBQWM7UUFFZCxJQUFJLElBQUEscUJBQVUsRUFBQyxJQUFJLENBQUMsSUFBSSxDQUFDLEVBQUU7WUFDekIsT0FBTyxNQUFNLElBQUksQ0FBQyxZQUFZLENBQzVCLFFBQVEsRUFDUixXQUFXLEVBQ1gsSUFBSSxDQUFDLElBQUksRUFDVCxJQUFJLENBQUMsR0FBRyxFQUNSLFFBQVEsQ0FDVCxDQUFDO1NBQ0g7YUFBTSxJQUFJLElBQUEsOEJBQW1CLEVBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxFQUFFO1lBQ3pDLE9BQU8sSUFBSSxDQUFDLHFCQUFxQixDQUMvQixXQUFXLEVBQ1gsSUFBSSxDQUFDLElBQUksRUF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0VudGl0eU9wZXJhdGlvbk9mVHlwZShcInRyYW5zYWN0XCIsIGNhbGwpXG4gICAgICAgICAgICAgID8gdW5kZWZpbmVkXG4gICAgICAgICAgICAgIDogY2FsbC5lbnRpdHlOYW1lLFxuICAgICAgICAgICAgcmVzdWx0LFxuICAgICAgICAgICAgc2VxLFxuICAgICAgICAgIH0sXG4gICAgICAgICAgYmFzZVRpbWVcbiAgICAgICAgKVxuICAgICAgKTtcbiAgICB9IGNhdGNoIChlcnIpIHtcbiAgICAgIGF3YWl0IHRoaXMucHJvcHMuZXhlY3V0aW9uUXVldWVDbGllbnQuc3VibWl0RXhlY3V0aW9uRXZlbnRzKFxuICAgICAgICBleGVjdXRpb25JZCxcbiAgICAgICAgY3JlYXRlRXZlbnQ8RW50aXR5UmVxdWVzdEZhaWxlZD4oXG4gICAgICAgICAge1xuICAgICAgICAgICAgdHlwZTogV29ya2Zsb3dFdmVudFR5cGUuRW50aXR5UmVxdWVzdEZhaWxlZCxcbiAgICAgICAgICAgIHNlcSxcbiAgICAgICAgICAgIG5hbWU6IGlzRW50aXR5T3BlcmF0aW9uT2ZUeXBlKFwidHJhbnNhY3RcIiwgY2FsbClcbiAgICAgICAgICAgICAgPyB1bmRlZmluZWRcbiAgICAgICAgICAgICAgOiBjYWxsLmVudGl0eU5hbWUsXG4gICAgICAgICAgICBvcGVyYXRpb246IGNhbGwub3BlcmF0aW9uLFxuICAgICAgICAgICAgLi4ubm9ybWFsaXplRXJyb3IoZXJyKSxcbiAgICAgICAgICB9LFxuICAgICAgICAgIGJhc2VUaW1lXG4gICAgICAgIClcbiAgICAgICk7XG4gICAgfVxuXG4gICAgcmV0dXJuIGNyZWF0ZUV2ZW50PEVudGl0eVJlcXVlc3Q+KFxuICAgICAge1xuICAgICAgICB0eXBlOiBXb3JrZmxvd0V2ZW50VHlwZS5FbnRpdHlSZXF1ZXN0LFxuICAgICAgICBvcGVyYXRpb246IGNhbGwsXG4gICAgICAgIHNlcSxcbiAgICAgIH0s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gICAgICBleGVjdXRpb25JZCxcbiAgICAgICAgICBjcmVhdGVFdmVudDxUcmFuc2FjdGlvblJlcXVlc3RTdWNjZWVkZWQ+KFxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICB0eXBlOiBXb3JrZmxvd0V2ZW50VHlwZS5UcmFuc2FjdGlvblJlcXVlc3RTdWNjZWVkZWQsXG4gICAgICAgICAgICAgIHJlc3VsdDogcmVzdWx0Lm91dHB1dCxcbiAgICAgICAgICAgICAgc2VxLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGJhc2VUaW1lXG4gICAgICAgICAgKVxuICAgICAgICApO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgYXdhaXQgdGhpcy5wcm9wcy5leGVjdXRpb25RdWV1ZUNsaWVudC5zdWJtaXRFeGVjdXRpb25FdmVudHMoXG4gICAgICAgICAgZXhlY3V0aW9uSWQsXG4gICAgICAgICAgY3JlYXRlRXZlbnQ8VHJhbnNhY3Rpb25SZXF1ZXN0RmFpbGVkPihcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgdHlwZTogV29ya2Zsb3dFdmVudFR5cGUuVHJhbnNhY3Rpb25SZXF1ZXN0RmFpbGVkLFxuICAgICAgICAgICAgICBlcnJvcjogXCJUcmFuc2FjdGlvbiBGYWlsZWRcIixcbiAgICAgICAgICAgICAgbWVzc2FnZTogXCJcIixcbiAgICAgICAgICAgICAgc2VxLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGJhc2VUaW1lXG4gICAgICAgICAgKVxuICAgICAgICApO1xuICAgICAgfVxuICAgIH0gY2F0Y2ggKGVycikge1xuICAgICAgYXdhaXQgdGhpcy5wcm9wcy5leGVjdXRpb25RdWV1ZUNsaWVudC5zdWJtaXRFeGVjdXRpb25FdmVudHMoXG4gICAgICAgIGV4ZWN1dGlvbklkLFxuICAgICAgICBjcmVhdGVFdmVudDxUcmFuc2FjdGlvblJlcXVlc3RGYWlsZWQ+KFxuICAgICAgICAgI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RhdGEpO1xuXG4gICAgICB0cnkge1xuICAgICAgICBjb25zdCByZXN1bHQgPSBhd2FpdCB0aGlzLnByb3BzLmJ1Y2tldFN0b3JlLnB1dChcbiAgICAgICAgICBjYWxsLmJ1Y2tldE5hbWUsXG4gICAgICAgICAga2V5LFxuICAgICAgICAgIGJ1ZmZlclxuICAgICAgICApO1xuXG4gICAgICAgIGF3YWl0IHRoaXMucHJvcHMuZXhlY3V0aW9uUXVldWVDbGllbnQuc3VibWl0RXhlY3V0aW9uRXZlbnRzKFxuICAgICAgICAgIGV4ZWN1dGlvbklkLFxuICAgICAgICAgIGNyZWF0ZUV2ZW50PEJ1Y2tldFJlcXVlc3RTdWNjZWVkZWQ+KFxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICB0eXBlOiBXb3JrZmxvd0V2ZW50VHlwZS5CdWNrZXRSZXF1ZXN0U3VjY2VlZGVkLFxuICAgICAgICAgICAgICBvcGVyYXRpb246IFwicHV0XCIsXG4gICAgICAgICAgICAgIHJlc3VsdDoge1xuICAgICAgICAgICAgICAgIGV0YWc6IHJlc3VsdC5ldGFnLFxuICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICBzZXEsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgYmFzZVRpbWVcbiAgICAgICAgICApXG4gICAgICAgICk7XG4gICAgICB9IGNhdGNoIChlcnIpIHtcbiAgICAgICAgYXdhaXQgdGhpcy5wcm9wcy5leGVjdXRpb25RdWV1ZUNsaWVudC5zdWJtaXRFeGVjdXRpb25FdmVudHMoXG4gICAgICAgICAgZXhlY3V0aW9uSWQsXG4gICAgICAgICAgY3JlYXRlRXZlbnQ8QnVja2V0UmVxdWVzdEZhaWxlZD4oXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgIHR5cGU6IFdvcmtmbG93RXZlbnRUeXBlLkJ1Y2tldFJlcXVlc3RGYWlsZWQsXG4gICAgICAgICAgICAgIG9wZXJhdGlvbjogXCJwdXRcIixcbiAgICAgICA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WNrZXROYW1lLFxuICAgICAgICAgIC4uLmNhbGwucGFyYW1zXG4gICAgICAgICk7XG5cbiAgICAgICAgYXdhaXQgdGhpcy5wcm9wcy5leGVjdXRpb25RdWV1ZUNsaWVudC5zdWJtaXRFeGVjdXRpb25FdmVudHMoXG4gICAgICAgICAgZXhlY3V0aW9uSWQsXG4gICAgICAgICAgY3JlYXRlRXZlbnQ8QnVja2V0UmVxdWVzdFN1Y2NlZWRlZD4oXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgIHR5cGU6IFdvcmtmbG93RXZlbnRUeXBlLkJ1Y2tldFJlcXVlc3RTdWNjZWVkZWQsXG4gICAgICAgICAgICAgIG9wZXJhdGlvbjogY2FsbC5vcGVyYXRpb24sXG4gICAgICAgICAgICAgIHJlc3VsdDogcmVzdWx0XG4gICAgICAgICAgICAgICAgPyAoe1xuICAgICAgICAgICAgICAgICAgICAvLyBzZXJpYWxpemUgdGhlIGRhdGEgcmV0cmlldmVkIGRhdGEgdG8gYmUgc3RvcmVkXG4gICAgICAgICAgICAgICAgICAgIGJvZHk6IChcbiAgICAgICAgICAgICAgICAgICAgICBhd2FpdCBzdHJlYW1Ub0J1ZmZlcihyZXN1bHQuYm9keSlcbiAgICAgICAgICAgICAgICAgICAgKS50b1N0cmluZyhcImJhc2U2NFwiKSxcbiAgICAgICAgICAgICAgICAgICAgYmFzZTY0RW5jb2RlZDogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgY29udGVudExlbmd0aDogcmVzdWx0LmNvbnRlbnRMZW5ndGgsXG4gICAgICAgICAgICAgICAgICAgIGV0YWc6IHJlc3VsdC5ldGFnLFxuICAgICAgICAgICAgICAgICAgfSBzYXRpc2ZpZXMgQnVja2V0R2V0T2JqZWN0U2VyaWFsaXplZFJlc3VsdClcbiAgICAgICAgICAgICAgICA6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgc2VxLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGJhc2VUaW1lXG4gICAgICAgICAgKVxuICAgICAgICApO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgY29uc3QgcmVzdWx0ID0gYXdhaXQgdGhpcy5wcm9wcy5idWNrZXRTdG9yZVtjYWxsLm9wZXJhdGlvbl0oXG4gICAgICAgICAgY2FsbC5idWNrZXROYW1lLFxuICAgICAgICAgIC8vIEB0cy1pZ25vcmVcbiAgICAgICAgICAuLi5jYWxsLnBhcmFtc1xuICAgICAgICApO1xuXG4gICAgICAgIGF3YWl0IHRoaXMucHJvcHMuZXhlY3V0aW9uUXVldWVDbGllbnQuc3VibWl0RXhlY3V0aW9uRXZlbnRzKFxuICAgICAgICAgIGV4ZWN1dGlvbklkLFxuICAgICAgICAgIGNyZWF0ZUV2ZW50PEJ1Y2tldFJlcXVlc3RTdWNjZWVkZWQ+KFxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICB0eXBlOiBXb3JrZmxvd0V2ZW50VHlwZS5CdWNrZXRSZXF1ZXN0U3VjY2VlZGVkLFxuICAgICAgICAgICAgICBvcGVyYXRpb246IGNhbGwub3BlcmF0aW9uLFxuICAgICAgICAgICAgICByZXN1bHQsXG4gICAgICAgICAgICAgIHNlcSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBiYXNlVGltZVxuICAgICAgICAgIClcbiAgICAgICAgKTtcbiAgICAgIH1cbiAgICB9IGNhdGNoIChlcnIpIHtcbiAgICAgIGF3YWl0IHRoaXMucHJvcHMuZXhlY3V0aW9uUXVldWVDbGllbnQuc3VibWl0RXhlY3V0aW9uRXZlbnRzKFxuICAgICAgICBleGVjdXRpb25JZCxcbiAgICAgICAgY3JlYXRlRXZlbnQ8QnVja2V0UmVxdWVzdEZhaWxlZD4oXG4gICAgICAgICAge1xuICAgICAgICAgICAgdHlwZTogV29ya2Zsb3dFdmVudFR5cGUuQnVja2V0UmVxdWVzdEZhaWxlZCxcbiAgICAgICAgICAgIG9wZXJhdGlvbjogY2FsbC5vcGVyYXRpb24sXG4gICAgICAgICAgICBzZXEsXG4gICAgICAgICAgICAuLi5ub3JtYWxpemVFcnJvcihlcnIpLFxuICAgICAgICAgIH0sXG4gICAgICAgICAgYmFzZVRpbWVcbiAgICAgICAgKVxuICAgICAgKTtcbiAgICB9XG5cbiAgICByZXR1cm4gY3JlYXRlRXZlbnQ8QnVja2V0UmVxdWVzdD4oXG4gICAgICB7XG4gICAgICAgIHR5cGU6IFdvcmtmbG93RXZlbnRUeXBlLkJ1Y2tldFJlcXVlc3QsXG4gICAgICAgIG9wZXJhdGlvbjoge1xuICAgICAgICAgIG9wZXJhdGlvbjogY2FsbC5vcGVyYXRpb24sXG4gICAgICAgICAgYnVja2V0TmFtZTogY2FsbC5idWNrZXROYW1lLFxuICAgICAgICAgIC8vIEB0cy1pZ25vcmVcbiAgICAgICAgICBwYXJhbXM6IGNhbGwucGFyYW1zLFxuICAgICAgICB9LFxuICAgICAgICBzZXEsXG4gICAgICB9LFxuICAgICAgYmFzZVRpbWVcbiAgICApO1xuICB9XG59XG5cbmFzeW5jIGZ1bmN0aW9uIHN0cmVhbVRvQnVmZmVyKHN0cmVhbTogc3RyZWFtLlJlYWRhYmxlKSB7XG4gIC8vIGxldHMgaGF2ZSBhIFJlYWRhYmxlU3RyZWFtIGFzIGEgc3RyZWFtIHZhcmlhYmxlXG4gIGNvbnN0IGNodW5rcyA9IFtdO1xuXG4gIGZvciBhd2FpdCAoY29uc3QgY2h1bmsgb2Ygc3RyZWFtKSB7XG4gICAgY2h1bmtzLnB1c2goQnVmZmVyLmZyb20oY2h1bmspKTtcbiAgfVxuXG4gIHJldHVybiBCdWZmZXIuY29uY2F0KGNodW5rcyk7XG59XG4iXX0=
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid29ya2Zsb3ctY2FsbC1leGVjdXRvci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy93b3JrZmxvdy1jYWxsLWV4ZWN1dG9yLnR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XCJ0cmFuc2FjdFwiLCBjYWxsKVxuICAgICAgICAgICAgICA/IHVuZGVmaW5lZFxuICAgICAgICAgICAgICA6IGNhbGwuZW50aXR5TmFtZSxcbiAgICAgICAgICAgIHJlc3VsdCxcbiAgICAgICAgICAgIHNlcSxcbiAgICAgICAgICB9LFxuICAgICAgICAgIGJhc2VUaW1lXG4gICAgICAgIClcbiAgICAgICk7XG4gICAgfSBjYXRjaCAoZXJyKSB7XG4gICAgICBhd2FpdCB0aGlzLnByb3BzLmV4ZWN1dGlvblF1ZXVlQ2xpZW50LnN1Ym1pdEV4ZWN1dGlvbkV2ZW50cyhcbiAgICAgICAgZXhlY3V0aW9uSWQsXG4gICAgICAgIGNyZWF0ZUV2ZW50PEVudGl0eVJlcXVlc3RGYWlsZWQ+KFxuICAgICAgICAgIHtcbiAgICAgICAgICAgIHR5cGU6IFdvcmtmbG93RXZlbnRUeXBlLkVudGl0eVJlcXVlc3RGYWlsZWQsXG4gICAgICAgICAgICBzZXEsXG4gICAgICAgICAgICBuYW1lOiBpc0VudGl0eU9wZXJhdGlvbk9mVHlwZShcInRyYW5zYWN0XCIsIGNhbGwpXG4gICAgICAgICAgICAgID8gdW5kZWZpbmVkXG4gICAgICAgICAgICAgIDogY2FsbC5lbnRpdHlOYW1lLFxuICAgICAgICAgICAgb3BlcmF0aW9uOiBjYWxsLm9wZXJhdGlvbixcbiAgICAgICAgICAgIC4uLm5vcm1hbGl6ZUVycm9yKGVyciksXG4gICAgICAgICAgfSxcbiAgICAgICAgICBiYXNlVGltZVxuICAgICAgICApXG4gICAgICApO1xuICAgIH1cblxuICAgIHJldHVybiBjcmVhdGVFdmVudDxFbnRpdHlSZXF1ZXN0PihcbiAgICAgIHtcbiAgICAgICAgdHlwZTogV29ya2Zsb3dFdmVudFR5cGUuRW50aXR5UmVxdWVzdCxcbiAgICAgICAgb3BlcmF0aW9uOiBjYWxsLFxuICAgICAgICBzZXEsXG4gICAgICB9LFxuICAgICAgYmFzZVRpbWVcb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sbCkpIHtcbiAgICAgIC8vIGhhbmRsZSBwdXQgc2VwYXJhdGVseSB0byBzZXJpYWxpemUgdGhlIGlucHV0XG4gICAgICBjb25zdCBba2V5LCBkYXRhXSA9IGNhbGwucGFyYW1zO1xuXG4gICAgICBjb25zdCBidWZmZXIgPVxuICAgICAgICB0eXBlb2YgZGF0YSA9PT0gXCJzdHJpbmdcIiB8fCBkYXRhIGluc3RhbmNlb2YgQnVmZmVyXG4gICAgICAgICAgPyBkYXRhXG4gICAgICAgICAgOiBhd2FpdCBzdHJlYW1Ub0J1ZmZlcihkYXRhKTtcblxuICAgICAgdHJ5IHtcbiAgICAgICAgY29uc3QgcmVzdWx0ID0gYXdhaXQgdGhpcy5wcm9wcy5idWNrZXRTdG9yZS5wdXQoXG4gICAgICAgICAgY2FsbC5idWNrZXROYW1lLFxuICAgICAgICAgIGtleSxcbiAgICAgICAgICBidWZmZXJcbiAgICAgICAgKTtcblxuICAgICAgICBhd2FpdCB0aGlzLnByb3BzLmV4ZWN1dGlvblF1ZXVlQ2xpZW50LnN1Ym1pdEV4ZWN1dGlvbkV2ZW50cyhcbiAgICAgICAgICBleGVjdXRpb25JZCxcbiAgICAgICAgICBjcmVhdGVFdmVudDxCdWNrZXRSZXF1ZXN0U3VjY2VlZGVkPihcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgdHlwZTogV29ya2Zsb3dFdmVudFR5cGUuQnVja2V0UmVxdWVzdFN1Y2NlZWRlZCxcbiAgICAgICAgICAgICAgb3BlcmF0aW9uOiBcInB1dFwiLFxuICAgICAgICAgICAgICByZXN1bHQ6IHtcbiAgICAgICAgICAgICAgICBldGFnOiByZXN1bHQuZXRhZyxcbiAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgc2VxLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGJhc2VUaW1lXG4gICAgICAgICAgKVxuICAgICAgICApO1xuICAgICAgfSBjYXRjaCAoZXJyKSB7XG4gICAgICAgIGF3YWl0IHRoaXMucHJvcHMuZXhlY3V0aW9uUXVldWVDbGllbnQuc3VibWl0RXhlY3V0aW9uRXZlbnRzKFxuICAgICAgICAgIGV4ZWN1dGlvbklkLFxuICAgICAgICAgIGNyZWF0ZUV2ZW50PEJ1Y2tldFJlcXVlc3RGYWlsZWQ+KFxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICB0eXBlOiBXb3JrZmxvd0V2ZW50VHlwZS5CdWNrZXRSZXF1ZXN0RmFpbGVkLFxuICAgICAgICAgICAgICBvcGVyYXRpb246IFwicHV0XCIsXG4gICAgICAgICAgICAgIHNlcSxcbiAgICAgICAgICAgICAgLi4ubm9ybWFsaXplRXJyb3IoZXJyKSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBiYXNlVGltZVxuICAgICAgICAgIClcbiAgICAgICAgKTtcbiAgICAgIH1cblxuICAgICAgcmV0dXJuIGNyZWF0ZUV2ZW50PEJ1Y2tldFJlcXVlc3Q+KFxuICAgICAgICB7XG4gICAgICAgICAgdHlwZTogV29ya2Zsb3dFdmVudFR5cGUuQnVja2V0UmVxdWVzdCxcbiAgICAgICAgICBvcGVyYXRpb246IHtcbiAgICAgICAgICAgIG9wZXJhdGlvbjogXCJwdXRcIixcbiAgICAgICAgICAgIGJ1Y2tldE5hbWU6IGNhbGwuYnVja2V0TmFtZSxcbiAgICAgICAgICAgIGtleSxcbiAgICAgICAgICAgIC8vIHNlcmlhbGl6ZSB0aGUgZGF0YSBwdXQgaW50byBhIHN0cmluZyB0byBiZSBzdG9yZWRcbiAgICAgICAgICAgIGRhdGE6XG4gICAgICAgICAgICAgIHR5cGVvZiBidWZmZXIgPT09IFwic3RyaW5nXCIgPyBidWZmZXIgOiBidWZmZXIudG9TdHJpbmcoXCJiYXNlNjRcIiksXG4gICAgICAgICAgICBpc0Jhc2U2NEVuY29kZWQ6IHR5cGVvZiBidWZmZXIgIT09IFwic3RyaW5nXCIsXG4gICAgICAgICAgfSxcbiAgICAgICAgICBzZXEsXG4gICAgICAgIH0sXG4gICAgICAgIGJhc2VUaW1lXG4gICAgICApO1xuICAgIH1cblxuICAgIHRyeSB7XG4gICAgICAvLyBoYW5kbGUgZ2V0IHNlcGFyYXRlbHkgdG8gc2VyaWFsaXplIHRoZSByZXN1bHRcbiAgICAgIGlmIChpc0J1Y2tldENhbGxUeXBlKFwiZ2V0XCIsIGNhbGwpKSB7XG4gICAgICAgIGNvbnN0IHJlc3VsdCA9IGF3YWl0IHRoaXMucHJvcHMuYnVja2V0U3RvcmUuZ2V0KFxuICAgICAgICAgIGNhbGwuYnVja2V0TmFtZSxcbiAgICAgICAgICAuLi5jYWxsLnBhcmFtc1xuICAgICAgICApO1xuXG4gICAgICAgIGF3YWl0IHRoaXMucHJvcHMuZXhlY3V0aW9uUXVldWVDbGllbnQuc3VibWl0RXhlY3V0aW9uRXZlbnRzKFxuICAgICAgICAgIGV4ZWN1dGlvbklkLFxuICAgICAgICAgIGNyZWF0ZUV2ZW50PEJ1Y2tldFJlcXVlc3RTdWNjZWVkZWQ+KFxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICB0eXBlOiBXb3JrZmxvd0V2ZW50VHlwZS5CdWNrZXRSZXF1ZXN0U3VjY2VlZGVkLFxuICAgICAgICAgICAgICBvcGVyYXRpb246IGNhbGwub3BlcmF0aW9uLFxuICAgICAgICAgICAgICByZXN1bHQ6IHJlc3VsdFxuICAgICAgICAgICAgICAgID8gKHtcbiAgICAgICAgICAgICAgICAgICAgLy8gc2VyaWFsaXplIHRoZSBkYXRhIHJldHJpZXZlZCBkYXRhIHRvIGJlIHN0b3JlZFxuICAgICAgICAgICAgICAgICAgICBib2R5OiAoXG4gICAgICAgICAgICAgICAgICAgICAgYXdhaXQgc3RyZWFtVG9CdWZmZXIocmVzdWx0LmJvZHkpXG4gICAgICAgICAgICAgICAgICAgICkudG9TdHJpbmcoXCJiYXNlNjRcIiksXG4gICAgICAgICAgICAgICAgICAgIGJhc2U2NEVuY29kZWQ6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgIGNvbnRlbnRMZW5ndGg6IHJlc3VsdC5jb250ZW50TGVuZ3RoLFxuICAgICAgICAgICAgICAgICAgICBldGFnOiByZXN1bHQuZXRhZyxcbiAgICAgICAgICAgICAgICAgIH0gc2F0aXNmaWVzIEJ1Y2tldEdldE9iamVjdFNlcmlhbGl6ZWRSZXN1bHQpXG4gICAgICAgICAgICAgICAgOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgIHNlcSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBiYXNlVGltZVxuICAgICAgICAgIClcbiAgICAgICAgKTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGNvbnN0IHJlc3VsdCA9IGF3YWl0IHRoaXMucHJvcHMuYnVja2V0U3RvcmVbY2FsbC5vcGVyYXRpb25dKFxuICAgICAgICAgIGNhbGwuYnVja2V0TmFtZSxcbiAgICAgICAgICAvLyBAdHMtaWdub3JlXG4gICAgICAgICAgLi4uY2FsbC5wYXJhbXNcbiAgICAgICAgKTtcblxuICAgICAgICBhd2FpdCB0aGlzLnByb3BzLmV4ZWN1dGlvblF1ZXVlQ2xpZW50LnN1Ym1pdEV4ZWN1dGlvbkV2ZW50cyhcbiAgICAgICAgICBleGVjdXRpb25JZCxcbiAgICAgICAgICBjcmVhdGVFdmVudDxCdWNrZXRSZXF1ZXN0U3VjY2VlZGVkPihcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgdHlwZTogV29ya2Zsb3dFdmVudFR5cGUuQnVja2V0UmVxdWVzdFN1Y2NlZWRlZCxcbiAgICAgICAgICAgICAgb3BlcmF0aW9uOiBjYWxsLm9wZXJhdGlvbixcbiAgICAgICAgICAgICAgcmVzdWx0LFxuICAgICAgICAgICAgICBzZXEsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgYmFzZVRpbWVcbiAgICAgICAgICApXG4gICAgICAgICk7XG4gICAgICB9XG4gICAgfSBjYXRjaCAoZXJyKSB7XG4gICA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IgYXdhaXQgKGNvbnN0IGNodW5rIG9mIHN0cmVhbSkge1xuICAgIGNodW5rcy5wdXNoKEJ1ZmZlci5mcm9tKGNodW5rKSk7XG4gIH1cblxuICByZXR1cm4gQnVmZmVyLmNvbmNhdChjaHVua3MpO1xufVxuIl19

@@ -1,2 +0,2 @@

import { Entity, Attributes, EntityConsistencyOptions, EntityQueryOptions, EntityQueryResult, EntitySetOptions, EntityWithMetadata } from "@eventual/core";
import { Attributes, Entity, EntityConsistencyOptions, EntityIndex, EntityQueryOptions, EntityQueryResult, EntitySetOptions, EntityWithMetadata, KeyValue } from "@eventual/core";
import { EntityProvider } from "../../providers/entity-provider.js";

@@ -9,2 +9,6 @@ import { EntityStore, NormalizedEntityCompositeKey, NormalizedEntityCompositeKeyComplete, NormalizedEntityKeyCompletePart, NormalizedEntityTransactItem } from "../../stores/entity-store.js";

}
export interface LocalEntity {
data: Map<KeyValue, Map<KeyValue, EntityWithMetadata>>;
indices: Record<string, Map<KeyValue, Map<KeyValue, EntityWithMetadata>>>;
}
export declare class LocalEntityStore extends EntityStore {

@@ -19,6 +23,7 @@ private props;

protected _delete(entity: Entity, key: NormalizedEntityCompositeKeyComplete, options?: EntityConsistencyOptions | undefined): Promise<void>;
protected _query(entity: Entity, queryKey: NormalizedEntityCompositeKey<NormalizedEntityKeyCompletePart>, options?: EntityQueryOptions): Promise<EntityQueryResult>;
protected _query(entity: Entity | EntityIndex, queryKey: NormalizedEntityCompositeKey<NormalizedEntityKeyCompletePart>, options?: EntityQueryOptions): Promise<EntityQueryResult>;
protected _transactWrite(items: NormalizedEntityTransactItem[]): Promise<void>;
private getLocalEntity;
private getPartitionMap;
}
//# sourceMappingURL=entity-store.d.ts.map
import { TransactionCancelled, UnexpectedVersion, } from "@eventual/core";
import { assertNever } from "@eventual/core/internal";
import { EntityStore, convertNormalizedEntityKeyToMap, isCompleteKey, } from "../../stores/entity-store.js";
import { EntityStore, convertNormalizedEntityKeyToMap, isCompleteKey, normalizeCompositeKey, } from "../../stores/entity-store.js";
import { deserializeCompositeKey, serializeCompositeKey } from "../../utils.js";

@@ -22,6 +22,7 @@ import { paginateItems } from "./pagination.js";

const newVersion = options?.incrementVersion === false ? version : version + 1;
this.getPartitionMap(entity, key.partition).set(key.sort?.keyValue ?? "default", {
const newValue = {
value,
version: newVersion,
});
};
setLocalEntity(this.getLocalEntity(entity), newValue, key, entity);
this.props.localConnector.pushWorkflowTask({

@@ -46,13 +47,11 @@ entityName: entity.name,

}
if (!isCompleteKey(key)) {
throw new Error("Entity key cannot be partial for delete");
if (deleteLocalEntity(this.getLocalEntity(entity), key, entity)) {
this.props.localConnector.pushWorkflowTask({
entityName: entity.name,
key: convertNormalizedEntityKeyToMap(key),
operation: "remove",
oldValue: item.value,
oldVersion: item.version,
});
}
this.getPartitionMap(entity, key.partition).delete(key.sort?.keyValue ?? "default");
this.props.localConnector.pushWorkflowTask({
entityName: entity.name,
key: convertNormalizedEntityKeyToMap(key),
operation: "remove",
oldValue: item.value,
oldVersion: item.version,
});
}

@@ -124,8 +123,21 @@ }

}
getPartitionMap(entity, partitionKey) {
const _entity = (this.entities[entity.name] ??= new Map());
let partitionMap = _entity.get(partitionKey.keyValue);
getLocalEntity(entityOrIndex) {
const entity = entityOrIndex.kind === "Entity"
? entityOrIndex
: this.getEntity(entityOrIndex.entityName);
const _entity = (this.entities[entity.name] ??=
initializeLocalEntity(entity));
return _entity;
}
getPartitionMap(entityOrIndex, partitionKey) {
const index = entityOrIndex.kind === "EntityIndex" ? entityOrIndex : undefined;
const _entity = this.getLocalEntity(entityOrIndex);
const table = index ? _entity.indices[index.name] : _entity.data;
if (!table) {
throw new Error(`Index ${index?.name} not found`);
}
let partitionMap = table.get(partitionKey.keyValue);
if (!partitionMap) {
partitionMap = new Map();
_entity.set(partitionKey.keyValue, partitionMap);
table.set(partitionKey.keyValue, partitionMap);
}

@@ -135,2 +147,61 @@ return partitionMap;

}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjoz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7XG4gICAgY29uc3QgX2VudGl0eSA9ICh0aGlzLmVudGl0aWVzW2VudGl0eS5uYW1lXSA/Pz0gbmV3IE1hcDxcbiAgICAgIEtleVZhbHVlLFxuICAgICAgTWFwPEtleVZhbHVlLCBFbnRpdHlXaXRoTWV0YWRhdGE+XG4gICAgPigpKTtcbiAgICBsZXQgcGFydGl0aW9uTWFwID0gX2VudGl0eS5nZXQocGFydGl0aW9uS2V5LmtleVZhbHVlKTtcbiAgICBpZiAoIXBhcnRpdGlvbk1hcCkge1xuICAgICAgcGFydGl0aW9uTWFwID0gbmV3IE1hcDxLZXlWYWx1ZSwgRW50aXR5V2l0aE1ldGFkYXRhPigpO1xuICAgICAgX2VudGl0eS5zZXQocGFydGl0aW9uS2V5LmtleVZhbHVlLCBwYXJ0aXRpb25NYXApO1xuICAgIH1cbiAgICByZXR1cm4gcGFydGl0aW9uTWFwO1xuICB9XG59XG4iXX0=
function initializeLocalEntity(entity) {
return {
data: new Map(),
indices: Object.fromEntries(entity.indices.map((i) => [
i.name,
new Map(),
])),
};
}
function setLocalEntity(localEntity, value, key, entity) {
updatePartitionEntry(localEntity.data, key, value);
entity.indices.forEach((i) => {
const localIndex = localEntity.indices[i.name];
if (!localIndex) {
return;
}
const normalizedKey = normalizeCompositeKey(i.key, value.value);
// if the key isn't complete (missing parts of the index composite key), ignore this item
if (isCompleteKey(normalizedKey)) {
updatePartitionEntry(localIndex, normalizedKey, value);
}
});
function updatePartitionEntry(store, key, value) {
let partitionMap = store.get(key.partition.keyValue);
if (!partitionMap) {
partitionMap = new Map();
store.set(key.partition.keyValue, partitionMap);
}
partitionMap.set(key.sort?.keyValue ?? "default", value);
}
}
function deleteLocalEntity(localEntity, key, entity) {
const value = localEntity.data
.get(key.partition.keyValue)
?.get(key.sort?.keyValue ?? "default");
if (!value) {
return false;
}
const deleted = deletePartitionEntry(localEntity.data, key);
entity.indices.forEach((i) => {
const localIndex = localEntity.indices[i.name];
if (!localIndex) {
return;
}
const normalizedKey = normalizeCompositeKey(i.key, value.value);
// if the key isn't complete (missing parts of the index composite key), ignore this item
if (isCompleteKey(normalizedKey)) {
deletePartitionEntry(localIndex, normalizedKey);
}
});
return deleted;
function deletePartitionEntry(store, key) {
const partitionMap = store.get(key.partition.keyValue);
if (partitionMap) {
return partitionMap.delete(key.sort?.keyValue ?? "default");
}
return false;
}
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW50aXR5LXN0b3JlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL2xvY2FsL3N0b3Jlcy9lbnRpdHktc3RvcmUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQVVMLG9CQUFvQixFQUNwQixpQkFBaUIsR0FDbEIsTUFBTSxnQkFBZ0IsQ0FBQztBQUN4QixPQUFPLEVBQUUsV0FBVyxFQUFFLE1BQU0seUJBQXlCLENBQUM7QUFFdEQsT0FBTyxFQUNMLFdBQVcsRUFLWCwrQkFBK0IsRUFDL0IsYUFBYSxFQUNiLHFCQUFxQixHQUN0QixNQUFNLDhCQUE4QixDQUFDO0FBQ3RDLE9BQU8sRUFBRSx1QkFBdUIsRUFBRSxxQkFBcUIsRUFBRSxNQUFNLGdCQUFnQixDQUFDO0FBRWhGLE9BQU8sRUFBRSxhQUFhLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQztBQVloRCxNQUFNLE9BQU8sZ0JBQWlCLFNBQVEsV0FBVztJQUcvQyxZQUFvQixLQUE0QjtRQUM5QyxLQUFLLENBQUMsS0FBSyxDQUFDLGNBQWMsQ0FBQyxDQUFDO1FBRFYsVUFBSyxHQUFMLEtBQUssQ0FBdUI7UUFGeEMsYUFBUSxHQUFnQyxFQUFFLENBQUM7SUFJbkQsQ0FBQztJQUVrQixLQUFLLENBQUMsZ0JBQWdCLENBQ3ZDLE1BQWMsRUFDZCxHQUF5QztRQUV6QyxPQUFP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RoZSBpbmRleCBjb21wb3NpdGUga2V5KSwgaWdub3JlIHRoaXMgaXRlbVxuICAgIGlmIChpc0NvbXBsZXRlS2V5KG5vcm1hbGl6ZWRLZXkpKSB7XG4gICAgICBkZWxldGVQYXJ0aXRpb25FbnRyeShsb2NhbEluZGV4LCBub3JtYWxpemVkS2V5KTtcbiAgICB9XG4gIH0pO1xuXG4gIHJldHVybiBkZWxldGVkO1xuXG4gIGZ1bmN0aW9uIGRlbGV0ZVBhcnRpdGlvbkVudHJ5KFxuICAgIHN0b3JlOiBNYXA8S2V5VmFsdWUsIE1hcDxLZXlWYWx1ZSwgRW50aXR5V2l0aE1ldGFkYXRhPj4sXG4gICAga2V5OiBOb3JtYWxpemVkRW50aXR5Q29tcG9zaXRlS2V5Q29tcGxldGVcbiAgKSB7XG4gICAgY29uc3QgcGFydGl0aW9uTWFwID0gc3RvcmUuZ2V0KGtleS5wYXJ0aXRpb24ua2V5VmFsdWUpO1xuICAgIGlmIChwYXJ0aXRpb25NYXApIHtcbiAgICAgIHJldHVybiBwYXJ0aXRpb25NYXAuZGVsZXRlKGtleS5zb3J0Py5rZXlWYWx1ZSA/PyBcImRlZmF1bHRcIik7XG4gICAgfVxuICAgIHJldHVybiBmYWxzZTtcbiAgfVxufVxuIl19

@@ -1,2 +0,2 @@

import type { Entity, Attributes, CompositeKey, EntityConsistencyOptions, KeyMap, KeyValue, QueryKey, EntityQueryOptions, EntityQueryResult, EntitySetOptions, EntityTransactItem, EntityWithMetadata } from "@eventual/core";
import type { Entity, Attributes, CompositeKey, EntityConsistencyOptions, KeyMap, KeyValue, QueryKey, EntityQueryOptions, EntityQueryResult, EntitySetOptions, EntityTransactItem, EntityWithMetadata, EntityIndex } from "@eventual/core";
import type { EntityHook, KeyDefinition, KeyDefinitionPart } from "@eventual/core/internal";

@@ -19,3 +19,4 @@ import { EntityProvider } from "../providers/entity-provider.js";

query(entityName: string, queryKey: QueryKey, options?: EntityQueryOptions | undefined): Promise<EntityQueryResult>;
protected abstract _query(entity: Entity, queryKey: NormalizedEntityCompositeKey<NormalizedEntityKeyCompletePart>, options: EntityQueryOptions | undefined): Promise<EntityQueryResult>;
queryIndex(entityName: string, indexName: string, queryKey: QueryKey, options?: EntityQueryOptions | undefined): Promise<EntityQueryOptions>;
protected abstract _query(entity: Entity | EntityIndex, queryKey: NormalizedEntityCompositeKey<NormalizedEntityKeyCompletePart>, options: EntityQueryOptions | undefined): Promise<EntityQueryResult>;
transactWrite(items: EntityTransactItem[]): Promise<void>;

@@ -22,0 +23,0 @@ protected abstract _transactWrite(items: NormalizedEntityTransactItem[]): Promise<void>;

@@ -40,2 +40,13 @@ export class EntityStore {

}
queryIndex(entityName, indexName, queryKey, options) {
const index = this.getEntity(entityName).indices.find((i) => i.name === indexName);
if (!index) {
throw new Error(`Index ${indexName} was not found on entity ${entityName}`);
}
const normalizedKey = normalizeCompositeKey(index.key, queryKey);
if (!isCompleteKeyPart(normalizedKey.partition)) {
throw new Error("Entity Index partition key cannot be partial for query.");
}
return this._query(index, normalizedKey, options);
}
async transactWrite(items) {

@@ -139,2 +150,2 @@ return this._transactWrite(items.map((item) => {

}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW50aXR5LXN0b3JlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3N0b3Jlcy9lbnRpdHktc3RvcmUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBcUJBLE1BQU0sT0FBZ0IsV0FBVztJQUMvQixZQUFvQixjQUE4QjtRQUE5QixtQkFBYyxHQUFkLGNBQWMsQ0FBZ0I7SUFBRyxDQUFDO0lBRS9DLEtBQUssQ0FBQyxHQUFHLENBQUMsVUFBa0IsRUFBRSxHQUFpQjtRQUNwRCxPQUFPLENBQUMsTUFBTSxJQUFJLENBQUMsZUFBZSxDQUFDLFVBQVUsRUFBRSxHQUFHLENBQUMsQ0FBQyxFQUFFLEtB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oa2V5KSkge1xuICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcbiAgICAgICAgICAgIFwiRW50aXR5IGtleSBjYW5ub3QgYmUgcGFydGlhbCBmb3Igc2V0LCBkZWxldGUsIG9yIGNvbmRpdGlvbiBvcGVyYXRpb25zLlwiXG4gICAgICAgICAgKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBpdGVtLm9wZXJhdGlvbiA9PT0gXCJzZXRcIlxuICAgICAgICAgID8ge1xuICAgICAgICAgICAgICBvcGVyYXRpb246IFwic2V0XCIsXG4gICAgICAgICAgICAgIGVudGl0eSxcbiAgICAgICAgICAgICAga2V5LFxuICAgICAgICAgICAgICB2YWx1ZTogaXRlbS52YWx1ZSxcbiAgICAgICAgICAgICAgb3B0aW9uczogaXRlbS5vcHRpb25zLFxuICAgICAgICAgICAgfVxuICAgICAgICAgIDogaXRlbS5vcGVyYXRpb24gPT09IFwiZGVsZXRlXCJcbiAgICAgICAgICA/IHtcbiAgICAgICAgICAgICAgb3BlcmF0aW9uOiBcImRlbGV0ZVwiLFxuICAgICAgICAgICAgICBlbnRpdHksXG4gICAgICAgICAgICAgIGtleSxcbiAgICAgICAgICAgICAgb3B0aW9uczogaXRlbS5vcHRpb25zLFxuICAgICAgICAgICAgfVxuICAgICAgICAgIDoge1xuICAgICAgICAgICAgICBvcGVyYXRpb246IFwiY29uZGl0aW9uXCIsXG4gICAgICAgICAgICAgIGVudGl0eSxcbiAgICAgICAgICAgICAga2V5LFxuICAgICAgICAgICAgICB2ZXJzaW9uOiBpdGVtLnZlcnNpb24sXG4gICAgICAgICAgICB9O1xuICAgICAgfSlcbiAgICApO1xuICB9XG5cbiAgcHJvdGVjdGVkIGFic3RyYWN0IF90cmFuc2FjdFdyaXRlKFxuICAgIGl0ZW1zOiBOb3JtYWxpemVkRW50aXR5VHJhbnNhY3RJdGVtW11cbiAgKTogUHJvbWlzZTx2b2lkPjtcblxuICBwcm90ZWN0ZWQgZ2V0RW50aXR5KGV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gaXRlbS5vcGVyYXRpb24gPT09IFwic2V0XCIgPyBpdGVtLnZhbHVlIDogaXRlbS5rZXk7XG4gICAgICAgIGNvbnN0IGtleSA9IG5vcm1hbGl6ZUNvbXBvc2l0ZUtleShlbnRpdHksIGtleVZhbHVlKTtcbiAgICAgICAgaWYgKCFpc0NvbXBsZXRlS2V5KGtleSkpIHtcbiAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXG4gICAgICAgICAgICBcIkVudGl0eSBrZXkgY2Fubm90IGJlIHBhcnRpYWwgZm9yIHNldCwgZGVsZXRlLCBvciBjb25kaXRpb24gb3BlcmF0aW9ucy5cIlxuICAgICAgICAgICk7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gaXRlbS5vcGVyYXRpb24gPT09IFwic2V0XCJcbiAgICAgICAgICA/IHtcbiAgICAgICAgICAgICAgb3BlcmF0aW9uOiBcInNldFwiLFxuICAgICAgICAgICAgICBlbnRpdHksXG4gICAgICAgICAgICAgIGtleSxcbiAgICAgICAgICAgICAgdmFsdWU6IGl0ZW0udmFsdWUsXG4gICAgICAgICAgICAgIG9wdGlvbnM6IGl0ZW0ub3B0aW9ucyxcbiAgICAgICAgICAgIH1cbiAgICAgICAgICA6IGl0ZW0ub3BlcmF0aW9uID09PSBcImRlbGV0ZVwiXG4gICAgICAgICAgPyB7XG4gICAgICAgICAgICAgIG9wZXJhdGlvbjogXCJkZWxldGVcIixcbiAgICAgICAgICAgICAgZW50aXR5LFxuICAgICAgICAgICAgICBrZXksXG4gICAgICAgICAgICAgIG9wdGlvbnM6IGl0ZW0ub3B0aW9ucyxcbiAgICAgICAgICAgIH1cbiAgICAgICAgICA6IHtcbiAgICAgICAgICAgICAgb3BlcmF0aW9uOiBcImNvbmRpdGlvblwiLFxuICAgICAgICAgICAgICBlbnRpdHksXG4gICAgICAgICAgICAgIGtleSxcbiAgICAgICAgICAgICAgdmVyc2lvbjogaXRlbS52ZXJzaW9uLFxuICAgICAgICAgICAgfTtcbiAg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CwgdmFsdWVdKVxuICAgICAgOiBbXSksXG4gIF0pO1xuICBjb25zb2xlLmxvZyhcImdlbmVyYXRlZCBrZXlcIiwgSlNPTi5zdHJpbmdpZnkoZ2VuZXJhdGVkS2V5KSk7XG4gIHJldHVybiBnZW5lcmF0ZWRLZXk7XG59XG4iXX0=

@@ -159,2 +159,5 @@ import { assertNever, isAwaitTimerCall, isBucketCall, isBucketCallType, isChildExecutionTarget, isChildWorkflowCall, isConditionCall, isEmitEventsCall, isEntityCall, isEntityOperationOfType, isExpectSignalCall, isInvokeTransactionCall, isRegisterSignalHandlerCall, isSendSignalCall, isTaskCall, WorkflowEventType, } from "@eventual/core/internal";

}
else if (isEntityOperationOfType("queryIndex", operation)) {
return self.props.entityStore.queryIndex(operation.entityName, operation.indexName, ...operation.params);
}
return self.props.entityStore[operation.operation](operation.entityName,

@@ -299,2 +302,2 @@ // @ts-ignore

}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid29ya2Zsb3ctY2FsbC1leGVjdXRvci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy93b3JrZmxvdy1jYWxsLWV4ZWN1dG9yLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLE9BQU8sRUFDTCxXQUFXLEVBa0JYLGdCQUFnQixFQUNoQixZQUFZLEVBQ1osZ0JBQWdCLEVBQ2hCLHNCQUFzQixFQUN0QixtQkFBbUIsRUFDbkIsZUFBZSxFQUNmLGdCQUFnQixFQUNoQixZQUFZLEVBQ1osdUJBQXVCLEVBQ3ZCLGtCQUFrQixFQUNsQix1QkFBdUIsRUFDdkIsMkJBQTJCLEVBQzNCLGdCQUFnQixFQUNoQixVQUFVLEVBVVYsaUJBQWlCLEdBQ2xCLE1BQU0seUJBQXlCLENBQUM7QUFRakMsT0FBTyxFQUFFLHdCQUF3QixFQUFFLGlCQUFpQixFQUFFLE1BQU0sZ0JBQWd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Zsb3dFdmVudFR5cGUuVHJhbnNhY3Rpb25SZXF1ZXN0RmFpbGVkLFxuICAgICAgICAgICAgICBlcnJvcjogXCJUcmFuc2FjdGlvbiBGYWlsZWRcIixcbiAgICAgICAgICAgICAgbWVzc2FnZTogXCJcIixcbiAgICAgICAgICAgICAgc2VxLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGJhc2VUaW1lXG4gICAgICAgICAgKVxuICAgICAgICApO1xuICAgICAgfVxuICAgIH0gY2F0Y2ggKGVycikge1xuICAgICAgYXdhaXQgdGhpcy5wcm9wcy5leGVjdXRpb25RdWV1ZUNsaWVudC5zdWJtaXRFeGVjdXRpb25FdmVudHMoXG4gICAgICAgIGV4ZWN1dGlvbklkLFxuICAgICAgICBjcmVhdGVFdmVudDxUcmFuc2FjdGlvblJlcXVlc3RGYWlsZWQ+KFxuICAgICAgICAgIHtcbiAgICAgICAgICAgIHR5cGU6IFdvcmtmbG93RXZlbnRUeXBlLlRyYW5zYWN0aW9uUmVxdWVzdEZhaWxlZCxcbiAgICAgICAgICAgIC4uLm5vcm1hbGl6ZUVycm9yKGVyciksXG4gICAgICAgICAgICBzZXEsXG4gICAgICAgICAgfSxcbiAgICAgICAgICBiYXNlVGltZVxuICAgICAgICApXG4gICAgICApO1xuICAgIH1cblxuICAgIHJldHVybiBjcmVhdGVFdmVudDxUcmFuc2FjdGlvblJlcXVlc3Q+KFxuICAgICAge1xuICAgICAgICB0eXBlOiBXb3JrZmxvd0V2ZW50VHlwZS5UcmFuc2FjdGlvblJlcXVlc3QsXG4gICAgICAgIGlucHV0OiBjYWxsLmlucHV0LFxuICAgICAgICB0cmFuc2FjdGlvbk5hbWU6IGNhbGwudHJhbnNhY3Rpb25OYW1lLFxuICAgICAgICBzZXEsXG4gICAgICB9LFxuICAgICAgYmFzZVRpbWVcbiAgICApO1xuICB9XG5cbiAgcHJpdmF0ZSBhc3luYyBpbnZva2VCdWNrZXRSZXF1ZXN0KFxuICAgIGNhbGw6IEJ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xuICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICBzZXEsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgYmFzZVRpbWVcbiAgICAgICAgICApXG4gICAgICAgICk7XG4gICAgICB9IGNhdGNoIChlcnIpIHtcbiAgICAgICAgYXdhaXQgdGhpcy5wcm9wcy5leGVjdXRpb25RdWV1ZUNsaWVudC5zdWJtaXRFeGVjdXRpb25FdmVudHMoXG4gICAgICAgICAgZXhlY3V0aW9uSWQsXG4gICAgICAgICAgY3JlYXRlRXZlbnQ8QnVja2V0UmVxdWVzdEZhaWxlZD4oXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgIHR5cGU6IFdvcmtmbG93RXZlbnRUeXBlLkJ1Y2tldFJlcXVlc3RGYWlsZWQsXG4gICAgICAgICAgICAgIG9wZXJhdGlvbjogXCJwdXRcIixcbiAgICAgICAgICAgICAgc2VxLFxuICAgICAgICAgICAgICAuLi5ub3JtYWxpemVFcnJvcihlcnIpLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGJhc2VUaW1lXG4gICAgICAgICAgKVxuICAgICAgICApO1xuICAgICAgfVxuXG4gICAgICByZXR1cm4gY3JlYXRlRXZlbnQ8QnVja2V0UmVxdWVzdD4oXG4gICAgICAgIHtcbiAgICAgICAgICB0eXBlOiBXb3JrZmxvd0V2ZW50VHlwZS5CdWNrZXRSZXF1ZXN0LFxuICAgICAgICAgIG9wZXJhdGlvbjoge1xuICAgICAgICAgICAgb3BlcmF0aW9uOiBcInB1dFwiLFxuICAgICAgICAgICAgYnVja2V0TmFtZTogY2FsbC5idWNrZXROYW1lLFxuICAgICAgICAgICAga2V5LFxuICAgICAgICAgICAgLy8gc2VyaWFsaXplIHRoZSBkYXRhIHB1dCBpbnRvIGEgc3RyaW5nIHRvIGJlIHN0b3JlZFxuICAgICAgICAgICAgZGF0YTpcbiAgICAgICAgICAgICAgdHlwZW9mIGJ1ZmZlciA9PT0gXCJzdHJpbmdcIiA/IGJ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AgICAgICAgICAgICBhd2FpdCBzdHJlYW1Ub0J1ZmZlcihyZXN1bHQuYm9keSlcbiAgICAgICAgICAgICAgICAgICAgKS50b1N0cmluZyhcImJhc2U2NFwiKSxcbiAgICAgICAgICAgICAgICAgICAgYmFzZTY0RW5jb2RlZDogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgY29udGVudExlbmd0aDogcmVzdWx0LmNvbnRlbnRMZW5ndGgsXG4gICAgICAgICAgICAgICAgICAgIGV0YWc6IHJlc3VsdC5ldGFnLFxuICAgICAgICAgICAgICAgICAgfSBzYXRpc2ZpZXMgQnVja2V0R2V0T2JqZWN0U2VyaWFsaXplZFJlc3VsdClcbiAgICAgICAgICAgICAgICA6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgc2VxLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGJhc2VUaW1lXG4gICAgICAgICAgKVxuICAgICAgICApO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgY29uc3QgcmVzdWx0ID0gYXdhaXQgdGhpcy5wcm9wcy5idWNrZXRTdG9yZVtjYWxsLm9wZXJhdGlvbl0oXG4gICAgICAgICAgY2FsbC5idWNrZXROYW1lLFxuICAgICAgICAgIC8vIEB0cy1pZ25vcmVcbiAgICAgICAgICAuLi5jYWxsLnBhcmFtc1xuICAgICAgICApO1xuXG4gICAgICAgIGF3YWl0IHRoaXMucHJvcHMuZXhlY3V0aW9uUXVldWVDbGllbnQuc3VibWl0RXhlY3V0aW9uRXZlbnRzKFxuICAgICAgICAgIGV4ZWN1dGlvbklkLFxuICAgICAgICAgIGNyZWF0ZUV2ZW50PEJ1Y2tldFJlcXVlc3RTdWNjZWVkZWQ+KFxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICB0eXBlOiBXb3JrZmxvd0V2ZW50VHlwZS5CdWNrZXRSZXF1ZXN0U3VjY2VlZGVkLFxuICAgICAgICAgICAgICBvcGVyYXRpb246IGNhbGwub3BlcmF0aW9uLFxuICAgICAgICAgICAgICByZXN1bHQsXG4gICAgICAgICAgICAgIHNlcSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBiYXNlVGltZVxuICAgICAgICAgIClcbiAgICAgICAgKTtcbiAgICAgIH1cbiAgICB9IGNhdGNoIChlcnIpIHtcbiAgICAgIGF3YWl0IHRoaXMucHJvcHMuZXhlY3V0aW9uUXVldWVDbGllbnQuc3VibWl0RXhlY3V0aW9uRXZlbnRzKFxuICAgICAgICBleGVjdXRpb25JZCxcbiAgICAgICAgY3JlYXRlRXZlbnQ8QnVja2V0UmVxdWVzdEZhaWxlZD4oXG4gICAgICAgICAge1xuICAgICAgICAgICAgdHlwZTogV29ya2Zsb3dFdmVudFR5cGUuQnVja2V0UmVxdWVzdEZhaWxlZCxcbiAgICAgICAgICAgIG9wZXJhdGlvbjogY2FsbC5vcGVyYXRpb24sXG4gICAgICAgICAgICBzZXEsXG4gICAgICAgICAgICAuLi5ub3JtYWxpemVFcnJvcihlcnIpLFxuICAgICAgICAgIH0sXG4gICAgICAgICAgYmFzZVRpbWVcbiAgICAgICAgKVxuICAgICAgKTtcbiAgICB9XG5cbiAgICByZXR1cm4gY3JlYXRlRXZlbnQ8QnVja2V0UmVxdWVzdD4oXG4gICAgICB7XG4gICAgICAgIHR5cGU6IFdvcmtmbG93RXZlbnRUeXBlLkJ1Y2tldFJlcXVlc3QsXG4gICAgICAgIG9wZXJhdGlvbjoge1xuICAgICAgICAgIG9wZXJhdGlvbjogY2FsbC5vcGVyYXRpb24sXG4gICAgICAgICAgYnVja2V0TmFtZTogY2FsbC5idWNrZXROYW1lLFxuICAgICAgICAgIC8vIEB0cy1pZ25vcmVcbiAgICAgICAgICBwYXJhbXM6IGNhbGwucGFyYW1zLFxuICAgICAgICB9LFxuICAgICAgICBzZXEsXG4gICAgICB9LFxuICAgICAgYmFzZVRpbWVcbiAgICApO1xuICB9XG59XG5cbmFzeW5jIGZ1bmN0aW9uIHN0cmVhbVRvQnVmZmVyKHN0cmVh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gIGV4ZWN1dGlvbklkOiBzdHJpbmcsXG4gICAgY2FsbDogRW50aXR5Q2FsbCxcbiAgICBzZXE6IG51bWJlcixcbiAgICBiYXNlVGltZTogRGF0ZVxuICApIHtcbiAgICBjb25zdCBzZWxmID0gdGhpcztcbiAgICB0cnkge1xuICAgICAgY29uc3QgcmVzdWx0ID0gYXdhaXQgaW52b2tlRW50aXR5T3BlcmF0aW9uKGNhbGwpO1xuICAgICAgYXdhaXQgdGhpcy5wcm9wcy5leGVjdXRpb25RdWV1ZUNsaWVudC5zdWJtaXRFeGVjdXRpb25FdmVudHMoXG4gICAgICAgIGV4ZWN1dGlvbklkLFxuICAgICAgICBjcmVhdGVFdmVudDxFbnRpdHlSZXF1ZXN0U3VjY2VlZGVkPihcbiAgICAgICAgICB7XG4gICAgICAgICAgICB0eXBlOiBXb3JrZmxvd0V2ZW50VHlwZS5FbnRpdHlSZXF1ZXN0U3VjY2VlZGVkLFxuICAgICAgICAgICAgb3BlcmF0aW9uOiBjYWxsLm9wZXJhdGlvbixcbiAgICAgICAgICAgIG5hbWU6IGlzRW50aXR5T3BlcmF0aW9uT2ZUeXBlKFwidHJhbnNhY3RcIiwgY2FsbClcbiAgICAgICAgICAgICAgPyB1bmRlZmluZWRcbiAgICAgICAgICAgICAgOiBjYWxsLmVudGl0eU5hbWUsXG4gICAgICAgICAgICByZXN1bHQsXG4gICAgICAgICAgICBzZXEsXG4gICAgICAgICAgfSxcbiAgICAgICAgICBiYXNlVGltZVxuICAgICAgICApXG4gICAgICApO1xuICAgIH0gY2F0Y2ggKGVycikge1xuICAgICAgYXdhaXQgdGhpcy5wcm9wcy5leGVjdXRpb25RdWV1ZUNsaWVudC5zdWJtaXRFeGVjdXRpb25FdmVudHMoXG4gICAgICAgIGV4ZWN1dGlvbklkLFxuICAgICAgICBjcmVhdGVFdmVudDxFbnRpdHlSZXF1ZXN0RmFpbGVkPihcbiAgICAgICAgICB7XG4gICAgICAgICAgICB0eXBlOiBXb3JrZmxvd0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Y2NlZWRlZCxcbiAgICAgICAgICAgICAgcmVzdWx0OiByZXN1bHQub3V0cHV0LFxuICAgICAgICAgICAgICBzZXEsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgYmFzZVRpbWVcbiAgICAgICAgICApXG4gICAgICAgICk7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBhd2FpdCB0aGlzLnByb3BzLmV4ZWN1dGlvblF1ZXVlQ2xpZW50LnN1Ym1pdEV4ZWN1dGlvbkV2ZW50cyhcbiAgICAgICAgICBleGVjdXRpb25JZCxcbiAgICAgICAgICBjcmVhdGVFdmVudDxUcmFuc2FjdGlvblJlcXVlc3RGYWlsZWQ+KFxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICB0eXBlOiBXb3JrZmxvd0V2ZW50VHlwZS5UcmFuc2FjdGlvblJlcXVlc3RGYWlsZWQsXG4gICAgICAgICAgICAgIGVycm9yOiBcIlRyYW5zYWN0aW9uIEZhaWxlZFwiLFxuICAgICAgICAgICAgICBtZXNzYWdlOiBcIlwiLFxuICAgICAgICAgICAgICBzZXEsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgYmFzZVRpbWVcbiAgICAgICAgICApXG4gICAgICAgICk7XG4gICAgICB9XG4gICAgfSBjYXRjaCAoZXJyKSB7XG4gICAgICBhd2FpdCB0aGlzLnByb3BzLmV4ZWN1dGlvblF1ZXVlQ2xpZW50LnN1Ym1pdEV4ZWN1dGlvbkV2ZW50cyhcbiAgICAgICAgZXhlY3V0aW9uSWQsXG4gICAgICAgIGNyZWF0ZUV2ZW50PFRyYW5zYWN0aW9uUmVxdWVzdEZhaWxlZD4oXG4gICAgICAgICAge1xuICAgICAgICAgICAgdHlwZTogV29ya2Zsb3dFdmVudFR5cGUuVHJhbnNhY3Rpb25SZXF1ZXN0RmFpbGVkLFxuICAgICAgICAgICAgLi4ubm9ybWFsaXplRXJyb3IoZXJyKSxcbiAgICAgICAgICAgIHNlcSxcbiAgICAgICAgICB9LFxuICAgIC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yXG4gICAgICAgICk7XG5cbiAgICAgICAgYXdhaXQgdGhpcy5wcm9wcy5leGVjdXRpb25RdWV1ZUNsaWVudC5zdWJtaXRFeGVjdXRpb25FdmVudHMoXG4gICAgICAgICAgZXhlY3V0aW9uSWQsXG4gICAgICAgICAgY3JlYXRlRXZlbnQ8QnVja2V0UmVxdWVzdFN1Y2NlZWRlZD4oXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgIHR5cGU6IFdvcmtmbG93RXZlbnRUeXBlLkJ1Y2tldFJlcXVlc3RTdWNjZWVkZWQsXG4gICAgICAgICAgICAgIG9wZXJhdGlvbjogXCJwdXRcIixcbiAgICAgICAgICAgICAgcmVzdWx0OiB7XG4gICAgICAgICAgICAgICAgZXRhZzogcmVzdWx0LmV0YWcsXG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgIHNlcSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBiYXNlVGltZVxuICAgICAgICAgIClcbiAgICAgICAgKTtcbiAgICAgIH0gY2F0Y2ggKGVycikge1xuICAgICAgICBhd2FpdCB0aGlzLnByb3BzLmV4ZWN1dGlvblF1ZXVlQ2xpZW50LnN1Ym1pdEV4ZWN1dGlvbkV2ZW50cyhcbiAgICAgICAgICBleGVjdXRpb25JZCxcbiAgICAgICAgICBjcmVhdGVFdmVudDxCdWNrZXRSZXF1ZXN0RmFpbGVkPihcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgdHlwZTogV29ya2Zsb3dFdmVudFR5cGUuQnVja2V0UmVxdWVzdEZhaWxlZCxcbiAgICAgICAgICAgICAgb3BlcmF0aW9uOiBcInB1dFwiLFxuICAgICAgICAgICAgICBzZXEsXG4gICAgICAgICAgICAgIC4uLm5vcm1hbGl6ZUVycm9yKGVyciksXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgYmFzZVRpbWVcbiAgICAgICAgICApXG4gICAgICAgICk7XG4gICAgICB9XG5cbiAgICAgIHJldHVybiBjcmVhdG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AgICAgICAgICBjcmVhdGVFdmVudDxCdWNrZXRSZXF1ZXN0U3VjY2VlZGVkPihcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgdHlwZTogV29ya2Zsb3dFdmVudFR5cGUuQnVja2V0UmVxdWVzdFN1Y2NlZWRlZCxcbiAgICAgICAgICAgICAgb3BlcmF0aW9uOiBjYWxsLm9wZXJhdGlvbixcbiAgICAgICAgICAgICAgcmVzdWx0OiByZXN1bHRcbiAgICAgICAgICAgICAgICA/ICh7XG4gICAgICAgICAgICAgICAgICAgIC8vIHNlcmlhbGl6ZSB0aGUgZGF0YSByZXRyaWV2ZWQgZGF0YSB0byBiZSBzdG9yZWRcbiAgICAgICAgICAgICAgICAgICAgYm9keTogKFxuICAgICAgICAgICAgICAgICAgICAgIGF3YWl0IHN0cmVhbVRvQnVmZmVyKHJlc3VsdC5ib2R5KVxuICAgICAgICAgICAgICAgICAgICApLnRvU3RyaW5nKFwiYmFzZTY0XCIpLFxuICAgICAgICAgICAgICAgICAgICBiYXNlNjRFbmNvZGVkOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICBjb250ZW50TGVuZ3RoOiByZXN1bHQuY29udGVudExlbmd0aCxcbiAgICAgICAgICAgICAgICAgICAgZXRhZzogcmVzdWx0LmV0YWcsXG4gICAgICAgICAgICAgICAgICB9IHNhdGlzZmllcyBCdWNrZXRHZXRPYmplY3RTZXJpYWxpemVkUmVzdWx0KVxuICAgICAgICAgICAgICAgIDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICBzZXEsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgYmFzZVRpbWVcbiAgICAgICAgICApXG4gICAgICAgICk7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBjb25zdCByZXN1bHQgPSBhd2FpdCB0aGlzLnByb3BzLmJ1Y2tldFN0b3JlW2NhbGwub3BlcmF0aW9uXShcbiAgICAgICAgICBjYWxsLmJ1Y2tldE5hbWUsXG4gICAgICAgICAgLy8gQHRzLWlnbm9yZVxuICAgICAgICAgIC4uLmNhbGwucGFyYW1zXG4gICAgICAgICk7XG5cbiAgICAgICAgYXdhaXQgdGhpcy5wcm9wcy5leGVjdXRpb25RdWV1ZUNsaWVudC5zdWJtaXRFeGVjdXRpb25FdmVudHMoXG4gICAgICAgICAgZXhlY3V0aW9uSWQsXG4gICAgICAgICAgY3JlYXRlRXZlbnQ8QnVja2V0UmVxdWVzdFN1Y2NlZWRlZD4oXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgIHR5cGU6IFdvcmtmbG93RXZlbnRUeXBlLkJ1Y2tldFJlcXVlc3RTdWNjZWVkZWQsXG4gICAgICAgICAgICAgIG9wZXJhdGlvbjogY2FsbC5vcGVyYXRpb24sXG4gICAgICAgICAgICAgIHJlc3VsdCxcbiAgICAgICAgICAgICAgc2VxLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGJhc2VUaW1lXG4gICAgICAgICAgKVxuICAgICAgICApO1xuICAgICAgfVxuICAgIH0gY2F0Y2ggKGVycikge1xuICAgICAgYXdhaXQgdGhpcy5wcm9wcy5leGVjdXRpb25RdWV1ZUNsaWVudC5zdWJtaXRFeGVjdXRpb25FdmVudHMoXG4gICAgICAgIGV4ZWN1dGlvbklkLFxuICAgICAgICBjcmVhdGVFdmVudDxCdWNrZXRSZXF1ZXN0RmFpbGVkPihcbiAgICAgICAgICB7XG4gICAgICAgICAgICB0eXBlOiBXb3JrZmxvd0V2ZW50VHlwZS5CdWNrZXRSZXF1ZXN0RmFpbGVkLFxuICAgICAgICAgICAgb3BlcmF0aW9uOiBjYWxsLm9wZXJhdGlvbixcbiAgICAgICAgICAgIHNlcSxcbiAgICAgICAgICAgIC4uLm5vcm1hbGl6ZUVycm9yKGVyciksXG4gICAgICAgICAgfSxcbiAgICAgICAgICBiYXNlVGltZVxuICAgICAgICApXG4gICAgICApO1xuICAgIH1cblxuICAgIHJldHVybiBjcmVhdGVFdmVudDxCdWNrZXRSZXF1ZXN0PihcbiAgICAgIHtcbiAgICAgICAgdHlwZTogV29ya2Zsb3dFdmVudFR5cGUuQnVja2V0UmVxdWVzdCxcbiAgICAgICAgb3BlcmF0aW9uOiB7XG4gICAgICAgICAgb3BlcmF0aW9uOiBjYWxsLm9wZXJhdGlvbixcbiAgICAgICAgICBidWNrZXROYW1lOiBjYWxsLmJ1Y2tldE5hbWUsXG4gICAgICAgICAgLy8gQHRzLWlnbm9yZVxuICAgICAgICAgIHBhcmFtczogY2FsbC5wYXJhbXMsXG4gICAgICAgIH0sXG4gICAgICAgIHNlcSxcbiAgICAgIH0sXG4gICAgICBiYXNlVGltZVxuICAgICk7XG4gIH1cbn1cblxuYXN5bmMgZnVuY3Rpb24gc3RyZWFtVG9CdWZmZXIoc3RyZWFtOiBzdHJlYW0uUmVhZGFibGUpIHtcbiAgLy8gbGV0cyBoYXZlIGEgUmVhZGFibGVTdHJlYW0gYXMgYSBzdHJlYW0gdmFyaWFibGVcbiAgY29uc3QgY2h1bmtzID0gW107XG5cbiAgZm9yIGF3YWl0IChjb25zdCBjaHVuayBvZiBzdHJlYW0pIHtcbiAgICBjaHVua3MucHVzaChCdWZmZXIuZnJvbShjaHVuaykpO1xuICB9XG5cbiAgcmV0dXJuIEJ1ZmZlci5jb25jYXQoY2h1bmtzKTtcbn1cbiJdfQ==
{
"name": "@eventual/core-runtime",
"version": "0.37.3",
"version": "0.38.0",
"exports": {

@@ -20,3 +20,3 @@ ".": {

"zod": "^3.21.4",
"@eventual/core": "^0.37.3"
"@eventual/core": "^0.38.0"
},

@@ -28,3 +28,3 @@ "devDependencies": {

"jest": "^29",
"ts-jest": "^29",
"ts-jest": "^29.1.0",
"ts-node": "^10.9.1",

@@ -31,0 +31,0 @@ "typescript": "^5"

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc