From 61ddc4500ce6d502d44d2c14ad2672f83bec240b Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Thu, 13 Jun 2024 16:58:58 -0400 Subject: [PATCH] Add start of swr-api-hooks presentation --- enum-presentation.md | 4 +- swr-api-hooks.md | 123 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 125 insertions(+), 2 deletions(-) create mode 100644 swr-api-hooks.md diff --git a/enum-presentation.md b/enum-presentation.md index 7c517e0..a2c4dfe 100644 --- a/enum-presentation.md +++ b/enum-presentation.md @@ -71,10 +71,10 @@ enum UsefulFor { -# Okay, that's great, but when should I use an enum? +# Okay, that's great, but how do I know when to use one? -## (Or "Booleans? More like, _Fooleans_!") +## (Or, "Booleans? More like, _Fooleans!_") So, picture this. You've got some code that analyzes a computer network. diff --git a/swr-api-hooks.md b/swr-api-hooks.md new file mode 100644 index 0000000..0a8aea8 --- /dev/null +++ b/swr-api-hooks.md @@ -0,0 +1,123 @@ +--- +title: SWR API Hooks (and other assorted magicks) +--- + +# Okay but truly, what are you on about? + + +## So, hopefully we've all seen a bit of swagger at one point or another + + +```yaml +openapi: 3.0.1 +info: + title: ELT API +paths: + /liens/count: + get: + tags: + - Liens + summary: "Get Count of Lien Summaries. Note: When a search param is provided\ + \ date filters are ignored." + parameters: + - name: filter + in: query + description: "" + required: false + schema: + $ref: '#/components/schemas/BaseLiensFilter' + responses: + "200": + content: + text/plain: + schema: + type: integer + format: int32 + "400": + $ref: '#/components/responses/InvalidRequest' + security: + - Basic: [] + + /yada-yada-yada: +``` + + + + +# Maybe, + + +## a few times, + + +### you've even clicked 'Try it Out' + + +``` + ┍━━━━━━━━━━━━┑ + │ Try it Out │ + ┕━━━━━━━━━━━━┙ +``` + + +# Which is pretty nice in its own right. + + + + +# You may have also noticed some generated typescript for the frontend: + +``` +generated/ +├── apis +│   ├── AdminApi.ts +│   ├── index.ts +│   ├── LetterDataApi.ts +│   ├── LetterEventsApi.ts +│   ├── LettersApi.ts +│   ├── PacketDetailsApi.ts +│   ├── PacketsApi.ts +│   ├── PreferencesApi.ts +│   ├── SecondLettersApi.ts +│   └── SparklerDefaultApi.ts +├── index.ts +├── models +│   ├── AffiliateExclusion.ts +│   ├── DeletePacketRequestBody.ts +│   ├── DeselectedInterestsResponse.ts +│   ├── DeselectedInterest.ts +│   ├── DeselectedLetterRequestBody.ts +│   ├── EventId.ts +│   ├── EventLog.ts +│   ├── Event.ts +│   ├── FirmBook.ts +│   ├── GetEventLogsResponse.ts +│   ├── GetPreferencesResponse.ts +│   ├── GetResponse.ts +│   ├── index.ts +│   ├── LetterSummary.ts +│   ├── Letter.ts +│   ├── ListAffiliateExclusionsFilter.ts +│   ├── ListAffiliateExclusionsResponse.ts +│   ├── ListPacketsFilter.ts +│   ├── ListPacketsResponse.ts +│   ├── MailingAddress.ts +│   ├── Money.ts +│   ├── PacketDetailsData.ts +│   ├── PacketSummary.ts +│   ├── Packet.ts +│   ├── SecondLetterPacket.ts +│   ├── SecondLettersResponse.ts +│   ├── SecondLetter.ts +│   ├── User.ts +│   ├── UspsRre.ts +│   ├── ViolationResponse.ts +│   └── Violation.ts +├── openapitools.json +└── runtime.ts +``` + +# However + +## With the power of +