amf-client-js 5.2.3 → 5.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/amf.js +11560 -11435
  2. package/package.json +1 -1
  3. package/typings/amf-client-js.d.ts +350 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "amf-client-js",
3
- "version": "5.2.3",
3
+ "version": "5.2.4",
4
4
  "description": "AMF Library",
5
5
  "main": "amf.js",
6
6
  "author": "amf team",
@@ -590,6 +590,9 @@ declare module "amf-client-js" {
590
590
 
591
591
  validate(schema: undefined, data: undefined): boolean;
592
592
  }
593
+ export interface AmfObjectWrapper extends Annotable {
594
+ annotations(): Annotations;
595
+ }
593
596
  export class AmlDomainElementEmitter {
594
597
  static emitToBuilder<T>(
595
598
  element: DomainElement,
@@ -825,6 +828,9 @@ declare module "amf-client-js" {
825
828
  export interface Annotable {
826
829
  annotations(): Annotations;
827
830
  }
831
+ export interface JsonLDElement extends Annotable {
832
+ annotations(): Annotations;
833
+ }
828
834
  export class AnnotationMapping implements DomainElement {
829
835
  customDomainProperties: Array<DomainExtension>;
830
836
  extendsNode: Array<DomainElement>;
@@ -1348,6 +1354,33 @@ declare module "amf-client-js" {
1348
1354
 
1349
1355
  fetch(resource: string): Promise<Content>;
1350
1356
  }
1357
+ export class BaseIri implements DomainElement {
1358
+ customDomainProperties: Array<DomainExtension>;
1359
+ extendsNode: Array<DomainElement>;
1360
+ id: string;
1361
+ iri: StrField;
1362
+ isExternalLink: BoolField;
1363
+ nulled: BoolField;
1364
+ position: Range;
1365
+
1366
+ constructor();
1367
+
1368
+ annotations(): Annotations;
1369
+
1370
+ graph(): Graph;
1371
+
1372
+ withCustomDomainProperties(extensions: Array<DomainExtension>): this;
1373
+
1374
+ withExtendsNode(extension: Array<ParametrizedDeclaration>): this;
1375
+
1376
+ withId(id: string): this;
1377
+
1378
+ withIri(iri: string): this;
1379
+
1380
+ withIsExternalLink(isExternalLink: boolean): DomainElement;
1381
+
1382
+ withNulled(nulled: boolean): this;
1383
+ }
1351
1384
  export class BaseShapesConfiguration extends BaseAMLConfiguration {
1352
1385
  withDialect(dialect: Dialect): BaseShapesConfiguration;
1353
1386
 
@@ -1385,7 +1418,7 @@ declare module "amf-client-js" {
1385
1418
 
1386
1419
  toRamlDatatype(element: AnyShape): string;
1387
1420
  }
1388
- export interface BaseUnit {
1421
+ export interface BaseUnit extends AmfObjectWrapper {
1389
1422
  id: string;
1390
1423
  location: string;
1391
1424
  modelVersion: StrField;
@@ -1428,7 +1461,7 @@ declare module "amf-client-js" {
1428
1461
 
1429
1462
  withUsage(usage: string): this;
1430
1463
  }
1431
- export class BaseUnitProcessingData {
1464
+ export class BaseUnitProcessingData implements AmfObjectWrapper {
1432
1465
  transformed: BoolField;
1433
1466
 
1434
1467
  constructor();
@@ -1437,7 +1470,7 @@ declare module "amf-client-js" {
1437
1470
 
1438
1471
  withTransformed(value: boolean): this;
1439
1472
  }
1440
- export class BaseUnitSourceInformation {
1473
+ export class BaseUnitSourceInformation implements AmfObjectWrapper {
1441
1474
  additionalLocations: Array<LocationInformation>;
1442
1475
  rootLocation: StrField;
1443
1476
 
@@ -1621,6 +1654,42 @@ declare module "amf-client-js" {
1621
1654
  constructor(stream: string, url: string, mime: string);
1622
1655
  readonly url: string;
1623
1656
  }
1657
+ export class ContextMapping implements DomainElement {
1658
+ alias: StrField;
1659
+ coercion: StrField;
1660
+ containers: Array<StrField>;
1661
+ customDomainProperties: Array<DomainExtension>;
1662
+ extendsNode: Array<DomainElement>;
1663
+ id: string;
1664
+ iri: StrField;
1665
+ isExternalLink: BoolField;
1666
+ nulled: BoolField;
1667
+ position: Range;
1668
+
1669
+ constructor();
1670
+
1671
+ annotations(): Annotations;
1672
+
1673
+ graph(): Graph;
1674
+
1675
+ withAlias(alias: string): this;
1676
+
1677
+ withCoercion(coersion: string): this;
1678
+
1679
+ withContainers(containers: Array<string>): this;
1680
+
1681
+ withCustomDomainProperties(extensions: Array<DomainExtension>): this;
1682
+
1683
+ withExtendsNode(extension: Array<ParametrizedDeclaration>): this;
1684
+
1685
+ withId(id: string): this;
1686
+
1687
+ withIri(iri: string): this;
1688
+
1689
+ withIsExternalLink(isExternalLink: boolean): DomainElement;
1690
+
1691
+ withNulled(nulled: boolean): this;
1692
+ }
1624
1693
  export class CorrelationId implements DomainElement, Linkable {
1625
1694
  customDomainProperties: Array<DomainExtension>;
1626
1695
  description: StrField;
@@ -1694,6 +1763,33 @@ declare module "amf-client-js" {
1694
1763
 
1695
1764
  withUrl(url: string): this;
1696
1765
  }
1766
+ export class CuriePrefix implements DomainElement {
1767
+ alias: StrField;
1768
+ customDomainProperties: Array<DomainExtension>;
1769
+ extendsNode: Array<DomainElement>;
1770
+ id: string;
1771
+ iri: StrField;
1772
+ isExternalLink: BoolField;
1773
+ position: Range;
1774
+
1775
+ constructor();
1776
+
1777
+ annotations(): Annotations;
1778
+
1779
+ graph(): Graph;
1780
+
1781
+ withAlias(alias: string): this;
1782
+
1783
+ withCustomDomainProperties(extensions: Array<DomainExtension>): this;
1784
+
1785
+ withExtendsNode(extension: Array<ParametrizedDeclaration>): this;
1786
+
1787
+ withId(id: string): this;
1788
+
1789
+ withIri(iri: string): this;
1790
+
1791
+ withIsExternalLink(isExternalLink: boolean): DomainElement;
1792
+ }
1697
1793
  export class CustomDomainProperty implements DomainElement, Linkable {
1698
1794
  customDomainProperties: Array<DomainExtension>;
1699
1795
  description: StrField;
@@ -1797,7 +1893,7 @@ declare module "amf-client-js" {
1797
1893
  export class DatatypePropertyTerm extends PropertyTerm {
1798
1894
  constructor();
1799
1895
  }
1800
- export interface DeclaresModel {
1896
+ export interface DeclaresModel extends AmfObjectWrapper {
1801
1897
  declares: Array<DomainElement>;
1802
1898
 
1803
1899
  annotations(): Annotations;
@@ -1809,6 +1905,30 @@ declare module "amf-client-js" {
1809
1905
  export class DefaultExecutionEnvironment {
1810
1906
  static apply(): ExecutionEnvironment;
1811
1907
  }
1908
+ export class DefaultVocabulary implements DomainElement {
1909
+ customDomainProperties: Array<DomainExtension>;
1910
+ extendsNode: Array<DomainElement>;
1911
+ id: string;
1912
+ iri: StrField;
1913
+ isExternalLink: BoolField;
1914
+ position: Range;
1915
+
1916
+ constructor();
1917
+
1918
+ annotations(): Annotations;
1919
+
1920
+ graph(): Graph;
1921
+
1922
+ withCustomDomainProperties(extensions: Array<DomainExtension>): this;
1923
+
1924
+ withExtendsNode(extension: Array<ParametrizedDeclaration>): this;
1925
+
1926
+ withId(id: string): this;
1927
+
1928
+ withIri(iri: string): this;
1929
+
1930
+ withIsExternalLink(isExternalLink: boolean): DomainElement;
1931
+ }
1812
1932
  export class DetectedSyntaxMediaTypeEvent {}
1813
1933
  export class Dialect implements BaseUnit, EncodesModel, DeclaresModel {
1814
1934
  allHeaders: Array<string>;
@@ -2626,7 +2746,7 @@ declare module "amf-client-js" {
2626
2746
 
2627
2747
  withType(type: string): this;
2628
2748
  }
2629
- export interface EncodesModel {
2749
+ export interface EncodesModel extends AmfObjectWrapper {
2630
2750
  encodes: DomainElement;
2631
2751
 
2632
2752
  withEncodes(encoded: DomainElement): this;
@@ -3296,6 +3416,188 @@ declare module "amf-client-js" {
3296
3416
  configuration: AMFGraphConfiguration
3297
3417
  ): BaseUnit;
3298
3418
  }
3419
+ export class JsonLDArray {
3420
+ jsonLDElements: Array<JsonLDElement>;
3421
+
3422
+ constructor();
3423
+ }
3424
+ export class JsonLDError {
3425
+ constructor();
3426
+ }
3427
+ export class JsonLDInstanceDocument implements BaseUnit {
3428
+ encodes: Array<JsonLDElement>;
3429
+ id: string;
3430
+ location: string;
3431
+ modelVersion: StrField;
3432
+ processingData: BaseUnitProcessingData;
3433
+ raw: undefined | string;
3434
+ sourceInformation: BaseUnitSourceInformation;
3435
+ sourceSpec: undefined | Spec;
3436
+ usage: StrField;
3437
+
3438
+ constructor();
3439
+
3440
+ annotations(): Annotations;
3441
+
3442
+ cloneUnit(): BaseUnit;
3443
+
3444
+ findById(id: string): undefined | DomainElement;
3445
+
3446
+ findByType(typeId: string): Array<DomainElement>;
3447
+
3448
+ pkg(): StrField;
3449
+
3450
+ references(): Array<BaseUnit>;
3451
+
3452
+ withEncodes(encodes: Array<JsonLDElement>): this;
3453
+
3454
+ withId(id: string): this;
3455
+
3456
+ withLocation(location: string): this;
3457
+
3458
+ withPkg(pkg: string): this;
3459
+
3460
+ withProcessingData(data: BaseUnitProcessingData): this;
3461
+
3462
+ withRaw(raw: string): this;
3463
+
3464
+ withReferenceAlias(
3465
+ alias: string,
3466
+ id: string,
3467
+ fullUrl: string,
3468
+ relativeUrl: string
3469
+ ): BaseUnit;
3470
+
3471
+ withReferences(references: Array<BaseUnit>): this;
3472
+
3473
+ withUsage(usage: string): this;
3474
+ }
3475
+ export class JsonLDInstanceResult extends AMFParseResult {
3476
+ readonly instance: JsonLDInstanceDocument;
3477
+ }
3478
+ export class JsonLDObject implements DomainElement {
3479
+ componentId: string;
3480
+ customDomainProperties: Array<DomainExtension>;
3481
+ extendsNode: Array<DomainElement>;
3482
+ id: string;
3483
+ isExternalLink: BoolField;
3484
+ position: Range;
3485
+
3486
+ constructor();
3487
+
3488
+ annotations(): Annotations;
3489
+
3490
+ graph(): Graph;
3491
+
3492
+ withBoolPropertyCollection(
3493
+ property: string,
3494
+ values: Array<boolean>
3495
+ ): JsonLDObject;
3496
+
3497
+ withCustomDomainProperties(extensions: Array<DomainExtension>): this;
3498
+
3499
+ withExtendsNode(extension: Array<ParametrizedDeclaration>): this;
3500
+
3501
+ withFloatPropertyCollection(
3502
+ property: string,
3503
+ values: Array<number>
3504
+ ): JsonLDObject;
3505
+
3506
+ withId(id: string): this;
3507
+
3508
+ withIntPropertyCollection(
3509
+ property: string,
3510
+ values: Array<number>
3511
+ ): JsonLDObject;
3512
+
3513
+ withIsExternalLink(isExternalLink: boolean): DomainElement;
3514
+
3515
+ withObjPropertyCollection(
3516
+ property: string,
3517
+ values: Array<JsonLDObject>
3518
+ ): JsonLDObject;
3519
+
3520
+ withProperty(property: string, value: number): JsonLDObject;
3521
+
3522
+ withProperty(property: string, value: JsonLDObject): JsonLDObject;
3523
+
3524
+ withProperty(property: string, value: boolean): JsonLDObject;
3525
+
3526
+ withProperty(property: string, value: string): JsonLDObject;
3527
+
3528
+ withStringPropertyCollection(
3529
+ property: string,
3530
+ values: Array<string>
3531
+ ): JsonLDObject;
3532
+ }
3533
+ export class JsonLDScalar {
3534
+ readonly dataType: string;
3535
+ readonly value: any;
3536
+
3537
+ constructor(value: any, dataType: string);
3538
+
3539
+ annotations(): any;
3540
+ }
3541
+ export class JsonLDSchemaConfiguration extends BaseShapesConfiguration {
3542
+ static JsonLDSchema(): JsonLDSchemaConfiguration;
3543
+
3544
+ baseUnitClient(): JsonLDSchemaConfigurationClient;
3545
+
3546
+ elementClient(): JsonLDSchemaElementClient;
3547
+
3548
+ forInstance(url: string): Promise<JsonLDSchemaConfiguration>;
3549
+
3550
+ withDialect(dialect: Dialect): JsonLDSchemaConfiguration;
3551
+
3552
+ withDialect(url: string): Promise<JsonLDSchemaConfiguration>;
3553
+
3554
+ withErrorHandlerProvider(
3555
+ provider: ErrorHandlerProvider
3556
+ ): JsonLDSchemaConfiguration;
3557
+
3558
+ withEventListener(listener: AMFEventListener): JsonLDSchemaConfiguration;
3559
+
3560
+ withExecutionEnvironment(
3561
+ executionEnv: ExecutionEnvironment
3562
+ ): JsonLDSchemaConfiguration;
3563
+
3564
+ withParsingOptions(
3565
+ parsingOptions: ParsingOptions
3566
+ ): JsonLDSchemaConfiguration;
3567
+
3568
+ withRenderOptions(renderOptions: RenderOptions): JsonLDSchemaConfiguration;
3569
+
3570
+ withResourceLoader(rl: ResourceLoader): JsonLDSchemaConfiguration;
3571
+
3572
+ withResourceLoaders(rl: Array<ResourceLoader>): JsonLDSchemaConfiguration;
3573
+
3574
+ withTransformationPipeline(
3575
+ pipeline: TransformationPipeline
3576
+ ): JsonLDSchemaConfiguration;
3577
+
3578
+ withUnitCache(cache: UnitCache): JsonLDSchemaConfiguration;
3579
+ }
3580
+ export class JsonLDSchemaConfigurationClient extends BaseAMLBaseUnitClient {
3581
+ getConfiguration(): JsonLDSchemaConfiguration;
3582
+
3583
+ parseJsonLDInstance(
3584
+ url: string,
3585
+ jsonLDSchema: JsonSchemaDocument
3586
+ ): Promise<JsonLDInstanceResult>;
3587
+
3588
+ parseJsonLDSchema(url: string): Promise<JsonLDSchemaResult>;
3589
+ }
3590
+ export class JsonLDSchemaElementClient extends BaseAMLElementClient {
3591
+ getConfiguration(): JsonLDSchemaConfiguration;
3592
+
3593
+ renderToBuilder<T>(
3594
+ element: DomainElement,
3595
+ builder: org.yaml.builder.JsOutputBuilder
3596
+ ): void;
3597
+ }
3598
+ export class JsonLDSchemaResult extends AMFParseResult {
3599
+ readonly jsonDocument: JsonSchemaDocument;
3600
+ }
3299
3601
  export class JsonSchemaConfiguration {
3300
3602
  static JsonSchema(): ShapesConfiguration;
3301
3603
  }
@@ -3507,7 +3809,7 @@ declare module "amf-client-js" {
3507
3809
 
3508
3810
  withLinkTarget(target: undefined): this;
3509
3811
  }
3510
- export class LocationInformation {
3812
+ export class LocationInformation implements AmfObjectWrapper {
3511
3813
  locationValue: StrField;
3512
3814
 
3513
3815
  constructor();
@@ -5580,6 +5882,48 @@ declare module "amf-client-js" {
5580
5882
  content: string
5581
5883
  ): Promise<AMFSemanticSchemaResult>;
5582
5884
  }
5885
+ export class SemanticContext implements DomainElement {
5886
+ base: undefined | BaseIri;
5887
+ curies: Array<CuriePrefix>;
5888
+ customDomainProperties: Array<DomainExtension>;
5889
+ extendsNode: Array<DomainElement>;
5890
+ id: string;
5891
+ iri: StrField;
5892
+ isExternalLink: BoolField;
5893
+ mapping: Array<ContextMapping>;
5894
+ overrideMappings: Array<StrField>;
5895
+ position: Range;
5896
+ typeMappings: Array<StrField>;
5897
+ vocab: undefined | DefaultVocabulary;
5898
+
5899
+ constructor();
5900
+
5901
+ annotations(): Annotations;
5902
+
5903
+ graph(): Graph;
5904
+
5905
+ withBase(base: BaseIri): this;
5906
+
5907
+ withCuries(curies: Array<CuriePrefix>): this;
5908
+
5909
+ withCustomDomainProperties(extensions: Array<DomainExtension>): this;
5910
+
5911
+ withExtendsNode(extension: Array<ParametrizedDeclaration>): this;
5912
+
5913
+ withId(id: string): this;
5914
+
5915
+ withIri(iri: string): this;
5916
+
5917
+ withIsExternalLink(isExternalLink: boolean): DomainElement;
5918
+
5919
+ withMapping(mapping: Array<ContextMapping>): this;
5920
+
5921
+ withOverrideMappings(overrideMappings: Array<string>): this;
5922
+
5923
+ withTypeMappings(typeMappings: Array<string>): this;
5924
+
5925
+ withVocab(vocab: DefaultVocabulary): this;
5926
+ }
5583
5927
  export class SemanticExtension implements DomainElement {
5584
5928
  customDomainProperties: Array<DomainExtension>;
5585
5929
  extendsNode: Array<DomainElement>;