@sasjs/api 0.47.0 → 0.48.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/build/browser.js +1 -3
- package/build/cjs/viya/seed.js +9 -13
- package/build/esm/host/dispatch.d.ts +4 -4
- package/build/esm/viya/seed.d.ts +10 -14
- package/build/esm/viya/seed.d.ts.map +1 -1
- package/build/esm/viya/seed.js +9 -13
- package/package.json +1 -1
package/build/browser.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @sasjs/api 0.
|
|
1
|
+
/* @sasjs/api 0.48.0 - the SASjs Server API, for a service worker. https://github.com/sasjs/api */
|
|
2
2
|
"use strict";
|
|
3
3
|
var SASjsApi = (() => {
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -5536,8 +5536,6 @@ var SASjsApi = (() => {
|
|
|
5536
5536
|
return value >>> 0;
|
|
5537
5537
|
};
|
|
5538
5538
|
var seedOf = (settings = {}) => {
|
|
5539
|
-
if (settings.seed !== void 0 && settings.seed !== "")
|
|
5540
|
-
return hash(`seed:${settings.seed}`);
|
|
5541
5539
|
const address = normaliseServerUrl(settings.serverUrl);
|
|
5542
5540
|
return hash(`url:${address || DEFAULT_SEED}`);
|
|
5543
5541
|
};
|
package/build/cjs/viya/seed.js
CHANGED
|
@@ -9,15 +9,14 @@
|
|
|
9
9
|
* tomorrow.
|
|
10
10
|
*
|
|
11
11
|
* The seed is therefore the identity of the estate, and the identity of an estate
|
|
12
|
-
* is the address clients already use to reach it
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* address), and the port that moves between runs (CI picks an ephemeral one).
|
|
12
|
+
* is the address clients already use to reach it, normalised so that one estate
|
|
13
|
+
* spelled two ways is one string. There is no override: an address that differs is
|
|
14
|
+
* a different estate with different data, by design. Anything that reads this
|
|
15
|
+
* data - a fixture, a screenshot, a test - has to work whatever the address is,
|
|
16
|
+
* because the address is all the identity there is.
|
|
18
17
|
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
18
|
+
* An emulator with no address has not said which estate it is, so every such
|
|
19
|
+
* estate shares one seed. That is the only honest default.
|
|
21
20
|
*/
|
|
22
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
22
|
exports.drawFrom = exports.drawInt = exports.generator = exports.seedOf = exports.hash = exports.normaliseServerUrl = exports.DEFAULT_SEED = void 0;
|
|
@@ -83,13 +82,10 @@ exports.hash = hash;
|
|
|
83
82
|
/**
|
|
84
83
|
* The number that makes this estate's generated data reproducible.
|
|
85
84
|
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
* the address gets to overrule.
|
|
85
|
+
* The address is the only input: the same estate answers the same way every time,
|
|
86
|
+
* and a different address is a different estate.
|
|
89
87
|
*/
|
|
90
88
|
const seedOf = (settings = {}) => {
|
|
91
|
-
if (settings.seed !== undefined && settings.seed !== '')
|
|
92
|
-
return (0, exports.hash)(`seed:${settings.seed}`);
|
|
93
89
|
const address = (0, exports.normaliseServerUrl)(settings.serverUrl);
|
|
94
90
|
return (0, exports.hash)(`url:${address || exports.DEFAULT_SEED}`);
|
|
95
91
|
};
|
|
@@ -117,10 +117,10 @@ export interface Services {
|
|
|
117
117
|
/**
|
|
118
118
|
* The emulated Viya estate this host mounts, when it mounts one.
|
|
119
119
|
*
|
|
120
|
-
* Absent, the emulated answers fall back to one shared seed. The
|
|
121
|
-
*
|
|
122
|
-
*
|
|
123
|
-
*
|
|
120
|
+
* Absent, the emulated answers fall back to one shared seed. The normalised
|
|
121
|
+
* `serverUrl` is the whole identity: one address is one estate, a different
|
|
122
|
+
* address - a moved port, a second hostname - is a different estate with its own
|
|
123
|
+
* data, and there is no setting that makes two addresses one.
|
|
124
124
|
*/
|
|
125
125
|
viya?: ViyaSeedSettings;
|
|
126
126
|
/**
|
package/build/esm/viya/seed.d.ts
CHANGED
|
@@ -8,15 +8,14 @@
|
|
|
8
8
|
* tomorrow.
|
|
9
9
|
*
|
|
10
10
|
* The seed is therefore the identity of the estate, and the identity of an estate
|
|
11
|
-
* is the address clients already use to reach it
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* address), and the port that moves between runs (CI picks an ephemeral one).
|
|
11
|
+
* is the address clients already use to reach it, normalised so that one estate
|
|
12
|
+
* spelled two ways is one string. There is no override: an address that differs is
|
|
13
|
+
* a different estate with different data, by design. Anything that reads this
|
|
14
|
+
* data - a fixture, a screenshot, a test - has to work whatever the address is,
|
|
15
|
+
* because the address is all the identity there is.
|
|
17
16
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
17
|
+
* An emulator with no address has not said which estate it is, so every such
|
|
18
|
+
* estate shares one seed. That is the only honest default.
|
|
20
19
|
*/
|
|
21
20
|
/** The seed every emulated estate falls back to. */
|
|
22
21
|
export declare const DEFAULT_SEED = "emulated";
|
|
@@ -56,10 +55,8 @@ export interface ViyaRun {
|
|
|
56
55
|
state?: 'completed' | 'failed';
|
|
57
56
|
}
|
|
58
57
|
export interface ViyaSeedSettings {
|
|
59
|
-
/** The address this estate answers at. */
|
|
58
|
+
/** The address this estate answers at, which is what seeds it. */
|
|
60
59
|
serverUrl?: string;
|
|
61
|
-
/** Pins the generated data when the address is not the identity. */
|
|
62
|
-
seed?: string | number;
|
|
63
60
|
/** Runs a submitted program, when the host has an engine. */
|
|
64
61
|
execute?: ViyaExecutor['execute'];
|
|
65
62
|
}
|
|
@@ -77,9 +74,8 @@ export declare const hash: (input: string) => number;
|
|
|
77
74
|
/**
|
|
78
75
|
* The number that makes this estate's generated data reproducible.
|
|
79
76
|
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
* the address gets to overrule.
|
|
77
|
+
* The address is the only input: the same estate answers the same way every time,
|
|
78
|
+
* and a different address is a different estate.
|
|
83
79
|
*/
|
|
84
80
|
export declare const seedOf: (settings?: ViyaSeedSettings) => number;
|
|
85
81
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seed.d.ts","sourceRoot":"","sources":["../../../src/viya/seed.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"seed.d.ts","sourceRoot":"","sources":["../../../src/viya/seed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,oDAAoD;AACpD,eAAO,MAAM,YAAY,aAAa,CAAA;AAEtC;;;;;;;GAOG;AACH,MAAM,WAAW,YAAY;IAC3B,OAAO,CAAC,OAAO,EAAE;QACf,2DAA2D;QAC3D,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;QAC1B,4DAA4D;QAC5D,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;QAClC,kEAAkE;QAClE,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,sCAAsC;QACtC,SAAS,EAAE,MAAM,CAAA;KAClB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;CACrB;AAED,8CAA8C;AAC9C,MAAM,WAAW,OAAO;IACtB,6DAA6D;IAC7D,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,gFAAgF;IAChF,GAAG,EAAE,MAAM,CAAA;IACX;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,WAAW,GAAG,QAAQ,CAAA;CAC/B;AAED,MAAM,WAAW,gBAAgB;IAC/B,kEAAkE;IAClE,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,6DAA6D;IAC7D,OAAO,CAAC,EAAE,YAAY,CAAC,SAAS,CAAC,CAAA;CAClC;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,GAAI,KAAK,MAAM,GAAG,SAAS,KAAG,MA+C5D,CAAA;AAED,8DAA8D;AAC9D,eAAO,MAAM,IAAI,GAAI,OAAO,MAAM,KAAG,MASpC,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,MAAM,GAAI,WAAU,gBAAqB,KAAG,MAIxD,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,GAAI,MAAM,MAAM,KAAG,CAAC,MAAM,MAAM,CAarD,CAAA;AAED,4DAA4D;AAC5D,eAAO,MAAM,OAAO,GAAI,MAAM,MAAM,MAAM,EAAE,OAAO,MAAM,KAAG,MAChC,CAAA;AAE5B,oDAAoD;AACpD,eAAO,MAAM,QAAQ,GAAI,CAAC,EAAE,MAAM,MAAM,MAAM,EAAE,QAAQ,CAAC,EAAE,KAAG,CACxB,CAAA"}
|
package/build/esm/viya/seed.js
CHANGED
|
@@ -8,15 +8,14 @@
|
|
|
8
8
|
* tomorrow.
|
|
9
9
|
*
|
|
10
10
|
* The seed is therefore the identity of the estate, and the identity of an estate
|
|
11
|
-
* is the address clients already use to reach it
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* address), and the port that moves between runs (CI picks an ephemeral one).
|
|
11
|
+
* is the address clients already use to reach it, normalised so that one estate
|
|
12
|
+
* spelled two ways is one string. There is no override: an address that differs is
|
|
13
|
+
* a different estate with different data, by design. Anything that reads this
|
|
14
|
+
* data - a fixture, a screenshot, a test - has to work whatever the address is,
|
|
15
|
+
* because the address is all the identity there is.
|
|
17
16
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
17
|
+
* An emulator with no address has not said which estate it is, so every such
|
|
18
|
+
* estate shares one seed. That is the only honest default.
|
|
20
19
|
*/
|
|
21
20
|
/** The seed every emulated estate falls back to. */
|
|
22
21
|
export const DEFAULT_SEED = 'emulated';
|
|
@@ -78,13 +77,10 @@ export const hash = (input) => {
|
|
|
78
77
|
/**
|
|
79
78
|
* The number that makes this estate's generated data reproducible.
|
|
80
79
|
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
* the address gets to overrule.
|
|
80
|
+
* The address is the only input: the same estate answers the same way every time,
|
|
81
|
+
* and a different address is a different estate.
|
|
84
82
|
*/
|
|
85
83
|
export const seedOf = (settings = {}) => {
|
|
86
|
-
if (settings.seed !== undefined && settings.seed !== '')
|
|
87
|
-
return hash(`seed:${settings.seed}`);
|
|
88
84
|
const address = normaliseServerUrl(settings.serverUrl);
|
|
89
85
|
return hash(`url:${address || DEFAULT_SEED}`);
|
|
90
86
|
};
|
package/package.json
CHANGED