@agoric/vow 0.1.1-dev-14b75b9.0.14b75b9 → 0.1.1-dev-64cee5a.0.64cee5a
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/package.json +6 -6
- package/src/E.d.ts +3 -53
- package/src/E.d.ts.map +1 -1
- package/src/E.js +3 -3
- package/src/retryable.d.ts +1 -30
- package/src/retryable.d.ts.map +1 -1
- package/src/retryable.js +1 -1
- package/vat.js +7 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/vow",
|
|
3
|
-
"version": "0.1.1-dev-
|
|
3
|
+
"version": "0.1.1-dev-64cee5a.0.64cee5a",
|
|
4
4
|
"description": "Remote (shortening and disconnection-tolerant) Promise-likes",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"lint:types": "yarn run -T tsc"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@agoric/base-zone": "0.1.1-dev-
|
|
24
|
-
"@agoric/internal": "0.3.3-dev-
|
|
23
|
+
"@agoric/base-zone": "0.1.1-dev-64cee5a.0.64cee5a",
|
|
24
|
+
"@agoric/internal": "0.3.3-dev-64cee5a.0.64cee5a",
|
|
25
25
|
"@endo/env-options": "^1.1.11",
|
|
26
26
|
"@endo/errors": "^1.2.13",
|
|
27
27
|
"@endo/eventual-send": "^1.3.4",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@agoric/internal": "workspace:*",
|
|
34
|
-
"@agoric/swingset-vat": "0.32.3-dev-
|
|
35
|
-
"@agoric/zone": "0.2.3-dev-
|
|
34
|
+
"@agoric/swingset-vat": "0.32.3-dev-64cee5a.0.64cee5a",
|
|
35
|
+
"@agoric/zone": "0.2.3-dev-64cee5a.0.64cee5a",
|
|
36
36
|
"@endo/far": "^1.1.14",
|
|
37
37
|
"@endo/init": "^1.1.12",
|
|
38
38
|
"ava": "^5.3.0",
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"typeCoverage": {
|
|
59
59
|
"atLeast": 91.98
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "64cee5ae5d1a3488a30ce042d6f3f561ac2a6e82"
|
|
62
62
|
}
|
package/src/E.d.ts
CHANGED
|
@@ -1,56 +1,6 @@
|
|
|
1
1
|
export default makeE;
|
|
2
2
|
export type Callable = (...args: unknown[]) => any;
|
|
3
|
-
export type EProxy = ReturnType<
|
|
4
|
-
unwrap?: (<T>(x: T) => Promise<EUnwrap<T>>) | undefined;
|
|
5
|
-
additional?: A | undefined;
|
|
6
|
-
}) => (<T>(x: T) => ECallableOrMethods<RemoteFunctions<T>>) & {
|
|
7
|
-
/**
|
|
8
|
-
* E.get(x) returns a proxy on which you can get arbitrary properties.
|
|
9
|
-
* Each of these properties returns a promise for the property. The promise
|
|
10
|
-
* value will be the property fetched from whatever 'x' designates (or
|
|
11
|
-
* resolves to) in a future turn, not this one.
|
|
12
|
-
*
|
|
13
|
-
* @template T
|
|
14
|
-
* @param {T} x target for property get
|
|
15
|
-
* @returns {EGetters<LocalRecord<T>>} property get proxy
|
|
16
|
-
* @readonly
|
|
17
|
-
*/
|
|
18
|
-
readonly get: <T>(x: T) => EGetters<LocalRecord<T>>;
|
|
19
|
-
/**
|
|
20
|
-
* E.resolve(x) converts x to a handled promise. It is
|
|
21
|
-
* shorthand for HandledPromise.resolve(x)
|
|
22
|
-
*
|
|
23
|
-
* @template T
|
|
24
|
-
* @param {T} x value to convert to a handled promise
|
|
25
|
-
* @returns {Promise<Awaited<T>>} handled promise for x
|
|
26
|
-
* @readonly
|
|
27
|
-
*/
|
|
28
|
-
readonly resolve: <T>(x: T) => Promise<Awaited<T>>;
|
|
29
|
-
/**
|
|
30
|
-
* E.sendOnly returns a proxy similar to E, but for which the results
|
|
31
|
-
* are ignored (undefined is returned).
|
|
32
|
-
*
|
|
33
|
-
* @template T
|
|
34
|
-
* @param {T} x target for method/function call
|
|
35
|
-
* @returns {ESendOnlyCallableOrMethods<RemoteFunctions<T>>} method/function call proxy
|
|
36
|
-
* @readonly
|
|
37
|
-
*/
|
|
38
|
-
readonly sendOnly: <T>(x: T) => ESendOnlyCallableOrMethods<RemoteFunctions<T>>;
|
|
39
|
-
/**
|
|
40
|
-
* E.when(x, res, rej) is equivalent to
|
|
41
|
-
* unwrap(x).then(onfulfilled, onrejected)
|
|
42
|
-
*
|
|
43
|
-
* @template T
|
|
44
|
-
* @template [TResult1=EUnwrap<T>]
|
|
45
|
-
* @template [TResult2=never]
|
|
46
|
-
* @param {ERef<T>} x value to convert to a handled promise
|
|
47
|
-
* @param {(value: EUnwrap<T>) => ERef<TResult1>} [onfulfilled]
|
|
48
|
-
* @param {(reason: any) => ERef<TResult2>} [onrejected]
|
|
49
|
-
* @returns {Promise<TResult1 | TResult2>}
|
|
50
|
-
* @readonly
|
|
51
|
-
*/
|
|
52
|
-
readonly when: <T, TResult1 = EUnwrap<T>, TResult2 = never>(x: ERef<T>, onfulfilled?: (value: EUnwrap<T>) => ERef<TResult1>, onrejected?: (reason: any) => ERef<TResult2>) => Promise<TResult1 | TResult2>;
|
|
53
|
-
} & A)>;
|
|
3
|
+
export type EProxy = ReturnType<typeof makeE>;
|
|
54
4
|
/**
|
|
55
5
|
* `DataOnly<T>` means to return a record type `T2` consisting only of
|
|
56
6
|
* properties that are *not* functions.
|
|
@@ -147,8 +97,8 @@ declare function makeE<A = {}>(HandledPromise: HandledPromiseConstructor, powers
|
|
|
147
97
|
*/
|
|
148
98
|
readonly when: <T, TResult1 = EUnwrap<T>, TResult2 = never>(x: ERef<T>, onfulfilled?: (value: EUnwrap<T>) => ERef<TResult1>, onrejected?: (reason: any) => ERef<TResult2>) => Promise<TResult1 | TResult2>;
|
|
149
99
|
} & A;
|
|
150
|
-
import type { HandledPromiseConstructor } from '@endo/eventual-send';
|
|
151
100
|
import type { EUnwrap } from './types.js';
|
|
152
|
-
import type { ERef } from '@endo/far';
|
|
153
101
|
import type { RemotableBrand } from '@endo/eventual-send';
|
|
102
|
+
import type { ERef } from '@endo/far';
|
|
103
|
+
import type { HandledPromiseConstructor } from '@endo/eventual-send';
|
|
154
104
|
//# sourceMappingURL=E.d.ts.map
|
package/src/E.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"E.d.ts","sourceRoot":"","sources":["E.js"],"names":[],"mappings":";uBAiCc,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,GAAG;qBAuR3B,UAAU,
|
|
1
|
+
{"version":3,"file":"E.d.ts","sourceRoot":"","sources":["E.js"],"names":[],"mappings":";uBAiCc,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,GAAG;qBAuR3B,UAAU,CAAC,OAAO,KAAK,CAAC;;;;;qBAMzB,CAAC,IACD,IAAI,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;sBAIvB,CAAC,SAAX,QAAS,IACV,UAAU,CAAC,CAAC,CAAC,SAAS,QAAQ,UAAU,CAAC,CAAC,CAAC,CAAC,GAChD,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAClD,UAAU,CAAC,CAAC,CAAC,SAAS,OAAO,CAAC,QAAQ,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,GACnD,CAAC,GACD,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,QAAQ,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;qBAIzD,CAAC,IACD,EACZ,QAAY,EAAE,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,QAAQ,GAC1C,SAAS,CAAC,CAAC,CAA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CAAC,CAAC,CAAC,CAAC;IAWrC;;;;;;;;OAQG;uBAJU,CAAC,KACH,CAAC,KACC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAKhC;;;;;;;;OAQG;wBAJU,CAAC,KACH,CAAC,KACC,0BAA0B,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;IAW3D;;;;;;;;;;;;OAYG;oBARU,CAAC,EACA,QAAQ,eACR,QAAQ,aACX,KAAK,CAAC,CAAC,gBACP,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,KAAK,KAAK,QAAQ,CAAC,eACrC,CAAC,MAAM,EAAE,GAAG,KAAK,KAAK,QAAQ,CAAC,KAC7B,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;MAgBhD;6BA7RyB,YAAY;oCAQwB,qBAAqB;0BAT5D,WAAW;+CAS4B,qBAAqB"}
|
package/src/E.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @ts-check
|
|
2
2
|
/**
|
|
3
3
|
* @file provides a `makeE` that can be parameterized with an `unwrap` function
|
|
4
|
-
* and corresponding `
|
|
4
|
+
* and corresponding `EUnwrap<T>`. These will be used to
|
|
5
5
|
* extract the final settlement from a chain of PromiseLikes and PromiseSteps or
|
|
6
6
|
* similar non-thenable pseudo-promises.
|
|
7
7
|
*
|
|
@@ -21,6 +21,7 @@ import { makeMessageBreakpointTester } from './message-breakpoints.js';
|
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* @import {ERef} from '@endo/far';
|
|
24
|
+
* @import {EUnwrap} from './types.js';
|
|
24
25
|
*/
|
|
25
26
|
|
|
26
27
|
const { assign, create } = Object;
|
|
@@ -29,7 +30,6 @@ const onSend = makeMessageBreakpointTester('ENDO_SEND_BREAKPOINTS');
|
|
|
29
30
|
|
|
30
31
|
/**
|
|
31
32
|
* @import { HandledPromiseConstructor, RemotableBrand } from '@endo/eventual-send'
|
|
32
|
-
* @import { EUnwrap } from './types.js'
|
|
33
33
|
*/
|
|
34
34
|
/** @typedef {(...args: unknown[]) => any} Callable */
|
|
35
35
|
|
|
@@ -310,7 +310,7 @@ const makeE = (HandledPromise, powers = {}) => {
|
|
|
310
310
|
|
|
311
311
|
export default makeE;
|
|
312
312
|
|
|
313
|
-
/** @typedef {ReturnType<makeE>} EProxy */
|
|
313
|
+
/** @typedef {ReturnType<typeof makeE>} EProxy */
|
|
314
314
|
|
|
315
315
|
/**
|
|
316
316
|
* `DataOnly<T>` means to return a record type `T2` consisting only of
|
package/src/retryable.d.ts
CHANGED
|
@@ -33,36 +33,7 @@ export type PreparationOptions = {
|
|
|
33
33
|
isRetryableReason: IsRetryableReason;
|
|
34
34
|
};
|
|
35
35
|
export type RetryableFunc = (...args: Passable[]) => Promise<any>;
|
|
36
|
-
export type RetryableTools = ReturnType<
|
|
37
|
-
prepareRetryableFlowKit: (zone: Zone, tag: string, retryableFunc: RetryableFunc) => (activationArgs: any) => import("@endo/exo").GuardedKit<{
|
|
38
|
-
flow: {
|
|
39
|
-
/**
|
|
40
|
-
* Calls the retryable function, either for the initial run or when
|
|
41
|
-
* the result of the previous run fails with a retryable reason.
|
|
42
|
-
*/
|
|
43
|
-
restart(): void;
|
|
44
|
-
getOutcome(): Vow<any>;
|
|
45
|
-
};
|
|
46
|
-
resultWatcher: {
|
|
47
|
-
onFulfilled(value: any, runId: any): void;
|
|
48
|
-
onRejected(reason: any, runId: any): void;
|
|
49
|
-
};
|
|
50
|
-
}>;
|
|
51
|
-
adminRetryableFlow: import("@endo/exo").Guarded<{
|
|
52
|
-
/**
|
|
53
|
-
* @param {Vow} outcomeVow
|
|
54
|
-
*/
|
|
55
|
-
getFlowForOutcomeVow(outcomeVow: Vow): import("@endo/exo").Guarded<{
|
|
56
|
-
/**
|
|
57
|
-
* Calls the retryable function, either for the initial run or when
|
|
58
|
-
* the result of the previous run fails with a retryable reason.
|
|
59
|
-
*/
|
|
60
|
-
restart(): void;
|
|
61
|
-
getOutcome(): Vow<any>;
|
|
62
|
-
}>;
|
|
63
|
-
}>;
|
|
64
|
-
retryable: import("./types.js").RetryableTool;
|
|
65
|
-
}>;
|
|
36
|
+
export type RetryableTools = ReturnType<typeof prepareRetryableTools>;
|
|
66
37
|
export type AdminRetryableFlow = RetryableTools["adminRetryableFlow"];
|
|
67
38
|
export type MakeRetryableFlowKit = ReturnType<RetryableTools["prepareRetryableFlowKit"]>;
|
|
68
39
|
export type RetryableFlowKit = ReturnType<MakeRetryableFlowKit>;
|
package/src/retryable.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retryable.d.ts","sourceRoot":"","sources":["retryable.js"],"names":[],"mappings":"AAwCO,iDAHI,IAAI,gBACJ,kBAAkB;oCAoBhB,IAAI,OACJ,MAAM,iBACN,aAAa;;YAsBhB;;;eAGG;;;;;;;;;;QAuGP;;WAEG;yCADQ,GAAG;YA3GV;;;eAGG;;;;;;EAqHZ;;gBA5La,MAAM,OAAO,GAAG,CAAC;uBACjB,iBAAiB;;4BAIlB,CAAC,GAAG,IAAI,EAAE,QAAQ,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC;6BA2LrC,UAAU,
|
|
1
|
+
{"version":3,"file":"retryable.d.ts","sourceRoot":"","sources":["retryable.js"],"names":[],"mappings":"AAwCO,iDAHI,IAAI,gBACJ,kBAAkB;oCAoBhB,IAAI,OACJ,MAAM,iBACN,aAAa;;YAsBhB;;;eAGG;;;;;;;;;;QAuGP;;WAEG;yCADQ,GAAG;YA3GV;;;eAGG;;;;;;EAqHZ;;gBA5La,MAAM,OAAO,GAAG,CAAC;uBACjB,iBAAiB;;4BAIlB,CAAC,GAAG,IAAI,EAAE,QAAQ,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC;6BA2LrC,UAAU,CAAC,OAAO,qBAAqB,CAAC;iCAIxC,cAAc,CAAC,oBAAoB,CAAC;mCAIpC,UAAU,CAAC,cAAc,CAAC,yBAAyB,CAAC,CAAC;+BAIrD,UAAU,CAAC,oBAAoB,CAAC;4BAIhC,gBAAgB,CAAC,MAAM,CAAC;0BAvNd,mBAAmB;yBACiB,YAAY;4BAAZ,YAAY;uCAAZ,YAAY;8BAC/B,kBAAkB"}
|
package/src/retryable.js
CHANGED
|
@@ -204,7 +204,7 @@ export const prepareRetryableTools = (outerZone, outerOptions) => {
|
|
|
204
204
|
harden(prepareRetryableTools);
|
|
205
205
|
|
|
206
206
|
/**
|
|
207
|
-
* @typedef {ReturnType<prepareRetryableTools>} RetryableTools
|
|
207
|
+
* @typedef {ReturnType<typeof prepareRetryableTools>} RetryableTools
|
|
208
208
|
*/
|
|
209
209
|
|
|
210
210
|
/**
|
package/vat.js
CHANGED
|
@@ -14,7 +14,12 @@ import { makeHeapZone } from '@agoric/base-zone/heap.js';
|
|
|
14
14
|
import { prepareBasicVowTools } from './src/tools.js';
|
|
15
15
|
import makeE from './src/E.js';
|
|
16
16
|
|
|
17
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* @import {IsRetryableReason} from './src/types.js';
|
|
19
|
+
* @import {E} from '@endo/far';
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
/** @type {IsRetryableReason} */
|
|
18
23
|
const isRetryableReason = (reason, priorRetryValue) => {
|
|
19
24
|
if (
|
|
20
25
|
isUpgradeDisconnection(reason) &&
|
|
@@ -63,7 +68,7 @@ export const heapVowTools = prepareSwingsetVowTools(makeHeapZone());
|
|
|
63
68
|
*
|
|
64
69
|
* This produces long-lived ephemeral promises that encapsulate the shortening
|
|
65
70
|
* behaviour, and so provides no way for `watch` to durably shorten. Use the
|
|
66
|
-
* standard `
|
|
71
|
+
* standard `E` if you need to `watch` its resulting
|
|
67
72
|
* promises.
|
|
68
73
|
*/
|
|
69
74
|
export const heapVowE = makeE(globalThis.HandledPromise, {
|