@milaboratories/pl-client 2.7.12 → 2.7.14
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/core/auth.d.ts.map +1 -1
- package/dist/core/cache.d.ts.map +1 -1
- package/dist/core/client.d.ts +1 -1
- package/dist/core/client.d.ts.map +1 -1
- package/dist/core/default_client.d.ts.map +1 -1
- package/dist/core/driver.d.ts.map +1 -1
- package/dist/core/errors.d.ts.map +1 -1
- package/dist/core/final.d.ts.map +1 -1
- package/dist/core/ll_client.d.ts.map +1 -1
- package/dist/core/ll_transaction.d.ts.map +1 -1
- package/dist/core/transaction.d.ts +1 -1
- package/dist/core/transaction.d.ts.map +1 -1
- package/dist/core/type_conversion.d.ts.map +1 -1
- package/dist/core/types.d.ts +1 -1
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/unauth_client.d.ts.map +1 -1
- package/dist/helpers/pl.d.ts.map +1 -1
- package/dist/helpers/poll.d.ts.map +1 -1
- package/dist/helpers/state_helpers.d.ts.map +1 -1
- package/dist/helpers/tx_helpers.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4069 -4075
- package/dist/index.mjs.map +1 -1
- package/dist/proto/github.com/googleapis/googleapis/google/rpc/status.d.ts +15 -15
- package/dist/proto/github.com/googleapis/googleapis/google/rpc/status.d.ts.map +1 -1
- package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.client.d.ts +4 -4
- package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.client.d.ts.map +1 -1
- package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.d.ts +16 -16
- package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.d.ts.map +1 -1
- package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.client.d.ts +4 -4
- package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.client.d.ts.map +1 -1
- package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.d.ts +59 -59
- package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.d.ts.map +1 -1
- package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.client.d.ts +8 -8
- package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.client.d.ts.map +1 -1
- package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.d.ts +22 -22
- package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.d.ts.map +1 -1
- package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.client.d.ts +72 -72
- package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.client.d.ts.map +1 -1
- package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.d.ts +152 -152
- package/dist/proto/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.d.ts.map +1 -1
- package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api.client.d.ts +156 -156
- package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api.client.d.ts.map +1 -1
- package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api.d.ts +773 -773
- package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api.d.ts.map +1 -1
- package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api_types.d.ts +163 -163
- package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/api_types.d.ts.map +1 -1
- package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/base_types.d.ts +22 -22
- package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/base_types.d.ts.map +1 -1
- package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/import.d.ts +32 -32
- package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/import.d.ts.map +1 -1
- package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/resource_types.d.ts +78 -78
- package/dist/proto/github.com/milaboratory/pl/plapi/plapiproto/resource_types.d.ts.map +1 -1
- package/dist/proto/google/api/http.d.ts +89 -89
- package/dist/proto/google/api/http.d.ts.map +1 -1
- package/dist/proto/google/protobuf/any.d.ts +52 -52
- package/dist/proto/google/protobuf/any.d.ts.map +1 -1
- package/dist/proto/google/protobuf/descriptor.d.ts +1151 -1151
- package/dist/proto/google/protobuf/descriptor.d.ts.map +1 -1
- package/dist/proto/google/protobuf/duration.d.ts +19 -19
- package/dist/proto/google/protobuf/duration.d.ts.map +1 -1
- package/dist/proto/google/protobuf/empty.d.ts.map +1 -1
- package/dist/proto/google/protobuf/struct.d.ts +56 -56
- package/dist/proto/google/protobuf/struct.d.ts.map +1 -1
- package/dist/proto/google/protobuf/timestamp.d.ts +25 -25
- package/dist/proto/google/protobuf/timestamp.d.ts.map +1 -1
- package/dist/proto/google/protobuf/wrappers.d.ts +72 -72
- package/dist/proto/google/protobuf/wrappers.d.ts.map +1 -1
- package/dist/test/test_config.d.ts.map +1 -1
- package/dist/util/util.d.ts.map +1 -1
- package/package.json +17 -13
- package/src/core/auth.ts +3 -3
- package/src/core/cache.ts +1 -1
- package/src/core/client.ts +39 -31
- package/src/core/config.ts +21 -21
- package/src/core/default_client.ts +15 -14
- package/src/core/driver.ts +4 -4
- package/src/core/errors.ts +3 -3
- package/src/core/final.ts +7 -4
- package/src/core/ll_client.ts +31 -27
- package/src/core/ll_transaction.ts +17 -17
- package/src/core/stat.ts +2 -2
- package/src/core/transaction.ts +93 -95
- package/src/core/type_conversion.ts +11 -8
- package/src/core/types.ts +25 -26
- package/src/core/unauth_client.ts +6 -6
- package/src/helpers/pl.ts +8 -7
- package/src/helpers/poll.ts +25 -21
- package/src/helpers/state_helpers.ts +2 -1
- package/src/helpers/tx_helpers.ts +4 -3
- package/src/proto/github.com/googleapis/googleapis/google/rpc/status.ts +74 -71
- package/src/proto/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.client.ts +21 -20
- package/src/proto/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.ts +240 -225
- package/src/proto/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.client.ts +21 -20
- package/src/proto/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.ts +290 -275
- package/src/proto/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.client.ts +32 -30
- package/src/proto/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.ts +388 -364
- package/src/proto/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.client.ts +58 -53
- package/src/proto/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.ts +490 -469
- package/src/proto/github.com/milaboratory/pl/plapi/plapiproto/api.client.ts +262 -237
- package/src/proto/github.com/milaboratory/pl/plapi/plapiproto/api.ts +11751 -11032
- package/src/proto/github.com/milaboratory/pl/plapi/plapiproto/api_types.ts +1155 -1114
- package/src/proto/github.com/milaboratory/pl/plapi/plapiproto/base_types.ts +131 -125
- package/src/proto/github.com/milaboratory/pl/plapi/plapiproto/import.ts +203 -200
- package/src/proto/github.com/milaboratory/pl/plapi/plapiproto/resource_types.ts +559 -540
- package/src/proto/google/api/http.ts +280 -271
- package/src/proto/google/protobuf/any.ts +149 -139
- package/src/proto/google/protobuf/descriptor.ts +2952 -2853
- package/src/proto/google/protobuf/duration.ts +107 -102
- package/src/proto/google/protobuf/empty.ts +41 -38
- package/src/proto/google/protobuf/struct.ts +336 -322
- package/src/proto/google/protobuf/timestamp.ts +131 -123
- package/src/proto/google/protobuf/wrappers.ts +536 -491
- package/src/test/test_config.ts +21 -19
- package/src/util/util.ts +1 -0
|
@@ -8,10 +8,10 @@ import { BinaryWriteOptions, IBinaryWriter, BinaryReadOptions, IBinaryReader, Pa
|
|
|
8
8
|
*/
|
|
9
9
|
export interface DoubleValue {
|
|
10
10
|
/**
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
* The double value.
|
|
12
|
+
*
|
|
13
|
+
* @generated from protobuf field: double value = 1;
|
|
14
|
+
*/
|
|
15
15
|
value: number;
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
@@ -23,10 +23,10 @@ export interface DoubleValue {
|
|
|
23
23
|
*/
|
|
24
24
|
export interface FloatValue {
|
|
25
25
|
/**
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
* The float value.
|
|
27
|
+
*
|
|
28
|
+
* @generated from protobuf field: float value = 1;
|
|
29
|
+
*/
|
|
30
30
|
value: number;
|
|
31
31
|
}
|
|
32
32
|
/**
|
|
@@ -38,10 +38,10 @@ export interface FloatValue {
|
|
|
38
38
|
*/
|
|
39
39
|
export interface Int64Value {
|
|
40
40
|
/**
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
* The int64 value.
|
|
42
|
+
*
|
|
43
|
+
* @generated from protobuf field: int64 value = 1;
|
|
44
|
+
*/
|
|
45
45
|
value: bigint;
|
|
46
46
|
}
|
|
47
47
|
/**
|
|
@@ -53,10 +53,10 @@ export interface Int64Value {
|
|
|
53
53
|
*/
|
|
54
54
|
export interface UInt64Value {
|
|
55
55
|
/**
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
* The uint64 value.
|
|
57
|
+
*
|
|
58
|
+
* @generated from protobuf field: uint64 value = 1;
|
|
59
|
+
*/
|
|
60
60
|
value: bigint;
|
|
61
61
|
}
|
|
62
62
|
/**
|
|
@@ -68,10 +68,10 @@ export interface UInt64Value {
|
|
|
68
68
|
*/
|
|
69
69
|
export interface Int32Value {
|
|
70
70
|
/**
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
71
|
+
* The int32 value.
|
|
72
|
+
*
|
|
73
|
+
* @generated from protobuf field: int32 value = 1;
|
|
74
|
+
*/
|
|
75
75
|
value: number;
|
|
76
76
|
}
|
|
77
77
|
/**
|
|
@@ -83,10 +83,10 @@ export interface Int32Value {
|
|
|
83
83
|
*/
|
|
84
84
|
export interface UInt32Value {
|
|
85
85
|
/**
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
86
|
+
* The uint32 value.
|
|
87
|
+
*
|
|
88
|
+
* @generated from protobuf field: uint32 value = 1;
|
|
89
|
+
*/
|
|
90
90
|
value: number;
|
|
91
91
|
}
|
|
92
92
|
/**
|
|
@@ -98,10 +98,10 @@ export interface UInt32Value {
|
|
|
98
98
|
*/
|
|
99
99
|
export interface BoolValue {
|
|
100
100
|
/**
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
101
|
+
* The bool value.
|
|
102
|
+
*
|
|
103
|
+
* @generated from protobuf field: bool value = 1;
|
|
104
|
+
*/
|
|
105
105
|
value: boolean;
|
|
106
106
|
}
|
|
107
107
|
/**
|
|
@@ -113,10 +113,10 @@ export interface BoolValue {
|
|
|
113
113
|
*/
|
|
114
114
|
export interface StringValue {
|
|
115
115
|
/**
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
116
|
+
* The string value.
|
|
117
|
+
*
|
|
118
|
+
* @generated from protobuf field: string value = 1;
|
|
119
|
+
*/
|
|
120
120
|
value: string;
|
|
121
121
|
}
|
|
122
122
|
/**
|
|
@@ -128,21 +128,21 @@ export interface StringValue {
|
|
|
128
128
|
*/
|
|
129
129
|
export interface BytesValue {
|
|
130
130
|
/**
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
131
|
+
* The bytes value.
|
|
132
|
+
*
|
|
133
|
+
* @generated from protobuf field: bytes value = 1;
|
|
134
|
+
*/
|
|
135
135
|
value: Uint8Array;
|
|
136
136
|
}
|
|
137
137
|
declare class DoubleValue$Type extends MessageType<DoubleValue> {
|
|
138
138
|
constructor();
|
|
139
139
|
/**
|
|
140
|
-
|
|
141
|
-
|
|
140
|
+
* Encode `DoubleValue` to JSON number.
|
|
141
|
+
*/
|
|
142
142
|
internalJsonWrite(message: DoubleValue, options: JsonWriteOptions): JsonValue;
|
|
143
143
|
/**
|
|
144
|
-
|
|
145
|
-
|
|
144
|
+
* Decode `DoubleValue` from JSON number.
|
|
145
|
+
*/
|
|
146
146
|
internalJsonRead(json: JsonValue, options: JsonReadOptions, target?: DoubleValue): DoubleValue;
|
|
147
147
|
create(value?: PartialMessage<DoubleValue>): DoubleValue;
|
|
148
148
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DoubleValue): DoubleValue;
|
|
@@ -155,12 +155,12 @@ export declare const DoubleValue: DoubleValue$Type;
|
|
|
155
155
|
declare class FloatValue$Type extends MessageType<FloatValue> {
|
|
156
156
|
constructor();
|
|
157
157
|
/**
|
|
158
|
-
|
|
159
|
-
|
|
158
|
+
* Encode `FloatValue` to JSON number.
|
|
159
|
+
*/
|
|
160
160
|
internalJsonWrite(message: FloatValue, options: JsonWriteOptions): JsonValue;
|
|
161
161
|
/**
|
|
162
|
-
|
|
163
|
-
|
|
162
|
+
* Decode `FloatValue` from JSON number.
|
|
163
|
+
*/
|
|
164
164
|
internalJsonRead(json: JsonValue, options: JsonReadOptions, target?: FloatValue): FloatValue;
|
|
165
165
|
create(value?: PartialMessage<FloatValue>): FloatValue;
|
|
166
166
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FloatValue): FloatValue;
|
|
@@ -173,12 +173,12 @@ export declare const FloatValue: FloatValue$Type;
|
|
|
173
173
|
declare class Int64Value$Type extends MessageType<Int64Value> {
|
|
174
174
|
constructor();
|
|
175
175
|
/**
|
|
176
|
-
|
|
177
|
-
|
|
176
|
+
* Encode `Int64Value` to JSON string.
|
|
177
|
+
*/
|
|
178
178
|
internalJsonWrite(message: Int64Value, options: JsonWriteOptions): JsonValue;
|
|
179
179
|
/**
|
|
180
|
-
|
|
181
|
-
|
|
180
|
+
* Decode `Int64Value` from JSON string.
|
|
181
|
+
*/
|
|
182
182
|
internalJsonRead(json: JsonValue, options: JsonReadOptions, target?: Int64Value): Int64Value;
|
|
183
183
|
create(value?: PartialMessage<Int64Value>): Int64Value;
|
|
184
184
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Int64Value): Int64Value;
|
|
@@ -191,12 +191,12 @@ export declare const Int64Value: Int64Value$Type;
|
|
|
191
191
|
declare class UInt64Value$Type extends MessageType<UInt64Value> {
|
|
192
192
|
constructor();
|
|
193
193
|
/**
|
|
194
|
-
|
|
195
|
-
|
|
194
|
+
* Encode `UInt64Value` to JSON string.
|
|
195
|
+
*/
|
|
196
196
|
internalJsonWrite(message: UInt64Value, options: JsonWriteOptions): JsonValue;
|
|
197
197
|
/**
|
|
198
|
-
|
|
199
|
-
|
|
198
|
+
* Decode `UInt64Value` from JSON string.
|
|
199
|
+
*/
|
|
200
200
|
internalJsonRead(json: JsonValue, options: JsonReadOptions, target?: UInt64Value): UInt64Value;
|
|
201
201
|
create(value?: PartialMessage<UInt64Value>): UInt64Value;
|
|
202
202
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UInt64Value): UInt64Value;
|
|
@@ -209,12 +209,12 @@ export declare const UInt64Value: UInt64Value$Type;
|
|
|
209
209
|
declare class Int32Value$Type extends MessageType<Int32Value> {
|
|
210
210
|
constructor();
|
|
211
211
|
/**
|
|
212
|
-
|
|
213
|
-
|
|
212
|
+
* Encode `Int32Value` to JSON string.
|
|
213
|
+
*/
|
|
214
214
|
internalJsonWrite(message: Int32Value, options: JsonWriteOptions): JsonValue;
|
|
215
215
|
/**
|
|
216
|
-
|
|
217
|
-
|
|
216
|
+
* Decode `Int32Value` from JSON string.
|
|
217
|
+
*/
|
|
218
218
|
internalJsonRead(json: JsonValue, options: JsonReadOptions, target?: Int32Value): Int32Value;
|
|
219
219
|
create(value?: PartialMessage<Int32Value>): Int32Value;
|
|
220
220
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Int32Value): Int32Value;
|
|
@@ -227,12 +227,12 @@ export declare const Int32Value: Int32Value$Type;
|
|
|
227
227
|
declare class UInt32Value$Type extends MessageType<UInt32Value> {
|
|
228
228
|
constructor();
|
|
229
229
|
/**
|
|
230
|
-
|
|
231
|
-
|
|
230
|
+
* Encode `UInt32Value` to JSON string.
|
|
231
|
+
*/
|
|
232
232
|
internalJsonWrite(message: UInt32Value, options: JsonWriteOptions): JsonValue;
|
|
233
233
|
/**
|
|
234
|
-
|
|
235
|
-
|
|
234
|
+
* Decode `UInt32Value` from JSON string.
|
|
235
|
+
*/
|
|
236
236
|
internalJsonRead(json: JsonValue, options: JsonReadOptions, target?: UInt32Value): UInt32Value;
|
|
237
237
|
create(value?: PartialMessage<UInt32Value>): UInt32Value;
|
|
238
238
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UInt32Value): UInt32Value;
|
|
@@ -245,12 +245,12 @@ export declare const UInt32Value: UInt32Value$Type;
|
|
|
245
245
|
declare class BoolValue$Type extends MessageType<BoolValue> {
|
|
246
246
|
constructor();
|
|
247
247
|
/**
|
|
248
|
-
|
|
249
|
-
|
|
248
|
+
* Encode `BoolValue` to JSON bool.
|
|
249
|
+
*/
|
|
250
250
|
internalJsonWrite(message: BoolValue, options: JsonWriteOptions): JsonValue;
|
|
251
251
|
/**
|
|
252
|
-
|
|
253
|
-
|
|
252
|
+
* Decode `BoolValue` from JSON bool.
|
|
253
|
+
*/
|
|
254
254
|
internalJsonRead(json: JsonValue, options: JsonReadOptions, target?: BoolValue): BoolValue;
|
|
255
255
|
create(value?: PartialMessage<BoolValue>): BoolValue;
|
|
256
256
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: BoolValue): BoolValue;
|
|
@@ -263,12 +263,12 @@ export declare const BoolValue: BoolValue$Type;
|
|
|
263
263
|
declare class StringValue$Type extends MessageType<StringValue> {
|
|
264
264
|
constructor();
|
|
265
265
|
/**
|
|
266
|
-
|
|
267
|
-
|
|
266
|
+
* Encode `StringValue` to JSON string.
|
|
267
|
+
*/
|
|
268
268
|
internalJsonWrite(message: StringValue, options: JsonWriteOptions): JsonValue;
|
|
269
269
|
/**
|
|
270
|
-
|
|
271
|
-
|
|
270
|
+
* Decode `StringValue` from JSON string.
|
|
271
|
+
*/
|
|
272
272
|
internalJsonRead(json: JsonValue, options: JsonReadOptions, target?: StringValue): StringValue;
|
|
273
273
|
create(value?: PartialMessage<StringValue>): StringValue;
|
|
274
274
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: StringValue): StringValue;
|
|
@@ -281,12 +281,12 @@ export declare const StringValue: StringValue$Type;
|
|
|
281
281
|
declare class BytesValue$Type extends MessageType<BytesValue> {
|
|
282
282
|
constructor();
|
|
283
283
|
/**
|
|
284
|
-
|
|
285
|
-
|
|
284
|
+
* Encode `BytesValue` to JSON string.
|
|
285
|
+
*/
|
|
286
286
|
internalJsonWrite(message: BytesValue, options: JsonWriteOptions): JsonValue;
|
|
287
287
|
/**
|
|
288
|
-
|
|
289
|
-
|
|
288
|
+
* Decode `BytesValue` from JSON string.
|
|
289
|
+
*/
|
|
290
290
|
internalJsonRead(json: JsonValue, options: JsonReadOptions, target?: BytesValue): BytesValue;
|
|
291
291
|
create(value?: PartialMessage<BytesValue>): BytesValue;
|
|
292
292
|
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: BytesValue): BytesValue;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wrappers.d.ts","sourceRoot":"","sources":["../../../../src/proto/google/protobuf/wrappers.ts"],"names":[],"mappings":"AA8CA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,KAAK,EAAE,iBAAiB,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AE,kBAAkB,GAAG,aAAa;CAS5G;AACD;;GAEG;AACH,eAAO,MAAM,UAAU,iBAAwB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test_config.d.ts","sourceRoot":"","sources":["../../src/test/test_config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAmB,OAAO,
|
|
1
|
+
{"version":3,"file":"test_config.d.ts","sourceRoot":"","sources":["../../src/test/test_config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,EAAmB,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAG/E,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAO1C,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAYD,wBAAgB,aAAa,IAAI,UAAU,CAmB1C;AAiCD,wBAAsB,iBAAiB,IAAI,OAAO,CAAC;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC,CA0D1F;AAED,wBAAsB,eAAe,CAAC,aAAa,GAAE,OAAO,CAAC,cAAc,CAAM,uBAGhF;AAED,wBAAsB,aAAa,CAAC,eAAe,CAAC,EAAE,MAAM,qBAK3D;AAED,wBAAsB,YAAY,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAcpF"}
|
package/dist/util/util.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/util/util.ts"],"names":[],"mappings":"AAIA,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,GAAG,UAAU,
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/util/util.ts"],"names":[],"mappings":"AAIA,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,GAAG,UAAU,CAK9D"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@milaboratories/pl-client",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.14",
|
|
4
|
+
"engines": {
|
|
5
|
+
"node": ">=20.3.0"
|
|
6
|
+
},
|
|
4
7
|
"description": "New TS/JS client for Platform API",
|
|
5
8
|
"types": "./dist/index.d.ts",
|
|
6
9
|
"main": "./dist/index.js",
|
|
@@ -17,36 +20,37 @@
|
|
|
17
20
|
"./src/**/*"
|
|
18
21
|
],
|
|
19
22
|
"dependencies": {
|
|
20
|
-
"@grpc/grpc-js": "~1.
|
|
21
|
-
"@protobuf-ts/grpc-transport": "2.9.
|
|
22
|
-
"@protobuf-ts/runtime": "2.9.
|
|
23
|
-
"@protobuf-ts/runtime-rpc": "2.9.
|
|
24
|
-
"canonicalize": "~2.
|
|
23
|
+
"@grpc/grpc-js": "~1.13.1",
|
|
24
|
+
"@protobuf-ts/grpc-transport": "2.9.6",
|
|
25
|
+
"@protobuf-ts/runtime": "2.9.6",
|
|
26
|
+
"@protobuf-ts/runtime-rpc": "2.9.6",
|
|
27
|
+
"canonicalize": "~2.1.0",
|
|
25
28
|
"denque": "^2.1.0",
|
|
26
|
-
"lru-cache": "^11.0
|
|
29
|
+
"lru-cache": "^11.1.0",
|
|
27
30
|
"https-proxy-agent": "^7.0.6",
|
|
28
31
|
"long": "^5.3.1",
|
|
29
|
-
"undici": "~7.
|
|
32
|
+
"undici": "~7.5.0",
|
|
30
33
|
"utility-types": "^3.11.0",
|
|
31
|
-
"yaml": "^2.
|
|
32
|
-
"@milaboratories/
|
|
33
|
-
"@milaboratories/
|
|
34
|
+
"yaml": "^2.7.0",
|
|
35
|
+
"@milaboratories/ts-helpers": "^1.1.5",
|
|
36
|
+
"@milaboratories/pl-http": "^1.1.2"
|
|
34
37
|
},
|
|
35
38
|
"devDependencies": {
|
|
36
39
|
"typescript": "~5.5.4",
|
|
37
40
|
"vite": "^5.4.11",
|
|
38
41
|
"@types/node": "~20.16.15",
|
|
39
|
-
"@protobuf-ts/plugin": "2.9.
|
|
42
|
+
"@protobuf-ts/plugin": "2.9.6",
|
|
40
43
|
"@types/http-proxy": "^1.17.16",
|
|
41
44
|
"@types/jest": "^29.5.14",
|
|
42
45
|
"jest": "^29.7.0",
|
|
43
46
|
"@jest/globals": "^29.7.0",
|
|
44
47
|
"ts-jest": "^29.2.6",
|
|
45
|
-
"@milaboratories/platforma-build-configs": "1.0.
|
|
48
|
+
"@milaboratories/platforma-build-configs": "1.0.3"
|
|
46
49
|
},
|
|
47
50
|
"scripts": {
|
|
48
51
|
"type-check": "tsc --noEmit --composite false",
|
|
49
52
|
"build": "vite build",
|
|
53
|
+
"lint": "eslint .",
|
|
50
54
|
"test": "jest --runInBand",
|
|
51
55
|
"do-pack": "rm -f *.tgz && pnpm pack && mv *.tgz package.tgz"
|
|
52
56
|
}
|
package/src/core/auth.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { AuthInformation } from './config';
|
|
1
|
+
import type { AuthInformation } from './config';
|
|
2
2
|
import { parsePlJwt } from '../util/pl';
|
|
3
3
|
|
|
4
4
|
/** Returns a timestamp when current authorization information should be refreshed.
|
|
5
5
|
* Compare the value with Date.now(). */
|
|
6
6
|
export function inferAuthRefreshTime(
|
|
7
7
|
info: AuthInformation,
|
|
8
|
-
maxRefreshSeconds: number
|
|
8
|
+
maxRefreshSeconds: number,
|
|
9
9
|
): number | undefined {
|
|
10
10
|
if (info.jwtToken === undefined) return undefined;
|
|
11
11
|
|
|
@@ -15,7 +15,7 @@ export function inferAuthRefreshTime(
|
|
|
15
15
|
Math.min(
|
|
16
16
|
// in the middle between issue and expiration time points
|
|
17
17
|
(iat + exp) / 2,
|
|
18
|
-
iat + maxRefreshSeconds
|
|
18
|
+
iat + maxRefreshSeconds,
|
|
19
19
|
) * 1000
|
|
20
20
|
);
|
|
21
21
|
}
|
package/src/core/cache.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BasicResourceData, ResourceData } from './types';
|
|
1
|
+
import type { BasicResourceData, ResourceData } from './types';
|
|
2
2
|
|
|
3
3
|
export type ResourceDataCacheRecord = {
|
|
4
4
|
/** There is a slight chance of inconsistent data retrieval from tx if we allow later transactions to leak resource data into earlier transactions.
|
package/src/core/client.ts
CHANGED
|
@@ -1,29 +1,37 @@
|
|
|
1
|
-
import { AuthOps, PlClientConfig, PlConnectionStatusListener } from './config';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import type { AuthOps, PlClientConfig, PlConnectionStatusListener } from './config';
|
|
2
|
+
import type { PlCallOps } from './ll_client';
|
|
3
|
+
import { LLPlClient } from './ll_client';
|
|
4
|
+
import type { AnyResourceRef } from './transaction';
|
|
5
|
+
import { PlTransaction, toGlobalResourceId, TxCommitConflict } from './transaction';
|
|
6
|
+
import { createHash } from 'node:crypto';
|
|
7
|
+
import type {
|
|
8
|
+
OptionalResourceId,
|
|
9
|
+
ResourceId,
|
|
10
|
+
} from './types';
|
|
5
11
|
import {
|
|
6
12
|
ensureResourceIdNotNull,
|
|
7
13
|
isNullResourceId,
|
|
8
14
|
NullResourceId,
|
|
9
|
-
OptionalResourceId,
|
|
10
|
-
ResourceId
|
|
11
15
|
} from './types';
|
|
12
16
|
import { ClientRoot } from '../helpers/pl';
|
|
17
|
+
import type {
|
|
18
|
+
RetryOptions,
|
|
19
|
+
} from '@milaboratories/ts-helpers';
|
|
13
20
|
import {
|
|
14
21
|
assertNever,
|
|
15
22
|
createRetryState,
|
|
16
23
|
nextRetryStateOrError,
|
|
17
|
-
RetryOptions
|
|
18
24
|
} from '@milaboratories/ts-helpers';
|
|
19
|
-
import { PlDriver, PlDriverDefinition } from './driver';
|
|
20
|
-
import { MaintenanceAPI_Ping_Response } from '../proto/github.com/milaboratory/pl/plapi/plapiproto/api';
|
|
25
|
+
import type { PlDriver, PlDriverDefinition } from './driver';
|
|
26
|
+
import type { MaintenanceAPI_Ping_Response } from '../proto/github.com/milaboratory/pl/plapi/plapiproto/api';
|
|
21
27
|
import * as tp from 'node:timers/promises';
|
|
22
|
-
import { Dispatcher } from 'undici';
|
|
28
|
+
import type { Dispatcher } from 'undici';
|
|
23
29
|
import { LRUCache } from 'lru-cache';
|
|
24
|
-
import { ResourceDataCacheRecord } from './cache';
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
30
|
+
import type { ResourceDataCacheRecord } from './cache';
|
|
31
|
+
import type { FinalResourceDataPredicate } from './final';
|
|
32
|
+
import { DefaultFinalResourceDataPredicate } from './final';
|
|
33
|
+
import type { AllTxStat, TxStat } from './stat';
|
|
34
|
+
import { addStat, initialTxStat } from './stat';
|
|
27
35
|
|
|
28
36
|
export type TxOps = PlCallOps & {
|
|
29
37
|
sync?: boolean;
|
|
@@ -31,7 +39,7 @@ export type TxOps = PlCallOps & {
|
|
|
31
39
|
};
|
|
32
40
|
|
|
33
41
|
const defaultTxOps = {
|
|
34
|
-
sync: false
|
|
42
|
+
sync: false,
|
|
35
43
|
};
|
|
36
44
|
|
|
37
45
|
const AnonymousClientRoot = 'AnonymousRoot';
|
|
@@ -43,7 +51,7 @@ function alternativeRootFieldName(alternativeRoot: string): string {
|
|
|
43
51
|
/** Client to access core PL API. */
|
|
44
52
|
export class PlClient {
|
|
45
53
|
private readonly ll: LLPlClient;
|
|
46
|
-
private readonly drivers = new Map<
|
|
54
|
+
private readonly drivers = new Map<string, PlDriver>();
|
|
47
55
|
|
|
48
56
|
/** Artificial delay introduced after write transactions completion, to
|
|
49
57
|
* somewhat throttle the load on pl. Delay introduced after sync, if requested. */
|
|
@@ -55,7 +63,7 @@ export class PlClient {
|
|
|
55
63
|
/** Last resort measure to solve complicated race conditions in pl. */
|
|
56
64
|
private readonly defaultRetryOptions: RetryOptions;
|
|
57
65
|
|
|
58
|
-
/** Stores client root (this abstraction is intended for future implementation of the security model)*/
|
|
66
|
+
/** Stores client root (this abstraction is intended for future implementation of the security model) */
|
|
59
67
|
private _clientRoot: OptionalResourceId = NullResourceId;
|
|
60
68
|
|
|
61
69
|
private _serverInfo: MaintenanceAPI_Ping_Response | undefined = undefined;
|
|
@@ -80,7 +88,7 @@ export class PlClient {
|
|
|
80
88
|
ops: {
|
|
81
89
|
statusListener?: PlConnectionStatusListener;
|
|
82
90
|
finalPredicate?: FinalResourceDataPredicate;
|
|
83
|
-
} = {}
|
|
91
|
+
} = {},
|
|
84
92
|
) {
|
|
85
93
|
this.ll = new LLPlClient(configOrAddress, { auth, ...ops });
|
|
86
94
|
const conf = this.ll.conf;
|
|
@@ -89,7 +97,7 @@ export class PlClient {
|
|
|
89
97
|
this.finalPredicate = ops.finalPredicate ?? DefaultFinalResourceDataPredicate;
|
|
90
98
|
this.resourceDataCache = new LRUCache({
|
|
91
99
|
maxSize: conf.maxCacheBytes,
|
|
92
|
-
sizeCalculation: (v) => (v.basicData.data?.length ?? 0) + 64
|
|
100
|
+
sizeCalculation: (v) => (v.basicData.data?.length ?? 0) + 64,
|
|
93
101
|
});
|
|
94
102
|
switch (conf.retryBackoffAlgorithm) {
|
|
95
103
|
case 'exponential':
|
|
@@ -98,7 +106,7 @@ export class PlClient {
|
|
|
98
106
|
initialDelay: conf.retryInitialDelay,
|
|
99
107
|
maxAttempts: conf.retryMaxAttempts,
|
|
100
108
|
backoffMultiplier: conf.retryExponentialBackoffMultiplier,
|
|
101
|
-
jitter: conf.retryJitter
|
|
109
|
+
jitter: conf.retryJitter,
|
|
102
110
|
};
|
|
103
111
|
break;
|
|
104
112
|
case 'linear':
|
|
@@ -107,7 +115,7 @@ export class PlClient {
|
|
|
107
115
|
initialDelay: conf.retryInitialDelay,
|
|
108
116
|
maxAttempts: conf.retryMaxAttempts,
|
|
109
117
|
backoffStep: conf.retryLinearBackoffStep,
|
|
110
|
-
jitter: conf.retryJitter
|
|
118
|
+
jitter: conf.retryJitter,
|
|
111
119
|
};
|
|
112
120
|
break;
|
|
113
121
|
default:
|
|
@@ -135,7 +143,7 @@ export class PlClient {
|
|
|
135
143
|
return {
|
|
136
144
|
committed: this.txCommittedStat,
|
|
137
145
|
conflict: this.txConflictStat,
|
|
138
|
-
error: this.txErrorStat
|
|
146
|
+
error: this.txErrorStat,
|
|
139
147
|
};
|
|
140
148
|
}
|
|
141
149
|
|
|
@@ -175,8 +183,8 @@ export class PlClient {
|
|
|
175
183
|
|
|
176
184
|
// calculating reproducible root name from the username
|
|
177
185
|
const user = this.ll.authUser;
|
|
178
|
-
const mainRootName
|
|
179
|
-
user === null ? AnonymousClientRoot : createHash('sha256').update(user).digest('hex');
|
|
186
|
+
const mainRootName
|
|
187
|
+
= user === null ? AnonymousClientRoot : createHash('sha256').update(user).digest('hex');
|
|
180
188
|
|
|
181
189
|
this._serverInfo = await this.ping();
|
|
182
190
|
|
|
@@ -196,7 +204,7 @@ export class PlClient {
|
|
|
196
204
|
} else {
|
|
197
205
|
const aFId = {
|
|
198
206
|
resourceId: mainRoot,
|
|
199
|
-
fieldName: alternativeRootFieldName(this.conf.alternativeRoot)
|
|
207
|
+
fieldName: alternativeRootFieldName(this.conf.alternativeRoot),
|
|
200
208
|
};
|
|
201
209
|
|
|
202
210
|
const altRoot = tx.createEphemeral(ClientRoot);
|
|
@@ -224,7 +232,7 @@ export class PlClient {
|
|
|
224
232
|
return await this.withWriteTx('delete-alternative-root', async (tx) => {
|
|
225
233
|
const fId = {
|
|
226
234
|
resourceId: tx.clientRoot,
|
|
227
|
-
fieldName: alternativeRootFieldName(alternativeRootName)
|
|
235
|
+
fieldName: alternativeRootFieldName(alternativeRootName),
|
|
228
236
|
};
|
|
229
237
|
const exists = tx.fieldExists(fId);
|
|
230
238
|
tx.removeField(fId);
|
|
@@ -238,7 +246,7 @@ export class PlClient {
|
|
|
238
246
|
writable: boolean,
|
|
239
247
|
clientRoot: OptionalResourceId,
|
|
240
248
|
body: (tx: PlTransaction) => Promise<T>,
|
|
241
|
-
ops?: TxOps
|
|
249
|
+
ops?: TxOps,
|
|
242
250
|
): Promise<T> {
|
|
243
251
|
// for exponential / linear backoff
|
|
244
252
|
let retryState = createRetryState(ops?.retryOptions ?? this.defaultRetryOptions);
|
|
@@ -253,7 +261,7 @@ export class PlClient {
|
|
|
253
261
|
writable,
|
|
254
262
|
clientRoot,
|
|
255
263
|
this.finalPredicate,
|
|
256
|
-
this.resourceDataCache
|
|
264
|
+
this.resourceDataCache,
|
|
257
265
|
);
|
|
258
266
|
|
|
259
267
|
let ok = false;
|
|
@@ -313,7 +321,7 @@ export class PlClient {
|
|
|
313
321
|
name: string,
|
|
314
322
|
writable: boolean,
|
|
315
323
|
body: (tx: PlTransaction) => Promise<T>,
|
|
316
|
-
ops: Partial<TxOps> = {}
|
|
324
|
+
ops: Partial<TxOps> = {},
|
|
317
325
|
): Promise<T> {
|
|
318
326
|
this.checkInitialized();
|
|
319
327
|
return await this._withTx(name, writable, this.clientRoot, body, { ...ops, ...defaultTxOps });
|
|
@@ -322,7 +330,7 @@ export class PlClient {
|
|
|
322
330
|
public async withWriteTx<T>(
|
|
323
331
|
name: string,
|
|
324
332
|
body: (tx: PlTransaction) => Promise<T>,
|
|
325
|
-
ops: Partial<TxOps> = {}
|
|
333
|
+
ops: Partial<TxOps> = {},
|
|
326
334
|
): Promise<T> {
|
|
327
335
|
return await this.withTx(name, true, body, { ...ops, ...defaultTxOps });
|
|
328
336
|
}
|
|
@@ -330,7 +338,7 @@ export class PlClient {
|
|
|
330
338
|
public async withReadTx<T>(
|
|
331
339
|
name: string,
|
|
332
340
|
body: (tx: PlTransaction) => Promise<T>,
|
|
333
|
-
ops: Partial<TxOps> = {}
|
|
341
|
+
ops: Partial<TxOps> = {},
|
|
334
342
|
): Promise<T> {
|
|
335
343
|
return await this.withTx(name, false, body, { ...ops, ...defaultTxOps });
|
|
336
344
|
}
|
|
@@ -353,7 +361,7 @@ export class PlClient {
|
|
|
353
361
|
auth: AuthOps,
|
|
354
362
|
ops: {
|
|
355
363
|
statusListener?: PlConnectionStatusListener;
|
|
356
|
-
} = {}
|
|
364
|
+
} = {},
|
|
357
365
|
) {
|
|
358
366
|
const pl = new PlClient(configOrAddress, auth, ops);
|
|
359
367
|
await pl.init();
|