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
| import fetch from 'node-fetch'; | |
| /** | |
| * @description Get flags from AWS AppConfig. | |
| * | |
| * Flags and configuration is handled manually in the GUI. | |
| * | |
| * Environment variables and such config are still done in `serverless.yml` as usual. | |
| * | |
| * @see https://aws.amazon.com/blogs/mt/using-aws-appconfig-feature-flags/ |
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
| import React, { useEffect } from 'react'; | |
| import mermaid from 'mermaid'; | |
| import { Service, Event } from '@eventcatalog/types'; | |
| import { buildMermaidFlowChartForEvent, buildMermaidFlowChartForService } from '@/lib/graphs'; | |
| mermaid.initialize({ | |
| startOnLoad: true, | |
| theme: 'forest', | |
| securityLevel: 'loose', | |
| flowchart: { |
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
| { | |
| "asyncapi": "2.4.0", | |
| "info": { | |
| "title": "User Service", | |
| "version": "1.0.0", | |
| "contact": { | |
| "name": "Sam Person", | |
| "url": "https://acmecorp.com/docs#owner", | |
| "email": "[email protected]" | |
| }, |
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
| { | |
| "asyncapi": "2.4.0", | |
| "info": { | |
| "title": "Greet Service", | |
| "version": "1.0.0", | |
| "contact": { | |
| "name": "John Doe", | |
| "url": "https://acmecorp.com/docs#owner", | |
| "email": "[email protected]" | |
| }, |
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
| // See: https://www.digitalocean.com/community/tutorials/how-to-use-generics-in-typescript | |
| type StarWarsApiResponse = { | |
| name: string; | |
| rotation_period: string; | |
| orbital_period: string; | |
| diameter: string; | |
| climate: string; | |
| gravity: string; | |
| terrain: 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
| type Dog = { | |
| name: string; | |
| race: RacesLimitedList; | |
| }; | |
| type RacesFullList = 'Alsatian' | 'Pomeranian'; | |
| type RacesLimitedList = Exclude<RacesFullList, 'Pomeranian'>; | |
| const dog: Dog = { | |
| name: 'Sam', |
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
| export const assertions = [ | |
| { | |
| name: 'It should DO SOMETHING', | |
| payload: { | |
| method: 'POST', | |
| path: 'DoSomething', | |
| headers: { | |
| 'X-Client-Version': 1 | |
| }, | |
| body: { |
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
| import { | |
| Event, | |
| EventEmitter, | |
| DomainEventPublisher, | |
| DomainEventPublisherDependencies | |
| } from './interfaces'; | |
| /** | |
| * @description Service to publish domain events. | |
| * |
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
| const emfLog = { | |
| message: '[Embedded Metric]', | |
| status_code: `200`, | |
| status_code_count: 1, | |
| _aws: { | |
| Timestamp: Date.now(), | |
| CloudWatchMetrics: [ | |
| { | |
| Namespace: 'AWS EMF demo: Status codes', | |
| Dimensions: [['status_code']], |