How to use the @accordproject/cicero-core.TemplateLibrary function in @accordproject/cicero-core

To help you get started, we’ve selected a few @accordproject/cicero-core 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 accordproject / template-studio / src / TemplateStudio / index.js View on Github external
async loadTemplateLibrary() {
        const templateLibrary = new TemplateLibrary();
        const templateIndex = await templateLibrary.getTemplateIndex({ latestVersion: true, ciceroVersion });
        const templates = [];
        for (const t in templateIndex) {
            if (Object.prototype.hasOwnProperty.call(templateIndex, t)) {
                templates.push({ key: t, value: `ap://${t}#hash`, text: t });
            }
        }
        this.setState({ templates });
    }
github accordproject / template-studio-v2 / src / sagas / templatesSaga.js View on Github external
export function* pushTemplatesToStore() {
  try {
    const templateLibrary = new TemplateLibrary();
    const templateIndex = yield templateLibrary
      .getTemplateIndex({ latestVersion: false, ciceroVersion });
    const templateIndexArray = Object.values(templateIndex);
    yield put(actions.getTemplatesSuccess(templateIndexArray));
  } catch (err) {
    yield put(appActions.addAppError('Failed to load templates', err));
  }
}
github accordproject / template-studio-v2 / src / sagas / templatesSaga.js View on Github external
export function* pushTemplatesToStore() {
  try {
    const templateLibrary = new TemplateLibrary();
    const templateIndex = yield templateLibrary
      .getTemplateIndex({ latestVersion: true, ciceroVersion });
    const templateIndexArray = Object.values(templateIndex);
    yield put(actions.getTemplatesSuccess(templateIndexArray));
  } catch (err) {
    yield put(appActions.addAppError('Failed to load templates', err));
  }
}