-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(moderation): support crisp tickets (#485)
- Loading branch information
1 parent
1bb32f8
commit 9dfd604
Showing
95 changed files
with
1,654 additions
and
469 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,12 +12,17 @@ API_AUTH_URL="http://localhost:6300" | |
API_AUTH_USERNAME="________________________" | ||
CONSOLA_LEVEL="4" | ||
COOKIE_ENCRYPTION_KEY="password_at_least_32_characters_long" | ||
CRISP_BASE_URL="http://localhost:6400" | ||
CRISP_IDENTIFIER="________-____-____-____-____________" | ||
CRISP_KEY="________________________________________________________________" | ||
CRISP_PLUGIN_URN="urn:_______:______________:_" | ||
CRISP_USER_NICKNAME="______________" | ||
CRISP_WEBSITE_ID="________-____-____-____-____________" | ||
DATABASE_URL="postgresql://postgres:postgres@localhost:5432/postgres?schema=public" | ||
ENTREPRISE_API_GOUV_TOKEN="____.____.____" | ||
ENTREPRISE_API_GOUV_URL="http://localhost:6200" | ||
HOST="https://hyyypertool-preprod.moncomptepro.beta.gouv.fr/proxy/localhost:3000" | ||
SENTRY_DNS="https://[email protected]/____" | ||
SYMMETRIC_ENCRYPTION_KEY="aTrueRandom32BytesLongBase64EncodedStringAA=" | ||
ZAMMAD_TOKEN="____" | ||
ZAMMAD_URL="https://support.etalab.gouv.fr" | ||
|
||
SYMMETRIC_ENCRYPTION_KEY="aTrueRandom32BytesLongBase64EncodedStringAA=" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
node_modules/ | ||
|
||
# | ||
.env.local | ||
.env.*.local | ||
|
||
# Generated style | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
[ | ||
{ | ||
"httpRequest": { | ||
"method": "GET", | ||
"path": "/v1/website/{website_id}/conversation/{session_id}", | ||
"pathParameters": { | ||
"session_id": ["[A-Z0-9\\-\\_]+"], | ||
"website_id": ["[A-Z0-9\\-\\_]+"] | ||
} | ||
}, | ||
"httpResponse": { | ||
"body": { | ||
"data": { | ||
"meta": { | ||
"subjet": "Lorem Ipsum" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"httpRequest": { | ||
"method": "POST", | ||
"path": "/v1/website/{website_id}/conversation/{session_id}/message", | ||
"pathParameters": { | ||
"session_id": ["[A-Z0-9\\-\\_]+"], | ||
"website_id": ["[A-Z0-9\\-\\_]+"] | ||
} | ||
}, | ||
"httpResponse": { | ||
"body": { | ||
"data": { | ||
"fingerprint": "123456789" | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"httpRequest": { | ||
"method": "GET", | ||
"path": "/v1/website/{website_id}/conversation/{session_id}/messages", | ||
"pathParameters": { | ||
"session_id": ["[A-Z0-9\\-\\_]+"], | ||
"website_id": ["[A-Z0-9\\-\\_]+"] | ||
} | ||
}, | ||
"httpResponse": { | ||
"body": { | ||
"data": [ | ||
{ | ||
"content": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.", | ||
"type": "text", | ||
"timestamp": 1715097494011, | ||
"user": { | ||
"user_id": "123456789", | ||
"nickname": "John User" | ||
} | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
{ | ||
"httpRequest": { | ||
"method": "GET", | ||
"path": "/v1/website/{website_id}/operators/list", | ||
"pathParameters": { | ||
"website_id": ["[A-Z0-9\\-\\_]+"] | ||
} | ||
}, | ||
"httpResponse": { | ||
"body": { | ||
"data": [ | ||
{ | ||
"details": { | ||
"email": "[email protected]", | ||
"firstname": "John", | ||
"lastname": "User", | ||
"user_id": "123456789" | ||
} | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
{ | ||
"httpRequest": { | ||
"path": "/readyz" | ||
}, | ||
"httpResponse": { | ||
"body": "readyz check passed", | ||
"reasonPhrase": "OK", | ||
"statusCode": 200 | ||
} | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// | ||
|
||
import type { Child } from "hono/jsx"; | ||
|
||
// | ||
/** | ||
* | ||
* @example | ||
* ```tsx | ||
* <OpenInCrisp session_id={moderation.session_id}> | ||
* #{moderation.session_id} | ||
* </OpenInCrisp> | ||
* ``` | ||
*/ | ||
|
||
export function OpenInCrisp({ | ||
base_url = "https://app.crisp.chat", | ||
children, | ||
session_id, | ||
website_id, | ||
}: { | ||
base_url?: string; | ||
children: Child; | ||
session_id: string; | ||
website_id: string; | ||
}) { | ||
return ( | ||
<a | ||
href={`${base_url}/website/${website_id}/inbox/${session_id}`} | ||
rel="noopener noreferrer" | ||
target="_blank" | ||
> | ||
{children} | ||
</a> | ||
); | ||
} | ||
|
||
export function short_session_id(session_id: string) { | ||
return session_id.replace("session_", "").slice(0, 7); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/~/config/typescript/api.json → ...ges/~/config/typescript/api/tsconfig.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
packages/~/config/typescript/bun.json → ...ges/~/config/typescript/bun/tsconfig.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
packages/~/config/typescript/tsx.json → ...ges/~/config/typescript/tsx/tsconfig.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
{ | ||
"$schema": "https://json.schemastore.org/tsconfig", | ||
"display": "TSX", | ||
"extends": "./base.json", | ||
"extends": "../base/tsconfig.json", | ||
"compilerOptions": { | ||
"jsx": "preserve", | ||
"jsx": "react-jsx", | ||
"jsxImportSource": "hono/jsx" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.