bb-relay 0.0.3 → 0.0.5
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/dist/index.d.mts +58 -24
- package/dist/index.d.ts +58 -24
- package/dist/index.js +35 -2
- package/dist/index.mjs +33 -1
- package/package.json +1 -1
- package/src/index.ts +8 -3
- package/src/lib/validate-manifest.ts +37 -0
- package/src/types/Zip.ts +15 -0
- package/src/types/plugins/Plugin.ts +22 -0
- package/src/types/plugins/Release.ts +14 -0
- package/src/types/editor/Plugin.ts +0 -22
package/dist/index.d.mts
CHANGED
|
@@ -465,29 +465,6 @@ interface MenuContent {
|
|
|
465
465
|
|
|
466
466
|
type Nav = "file-explorer" | "checkpoints" | "plugins" | "settings" | "remote";
|
|
467
467
|
|
|
468
|
-
type Plugin = {
|
|
469
|
-
id: string;
|
|
470
|
-
slug: string;
|
|
471
|
-
userId: string;
|
|
472
|
-
size: number;
|
|
473
|
-
latestProduction: {
|
|
474
|
-
version: string;
|
|
475
|
-
id: number;
|
|
476
|
-
};
|
|
477
|
-
latestBeta: {
|
|
478
|
-
version: string;
|
|
479
|
-
id: number;
|
|
480
|
-
};
|
|
481
|
-
latestAlpha: {
|
|
482
|
-
version: string;
|
|
483
|
-
id: number;
|
|
484
|
-
};
|
|
485
|
-
latestDraft: {
|
|
486
|
-
version: string;
|
|
487
|
-
id: number;
|
|
488
|
-
};
|
|
489
|
-
};
|
|
490
|
-
|
|
491
468
|
interface RenameType {
|
|
492
469
|
path: string;
|
|
493
470
|
name: string;
|
|
@@ -521,4 +498,61 @@ declare const frFR: {
|
|
|
521
498
|
[key in Language]: ;
|
|
522
499
|
};
|
|
523
500
|
|
|
524
|
-
|
|
501
|
+
type Release = {
|
|
502
|
+
storageRef: string;
|
|
503
|
+
changes: string;
|
|
504
|
+
version: string;
|
|
505
|
+
type: "production" | "beta" | "alpha" | "draft";
|
|
506
|
+
slug: string;
|
|
507
|
+
metadata: {
|
|
508
|
+
uploadedAt: number;
|
|
509
|
+
totalFiles: number;
|
|
510
|
+
totalSize: number;
|
|
511
|
+
};
|
|
512
|
+
createdAt: string;
|
|
513
|
+
id?: string;
|
|
514
|
+
};
|
|
515
|
+
|
|
516
|
+
type Status = Omit<Release, "type">;
|
|
517
|
+
/**
|
|
518
|
+
* This will be pulled from two firestore
|
|
519
|
+
* The part of name, description etc will be in the main
|
|
520
|
+
* Things like installs will be in the registry
|
|
521
|
+
*/
|
|
522
|
+
type Plugin = {
|
|
523
|
+
userId: string;
|
|
524
|
+
slug: string;
|
|
525
|
+
name: string;
|
|
526
|
+
description: string | null;
|
|
527
|
+
installs: number;
|
|
528
|
+
archived?: boolean;
|
|
529
|
+
deprecated?: boolean;
|
|
530
|
+
alpha: Status | null;
|
|
531
|
+
beta: Status | null;
|
|
532
|
+
production: Status | null;
|
|
533
|
+
createdAt: string;
|
|
534
|
+
updatedAt: string;
|
|
535
|
+
};
|
|
536
|
+
|
|
537
|
+
interface FileNode {
|
|
538
|
+
name: string;
|
|
539
|
+
path: string;
|
|
540
|
+
type: "file" | "folder";
|
|
541
|
+
size?: number;
|
|
542
|
+
content?: string | ArrayBuffer;
|
|
543
|
+
mimeType?: string;
|
|
544
|
+
children?: FileNode[];
|
|
545
|
+
}
|
|
546
|
+
interface Zip {
|
|
547
|
+
files: FileNode[];
|
|
548
|
+
totalFiles: number;
|
|
549
|
+
totalSize: number;
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
type ValidateManifestProp = {
|
|
553
|
+
text: string;
|
|
554
|
+
id: string;
|
|
555
|
+
};
|
|
556
|
+
declare const validateManifest: (manifestContent: string) => ValidateManifestProp[];
|
|
557
|
+
|
|
558
|
+
export { type BBEvent, type BBRequest, type Checkpoint, type CopyArg, type DirInfo, type DirectoryContents, type DirectoryStats, type EventReturn, type FileContent, type FileInfo, type GitFileStatus, type IconArg, type Language, type Load, type Locale, type MenuContent, type Nav, type Plugin, type Project, type Release, type RenameType, type RequestReturn, type Result, type Route, type Settings, type TutorialHeader, type User, type ValidateManifestProp, type WatchFSEvent, type Zip, BBRelay as default, enGB, frFR, injectStyles, registerEvent, registerRequest, validateManifest };
|
package/dist/index.d.ts
CHANGED
|
@@ -465,29 +465,6 @@ interface MenuContent {
|
|
|
465
465
|
|
|
466
466
|
type Nav = "file-explorer" | "checkpoints" | "plugins" | "settings" | "remote";
|
|
467
467
|
|
|
468
|
-
type Plugin = {
|
|
469
|
-
id: string;
|
|
470
|
-
slug: string;
|
|
471
|
-
userId: string;
|
|
472
|
-
size: number;
|
|
473
|
-
latestProduction: {
|
|
474
|
-
version: string;
|
|
475
|
-
id: number;
|
|
476
|
-
};
|
|
477
|
-
latestBeta: {
|
|
478
|
-
version: string;
|
|
479
|
-
id: number;
|
|
480
|
-
};
|
|
481
|
-
latestAlpha: {
|
|
482
|
-
version: string;
|
|
483
|
-
id: number;
|
|
484
|
-
};
|
|
485
|
-
latestDraft: {
|
|
486
|
-
version: string;
|
|
487
|
-
id: number;
|
|
488
|
-
};
|
|
489
|
-
};
|
|
490
|
-
|
|
491
468
|
interface RenameType {
|
|
492
469
|
path: string;
|
|
493
470
|
name: string;
|
|
@@ -521,4 +498,61 @@ declare const frFR: {
|
|
|
521
498
|
[key in Language]: ;
|
|
522
499
|
};
|
|
523
500
|
|
|
524
|
-
|
|
501
|
+
type Release = {
|
|
502
|
+
storageRef: string;
|
|
503
|
+
changes: string;
|
|
504
|
+
version: string;
|
|
505
|
+
type: "production" | "beta" | "alpha" | "draft";
|
|
506
|
+
slug: string;
|
|
507
|
+
metadata: {
|
|
508
|
+
uploadedAt: number;
|
|
509
|
+
totalFiles: number;
|
|
510
|
+
totalSize: number;
|
|
511
|
+
};
|
|
512
|
+
createdAt: string;
|
|
513
|
+
id?: string;
|
|
514
|
+
};
|
|
515
|
+
|
|
516
|
+
type Status = Omit<Release, "type">;
|
|
517
|
+
/**
|
|
518
|
+
* This will be pulled from two firestore
|
|
519
|
+
* The part of name, description etc will be in the main
|
|
520
|
+
* Things like installs will be in the registry
|
|
521
|
+
*/
|
|
522
|
+
type Plugin = {
|
|
523
|
+
userId: string;
|
|
524
|
+
slug: string;
|
|
525
|
+
name: string;
|
|
526
|
+
description: string | null;
|
|
527
|
+
installs: number;
|
|
528
|
+
archived?: boolean;
|
|
529
|
+
deprecated?: boolean;
|
|
530
|
+
alpha: Status | null;
|
|
531
|
+
beta: Status | null;
|
|
532
|
+
production: Status | null;
|
|
533
|
+
createdAt: string;
|
|
534
|
+
updatedAt: string;
|
|
535
|
+
};
|
|
536
|
+
|
|
537
|
+
interface FileNode {
|
|
538
|
+
name: string;
|
|
539
|
+
path: string;
|
|
540
|
+
type: "file" | "folder";
|
|
541
|
+
size?: number;
|
|
542
|
+
content?: string | ArrayBuffer;
|
|
543
|
+
mimeType?: string;
|
|
544
|
+
children?: FileNode[];
|
|
545
|
+
}
|
|
546
|
+
interface Zip {
|
|
547
|
+
files: FileNode[];
|
|
548
|
+
totalFiles: number;
|
|
549
|
+
totalSize: number;
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
type ValidateManifestProp = {
|
|
553
|
+
text: string;
|
|
554
|
+
id: string;
|
|
555
|
+
};
|
|
556
|
+
declare const validateManifest: (manifestContent: string) => ValidateManifestProp[];
|
|
557
|
+
|
|
558
|
+
export { type BBEvent, type BBRequest, type Checkpoint, type CopyArg, type DirInfo, type DirectoryContents, type DirectoryStats, type EventReturn, type FileContent, type FileInfo, type GitFileStatus, type IconArg, type Language, type Load, type Locale, type MenuContent, type Nav, type Plugin, type Project, type Release, type RenameType, type RequestReturn, type Result, type Route, type Settings, type TutorialHeader, type User, type ValidateManifestProp, type WatchFSEvent, type Zip, BBRelay as default, enGB, frFR, injectStyles, registerEvent, registerRequest, validateManifest };
|
package/dist/index.js
CHANGED
|
@@ -25,7 +25,8 @@ __export(src_exports, {
|
|
|
25
25
|
frFR: () => fr_FR_default,
|
|
26
26
|
injectStyles: () => injectStyles,
|
|
27
27
|
registerEvent: () => registerEvent,
|
|
28
|
-
registerRequest: () => registerRequest
|
|
28
|
+
registerRequest: () => registerRequest,
|
|
29
|
+
validateManifest: () => validate_manifest_default
|
|
29
30
|
});
|
|
30
31
|
module.exports = __toCommonJS(src_exports);
|
|
31
32
|
|
|
@@ -393,6 +394,37 @@ var frFR = {
|
|
|
393
394
|
};
|
|
394
395
|
var fr_FR_default = frFR;
|
|
395
396
|
|
|
397
|
+
// src/lib/validate-manifest.ts
|
|
398
|
+
var validateManifest = (manifestContent) => {
|
|
399
|
+
const checks = [];
|
|
400
|
+
const content = JSON.parse(manifestContent);
|
|
401
|
+
if (!content.id) {
|
|
402
|
+
checks.push({
|
|
403
|
+
text: "Manifest id is missing",
|
|
404
|
+
id: "manifest-id"
|
|
405
|
+
});
|
|
406
|
+
}
|
|
407
|
+
if (!content.manifest_version) {
|
|
408
|
+
checks.push({
|
|
409
|
+
text: "Manifest manifest_version is missing",
|
|
410
|
+
id: "manifest-version"
|
|
411
|
+
});
|
|
412
|
+
} else if (content.manifest_version !== 1) {
|
|
413
|
+
checks.push({
|
|
414
|
+
text: "Manifest manifest_version should be 1",
|
|
415
|
+
id: "manifest-version"
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
if (!content.version) {
|
|
419
|
+
checks.push({
|
|
420
|
+
text: "Plugin version not provided",
|
|
421
|
+
id: "plugin-version"
|
|
422
|
+
});
|
|
423
|
+
}
|
|
424
|
+
return checks;
|
|
425
|
+
};
|
|
426
|
+
var validate_manifest_default = validateManifest;
|
|
427
|
+
|
|
396
428
|
// src/index.ts
|
|
397
429
|
var src_default = BBRelay;
|
|
398
430
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -401,5 +433,6 @@ var src_default = BBRelay;
|
|
|
401
433
|
frFR,
|
|
402
434
|
injectStyles,
|
|
403
435
|
registerEvent,
|
|
404
|
-
registerRequest
|
|
436
|
+
registerRequest,
|
|
437
|
+
validateManifest
|
|
405
438
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -364,6 +364,37 @@ var frFR = {
|
|
|
364
364
|
};
|
|
365
365
|
var fr_FR_default = frFR;
|
|
366
366
|
|
|
367
|
+
// src/lib/validate-manifest.ts
|
|
368
|
+
var validateManifest = (manifestContent) => {
|
|
369
|
+
const checks = [];
|
|
370
|
+
const content = JSON.parse(manifestContent);
|
|
371
|
+
if (!content.id) {
|
|
372
|
+
checks.push({
|
|
373
|
+
text: "Manifest id is missing",
|
|
374
|
+
id: "manifest-id"
|
|
375
|
+
});
|
|
376
|
+
}
|
|
377
|
+
if (!content.manifest_version) {
|
|
378
|
+
checks.push({
|
|
379
|
+
text: "Manifest manifest_version is missing",
|
|
380
|
+
id: "manifest-version"
|
|
381
|
+
});
|
|
382
|
+
} else if (content.manifest_version !== 1) {
|
|
383
|
+
checks.push({
|
|
384
|
+
text: "Manifest manifest_version should be 1",
|
|
385
|
+
id: "manifest-version"
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
if (!content.version) {
|
|
389
|
+
checks.push({
|
|
390
|
+
text: "Plugin version not provided",
|
|
391
|
+
id: "plugin-version"
|
|
392
|
+
});
|
|
393
|
+
}
|
|
394
|
+
return checks;
|
|
395
|
+
};
|
|
396
|
+
var validate_manifest_default = validateManifest;
|
|
397
|
+
|
|
367
398
|
// src/index.ts
|
|
368
399
|
var src_default = BBRelay;
|
|
369
400
|
export {
|
|
@@ -372,5 +403,6 @@ export {
|
|
|
372
403
|
fr_FR_default as frFR,
|
|
373
404
|
injectStyles,
|
|
374
405
|
registerEvent,
|
|
375
|
-
registerRequest
|
|
406
|
+
registerRequest,
|
|
407
|
+
validate_manifest_default as validateManifest
|
|
376
408
|
};
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -22,7 +22,6 @@ import Language from "./types/editor/Language";
|
|
|
22
22
|
import Locale from "./types/editor/Locale";
|
|
23
23
|
import { MenuContent } from "./types/editor/MenuContent";
|
|
24
24
|
import Nav from "./types/editor/Nav";
|
|
25
|
-
import { Plugin } from "./types/editor/Plugin";
|
|
26
25
|
import Project from "./types/project/Project";
|
|
27
26
|
import { RenameType } from "./types/editor/RenameType";
|
|
28
27
|
import Result from "./types/editor/Result";
|
|
@@ -31,11 +30,17 @@ import { Settings } from "./types/editor/Settings";
|
|
|
31
30
|
import { TutorialHeader } from "./types/editor/TutorialHeader";
|
|
32
31
|
import enGB from "./locales/en-GB";
|
|
33
32
|
import frFR from "./locales/fr-FR";
|
|
33
|
+
import { Release } from "./types/plugins/Release";
|
|
34
|
+
import { Plugin } from "./types/plugins/Plugin";
|
|
35
|
+
import { Zip } from "./types/Zip";
|
|
36
|
+
import validateManifest, {
|
|
37
|
+
ValidateManifestProp,
|
|
38
|
+
} from "./lib/validate-manifest";
|
|
34
39
|
|
|
35
40
|
export default BBRelay;
|
|
36
41
|
|
|
37
42
|
export { registerRequest, injectStyles, registerEvent };
|
|
38
|
-
|
|
43
|
+
export { validateManifest };
|
|
39
44
|
export type {
|
|
40
45
|
BBRequest,
|
|
41
46
|
DirInfo,
|
|
@@ -58,7 +63,6 @@ export type {
|
|
|
58
63
|
Locale,
|
|
59
64
|
MenuContent,
|
|
60
65
|
Nav,
|
|
61
|
-
Plugin,
|
|
62
66
|
Project,
|
|
63
67
|
RenameType,
|
|
64
68
|
Result,
|
|
@@ -69,4 +73,5 @@ export type {
|
|
|
69
73
|
WatchFSEvent,
|
|
70
74
|
};
|
|
71
75
|
|
|
76
|
+
export type { Release, Plugin, Zip, ValidateManifestProp };
|
|
72
77
|
export { enGB, frFR };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export type ValidateManifestProp = {
|
|
2
|
+
text: string;
|
|
3
|
+
id: string;
|
|
4
|
+
};
|
|
5
|
+
|
|
6
|
+
const validateManifest = (manifestContent: string) => {
|
|
7
|
+
const checks: ValidateManifestProp[] = [];
|
|
8
|
+
const content: Record<string, unknown> = JSON.parse(manifestContent);
|
|
9
|
+
|
|
10
|
+
if (!content.id) {
|
|
11
|
+
checks.push({
|
|
12
|
+
text: "Manifest id is missing",
|
|
13
|
+
id: "manifest-id",
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
if (!content.manifest_version) {
|
|
17
|
+
checks.push({
|
|
18
|
+
text: "Manifest manifest_version is missing",
|
|
19
|
+
id: "manifest-version",
|
|
20
|
+
});
|
|
21
|
+
} else if (content.manifest_version !== 1) {
|
|
22
|
+
checks.push({
|
|
23
|
+
text: "Manifest manifest_version should be 1",
|
|
24
|
+
id: "manifest-version",
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
if (!content.version) {
|
|
28
|
+
checks.push({
|
|
29
|
+
text: "Plugin version not provided",
|
|
30
|
+
id: "plugin-version",
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return checks;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export default validateManifest;
|
package/src/types/Zip.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
interface FileNode {
|
|
2
|
+
name: string;
|
|
3
|
+
path: string;
|
|
4
|
+
type: "file" | "folder";
|
|
5
|
+
size?: number;
|
|
6
|
+
content?: string | ArrayBuffer;
|
|
7
|
+
mimeType?: string;
|
|
8
|
+
children?: FileNode[];
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface Zip {
|
|
12
|
+
files: FileNode[];
|
|
13
|
+
totalFiles: number;
|
|
14
|
+
totalSize: number;
|
|
15
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Release } from "./Release";
|
|
2
|
+
|
|
3
|
+
type Status = Omit<Release, "type">;
|
|
4
|
+
/**
|
|
5
|
+
* This will be pulled from two firestore
|
|
6
|
+
* The part of name, description etc will be in the main
|
|
7
|
+
* Things like installs will be in the registry
|
|
8
|
+
*/
|
|
9
|
+
export type Plugin = {
|
|
10
|
+
userId: string;
|
|
11
|
+
slug: string;
|
|
12
|
+
name: string;
|
|
13
|
+
description: string | null;
|
|
14
|
+
installs: number;
|
|
15
|
+
archived?: boolean;
|
|
16
|
+
deprecated?: boolean;
|
|
17
|
+
alpha: Status | null;
|
|
18
|
+
beta: Status | null;
|
|
19
|
+
production: Status | null;
|
|
20
|
+
createdAt: string;
|
|
21
|
+
updatedAt: string;
|
|
22
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type Release = {
|
|
2
|
+
storageRef: string;
|
|
3
|
+
changes: string;
|
|
4
|
+
version: string;
|
|
5
|
+
type: "production" | "beta" | "alpha" | "draft";
|
|
6
|
+
slug: string;
|
|
7
|
+
metadata: {
|
|
8
|
+
uploadedAt: number;
|
|
9
|
+
totalFiles: number;
|
|
10
|
+
totalSize: number;
|
|
11
|
+
};
|
|
12
|
+
createdAt: string;
|
|
13
|
+
id?: string
|
|
14
|
+
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export type Plugin = {
|
|
2
|
-
id: string;
|
|
3
|
-
slug: string;
|
|
4
|
-
userId: string;
|
|
5
|
-
size: number;
|
|
6
|
-
latestProduction: {
|
|
7
|
-
version: string;
|
|
8
|
-
id: number;
|
|
9
|
-
};
|
|
10
|
-
latestBeta: {
|
|
11
|
-
version: string;
|
|
12
|
-
id: number;
|
|
13
|
-
};
|
|
14
|
-
latestAlpha: {
|
|
15
|
-
version: string;
|
|
16
|
-
id: number;
|
|
17
|
-
};
|
|
18
|
-
latestDraft: {
|
|
19
|
-
version: string;
|
|
20
|
-
id: number;
|
|
21
|
-
};
|
|
22
|
-
};
|