Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@xata.io/pgroll

Package Overview
Dependencies
Maintainers
2
Versions
734
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@xata.io/pgroll - npm Package Compare versions

Comparing version 0.0.0-alpha.v2c9ea3dbf19889840778de49c23486c8265974c6 to 0.0.0-alpha.v2cee9cab91cb41aa4404a3ce8f70e16e40bb12a3

14

CHANGELOG.md
# @xata.io/pgroll
## 0.0.0-alpha.v2c9ea3dbf19889840778de49c23486c8265974c6
## 0.0.0-alpha.v2cee9cab91cb41aa4404a3ce8f70e16e40bb12a3

@@ -9,2 +9,14 @@ ### Patch Changes

## 0.6.0
### Minor Changes
- [#1478](https://github.com/xataio/client-ts/pull/1478) [`81a06ca`](https://github.com/xataio/client-ts/commit/81a06ca98f4b46bad8e32bf284cc63ada1ab0dc3) Thanks [@SferaDev](https://github.com/SferaDev)! - Update pgroll package to version 0.6.0
## 0.5.0
### Minor Changes
- [#1372](https://github.com/xataio/client-ts/pull/1372) [`db01bea`](https://github.com/xataio/client-ts/commit/db01bead243bee3910895d391abe21a80b252a8f) Thanks [@SferaDev](https://github.com/SferaDev)! - Bump pgroll version to match v0.5.0
## 0.4.4

@@ -11,0 +23,0 @@

12

package.json
{
"name": "@xata.io/pgroll",
"version": "0.0.0-alpha.v2c9ea3dbf19889840778de49c23486c8265974c6",
"version": "0.0.0-alpha.v2cee9cab91cb41aa4404a3ce8f70e16e40bb12a3",
"description": "Migration tool for PostgreSQL",

@@ -26,10 +26,10 @@ "type": "module",

},
"homepage": "https://github.com/xataio/client-ts/blob/main/importer/README.md",
"homepage": "https://github.com/xataio/client-ts",
"dependencies": {
"zod": "^3.22.4",
"zod-to-json-schema": "^3.22.4"
"zod": "^3.23.8",
"zod-to-json-schema": "^3.23.2"
},
"devDependencies": {
"ts-morph": "^21.0.1",
"tsx": "^4.7.0"
"ts-morph": "^23.0.0",
"tsx": "^4.19.0"
},

@@ -36,0 +36,0 @@ "scripts": {

@@ -7,4 +7,6 @@ import fs from 'fs/promises';

type DefintionType = 'string' | 'boolean' | 'number' | 'null';
type Definition =
| { type: 'string' | 'boolean' | 'number'; description?: string }
| { type: DefintionType | DefintionType[]; description?: string }
| { $ref: string; description?: string }

@@ -22,6 +24,8 @@ | {

const DefinitionTypeSchema = z.enum(['string', 'boolean', 'number', 'null']);
const DefinitionSchema: z.ZodSchema<Definition> = z.lazy(() =>
z.union([
z.object({
type: z.enum(['string', 'boolean', 'number']),
type: z.union([DefinitionTypeSchema, z.array(DefinitionTypeSchema)]),
description: z.string().optional()

@@ -88,15 +92,13 @@ }),

if (definition.type === 'string') {
return 'z.string()';
}
const types = typeof definition.type === 'string' ? [definition.type] : definition.type;
const zodTypes = types.map((type) => {
if (type === 'string') return 'z.string()';
if (type === 'boolean') return 'z.boolean()';
if (type === 'number') return 'z.number()';
if (type === 'null') return 'z.null()';
throw new Error(`Unknown type: ${type}`);
});
if (definition.type === 'boolean') {
return 'z.boolean()';
}
if (definition.type === 'number') {
return 'z.number()';
}
throw new Error(`Unknown type: ${definition.type}`);
if (zodTypes.length === 1) return zodTypes[0];
return `z.union([${zodTypes.join(', ')}])`;
}

@@ -103,0 +105,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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