Skip to content

Commit

Permalink
Regenerate
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-c committed May 17, 2024
1 parent 1290fb1 commit f157d6a
Show file tree
Hide file tree
Showing 115 changed files with 1,521 additions and 359 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,12 @@
"chai-as-promised": "^7.1.1",
"mocha": "^9.1.3",
"nyc": "^15.1.0",
"rimraf": "^3.0.2",
"sinon": "^12.0.1",
"ts-node": "^10.4.0",
"typedoc": "^0.22.10",
"typescript": "^4.4.4"
"typescript": "^4.4.4",
"codecov.io": "^0.1.6",
"rimraf": "^3.0.2"
},
"dependencies": {
"js-yaml": "^4.1.0",
Expand Down
14 changes: 9 additions & 5 deletions src/ArraySchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ export class ArraySchema extends Saveable implements Internal.ArraySchemaPropert
/**
* Defines the type of the array elements.
*/
items: Internal.PrimitiveType | Internal.RecordSchema | Internal.EnumSchema | Internal.ArraySchema | string | Array<Internal.PrimitiveType | Internal.RecordSchema | Internal.EnumSchema | Internal.ArraySchema | string>
items: Internal.PrimitiveType | Internal.RecordSchema | Internal.EnumSchema | Internal.ArraySchema | Internal.MapSchema | Internal.UnionSchema | string | Array<Internal.PrimitiveType | Internal.RecordSchema | Internal.EnumSchema | Internal.ArraySchema | Internal.MapSchema | Internal.UnionSchema | string>

/**
* Must be `array`
*/
type: Internal.enum_d062602be0b4b8fd33e69e29a841317b6ab665bc
type: Internal.Array_name


constructor ({loadingOptions, extensionFields, items, type} : {loadingOptions?: LoadingOptions} & Internal.ArraySchemaProperties) {
Expand Down Expand Up @@ -57,7 +57,7 @@ export class ArraySchema extends Saveable implements Internal.ArraySchemaPropert

let items
try {
items = await loadField(_doc.items, LoaderInstances.typedslunionOfPrimitiveTypeLoaderOrRecordSchemaLoaderOrEnumSchemaLoaderOrArraySchemaLoaderOrstrtypeOrarrayOfunionOfPrimitiveTypeLoaderOrRecordSchemaLoaderOrEnumSchemaLoaderOrArraySchemaLoaderOrstrtype2,
items = await loadField(_doc.items, LoaderInstances.uriunionOfPrimitiveTypeLoaderOrRecordSchemaLoaderOrEnumSchemaLoaderOrArraySchemaLoaderOrMapSchemaLoaderOrUnionSchemaLoaderOrstrtypeOrarrayOfunionOfPrimitiveTypeLoaderOrRecordSchemaLoaderOrEnumSchemaLoaderOrArraySchemaLoaderOrMapSchemaLoaderOrUnionSchemaLoaderOrstrtypeFalseTrue2None,
baseuri, loadingOptions)
} catch (e) {
if (e instanceof ValidationException) {
Expand All @@ -71,7 +71,7 @@ export class ArraySchema extends Saveable implements Internal.ArraySchemaPropert

let type
try {
type = await loadField(_doc.type, LoaderInstances.typedslenum_d062602be0b4b8fd33e69e29a841317b6ab665bcLoader2,
type = await loadField(_doc.type, LoaderInstances.typedslArray_nameLoader2,
baseuri, loadingOptions)
} catch (e) {
if (e instanceof ValidationException) {
Expand Down Expand Up @@ -120,7 +120,11 @@ export class ArraySchema extends Saveable implements Internal.ArraySchemaPropert
}

if (this.items != null) {
r.items = save(this.items, false, baseUrl, relativeUris)
const u = saveRelativeUri(this.items, baseUrl, false,
relativeUris, 2)
if (u != null) {
r.items = u
}
}

if (this.type != null) {
Expand Down
4 changes: 2 additions & 2 deletions src/ArraySchemaProperties.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ export interface ArraySchemaProperties {
/**
* Defines the type of the array elements.
*/
items: Internal.PrimitiveType | Internal.RecordSchema | Internal.EnumSchema | Internal.ArraySchema | string | Array<Internal.PrimitiveType | Internal.RecordSchema | Internal.EnumSchema | Internal.ArraySchema | string>
items: Internal.PrimitiveType | Internal.RecordSchema | Internal.EnumSchema | Internal.ArraySchema | Internal.MapSchema | Internal.UnionSchema | string | Array<Internal.PrimitiveType | Internal.RecordSchema | Internal.EnumSchema | Internal.ArraySchema | Internal.MapSchema | Internal.UnionSchema | string>

/**
* Must be `array`
*/
type: Internal.enum_d062602be0b4b8fd33e69e29a841317b6ab665bc
type: Internal.Array_name
}
4 changes: 4 additions & 0 deletions src/Array_name.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

export enum Array_name {
ARRAY='array',
}
146 changes: 146 additions & 0 deletions src/CWLArraySchema.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@

import {
Dictionary,
expandUrl,
loadField,
LoaderInstances,
LoadingOptions,
Saveable,
ValidationException,
prefixUrl,
save,
saveRelativeUri
} from './util/Internal'
import { v4 as uuidv4 } from 'uuid'
import * as Internal from './util/Internal'


/**
* Auto-generated class implementation for https://w3id.org/cwl/cwl#CWLArraySchema
*/
export class CWLArraySchema extends Saveable implements Internal.CWLArraySchemaProperties {
extensionFields?: Internal.Dictionary<any>

/**
* Defines the type of the array elements.
*/
items: Internal.PrimitiveType | Internal.CWLRecordSchema | Internal.EnumSchema | Internal.CWLArraySchema | string | Array<Internal.PrimitiveType | Internal.CWLRecordSchema | Internal.EnumSchema | Internal.CWLArraySchema | string>

/**
* Must be `array`
*/
type: Internal.Array_name


constructor ({loadingOptions, extensionFields, items, type} : {loadingOptions?: LoadingOptions} & Internal.CWLArraySchemaProperties) {
super(loadingOptions)
this.extensionFields = extensionFields ?? {}
this.items = items
this.type = type
}

/**
* Used to construct instances of {@link CWLArraySchema }.
*
* @param __doc Document fragment to load this record object from.
* @param baseuri Base URI to generate child document IDs against.
* @param loadingOptions Context for loading URIs and populating objects.
* @param docRoot ID at this position in the document (if available)
* @returns An instance of {@link CWLArraySchema }
* @throws {@link ValidationException} If the document fragment is not a
* {@link Dictionary} or validation of fields fails.
*/
static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions,
docRoot?: string): Promise<Saveable> {
const _doc = Object.assign({}, __doc)
const __errors: ValidationException[] = []

let items
try {
items = await loadField(_doc.items, LoaderInstances.uriunionOfPrimitiveTypeLoaderOrCWLRecordSchemaLoaderOrEnumSchemaLoaderOrCWLArraySchemaLoaderOrstrtypeOrarrayOfunionOfPrimitiveTypeLoaderOrCWLRecordSchemaLoaderOrEnumSchemaLoaderOrCWLArraySchemaLoaderOrstrtypeFalseTrue2None,
baseuri, loadingOptions)
} catch (e) {
if (e instanceof ValidationException) {
__errors.push(
new ValidationException('the `items` field is not valid because: ', [e])
)
} else {
throw e
}
}

let type
try {
type = await loadField(_doc.type, LoaderInstances.typedslArray_nameLoader2,
baseuri, loadingOptions)
} catch (e) {
if (e instanceof ValidationException) {
__errors.push(
new ValidationException('the `type` field is not valid because: ', [e])
)
} else {
throw e
}
}

const extensionFields: Dictionary<any> = {}
for (const [key, value] of Object.entries(_doc)) {
if (!CWLArraySchema.attr.has(key)) {
if ((key as string).includes(':')) {
const ex = expandUrl(key, '', loadingOptions, false, false)
extensionFields[ex] = value
} else {
__errors.push(
new ValidationException(`invalid field ${key as string}, \
expected one of: \`items\`,\`type\``)
)
break
}
}
}

if (__errors.length > 0) {
throw new ValidationException("Trying 'CWLArraySchema'", __errors)
}

const schema = new CWLArraySchema({
extensionFields: extensionFields,
loadingOptions: loadingOptions,
items: items,
type: type
})
return schema
}

save (top: boolean = false, baseUrl: string = '', relativeUris: boolean = true)
: Dictionary<any> {
const r: Dictionary<any> = {}
for (const ef in this.extensionFields) {
r[prefixUrl(ef, this.loadingOptions.vocab)] = this.extensionFields.ef
}

if (this.items != null) {
const u = saveRelativeUri(this.items, baseUrl, false,
relativeUris, 2)
if (u != null) {
r.items = u
}
}

if (this.type != null) {
r.type = save(this.type, false, baseUrl, relativeUris)
}

if (top) {
if (this.loadingOptions.namespaces != null) {
r.$namespaces = this.loadingOptions.namespaces
}
if (this.loadingOptions.schemas != null) {
r.$schemas = this.loadingOptions.schemas
}
}
return r
}

static attr: Set<string> = new Set(['items','type'])
}
21 changes: 21 additions & 0 deletions src/CWLArraySchemaProperties.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

import * as Internal from './util/Internal'


/**
* Auto-generated interface for https://w3id.org/cwl/cwl#CWLArraySchema
*/
export interface CWLArraySchemaProperties extends Internal.ArraySchemaProperties {

extensionFields?: Internal.Dictionary<any>

/**
* Defines the type of the array elements.
*/
items: Internal.PrimitiveType | Internal.CWLRecordSchema | Internal.EnumSchema | Internal.CWLArraySchema | string | Array<Internal.PrimitiveType | Internal.CWLRecordSchema | Internal.EnumSchema | Internal.CWLArraySchema | string>

/**
* Must be `array`
*/
type: Internal.Array_name
}
Loading

0 comments on commit f157d6a

Please sign in to comment.