@linklabjs/core 0.1.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 (72) hide show
  1. package/README.md +411 -0
  2. package/package.json +48 -0
  3. package/src/api/DomainNode.ts +1433 -0
  4. package/src/api/Graph.ts +271 -0
  5. package/src/api/PathBuilder.ts +247 -0
  6. package/src/api/index.ts +15 -0
  7. package/src/api/loadGraph.ts +207 -0
  8. package/src/api/test-api.ts +153 -0
  9. package/src/api/test-domain.ts +119 -0
  10. package/src/api/types.ts +88 -0
  11. package/src/config/synonyms.json +28 -0
  12. package/src/core/EventBus.ts +187 -0
  13. package/src/core/GraphEvents.ts +153 -0
  14. package/src/core/PathFinder.ts +283 -0
  15. package/src/formatters/BaseFormatter.ts +17 -0
  16. package/src/graph/GraphAssembler.ts +50 -0
  17. package/src/graph/GraphCompiler.ts +412 -0
  18. package/src/graph/GraphExtractor.ts +191 -0
  19. package/src/graph/GraphOptimizer.ts +404 -0
  20. package/src/graph/GraphTrainer.ts +247 -0
  21. package/src/http/LinkBuilder.ts +244 -0
  22. package/src/http/TrailRequest.ts +48 -0
  23. package/src/http/example-netflix.ts +59 -0
  24. package/src/http/hateoas/README.md +87 -0
  25. package/src/http/index.ts +33 -0
  26. package/src/http/plugin.ts +360 -0
  27. package/src/index.ts +121 -0
  28. package/src/instrumentation/TelemetryShim.ts +172 -0
  29. package/src/navigation/NavigationEngine.ts +441 -0
  30. package/src/navigation/Resolver.ts +134 -0
  31. package/src/navigation/Scheduler.ts +136 -0
  32. package/src/navigation/Trail.ts +252 -0
  33. package/src/navigation/TrailParser.ts +207 -0
  34. package/src/navigation/index.ts +11 -0
  35. package/src/providers/MockProvider.ts +68 -0
  36. package/src/providers/PostgresProvider.ts +187 -0
  37. package/src/runtime/CompiledGraphEngine.ts +274 -0
  38. package/src/runtime/DataLoader.ts +236 -0
  39. package/src/runtime/Engine.ts +163 -0
  40. package/src/runtime/QueryEngine.ts +222 -0
  41. package/src/scenarios/test-metro-paris/config.json +6 -0
  42. package/src/scenarios/test-metro-paris/graph.json +16325 -0
  43. package/src/scenarios/test-metro-paris/queries.ts +152 -0
  44. package/src/scenarios/test-metro-paris/stack.json +1 -0
  45. package/src/scenarios/test-musicians/config.json +10 -0
  46. package/src/scenarios/test-musicians/graph.json +20 -0
  47. package/src/scenarios/test-musicians/stack.json +1 -0
  48. package/src/scenarios/test-netflix/MIGRATION.md +23 -0
  49. package/src/scenarios/test-netflix/README.md +138 -0
  50. package/src/scenarios/test-netflix/actions.ts +92 -0
  51. package/src/scenarios/test-netflix/config.json +6 -0
  52. package/src/scenarios/test-netflix/data/categories.json +1 -0
  53. package/src/scenarios/test-netflix/data/companies.json +1 -0
  54. package/src/scenarios/test-netflix/data/credits.json +19797 -0
  55. package/src/scenarios/test-netflix/data/departments.json +18 -0
  56. package/src/scenarios/test-netflix/data/jobs.json +142 -0
  57. package/src/scenarios/test-netflix/data/movies.json +3497 -0
  58. package/src/scenarios/test-netflix/data/people.json +1 -0
  59. package/src/scenarios/test-netflix/data/synonyms.json +8 -0
  60. package/src/scenarios/test-netflix/data/users.json +70 -0
  61. package/src/scenarios/test-netflix/graph.json +1017 -0
  62. package/src/scenarios/test-netflix/queries.ts +159 -0
  63. package/src/scenarios/test-netflix/stack.json +14 -0
  64. package/src/schema/GraphBuilder.ts +106 -0
  65. package/src/schema/JsonSchemaExtractor.ts +107 -0
  66. package/src/schema/SchemaAnalyzer.ts +175 -0
  67. package/src/schema/SchemaExtractor.ts +102 -0
  68. package/src/schema/SynonymResolver.ts +143 -0
  69. package/src/scripts/dictionary.json +796 -0
  70. package/src/scripts/graph.json +664 -0
  71. package/src/scripts/regenerate.ts +248 -0
  72. package/src/types/index.ts +506 -0
