@typeberry/lib 0.1.2-80d53fd → 0.1.2-953c012
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/index.cjs +19 -16
- package/index.d.ts +21 -19
- package/index.js +19 -16
- package/package.json +1 -1
package/index.cjs
CHANGED
|
@@ -10,6 +10,7 @@ var GpVersion;
|
|
|
10
10
|
GpVersion["V0_6_7"] = "0.6.7";
|
|
11
11
|
GpVersion["V0_7_0"] = "0.7.0";
|
|
12
12
|
GpVersion["V0_7_1"] = "0.7.1-preview";
|
|
13
|
+
GpVersion["V0_7_2"] = "0.7.2-preview";
|
|
13
14
|
})(GpVersion || (GpVersion = {}));
|
|
14
15
|
var TestSuite;
|
|
15
16
|
(function (TestSuite) {
|
|
@@ -17,7 +18,7 @@ var TestSuite;
|
|
|
17
18
|
TestSuite["JAMDUNA"] = "jamduna";
|
|
18
19
|
})(TestSuite || (TestSuite = {}));
|
|
19
20
|
const DEFAULT_SUITE = TestSuite.W3F_DAVXY;
|
|
20
|
-
const ALL_VERSIONS_IN_ORDER = [GpVersion.V0_6_7, GpVersion.V0_7_0, GpVersion.V0_7_1];
|
|
21
|
+
const ALL_VERSIONS_IN_ORDER = [GpVersion.V0_6_7, GpVersion.V0_7_0, GpVersion.V0_7_1, GpVersion.V0_7_2];
|
|
21
22
|
const env$1 = typeof process === "undefined" ? {} : process.env;
|
|
22
23
|
const DEFAULT_VERSION = GpVersion.V0_7_0;
|
|
23
24
|
let CURRENT_VERSION = parseCurrentVersion(env$1.GP_VERSION) ?? DEFAULT_VERSION;
|
|
@@ -26,20 +27,26 @@ function parseCurrentVersion(env) {
|
|
|
26
27
|
if (env === undefined) {
|
|
27
28
|
return undefined;
|
|
28
29
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
switch (env) {
|
|
31
|
+
case GpVersion.V0_6_7:
|
|
32
|
+
case GpVersion.V0_7_0:
|
|
33
|
+
case GpVersion.V0_7_1:
|
|
34
|
+
case GpVersion.V0_7_2:
|
|
35
|
+
return env;
|
|
36
|
+
default:
|
|
37
|
+
throw new Error(`Configured environment variable GP_VERSION is unknown: '${env}'. Use one of: ${ALL_VERSIONS_IN_ORDER}`);
|
|
32
38
|
}
|
|
33
|
-
return version;
|
|
34
39
|
}
|
|
35
40
|
function parseCurrentSuite(env) {
|
|
36
41
|
if (env === undefined)
|
|
37
42
|
return undefined;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
43
|
+
switch (env) {
|
|
44
|
+
case TestSuite.W3F_DAVXY:
|
|
45
|
+
case TestSuite.JAMDUNA:
|
|
46
|
+
return env;
|
|
47
|
+
default:
|
|
48
|
+
throw new Error(`Configured environment variable TEST_SUITE is unknown: '${env}'. Use one of: ${Object.values(TestSuite)}`);
|
|
41
49
|
}
|
|
42
|
-
return val;
|
|
43
50
|
}
|
|
44
51
|
class Compatibility {
|
|
45
52
|
static override(version) {
|
|
@@ -8045,8 +8052,8 @@ function print(level, levelAndName, strings, data) {
|
|
|
8045
8052
|
return;
|
|
8046
8053
|
}
|
|
8047
8054
|
const lvlText = Level[level].padEnd(5);
|
|
8048
|
-
const val = strings.map((v, idx) => `${v}${data[idx]}`);
|
|
8049
|
-
const msg = `${lvlText} [${levelAndName[1]}] ${val}`;
|
|
8055
|
+
const val = strings.map((v, idx) => `${v}${idx < data.length ? data[idx] : ""}`);
|
|
8056
|
+
const msg = `${lvlText} [${levelAndName[1]}] ${val.join("")}`;
|
|
8050
8057
|
if (level === Level.WARN) {
|
|
8051
8058
|
console.warn(msg);
|
|
8052
8059
|
}
|
|
@@ -12397,16 +12404,12 @@ class PartiallyUpdatedState {
|
|
|
12397
12404
|
*
|
|
12398
12405
|
* NOTE the info may be updated compared to what is in the state.
|
|
12399
12406
|
*
|
|
12400
|
-
* Takes into account newly created services as well.
|
|
12407
|
+
* Takes into account ejected and newly created services as well.
|
|
12401
12408
|
*/
|
|
12402
12409
|
getServiceInfo(destination) {
|
|
12403
12410
|
if (destination === null) {
|
|
12404
12411
|
return null;
|
|
12405
12412
|
}
|
|
12406
|
-
const isEjected = this.stateUpdate.services.servicesRemoved.some((x) => x === destination);
|
|
12407
|
-
if (isEjected) {
|
|
12408
|
-
return null;
|
|
12409
|
-
}
|
|
12410
12413
|
const maybeNewService = this.stateUpdate.services.servicesUpdates.find((update) => update.serviceId === destination);
|
|
12411
12414
|
if (maybeNewService !== undefined) {
|
|
12412
12415
|
return maybeNewService.action.account;
|
package/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ declare enum GpVersion {
|
|
|
2
2
|
V0_6_7 = "0.6.7",
|
|
3
3
|
V0_7_0 = "0.7.0",
|
|
4
4
|
V0_7_1 = "0.7.1-preview",
|
|
5
|
+
V0_7_2 = "0.7.2-preview",
|
|
5
6
|
}
|
|
6
7
|
|
|
7
8
|
declare enum TestSuite {
|
|
@@ -11,7 +12,7 @@ declare enum TestSuite {
|
|
|
11
12
|
|
|
12
13
|
declare const DEFAULT_SUITE = TestSuite.W3F_DAVXY;
|
|
13
14
|
|
|
14
|
-
declare const ALL_VERSIONS_IN_ORDER = [GpVersion.V0_6_7, GpVersion.V0_7_0, GpVersion.V0_7_1];
|
|
15
|
+
declare const ALL_VERSIONS_IN_ORDER = [GpVersion.V0_6_7, GpVersion.V0_7_0, GpVersion.V0_7_1, GpVersion.V0_7_2];
|
|
15
16
|
declare const DEFAULT_VERSION = GpVersion.V0_7_0;
|
|
16
17
|
declare let CURRENT_VERSION = parseCurrentVersion(env.GP_VERSION) ?? DEFAULT_VERSION;
|
|
17
18
|
declare let CURRENT_SUITE = parseCurrentSuite(env.TEST_SUITE) ?? DEFAULT_SUITE;
|
|
@@ -20,24 +21,30 @@ declare function parseCurrentVersion(env?: string): GpVersion | undefined {
|
|
|
20
21
|
if (env === undefined) {
|
|
21
22
|
return undefined;
|
|
22
23
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
switch (env) {
|
|
25
|
+
case GpVersion.V0_6_7:
|
|
26
|
+
case GpVersion.V0_7_0:
|
|
27
|
+
case GpVersion.V0_7_1:
|
|
28
|
+
case GpVersion.V0_7_2:
|
|
29
|
+
return env;
|
|
30
|
+
default:
|
|
31
|
+
throw new Error(
|
|
32
|
+
`Configured environment variable GP_VERSION is unknown: '${env}'. Use one of: ${ALL_VERSIONS_IN_ORDER}`,
|
|
33
|
+
);
|
|
28
34
|
}
|
|
29
|
-
return version;
|
|
30
35
|
}
|
|
31
36
|
|
|
32
37
|
declare function parseCurrentSuite(env?: string): TestSuite | undefined {
|
|
33
38
|
if (env === undefined) return undefined;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
+
switch (env) {
|
|
40
|
+
case TestSuite.W3F_DAVXY:
|
|
41
|
+
case TestSuite.JAMDUNA:
|
|
42
|
+
return env;
|
|
43
|
+
default:
|
|
44
|
+
throw new Error(
|
|
45
|
+
`Configured environment variable TEST_SUITE is unknown: '${env}'. Use one of: ${Object.values(TestSuite)}`,
|
|
46
|
+
);
|
|
39
47
|
}
|
|
40
|
-
return val;
|
|
41
48
|
}
|
|
42
49
|
|
|
43
50
|
declare class Compatibility {
|
|
@@ -17150,18 +17157,13 @@ declare class PartiallyUpdatedState<T extends StateSlice = StateSlice> {
|
|
|
17150
17157
|
*
|
|
17151
17158
|
* NOTE the info may be updated compared to what is in the state.
|
|
17152
17159
|
*
|
|
17153
|
-
* Takes into account newly created services as well.
|
|
17160
|
+
* Takes into account ejected and newly created services as well.
|
|
17154
17161
|
*/
|
|
17155
17162
|
getServiceInfo(destination: ServiceId | null): ServiceAccountInfo | null {
|
|
17156
17163
|
if (destination === null) {
|
|
17157
17164
|
return null;
|
|
17158
17165
|
}
|
|
17159
17166
|
|
|
17160
|
-
const isEjected = this.stateUpdate.services.servicesRemoved.some((x) => x === destination);
|
|
17161
|
-
if (isEjected) {
|
|
17162
|
-
return null;
|
|
17163
|
-
}
|
|
17164
|
-
|
|
17165
17167
|
const maybeNewService = this.stateUpdate.services.servicesUpdates.find(
|
|
17166
17168
|
(update) => update.serviceId === destination,
|
|
17167
17169
|
);
|
package/index.js
CHANGED
|
@@ -7,6 +7,7 @@ var GpVersion;
|
|
|
7
7
|
GpVersion["V0_6_7"] = "0.6.7";
|
|
8
8
|
GpVersion["V0_7_0"] = "0.7.0";
|
|
9
9
|
GpVersion["V0_7_1"] = "0.7.1-preview";
|
|
10
|
+
GpVersion["V0_7_2"] = "0.7.2-preview";
|
|
10
11
|
})(GpVersion || (GpVersion = {}));
|
|
11
12
|
var TestSuite;
|
|
12
13
|
(function (TestSuite) {
|
|
@@ -14,7 +15,7 @@ var TestSuite;
|
|
|
14
15
|
TestSuite["JAMDUNA"] = "jamduna";
|
|
15
16
|
})(TestSuite || (TestSuite = {}));
|
|
16
17
|
const DEFAULT_SUITE = TestSuite.W3F_DAVXY;
|
|
17
|
-
const ALL_VERSIONS_IN_ORDER = [GpVersion.V0_6_7, GpVersion.V0_7_0, GpVersion.V0_7_1];
|
|
18
|
+
const ALL_VERSIONS_IN_ORDER = [GpVersion.V0_6_7, GpVersion.V0_7_0, GpVersion.V0_7_1, GpVersion.V0_7_2];
|
|
18
19
|
const env$1 = typeof process === "undefined" ? {} : process.env;
|
|
19
20
|
const DEFAULT_VERSION = GpVersion.V0_7_0;
|
|
20
21
|
let CURRENT_VERSION = parseCurrentVersion(env$1.GP_VERSION) ?? DEFAULT_VERSION;
|
|
@@ -23,20 +24,26 @@ function parseCurrentVersion(env) {
|
|
|
23
24
|
if (env === undefined) {
|
|
24
25
|
return undefined;
|
|
25
26
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
switch (env) {
|
|
28
|
+
case GpVersion.V0_6_7:
|
|
29
|
+
case GpVersion.V0_7_0:
|
|
30
|
+
case GpVersion.V0_7_1:
|
|
31
|
+
case GpVersion.V0_7_2:
|
|
32
|
+
return env;
|
|
33
|
+
default:
|
|
34
|
+
throw new Error(`Configured environment variable GP_VERSION is unknown: '${env}'. Use one of: ${ALL_VERSIONS_IN_ORDER}`);
|
|
29
35
|
}
|
|
30
|
-
return version;
|
|
31
36
|
}
|
|
32
37
|
function parseCurrentSuite(env) {
|
|
33
38
|
if (env === undefined)
|
|
34
39
|
return undefined;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
40
|
+
switch (env) {
|
|
41
|
+
case TestSuite.W3F_DAVXY:
|
|
42
|
+
case TestSuite.JAMDUNA:
|
|
43
|
+
return env;
|
|
44
|
+
default:
|
|
45
|
+
throw new Error(`Configured environment variable TEST_SUITE is unknown: '${env}'. Use one of: ${Object.values(TestSuite)}`);
|
|
38
46
|
}
|
|
39
|
-
return val;
|
|
40
47
|
}
|
|
41
48
|
class Compatibility {
|
|
42
49
|
static override(version) {
|
|
@@ -8042,8 +8049,8 @@ function print(level, levelAndName, strings, data) {
|
|
|
8042
8049
|
return;
|
|
8043
8050
|
}
|
|
8044
8051
|
const lvlText = Level[level].padEnd(5);
|
|
8045
|
-
const val = strings.map((v, idx) => `${v}${data[idx]}`);
|
|
8046
|
-
const msg = `${lvlText} [${levelAndName[1]}] ${val}`;
|
|
8052
|
+
const val = strings.map((v, idx) => `${v}${idx < data.length ? data[idx] : ""}`);
|
|
8053
|
+
const msg = `${lvlText} [${levelAndName[1]}] ${val.join("")}`;
|
|
8047
8054
|
if (level === Level.WARN) {
|
|
8048
8055
|
console.warn(msg);
|
|
8049
8056
|
}
|
|
@@ -12394,16 +12401,12 @@ class PartiallyUpdatedState {
|
|
|
12394
12401
|
*
|
|
12395
12402
|
* NOTE the info may be updated compared to what is in the state.
|
|
12396
12403
|
*
|
|
12397
|
-
* Takes into account newly created services as well.
|
|
12404
|
+
* Takes into account ejected and newly created services as well.
|
|
12398
12405
|
*/
|
|
12399
12406
|
getServiceInfo(destination) {
|
|
12400
12407
|
if (destination === null) {
|
|
12401
12408
|
return null;
|
|
12402
12409
|
}
|
|
12403
|
-
const isEjected = this.stateUpdate.services.servicesRemoved.some((x) => x === destination);
|
|
12404
|
-
if (isEjected) {
|
|
12405
|
-
return null;
|
|
12406
|
-
}
|
|
12407
12410
|
const maybeNewService = this.stateUpdate.services.servicesUpdates.find((update) => update.serviceId === destination);
|
|
12408
12411
|
if (maybeNewService !== undefined) {
|
|
12409
12412
|
return maybeNewService.action.account;
|