Add start of swr-api-hooks presentation

This commit is contained in:
Sage Vaillancourt 2024-06-13 16:58:58 -04:00
parent 522ba9491c
commit 61ddc4500c
2 changed files with 125 additions and 2 deletions

View File

@ -71,10 +71,10 @@ enum UsefulFor {
<!-- end_slide -->
# Okay, that's great, but when should I use an enum?
# Okay, that's great, but how do I know when to use one?
<!-- pause -->
## (Or "Booleans? More like, _Fooleans_!")
## (Or, "Booleans? More like, _Fooleans!_")
<!-- pause -->
So, picture this. You've got some code that analyzes a computer network.

123
swr-api-hooks.md Normal file
View File

@ -0,0 +1,123 @@
---
title: SWR API Hooks (and other assorted magicks)
---
# Okay but truly, what are you on about?
<!-- pause -->
## So, hopefully we've all seen a bit of swagger at one point or another
<!-- pause -->
```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:
```
<!-- end_slide -->
# Maybe,
<!-- pause -->
## a few times,
<!-- pause -->
### you've even clicked 'Try it Out'
<!-- pause -->
```
┍━━━━━━━━━━━━┑
│ Try it Out │
┕━━━━━━━━━━━━┙
```
<!-- pause -->
# Which is pretty nice in its own right.
<!-- end_slide -->
# 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