proto.io 0.0.147 → 0.0.149
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/file/database.d.ts +2 -2
- package/dist/adapters/file/database.js +2 -2
- package/dist/adapters/file/database.mjs +2 -2
- package/dist/adapters/file/filesystem.d.ts +2 -2
- package/dist/adapters/file/google-cloud-storage.d.ts +2 -2
- package/dist/adapters/storage/progres.d.ts +3 -1
- package/dist/adapters/storage/progres.js +6 -3
- package/dist/adapters/storage/progres.js.map +1 -1
- package/dist/adapters/storage/progres.mjs +6 -3
- package/dist/adapters/storage/progres.mjs.map +1 -1
- package/dist/client.d.ts +3 -5
- package/dist/client.js +2 -2
- package/dist/client.mjs +3 -3
- package/dist/index.d.ts +3 -5
- package/dist/index.js +73 -64
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +74 -65
- package/dist/index.mjs.map +1 -1
- package/dist/internals/{index-EOtjV6U_.mjs → index-BmRuvHVZ.mjs} +11 -1
- package/dist/internals/index-BmRuvHVZ.mjs.map +1 -0
- package/dist/internals/index-BqFdBhFc.js.map +1 -1
- package/dist/internals/{index-BDB4idmt.d.ts → index-BuXVzVd8.d.ts} +3 -2
- package/dist/internals/index-BuXVzVd8.d.ts.map +1 -0
- package/dist/internals/index-CKgKjs8z.d.ts +60 -0
- package/dist/internals/index-CKgKjs8z.d.ts.map +1 -0
- package/dist/internals/{index-DZS2c96L.js → index-CSNRyhjB.js} +2 -2
- package/dist/internals/{index-DZS2c96L.js.map → index-CSNRyhjB.js.map} +1 -1
- package/dist/internals/{index-C6zdNpc_.js → index-CVutVPmd.js} +11 -1
- package/dist/internals/{index-C6zdNpc_.js.map → index-CVutVPmd.js.map} +1 -1
- package/dist/internals/{index-CT01T3qs.js → index-D1YGwuNK.js} +26 -4
- package/dist/internals/index-D1YGwuNK.js.map +1 -0
- package/dist/internals/{index-BWztjrw_.d.ts → index-DnREUbmG.d.ts} +9 -90
- package/dist/internals/index-DnREUbmG.d.ts.map +1 -0
- package/dist/internals/index-be1VYBY2.mjs.map +1 -1
- package/dist/internals/{index-Do-zNOpD.mjs → index-c-CaNuVY.mjs} +26 -4
- package/dist/internals/index-c-CaNuVY.mjs.map +1 -0
- package/dist/internals/{index-DTZ5uRgF.mjs → index-tU-lsQqj.mjs} +2 -2
- package/dist/internals/{index-DTZ5uRgF.mjs.map → index-tU-lsQqj.mjs.map} +1 -1
- package/dist/internals/{random-XGNkddOu.js → random-DBDmz54D.js} +3 -3
- package/dist/internals/{random-XGNkddOu.js.map → random-DBDmz54D.js.map} +1 -1
- package/dist/internals/{random-BjV_01xP.mjs → random-KZTFMK9-.mjs} +3 -3
- package/dist/internals/{random-BjV_01xP.mjs.map → random-KZTFMK9-.mjs.map} +1 -1
- package/package.json +4 -4
- package/dist/internals/index-BDB4idmt.d.ts.map +0 -1
- package/dist/internals/index-BWztjrw_.d.ts.map +0 -1
- package/dist/internals/index-CT01T3qs.js.map +0 -1
- package/dist/internals/index-Do-zNOpD.mjs.map +0 -1
- package/dist/internals/index-EOtjV6U_.mjs.map +0 -1
- package/dist/internals/index-bbPCIbir.d.ts +0 -116
- package/dist/internals/index-bbPCIbir.d.ts.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as TSchema, P as ProtoService } from '../../internals/index-
|
|
2
|
-
import { F as FileStorageBase, a as FileStorageOptions } from '../../internals/index-
|
|
1
|
+
import { T as TSchema, P as ProtoService } from '../../internals/index-DnREUbmG.js';
|
|
2
|
+
import { F as FileStorageBase, a as FileStorageOptions } from '../../internals/index-BuXVzVd8.js';
|
|
3
3
|
import '@o2ter/utils-js';
|
|
4
4
|
import 'jsonwebtoken';
|
|
5
5
|
import '@o2ter/server-js';
|
|
@@ -4,12 +4,12 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var _ = require('lodash');
|
|
6
6
|
var index = require('../../internals/index-BqFdBhFc.js');
|
|
7
|
-
var index$1 = require('../../internals/index-
|
|
7
|
+
var index$1 = require('../../internals/index-CSNRyhjB.js');
|
|
8
8
|
var utilsJs = require('@o2ter/utils-js');
|
|
9
9
|
require('util');
|
|
10
10
|
require('zlib');
|
|
11
11
|
require('../../internals/private-CSB1Ep4g.js');
|
|
12
|
-
require('../../internals/index-
|
|
12
|
+
require('../../internals/index-CVutVPmd.js');
|
|
13
13
|
require('decimal.js');
|
|
14
14
|
|
|
15
15
|
//
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import _ from 'lodash';
|
|
2
2
|
import { F as FileStorageBase } from '../../internals/index-be1VYBY2.mjs';
|
|
3
|
-
import { Q as QuerySelector } from '../../internals/index-
|
|
3
|
+
import { Q as QuerySelector } from '../../internals/index-tU-lsQqj.mjs';
|
|
4
4
|
import { bufferToBase64, base64ToBuffer } from '@o2ter/utils-js';
|
|
5
5
|
import 'util';
|
|
6
6
|
import 'zlib';
|
|
7
7
|
import '../../internals/private-BUpLAMZi.mjs';
|
|
8
|
-
import '../../internals/index-
|
|
8
|
+
import '../../internals/index-BmRuvHVZ.mjs';
|
|
9
9
|
import 'decimal.js';
|
|
10
10
|
|
|
11
11
|
//
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as ProtoService } from '../../internals/index-
|
|
2
|
-
import { F as FileStorageBase, a as FileStorageOptions } from '../../internals/index-
|
|
1
|
+
import { P as ProtoService } from '../../internals/index-DnREUbmG.js';
|
|
2
|
+
import { F as FileStorageBase, a as FileStorageOptions } from '../../internals/index-BuXVzVd8.js';
|
|
3
3
|
import '@o2ter/utils-js';
|
|
4
4
|
import 'jsonwebtoken';
|
|
5
5
|
import '@o2ter/server-js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _google_cloud_storage from '@google-cloud/storage';
|
|
2
2
|
import { Storage } from '@google-cloud/storage';
|
|
3
|
-
import { P as ProtoService } from '../../internals/index-
|
|
4
|
-
import { F as FileStorageBase, a as FileStorageOptions } from '../../internals/index-
|
|
3
|
+
import { P as ProtoService } from '../../internals/index-DnREUbmG.js';
|
|
4
|
+
import { F as FileStorageBase, a as FileStorageOptions } from '../../internals/index-BuXVzVd8.js';
|
|
5
5
|
import '@o2ter/utils-js';
|
|
6
6
|
import 'jsonwebtoken';
|
|
7
7
|
import '@o2ter/server-js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Pool, PoolClient, PoolConfig } from 'pg';
|
|
2
|
-
import { _ as _TValue,
|
|
2
|
+
import { _ as _TValue, n as EventData, T as TSchema, o as DecodedQuery, F as FindOptions, Q as QuerySelector, p as DecodedSortOption, I as InsertOptions, q as TValue, r as FindOneOptions, t as TUpdateOp, u as FieldSelectorExpression, v as QueryExpression, w as TStorage, x as TransactionOptions, h as TObject, y as TQueryRandomOptions, z as TPubSub } from '../../internals/index-DnREUbmG.js';
|
|
3
3
|
import * as _o2ter_utils_js from '@o2ter/utils-js';
|
|
4
4
|
import { asyncStream } from '@o2ter/utils-js';
|
|
5
5
|
import 'jsonwebtoken';
|
|
@@ -178,6 +178,7 @@ declare abstract class SqlStorage implements TStorage {
|
|
|
178
178
|
abstract setConfig(values: Record<string, _TValue>, acl?: string[]): PromiseLike<void>;
|
|
179
179
|
abstract lockTable(className: string | string[], update: boolean): Promise<void>;
|
|
180
180
|
abstract withConnection<T>(callback: (connection: TStorage) => PromiseLike<T>): PromiseLike<T>;
|
|
181
|
+
abstract isDuplicateIdError(error: any): boolean;
|
|
181
182
|
abstract atomic<T>(callback: (connection: TStorage) => PromiseLike<T>, options?: {
|
|
182
183
|
lockTable?: string;
|
|
183
184
|
}): PromiseLike<T>;
|
|
@@ -236,6 +237,7 @@ declare class PostgresStorageClient<Driver extends PostgresClientDriver> extends
|
|
|
236
237
|
}>;
|
|
237
238
|
lockTable(table: string | string[], update: boolean): Promise<void>;
|
|
238
239
|
withConnection<T>(callback: (connection: PostgresStorageClient<PostgresClientDriver>) => PromiseLike<T>): PromiseLike<T>;
|
|
240
|
+
isDuplicateIdError(error: any): any;
|
|
239
241
|
atomic<T>(callback: (connection: PostgresStorageTransaction) => PromiseLike<T>, options?: {
|
|
240
242
|
lockTable?: string;
|
|
241
243
|
}): PromiseLike<T>;
|
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var _ = require('lodash');
|
|
6
|
-
var index = require('../../internals/index-
|
|
6
|
+
var index = require('../../internals/index-CVutVPmd.js');
|
|
7
7
|
var pg = require('pg');
|
|
8
8
|
var QueryStream = require('pg-query-stream');
|
|
9
9
|
var utilsJs = require('@o2ter/utils-js');
|
|
10
10
|
var Decimal = require('decimal.js');
|
|
11
11
|
var utils = require('pg/lib/utils');
|
|
12
|
-
var index$1 = require('../../internals/index-
|
|
12
|
+
var index$1 = require('../../internals/index-CSNRyhjB.js');
|
|
13
13
|
require('@o2ter/crypto-js');
|
|
14
|
-
var random$1 = require('../../internals/random-
|
|
14
|
+
var random$1 = require('../../internals/random-DBDmz54D.js');
|
|
15
15
|
var _private = require('../../internals/private-CSB1Ep4g.js');
|
|
16
16
|
|
|
17
17
|
//
|
|
@@ -2449,6 +2449,9 @@ class PostgresStorageClient extends SqlStorage {
|
|
|
2449
2449
|
withConnection(callback) {
|
|
2450
2450
|
return callback(this);
|
|
2451
2451
|
}
|
|
2452
|
+
isDuplicateIdError(error) {
|
|
2453
|
+
return error.code === '23505' && error.table && error.constraint === `${error.table}_pkey`;
|
|
2454
|
+
}
|
|
2452
2455
|
atomic(callback, options) {
|
|
2453
2456
|
return this.withTransaction(async (conn) => {
|
|
2454
2457
|
if (options?.lockTable)
|