function entityId(moduleId, entity) {
  return `${moduleId}:${entity}`;
}
function linkable(moduleId, entities) {
  return Object.fromEntries(entities.map((e) => [e, entityId(moduleId, e)]));
}
function defineLink(base, extension, opts) {
  return { base, extension, ...opts };
}
const cf = {
  text: (key, opts = {}) => ({ key, kind: "text", ...opts }),
  multiline: (key, opts = {}) => ({ key, kind: "multiline", ...opts }),
  integer: (key, opts = {}) => ({ key, kind: "integer", ...opts }),
  float: (key, opts = {}) => ({ key, kind: "float", ...opts }),
  boolean: (key, opts = {}) => ({ key, kind: "boolean", ...opts }),
  select: (key, options, opts = {}) => ({ key, kind: "select", options, ...opts }),
  currency: (key, opts = {}) => ({ key, kind: "currency", ...opts }),
  phone: (key, opts = {}) => ({ key, kind: "phone", ...opts }),
  date: (key, opts = {}) => ({ key, kind: "date", ...opts }),
  datetime: (key, opts = {}) => ({ key, kind: "datetime", ...opts }),
  dictionary: (key, dictionaryId, opts = {}) => ({ key, kind: "dictionary", dictionaryId, ...opts })
};
function defineFields(entity, fields, source) {
  return { entity, fields, source };
}
export {
  cf,
  defineFields,
  defineLink,
  entityId,
  linkable
};
//# sourceMappingURL=dsl.js.map
