@warp-drive/schema-record 0.0.0-alpha.101

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE.md ADDED
@@ -0,0 +1,12 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (C) 2023 EmberData and WarpDrive contributors
4
+ Copyright (C) 2017-2022 Ember.js contributors
5
+ Portions Copyright (C) 2011-2017 Tilde, Inc. and contributors.
6
+ Portions Copyright (C) 2011 LivingSocial Inc.
7
+
8
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
11
+
12
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,4 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="1200pt" height="1200pt" version="1.1" viewBox="0 0 1200 1200" xmlns="http://www.w3.org/2000/svg">
3
+ <path fill="#0969da" d="m1096.3 402.82c-53.148-53.008-117.12-79.516-191.93-79.516-67.488 0-126.55 21.938-177.16 65.805-50.617 43.871-80.988 98.285-91.113 163.25l53.57 4.2188c14.625 0.28125 25.449 6.75 32.48 19.406h18.984c11.809 0 17.715 5.7617 17.715 17.293s-5.9062 17.293-17.715 17.293h-17.297c-6.75 14.344-18.137 21.797-34.168 22.359l-53.57 4.6406c10.125 64.68 40.496 118.95 91.113 162.82 50.617 43.871 109.68 65.805 177.16 65.805 74.805 0 138.78-26.574 191.93-79.723 53.152-53.148 79.727-116.98 79.727-191.51 0-75.086-26.574-139.13-79.727-192.14zm-79.422 185.27c0 2.9531 2.3906 5.3477 5.3438 5.3477 2.9531 0 5.3477-2.3945 5.3477-5.3477 0-2.9492-2.3945-5.3438-5.3477-5.3438-2.9531 0-5.3438 2.3945-5.3438 5.3438zm-104.54-111.07c0 2.9531 2.3945 5.3477 5.3438 5.3477 2.9531 0 5.3477-2.3945 5.3477-5.3477s-2.3945-5.3438-5.3477-5.3438c-2.9492 0-5.3438 2.3906-5.3438 5.3438zm-12.473 0c0 2.9531 2.3906 5.3477 5.3438 5.3477s5.3477-2.3945 5.3477-5.3477-2.3945-5.3438-5.3477-5.3438-5.3438 2.3906-5.3438 5.3438zm117.01 123.55c0 2.9492 2.3906 5.3438 5.3438 5.3438 2.9531 0 5.3477-2.3945 5.3477-5.3438 0-2.9531-2.3945-5.3477-5.3477-5.3477-2.9531 0-5.3438 2.3945-5.3438 5.3477zm-104.54 111.66c0 2.9531 2.3945 5.3477 5.3438 5.3477 2.9531 0 5.3477-2.3945 5.3477-5.3477s-2.3945-5.3438-5.3477-5.3438c-2.9492 0-5.3438 2.3906-5.3438 5.3438zm-12.473 0c0 2.9531 2.3906 5.3477 5.3438 5.3477s5.3477-2.3945 5.3477-5.3477-2.3945-5.3438-5.3477-5.3438-5.3438 2.3906-5.3438 5.3438zm-848-318.48c14.062-2.5312 30.934-4.5 50.621-5.9062l-46.402-0.84375zm499.86 169.15c-8.7188-2.25-18.141-8.7188-28.266-19.402l-101.23-103.35h-111.36l173.79 126.12v4.2188c21.652 6.1836 44.008 3.6562 67.07-7.5938zm47.664-148.48c-0.84375 3.3711-2.8125 6.6055-5.9062 9.6992h-5.0625l-6.3242-5.0625h-79.305v-4.6367zm-5.9062-16.031c3.0938 3.0938 5.0625 6.4688 5.9062 10.125h-96.598v-4.6406h79.305l6.3242-5.4844zm-541.62 397.78 4.2188 6.7461 46.402-0.84375c-22.5-2.2461-39.371-4.2148-50.621-5.9023zm499.86-169.15c-23.062-11.531-45.418-14.062-67.07-7.5938v4.2188l-173.79 126.12h111.36l101.23-103.77c10.406-10.684 19.828-17.012 28.266-18.98zm47.664 148.48h-96.598v-4.6406h79.305l6.3242-5.4805h5.0625c3.0938 3.6523 5.0625 7.0273 5.9062 10.121zm-5.9062 15.609h-5.0625l-6.3242-5.0625h-79.305v-4.6406h96.598c-0.84375 3.0938-2.8125 6.3281-5.9062 9.7031zm-102.5 9.6992c3.6562 1.4062 7.4531 2.1094 11.391 2.1094h64.961c24.746 0 37.121-8.4336 37.121-25.309 0-8.4375-4.6406-14.691-13.922-18.77-9.2773-4.0781-17.012-6.1172-23.199-6.1172h-64.961c-4.7812 0-8.5781 0.5625-11.391 1.6875h-333.66c-5.0625 0-28.543 1.6172-70.445 4.8516-41.902 3.2344-62.852 7.3828-62.852 12.441v11.812c0 4.5 20.949 8.5078 62.852 12.023 41.902 3.5156 65.383 5.2695 70.445 5.2695zm125.28-207.54h-42.602c-3.375 1.125-3.375 2.25 0 3.375h42.602zm-43.445 8.4375h-5.4844v-13.5h5.4844c17.152-6.1875 33.605-9.9844 49.352-11.391l4.6406-25.309 4.6406 0.42188c0.5625-4.2188 1.6875-10.262 3.375-18.137-28.684-0.5625-64.398 1.6875-107.14 6.75 3.6562 4.2148 7.4531 7.8711 11.391 10.965 4.7812 3.375 9.4219 5.625 13.918 6.75l12.656 2.9531-11.812 5.9062c-13.496 6.75-30.23 10.121-50.195 10.121-5.0625 0-8.5781-0.14062-10.547-0.42188-4.2188-0.5625-7.5898-1.1211-10.121-1.6836l-3.375-1.2656v-5.4844l-24.043-17.297c-41.34 5.625-69.32 8.5781-83.945 8.8594-31.496 0.28125-47.242 11.953-47.242 35.012 0 22.215 15.746 33.887 47.242 35.012 18.844 0.28125 46.824 3.2344 83.945 8.8594l24.043-17.297v-5.4844l3.375-1.2656c2.5312-0.84375 5.9023-1.4062 10.121-1.6875 1.9688-0.28125 5.4844-0.42187 10.547-0.42187 19.965 0 36.699 3.375 50.195 10.125l11.812 5.4844-12.656 3.375c-4.4961 0.84375-9.1367 3.0938-13.918 6.75-3.6562 2.2461-7.4531 5.7617-11.391 10.543 40.777 5.0625 76.492 7.4531 107.14 7.1719-1.6875-7.3125-2.8125-13.359-3.375-18.137h-4.6406l-4.6406-24.891c-17.434-2.25-33.887-6.043-49.352-11.387zm48.508-20.25c-12.652 1.6875-23.762 3.9375-33.324 6.75h29.105l3.7969-4.2188zm-4.2188 20.25h-29.105c9.5625 2.5312 20.672 4.7812 33.324 6.7461l-0.42188-2.5273zm136.67-8.4375c0-8.4375-4.2188-12.656-12.652-12.656h-21.516c-6.4688-12.652-16.59-18.98-30.371-18.98l-58.211-5.0625-5.9062 29.527-4.2188 5.0625v7.5938l4.2188 5.0625 5.9062 29.105 58.211-5.0625c15.469 0 26.012-7.3125 31.637-21.934h20.25c8.4336 0 12.652-4.2188 12.652-12.656zm-46.82 1.6875c0-11.531-5.9062-17.297-17.719-17.297-11.527 0-17.293 5.7656-17.293 17.297 0 11.812 5.7656 17.715 17.293 17.715 11.812 0 17.719-5.9023 17.719-17.715zm4.6406 0c0 14.902-7.4531 22.355-22.359 22.355-14.902 0-22.355-7.4531-22.355-22.355 0-14.906 7.4531-22.355 22.355-22.355 14.906 0 22.359 7.4492 22.359 22.355zm-13.922 0c0-5.625-2.8125-8.4375-8.4375-8.4375-5.3438 0-8.0156 2.8125-8.0156 8.4375s2.6719 8.4375 8.0156 8.4375c5.625 0 8.4375-2.8125 8.4375-8.4375zm4.6406 0c0 8.7188-4.3594 13.078-13.078 13.078-8.4375 0-12.652-4.3594-12.652-13.078s4.2148-13.078 12.652-13.078c8.7188 0 13.078 4.3594 13.078 13.078zm-43.871-2.1094v4.2188h-35.012v-4.2188zm258.58 2.1094c-0.5625-8.4375-4.7812-12.656-12.656-12.656-8.4336 0-12.652 4.2188-12.652 12.656s4.2188 12.656 12.652 12.656c8.4375 0 12.656-4.2188 12.656-12.656zm4.6406 0c0 11.531-5.7656 17.293-17.297 17.293-11.527 0-17.293-5.7617-17.293-17.293s5.7656-17.297 17.293-17.297c11.531 0 17.297 5.7656 17.297 17.297zm32.48 0c0-13.781-4.9219-25.59-14.766-35.434-9.5586-9.5625-21.23-14.344-35.012-14.344-15.184 0-31.777 5.7656-49.773 17.297-18.559 11.531-27.84 22.355-27.84 32.48 0 9.8438 9.2812 20.668 27.84 32.48 17.996 11.531 34.59 17.293 49.773 17.293 13.781 0 25.453-4.918 35.012-14.762 9.8438-9.5625 14.766-21.234 14.766-35.012zm5.0625 0c0 14.902-5.3438 27.699-16.031 38.387-10.684 10.684-23.621 16.027-38.809 16.027-15.746 0-33.18-6.0469-52.305-18.137-20.246-12.656-30.371-24.746-30.371-36.277s10.125-23.762 30.371-36.699c19.125-12.094 36.559-18.137 52.305-18.137 14.625 0 27.562 5.3398 38.809 16.027 10.688 10.969 16.031 23.902 16.031 38.809zm-54.418-29.105c-3.9336 0-10.262 1.6875-18.98 5.0625-7.875 3.9375-11.812 6.4648-11.812 7.5898v32.48c0 3.0938 3.9375 5.625 11.812 7.5938 7.875 3.375 14.203 5.0625 18.98 5.0625 19.406 0 29.391-9.2812 29.953-27.84 0-19.688-9.9844-29.668-29.953-29.949zm34.59 29.105v0.84375c0 21.371-11.527 32.34-34.59 32.902-4.4961 0-11.527-1.8281-21.09-5.4844-7.0312-3.9375-10.969-6.3281-11.809-7.1719-1.6875-1.4062-2.5312-3.0938-2.5312-5.0625v-32.48c0-1.4062 0.70312-2.9492 2.1094-4.6367 3.0898-2.8125 7.168-5.2031 12.23-7.1719 9-3.6562 16.031-5.4844 21.09-5.4844 22.5 0.28125 34.027 11.531 34.59 33.746zm-448.4-206.27h-333.66c-5.0625 0-28.543 1.6875-70.445 5.0625-41.902 3.375-62.852 7.5938-62.852 12.656v11.387c0 4.7812 20.949 8.8594 62.852 12.234 41.902 3.375 65.383 5.0625 70.445 5.0625h333.66c3.6562 1.4062 7.4531 2.1094 11.391 2.1094h64.961c5.3438 0 12.867-2.25 22.566-6.75 9.7031-4.5 14.555-10.547 14.555-18.137 0.28125-16.875-12.094-25.312-37.121-25.312h-64.961c-4.7812 0-8.5781 0.5625-11.391 1.6875z" fill-rule="evenodd"/>
4
+ </svg>
package/NCC-1701-a.svg ADDED
@@ -0,0 +1,4 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="1200pt" height="1200pt" version="1.1" viewBox="0 0 1200 1200" xmlns="http://www.w3.org/2000/svg">
3
+ <path fill="#FFFFFF" d="m1096.3 402.82c-53.148-53.008-117.12-79.516-191.93-79.516-67.488 0-126.55 21.938-177.16 65.805-50.617 43.871-80.988 98.285-91.113 163.25l53.57 4.2188c14.625 0.28125 25.449 6.75 32.48 19.406h18.984c11.809 0 17.715 5.7617 17.715 17.293s-5.9062 17.293-17.715 17.293h-17.297c-6.75 14.344-18.137 21.797-34.168 22.359l-53.57 4.6406c10.125 64.68 40.496 118.95 91.113 162.82 50.617 43.871 109.68 65.805 177.16 65.805 74.805 0 138.78-26.574 191.93-79.723 53.152-53.148 79.727-116.98 79.727-191.51 0-75.086-26.574-139.13-79.727-192.14zm-79.422 185.27c0 2.9531 2.3906 5.3477 5.3438 5.3477 2.9531 0 5.3477-2.3945 5.3477-5.3477 0-2.9492-2.3945-5.3438-5.3477-5.3438-2.9531 0-5.3438 2.3945-5.3438 5.3438zm-104.54-111.07c0 2.9531 2.3945 5.3477 5.3438 5.3477 2.9531 0 5.3477-2.3945 5.3477-5.3477s-2.3945-5.3438-5.3477-5.3438c-2.9492 0-5.3438 2.3906-5.3438 5.3438zm-12.473 0c0 2.9531 2.3906 5.3477 5.3438 5.3477s5.3477-2.3945 5.3477-5.3477-2.3945-5.3438-5.3477-5.3438-5.3438 2.3906-5.3438 5.3438zm117.01 123.55c0 2.9492 2.3906 5.3438 5.3438 5.3438 2.9531 0 5.3477-2.3945 5.3477-5.3438 0-2.9531-2.3945-5.3477-5.3477-5.3477-2.9531 0-5.3438 2.3945-5.3438 5.3477zm-104.54 111.66c0 2.9531 2.3945 5.3477 5.3438 5.3477 2.9531 0 5.3477-2.3945 5.3477-5.3477s-2.3945-5.3438-5.3477-5.3438c-2.9492 0-5.3438 2.3906-5.3438 5.3438zm-12.473 0c0 2.9531 2.3906 5.3477 5.3438 5.3477s5.3477-2.3945 5.3477-5.3477-2.3945-5.3438-5.3477-5.3438-5.3438 2.3906-5.3438 5.3438zm-848-318.48c14.062-2.5312 30.934-4.5 50.621-5.9062l-46.402-0.84375zm499.86 169.15c-8.7188-2.25-18.141-8.7188-28.266-19.402l-101.23-103.35h-111.36l173.79 126.12v4.2188c21.652 6.1836 44.008 3.6562 67.07-7.5938zm47.664-148.48c-0.84375 3.3711-2.8125 6.6055-5.9062 9.6992h-5.0625l-6.3242-5.0625h-79.305v-4.6367zm-5.9062-16.031c3.0938 3.0938 5.0625 6.4688 5.9062 10.125h-96.598v-4.6406h79.305l6.3242-5.4844zm-541.62 397.78 4.2188 6.7461 46.402-0.84375c-22.5-2.2461-39.371-4.2148-50.621-5.9023zm499.86-169.15c-23.062-11.531-45.418-14.062-67.07-7.5938v4.2188l-173.79 126.12h111.36l101.23-103.77c10.406-10.684 19.828-17.012 28.266-18.98zm47.664 148.48h-96.598v-4.6406h79.305l6.3242-5.4805h5.0625c3.0938 3.6523 5.0625 7.0273 5.9062 10.121zm-5.9062 15.609h-5.0625l-6.3242-5.0625h-79.305v-4.6406h96.598c-0.84375 3.0938-2.8125 6.3281-5.9062 9.7031zm-102.5 9.6992c3.6562 1.4062 7.4531 2.1094 11.391 2.1094h64.961c24.746 0 37.121-8.4336 37.121-25.309 0-8.4375-4.6406-14.691-13.922-18.77-9.2773-4.0781-17.012-6.1172-23.199-6.1172h-64.961c-4.7812 0-8.5781 0.5625-11.391 1.6875h-333.66c-5.0625 0-28.543 1.6172-70.445 4.8516-41.902 3.2344-62.852 7.3828-62.852 12.441v11.812c0 4.5 20.949 8.5078 62.852 12.023 41.902 3.5156 65.383 5.2695 70.445 5.2695zm125.28-207.54h-42.602c-3.375 1.125-3.375 2.25 0 3.375h42.602zm-43.445 8.4375h-5.4844v-13.5h5.4844c17.152-6.1875 33.605-9.9844 49.352-11.391l4.6406-25.309 4.6406 0.42188c0.5625-4.2188 1.6875-10.262 3.375-18.137-28.684-0.5625-64.398 1.6875-107.14 6.75 3.6562 4.2148 7.4531 7.8711 11.391 10.965 4.7812 3.375 9.4219 5.625 13.918 6.75l12.656 2.9531-11.812 5.9062c-13.496 6.75-30.23 10.121-50.195 10.121-5.0625 0-8.5781-0.14062-10.547-0.42188-4.2188-0.5625-7.5898-1.1211-10.121-1.6836l-3.375-1.2656v-5.4844l-24.043-17.297c-41.34 5.625-69.32 8.5781-83.945 8.8594-31.496 0.28125-47.242 11.953-47.242 35.012 0 22.215 15.746 33.887 47.242 35.012 18.844 0.28125 46.824 3.2344 83.945 8.8594l24.043-17.297v-5.4844l3.375-1.2656c2.5312-0.84375 5.9023-1.4062 10.121-1.6875 1.9688-0.28125 5.4844-0.42187 10.547-0.42187 19.965 0 36.699 3.375 50.195 10.125l11.812 5.4844-12.656 3.375c-4.4961 0.84375-9.1367 3.0938-13.918 6.75-3.6562 2.2461-7.4531 5.7617-11.391 10.543 40.777 5.0625 76.492 7.4531 107.14 7.1719-1.6875-7.3125-2.8125-13.359-3.375-18.137h-4.6406l-4.6406-24.891c-17.434-2.25-33.887-6.043-49.352-11.387zm48.508-20.25c-12.652 1.6875-23.762 3.9375-33.324 6.75h29.105l3.7969-4.2188zm-4.2188 20.25h-29.105c9.5625 2.5312 20.672 4.7812 33.324 6.7461l-0.42188-2.5273zm136.67-8.4375c0-8.4375-4.2188-12.656-12.652-12.656h-21.516c-6.4688-12.652-16.59-18.98-30.371-18.98l-58.211-5.0625-5.9062 29.527-4.2188 5.0625v7.5938l4.2188 5.0625 5.9062 29.105 58.211-5.0625c15.469 0 26.012-7.3125 31.637-21.934h20.25c8.4336 0 12.652-4.2188 12.652-12.656zm-46.82 1.6875c0-11.531-5.9062-17.297-17.719-17.297-11.527 0-17.293 5.7656-17.293 17.297 0 11.812 5.7656 17.715 17.293 17.715 11.812 0 17.719-5.9023 17.719-17.715zm4.6406 0c0 14.902-7.4531 22.355-22.359 22.355-14.902 0-22.355-7.4531-22.355-22.355 0-14.906 7.4531-22.355 22.355-22.355 14.906 0 22.359 7.4492 22.359 22.355zm-13.922 0c0-5.625-2.8125-8.4375-8.4375-8.4375-5.3438 0-8.0156 2.8125-8.0156 8.4375s2.6719 8.4375 8.0156 8.4375c5.625 0 8.4375-2.8125 8.4375-8.4375zm4.6406 0c0 8.7188-4.3594 13.078-13.078 13.078-8.4375 0-12.652-4.3594-12.652-13.078s4.2148-13.078 12.652-13.078c8.7188 0 13.078 4.3594 13.078 13.078zm-43.871-2.1094v4.2188h-35.012v-4.2188zm258.58 2.1094c-0.5625-8.4375-4.7812-12.656-12.656-12.656-8.4336 0-12.652 4.2188-12.652 12.656s4.2188 12.656 12.652 12.656c8.4375 0 12.656-4.2188 12.656-12.656zm4.6406 0c0 11.531-5.7656 17.293-17.297 17.293-11.527 0-17.293-5.7617-17.293-17.293s5.7656-17.297 17.293-17.297c11.531 0 17.297 5.7656 17.297 17.297zm32.48 0c0-13.781-4.9219-25.59-14.766-35.434-9.5586-9.5625-21.23-14.344-35.012-14.344-15.184 0-31.777 5.7656-49.773 17.297-18.559 11.531-27.84 22.355-27.84 32.48 0 9.8438 9.2812 20.668 27.84 32.48 17.996 11.531 34.59 17.293 49.773 17.293 13.781 0 25.453-4.918 35.012-14.762 9.8438-9.5625 14.766-21.234 14.766-35.012zm5.0625 0c0 14.902-5.3438 27.699-16.031 38.387-10.684 10.684-23.621 16.027-38.809 16.027-15.746 0-33.18-6.0469-52.305-18.137-20.246-12.656-30.371-24.746-30.371-36.277s10.125-23.762 30.371-36.699c19.125-12.094 36.559-18.137 52.305-18.137 14.625 0 27.562 5.3398 38.809 16.027 10.688 10.969 16.031 23.902 16.031 38.809zm-54.418-29.105c-3.9336 0-10.262 1.6875-18.98 5.0625-7.875 3.9375-11.812 6.4648-11.812 7.5898v32.48c0 3.0938 3.9375 5.625 11.812 7.5938 7.875 3.375 14.203 5.0625 18.98 5.0625 19.406 0 29.391-9.2812 29.953-27.84 0-19.688-9.9844-29.668-29.953-29.949zm34.59 29.105v0.84375c0 21.371-11.527 32.34-34.59 32.902-4.4961 0-11.527-1.8281-21.09-5.4844-7.0312-3.9375-10.969-6.3281-11.809-7.1719-1.6875-1.4062-2.5312-3.0938-2.5312-5.0625v-32.48c0-1.4062 0.70312-2.9492 2.1094-4.6367 3.0898-2.8125 7.168-5.2031 12.23-7.1719 9-3.6562 16.031-5.4844 21.09-5.4844 22.5 0.28125 34.027 11.531 34.59 33.746zm-448.4-206.27h-333.66c-5.0625 0-28.543 1.6875-70.445 5.0625-41.902 3.375-62.852 7.5938-62.852 12.656v11.387c0 4.7812 20.949 8.8594 62.852 12.234 41.902 3.375 65.383 5.0625 70.445 5.0625h333.66c3.6562 1.4062 7.4531 2.1094 11.391 2.1094h64.961c5.3438 0 12.867-2.25 22.566-6.75 9.7031-4.5 14.555-10.547 14.555-18.137 0.28125-16.875-12.094-25.312-37.121-25.312h-64.961c-4.7812 0-8.5781 0.5625-11.391 1.6875z" fill-rule="evenodd"/>
4
+ </svg>
package/README.md ADDED
@@ -0,0 +1,265 @@
1
+ <p align="center">
2
+ <img
3
+ class="project-logo"
4
+ src="./NCC-1701-a-blue.svg#gh-light-mode-only"
5
+ alt="WarpDrive"
6
+ width="120px"
7
+ title="WarpDrive" />
8
+ <img
9
+ class="project-logo"
10
+ src="./NCC-1701-a.svg#gh-dark-mode-only"
11
+ alt="WarpDrive"
12
+ width="120px"
13
+ title="WarpDrive" />
14
+ </p>
15
+
16
+ <h3 align="center">Your data, managed.</h3>
17
+ <p align="center">🌲 Get back to Nature 🐿️ Or shipping 💚</p>
18
+
19
+ SchemaRecord is:
20
+ - ⚡️ Fast
21
+ - 📦 Tiny
22
+ - ✨ Optimized
23
+ - 🚀 Scalable
24
+ - :electron: Universal
25
+
26
+ Never write a Model again.
27
+
28
+ This package provides presentation capabilities for your resource data. It works together with an [*Ember***Data**](https://github.com/emberjs/data/) [Cache](https://github.com/emberjs/data/blob/main/ember-data-types/cache/cache.ts) and associated Schemas to simplify the most complex parts of your state management.
29
+
30
+ ## Installation
31
+
32
+ ```cli
33
+ pnpm install @warp-drive/schema-record
34
+ ```
35
+
36
+ **Tagged Releases**
37
+
38
+ - ![NPM Canary Version](https://img.shields.io/npm/v/%40warp-drive/schema-record/canary?label=%40canary&color=FFBF00)
39
+ - ![NPM Beta Version](https://img.shields.io/npm/v/%40warp-drive/schema-record/beta?label=%40beta&color=ff00ff)
40
+ - ![NPM Stable Version](https://img.shields.io/npm/v/%40warp-drive/schema-record/latest?label=%40latest&color=90EE90)
41
+ - ![NPM LTS Version](https://img.shields.io/npm/v/%40warp-drive/schema-record/lts?label=%40lts&color=0096FF)
42
+ - ![NPM LTS 4.12 Version](https://img.shields.io/npm/v/%40warp-drive/schema-record/lts-4-12?label=%40lts-4-12&color=bbbbbb)
43
+
44
+
45
+ #### 🔜 Soon
46
+ Install using your javascript package manager of choice. For instance with [pnpm](https://pnpm.io/)
47
+
48
+ ```no-highlight
49
+ pnpm add @warp-drive/schema-record
50
+ ```
51
+
52
+ ## Getting Started
53
+
54
+ If this package is how you are first learning about EmberData, we recommend starting with learning about the [Store](https://github.com/emberjs/data/blob/main/packages/store/README.md) and [Requests](https://github.com/emberjs/data/blob/main/packages/request/README.md)
55
+
56
+ ## 🚀 Setup
57
+
58
+ SchemaRecord integrates with EmberData via the Store's resource lifecycle hooks.
59
+ When EmberData needs to create a new presentation class to pair with some resource
60
+ data, it calls `instantiateRecord`. When it no longer needs that class, it will call
61
+ `teardownRecord`.
62
+
63
+ ```ts
64
+ import Store from '@ember-data/store';
65
+ import SchemaRecord from '@warp-drive/schema-record';
66
+ import Cache from '@ember-data/json-api';
67
+
68
+ const DestroyHook = Symbol.for('destroy');
69
+
70
+ export default class extends Store {
71
+ instantiateRecord(identifier) {
72
+ return new SchemaRecord(this, identifier);
73
+ }
74
+
75
+ teardownRecord(record: SchemaRecord): void {
76
+ record[DestroyHook]();
77
+ }
78
+ }
79
+ ```
80
+
81
+ ## Start Using
82
+
83
+ Any Store method that returns records will use SchemaRecord once configured as above.
84
+ After that, its up to you what SchemaRecord can do.
85
+
86
+ SchemaRecord's behavior is driven by the Schemas you register with the Store's Schema
87
+ Service. Schemas are simple json objects that follow a pattern.
88
+
89
+ You could manually construct schemas, though that would be laborious. We recommend
90
+ compiling schemas from another available source such as your API's types. If you don't
91
+ have a source from which to compile schemas, consider using `@warp-drive/schema-dsl`.
92
+
93
+ The Schema DSL allows authoring rich, expressive schemas using familiar Typescript and
94
+ Decorators, which compile at build into json schemas you can deliver to your app either
95
+ in your asset bundle, via a separate fetch, or from your API.
96
+
97
+ The Schema DSL will also compile and register types for your schemas that give you robust
98
+ typescript support.
99
+
100
+ ## Main Paradigms
101
+
102
+ ### Immutability
103
+
104
+ SchemaRecord is Immutable. This means by design you cannot mutate a SchemaRecord instance.
105
+
106
+ How then do you make edits and preserve changes?
107
+
108
+ ### Mutation Workflows
109
+
110
+ Edits are performed in mutation workflows. A workflow is begun by forking the store.
111
+ Forks are cheap copy-on-write scopes that allow you to make changes in isolation without
112
+ affecting the global state of the application (until you want to). You can even fork forks, though its probably not that useful to do so in the common case.
113
+
114
+ ```ts
115
+ const fork = await store.fork();
116
+ ```
117
+
118
+ Forks are not themselves editable, they are just a pre-requisite.
119
+ There are three ways to get an editable SchemaRecord instance.
120
+
121
+ 1. Create a new record with `const editable = fork.createRecord(<type>, data)`
122
+ 2. Checkout an existing record in edit mode: `const editable = fork.checkoutRecord(record)`
123
+ 3. Access a related record on a record already in edit mode: `const editableFriend = editable.bestFriend`
124
+
125
+ If you decide you want to discard your changes, there's no need to rollback. Simply
126
+ dereferencing the fork and any records you've received from it will cause it to GC.
127
+
128
+ However, explicitly calling `fork.deref()` will ensure that if you did forget to dereference
129
+ any records and left them around somewhere as a variable, they'll blow up with a useful
130
+ error if used again.
131
+
132
+ To save changes, call `fork.request(saveRecord(editable))`. Saving changes will only commit
133
+ the changes to the fork, it won't commit them upstream. To reflect the changes upstream, call
134
+ `await fork.merge(store)`. In most cases, `store` should be the store you forked from, though
135
+ it is allowed to attempt to merge into a parent `store` as well.
136
+
137
+ ```ts
138
+ // get a fork for editing
139
+ const fork = await store.fork();
140
+
141
+ // create a new record
142
+ const user = fork.createRecord('user', { name: 'Chris' });
143
+
144
+ // save the record
145
+ await fork.request(createRecord(user));
146
+
147
+ // reflect the changes back to the original store
148
+ await store.merge(fork);
149
+ ```
150
+
151
+ > Note: merging behavior is determined by the Cache implementation. The implementations
152
+ > maintained by the EmberData team will merge both persisted and unpersisted changes back
153
+ > to the upstream (preserving them as remote and local state respectively). This approach
154
+ > allows developers to choose to optimistically vs pessimistically update the global state.
155
+
156
+ ### Optimistic UX
157
+
158
+ ```ts
159
+ // get a fork for editing
160
+ const fork = await store.fork();
161
+
162
+ // create a new record
163
+ const user = fork.createRecord('user', { name: 'Chris' });
164
+
165
+ // reflect the (dirty) changes back to the original store
166
+ await store.merge(fork);
167
+
168
+ // save the record
169
+ await fork.request(createRecord(user));
170
+
171
+ // reflect the (clean) changes back to the original store
172
+ await store.merge(fork);
173
+ ```
174
+
175
+ ## Schema Format
176
+
177
+ The schema format is the array representation of a Map structure. From which
178
+ we will populate or append to a Map!
179
+
180
+ ```ts
181
+ [
182
+ [ 'user', <user-schema> ],
183
+ [ 'company', <company-schema> ],
184
+ ]
185
+ ```
186
+
187
+ It follows this signature:
188
+
189
+ ```ts
190
+ type ResourceType = string; // 'user'
191
+ type FieldName = string; // 'name'
192
+ type FieldDef = {
193
+ name: string;
194
+ type: string | null;
195
+ kind: 'resource' | 'collection' | 'attribute' | 'derivation' | 'object' | 'array';
196
+ options: Record<string, unknown>;
197
+ };
198
+
199
+ type ResourceSchema = Array<[FieldName, FieldDef]>
200
+ type Schemas = Array<[ResourceType, ResourceSchema]>
201
+ ```
202
+
203
+ You'll find this syntax is capable of describing most conceivable behaviors, including
204
+ some emergent ones we're sure we haven't thought of yet.
205
+
206
+
207
+ ### ♥️ Credits
208
+
209
+ <details>
210
+ <summary>Brought to you with ♥️ love by <a href="https://emberjs.com" title="EmberJS">🐹 Ember</a></summary>
211
+
212
+ <style type="text/css">
213
+ img.project-logo {
214
+ padding: 0 5em 1em 5em;
215
+ width: 100px;
216
+ border-bottom: 2px solid #0969da;
217
+ margin: 0 auto;
218
+ display: block;
219
+ }
220
+ details > summary {
221
+ font-size: 1.1rem;
222
+ line-height: 1rem;
223
+ margin-bottom: 1rem;
224
+ }
225
+ details {
226
+ font-size: 1rem;
227
+ }
228
+ details > summary strong {
229
+ display: inline-block;
230
+ padding: .2rem 0;
231
+ color: #000;
232
+ border-bottom: 3px solid #0969da;
233
+ }
234
+
235
+ details > details {
236
+ margin-left: 2rem;
237
+ }
238
+ details > details > summary {
239
+ font-size: 1rem;
240
+ line-height: 1rem;
241
+ margin-bottom: 1rem;
242
+ }
243
+ details > details > summary strong {
244
+ display: inline-block;
245
+ padding: .2rem 0;
246
+ color: #555;
247
+ border-bottom: 2px solid #555;
248
+ }
249
+ details > details {
250
+ font-size: .85rem;
251
+ }
252
+
253
+ @media (prefers-color-scheme: dark) {
254
+ details > summary strong {
255
+ color: #fff;
256
+ }
257
+ }
258
+ @media (prefers-color-scheme: dark) {
259
+ details > details > summary strong {
260
+ color: #afaba0;
261
+ border-bottom: 2px solid #afaba0;
262
+ }
263
+ }
264
+ </style>
265
+ </details>
package/addon-main.cjs ADDED
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ const { addonShim } = require('@warp-drive/build-config/addon-shim.cjs');
4
+
5
+ module.exports = addonShim(__dirname);
package/dist/hooks.js ADDED
@@ -0,0 +1,19 @@
1
+ import { SchemaRecord } from "./record.js";
2
+ import { E as Editable, L as Legacy, D as Destroy } from "./symbols-DqoS4ybV.js";
3
+ function instantiateRecord(store, identifier, createArgs) {
4
+ const schema = store.schema;
5
+ const isLegacy = schema.resource(identifier)?.legacy ?? false;
6
+ const isEditable = isLegacy || store.cache.isNew(identifier);
7
+ const record = new SchemaRecord(store, identifier, {
8
+ [Editable]: isEditable,
9
+ [Legacy]: isLegacy
10
+ });
11
+ if (createArgs) {
12
+ Object.assign(record, createArgs);
13
+ }
14
+ return record;
15
+ }
16
+ function teardownRecord(record) {
17
+ record[Destroy]();
18
+ }
19
+ export { instantiateRecord, teardownRecord };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hooks.js","sources":["../src/hooks.ts"],"sourcesContent":["import type Store from '@ember-data/store';\nimport type { StableRecordIdentifier } from '@warp-drive/core-types';\n\nimport { SchemaRecord } from './record';\nimport type { SchemaService } from './schema';\nimport { Destroy, Editable, Legacy } from './symbols';\n\nexport function instantiateRecord(\n store: Store,\n identifier: StableRecordIdentifier,\n createArgs?: Record<string, unknown>\n): SchemaRecord {\n const schema = store.schema as unknown as SchemaService;\n const isLegacy = schema.resource(identifier)?.legacy ?? false;\n const isEditable = isLegacy || store.cache.isNew(identifier);\n const record = new SchemaRecord(store, identifier, {\n [Editable]: isEditable,\n [Legacy]: isLegacy,\n });\n\n if (createArgs) {\n Object.assign(record, createArgs);\n }\n\n return record;\n}\n\nexport function teardownRecord(record: SchemaRecord): void {\n record[Destroy]();\n}\n"],"names":["instantiateRecord","store","identifier","createArgs","schema","isLegacy","resource","legacy","isEditable","cache","isNew","record","SchemaRecord","Editable","Legacy","Object","assign","teardownRecord","Destroy"],"mappings":";;;AAOO,SAASA,iBAAiBA,CAC/BC,KAAY,EACZC,UAAkC,EAClCC,UAAoC,EACtB;AACd,EAAA,MAAMC,MAAM,GAAGH,KAAK,CAACG,MAAkC,CAAA;EACvD,MAAMC,QAAQ,GAAGD,MAAM,CAACE,QAAQ,CAACJ,UAAU,CAAC,EAAEK,MAAM,IAAI,KAAK,CAAA;EAC7D,MAAMC,UAAU,GAAGH,QAAQ,IAAIJ,KAAK,CAACQ,KAAK,CAACC,KAAK,CAACR,UAAU,CAAC,CAAA;EAC5D,MAAMS,MAAM,GAAG,IAAIC,YAAY,CAACX,KAAK,EAAEC,UAAU,EAAE;IACjD,CAACW,QAAQ,GAAGL,UAAU;AACtB,IAAA,CAACM,MAAM,GAAGT,QAAAA;AACZ,GAAC,CAAC,CAAA;AAEF,EAAA,IAAIF,UAAU,EAAE;AACdY,IAAAA,MAAM,CAACC,MAAM,CAACL,MAAM,EAAER,UAAU,CAAC,CAAA;AACnC,GAAA;AAEA,EAAA,OAAOQ,MAAM,CAAA;AACf,CAAA;AAEO,SAASM,cAAcA,CAACN,MAAoB,EAAQ;AACzDA,EAAAA,MAAM,CAACO,OAAO,CAAC,EAAE,CAAA;AACnB;;;;"}