@camstack/server 1.2.932 → 1.2.934
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/CHANGELOG.md +18 -0
- package/dist/api/trpc/generated-cap-routers.js +20 -0
- package/package.json +8 -7
- package/system/dist/addon-utils.mjs +1 -1
- package/system/dist/{base-device-IuM1AwXZ.mjs → base-device-Bwiblqmn.mjs} +1 -1
- package/system/dist/{base-device-2sL1DMm1.js → base-device-C1z4zYGR.js} +1 -1
- package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +3 -3
- package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +4 -4
- package/system/dist/builtins/alerts/alerts.addon.js +2 -2
- package/system/dist/builtins/alerts/alerts.addon.mjs +4 -4
- package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +4 -4
- package/system/dist/builtins/camera-grid/index.js +2 -2
- package/system/dist/builtins/camera-grid/index.mjs +2 -2
- package/system/dist/builtins/composer/composer.addon.js +5 -5
- package/system/dist/builtins/composer/composer.addon.mjs +5 -5
- package/system/dist/builtins/core-blocks/cap-links.d.ts +34 -0
- package/system/dist/builtins/core-blocks/core-blocks.addon.d.ts +4 -0
- package/system/dist/builtins/core-blocks/core-blocks.addon.js +282 -8
- package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +282 -8
- package/system/dist/builtins/device-manager/device-manager.addon.js +18 -4
- package/system/dist/builtins/device-manager/device-manager.addon.mjs +18 -4
- package/system/dist/builtins/local-auth/local-auth.addon.mjs +3 -3
- package/system/dist/builtins/local-network/local-network.addon.mjs +2 -2
- package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +9 -9
- package/system/dist/builtins/platform-probe/index.mjs +9 -9
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +19 -19
- package/system/dist/builtins/system-config/system-config.addon.mjs +113 -113
- package/system/dist/{composition-sources-BEUWn2s_.mjs → composition-sources-B0QW4g86.mjs} +2 -2
- package/system/dist/{composition-sources-acfR4hDq.js → composition-sources-BtUx1MfU.js} +2 -2
- package/system/dist/{coral-accelerators-zTMTEd-8.mjs → coral-accelerators-BKcXP59c.mjs} +6 -6
- package/system/dist/{core-blocks.cap-BRPsLAij.mjs → core-blocks.cap-CnwBuf7E.mjs} +1524 -1267
- package/system/dist/{core-blocks.cap-BMeMCBrx.js → core-blocks.cap-DlEuHq-S.js} +1555 -1268
- package/system/dist/{custom-action-registry-N7flBDwT.mjs → custom-action-registry-B9zFBNVa.mjs} +37 -37
- package/system/dist/{error.cap-CSM_SRfR.mjs → error.cap-5zNPAgU2.mjs} +19 -2
- package/system/dist/{error.cap-DBhgPeWK.js → error.cap-BCqzFlo2.js} +24 -1
- package/system/dist/{hub-identity-_IOgPJ00.mjs → hub-identity-DjMN9Ac2.mjs} +9 -9
- package/system/dist/{hub-mdns-ciao-Dk7ts_Uk.mjs → hub-mdns-ciao-DBrtHOcc.mjs} +1 -1
- package/system/dist/index.js +2 -2
- package/system/dist/index.mjs +214 -214
- package/system/dist/{prefix-walk-ifwg_ukx.mjs → prefix-walk-CRnbYJcC.mjs} +2 -2
- package/system/dist/{prefix-walk-BkMxoXpL.js → prefix-walk-DD1BM923.js} +2 -2
- package/system/dist/{rename-composition-block-BJsL58Ih.js → rename-composition-block-BRgyBO25.js} +20 -2
- package/system/dist/{rename-composition-block-OAtErZgq.mjs → rename-composition-block-BYRBlx-V.mjs} +20 -2
- package/system/dist/{restore-archive-kSFNjkWY.mjs → restore-archive-CjAyKpgX.mjs} +93 -93
- package/system/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as BaseAddon } from "../../base-addon-Md14i7pe.mjs";
|
|
2
2
|
import { n as filesystemBrowseCapability, t as storageProviderCapability } from "../../storage-provider.cap-CMeck2w4.mjs";
|
|
3
3
|
import { randomUUID } from "node:crypto";
|
|
4
|
-
import * as fs from "node:fs";
|
|
4
|
+
import * as fs$1 from "node:fs";
|
|
5
5
|
import * as path$1 from "node:path";
|
|
6
6
|
import { basename, dirname, isAbsolute, join, resolve, sep } from "node:path";
|
|
7
7
|
import { mkdir, readdir, realpath, statfs } from "node:fs/promises";
|
|
@@ -170,16 +170,16 @@ var FilesystemStorageProvider = class FilesystemStorageProvider {
|
|
|
170
170
|
error: "config.basePath must be a non-empty string"
|
|
171
171
|
};
|
|
172
172
|
try {
|
|
173
|
-
const stat = await fs.promises.stat(basePath).catch(() => null);
|
|
173
|
+
const stat = await fs$1.promises.stat(basePath).catch(() => null);
|
|
174
174
|
if (stat) {
|
|
175
175
|
if (!stat.isDirectory()) return {
|
|
176
176
|
ok: false,
|
|
177
177
|
error: `Path "${basePath}" exists but is not a directory`
|
|
178
178
|
};
|
|
179
|
-
await fs.promises.access(basePath, fs.constants.W_OK);
|
|
179
|
+
await fs$1.promises.access(basePath, fs$1.constants.W_OK);
|
|
180
180
|
return { ok: true };
|
|
181
181
|
}
|
|
182
|
-
await fs.promises.mkdir(basePath, { recursive: true });
|
|
182
|
+
await fs$1.promises.mkdir(basePath, { recursive: true });
|
|
183
183
|
return { ok: true };
|
|
184
184
|
} catch (err) {
|
|
185
185
|
return {
|
|
@@ -193,12 +193,12 @@ var FilesystemStorageProvider = class FilesystemStorageProvider {
|
|
|
193
193
|
}
|
|
194
194
|
async write({ location, relativePath, data }) {
|
|
195
195
|
const filePath = safeResolve(getBasePath(location), relativePath);
|
|
196
|
-
await fs.promises.mkdir(path$1.dirname(filePath), { recursive: true });
|
|
197
|
-
await fs.promises.writeFile(filePath, data);
|
|
196
|
+
await fs$1.promises.mkdir(path$1.dirname(filePath), { recursive: true });
|
|
197
|
+
await fs$1.promises.writeFile(filePath, data);
|
|
198
198
|
}
|
|
199
199
|
async read({ location, relativePath }) {
|
|
200
200
|
const filePath = safeResolve(getBasePath(location), relativePath);
|
|
201
|
-
const buf = await fs.promises.readFile(filePath);
|
|
201
|
+
const buf = await fs$1.promises.readFile(filePath);
|
|
202
202
|
const out = new Uint8Array(new ArrayBuffer(buf.byteLength));
|
|
203
203
|
out.set(buf);
|
|
204
204
|
return out;
|
|
@@ -206,7 +206,7 @@ var FilesystemStorageProvider = class FilesystemStorageProvider {
|
|
|
206
206
|
async exists({ location, relativePath }) {
|
|
207
207
|
const filePath = safeResolve(getBasePath(location), relativePath);
|
|
208
208
|
try {
|
|
209
|
-
await fs.promises.access(filePath);
|
|
209
|
+
await fs$1.promises.access(filePath);
|
|
210
210
|
return true;
|
|
211
211
|
} catch {
|
|
212
212
|
return false;
|
|
@@ -216,25 +216,25 @@ var FilesystemStorageProvider = class FilesystemStorageProvider {
|
|
|
216
216
|
const base = getBasePath(location);
|
|
217
217
|
const dir = prefix ? safeResolve(base, prefix) : path$1.resolve(base);
|
|
218
218
|
try {
|
|
219
|
-
return (await fs.promises.readdir(dir, { withFileTypes: true })).map((e) => prefix ? `${prefix}/${e.name}` : e.name);
|
|
219
|
+
return (await fs$1.promises.readdir(dir, { withFileTypes: true })).map((e) => prefix ? `${prefix}/${e.name}` : e.name);
|
|
220
220
|
} catch {
|
|
221
221
|
return [];
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
224
|
async delete({ location, relativePath }) {
|
|
225
225
|
const filePath = safeResolve(getBasePath(location), relativePath);
|
|
226
|
-
await fs.promises.rm(filePath, { force: true });
|
|
226
|
+
await fs$1.promises.rm(filePath, { force: true });
|
|
227
227
|
}
|
|
228
228
|
async getAvailableSpace({ location }) {
|
|
229
229
|
const base = path$1.resolve(getBasePath(location));
|
|
230
230
|
try {
|
|
231
231
|
let target = base;
|
|
232
|
-
while (!fs.existsSync(target)) {
|
|
232
|
+
while (!fs$1.existsSync(target)) {
|
|
233
233
|
const parent = path$1.dirname(target);
|
|
234
234
|
if (!parent || parent === target) return null;
|
|
235
235
|
target = parent;
|
|
236
236
|
}
|
|
237
|
-
const stats = await fs.promises.statfs(target);
|
|
237
|
+
const stats = await fs$1.promises.statfs(target);
|
|
238
238
|
return stats.bavail * stats.bsize;
|
|
239
239
|
} catch {
|
|
240
240
|
return null;
|
|
@@ -243,9 +243,9 @@ var FilesystemStorageProvider = class FilesystemStorageProvider {
|
|
|
243
243
|
async beginUpload({ location, relativePath }) {
|
|
244
244
|
const target = safeResolve(getBasePath(location), relativePath);
|
|
245
245
|
const partial = `${target}.partial`;
|
|
246
|
-
await fs.promises.mkdir(path$1.dirname(target), { recursive: true });
|
|
247
|
-
await fs.promises.unlink(partial).catch(() => {});
|
|
248
|
-
const stream = fs.createWriteStream(partial);
|
|
246
|
+
await fs$1.promises.mkdir(path$1.dirname(target), { recursive: true });
|
|
247
|
+
await fs$1.promises.unlink(partial).catch(() => {});
|
|
248
|
+
const stream = fs$1.createWriteStream(partial);
|
|
249
249
|
const uploadId = randomUUID();
|
|
250
250
|
const session = {
|
|
251
251
|
stream,
|
|
@@ -286,7 +286,7 @@ var FilesystemStorageProvider = class FilesystemStorageProvider {
|
|
|
286
286
|
session.stream.end(() => resolve());
|
|
287
287
|
session.stream.on("error", reject);
|
|
288
288
|
});
|
|
289
|
-
await fs.promises.rename(session.partial, session.target);
|
|
289
|
+
await fs$1.promises.rename(session.partial, session.target);
|
|
290
290
|
clearTimeout(session.timer);
|
|
291
291
|
this.uploads.delete(uploadId);
|
|
292
292
|
}
|
|
@@ -296,14 +296,14 @@ var FilesystemStorageProvider = class FilesystemStorageProvider {
|
|
|
296
296
|
try {
|
|
297
297
|
session.stream.destroy();
|
|
298
298
|
} catch {}
|
|
299
|
-
await fs.promises.unlink(session.partial).catch(() => {});
|
|
299
|
+
await fs$1.promises.unlink(session.partial).catch(() => {});
|
|
300
300
|
clearTimeout(session.timer);
|
|
301
301
|
this.uploads.delete(uploadId);
|
|
302
302
|
}
|
|
303
303
|
async beginDownload({ location, relativePath }) {
|
|
304
304
|
const target = safeResolve(getBasePath(location), relativePath);
|
|
305
|
-
const stat = await fs.promises.stat(target);
|
|
306
|
-
const fd = await fs.promises.open(target, "r");
|
|
305
|
+
const stat = await fs$1.promises.stat(target);
|
|
306
|
+
const fd = await fs$1.promises.open(target, "r");
|
|
307
307
|
const downloadId = randomUUID();
|
|
308
308
|
const session = {
|
|
309
309
|
fd,
|