A. No
unsanitary examples ommited
import { ref } from "valtio"; | |
import { proxyWithHistory } from "valtio-history"; | |
export { snapshot, useSnapshot } from "valtio"; | |
export type EditHistory<V> = ReturnType<typeof proxyWithHistory<V>> & { | |
status: EditHistoryStatus; | |
hasChanges: () => boolean; | |
reset(value: V): UnsubscribeEditHistory; | |
savedChanges: () => void; |
{ | |
"scripts": { | |
"generate-api": "openapi-typescript http://localhost:54321/api/yada/v1/openapi/schema.json -o ./src/platform/client/api.gen.ts", | |
"generate-client": "npm run generate-api && node ./bin/generate-client-schemas.mjs", | |
}, | |
"dependencies": { | |
"openapi-fetch": "^0.14.0", | |
}, | |
"devDependencies": { | |
"openapi-typescript": "^7.8.0", |
/** @file Resource helpers. */ | |
import { | |
type QueryPromise, | |
type SelectedFields, | |
and, | |
asc, | |
desc, | |
count, | |
eq, | |
ilike, |
You can see how Scalar is integrated on line ~125 of lib/openapi/docs.ts
(Shown here as lib-openapi-docs.ts
)
I may have not included every module that's needed for this system because it's unreleased.
Also, hono-openapi
is not being used at all, I developed my own system which is included below.
But, that should not matter too much - the principles should be the same.
The REST Dialect used by this project is inspired by the current stable version of JSON Server similarly to how it's implemented in the React Admin ra-data-json-server package.
It is NOT REQUIRED to match the ra-data-json-server
method names such as
getList
,getOne
, etc. in any server/client function/operation identifier/etc.
#! /usr/bin/env node | |
/** | |
* @file Generates ajv compatible JSON Schema definitions for combining schemas | |
* with $ref. Required by the frontend for form validation with ajv. See: | |
* | |
* - https://ajv.js.org/guide/combining-schemas.html#combining-schemas-with-ref | |
* | |
* Modules generated into frontend/src/platform/client/schemas/ should import | |
* the `operations` from "../api.gen" as shown below, with any related, | |
* referenced schemas defined in a `definitions` property. See also, existing |