@@ -0,0 +1,18 @@
1
+ [
2
+ {
3
+ "id": 0,
4
+ "name": "Unknow"
5
+ },
6
+ {
7
+ "id": 1,
8
+ "name": "Acting"
9
+ },
10
+ {
11
+ "id": 2,
12
+ "name": "Directing"
13
+ },
14
+ {
15
+ "id": 3,
16
+ "name": "Writing"
17
+ }
18
+ ]
@@ -0,0 +1,142 @@
1
+ [
2
+ {
3
+ "id": 0,
4
+ "name": "Unknow",
5
+ "departmentId": 0
6
+ },
7
+ {
8
+ "id": 1,
9
+ "name": "Actor",
10
+ "departmentId": 1
11
+ },
12
+ {
13
+ "id": 2,
14
+ "name": "Director",
15
+ "departmentId": 2
16
+ },
17
+ {
18
+ "id": 3,
19
+ "name": "Writer",
20
+ "departmentId": 3
21
+ },
22
+ {
23
+ "id": 4,
24
+ "name": "Novel",
25
+ "departmentId": 3
26
+ },
27
+ {
28
+ "id": 5,
29
+ "name": "Screenplay",
30
+ "departmentId": 3
31
+ },
32
+ {
33
+ "id": 6,
34
+ "name": "Dialogue",
35
+ "departmentId": 3
36
+ },
37
+ {
38
+ "id": 7,
39
+ "name": "Lyricist",
40
+ "departmentId": 3
41
+ },
42
+ {
43
+ "id": 8,
44
+ "name": "Story",
45
+ "departmentId": 3
46
+ },
47
+ {
48
+ "id": 9,
49
+ "name": "Characters",
50
+ "departmentId": 3
51
+ },
52
+ {
53
+ "id": 10,
54
+ "name": "Adaptation",
55
+ "departmentId": 3
56
+ },
57
+ {
58
+ "id": 11,
59
+ "name": "Creative Producer",
60
+ "departmentId": 3
61
+ },
62
+ {
63
+ "id": 12,
64
+ "name": "Theatre Play",
65
+ "departmentId": 3
66
+ },
67
+ {
68
+ "id": 13,
69
+ "name": "Story Artist",
70
+ "departmentId": 3
71
+ },
72
+ {
73
+ "id": 14,
74
+ "name": "Original Story",
75
+ "departmentId": 3
76
+ },
77
+ {
78
+ "id": 15,
79
+ "name": "Head of Story",
80
+ "departmentId": 3
81
+ },
82
+ {
83
+ "id": 16,
84
+ "name": "Story Coordinator",
85
+ "departmentId": 3
86
+ },
87
+ {
88
+ "id": 17,
89
+ "name": "Comic Book",
90
+ "departmentId": 3
91
+ },
92
+ {
93
+ "id": 18,
94
+ "name": "Author",
95
+ "departmentId": 3
96
+ },
97
+ {
98
+ "id": 19,
99
+ "name": "Short Story",
100
+ "departmentId": 3
101
+ },
102
+ {
103
+ "id": 20,
104
+ "name": "Book",
105
+ "departmentId": 3
106
+ },
107
+ {
108
+ "id": 21,
109
+ "name": "Co-Writer",
110
+ "departmentId": 3
111
+ },
112
+ {
113
+ "id": 22,
114
+ "name": "Storyboard",
115
+ "departmentId": 3
116
+ },
117
+ {
118
+ "id": 23,
119
+ "name": "Original Series Creator",
120
+ "departmentId": 3
121
+ },
122
+ {
123
+ "id": 24,
124
+ "name": "Original Film Writer",
125
+ "departmentId": 3
126
+ },
127
+ {
128
+ "id": 25,
129
+ "name": "Story Supervisor",
130
+ "departmentId": 3
131
+ },
132
+ {
133
+ "id": 26,
134
+ "name": "Screenstory",
135
+ "departmentId": 3
136
+ },
137
+ {
138
+ "id": 27,
139
+ "name": "Story Editor",
140
+ "departmentId": 3
141
+ }
142
+ ]