UNPKG

@nymphjs/nymph

Version:

Nymph.js - Nymph ORM

53 lines 1.66 kB
import Entity from './Entity.js'; /** * This class is a test class that extends the Entity class. */ export class TestModel extends Entity { static ETYPE = 'test_model'; static class = 'TestModel'; $privateData = ['boolean']; static searchRestrictedData = ['fish']; $allowlistData = ['string', 'array', 'mdate']; $protectedTags = ['test', 'notag']; $allowlistTags = ['newtag']; constructor() { super(); this.$addTag('test'); this.$data.boolean = true; this.$data.uniques = []; } async $getUniques() { return this.$data.uniques ?? []; } $useProtectedData() { const $allowlistData = this.$allowlistData; const $allowlistTags = this.$allowlistTags; const $protectedData = this.$protectedData; const $protectedTags = this.$protectedTags; delete this.$allowlistData; delete this.$allowlistTags; this.$protectedData = ['number']; this.$protectedTags = []; return () => { this.$allowlistData = $allowlistData; this.$allowlistTags = $allowlistTags; this.$protectedData = $protectedData; this.$protectedTags = $protectedTags; }; } } /** * This class is a test class that extends the Entity class. */ export class TestBModel extends TestModel { static ETYPE = 'test_b_model'; static class = 'TestBModel'; } /** * This class is a test class that extends the Entity class. */ export class TestEmptyModel extends Entity { static ETYPE = 'test_empty_model'; static class = 'TestEmptyModel'; } //# sourceMappingURL=testArtifacts.js.map