flarecms 0.1.0 → 0.1.2

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.
Files changed (113) hide show
  1. package/LICENSE +21 -0
  2. package/dist/auth/index.js +201 -1
  3. package/dist/cli/commands.js +5554 -55
  4. package/dist/cli/index.js +5554 -55
  5. package/dist/cli/mcp.js +30 -0
  6. package/dist/client/index.js +23576 -0
  7. package/dist/db/index.js +10392 -25
  8. package/dist/index.js +56776 -7582
  9. package/dist/server/index.js +43280 -0
  10. package/dist/style.css +5536 -0
  11. package/package.json +33 -30
  12. package/scripts/fix-api-paths.mjs +0 -32
  13. package/scripts/fix-imports.mjs +0 -38
  14. package/scripts/prefix-css.mjs +0 -45
  15. package/src/api/lib/cache.ts +0 -45
  16. package/src/api/lib/response.ts +0 -40
  17. package/src/api/middlewares/auth.ts +0 -186
  18. package/src/api/middlewares/cors.ts +0 -10
  19. package/src/api/middlewares/rbac.ts +0 -85
  20. package/src/api/routes/auth.ts +0 -377
  21. package/src/api/routes/collections.ts +0 -205
  22. package/src/api/routes/content.ts +0 -175
  23. package/src/api/routes/device.ts +0 -160
  24. package/src/api/routes/magic.ts +0 -150
  25. package/src/api/routes/mcp.ts +0 -273
  26. package/src/api/routes/oauth.ts +0 -160
  27. package/src/api/routes/settings.ts +0 -43
  28. package/src/api/routes/setup.ts +0 -307
  29. package/src/api/routes/tokens.ts +0 -80
  30. package/src/api/schemas/auth.ts +0 -15
  31. package/src/api/schemas/index.ts +0 -51
  32. package/src/api/schemas/tokens.ts +0 -24
  33. package/src/auth/index.ts +0 -28
  34. package/src/cli/commands.ts +0 -217
  35. package/src/cli/index.ts +0 -21
  36. package/src/cli/mcp.ts +0 -210
  37. package/src/cli/tests/cli.test.ts +0 -40
  38. package/src/cli/tests/create.test.ts +0 -87
  39. package/src/client/FlareAdminRouter.tsx +0 -47
  40. package/src/client/app.tsx +0 -175
  41. package/src/client/components/app-sidebar.tsx +0 -227
  42. package/src/client/components/collection-modal.tsx +0 -215
  43. package/src/client/components/content-list.tsx +0 -247
  44. package/src/client/components/dynamic-form.tsx +0 -190
  45. package/src/client/components/field-modal.tsx +0 -221
  46. package/src/client/components/settings/api-token-section.tsx +0 -400
  47. package/src/client/components/settings/general-section.tsx +0 -224
  48. package/src/client/components/settings/security-section.tsx +0 -154
  49. package/src/client/components/settings/seo-section.tsx +0 -200
  50. package/src/client/components/settings/signup-section.tsx +0 -257
  51. package/src/client/components/ui/accordion.tsx +0 -78
  52. package/src/client/components/ui/avatar.tsx +0 -107
  53. package/src/client/components/ui/badge.tsx +0 -52
  54. package/src/client/components/ui/button.tsx +0 -60
  55. package/src/client/components/ui/card.tsx +0 -103
  56. package/src/client/components/ui/checkbox.tsx +0 -27
  57. package/src/client/components/ui/collapsible.tsx +0 -19
  58. package/src/client/components/ui/dialog.tsx +0 -162
  59. package/src/client/components/ui/icon-picker.tsx +0 -485
  60. package/src/client/components/ui/icons-data.ts +0 -8476
  61. package/src/client/components/ui/input.tsx +0 -20
  62. package/src/client/components/ui/label.tsx +0 -20
  63. package/src/client/components/ui/popover.tsx +0 -91
  64. package/src/client/components/ui/select.tsx +0 -204
  65. package/src/client/components/ui/separator.tsx +0 -23
  66. package/src/client/components/ui/sheet.tsx +0 -141
  67. package/src/client/components/ui/sidebar.tsx +0 -722
  68. package/src/client/components/ui/skeleton.tsx +0 -13
  69. package/src/client/components/ui/sonner.tsx +0 -47
  70. package/src/client/components/ui/switch.tsx +0 -30
  71. package/src/client/components/ui/table.tsx +0 -116
  72. package/src/client/components/ui/tabs.tsx +0 -80
  73. package/src/client/components/ui/textarea.tsx +0 -18
  74. package/src/client/components/ui/tooltip.tsx +0 -68
  75. package/src/client/hooks/use-mobile.ts +0 -19
  76. package/src/client/index.css +0 -149
  77. package/src/client/index.ts +0 -7
  78. package/src/client/layouts/admin-layout.tsx +0 -93
  79. package/src/client/layouts/settings-layout.tsx +0 -104
  80. package/src/client/lib/api.ts +0 -72
  81. package/src/client/lib/utils.ts +0 -6
  82. package/src/client/main.tsx +0 -10
  83. package/src/client/pages/collection-detail.tsx +0 -634
  84. package/src/client/pages/collections.tsx +0 -180
  85. package/src/client/pages/dashboard.tsx +0 -133
  86. package/src/client/pages/device.tsx +0 -66
  87. package/src/client/pages/document-detail-page.tsx +0 -139
  88. package/src/client/pages/documents-page.tsx +0 -103
  89. package/src/client/pages/login.tsx +0 -345
  90. package/src/client/pages/settings.tsx +0 -65
  91. package/src/client/pages/setup.tsx +0 -129
  92. package/src/client/pages/signup.tsx +0 -188
  93. package/src/client/store/auth.ts +0 -30
  94. package/src/client/store/collections.ts +0 -13
  95. package/src/client/store/config.ts +0 -12
  96. package/src/client/store/fetcher.ts +0 -30
  97. package/src/client/store/router.ts +0 -95
  98. package/src/client/store/schema.ts +0 -39
  99. package/src/client/store/settings.ts +0 -31
  100. package/src/client/types.ts +0 -34
  101. package/src/db/dynamic.ts +0 -70
  102. package/src/db/index.ts +0 -16
  103. package/src/db/migrations/001_initial_schema.ts +0 -57
  104. package/src/db/migrations/002_auth_tables.ts +0 -84
  105. package/src/db/migrator.ts +0 -61
  106. package/src/db/schema.ts +0 -142
  107. package/src/index.ts +0 -12
  108. package/src/server/index.ts +0 -66
  109. package/src/types.ts +0 -20
  110. package/tests/css.test.ts +0 -21
  111. package/tests/modular.test.ts +0 -29
  112. package/tsconfig.json +0 -10
  113. /package/{style.css.d.ts → dist/style.css.d.ts} +0 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Francy Santos (fhorray)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -1,5 +1,35 @@
