How to use the amf-client-js.Core function in amf-client-js

To help you get started, we’ve selected a few amf-client-js examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github advanced-rest-client / arc-electron / scripts / packages / amf-service / lib / amf-resolver.js View on Github external
process.on('message', (data) => {
  const {model, type} = data;
  amf.Core.init()
  .then(() => modelToDoc(model))
  .then((doc) => generateEditingResolvedModel(doc, type))
  .then((result) => {
    process.send({api: result});
  })
  .catch((cause) => {
    let m = `AMF parser: Unable to resolve AMF ld+json model.\n`;
    if (cause.message) {
      m += cause.message;
    } else if (cause.toString) {
      m += cause.toString();
    }
    process.send({error: m});
  });
});
github advanced-rest-client / arc-electron / scripts / packages / amf-service / lib / amf-resolver.js View on Github external
function generateEditingResolvedModel(doc, type) {
  const resolver = amf.Core.resolver(type);
  doc = resolver.resolve(doc, 'editing');
  const generator = amf.Core.generator('AMF Graph', 'application/ld+json');
  const opts = amf.render.RenderOptions().withSourceMaps.withCompactUris;
  return generator.generateString(doc, opts);
}
github mulesoft-labs / api-console-cli / lib / generate-json.js View on Github external
_resolve(doc, type) {
    this.logger.info('Resolving API model for API components...');
    const resolver = amf.Core.resolver(type);
    return resolver.resolve(doc, 'editing');
  }
  /**

amf-client-js

AMF Library

Apache-2.0
Latest version published 16 days ago

Package Health Score

87 / 100
Full package analysis

Similar packages