-
Notifications
You must be signed in to change notification settings - Fork 10k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into fix/unnecessary-permissions-check-marketp…
…lace
- Loading branch information
Showing
1,991 changed files
with
26,085 additions
and
22,426 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
Large diffs are not rendered by default.
Oops, something went wrong.
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
Large diffs are not rendered by default.
Oops, something went wrong.
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,7 @@ | ||
--- | ||
to: ee/apps/<%= name %>/.eslintrc.json | ||
--- | ||
{ | ||
"extends": ["@rocket.chat/eslint-config"], | ||
"ignorePatterns": ["**/dist"] | ||
} |
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,52 @@ | ||
--- | ||
to: ee/apps/<%= name %>/package.json | ||
--- | ||
{ | ||
"name": "@rocket.chat/<%= name.toLowerCase() %>", | ||
"private": true, | ||
"version": "0.1.0", | ||
"description": "Rocket.Chat service", | ||
"scripts": { | ||
"build": "tsc -p tsconfig.json", | ||
"ms": "TRANSPORTER=${TRANSPORTER:-TCP} MONGO_URL=${MONGO_URL:-mongodb://localhost:3001/meteor} ts-node --files src/service.ts", | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"lint": "eslint src", | ||
"typecheck": "tsc --noEmit --skipLibCheck -p tsconfig.json" | ||
}, | ||
"keywords": [ | ||
"rocketchat" | ||
], | ||
"author": "Rocket.Chat", | ||
"dependencies": { | ||
"@rocket.chat/core-services": "workspace:^", | ||
"@rocket.chat/core-typings": "workspace:^", | ||
"@rocket.chat/emitter": "0.31.22", | ||
"@rocket.chat/model-typings": "workspace:^", | ||
"@rocket.chat/models": "workspace:^", | ||
"@rocket.chat/rest-typings": "workspace:^", | ||
"@rocket.chat/string-helpers": "0.31.22", | ||
"@types/node": "^14.18.21", | ||
"ejson": "^2.2.2", | ||
"eventemitter3": "^4.0.7", | ||
"fibers": "^5.0.3", | ||
"mem": "^8.1.1", | ||
"moleculer": "^0.14.21", | ||
"mongodb": "^4.12.1", | ||
"nats": "^2.4.0", | ||
"pino": "^8.4.2", | ||
"polka": "^0.5.2" | ||
}, | ||
"devDependencies": { | ||
"@rocket.chat/eslint-config": "workspace:^", | ||
"@types/eslint": "^8.4.10", | ||
"@types/polka": "^0.5.4", | ||
"eslint": "^8.29.0", | ||
"ts-node": "^10.9.1", | ||
"typescript": "~4.5.5" | ||
}, | ||
"main": "./dist/ee/apps/<%= name %>/src/service.js", | ||
"files": [ | ||
"/dist" | ||
] | ||
} | ||
|
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,43 @@ | ||
--- | ||
to: ee/apps/<%= name %>/src/service.ts | ||
--- | ||
import type { Document } from 'mongodb'; | ||
import polka from 'polka'; | ||
import { api } from '@rocket.chat/core-services'; | ||
|
||
import { broker } from '../../../../apps/meteor/ee/server/startup/broker'; | ||
import { Collections, getCollection, getConnection } from '../../../../apps/meteor/ee/server/services/mongo'; | ||
import { registerServiceModels } from '../../../../apps/meteor/ee/server/lib/registerServiceModels'; | ||
|
||
const PORT = process.env.PORT || 3034; | ||
|
||
(async () => { | ||
const db = await getConnection(); | ||
|
||
const trash = await getCollection<Document>(Collections.Trash); | ||
|
||
registerServiceModels(db, trash); | ||
|
||
api.setBroker(broker); | ||
|
||
// need to import service after models are registered | ||
const { <%= h.changeCase.pascalCase(name) %> } = await import('./<%= h.changeCase.pascalCase(name) %>'); | ||
|
||
api.registerService(new <%= h.changeCase.pascalCase(name) %>()); | ||
|
||
await api.start(); | ||
|
||
polka() | ||
.get('/health', async function (_req, res) { | ||
try { | ||
await api.nodeList(); | ||
res.end('ok'); | ||
} catch (err) { | ||
console.error('Service not healthy', err); | ||
|
||
res.writeHead(500); | ||
res.end('not healthy'); | ||
} | ||
}) | ||
.listen(PORT); | ||
})(); |
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,16 @@ | ||
--- | ||
to: ee/apps/<%= name %>/src/<%= h.changeCase.pascalCase(name) %>.ts | ||
--- | ||
import { ServiceClass } from '@rocket.chat/core-services'; | ||
|
||
export class <%= h.changeCase.pascalCase(name) %> extends ServiceClass { | ||
protected name = '<%= name %>'; | ||
|
||
constructor() { | ||
super(); | ||
|
||
// your stuff | ||
} | ||
|
||
// more stuff | ||
} |
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,12 @@ | ||
--- | ||
to: ee/apps/<%= name %>/tsconfig.json | ||
--- | ||
{ | ||
"extends": "../../../tsconfig.base.server.json", | ||
"compilerOptions": { | ||
"outDir": "./dist" | ||
}, | ||
"files": ["./src/service.ts"], | ||
"include": ["../../../apps/meteor/definition/externals/meteor"], | ||
"exclude": ["./dist"] | ||
} |
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.