{"version":3,"sources":["storage-map.ts"],"sourcesContent":["// deno-lint-ignore-file no-this-alias\n\nimport { Compiler } from \"../compiler/compiler.ts\";\nimport { DX_PTR } from \"../runtime/constants.ts\";\nimport { Pointer } from \"../runtime/pointers.ts\";\nimport { MatchOptions, Storage } from \"../storage/storage.ts\";\nimport { Class } from \"../utils/global_types.ts\";\nimport { MatchInput, MatchResult, match } from \"../utils/match.ts\";\nimport { Type } from \"./type.ts\";\n\n\n/**\n * WeakMap that outsources values to storage.\n * The API is similar to the JS WeakMap API, but all methods are async.\n * In contrast to JS WeakMaps, primitive keys are also allowed.\n * The StorageWeakMap holds no strong references to its keys in storage.\n * This means that the pointer of a key can be garbage collected.\n */\nexport class StorageWeakMap<K,V> {\n\n\t/**\n\t * Create a new StorageWeakMap instance with the given key and value types.\n\t * @param keyType Class or DATEX Type of the keys\n\t * @param valueType\tClass or DATEX Type of the values\n\t * @returns \n\t */\n\tstatic of<K,V>(keyType:Class<K>|Type<K>|undefined|null, valueType: Class<V>|Type<V>): StorageWeakMap<K,V> {\n\t\tconst storageMap = new this<K,V>();\n\t\tstorageMap.#_type = valueType instanceof Type ? valueType : Type.getClassDatexType(valueType);\n\t\tstorageMap._type = storageMap.#_type.namespace + \":\" + storageMap.#_type.name;\n\t\treturn storageMap;\n\t}\n\n\t_type?: string\n\t#_type?: Type<V>;\n\n\tprotected get type() {\n\t\tif (!this._type) return undefined;\n\t\tif (!this.#_type) this.#_type = Type.get(this._type);\n\t\treturn this.#_type;\n\t}\n\n\t#prefix?: string;\n\n\t/**\n\t * Time in milliseconds after which a value is removed from the in-memory cache\n\t * Default: 5min\n\t */\n\tcacheTimeout = 5 * 60 * 1000;\n\n\t/**\n\t * If true, non-pointer objects are allowed as \n\t * values in the map (default)\n\t * Otherwise, object values are automatically proxified\n\t * when added to the map.\n\t */\n\tallowNonPointerObjectValues = false;\n\n\t// StorageWeakMaps are not bound to a pointer per default, but a pointer is automatically created if needed\n\t#_pointer?: Pointer;\n\tget #pointer() {\n\t\tif (!this.#_pointer) this.#_pointer = Pointer.getByValue(this);\n\t\tif (!this.#_pointer) {\n\t\t\tPointer.proxifyValue(this);\n\t\t\tthis.#_pointer = Pointer.getByValue(this)!;\n\t\t}\n\t\treturn this.#_pointer;\n\t}\n\n\tstatic async from<K,V>(entries: readonly (readonly [K, V])[]){\n\t\tconst map = $$(new StorageWeakMap<K,V>());\n\t\tfor (const [key, value] of entries) await map.set(key, value);\n\t\treturn map;\n\t}\n\n\tprotected get _prefix() {\n\t\tif (!this.#prefix) this.#prefix = 'dxmap::'+this.#pointer.idString()+'.';\n\t\treturn this.#prefix;\n\t}\n\n\tasync get(key: K): Promise<V|undefined> {\n\t\tconst storage_key = await this.getStorageKey(key);\n\t\treturn this._get(storage_key);\n\t}\n\n\tprotected _get(storage_key:string) {\n\t\tthis.activateCacheTimeout(storage_key);\n\t\treturn Storage.getItem(storage_key);\n\t}\n\n\tasync has(key: K): Promise<boolean> {\n\t\tconst storage_key = await this.getStorageKey(key);\n\t\treturn this._has(storage_key);\n\t}\n\tprotected _has(storage_key:string) {\n\t\treturn Storage.hasItem(storage_key)\n\t}\n\n\tasync delete(key: K) {\n\t\tconst storage_key = await this.getStorageKey(key);\n\t\treturn this._delete(storage_key);\n\t}\n\tprotected _delete(storage_key:string) {\n\t\treturn Storage.removeItem(storage_key)\n\t}\n\n\tasync set(key: K, value:V) {\n\t\tconst storage_key = await this.getStorageKey(key);\n\t\treturn this._set(storage_key, value);\n\t}\n\tprotected async _set(storage_key:string, value:V) {\n\t\t// proxify value\n\t\tif (!this.allowNonPointerObjectValues) {\n\t\t\tvalue = this.#pointer.proxifyChild(\"\", value);\n\t\t}\n\t\tthis.activateCacheTimeout(storage_key);\n\t\tawait Storage.setItem(storage_key, value)\n\t\treturn this;\n\t}\n\n\tprotected activateCacheTimeout(storage_key:string){\n\t\tsetTimeout(()=>{\n\t\t\tStorage.cache.delete(storage_key)\n\t\t}, this.cacheTimeout);\n\t}\n\n\tprotected async getStorageKey(key: K) {\n\t\tconst keyHash = await Compiler.getUniqueValueIdentifier(key);\n\t\t// @ts-ignore DX_PTR\n\t\treturn this._prefix + keyHash;\n\t}\n\n\tasync clear() {\n\t\tconst promises = [];\n\t\tfor (const key of await Storage.getItemKeysStartingWith(this._prefix)) {\n\t\t\tpromises.push(Storage.removeItem(key));\n\t\t}\n\t\tawait Promise.all(promises);\n\t}\n\n}\n\n/**\n * Set that outsources values to storage.\n * The API is similar to the JS Map API, but all methods are async.\n */\nexport class StorageMap<K,V> extends StorageWeakMap<K,V> {\n\n\t/**\n\t * Create a new StorageMap instance with the given key and value types.\n\t * @param keyType Class or DATEX Type of the keys\n\t * @param valueType Class or DATEX Type of the values\n\t * @returns \n\t */\n\tstatic of<K, V>(keyType:Class<K>|Type<K>, valueType: Class<V>|Type<V>): StorageMap<K, V> {\n\t\treturn super.of(keyType, valueType) as StorageMap<K, V>;\n\t}\n\n\tstatic override async from<K,V>(entries: readonly (readonly [K, V])[]){\n\t\tconst map = $$(new StorageMap<K,V>());\n\t\tfor (const [key, value] of entries) await map.set(key, value);\n\t\treturn map;\n\t}\n\n\t#key_prefix = 'key.'\n\n\t#size?: number;\n\n\tget size() {\n\t\tif (this.#size == undefined) throw new Error(\"size not yet available. use getSize() instead\");\n\t\treturn this.#size;\n\t}\n\n\tasync getSize() {\n\t\tif (this.#size != undefined) return this.#size;\n\t\telse {\n\t\t\tawait this.#determineSizeFromStorage(); \n\t\t\treturn this.#size!\n\t\t}\n\t}\n\n\tasync getKeyForValue(value: V): Promise<K|undefined> {\n\t\tconst keyId = await Storage.getItemKey(value);\n\t\tconst key = await Storage.getItem(this.#key_prefix + keyId);\n\t\treturn key;\n\t}\n\n\t/**\n\t * Sets this.#size to the correct value determined from storage.\n\t */\n\tasync #determineSizeFromStorage() {\n\t\tconst calculatedSize = await Storage.getItemCountStartingWith(this._prefix);\n\t\tthis.#updateSize(calculatedSize);\n\t}\n\n\t#updateSize(newSize: number) {\n\t\tthis.#size = newSize;\n\t}\n\n\tasync #incrementSize() {\n\t\tthis.#updateSize(this.#size == undefined ? await this.getSize() : this.#size + 1);\n\t}\n\t\n\tasync #decrementSize() {\n\t\tthis.#updateSize(this.#size == undefined ? await this.getSize() : this.#size - 1);\n\t}\n\n\toverride async set(key: K, value: V): Promise<this> {\n\t\tconst storage_key = await this.getStorageKey(key);\n\t\tconst storage_item_key = this.#key_prefix + storage_key;\n\t\t// store value\n\t\tawait this._set(storage_key, value);\n\t\t// store key\n\t\tthis.activateCacheTimeout(storage_item_key);\n\t\tconst alreadyExisted = await Storage.setItem(storage_item_key, key);\n\t\tif (!alreadyExisted) await this.#incrementSize();\n\t\treturn this;\n\t}\n\n\toverride async delete(key: K) {\n\t\tconst storage_key = await this.getStorageKey(key);\n\t\tconst storage_item_key = this.#key_prefix + storage_key;\n\t\t// delete value\n\t\tawait this._delete(storage_key);\n\t\t// delete key\n\t\tconst existed = await Storage.removeItem(storage_item_key)\n\t\tif (existed) await this.#decrementSize();\n\t\treturn existed;\n\t}\n\n\t/**\n\t * Async iterator that returns all keys.\n\t */\n\tkeys() {\n\t\tconst self = this;\n\t\tconst key_prefix = this.#key_prefix;\n\t\treturn (async function*(){\n\t\t\tconst keyGenerator = await Storage.getItemKeysStartingWith(self._prefix);\n\t\t\t\n\t\t\tfor (const key of keyGenerator) {\n\t\t\t\tconst keyValue = await Storage.getItem(key_prefix+key);\n\t\t\t\tyield (<K> keyValue);\n\t\t\t}\n\t\t})()\n\t}\n\n\t/**\n\t * Returns an array containing all keys.\n\t * This can be used to iterate over the keys without using a (for await of) loop.\n\t */\n\tasync keysArray() {\n\t\tconst keys = [];\n\t\tfor await (const key of this.keys()) keys.push(key);\n\t\treturn keys;\n\t}\n\n\t/**\n\t * Async iterator that returns all values.\n\t */\n\tvalues() {\n\t\tconst self = this;\n\t\treturn (async function*(){\n\t\t\tconst keyGenerator = await Storage.getItemKeysStartingWith(self._prefix);\n\t\t\t\n\t\t\tfor (const key of keyGenerator) {\n\t\t\t\tconst value = await Storage.getItem(key);\n\t\t\t\tyield (<V> value);\n\t\t\t}\n\t\t})()\n\t}\n\n\t/**\n\t * Returns an array containing all values.\n\t * This can be used to iterate over the values without using a (for await of) loop.\n\t */\n\tasync valuesArray() {\n\t\tconst values = [];\n\t\tfor await (const value of this.values()) values.push(value);\n\t\treturn values;\n\t}\n\n\t/**\n\t * Async iterator that returns all entries.\n\t */\n\tentries() {\n\t\treturn this[Symbol.asyncIterator]()\n\t}\n\n\t/**\n\t * Returns an array containing all entries.\n\t * This can be used to iterate over the entries without using a (for await of) loop.\n\t */\n\tasync entriesArray() {\n\t\tconst entries = [];\n\t\tfor await (const entry of this.entries()) entries.push(entry);\n\t\treturn entries;\n\t}\n\n\tasync *[Symbol.asyncIterator]() {\n\t\tconst keyGenerator = await Storage.getItemKeysStartingWith(this._prefix);\n\t\t\n\t\tfor (const key of keyGenerator) {\n\t\t\tconst keyValue = await Storage.getItem(this.#key_prefix+key);\n\t\t\tconst value = await Storage.getItem(key);\n\t\t\tyield (<[K,V]> [keyValue, value]);\n\t\t}\n\t}\n\n\toverride async clear() {\n\t\tconst promises = [];\n\t\tfor (const key of await Storage.getItemKeysStartingWith(this._prefix)) {\n\t\t\tpromises.push(await Storage.removeItem(key));\n\t\t\tpromises.push(await Storage.removeItem(this.#key_prefix+key));\n\t\t}\n\t\tawait Promise.all(promises);\n\t}\n\n\tmatch<Options extends MatchOptions, T extends V & object>(matchInput: MatchInput<T>, options?: Options, valueType?: Class<T>|Type<T>): Promise<MatchResult<Options['returnKeys'] extends true ? K : T, Options>> {\n\t\tvalueType ??= this.type;\n\t\tif (!valueType) throw new Error(\"Cannot determine value type. Please provide a valueType parameter to match()\");\n\t\treturn match(this as unknown as StorageMap<unknown, T>, valueType, matchInput, options) as any;\n\t}\n\n}"],"names":["Compiler","Pointer","Storage","match","Type","StorageWeakMap","of","keyType","valueType","storageMap","getClassDatexType","_type","namespace","name","type","get","cacheTimeout","allowNonPointerObjectValues","getByValue","proxifyValue","from","entries","map","$$","key","value","set","_prefix","idString","storage_key","getStorageKey","_get","activateCacheTimeout","getItem","has","_has","hasItem","delete","_delete","removeItem","_set","proxifyChild","setItem","setTimeout","cache","keyHash","getUniqueValueIdentifier","clear","promises","getItemKeysStartingWith","push","Promise","all","Symbol","asyncIterator","StorageMap","size","undefined","Error","getSize","getKeyForValue","keyId","getItemKey","calculatedSize","getItemCountStartingWith","newSize","storage_item_key","existed","keys","self","key_prefix","keyValue","keysArray","values","valuesArray","entriesArray","entry","matchInput","options"],"mappings":";AAEA,SAASA,QAAQ,QAAQ,0BAA0B;AAEnD,SAASC,OAAO,QAAQ,yBAAyB;AACjD,SAAuBC,OAAO,QAAQ,wBAAwB;AAE9D,SAAkCC,KAAK,QAAQ,oBAAoB;AACnE,SAASC,IAAI,QAAQ,YAAY;AAUjC,OAAO,MAAMC;IAQZ,OAAOC,GAAQC,OAAuC,EAAEC,SAA2B,EAAuB;QACzG,IAAMC,aAAa,IAAI,IAAI;QAG3B,OAFAA,WAAW,CAAA,KAAM,GAAGD,qBAAqBJ,OAAOI,YAAYJ,KAAKM,iBAAiB,CAACF,YACnFC,WAAWE,KAAK,GAAGF,WAAW,CAAA,KAAM,CAACG,SAAS,GAAG,MAAMH,WAAW,CAAA,KAAM,CAACI,IAAI,EACtEJ;IACR;IAEAE,MAAc;IACd,CAAA,KAAM,CAAW;IAEjB,IAAcG,OAAO;QACpB,IAAK,IAAI,CAACH,KAAK,EAEf,OADK,IAAI,CAAC,CAAA,KAAM,IAAE,CAAA,IAAI,CAAC,CAAA,KAAM,GAAGP,KAAKW,GAAG,CAAC,IAAI,CAACJ,KAAK,CAAA,GAC5C,IAAI,CAAC,CAAA,KAAM;IACnB;IAEA,CAAA,MAAO,CAAU;IAMjBK,eAAe,OAAc;IAQ7BC,8BAA8B,CAAA,EAAM;IAGpC,CAAA,QAAS,CAAW;IACpB,IAAI,CAAA,OAAQ;QAMX,OALK,IAAI,CAAC,CAAA,QAAS,IAAE,CAAA,I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