1
1
  // @bun
2
+ var __create = Object.create;
3
+ var __getProtoOf = Object.getPrototypeOf;
2
4
  var __defProp = Object.defineProperty;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ function __accessProp(key) {
8
+ return this[key];
9
+ }
10
+ var __toESMCache_node;
11
+ var __toESMCache_esm;
12
+ var __toESM = (mod, isNodeMode, target) => {
13
+ var canCache = mod != null && typeof mod === "object";
14
+ if (canCache) {
15
+ var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
16
+ var cached = cache.get(mod);
17
+ if (cached)
18
+ return cached;
19
+ }
20
+ target = mod != null ? __create(__getProtoOf(mod)) : {};
21
+ const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
22
+ for (let key of __getOwnPropNames(mod))
23
+ if (!__hasOwnProp.call(to, key))
24
+ __defProp(to, key, {
25
+ get: __accessProp.bind(mod, key),
26
+ enumerable: true
27
+ });
28
+ if (canCache)
29
+ cache.set(mod, to);
30
+ return to;
31
+ };
32
+ var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
3
33
  var __returnValue = (v) => v;
4
34
  function __exportSetter(name, newValue) {
5
35
  this[name] = __returnValue.bind(null, newValue);
@@ -15,8 +45,178 @@ var __export = (target, all) => {
15
45
  };
16
46
  var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
17
47
 
48
+ // ../../node_modules/.bun/@oslojs+encoding@1.1.0/node_modules/@oslojs/encoding/dist/hex.js
49
+ function encodeHexLowerCase(data) {
50
+ let result = "";
51
+ for (let i = 0;i < data.length; i++) {
52
+ result += alphabetLowerCase[data[i] >> 4];
53
+ result += alphabetLowerCase[data[i] & 15];
54
+ }
55
+ return result;
56
+ }
57
+ var alphabetLowerCase = "0123456789abcdef";
58
+ // ../../node_modules/.bun/@oslojs+encoding@1.1.0/node_modules/@oslojs/encoding/dist/base32.js
59
+ var EncodingPadding;
60
+ (function(EncodingPadding2) {
61
+ EncodingPadding2[EncodingPadding2["Include"] = 0] = "Include";
62
+ EncodingPadding2[EncodingPadding2["None"] = 1] = "None";
63
+ })(EncodingPadding || (EncodingPadding = {}));
64
+ var DecodingPadding;
65
+ (function(DecodingPadding2) {
66
+ DecodingPadding2[DecodingPadding2["Required"] = 0] = "Required";
67
+ DecodingPadding2[DecodingPadding2["Ignore"] = 1] = "Ignore";
68
+ })(DecodingPadding || (DecodingPadding = {}));
69
+ // ../../node_modules/.bun/@oslojs+encoding@1.1.0/node_modules/@oslojs/encoding/dist/base64.js
70
+ function encodeBase64url(bytes) {
71
+ return encodeBase64_internal(bytes, base64urlAlphabet, EncodingPadding2.Include);
72
+ }
73
+ function encodeBase64_internal(bytes, alphabet, padding) {
74
+ let result = "";
75
+ for (let i = 0;i < bytes.byteLength; i += 3) {
76
+ let buffer = 0;
77
+ let bufferBitSize = 0;
78
+ for (let j = 0;j < 3 && i + j < bytes.byteLength; j++) {
79
+ buffer = buffer << 8 | bytes[i + j];
80
+ bufferBitSize += 8;
81
+ }
82
+ for (let j = 0;j < 4; j++) {
83
+ if (bufferBitSize >= 6) {
84
+ result += alphabet[buffer >> bufferBitSize - 6 & 63];
85
+ bufferBitSize -= 6;
86
+ } else if (bufferBitSize > 0) {
87
+ result += alphabet[buffer << 6 - bufferBitSize & 63];
88
+ bufferBitSize = 0;
89
+ } else if (padding === EncodingPadding2.Include) {
90
+ result += "=";
91
+ }
92
+ }
93
+ }
94
+ return result;
95
+ }
96
+ var base64urlAlphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
97
+ function decodeBase64url(encoded) {
98
+ return decodeBase64_internal(encoded, base64urlDecodeMap, DecodingPadding2.Required);
99
+ }
100
+ function decodeBase64_internal(encoded, decodeMap, padding) {
101
+ const result = new Uint8Array(Math.ceil(encoded.length / 4) * 3);
102
+ let totalBytes = 0;
103
+ for (let i = 0;i < encoded.length; i += 4) {
104
+ let chunk = 0;
105
+ let bitsRead = 0;
106
+ for (let j = 0;j < 4; j++) {
107
+ if (padding === DecodingPadding2.Required && encoded[i + j] === "=") {
108
+ continue;
109
+ }
110
+ if (padding === DecodingPadding2.Ignore && (i + j >= encoded.length || encoded[i + j] === "=")) {
111
+ continue;
112
+ }
113
+ if (j > 0 && encoded[i + j - 1] === "=") {
114
+ throw new Error("Invalid padding");
115
+ }
116
+ if (!(encoded[i + j] in decodeMap)) {
117
+ throw new Error("Invalid character");
118
+ }
119
+ chunk |= decodeMap[encoded[i + j]] << (3 - j) * 6;
120
+ bitsRead += 6;
121
+ }
122
+ if (bitsRead < 24) {
123
+ let unused;
124
+ if (bitsRead === 12) {
125
+ unused = chunk & 65535;
126
+ } else if (bitsRead === 18) {
127
+ unused = chunk & 255;
128
+ } else {
129
+ throw new Error("Invalid padding");
130
+ }
131
+ if (unused !== 0) {
132
+ throw new Error("Invalid padding");
133
+ }
134
+ }
135
+ const byteLength = Math.floor(bitsRead / 8);
136
+ for (let i2 = 0;i2 < byteLength; i2++) {
137
+ result[totalBytes] = chunk >> 16 - i2 * 8 & 255;
138
+ totalBytes++;
139
+ }
140
+ }
141
+ return result.slice(0, totalBytes);
142
+ }
143
+ var EncodingPadding2;
144
+ (function(EncodingPadding3) {
145
+ EncodingPadding3[EncodingPadding3["Include"] = 0] = "Include";
146
+ EncodingPadding3[EncodingPadding3["None"] = 1] = "None";
147
+ })(EncodingPadding2 || (EncodingPadding2 = {}));
148
+ var DecodingPadding2;
149
+ (function(DecodingPadding3) {
150
+ DecodingPadding3[DecodingPadding3["Required"] = 0] = "Required";
151
+ DecodingPadding3[DecodingPadding3["Ignore"] = 1] = "Ignore";
152
+ })(DecodingPadding2 || (DecodingPadding2 = {}));
153
+ var base64urlDecodeMap = {
154
+ "0": 52,
155
+ "1": 53,
156
+ "2": 54,
157
+ "3": 55,
158
+ "4": 56,
159
+ "5": 57,
160
+ "6": 58,
161
+ "7": 59,
162
+ "8": 60,
163
+ "9": 61,
164
+ A: 0,
165
+ B: 1,
166
+ C: 2,
167
+ D: 3,
168
+ E: 4,
169
+ F: 5,
170
+ G: 6,
171
+ H: 7,
172
+ I: 8,
173
+ J: 9,
174
+ K: 10,
175
+ L: 11,
176
+ M: 12,
177
+ N: 13,
178
+ O: 14,
179
+ P: 15,
180
+ Q: 16,
181
+ R: 17,
182
+ S: 18,
183
+ T: 19,
184
+ U: 20,
185
+ V: 21,
186
+ W: 22,
187
+ X: 23,
188
+ Y: 24,
189
+ Z: 25,
190
+ a: 26,
191
+ b: 27,
192
+ c: 28,
193
+ d: 29,
194
+ e: 30,
195
+ f: 31,
196
+ g: 32,
197
+ h: 33,
198
+ i: 34,
199
+ j: 35,
200
+ k: 36,
201
+ l: 37,
202
+ m: 38,
203
+ n: 39,
204
+ o: 40,
205
+ p: 41,
206
+ q: 42,
207
+ r: 43,
208
+ s: 44,
209
+ t: 45,
210
+ u: 46,
211
+ v: 47,
212
+ w: 48,
213
+ x: 49,
214
+ y: 50,
215
+ z: 51,
216
+ "-": 62,
217
+ _: 63
218
+ };
18
219
  // src/auth/index.ts
19
- import { encodeHexLowerCase } from "@oslojs/encoding";
20
220
  function generateSessionToken() {
21
221
  const bytes = new Uint8Array(20);
22
222
  crypto.getRandomValues(bytes);