lucid-package 0.0.25 → 0.0.26

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lucid-package",
3
- "version": "0.0.25",
3
+ "version": "0.0.26",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -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 (!(0, checks_1.isString)(provider['tokenUrl'])) {
64
- throw new Error('manifest.json: OAuth provider "tokenUrl" must be a string');
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
  }