datastore-api 1.0.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.
@@ -0,0 +1,480 @@
1
+ "use strict";
2
+ /*
3
+ * dstore.ts - Datastore Compatibility layer
4
+ * Try to get a smoother api for transactions and such.
5
+ * A little bit inspired by the Python2 ndb interface.
6
+ *
7
+ * In future https://github.com/graphql/dataloader might be used for batching.
8
+ *
9
+ * Created by Dr. Maximillian Dornseif 2021-12-05 in huwawi3backend 11.10.0
10
+ * Copyright (c) Dr. Maximillian Dornseif
11
+ */
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.DstoreError = exports.Dstore = exports.Transaction = exports.Query = exports.Key = exports.Datastore = void 0;
14
+ const async_hooks_1 = require("async_hooks");
15
+ const datastore_1 = require("@google-cloud/datastore");
16
+ const entity_1 = require("@google-cloud/datastore/build/src/entity");
17
+ const assertate_1 = require("assertate");
18
+ // import Debug from 'debug';
19
+ /** @ignore */
20
+ var datastore_2 = require("@google-cloud/datastore");
21
+ Object.defineProperty(exports, "Datastore", { enumerable: true, get: function () { return datastore_2.Datastore; } });
22
+ Object.defineProperty(exports, "Key", { enumerable: true, get: function () { return datastore_2.Key; } });
23
+ Object.defineProperty(exports, "Query", { enumerable: true, get: function () { return datastore_2.Query; } });
24
+ Object.defineProperty(exports, "Transaction", { enumerable: true, get: function () { return datastore_2.Transaction; } });
25
+ /** @ignore */
26
+ // const debug = Debug('h3:dstore');
27
+ /** @ignore */
28
+ const transactionAsyncLocalStorage = new async_hooks_1.AsyncLocalStorage();
29
+ /** Dstore implements a slightly more accessible version of the [Google Cloud Datastore: Node.js Client](https://cloud.google.com/nodejs/docs/reference/datastore/latest)
30
+
31
+ [@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.
32
+ (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.
33
+
34
+ Also the typings are strange. The Google provided type `Entities` can be the on disk representation, the same but including a key reference (`Datastore.KEY` - [[DstoreEntry]]), 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.
35
+
36
+ KvStore 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).
37
+
38
+ Main differences:
39
+
40
+ - Everything asynchronous is Promise-based - no callbacks.
41
+ - [[get]] always returns a single [[DstoreEntry]].
42
+ - [[getMulti]] always returns an Array<[[DstoreEntry]]> of the same length as the input Array. Items not found are represented by null.
43
+ - [[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.
44
+ - [[key]] handles [[Key]] object instantiation for you.
45
+ - [[readKey]] extracts the key from an [[DstoreEntry]] 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 [[DstoreEntry]] from a serializing cache.
46
+ - [[allocateOneId]] returns a single numeric string encoded unique datastore id without the need of fancy unpacking.
47
+ - [[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).
48
+ - [[keySerialize]] is synchronous.
49
+
50
+ This 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.
51
+ */
52
+ class Dstore {
53
+ /** Generate a Dstore instance for a specific [[Datastore]] instance.
54
+
55
+ ```
56
+ const dstore = Dstore(new Datastore())
57
+ ```
58
+
59
+ 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:
60
+
61
+ ```
62
+ const dstore = Dstore(new Datastore(), process.env.GCLOUD_PROJECT)
63
+
64
+ @param datastore A [[Datastore]] instance. Can be freely accessed by the client. Be aware that using this inside [[runInTransaction]] ignores the transaction.
65
+ @param projectId The `GCLOUD_PROJECT ID`. Used for Key generation during serialization.
66
+ ```
67
+ */
68
+ constructor(datastore, projectId, logger) {
69
+ this.datastore = datastore;
70
+ this.projectId = projectId;
71
+ this.logger = logger;
72
+ this.urlSaveKey = new entity_1.entity.URLSafeKey();
73
+ (0, assertate_1.assertIsObject)(datastore);
74
+ }
75
+ /** Gets the Datastore or the current Transaction. */
76
+ getDoT() {
77
+ return (transactionAsyncLocalStorage.getStore() || this.datastore);
78
+ }
79
+ /** `key()` creates a [[Key]] Object from a path.
80
+ *
81
+ * Compatible to [Datastore.key](https://cloud.google.com/nodejs/docs/reference/datastore/latest/datastore/datastore#_google_cloud_datastore_Datastore_key_member_1_)
82
+ *
83
+ * 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]].
84
+ *
85
+ * @category Datastore Drop-In
86
+ */
87
+ key(path) {
88
+ return this.datastore.key(path);
89
+ }
90
+ /** `keyFromSerialized()` serializes [[Key]] to a string.
91
+ *
92
+ * 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.
93
+ *
94
+ * 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.
95
+ *
96
+ * @category Datastore Drop-In
97
+ */
98
+ keySerialize(key) {
99
+ var _a;
100
+ return key ? this.urlSaveKey.legacyEncode((_a = this.projectId) !== null && _a !== void 0 ? _a : '', key) : '';
101
+ }
102
+ /** `keyFromSerialized()` deserializes a string created with [[keySerialize]] to a [[Key]].
103
+ *
104
+ * Compatible to [keyFromLegacyUrlsafe](https://cloud.google.com/nodejs/docs/reference/datastore/latest/datastore/datastore#_google_cloud_datastore_Datastore_keyFromLegacyUrlsafe_member_1_).
105
+ *
106
+ * @category Datastore Drop-In
107
+ */
108
+ keyFromSerialized(text) {
109
+ return this.urlSaveKey.legacyDecode(text);
110
+ }
111
+ /** `readKey()` extracts the [[Key]] from an [[DstoreEntry]].
112
+ *
113
+ * Is is an alternative to `entity[Datastore.KEY]` which tends to fail in various contexts and also confuses older Typescript compilers.
114
+ * It can extract the [[Key]] form a [[DstoreEntry]] which has been serialized to JSON by leveraging the property `_keyStr`.
115
+ *
116
+ * @category Additional
117
+ */
118
+ readKey(ent) {
119
+ (0, assertate_1.assertIsObject)(ent);
120
+ let ret = ent[datastore_1.Datastore.KEY];
121
+ if (ent._keyStr && !ret) {
122
+ ret = this.keyFromSerialized(ent._keyStr);
123
+ }
124
+ (0, assertate_1.assertIsObject)(ret, 'entity[Datastore.KEY]/entity._keyStr', `Entity is missing the datastore Key: ${JSON.stringify(ent)}`);
125
+ return ret;
126
+ }
127
+ /** `fixKeys()` is called for all [[DstoreEntry]]sa returned from [[Dstore]].
128
+ *
129
+ * Is ensures that besides `entity[Datastore.KEY]` there is `_keyStr` to be leveraged by [[readKey]].
130
+ *
131
+ * @internal
132
+ */
133
+ fixKeys(entities) {
134
+ entities.forEach((x) => {
135
+ if (!!(x === null || x === void 0 ? void 0 : x[datastore_1.Datastore.KEY]) && x[datastore_1.Datastore.KEY]) {
136
+ (0, assertate_1.assertIsDefined)(x[datastore_1.Datastore.KEY]);
137
+ (0, assertate_1.assertIsObject)(x[datastore_1.Datastore.KEY]);
138
+ // Scheinbar stolpert TypesScript über Symbole als Attribut
139
+ x._keyStr = this.keySerialize(x[datastore_1.Datastore.KEY]);
140
+ }
141
+ });
142
+ return entities;
143
+ }
144
+ /** `get()` reads a [[DstoreEntry]] from the Datastore.
145
+ *
146
+ * It returns [[DstoreEntry]] or `null` if not found.
147
+
148
+ * The underlying Datastore API Call is [lookup](https://cloud.google.com/datastore/docs/reference/data/rest/v1/projects/lookup).
149
+ *
150
+ * It is in the Spirit of [Datastore.get()]. Unfortunately currently (late 2021) there is no formal documentation from Google on [Datastore.get()].
151
+ *
152
+ * Differences between [[Dstore.get]] and [[Datastore.get]]:
153
+ *
154
+ * - [Dstore.get]] takes a single [[Key]] as Parameter, no Array. Check [[getMulti]] if you want Arrays.
155
+ * - [Dstore.get]] returns a single [[DstoreEntry]], no Array.
156
+ *
157
+ * @category Datastore Drop-In
158
+ */
159
+ async get(key) {
160
+ (0, assertate_1.assertIsObject)(key);
161
+ (0, assertate_1.assert)(!Array.isArray(key));
162
+ const getresult = await this.getMulti([key]);
163
+ return (getresult === null || getresult === void 0 ? void 0 : getresult[0]) || null;
164
+ }
165
+ /** `getMulti()` reads several [[DstoreEntry]]s from the Datastore.
166
+ *
167
+ * It returns a list of [[DstoreEntry]]s or `null` if not found.
168
+
169
+ * The underlying Datastore API Call is [lookup](https://cloud.google.com/datastore/docs/reference/data/rest/v1/projects/lookup).
170
+ *
171
+ * It is in the Spirit of [Datastore.get()]. Unfortunately currently (late 2021) there is no formal documentation from Google on [Datastore.get()].
172
+ *
173
+ * Differences between [[Dstore.getMulti]] and [[Datastore.get]]:
174
+ *
175
+ * - [[Dstore.getMulti]] always takes an Array of [[Key]]s as Parameter.
176
+ * - [[Dstore.getMulti]] returns always a Array of [[DstoreEntry]], or null.
177
+ * - [[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.
178
+ *
179
+ * @category Datastore Drop-In
180
+ */
181
+ async getMulti(keys) {
182
+ var _a;
183
+ // assertIsArray(keys);
184
+ try {
185
+ return this.fixKeys(keys.length > 0
186
+ ? (_a = (await this.getDoT().get(keys))) === null || _a === void 0 ? void 0 : _a[0]
187
+ : []);
188
+ }
189
+ catch (error) {
190
+ // console.error(error)
191
+ throw process.env.NODE_ENV === 'test'
192
+ ? error
193
+ : new DstoreError('datastore.getMulti error', error, { keys });
194
+ }
195
+ }
196
+ /** `set()` is addition to [[Datastore]]. It provides a classic Key-value Interface.
197
+ *
198
+ * Instead providing a nested [[DstoreSaveEntity]] to [[save]] you can call set directly as `set( key, value)`.
199
+ * Observe that set takes a [[Key]] as first parameter. you call it like this;
200
+ *
201
+ * ```js
202
+ * const ds = Dstore()
203
+ * ds.set(ds.key('kind', '123'), {props1: 'foo', prop2: 'bar'})
204
+ * ```
205
+ *
206
+ * It returns the [[Key]] of the Object being written.
207
+ * If the Key provided was an incomplete [[Key]] it will return a completed [[Key]].
208
+ * See [[save]] for more information on key generation.
209
+ *
210
+ * @category Additional
211
+ */
212
+ async set(key, data) {
213
+ (0, assertate_1.assertIsObject)(key);
214
+ (0, assertate_1.assertIsObject)(data);
215
+ const saveEntity = { key, data };
216
+ await this.save([saveEntity]);
217
+ return saveEntity.key;
218
+ }
219
+ /** `save()` is compatible to [Datastore.save()](https://cloud.google.com/nodejs/docs/reference/datastore/latest/datastore/datastore#_google_cloud_datastore_Datastore_save_member_1_).
220
+ *
221
+ * The single Parameter is a list of [[DstoreSaveEntity]]s.
222
+ * If called within a transaction it returns `undefined`.
223
+ * If not, it returns a [[CommitResponse]] which is not documented by Google.
224
+ *
225
+ * Different [DstoreSaveEntity]]s in the `entities` parameter can have different values in their [[DstoreSaveEntity.method]] property.
226
+ * This allows you to do `insert`, `update` and `upsert` (the default) in a single request.
227
+ *
228
+ * `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_).
229
+ *
230
+ * If the [[Key]] provided in [[DstoreSaveEntity.key]] was an incomplete [[Key]] it will be updated by `save()` inside the [[DstoreSaveEntity]].
231
+ *
232
+ * If the Datastore generates a new ID because of an incomplete [[Key]] *on first save* it will return an large integer as [[Key.id]].
233
+ * On every subsequent `save()` an string encoded number representation is returned.
234
+ * Dstore normalizes that and always returns an string encoded number representation.
235
+ *
236
+ * @category Datastore Drop-In
237
+ */
238
+ async save(entities) {
239
+ (0, assertate_1.assertIsArray)(entities);
240
+ try {
241
+ // Innerhalb von Transaktionen bekommen wir keine Antwort!
242
+ // [ { mutationResults: [ [Object], [Object] ], indexUpdates: 51 } ]
243
+ for (const e of entities) {
244
+ (0, assertate_1.assertIsObject)(e.key);
245
+ (0, assertate_1.assertIsObject)(e.data);
246
+ this.fixKeys([e.data]);
247
+ }
248
+ return (await this.getDoT().save(entities)) || undefined;
249
+ }
250
+ catch (error) {
251
+ throw process.env.NODE_ENV === 'test'
252
+ ? error
253
+ : new DstoreError('datastore.save error', error);
254
+ }
255
+ }
256
+ /** `insert()` is compatible to [Datastore.insert()](https://cloud.google.com/nodejs/docs/reference/datastore/latest/datastore/datastore#_google_cloud_datastore_Datastore_insert_member_1_).
257
+ *
258
+ * The single Parameter is a list of [[DstoreSaveEntity]]s.
259
+ * If called within a transaction it returns `undefined`.
260
+ * If not, it returns a [[CommitResponse]] which is not documented by Google.
261
+ *
262
+ * `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.
263
+ *
264
+ * For handling of incomplete [[Key]]s see [[save]].
265
+ *
266
+ * @throws [[DstoreError]]
267
+ * @category Datastore Drop-In
268
+ */
269
+ async insert(entities) {
270
+ (0, assertate_1.assertIsArray)(entities);
271
+ try {
272
+ return (await this.getDoT().insert(entities)) || undefined;
273
+ }
274
+ catch (error) {
275
+ // console.error(error)
276
+ throw process.env.NODE_ENV === 'test'
277
+ ? error
278
+ : new DstoreError('datastore.insert error', error);
279
+ }
280
+ }
281
+ /** `update()` is compatible to [Datastore.update()](https://cloud.google.com/nodejs/docs/reference/datastore/latest/datastore/datastore#_google_cloud_datastore_Datastore_update_member_1_).
282
+
283
+ * The single Parameter is a list of [[DstoreSaveEntity]]s.
284
+ * If called within a transaction it returns `undefined`.
285
+ * If not, it returns a [[CommitResponse]] which is not documented by Google.
286
+ *
287
+ * `update()` seems to be like [[save]] where [[DstoreSaveEntity.method]] is set to `'update'`.
288
+ * It throws an [[DstoreError]] if there is no Entity with the same [[Key]] in the Datastore. `update()` *overwrites all existing data* for that [[Key]].
289
+ * 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.
290
+ *
291
+ * `update()` is idempotent. Deleting the same [[Key]] twice is no error.
292
+ *
293
+ * @throws [[DstoreError]]
294
+ * @category Datastore Drop-In
295
+ */
296
+ async update(entities) {
297
+ (0, assertate_1.assertIsArray)(entities);
298
+ try {
299
+ return (await this.getDoT().update(entities)) || undefined;
300
+ }
301
+ catch (error) {
302
+ // console.error(error)
303
+ throw process.env.NODE_ENV === 'test'
304
+ ? error
305
+ : new DstoreError('datastore.update error', error);
306
+ }
307
+ }
308
+ /** `delete()` is compatible to [Datastore.update()].
309
+ *
310
+ * Unfortunately currently (late 2021) there is no formal documentation from Google on [Datastore.update()].
311
+ *
312
+ * The single Parameter is a list of [[Key]]s.
313
+ * If called within a transaction it returns `undefined`.
314
+ * If not, it returns a [[CommitResponse]] which is not documented by Google.
315
+ *
316
+ * `delete()` is idempotent. Deleting the same [[Key]] twice is no error.
317
+ *
318
+ * @throws [[DstoreError]]
319
+ * @category Datastore Drop-In
320
+ */
321
+ async delete(keys) {
322
+ (0, assertate_1.assertIsArray)(keys);
323
+ keys.forEach((key) => (0, assertate_1.assertIsObject)(key));
324
+ try {
325
+ return (await this.getDoT().delete(keys)) || undefined;
326
+ }
327
+ catch (error) {
328
+ // console.error(error)
329
+ throw process.env.NODE_ENV === 'test'
330
+ ? error
331
+ : new DstoreError('datastore.delete error', error);
332
+ }
333
+ }
334
+ /** `createQuery()` creates an "empty" [[Query]] Object.
335
+ *
336
+ * Compatible to [createQuery](https://cloud.google.com/nodejs/docs/reference/datastore/latest/datastore/datastore#_google_cloud_datastore_Datastore_createQuery_member_1_) in the datastore.
337
+ *
338
+ * @param kind Name of the [[Datastore]][Kind](https://cloud.google.com/datastore/docs/concepts/entities#kinds_and_identifiers) ("Table") which should be searched.
339
+ *
340
+ * @category Datastore Drop-In
341
+ */ createQuery(kind) {
342
+ return this.getDoT().createQuery(kind);
343
+ }
344
+ async runQuery(query) {
345
+ try {
346
+ return await this.getDoT().runQuery(query);
347
+ }
348
+ catch (error) {
349
+ throw new DstoreError('datastore.runQuery error', error);
350
+ // console.error(error)
351
+ // throw process.env.NODE_ENV === 'test' ? error : new KvStoreError('datastore.runQuery error', error)
352
+ }
353
+ }
354
+ async query(kindName, filters = [], limit = 2500, orders = []) {
355
+ (0, assertate_1.assertIsString)(kindName);
356
+ (0, assertate_1.assertIsArray)(filters);
357
+ (0, assertate_1.assertIsNumber)(limit);
358
+ try {
359
+ const q = this.createQuery(kindName);
360
+ for (const fspec of filters) {
361
+ q.filter(...fspec);
362
+ }
363
+ for (const orderField of orders) {
364
+ q.order(orderField);
365
+ }
366
+ if (limit > 0) {
367
+ q.limit(limit);
368
+ }
369
+ return await this.runQuery(q);
370
+ }
371
+ catch (error) {
372
+ console.error(error, { kindName, filters, limit, orders });
373
+ throw process.env.NODE_ENV === 'test'
374
+ ? error
375
+ : new DstoreError('datastore.query error', error, {
376
+ kindName,
377
+ filters,
378
+ limit,
379
+ orders,
380
+ });
381
+ }
382
+ }
383
+ /** Allocate one ID in the Datastore.
384
+ *
385
+ * Currently (late 2021) there is no documentation provided by Google for the underlying node function.
386
+ * Check the Documentation for [the low-level function](https://cloud.google.com/datastore/docs/reference/data/rest/v1/projects/allocateIds)
387
+ * and [the conceptual overview](https://cloud.google.com/datastore/docs/concepts/entities#assigning_your_own_numeric_id)
388
+ * and [this Stackoverflow post](https://stackoverflow.com/questions/60516959/how-does-allocateids-work-in-cloud-datastore-mode).
389
+ *
390
+ * The ID is a string encoded large number. This function will never return the same ID twice for any given Datastore.
391
+ * If you provide a kindName the ID will be namespaced to this kind.
392
+ * In fact the generated ID is namespaced via an incomplete [[Key]] of the given Kind.
393
+ */
394
+ async allocateOneId(kindName = 'Numbering') {
395
+ (0, assertate_1.assertIsString)(kindName);
396
+ const ret = (await this.datastore.allocateIds(this.key([kindName]), 1))[0][0].id;
397
+ (0, assertate_1.assertIsString)(ret);
398
+ return ret;
399
+ }
400
+ /** This tries to give high level access to transactions.
401
+
402
+ 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).
403
+
404
+ 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.
405
+
406
+ [[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).
407
+
408
+ 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 seralize 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.
409
+
410
+ 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.
411
+ */
412
+ async runInTransaction(func) {
413
+ let ret;
414
+ const transaction = this.datastore.transaction();
415
+ await transactionAsyncLocalStorage.run(transaction, async () => {
416
+ const [transactionInfo, _transactionRunApiResponse] = await transaction.run();
417
+ let commitApiResponse;
418
+ try {
419
+ ret = await func();
420
+ }
421
+ catch (error) {
422
+ const _rollbackInfo = await transaction.rollback();
423
+ // logger.info(
424
+ // {
425
+ // err: error,
426
+ // transactionInfo,
427
+ // transactionRunApiResponse,
428
+ // rollbackInfo,
429
+ // ret,
430
+ // commitApiResponse,
431
+ // },
432
+ // 'Transaction failed'
433
+ // );
434
+ // console.error(error)
435
+ throw process.env.NODE_ENV === 'test'
436
+ ? error
437
+ : new DstoreError('datastore.transaction execution error', error);
438
+ }
439
+ try {
440
+ commitApiResponse = await transaction.commit()[0];
441
+ }
442
+ catch (error) {
443
+ // logger.info(
444
+ // {
445
+ // err: error,
446
+ // transactionInfo,
447
+ // transactionRunApiResponse,
448
+ // ret,
449
+ // commitApiResponse,
450
+ // },
451
+ // 'Transaction commit failed'
452
+ // );
453
+ // console.error(error)
454
+ throw process.env.NODE_ENV === 'test'
455
+ ? error
456
+ : new DstoreError('datastore.transaction execution error', error);
457
+ }
458
+ });
459
+ return ret;
460
+ }
461
+ }
462
+ exports.Dstore = Dstore;
463
+ class DstoreError extends Error {
464
+ constructor(message, originalError, extensions) {
465
+ super(`${message}: ${originalError === null || originalError === void 0 ? void 0 : originalError.message}`);
466
+ // if no name provided, use the default. defineProperty ensures that it stays non-enumerable
467
+ if (!this.name) {
468
+ Object.defineProperty(this, 'name', { value: 'DstoreError' });
469
+ }
470
+ // code: 3,
471
+ // details: 'The key path element name is the empty string.',
472
+ // metadata: Metadata { internalRepr: Map(0) {}, options: {} },
473
+ // note: 'Exception occurred in retry method that was not classified as transient'
474
+ this.originalError = originalError;
475
+ this.extensions = Object.assign({}, extensions);
476
+ // logger.error({ err: originalError, extensions }, message);
477
+ }
478
+ }
479
+ exports.DstoreError = DstoreError;
480
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZHN0b3JlLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3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