| 117 | // VERSIONED |
| 118 | |
| 119 | const versionedProps = linkFragment => ({ |
| 120 | version: { |
| 121 | default: { minor: 0, major: 0, isLatestMajor: true, isLatestMinor: true }, |
| 122 | format: 'version', |
| 123 | title: 'Version', |
| 124 | type: 'object', |
| 125 | readOnly: true, |
| 126 | additionalProperties: false, |
| 127 | properties: { |
| 128 | major: { type: 'number', minimum: 0 }, |
| 129 | minor: { type: 'number', minimum: 0 }, |
| 130 | isLatestMajor: { type: 'boolean' }, |
| 131 | isLatestMinor: { type: 'boolean' }, |
| 132 | }, |
| 133 | }, |
| 134 | |
| 135 | // TODO: figure out useful 'rel' values here |
| 136 | original: me.objectId({ links: [{ rel: 'extra', href: `/db/${linkFragment}/{($)}` }], format: 'hidden' }), |
| 137 | |
| 138 | parent: me.objectId({ links: [{ rel: 'extra', href: `/db/${linkFragment}/{($)}` }], format: 'hidden' }), |
| 139 | creator: me.objectId({ links: [{ rel: 'extra', href: '/db/user/{($)}' }], format: 'hidden' }), |
| 140 | created: me.date({ title: 'Created', readOnly: true }), |
| 141 | commitMessage: { type: 'string', maxLength: 500, title: 'Commit Message', readOnly: true }, |
| 142 | }) |
| 143 | |
| 144 | me.extendVersionedProperties = function (schema, linkFragment) { |
| 145 | if (schema.properties == null) { schema.properties = {} } |