lucid-package 0.0.24 → 0.0.27
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/package.json +1 -1
- package/src/editorextension.js +3 -0
- package/src/index.js +13 -4
- package/src/packagemanifest.js +11 -3
package/package.json
CHANGED
package/src/editorextension.js
CHANGED
|
@@ -138,6 +138,9 @@ async function debugEditorExtension(extensionNames, quiet = false) {
|
|
|
138
138
|
const credentials = JSON.parse((await fs.readFile(`${name}.credentials.local`)).toString());
|
|
139
139
|
res.send(JSON.stringify(Object.assign(Object.assign({}, provider), credentials)));
|
|
140
140
|
}
|
|
141
|
+
else {
|
|
142
|
+
res.sendStatus(404);
|
|
143
|
+
}
|
|
141
144
|
}
|
|
142
145
|
else {
|
|
143
146
|
res.sendStatus(404);
|
package/src/index.js
CHANGED
|
@@ -72,7 +72,7 @@ class LucidSuiteExtensionCLI {
|
|
|
72
72
|
createShapeLibrary.add_argument('name');
|
|
73
73
|
const parsed = parser.parse_args(args);
|
|
74
74
|
//For internal development, creating and operating on a "test" package via bazel
|
|
75
|
-
|
|
75
|
+
let isInternalTesting = !!parsed['chdir'];
|
|
76
76
|
if (isInternalTesting) {
|
|
77
77
|
if (parsed['project']) {
|
|
78
78
|
process.chdir(parsed['chdir'] + '/' + parsed['project']);
|
|
@@ -84,6 +84,11 @@ class LucidSuiteExtensionCLI {
|
|
|
84
84
|
else if (parsed['project']) {
|
|
85
85
|
process.chdir(parsed['project']);
|
|
86
86
|
}
|
|
87
|
+
//If we've spawned a child process recursively calling a new lucid-package target,
|
|
88
|
+
//then we're still testing as long as it's originally triggered by Bazel.
|
|
89
|
+
if (process.env['BAZEL_TARGET']) {
|
|
90
|
+
isInternalTesting = true;
|
|
91
|
+
}
|
|
87
92
|
switch (parsed['command']) {
|
|
88
93
|
case 'create':
|
|
89
94
|
(0, package_1.createEmptyPackage)(parsed['name']);
|
|
@@ -157,6 +162,10 @@ class LucidSuiteExtensionCLI {
|
|
|
157
162
|
}
|
|
158
163
|
}
|
|
159
164
|
}
|
|
160
|
-
new LucidSuiteExtensionCLI()
|
|
161
|
-
|
|
162
|
-
|
|
165
|
+
new LucidSuiteExtensionCLI().run(process.argv.slice(2)).catch((reason) => {
|
|
166
|
+
let reasonMessage = reason;
|
|
167
|
+
if (reason instanceof Object && reason.toString) {
|
|
168
|
+
reasonMessage = reason.toString();
|
|
169
|
+
}
|
|
170
|
+
console.error('Error running Lucid Suite Extension CLI', reasonMessage);
|
|
171
|
+
});
|
package/src/packagemanifest.js
CHANGED
|
@@ -60,12 +60,20 @@ function validateManifestOrThrow(manifest) {
|
|
|
60
60
|
if (!(0, checks_1.isString)(provider['title'])) {
|
|
61
61
|
throw new Error('manifest.json: OAuth provider "title" must be a string');
|
|
62
62
|
}
|
|
63
|
-
if (
|
|
64
|
-
|
|
63
|
+
if (provider['grantType'] &&
|
|
64
|
+
provider['grantType'] !== 'authorizationCode' &&
|
|
65
|
+
provider['grantType'] !== 'clientCredentials') {
|
|
66
|
+
throw new Error('manifest.json: OAuth provider "grantType" must be "authorizationCode" or "clientCredentials"');
|
|
65
67
|
}
|
|
66
|
-
if (!(0, checks_1.isString)(provider['authorizationUrl'])) {
|
|
68
|
+
if (provider['grantType'] === 'authorizationCode' && !(0, checks_1.isString)(provider['authorizationUrl'])) {
|
|
67
69
|
throw new Error('manifest.json: OAuth provider "authorizationUrl" must be a string');
|
|
68
70
|
}
|
|
71
|
+
if (provider['grantType'] === 'clientCredentials' && provider['authorizationUrl']) {
|
|
72
|
+
throw new Error('manifest.json: OAuth provider "authorizationUrl" must not be provided when grantType is "clientCredentials"');
|
|
73
|
+
}
|
|
74
|
+
if (!(0, checks_1.isString)(provider['tokenUrl'])) {
|
|
75
|
+
throw new Error('manifest.json: OAuth provider "tokenUrl" must be a string');
|
|
76
|
+
}
|
|
69
77
|
if (!(0, checks_1.isTypedArray)(checks_1.isString)(provider['scopes'])) {
|
|
70
78
|
throw new Error('manifest.json: OAuth provider "scopes" must be a string array');
|
|
71
79
|
}
|