New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

crdtoapi

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

crdtoapi - npm Package Compare versions

Comparing version 0.0.9 to 0.0.10

5

package.json
{
"name": "crdtoapi",
"version": "0.0.9",
"version": "0.0.10",
"description": "CustomResourceDefinitions to OpensAPI",

@@ -8,3 +8,4 @@ "homepage": "https://github.com/yaacov/crdtoapi",

"bin": {
"crdtoapi": "./dist/index.js"
"crdtoapi": "./dist/index.js",
"crdtomodel": "./dist/findModels.js"
},

@@ -11,0 +12,0 @@ "scripts": {

@@ -30,2 +30,11 @@ [![npm version](https://badge.fury.io/js/crdtoapi.svg)](https://badge.fury.io/js/crdtoapi)

Use kubernetes CRD definitions to create Typescript resource constants.
``` bash
crdtomodel --help
# create typescropt constant files in ./tmp dir
mkdir tmp
crdtomodel -i ./examples/forklift/ -o ./tmp
```
## Generate some API

@@ -32,0 +41,0 @@

6

src/findModels.ts

@@ -43,3 +43,3 @@ #!/usr/bin/env node

program
.version("0.0.9")
.version("0.0.10")
.description("Convert CRDs to Group Version Kind Typescript constants")

@@ -118,3 +118,3 @@ .option("-i, --in <file>", "Input directory path - required")

yaml.spec.versions.forEach((version) => {
const name = `${version.name}${yaml.spec.names.kind}`;
const name = `${yaml.spec.names.kind}Model.${version.name}`;

@@ -184,3 +184,3 @@ models[name] = {

for (const [key, model] of Object.entries(data)) {
const fileName = `${model.kind}Model.${model.apiVersion}.ts`
const fileName = `${key}.ts`
const fileText = Mustache.render(FileTemplate, model);

@@ -187,0 +187,0 @@

@@ -13,3 +13,3 @@ #!/usr/bin/env node

program
.version("0.0.9")
.version("0.0.10")
.description("Convert CRDs to OpenAPI file")

@@ -16,0 +16,0 @@ .option("-i, --in <dir>", "Input directory path - required")

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc