@enterspeed/js-schema-types
TypeScript icon, indicating that this package has built-in type declarations

1.4.1 • Public • Published

Intro

With JavaScript schemas, you can build your schemas in a standard language most developers are already familiar with. This means that you have all the power and flexibility from JavaScript available when you are creating your schemas.

This types package goal is to improve developers experience while working with Enterspeed schemas, by providing types to be used by intellisense.

https://docs.enterspeed.com/reference/js/Intro

How to use this package for local schemas development?

  1. Install package
npm i @enterspeed/js-schema-types
  1. Configure jsconfig.json
{
    "compilerOptions": {
        "strict": true,
        "allowJs": true,
        "checkJs": true,
        "moduleResolution": "node",
        "noEmit": true,
        "target": "ESNext",
        "types": [
            "@enterspeed/js-schema-types"
        ]
    }
}
  1. Decorate your export object with corresponding schema type
/** @type {Enterspeed.FullSchema} */
export default {
  triggers: function(context) {
    context.triggers('umbraco', ['page', 'article']);
  },
  actions: function(sourceEntity, context) {
    context.reprocess('anotherSchema').bySchema();
    context.destination('algolia');
  },
  routes: (sourceEntity, context) => context.url(sourceEntity.url),
  properties: function (sourceEntity, context) {
    const p = sourceEntity.properties;
    return {
      title: p.title,
      blocks: context.partial("blocks", p.blocks),
      aboutUsPage: context.reference("page").children('type eq `product`').orderBy({direction: 'asc', propertyName: 'asd' }).limit(2),
    }
  }
}

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.5.143beta
1.4.131latest

Version History

VersionDownloads (Last 7 Days)Published
1.5.143
1.5.048
1.4.131
1.4.00
1.3.00
1.2.2-beta.10
1.2.10
1.1.20
1.2.1-beta.10
1.1.10
1.1.00
1.2.0-beta.10
1.1.0-beta.10
1.0.00

Package Sidebar

Install

npm i @enterspeed/js-schema-types

Weekly Downloads

117

Version

1.4.1

License

MIT

Unpacked Size

28.2 kB

Total Files

4

Last publish

Collaborators

  • elgarslogins
  • alexkarlsen
  • jesperweber
  • emilras