@simulacrum/auth0-simulator 0.2.1 → 0.4.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.
Files changed (77) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/README.md +13 -9
  3. package/bin/index.js +2 -0
  4. package/dist/auth/date.js +1 -1
  5. package/dist/auth/date.js.map +1 -1
  6. package/dist/auth/jwt.d.ts +1 -1
  7. package/dist/auth/jwt.d.ts.map +1 -1
  8. package/dist/auth/jwt.js +5 -4
  9. package/dist/auth/jwt.js.map +1 -1
  10. package/dist/handlers/auth0-handlers.d.ts +1 -1
  11. package/dist/handlers/auth0-handlers.d.ts.map +1 -1
  12. package/dist/handlers/auth0-handlers.js +82 -31
  13. package/dist/handlers/auth0-handlers.js.map +1 -1
  14. package/dist/handlers/get-service-url.js +1 -1
  15. package/dist/handlers/get-service-url.js.map +1 -1
  16. package/dist/handlers/login-redirect.js +1 -1
  17. package/dist/handlers/login-redirect.js.map +1 -1
  18. package/dist/handlers/openid-handlers.js +2 -2
  19. package/dist/handlers/openid-handlers.js.map +1 -1
  20. package/dist/handlers/web-message.js +4 -4
  21. package/dist/handlers/web-message.js.map +1 -1
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/index.js +33 -28
  24. package/dist/index.js.map +1 -1
  25. package/dist/middleware/create-cors.js +1 -1
  26. package/dist/middleware/create-cors.js.map +1 -1
  27. package/dist/middleware/session.js +1 -1
  28. package/dist/middleware/session.js.map +1 -1
  29. package/dist/rules/parse-rules-files.js +2 -2
  30. package/dist/rules/parse-rules-files.js.map +1 -1
  31. package/dist/rules/rules-runner.js +3 -3
  32. package/dist/rules/rules-runner.js.map +1 -1
  33. package/dist/start.js +35 -3
  34. package/dist/start.js.map +1 -1
  35. package/dist/types.d.ts +21 -0
  36. package/dist/types.d.ts.map +1 -1
  37. package/dist/views/login.js +1 -1
  38. package/dist/views/username-password.js +1 -1
  39. package/dist/views/username-password.js.map +1 -1
  40. package/dist/views/web-message.js +1 -1
  41. package/dist/views/web-message.js.map +1 -1
  42. package/package.json +19 -13
  43. package/docs/create-simulation.png +0 -0
  44. package/docs/person.png +0 -0
  45. package/src/auth/constants.ts +0 -16
  46. package/src/auth/date.ts +0 -4
  47. package/src/auth/jwt.ts +0 -23
  48. package/src/handlers/auth0-handlers.ts +0 -219
  49. package/src/handlers/get-service-url.ts +0 -10
  50. package/src/handlers/login-redirect.ts +0 -37
  51. package/src/handlers/openid-handlers.ts +0 -39
  52. package/src/handlers/url.ts +0 -1
  53. package/src/handlers/web-message.ts +0 -31
  54. package/src/index.ts +0 -70
  55. package/src/middleware/create-cors.ts +0 -14
  56. package/src/middleware/no-cache.ts +0 -7
  57. package/src/middleware/session.ts +0 -14
  58. package/src/rules/extensionless-file-name.ts +0 -4
  59. package/src/rules/parse-rules-files.ts +0 -40
  60. package/src/rules/rules-runner.ts +0 -72
  61. package/src/rules/types.ts +0 -25
  62. package/src/start.ts +0 -19
  63. package/src/types.ts +0 -29
  64. package/src/views/login.ts +0 -107
  65. package/src/views/public/img/frontside-logo.png +0 -0
  66. package/src/views/username-password.ts +0 -54
  67. package/src/views/web-message.ts +0 -72
  68. package/test/auth0.test.ts +0 -351
  69. package/test/helpers.ts +0 -23
  70. package/test/openid-handlers.test.ts +0 -57
  71. package/test/rules/avatar.js +0 -13
  72. package/test/rules/avatar.json +0 -5
  73. package/tsconfig.dist.json +0 -12
  74. package/tsconfig.dist.tsbuildinfo +0 -2236
  75. package/tsconfig.json +0 -11
  76. package/tsconfig.watch.json +0 -9
  77. package/watch.ts +0 -59
package/tsconfig.json DELETED
@@ -1,11 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.base.json",
3
- "references": [{
4
- "path": "../server/tsconfig.dist.json"
5
- }],
6
- "compilerOptions": {
7
- "baseUrl": ".",
8
- "noEmit": true
9
- },
10
- "include": ["src/**/*.ts", "test/**/*.ts"]
11
- }
@@ -1,9 +0,0 @@
1
- {
2
- "extends": "@frontside/tsconfig",
3
- "compilerOptions": {
4
- "rootDir": ".",
5
- "noEmit": true,
6
- "sourceMap": true
7
- },
8
- "include": ["./watch.ts"]
9
- }
package/watch.ts DELETED
@@ -1,59 +0,0 @@
1
- import { Operation, Stream, Task, main, on, sleep, spawn } from 'effection';
2
- import { exec, daemon, StdIO } from '@effection/process';
3
- import { watch } from 'chokidar';
4
-
5
- main(function* (scope: Task) {
6
- if (!process.env.PORT) process.env.PORT = '4000';
7
-
8
- let watcher = watch(['../server/src/**/*.ts', './src/**/*.ts'], { ignoreInitial: true, ignored: 'dist' });
9
- try {
10
- let process: Task = scope.run(buildAndRun);
11
-
12
- yield on(watcher, 'all').forEach(() => {
13
- process.halt();
14
- process = scope.run(function*() {
15
- yield sleep(10);
16
- console.log('rebuilding.....');
17
- yield buildAndRun;
18
- });
19
- });
20
- } finally {
21
- watcher.close();
22
- }
23
- });
24
-
25
- function writeOut(channel: Stream<string>, out: NodeJS.WriteStream) {
26
- return channel.forEach(function (data) {
27
- return new Promise((resolve, reject) => {
28
- out.write(data, (err) => {
29
- if (err) {
30
- reject(err);
31
- } else {
32
- resolve();
33
- }
34
- });
35
- });
36
- });
37
- }
38
-
39
- function* executeAndOut(command: string): Operation<void> {
40
- let { stdout, stderr, expect } = yield exec(`npm run ${command}`);
41
- yield spawn(writeOut(stdout, process.stdout));
42
- yield spawn(writeOut(stderr, process.stderr));
43
- yield expect();
44
- }
45
-
46
- function* buildAndRun() {
47
- try {
48
- yield executeAndOut('clean');
49
- yield executeAndOut('prepack');
50
-
51
- let server: StdIO = yield daemon('node dist/start.js');
52
- yield spawn(writeOut(server.stdout, process.stdout));
53
- yield spawn(writeOut(server.stderr, process.stderr));
54
- } catch (err) {
55
- console.error(err);
56
- }
57
-
58
- yield;
59
- }