@simulacrum/auth0-simulator 0.11.1 → 0.11.2

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/index.cjs CHANGED
@@ -91,24 +91,29 @@ const inputSchema = (initialState, extendedSchema) => ({ slice: slice$3 }) => {
91
91
  ...extended
92
92
  };
93
93
  };
94
- const inputActions = (args) => {
94
+ const inputActions = (_args) => {
95
95
  return {};
96
96
  };
97
97
  const extendActions = (extendedActions) => (args) => {
98
- return extendedActions ? {
99
- ...inputActions(args),
100
- ...extendedActions(args)
101
- } : inputActions(args);
98
+ const base = inputActions(args);
99
+ if (!extendedActions) return base;
100
+ const extResult = extendedActions(args);
101
+ return {
102
+ ...base,
103
+ ...extResult
104
+ };
102
105
  };
103
- const inputSelectors = (args) => {
104
- const { createSelector, schema } = args;
106
+ const inputSelectors = (_args) => {
105
107
  return {};
106
108
  };
107
109
  const extendSelectors = (extendedSelectors) => (args) => {
108
- return extendedSelectors ? {
109
- ...inputSelectors(args),
110
- ...extendedSelectors(args)
111
- } : inputSelectors(args);
110
+ const base = inputSelectors(args);
111
+ if (!extendedSelectors) return base;
112
+ const extResult = extendedSelectors(args);
113
+ return {
114
+ ...base,
115
+ ...extResult
116
+ };
112
117
  };
113
118
  const extendStore = (initialState, extended) => ({
114
119
  actions: extendActions(extended?.actions),
@@ -187,8 +192,7 @@ var require_depd = /* @__PURE__ */ __commonJS({ "../../node_modules/depd/index.j
187
192
  */
188
193
  function depd(namespace) {
189
194
  if (!namespace) throw new TypeError("argument namespace is required");
190
- var stack = getStack();
191
- var file = callSiteLocation(stack[1])[0];
195
+ var file = callSiteLocation(getStack()[1])[0];
192
196
  function deprecate$3(message) {
193
197
  log$1.call(deprecate$3, message);
194
198
  }
@@ -220,16 +224,14 @@ var require_depd = /* @__PURE__ */ __commonJS({ "../../node_modules/depd/index.j
220
224
  */
221
225
  function isignored(namespace) {
222
226
  if (process.noDeprecation) return true;
223
- var str = process.env.NO_DEPRECATION || "";
224
- return containsNamespace(str, namespace);
227
+ return containsNamespace(process.env.NO_DEPRECATION || "", namespace);
225
228
  }
226
229
  /**
227
230
  * Determine if namespace is traced.
228
231
  */
229
232
  function istraced(namespace) {
230
233
  if (process.traceDeprecation) return true;
231
- var str = process.env.TRACE_DEPRECATION || "";
232
- return containsNamespace(str, namespace);
234
+ return containsNamespace(process.env.TRACE_DEPRECATION || "", namespace);
233
235
  }
234
236
  /**
235
237
  * Display deprecation message.
@@ -362,8 +364,7 @@ var require_depd = /* @__PURE__ */ __commonJS({ "../../node_modules/depd/index.j
362
364
  function wrapfunction(fn, message) {
363
365
  if (typeof fn !== "function") throw new TypeError("argument fn must be a function");
364
366
  var args = createArgumentsString(fn.length);
365
- var stack = getStack();
366
- var site = callSiteLocation(stack[1]);
367
+ var site = callSiteLocation(getStack()[1]);
367
368
  site.name = fn.name;
368
369
  return new Function("fn", "log", "deprecate", "message", "site", "\"use strict\"\nreturn function (" + args + ") {log.call(deprecate, message, site)\nreturn fn.apply(this, arguments)\n}")(fn, log$1, this, message, site);
369
370
  }
@@ -376,8 +377,7 @@ var require_depd = /* @__PURE__ */ __commonJS({ "../../node_modules/depd/index.j
376
377
  if (!descriptor) throw new TypeError("must call property on owner object");
377
378
  if (!descriptor.configurable) throw new TypeError("property must be configurable");
378
379
  var deprecate$3 = this;
379
- var stack = getStack();
380
- var site = callSiteLocation(stack[1]);
380
+ var site = callSiteLocation(getStack()[1]);
381
381
  site.name = prop;
382
382
  if ("value" in descriptor) descriptor = convertDataDescriptorToAccessor(obj, prop, message);
383
383
  var get = descriptor.get;
@@ -1436,7 +1436,7 @@ var require_supports_color = /* @__PURE__ */ __commonJS({ "../../node_modules/su
1436
1436
  "GITLAB_CI",
1437
1437
  "GITHUB_ACTIONS",
1438
1438
  "BUILDKITE"
1439
- ].some((sign$3) => sign$3 in env) || env.CI_NAME === "codeship") return 1;
1439
+ ].some((sign$2) => sign$2 in env) || env.CI_NAME === "codeship") return 1;
1440
1440
  return min$1;
1441
1441
  }
1442
1442
  if ("TEAMCITY_VERSION" in env) return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
@@ -1454,8 +1454,7 @@ var require_supports_color = /* @__PURE__ */ __commonJS({ "../../node_modules/su
1454
1454
  return min$1;
1455
1455
  }
1456
1456
  function getSupportLevel(stream) {
1457
- const level = supportsColor(stream, stream && stream.isTTY);
1458
- return translateLevel(level);
1457
+ return translateLevel(supportsColor(stream, stream && stream.isTTY));
1459
1458
  }
1460
1459
  module.exports = {
1461
1460
  supportsColor: getSupportLevel,
@@ -10952,10 +10951,7 @@ var require_raw_body = /* @__PURE__ */ __commonJS({ "../../node_modules/raw-body
10952
10951
  received,
10953
10952
  type: "request.size.invalid"
10954
10953
  }));
10955
- else {
10956
- var string = decoder ? buffer$2 + (decoder.end() || "") : Buffer.concat(buffer$2);
10957
- done(null, string);
10958
- }
10954
+ else done(null, decoder ? buffer$2 + (decoder.end() || "") : Buffer.concat(buffer$2));
10959
10955
  }
10960
10956
  function cleanup() {
10961
10957
  buffer$2 = null;
@@ -27555,8 +27551,7 @@ var require_mimeScore = /* @__PURE__ */ __commonJS({ "../../node_modules/mime-ty
27555
27551
  module.exports = function mimeScore$1(mimeType, source = "default") {
27556
27552
  if (mimeType === "application/octet-stream") return 0;
27557
27553
  const [type, subtype] = mimeType.split("/");
27558
- const facet = subtype.replace(/(\.|x-).*/, "$1");
27559
- const facetScore = FACET_SCORES[facet] || FACET_SCORES.default;
27554
+ const facetScore = FACET_SCORES[subtype.replace(/(\.|x-).*/, "$1")] || FACET_SCORES.default;
27560
27555
  const sourceScore = SOURCE_SCORES[source] || SOURCE_SCORES.default;
27561
27556
  const typeScore = TYPE_SCORES[type] || TYPE_SCORES.default;
27562
27557
  const lengthScore = 1 - mimeType.length / 100;
@@ -27670,9 +27665,7 @@ var require_mime_types = /* @__PURE__ */ __commonJS({ "../../node_modules/mime-t
27670
27665
  });
27671
27666
  }
27672
27667
  function _preferredType(ext, type0, type1) {
27673
- var score0 = type0 ? mimeScore(type0, db[type0].source) : 0;
27674
- var score1 = type1 ? mimeScore(type1, db[type1].source) : 0;
27675
- return score0 > score1 ? type0 : type1;
27668
+ return (type0 ? mimeScore(type0, db[type0].source) : 0) > (type1 ? mimeScore(type1, db[type1].source) : 0) ? type0 : type1;
27676
27669
  }
27677
27670
  function _preferredTypeLegacy(ext, type0, type1) {
27678
27671
  var SOURCE_RANK = [
@@ -27999,12 +27992,11 @@ var require_utils$2 = /* @__PURE__ */ __commonJS({ "../../node_modules/body-pars
27999
27992
  var type = options?.type || defaultType;
28000
27993
  var verify = options?.verify || false;
28001
27994
  if (verify !== false && typeof verify !== "function") throw new TypeError("option verify must be function");
28002
- var shouldParse = typeof type !== "function" ? typeChecker(type) : type;
28003
27995
  return {
28004
27996
  inflate,
28005
27997
  limit: limit$1,
28006
27998
  verify,
28007
- shouldParse
27999
+ shouldParse: typeof type !== "function" ? typeChecker(type) : type
28008
28000
  };
28009
28001
  }
28010
28002
  }) });
@@ -28263,9 +28255,8 @@ var require_text = /* @__PURE__ */ __commonJS({ "../../node_modules/body-parser/
28263
28255
  next();
28264
28256
  return;
28265
28257
  }
28266
- var charset$1 = getCharset$1(req$2) || defaultCharset;
28267
28258
  read$1(req$2, res$2, next, parse$12, debug$8, {
28268
- encoding: charset$1,
28259
+ encoding: getCharset$1(req$2) || defaultCharset,
28269
28260
  inflate,
28270
28261
  limit: limit$1,
28271
28262
  verify
@@ -28459,8 +28450,7 @@ var require_object_inspect = /* @__PURE__ */ __commonJS({ "../../node_modules/ob
28459
28450
  return String(obj);
28460
28451
  };
28461
28452
  function wrapQuotes(s$1, defaultStyle, opts) {
28462
- var style = opts.quoteStyle || defaultStyle;
28463
- var quoteChar = quotes[style];
28453
+ var quoteChar = quotes[opts.quoteStyle || defaultStyle];
28464
28454
  return quoteChar + s$1 + quoteChar;
28465
28455
  }
28466
28456
  function quote(s$1) {
@@ -28601,8 +28591,7 @@ var require_object_inspect = /* @__PURE__ */ __commonJS({ "../../node_modules/ob
28601
28591
  }
28602
28592
  var quoteRE = quoteREs[opts.quoteStyle || "single"];
28603
28593
  quoteRE.lastIndex = 0;
28604
- var s$1 = $replace$1.call($replace$1.call(str, quoteRE, "\\$1"), /[\x00-\x1f]/g, lowbyte);
28605
- return wrapQuotes(s$1, "single", opts);
28594
+ return wrapQuotes($replace$1.call($replace$1.call(str, quoteRE, "\\$1"), /[\x00-\x1f]/g, lowbyte), "single", opts);
28606
28595
  }
28607
28596
  function lowbyte(c) {
28608
28597
  var n = c.charCodeAt(0);
@@ -28854,7 +28843,7 @@ var require_isNaN = /* @__PURE__ */ __commonJS({ "../../node_modules/math-intrin
28854
28843
  var require_sign = /* @__PURE__ */ __commonJS({ "../../node_modules/math-intrinsics/sign.js": ((exports, module) => {
28855
28844
  var $isNaN = require_isNaN();
28856
28845
  /** @type {import('./sign')} */
28857
- module.exports = function sign$3(number) {
28846
+ module.exports = function sign$2(number) {
28858
28847
  if ($isNaN(number) || number === 0) return number;
28859
28848
  return number < 0 ? -1 : 1;
28860
28849
  };
@@ -29124,7 +29113,7 @@ var require_get_intrinsic = /* @__PURE__ */ __commonJS({ "../../node_modules/get
29124
29113
  var min = require_min();
29125
29114
  var pow = require_pow();
29126
29115
  var round = require_round();
29127
- var sign$2 = require_sign();
29116
+ var sign$1 = require_sign();
29128
29117
  var $Function = Function;
29129
29118
  var getEvalledConstructor = function(expressionSyntax) {
29130
29119
  try {
@@ -29236,7 +29225,7 @@ var require_get_intrinsic = /* @__PURE__ */ __commonJS({ "../../node_modules/get
29236
29225
  "%Math.min%": min,
29237
29226
  "%Math.pow%": pow,
29238
29227
  "%Math.round%": round,
29239
- "%Math.sign%": sign$2,
29228
+ "%Math.sign%": sign$1,
29240
29229
  "%Reflect.getPrototypeOf%": $ReflectGPO
29241
29230
  };
29242
29231
  if (getProto) try {
@@ -29866,10 +29855,7 @@ var require_stringify = /* @__PURE__ */ __commonJS({ "../../node_modules/qs/lib/
29866
29855
  obj = "";
29867
29856
  }
29868
29857
  if (isNonNullishPrimitive(obj) || utils$1.isBuffer(obj)) {
29869
- if (encoder) {
29870
- var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults$1.encoder, charset$1, "key", format$4);
29871
- return [formatter(keyValue) + "=" + formatter(encoder(obj, defaults$1.encoder, charset$1, "value", format$4))];
29872
- }
29858
+ if (encoder) return [formatter(encodeValuesOnly ? prefix : encoder(prefix, defaults$1.encoder, charset$1, "key", format$4)) + "=" + formatter(encoder(obj, defaults$1.encoder, charset$1, "value", format$4))];
29873
29859
  return [formatter(prefix) + "=" + formatter(String(obj))];
29874
29860
  }
29875
29861
  var values = [];
@@ -32239,8 +32225,7 @@ var require_utils = /* @__PURE__ */ __commonJS({ "../../node_modules/express/lib
32239
32225
  */
32240
32226
  function createETagGenerator(options) {
32241
32227
  return function generateETag(body, encoding) {
32242
- var buf = !Buffer.isBuffer(body) ? Buffer.from(body, encoding) : body;
32243
- return etag$1(buf, options);
32228
+ return etag$1(!Buffer.isBuffer(body) ? Buffer.from(body, encoding) : body, options);
32244
32229
  };
32245
32230
  }
32246
32231
  /**
@@ -32496,8 +32481,7 @@ var require_dist = /* @__PURE__ */ __commonJS({ "../../node_modules/path-to-rege
32496
32481
  */
32497
32482
  function compile(path$7, options = {}) {
32498
32483
  const { encode: encode$5 = encodeURIComponent, delimiter = DEFAULT_DELIMITER } = options;
32499
- const data = typeof path$7 === "object" ? path$7 : parse$4(path$7, options);
32500
- const fn = tokensToFunction(data.tokens, delimiter, encode$5);
32484
+ const fn = tokensToFunction((typeof path$7 === "object" ? path$7 : parse$4(path$7, options)).tokens, delimiter, encode$5);
32501
32485
  return function path$8(params = {}) {
32502
32486
  const [path$9, ...missing] = fn(params);
32503
32487
  if (missing.length) throw new TypeError(`Missing parameters: ${missing.join(", ")}`);
@@ -33037,7 +33021,7 @@ var require_router = /* @__PURE__ */ __commonJS({ "../../node_modules/router/ind
33037
33021
  /**
33038
33022
  * Expose `Router`.
33039
33023
  */
33040
- module.exports = Router$2;
33024
+ module.exports = Router$3;
33041
33025
  /**
33042
33026
  * Expose `Route`.
33043
33027
  */
@@ -33049,8 +33033,8 @@ var require_router = /* @__PURE__ */ __commonJS({ "../../node_modules/router/ind
33049
33033
  * @return {Router} which is a callable function
33050
33034
  * @public
33051
33035
  */
33052
- function Router$2(options) {
33053
- if (!(this instanceof Router$2)) return new Router$2(options);
33036
+ function Router$3(options) {
33037
+ if (!(this instanceof Router$3)) return new Router$3(options);
33054
33038
  const opts = options || {};
33055
33039
  function router(req$2, res$2, next) {
33056
33040
  router.handle(req$2, res$2, next);
@@ -33067,7 +33051,7 @@ var require_router = /* @__PURE__ */ __commonJS({ "../../node_modules/router/ind
33067
33051
  * Router prototype inherits from a Function.
33068
33052
  */
33069
33053
  /* istanbul ignore next */
33070
- Router$2.prototype = function() {};
33054
+ Router$3.prototype = function() {};
33071
33055
  /**
33072
33056
  * Map the given param placeholder `name`(s) to the given callback.
33073
33057
  *
@@ -33100,7 +33084,7 @@ var require_router = /* @__PURE__ */ __commonJS({ "../../node_modules/router/ind
33100
33084
  * @param {function} fn
33101
33085
  * @public
33102
33086
  */
33103
- Router$2.prototype.param = function param(name, fn) {
33087
+ Router$3.prototype.param = function param(name, fn) {
33104
33088
  if (!name) throw new TypeError("argument name is required");
33105
33089
  if (typeof name !== "string") throw new TypeError("argument name must be a string");
33106
33090
  if (!fn) throw new TypeError("argument fn is required");
@@ -33115,7 +33099,7 @@ var require_router = /* @__PURE__ */ __commonJS({ "../../node_modules/router/ind
33115
33099
  *
33116
33100
  * @private
33117
33101
  */
33118
- Router$2.prototype.handle = function handle(req$2, res$2, callback) {
33102
+ Router$3.prototype.handle = function handle(req$2, res$2, callback) {
33119
33103
  if (!callback) throw new TypeError("argument callback is required");
33120
33104
  debug$2("dispatching %s %s", req$2.method, req$2.url);
33121
33105
  let idx = 0;
@@ -33229,7 +33213,7 @@ var require_router = /* @__PURE__ */ __commonJS({ "../../node_modules/router/ind
33229
33213
  *
33230
33214
  * @public
33231
33215
  */
33232
- Router$2.prototype.use = function use(handler) {
33216
+ Router$3.prototype.use = function use(handler) {
33233
33217
  let offset = 0;
33234
33218
  let path$7 = "/";
33235
33219
  if (typeof handler !== "function") {
@@ -33268,7 +33252,7 @@ var require_router = /* @__PURE__ */ __commonJS({ "../../node_modules/router/ind
33268
33252
  * @return {Route}
33269
33253
  * @public
33270
33254
  */
33271
- Router$2.prototype.route = function route(path$7) {
33255
+ Router$3.prototype.route = function route(path$7) {
33272
33256
  const route$1 = new Route(path$7);
33273
33257
  const layer = new Layer(path$7, {
33274
33258
  sensitive: this.caseSensitive,
@@ -33283,7 +33267,7 @@ var require_router = /* @__PURE__ */ __commonJS({ "../../node_modules/router/ind
33283
33267
  return route$1;
33284
33268
  };
33285
33269
  methods$1.concat("all").forEach(function(method) {
33286
- Router$2.prototype[method] = function(path$7) {
33270
+ Router$3.prototype[method] = function(path$7) {
33287
33271
  const route = this.route(path$7);
33288
33272
  route[method].apply(route, slice$1.call(arguments, 1));
33289
33273
  return this;
@@ -33494,7 +33478,7 @@ var require_application = /* @__PURE__ */ __commonJS({ "../../node_modules/expre
33494
33478
  var compileTrust = require_utils().compileTrust;
33495
33479
  var resolve$3 = require("node:path").resolve;
33496
33480
  var once = require_once();
33497
- var Router$1 = require_router();
33481
+ var Router$2 = require_router();
33498
33482
  /**
33499
33483
  * Module variables.
33500
33484
  * @private
@@ -33529,7 +33513,7 @@ var require_application = /* @__PURE__ */ __commonJS({ "../../node_modules/expre
33529
33513
  configurable: true,
33530
33514
  enumerable: true,
33531
33515
  get: function getrouter() {
33532
- if (router === null) router = new Router$1({
33516
+ if (router === null) router = new Router$2({
33533
33517
  caseSensitive: this.enabled("case sensitive routing"),
33534
33518
  strict: this.enabled("strict routing")
33535
33519
  });
@@ -35473,9 +35457,7 @@ var require_content_disposition = /* @__PURE__ */ __commonJS({ "../../node_modul
35473
35457
  */
35474
35458
  function contentDisposition$1(filename, options) {
35475
35459
  var opts = options || {};
35476
- var type = opts.type || "attachment";
35477
- var params = createparams(filename, opts.fallback);
35478
- return format(new ContentDisposition(type, params));
35460
+ return format(new ContentDisposition(opts.type || "attachment", createparams(filename, opts.fallback)));
35479
35461
  }
35480
35462
  /**
35481
35463
  * Create parameters object from filename and fallback.
@@ -35800,8 +35782,7 @@ var require_cookie = /* @__PURE__ */ __commonJS({ "../../node_modules/cookie/ind
35800
35782
  valStartIdx++;
35801
35783
  valEndIdx--;
35802
35784
  }
35803
- var val = str.slice(valStartIdx, valEndIdx);
35804
- obj[key$1] = tryDecode(val, dec);
35785
+ obj[key$1] = tryDecode(str.slice(valStartIdx, valEndIdx), dec);
35805
35786
  }
35806
35787
  index = endIdx + 1;
35807
35788
  } while (index < len);
@@ -36033,8 +36014,7 @@ var require_send = /* @__PURE__ */ __commonJS({ "../../node_modules/send/index.j
36033
36014
  SendStream.prototype.error = function error(status$2, err) {
36034
36015
  if (hasListeners(this, "error")) return this.emit("error", createHttpError(status$2, err));
36035
36016
  var res$2 = this.res;
36036
- var msg = statuses$1.message[status$2] || String(status$2);
36037
- var doc = createHtmlDocument$1("Error", escapeHtml$2(msg));
36017
+ var doc = createHtmlDocument$1("Error", escapeHtml$2(statuses$1.message[status$2] || String(status$2)));
36038
36018
  clearHeaders(res$2);
36039
36019
  if (err && err.headers) setHeaders(res$2, err.headers);
36040
36020
  res$2.statusCode = status$2;
@@ -36174,8 +36154,7 @@ var require_send = /* @__PURE__ */ __commonJS({ "../../node_modules/send/index.j
36174
36154
  var etag$3 = this.res.getHeader("ETag");
36175
36155
  return Boolean(etag$3 && ifRange.indexOf(etag$3) !== -1);
36176
36156
  }
36177
- var lastModified = this.res.getHeader("Last-Modified");
36178
- return parseHttpDate(lastModified) <= parseHttpDate(ifRange);
36157
+ return parseHttpDate(this.res.getHeader("Last-Modified")) <= parseHttpDate(ifRange);
36179
36158
  };
36180
36159
  /**
36181
36160
  * Redirect to path.
@@ -36690,8 +36669,7 @@ var require_vary = /* @__PURE__ */ __commonJS({ "../../node_modules/vary/index.j
36690
36669
  function vary$1(res$2, field) {
36691
36670
  if (!res$2 || !res$2.getHeader || !res$2.setHeader) throw new TypeError("res argument is required");
36692
36671
  var val = res$2.getHeader("Vary") || "";
36693
- var header = Array.isArray(val) ? val.join(", ") : String(val);
36694
- if (val = append(header, field)) res$2.setHeader("Vary", val);
36672
+ if (val = append(Array.isArray(val) ? val.join(", ") : String(val), field)) res$2.setHeader("Vary", val);
36695
36673
  }
36696
36674
  }) });
36697
36675
 
@@ -36712,7 +36690,7 @@ var require_response = /* @__PURE__ */ __commonJS({ "../../node_modules/express/
36712
36690
  var path$4 = require("node:path");
36713
36691
  var pathIsAbsolute = require("node:path").isAbsolute;
36714
36692
  var statuses = require_statuses();
36715
- var sign$1 = require_cookie_signature().sign;
36693
+ var sign = require_cookie_signature().sign;
36716
36694
  var normalizeType = require_utils().normalizeType;
36717
36695
  var normalizeTypes = require_utils().normalizeTypes;
36718
36696
  var setCharset = require_utils().setCharset;
@@ -36860,9 +36838,7 @@ var require_response = /* @__PURE__ */ __commonJS({ "../../node_modules/express/
36860
36838
  res$1.json = function json$1(obj) {
36861
36839
  var app$1 = this.app;
36862
36840
  var escape$2 = app$1.get("json escape");
36863
- var replacer = app$1.get("json replacer");
36864
- var spaces = app$1.get("json spaces");
36865
- var body = stringify$2(obj, replacer, spaces, escape$2);
36841
+ var body = stringify$2(obj, app$1.get("json replacer"), app$1.get("json spaces"), escape$2);
36866
36842
  if (!this.get("Content-Type")) this.set("Content-Type", "application/json");
36867
36843
  return this.send(body);
36868
36844
  };
@@ -36880,9 +36856,7 @@ var require_response = /* @__PURE__ */ __commonJS({ "../../node_modules/express/
36880
36856
  res$1.jsonp = function jsonp(obj) {
36881
36857
  var app$1 = this.app;
36882
36858
  var escape$2 = app$1.get("json escape");
36883
- var replacer = app$1.get("json replacer");
36884
- var spaces = app$1.get("json spaces");
36885
- var body = stringify$2(obj, replacer, spaces, escape$2);
36859
+ var body = stringify$2(obj, app$1.get("json replacer"), app$1.get("json spaces"), escape$2);
36886
36860
  var callback = this.req.query[app$1.get("jsonp callback name")];
36887
36861
  if (!this.get("Content-Type")) {
36888
36862
  this.set("X-Content-Type-Options", "nosniff");
@@ -36974,8 +36948,7 @@ var require_response = /* @__PURE__ */ __commonJS({ "../../node_modules/express/
36974
36948
  if (!opts.root && !pathIsAbsolute(path$7)) throw new TypeError("path must be absolute or specify root to res.sendFile");
36975
36949
  var pathname = encodeURI(path$7);
36976
36950
  opts.etag = this.app.enabled("etag");
36977
- var file = send$1(req$2, pathname, opts);
36978
- sendfile(res$2, file, opts, function(err) {
36951
+ sendfile(res$2, send$1(req$2, pathname, opts), opts, function(err) {
36979
36952
  if (done) return done(err);
36980
36953
  if (err && err.code === "EISDIR") return next();
36981
36954
  if (err && err.code !== "ECONNABORTED" && err.syscall !== "write") next(err);
@@ -37241,7 +37214,7 @@ var require_response = /* @__PURE__ */ __commonJS({ "../../node_modules/express/
37241
37214
  var signed = opts.signed;
37242
37215
  if (signed && !secret) throw new Error("cookieParser(\"secret\") required for signed cookies");
37243
37216
  var val = typeof value === "object" ? "j:" + JSON.stringify(value) : String(value);
37244
- if (signed) val = "s:" + sign$1(val, secret);
37217
+ if (signed) val = "s:" + sign(val, secret);
37245
37218
  if (opts.maxAge != null) {
37246
37219
  var maxAge = opts.maxAge - 0;
37247
37220
  if (!isNaN(maxAge)) {
@@ -37567,7 +37540,7 @@ var require_express$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/express
37567
37540
  var EventEmitter = require("node:events").EventEmitter;
37568
37541
  var mixin = require_merge_descriptors();
37569
37542
  var proto = require_application();
37570
- var Router = require_router();
37543
+ var Router$1 = require_router();
37571
37544
  var req = require_request();
37572
37545
  var res = require_response();
37573
37546
  /**
@@ -37610,8 +37583,8 @@ var require_express$1 = /* @__PURE__ */ __commonJS({ "../../node_modules/express
37610
37583
  /**
37611
37584
  * Expose constructors.
37612
37585
  */
37613
- exports.Route = Router.Route;
37614
- exports.Router = Router;
37586
+ exports.Route = Router$1.Route;
37587
+ exports.Router = Router$1;
37615
37588
  /**
37616
37589
  * Expose middleware
37617
37590
  */
@@ -38183,7 +38156,7 @@ function createJsonWebToken(payload, privateKey = parseKey(PRIVATE_KEY), options
38183
38156
  algorithm: "RS256",
38184
38157
  keyid: JWKS.keys[0].kid
38185
38158
  }) {
38186
- return (0, jsonwebtoken.sign)(payload, privateKey, options);
38159
+ return jsonwebtoken.sign(payload, privateKey, options);
38187
38160
  }
38188
38161
 
38189
38162
  //#endregion
@@ -38417,7 +38390,13 @@ const verifyUserExistsInStore = ({ simulationStore, body, grant_type }) => {
38417
38390
  //#endregion
38418
38391
  //#region src/views/username-password.ts
38419
38392
  const userNamePasswordForm = ({ auth0Domain = "/login/callback", redirect_uri, state, nonce, client_id, scope, audience, connection, response_type, tenant }) => {
38420
- let wctx = (0, html_entities.encode)(JSON.stringify({
38393
+ return `
38394
+ <form method="post" name="hiddenform" action="${auth0Domain}">
38395
+ <input type="hidden" name="wa" value="wsignin1.0">
38396
+ <input type="hidden"
38397
+ name="wresult"
38398
+ value="eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJ1c2VyX2lkIjoiNjA1MzhjYWQ2YWI5ODQwMDY5OWIxZDZhIiwiZW1haWwiOiJpbXJhbi5zdWxlbWFuamlAcmVzaWRlby5jb20iLCJlbWFpbF92ZXJpZmllZCI6ZmFsc2UsInNpZCI6Im5zSHZTQ0lYT2NGSUZINUIyRzdVdUFEWDVQTlR4cmRPIiwiaWF0IjoxNjE2MTU0ODA0LCJleHAiOjE2MTYxNTQ4NjQsImF1ZCI6InVybjphdXRoMDpyZXNpZGVvOlVzZXJuYW1lLVBhc3N3b3JkLUF1dGhlbnRpY2F0aW9uIiwiaXNzIjoidXJuOmF1dGgwIn0.CTl0A1hDc4YrErsrFBCCEG0ekIUU3bv0x12p_vUgoyD6zOg_QhaSZjKeZI2elaeYnAi7KUcohgOP9TApj3VlQtm6GlGNuWIiQke4866FtfhufGo2_uLBWyf4nmOgbNcmhpIg2bvVJHUqM-6OCNfnzPWAoFW2_g-DeIo20WBfK2E">
38399
+ <input type="hidden" name="wctx" value="${(0, html_entities.encode)(JSON.stringify({
38421
38400
  strategy: "auth0",
38422
38401
  tenant,
38423
38402
  connection,
@@ -38429,14 +38408,7 @@ const userNamePasswordForm = ({ auth0Domain = "/login/callback", redirect_uri, s
38429
38408
  nonce,
38430
38409
  audience,
38431
38410
  realm: connection
38432
- }));
38433
- return `
38434
- <form method="post" name="hiddenform" action="${auth0Domain}">
38435
- <input type="hidden" name="wa" value="wsignin1.0">
38436
- <input type="hidden"
38437
- name="wresult"
38438
- value="eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJ1c2VyX2lkIjoiNjA1MzhjYWQ2YWI5ODQwMDY5OWIxZDZhIiwiZW1haWwiOiJpbXJhbi5zdWxlbWFuamlAcmVzaWRlby5jb20iLCJlbWFpbF92ZXJpZmllZCI6ZmFsc2UsInNpZCI6Im5zSHZTQ0lYT2NGSUZINUIyRzdVdUFEWDVQTlR4cmRPIiwiaWF0IjoxNjE2MTU0ODA0LCJleHAiOjE2MTYxNTQ4NjQsImF1ZCI6InVybjphdXRoMDpyZXNpZGVvOlVzZXJuYW1lLVBhc3N3b3JkLUF1dGhlbnRpY2F0aW9uIiwiaXNzIjoidXJuOmF1dGgwIn0.CTl0A1hDc4YrErsrFBCCEG0ekIUU3bv0x12p_vUgoyD6zOg_QhaSZjKeZI2elaeYnAi7KUcohgOP9TApj3VlQtm6GlGNuWIiQke4866FtfhufGo2_uLBWyf4nmOgbNcmhpIg2bvVJHUqM-6OCNfnzPWAoFW2_g-DeIo20WBfK2E">
38439
- <input type="hidden" name="wctx" value="${wctx}">
38411
+ }))}">
38440
38412
  <noscript>
38441
38413
  <p>
38442
38414
  Script is disabled. Click Submit to continue.
@@ -38540,12 +38512,10 @@ const createAuth0Handlers = (simulationStore, serviceURL, options, debug$11) =>
38540
38512
  } });
38541
38513
  let { redirect_uri, nonce } = wctx;
38542
38514
  const { username } = simulationStore.schema.sessions.selectById(simulationStore.store.getState(), { id: nonce }) ?? {};
38543
- let encodedNonce = (0, base64_url.encode)(`${nonce}:${username}`);
38544
- let qs$2 = (0, querystring.stringify)({
38545
- code: encodedNonce,
38515
+ let routerUrl = `${redirect_uri}?${(0, querystring.stringify)({
38516
+ code: (0, base64_url.encode)(`${nonce}:${username}`),
38546
38517
  ...wctx
38547
- });
38548
- let routerUrl = `${redirect_uri}?${qs$2}`;
38518
+ })}`;
38549
38519
  res$2.redirect(302, routerUrl);
38550
38520
  },
38551
38521
  ["/oauth/token"]: async function(req$2, res$2, next) {
@@ -38608,7 +38578,7 @@ const createAuth0Handlers = (simulationStore, serviceURL, options, debug$11) =>
38608
38578
  ["/passwordless/start"]: function(req$2, res$2, next) {
38609
38579
  logger.log({ "/passwordless/start": { body: req$2.body } });
38610
38580
  try {
38611
- const { client_id, connection, email, phone_number, send: send$4 } = req$2.body;
38581
+ const { client_id, connection, email, phone_number } = req$2.body;
38612
38582
  if (!client_id) {
38613
38583
  res$2.status(400).json({ error: "client_id is required" });
38614
38584
  return;
@@ -38697,11 +38667,13 @@ const configurationSchema = zod.z.object({
38697
38667
  //#endregion
38698
38668
  //#region src/handlers/index.ts
38699
38669
  const publicDir = path.default.join(__dirname, "..", "views", "public");
38700
- const extendRouter = (config, debug$11 = false) => (router, simulationStore) => {
38670
+ const extendRouter = (config, extend, debug$11 = false) => (router, simulationStore) => {
38701
38671
  const serviceURL = (request) => `${request.protocol}://${request.get("Host")}/`;
38702
38672
  const auth0 = createAuth0Handlers(simulationStore, serviceURL, config, debug$11);
38703
38673
  const openid = createOpenIdHandlers(serviceURL);
38704
- router.use(import_express.static(publicDir)).use(createSession()).use(createCors()).use(noCache()).get("/health", (_, response) => {
38674
+ router.use(import_express.static(publicDir)).use(createSession()).use(createCors()).use(noCache());
38675
+ if (extend) extend(router, simulationStore);
38676
+ router.get("/health", (_, response) => {
38705
38677
  response.send({ status: "ok" });
38706
38678
  }).get("/heartbeat", auth0["/heartbeat"]).get("/authorize", auth0["/authorize"]).get("/login", auth0["/login"]).get("/u/login", auth0["/usernamepassword/login"]).post("/usernamepassword/login", auth0["/usernamepassword/login"]).post("/login/callback", auth0["/login/callback"]).post("/oauth/token", auth0["/oauth/token"]).post("/passwordless/start", auth0["/passwordless/start"]).get("/userinfo", auth0["/userinfo"]).get("/v2/logout", auth0["/v2/logout"]).get("/.well-known/jwks.json", openid["/.well-known/jwks.json"]).get("/.well-known/openid-configuration", openid["/.well-known/openid-configuration"]);
38707
38679
  router.use(defaultErrorHandler);
@@ -38747,10 +38719,10 @@ const simulation = (args = {}) => {
38747
38719
  const config = getConfig(args.options);
38748
38720
  const parsedInitialState = !args?.initialState ? void 0 : auth0InitialStoreSchema.parse(args?.initialState);
38749
38721
  return (0, __simulacrum_foundation_simulator.createFoundationSimulationServer)({
38750
- port: 4400,
38722
+ port: config.port ?? 4400,
38751
38723
  protocol: "https",
38752
38724
  extendStore: extendStore(parsedInitialState, args?.extend?.extendStore),
38753
- extendRouter: extendRouter(config, args.debug)
38725
+ extendRouter: extendRouter(config, args.extend?.extendRouter, args.debug)
38754
38726
  })();
38755
38727
  };
38756
38728
 
package/dist/index.d.cts CHANGED
@@ -1,5 +1,6 @@
1
- import { AnyState, ExtendSimulationActions, ExtendSimulationSchema, ExtendSimulationSelectors, FoundationSimulator, SimulationHandlers, SimulationStore, TableOutput, createFoundationSimulationServer } from "@simulacrum/foundation-simulator";
1
+ import { AnyState, ExtendSimulationActions, ExtendSimulationSchema, ExtendSimulationSelectors, ExtendStoreConfig, FoundationSimulator, SimulationHandlers, SimulationStore, TableOutput } from "@simulacrum/foundation-simulator";
2
2
  import { z } from "zod";
3
+ import { Router } from "express";
3
4
 
4
5
  //#region src/store/entities.d.ts
5
6
  declare const auth0UserSchema: z.ZodEffects<z.ZodObject<{
@@ -105,9 +106,13 @@ type ExtendedSchema = ({
105
106
  };
106
107
  type ExtendActions = typeof inputActions;
107
108
  type ExtendSelectors = typeof inputSelectors;
108
- type ExtendedSimulationStore = SimulationStore<ReturnType<ExtendedSchema>, ReturnType<ExtendActions>, ReturnType<ExtendSelectors>>;
109
- declare const inputActions: (args: ExtendSimulationActions<ExtendedSchema>) => {};
110
- declare const inputSelectors: (args: ExtendSimulationSelectors<ExtendedSchema>) => {};
109
+ type Auth0Schema = ReturnType<ExtendedSchema>;
110
+ type Auth0Actions = ReturnType<ExtendActions>;
111
+ type Auth0Selectors = ReturnType<ExtendSelectors>;
112
+ type ExtendedSimulationStore = SimulationStore<Auth0Schema, Auth0Actions, Auth0Selectors>;
113
+ declare const inputActions: (_args: ExtendSimulationActions<ExtendedSchema>) => ExtendSimulationActions<ExtendedSchema>;
114
+ declare const inputSelectors: (_args: ExtendSimulationSelectors<ExtendedSchema>) => ExtendSimulationSelectors<ExtendedSchema>;
115
+ type Auth0ExtendStoreInput = ExtendStoreConfig<Auth0Schema, Auth0Actions, Auth0Selectors>;
111
116
  //#endregion
112
117
  //#region src/types.d.ts
113
118
  declare const configurationSchema: z.ZodObject<{
@@ -176,13 +181,12 @@ type Auth0Simulator = (args?: {
176
181
  debug?: boolean;
177
182
  initialState?: Auth0InitialStore;
178
183
  extend?: {
179
- extendStore?: SimulationInput["extendStore"];
184
+ extendStore?: Auth0ExtendStoreInput;
180
185
  openapiHandlers?: (simulationStore: ExtendedSimulationStore) => SimulationHandlers;
181
- extendRouter?: SimulationInput["extendRouter"];
186
+ extendRouter?: (router: Router, simulationStore: ExtendedSimulationStore) => void;
182
187
  };
183
188
  options?: Partial<Auth0Configuration>;
184
189
  }) => FoundationSimulator<ExtendedSimulationStore>;
185
- type SimulationInput = Parameters<typeof createFoundationSimulationServer>[0];
186
190
  declare const simulation: Auth0Simulator;
187
191
  //#endregion
188
192
  export { Auth0Simulator, auth0UserSchema, defaultUser, simulation };
@@ -1 +1 @@
1
- {"version":3,"file":"index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ectors, FoundationSimulator, SimulationHandlers, SimulationStore, TableOutput, createFoundationSimulationServer } from "@simulacrum/foundation-simulator";
1
+ import { AnyState, ExtendSimulationActions, ExtendSimulationSchema, ExtendSimulationSelectors, ExtendStoreConfig, FoundationSimulator, SimulationHandlers, SimulationStore, TableOutput } from "@simulacrum/foundation-simulator";
2
2
  import { z } from "zod";
3
+ import { Router } from "express";
3
4
 
4
5
  //#region src/store/entities.d.ts
5
6
  declare const auth0UserSchema: z.ZodEffects<z.ZodObject<{
@@ -105,9 +106,13 @@ type ExtendedSchema = ({
105
106
  };
106
107
  type ExtendActions = typeof inputActions;
107
108
  type ExtendSelectors = typeof inputSelectors;
108
- type ExtendedSimulationStore = SimulationStore<ReturnType<ExtendedSchema>, ReturnType<ExtendActions>, ReturnType<ExtendSelectors>>;
109
- declare const inputActions: (args: ExtendSimulationActions<ExtendedSchema>) => {};
110
- declare const inputSelectors: (args: ExtendSimulationSelectors<ExtendedSchema>) => {};
109
+ type Auth0Schema = ReturnType<ExtendedSchema>;
110
+ type Auth0Actions = ReturnType<ExtendActions>;
111
+ type Auth0Selectors = ReturnType<ExtendSelectors>;
112
+ type ExtendedSimulationStore = SimulationStore<Auth0Schema, Auth0Actions, Auth0Selectors>;
113
+ declare const inputActions: (_args: ExtendSimulationActions<ExtendedSchema>) => ExtendSimulationActions<ExtendedSchema>;
114
+ declare const inputSelectors: (_args: ExtendSimulationSelectors<ExtendedSchema>) => ExtendSimulationSelectors<ExtendedSchema>;
115
+ type Auth0ExtendStoreInput = ExtendStoreConfig<Auth0Schema, Auth0Actions, Auth0Selectors>;
111
116
  //#endregion
112
117
  //#region src/types.d.ts
113
118
  declare const configurationSchema: z.ZodObject<{
@@ -176,13 +181,12 @@ type Auth0Simulator = (args?: {
176
181
  debug?: boolean;
177
182
  initialState?: Auth0InitialStore;
178
183
  extend?: {
179
- extendStore?: SimulationInput["extendStore"];
184
+ extendStore?: Auth0ExtendStoreInput;
180
185
  openapiHandlers?: (simulationStore: ExtendedSimulationStore) => SimulationHandlers;
181
- extendRouter?: SimulationInput["extendRouter"];
186
+ extendRouter?: (router: Router, simulationStore: ExtendedSimulationStore) => void;
182
187
  };
183
188
  options?: Partial<Auth0Configuration>;
184
189
  }) => FoundationSimulator<ExtendedSimulationStore>;
185
- type SimulationInput = Parameters<typeof createFoundationSimulationServer>[0];
186
190
  declare const simulation: Auth0Simulator;
187
191
  //#endregion
188
192
  export { Auth0Simulator, auth0UserSchema, defaultUser, simulation };