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
| // Reproduces InstantDB's response shape for optional fields under different | |
| // permission/value combinations. Run with: | |
| // | |
| // npm i @instantdb/admin | |
| // INSTANTDB_APP_ID=... INSTANTDB_ADMIN_TOKEN=... npx tsx instantdb-optional-field-shape.ts | |
| // | |
| // The app must have the schema + perms below pushed first: | |
| // | |
| // npx instant-cli@latest push schema -p admin -a $INSTANTDB_APP_ID -y | |
| // npx instant-cli@latest push perms -p admin -a $INSTANTDB_APP_ID -y |
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
| { | |
| "pricePerShareInEuro": 500, | |
| "noticePeriodInYears": 4, | |
| "estimatedDividendPerYear": "1 - 3%", | |
| "products": [ | |
| { | |
| "name": "Junges Girokonto", | |
| "priceGlsContribution": { | |
| "billingPeriod": "yearly", | |
| "pricePerBillingPeriodInEuro": 12 |
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
| class User extends Document { | |
| final Name name; | |
| final Address address; | |
| final Gender gender; | |
| final Birthday birthday; | |
| final Email email; | |
| final Weight weight; | |
| final Length height; | |
| final bool _hasFinishedSignUp; | |
| final Iterable<Bike> myBikes; |
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
| abstract class User extends DataModel { | |
| final Name name; | |
| final Address address; | |
| final Gender gender; | |
| final Birthday birthDay; | |
| final Email email; | |
| final Weight weight; | |
| final Length height; | |
| final bool hasFinishedSignUp; |