@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 CHANGED
@@ -1,4 +1,4 @@
1
- /* @sasjs/api 0.47.0 - the SASjs Server API, for a service worker. https://github.com/sasjs/api */
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
  };
@@ -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. A target that points at
13
- * `http://localhost:5000` and a target that points at `http://127.0.0.1:5000` are
14
- * the same estate spelled two ways, so the address is normalised before it is
15
- * hashed - and `seed` exists for the two cases where the address is the wrong
16
- * identity: the estate reached by a different hostname (a container name, a LAN
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
- * Absent both, every emulated estate shares one seed. That is the only honest
20
- * default: an emulator with no address has not told us which estate it is.
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
- * `seed` wins over the address when both are present: it is the override a host
87
- * reaches for when the address disagrees with the estate, not a second opinion
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 address is what
121
- * identifies an estate, so `serverUrl` is the seed unless `seed` overrides it -
122
- * which a host does when the port moves between runs or the estate answers on a
123
- * second hostname.
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
  /**
@@ -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. A target that points at
12
- * `http://localhost:5000` and a target that points at `http://127.0.0.1:5000` are
13
- * the same estate spelled two ways, so the address is normalised before it is
14
- * hashed - and `seed` exists for the two cases where the address is the wrong
15
- * identity: the estate reached by a different hostname (a container name, a LAN
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
- * Absent both, every emulated estate shares one seed. That is the only honest
19
- * default: an emulator with no address has not told us which estate it is.
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
- * `seed` wins over the address when both are present: it is the override a host
81
- * reaches for when the address disagrees with the estate, not a second opinion
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;;;;;;;;;;;;;;;;;;;GAmBG;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;KACl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AA"}
@@ -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. A target that points at
12
- * `http://localhost:5000` and a target that points at `http://127.0.0.1:5000` are
13
- * the same estate spelled two ways, so the address is normalised before it is
14
- * hashed - and `seed` exists for the two cases where the address is the wrong
15
- * identity: the estate reached by a different hostname (a container name, a LAN
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
- * Absent both, every emulated estate shares one seed. That is the only honest
19
- * default: an emulator with no address has not told us which estate it is.
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
- * `seed` wins over the address when both are present: it is the override a host
82
- * reaches for when the address disagrees with the estate, not a second opinion
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sasjs/api",
3
- "version": "0.47.0",
3
+ "version": "0.48.0",
4
4
  "description": "The SASjs Server API, described once - a generated route table, the services behind it, and the conformance corpus both hosts run",
5
5
  "license": "MIT",
6
6
  "author": "SASjs",