datastore-api 6.2.1 → 6.2.2
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datastore-api.cjs.development.js","sources":["../src/lib/assert.ts","../src/lib/dstore-api.ts"],"sourcesContent":["/*\n * assert.ts\n * \n * Created by Dr. Maximillian Dornseif 2025-04-11 in datastore-api 6.0.1\n */\n\nimport { Datastore, Key } from '@google-cloud/datastore'\nimport { AssertionMessageType, assert, getType } from 'assertate-debug'\n\n/**\n * Generates an type assertion message for the given `value`\n *\n * @param value value being type-checked\n * @param type the expected value as a string; eg 'string', 'boolean', 'number'\n * @param variableName the name of the variable being type-checked\n * @param additionalMessage further information on failure\n */\nlet AssertionMessage: AssertionMessageType = (\n value,\n type,\n variableName?,\n additionalMessage?\n): string => {\n let message = variableName\n ? `${variableName} must be of type '${type}', '${getType(value)}' provided`\n : `expected value of type '${type}', '${getType(value)}' provided`\n return additionalMessage ? `${message}: ${additionalMessage}` : message\n}\n\n/**\n * Type-checks the provided `value` to be a symbol, throws an Error if it is not\n *\n * @param value the value to type-check as a symbol\n * @param variableName the name of the variable to be type-checked\n * @param additionalMessage further information on failure\n * @throws {Error}\n */\nexport function assertIsKey(\n value: unknown,\n variableName?: string,\n additionalMessage?: string\n): asserts value is Key {\n assert(\n Datastore.isKey(value as any),\n AssertionMessage(value, \"Key\", variableName, additionalMessage)\n )\n}\n\n\n\n\n\n","/*\n * dstore.ts - Datastore Compatibility layer\n * Try to get a smoother API for transactions and such.\n * A little bit inspired by the Python2 ndb interface.\n * But without the ORM bits.\n *\n * In future https://github.com/graphql/dataloader might be used for batching.\n *\n * Created by Dr. Maximillian Dornseif 2021-12-05 in huwawi3backend 11.10.0\n * Copyright (c) 2021, 2022, 2023, 2025 Dr. Maximillian Dornseif\n */\n\nimport { AsyncLocalStorage } from 'async_hooks'\nimport { setImmediate } from 'timers/promises'\n\nimport { Datastore, Key, PathType, Query, Transaction, PropertyFilter } from '@google-cloud/datastore'\nimport { Entity, entity } from '@google-cloud/datastore/build/src/entity'\nimport { Operator, RunQueryInfo, RunQueryResponse } from '@google-cloud/datastore/build/src/query'\nimport { CommitResponse } from '@google-cloud/datastore/build/src/request'\nimport {\n assert,\n assertIsArray,\n assertIsDefined,\n assertIsNumber,\n assertIsObject,\n assertIsString,\n} from 'assertate-debug'\nimport Debug from 'debug'\nimport promClient from 'prom-client'\nimport { Writable } from 'ts-essentials'\nimport { assertIsKey } from './assert'\n\n/** @ignore */\nexport { Datastore, Key, PathType, Query, Transaction } from '@google-cloud/datastore'\n\n/** @ignore */\nconst debug = Debug('ds:api')\n\n/** @ignore */\nconst transactionAsyncLocalStorage = new AsyncLocalStorage()\n\n// for HMR\npromClient.register.removeSingleMetric('dstore_requests_seconds')\npromClient.register.removeSingleMetric('dstore_failures_total')\n/** @ignore */\nconst metricHistogram = new promClient.Histogram({\n name: 'dstore_requests_seconds',\n help: 'How long did Datastore operations take?',\n labelNames: ['operation'],\n})\nconst metricFailureCounter = new promClient.Counter({\n name: 'dstore_failures_total',\n help: 'How many Datastore operations failed?',\n labelNames: ['operation'],\n})\n\n/** Use instead of Datastore.KEY\n *\n * Even better: use `_key` instead.\n */\nexport const KEYSYM = Datastore.KEY\n\nexport type IGqlFilterTypes = boolean | string | number\n\nexport type IGqlFilterSpec = {\n readonly eq: IGqlFilterTypes\n}\nexport type TGqlFilterList = Array<[string, Operator, DstorePropertyValues]>\n\n/** Define what can be written into the Datastore */\nexport type DstorePropertyValues =\n | number\n | string\n | Date\n | boolean\n | null\n | undefined\n | Buffer\n | Key\n | DstorePropertyValues[]\n | { [key: string]: DstorePropertyValues }\n\nexport interface IDstoreEntryWithoutKey {\n /** All User Data stored in the Datastore */\n [key: string]: DstorePropertyValues\n}\n\n/** Represents what is actually stored inside the Datastore, called \"Entity\" by Google\n [@google-cloud/datastore](https://github.com/googleapis/nodejs-datastore#readme) adds `[Datastore.KEY]`. Using ES6 Symbols presents all kinds of hurdles, especially when you try to serialize into a cache. So we add the property _keyStr which contains the encoded key. It is automatically used to reconstruct `[Datastore.KEY]`, if you use [[Dstore.readKey]].\n*/\nexport interface IDstoreEntry extends IDstoreEntryWithoutKey {\n /* Datastore Key provided by [@google-cloud/datastore](https://github.com/googleapis/nodejs-datastore#readme) */\n readonly [Datastore.KEY]?: Key\n /** [Datastore.KEY] key */\n _keyStr: string\n}\n\n/** Represents what is actually stored inside the Datastore, called \"Entity\" by Google\n*/\nexport interface IDstoreEntryWithKey extends IDstoreEntry {\n /* Datastore Key provided by [@google-cloud/datastore](https://github.com/googleapis/nodejs-datastore#readme) */\n readonly [Datastore.KEY]: Key\n /** [Datastore.KEY] key */\n _keyStr: string\n}\n\n/** Represents the thing you pass to the save method. Also called \"Entity\" by Google */\nexport type DstoreSaveEntity = {\n key: Key\n data: Omit<IDstoreEntry, '_keyStr' | Datastore['KEY']> &\n Partial<{\n _keyStr: string | undefined;\n [Datastore.KEY]: Key\n }>\n method?: 'insert' | 'update' | 'upsert'\n excludeLargeProperties?: boolean\n excludeFromIndexes?: readonly string[]\n}\n\nexport interface IIterateParams {\n kindName: string,\n filters?: TGqlFilterList,\n limit?: number,\n ordering?: readonly string[],\n selection?: readonly string[],\n}\ntype IDstore = {\n /** Accessible by Users of the library. Keep in mind that you will access outside transactions created by [[runInTransaction]]. */\n readonly datastore: Datastore\n key: (path: ReadonlyArray<PathType>) => Key\n keyFromSerialized: (text: string) => Key\n keySerialize: (key: Key) => string\n readKey: (entry: IDstoreEntry) => Key\n get: (key: Key) => Promise<IDstoreEntry | null>\n getMulti: (keys: ReadonlyArray<Key>) => Promise<ReadonlyArray<IDstoreEntry | null>>\n set: (key: Key, entry: IDstoreEntry) => Promise<Key>\n save: (entities: readonly DstoreSaveEntity[]) => Promise<CommitResponse | undefined>\n insert: (entities: readonly DstoreSaveEntity[]) => Promise<CommitResponse | undefined>\n update: (entities: readonly DstoreSaveEntity[]) => Promise<CommitResponse | undefined>\n delete: (keys: readonly Key[]) => Promise<CommitResponse | undefined>\n createQuery: (kind: string) => Query\n runQuery: (query: Query | Omit<Query, 'run'>) => Promise<RunQueryResponse>\n query: (\n kind: string,\n filters?: TGqlFilterList,\n limit?: number,\n ordering?: readonly string[],\n selection?: readonly string[],\n cursor?: string\n ) => Promise<RunQueryResponse>\n iterate: (options: IIterateParams) => AsyncIterable<IDstoreEntry>\n allocateOneId: (kindName: string) => Promise<string>\n runInTransaction: <T>(func: { (): Promise<T>; (): T }) => Promise<T>\n}\n\n/** Dstore implements a slightly more accessible version of the [Google Cloud Datastore: Node.js Client](https://cloud.google.com/nodejs/docs/reference/datastore/latest)\n\n[@google-cloud/datastore](https://github.com/googleapis/nodejs-datastore#readme) is a strange beast: [The documentation is auto generated](https://cloud.google.com/nodejs/docs/reference/datastore/latest) and completely shy of documenting any advanced concepts.\n(Example: If you ask the datastore to auto-generate keys during save: how do you retrieve the generated key?) Generally I suggest to look at the Python 2.x [db](https://cloud.google.com/appengine/docs/standard/python/datastore/api-overview) and [ndb](https://cloud.google.com/appengine/docs/standard/python/ndb) documentation to get a better explanation of the workings of the datastore.\n\nAlso the typings are strange. The Google provided type `Entities` can be the on disk representation, the same but including a key reference (`Datastore.KEY` - [[IDstoreEntry]]), a list of these or a structured object containing the on disk representation under the `data` property and a `key` property and maybe some configuration like `excludeFromIndexes` ([[DstoreSaveEntity]]) or a list of these.\n\nKvStore tries to abstract away most surprises the datastore provides to you but als tries to stay as API compatible as possible to [@google-cloud/datastore](https://github.com/googleapis/nodejs-datastore).\n\nMain differences:\n\n- Everything asynchronous is Promise-based - no callbacks.\n- [[get]] always returns a single [[IDstoreEntry]].\n- [[getMulti]] always returns an Array<[[IDstoreEntry]]> of the same length as the input Array. Items not found are represented by null.\n- [[set]] is called with `(key, value)` and always returns the complete [[Key]] of the entity being written. Keys are normalized, numeric IDs are always encoded as strings.\n- [[key]] handles [[Key]] object instantiation for you.\n- [[readKey]] extracts the key from an [[IDstoreEntry]] you have read without the need of fancy `Symbol`-based access to `entity[Datastore.KEY]`. If needed, it tries to deserialize `_keyStr` to create `entity[Datastore.KEY]`. This ist important when rehydrating an [[IDstoreEntry]] from a serializing cache.\n- [[allocateOneId]] returns a single numeric string encoded unique datastore id without the need of fancy unpacking.\n- [[runInTransaction]] allows you to provide a function to be executed inside an transaction without the need of passing around the transaction object. This is modelled after Python 2.7 [ndb's `@ndb.transactional` feature](https://cloud.google.com/appengine/docs/standard/python/ndb/transactions). This is implemented via node's [AsyncLocalStorage](https://nodejs.org/docs/latest-v14.x/api/async_hooks.html).\n- [[keySerialize]] is synchronous.\n\nThis documentation also tries to document the little known idiosyncrasies of the [@google-cloud/datastore](https://github.com/googleapis/nodejs-datastore) library. See the corresponding functions.\n*/\nexport class Dstore implements IDstore {\n engine = 'Dstore';\n engines: string[] = [];\n private readonly urlSaveKey = new entity.URLSafeKey();\n\n /** Generate a Dstore instance for a specific [[Datastore]] instance.\n\n ```\n const dstore = Dstore(new Datastore())\n ```\n\n You are encouraged to provide the second parameter to provide the ProjectID. This makes [[keySerialize]] more robust. Usually you can get this from the Environment:\n\n ```\n const dstore = Dstore(new Datastore(), process.env.GCLOUD_PROJECT)\n\n @param datastore A [[Datastore]] instance. Can be freely accessed by the client. Be aware that using this inside [[runInTransaction]] ignores the transaction.\n @param projectId The `GCLOUD_PROJECT ID`. Used for Key generation during serialization.\n ```\n */\n constructor(readonly datastore: Datastore, readonly projectId?: string, readonly logger?: string) {\n assertIsObject(datastore)\n this.engines.push(this.engine)\n }\n\n /** Gets the Datastore or the current Transaction. */\n private getDoT(): Transaction | Datastore {\n return (transactionAsyncLocalStorage.getStore() as Transaction) || this.datastore\n }\n\n /** `key()` creates a [[Key]] Object from a path.\n *\n * Compatible to [Datastore.key](https://cloud.google.com/nodejs/docs/reference/datastore/latest/datastore/datastore#_google_cloud_datastore_Datastore_key_member_1_)\n *\n * If the Path has an odd number of elements, it is considered an incomplete Key. This can only be used for saving and will prompt the Datastore to auto-generate an (random) ID. See also [[save]].\n *\n * @category Datastore Drop-In\n */\n key(path: readonly PathType[]): Key {\n return this.datastore.key(path as Writable<typeof path>)\n }\n\n /** `keyFromSerialized()` serializes [[Key]] to a string.\n *\n * Compatible to [keyToLegacyUrlSafe](https://cloud.google.com/nodejs/docs/reference/datastore/latest/datastore/datastore#_google_cloud_datastore_Datastore_keyToLegacyUrlSafe_member_1_), but does not support the \"locationPrefix\" since the use for this parameter is undocumented and unknown. It seems to be an artifact from early App Engine days.\n *\n * It can be a synchronous function because it does not look up the `projectId`. Instead it is assumed, that you give the `projectId` upon instantiation of [[Dstore]]. It also seems, that a wrong `projectId` bears no ill effects.\n *\n * @category Datastore Drop-In\n */\n keySerialize(key: Key): string {\n return key ? this.urlSaveKey.legacyEncode(this.projectId ?? '', key) : ''\n }\n\n /** `keyFromSerialized()` deserializes a string created with [[keySerialize]] to a [[Key]].\n *\n * Compatible to [keyFromLegacyUrlsafe](https://cloud.google.com/nodejs/docs/reference/datastore/latest/datastore/datastore#_google_cloud_datastore_Datastore_keyFromLegacyUrlsafe_member_1_).\n *\n * @category Datastore Drop-In\n */\n keyFromSerialized(text: string): Key {\n return this.urlSaveKey.legacyDecode(text)\n }\n\n /** `readKey()` extracts the [[Key]] from an [[IDstoreEntry]].\n *\n * Is is an alternative to `entity[Datastore.KEY]` which tends to fail in various contexts and also confuses older Typescript compilers.\n * It can extract the [[Key]] form a [[IDstoreEntry]] which has been serialized to JSON by leveraging the property `_keyStr`.\n *\n * @category Additional\n */\n readKey(ent: IDstoreEntry): Key {\n assertIsObject(ent)\n let ret = ent[Datastore.KEY]\n if (ent._keyStr && !ret) {\n ret = this.keyFromSerialized(ent._keyStr)\n }\n assertIsObject(\n ret,\n 'entity[Datastore.KEY]/entity._keyStr',\n `Entity is missing the datastore Key: ${JSON.stringify(ent)}`\n )\n return ret\n }\n\n /** `fixKeys()` is called for all [[IDstoreEntry]] returned from [[Dstore]].\n *\n * Is ensures that besides `entity[Datastore.KEY]` there is `_keyStr` to be leveraged by [[readKey]].\n *\n * @internal\n */\n private fixKeys(\n entities: ReadonlyArray<Partial<IDstoreEntry> | undefined>\n ): Array<IDstoreEntry | undefined> {\n entities.forEach((x) => {\n if (!!x?.[Datastore.KEY] && x[Datastore.KEY]) {\n assertIsDefined(x[Datastore.KEY])\n assertIsObject(x[Datastore.KEY])\n // Old TypesScript has problems with symbols as a property\n x._keyStr = this.keySerialize(x[Datastore.KEY] as Key)\n }\n })\n return entities as Array<IDstoreEntry | undefined>\n }\n\n /** this is for save, insert, update and upsert and ensures _kkeyStr() handling.\n * \n */\n private prepareEntitiesForDatastore(entities: readonly DstoreSaveEntity[]) {\n for (const e of entities) {\n assertIsObject(e.key)\n assertIsObject(e.data)\n this.fixKeys([e.data])\n e.excludeLargeProperties = e.excludeLargeProperties === undefined ? true : e.excludeLargeProperties\n e.data = { ...e.data, _keyStr: undefined }\n }\n }\n\n /** this is for save, insert, update and upsert and ensures _kkeyStr() handling.\n * \n */\n private prepareEntitiesFromDatastore(entities: readonly DstoreSaveEntity[] & unknown[]) {\n for (const e of entities) {\n e.data[Datastore.KEY] = e.key\n this.fixKeys([e.data])\n }\n }\n\n /** `get()` reads a [[IDstoreEntry]] from the Datastore.\n *\n * It returns [[IDstoreEntry]] or `null` if not found.\n\n * The underlying Datastore API Call is [lookup](https://cloud.google.com/datastore/docs/reference/data/rest/v1/projects/lookup).\n *\n * It is in the Spirit of [Datastore.get()]. Unfortunately currently (late 2021) there is no formal documentation from Google on [Datastore.get()].\n *\n * Differences between [[Dstore.get]] and [[Datastore.get]]:\n *\n * - [Dstore.get]] takes a single [[Key]] as Parameter, no Array. Check [[getMulti]] if you want Arrays.\n * - [Dstore.get]] returns a single [[IDstoreEntry]], no Array.\n *\n * @category Datastore Drop-In\n */\n async get(key: Key): Promise<IDstoreEntry | null> {\n assertIsObject(key)\n assert(!Array.isArray(key))\n assert(key.path.length % 2 == 0, `key.path must be complete: ${JSON.stringify(key.path)}`)\n const result = await this.getMulti([key])\n return result?.[0] || null\n }\n\n /** `getMulti()` reads several [[IDstoreEntry]]s from the Datastore.\n *\n * It returns a list of [[IDstoreEntry]]s or `undefined` if not found. Entries are in the same Order as the keys in the Parameter.\n * This is different from the @google-cloud/datastore where not found items are not present in the result and the order in the result list is undefined.\n *\n * The underlying Datastore API Call is [lookup](https://cloud.google.com/datastore/docs/reference/data/rest/v1/projects/lookup).\n *\n * It is in the Spirit of [Datastore.get()]. Unfortunately currently (late 2021) there is no formal documentation from Google on [Datastore.get()].\n *\n * Differences between [[Dstore.getMulti]] and [[Datastore.get]]:\n *\n * - [[Dstore.getMulti]] always takes an Array of [[Key]]s as Parameter.\n * - [[Dstore.getMulti]] returns always a Array of [[IDstoreEntry]], or null.\n * - [[Datastore.get]] has many edge cases - e.g. when not being able to find any of the provided keys - which return surprising results. [[Dstore.getMulti]] always returns an Array. TODO: return a Array with the same length as the Input.\n *\n * @category Datastore Drop-In\n */\n async getMulti(keys: readonly Key[]): Promise<Array<IDstoreEntry | null>> {\n // assertIsArray(keys);\n let results: (IDstoreEntry | null | undefined)[]\n const metricEnd = metricHistogram.startTimer()\n try {\n results = this.fixKeys(\n keys.length > 0 ? (await this.getDoT().get(keys as Writable<typeof keys>))?.[0] : []\n )\n } catch (error) {\n metricFailureCounter.inc({ operation: 'get' })\n await setImmediate()\n throw new DstoreError('datastore.getMulti error', error as Error, { keys })\n } finally {\n metricEnd({ operation: 'get' })\n }\n\n // Sort resulting entities by the keys they were requested with.\n assertIsArray(results)\n const entities = results as IDstoreEntry[]\n const entitiesByKey: Record<string, IDstoreEntry> = {}\n entities.forEach((entity) => {\n entitiesByKey[JSON.stringify(entity[Datastore.KEY])] = entity\n })\n return keys.map((key) => entitiesByKey[JSON.stringify(key)] || null)\n }\n\n /** `set()` is addition to [[Datastore]]. It provides a classic Key-value Interface.\n *\n * Instead providing a nested [[DstoreSaveEntity]] to [[save]] you can call set directly as `set( key, value)`.\n * Observe that set takes a [[Key]] as first parameter. you call it like this;\n *\n * ```js\n * const ds = Dstore()\n * ds.set(ds.key('kind', '123'), {props1: 'foo', prop2: 'bar'})\n * ```\n *\n * It returns the [[Key]] of the Object being written.\n * If the Key provided was an incomplete [[Key]] it will return a completed [[Key]].\n * See [[save]] for more information on key generation.\n *\n * @category Additional\n */\n async set(key: Key, data: IDstoreEntryWithoutKey): Promise<Key> {\n assertIsObject(key)\n assertIsObject(data)\n const saveEntity = { key, data: { ...data, _keyStr: undefined } }\n await this.save([saveEntity])\n return saveEntity.key\n }\n\n /** `save()` is compatible to [Datastore.save()](https://cloud.google.com/nodejs/docs/reference/datastore/latest/datastore/datastore#_google_cloud_datastore_Datastore_save_member_1_).\n *\n * The single Parameter is a list of [[DstoreSaveEntity]]s.\n * If called within a transaction it returns `undefined`.\n * If not, it returns a [[CommitResponse]] which is not documented by Google.\n *\n * Different [DstoreSaveEntity]]s in the `entities` parameter can have different values in their [[DstoreSaveEntity.method]] property.\n * This allows you to do `insert`, `update` and `upsert` (the default) in a single request.\n *\n * `save()` seems to basically be an alias to [upsert](https://cloud.google.com/nodejs/docs/reference/datastore/latest/datastore/datastore#_google_cloud_datastore_Datastore_upsert_member_1_).\n *\n * If the [[Key]] provided in [[DstoreSaveEntity.key]] was an incomplete [[Key]] it will be updated by `save()` inside the [[DstoreSaveEntity]].\n *\n * If the Datastore generates a new ID because of an incomplete [[Key]] *on first save* it will return an large integer as [[Key.id]].\n * On every subsequent `save()` an string encoded number representation is returned.\n * @todo Dstore should normalizes that and always return an string encoded number representation.\n *\n * Each [[DstoreSaveEntity]] can have an `excludeFromIndexes` property which is somewhat underdocumented.\n * It can use something like JSON-Path notation\n * ([Source](https://github.com/googleapis/nodejs-datastore/blob/2941f2f0f132b41534e303d441d837051ce88fd7/src/index.ts#L948))\n * [.*](https://github.com/googleapis/nodejs-datastore/blob/406b15d2014087172df617c6e0a397a2c0902c5f/test/index.ts#L1598),\n * [parent[]](https://github.com/googleapis/nodejs-datastore/blob/406b15d2014087172df617c6e0a397a2c0902c5f/test/index.ts#L1672),\n * [parent.*](https://github.com/googleapis/nodejs-datastore/blob/406b15d2014087172df617c6e0a397a2c0902c5f/test/index.ts#L1672),\n * [parent[].*](https://github.com/googleapis/nodejs-datastore/blob/406b15d2014087172df617c6e0a397a2c0902c5f/test/index.ts#L1672)\n * and [more complex patterns](https://github.com/googleapis/nodejs-datastore/blob/406b15d2014087172df617c6e0a397a2c0902c5f/test/index.ts#L1754)\n * seem to be supported patterns.\n *\n * If the caller has not provided an `excludeLargeProperties` in a [[DstoreSaveEntity]] we will default it\n * to `excludeLargeProperties: true`. Without this you can not store strings longer than 1500 bytes easily\n * ([source](https://github.com/googleapis/nodejs-datastore/blob/c7a08a8382c6706ccbfbbf77950babf40bac757c/src/entity.ts#L961)).\n *\n * @category Datastore Drop-In\n */\n async save(entities: readonly DstoreSaveEntity[]): Promise<CommitResponse | undefined> {\n assertIsArray(entities)\n let ret: CommitResponse | undefined\n const metricEnd = metricHistogram.startTimer()\n try {\n this.prepareEntitiesForDatastore(entities)\n // Within Transaction we don't get any answer here!\n // [ { mutationResults: [ [Object], [Object] ], indexUpdates: 51 } ]\n ret = (await this.getDoT().save(entities)) || undefined\n this.prepareEntitiesFromDatastore(entities)\n } catch (error) {\n metricFailureCounter.inc({ operation: 'save' })\n await setImmediate()\n throw new DstoreError('datastore.save error', error as Error)\n } finally {\n metricEnd({ operation: 'save' })\n }\n return ret\n }\n\n\n\n /** `insert()` is compatible to [Datastore.insert()](https://cloud.google.com/nodejs/docs/reference/datastore/latest/datastore/datastore#_google_cloud_datastore_Datastore_insert_member_1_).\n *\n * The single Parameter is a list of [[DstoreSaveEntity]]s.\n * If called within a transaction it returns `undefined`.\n * If not, it returns a [[CommitResponse]] which is not documented by Google.\n *\n * `insert()` seems to be like [[save]] where [[DstoreSaveEntity.method]] is set to `'insert'`. It throws an [[DstoreError]] if there is already a Entity with the same [[Key]] in the Datastore.\n *\n * For handling of incomplete [[Key]]s see [[save]].\n *\n * This function can be completely emulated by using [[save]] with `method: 'insert'` inside each [[DstoreSaveEntity]].\n * Prefer using `save()` because it is much better tested.\n *\n * await ds.insert([{key: ds.key(['testKind', 123]), entity: {data:' 123'}}])\n *\n * @throws [[DstoreError]]\n * @category Datastore Drop-In\n */\n async insert(entities: readonly DstoreSaveEntity[]): Promise<CommitResponse | undefined> {\n assertIsArray(entities)\n let ret: CommitResponse | undefined\n const metricEnd = metricHistogram.startTimer()\n try {\n this.prepareEntitiesForDatastore(entities)\n ret = (await this.getDoT().insert(entities)) || undefined\n this.prepareEntitiesFromDatastore(entities)\n } catch (error) {\n // console.error(error)\n metricFailureCounter.inc({ operation: 'insert' })\n await setImmediate()\n throw new DstoreError('datastore.insert error', error as Error)\n } finally {\n metricEnd({ operation: 'insert' })\n }\n return ret\n }\n\n /** `update()` is compatible to [Datastore.update()](https://cloud.google.com/nodejs/docs/reference/datastore/latest/datastore/datastore#_google_cloud_datastore_Datastore_update_member_1_).\n\n * The single Parameter is a list of [[DstoreSaveEntity]]s.\n * If called within a transaction it returns `undefined`.\n * If not, it returns a [[CommitResponse]] which is not documented by Google.\n *\n * `update()` seems to be like [[save]] where [[DstoreSaveEntity.method]] is set to `'update'`.\n * It throws an [[DstoreError]] if there is no Entity with the same [[Key]] in the Datastore. `update()` *overwrites all existing data* for that [[Key]].\n * There was an alpha functionality called `merge()` in the Datastore which read an Entity, merged it with the new data and wrote it back, but this was never documented.\n *\n * `update()` is idempotent. Updating the same [[Key]] twice is no error.\n *\n * This function can be completely emulated by using [[save]] with `method: 'update'` inside each [[DstoreSaveEntity]].\n * Prefer using `save()` because it is much better tested.\n *\n * @throws [[DstoreError]]\n * @category Datastore Drop-In\n */\n async update(entities: readonly DstoreSaveEntity[]): Promise<CommitResponse | undefined> {\n assertIsArray(entities)\n\n entities.forEach((entity) => assertIsObject(entity.key))\n entities.forEach((entity) =>\n assert(\n entity.key.path.length % 2 == 0,\n `entity.key.path must be complete: ${JSON.stringify([entity.key.path, entity])}`\n )\n )\n let ret: CommitResponse | undefined\n const metricEnd = metricHistogram.startTimer()\n\n try {\n this.prepareEntitiesForDatastore(entities)\n ret = (await this.getDoT().update(entities)) || undefined\n this.prepareEntitiesFromDatastore(entities)\n } catch (error) {\n // console.error(error)\n metricFailureCounter.inc({ operation: 'update' })\n await setImmediate()\n throw new DstoreError('datastore.update error', error as Error)\n } finally {\n metricEnd({ operation: 'update' })\n }\n return ret\n }\n\n /** `delete()` is compatible to [Datastore.delete()].\n *\n * Unfortunately currently (late 2021) there is no formal documentation from Google on [Datastore.delete()].\n *\n * The single Parameter is a list of [[Key]]s.\n * If called within a transaction it returns `undefined`.\n * If not, it returns a [[CommitResponse]] which is not documented by Google.\n *\n * `delete()` is idempotent. Deleting the same [[Key]] twice is no error.\n *\n * @throws [[DstoreError]]\n * @category Datastore Drop-In\n */\n async delete(keys: readonly Key[]): Promise<CommitResponse | undefined> {\n assertIsArray(keys)\n keys.forEach((key) => assertIsObject(key))\n keys.forEach((key) =>\n assert(key.path.length % 2 == 0, `key.path must be complete: ${JSON.stringify(key.path)}`)\n )\n let ret\n const metricEnd = metricHistogram.startTimer()\n try {\n ret = (await this.getDoT().delete(keys)) || undefined\n } catch (error) {\n metricFailureCounter.inc({ operation: 'delete' })\n await setImmediate()\n throw new DstoreError('datastore.delete error', error as Error)\n } finally {\n metricEnd({ operation: 'delete' })\n }\n return ret\n }\n\n /** `createQuery()` creates an \"empty\" [[Query]] Object.\n *\n * Compatible to [createQuery](https://cloud.google.com/nodejs/docs/reference/datastore/latest/datastore/datastore#_google_cloud_datastore_Datastore_createQuery_member_1_) in the datastore.\n *\n * @param kindName Name of the [[Datastore]][Kind](https://cloud.google.com/datastore/docs/concepts/entities#kinds_and_identifiers) (\"Table\") which should be searched.\n *\n * @category Datastore Drop-In\n */\n createQuery(kindName: string): Query {\n try {\n return this.getDoT().createQuery(kindName)\n } catch (error) {\n throw new DstoreError('datastore.createQuery error', error as Error)\n }\n }\n\n async runQuery(query: Query | Omit<Query, 'run'>): Promise<RunQueryResponse> {\n let ret\n const metricEnd = metricHistogram.startTimer()\n try {\n const [entities, info]: [Entity[], RunQueryInfo] = await this.getDoT().runQuery(query as Query)\n ret = [this.fixKeys(entities), info]\n } catch (error) {\n await setImmediate()\n throw new DstoreError('datastore.runQuery error', error as Error)\n } finally {\n metricEnd({ operation: 'query' })\n }\n return ret as RunQueryResponse\n }\n\n /** `query()` combined [[createQuery]] and [[runQuery]] in a single call.\n *\n *\n * @param kindName Name of the [[Datastore]][Kind](https://cloud.google.com/datastore/docs/concepts/entities#kinds_and_identifiers) (\"Table\") which should be searched.\n * @param filters List of [[Query]] filter() calls.\n * @param limit Maximum Number of Results to return.\n * @param ordering List of [[Query]] order() calls.\n * @param selection selectionList of [[Query]] select() calls.\n * @param cursor unsupported so far.\n *\n * @throws [[DstoreError]]\n * @category Datastore Drop-In\n */\n async query(\n kindName: string,\n filters: TGqlFilterList = [],\n limit = 2500,\n ordering: readonly string[] = [],\n selection: readonly string[] = [],\n cursor?: string\n ): Promise<RunQueryResponse> {\n assertIsString(kindName)\n assertIsArray(filters)\n assertIsNumber(limit)\n try {\n const q = this.createQuery(kindName)\n for (const filterSpec of filters) {\n assertIsObject(filterSpec)\n // @ts-ignore\n q.filter(new PropertyFilter(...filterSpec))\n }\n for (const orderField of ordering) {\n q.order(orderField)\n }\n if (limit > 0) {\n q.limit(limit)\n }\n if (selection.length > 0) {\n q.select(selection as any)\n }\n const ret = await this.getDoT().runQuery(q)\n return [this.fixKeys(ret[0]), ret[1]]\n } catch (error) {\n await setImmediate()\n throw new DstoreError('datastore.query error', error as Error, {\n kindName,\n filters,\n limit,\n ordering,\n })\n }\n }\n\n\n /** `iterate()` is a modernized version of `query()`.\n *\n * It takes a Parameter object and returns an AsyncIterable.\n * Entities returned have been processed by `fixKeys()`.\n * \n * Can be used with `for await` loops like this:\n * \n * ```typescript\n * for await (const entity of dstore.iterate({ kindName: 'p_ReservierungsAbruf', filters: [['verbucht', '=', true]]})) {\n * console.log(entity)\n * }\n * ```\n * \n * @param kindName Name of the [[Datastore]][Kind](https://cloud.google.com/datastore/docs/concepts/entities#kinds_and_identifiers) (\"Table\") which should be searched.\n * @param filters List of [[Query]] filter() calls.\n * @param limit Maximum Number of Results to return.\n * @param ordering List of [[Query]] order() calls.\n * @param selection selectionList of [[Query]] select() calls.\n *\n * @throws [[DstoreError]]\n * @category Additional\n */\n async * iterate({\n kindName,\n filters = [],\n limit = 2500,\n ordering = [],\n selection = [],\n }: IIterateParams): AsyncIterable<IDstoreEntry> {\n assertIsString(kindName)\n assertIsArray(filters)\n assertIsNumber(limit)\n try {\n const q = this.getDoT().createQuery(kindName)\n for (const filterSpec of filters) {\n assertIsObject(filterSpec)\n // @ts-ignore\n q.filter(new PropertyFilter(...filterSpec))\n }\n for (const orderField of ordering) {\n q.order(orderField)\n }\n if (limit > 0) {\n q.limit(limit)\n }\n if (selection.length > 0) {\n q.select(selection as any)\n }\n for await (const entity of q.runStream()) {\n const ret = this.fixKeys([entity])[0]\n assertIsDefined(ret, 'datastore.iterate: entity is undefined')\n assertIsKey(ret[Datastore.KEY])\n yield ret as IDstoreEntryWithKey\n }\n } catch (error) {\n await setImmediate()\n throw new DstoreError('datastore.query error', error as Error, {\n kindName,\n filters,\n limit,\n ordering,\n })\n }\n }\n\n /** Allocate one ID in the Datastore.\n *\n * Currently (late 2021) there is no documentation provided by Google for the underlying node function.\n * Check the Documentation for [the low-level function](https://cloud.google.com/datastore/docs/reference/data/rest/v1/projects/allocateIds)\n * and [the conceptual overview](https://cloud.google.com/datastore/docs/concepts/entities#assigning_your_own_numeric_id)\n * and [this Stackoverflow post](https://stackoverflow.com/questions/60516959/how-does-allocateids-work-in-cloud-datastore-mode).\n *\n * The ID is a string encoded large number. This function will never return the same ID twice for any given Datastore.\n * If you provide a kindName the ID will be namespaced to this kind.\n * In fact the generated ID is namespaced via an incomplete [[Key]] of the given Kind.\n */\n async allocateOneId(kindName = 'Numbering'): Promise<string> {\n assertIsString(kindName)\n const ret = (await this.datastore.allocateIds(this.key([kindName]), 1))[0][0].id\n assertIsString(ret)\n return ret\n }\n\n /** This tries to give high level access to transactions.\n\n So called \"Gross Group Transactions\" are always enabled. Transactions are never Cross Project. `runInTransaction()` works only if you use the same [[KvStore] instance for all access within the Transaction.\n\n [[runInTransaction]] is modelled after Python 2.7 [ndb's `@ndb.transactional` feature](https://cloud.google.com/appengine/docs/standard/python/ndb/transactions). This is based on node's [AsyncLocalStorage](https://nodejs.org/docs/latest-v14.x/api/async_hooks.html).\n\n Transactions frequently fail if you try to access the same data via in a transaction. See the [Documentation on Locking](https://cloud.google.com/datastore/docs/concepts/transactions#transaction_locks) for further reference. You are advised to use [p-limit](https://github.com/sindresorhus/p-limit)(1) to serialize transactions touching the same resource. This should work nicely with node's single process model. It is a much bigger problem on shared-nothing approaches, like Python on App Engine.\n\n Transactions might be wrapped in [p-retry](https://github.com/sindresorhus/p-retry) to implement automatically retrying them with exponential back-off should they fail due to contention.\n\n Be aware that Transactions differ considerable between Master-Slave Datastore (very old), High Replication Datastore (old, later called [Google Cloud Datastore](https://cloud.google.com/datastore/docs/concepts/cloud-datastore-transactions)) and [Firestore in Datastore Mode](https://cloud.google.com/datastore/docs/firestore-or-datastore#in_datastore_mode) (current).\n\n Most Applications today are running on \"Firestore in Datastore Mode\". Beware that the Datastore-Emulator fails with `error: 3 INVALID_ARGUMENT: Only ancestor queries are allowed inside transactions.` during [[runQuery]] while the Datastore on Google Infrastructure does not have such an restriction anymore as of 2022.\n */\n async runInTransaction<T>(func: () => Promise<T>): Promise<T> {\n let ret\n const transaction: Transaction = this.datastore.transaction()\n await transactionAsyncLocalStorage.run(transaction, async () => {\n const [transactionInfo, transactionRunApiResponse] = await transaction.run()\n let commitApiResponse\n try {\n ret = await func()\n } catch (error) {\n const rollbackInfo = await transaction.rollback()\n debug(\n 'Transaction failed, rollback initiated: %O %O %O %O',\n transactionInfo,\n transactionRunApiResponse,\n rollbackInfo,\n error\n )\n await setImmediate()\n throw new DstoreError('datastore.transaction execution error', error as Error)\n }\n try {\n commitApiResponse = (await transaction.commit())[0]\n } catch (error) {\n debug(\n 'Transaction commit failed: %O %O %O %O ret: %O',\n transactionInfo,\n transactionRunApiResponse,\n commitApiResponse,\n error,\n ret\n )\n await setImmediate()\n throw new DstoreError('datastore.transaction execution error', error as Error)\n }\n })\n return ret as T\n }\n}\n\nexport class DstoreError extends Error {\n public readonly extensions: Record<string, unknown>\n public readonly originalError: Error | undefined\n readonly [key: string]: unknown\n\n constructor(message: string, originalError: Error | undefined, extensions?: Record<string, unknown>) {\n super(`${message}: ${originalError?.message}`)\n\n // if no name provided, use the default. defineProperty ensures that it stays non-enumerable\n if (!this.name) {\n Object.defineProperty(this, 'name', { value: 'DstoreError' })\n }\n // metadata: Metadata { internalRepr: Map(0) {}, options: {} },\n this.originalError = originalError\n this.extensions = { ...extensions }\n this.stack =\n (this.stack?.split('\\n')[0] || '') +\n '\\n' +\n (originalError?.stack?.split('\\n')?.slice(1)?.join('\\n') || '') +\n '\\n' +\n (this.stack?.split('\\n')?.slice(1)?.join('\\n') || '')\n\n // These are usually present on Datastore Errors\n // logger.error({ err: originalError, extensions }, message);\n }\n}\n"],"names":["AssertionMessage","value","type","variableName","additionalMessage","message","getType","assertIsKey","assert","Datastore","isKey","debug","Debug","transactionAsyncLocalStorage","AsyncLocalStorage","promClient","register","removeSingleMetric","metricHistogram","Histogram","name","help","labelNames","metricFailureCounter","Counter","KEYSYM","KEY","Dstore","datastore","projectId","logger","engine","engines","urlSaveKey","entity","URLSafeKey","assertIsObject","push","_proto","prototype","getDoT","getStore","key","path","keySerialize","_this$projectId","legacyEncode","keyFromSerialized","text","legacyDecode","readKey","ent","ret","_keyStr","JSON","stringify","fixKeys","entities","_this2","forEach","x","assertIsDefined","prepareEntitiesForDatastore","_iterator2","_createForOfIteratorHelperLoose","_step2","done","e","data","excludeLargeProperties","undefined","_extends","prepareEntitiesFromDatastore","_iterator3","_step3","get","_get","_asyncToGenerator","_regeneratorRuntime","mark","_callee","result","wrap","_callee$","_context","prev","next","Array","isArray","length","getMulti","sent","abrupt","stop","_x","apply","arguments","_getMulti","_callee2","keys","results","metricEnd","_yield$this$getDoT$ge","entitiesByKey","_callee2$","_context2","startTimer","t0","t2","t3","t1","t4","call","t5","inc","operation","setImmediate","DstoreError","finish","assertIsArray","map","_x2","set","_set","_callee3","saveEntity","_callee3$","_context3","save","_x3","_x4","_save","_callee4","_callee4$","_context4","_x5","insert","_insert","_callee5","_callee5$","_context5","_x6","update","_update","_callee6","_callee6$","_context6","_x7","_delete2","_callee7","_callee7$","_context7","delete","_x8","createQuery","kindName","error","runQuery","_runQuery","_callee8","query","_yield$this$getDoT$ru","info","_callee8$","_context8","_x9","_query","_callee9","filters","limit","ordering","selection","cursor","q","_iterator4","_step4","filterSpec","_iterator5","_step5","orderField","_callee9$","_context9","assertIsString","assertIsNumber","filter","_construct","PropertyFilter","order","select","_x10","_x11","_x12","_x13","_x14","_x15","iterate","_ref","_this","_ref$filters","_ref$limit","_ref$ordering","_ref$selection","_wrapAsyncGenerator","_callee10","_iterator6","_step6","_iterator7","_step7","_iteratorAbruptCompletion","_didIteratorError","_iteratorError","_iterator","_step","_entity","_callee10$","_context10","_asyncIterator","runStream","_awaitAsyncGenerator","allocateOneId","_allocateOneId","_callee11","_callee11$","_context11","allocateIds","id","_x16","runInTransaction","_runInTransaction","_callee13","func","transaction","_callee13$","_context13","run","_callee12","_yield$transaction$ru","transactionInfo","transactionRunApiResponse","commitApiResponse","rollbackInfo","_callee12$","_context12","rollback","commit","_x17","_Error","originalError","extensions","_this3$stack","_originalError$stack","_this3$stack2","_this3","Object","defineProperty","stack","split","slice","join","_inheritsLoose","_wrapNativeSuper","Error"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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. Maximillian Dornseif 2025-04-11 in datastore-api 6.0.1\n */\n\nimport { Datastore, Key } from '@google-cloud/datastore'\nimport { AssertionMessageType, assert, getType } from 'assertate-debug'\n\n/**\n * Generates an type assertion message for the given `value`\n *\n * @param value value being type-checked\n * @param type the expected value as a string; eg 'string', 'boolean', 'number'\n * @param variableName the name of the variable being type-checked\n * @param additionalMessage further information on failure\n */\nlet AssertionMessage: AssertionMessageType = (\n value,\n type,\n variableName?,\n additionalMessage?\n): string => {\n let message = variableName\n ? `${variableName} must be of type '${type}', '${getType(value)}' provided`\n : `expected value of type '${type}', '${getType(value)}' provided`\n return additionalMessage ? `${message}: ${additionalMessage}` : message\n}\n\n/**\n * Type-checks the provided `value` to be a symbol, throws an Error if it is not\n *\n * @param value the value to type-check as a symbol\n * @param variableName the name of the variable to be type-checked\n * @param additionalMessage further information on failure\n * @throws {Error}\n */\nexport function assertIsKey(\n value: unknown,\n variableName?: string,\n additionalMessage?: string\n): asserts value is Key {\n assert(\n Datastore.isKey(value as any),\n AssertionMessage(value, \"Key\", variableName, additionalMessage)\n )\n}\n\n\n\n\n\n","/*\n * dstore.ts - Datastore Compatibility layer\n * Try to get a smoother API for transactions and such.\n * A little bit inspired by the Python2 ndb interface.\n * But without the ORM bits.\n *\n * In future https://github.com/graphql/dataloader might be used for batching.\n *\n * Created by Dr. Maximillian Dornseif 2021-12-05 in huwawi3backend 11.10.0\n * Copyright (c) 2021, 2022, 2023, 2025 Dr. Maximillian Dornseif\n */\n\nimport { AsyncLocalStorage } from 'async_hooks'\nimport { setImmediate } from 'timers/promises'\n\nimport { Datastore, Key, PathType, Query, Transaction, PropertyFilter } from '@google-cloud/datastore'\nimport { Entity, entity } from '@google-cloud/datastore/build/src/entity'\nimport { Operator, RunQueryInfo, RunQueryResponse } from '@google-cloud/datastore/build/src/query'\nimport { CommitResponse } from '@google-cloud/datastore/build/src/request'\nimport {\n assert,\n assertIsArray,\n assertIsDefined,\n assertIsNumber,\n assertIsObject,\n assertIsString,\n} from 'assertate-debug'\nimport Debug from 'debug'\nimport promClient from 'prom-client'\nimport { Writable } from 'ts-essentials'\nimport { assertIsKey } from './assert'\n\n/** @ignore */\nexport { Datastore, Key, PathType, Query, Transaction } from '@google-cloud/datastore'\n\n/** @ignore */\nconst debug = Debug('ds:api')\n\n/** @ignore */\nconst transactionAsyncLocalStorage = new AsyncLocalStorage()\n\n// for HMR\npromClient.register.removeSingleMetric('dstore_requests_seconds')\npromClient.register.removeSingleMetric('dstore_failures_total')\n/** @ignore */\nconst metricHistogram = new promClient.Histogram({\n name: 'dstore_requests_seconds',\n help: 'How long did Datastore operations take?',\n labelNames: ['operation'],\n})\nconst metricFailureCounter = new promClient.Counter({\n name: 'dstore_failures_total',\n help: 'How many Datastore operations failed?',\n labelNames: ['operation'],\n})\n\n/** Use instead of Datastore.KEY\n *\n * Even better: use `_key` instead.\n */\nexport const KEYSYM = Datastore.KEY\n\nexport type IGqlFilterTypes = boolean | string | number\n\nexport type IGqlFilterSpec = {\n readonly eq: IGqlFilterTypes\n}\nexport type TGqlFilterList = Array<[string, Operator, DstorePropertyValues]>\n\n/** Define what can be written into the Datastore */\nexport type DstorePropertyValues =\n | number\n | string\n | Date\n | boolean\n | null\n | undefined\n | Buffer\n | Key\n | DstorePropertyValues[]\n | { [key: string]: DstorePropertyValues }\n\nexport interface IDstoreEntryWithoutKey {\n /** All User Data stored in the Datastore */\n [key: string]: DstorePropertyValues\n}\n\n/** Represents what is actually stored inside the Datastore, called \"Entity\" by Google\n [@google-cloud/datastore](https://github.com/googleapis/nodejs-datastore#readme) adds `[Datastore.KEY]`. Using ES6 Symbols presents all kinds of hurdles, especially when you try to serialize into a cache. So we add the property _keyStr which contains the encoded key. It is automatically used to reconstruct `[Datastore.KEY]`, if you use [[Dstore.readKey]].\n*/\nexport interface IDstoreEntry extends IDstoreEntryWithoutKey {\n /* Datastore Key provided by [@google-cloud/datastore](https://github.com/googleapis/nodejs-datastore#readme) */\n readonly [Datastore.KEY]?: Key\n /** [Datastore.KEY] key */\n _keyStr: string\n}\n\n/** Represents what is actually stored inside the Datastore, called \"Entity\" by Google\n*/\nexport interface IDstoreEntryWithKey extends IDstoreEntry {\n /* Datastore Key provided by [@google-cloud/datastore](https://github.com/googleapis/nodejs-datastore#readme) */\n readonly [Datastore.KEY]: Key\n /** [Datastore.KEY] key */\n _keyStr: string\n}\n\n/** Represents the thing you pass to the save method. Also called \"Entity\" by Google */\nexport type DstoreSaveEntity = {\n key: Key\n data: Omit<IDstoreEntry, '_keyStr' | Datastore['KEY']> &\n Partial<{\n _keyStr: string | undefined;\n [Datastore.KEY]: Key\n }>\n method?: 'insert' | 'update' | 'upsert'\n excludeLargeProperties?: boolean\n excludeFromIndexes?: readonly string[]\n}\n\nexport interface IIterateParams {\n kindName: string,\n filters?: TGqlFilterList,\n limit?: number,\n ordering?: readonly string[],\n selection?: readonly string[],\n}\ntype IDstore = {\n /** Accessible by Users of the library. Keep in mind that you will access outside transactions created by [[runInTransaction]]. */\n readonly datastore: Datastore\n key: (path: ReadonlyArray<PathType>) => Key\n keyFromSerialized: (text: string) => Key\n keySerialize: (key: Key) => string\n readKey: (entry: IDstoreEntry) => Key\n get: (key: Key) => Promise<IDstoreEntry | null>\n getMulti: (keys: ReadonlyArray<Key>) => Promise<ReadonlyArray<IDstoreEntry | null>>\n set: (key: Key, entry: IDstoreEntry) => Promise<Key>\n save: (entities: readonly DstoreSaveEntity[]) => Promise<CommitResponse | undefined>\n insert: (entities: readonly DstoreSaveEntity[]) => Promise<CommitResponse | undefined>\n update: (entities: readonly DstoreSaveEntity[]) => Promise<CommitResponse | undefined>\n delete: (keys: readonly Key[]) => Promise<CommitResponse | undefined>\n createQuery: (kind: string) => Query\n runQuery: (query: Query | Omit<Query, 'run'>) => Promise<RunQueryResponse>\n query: (\n kind: string,\n filters?: TGqlFilterList,\n limit?: number,\n ordering?: readonly string[],\n selection?: readonly string[],\n cursor?: string\n ) => Promise<RunQueryResponse>\n iterate: (options: IIterateParams) => AsyncIterable<IDstoreEntryWithKey>\n allocateOneId: (kindName: string) => Promise<string>\n runInTransaction: <T>(func: { (): Promise<T>; (): T }) => Promise<T>\n}\n\n/** Dstore implements a slightly more accessible version of the [Google Cloud Datastore: Node.js Client](https://cloud.google.com/nodejs/docs/reference/datastore/latest)\n\n[@google-cloud/datastore](https://github.com/googleapis/nodejs-datastore#readme) is a strange beast: [The documentation is auto generated](https://cloud.google.com/nodejs/docs/reference/datastore/latest) and completely shy of documenting any advanced concepts.\n(Example: If you ask the datastore to auto-generate keys during save: how do you retrieve the generated key?) Generally I suggest to look at the Python 2.x [db](https://cloud.google.com/appengine/docs/standard/python/datastore/api-overview) and [ndb](https://cloud.google.com/appengine/docs/standard/python/ndb) documentation to get a better explanation of the workings of the datastore.\n\nAlso the typings are strange. The Google provided type `Entities` can be the on disk representation, the same but including a key reference (`Datastore.KEY` - [[IDstoreEntry]]), a list of these or a structured object containing the on disk representation under the `data` property and a `key` property and maybe some configuration like `excludeFromIndexes` ([[DstoreSaveEntity]]) or a list of these.\n\nKvStore tries to abstract away most surprises the datastore provides to you but als tries to stay as API compatible as possible to [@google-cloud/datastore](https://github.com/googleapis/nodejs-datastore).\n\nMain differences:\n\n- Everything asynchronous is Promise-based - no callbacks.\n- [[get]] always returns a single [[IDstoreEntry]].\n- [[getMulti]] always returns an Array<[[IDstoreEntry]]> of the same length as the input Array. Items not found are represented by null.\n- [[set]] is called with `(key, value)` and always returns the complete [[Key]] of the entity being written. Keys are normalized, numeric IDs are always encoded as strings.\n- [[key]] handles [[Key]] object instantiation for you.\n- [[readKey]] extracts the key from an [[IDstoreEntry]] you have read without the need of fancy `Symbol`-based access to `entity[Datastore.KEY]`. If needed, it tries to deserialize `_keyStr` to create `entity[Datastore.KEY]`. This ist important when rehydrating an [[IDstoreEntry]] from a serializing cache.\n- [[allocateOneId]] returns a single numeric string encoded unique datastore id without the need of fancy unpacking.\n- [[runInTransaction]] allows you to provide a function to be executed inside an transaction without the need of passing around the transaction object. This is modelled after Python 2.7 [ndb's `@ndb.transactional` feature](https://cloud.google.com/appengine/docs/standard/python/ndb/transactions). This is implemented via node's [AsyncLocalStorage](https://nodejs.org/docs/latest-v14.x/api/async_hooks.html).\n- [[keySerialize]] is synchronous.\n\nThis documentation also tries to document the little known idiosyncrasies of the [@google-cloud/datastore](https://github.com/googleapis/nodejs-datastore) library. See the corresponding functions.\n*/\nexport class Dstore implements IDstore {\n engine = 'Dstore';\n engines: string[] = [];\n private readonly urlSaveKey = new entity.URLSafeKey();\n\n /** Generate a Dstore instance for a specific [[Datastore]] instance.\n\n ```\n const dstore = Dstore(new Datastore())\n ```\n\n You are encouraged to provide the second parameter to provide the ProjectID. This makes [[keySerialize]] more robust. Usually you can get this from the Environment:\n\n ```\n const dstore = Dstore(new Datastore(), process.env.GCLOUD_PROJECT)\n\n @param datastore A [[Datastore]] instance. Can be freely accessed by the client. Be aware that using this inside [[runInTransaction]] ignores the transaction.\n @param projectId The `GCLOUD_PROJECT ID`. Used for Key generation during serialization.\n ```\n */\n constructor(readonly datastore: Datastore, readonly projectId?: string, readonly logger?: string) {\n assertIsObject(datastore)\n this.engines.push(this.engine)\n }\n\n /** Gets the Datastore or the current Transaction. */\n private getDoT(): Transaction | Datastore {\n return (transactionAsyncLocalStorage.getStore() as Transaction) || this.datastore\n }\n\n /** `key()` creates a [[Key]] Object from a path.\n *\n * Compatible to [Datastore.key](https://cloud.google.com/nodejs/docs/reference/datastore/latest/datastore/datastore#_google_cloud_datastore_Datastore_key_member_1_)\n *\n * If the Path has an odd number of elements, it is considered an incomplete Key. This can only be used for saving and will prompt the Datastore to auto-generate an (random) ID. See also [[save]].\n *\n * @category Datastore Drop-In\n */\n key(path: readonly PathType[]): Key {\n return this.datastore.key(path as Writable<typeof path>)\n }\n\n /** `keyFromSerialized()` serializes [[Key]] to a string.\n *\n * Compatible to [keyToLegacyUrlSafe](https://cloud.google.com/nodejs/docs/reference/datastore/latest/datastore/datastore#_google_cloud_datastore_Datastore_keyToLegacyUrlSafe_member_1_), but does not support the \"locationPrefix\" since the use for this parameter is undocumented and unknown. It seems to be an artifact from early App Engine days.\n *\n * It can be a synchronous function because it does not look up the `projectId`. Instead it is assumed, that you give the `projectId` upon instantiation of [[Dstore]]. It also seems, that a wrong `projectId` bears no ill effects.\n *\n * @category Datastore Drop-In\n */\n keySerialize(key: Key): string {\n return key ? this.urlSaveKey.legacyEncode(this.projectId ?? '', key) : ''\n }\n\n /** `keyFromSerialized()` deserializes a string created with [[keySerialize]] to a [[Key]].\n *\n * Compatible to [keyFromLegacyUrlsafe](https://cloud.google.com/nodejs/docs/reference/datastore/latest/datastore/datastore#_google_cloud_datastore_Datastore_keyFromLegacyUrlsafe_member_1_).\n *\n * @category Datastore Drop-In\n */\n keyFromSerialized(text: string): Key {\n return this.urlSaveKey.legacyDecode(text)\n }\n\n /** `readKey()` extracts the [[Key]] from an [[IDstoreEntry]].\n *\n * Is is an alternative to `entity[Datastore.KEY]` which tends to fail in various contexts and also confuses older Typescript compilers.\n * It can extract the [[Key]] form a [[IDstoreEntry]] which has been serialized to JSON by leveraging the property `_keyStr`.\n *\n * @category Additional\n */\n readKey(ent: IDstoreEntry): Key {\n assertIsObject(ent)\n let ret = ent[Datastore.KEY]\n if (ent._keyStr && !ret) {\n ret = this.keyFromSerialized(ent._keyStr)\n }\n assertIsObject(\n ret,\n 'entity[Datastore.KEY]/entity._keyStr',\n `Entity is missing the datastore Key: ${JSON.stringify(ent)}`\n )\n return ret\n }\n\n /** `fixKeys()` is called for all [[IDstoreEntry]] returned from [[Dstore]].\n *\n * Is ensures that besides `entity[Datastore.KEY]` there is `_keyStr` to be leveraged by [[readKey]].\n *\n * @internal\n */\n private fixKeys(\n entities: ReadonlyArray<Partial<IDstoreEntry> | undefined>\n ): Array<IDstoreEntry | undefined> {\n entities.forEach((x) => {\n if (!!x?.[Datastore.KEY] && x[Datastore.KEY]) {\n assertIsDefined(x[Datastore.KEY])\n assertIsObject(x[Datastore.KEY])\n // Old TypesScript has problems with symbols as a property\n x._keyStr = this.keySerialize(x[Datastore.KEY] as Key)\n }\n })\n return entities as Array<IDstoreEntry | undefined>\n }\n\n /** this is for save, insert, update and upsert and ensures _kkeyStr() handling.\n * \n */\n private prepareEntitiesForDatastore(entities: readonly DstoreSaveEntity[]) {\n for (const e of entities) {\n assertIsObject(e.key)\n assertIsObject(e.data)\n this.fixKeys([e.data])\n e.excludeLargeProperties = e.excludeLargeProperties === undefined ? true : e.excludeLargeProperties\n e.data = { ...e.data, _keyStr: undefined }\n }\n }\n\n /** this is for save, insert, update and upsert and ensures _kkeyStr() handling.\n * \n */\n private prepareEntitiesFromDatastore(entities: readonly DstoreSaveEntity[] & unknown[]) {\n for (const e of entities) {\n e.data[Datastore.KEY] = e.key\n this.fixKeys([e.data])\n }\n }\n\n /** `get()` reads a [[IDstoreEntry]] from the Datastore.\n *\n * It returns [[IDstoreEntry]] or `null` if not found.\n\n * The underlying Datastore API Call is [lookup](https://cloud.google.com/datastore/docs/reference/data/rest/v1/projects/lookup).\n *\n * It is in the Spirit of [Datastore.get()]. Unfortunately currently (late 2021) there is no formal documentation from Google on [Datastore.get()].\n *\n * Differences between [[Dstore.get]] and [[Datastore.get]]:\n *\n * - [Dstore.get]] takes a single [[Key]] as Parameter, no Array. Check [[getMulti]] if you want Arrays.\n * - [Dstore.get]] returns a single [[IDstoreEntry]], no Array.\n *\n * @category Datastore Drop-In\n */\n async get(key: Key): Promise<IDstoreEntry | null> {\n assertIsObject(key)\n assert(!Array.isArray(key))\n assert(key.path.length % 2 == 0, `key.path must be complete: ${JSON.stringify(key.path)}`)\n const result = await this.getMulti([key])\n return result?.[0] || null\n }\n\n /** `getMulti()` reads several [[IDstoreEntry]]s from the Datastore.\n *\n * It returns a list of [[IDstoreEntry]]s or `undefined` if not found. Entries are in the same Order as the keys in the Parameter.\n * This is different from the @google-cloud/datastore where not found items are not present in the result and the order in the result list is undefined.\n *\n * The underlying Datastore API Call is [lookup](https://cloud.google.com/datastore/docs/reference/data/rest/v1/projects/lookup).\n *\n * It is in the Spirit of [Datastore.get()]. Unfortunately currently (late 2021) there is no formal documentation from Google on [Datastore.get()].\n *\n * Differences between [[Dstore.getMulti]] and [[Datastore.get]]:\n *\n * - [[Dstore.getMulti]] always takes an Array of [[Key]]s as Parameter.\n * - [[Dstore.getMulti]] returns always a Array of [[IDstoreEntry]], or null.\n * - [[Datastore.get]] has many edge cases - e.g. when not being able to find any of the provided keys - which return surprising results. [[Dstore.getMulti]] always returns an Array. TODO: return a Array with the same length as the Input.\n *\n * @category Datastore Drop-In\n */\n async getMulti(keys: readonly Key[]): Promise<Array<IDstoreEntry | null>> {\n // assertIsArray(keys);\n let results: (IDstoreEntry | null | undefined)[]\n const metricEnd = metricHistogram.startTimer()\n try {\n results = this.fixKeys(\n keys.length > 0 ? (await this.getDoT().get(keys as Writable<typeof keys>))?.[0] : []\n )\n } catch (error) {\n metricFailureCounter.inc({ operation: 'get' })\n await setImmediate()\n throw new DstoreError('datastore.getMulti error', error as Error, { keys })\n } finally {\n metricEnd({ operation: 'get' })\n }\n\n // Sort resulting entities by the keys they were requested with.\n assertIsArray(results)\n const entities = results as IDstoreEntry[]\n const entitiesByKey: Record<string, IDstoreEntry> = {}\n entities.forEach((entity) => {\n entitiesByKey[JSON.stringify(entity[Datastore.KEY])] = entity\n })\n return keys.map((key) => entitiesByKey[JSON.stringify(key)] || null)\n }\n\n /** `set()` is addition to [[Datastore]]. It provides a classic Key-value Interface.\n *\n * Instead providing a nested [[DstoreSaveEntity]] to [[save]] you can call set directly as `set( key, value)`.\n * Observe that set takes a [[Key]] as first parameter. you call it like this;\n *\n * ```js\n * const ds = Dstore()\n * ds.set(ds.key('kind', '123'), {props1: 'foo', prop2: 'bar'})\n * ```\n *\n * It returns the [[Key]] of the Object being written.\n * If the Key provided was an incomplete [[Key]] it will return a completed [[Key]].\n * See [[save]] for more information on key generation.\n *\n * @category Additional\n */\n async set(key: Key, data: IDstoreEntryWithoutKey): Promise<Key> {\n assertIsObject(key)\n assertIsObject(data)\n const saveEntity = { key, data: { ...data, _keyStr: undefined } }\n await this.save([saveEntity])\n return saveEntity.key\n }\n\n /** `save()` is compatible to [Datastore.save()](https://cloud.google.com/nodejs/docs/reference/datastore/latest/datastore/datastore#_google_cloud_datastore_Datastore_save_member_1_).\n *\n * The single Parameter is a list of [[DstoreSaveEntity]]s.\n * If called within a transaction it returns `undefined`.\n * If not, it returns a [[CommitResponse]] which is not documented by Google.\n *\n * Different [DstoreSaveEntity]]s in the `entities` parameter can have different values in their [[DstoreSaveEntity.method]] property.\n * This allows you to do `insert`, `update` and `upsert` (the default) in a single request.\n *\n * `save()` seems to basically be an alias to [upsert](https://cloud.google.com/nodejs/docs/reference/datastore/latest/datastore/datastore#_google_cloud_datastore_Datastore_upsert_member_1_).\n *\n * If the [[Key]] provided in [[DstoreSaveEntity.key]] was an incomplete [[Key]] it will be updated by `save()` inside the [[DstoreSaveEntity]].\n *\n * If the Datastore generates a new ID because of an incomplete [[Key]] *on first save* it will return an large integer as [[Key.id]].\n * On every subsequent `save()` an string encoded number representation is returned.\n * @todo Dstore should normalizes that and always return an string encoded number representation.\n *\n * Each [[DstoreSaveEntity]] can have an `excludeFromIndexes` property which is somewhat underdocumented.\n * It can use something like JSON-Path notation\n * ([Source](https://github.com/googleapis/nodejs-datastore/blob/2941f2f0f132b41534e303d441d837051ce88fd7/src/index.ts#L948))\n * [.*](https://github.com/googleapis/nodejs-datastore/blob/406b15d2014087172df617c6e0a397a2c0902c5f/test/index.ts#L1598),\n * [parent[]](https://github.com/googleapis/nodejs-datastore/blob/406b15d2014087172df617c6e0a397a2c0902c5f/test/index.ts#L1672),\n * [parent.*](https://github.com/googleapis/nodejs-datastore/blob/406b15d2014087172df617c6e0a397a2c0902c5f/test/index.ts#L1672),\n * [parent[].*](https://github.com/googleapis/nodejs-datastore/blob/406b15d2014087172df617c6e0a397a2c0902c5f/test/index.ts#L1672)\n * and [more complex patterns](https://github.com/googleapis/nodejs-datastore/blob/406b15d2014087172df617c6e0a397a2c0902c5f/test/index.ts#L1754)\n * seem to be supported patterns.\n *\n * If the caller has not provided an `excludeLargeProperties` in a [[DstoreSaveEntity]] we will default it\n * to `excludeLargeProperties: true`. Without this you can not store strings longer than 1500 bytes easily\n * ([source](https://github.com/googleapis/nodejs-datastore/blob/c7a08a8382c6706ccbfbbf77950babf40bac757c/src/entity.ts#L961)).\n *\n * @category Datastore Drop-In\n */\n async save(entities: readonly DstoreSaveEntity[]): Promise<CommitResponse | undefined> {\n assertIsArray(entities)\n let ret: CommitResponse | undefined\n const metricEnd = metricHistogram.startTimer()\n try {\n this.prepareEntitiesForDatastore(entities)\n // Within Transaction we don't get any answer here!\n // [ { mutationResults: [ [Object], [Object] ], indexUpdates: 51 } ]\n ret = (await this.getDoT().save(entities)) || undefined\n this.prepareEntitiesFromDatastore(entities)\n } catch (error) {\n metricFailureCounter.inc({ operation: 'save' })\n await setImmediate()\n throw new DstoreError('datastore.save error', error as Error)\n } finally {\n metricEnd({ operation: 'save' })\n }\n return ret\n }\n\n\n\n /** `insert()` is compatible to [Datastore.insert()](https://cloud.google.com/nodejs/docs/reference/datastore/latest/datastore/datastore#_google_cloud_datastore_Datastore_insert_member_1_).\n *\n * The single Parameter is a list of [[DstoreSaveEntity]]s.\n * If called within a transaction it returns `undefined`.\n * If not, it returns a [[CommitResponse]] which is not documented by Google.\n *\n * `insert()` seems to be like [[save]] where [[DstoreSaveEntity.method]] is set to `'insert'`. It throws an [[DstoreError]] if there is already a Entity with the same [[Key]] in the Datastore.\n *\n * For handling of incomplete [[Key]]s see [[save]].\n *\n * This function can be completely emulated by using [[save]] with `method: 'insert'` inside each [[DstoreSaveEntity]].\n * Prefer using `save()` because it is much better tested.\n *\n * await ds.insert([{key: ds.key(['testKind', 123]), entity: {data:' 123'}}])\n *\n * @throws [[DstoreError]]\n * @category Datastore Drop-In\n */\n async insert(entities: readonly DstoreSaveEntity[]): Promise<CommitResponse | undefined> {\n assertIsArray(entities)\n let ret: CommitResponse | undefined\n const metricEnd = metricHistogram.startTimer()\n try {\n this.prepareEntitiesForDatastore(entities)\n ret = (await this.getDoT().insert(entities)) || undefined\n this.prepareEntitiesFromDatastore(entities)\n } catch (error) {\n // console.error(error)\n metricFailureCounter.inc({ operation: 'insert' })\n await setImmediate()\n throw new DstoreError('datastore.insert error', error as Error)\n } finally {\n metricEnd({ operation: 'insert' })\n }\n return ret\n }\n\n /** `update()` is compatible to [Datastore.update()](https://cloud.google.com/nodejs/docs/reference/datastore/latest/datastore/datastore#_google_cloud_datastore_Datastore_update_member_1_).\n\n * The single Parameter is a list of [[DstoreSaveEntity]]s.\n * If called within a transaction it returns `undefined`.\n * If not, it returns a [[CommitResponse]] which is not documented by Google.\n *\n * `update()` seems to be like [[save]] where [[DstoreSaveEntity.method]] is set to `'update'`.\n * It throws an [[DstoreError]] if there is no Entity with the same [[Key]] in the Datastore. `update()` *overwrites all existing data* for that [[Key]].\n * There was an alpha functionality called `merge()` in the Datastore which read an Entity, merged it with the new data and wrote it back, but this was never documented.\n *\n * `update()` is idempotent. Updating the same [[Key]] twice is no error.\n *\n * This function can be completely emulated by using [[save]] with `method: 'update'` inside each [[DstoreSaveEntity]].\n * Prefer using `save()` because it is much better tested.\n *\n * @throws [[DstoreError]]\n * @category Datastore Drop-In\n */\n async update(entities: readonly DstoreSaveEntity[]): Promise<CommitResponse | undefined> {\n assertIsArray(entities)\n\n entities.forEach((entity) => assertIsObject(entity.key))\n entities.forEach((entity) =>\n assert(\n entity.key.path.length % 2 == 0,\n `entity.key.path must be complete: ${JSON.stringify([entity.key.path, entity])}`\n )\n )\n let ret: CommitResponse | undefined\n const metricEnd = metricHistogram.startTimer()\n\n try {\n this.prepareEntitiesForDatastore(entities)\n ret = (await this.getDoT().update(entities)) || undefined\n this.prepareEntitiesFromDatastore(entities)\n } catch (error) {\n // console.error(error)\n metricFailureCounter.inc({ operation: 'update' })\n await setImmediate()\n throw new DstoreError('datastore.update error', error as Error)\n } finally {\n metricEnd({ operation: 'update' })\n }\n return ret\n }\n\n /** `delete()` is compatible to [Datastore.delete()].\n *\n * Unfortunately currently (late 2021) there is no formal documentation from Google on [Datastore.delete()].\n *\n * The single Parameter is a list of [[Key]]s.\n * If called within a transaction it returns `undefined`.\n * If not, it returns a [[CommitResponse]] which is not documented by Google.\n *\n * `delete()` is idempotent. Deleting the same [[Key]] twice is no error.\n *\n * @throws [[DstoreError]]\n * @category Datastore Drop-In\n */\n async delete(keys: readonly Key[]): Promise<CommitResponse | undefined> {\n assertIsArray(keys)\n keys.forEach((key) => assertIsObject(key))\n keys.forEach((key) =>\n assert(key.path.length % 2 == 0, `key.path must be complete: ${JSON.stringify(key.path)}`)\n )\n let ret\n const metricEnd = metricHistogram.startTimer()\n try {\n ret = (await this.getDoT().delete(keys)) || undefined\n } catch (error) {\n metricFailureCounter.inc({ operation: 'delete' })\n await setImmediate()\n throw new DstoreError('datastore.delete error', error as Error)\n } finally {\n metricEnd({ operation: 'delete' })\n }\n return ret\n }\n\n /** `createQuery()` creates an \"empty\" [[Query]] Object.\n *\n * Compatible to [createQuery](https://cloud.google.com/nodejs/docs/reference/datastore/latest/datastore/datastore#_google_cloud_datastore_Datastore_createQuery_member_1_) in the datastore.\n *\n * @param kindName Name of the [[Datastore]][Kind](https://cloud.google.com/datastore/docs/concepts/entities#kinds_and_identifiers) (\"Table\") which should be searched.\n *\n * @category Datastore Drop-In\n */\n createQuery(kindName: string): Query {\n try {\n return this.getDoT().createQuery(kindName)\n } catch (error) {\n throw new DstoreError('datastore.createQuery error', error as Error)\n }\n }\n\n async runQuery(query: Query | Omit<Query, 'run'>): Promise<RunQueryResponse> {\n let ret\n const metricEnd = metricHistogram.startTimer()\n try {\n const [entities, info]: [Entity[], RunQueryInfo] = await this.getDoT().runQuery(query as Query)\n ret = [this.fixKeys(entities), info]\n } catch (error) {\n await setImmediate()\n throw new DstoreError('datastore.runQuery error', error as Error)\n } finally {\n metricEnd({ operation: 'query' })\n }\n return ret as RunQueryResponse\n }\n\n /** `query()` combined [[createQuery]] and [[runQuery]] in a single call.\n *\n *\n * @param kindName Name of the [[Datastore]][Kind](https://cloud.google.com/datastore/docs/concepts/entities#kinds_and_identifiers) (\"Table\") which should be searched.\n * @param filters List of [[Query]] filter() calls.\n * @param limit Maximum Number of Results to return.\n * @param ordering List of [[Query]] order() calls.\n * @param selection selectionList of [[Query]] select() calls.\n * @param cursor unsupported so far.\n *\n * @throws [[DstoreError]]\n * @category Datastore Drop-In\n */\n async query(\n kindName: string,\n filters: TGqlFilterList = [],\n limit = 2500,\n ordering: readonly string[] = [],\n selection: readonly string[] = [],\n cursor?: string\n ): Promise<RunQueryResponse> {\n assertIsString(kindName)\n assertIsArray(filters)\n assertIsNumber(limit)\n try {\n const q = this.createQuery(kindName)\n for (const filterSpec of filters) {\n assertIsObject(filterSpec)\n // @ts-ignore\n q.filter(new PropertyFilter(...filterSpec))\n }\n for (const orderField of ordering) {\n q.order(orderField)\n }\n if (limit > 0) {\n q.limit(limit)\n }\n if (selection.length > 0) {\n q.select(selection as any)\n }\n const ret = await this.getDoT().runQuery(q)\n return [this.fixKeys(ret[0]), ret[1]]\n } catch (error) {\n await setImmediate()\n throw new DstoreError('datastore.query error', error as Error, {\n kindName,\n filters,\n limit,\n ordering,\n })\n }\n }\n\n\n /** `iterate()` is a modernized version of `query()`.\n *\n * It takes a Parameter object and returns an AsyncIterable.\n * Entities returned have been processed by `fixKeys()`.\n * \n * Can be used with `for await` loops like this:\n * \n * ```typescript\n * for await (const entity of dstore.iterate({ kindName: 'p_ReservierungsAbruf', filters: [['verbucht', '=', true]]})) {\n * console.log(entity)\n * }\n * ```\n * \n * @param kindName Name of the [[Datastore]][Kind](https://cloud.google.com/datastore/docs/concepts/entities#kinds_and_identifiers) (\"Table\") which should be searched.\n * @param filters List of [[Query]] filter() calls.\n * @param limit Maximum Number of Results to return.\n * @param ordering List of [[Query]] order() calls.\n * @param selection selectionList of [[Query]] select() calls.\n *\n * @throws [[DstoreError]]\n * @category Additional\n */\n async * iterate({\n kindName,\n filters = [],\n limit = 2500,\n ordering = [],\n selection = [],\n }: IIterateParams): AsyncIterable<IDstoreEntryWithKey> {\n assertIsString(kindName)\n assertIsArray(filters)\n assertIsNumber(limit)\n try {\n const q = this.getDoT().createQuery(kindName)\n for (const filterSpec of filters) {\n assertIsObject(filterSpec)\n // @ts-ignore\n q.filter(new PropertyFilter(...filterSpec))\n }\n for (const orderField of ordering) {\n q.order(orderField)\n }\n if (limit > 0) {\n q.limit(limit)\n }\n if (selection.length > 0) {\n q.select(selection as any)\n }\n for await (const entity of q.runStream()) {\n const ret = this.fixKeys([entity])[0]\n assertIsDefined(ret, 'datastore.iterate: entity is undefined')\n assertIsKey(ret[Datastore.KEY])\n yield ret as IDstoreEntryWithKey\n }\n } catch (error) {\n await setImmediate()\n throw new DstoreError('datastore.query error', error as Error, {\n kindName,\n filters,\n limit,\n ordering,\n })\n }\n }\n\n /** Allocate one ID in the Datastore.\n *\n * Currently (late 2021) there is no documentation provided by Google for the underlying node function.\n * Check the Documentation for [the low-level function](https://cloud.google.com/datastore/docs/reference/data/rest/v1/projects/allocateIds)\n * and [the conceptual overview](https://cloud.google.com/datastore/docs/concepts/entities#assigning_your_own_numeric_id)\n * and [this Stackoverflow post](https://stackoverflow.com/questions/60516959/how-does-allocateids-work-in-cloud-datastore-mode).\n *\n * The ID is a string encoded large number. This function will never return the same ID twice for any given Datastore.\n * If you provide a kindName the ID will be namespaced to this kind.\n * In fact the generated ID is namespaced via an incomplete [[Key]] of the given Kind.\n */\n async allocateOneId(kindName = 'Numbering'): Promise<string> {\n assertIsString(kindName)\n const ret = (await this.datastore.allocateIds(this.key([kindName]), 1))[0][0].id\n assertIsString(ret)\n return ret\n }\n\n /** This tries to give high level access to transactions.\n\n So called \"Gross Group Transactions\" are always enabled. Transactions are never Cross Project. `runInTransaction()` works only if you use the same [[KvStore] instance for all access within the Transaction.\n\n [[runInTransaction]] is modelled after Python 2.7 [ndb's `@ndb.transactional` feature](https://cloud.google.com/appengine/docs/standard/python/ndb/transactions). This is based on node's [AsyncLocalStorage](https://nodejs.org/docs/latest-v14.x/api/async_hooks.html).\n\n Transactions frequently fail if you try to access the same data via in a transaction. See the [Documentation on Locking](https://cloud.google.com/datastore/docs/concepts/transactions#transaction_locks) for further reference. You are advised to use [p-limit](https://github.com/sindresorhus/p-limit)(1) to serialize transactions touching the same resource. This should work nicely with node's single process model. It is a much bigger problem on shared-nothing approaches, like Python on App Engine.\n\n Transactions might be wrapped in [p-retry](https://github.com/sindresorhus/p-retry) to implement automatically retrying them with exponential back-off should they fail due to contention.\n\n Be aware that Transactions differ considerable between Master-Slave Datastore (very old), High Replication Datastore (old, later called [Google Cloud Datastore](https://cloud.google.com/datastore/docs/concepts/cloud-datastore-transactions)) and [Firestore in Datastore Mode](https://cloud.google.com/datastore/docs/firestore-or-datastore#in_datastore_mode) (current).\n\n Most Applications today are running on \"Firestore in Datastore Mode\". Beware that the Datastore-Emulator fails with `error: 3 INVALID_ARGUMENT: Only ancestor queries are allowed inside transactions.` during [[runQuery]] while the Datastore on Google Infrastructure does not have such an restriction anymore as of 2022.\n */\n async runInTransaction<T>(func: () => Promise<T>): Promise<T> {\n let ret\n const transaction: Transaction = this.datastore.transaction()\n await transactionAsyncLocalStorage.run(transaction, async () => {\n const [transactionInfo, transactionRunApiResponse] = await transaction.run()\n let commitApiResponse\n try {\n ret = await func()\n } catch (error) {\n const rollbackInfo = await transaction.rollback()\n debug(\n 'Transaction failed, rollback initiated: %O %O %O %O',\n transactionInfo,\n transactionRunApiResponse,\n rollbackInfo,\n error\n )\n await setImmediate()\n throw new DstoreError('datastore.transaction execution error', error as Error)\n }\n try {\n commitApiResponse = (await transaction.commit())[0]\n } catch (error) {\n debug(\n 'Transaction commit failed: %O %O %O %O ret: %O',\n transactionInfo,\n transactionRunApiResponse,\n commitApiResponse,\n error,\n ret\n )\n await setImmediate()\n throw new DstoreError('datastore.transaction execution error', error as Error)\n }\n })\n return ret as T\n }\n}\n\nexport class DstoreError extends Error {\n public readonly extensions: Record<string, unknown>\n public readonly originalError: Error | undefined\n readonly [key: string]: unknown\n\n constructor(message: string, originalError: Error | undefined, extensions?: Record<string, unknown>) {\n super(`${message}: ${originalError?.message}`)\n\n // if no name provided, use the default. defineProperty ensures that it stays non-enumerable\n if (!this.name) {\n Object.defineProperty(this, 'name', { value: 'DstoreError' })\n }\n // metadata: Metadata { internalRepr: Map(0) {}, options: {} },\n this.originalError = originalError\n this.extensions = { ...extensions }\n this.stack =\n (this.stack?.split('\\n')[0] || '') +\n '\\n' +\n (originalError?.stack?.split('\\n')?.slice(1)?.join('\\n') || '') +\n '\\n' +\n (this.stack?.split('\\n')?.slice(1)?.join('\\n') || '')\n\n // These are usually present on Datastore Errors\n // logger.error({ err: originalError, extensions }, message);\n }\n}\n"],"names":["AssertionMessage","value","type","variableName","additionalMessage","message","getType","assertIsKey","assert","Datastore","isKey","debug","Debug","transactionAsyncLocalStorage","AsyncLocalStorage","promClient","register","removeSingleMetric","metricHistogram","Histogram","name","help","labelNames","metricFailureCounter","Counter","KEYSYM","KEY","Dstore","datastore","projectId","logger","engine","engines","urlSaveKey","entity","URLSafeKey","assertIsObject","push","_proto","prototype","getDoT","getStore","key","path","keySerialize","_this$projectId","legacyEncode","keyFromSerialized","text","legacyDecode","readKey","ent","ret","_keyStr","JSON","stringify","fixKeys","entities","_this2","forEach","x","assertIsDefined","prepareEntitiesForDatastore","_iterator2","_createForOfIteratorHelperLoose","_step2","done","e","data","excludeLargeProperties","undefined","_extends","prepareEntitiesFromDatastore","_iterator3","_step3","get","_get","_asyncToGenerator","_regeneratorRuntime","mark","_callee","result","wrap","_callee$","_context","prev","next","Array","isArray","length","getMulti","sent","abrupt","stop","_x","apply","arguments","_getMulti","_callee2","keys","results","metricEnd","_yield$this$getDoT$ge","entitiesByKey","_callee2$","_context2","startTimer","t0","t2","t3","t1","t4","call","t5","inc","operation","setImmediate","DstoreError","finish","assertIsArray","map","_x2","set","_set","_callee3","saveEntity","_callee3$","_context3","save","_x3","_x4","_save","_callee4","_callee4$","_context4","_x5","insert","_insert","_callee5","_callee5$","_context5","_x6","update","_update","_callee6","_callee6$","_context6","_x7","_delete2","_callee7","_callee7$","_context7","delete","_x8","createQuery","kindName","error","runQuery","_runQuery","_callee8","query","_yield$this$getDoT$ru","info","_callee8$","_context8","_x9","_query","_callee9","filters","limit","ordering","selection","cursor","q","_iterator4","_step4","filterSpec","_iterator5","_step5","orderField","_callee9$","_context9","assertIsString","assertIsNumber","filter","_construct","PropertyFilter","order","select","_x10","_x11","_x12","_x13","_x14","_x15","iterate","_ref","_this","_ref$filters","_ref$limit","_ref$ordering","_ref$selection","_wrapAsyncGenerator","_callee10","_iterator6","_step6","_iterator7","_step7","_iteratorAbruptCompletion","_didIteratorError","_iteratorError","_iterator","_step","_entity","_callee10$","_context10","_asyncIterator","runStream","_awaitAsyncGenerator","allocateOneId","_allocateOneId","_callee11","_callee11$","_context11","allocateIds","id","_x16","runInTransaction","_runInTransaction","_callee13","func","transaction","_callee13$","_context13","run","_callee12","_yield$transaction$ru","transactionInfo","transactionRunApiResponse","commitApiResponse","rollbackInfo","_callee12$","_context12","rollback","commit","_x17","_Error","originalError","extensions","_this3$stack","_originalError$stack","_this3$stack2","_this3","Object","defineProperty","stack","split","slice","join","_inheritsLoose","_wrapNativeSuper","Error"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAC,CAAC,CAAC,KAAI,EAAE,IACjC,IAAI,IACH,CAAAT,aAAa,IAAAG,IAAAA,IAAAA,CAAAA,oBAAA,GAAbH,aAAa,CAAEQ,KAAK,KAAAL,IAAAA,IAAAA,CAAAA,oBAAA,GAApBA,oBAAA,CAAsBM,KAAK,CAAC,IAAI,CAAC,KAAAN,IAAAA,IAAAA,CAAAA,oBAAA,GAAjCA,oBAAA,CAAmCO,KAAK,CAAC,CAAC,CAAC,qBAA3CP,oBAAA,CAA6CQ,IAAI,CAAC,IAAI,CAAC,KAAI,EAAE,CAAC,GAC/D,IAAI,IACH,CAAAP,CAAAA,aAAA,GAAAC,MAAA,CAAKG,KAAK,KAAA,IAAA,IAAA,CAAAJ,aAAA,GAAVA,aAAA,CAAYK,KAAK,CAAC,IAAI,CAAC,cAAAL,aAAA,GAAvBA,aAAA,CAAyBM,KAAK,CAAC,CAAC,CAAC,KAAA,IAAA,GAAA,KAAA,CAAA,GAAjCN,aAAA,CAAmCO,IAAI,CAAC,IAAI,CAAC,KAAI,EAAE,CAAC,CAAA;AAEvD;AACA;AAAA,IAAA,OAAAN,MAAA,CAAA;AACF,GAAA;EAACO,cAAA,CAAA9I,WAAA,EAAAiI,MAAA,CAAA,CAAA;AAAA,EAAA,OAAAjI,WAAA,CAAA;AAAA,CAAA+I,cAAAA,gBAAA,CAxB8BC,KAAK,CAAA;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datastore-api.cjs.production.min.js","sources":["../src/lib/assert.ts","../src/lib/dstore-api.ts"],"sourcesContent":["/*\n * assert.ts\n * \n * Created by Dr. Maximillian Dornseif 2025-04-11 in datastore-api 6.0.1\n */\n\nimport { Datastore, Key } from '@google-cloud/datastore'\nimport { AssertionMessageType, assert, getType } from 'assertate-debug'\n\n/**\n * Generates an type assertion message for the given `value`\n *\n * @param value value being type-checked\n * @param type the expected value as a string; eg 'string', 'boolean', 'number'\n * @param variableName the name of the variable being type-checked\n * @param additionalMessage further information on failure\n */\nlet AssertionMessage: AssertionMessageType = (\n value,\n type,\n variableName?,\n additionalMessage?\n): string => {\n let message = variableName\n ? `${variableName} must be of type '${type}', '${getType(value)}' provided`\n : `expected value of type '${type}', '${getType(value)}' provided`\n return additionalMessage ? `${message}: ${additionalMessage}` : message\n}\n\n/**\n * Type-checks the provided `value` to be a symbol, throws an Error if it is not\n *\n * @param value the value to type-check as a symbol\n * @param variableName the name of the variable to be type-checked\n * @param additionalMessage further information on failure\n * @throws {Error}\n */\nexport function assertIsKey(\n value: unknown,\n variableName?: string,\n additionalMessage?: string\n): asserts value is Key {\n assert(\n Datastore.isKey(value as any),\n AssertionMessage(value, \"Key\", variableName, additionalMessage)\n )\n}\n\n\n\n\n\n","/*\n * dstore.ts - Datastore Compatibility layer\n * Try to get a smoother API for transactions and such.\n * A little bit inspired by the Python2 ndb interface.\n * But without the ORM bits.\n *\n * In future https://github.com/graphql/dataloader might be used for batching.\n *\n * Created by Dr. Maximillian Dornseif 2021-12-05 in huwawi3backend 11.10.0\n * Copyright (c) 2021, 2022, 2023, 2025 Dr. Maximillian Dornseif\n */\n\nimport { AsyncLocalStorage } from 'async_hooks'\nimport { setImmediate } from 'timers/promises'\n\nimport { Datastore, Key, PathType, Query, Transaction, PropertyFilter } from '@google-cloud/datastore'\nimport { Entity, entity } from '@google-cloud/datastore/build/src/entity'\nimport { Operator, RunQueryInfo, RunQueryResponse } from '@google-cloud/datastore/build/src/query'\nimport { CommitResponse } from '@google-cloud/datastore/build/src/request'\nimport {\n assert,\n assertIsArray,\n assertIsDefined,\n assertIsNumber,\n assertIsObject,\n assertIsString,\n} from 'assertate-debug'\nimport Debug from 'debug'\nimport promClient from 'prom-client'\nimport { Writable } from 'ts-essentials'\nimport { assertIsKey } from './assert'\n\n/** @ignore */\nexport { Datastore, Key, PathType, Query, Transaction } from '@google-cloud/datastore'\n\n/** @ignore */\nconst debug = Debug('ds:api')\n\n/** @ignore */\nconst transactionAsyncLocalStorage = new AsyncLocalStorage()\n\n// for HMR\npromClient.register.removeSingleMetric('dstore_requests_seconds')\npromClient.register.removeSingleMetric('dstore_failures_total')\n/** @ignore */\nconst metricHistogram = new promClient.Histogram({\n name: 'dstore_requests_seconds',\n help: 'How long did Datastore operations take?',\n labelNames: ['operation'],\n})\nconst metricFailureCounter = new promClient.Counter({\n name: 'dstore_failures_total',\n help: 'How many Datastore operations failed?',\n labelNames: ['operation'],\n})\n\n/** Use instead of Datastore.KEY\n *\n * Even better: use `_key` instead.\n */\nexport const KEYSYM = Datastore.KEY\n\nexport type IGqlFilterTypes = boolean | string | number\n\nexport type IGqlFilterSpec = {\n readonly eq: IGqlFilterTypes\n}\nexport type TGqlFilterList = Array<[string, Operator, DstorePropertyValues]>\n\n/** Define what can be written into the Datastore */\nexport type DstorePropertyValues =\n | number\n | string\n | Date\n | boolean\n | null\n | undefined\n | Buffer\n | Key\n | DstorePropertyValues[]\n | { [key: string]: DstorePropertyValues }\n\nexport interface IDstoreEntryWithoutKey {\n /** All User Data stored in the Datastore */\n [key: string]: DstorePropertyValues\n}\n\n/** Represents what is actually stored inside the Datastore, called \"Entity\" by Google\n [@google-cloud/datastore](https://github.com/googleapis/nodejs-datastore#readme) adds `[Datastore.KEY]`. Using ES6 Symbols presents all kinds of hurdles, especially when you try to serialize into a cache. So we add the property _keyStr which contains the encoded key. It is automatically used to reconstruct `[Datastore.KEY]`, if you use [[Dstore.readKey]].\n*/\nexport interface IDstoreEntry extends IDstoreEntryWithoutKey {\n /* Datastore Key provided by [@google-cloud/datastore](https://github.com/googleapis/nodejs-datastore#readme) */\n readonly [Datastore.KEY]?: Key\n /** [Datastore.KEY] key */\n _keyStr: string\n}\n\n/** Represents what is actually stored inside the Datastore, called \"Entity\" by Google\n*/\nexport interface IDstoreEntryWithKey extends IDstoreEntry {\n /* Datastore Key provided by [@google-cloud/datastore](https://github.com/googleapis/nodejs-datastore#readme) */\n readonly [Datastore.KEY]: Key\n /** [Datastore.KEY] key */\n _keyStr: string\n}\n\n/** Represents the thing you pass to the save method. Also called \"Entity\" by Google */\nexport type DstoreSaveEntity = {\n key: Key\n data: Omit<IDstoreEntry, '_keyStr' | Datastore['KEY']> &\n Partial<{\n _keyStr: string | undefined;\n [Datastore.KEY]: Key\n }>\n method?: 'insert' | 'update' | 'upsert'\n excludeLargeProperties?: boolean\n excludeFromIndexes?: readonly string[]\n}\n\nexport interface IIterateParams {\n kindName: string,\n filters?: TGqlFilterList,\n limit?: number,\n ordering?: readonly string[],\n selection?: readonly string[],\n}\ntype IDstore = {\n /** Accessible by Users of the library. Keep in mind that you will access outside transactions created by [[runInTransaction]]. */\n readonly datastore: Datastore\n key: (path: ReadonlyArray<PathType>) => Key\n keyFromSerialized: (text: string) => Key\n keySerialize: (key: Key) => string\n readKey: (entry: IDstoreEntry) => Key\n get: (key: Key) => Promise<IDstoreEntry | null>\n getMulti: (keys: ReadonlyArray<Key>) => Promise<ReadonlyArray<IDstoreEntry | null>>\n set: (key: Key, entry: IDstoreEntry) => Promise<Key>\n save: (entities: readonly DstoreSaveEntity[]) => Promise<CommitResponse | undefined>\n insert: (entities: readonly DstoreSaveEntity[]) => Promise<CommitResponse | undefined>\n update: (entities: readonly DstoreSaveEntity[]) => Promise<CommitResponse | undefined>\n delete: (keys: readonly Key[]) => Promise<CommitResponse | undefined>\n createQuery: (kind: string) => Query\n runQuery: (query: Query | Omit<Query, 'run'>) => Promise<RunQueryResponse>\n query: (\n kind: string,\n filters?: TGqlFilterList,\n limit?: number,\n ordering?: readonly string[],\n selection?: readonly string[],\n cursor?: string\n ) => Promise<RunQueryResponse>\n iterate: (options: IIterateParams) => AsyncIterable<IDstoreEntry>\n allocateOneId: (kindName: string) => Promise<string>\n runInTransaction: <T>(func: { (): Promise<T>; (): T }) => Promise<T>\n}\n\n/** Dstore implements a slightly more accessible version of the [Google Cloud Datastore: Node.js Client](https://cloud.google.com/nodejs/docs/reference/datastore/latest)\n\n[@google-cloud/datastore](https://github.com/googleapis/nodejs-datastore#readme) is a strange beast: [The documentation is auto generated](https://cloud.google.com/nodejs/docs/reference/datastore/latest) and completely shy of documenting any advanced concepts.\n(Example: If you ask the datastore to auto-generate keys during save: how do you retrieve the generated key?) Generally I suggest to look at the Python 2.x [db](https://cloud.google.com/appengine/docs/standard/python/datastore/api-overview) and [ndb](https://cloud.google.com/appengine/docs/standard/python/ndb) documentation to get a better explanation of the workings of the datastore.\n\nAlso the typings are strange. The Google provided type `Entities` can be the on disk representation, the same but including a key reference (`Datastore.KEY` - [[IDstoreEntry]]), a list of these or a structured object containing the on disk representation under the `data` property and a `key` property and maybe some configuration like `excludeFromIndexes` ([[DstoreSaveEntity]]) or a list of these.\n\nKvStore tries to abstract away most surprises the datastore provides to you but als tries to stay as API compatible as possible to [@google-cloud/datastore](https://github.com/googleapis/nodejs-datastore).\n\nMain differences:\n\n- Everything asynchronous is Promise-based - no callbacks.\n- [[get]] always returns a single [[IDstoreEntry]].\n- [[getMulti]] always returns an Array<[[IDstoreEntry]]> of the same length as the input Array. Items not found are represented by null.\n- [[set]] is called with `(key, value)` and always returns the complete [[Key]] of the entity being written. Keys are normalized, numeric IDs are always encoded as strings.\n- [[key]] handles [[Key]] object instantiation for you.\n- [[readKey]] extracts the key from an [[IDstoreEntry]] you have read without the need of fancy `Symbol`-based access to `entity[Datastore.KEY]`. If needed, it tries to deserialize `_keyStr` to create `entity[Datastore.KEY]`. This ist important when rehydrating an [[IDstoreEntry]] from a serializing cache.\n- [[allocateOneId]] returns a single numeric string encoded unique datastore id without the need of fancy unpacking.\n- [[runInTransaction]] allows you to provide a function to be executed inside an transaction without the need of passing around the transaction object. This is modelled after Python 2.7 [ndb's `@ndb.transactional` feature](https://cloud.google.com/appengine/docs/standard/python/ndb/transactions). This is implemented via node's [AsyncLocalStorage](https://nodejs.org/docs/latest-v14.x/api/async_hooks.html).\n- [[keySerialize]] is synchronous.\n\nThis documentation also tries to document the little known idiosyncrasies of the [@google-cloud/datastore](https://github.com/googleapis/nodejs-datastore) library. See the corresponding functions.\n*/\nexport class Dstore implements IDstore {\n engine = 'Dstore';\n engines: string[] = [];\n private readonly urlSaveKey = new entity.URLSafeKey();\n\n /** Generate a Dstore instance for a specific [[Datastore]] instance.\n\n ```\n const dstore = Dstore(new Datastore())\n ```\n\n You are encouraged to provide the second parameter to provide the ProjectID. This makes [[keySerialize]] more robust. Usually you can get this from the Environment:\n\n ```\n const dstore = Dstore(new Datastore(), process.env.GCLOUD_PROJECT)\n\n @param datastore A [[Datastore]] instance. Can be freely accessed by the client. Be aware that using this inside [[runInTransaction]] ignores the transaction.\n @param projectId The `GCLOUD_PROJECT ID`. Used for Key generation during serialization.\n ```\n */\n constructor(readonly datastore: Datastore, readonly projectId?: string, readonly logger?: string) {\n assertIsObject(datastore)\n this.engines.push(this.engine)\n }\n\n /** Gets the Datastore or the current Transaction. */\n private getDoT(): Transaction | Datastore {\n return (transactionAsyncLocalStorage.getStore() as Transaction) || this.datastore\n }\n\n /** `key()` creates a [[Key]] Object from a path.\n *\n * Compatible to [Datastore.key](https://cloud.google.com/nodejs/docs/reference/datastore/latest/datastore/datastore#_google_cloud_datastore_Datastore_key_member_1_)\n *\n * If the Path has an odd number of elements, it is considered an incomplete Key. This can only be used for saving and will prompt the Datastore to auto-generate an (random) ID. See also [[save]].\n *\n * @category Datastore Drop-In\n */\n key(path: readonly PathType[]): Key {\n return this.datastore.key(path as Writable<typeof path>)\n }\n\n /** `keyFromSerialized()` serializes [[Key]] to a string.\n *\n * Compatible to [keyToLegacyUrlSafe](https://cloud.google.com/nodejs/docs/reference/datastore/latest/datastore/datastore#_google_cloud_datastore_Datastore_keyToLegacyUrlSafe_member_1_), but does not support the \"locationPrefix\" since the use for this parameter is undocumented and unknown. It seems to be an artifact from early App Engine days.\n *\n * It can be a synchronous function because it does not look up the `projectId`. Instead it is assumed, that you give the `projectId` upon instantiation of [[Dstore]]. It also seems, that a wrong `projectId` bears no ill effects.\n *\n * @category Datastore Drop-In\n */\n keySerialize(key: Key): string {\n return key ? this.urlSaveKey.legacyEncode(this.projectId ?? '', key) : ''\n }\n\n /** `keyFromSerialized()` deserializes a string created with [[keySerialize]] to a [[Key]].\n *\n * Compatible to [keyFromLegacyUrlsafe](https://cloud.google.com/nodejs/docs/reference/datastore/latest/datastore/datastore#_google_cloud_datastore_Datastore_keyFromLegacyUrlsafe_member_1_).\n *\n * @category Datastore Drop-In\n */\n keyFromSerialized(text: string): Key {\n return this.urlSaveKey.legacyDecode(text)\n }\n\n /** `readKey()` extracts the [[Key]] from an [[IDstoreEntry]].\n *\n * Is is an alternative to `entity[Datastore.KEY]` which tends to fail in various contexts and also confuses older Typescript compilers.\n * It can extract the [[Key]] form a [[IDstoreEntry]] which has been serialized to JSON by leveraging the property `_keyStr`.\n *\n * @category Additional\n */\n readKey(ent: IDstoreEntry): Key {\n assertIsObject(ent)\n let ret = ent[Datastore.KEY]\n if (ent._keyStr && !ret) {\n ret = this.keyFromSerialized(ent._keyStr)\n }\n assertIsObject(\n ret,\n 'entity[Datastore.KEY]/entity._keyStr',\n `Entity is missing the datastore Key: ${JSON.stringify(ent)}`\n )\n return ret\n }\n\n /** `fixKeys()` is called for all [[IDstoreEntry]] returned from [[Dstore]].\n *\n * Is ensures that besides `entity[Datastore.KEY]` there is `_keyStr` to be leveraged by [[readKey]].\n *\n * @internal\n */\n private fixKeys(\n entities: ReadonlyArray<Partial<IDstoreEntry> | undefined>\n ): Array<IDstoreEntry | undefined> {\n entities.forEach((x) => {\n if (!!x?.[Datastore.KEY] && x[Datastore.KEY]) {\n assertIsDefined(x[Datastore.KEY])\n assertIsObject(x[Datastore.KEY])\n // Old TypesScript has problems with symbols as a property\n x._keyStr = this.keySerialize(x[Datastore.KEY] as Key)\n }\n })\n return entities as Array<IDstoreEntry | undefined>\n }\n\n /** this is for save, insert, update and upsert and ensures _kkeyStr() handling.\n * \n */\n private prepareEntitiesForDatastore(entities: readonly DstoreSaveEntity[]) {\n for (const e of entities) {\n assertIsObject(e.key)\n assertIsObject(e.data)\n this.fixKeys([e.data])\n e.excludeLargeProperties = e.excludeLargeProperties === undefined ? true : e.excludeLargeProperties\n e.data = { ...e.data, _keyStr: undefined }\n }\n }\n\n /** this is for save, insert, update and upsert and ensures _kkeyStr() handling.\n * \n */\n private prepareEntitiesFromDatastore(entities: readonly DstoreSaveEntity[] & unknown[]) {\n for (const e of entities) {\n e.data[Datastore.KEY] = e.key\n this.fixKeys([e.data])\n }\n }\n\n /** `get()` reads a [[IDstoreEntry]] from the Datastore.\n *\n * It returns [[IDstoreEntry]] or `null` if not found.\n\n * The underlying Datastore API Call is [lookup](https://cloud.google.com/datastore/docs/reference/data/rest/v1/projects/lookup).\n *\n * It is in the Spirit of [Datastore.get()]. Unfortunately currently (late 2021) there is no formal documentation from Google on [Datastore.get()].\n *\n * Differences between [[Dstore.get]] and [[Datastore.get]]:\n *\n * - [Dstore.get]] takes a single [[Key]] as Parameter, no Array. Check [[getMulti]] if you want Arrays.\n * - [Dstore.get]] returns a single [[IDstoreEntry]], no Array.\n *\n * @category Datastore Drop-In\n */\n async get(key: Key): Promise<IDstoreEntry | null> {\n assertIsObject(key)\n assert(!Array.isArray(key))\n assert(key.path.length % 2 == 0, `key.path must be complete: ${JSON.stringify(key.path)}`)\n const result = await this.getMulti([key])\n return result?.[0] || null\n }\n\n /** `getMulti()` reads several [[IDstoreEntry]]s from the Datastore.\n *\n * It returns a list of [[IDstoreEntry]]s or `undefined` if not found. Entries are in the same Order as the keys in the Parameter.\n * This is different from the @google-cloud/datastore where not found items are not present in the result and the order in the result list is undefined.\n *\n * The underlying Datastore API Call is [lookup](https://cloud.google.com/datastore/docs/reference/data/rest/v1/projects/lookup).\n *\n * It is in the Spirit of [Datastore.get()]. Unfortunately currently (late 2021) there is no formal documentation from Google on [Datastore.get()].\n *\n * Differences between [[Dstore.getMulti]] and [[Datastore.get]]:\n *\n * - [[Dstore.getMulti]] always takes an Array of [[Key]]s as Parameter.\n * - [[Dstore.getMulti]] returns always a Array of [[IDstoreEntry]], or null.\n * - [[Datastore.get]] has many edge cases - e.g. when not being able to find any of the provided keys - which return surprising results. [[Dstore.getMulti]] always returns an Array. TODO: return a Array with the same length as the Input.\n *\n * @category Datastore Drop-In\n */\n async getMulti(keys: readonly Key[]): Promise<Array<IDstoreEntry | null>> {\n // assertIsArray(keys);\n let results: (IDstoreEntry | null | undefined)[]\n const metricEnd = metricHistogram.startTimer()\n try {\n results = this.fixKeys(\n keys.length > 0 ? (await this.getDoT().get(keys as Writable<typeof keys>))?.[0] : []\n )\n } catch (error) {\n metricFailureCounter.inc({ operation: 'get' })\n await setImmediate()\n throw new DstoreError('datastore.getMulti error', error as Error, { keys })\n } finally {\n metricEnd({ operation: 'get' })\n }\n\n // Sort resulting entities by the keys they were requested with.\n assertIsArray(results)\n const entities = results as IDstoreEntry[]\n const entitiesByKey: Record<string, IDstoreEntry> = {}\n entities.forEach((entity) => {\n entitiesByKey[JSON.stringify(entity[Datastore.KEY])] = entity\n })\n return keys.map((key) => entitiesByKey[JSON.stringify(key)] || null)\n }\n\n /** `set()` is addition to [[Datastore]]. It provides a classic Key-value Interface.\n *\n * Instead providing a nested [[DstoreSaveEntity]] to [[save]] you can call set directly as `set( key, value)`.\n * Observe that set takes a [[Key]] as first parameter. you call it like this;\n *\n * ```js\n * const ds = Dstore()\n * ds.set(ds.key('kind', '123'), {props1: 'foo', prop2: 'bar'})\n * ```\n *\n * It returns the [[Key]] of the Object being written.\n * If the Key provided was an incomplete [[Key]] it will return a completed [[Key]].\n * See [[save]] for more information on key generation.\n *\n * @category Additional\n */\n async set(key: Key, data: IDstoreEntryWithoutKey): Promise<Key> {\n assertIsObject(key)\n assertIsObject(data)\n const saveEntity = { key, data: { ...data, _keyStr: undefined } }\n await this.save([saveEntity])\n return saveEntity.key\n }\n\n /** `save()` is compatible to [Datastore.save()](https://cloud.google.com/nodejs/docs/reference/datastore/latest/datastore/datastore#_google_cloud_datastore_Datastore_save_member_1_).\n *\n * The single Parameter is a list of [[DstoreSaveEntity]]s.\n * If called within a transaction it returns `undefined`.\n * If not, it returns a [[CommitResponse]] which is not documented by Google.\n *\n * Different [DstoreSaveEntity]]s in the `entities` parameter can have different values in their [[DstoreSaveEntity.method]] property.\n * This allows you to do `insert`, `update` and `upsert` (the default) in a single request.\n *\n * `save()` seems to basically be an alias to [upsert](https://cloud.google.com/nodejs/docs/reference/datastore/latest/datastore/datastore#_google_cloud_datastore_Datastore_upsert_member_1_).\n *\n * If the [[Key]] provided in [[DstoreSaveEntity.key]] was an incomplete [[Key]] it will be updated by `save()` inside the [[DstoreSaveEntity]].\n *\n * If the Datastore generates a new ID because of an incomplete [[Key]] *on first save* it will return an large integer as [[Key.id]].\n * On every subsequent `save()` an string encoded number representation is returned.\n * @todo Dstore should normalizes that and always return an string encoded number representation.\n *\n * Each [[DstoreSaveEntity]] can have an `excludeFromIndexes` property which is somewhat underdocumented.\n * It can use something like JSON-Path notation\n * ([Source](https://github.com/googleapis/nodejs-datastore/blob/2941f2f0f132b41534e303d441d837051ce88fd7/src/index.ts#L948))\n * [.*](https://github.com/googleapis/nodejs-datastore/blob/406b15d2014087172df617c6e0a397a2c0902c5f/test/index.ts#L1598),\n * [parent[]](https://github.com/googleapis/nodejs-datastore/blob/406b15d2014087172df617c6e0a397a2c0902c5f/test/index.ts#L1672),\n * [parent.*](https://github.com/googleapis/nodejs-datastore/blob/406b15d2014087172df617c6e0a397a2c0902c5f/test/index.ts#L1672),\n * [parent[].*](https://github.com/googleapis/nodejs-datastore/blob/406b15d2014087172df617c6e0a397a2c0902c5f/test/index.ts#L1672)\n * and [more complex patterns](https://github.com/googleapis/nodejs-datastore/blob/406b15d2014087172df617c6e0a397a2c0902c5f/test/index.ts#L1754)\n * seem to be supported patterns.\n *\n * If the caller has not provided an `excludeLargeProperties` in a [[DstoreSaveEntity]] we will default it\n * to `excludeLargeProperties: true`. Without this you can not store strings longer than 1500 bytes easily\n * ([source](https://github.com/googleapis/nodejs-datastore/blob/c7a08a8382c6706ccbfbbf77950babf40bac757c/src/entity.ts#L961)).\n *\n * @category Datastore Drop-In\n */\n async save(entities: readonly DstoreSaveEntity[]): Promise<CommitResponse | undefined> {\n assertIsArray(entities)\n let ret: CommitResponse | undefined\n const metricEnd = metricHistogram.startTimer()\n try {\n this.prepareEntitiesForDatastore(entities)\n // Within Transaction we don't get any answer here!\n // [ { mutationResults: [ [Object], [Object] ], indexUpdates: 51 } ]\n ret = (await this.getDoT().save(entities)) || undefined\n this.prepareEntitiesFromDatastore(entities)\n } catch (error) {\n metricFailureCounter.inc({ operation: 'save' })\n await setImmediate()\n throw new DstoreError('datastore.save error', error as Error)\n } finally {\n metricEnd({ operation: 'save' })\n }\n return ret\n }\n\n\n\n /** `insert()` is compatible to [Datastore.insert()](https://cloud.google.com/nodejs/docs/reference/datastore/latest/datastore/datastore#_google_cloud_datastore_Datastore_insert_member_1_).\n *\n * The single Parameter is a list of [[DstoreSaveEntity]]s.\n * If called within a transaction it returns `undefined`.\n * If not, it returns a [[CommitResponse]] which is not documented by Google.\n *\n * `insert()` seems to be like [[save]] where [[DstoreSaveEntity.method]] is set to `'insert'`. It throws an [[DstoreError]] if there is already a Entity with the same [[Key]] in the Datastore.\n *\n * For handling of incomplete [[Key]]s see [[save]].\n *\n * This function can be completely emulated by using [[save]] with `method: 'insert'` inside each [[DstoreSaveEntity]].\n * Prefer using `save()` because it is much better tested.\n *\n * await ds.insert([{key: ds.key(['testKind', 123]), entity: {data:' 123'}}])\n *\n * @throws [[DstoreError]]\n * @category Datastore Drop-In\n */\n async insert(entities: readonly DstoreSaveEntity[]): Promise<CommitResponse | undefined> {\n assertIsArray(entities)\n let ret: CommitResponse | undefined\n const metricEnd = metricHistogram.startTimer()\n try {\n this.prepareEntitiesForDatastore(entities)\n ret = (await this.getDoT().insert(entities)) || undefined\n this.prepareEntitiesFromDatastore(entities)\n } catch (error) {\n // console.error(error)\n metricFailureCounter.inc({ operation: 'insert' })\n await setImmediate()\n throw new DstoreError('datastore.insert error', error as Error)\n } finally {\n metricEnd({ operation: 'insert' })\n }\n return ret\n }\n\n /** `update()` is compatible to [Datastore.update()](https://cloud.google.com/nodejs/docs/reference/datastore/latest/datastore/datastore#_google_cloud_datastore_Datastore_update_member_1_).\n\n * The single Parameter is a list of [[DstoreSaveEntity]]s.\n * If called within a transaction it returns `undefined`.\n * If not, it returns a [[CommitResponse]] which is not documented by Google.\n *\n * `update()` seems to be like [[save]] where [[DstoreSaveEntity.method]] is set to `'update'`.\n * It throws an [[DstoreError]] if there is no Entity with the same [[Key]] in the Datastore. `update()` *overwrites all existing data* for that [[Key]].\n * There was an alpha functionality called `merge()` in the Datastore which read an Entity, merged it with the new data and wrote it back, but this was never documented.\n *\n * `update()` is idempotent. Updating the same [[Key]] twice is no error.\n *\n * This function can be completely emulated by using [[save]] with `method: 'update'` inside each [[DstoreSaveEntity]].\n * Prefer using `save()` because it is much better tested.\n *\n * @throws [[DstoreError]]\n * @category Datastore Drop-In\n */\n async update(entities: readonly DstoreSaveEntity[]): Promise<CommitResponse | undefined> {\n assertIsArray(entities)\n\n entities.forEach((entity) => assertIsObject(entity.key))\n entities.forEach((entity) =>\n assert(\n entity.key.path.length % 2 == 0,\n `entity.key.path must be complete: ${JSON.stringify([entity.key.path, entity])}`\n )\n )\n let ret: CommitResponse | undefined\n const metricEnd = metricHistogram.startTimer()\n\n try {\n this.prepareEntitiesForDatastore(entities)\n ret = (await this.getDoT().update(entities)) || undefined\n this.prepareEntitiesFromDatastore(entities)\n } catch (error) {\n // console.error(error)\n metricFailureCounter.inc({ operation: 'update' })\n await setImmediate()\n throw new DstoreError('datastore.update error', error as Error)\n } finally {\n metricEnd({ operation: 'update' })\n }\n return ret\n }\n\n /** `delete()` is compatible to [Datastore.delete()].\n *\n * Unfortunately currently (late 2021) there is no formal documentation from Google on [Datastore.delete()].\n *\n * The single Parameter is a list of [[Key]]s.\n * If called within a transaction it returns `undefined`.\n * If not, it returns a [[CommitResponse]] which is not documented by Google.\n *\n * `delete()` is idempotent. Deleting the same [[Key]] twice is no error.\n *\n * @throws [[DstoreError]]\n * @category Datastore Drop-In\n */\n async delete(keys: readonly Key[]): Promise<CommitResponse | undefined> {\n assertIsArray(keys)\n keys.forEach((key) => assertIsObject(key))\n keys.forEach((key) =>\n assert(key.path.length % 2 == 0, `key.path must be complete: ${JSON.stringify(key.path)}`)\n )\n let ret\n const metricEnd = metricHistogram.startTimer()\n try {\n ret = (await this.getDoT().delete(keys)) || undefined\n } catch (error) {\n metricFailureCounter.inc({ operation: 'delete' })\n await setImmediate()\n throw new DstoreError('datastore.delete error', error as Error)\n } finally {\n metricEnd({ operation: 'delete' })\n }\n return ret\n }\n\n /** `createQuery()` creates an \"empty\" [[Query]] Object.\n *\n * Compatible to [createQuery](https://cloud.google.com/nodejs/docs/reference/datastore/latest/datastore/datastore#_google_cloud_datastore_Datastore_createQuery_member_1_) in the datastore.\n *\n * @param kindName Name of the [[Datastore]][Kind](https://cloud.google.com/datastore/docs/concepts/entities#kinds_and_identifiers) (\"Table\") which should be searched.\n *\n * @category Datastore Drop-In\n */\n createQuery(kindName: string): Query {\n try {\n return this.getDoT().createQuery(kindName)\n } catch (error) {\n throw new DstoreError('datastore.createQuery error', error as Error)\n }\n }\n\n async runQuery(query: Query | Omit<Query, 'run'>): Promise<RunQueryResponse> {\n let ret\n const metricEnd = metricHistogram.startTimer()\n try {\n const [entities, info]: [Entity[], RunQueryInfo] = await this.getDoT().runQuery(query as Query)\n ret = [this.fixKeys(entities), info]\n } catch (error) {\n await setImmediate()\n throw new DstoreError('datastore.runQuery error', error as Error)\n } finally {\n metricEnd({ operation: 'query' })\n }\n return ret as RunQueryResponse\n }\n\n /** `query()` combined [[createQuery]] and [[runQuery]] in a single call.\n *\n *\n * @param kindName Name of the [[Datastore]][Kind](https://cloud.google.com/datastore/docs/concepts/entities#kinds_and_identifiers) (\"Table\") which should be searched.\n * @param filters List of [[Query]] filter() calls.\n * @param limit Maximum Number of Results to return.\n * @param ordering List of [[Query]] order() calls.\n * @param selection selectionList of [[Query]] select() calls.\n * @param cursor unsupported so far.\n *\n * @throws [[DstoreError]]\n * @category Datastore Drop-In\n */\n async query(\n kindName: string,\n filters: TGqlFilterList = [],\n limit = 2500,\n ordering: readonly string[] = [],\n selection: readonly string[] = [],\n cursor?: string\n ): Promise<RunQueryResponse> {\n assertIsString(kindName)\n assertIsArray(filters)\n assertIsNumber(limit)\n try {\n const q = this.createQuery(kindName)\n for (const filterSpec of filters) {\n assertIsObject(filterSpec)\n // @ts-ignore\n q.filter(new PropertyFilter(...filterSpec))\n }\n for (const orderField of ordering) {\n q.order(orderField)\n }\n if (limit > 0) {\n q.limit(limit)\n }\n if (selection.length > 0) {\n q.select(selection as any)\n }\n const ret = await this.getDoT().runQuery(q)\n return [this.fixKeys(ret[0]), ret[1]]\n } catch (error) {\n await setImmediate()\n throw new DstoreError('datastore.query error', error as Error, {\n kindName,\n filters,\n limit,\n ordering,\n })\n }\n }\n\n\n /** `iterate()` is a modernized version of `query()`.\n *\n * It takes a Parameter object and returns an AsyncIterable.\n * Entities returned have been processed by `fixKeys()`.\n * \n * Can be used with `for await` loops like this:\n * \n * ```typescript\n * for await (const entity of dstore.iterate({ kindName: 'p_ReservierungsAbruf', filters: [['verbucht', '=', true]]})) {\n * console.log(entity)\n * }\n * ```\n * \n * @param kindName Name of the [[Datastore]][Kind](https://cloud.google.com/datastore/docs/concepts/entities#kinds_and_identifiers) (\"Table\") which should be searched.\n * @param filters List of [[Query]] filter() calls.\n * @param limit Maximum Number of Results to return.\n * @param ordering List of [[Query]] order() calls.\n * @param selection selectionList of [[Query]] select() calls.\n *\n * @throws [[DstoreError]]\n * @category Additional\n */\n async * iterate({\n kindName,\n filters = [],\n limit = 2500,\n ordering = [],\n selection = [],\n }: IIterateParams): AsyncIterable<IDstoreEntry> {\n assertIsString(kindName)\n assertIsArray(filters)\n assertIsNumber(limit)\n try {\n const q = this.getDoT().createQuery(kindName)\n for (const filterSpec of filters) {\n assertIsObject(filterSpec)\n // @ts-ignore\n q.filter(new PropertyFilter(...filterSpec))\n }\n for (const orderField of ordering) {\n q.order(orderField)\n }\n if (limit > 0) {\n q.limit(limit)\n }\n if (selection.length > 0) {\n q.select(selection as any)\n }\n for await (const entity of q.runStream()) {\n const ret = this.fixKeys([entity])[0]\n assertIsDefined(ret, 'datastore.iterate: entity is undefined')\n assertIsKey(ret[Datastore.KEY])\n yield ret as IDstoreEntryWithKey\n }\n } catch (error) {\n await setImmediate()\n throw new DstoreError('datastore.query error', error as Error, {\n kindName,\n filters,\n limit,\n ordering,\n })\n }\n }\n\n /** Allocate one ID in the Datastore.\n *\n * Currently (late 2021) there is no documentation provided by Google for the underlying node function.\n * Check the Documentation for [the low-level function](https://cloud.google.com/datastore/docs/reference/data/rest/v1/projects/allocateIds)\n * and [the conceptual overview](https://cloud.google.com/datastore/docs/concepts/entities#assigning_your_own_numeric_id)\n * and [this Stackoverflow post](https://stackoverflow.com/questions/60516959/how-does-allocateids-work-in-cloud-datastore-mode).\n *\n * The ID is a string encoded large number. This function will never return the same ID twice for any given Datastore.\n * If you provide a kindName the ID will be namespaced to this kind.\n * In fact the generated ID is namespaced via an incomplete [[Key]] of the given Kind.\n */\n async allocateOneId(kindName = 'Numbering'): Promise<string> {\n assertIsString(kindName)\n const ret = (await this.datastore.allocateIds(this.key([kindName]), 1))[0][0].id\n assertIsString(ret)\n return ret\n }\n\n /** This tries to give high level access to transactions.\n\n So called \"Gross Group Transactions\" are always enabled. Transactions are never Cross Project. `runInTransaction()` works only if you use the same [[KvStore] instance for all access within the Transaction.\n\n [[runInTransaction]] is modelled after Python 2.7 [ndb's `@ndb.transactional` feature](https://cloud.google.com/appengine/docs/standard/python/ndb/transactions). This is based on node's [AsyncLocalStorage](https://nodejs.org/docs/latest-v14.x/api/async_hooks.html).\n\n Transactions frequently fail if you try to access the same data via in a transaction. See the [Documentation on Locking](https://cloud.google.com/datastore/docs/concepts/transactions#transaction_locks) for further reference. You are advised to use [p-limit](https://github.com/sindresorhus/p-limit)(1) to serialize transactions touching the same resource. This should work nicely with node's single process model. It is a much bigger problem on shared-nothing approaches, like Python on App Engine.\n\n Transactions might be wrapped in [p-retry](https://github.com/sindresorhus/p-retry) to implement automatically retrying them with exponential back-off should they fail due to contention.\n\n Be aware that Transactions differ considerable between Master-Slave Datastore (very old), High Replication Datastore (old, later called [Google Cloud Datastore](https://cloud.google.com/datastore/docs/concepts/cloud-datastore-transactions)) and [Firestore in Datastore Mode](https://cloud.google.com/datastore/docs/firestore-or-datastore#in_datastore_mode) (current).\n\n Most Applications today are running on \"Firestore in Datastore Mode\". Beware that the Datastore-Emulator fails with `error: 3 INVALID_ARGUMENT: Only ancestor queries are allowed inside transactions.` during [[runQuery]] while the Datastore on Google Infrastructure does not have such an restriction anymore as of 2022.\n */\n async runInTransaction<T>(func: () => Promise<T>): Promise<T> {\n let ret\n const transaction: Transaction = this.datastore.transaction()\n await transactionAsyncLocalStorage.run(transaction, async () => {\n const [transactionInfo, transactionRunApiResponse] = await transaction.run()\n let commitApiResponse\n try {\n ret = await func()\n } catch (error) {\n const rollbackInfo = await transaction.rollback()\n debug(\n 'Transaction failed, rollback initiated: %O %O %O %O',\n transactionInfo,\n transactionRunApiResponse,\n rollbackInfo,\n error\n )\n await setImmediate()\n throw new DstoreError('datastore.transaction execution error', error as Error)\n }\n try {\n commitApiResponse = (await transaction.commit())[0]\n } catch (error) {\n debug(\n 'Transaction commit failed: %O %O %O %O ret: %O',\n transactionInfo,\n transactionRunApiResponse,\n commitApiResponse,\n error,\n ret\n )\n await setImmediate()\n throw new DstoreError('datastore.transaction execution error', error as Error)\n }\n })\n return ret as T\n }\n}\n\nexport class DstoreError extends Error {\n public readonly extensions: Record<string, unknown>\n public readonly originalError: Error | undefined\n readonly [key: string]: unknown\n\n constructor(message: string, originalError: Error | undefined, extensions?: Record<string, unknown>) {\n super(`${message}: ${originalError?.message}`)\n\n // if no name provided, use the default. defineProperty ensures that it stays non-enumerable\n if (!this.name) {\n Object.defineProperty(this, 'name', { value: 'DstoreError' })\n }\n // metadata: Metadata { internalRepr: Map(0) {}, options: {} },\n this.originalError = originalError\n this.extensions = { ...extensions }\n this.stack =\n (this.stack?.split('\\n')[0] || '') +\n '\\n' +\n (originalError?.stack?.split('\\n')?.slice(1)?.join('\\n') || '') +\n '\\n' +\n (this.stack?.split('\\n')?.slice(1)?.join('\\n') || '')\n\n // These are usually present on Datastore Errors\n // logger.error({ err: originalError, extensions }, message);\n }\n}\n"],"names":["assertIsKey","value","variableName","additionalMessage","assert","Datastore","isKey","type","message","getType","AssertionMessage","debug","Debug","transactionAsyncLocalStorage","AsyncLocalStorage","promClient","register","removeSingleMetric","metricHistogram","Histogram","name","help","labelNames","metricFailureCounter","Counter","KEYSYM","KEY","Dstore","datastore","projectId","logger","this","engine","engines","urlSaveKey","entity","URLSafeKey","assertIsObject","push","_proto","prototype","getDoT","getStore","key","path","keySerialize","_this$projectId","legacyEncode","keyFromSerialized","text","legacyDecode","readKey","ent","ret","_keyStr","JSON","stringify","fixKeys","entities","_this2","forEach","x","assertIsDefined","prepareEntitiesForDatastore","_step2","_iterator2","_createForOfIteratorHelperLoose","done","e","data","excludeLargeProperties","undefined","_extends","prepareEntitiesFromDatastore","_step3","_iterator3","get","_get","_asyncToGenerator","_regeneratorRuntime","mark","_callee","result","wrap","_context","prev","next","Array","isArray","length","getMulti","abrupt","sent","stop","_x","apply","arguments","_getMulti","_callee2","keys","results","metricEnd","_yield$this$getDoT$ge","entitiesByKey","_context2","startTimer","t0","t2","t3","t1","t4","call","t5","inc","operation","setImmediate","DstoreError","finish","assertIsArray","map","_x2","set","_set","_callee3","saveEntity","_context3","save","_x3","_x4","_save","_callee4","_context4","_x5","insert","_insert","_callee5","_context5","_x6","update","_update","_callee6","_context6","_x7","_delete2","_callee7","_context7","_x8","createQuery","kindName","error","runQuery","_runQuery","_callee8","query","_yield$this$getDoT$ru","info","_context8","_x9","_query","_callee9","filters","limit","ordering","selection","cursor","q","_iterator4","_step4","filterSpec","_iterator5","_step5","_context9","assertIsString","assertIsNumber","filter","_construct","PropertyFilter","order","select","_x10","_x11","_x12","_x13","_x14","_x15","iterate","_ref","_this","_ref$filters","_ref$limit","_ref$ordering","_ref$selection","_callee10","_iterator6","_step6","_iterator7","_step7","_iteratorAbruptCompletion","_didIteratorError","_iteratorError","_iterator","_step","_context10","_asyncIterator","runStream","_awaitAsyncGenerator","allocateOneId","_allocateOneId","_callee11","_context11","allocateIds","id","_x16","runInTransaction","_runInTransaction","_callee13","func","transaction","_context13","run","_callee12","_yield$transaction$ru","transactionInfo","transactionRunApiResponse","commitApiResponse","_context12","rollback","commit","_x17","_Error","originalError","extensions","_this3$stack","_originalError$stack","_this3$stack2","_this3","Object","defineProperty","stack","split","slice","join","_wrapNativeSuper","Error"],"mappings":"qkVAqCgBA,EACZC,EACAC,EACAC,GAEAC,EAAAA,OACIC,EAASA,UAACC,MAAML,GA1BqB,SACzCA,EACAM,EACAL,EACAC,GAEA,IAAIK,EAAUN,EACLA,8BAA4CO,UAAQR,kDACjBQ,EAAAA,QAAQR,GAAkB,aACtE,OAAOE,EAAuBK,EAAYL,KAAAA,EAAsBK,CACpE,CAiBQE,CAAiBT,EAAO,EAAOC,EAAcC,GAErD,mSCVA,IAAMQ,EAAQC,EAAM,UAGdC,EAA+B,IAAIC,EAAAA,kBAGzCC,EAAWC,SAASC,mBAAmB,2BACvCF,EAAWC,SAASC,mBAAmB,yBAEvC,IAAMC,EAAkB,IAAIH,EAAWI,UAAU,CAC/CC,KAAM,0BACNC,KAAM,0CACNC,WAAY,CAAC,eAETC,EAAuB,IAAIR,EAAWS,QAAQ,CAClDJ,KAAM,wBACNC,KAAM,wCACNC,WAAY,CAAC,eAOFG,EAASpB,EAASA,UAACqB,IAsHnBC,EAAM,WAoBjB,SAAAA,EAAqBC,EAA+BC,EAA6BC,GAAeC,KAA3EH,eAAA,EAAAG,KAA+BF,eAAA,EAAAE,KAA6BD,YAAA,EAAAC,KAnBjFC,OAAS,SAAQD,KACjBE,QAAo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AK,QAAS,IAGpDN,CACF,SAAC,SAAAN,KAAAjH,yEAAAA,CAAA,EAAA8H,EAxB8BC"}
|
|
1
|
+
{"version":3,"file":"datastore-api.cjs.production.min.js","sources":["../src/lib/assert.ts","../src/lib/dstore-api.ts"],"sourcesContent":["/*\n * assert.ts\n * \n * Created by Dr. Maximillian Dornseif 2025-04-11 in datastore-api 6.0.1\n */\n\nimport { Datastore, Key } from '@google-cloud/datastore'\nimport { AssertionMessageType, assert, getType } from 'assertate-debug'\n\n/**\n * Generates an type assertion message for the given `value`\n *\n * @param value value being type-checked\n * @param type the expected value as a string; eg 'string', 'boolean', 'number'\n * @param variableName the name of the variable being type-checked\n * @param additionalMessage further information on failure\n */\nlet AssertionMessage: AssertionMessageType = (\n value,\n type,\n variableName?,\n additionalMessage?\n): string => {\n let message = variableName\n ? `${variableName} must be of type '${type}', '${getType(value)}' provided`\n : `expected value of type '${type}', '${getType(value)}' provided`\n return additionalMessage ? `${message}: ${additionalMessage}` : message\n}\n\n/**\n * Type-checks the provided `value` to be a symbol, throws an Error if it is not\n *\n * @param value the value to type-check as a symbol\n * @param variableName the name of the variable to be type-checked\n * @param additionalMessage further information on failure\n * @throws {Error}\n */\nexport function assertIsKey(\n value: unknown,\n variableName?: string,\n additionalMessage?: string\n): asserts value is Key {\n assert(\n Datastore.isKey(value as any),\n AssertionMessage(value, \"Key\", variableName, additionalMessage)\n )\n}\n\n\n\n\n\n","/*\n * dstore.ts - Datastore Compatibility layer\n * Try to get a smoother API for transactions and such.\n * A little bit inspired by the Python2 ndb interface.\n * But without the ORM bits.\n *\n * In future https://github.com/graphql/dataloader might be used for batching.\n *\n * Created by Dr. Maximillian Dornseif 2021-12-05 in huwawi3backend 11.10.0\n * Copyright (c) 2021, 2022, 2023, 2025 Dr. Maximillian Dornseif\n */\n\nimport { AsyncLocalStorage } from 'async_hooks'\nimport { setImmediate } from 'timers/promises'\n\nimport { Datastore, Key, PathType, Query, Transaction, PropertyFilter } from '@google-cloud/datastore'\nimport { Entity, entity } from '@google-cloud/datastore/build/src/entity'\nimport { Operator, RunQueryInfo, RunQueryResponse } from '@google-cloud/datastore/build/src/query'\nimport { CommitResponse } from '@google-cloud/datastore/build/src/request'\nimport {\n assert,\n assertIsArray,\n assertIsDefined,\n assertIsNumber,\n assertIsObject,\n assertIsString,\n} from 'assertate-debug'\nimport Debug from 'debug'\nimport promClient from 'prom-client'\nimport { Writable } from 'ts-essentials'\nimport { assertIsKey } from './assert'\n\n/** @ignore */\nexport { Datastore, Key, PathType, Query, Transaction } from '@google-cloud/datastore'\n\n/** @ignore */\nconst debug = Debug('ds:api')\n\n/** @ignore */\nconst transactionAsyncLocalStorage = new AsyncLocalStorage()\n\n// for HMR\npromClient.register.removeSingleMetric('dstore_requests_seconds')\npromClient.register.removeSingleMetric('dstore_failures_total')\n/** @ignore */\nconst metricHistogram = new promClient.Histogram({\n name: 'dstore_requests_seconds',\n help: 'How long did Datastore operations take?',\n labelNames: ['operation'],\n})\nconst metricFailureCounter = new promClient.Counter({\n name: 'dstore_failures_total',\n help: 'How many Datastore operations failed?',\n labelNames: ['operation'],\n})\n\n/** Use instead of Datastore.KEY\n *\n * Even better: use `_key` instead.\n */\nexport const KEYSYM = Datastore.KEY\n\nexport type IGqlFilterTypes = boolean | string | number\n\nexport type IGqlFilterSpec = {\n readonly eq: IGqlFilterTypes\n}\nexport type TGqlFilterList = Array<[string, Operator, DstorePropertyValues]>\n\n/** Define what can be written into the Datastore */\nexport type DstorePropertyValues =\n | number\n | string\n | Date\n | boolean\n | null\n | undefined\n | Buffer\n | Key\n | DstorePropertyValues[]\n | { [key: string]: DstorePropertyValues }\n\nexport interface IDstoreEntryWithoutKey {\n /** All User Data stored in the Datastore */\n [key: string]: DstorePropertyValues\n}\n\n/** Represents what is actually stored inside the Datastore, called \"Entity\" by Google\n [@google-cloud/datastore](https://github.com/googleapis/nodejs-datastore#readme) adds `[Datastore.KEY]`. Using ES6 Symbols presents all kinds of hurdles, especially when you try to serialize into a cache. So we add the property _keyStr which contains the encoded key. It is automatically used to reconstruct `[Datastore.KEY]`, if you use [[Dstore.readKey]].\n*/\nexport interface IDstoreEntry extends IDstoreEntryWithoutKey {\n /* Datastore Key provided by [@google-cloud/datastore](https://github.com/googleapis/nodejs-datastore#readme) */\n readonly [Datastore.KEY]?: Key\n /** [Datastore.KEY] key */\n _keyStr: string\n}\n\n/** Represents what is actually stored inside the Datastore, called \"Entity\" by Google\n*/\nexport interface IDstoreEntryWithKey extends IDstoreEntry {\n /* Datastore Key provided by [@google-cloud/datastore](https://github.com/googleapis/nodejs-datastore#readme) */\n readonly [Datastore.KEY]: Key\n /** [Datastore.KEY] key */\n _keyStr: string\n}\n\n/** Represents the thing you pass to the save method. Also called \"Entity\" by Google */\nexport type DstoreSaveEntity = {\n key: Key\n data: Omit<IDstoreEntry, '_keyStr' | Datastore['KEY']> &\n Partial<{\n _keyStr: string | undefined;\n [Datastore.KEY]: Key\n }>\n method?: 'insert' | 'update' | 'upsert'\n excludeLargeProperties?: boolean\n excludeFromIndexes?: readonly string[]\n}\n\nexport interface IIterateParams {\n kindName: string,\n filters?: TGqlFilterList,\n limit?: number,\n ordering?: readonly string[],\n selection?: readonly string[],\n}\ntype IDstore = {\n /** Accessible by Users of the library. Keep in mind that you will access outside transactions created by [[runInTransaction]]. */\n readonly datastore: Datastore\n key: (path: ReadonlyArray<PathType>) => Key\n keyFromSerialized: (text: string) => Key\n keySerialize: (key: Key) => string\n readKey: (entry: IDstoreEntry) => Key\n get: (key: Key) => Promise<IDstoreEntry | null>\n getMulti: (keys: ReadonlyArray<Key>) => Promise<ReadonlyArray<IDstoreEntry | null>>\n set: (key: Key, entry: IDstoreEntry) => Promise<Key>\n save: (entities: readonly DstoreSaveEntity[]) => Promise<CommitResponse | undefined>\n insert: (entities: readonly DstoreSaveEntity[]) => Promise<CommitResponse | undefined>\n update: (entities: readonly DstoreSaveEntity[]) => Promise<CommitResponse | undefined>\n delete: (keys: readonly Key[]) => Promise<CommitResponse | undefined>\n createQuery: (kind: string) => Query\n runQuery: (query: Query | Omit<Query, 'run'>) => Promise<RunQueryResponse>\n query: (\n kind: string,\n filters?: TGqlFilterList,\n limit?: number,\n ordering?: readonly string[],\n selection?: readonly string[],\n cursor?: string\n ) => Promise<RunQueryResponse>\n iterate: (options: IIterateParams) => AsyncIterable<IDstoreEntryWithKey>\n allocateOneId: (kindName: string) => Promise<string>\n runInTransaction: <T>(func: { (): Promise<T>; (): T }) => Promise<T>\n}\n\n/** Dstore implements a slightly more accessible version of the [Google Cloud Datastore: Node.js Client](https://cloud.google.com/nodejs/docs/reference/datastore/latest)\n\n[@google-cloud/datastore](https://github.com/googleapis/nodejs-datastore#readme) is a strange beast: [The documentation is auto generated](https://cloud.google.com/nodejs/docs/reference/datastore/latest) and completely shy of documenting any advanced concepts.\n(Example: If you ask the datastore to auto-generate keys during save: how do you retrieve the generated key?) Generally I suggest to look at the Python 2.x [db](https://cloud.google.com/appengine/docs/standard/python/datastore/api-overview) and [ndb](https://cloud.google.com/appengine/docs/standard/python/ndb) documentation to get a better explanation of the workings of the datastore.\n\nAlso the typings are strange. The Google provided type `Entities` can be the on disk representation, the same but including a key reference (`Datastore.KEY` - [[IDstoreEntry]]), a list of these or a structured object containing the on disk representation under the `data` property and a `key` property and maybe some configuration like `excludeFromIndexes` ([[DstoreSaveEntity]]) or a list of these.\n\nKvStore tries to abstract away most surprises the datastore provides to you but als tries to stay as API compatible as possible to [@google-cloud/datastore](https://github.com/googleapis/nodejs-datastore).\n\nMain differences:\n\n- Everything asynchronous is Promise-based - no callbacks.\n- [[get]] always returns a single [[IDstoreEntry]].\n- [[getMulti]] always returns an Array<[[IDstoreEntry]]> of the same length as the input Array. Items not found are represented by null.\n- [[set]] is called with `(key, value)` and always returns the complete [[Key]] of the entity being written. Keys are normalized, numeric IDs are always encoded as strings.\n- [[key]] handles [[Key]] object instantiation for you.\n- [[readKey]] extracts the key from an [[IDstoreEntry]] you have read without the need of fancy `Symbol`-based access to `entity[Datastore.KEY]`. If needed, it tries to deserialize `_keyStr` to create `entity[Datastore.KEY]`. This ist important when rehydrating an [[IDstoreEntry]] from a serializing cache.\n- [[allocateOneId]] returns a single numeric string encoded unique datastore id without the need of fancy unpacking.\n- [[runInTransaction]] allows you to provide a function to be executed inside an transaction without the need of passing around the transaction object. This is modelled after Python 2.7 [ndb's `@ndb.transactional` feature](https://cloud.google.com/appengine/docs/standard/python/ndb/transactions). This is implemented via node's [AsyncLocalStorage](https://nodejs.org/docs/latest-v14.x/api/async_hooks.html).\n- [[keySerialize]] is synchronous.\n\nThis documentation also tries to document the little known idiosyncrasies of the [@google-cloud/datastore](https://github.com/googleapis/nodejs-datastore) library. See the corresponding functions.\n*/\nexport class Dstore implements IDstore {\n engine = 'Dstore';\n engines: string[] = [];\n private readonly urlSaveKey = new entity.URLSafeKey();\n\n /** Generate a Dstore instance for a specific [[Datastore]] instance.\n\n ```\n const dstore = Dstore(new Datastore())\n ```\n\n You are encouraged to provide the second parameter to provide the ProjectID. This makes [[keySerialize]] more robust. Usually you can get this from the Environment:\n\n ```\n const dstore = Dstore(new Datastore(), process.env.GCLOUD_PROJECT)\n\n @param datastore A [[Datastore]] instance. Can be freely accessed by the client. Be aware that using this inside [[runInTransaction]] ignores the transaction.\n @param projectId The `GCLOUD_PROJECT ID`. Used for Key generation during serialization.\n ```\n */\n constructor(readonly datastore: Datastore, readonly projectId?: string, readonly logger?: string) {\n assertIsObject(datastore)\n this.engines.push(this.engine)\n }\n\n /** Gets the Datastore or the current Transaction. */\n private getDoT(): Transaction | Datastore {\n return (transactionAsyncLocalStorage.getStore() as Transaction) || this.datastore\n }\n\n /** `key()` creates a [[Key]] Object from a path.\n *\n * Compatible to [Datastore.key](https://cloud.google.com/nodejs/docs/reference/datastore/latest/datastore/datastore#_google_cloud_datastore_Datastore_key_member_1_)\n *\n * If the Path has an odd number of elements, it is considered an incomplete Key. This can only be used for saving and will prompt the Datastore to auto-generate an (random) ID. See also [[save]].\n *\n * @category Datastore Drop-In\n */\n key(path: readonly PathType[]): Key {\n return this.datastore.key(path as Writable<typeof path>)\n }\n\n /** `keyFromSerialized()` serializes [[Key]] to a string.\n *\n * Compatible to [keyToLegacyUrlSafe](https://cloud.google.com/nodejs/docs/reference/datastore/latest/datastore/datastore#_google_cloud_datastore_Datastore_keyToLegacyUrlSafe_member_1_), but does not support the \"locationPrefix\" since the use for this parameter is undocumented and unknown. It seems to be an artifact from early App Engine days.\n *\n * It can be a synchronous function because it does not look up the `projectId`. Instead it is assumed, that you give the `projectId` upon instantiation of [[Dstore]]. It also seems, that a wrong `projectId` bears no ill effects.\n *\n * @category Datastore Drop-In\n */\n keySerialize(key: Key): string {\n return key ? this.urlSaveKey.legacyEncode(this.projectId ?? '', key) : ''\n }\n\n /** `keyFromSerialized()` deserializes a string created with [[keySerialize]] to a [[Key]].\n *\n * Compatible to [keyFromLegacyUrlsafe](https://cloud.google.com/nodejs/docs/reference/datastore/latest/datastore/datastore#_google_cloud_datastore_Datastore_keyFromLegacyUrlsafe_member_1_).\n *\n * @category Datastore Drop-In\n */\n keyFromSerialized(text: string): Key {\n return this.urlSaveKey.legacyDecode(text)\n }\n\n /** `readKey()` extracts the [[Key]] from an [[IDstoreEntry]].\n *\n * Is is an alternative to `entity[Datastore.KEY]` which tends to fail in various contexts and also confuses older Typescript compilers.\n * It can extract the [[Key]] form a [[IDstoreEntry]] which has been serialized to JSON by leveraging the property `_keyStr`.\n *\n * @category Additional\n */\n readKey(ent: IDstoreEntry): Key {\n assertIsObject(ent)\n let ret = ent[Datastore.KEY]\n if (ent._keyStr && !ret) {\n ret = this.keyFromSerialized(ent._keyStr)\n }\n assertIsObject(\n ret,\n 'entity[Datastore.KEY]/entity._keyStr',\n `Entity is missing the datastore Key: ${JSON.stringify(ent)}`\n )\n return ret\n }\n\n /** `fixKeys()` is called for all [[IDstoreEntry]] returned from [[Dstore]].\n *\n * Is ensures that besides `entity[Datastore.KEY]` there is `_keyStr` to be leveraged by [[readKey]].\n *\n * @internal\n */\n private fixKeys(\n entities: ReadonlyArray<Partial<IDstoreEntry> | undefined>\n ): Array<IDstoreEntry | undefined> {\n entities.forEach((x) => {\n if (!!x?.[Datastore.KEY] && x[Datastore.KEY]) {\n assertIsDefined(x[Datastore.KEY])\n assertIsObject(x[Datastore.KEY])\n // Old TypesScript has problems with symbols as a property\n x._keyStr = this.keySerialize(x[Datastore.KEY] as Key)\n }\n })\n return entities as Array<IDstoreEntry | undefined>\n }\n\n /** this is for save, insert, update and upsert and ensures _kkeyStr() handling.\n * \n */\n private prepareEntitiesForDatastore(entities: readonly DstoreSaveEntity[]) {\n for (const e of entities) {\n assertIsObject(e.key)\n assertIsObject(e.data)\n this.fixKeys([e.data])\n e.excludeLargeProperties = e.excludeLargeProperties === undefined ? true : e.excludeLargeProperties\n e.data = { ...e.data, _keyStr: undefined }\n }\n }\n\n /** this is for save, insert, update and upsert and ensures _kkeyStr() handling.\n * \n */\n private prepareEntitiesFromDatastore(entities: readonly DstoreSaveEntity[] & unknown[]) {\n for (const e of entities) {\n e.data[Datastore.KEY] = e.key\n this.fixKeys([e.data])\n }\n }\n\n /** `get()` reads a [[IDstoreEntry]] from the Datastore.\n *\n * It returns [[IDstoreEntry]] or `null` if not found.\n\n * The underlying Datastore API Call is [lookup](https://cloud.google.com/datastore/docs/reference/data/rest/v1/projects/lookup).\n *\n * It is in the Spirit of [Datastore.get()]. Unfortunately currently (late 2021) there is no formal documentation from Google on [Datastore.get()].\n *\n * Differences between [[Dstore.get]] and [[Datastore.get]]:\n *\n * - [Dstore.get]] takes a single [[Key]] as Parameter, no Array. Check [[getMulti]] if you want Arrays.\n * - [Dstore.get]] returns a single [[IDstoreEntry]], no Array.\n *\n * @category Datastore Drop-In\n */\n async get(key: Key): Promise<IDstoreEntry | null> {\n assertIsObject(key)\n assert(!Array.isArray(key))\n assert(key.path.length % 2 == 0, `key.path must be complete: ${JSON.stringify(key.path)}`)\n const result = await this.getMulti([key])\n return result?.[0] || null\n }\n\n /** `getMulti()` reads several [[IDstoreEntry]]s from the Datastore.\n *\n * It returns a list of [[IDstoreEntry]]s or `undefined` if not found. Entries are in the same Order as the keys in the Parameter.\n * This is different from the @google-cloud/datastore where not found items are not present in the result and the order in the result list is undefined.\n *\n * The underlying Datastore API Call is [lookup](https://cloud.google.com/datastore/docs/reference/data/rest/v1/projects/lookup).\n *\n * It is in the Spirit of [Datastore.get()]. Unfortunately currently (late 2021) there is no formal documentation from Google on [Datastore.get()].\n *\n * Differences between [[Dstore.getMulti]] and [[Datastore.get]]:\n *\n * - [[Dstore.getMulti]] always takes an Array of [[Key]]s as Parameter.\n * - [[Dstore.getMulti]] returns always a Array of [[IDstoreEntry]], or null.\n * - [[Datastore.get]] has many edge cases - e.g. when not being able to find any of the provided keys - which return surprising results. [[Dstore.getMulti]] always returns an Array. TODO: return a Array with the same length as the Input.\n *\n * @category Datastore Drop-In\n */\n async getMulti(keys: readonly Key[]): Promise<Array<IDstoreEntry | null>> {\n // assertIsArray(keys);\n let results: (IDstoreEntry | null | undefined)[]\n const metricEnd = metricHistogram.startTimer()\n try {\n results = this.fixKeys(\n keys.length > 0 ? (await this.getDoT().get(keys as Writable<typeof keys>))?.[0] : []\n )\n } catch (error) {\n metricFailureCounter.inc({ operation: 'get' })\n await setImmediate()\n throw new DstoreError('datastore.getMulti error', error as Error, { keys })\n } finally {\n metricEnd({ operation: 'get' })\n }\n\n // Sort resulting entities by the keys they were requested with.\n assertIsArray(results)\n const entities = results as IDstoreEntry[]\n const entitiesByKey: Record<string, IDstoreEntry> = {}\n entities.forEach((entity) => {\n entitiesByKey[JSON.stringify(entity[Datastore.KEY])] = entity\n })\n return keys.map((key) => entitiesByKey[JSON.stringify(key)] || null)\n }\n\n /** `set()` is addition to [[Datastore]]. It provides a classic Key-value Interface.\n *\n * Instead providing a nested [[DstoreSaveEntity]] to [[save]] you can call set directly as `set( key, value)`.\n * Observe that set takes a [[Key]] as first parameter. you call it like this;\n *\n * ```js\n * const ds = Dstore()\n * ds.set(ds.key('kind', '123'), {props1: 'foo', prop2: 'bar'})\n * ```\n *\n * It returns the [[Key]] of the Object being written.\n * If the Key provided was an incomplete [[Key]] it will return a completed [[Key]].\n * See [[save]] for more information on key generation.\n *\n * @category Additional\n */\n async set(key: Key, data: IDstoreEntryWithoutKey): Promise<Key> {\n assertIsObject(key)\n assertIsObject(data)\n const saveEntity = { key, data: { ...data, _keyStr: undefined } }\n await this.save([saveEntity])\n return saveEntity.key\n }\n\n /** `save()` is compatible to [Datastore.save()](https://cloud.google.com/nodejs/docs/reference/datastore/latest/datastore/datastore#_google_cloud_datastore_Datastore_save_member_1_).\n *\n * The single Parameter is a list of [[DstoreSaveEntity]]s.\n * If called within a transaction it returns `undefined`.\n * If not, it returns a [[CommitResponse]] which is not documented by Google.\n *\n * Different [DstoreSaveEntity]]s in the `entities` parameter can have different values in their [[DstoreSaveEntity.method]] property.\n * This allows you to do `insert`, `update` and `upsert` (the default) in a single request.\n *\n * `save()` seems to basically be an alias to [upsert](https://cloud.google.com/nodejs/docs/reference/datastore/latest/datastore/datastore#_google_cloud_datastore_Datastore_upsert_member_1_).\n *\n * If the [[Key]] provided in [[DstoreSaveEntity.key]] was an incomplete [[Key]] it will be updated by `save()` inside the [[DstoreSaveEntity]].\n *\n * If the Datastore generates a new ID because of an incomplete [[Key]] *on first save* it will return an large integer as [[Key.id]].\n * On every subsequent `save()` an string encoded number representation is returned.\n * @todo Dstore should normalizes that and always return an string encoded number representation.\n *\n * Each [[DstoreSaveEntity]] can have an `excludeFromIndexes` property which is somewhat underdocumented.\n * It can use something like JSON-Path notation\n * ([Source](https://github.com/googleapis/nodejs-datastore/blob/2941f2f0f132b41534e303d441d837051ce88fd7/src/index.ts#L948))\n * [.*](https://github.com/googleapis/nodejs-datastore/blob/406b15d2014087172df617c6e0a397a2c0902c5f/test/index.ts#L1598),\n * [parent[]](https://github.com/googleapis/nodejs-datastore/blob/406b15d2014087172df617c6e0a397a2c0902c5f/test/index.ts#L1672),\n * [parent.*](https://github.com/googleapis/nodejs-datastore/blob/406b15d2014087172df617c6e0a397a2c0902c5f/test/index.ts#L1672),\n * [parent[].*](https://github.com/googleapis/nodejs-datastore/blob/406b15d2014087172df617c6e0a397a2c0902c5f/test/index.ts#L1672)\n * and [more complex patterns](https://github.com/googleapis/nodejs-datastore/blob/406b15d2014087172df617c6e0a397a2c0902c5f/test/index.ts#L1754)\n * seem to be supported patterns.\n *\n * If the caller has not provided an `excludeLargeProperties` in a [[DstoreSaveEntity]] we will default it\n * to `excludeLargeProperties: true`. Without this you can not store strings longer than 1500 bytes easily\n * ([source](https://github.com/googleapis/nodejs-datastore/blob/c7a08a8382c6706ccbfbbf77950babf40bac757c/src/entity.ts#L961)).\n *\n * @category Datastore Drop-In\n */\n async save(entities: readonly DstoreSaveEntity[]): Promise<CommitResponse | undefined> {\n assertIsArray(entities)\n let ret: CommitResponse | undefined\n const metricEnd = metricHistogram.startTimer()\n try {\n this.prepareEntitiesForDatastore(entities)\n // Within Transaction we don't get any answer here!\n // [ { mutationResults: [ [Object], [Object] ], indexUpdates: 51 } ]\n ret = (await this.getDoT().save(entities)) || undefined\n this.prepareEntitiesFromDatastore(entities)\n } catch (error) {\n metricFailureCounter.inc({ operation: 'save' })\n await setImmediate()\n throw new DstoreError('datastore.save error', error as Error)\n } finally {\n metricEnd({ operation: 'save' })\n }\n return ret\n }\n\n\n\n /** `insert()` is compatible to [Datastore.insert()](https://cloud.google.com/nodejs/docs/reference/datastore/latest/datastore/datastore#_google_cloud_datastore_Datastore_insert_member_1_).\n *\n * The single Parameter is a list of [[DstoreSaveEntity]]s.\n * If called within a transaction it returns `undefined`.\n * If not, it returns a [[CommitResponse]] which is not documented by Google.\n *\n * `insert()` seems to be like [[save]] where [[DstoreSaveEntity.method]] is set to `'insert'`. It throws an [[DstoreError]] if there is already a Entity with the same [[Key]] in the Datastore.\n *\n * For handling of incomplete [[Key]]s see [[save]].\n *\n * This function can be completely emulated by using [[save]] with `method: 'insert'` inside each [[DstoreSaveEntity]].\n * Prefer using `save()` because it is much better tested.\n *\n * await ds.insert([{key: ds.key(['testKind', 123]), entity: {data:' 123'}}])\n *\n * @throws [[DstoreError]]\n * @category Datastore Drop-In\n */\n async insert(entities: readonly DstoreSaveEntity[]): Promise<CommitResponse | undefined> {\n assertIsArray(entities)\n let ret: CommitResponse | undefined\n const metricEnd = metricHistogram.startTimer()\n try {\n this.prepareEntitiesForDatastore(entities)\n ret = (await this.getDoT().insert(entities)) || undefined\n this.prepareEntitiesFromDatastore(entities)\n } catch (error) {\n // console.error(error)\n metricFailureCounter.inc({ operation: 'insert' })\n await setImmediate()\n throw new DstoreError('datastore.insert error', error as Error)\n } finally {\n metricEnd({ operation: 'insert' })\n }\n return ret\n }\n\n /** `update()` is compatible to [Datastore.update()](https://cloud.google.com/nodejs/docs/reference/datastore/latest/datastore/datastore#_google_cloud_datastore_Datastore_update_member_1_).\n\n * The single Parameter is a list of [[DstoreSaveEntity]]s.\n * If called within a transaction it returns `undefined`.\n * If not, it returns a [[CommitResponse]] which is not documented by Google.\n *\n * `update()` seems to be like [[save]] where [[DstoreSaveEntity.method]] is set to `'update'`.\n * It throws an [[DstoreError]] if there is no Entity with the same [[Key]] in the Datastore. `update()` *overwrites all existing data* for that [[Key]].\n * There was an alpha functionality called `merge()` in the Datastore which read an Entity, merged it with the new data and wrote it back, but this was never documented.\n *\n * `update()` is idempotent. Updating the same [[Key]] twice is no error.\n *\n * This function can be completely emulated by using [[save]] with `method: 'update'` inside each [[DstoreSaveEntity]].\n * Prefer using `save()` because it is much better tested.\n *\n * @throws [[DstoreError]]\n * @category Datastore Drop-In\n */\n async update(entities: readonly DstoreSaveEntity[]): Promise<CommitResponse | undefined> {\n assertIsArray(entities)\n\n entities.forEach((entity) => assertIsObject(entity.key))\n entities.forEach((entity) =>\n assert(\n entity.key.path.length % 2 == 0,\n `entity.key.path must be complete: ${JSON.stringify([entity.key.path, entity])}`\n )\n )\n let ret: CommitResponse | undefined\n const metricEnd = metricHistogram.startTimer()\n\n try {\n this.prepareEntitiesForDatastore(entities)\n ret = (await this.getDoT().update(entities)) || undefined\n this.prepareEntitiesFromDatastore(entities)\n } catch (error) {\n // console.error(error)\n metricFailureCounter.inc({ operation: 'update' })\n await setImmediate()\n throw new DstoreError('datastore.update error', error as Error)\n } finally {\n metricEnd({ operation: 'update' })\n }\n return ret\n }\n\n /** `delete()` is compatible to [Datastore.delete()].\n *\n * Unfortunately currently (late 2021) there is no formal documentation from Google on [Datastore.delete()].\n *\n * The single Parameter is a list of [[Key]]s.\n * If called within a transaction it returns `undefined`.\n * If not, it returns a [[CommitResponse]] which is not documented by Google.\n *\n * `delete()` is idempotent. Deleting the same [[Key]] twice is no error.\n *\n * @throws [[DstoreError]]\n * @category Datastore Drop-In\n */\n async delete(keys: readonly Key[]): Promise<CommitResponse | undefined> {\n assertIsArray(keys)\n keys.forEach((key) => assertIsObject(key))\n keys.forEach((key) =>\n assert(key.path.length % 2 == 0, `key.path must be complete: ${JSON.stringify(key.path)}`)\n )\n let ret\n const metricEnd = metricHistogram.startTimer()\n try {\n ret = (await this.getDoT().delete(keys)) || undefined\n } catch (error) {\n metricFailureCounter.inc({ operation: 'delete' })\n await setImmediate()\n throw new DstoreError('datastore.delete error', error as Error)\n } finally {\n metricEnd({ operation: 'delete' })\n }\n return ret\n }\n\n /** `createQuery()` creates an \"empty\" [[Query]] Object.\n *\n * Compatible to [createQuery](https://cloud.google.com/nodejs/docs/reference/datastore/latest/datastore/datastore#_google_cloud_datastore_Datastore_createQuery_member_1_) in the datastore.\n *\n * @param kindName Name of the [[Datastore]][Kind](https://cloud.google.com/datastore/docs/concepts/entities#kinds_and_identifiers) (\"Table\") which should be searched.\n *\n * @category Datastore Drop-In\n */\n createQuery(kindName: string): Query {\n try {\n return this.getDoT().createQuery(kindName)\n } catch (error) {\n throw new DstoreError('datastore.createQuery error', error as Error)\n }\n }\n\n async runQuery(query: Query | Omit<Query, 'run'>): Promise<RunQueryResponse> {\n let ret\n const metricEnd = metricHistogram.startTimer()\n try {\n const [entities, info]: [Entity[], RunQueryInfo] = await this.getDoT().runQuery(query as Query)\n ret = [this.fixKeys(entities), info]\n } catch (error) {\n await setImmediate()\n throw new DstoreError('datastore.runQuery error', error as Error)\n } finally {\n metricEnd({ operation: 'query' })\n }\n return ret as RunQueryResponse\n }\n\n /** `query()` combined [[createQuery]] and [[runQuery]] in a single call.\n *\n *\n * @param kindName Name of the [[Datastore]][Kind](https://cloud.google.com/datastore/docs/concepts/entities#kinds_and_identifiers) (\"Table\") which should be searched.\n * @param filters List of [[Query]] filter() calls.\n * @param limit Maximum Number of Results to return.\n * @param ordering List of [[Query]] order() calls.\n * @param selection selectionList of [[Query]] select() calls.\n * @param cursor unsupported so far.\n *\n * @throws [[DstoreError]]\n * @category Datastore Drop-In\n */\n async query(\n kindName: string,\n filters: TGqlFilterList = [],\n limit = 2500,\n ordering: readonly string[] = [],\n selection: readonly string[] = [],\n cursor?: string\n ): Promise<RunQueryResponse> {\n assertIsString(kindName)\n assertIsArray(filters)\n assertIsNumber(limit)\n try {\n const q = this.createQuery(kindName)\n for (const filterSpec of filters) {\n assertIsObject(filterSpec)\n // @ts-ignore\n q.filter(new PropertyFilter(...filterSpec))\n }\n for (const orderField of ordering) {\n q.order(orderField)\n }\n if (limit > 0) {\n q.limit(limit)\n }\n if (selection.length > 0) {\n q.select(selection as any)\n }\n const ret = await this.getDoT().runQuery(q)\n return [this.fixKeys(ret[0]), ret[1]]\n } catch (error) {\n await setImmediate()\n throw new DstoreError('datastore.query error', error as Error, {\n kindName,\n filters,\n limit,\n ordering,\n })\n }\n }\n\n\n /** `iterate()` is a modernized version of `query()`.\n *\n * It takes a Parameter object and returns an AsyncIterable.\n * Entities returned have been processed by `fixKeys()`.\n * \n * Can be used with `for await` loops like this:\n * \n * ```typescript\n * for await (const entity of dstore.iterate({ kindName: 'p_ReservierungsAbruf', filters: [['verbucht', '=', true]]})) {\n * console.log(entity)\n * }\n * ```\n * \n * @param kindName Name of the [[Datastore]][Kind](https://cloud.google.com/datastore/docs/concepts/entities#kinds_and_identifiers) (\"Table\") which should be searched.\n * @param filters List of [[Query]] filter() calls.\n * @param limit Maximum Number of Results to return.\n * @param ordering List of [[Query]] order() calls.\n * @param selection selectionList of [[Query]] select() calls.\n *\n * @throws [[DstoreError]]\n * @category Additional\n */\n async * iterate({\n kindName,\n filters = [],\n limit = 2500,\n ordering = [],\n selection = [],\n }: IIterateParams): AsyncIterable<IDstoreEntryWithKey> {\n assertIsString(kindName)\n assertIsArray(filters)\n assertIsNumber(limit)\n try {\n const q = this.getDoT().createQuery(kindName)\n for (const filterSpec of filters) {\n assertIsObject(filterSpec)\n // @ts-ignore\n q.filter(new PropertyFilter(...filterSpec))\n }\n for (const orderField of ordering) {\n q.order(orderField)\n }\n if (limit > 0) {\n q.limit(limit)\n }\n if (selection.length > 0) {\n q.select(selection as any)\n }\n for await (const entity of q.runStream()) {\n const ret = this.fixKeys([entity])[0]\n assertIsDefined(ret, 'datastore.iterate: entity is undefined')\n assertIsKey(ret[Datastore.KEY])\n yield ret as IDstoreEntryWithKey\n }\n } catch (error) {\n await setImmediate()\n throw new DstoreError('datastore.query error', error as Error, {\n kindName,\n filters,\n limit,\n ordering,\n })\n }\n }\n\n /** Allocate one ID in the Datastore.\n *\n * Currently (late 2021) there is no documentation provided by Google for the underlying node function.\n * Check the Documentation for [the low-level function](https://cloud.google.com/datastore/docs/reference/data/rest/v1/projects/allocateIds)\n * and [the conceptual overview](https://cloud.google.com/datastore/docs/concepts/entities#assigning_your_own_numeric_id)\n * and [this Stackoverflow post](https://stackoverflow.com/questions/60516959/how-does-allocateids-work-in-cloud-datastore-mode).\n *\n * The ID is a string encoded large number. This function will never return the same ID twice for any given Datastore.\n * If you provide a kindName the ID will be namespaced to this kind.\n * In fact the generated ID is namespaced via an incomplete [[Key]] of the given Kind.\n */\n async allocateOneId(kindName = 'Numbering'): Promise<string> {\n assertIsString(kindName)\n const ret = (await this.datastore.allocateIds(this.key([kindName]), 1))[0][0].id\n assertIsString(ret)\n return ret\n }\n\n /** This tries to give high level access to transactions.\n\n So called \"Gross Group Transactions\" are always enabled. Transactions are never Cross Project. `runInTransaction()` works only if you use the same [[KvStore] instance for all access within the Transaction.\n\n [[runInTransaction]] is modelled after Python 2.7 [ndb's `@ndb.transactional` feature](https://cloud.google.com/appengine/docs/standard/python/ndb/transactions). This is based on node's [AsyncLocalStorage](https://nodejs.org/docs/latest-v14.x/api/async_hooks.html).\n\n Transactions frequently fail if you try to access the same data via in a transaction. See the [Documentation on Locking](https://cloud.google.com/datastore/docs/concepts/transactions#transaction_locks) for further reference. You are advised to use [p-limit](https://github.com/sindresorhus/p-limit)(1) to serialize transactions touching the same resource. This should work nicely with node's single process model. It is a much bigger problem on shared-nothing approaches, like Python on App Engine.\n\n Transactions might be wrapped in [p-retry](https://github.com/sindresorhus/p-retry) to implement automatically retrying them with exponential back-off should they fail due to contention.\n\n Be aware that Transactions differ considerable between Master-Slave Datastore (very old), High Replication Datastore (old, later called [Google Cloud Datastore](https://cloud.google.com/datastore/docs/concepts/cloud-datastore-transactions)) and [Firestore in Datastore Mode](https://cloud.google.com/datastore/docs/firestore-or-datastore#in_datastore_mode) (current).\n\n Most Applications today are running on \"Firestore in Datastore Mode\". Beware that the Datastore-Emulator fails with `error: 3 INVALID_ARGUMENT: Only ancestor queries are allowed inside transactions.` during [[runQuery]] while the Datastore on Google Infrastructure does not have such an restriction anymore as of 2022.\n */\n async runInTransaction<T>(func: () => Promise<T>): Promise<T> {\n let ret\n const transaction: Transaction = this.datastore.transaction()\n await transactionAsyncLocalStorage.run(transaction, async () => {\n const [transactionInfo, transactionRunApiResponse] = await transaction.run()\n let commitApiResponse\n try {\n ret = await func()\n } catch (error) {\n const rollbackInfo = await transaction.rollback()\n debug(\n 'Transaction failed, rollback initiated: %O %O %O %O',\n transactionInfo,\n transactionRunApiResponse,\n rollbackInfo,\n error\n )\n await setImmediate()\n throw new DstoreError('datastore.transaction execution error', error as Error)\n }\n try {\n commitApiResponse = (await transaction.commit())[0]\n } catch (error) {\n debug(\n 'Transaction commit failed: %O %O %O %O ret: %O',\n transactionInfo,\n transactionRunApiResponse,\n commitApiResponse,\n error,\n ret\n )\n await setImmediate()\n throw new DstoreError('datastore.transaction execution error', error as Error)\n }\n })\n return ret as T\n }\n}\n\nexport class DstoreError extends Error {\n public readonly extensions: Record<string, unknown>\n public readonly originalError: Error | undefined\n readonly [key: string]: unknown\n\n constructor(message: string, originalError: Error | undefined, extensions?: Record<string, unknown>) {\n super(`${message}: ${originalError?.message}`)\n\n // if no name provided, use the default. defineProperty ensures that it stays non-enumerable\n if (!this.name) {\n Object.defineProperty(this, 'name', { value: 'DstoreError' })\n }\n // metadata: Metadata { internalRepr: Map(0) {}, options: {} },\n this.originalError = originalError\n this.extensions = { ...extensions }\n this.stack =\n (this.stack?.split('\\n')[0] || '') +\n '\\n' +\n (originalError?.stack?.split('\\n')?.slice(1)?.join('\\n') || '') +\n '\\n' +\n (this.stack?.split('\\n')?.slice(1)?.join('\\n') || '')\n\n // These are usually present on Datastore Errors\n // logger.error({ err: originalError, extensions }, message);\n }\n}\n"],"names":["assertIsKey","value","variableName","additionalMessage","assert","Datastore","isKey","type","message","getType","AssertionMessage","debug","Debug","transactionAsyncLocalStorage","AsyncLocalStorage","promClient","register","removeSingleMetric","metricHistogram","Histogram","name","help","labelNames","metricFailureCounter","Counter","KEYSYM","KEY","Dstore","datastore","projectId","logger","this","engine","engines","urlSaveKey","entity","URLSafeKey","assertIsObject","push","_proto","prototype","getDoT","getStore","key","path","keySerialize","_this$projectId","legacyEncode","keyFromSerialized","text","legacyDecode","readKey","ent","ret","_keyStr","JSON","stringify","fixKeys","entities","_this2","forEach","x","assertIsDefined","prepareEntitiesForDatastore","_step2","_iterator2","_createForOfIteratorHelperLoose","done","e","data","excludeLargeProperties","undefined","_extends","prepareEntitiesFromDatastore","_step3","_iterator3","get","_get","_asyncToGenerator","_regeneratorRuntime","mark","_callee","result","wrap","_context","prev","next","Array","isArray","length","getMulti","abrupt","sent","stop","_x","apply","arguments","_getMulti","_callee2","keys","results","metricEnd","_yield$this$getDoT$ge","entitiesByKey","_context2","startTimer","t0","t2","t3","t1","t4","call","t5","inc","operation","setImmediate","DstoreError","finish","assertIsArray","map","_x2","set","_set","_callee3","saveEntity","_context3","save","_x3","_x4","_save","_callee4","_context4","_x5","insert","_insert","_callee5","_context5","_x6","update","_update","_callee6","_context6","_x7","_delete2","_callee7","_context7","_x8","createQuery","kindName","error","runQuery","_runQuery","_callee8","query","_yield$this$getDoT$ru","info","_context8","_x9","_query","_callee9","filters","limit","ordering","selection","cursor","q","_iterator4","_step4","filterSpec","_iterator5","_step5","_context9","assertIsString","assertIsNumber","filter","_construct","PropertyFilter","order","select","_x10","_x11","_x12","_x13","_x14","_x15","iterate","_ref","_this","_ref$filters","_ref$limit","_ref$ordering","_ref$selection","_callee10","_iterator6","_step6","_iterator7","_step7","_iteratorAbruptCompletion","_didIteratorError","_iteratorError","_iterator","_step","_context10","_asyncIterator","runStream","_awaitAsyncGenerator","allocateOneId","_allocateOneId","_callee11","_context11","allocateIds","id","_x16","runInTransaction","_runInTransaction","_callee13","func","transaction","_context13","run","_callee12","_yield$transaction$ru","transactionInfo","transactionRunApiResponse","commitApiResponse","_context12","rollback","commit","_x17","_Error","originalError","extensions","_this3$stack","_originalError$stack","_this3$stack2","_this3","Object","defineProperty","stack","split","slice","join","_wrapNativeSuper","Error"],"mappings":"qkVAqCgBA,EACZC,EACAC,EACAC,GAEAC,EAAAA,OACIC,EAASA,UAACC,MAAML,GA1BqB,SACzCA,EACAM,EACAL,EACAC,GAEA,IAAIK,EAAUN,EACLA,8BAA4CO,UAAQR,kDACjBQ,EAAAA,QAAQR,GAAkB,aACtE,OAAOE,EAAuBK,EAAYL,KAAAA,EAAsBK,CACpE,CAiBQE,CAAiBT,EAAO,EAAOC,EAAcC,GAErD,mSCVA,IAAMQ,EAAQC,EAAM,UAGdC,EAA+B,IAAIC,EAAAA,kBAGzC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MAAO,gBAG/C0O,EAAKL,cAAgBA,EACrBK,EAAKJ,WAAU/J,EAAA,CAAA,EAAQ+J,GACvBI,EAAKG,eACFN,EAAAG,EAAKG,cAALN,EAAYO,MAAM,MAAM,KAAM,IAC/B,OACcN,MAAbH,GAAoBG,OAAPA,EAAbH,EAAeQ,QAAkBL,OAAbA,EAApBA,EAAsBM,MAAM,eAAKN,EAAjCA,EAAmCO,MAAM,WAAzCP,EAA6CQ,KAAK,QAAS,IAC5D,OACW,OAAVP,EAAAC,EAAKG,eAAKJ,EAAVA,EAAYK,MAAM,QAAe,OAAVL,EAAvBA,EAAyBM,MAAM,SAAE,EAAjCN,EAAmCO,KAAK,QAAS,IAGpDN,CACF,SAAC,SAAAN,KAAAjH,yEAAAA,CAAA,EAAA8H,EAxB8BC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datastore-api.esm.js","sources":["../src/lib/assert.ts","../src/lib/dstore-api.ts"],"sourcesContent":["/*\n * assert.ts\n * \n * Created by Dr. Maximillian Dornseif 2025-04-11 in datastore-api 6.0.1\n */\n\nimport { Datastore, Key } from '@google-cloud/datastore'\nimport { AssertionMessageType, assert, getType } from 'assertate-debug'\n\n/**\n * Generates an type assertion message for the given `value`\n *\n * @param value value being type-checked\n * @param type the expected value as a string; eg 'string', 'boolean', 'number'\n * @param variableName the name of the variable being type-checked\n * @param additionalMessage further information on failure\n */\nlet AssertionMessage: AssertionMessageType = (\n value,\n type,\n variableName?,\n additionalMessage?\n): string => {\n let message = variableName\n ? `${variableName} must be of type '${type}', '${getType(value)}' provided`\n : `expected value of type '${type}', '${getType(value)}' provided`\n return additionalMessage ? `${message}: ${additionalMessage}` : message\n}\n\n/**\n * Type-checks the provided `value` to be a symbol, throws an Error if it is not\n *\n * @param value the value to type-check as a symbol\n * @param variableName the name of the variable to be type-checked\n * @param additionalMessage further information on failure\n * @throws {Error}\n */\nexport function assertIsKey(\n value: unknown,\n variableName?: string,\n additionalMessage?: string\n): asserts value is Key {\n assert(\n Datastore.isKey(value as any),\n AssertionMessage(value, \"Key\", variableName, additionalMessage)\n )\n}\n\n\n\n\n\n","/*\n * dstore.ts - Datastore Compatibility layer\n * Try to get a smoother API for transactions and such.\n * A little bit inspired by the Python2 ndb interface.\n * But without the ORM bits.\n *\n * In future https://github.com/graphql/dataloader might be used for batching.\n *\n * Created by Dr. Maximillian Dornseif 2021-12-05 in huwawi3backend 11.10.0\n * Copyright (c) 2021, 2022, 2023, 2025 Dr. Maximillian Dornseif\n */\n\nimport { AsyncLocalStorage } from 'async_hooks'\nimport { setImmediate } from 'timers/promises'\n\nimport { Datastore, Key, PathType, Query, Transaction, PropertyFilter } from '@google-cloud/datastore'\nimport { Entity, entity } from '@google-cloud/datastore/build/src/entity'\nimport { Operator, RunQueryInfo, RunQueryResponse } from '@google-cloud/datastore/build/src/query'\nimport { CommitResponse } from '@google-cloud/datastore/build/src/request'\nimport {\n assert,\n assertIsArray,\n assertIsDefined,\n assertIsNumber,\n assertIsObject,\n assertIsString,\n} from 'assertate-debug'\nimport Debug from 'debug'\nimport promClient from 'prom-client'\nimport { Writable } from 'ts-essentials'\nimport { assertIsKey } from './assert'\n\n/** @ignore */\nexport { Datastore, Key, PathType, Query, Transaction } from '@google-cloud/datastore'\n\n/** @ignore */\nconst debug = Debug('ds:api')\n\n/** @ignore */\nconst transactionAsyncLocalStorage = new AsyncLocalStorage()\n\n// for HMR\npromClient.register.removeSingleMetric('dstore_requests_seconds')\npromClient.register.removeSingleMetric('dstore_failures_total')\n/** @ignore */\nconst metricHistogram = new promClient.Histogram({\n name: 'dstore_requests_seconds',\n help: 'How long did Datastore operations take?',\n labelNames: ['operation'],\n})\nconst metricFailureCounter = new promClient.Counter({\n name: 'dstore_failures_total',\n help: 'How many Datastore operations failed?',\n labelNames: ['operation'],\n})\n\n/** Use instead of Datastore.KEY\n *\n * Even better: use `_key` instead.\n */\nexport const KEYSYM = Datastore.KEY\n\nexport type IGqlFilterTypes = boolean | string | number\n\nexport type IGqlFilterSpec = {\n readonly eq: IGqlFilterTypes\n}\nexport type TGqlFilterList = Array<[string, Operator, DstorePropertyValues]>\n\n/** Define what can be written into the Datastore */\nexport type DstorePropertyValues =\n | number\n | string\n | Date\n | boolean\n | null\n | undefined\n | Buffer\n | Key\n | DstorePropertyValues[]\n | { [key: string]: DstorePropertyValues }\n\nexport interface IDstoreEntryWithoutKey {\n /** All User Data stored in the Datastore */\n [key: string]: DstorePropertyValues\n}\n\n/** Represents what is actually stored inside the Datastore, called \"Entity\" by Google\n [@google-cloud/datastore](https://github.com/googleapis/nodejs-datastore#readme) adds `[Datastore.KEY]`. Using ES6 Symbols presents all kinds of hurdles, especially when you try to serialize into a cache. So we add the property _keyStr which contains the encoded key. It is automatically used to reconstruct `[Datastore.KEY]`, if you use [[Dstore.readKey]].\n*/\nexport interface IDstoreEntry extends IDstoreEntryWithoutKey {\n /* Datastore Key provided by [@google-cloud/datastore](https://github.com/googleapis/nodejs-datastore#readme) */\n readonly [Datastore.KEY]?: Key\n /** [Datastore.KEY] key */\n _keyStr: string\n}\n\n/** Represents what is actually stored inside the Datastore, called \"Entity\" by Google\n*/\nexport interface IDstoreEntryWithKey extends IDstoreEntry {\n /* Datastore Key provided by [@google-cloud/datastore](https://github.com/googleapis/nodejs-datastore#readme) */\n readonly [Datastore.KEY]: Key\n /** [Datastore.KEY] key */\n _keyStr: string\n}\n\n/** Represents the thing you pass to the save method. Also called \"Entity\" by Google */\nexport type DstoreSaveEntity = {\n key: Key\n data: Omit<IDstoreEntry, '_keyStr' | Datastore['KEY']> &\n Partial<{\n _keyStr: string | undefined;\n [Datastore.KEY]: Key\n }>\n method?: 'insert' | 'update' | 'upsert'\n excludeLargeProperties?: boolean\n excludeFromIndexes?: readonly string[]\n}\n\nexport interface IIterateParams {\n kindName: string,\n filters?: TGqlFilterList,\n limit?: number,\n ordering?: readonly string[],\n selection?: readonly string[],\n}\ntype IDstore = {\n /** Accessible by Users of the library. Keep in mind that you will access outside transactions created by [[runInTransaction]]. */\n readonly datastore: Datastore\n key: (path: ReadonlyArray<PathType>) => Key\n keyFromSerialized: (text: string) => Key\n keySerialize: (key: Key) => string\n readKey: (entry: IDstoreEntry) => Key\n get: (key: Key) => Promise<IDstoreEntry | null>\n getMulti: (keys: ReadonlyArray<Key>) => Promise<ReadonlyArray<IDstoreEntry | null>>\n set: (key: Key, entry: IDstoreEntry) => Promise<Key>\n save: (entities: readonly DstoreSaveEntity[]) => Promise<CommitResponse | undefined>\n insert: (entities: readonly DstoreSaveEntity[]) => Promise<CommitResponse | undefined>\n update: (entities: readonly DstoreSaveEntity[]) => Promise<CommitResponse | undefined>\n delete: (keys: readonly Key[]) => Promise<CommitResponse | undefined>\n createQuery: (kind: string) => Query\n runQuery: (query: Query | Omit<Query, 'run'>) => Promise<RunQueryResponse>\n query: (\n kind: string,\n filters?: TGqlFilterList,\n limit?: number,\n ordering?: readonly string[],\n selection?: readonly string[],\n cursor?: string\n ) => Promise<RunQueryResponse>\n iterate: (options: IIterateParams) => AsyncIterable<IDstoreEntry>\n allocateOneId: (kindName: string) => Promise<string>\n runInTransaction: <T>(func: { (): Promise<T>; (): T }) => Promise<T>\n}\n\n/** Dstore implements a slightly more accessible version of the [Google Cloud Datastore: Node.js Client](https://cloud.google.com/nodejs/docs/reference/datastore/latest)\n\n[@google-cloud/datastore](https://github.com/googleapis/nodejs-datastore#readme) is a strange beast: [The documentation is auto generated](https://cloud.google.com/nodejs/docs/reference/datastore/latest) and completely shy of documenting any advanced concepts.\n(Example: If you ask the datastore to auto-generate keys during save: how do you retrieve the generated key?) Generally I suggest to look at the Python 2.x [db](https://cloud.google.com/appengine/docs/standard/python/datastore/api-overview) and [ndb](https://cloud.google.com/appengine/docs/standard/python/ndb) documentation to get a better explanation of the workings of the datastore.\n\nAlso the typings are strange. The Google provided type `Entities` can be the on disk representation, the same but including a key reference (`Datastore.KEY` - [[IDstoreEntry]]), a list of these or a structured object containing the on disk representation under the `data` property and a `key` property and maybe some configuration like `excludeFromIndexes` ([[DstoreSaveEntity]]) or a list of these.\n\nKvStore tries to abstract away most surprises the datastore provides to you but als tries to stay as API compatible as possible to [@google-cloud/datastore](https://github.com/googleapis/nodejs-datastore).\n\nMain differences:\n\n- Everything asynchronous is Promise-based - no callbacks.\n- [[get]] always returns a single [[IDstoreEntry]].\n- [[getMulti]] always returns an Array<[[IDstoreEntry]]> of the same length as the input Array. Items not found are represented by null.\n- [[set]] is called with `(key, value)` and always returns the complete [[Key]] of the entity being written. Keys are normalized, numeric IDs are always encoded as strings.\n- [[key]] handles [[Key]] object instantiation for you.\n- [[readKey]] extracts the key from an [[IDstoreEntry]] you have read without the need of fancy `Symbol`-based access to `entity[Datastore.KEY]`. If needed, it tries to deserialize `_keyStr` to create `entity[Datastore.KEY]`. This ist important when rehydrating an [[IDstoreEntry]] from a serializing cache.\n- [[allocateOneId]] returns a single numeric string encoded unique datastore id without the need of fancy unpacking.\n- [[runInTransaction]] allows you to provide a function to be executed inside an transaction without the need of passing around the transaction object. This is modelled after Python 2.7 [ndb's `@ndb.transactional` feature](https://cloud.google.com/appengine/docs/standard/python/ndb/transactions). This is implemented via node's [AsyncLocalStorage](https://nodejs.org/docs/latest-v14.x/api/async_hooks.html).\n- [[keySerialize]] is synchronous.\n\nThis documentation also tries to document the little known idiosyncrasies of the [@google-cloud/datastore](https://github.com/googleapis/nodejs-datastore) library. See the corresponding functions.\n*/\nexport class Dstore implements IDstore {\n engine = 'Dstore';\n engines: string[] = [];\n private readonly urlSaveKey = new entity.URLSafeKey();\n\n /** Generate a Dstore instance for a specific [[Datastore]] instance.\n\n ```\n const dstore = Dstore(new Datastore())\n ```\n\n You are encouraged to provide the second parameter to provide the ProjectID. This makes [[keySerialize]] more robust. Usually you can get this from the Environment:\n\n ```\n const dstore = Dstore(new Datastore(), process.env.GCLOUD_PROJECT)\n\n @param datastore A [[Datastore]] instance. Can be freely accessed by the client. Be aware that using this inside [[runInTransaction]] ignores the transaction.\n @param projectId The `GCLOUD_PROJECT ID`. Used for Key generation during serialization.\n ```\n */\n constructor(readonly datastore: Datastore, readonly projectId?: string, readonly logger?: string) {\n assertIsObject(datastore)\n this.engines.push(this.engine)\n }\n\n /** Gets the Datastore or the current Transaction. */\n private getDoT(): Transaction | Datastore {\n return (transactionAsyncLocalStorage.getStore() as Transaction) || this.datastore\n }\n\n /** `key()` creates a [[Key]] Object from a path.\n *\n * Compatible to [Datastore.key](https://cloud.google.com/nodejs/docs/reference/datastore/latest/datastore/datastore#_google_cloud_datastore_Datastore_key_member_1_)\n *\n * If the Path has an odd number of elements, it is considered an incomplete Key. This can only be used for saving and will prompt the Datastore to auto-generate an (random) ID. See also [[save]].\n *\n * @category Datastore Drop-In\n */\n key(path: readonly PathType[]): Key {\n return this.datastore.key(path as Writable<typeof path>)\n }\n\n /** `keyFromSerialized()` serializes [[Key]] to a string.\n *\n * Compatible to [keyToLegacyUrlSafe](https://cloud.google.com/nodejs/docs/reference/datastore/latest/datastore/datastore#_google_cloud_datastore_Datastore_keyToLegacyUrlSafe_member_1_), but does not support the \"locationPrefix\" since the use for this parameter is undocumented and unknown. It seems to be an artifact from early App Engine days.\n *\n * It can be a synchronous function because it does not look up the `projectId`. Instead it is assumed, that you give the `projectId` upon instantiation of [[Dstore]]. It also seems, that a wrong `projectId` bears no ill effects.\n *\n * @category Datastore Drop-In\n */\n keySerialize(key: Key): string {\n return key ? this.urlSaveKey.legacyEncode(this.projectId ?? '', key) : ''\n }\n\n /** `keyFromSerialized()` deserializes a string created with [[keySerialize]] to a [[Key]].\n *\n * Compatible to [keyFromLegacyUrlsafe](https://cloud.google.com/nodejs/docs/reference/datastore/latest/datastore/datastore#_google_cloud_datastore_Datastore_keyFromLegacyUrlsafe_member_1_).\n *\n * @category Datastore Drop-In\n */\n keyFromSerialized(text: string): Key {\n return this.urlSaveKey.legacyDecode(text)\n }\n\n /** `readKey()` extracts the [[Key]] from an [[IDstoreEntry]].\n *\n * Is is an alternative to `entity[Datastore.KEY]` which tends to fail in various contexts and also confuses older Typescript compilers.\n * It can extract the [[Key]] form a [[IDstoreEntry]] which has been serialized to JSON by leveraging the property `_keyStr`.\n *\n * @category Additional\n */\n readKey(ent: IDstoreEntry): Key {\n assertIsObject(ent)\n let ret = ent[Datastore.KEY]\n if (ent._keyStr && !ret) {\n ret = this.keyFromSerialized(ent._keyStr)\n }\n assertIsObject(\n ret,\n 'entity[Datastore.KEY]/entity._keyStr',\n `Entity is missing the datastore Key: ${JSON.stringify(ent)}`\n )\n return ret\n }\n\n /** `fixKeys()` is called for all [[IDstoreEntry]] returned from [[Dstore]].\n *\n * Is ensures that besides `entity[Datastore.KEY]` there is `_keyStr` to be leveraged by [[readKey]].\n *\n * @internal\n */\n private fixKeys(\n entities: ReadonlyArray<Partial<IDstoreEntry> | undefined>\n ): Array<IDstoreEntry | undefined> {\n entities.forEach((x) => {\n if (!!x?.[Datastore.KEY] && x[Datastore.KEY]) {\n assertIsDefined(x[Datastore.KEY])\n assertIsObject(x[Datastore.KEY])\n // Old TypesScript has problems with symbols as a property\n x._keyStr = this.keySerialize(x[Datastore.KEY] as Key)\n }\n })\n return entities as Array<IDstoreEntry | undefined>\n }\n\n /** this is for save, insert, update and upsert and ensures _kkeyStr() handling.\n * \n */\n private prepareEntitiesForDatastore(entities: readonly DstoreSaveEntity[]) {\n for (const e of entities) {\n assertIsObject(e.key)\n assertIsObject(e.data)\n this.fixKeys([e.data])\n e.excludeLargeProperties = e.excludeLargeProperties === undefined ? true : e.excludeLargeProperties\n e.data = { ...e.data, _keyStr: undefined }\n }\n }\n\n /** this is for save, insert, update and upsert and ensures _kkeyStr() handling.\n * \n */\n private prepareEntitiesFromDatastore(entities: readonly DstoreSaveEntity[] & unknown[]) {\n for (const e of entities) {\n e.data[Datastore.KEY] = e.key\n this.fixKeys([e.data])\n }\n }\n\n /** `get()` reads a [[IDstoreEntry]] from the Datastore.\n *\n * It returns [[IDstoreEntry]] or `null` if not found.\n\n * The underlying Datastore API Call is [lookup](https://cloud.google.com/datastore/docs/reference/data/rest/v1/projects/lookup).\n *\n * It is in the Spirit of [Datastore.get()]. Unfortunately currently (late 2021) there is no formal documentation from Google on [Datastore.get()].\n *\n * Differences between [[Dstore.get]] and [[Datastore.get]]:\n *\n * - [Dstore.get]] takes a single [[Key]] as Parameter, no Array. Check [[getMulti]] if you want Arrays.\n * - [Dstore.get]] returns a single [[IDstoreEntry]], no Array.\n *\n * @category Datastore Drop-In\n */\n async get(key: Key): Promise<IDstoreEntry | null> {\n assertIsObject(key)\n assert(!Array.isArray(key))\n assert(key.path.length % 2 == 0, `key.path must be complete: ${JSON.stringify(key.path)}`)\n const result = await this.getMulti([key])\n return result?.[0] || null\n }\n\n /** `getMulti()` reads several [[IDstoreEntry]]s from the Datastore.\n *\n * It returns a list of [[IDstoreEntry]]s or `undefined` if not found. Entries are in the same Order as the keys in the Parameter.\n * This is different from the @google-cloud/datastore where not found items are not present in the result and the order in the result list is undefined.\n *\n * The underlying Datastore API Call is [lookup](https://cloud.google.com/datastore/docs/reference/data/rest/v1/projects/lookup).\n *\n * It is in the Spirit of [Datastore.get()]. Unfortunately currently (late 2021) there is no formal documentation from Google on [Datastore.get()].\n *\n * Differences between [[Dstore.getMulti]] and [[Datastore.get]]:\n *\n * - [[Dstore.getMulti]] always takes an Array of [[Key]]s as Parameter.\n * - [[Dstore.getMulti]] returns always a Array of [[IDstoreEntry]], or null.\n * - [[Datastore.get]] has many edge cases - e.g. when not being able to find any of the provided keys - which return surprising results. [[Dstore.getMulti]] always returns an Array. TODO: return a Array with the same length as the Input.\n *\n * @category Datastore Drop-In\n */\n async getMulti(keys: readonly Key[]): Promise<Array<IDstoreEntry | null>> {\n // assertIsArray(keys);\n let results: (IDstoreEntry | null | undefined)[]\n const metricEnd = metricHistogram.startTimer()\n try {\n results = this.fixKeys(\n keys.length > 0 ? (await this.getDoT().get(keys as Writable<typeof keys>))?.[0] : []\n )\n } catch (error) {\n metricFailureCounter.inc({ operation: 'get' })\n await setImmediate()\n throw new DstoreError('datastore.getMulti error', error as Error, { keys })\n } finally {\n metricEnd({ operation: 'get' })\n }\n\n // Sort resulting entities by the keys they were requested with.\n assertIsArray(results)\n const entities = results as IDstoreEntry[]\n const entitiesByKey: Record<string, IDstoreEntry> = {}\n entities.forEach((entity) => {\n entitiesByKey[JSON.stringify(entity[Datastore.KEY])] = entity\n })\n return keys.map((key) => entitiesByKey[JSON.stringify(key)] || null)\n }\n\n /** `set()` is addition to [[Datastore]]. It provides a classic Key-value Interface.\n *\n * Instead providing a nested [[DstoreSaveEntity]] to [[save]] you can call set directly as `set( key, value)`.\n * Observe that set takes a [[Key]] as first parameter. you call it like this;\n *\n * ```js\n * const ds = Dstore()\n * ds.set(ds.key('kind', '123'), {props1: 'foo', prop2: 'bar'})\n * ```\n *\n * It returns the [[Key]] of the Object being written.\n * If the Key provided was an incomplete [[Key]] it will return a completed [[Key]].\n * See [[save]] for more information on key generation.\n *\n * @category Additional\n */\n async set(key: Key, data: IDstoreEntryWithoutKey): Promise<Key> {\n assertIsObject(key)\n assertIsObject(data)\n const saveEntity = { key, data: { ...data, _keyStr: undefined } }\n await this.save([saveEntity])\n return saveEntity.key\n }\n\n /** `save()` is compatible to [Datastore.save()](https://cloud.google.com/nodejs/docs/reference/datastore/latest/datastore/datastore#_google_cloud_datastore_Datastore_save_member_1_).\n *\n * The single Parameter is a list of [[DstoreSaveEntity]]s.\n * If called within a transaction it returns `undefined`.\n * If not, it returns a [[CommitResponse]] which is not documented by Google.\n *\n * Different [DstoreSaveEntity]]s in the `entities` parameter can have different values in their [[DstoreSaveEntity.method]] property.\n * This allows you to do `insert`, `update` and `upsert` (the default) in a single request.\n *\n * `save()` seems to basically be an alias to [upsert](https://cloud.google.com/nodejs/docs/reference/datastore/latest/datastore/datastore#_google_cloud_datastore_Datastore_upsert_member_1_).\n *\n * If the [[Key]] provided in [[DstoreSaveEntity.key]] was an incomplete [[Key]] it will be updated by `save()` inside the [[DstoreSaveEntity]].\n *\n * If the Datastore generates a new ID because of an incomplete [[Key]] *on first save* it will return an large integer as [[Key.id]].\n * On every subsequent `save()` an string encoded number representation is returned.\n * @todo Dstore should normalizes that and always return an string encoded number representation.\n *\n * Each [[DstoreSaveEntity]] can have an `excludeFromIndexes` property which is somewhat underdocumented.\n * It can use something like JSON-Path notation\n * ([Source](https://github.com/googleapis/nodejs-datastore/blob/2941f2f0f132b41534e303d441d837051ce88fd7/src/index.ts#L948))\n * [.*](https://github.com/googleapis/nodejs-datastore/blob/406b15d2014087172df617c6e0a397a2c0902c5f/test/index.ts#L1598),\n * [parent[]](https://github.com/googleapis/nodejs-datastore/blob/406b15d2014087172df617c6e0a397a2c0902c5f/test/index.ts#L1672),\n * [parent.*](https://github.com/googleapis/nodejs-datastore/blob/406b15d2014087172df617c6e0a397a2c0902c5f/test/index.ts#L1672),\n * [parent[].*](https://github.com/googleapis/nodejs-datastore/blob/406b15d2014087172df617c6e0a397a2c0902c5f/test/index.ts#L1672)\n * and [more complex patterns](https://github.com/googleapis/nodejs-datastore/blob/406b15d2014087172df617c6e0a397a2c0902c5f/test/index.ts#L1754)\n * seem to be supported patterns.\n *\n * If the caller has not provided an `excludeLargeProperties` in a [[DstoreSaveEntity]] we will default it\n * to `excludeLargeProperties: true`. Without this you can not store strings longer than 1500 bytes easily\n * ([source](https://github.com/googleapis/nodejs-datastore/blob/c7a08a8382c6706ccbfbbf77950babf40bac757c/src/entity.ts#L961)).\n *\n * @category Datastore Drop-In\n */\n async save(entities: readonly DstoreSaveEntity[]): Promise<CommitResponse | undefined> {\n assertIsArray(entities)\n let ret: CommitResponse | undefined\n const metricEnd = metricHistogram.startTimer()\n try {\n this.prepareEntitiesForDatastore(entities)\n // Within Transaction we don't get any answer here!\n // [ { mutationResults: [ [Object], [Object] ], indexUpdates: 51 } ]\n ret = (await this.getDoT().save(entities)) || undefined\n this.prepareEntitiesFromDatastore(entities)\n } catch (error) {\n metricFailureCounter.inc({ operation: 'save' })\n await setImmediate()\n throw new DstoreError('datastore.save error', error as Error)\n } finally {\n metricEnd({ operation: 'save' })\n }\n return ret\n }\n\n\n\n /** `insert()` is compatible to [Datastore.insert()](https://cloud.google.com/nodejs/docs/reference/datastore/latest/datastore/datastore#_google_cloud_datastore_Datastore_insert_member_1_).\n *\n * The single Parameter is a list of [[DstoreSaveEntity]]s.\n * If called within a transaction it returns `undefined`.\n * If not, it returns a [[CommitResponse]] which is not documented by Google.\n *\n * `insert()` seems to be like [[save]] where [[DstoreSaveEntity.method]] is set to `'insert'`. It throws an [[DstoreError]] if there is already a Entity with the same [[Key]] in the Datastore.\n *\n * For handling of incomplete [[Key]]s see [[save]].\n *\n * This function can be completely emulated by using [[save]] with `method: 'insert'` inside each [[DstoreSaveEntity]].\n * Prefer using `save()` because it is much better tested.\n *\n * await ds.insert([{key: ds.key(['testKind', 123]), entity: {data:' 123'}}])\n *\n * @throws [[DstoreError]]\n * @category Datastore Drop-In\n */\n async insert(entities: readonly DstoreSaveEntity[]): Promise<CommitResponse | undefined> {\n assertIsArray(entities)\n let ret: CommitResponse | undefined\n const metricEnd = metricHistogram.startTimer()\n try {\n this.prepareEntitiesForDatastore(entities)\n ret = (await this.getDoT().insert(entities)) || undefined\n this.prepareEntitiesFromDatastore(entities)\n } catch (error) {\n // console.error(error)\n metricFailureCounter.inc({ operation: 'insert' })\n await setImmediate()\n throw new DstoreError('datastore.insert error', error as Error)\n } finally {\n metricEnd({ operation: 'insert' })\n }\n return ret\n }\n\n /** `update()` is compatible to [Datastore.update()](https://cloud.google.com/nodejs/docs/reference/datastore/latest/datastore/datastore#_google_cloud_datastore_Datastore_update_member_1_).\n\n * The single Parameter is a list of [[DstoreSaveEntity]]s.\n * If called within a transaction it returns `undefined`.\n * If not, it returns a [[CommitResponse]] which is not documented by Google.\n *\n * `update()` seems to be like [[save]] where [[DstoreSaveEntity.method]] is set to `'update'`.\n * It throws an [[DstoreError]] if there is no Entity with the same [[Key]] in the Datastore. `update()` *overwrites all existing data* for that [[Key]].\n * There was an alpha functionality called `merge()` in the Datastore which read an Entity, merged it with the new data and wrote it back, but this was never documented.\n *\n * `update()` is idempotent. Updating the same [[Key]] twice is no error.\n *\n * This function can be completely emulated by using [[save]] with `method: 'update'` inside each [[DstoreSaveEntity]].\n * Prefer using `save()` because it is much better tested.\n *\n * @throws [[DstoreError]]\n * @category Datastore Drop-In\n */\n async update(entities: readonly DstoreSaveEntity[]): Promise<CommitResponse | undefined> {\n assertIsArray(entities)\n\n entities.forEach((entity) => assertIsObject(entity.key))\n entities.forEach((entity) =>\n assert(\n entity.key.path.length % 2 == 0,\n `entity.key.path must be complete: ${JSON.stringify([entity.key.path, entity])}`\n )\n )\n let ret: CommitResponse | undefined\n const metricEnd = metricHistogram.startTimer()\n\n try {\n this.prepareEntitiesForDatastore(entities)\n ret = (await this.getDoT().update(entities)) || undefined\n this.prepareEntitiesFromDatastore(entities)\n } catch (error) {\n // console.error(error)\n metricFailureCounter.inc({ operation: 'update' })\n await setImmediate()\n throw new DstoreError('datastore.update error', error as Error)\n } finally {\n metricEnd({ operation: 'update' })\n }\n return ret\n }\n\n /** `delete()` is compatible to [Datastore.delete()].\n *\n * Unfortunately currently (late 2021) there is no formal documentation from Google on [Datastore.delete()].\n *\n * The single Parameter is a list of [[Key]]s.\n * If called within a transaction it returns `undefined`.\n * If not, it returns a [[CommitResponse]] which is not documented by Google.\n *\n * `delete()` is idempotent. Deleting the same [[Key]] twice is no error.\n *\n * @throws [[DstoreError]]\n * @category Datastore Drop-In\n */\n async delete(keys: readonly Key[]): Promise<CommitResponse | undefined> {\n assertIsArray(keys)\n keys.forEach((key) => assertIsObject(key))\n keys.forEach((key) =>\n assert(key.path.length % 2 == 0, `key.path must be complete: ${JSON.stringify(key.path)}`)\n )\n let ret\n const metricEnd = metricHistogram.startTimer()\n try {\n ret = (await this.getDoT().delete(keys)) || undefined\n } catch (error) {\n metricFailureCounter.inc({ operation: 'delete' })\n await setImmediate()\n throw new DstoreError('datastore.delete error', error as Error)\n } finally {\n metricEnd({ operation: 'delete' })\n }\n return ret\n }\n\n /** `createQuery()` creates an \"empty\" [[Query]] Object.\n *\n * Compatible to [createQuery](https://cloud.google.com/nodejs/docs/reference/datastore/latest/datastore/datastore#_google_cloud_datastore_Datastore_createQuery_member_1_) in the datastore.\n *\n * @param kindName Name of the [[Datastore]][Kind](https://cloud.google.com/datastore/docs/concepts/entities#kinds_and_identifiers) (\"Table\") which should be searched.\n *\n * @category Datastore Drop-In\n */\n createQuery(kindName: string): Query {\n try {\n return this.getDoT().createQuery(kindName)\n } catch (error) {\n throw new DstoreError('datastore.createQuery error', error as Error)\n }\n }\n\n async runQuery(query: Query | Omit<Query, 'run'>): Promise<RunQueryResponse> {\n let ret\n const metricEnd = metricHistogram.startTimer()\n try {\n const [entities, info]: [Entity[], RunQueryInfo] = await this.getDoT().runQuery(query as Query)\n ret = [this.fixKeys(entities), info]\n } catch (error) {\n await setImmediate()\n throw new DstoreError('datastore.runQuery error', error as Error)\n } finally {\n metricEnd({ operation: 'query' })\n }\n return ret as RunQueryResponse\n }\n\n /** `query()` combined [[createQuery]] and [[runQuery]] in a single call.\n *\n *\n * @param kindName Name of the [[Datastore]][Kind](https://cloud.google.com/datastore/docs/concepts/entities#kinds_and_identifiers) (\"Table\") which should be searched.\n * @param filters List of [[Query]] filter() calls.\n * @param limit Maximum Number of Results to return.\n * @param ordering List of [[Query]] order() calls.\n * @param selection selectionList of [[Query]] select() calls.\n * @param cursor unsupported so far.\n *\n * @throws [[DstoreError]]\n * @category Datastore Drop-In\n */\n async query(\n kindName: string,\n filters: TGqlFilterList = [],\n limit = 2500,\n ordering: readonly string[] = [],\n selection: readonly string[] = [],\n cursor?: string\n ): Promise<RunQueryResponse> {\n assertIsString(kindName)\n assertIsArray(filters)\n assertIsNumber(limit)\n try {\n const q = this.createQuery(kindName)\n for (const filterSpec of filters) {\n assertIsObject(filterSpec)\n // @ts-ignore\n q.filter(new PropertyFilter(...filterSpec))\n }\n for (const orderField of ordering) {\n q.order(orderField)\n }\n if (limit > 0) {\n q.limit(limit)\n }\n if (selection.length > 0) {\n q.select(selection as any)\n }\n const ret = await this.getDoT().runQuery(q)\n return [this.fixKeys(ret[0]), ret[1]]\n } catch (error) {\n await setImmediate()\n throw new DstoreError('datastore.query error', error as Error, {\n kindName,\n filters,\n limit,\n ordering,\n })\n }\n }\n\n\n /** `iterate()` is a modernized version of `query()`.\n *\n * It takes a Parameter object and returns an AsyncIterable.\n * Entities returned have been processed by `fixKeys()`.\n * \n * Can be used with `for await` loops like this:\n * \n * ```typescript\n * for await (const entity of dstore.iterate({ kindName: 'p_ReservierungsAbruf', filters: [['verbucht', '=', true]]})) {\n * console.log(entity)\n * }\n * ```\n * \n * @param kindName Name of the [[Datastore]][Kind](https://cloud.google.com/datastore/docs/concepts/entities#kinds_and_identifiers) (\"Table\") which should be searched.\n * @param filters List of [[Query]] filter() calls.\n * @param limit Maximum Number of Results to return.\n * @param ordering List of [[Query]] order() calls.\n * @param selection selectionList of [[Query]] select() calls.\n *\n * @throws [[DstoreError]]\n * @category Additional\n */\n async * iterate({\n kindName,\n filters = [],\n limit = 2500,\n ordering = [],\n selection = [],\n }: IIterateParams): AsyncIterable<IDstoreEntry> {\n assertIsString(kindName)\n assertIsArray(filters)\n assertIsNumber(limit)\n try {\n const q = this.getDoT().createQuery(kindName)\n for (const filterSpec of filters) {\n assertIsObject(filterSpec)\n // @ts-ignore\n q.filter(new PropertyFilter(...filterSpec))\n }\n for (const orderField of ordering) {\n q.order(orderField)\n }\n if (limit > 0) {\n q.limit(limit)\n }\n if (selection.length > 0) {\n q.select(selection as any)\n }\n for await (const entity of q.runStream()) {\n const ret = this.fixKeys([entity])[0]\n assertIsDefined(ret, 'datastore.iterate: entity is undefined')\n assertIsKey(ret[Datastore.KEY])\n yield ret as IDstoreEntryWithKey\n }\n } catch (error) {\n await setImmediate()\n throw new DstoreError('datastore.query error', error as Error, {\n kindName,\n filters,\n limit,\n ordering,\n })\n }\n }\n\n /** Allocate one ID in the Datastore.\n *\n * Currently (late 2021) there is no documentation provided by Google for the underlying node function.\n * Check the Documentation for [the low-level function](https://cloud.google.com/datastore/docs/reference/data/rest/v1/projects/allocateIds)\n * and [the conceptual overview](https://cloud.google.com/datastore/docs/concepts/entities#assigning_your_own_numeric_id)\n * and [this Stackoverflow post](https://stackoverflow.com/questions/60516959/how-does-allocateids-work-in-cloud-datastore-mode).\n *\n * The ID is a string encoded large number. This function will never return the same ID twice for any given Datastore.\n * If you provide a kindName the ID will be namespaced to this kind.\n * In fact the generated ID is namespaced via an incomplete [[Key]] of the given Kind.\n */\n async allocateOneId(kindName = 'Numbering'): Promise<string> {\n assertIsString(kindName)\n const ret = (await this.datastore.allocateIds(this.key([kindName]), 1))[0][0].id\n assertIsString(ret)\n return ret\n }\n\n /** This tries to give high level access to transactions.\n\n So called \"Gross Group Transactions\" are always enabled. Transactions are never Cross Project. `runInTransaction()` works only if you use the same [[KvStore] instance for all access within the Transaction.\n\n [[runInTransaction]] is modelled after Python 2.7 [ndb's `@ndb.transactional` feature](https://cloud.google.com/appengine/docs/standard/python/ndb/transactions). This is based on node's [AsyncLocalStorage](https://nodejs.org/docs/latest-v14.x/api/async_hooks.html).\n\n Transactions frequently fail if you try to access the same data via in a transaction. See the [Documentation on Locking](https://cloud.google.com/datastore/docs/concepts/transactions#transaction_locks) for further reference. You are advised to use [p-limit](https://github.com/sindresorhus/p-limit)(1) to serialize transactions touching the same resource. This should work nicely with node's single process model. It is a much bigger problem on shared-nothing approaches, like Python on App Engine.\n\n Transactions might be wrapped in [p-retry](https://github.com/sindresorhus/p-retry) to implement automatically retrying them with exponential back-off should they fail due to contention.\n\n Be aware that Transactions differ considerable between Master-Slave Datastore (very old), High Replication Datastore (old, later called [Google Cloud Datastore](https://cloud.google.com/datastore/docs/concepts/cloud-datastore-transactions)) and [Firestore in Datastore Mode](https://cloud.google.com/datastore/docs/firestore-or-datastore#in_datastore_mode) (current).\n\n Most Applications today are running on \"Firestore in Datastore Mode\". Beware that the Datastore-Emulator fails with `error: 3 INVALID_ARGUMENT: Only ancestor queries are allowed inside transactions.` during [[runQuery]] while the Datastore on Google Infrastructure does not have such an restriction anymore as of 2022.\n */\n async runInTransaction<T>(func: () => Promise<T>): Promise<T> {\n let ret\n const transaction: Transaction = this.datastore.transaction()\n await transactionAsyncLocalStorage.run(transaction, async () => {\n const [transactionInfo, transactionRunApiResponse] = await transaction.run()\n let commitApiResponse\n try {\n ret = await func()\n } catch (error) {\n const rollbackInfo = await transaction.rollback()\n debug(\n 'Transaction failed, rollback initiated: %O %O %O %O',\n transactionInfo,\n transactionRunApiResponse,\n rollbackInfo,\n error\n )\n await setImmediate()\n throw new DstoreError('datastore.transaction execution error', error as Error)\n }\n try {\n commitApiResponse = (await transaction.commit())[0]\n } catch (error) {\n debug(\n 'Transaction commit failed: %O %O %O %O ret: %O',\n transactionInfo,\n transactionRunApiResponse,\n commitApiResponse,\n error,\n ret\n )\n await setImmediate()\n throw new DstoreError('datastore.transaction execution error', error as Error)\n }\n })\n return ret as T\n }\n}\n\nexport class DstoreError extends Error {\n public readonly extensions: Record<string, unknown>\n public readonly originalError: Error | undefined\n readonly [key: string]: unknown\n\n constructor(message: string, originalError: Error | undefined, extensions?: Record<string, unknown>) {\n super(`${message}: ${originalError?.message}`)\n\n // if no name provided, use the default. defineProperty ensures that it stays non-enumerable\n if (!this.name) {\n Object.defineProperty(this, 'name', { value: 'DstoreError' })\n }\n // metadata: Metadata { internalRepr: Map(0) {}, options: {} },\n this.originalError = originalError\n this.extensions = { ...extensions }\n this.stack =\n (this.stack?.split('\\n')[0] || '') +\n '\\n' +\n (originalError?.stack?.split('\\n')?.slice(1)?.join('\\n') || '') +\n '\\n' +\n (this.stack?.split('\\n')?.slice(1)?.join('\\n') || '')\n\n // These are usually present on Datastore Errors\n // logger.error({ err: originalError, extensions }, message);\n }\n}\n"],"names":["AssertionMessage","value","type","variableName","additionalMessage","message","getType","assertIsKey","assert","Datastore","isKey","debug","Debug","transactionAsyncLocalStorage","AsyncLocalStorage","promClient","register","removeSingleMetric","metricHistogram","Histogram","name","help","labelNames","metricFailureCounter","Counter","KEYSYM","KEY","Dstore","datastore","projectId","logger","engine","engines","urlSaveKey","entity","URLSafeKey","assertIsObject","push","_proto","prototype","getDoT","getStore","key","path","keySerialize","_this$projectId","legacyEncode","keyFromSerialized","text","legacyDecode","readKey","ent","ret","_keyStr","JSON","stringify","fixKeys","entities","_this2","forEach","x","assertIsDefined","prepareEntitiesForDatastore","_iterator2","_createForOfIteratorHelperLoose","_step2","done","e","data","excludeLargeProperties","undefined","_extends","prepareEntitiesFromDatastore","_iterator3","_step3","get","_get","_asyncToGenerator","_regeneratorRuntime","mark","_callee","result","wrap","_callee$","_context","prev","next","Array","isArray","length","getMulti","sent","abrupt","stop","_x","apply","arguments","_getMulti","_callee2","keys","results","metricEnd","_yield$this$getDoT$ge","entitiesByKey","_callee2$","_context2","startTimer","t0","t2","t3","t1","t4","call","t5","inc","operation","setImmediate","DstoreError","finish","assertIsArray","map","_x2","set","_set","_callee3","saveEntity","_callee3$","_context3","save","_x3","_x4","_save","_callee4","_callee4$","_context4","_x5","insert","_insert","_callee5","_callee5$","_context5","_x6","update","_update","_callee6","_callee6$","_context6","_x7","_delete2","_callee7","_callee7$","_context7","delete","_x8","createQuery","kindName","error","runQuery","_runQuery","_callee8","query","_yield$this$getDoT$ru","info","_callee8$","_context8","_x9","_query","_callee9","filters","limit","ordering","selection","cursor","q","_iterator4","_step4","filterSpec","_iterator5","_step5","orderField","_callee9$","_context9","assertIsString","assertIsNumber","filter","_construct","PropertyFilter","order","select","_x10","_x11","_x12","_x13","_x14","_x15","iterate","_ref","_this","_ref$filters","_ref$limit","_ref$ordering","_ref$selection","_wrapAsyncGenerator","_callee10","_iterator6","_step6","_iterator7","_step7","_iteratorAbruptCompletion","_didIteratorError","_iteratorError","_iterator","_step","_entity","_callee10$","_context10","_asyncIterator","runStream","_awaitAsyncGenerator","allocateOneId","_allocateOneId","_callee11","_callee11$","_context11","allocateIds","id","_x16","runInTransaction","_runInTransaction","_callee13","func","transaction","_callee13$","_context13","run","_callee12","_yield$transaction$ru","transactionInfo","transactionRunApiResponse","commitApiResponse","rollbackInfo","_callee12$","_context12","rollback","commit","_x17","_Error","originalError","extensions","_this3$stack","_originalError$stack","_this3$stack2","_this3","Object","defineProperty","stack","split","slice","join","_inheritsLoose","_wrapNativeSuper","Error"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;AAIG;AAKH;;;;;;;AAOG;AACH,IAAIA,gBAAgB,GAAyB,SAAzCA,gBAAgBA,CAChBC,KAAK,EACLC,IAAI,EACJC,YAAa,EACbC,iBAAkB,EACV;AACR,EAAA,IAAIC,OAAO,GAAGF,YAAY,GACjBA,YAAY,GAAA,oBAAA,GAAqBD,IAAI,GAAOI,MAAAA,GAAAA,OAAO,CAACL,KAAK,CAAC,+CAClCC,IAAI,GAAA,MAAA,GAAOI,OAAO,CAACL,KAAK,CAAC,GAAY,YAAA,CAAA;AACtE,EAA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A,OAAAN,MAAA,CAAA;AACF,GAAA;EAACO,cAAA,CAAA9I,WAAA,EAAAiI,MAAA,CAAA,CAAA;AAAA,EAAA,OAAAjI,WAAA,CAAA;AAAA,CAAA+I,cAAAA,gBAAA,CAxB8BC,KAAK,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"datastore-api.esm.js","sources":["../src/lib/assert.ts","../src/lib/dstore-api.ts"],"sourcesContent":["/*\n * assert.ts\n * \n * Created by Dr. Maximillian Dornseif 2025-04-11 in datastore-api 6.0.1\n */\n\nimport { Datastore, Key } from '@google-cloud/datastore'\nimport { AssertionMessageType, assert, getType } from 'assertate-debug'\n\n/**\n * Generates an type assertion message for the given `value`\n *\n * @param value value being type-checked\n * @param type the expected value as a string; eg 'string', 'boolean', 'number'\n * @param variableName the name of the variable being type-checked\n * @param additionalMessage further information on failure\n */\nlet AssertionMessage: AssertionMessageType = (\n value,\n type,\n variableName?,\n additionalMessage?\n): string => {\n let message = variableName\n ? `${variableName} must be of type '${type}', '${getType(value)}' provided`\n : `expected value of type '${type}', '${getType(value)}' provided`\n return additionalMessage ? `${message}: ${additionalMessage}` : message\n}\n\n/**\n * Type-checks the provided `value` to be a symbol, throws an Error if it is not\n *\n * @param value the value to type-check as a symbol\n * @param variableName the name of the variable to be type-checked\n * @param additionalMessage further information on failure\n * @throws {Error}\n */\nexport function assertIsKey(\n value: unknown,\n variableName?: string,\n additionalMessage?: string\n): asserts value is Key {\n assert(\n Datastore.isKey(value as any),\n AssertionMessage(value, \"Key\", variableName, additionalMessage)\n )\n}\n\n\n\n\n\n","/*\n * dstore.ts - Datastore Compatibility layer\n * Try to get a smoother API for transactions and such.\n * A little bit inspired by the Python2 ndb interface.\n * But without the ORM bits.\n *\n * In future https://github.com/graphql/dataloader might be used for batching.\n *\n * Created by Dr. Maximillian Dornseif 2021-12-05 in huwawi3backend 11.10.0\n * Copyright (c) 2021, 2022, 2023, 2025 Dr. Maximillian Dornseif\n */\n\nimport { AsyncLocalStorage } from 'async_hooks'\nimport { setImmediate } from 'timers/promises'\n\nimport { Datastore, Key, PathType, Query, Transaction, PropertyFilter } from '@google-cloud/datastore'\nimport { Entity, entity } from '@google-cloud/datastore/build/src/entity'\nimport { Operator, RunQueryInfo, RunQueryResponse } from '@google-cloud/datastore/build/src/query'\nimport { CommitResponse } from '@google-cloud/datastore/build/src/request'\nimport {\n assert,\n assertIsArray,\n assertIsDefined,\n assertIsNumber,\n assertIsObject,\n assertIsString,\n} from 'assertate-debug'\nimport Debug from 'debug'\nimport promClient from 'prom-client'\nimport { Writable } from 'ts-essentials'\nimport { assertIsKey } from './assert'\n\n/** @ignore */\nexport { Datastore, Key, PathType, Query, Transaction } from '@google-cloud/datastore'\n\n/** @ignore */\nconst debug = Debug('ds:api')\n\n/** @ignore */\nconst transactionAsyncLocalStorage = new AsyncLocalStorage()\n\n// for HMR\npromClient.register.removeSingleMetric('dstore_requests_seconds')\npromClient.register.removeSingleMetric('dstore_failures_total')\n/** @ignore */\nconst metricHistogram = new promClient.Histogram({\n name: 'dstore_requests_seconds',\n help: 'How long did Datastore operations take?',\n labelNames: ['operation'],\n})\nconst metricFailureCounter = new promClient.Counter({\n name: 'dstore_failures_total',\n help: 'How many Datastore operations failed?',\n labelNames: ['operation'],\n})\n\n/** Use instead of Datastore.KEY\n *\n * Even better: use `_key` instead.\n */\nexport const KEYSYM = Datastore.KEY\n\nexport type IGqlFilterTypes = boolean | string | number\n\nexport type IGqlFilterSpec = {\n readonly eq: IGqlFilterTypes\n}\nexport type TGqlFilterList = Array<[string, Operator, DstorePropertyValues]>\n\n/** Define what can be written into the Datastore */\nexport type DstorePropertyValues =\n | number\n | string\n | Date\n | boolean\n | null\n | undefined\n | Buffer\n | Key\n | DstorePropertyValues[]\n | { [key: string]: DstorePropertyValues }\n\nexport interface IDstoreEntryWithoutKey {\n /** All User Data stored in the Datastore */\n [key: string]: DstorePropertyValues\n}\n\n/** Represents what is actually stored inside the Datastore, called \"Entity\" by Google\n [@google-cloud/datastore](https://github.com/googleapis/nodejs-datastore#readme) adds `[Datastore.KEY]`. Using ES6 Symbols presents all kinds of hurdles, especially when you try to serialize into a cache. So we add the property _keyStr which contains the encoded key. It is automatically used to reconstruct `[Datastore.KEY]`, if you use [[Dstore.readKey]].\n*/\nexport interface IDstoreEntry extends IDstoreEntryWithoutKey {\n /* Datastore Key provided by [@google-cloud/datastore](https://github.com/googleapis/nodejs-datastore#readme) */\n readonly [Datastore.KEY]?: Key\n /** [Datastore.KEY] key */\n _keyStr: string\n}\n\n/** Represents what is actually stored inside the Datastore, called \"Entity\" by Google\n*/\nexport interface IDstoreEntryWithKey extends IDstoreEntry {\n /* Datastore Key provided by [@google-cloud/datastore](https://github.com/googleapis/nodejs-datastore#readme) */\n readonly [Datastore.KEY]: Key\n /** [Datastore.KEY] key */\n _keyStr: string\n}\n\n/** Represents the thing you pass to the save method. Also called \"Entity\" by Google */\nexport type DstoreSaveEntity = {\n key: Key\n data: Omit<IDstoreEntry, '_keyStr' | Datastore['KEY']> &\n Partial<{\n _keyStr: string | undefined;\n [Datastore.KEY]: Key\n }>\n method?: 'insert' | 'update' | 'upsert'\n excludeLargeProperties?: boolean\n excludeFromIndexes?: readonly string[]\n}\n\nexport interface IIterateParams {\n kindName: string,\n filters?: TGqlFilterList,\n limit?: number,\n ordering?: readonly string[],\n selection?: readonly string[],\n}\ntype IDstore = {\n /** Accessible by Users of the library. Keep in mind that you will access outside transactions created by [[runInTransaction]]. */\n readonly datastore: Datastore\n key: (path: ReadonlyArray<PathType>) => Key\n keyFromSerialized: (text: string) => Key\n keySerialize: (key: Key) => string\n readKey: (entry: IDstoreEntry) => Key\n get: (key: Key) => Promise<IDstoreEntry | null>\n getMulti: (keys: ReadonlyArray<Key>) => Promise<ReadonlyArray<IDstoreEntry | null>>\n set: (key: Key, entry: IDstoreEntry) => Promise<Key>\n save: (entities: readonly DstoreSaveEntity[]) => Promise<CommitResponse | undefined>\n insert: (entities: readonly DstoreSaveEntity[]) => Promise<CommitResponse | undefined>\n update: (entities: readonly DstoreSaveEntity[]) => Promise<CommitResponse | undefined>\n delete: (keys: readonly Key[]) => Promise<CommitResponse | undefined>\n createQuery: (kind: string) => Query\n runQuery: (query: Query | Omit<Query, 'run'>) => Promise<RunQueryResponse>\n query: (\n kind: string,\n filters?: TGqlFilterList,\n limit?: number,\n ordering?: readonly string[],\n selection?: readonly string[],\n cursor?: string\n ) => Promise<RunQueryResponse>\n iterate: (options: IIterateParams) => AsyncIterable<IDstoreEntryWithKey>\n allocateOneId: (kindName: string) => Promise<string>\n runInTransaction: <T>(func: { (): Promise<T>; (): T }) => Promise<T>\n}\n\n/** Dstore implements a slightly more accessible version of the [Google Cloud Datastore: Node.js Client](https://cloud.google.com/nodejs/docs/reference/datastore/latest)\n\n[@google-cloud/datastore](https://github.com/googleapis/nodejs-datastore#readme) is a strange beast: [The documentation is auto generated](https://cloud.google.com/nodejs/docs/reference/datastore/latest) and completely shy of documenting any advanced concepts.\n(Example: If you ask the datastore to auto-generate keys during save: how do you retrieve the generated key?) Generally I suggest to look at the Python 2.x [db](https://cloud.google.com/appengine/docs/standard/python/datastore/api-overview) and [ndb](https://cloud.google.com/appengine/docs/standard/python/ndb) documentation to get a better explanation of the workings of the datastore.\n\nAlso the typings are strange. The Google provided type `Entities` can be the on disk representation, the same but including a key reference (`Datastore.KEY` - [[IDstoreEntry]]), a list of these or a structured object containing the on disk representation under the `data` property and a `key` property and maybe some configuration like `excludeFromIndexes` ([[DstoreSaveEntity]]) or a list of these.\n\nKvStore tries to abstract away most surprises the datastore provides to you but als tries to stay as API compatible as possible to [@google-cloud/datastore](https://github.com/googleapis/nodejs-datastore).\n\nMain differences:\n\n- Everything asynchronous is Promise-based - no callbacks.\n- [[get]] always returns a single [[IDstoreEntry]].\n- [[getMulti]] always returns an Array<[[IDstoreEntry]]> of the same length as the input Array. Items not found are represented by null.\n- [[set]] is called with `(key, value)` and always returns the complete [[Key]] of the entity being written. Keys are normalized, numeric IDs are always encoded as strings.\n- [[key]] handles [[Key]] object instantiation for you.\n- [[readKey]] extracts the key from an [[IDstoreEntry]] you have read without the need of fancy `Symbol`-based access to `entity[Datastore.KEY]`. If needed, it tries to deserialize `_keyStr` to create `entity[Datastore.KEY]`. This ist important when rehydrating an [[IDstoreEntry]] from a serializing cache.\n- [[allocateOneId]] returns a single numeric string encoded unique datastore id without the need of fancy unpacking.\n- [[runInTransaction]] allows you to provide a function to be executed inside an transaction without the need of passing around the transaction object. This is modelled after Python 2.7 [ndb's `@ndb.transactional` feature](https://cloud.google.com/appengine/docs/standard/python/ndb/transactions). This is implemented via node's [AsyncLocalStorage](https://nodejs.org/docs/latest-v14.x/api/async_hooks.html).\n- [[keySerialize]] is synchronous.\n\nThis documentation also tries to document the little known idiosyncrasies of the [@google-cloud/datastore](https://github.com/googleapis/nodejs-datastore) library. See the corresponding functions.\n*/\nexport class Dstore implements IDstore {\n engine = 'Dstore';\n engines: string[] = [];\n private readonly urlSaveKey = new entity.URLSafeKey();\n\n /** Generate a Dstore instance for a specific [[Datastore]] instance.\n\n ```\n const dstore = Dstore(new Datastore())\n ```\n\n You are encouraged to provide the second parameter to provide the ProjectID. This makes [[keySerialize]] more robust. Usually you can get this from the Environment:\n\n ```\n const dstore = Dstore(new Datastore(), process.env.GCLOUD_PROJECT)\n\n @param datastore A [[Datastore]] instance. Can be freely accessed by the client. Be aware that using this inside [[runInTransaction]] ignores the transaction.\n @param projectId The `GCLOUD_PROJECT ID`. Used for Key generation during serialization.\n ```\n */\n constructor(readonly datastore: Datastore, readonly projectId?: string, readonly logger?: string) {\n assertIsObject(datastore)\n this.engines.push(this.engine)\n }\n\n /** Gets the Datastore or the current Transaction. */\n private getDoT(): Transaction | Datastore {\n return (transactionAsyncLocalStorage.getStore() as Transaction) || this.datastore\n }\n\n /** `key()` creates a [[Key]] Object from a path.\n *\n * Compatible to [Datastore.key](https://cloud.google.com/nodejs/docs/reference/datastore/latest/datastore/datastore#_google_cloud_datastore_Datastore_key_member_1_)\n *\n * If the Path has an odd number of elements, it is considered an incomplete Key. This can only be used for saving and will prompt the Datastore to auto-generate an (random) ID. See also [[save]].\n *\n * @category Datastore Drop-In\n */\n key(path: readonly PathType[]): Key {\n return this.datastore.key(path as Writable<typeof path>)\n }\n\n /** `keyFromSerialized()` serializes [[Key]] to a string.\n *\n * Compatible to [keyToLegacyUrlSafe](https://cloud.google.com/nodejs/docs/reference/datastore/latest/datastore/datastore#_google_cloud_datastore_Datastore_keyToLegacyUrlSafe_member_1_), but does not support the \"locationPrefix\" since the use for this parameter is undocumented and unknown. It seems to be an artifact from early App Engine days.\n *\n * It can be a synchronous function because it does not look up the `projectId`. Instead it is assumed, that you give the `projectId` upon instantiation of [[Dstore]]. It also seems, that a wrong `projectId` bears no ill effects.\n *\n * @category Datastore Drop-In\n */\n keySerialize(key: Key): string {\n return key ? this.urlSaveKey.legacyEncode(this.projectId ?? '', key) : ''\n }\n\n /** `keyFromSerialized()` deserializes a string created with [[keySerialize]] to a [[Key]].\n *\n * Compatible to [keyFromLegacyUrlsafe](https://cloud.google.com/nodejs/docs/reference/datastore/latest/datastore/datastore#_google_cloud_datastore_Datastore_keyFromLegacyUrlsafe_member_1_).\n *\n * @category Datastore Drop-In\n */\n keyFromSerialized(text: string): Key {\n return this.urlSaveKey.legacyDecode(text)\n }\n\n /** `readKey()` extracts the [[Key]] from an [[IDstoreEntry]].\n *\n * Is is an alternative to `entity[Datastore.KEY]` which tends to fail in various contexts and also confuses older Typescript compilers.\n * It can extract the [[Key]] form a [[IDstoreEntry]] which has been serialized to JSON by leveraging the property `_keyStr`.\n *\n * @category Additional\n */\n readKey(ent: IDstoreEntry): Key {\n assertIsObject(ent)\n let ret = ent[Datastore.KEY]\n if (ent._keyStr && !ret) {\n ret = this.keyFromSerialized(ent._keyStr)\n }\n assertIsObject(\n ret,\n 'entity[Datastore.KEY]/entity._keyStr',\n `Entity is missing the datastore Key: ${JSON.stringify(ent)}`\n )\n return ret\n }\n\n /** `fixKeys()` is called for all [[IDstoreEntry]] returned from [[Dstore]].\n *\n * Is ensures that besides `entity[Datastore.KEY]` there is `_keyStr` to be leveraged by [[readKey]].\n *\n * @internal\n */\n private fixKeys(\n entities: ReadonlyArray<Partial<IDstoreEntry> | undefined>\n ): Array<IDstoreEntry | undefined> {\n entities.forEach((x) => {\n if (!!x?.[Datastore.KEY] && x[Datastore.KEY]) {\n assertIsDefined(x[Datastore.KEY])\n assertIsObject(x[Datastore.KEY])\n // Old TypesScript has problems with symbols as a property\n x._keyStr = this.keySerialize(x[Datastore.KEY] as Key)\n }\n })\n return entities as Array<IDstoreEntry | undefined>\n }\n\n /** this is for save, insert, update and upsert and ensures _kkeyStr() handling.\n * \n */\n private prepareEntitiesForDatastore(entities: readonly DstoreSaveEntity[]) {\n for (const e of entities) {\n assertIsObject(e.key)\n assertIsObject(e.data)\n this.fixKeys([e.data])\n e.excludeLargeProperties = e.excludeLargeProperties === undefined ? true : e.excludeLargeProperties\n e.data = { ...e.data, _keyStr: undefined }\n }\n }\n\n /** this is for save, insert, update and upsert and ensures _kkeyStr() handling.\n * \n */\n private prepareEntitiesFromDatastore(entities: readonly DstoreSaveEntity[] & unknown[]) {\n for (const e of entities) {\n e.data[Datastore.KEY] = e.key\n this.fixKeys([e.data])\n }\n }\n\n /** `get()` reads a [[IDstoreEntry]] from the Datastore.\n *\n * It returns [[IDstoreEntry]] or `null` if not found.\n\n * The underlying Datastore API Call is [lookup](https://cloud.google.com/datastore/docs/reference/data/rest/v1/projects/lookup).\n *\n * It is in the Spirit of [Datastore.get()]. Unfortunately currently (late 2021) there is no formal documentation from Google on [Datastore.get()].\n *\n * Differences between [[Dstore.get]] and [[Datastore.get]]:\n *\n * - [Dstore.get]] takes a single [[Key]] as Parameter, no Array. Check [[getMulti]] if you want Arrays.\n * - [Dstore.get]] returns a single [[IDstoreEntry]], no Array.\n *\n * @category Datastore Drop-In\n */\n async get(key: Key): Promise<IDstoreEntry | null> {\n assertIsObject(key)\n assert(!Array.isArray(key))\n assert(key.path.length % 2 == 0, `key.path must be complete: ${JSON.stringify(key.path)}`)\n const result = await this.getMulti([key])\n return result?.[0] || null\n }\n\n /** `getMulti()` reads several [[IDstoreEntry]]s from the Datastore.\n *\n * It returns a list of [[IDstoreEntry]]s or `undefined` if not found. Entries are in the same Order as the keys in the Parameter.\n * This is different from the @google-cloud/datastore where not found items are not present in the result and the order in the result list is undefined.\n *\n * The underlying Datastore API Call is [lookup](https://cloud.google.com/datastore/docs/reference/data/rest/v1/projects/lookup).\n *\n * It is in the Spirit of [Datastore.get()]. Unfortunately currently (late 2021) there is no formal documentation from Google on [Datastore.get()].\n *\n * Differences between [[Dstore.getMulti]] and [[Datastore.get]]:\n *\n * - [[Dstore.getMulti]] always takes an Array of [[Key]]s as Parameter.\n * - [[Dstore.getMulti]] returns always a Array of [[IDstoreEntry]], or null.\n * - [[Datastore.get]] has many edge cases - e.g. when not being able to find any of the provided keys - which return surprising results. [[Dstore.getMulti]] always returns an Array. TODO: return a Array with the same length as the Input.\n *\n * @category Datastore Drop-In\n */\n async getMulti(keys: readonly Key[]): Promise<Array<IDstoreEntry | null>> {\n // assertIsArray(keys);\n let results: (IDstoreEntry | null | undefined)[]\n const metricEnd = metricHistogram.startTimer()\n try {\n results = this.fixKeys(\n keys.length > 0 ? (await this.getDoT().get(keys as Writable<typeof keys>))?.[0] : []\n )\n } catch (error) {\n metricFailureCounter.inc({ operation: 'get' })\n await setImmediate()\n throw new DstoreError('datastore.getMulti error', error as Error, { keys })\n } finally {\n metricEnd({ operation: 'get' })\n }\n\n // Sort resulting entities by the keys they were requested with.\n assertIsArray(results)\n const entities = results as IDstoreEntry[]\n const entitiesByKey: Record<string, IDstoreEntry> = {}\n entities.forEach((entity) => {\n entitiesByKey[JSON.stringify(entity[Datastore.KEY])] = entity\n })\n return keys.map((key) => entitiesByKey[JSON.stringify(key)] || null)\n }\n\n /** `set()` is addition to [[Datastore]]. It provides a classic Key-value Interface.\n *\n * Instead providing a nested [[DstoreSaveEntity]] to [[save]] you can call set directly as `set( key, value)`.\n * Observe that set takes a [[Key]] as first parameter. you call it like this;\n *\n * ```js\n * const ds = Dstore()\n * ds.set(ds.key('kind', '123'), {props1: 'foo', prop2: 'bar'})\n * ```\n *\n * It returns the [[Key]] of the Object being written.\n * If the Key provided was an incomplete [[Key]] it will return a completed [[Key]].\n * See [[save]] for more information on key generation.\n *\n * @category Additional\n */\n async set(key: Key, data: IDstoreEntryWithoutKey): Promise<Key> {\n assertIsObject(key)\n assertIsObject(data)\n const saveEntity = { key, data: { ...data, _keyStr: undefined } }\n await this.save([saveEntity])\n return saveEntity.key\n }\n\n /** `save()` is compatible to [Datastore.save()](https://cloud.google.com/nodejs/docs/reference/datastore/latest/datastore/datastore#_google_cloud_datastore_Datastore_save_member_1_).\n *\n * The single Parameter is a list of [[DstoreSaveEntity]]s.\n * If called within a transaction it returns `undefined`.\n * If not, it returns a [[CommitResponse]] which is not documented by Google.\n *\n * Different [DstoreSaveEntity]]s in the `entities` parameter can have different values in their [[DstoreSaveEntity.method]] property.\n * This allows you to do `insert`, `update` and `upsert` (the default) in a single request.\n *\n * `save()` seems to basically be an alias to [upsert](https://cloud.google.com/nodejs/docs/reference/datastore/latest/datastore/datastore#_google_cloud_datastore_Datastore_upsert_member_1_).\n *\n * If the [[Key]] provided in [[DstoreSaveEntity.key]] was an incomplete [[Key]] it will be updated by `save()` inside the [[DstoreSaveEntity]].\n *\n * If the Datastore generates a new ID because of an incomplete [[Key]] *on first save* it will return an large integer as [[Key.id]].\n * On every subsequent `save()` an string encoded number representation is returned.\n * @todo Dstore should normalizes that and always return an string encoded number representation.\n *\n * Each [[DstoreSaveEntity]] can have an `excludeFromIndexes` property which is somewhat underdocumented.\n * It can use something like JSON-Path notation\n * ([Source](https://github.com/googleapis/nodejs-datastore/blob/2941f2f0f132b41534e303d441d837051ce88fd7/src/index.ts#L948))\n * [.*](https://github.com/googleapis/nodejs-datastore/blob/406b15d2014087172df617c6e0a397a2c0902c5f/test/index.ts#L1598),\n * [parent[]](https://github.com/googleapis/nodejs-datastore/blob/406b15d2014087172df617c6e0a397a2c0902c5f/test/index.ts#L1672),\n * [parent.*](https://github.com/googleapis/nodejs-datastore/blob/406b15d2014087172df617c6e0a397a2c0902c5f/test/index.ts#L1672),\n * [parent[].*](https://github.com/googleapis/nodejs-datastore/blob/406b15d2014087172df617c6e0a397a2c0902c5f/test/index.ts#L1672)\n * and [more complex patterns](https://github.com/googleapis/nodejs-datastore/blob/406b15d2014087172df617c6e0a397a2c0902c5f/test/index.ts#L1754)\n * seem to be supported patterns.\n *\n * If the caller has not provided an `excludeLargeProperties` in a [[DstoreSaveEntity]] we will default it\n * to `excludeLargeProperties: true`. Without this you can not store strings longer than 1500 bytes easily\n * ([source](https://github.com/googleapis/nodejs-datastore/blob/c7a08a8382c6706ccbfbbf77950babf40bac757c/src/entity.ts#L961)).\n *\n * @category Datastore Drop-In\n */\n async save(entities: readonly DstoreSaveEntity[]): Promise<CommitResponse | undefined> {\n assertIsArray(entities)\n let ret: CommitResponse | undefined\n const metricEnd = metricHistogram.startTimer()\n try {\n this.prepareEntitiesForDatastore(entities)\n // Within Transaction we don't get any answer here!\n // [ { mutationResults: [ [Object], [Object] ], indexUpdates: 51 } ]\n ret = (await this.getDoT().save(entities)) || undefined\n this.prepareEntitiesFromDatastore(entities)\n } catch (error) {\n metricFailureCounter.inc({ operation: 'save' })\n await setImmediate()\n throw new DstoreError('datastore.save error', error as Error)\n } finally {\n metricEnd({ operation: 'save' })\n }\n return ret\n }\n\n\n\n /** `insert()` is compatible to [Datastore.insert()](https://cloud.google.com/nodejs/docs/reference/datastore/latest/datastore/datastore#_google_cloud_datastore_Datastore_insert_member_1_).\n *\n * The single Parameter is a list of [[DstoreSaveEntity]]s.\n * If called within a transaction it returns `undefined`.\n * If not, it returns a [[CommitResponse]] which is not documented by Google.\n *\n * `insert()` seems to be like [[save]] where [[DstoreSaveEntity.method]] is set to `'insert'`. It throws an [[DstoreError]] if there is already a Entity with the same [[Key]] in the Datastore.\n *\n * For handling of incomplete [[Key]]s see [[save]].\n *\n * This function can be completely emulated by using [[save]] with `method: 'insert'` inside each [[DstoreSaveEntity]].\n * Prefer using `save()` because it is much better tested.\n *\n * await ds.insert([{key: ds.key(['testKind', 123]), entity: {data:' 123'}}])\n *\n * @throws [[DstoreError]]\n * @category Datastore Drop-In\n */\n async insert(entities: readonly DstoreSaveEntity[]): Promise<CommitResponse | undefined> {\n assertIsArray(entities)\n let ret: CommitResponse | undefined\n const metricEnd = metricHistogram.startTimer()\n try {\n this.prepareEntitiesForDatastore(entities)\n ret = (await this.getDoT().insert(entities)) || undefined\n this.prepareEntitiesFromDatastore(entities)\n } catch (error) {\n // console.error(error)\n metricFailureCounter.inc({ operation: 'insert' })\n await setImmediate()\n throw new DstoreError('datastore.insert error', error as Error)\n } finally {\n metricEnd({ operation: 'insert' })\n }\n return ret\n }\n\n /** `update()` is compatible to [Datastore.update()](https://cloud.google.com/nodejs/docs/reference/datastore/latest/datastore/datastore#_google_cloud_datastore_Datastore_update_member_1_).\n\n * The single Parameter is a list of [[DstoreSaveEntity]]s.\n * If called within a transaction it returns `undefined`.\n * If not, it returns a [[CommitResponse]] which is not documented by Google.\n *\n * `update()` seems to be like [[save]] where [[DstoreSaveEntity.method]] is set to `'update'`.\n * It throws an [[DstoreError]] if there is no Entity with the same [[Key]] in the Datastore. `update()` *overwrites all existing data* for that [[Key]].\n * There was an alpha functionality called `merge()` in the Datastore which read an Entity, merged it with the new data and wrote it back, but this was never documented.\n *\n * `update()` is idempotent. Updating the same [[Key]] twice is no error.\n *\n * This function can be completely emulated by using [[save]] with `method: 'update'` inside each [[DstoreSaveEntity]].\n * Prefer using `save()` because it is much better tested.\n *\n * @throws [[DstoreError]]\n * @category Datastore Drop-In\n */\n async update(entities: readonly DstoreSaveEntity[]): Promise<CommitResponse | undefined> {\n assertIsArray(entities)\n\n entities.forEach((entity) => assertIsObject(entity.key))\n entities.forEach((entity) =>\n assert(\n entity.key.path.length % 2 == 0,\n `entity.key.path must be complete: ${JSON.stringify([entity.key.path, entity])}`\n )\n )\n let ret: CommitResponse | undefined\n const metricEnd = metricHistogram.startTimer()\n\n try {\n this.prepareEntitiesForDatastore(entities)\n ret = (await this.getDoT().update(entities)) || undefined\n this.prepareEntitiesFromDatastore(entities)\n } catch (error) {\n // console.error(error)\n metricFailureCounter.inc({ operation: 'update' })\n await setImmediate()\n throw new DstoreError('datastore.update error', error as Error)\n } finally {\n metricEnd({ operation: 'update' })\n }\n return ret\n }\n\n /** `delete()` is compatible to [Datastore.delete()].\n *\n * Unfortunately currently (late 2021) there is no formal documentation from Google on [Datastore.delete()].\n *\n * The single Parameter is a list of [[Key]]s.\n * If called within a transaction it returns `undefined`.\n * If not, it returns a [[CommitResponse]] which is not documented by Google.\n *\n * `delete()` is idempotent. Deleting the same [[Key]] twice is no error.\n *\n * @throws [[DstoreError]]\n * @category Datastore Drop-In\n */\n async delete(keys: readonly Key[]): Promise<CommitResponse | undefined> {\n assertIsArray(keys)\n keys.forEach((key) => assertIsObject(key))\n keys.forEach((key) =>\n assert(key.path.length % 2 == 0, `key.path must be complete: ${JSON.stringify(key.path)}`)\n )\n let ret\n const metricEnd = metricHistogram.startTimer()\n try {\n ret = (await this.getDoT().delete(keys)) || undefined\n } catch (error) {\n metricFailureCounter.inc({ operation: 'delete' })\n await setImmediate()\n throw new DstoreError('datastore.delete error', error as Error)\n } finally {\n metricEnd({ operation: 'delete' })\n }\n return ret\n }\n\n /** `createQuery()` creates an \"empty\" [[Query]] Object.\n *\n * Compatible to [createQuery](https://cloud.google.com/nodejs/docs/reference/datastore/latest/datastore/datastore#_google_cloud_datastore_Datastore_createQuery_member_1_) in the datastore.\n *\n * @param kindName Name of the [[Datastore]][Kind](https://cloud.google.com/datastore/docs/concepts/entities#kinds_and_identifiers) (\"Table\") which should be searched.\n *\n * @category Datastore Drop-In\n */\n createQuery(kindName: string): Query {\n try {\n return this.getDoT().createQuery(kindName)\n } catch (error) {\n throw new DstoreError('datastore.createQuery error', error as Error)\n }\n }\n\n async runQuery(query: Query | Omit<Query, 'run'>): Promise<RunQueryResponse> {\n let ret\n const metricEnd = metricHistogram.startTimer()\n try {\n const [entities, info]: [Entity[], RunQueryInfo] = await this.getDoT().runQuery(query as Query)\n ret = [this.fixKeys(entities), info]\n } catch (error) {\n await setImmediate()\n throw new DstoreError('datastore.runQuery error', error as Error)\n } finally {\n metricEnd({ operation: 'query' })\n }\n return ret as RunQueryResponse\n }\n\n /** `query()` combined [[createQuery]] and [[runQuery]] in a single call.\n *\n *\n * @param kindName Name of the [[Datastore]][Kind](https://cloud.google.com/datastore/docs/concepts/entities#kinds_and_identifiers) (\"Table\") which should be searched.\n * @param filters List of [[Query]] filter() calls.\n * @param limit Maximum Number of Results to return.\n * @param ordering List of [[Query]] order() calls.\n * @param selection selectionList of [[Query]] select() calls.\n * @param cursor unsupported so far.\n *\n * @throws [[DstoreError]]\n * @category Datastore Drop-In\n */\n async query(\n kindName: string,\n filters: TGqlFilterList = [],\n limit = 2500,\n ordering: readonly string[] = [],\n selection: readonly string[] = [],\n cursor?: string\n ): Promise<RunQueryResponse> {\n assertIsString(kindName)\n assertIsArray(filters)\n assertIsNumber(limit)\n try {\n const q = this.createQuery(kindName)\n for (const filterSpec of filters) {\n assertIsObject(filterSpec)\n // @ts-ignore\n q.filter(new PropertyFilter(...filterSpec))\n }\n for (const orderField of ordering) {\n q.order(orderField)\n }\n if (limit > 0) {\n q.limit(limit)\n }\n if (selection.length > 0) {\n q.select(selection as any)\n }\n const ret = await this.getDoT().runQuery(q)\n return [this.fixKeys(ret[0]), ret[1]]\n } catch (error) {\n await setImmediate()\n throw new DstoreError('datastore.query error', error as Error, {\n kindName,\n filters,\n limit,\n ordering,\n })\n }\n }\n\n\n /** `iterate()` is a modernized version of `query()`.\n *\n * It takes a Parameter object and returns an AsyncIterable.\n * Entities returned have been processed by `fixKeys()`.\n * \n * Can be used with `for await` loops like this:\n * \n * ```typescript\n * for await (const entity of dstore.iterate({ kindName: 'p_ReservierungsAbruf', filters: [['verbucht', '=', true]]})) {\n * console.log(entity)\n * }\n * ```\n * \n * @param kindName Name of the [[Datastore]][Kind](https://cloud.google.com/datastore/docs/concepts/entities#kinds_and_identifiers) (\"Table\") which should be searched.\n * @param filters List of [[Query]] filter() calls.\n * @param limit Maximum Number of Results to return.\n * @param ordering List of [[Query]] order() calls.\n * @param selection selectionList of [[Query]] select() calls.\n *\n * @throws [[DstoreError]]\n * @category Additional\n */\n async * iterate({\n kindName,\n filters = [],\n limit = 2500,\n ordering = [],\n selection = [],\n }: IIterateParams): AsyncIterable<IDstoreEntryWithKey> {\n assertIsString(kindName)\n assertIsArray(filters)\n assertIsNumber(limit)\n try {\n const q = this.getDoT().createQuery(kindName)\n for (const filterSpec of filters) {\n assertIsObject(filterSpec)\n // @ts-ignore\n q.filter(new PropertyFilter(...filterSpec))\n }\n for (const orderField of ordering) {\n q.order(orderField)\n }\n if (limit > 0) {\n q.limit(limit)\n }\n if (selection.length > 0) {\n q.select(selection as any)\n }\n for await (const entity of q.runStream()) {\n const ret = this.fixKeys([entity])[0]\n assertIsDefined(ret, 'datastore.iterate: entity is undefined')\n assertIsKey(ret[Datastore.KEY])\n yield ret as IDstoreEntryWithKey\n }\n } catch (error) {\n await setImmediate()\n throw new DstoreError('datastore.query error', error as Error, {\n kindName,\n filters,\n limit,\n ordering,\n })\n }\n }\n\n /** Allocate one ID in the Datastore.\n *\n * Currently (late 2021) there is no documentation provided by Google for the underlying node function.\n * Check the Documentation for [the low-level function](https://cloud.google.com/datastore/docs/reference/data/rest/v1/projects/allocateIds)\n * and [the conceptual overview](https://cloud.google.com/datastore/docs/concepts/entities#assigning_your_own_numeric_id)\n * and [this Stackoverflow post](https://stackoverflow.com/questions/60516959/how-does-allocateids-work-in-cloud-datastore-mode).\n *\n * The ID is a string encoded large number. This function will never return the same ID twice for any given Datastore.\n * If you provide a kindName the ID will be namespaced to this kind.\n * In fact the generated ID is namespaced via an incomplete [[Key]] of the given Kind.\n */\n async allocateOneId(kindName = 'Numbering'): Promise<string> {\n assertIsString(kindName)\n const ret = (await this.datastore.allocateIds(this.key([kindName]), 1))[0][0].id\n assertIsString(ret)\n return ret\n }\n\n /** This tries to give high level access to transactions.\n\n So called \"Gross Group Transactions\" are always enabled. Transactions are never Cross Project. `runInTransaction()` works only if you use the same [[KvStore] instance for all access within the Transaction.\n\n [[runInTransaction]] is modelled after Python 2.7 [ndb's `@ndb.transactional` feature](https://cloud.google.com/appengine/docs/standard/python/ndb/transactions). This is based on node's [AsyncLocalStorage](https://nodejs.org/docs/latest-v14.x/api/async_hooks.html).\n\n Transactions frequently fail if you try to access the same data via in a transaction. See the [Documentation on Locking](https://cloud.google.com/datastore/docs/concepts/transactions#transaction_locks) for further reference. You are advised to use [p-limit](https://github.com/sindresorhus/p-limit)(1) to serialize transactions touching the same resource. This should work nicely with node's single process model. It is a much bigger problem on shared-nothing approaches, like Python on App Engine.\n\n Transactions might be wrapped in [p-retry](https://github.com/sindresorhus/p-retry) to implement automatically retrying them with exponential back-off should they fail due to contention.\n\n Be aware that Transactions differ considerable between Master-Slave Datastore (very old), High Replication Datastore (old, later called [Google Cloud Datastore](https://cloud.google.com/datastore/docs/concepts/cloud-datastore-transactions)) and [Firestore in Datastore Mode](https://cloud.google.com/datastore/docs/firestore-or-datastore#in_datastore_mode) (current).\n\n Most Applications today are running on \"Firestore in Datastore Mode\". Beware that the Datastore-Emulator fails with `error: 3 INVALID_ARGUMENT: Only ancestor queries are allowed inside transactions.` during [[runQuery]] while the Datastore on Google Infrastructure does not have such an restriction anymore as of 2022.\n */\n async runInTransaction<T>(func: () => Promise<T>): Promise<T> {\n let ret\n const transaction: Transaction = this.datastore.transaction()\n await transactionAsyncLocalStorage.run(transaction, async () => {\n const [transactionInfo, transactionRunApiResponse] = await transaction.run()\n let commitApiResponse\n try {\n ret = await func()\n } catch (error) {\n const rollbackInfo = await transaction.rollback()\n debug(\n 'Transaction failed, rollback initiated: %O %O %O %O',\n transactionInfo,\n transactionRunApiResponse,\n rollbackInfo,\n error\n )\n await setImmediate()\n throw new DstoreError('datastore.transaction execution error', error as Error)\n }\n try {\n commitApiResponse = (await transaction.commit())[0]\n } catch (error) {\n debug(\n 'Transaction commit failed: %O %O %O %O ret: %O',\n transactionInfo,\n transactionRunApiResponse,\n commitApiResponse,\n error,\n ret\n )\n await setImmediate()\n throw new DstoreError('datastore.transaction execution error', error as Error)\n }\n })\n return ret as T\n }\n}\n\nexport class DstoreError extends Error {\n public readonly extensions: Record<string, unknown>\n public readonly originalError: Error | undefined\n readonly [key: string]: unknown\n\n constructor(message: string, originalError: Error | undefined, extensions?: Record<string, unknown>) {\n super(`${message}: ${originalError?.message}`)\n\n // if no name provided, use the default. defineProperty ensures that it stays non-enumerable\n if (!this.name) {\n Object.defineProperty(this, 'name', { value: 'DstoreError' })\n }\n // metadata: Metadata { internalRepr: Map(0) {}, options: {} },\n this.originalError = originalError\n this.extensions = { ...extensions }\n this.stack =\n (this.stack?.split('\\n')[0] || '') +\n '\\n' +\n (originalError?.stack?.split('\\n')?.slice(1)?.join('\\n') || '') +\n '\\n' +\n (this.stack?.split('\\n')?.slice(1)?.join('\\n') || '')\n\n // These are usually present on Datastore Errors\n // logger.error({ err: originalError, extensions }, message);\n }\n}\n"],"names":["AssertionMessage","value","type","variableName","additionalMessage","message","getType","assertIsKey","assert","Datastore","isKey","debug","Debug","transactionAsyncLocalStorage","AsyncLocalStorage","promClient","register","removeSingleMetric","metricHistogram","Histogram","name","help","labelNames","metricFailureCounter","Counter","KEYSYM","KEY","Dstore","datastore","projectId","logger","engine","engines","urlSaveKey","entity","URLSafeKey","assertIsObject","push","_proto","prototype","getDoT","getStore","key","path","keySerialize","_this$projectId","legacyEncode","keyFromSerialized","text","legacyDecode","readKey","ent","ret","_keyStr","JSON","stringify","fixKeys","entities","_this2","forEach","x","assertIsDefined","prepareEntitiesForDatastore","_iterator2","_createForOfIteratorHelperLoose","_step2","done","e","data","excludeLargeProperties","undefined","_extends","prepareEntitiesFromDatastore","_iterator3","_step3","get","_get","_asyncToGenerator","_regeneratorRuntime","mark","_callee","result","wrap","_callee$","_context","prev","next","Array","isArray","length","getMulti","sent","abrupt","stop","_x","apply","arguments","_getMulti","_callee2","keys","results","metricEnd","_yield$this$getDoT$ge","entitiesByKey","_callee2$","_context2","startTimer","t0","t2","t3","t1","t4","call","t5","inc","operation","setImmediate","DstoreError","finish","assertIsArray","map","_x2","set","_set","_callee3","saveEntity","_callee3$","_context3","save","_x3","_x4","_save","_callee4","_callee4$","_context4","_x5","insert","_insert","_callee5","_callee5$","_context5","_x6","update","_update","_callee6","_callee6$","_context6","_x7","_delete2","_callee7","_callee7$","_context7","delete","_x8","createQuery","kindName","error","runQuery","_runQuery","_callee8","query","_yield$this$getDoT$ru","info","_callee8$","_context8","_x9","_query","_callee9","filters","limit","ordering","selection","cursor","q","_iterator4","_step4","filterSpec","_iterator5","_step5","orderField","_callee9$","_context9","assertIsString","assertIsNumber","filter","_construct","PropertyFilter","order","select","_x10","_x11","_x12","_x13","_x14","_x15","iterate","_ref","_this","_ref$filters","_ref$limit","_ref$ordering","_ref$selection","_wrapAsyncGenerator","_callee10","_iterator6","_step6","_iterator7","_step7","_iteratorAbruptCompletion","_didIteratorError","_iteratorError","_iterator","_step","_entity","_callee10$","_context10","_asyncIterator","runStream","_awaitAsyncGenerator","allocateOneId","_allocateOneId","_callee11","_callee11$","_context11","allocateIds","id","_x16","runInTransaction","_runInTransaction","_callee13","func","transaction","_callee13$","_context13","run","_callee12","_yield$transaction$ru","transactionInfo","transactionRunApiResponse","commitApiResponse","rollbackInfo","_callee12$","_context12","rollback","commit","_x17","_Error","originalError","extensions","_this3$stack","_originalError$stack","_this3$stack2","_this3","Object","defineProperty","stack","split","slice","join","_inheritsLoose","_wrapNativeSuper","Error"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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|
|
74
74
|
query: (kind: string, filters?: TGqlFilterList, limit?: number, ordering?: readonly string[], selection?: readonly string[], cursor?: string) => Promise<RunQueryResponse>;
|
|
75
|
-
iterate: (options: IIterateParams) => AsyncIterable<
|
|
75
|
+
iterate: (options: IIterateParams) => AsyncIterable<IDstoreEntryWithKey>;
|
|
76
76
|
allocateOneId: (kindName: string) => Promise<string>;
|
|
77
77
|
runInTransaction: <T>(func: {
|
|
78
78
|
(): Promise<T>;
|
|
@@ -358,7 +358,7 @@ export declare class Dstore implements IDstore {
|
|
|
358
358
|
* @throws [[DstoreError]]
|
|
359
359
|
* @category Additional
|
|
360
360
|
*/
|
|
361
|
-
iterate({ kindName, filters, limit, ordering, selection, }: IIterateParams): AsyncIterable<
|
|
361
|
+
iterate({ kindName, filters, limit, ordering, selection, }: IIterateParams): AsyncIterable<IDstoreEntryWithKey>;
|
|
362
362
|
/** Allocate one ID in the Datastore.
|
|
363
363
|
*
|
|
364
364
|
* Currently (late 2021) there is no documentation provided by Google for the underlying node function.
|
package/package.json
CHANGED
package/src/lib/dstore-api.ts
CHANGED
|
@@ -148,7 +148,7 @@ type IDstore = {
|
|
|
148
148
|
selection?: readonly string[],
|
|
149
149
|
cursor?: string
|
|
150
150
|
) => Promise<RunQueryResponse>
|
|
151
|
-
iterate: (options: IIterateParams) => AsyncIterable<
|
|
151
|
+
iterate: (options: IIterateParams) => AsyncIterable<IDstoreEntryWithKey>
|
|
152
152
|
allocateOneId: (kindName: string) => Promise<string>
|
|
153
153
|
runInTransaction: <T>(func: { (): Promise<T>; (): T }) => Promise<T>
|
|
154
154
|
}
|
|
@@ -678,7 +678,7 @@ export class Dstore implements IDstore {
|
|
|
678
678
|
limit = 2500,
|
|
679
679
|
ordering = [],
|
|
680
680
|
selection = [],
|
|
681
|
-
}: IIterateParams): AsyncIterable<
|
|
681
|
+
}: IIterateParams): AsyncIterable<IDstoreEntryWithKey> {
|
|
682
682
|
assertIsString(kindName)
|
|
683
683
|
assertIsArray(filters)
|
|
684
684
|
assertIsNumber(limit)
|