@simulacrum/auth0-simulator
Version:
Run local instance of Auth0 API for local development and integration testing
26 lines • 1.56 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.defaultUser = exports.auth0UserSchema = exports.simulation = void 0;
const foundation_simulator_1 = require("@simulacrum/foundation-simulator");
const index_ts_1 = require("./store/index.js");
const index_ts_2 = require("./handlers/index.js");
const entities_ts_1 = require("./store/entities.js");
const get_config_ts_1 = require("./config/get-config.js");
const simulation = (args = {}) => {
var _a;
const config = (0, get_config_ts_1.getConfig)(args.options);
const parsedInitialState = !(args === null || args === void 0 ? void 0 : args.initialState)
? undefined
: entities_ts_1.auth0InitialStoreSchema.parse(args === null || args === void 0 ? void 0 : args.initialState);
return (0, foundation_simulator_1.createFoundationSimulationServer)({
port: 4400, // default port
protocol: "https",
extendStore: (0, index_ts_1.extendStore)(parsedInitialState, (_a = args === null || args === void 0 ? void 0 : args.extend) === null || _a === void 0 ? void 0 : _a.extendStore),
extendRouter: (0, index_ts_2.extendRouter)(config),
})();
};
exports.simulation = simulation;
var entities_ts_2 = require("./store/entities.js");
Object.defineProperty(exports, "auth0UserSchema", { enumerable: true, get: function () { return entities_ts_2.auth0UserSchema; } });
Object.defineProperty(exports, "defaultUser", { enumerable: true, get: function () { return entities_ts_2.defaultUser; } });
//# sourceMappingURL=index.js.map