@rubytech/create-maxy 1.0.698 → 1.0.699
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/payload/server/server.js
CHANGED
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
// ============================================================
|
|
2
|
-
// Migration 002 — LinkedIn import node types
|
|
3
|
-
// Adds the labels required to accommodate a full LinkedIn
|
|
4
|
-
// Basic Data Export. Idempotent: every statement uses
|
|
5
|
-
// IF NOT EXISTS so the migration can be re-run safely.
|
|
6
|
-
// ============================================================
|
|
7
|
-
|
|
8
|
-
// ----------------------------------------------------------
|
|
9
|
-
// Organization — schema:Organization. LinkedIn companies that
|
|
10
|
-
// connections work for, that Joel has held positions at, that
|
|
11
|
-
// he follows, or that appear as recommendation subjects.
|
|
12
|
-
// Distinct from :LocalBusiness (the Maxy account itself).
|
|
13
|
-
//
|
|
14
|
-
// Natural key: (accountId, nameNormalised) — lowercased,
|
|
15
|
-
// whitespace-trimmed company name. LinkedIn export has no
|
|
16
|
-
// stable organization id in the basic archive, so dedupe on
|
|
17
|
-
// normalised display name.
|
|
18
|
-
// ----------------------------------------------------------
|
|
19
|
-
CREATE CONSTRAINT organization_account_name_unique IF NOT EXISTS
|
|
20
|
-
FOR (o:Organization) REQUIRE (o.accountId, o.nameNormalised) IS UNIQUE;
|
|
21
|
-
|
|
22
|
-
CREATE INDEX organization_account IF NOT EXISTS
|
|
23
|
-
FOR (o:Organization) ON (o.accountId);
|
|
24
|
-
|
|
25
|
-
CREATE VECTOR INDEX organization_embedding IF NOT EXISTS
|
|
26
|
-
FOR (o:Organization) ON (o.embedding)
|
|
27
|
-
OPTIONS {
|
|
28
|
-
indexConfig: {
|
|
29
|
-
`vector.dimensions`: 768,
|
|
30
|
-
`vector.similarity_function`: 'cosine'
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
// ----------------------------------------------------------
|
|
35
|
-
// EducationalOrganization — schema:EducationalOrganization.
|
|
36
|
-
// Schools attended (Education.csv). Separate label (not a
|
|
37
|
-
// sublabel of Organization) so filter chips in /graph keep
|
|
38
|
-
// companies and schools visually distinct. Same natural key
|
|
39
|
-
// shape as Organization.
|
|
40
|
-
// ----------------------------------------------------------
|
|
41
|
-
CREATE CONSTRAINT edu_org_account_name_unique IF NOT EXISTS
|
|
42
|
-
FOR (e:EducationalOrganization) REQUIRE (e.accountId, e.nameNormalised) IS UNIQUE;
|
|
43
|
-
|
|
44
|
-
CREATE INDEX edu_org_account IF NOT EXISTS
|
|
45
|
-
FOR (e:EducationalOrganization) ON (e.accountId);
|
|
46
|
-
|
|
47
|
-
// ----------------------------------------------------------
|
|
48
|
-
// Skill — Joel's declared skills (Skills.csv) and the skills
|
|
49
|
-
// named in endorsement rows. Natural key (accountId,
|
|
50
|
-
// nameNormalised) so "machine learning" and "Machine Learning"
|
|
51
|
-
// collapse to one node.
|
|
52
|
-
// ----------------------------------------------------------
|
|
53
|
-
CREATE CONSTRAINT skill_account_name_unique IF NOT EXISTS
|
|
54
|
-
FOR (s:Skill) REQUIRE (s.accountId, s.nameNormalised) IS UNIQUE;
|
|
55
|
-
|
|
56
|
-
// ----------------------------------------------------------
|
|
57
|
-
// Credential — schema:EducationalOccupationalCredential.
|
|
58
|
-
// Professional certifications (Certifications.csv). Natural
|
|
59
|
-
// key (accountId, name, authority) — a credential is defined
|
|
60
|
-
// by its name and issuing authority.
|
|
61
|
-
// ----------------------------------------------------------
|
|
62
|
-
CREATE CONSTRAINT credential_unique IF NOT EXISTS
|
|
63
|
-
FOR (c:Credential) REQUIRE (c.accountId, c.name, c.authority) IS UNIQUE;
|
|
64
|
-
|
|
65
|
-
// ----------------------------------------------------------
|
|
66
|
-
// Article — schema:Article. Posts Joel authored on LinkedIn
|
|
67
|
-
// (Articles/ directory). Natural key elementId-less: content
|
|
68
|
-
// hash of (title + publishedAt) scoped to account.
|
|
69
|
-
// ----------------------------------------------------------
|
|
70
|
-
CREATE CONSTRAINT article_unique IF NOT EXISTS
|
|
71
|
-
FOR (a:Article) REQUIRE (a.accountId, a.articleHash) IS UNIQUE;
|
|
72
|
-
|
|
73
|
-
// ----------------------------------------------------------
|
|
74
|
-
// Recommendation — schema:Review (recommendation is a
|
|
75
|
-
// specialisation). One row per written-about relationship,
|
|
76
|
-
// direction encoded in edges (GAVE_RECOMMENDATION vs
|
|
77
|
-
// RECEIVED_RECOMMENDATION). Natural key: sha256 of
|
|
78
|
-
// (authorUrl + subjectUrl + creationDate).
|
|
79
|
-
// ----------------------------------------------------------
|
|
80
|
-
CREATE CONSTRAINT recommendation_unique IF NOT EXISTS
|
|
81
|
-
FOR (r:Recommendation) REQUIRE (r.accountId, r.recommendationHash) IS UNIQUE;
|
|
82
|
-
|
|
83
|
-
// ----------------------------------------------------------
|
|
84
|
-
// Sublabels — no new constraints, no new indexes. The
|
|
85
|
-
// existing Conversation / Message constraints apply.
|
|
86
|
-
// :Conversation:LinkedInConversation — messages.csv threads
|
|
87
|
-
// :Message:LinkedInMessage — individual DMs
|
|
88
|
-
// The sublabel is set at CREATE time (set-semantic labels)
|
|
89
|
-
// and drives /graph canvas colour and filter-chip separation
|
|
90
|
-
// without schema fragmentation.
|
|
91
|
-
// ----------------------------------------------------------
|
|
92
|
-
|
|
93
|
-
// ----------------------------------------------------------
|
|
94
|
-
// Person additions — LinkedIn carries two properties that do
|
|
95
|
-
// not already have an index: linkedinUrl (natural key for
|
|
96
|
-
// LinkedIn-origin persons) and isOperator (marks Joel's own
|
|
97
|
-
// Person node so the import can MATCH it from every row).
|
|
98
|
-
// ----------------------------------------------------------
|
|
99
|
-
CREATE INDEX person_linkedin_url IF NOT EXISTS
|
|
100
|
-
FOR (p:Person) ON (p.linkedinUrl);
|
|
101
|
-
|
|
102
|
-
CREATE INDEX person_is_operator IF NOT EXISTS
|
|
103
|
-
FOR (p:Person) ON (p.accountId, p.isOperator);
|