@superblocksteam/util 2.0.167-next.0 → 2.0.169-next.0
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/constants.d.ts +0 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +1 -2
- package/dist/constants.js.map +1 -1
- package/dist/events.d.ts +0 -3
- package/dist/events.d.ts.map +1 -1
- package/dist/events.js +0 -3
- package/dist/events.js.map +1 -1
- package/dist/file-uploader.js +3 -3
- package/dist/file-uploader.js.map +1 -1
- package/dist/file-uploader.test.js +1 -0
- package/dist/file-uploader.test.js.map +1 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -3
- package/dist/index.js.map +1 -1
- package/dist/login.d.ts.map +1 -1
- package/dist/login.js +14 -2
- package/dist/login.js.map +1 -1
- package/dist/login.test.d.ts +2 -0
- package/dist/login.test.d.ts.map +1 -0
- package/dist/login.test.js +66 -0
- package/dist/login.test.js.map +1 -0
- package/package.json +2 -6
- package/dist/component-configs.d.ts +0 -6
- package/dist/component-configs.d.ts.map +0 -1
- package/dist/component-configs.js +0 -178
- package/dist/component-configs.js.map +0 -1
- package/dist/data-types.d.ts +0 -8
- package/dist/data-types.d.ts.map +0 -1
- package/dist/data-types.js +0 -22
- package/dist/data-types.js.map +0 -1
- package/dist/generate-component-types.d.ts +0 -3
- package/dist/generate-component-types.d.ts.map +0 -1
- package/dist/generate-component-types.js +0 -45
- package/dist/generate-component-types.js.map +0 -1
- package/dist/types.d.ts +0 -105
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -3
- package/dist/types.js.map +0 -1
- package/dist/validation.d.ts +0 -5
- package/dist/validation.d.ts.map +0 -1
- package/dist/validation.js +0 -152
- package/dist/validation.js.map +0 -1
package/dist/constants.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ export declare const SUPERBLOCKS_HOME_FOLDER_NAME = ".superblocks";
|
|
|
2
2
|
export declare const TOKEN_CONFIG_PATH = ".superblocks/auth.json";
|
|
3
3
|
export declare const RESOURCE_CONFIG_PATH = ".superblocks/superblocks.json";
|
|
4
4
|
export declare const DEV_ENVIRONMENT_CONFIG_PATH = ".superblocks/dev-environment.json";
|
|
5
|
-
export declare const CUSTOM_COMPONENTS_PATH = "components";
|
|
6
5
|
export declare class FileAccessError extends Error {
|
|
7
6
|
constructor(message: string);
|
|
8
7
|
}
|
package/dist/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,4BAA4B,iBAAiB,CAAC;AAC3D,eAAO,MAAM,iBAAiB,2BAA2B,CAAC;AAC1D,eAAO,MAAM,oBAAoB,kCAAkC,CAAC;AACpE,eAAO,MAAM,2BAA2B,sCAAsC,CAAC;AAE/E,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,4BAA4B,iBAAiB,CAAC;AAC3D,eAAO,MAAM,iBAAiB,2BAA2B,CAAC;AAC1D,eAAO,MAAM,oBAAoB,kCAAkC,CAAC;AACpE,eAAO,MAAM,2BAA2B,sCAAsC,CAAC;AAE/E,qBAAa,eAAgB,SAAQ,KAAK;gBAC5B,OAAO,EAAE,MAAM;CAI5B;AAED,qBAAa,aAAc,SAAQ,KAAK;gBAC1B,OAAO,EAAE,MAAM;CAI5B;AAED,qBAAa,eAAgB,SAAQ,KAAK;gBAC5B,OAAO,EAAE,MAAM;CAI5B;AAED,qBAAa,cAAe,SAAQ,KAAK;gBAC3B,OAAO,EAAE,MAAM;CAI5B"}
|
package/dist/constants.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ForbiddenError = exports.BadRequestError = exports.NotFoundError = exports.FileAccessError = exports.
|
|
3
|
+
exports.ForbiddenError = exports.BadRequestError = exports.NotFoundError = exports.FileAccessError = exports.DEV_ENVIRONMENT_CONFIG_PATH = exports.RESOURCE_CONFIG_PATH = exports.TOKEN_CONFIG_PATH = exports.SUPERBLOCKS_HOME_FOLDER_NAME = void 0;
|
|
4
4
|
exports.SUPERBLOCKS_HOME_FOLDER_NAME = ".superblocks";
|
|
5
5
|
exports.TOKEN_CONFIG_PATH = ".superblocks/auth.json";
|
|
6
6
|
exports.RESOURCE_CONFIG_PATH = ".superblocks/superblocks.json";
|
|
7
7
|
exports.DEV_ENVIRONMENT_CONFIG_PATH = ".superblocks/dev-environment.json";
|
|
8
|
-
exports.CUSTOM_COMPONENTS_PATH = "components";
|
|
9
8
|
class FileAccessError extends Error {
|
|
10
9
|
constructor(message) {
|
|
11
10
|
super(message);
|
package/dist/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,4BAA4B,GAAG,cAAc,CAAC;AAC9C,QAAA,iBAAiB,GAAG,wBAAwB,CAAC;AAC7C,QAAA,oBAAoB,GAAG,+BAA+B,CAAC;AACvD,QAAA,2BAA2B,GAAG,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,4BAA4B,GAAG,cAAc,CAAC;AAC9C,QAAA,iBAAiB,GAAG,wBAAwB,CAAC;AAC7C,QAAA,oBAAoB,GAAG,+BAA+B,CAAC;AACvD,QAAA,2BAA2B,GAAG,mCAAmC,CAAC;AAE/E,MAAa,eAAgB,SAAQ,KAAK;IACxC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;IAChC,CAAC;CACF;AALD,0CAKC;AAED,MAAa,aAAc,SAAQ,KAAK;IACtC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC;IAClC,CAAC;CACF;AALD,sCAKC;AAED,MAAa,eAAgB,SAAQ,KAAK;IACxC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;IAChC,CAAC;CACF;AALD,0CAKC;AAED,MAAa,cAAe,SAAQ,KAAK;IACvC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;IAC/B,CAAC;CACF;AALD,wCAKC"}
|
package/dist/events.d.ts
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
export declare enum ComponentEvent {
|
|
2
|
-
CREATE = "create",
|
|
3
2
|
INIT = "init",
|
|
4
3
|
LOGIN = "login",
|
|
5
4
|
MIGRATE = "migrate",
|
|
6
5
|
PULL = "pull",
|
|
7
6
|
COMMITS = "commits",
|
|
8
7
|
PUSH = "push",
|
|
9
|
-
REGISTER = "register",
|
|
10
|
-
UPLOAD = "upload",
|
|
11
8
|
DEPLOY = "deploy"
|
|
12
9
|
}
|
|
13
10
|
//# sourceMappingURL=events.d.ts.map
|
package/dist/events.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAAA,oBAAY,cAAc;IACxB,
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAAA,oBAAY,cAAc;IACxB,IAAI,SAAS;IACb,KAAK,UAAU;IACf,OAAO,YAAY;IACnB,IAAI,SAAS;IACb,OAAO,YAAY;IACnB,IAAI,SAAS;IACb,MAAM,WAAW;CAClB"}
|
package/dist/events.js
CHANGED
|
@@ -3,15 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ComponentEvent = void 0;
|
|
4
4
|
var ComponentEvent;
|
|
5
5
|
(function (ComponentEvent) {
|
|
6
|
-
ComponentEvent["CREATE"] = "create";
|
|
7
6
|
ComponentEvent["INIT"] = "init";
|
|
8
7
|
ComponentEvent["LOGIN"] = "login";
|
|
9
8
|
ComponentEvent["MIGRATE"] = "migrate";
|
|
10
9
|
ComponentEvent["PULL"] = "pull";
|
|
11
10
|
ComponentEvent["COMMITS"] = "commits";
|
|
12
11
|
ComponentEvent["PUSH"] = "push";
|
|
13
|
-
ComponentEvent["REGISTER"] = "register";
|
|
14
|
-
ComponentEvent["UPLOAD"] = "upload";
|
|
15
12
|
ComponentEvent["DEPLOY"] = "deploy";
|
|
16
13
|
})(ComponentEvent || (exports.ComponentEvent = ComponentEvent = {}));
|
|
17
14
|
//# sourceMappingURL=events.js.map
|
package/dist/events.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.js","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":";;;AAAA,IAAY,
|
|
1
|
+
{"version":3,"file":"events.js","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":";;;AAAA,IAAY,cAQX;AARD,WAAY,cAAc;IACxB,+BAAa,CAAA;IACb,iCAAe,CAAA;IACf,qCAAmB,CAAA;IACnB,+BAAa,CAAA;IACb,qCAAmB,CAAA;IACnB,+BAAa,CAAA;IACb,mCAAiB,CAAA;AACnB,CAAC,EARW,cAAc,8BAAd,cAAc,QAQzB"}
|
package/dist/file-uploader.js
CHANGED
|
@@ -16,7 +16,9 @@ const getBucketeerUrlFromSuperblocksUrl = (superblocksBaseUrl) => {
|
|
|
16
16
|
catch {
|
|
17
17
|
return localhostBucketeerUrl();
|
|
18
18
|
}
|
|
19
|
-
|
|
19
|
+
// PR environments and master (the shared environment built from master)
|
|
20
|
+
// upload through the dev bucketeer in the staging account.
|
|
21
|
+
if (/^(?:pr-.*|master)\.superblocks\.dev$/u.test(hostname)) {
|
|
20
22
|
return "https://bucketeer.dev.superblocks.com";
|
|
21
23
|
}
|
|
22
24
|
switch (hostname) {
|
|
@@ -29,8 +31,6 @@ const getBucketeerUrlFromSuperblocksUrl = (superblocksBaseUrl) => {
|
|
|
29
31
|
case "app.superblocks.com":
|
|
30
32
|
case "app.superblockshq.com":
|
|
31
33
|
return "https://bucketeer.superblocks.com";
|
|
32
|
-
case "dev.superblocks.com":
|
|
33
|
-
return "https://bucketeer.dev.superblocks.com";
|
|
34
34
|
case "127.0.0.1":
|
|
35
35
|
case "localhost":
|
|
36
36
|
default:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-uploader.js","sourceRoot":"","sources":["../src/file-uploader.ts"],"names":[],"mappings":";;;AAAa,QAAA,sBAAsB,GAAG,+BAA+B,CAAC;AAEtE,4EAA4E;AAC5E,4EAA4E;AAC5E,2EAA2E;AAC3E,8BAA8B;AAC9B,MAAM,qBAAqB,GAAG,GAAW,EAAE,CACzC,OAAO,CAAC,GAAG,CAAC,yBAAyB,IAAI,uBAAuB,CAAC;AAEnE,qEAAqE;AAC9D,MAAM,iCAAiC,GAAG,CAC/C,kBAA0B,EAClB,EAAE;IACV,IAAI,QAAgB,CAAC;IACrB,IAAI,CAAC;QACH,QAAQ,GAAG,IAAI,GAAG,CAAC,kBAAkB,CAAC,CAAC,QAAQ,CAAC;IAClD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,qBAAqB,EAAE,CAAC;IACjC,CAAC;IAED,IAAI,
|
|
1
|
+
{"version":3,"file":"file-uploader.js","sourceRoot":"","sources":["../src/file-uploader.ts"],"names":[],"mappings":";;;AAAa,QAAA,sBAAsB,GAAG,+BAA+B,CAAC;AAEtE,4EAA4E;AAC5E,4EAA4E;AAC5E,2EAA2E;AAC3E,8BAA8B;AAC9B,MAAM,qBAAqB,GAAG,GAAW,EAAE,CACzC,OAAO,CAAC,GAAG,CAAC,yBAAyB,IAAI,uBAAuB,CAAC;AAEnE,qEAAqE;AAC9D,MAAM,iCAAiC,GAAG,CAC/C,kBAA0B,EAClB,EAAE;IACV,IAAI,QAAgB,CAAC;IACrB,IAAI,CAAC;QACH,QAAQ,GAAG,IAAI,GAAG,CAAC,kBAAkB,CAAC,CAAC,QAAQ,CAAC;IAClD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,qBAAqB,EAAE,CAAC;IACjC,CAAC;IAED,wEAAwE;IACxE,2DAA2D;IAC3D,IAAI,uCAAuC,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC3D,OAAO,uCAAuC,CAAC;IACjD,CAAC;IAED,QAAQ,QAAQ,EAAE,CAAC;QACjB,KAAK,oBAAoB,CAAC;QAC1B,KAAK,yBAAyB;YAC5B,OAAO,sCAAsC,CAAC;QAChD,KAAK,6BAA6B,CAAC;QACnC,KAAK,yBAAyB;YAC5B,OAAO,2CAA2C,CAAC;QACrD,KAAK,qBAAqB,CAAC;QAC3B,KAAK,uBAAuB;YAC1B,OAAO,mCAAmC,CAAC;QAC7C,KAAK,WAAW,CAAC;QACjB,KAAK,WAAW,CAAC;QACjB;YACE,OAAO,qBAAqB,EAAE,CAAC;IACnC,CAAC;AACH,CAAC,CAAC;AA/BW,QAAA,iCAAiC,qCA+B5C"}
|
|
@@ -38,6 +38,7 @@ const file_uploader_js_1 = require("./file-uploader.js");
|
|
|
38
38
|
(0, vitest_1.expect)((0, file_uploader_js_1.getBucketeerUrlFromSuperblocksUrl)("https://staging.superblocks.com")).toBe("https://bucketeer.staging.superblocks.com");
|
|
39
39
|
(0, vitest_1.expect)((0, file_uploader_js_1.getBucketeerUrlFromSuperblocksUrl)("https://eu.superblocks.com")).toBe("https://bucketeer.eu.superblocks.com");
|
|
40
40
|
(0, vitest_1.expect)((0, file_uploader_js_1.getBucketeerUrlFromSuperblocksUrl)("https://pr-123.superblocks.dev")).toBe("https://bucketeer.dev.superblocks.com");
|
|
41
|
+
(0, vitest_1.expect)((0, file_uploader_js_1.getBucketeerUrlFromSuperblocksUrl)("https://master.superblocks.dev")).toBe("https://bucketeer.dev.superblocks.com");
|
|
41
42
|
});
|
|
42
43
|
});
|
|
43
44
|
//# sourceMappingURL=file-uploader.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-uploader.test.js","sourceRoot":"","sources":["../src/file-uploader.test.ts"],"names":[],"mappings":";;AAAA,mCAAqE;AAErE,yDAAuE;AAEvE,IAAA,iBAAQ,EAAC,mCAAmC,EAAE,GAAG,EAAE;IACjD,IAAI,WAA+B,CAAC;IAEpC,IAAA,mBAAU,EAAC,GAAG,EAAE;QACd,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC;QACpD,OAAO,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC;IAC/C,CAAC,CAAC,CAAC;IAEH,IAAA,kBAAS,EAAC,GAAG,EAAE;QACb,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;YAC9B,OAAO,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC;QAC/C,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,GAAG,CAAC,yBAAyB,GAAG,WAAW,CAAC;QACtD,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,IAAA,WAAE,EAAC,mEAAmE,EAAE,GAAG,EAAE;QAC3E,IAAA,eAAM,EAAC,IAAA,oDAAiC,EAAC,uBAAuB,CAAC,CAAC,CAAC,IAAI,CACrE,uBAAuB,CACxB,CAAC;QACF,IAAA,eAAM,EAAC,IAAA,oDAAiC,EAAC,uBAAuB,CAAC,CAAC,CAAC,IAAI,CACrE,uBAAuB,CACxB,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,IAAA,WAAE,EAAC,+EAA+E,EAAE,GAAG,EAAE;QACvF,OAAO,CAAC,GAAG,CAAC,yBAAyB,GAAG,uBAAuB,CAAC;QAChE,IAAA,eAAM,EAAC,IAAA,oDAAiC,EAAC,uBAAuB,CA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AC,IAAA,oDAAiC,EAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CACzD,uBAAuB,CACxB,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,IAAA,WAAE,EAAC,kEAAkE,EAAE,GAAG,EAAE;QAC1E,OAAO,CAAC,GAAG,CAAC,yBAAyB,GAAG,uBAAuB,CAAC;QAChE,IAAA,eAAM,EAAC,IAAA,oDAAiC,EAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CACzD,uBAAuB,CACxB,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,IAAA,WAAE,EAAC,+DAA+D,EAAE,GAAG,EAAE;QACvE,OAAO,CAAC,GAAG,CAAC,yBAAyB,GAAG,uBAAuB,CAAC;QAEhE,IAAA,eAAM,EACJ,IAAA,oDAAiC,EAAC,6BAA6B,CAAC,CACjE,CAAC,IAAI,CAAC,mCAAmC,CAAC,CAAC;QAC5C,IAAA,eAAM,EACJ,IAAA,oDAAiC,EAAC,iCAAiC,CAAC,CACrE,CAAC,IAAI,CAAC,2CAA2C,CAAC,CAAC;QACpD,IAAA,eAAM,EACJ,IAAA,oDAAiC,EAAC,4BAA4B,CAAC,CAChE,CAAC,IAAI,CAAC,sCAAsC,CAAC,CAAC;QAC/C,IAAA,eAAM,EACJ,IAAA,oDAAiC,EAAC,gCAAgC,CAAC,CACpE,CAAC,IAAI,CAAC,uCAAuC,CAAC,CAAC;QAChD,IAAA,eAAM,EACJ,IAAA,oDAAiC,EAAC,gCAAgC,CAAC,CACpE,CAAC,IAAI,CAAC,uCAAuC,CAAC,CAAC;IAClD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
export * from "./constants.js";
|
|
2
|
-
export * from "./component-configs.js";
|
|
3
2
|
export * from "./events.js";
|
|
4
3
|
export * from "./file-uploader.js";
|
|
5
4
|
export * from "./login.js";
|
|
6
5
|
export * from "./resource-configs.js";
|
|
7
|
-
export * from "./data-types.js";
|
|
8
|
-
export * from "./types.js";
|
|
9
6
|
export * from "./identifiers.js";
|
|
10
7
|
export * from "./localGitRepoState.js";
|
|
11
8
|
export * from "./unreachable.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -15,13 +15,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./constants.js"), exports);
|
|
18
|
-
__exportStar(require("./component-configs.js"), exports);
|
|
19
18
|
__exportStar(require("./events.js"), exports);
|
|
20
19
|
__exportStar(require("./file-uploader.js"), exports);
|
|
21
20
|
__exportStar(require("./login.js"), exports);
|
|
22
21
|
__exportStar(require("./resource-configs.js"), exports);
|
|
23
|
-
__exportStar(require("./data-types.js"), exports);
|
|
24
|
-
__exportStar(require("./types.js"), exports);
|
|
25
22
|
__exportStar(require("./identifiers.js"), exports);
|
|
26
23
|
__exportStar(require("./localGitRepoState.js"), exports);
|
|
27
24
|
__exportStar(require("./unreachable.js"), exports);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,8CAA4B;AAC5B,qDAAmC;AACnC,6CAA2B;AAC3B,wDAAsC;AACtC,mDAAiC;AACjC,yDAAuC;AACvC,mDAAiC;AACjC,uDAAqC;AACrC,uDAAqC;AACrC,2DAAyC;AACzC,yDAAuC;AACvC,qDAAmC"}
|
package/dist/login.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../src/login.ts"],"names":[],"mappings":"AAOA,KAAK,OAAO,GAAG;IACb,kBAAkB,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,KAAK,gBAAgB,GAAG,OAAO,GAAG;IAChC,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAI5C;AAED,wBAAsB,YAAY,CAAC,kBAAkB,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,iBAmB5E;AAED,wBAAsB,4BAA4B,IAAI,OAAO,CAC3D,gBAAgB,GAAG,OAAO,GAAG,SAAS,CACvC,CAMA;AAED,wBAAsB,oBAAoB,IAAI,OAAO,CACnD,gBAAgB,GAAG,OAAO,CAC3B,
|
|
1
|
+
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../src/login.ts"],"names":[],"mappings":"AAOA,KAAK,OAAO,GAAG;IACb,kBAAkB,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,KAAK,gBAAgB,GAAG,OAAO,GAAG;IAChC,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAI5C;AAED,wBAAsB,YAAY,CAAC,kBAAkB,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,iBAmB5E;AAED,wBAAsB,4BAA4B,IAAI,OAAO,CAC3D,gBAAgB,GAAG,OAAO,GAAG,SAAS,CACvC,CAMA;AAED,wBAAsB,oBAAoB,IAAI,OAAO,CACnD,gBAAgB,GAAG,OAAO,CAC3B,CAkCA"}
|
package/dist/login.js
CHANGED
|
@@ -53,10 +53,14 @@ async function getLocalTokenWithUrl() {
|
|
|
53
53
|
try {
|
|
54
54
|
const tokenConfig = await fs_extra_1.default.readJSON(resolveAuthFilePath());
|
|
55
55
|
const superblocksBaseUrl = process.env.SUPERBLOCKS_BASE_URL || tokenConfig.superblocksBaseUrl;
|
|
56
|
-
|
|
56
|
+
// The auth file wins over the env var: warm-standby activation writes the
|
|
57
|
+
// real token to the auth file while the container env may still hold the
|
|
58
|
+
// placeholder token it booted with.
|
|
59
|
+
const token = tokenConfig.token || process.env.SUPERBLOCKS_TOKEN;
|
|
60
|
+
if (token) {
|
|
57
61
|
// user logged in
|
|
58
62
|
return {
|
|
59
|
-
token
|
|
63
|
+
token,
|
|
60
64
|
superblocksBaseUrl,
|
|
61
65
|
};
|
|
62
66
|
}
|
|
@@ -68,6 +72,14 @@ async function getLocalTokenWithUrl() {
|
|
|
68
72
|
}
|
|
69
73
|
}
|
|
70
74
|
catch {
|
|
75
|
+
// No auth file (e.g. a container that bypassed the entrypoint): fall back
|
|
76
|
+
// to env-only configuration when both parts are present.
|
|
77
|
+
if (process.env.SUPERBLOCKS_TOKEN && process.env.SUPERBLOCKS_BASE_URL) {
|
|
78
|
+
return {
|
|
79
|
+
token: process.env.SUPERBLOCKS_TOKEN,
|
|
80
|
+
superblocksBaseUrl: process.env.SUPERBLOCKS_BASE_URL,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
71
83
|
throw new Error("No local API key found");
|
|
72
84
|
}
|
|
73
85
|
}
|
package/dist/login.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login.js","sourceRoot":"","sources":["../src/login.ts"],"names":[],"mappings":";;;;;AAoBA,kDAIC;AAED,oCAmBC;AAED,oEAQC;AAED,
|
|
1
|
+
{"version":3,"file":"login.js","sourceRoot":"","sources":["../src/login.ts"],"names":[],"mappings":";;;;;AAoBA,kDAIC;AAED,oCAmBC;AAED,oEAQC;AAED,oDAoCC;AA7FD,qCAAkC;AAClC,yCAA0C;AAE1C,wDAA0B;AAE1B,iDAAoE;AAUpE;;;;GAIG;AACH,SAAgB,mBAAmB;IACjC,OAAO,CACL,OAAO,CAAC,GAAG,CAAC,qBAAqB,IAAI,IAAA,gBAAI,EAAC,IAAA,iBAAO,GAAE,EAAE,gCAAiB,CAAC,CACxE,CAAC;AACJ,CAAC;AAEM,KAAK,UAAU,YAAY,CAAC,kBAA0B,EAAE,KAAc;IAC3E,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,mBAAmB,EAAE,CAAC;QACvC,MAAM,kBAAE,CAAC,SAAS,CAAC,IAAA,mBAAO,EAAC,QAAQ,CAAC,CAAC,CAAC;QACtC,IAAI,KAAK,EAAE,CAAC;YACV,MAAM,WAAW,GAAqB;gBACpC,kBAAkB;gBAClB,KAAK;aACN,CAAC;YACF,MAAM,kBAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;QAC5C,CAAC;aAAM,CAAC;YACN,MAAM,WAAW,GAAY;gBAC3B,kBAAkB;aACnB,CAAC;YACF,MAAM,kBAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;QAC5C,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,8BAAe,CAAC,sBAAsB,CAAC,CAAC;IACpD,CAAC;AACH,CAAC;AAEM,KAAK,UAAU,4BAA4B;IAGhD,IAAI,CAAC;QACH,OAAO,MAAM,oBAAoB,EAAE,CAAC;IACtC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC;AAEM,KAAK,UAAU,oBAAoB;IAGxC,IAAI,CAAC;QACH,MAAM,WAAW,GAAqB,MAAM,kBAAE,CAAC,QAAQ,CACrD,mBAAmB,EAAE,CACtB,CAAC;QACF,MAAM,kBAAkB,GACtB,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,WAAW,CAAC,kBAAkB,CAAC;QACrE,0EAA0E;QAC1E,yEAAyE;QACzE,oCAAoC;QACpC,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,IAAI,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC;QACjE,IAAI,KAAK,EAAE,CAAC;YACV,iBAAiB;YACjB,OAAO;gBACL,KAAK;gBACL,kBAAkB;aACnB,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,qCAAqC;YACrC,OAAO;gBACL,kBAAkB;aACnB,CAAC;QACJ,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,0EAA0E;QAC1E,yDAAyD;QACzD,IAAI,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAI,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,CAAC;YACtE,OAAO;gBACL,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,iBAAiB;gBACpC,kBAAkB,EAAE,OAAO,CAAC,GAAG,CAAC,oBAAoB;aACrD,CAAC;QACJ,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;IAC5C,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"login.test.d.ts","sourceRoot":"","sources":["../src/login.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const promises_1 = require("node:fs/promises");
|
|
4
|
+
const node_os_1 = require("node:os");
|
|
5
|
+
const node_path_1 = require("node:path");
|
|
6
|
+
const vitest_1 = require("vitest");
|
|
7
|
+
const login_js_1 = require("./login.js");
|
|
8
|
+
(0, vitest_1.describe)("getLocalTokenWithUrl", () => {
|
|
9
|
+
let authDir;
|
|
10
|
+
let authFile;
|
|
11
|
+
(0, vitest_1.beforeEach)(async () => {
|
|
12
|
+
authDir = await (0, promises_1.mkdtemp)((0, node_path_1.join)((0, node_os_1.tmpdir)(), "sb-auth-"));
|
|
13
|
+
authFile = (0, node_path_1.join)(authDir, "auth.json");
|
|
14
|
+
vitest_1.vi.stubEnv("SUPERBLOCKS_AUTH_FILE", authFile);
|
|
15
|
+
vitest_1.vi.stubEnv("SUPERBLOCKS_TOKEN", "");
|
|
16
|
+
vitest_1.vi.stubEnv("SUPERBLOCKS_BASE_URL", "");
|
|
17
|
+
});
|
|
18
|
+
(0, vitest_1.afterEach)(async () => {
|
|
19
|
+
vitest_1.vi.unstubAllEnvs();
|
|
20
|
+
await (0, promises_1.rm)(authDir, { force: true, recursive: true });
|
|
21
|
+
});
|
|
22
|
+
(0, vitest_1.it)("returns the token from the auth file", async () => {
|
|
23
|
+
await (0, promises_1.writeFile)(authFile, JSON.stringify({
|
|
24
|
+
superblocksBaseUrl: "https://app.superblocks.com",
|
|
25
|
+
token: "file-token",
|
|
26
|
+
}));
|
|
27
|
+
await (0, vitest_1.expect)((0, login_js_1.getLocalTokenWithUrl)()).resolves.toEqual({
|
|
28
|
+
superblocksBaseUrl: "https://app.superblocks.com",
|
|
29
|
+
token: "file-token",
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
(0, vitest_1.it)("prefers the auth-file token over the SUPERBLOCKS_TOKEN env var", async () => {
|
|
33
|
+
vitest_1.vi.stubEnv("SUPERBLOCKS_TOKEN", "env-token");
|
|
34
|
+
await (0, promises_1.writeFile)(authFile, JSON.stringify({
|
|
35
|
+
superblocksBaseUrl: "https://app.superblocks.com",
|
|
36
|
+
token: "file-token",
|
|
37
|
+
}));
|
|
38
|
+
await (0, vitest_1.expect)((0, login_js_1.getLocalTokenWithUrl)()).resolves.toEqual({
|
|
39
|
+
superblocksBaseUrl: "https://app.superblocks.com",
|
|
40
|
+
token: "file-token",
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
(0, vitest_1.it)("falls back to SUPERBLOCKS_TOKEN when the auth file has no token", async () => {
|
|
44
|
+
vitest_1.vi.stubEnv("SUPERBLOCKS_TOKEN", "env-token");
|
|
45
|
+
await (0, promises_1.writeFile)(authFile, JSON.stringify({
|
|
46
|
+
superblocksBaseUrl: "https://app.superblocks.com",
|
|
47
|
+
token: "",
|
|
48
|
+
}));
|
|
49
|
+
await (0, vitest_1.expect)((0, login_js_1.getLocalTokenWithUrl)()).resolves.toEqual({
|
|
50
|
+
superblocksBaseUrl: "https://app.superblocks.com",
|
|
51
|
+
token: "env-token",
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
(0, vitest_1.it)("falls back to env token and base URL when the auth file is missing", async () => {
|
|
55
|
+
vitest_1.vi.stubEnv("SUPERBLOCKS_TOKEN", "env-token");
|
|
56
|
+
vitest_1.vi.stubEnv("SUPERBLOCKS_BASE_URL", "https://env.superblocks.com");
|
|
57
|
+
await (0, vitest_1.expect)((0, login_js_1.getLocalTokenWithUrl)()).resolves.toEqual({
|
|
58
|
+
superblocksBaseUrl: "https://env.superblocks.com",
|
|
59
|
+
token: "env-token",
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
(0, vitest_1.it)("throws when there is no auth file and no env configuration", async () => {
|
|
63
|
+
await (0, vitest_1.expect)((0, login_js_1.getLocalTokenWithUrl)()).rejects.toThrow("No local API key found");
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
//# sourceMappingURL=login.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"login.test.js","sourceRoot":"","sources":["../src/login.test.ts"],"names":[],"mappings":";;AAAA,+CAA0D;AAC1D,q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AA4D,EAAE,KAAK,IAAI,EAAE;QAC1E,MAAM,IAAA,eAAM,EAAC,IAAA,+BAAoB,GAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAClD,wBAAwB,CACzB,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superblocksteam/util",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.169-next.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"homepage": "https://www.superblocks.com",
|
|
6
6
|
"license": "Superblocks Community Software License",
|
|
@@ -10,20 +10,15 @@
|
|
|
10
10
|
"sideEffects": false,
|
|
11
11
|
"main": "dist/index.js",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"ajv": "^8.20.0",
|
|
14
|
-
"better-ajv-errors": "1.2.0",
|
|
15
13
|
"fs-extra": "^11.1.1",
|
|
16
14
|
"lodash-es": "^4.18.1",
|
|
17
|
-
"mime-types": "^2.1.35",
|
|
18
15
|
"slugify": "^1.6.6",
|
|
19
|
-
"typescript": "^6.0.3",
|
|
20
16
|
"yaml": "^2.4.2"
|
|
21
17
|
},
|
|
22
18
|
"devDependencies": {
|
|
23
19
|
"@eslint/js": "^9.39.2",
|
|
24
20
|
"@types/fs-extra": "^11.0.1",
|
|
25
21
|
"@types/lodash-es": "^4.17.12",
|
|
26
|
-
"@types/mime-types": "^2.1.1",
|
|
27
22
|
"@types/node": "^24",
|
|
28
23
|
"eslint": "^9.39.2",
|
|
29
24
|
"eslint-config-prettier": "^10.1.8",
|
|
@@ -31,6 +26,7 @@
|
|
|
31
26
|
"eslint-plugin-import": "^2.32.0",
|
|
32
27
|
"eslint-plugin-unicorn": "^62.0.0",
|
|
33
28
|
"globals": "^17.3.0",
|
|
29
|
+
"typescript": "^6.0.3",
|
|
34
30
|
"typescript-eslint": "^8.59.2",
|
|
35
31
|
"vitest": "^4.1.11"
|
|
36
32
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"component-configs.d.ts","sourceRoot":"","sources":["../src/component-configs.ts"],"names":[],"mappings":"AAiFA,wBAAsB,mBAAmB,CACvC,kBAAkB,EAAE,OAAO,GAC1B,OAAO,CAAC;IACT,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC7B,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC,CAoED;AAED,eAAO,MAAM,cAAc,GAAI,UAAU,MAAM,KAAG,MAMjD,CAAC"}
|
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.getContentType = void 0;
|
|
40
|
-
exports.getComponentConfigs = getComponentConfigs;
|
|
41
|
-
const node_child_process_1 = require("node:child_process");
|
|
42
|
-
const node_os_1 = __importDefault(require("node:os"));
|
|
43
|
-
const node_path_1 = __importDefault(require("node:path"));
|
|
44
|
-
const util = __importStar(require("node:util"));
|
|
45
|
-
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
46
|
-
const mime_types_1 = __importDefault(require("mime-types"));
|
|
47
|
-
const constants_js_1 = require("./constants.js");
|
|
48
|
-
const generate_component_types_js_1 = require("./generate-component-types.js");
|
|
49
|
-
const validation_js_1 = require("./validation.js");
|
|
50
|
-
const asyncExecFile = util.promisify(node_child_process_1.execFile);
|
|
51
|
-
async function compileTypeScript(inputFilePath, outputDir) {
|
|
52
|
-
try {
|
|
53
|
-
const tscPath = require.resolve("typescript/bin/tsc");
|
|
54
|
-
if (tscPath) {
|
|
55
|
-
const result = await asyncExecFile("node", [
|
|
56
|
-
tscPath,
|
|
57
|
-
node_path_1.default.resolve(inputFilePath),
|
|
58
|
-
"--outDir",
|
|
59
|
-
outputDir,
|
|
60
|
-
"--jsx",
|
|
61
|
-
"react-jsx",
|
|
62
|
-
"--target",
|
|
63
|
-
"es2019",
|
|
64
|
-
"--esModuleInterop",
|
|
65
|
-
"true",
|
|
66
|
-
"--moduleResolution",
|
|
67
|
-
"node",
|
|
68
|
-
"--module",
|
|
69
|
-
"es2022",
|
|
70
|
-
"--strict",
|
|
71
|
-
"true",
|
|
72
|
-
"--skipLibCheck",
|
|
73
|
-
"true",
|
|
74
|
-
]);
|
|
75
|
-
if (result.stdout || result.stderr) {
|
|
76
|
-
return {
|
|
77
|
-
output: result.stdout || result.stderr,
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
catch (error) {
|
|
83
|
-
return {
|
|
84
|
-
output: error.stdout || error.stderr,
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
return {};
|
|
88
|
-
}
|
|
89
|
-
async function getFolderPaths() {
|
|
90
|
-
try {
|
|
91
|
-
const folderPaths = await fs_extra_1.default.readdir(constants_js_1.CUSTOM_COMPONENTS_PATH, {
|
|
92
|
-
withFileTypes: true,
|
|
93
|
-
});
|
|
94
|
-
// filter out any non-directory items
|
|
95
|
-
const directories = folderPaths.filter((dirent) => dirent.isDirectory() ||
|
|
96
|
-
(dirent.isSymbolicLink() &&
|
|
97
|
-
fs_extra_1.default
|
|
98
|
-
.statSync(node_path_1.default.join(constants_js_1.CUSTOM_COMPONENTS_PATH, dirent.name))
|
|
99
|
-
.isDirectory()));
|
|
100
|
-
// map each directory to its path
|
|
101
|
-
const folderPathsArray = directories.map((dirent) => node_path_1.default.join(constants_js_1.CUSTOM_COMPONENTS_PATH, dirent.name));
|
|
102
|
-
return folderPathsArray;
|
|
103
|
-
}
|
|
104
|
-
catch {
|
|
105
|
-
throw new Error("Could not access component directory, check your permissions");
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
async function getComponentConfigs(generateTypesFiles) {
|
|
109
|
-
const folderPaths = await getFolderPaths();
|
|
110
|
-
let hasError = false;
|
|
111
|
-
const promiseConfigFiles = folderPaths.map(async (ccpath) => {
|
|
112
|
-
const absPath = node_path_1.default.resolve(ccpath);
|
|
113
|
-
try {
|
|
114
|
-
const config = await fs_extra_1.default.readJSON(`${absPath}/config.json`);
|
|
115
|
-
console.log(`Found component in ${absPath}`);
|
|
116
|
-
return { ccpath, config };
|
|
117
|
-
}
|
|
118
|
-
catch {
|
|
119
|
-
// Noop because there is a fallback
|
|
120
|
-
}
|
|
121
|
-
// This is a tad complex to explain this hack but here's the context:
|
|
122
|
-
// We want to be able to hot reload the config.ts file, but we can't import it directly
|
|
123
|
-
// because it is going to get cached in the module cache and we dont have access to it to clear it
|
|
124
|
-
// so instead we copy the file to a new location with a random name and import that
|
|
125
|
-
// this is technically a memory leak, but you shouldnt really have a hot module server running forever
|
|
126
|
-
const rawPath = `${ccpath}/config.ts`;
|
|
127
|
-
const fileName = node_path_1.default.resolve(rawPath);
|
|
128
|
-
const outputDirectory = node_path_1.default.resolve(`${node_os_1.default.tmpdir()}/superblocks/${ccpath}/config.timestamp-${Date.now()}-${Math.random()
|
|
129
|
-
.toString(16)
|
|
130
|
-
.slice(2)}`);
|
|
131
|
-
await fs_extra_1.default.ensureDir(outputDirectory);
|
|
132
|
-
const compilationResult = await compileTypeScript(fileName, outputDirectory);
|
|
133
|
-
if (compilationResult.output) {
|
|
134
|
-
hasError = true;
|
|
135
|
-
if (compilationResult.output.includes(`Cannot find module`)) {
|
|
136
|
-
throw new Error("Could not find a module in node_modules. You likely need to run 'npm install'");
|
|
137
|
-
}
|
|
138
|
-
throw new Error(compilationResult.output);
|
|
139
|
-
}
|
|
140
|
-
console.log(`Typescript compiled to ${ccpath}`);
|
|
141
|
-
const config = (await import(outputDirectory + "/config.js")).default;
|
|
142
|
-
const isValid = (0, validation_js_1.validateCustomComponents)(config);
|
|
143
|
-
if (!isValid.valid) {
|
|
144
|
-
// Not throwing because we don't need a stack trace here
|
|
145
|
-
console.log(`Invalid config.ts file found`);
|
|
146
|
-
console.log(isValid.message);
|
|
147
|
-
hasError = true;
|
|
148
|
-
}
|
|
149
|
-
return { ccpath, config };
|
|
150
|
-
});
|
|
151
|
-
const configFiles = await Promise.all(promiseConfigFiles);
|
|
152
|
-
if (generateTypesFiles) {
|
|
153
|
-
for (const { config, ccpath } of configFiles) {
|
|
154
|
-
const typesFileContents = (0, generate_component_types_js_1.generateComponentTypesFile)(config);
|
|
155
|
-
await fs_extra_1.default.writeFile(`${ccpath}/types.ts`, typesFileContents);
|
|
156
|
-
console.log(`Generated ${ccpath}/types.ts`);
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
const configs = configFiles
|
|
160
|
-
.filter((component) => component.config !== null)
|
|
161
|
-
.reduce((acc, { config }) => {
|
|
162
|
-
acc[config.id] = config;
|
|
163
|
-
return acc;
|
|
164
|
-
}, {});
|
|
165
|
-
return {
|
|
166
|
-
configs,
|
|
167
|
-
hasError,
|
|
168
|
-
};
|
|
169
|
-
}
|
|
170
|
-
const getContentType = (filename) => {
|
|
171
|
-
const mimeType = mime_types_1.default.lookup(filename);
|
|
172
|
-
if (!mimeType) {
|
|
173
|
-
return "";
|
|
174
|
-
}
|
|
175
|
-
return mimeType;
|
|
176
|
-
};
|
|
177
|
-
exports.getContentType = getContentType;
|
|
178
|
-
//# sourceMappingURL=component-configs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"component-configs.js","sourceRoot":"","sources":["../src/component-configs.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiFA,kDAyEC;AA1JD,2DAA8C;AAC9C,sDAAyB;AACzB,0DAA6B;AAC7B,gDAAkC;AAElC,wDAA0B;AAC1B,4DAAmC;AAEnC,iDAAwD;AACxD,+EAA2E;AAC3E,mDAA2D;AAE3D,MAAM,aAAa,GAAG,IAAI,CAAC,SAAS,CAAC,6BAAQ,CAAC,CAAC;AAE/C,KAAK,UAAU,iBAAiB,CAC9B,aAAqB,EACrB,SAAiB;IAEjB,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC;QACtD,IAAI,OAAO,EAAE,CAAC;Y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aAAa,MAAM,WAAW,CAAC,CAAC;QAC9C,CAAC;IACH,CAAC;IACD,MAAM,OAAO,GAAG,WAAW;SACxB,MAAM,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,MAAM,KAAK,IAAI,CAAC;SAChD,MAAM,CAAC,CAAC,GAAwB,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;QAC/C,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC;QACxB,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,EAAE,CAAC,CAAC;IACT,OAAO;QACL,OAAO;QACP,QAAQ;KACT,CAAC;AACJ,CAAC;AAEM,MAAM,cAAc,GAAG,CAAC,QAAgB,EAAU,EAAE;IACzD,MAAM,QAAQ,GAAG,oBAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC5C,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,OAAO,QAAkB,CAAC;AAC5B,CAAC,CAAC;AANW,QAAA,cAAc,kBAMzB"}
|
package/dist/data-types.d.ts
DELETED
package/dist/data-types.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"data-types.d.ts","sourceRoot":"","sources":["../src/data-types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,KAAK,CAAC;AAE/D,UAAU,QAAQ;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAiBxD,CAAC"}
|
package/dist/data-types.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.dataTypeDefinions = void 0;
|
|
4
|
-
exports.dataTypeDefinions = {
|
|
5
|
-
string: {
|
|
6
|
-
tsType: "string",
|
|
7
|
-
prompt: "string",
|
|
8
|
-
},
|
|
9
|
-
number: {
|
|
10
|
-
tsType: "number",
|
|
11
|
-
prompt: "number",
|
|
12
|
-
},
|
|
13
|
-
boolean: {
|
|
14
|
-
tsType: "boolean",
|
|
15
|
-
prompt: "boolean",
|
|
16
|
-
},
|
|
17
|
-
any: {
|
|
18
|
-
tsType: "any",
|
|
19
|
-
prompt: "any (raw js expression)",
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
//# sourceMappingURL=data-types.js.map
|
package/dist/data-types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"data-types.js","sourceRoot":"","sources":["../src/data-types.ts"],"names":[],"mappings":";;;AAOa,QAAA,iBAAiB,GAA+B;IAC3D,MAAM,EAAE;QACN,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE,QAAQ;KACjB;IACD,MAAM,EAAE;QACN,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE,QAAQ;KACjB;IACD,OAAO,EAAE;QACP,MAAM,EAAE,SAAS;QACjB,MAAM,EAAE,SAAS;KAClB;IACD,GAAG,EAAE;QACH,MAAM,EAAE,KAAK;QACb,MAAM,EAAE,yBAAyB;KAClC;CACF,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generate-component-types.d.ts","sourceRoot":"","sources":["../src/generate-component-types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAwBlD,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,eAAe,UA2BjE"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.generateComponentTypesFile = generateComponentTypesFile;
|
|
4
|
-
const data_types_js_1 = require("./data-types.js");
|
|
5
|
-
const indent = (str, spaces) => {
|
|
6
|
-
const spacesString = " ".repeat(spaces);
|
|
7
|
-
return str
|
|
8
|
-
.split("\n")
|
|
9
|
-
.map((line) => `${spacesString}${line}`)
|
|
10
|
-
.join("\n");
|
|
11
|
-
};
|
|
12
|
-
function renderInputTypeAsTS(name, type, trailingChars, indentSpaces) {
|
|
13
|
-
let { tsType } = data_types_js_1.dataTypeDefinions[type];
|
|
14
|
-
if (["number", "string"].includes(type)) {
|
|
15
|
-
tsType += " | null";
|
|
16
|
-
}
|
|
17
|
-
return indent(`${name}: ${tsType}${trailingChars}`, indentSpaces);
|
|
18
|
-
}
|
|
19
|
-
function generateComponentTypesFile(config) {
|
|
20
|
-
const properties = config.properties ?? [];
|
|
21
|
-
const eventHandlers = config.events ?? [];
|
|
22
|
-
return `// GENERATED CODE -- DO NOT EDIT!
|
|
23
|
-
//
|
|
24
|
-
// This file is automatically generated by the Superblocks CLI
|
|
25
|
-
// Use the \`superblocks components watch\` command to regenerate this file from its source in config.ts
|
|
26
|
-
|
|
27
|
-
// All properties of your component are defined here.
|
|
28
|
-
// These are the properties which are surfaced in the Superblocks properties panel
|
|
29
|
-
// and can be referenced throughout your Superblocks Application
|
|
30
|
-
export type Props = {
|
|
31
|
-
${properties
|
|
32
|
-
.map((v) => renderInputTypeAsTS(v.path, v.dataType, ";", 2) + "\n")
|
|
33
|
-
.join("")}};
|
|
34
|
-
|
|
35
|
-
export type EventTriggers = {
|
|
36
|
-
// Call the subsequent function(s) to trigger event(s) in Superblocks from your component.
|
|
37
|
-
// These events can be wired up to event handlers in your Superblocks App
|
|
38
|
-
${eventHandlers.length === 0
|
|
39
|
-
? " // Note: no event handlers defined\n"
|
|
40
|
-
: eventHandlers
|
|
41
|
-
.map((v) => indent(v.path, 2) + ": () => void;" + "\n")
|
|
42
|
-
.join("")}};
|
|
43
|
-
`;
|
|
44
|
-
}
|
|
45
|
-
//# sourceMappingURL=generate-component-types.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3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AAC,aAAa;aACV,GAAG,CAAC,CAAC,CAAM,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,eAAe,GAAG,IAAI,CAAC;aAC3D,IAAI,CAAC,EAAE,CAChB;CACC,CAAC;AACF,CAAC"}
|
package/dist/types.d.ts
DELETED
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import type { UUID } from "node:crypto";
|
|
2
|
-
import type { DataType } from "./data-types.js";
|
|
3
|
-
interface PropertiesPanelDisplay<T extends DataType> {
|
|
4
|
-
/**
|
|
5
|
-
* Determines what form item type is shown in the Superblocks properties panel.
|
|
6
|
-
*
|
|
7
|
-
* Only booleans are allowed to use the "switch" control
|
|
8
|
-
*/
|
|
9
|
-
controlType: T extends "boolean" ? "text" | "js-expr" | "switch" : "text" | "js-expr";
|
|
10
|
-
/**
|
|
11
|
-
* Determines form item label in the Superblocks properties panel.
|
|
12
|
-
*/
|
|
13
|
-
label: string;
|
|
14
|
-
/**
|
|
15
|
-
* Placeholder text appears as gray text in the properties panel. This only applies
|
|
16
|
-
* to text-like inputs.
|
|
17
|
-
*/
|
|
18
|
-
placeholder?: string;
|
|
19
|
-
/**
|
|
20
|
-
* This shows up in the popover as a user types into the properties panel.
|
|
21
|
-
* This is a documentation field that helps users understand what type of data is accepted
|
|
22
|
-
* by this property. You should give a specific example, not a generic type
|
|
23
|
-
*
|
|
24
|
-
* @example {
|
|
25
|
-
* label: "My Label",
|
|
26
|
-
* value: "myValue"
|
|
27
|
-
* }
|
|
28
|
-
*/
|
|
29
|
-
exampleData?: string;
|
|
30
|
-
/**
|
|
31
|
-
* This shows up in the popover as a user types into the properties panel.
|
|
32
|
-
* This is a documentation field that helps users understand what type of data is accepted
|
|
33
|
-
* by this property. Typescript notation is recommended.
|
|
34
|
-
*
|
|
35
|
-
* @example "Array<{ label: string; value: string; }>"
|
|
36
|
-
*/
|
|
37
|
-
expectedType?: string;
|
|
38
|
-
/**
|
|
39
|
-
* The default value should match the dataType of the property.
|
|
40
|
-
*/
|
|
41
|
-
defaultValue?: T;
|
|
42
|
-
/**
|
|
43
|
-
* The default value to use when adding a property.
|
|
44
|
-
*/
|
|
45
|
-
defaultOnAdd?: T;
|
|
46
|
-
}
|
|
47
|
-
interface PropertyForData<T extends DataType> {
|
|
48
|
-
path: string;
|
|
49
|
-
dataType: T;
|
|
50
|
-
/**
|
|
51
|
-
* The presence of this object determines whether or not this property
|
|
52
|
-
* shows up in the Superblocks properties panel.
|
|
53
|
-
**/
|
|
54
|
-
propertiesPanelDisplay?: PropertiesPanelDisplay<T>;
|
|
55
|
-
/**
|
|
56
|
-
* A description of this property. This is used in the Superblocks properties panel
|
|
57
|
-
* as well as in the custom component's autocomplete.
|
|
58
|
-
**/
|
|
59
|
-
description?: string;
|
|
60
|
-
/**
|
|
61
|
-
* By default, all your properties are readable from anywhere in Superblocks using dot notation
|
|
62
|
-
* (e.g. `myComponent.myProperty`). If you want to hide a property from the outside world,
|
|
63
|
-
* set this to true
|
|
64
|
-
* @default false
|
|
65
|
-
*/
|
|
66
|
-
isExternallyReadable?: boolean;
|
|
67
|
-
/**
|
|
68
|
-
* By default, all properties can have be used with Set Component Property and Reset Component to Default.
|
|
69
|
-
* @default true
|
|
70
|
-
**/
|
|
71
|
-
isExternallySettable?: boolean;
|
|
72
|
-
}
|
|
73
|
-
export type Property = PropertyForData<"string"> | PropertyForData<"number"> | PropertyForData<"boolean"> | PropertyForData<"any">;
|
|
74
|
-
export interface ComponentConfig {
|
|
75
|
-
id: UUID;
|
|
76
|
-
/**
|
|
77
|
-
* @example: "myComponent"
|
|
78
|
-
*/
|
|
79
|
-
name: string;
|
|
80
|
-
/**
|
|
81
|
-
* @example "My Component"
|
|
82
|
-
*/
|
|
83
|
-
displayName: string;
|
|
84
|
-
/**
|
|
85
|
-
* @example "components/myComponent/component.tsx"
|
|
86
|
-
*/
|
|
87
|
-
componentPath: string;
|
|
88
|
-
properties: Array<PropertyForData<"string"> | PropertyForData<"number"> | PropertyForData<"boolean"> | PropertyForData<"any">>;
|
|
89
|
-
/**
|
|
90
|
-
* @example [{
|
|
91
|
-
* label: "On Click",
|
|
92
|
-
* path: "onClick",
|
|
93
|
-
* }]
|
|
94
|
-
*/
|
|
95
|
-
events: Array<{
|
|
96
|
-
label: string;
|
|
97
|
-
path: string;
|
|
98
|
-
}>;
|
|
99
|
-
gridDimensions?: {
|
|
100
|
-
initialColumns: number;
|
|
101
|
-
initialRows: number;
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
export {};
|
|
105
|
-
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEhD,UAAU,sBAAsB,CAAC,CAAC,SAAS,QAAQ;IACjD;;;;OAIG;IACH,WAAW,EAAE,CAAC,SAAS,SAAS,GAC5B,MAAM,GAAG,SAAS,GAAG,QAAQ,GAC7B,MAAM,GAAG,SAAS,CAAC;IAEvB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;;;;;;;OASG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,YAAY,CAAC,EAAE,CAAC,CAAC;IAEjB;;OAEG;IACH,YAAY,CAAC,EAAE,CAAC,CAAC;CAClB;AAED,UAAU,eAAe,CAAC,CAAC,SAAS,QAAQ;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,CAAC,CAAC;IAEZ;;;QAGI;IACJ,sBAAsB,CAAC,EAAE,sBAAsB,CAAC,CAAC,CAAC,CAAC;IAEnD;;;QAGI;IACJ,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;;;OAKG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAE/B;;;QAGI;IACJ,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC;AAED,MAAM,MAAM,QAAQ,GAChB,eAAe,CAAC,QAAQ,CAAC,GACzB,eAAe,CAAC,QAAQ,CAAC,GACzB,eAAe,CAAC,SAAS,CAAC,GAC1B,eAAe,CAAC,KAAK,CAAC,CAAC;AAE3B,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,IAAI,CAAC;IAET;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB,UAAU,EAAE,KAAK,CAIb,eAAe,CAAC,QAAQ,CAAC,GACzB,eAAe,CAAC,QAAQ,CAAC,GACzB,eAAe,CAAC,SAAS,CAAC,GAC1B,eAAe,CAAC,KAAK,CAAC,CACzB,CAAC;IAEF;;;;;OAKG;IACH,MAAM,EAAE,KAAK,CAAC;QACZ,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;KACd,CAAC,CAAC;IAEH,cAAc,CAAC,EAAE;QACf,cAAc,EAAE,MAAM,CAAC;QACvB,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC;CACH"}
|
package/dist/types.js
DELETED
package/dist/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
package/dist/validation.d.ts
DELETED
package/dist/validation.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../src/validation.ts"],"names":[],"mappings":"AA4IA,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,GAAG,GAAG;IACnD,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAWA"}
|
package/dist/validation.js
DELETED
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.validateCustomComponents = validateCustomComponents;
|
|
7
|
-
const ajv_1 = __importDefault(require("ajv"));
|
|
8
|
-
const better_ajv_errors_1 = __importDefault(require("better-ajv-errors"));
|
|
9
|
-
const identifiers_js_1 = require("./identifiers.js");
|
|
10
|
-
const ajv = new ajv_1.default();
|
|
11
|
-
ajv.addKeyword({
|
|
12
|
-
keyword: "stringFormat",
|
|
13
|
-
compile: (schema) => {
|
|
14
|
-
let validateFunc;
|
|
15
|
-
// schema is the value assigned to stringFormat in the schema
|
|
16
|
-
if (schema === "identifier") {
|
|
17
|
-
validateFunc = (data) => {
|
|
18
|
-
if (typeof data != "string")
|
|
19
|
-
return false;
|
|
20
|
-
if (!(0, identifiers_js_1.isValidIdentifier)(data)) {
|
|
21
|
-
validateFunc.errors = [
|
|
22
|
-
{
|
|
23
|
-
keyword: "format",
|
|
24
|
-
message: "must be a valid identifier starting with a-z or underscore and containing only a-z, 0-9, and underscores",
|
|
25
|
-
},
|
|
26
|
-
];
|
|
27
|
-
return false;
|
|
28
|
-
}
|
|
29
|
-
if ((0, identifiers_js_1.isReservedPropertyName)(data)) {
|
|
30
|
-
validateFunc.errors = [
|
|
31
|
-
{
|
|
32
|
-
keyword: "format",
|
|
33
|
-
message: "must not match a reserved property path",
|
|
34
|
-
},
|
|
35
|
-
];
|
|
36
|
-
return false;
|
|
37
|
-
}
|
|
38
|
-
return true;
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
throw new Error(`Unknown stringFormat: ${schema}`);
|
|
43
|
-
}
|
|
44
|
-
return validateFunc;
|
|
45
|
-
},
|
|
46
|
-
errors: true,
|
|
47
|
-
});
|
|
48
|
-
const componentSchema = {
|
|
49
|
-
type: "object",
|
|
50
|
-
properties: {
|
|
51
|
-
id: { type: "string" },
|
|
52
|
-
name: { type: "string" },
|
|
53
|
-
displayName: { type: "string" },
|
|
54
|
-
componentPath: { type: "string" },
|
|
55
|
-
properties: {
|
|
56
|
-
type: "array",
|
|
57
|
-
items: {
|
|
58
|
-
$ref: "#/definitions/Property",
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
events: {
|
|
62
|
-
type: "array",
|
|
63
|
-
items: {
|
|
64
|
-
$ref: "#/definitions/EventHandler",
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
gridDimensions: {
|
|
68
|
-
type: "object",
|
|
69
|
-
properties: {
|
|
70
|
-
initialColumns: { type: "number" },
|
|
71
|
-
initialRows: { type: "number" },
|
|
72
|
-
},
|
|
73
|
-
additionalProperties: false,
|
|
74
|
-
required: ["initialColumns", "initialRows"],
|
|
75
|
-
},
|
|
76
|
-
},
|
|
77
|
-
required: [
|
|
78
|
-
"id",
|
|
79
|
-
"name",
|
|
80
|
-
"displayName",
|
|
81
|
-
"componentPath",
|
|
82
|
-
"properties",
|
|
83
|
-
"events",
|
|
84
|
-
],
|
|
85
|
-
additionalProperties: false,
|
|
86
|
-
definitions: {
|
|
87
|
-
Property: {
|
|
88
|
-
properties: {
|
|
89
|
-
path: { $ref: "#/definitions/Identifier" },
|
|
90
|
-
dataType: { enum: ["number", "boolean", "string", "any"] },
|
|
91
|
-
propertiesPanelDisplay: {
|
|
92
|
-
type: "object",
|
|
93
|
-
properties: {
|
|
94
|
-
label: { type: "string" },
|
|
95
|
-
controlType: { enum: ["text", "js-expr", "switch"] },
|
|
96
|
-
defaultValue: {
|
|
97
|
-
oneOf: [
|
|
98
|
-
{
|
|
99
|
-
type: "string",
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
type: "boolean",
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
type: "number",
|
|
106
|
-
},
|
|
107
|
-
],
|
|
108
|
-
},
|
|
109
|
-
placeholder: { type: "string" },
|
|
110
|
-
exampleData: { type: "string" },
|
|
111
|
-
expectedType: { type: "string" },
|
|
112
|
-
},
|
|
113
|
-
required: ["controlType", "label"],
|
|
114
|
-
additionalProperties: false,
|
|
115
|
-
},
|
|
116
|
-
description: { type: "string" },
|
|
117
|
-
isExternallySettable: { type: "boolean" },
|
|
118
|
-
isExternallyReadable: { type: "boolean" },
|
|
119
|
-
},
|
|
120
|
-
type: "object",
|
|
121
|
-
additionalProperties: false,
|
|
122
|
-
required: ["path", "dataType"],
|
|
123
|
-
},
|
|
124
|
-
EventHandler: {
|
|
125
|
-
properties: {
|
|
126
|
-
label: { type: "string" },
|
|
127
|
-
path: { $ref: "#/definitions/Identifier" },
|
|
128
|
-
},
|
|
129
|
-
type: "object",
|
|
130
|
-
additionalProperties: false,
|
|
131
|
-
required: ["label", "path"],
|
|
132
|
-
},
|
|
133
|
-
Identifier: {
|
|
134
|
-
type: "string",
|
|
135
|
-
stringFormat: "identifier",
|
|
136
|
-
},
|
|
137
|
-
},
|
|
138
|
-
};
|
|
139
|
-
const validate = ajv.compile(componentSchema);
|
|
140
|
-
function validateCustomComponents(data) {
|
|
141
|
-
const valid = validate(data);
|
|
142
|
-
if (!valid) {
|
|
143
|
-
return {
|
|
144
|
-
valid: false,
|
|
145
|
-
message: (0, better_ajv_errors_1.default)(componentSchema, data, validate.errors, {
|
|
146
|
-
indent: 2,
|
|
147
|
-
}),
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
return { valid: true };
|
|
151
|
-
}
|
|
152
|
-
//# sourceMappingURL=validation.js.map
|
package/dist/validation.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../src/validation.ts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