- node-fetch
- ansi-styles
- chalk
- ...wip...
This file contains hidden or 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
| cat > /etc/ssh/sshd_config << "EOF" | |
| Include /etc/ssh/sshd_config.d/*.conf | |
| #Port 22 | |
| #AddressFamily any | |
| #ListenAddress 0.0.0.0 | |
| #ListenAddress :: | |
| ... | |
| EOF |
This file contains hidden or 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
| /* | |
| NodeJS version: 16.4.1 | |
| Note: benchmarks not run in separate processes - expect some early noise | |
| 45 files | |
| size: 4.7M | |
| ---- 1 | |
| new: 4.3ms | |
| old: 4.0ms | |
| ---- 2 |
This file contains hidden or 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
| version: "3" | |
| services: | |
| example_gql_ts_accounts: | |
| container_name: example_gql_ts_accounts | |
| image: nick3141/example-gql-ts-accounts:latest | |
| restart: unless-stopped | |
| ports: | |
| - 5000:5000 | |
| environment: |
This file contains hidden or 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
| docker run \ | |
| --name example_gql_ts_accounts \ | |
| -p 5000:5000 \ | |
| -e PORT=5000 \ | |
| -e LOG_DIR=./storage/logs \ | |
| -e LOG_MAX_SIZE=20m \ | |
| -e LOG_ROTATION_MAX_AGE=7d \ | |
| -e RATE_LIMIT_WINDOW_MS=60000 \ | |
| -e RATE_LIMIT_MAX=100 \ | |
| --rm \ |
This file contains hidden or 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
| // Guard example from TypeGraphQL, using the @Authorized decorator | |
| @Resolver() | |
| class MyResolver { | |
| // Since the logic is statically attached to the endpoint and inaccessable elsewhere in the | |
| // application, we can't publish this authorisation to the client without duplicating the logic | |
| // (i.e. const canDoThing = user.permissions.includes("ADMIN")...) | |
| @Authorized("ADMIN") | |
| @Query() | |
| authedQuery(): string { |
This file contains hidden or 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
| /** | |
| * @ account/account.policy.ts | |
| * | |
| * AccountPolicy | |
| * | |
| * Handles authorisation for Accounts | |
| */ | |
| export class AccountPolicy { | |
| constructor( | |
| protected readonly ctx: BaseContext, |
This file contains hidden or 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
| /** | |
| * @ account/account.gql.node.ts | |
| * | |
| * AccountNode | |
| * | |
| * GrapQLObjectType for an Account | |
| */ | |
| // AccountNode Source is an AccountModel from our ORM | |
| export type IAccountNodeSource = AccountModel; |
This file contains hidden or 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
| query { | |
| rootNode{ | |
| # paginated connection node | |
| # must provide the root nodes source to the xToManyRelation's resolver | |
| xToManyRelation{ | |
| pageInfo | |
| childNodes{ ... } | |
| } | |
| } | |
| } |