@milaboratories/pl-client 2.9.3 → 2.10.0
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/error_resource.d.ts +6 -0
- package/dist/core/error_resource.d.ts.map +1 -0
- package/dist/core/transaction.d.ts +2 -0
- package/dist/core/transaction.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +192 -179
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/core/error_resource.ts +10 -0
- package/src/core/transaction.ts +13 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@milaboratories/pl-client",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.10.0",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": ">=20.3.0"
|
|
6
6
|
},
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"undici": "~7.5.0",
|
|
33
33
|
"utility-types": "^3.11.0",
|
|
34
34
|
"yaml": "^2.7.0",
|
|
35
|
-
"@milaboratories/
|
|
36
|
-
"@milaboratories/
|
|
35
|
+
"@milaboratories/pl-http": "^1.1.2",
|
|
36
|
+
"@milaboratories/ts-helpers": "^1.3.1"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"typescript": "~5.5.4",
|
package/src/core/transaction.ts
CHANGED
|
@@ -36,6 +36,8 @@ import type { LRUCache } from 'lru-cache';
|
|
|
36
36
|
import type { ResourceDataCacheRecord } from './cache';
|
|
37
37
|
import type { TxStat } from './stat';
|
|
38
38
|
import { initialTxStat } from './stat';
|
|
39
|
+
import type { ErrorResourceData } from './error_resource';
|
|
40
|
+
import { ErrorResourceType } from './error_resource';
|
|
39
41
|
|
|
40
42
|
/** Reference to resource, used only within transaction */
|
|
41
43
|
export interface ResourceRef {
|
|
@@ -440,6 +442,10 @@ export class PlTransaction {
|
|
|
440
442
|
);
|
|
441
443
|
}
|
|
442
444
|
|
|
445
|
+
public createError(message: string): ResourceRef {
|
|
446
|
+
return this.createValue(ErrorResourceType, JSON.stringify({ message } satisfies ErrorResourceData));
|
|
447
|
+
}
|
|
448
|
+
|
|
443
449
|
public setResourceName(name: string, rId: AnyResourceRef): void {
|
|
444
450
|
this.sendVoidAsync({
|
|
445
451
|
oneofKind: 'resourceNameSet',
|
|
@@ -630,6 +636,13 @@ export class PlTransaction {
|
|
|
630
636
|
this.lockOutputs(rID);
|
|
631
637
|
}
|
|
632
638
|
|
|
639
|
+
public setResourceError(rId: AnyResourceRef, ref: AnyResourceRef): void {
|
|
640
|
+
this.sendVoidAsync({
|
|
641
|
+
oneofKind: 'resourceSetError',
|
|
642
|
+
resourceSetError: { resourceId: toResourceId(rId), errorResourceId: toResourceId(ref) },
|
|
643
|
+
});
|
|
644
|
+
}
|
|
645
|
+
|
|
633
646
|
//
|
|
634
647
|
// Fields
|
|
635
648
|
//
|