orion-data 0.1.3
Install from the command line:
Learn more about npm packages
$ npm install @secureideasllc/orion-data@0.1.3
Install via package.json:
"@secureideasllc/orion-data": "0.1.3"
About this version
Contains type definitions for the Orion services.
Hosted in the GH Package Registry. Add the following to your .npmrc
file:
registry=https://registry.yarnpkg.com/
@secureideasllc:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken={yourtokenhere}
always-auth=true
Then install with:
npm install @secureideasllc/orion-data
These types are defined with Zod as the schema language. Typescript types are generated from the Zod schemas using its built-in type inference. Enums are an exception, as they are defined in Typescript and then converted to Zod schemas using its z.nativeEnum
method. Because of the type inference, any changes to the Zod schemas will be reflected in the Typescript types. A given Zod schema's .parse
method will always return a valid instance of the corresponding Typescript type, if it succeeds. However, the Typescript types are not guaranteed to be valid instances of the Zod schemas. This is because the Zod schemas can define additional constraints that are not expressible in Typescript. For example, a Zod schema can define a string that must be a valid email address, but the Typescript type will only be a string. This is a limitation of the Typescript language.
Conventionally, the Zod schemas use the suffix Schema
to distinguish them from the Typescript types. So for example, the Zod schema for the User
type is UserSchema
, and the Typescript type is User
. In the case of enums, the Zod schema is UserTypeEnum
and the Typescript type is UserType
.
For now we can modify the types pretty freely, and should expect to. In the future, we may need to consider breaking changes more carefully.
Details
- orion-data
- secureideasllc
- 10 months ago
- UNLICENSED
- 20 dependencies
Assets
- orion-data-0.1.3.tgz
Download activity
- Total downloads 0
- Last 30 days 0
- Last week 0
- Today 0