Skip to content

Commit

Permalink
Merge pull request #65 from moarief/feature/add-more-properties-to-as…
Browse files Browse the repository at this point in the history
…set-type

feat: ✨ Feature: Added more properties to the Asset type
  • Loading branch information
dohomi authored Feb 27, 2024
2 parents 0e1920e + bc10b62 commit 2ed19e4
Showing 1 changed file with 25 additions and 10 deletions.
35 changes: 25 additions & 10 deletions src/genericTypes.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {compile} from "json-schema-to-typescript"
import {JSONSchema4} from "json-schema";
import {BasicType, CompilerOptions} from "./typings";
import { JSONSchema4 } from 'json-schema';
import { compile } from 'json-schema-to-typescript';

import { BasicType, CompilerOptions } from './typings';

const typeFuncs: {
[k in BasicType]: (name: string, options: CompilerOptions) => Promise<string | undefined>
Expand Down Expand Up @@ -35,27 +35,42 @@ async function generateAssetTypeIfNotYetGenerated(title: string, compilerOptions
type: 'object',
required: ['id', 'filename', 'name'],
properties: {
alt: {
type: 'string'
},
copyright: {
_uid: {
type: 'string'
},
id: {
type: 'number'
},
filename: {
alt: {
type: 'string'
},
name: {
type: 'string'
},
focus: {
type: 'string'
},
source: {
type: 'string'
},
title: {
type: 'string'
},
focus: {
filename: {
type: 'string'
}
},
copyright: {
type: 'string'
},
fieldtype: {
type: 'string'
},
meta_data: {
type: ["null", "object"]
},
is_external_url: {
type: 'boolean'
},
}
}
try {
Expand Down

0 comments on commit 2ed19e4

Please sign in to comment.