@carlonicora/nestjs-neo4jsonapi 3.2.4 → 3.3.1
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/foundations/discord-user/repositories/discord-user.repository.d.ts +15 -0
- package/dist/foundations/discord-user/repositories/discord-user.repository.d.ts.map +1 -1
- package/dist/foundations/discord-user/repositories/discord-user.repository.js +25 -0
- package/dist/foundations/discord-user/repositories/discord-user.repository.js.map +1 -1
- package/package.json +16 -16
|
@@ -14,6 +14,21 @@ export declare class DiscordUserRepository extends AbstractRepository<DiscordUse
|
|
|
14
14
|
}>;
|
|
15
15
|
constructor(neo4j: Neo4jService, securityService: SecurityService, clsService: ClsService);
|
|
16
16
|
protected buildReturnStatement(): string;
|
|
17
|
+
/**
|
|
18
|
+
* The Discord account linked to a platform user, if there is one.
|
|
19
|
+
*
|
|
20
|
+
* The inverse of {@link findByDiscordId}, for the paths that start from an
|
|
21
|
+
* authenticated web user rather than from a Discord interaction (listing the
|
|
22
|
+
* servers that user shares with the bot, resolving a recording's game master
|
|
23
|
+
* when it was started from the web). Undefined when the user has never
|
|
24
|
+
* linked Discord — callers degrade rather than fail.
|
|
25
|
+
*
|
|
26
|
+
* A DiscordUser's `id` is NOT reliably the user's id (only accounts created
|
|
27
|
+
* through the Discord OAuth path share one), so this traverses the edge.
|
|
28
|
+
*/
|
|
29
|
+
findByUserId(params: {
|
|
30
|
+
userId: string;
|
|
31
|
+
}): Promise<DiscordUser | undefined>;
|
|
17
32
|
findByDiscordId(params: {
|
|
18
33
|
discordId: string;
|
|
19
34
|
}): Promise<DiscordUser>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discord-user.repository.d.ts","sourceRoot":"","sources":["../../../../src/foundations/discord-user/repositories/discord-user.repository.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAGlF,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAE9E,qBACa,qBAAsB,SAAQ,kBAAkB,CAAC,WAAW,EAAE,OAAO,qBAAqB,CAAC,aAAa,CAAC;IACpH,SAAS,CAAC,QAAQ,CAAC,UAAU;;;;;;;;;OAAyB;gBAC1C,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,UAAU,EAAE,UAAU;IAIzF,SAAS,CAAC,oBAAoB,IAAI,MAAM;
|
|
1
|
+
{"version":3,"file":"discord-user.repository.d.ts","sourceRoot":"","sources":["../../../../src/foundations/discord-user/repositories/discord-user.repository.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAGlF,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAE9E,qBACa,qBAAsB,SAAQ,kBAAkB,CAAC,WAAW,EAAE,OAAO,qBAAqB,CAAC,aAAa,CAAC;IACpH,SAAS,CAAC,QAAQ,CAAC,UAAU;;;;;;;;;OAAyB;gBAC1C,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,UAAU,EAAE,UAAU;IAIzF,SAAS,CAAC,oBAAoB,IAAI,MAAM;IAexC;;;;;;;;;;;OAWG;IACG,YAAY,CAAC,MAAM,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC;IAiB1E,eAAe,CAAC,MAAM,EAAE;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,WAAW,CAAC;CAc3E"}
|
|
@@ -35,6 +35,31 @@ let DiscordUserRepository = class DiscordUserRepository extends core_1.AbstractR
|
|
|
35
35
|
RETURN discorduser, discorduser_company, discorduser_user, discorduser_company as discorduser_user_company, discorduser_${user_1.userMeta.nodeName}_${role_1.roleMeta.nodeName}
|
|
36
36
|
`;
|
|
37
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* The Discord account linked to a platform user, if there is one.
|
|
40
|
+
*
|
|
41
|
+
* The inverse of {@link findByDiscordId}, for the paths that start from an
|
|
42
|
+
* authenticated web user rather than from a Discord interaction (listing the
|
|
43
|
+
* servers that user shares with the bot, resolving a recording's game master
|
|
44
|
+
* when it was started from the web). Undefined when the user has never
|
|
45
|
+
* linked Discord — callers degrade rather than fail.
|
|
46
|
+
*
|
|
47
|
+
* A DiscordUser's `id` is NOT reliably the user's id (only accounts created
|
|
48
|
+
* through the Discord OAuth path share one), so this traverses the edge.
|
|
49
|
+
*/
|
|
50
|
+
async findByUserId(params) {
|
|
51
|
+
const query = this.neo4j.initQuery({ serialiser: this.descriptor.model });
|
|
52
|
+
query.queryParams = {
|
|
53
|
+
userId: params.userId,
|
|
54
|
+
};
|
|
55
|
+
query.query = `
|
|
56
|
+
MATCH (:${user_1.userMeta.labelName} { id: $userId })-[:HAS_DISCORD]->(${discord_user_1.DiscordUserDescriptor.model.nodeName}:${discord_user_1.DiscordUserDescriptor.model.labelName})
|
|
57
|
+
${this.buildReturnStatement()}
|
|
58
|
+
LIMIT 1
|
|
59
|
+
`;
|
|
60
|
+
const users = await this.neo4j.readMany(query);
|
|
61
|
+
return users[0];
|
|
62
|
+
}
|
|
38
63
|
async findByDiscordId(params) {
|
|
39
64
|
const query = this.neo4j.initQuery({ serialiser: this.descriptor.model });
|
|
40
65
|
query.queryParams = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discord-user.repository.js","sourceRoot":"","sources":["../../../../src/foundations/discord-user/repositories/discord-user.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,2CAAwC;AACxC,wCAAkF;AAClF,qCAAsC;AACtC,qCAAsC;AACtC,2DAA8E;AAG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AM,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC/C,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,MAA6B;QACjD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC,CAAC;QAE1E,KAAK,CAAC,WAAW,GAAG;YAClB,SAAS,EAAE,MAAM,CAAC,SAAS;SAC5B,CAAC;QAEF,KAAK,CAAC,KAAK,GAAG;eACH,oCAAqB,CAAC,KAAK,CAAC,QAAQ,IAAI,oCAAqB,CAAC,KAAK,CAAC,SAAS;QACpF,IAAI,CAAC,oBAAoB,EAAE;KAC9B,CAAC;QAEF,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC;CACF,CAAA;AAhEY,sDAAqB;gCAArB,qBAAqB;IADjC,IAAA,mBAAU,GAAE;qCAGQ,mBAAY,EAAmB,sBAAe,EAAc,uBAAU;GAF9E,qBAAqB,CAgEjC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carlonicora/nestjs-neo4jsonapi",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.1",
|
|
4
4
|
"description": "NestJS foundation package with JSON:API, Neo4j, Redis, LangChain agents, and common utilities",
|
|
5
5
|
"author": "Carlo Nicora",
|
|
6
6
|
"license": "GPL-3.0-or-later",
|
|
@@ -67,17 +67,17 @@
|
|
|
67
67
|
"prepublishOnly": "pnpm build"
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"@ai-sdk/openai-compatible": "^3.0.
|
|
71
|
-
"@aws-sdk/client-s3": "^3.
|
|
72
|
-
"@aws-sdk/lib-storage": "^3.
|
|
73
|
-
"@aws-sdk/s3-request-presigner": "^3.
|
|
70
|
+
"@ai-sdk/openai-compatible": "^3.0.39",
|
|
71
|
+
"@aws-sdk/client-s3": "^3.1119.0",
|
|
72
|
+
"@aws-sdk/lib-storage": "^3.1119.0",
|
|
73
|
+
"@aws-sdk/s3-request-presigner": "^3.1119.0",
|
|
74
74
|
"@azure/storage-blob": "^12.33.0",
|
|
75
75
|
"@getbrevo/brevo": "^6.0.3",
|
|
76
76
|
"@kenjiuno/msgreader": "^1.28.0",
|
|
77
77
|
"@langchain/community": "^1.1.29",
|
|
78
78
|
"@langchain/core": "^1.2.9",
|
|
79
79
|
"@langchain/google-vertexai": "^2.3.0",
|
|
80
|
-
"@langchain/langgraph": "^1.4.
|
|
80
|
+
"@langchain/langgraph": "^1.4.13",
|
|
81
81
|
"@langchain/langgraph-checkpoint-redis": "^1.0.11",
|
|
82
82
|
"@langchain/openai": "^1.5.10",
|
|
83
83
|
"@langchain/textsplitters": "^1.0.1",
|
|
@@ -90,26 +90,26 @@
|
|
|
90
90
|
"@opentelemetry/sdk-node": "^0.221.0",
|
|
91
91
|
"@opentelemetry/semantic-conventions": "^1.43.0",
|
|
92
92
|
"@sendgrid/mail": "^8.1.6",
|
|
93
|
-
"@simplewebauthn/server": "^13.3.
|
|
93
|
+
"@simplewebauthn/server": "^13.3.3",
|
|
94
94
|
"adm-zip": "^0.6.0",
|
|
95
|
-
"ai": "^7.0.
|
|
96
|
-
"axios": "^1.
|
|
95
|
+
"ai": "^7.0.83",
|
|
96
|
+
"axios": "^1.20.0",
|
|
97
97
|
"bcrypt": "^6.0.0",
|
|
98
98
|
"bcryptjs": "^3.0.3",
|
|
99
|
-
"bullmq": "6.
|
|
99
|
+
"bullmq": "6.3.1",
|
|
100
100
|
"class-transformer": "^0.5.1",
|
|
101
101
|
"class-validator": "^0.15.1",
|
|
102
102
|
"discord-api-types": "^0.38.53",
|
|
103
103
|
"discord.js": "^14.27.0",
|
|
104
104
|
"docx": "9.7.1",
|
|
105
105
|
"docx-templates": "^4.15.0",
|
|
106
|
-
"fast-xml-parser": "^5.11.
|
|
106
|
+
"fast-xml-parser": "^5.11.1",
|
|
107
107
|
"fastify": "^5.12.1",
|
|
108
108
|
"gray-matter": "^4.0.3",
|
|
109
109
|
"handlebars": "^4.7.9",
|
|
110
110
|
"ioredis": "^6.0.0",
|
|
111
111
|
"js-tiktoken": "^1.0.21",
|
|
112
|
-
"js-yaml": "^5.4.
|
|
112
|
+
"js-yaml": "^5.4.1",
|
|
113
113
|
"jszip": "^3.10.1",
|
|
114
114
|
"langsmith": "^0.9.0",
|
|
115
115
|
"libreoffice-convert": "^1.8.2",
|
|
@@ -127,7 +127,7 @@
|
|
|
127
127
|
"node-tesseract-ocr": "^2.2.1",
|
|
128
128
|
"nodemailer": "^9.0.5",
|
|
129
129
|
"officeparser": "^7.8.0",
|
|
130
|
-
"openai": "^7.
|
|
130
|
+
"openai": "^7.7.0",
|
|
131
131
|
"otpauth": "^9.5.1",
|
|
132
132
|
"passport": "^0.7.0",
|
|
133
133
|
"passport-jwt": "^4.0.1",
|
|
@@ -143,9 +143,9 @@
|
|
|
143
143
|
"remark-mdx": "^3.1.1",
|
|
144
144
|
"remark-parse": "^11.0.0",
|
|
145
145
|
"rxjs": "^7.8.2",
|
|
146
|
-
"sharp": "^0.35.
|
|
146
|
+
"sharp": "^0.35.4",
|
|
147
147
|
"socket.io": "^4.8.3",
|
|
148
|
-
"stripe": "
|
|
148
|
+
"stripe": "22.5.0",
|
|
149
149
|
"tslib": "^2.8.1",
|
|
150
150
|
"turndown": "^7.2.4",
|
|
151
151
|
"unified": "^11.0.5",
|
|
@@ -181,7 +181,7 @@
|
|
|
181
181
|
"@types/js-yaml": "^4.0.9",
|
|
182
182
|
"@types/mailparser": "^3.4.6",
|
|
183
183
|
"@types/mdast": "^4.0.4",
|
|
184
|
-
"@types/node": "^26.
|
|
184
|
+
"@types/node": "^26.4.0",
|
|
185
185
|
"@types/nodemailer": "^8.0.1",
|
|
186
186
|
"@types/passport-jwt": "^4.0.1",
|
|
187
187
|
"@types/qrcode": "^1.5.6",
|