@prismatic-io/spectral 10.0.0 → 10.0.2

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.
@@ -90,7 +90,11 @@ const computeRetryDelay = (retryDelay, useExponentialBackoff) => {
90
90
  };
91
91
  const toAxiosRetryConfig = (_a) => {
92
92
  var { retryDelay, retryAllErrors, retryCondition, useExponentialBackoff } = _a, rest = __rest(_a, ["retryDelay", "retryAllErrors", "retryCondition", "useExponentialBackoff"]);
93
- return (Object.assign(Object.assign({}, rest), { retryDelay: computeRetryDelay(retryDelay, useExponentialBackoff), retryCondition: retryAllErrors ? () => true : retryCondition }));
93
+ return (Object.assign(Object.assign({}, rest), { retryDelay: computeRetryDelay(retryDelay, useExponentialBackoff), retryCondition: retryAllErrors
94
+ ? () => true
95
+ : typeof retryCondition === "function"
96
+ ? retryCondition
97
+ : axios_retry_1.isNetworkOrIdempotentRequestError }));
94
98
  };
95
99
  const createClient = ({ baseUrl, responseType, headers, timeout, params, debug = false, retryConfig, }) => {
96
100
  const client = axios_1.default.create({
@@ -334,7 +334,7 @@ const convertInputValue = (value, collectionType) => {
334
334
  };
335
335
  /** Converts a Config Var into the structure necessary for YAML generation. */
336
336
  const convertConfigVar = (key, configVar, referenceKey, componentRegistry) => {
337
- var _a;
337
+ var _a, _b, _c;
338
338
  if ((0, types_1.isOrganizationActivatedConnectionConfigVar)(configVar)) {
339
339
  const { stableKey } = (0, lodash_1.pick)(configVar, ["stableKey"]);
340
340
  return {
@@ -387,7 +387,7 @@ const convertConfigVar = (key, configVar, referenceKey, componentRegistry) => {
387
387
  } });
388
388
  }, {}),
389
389
  orgOnly,
390
- meta,
390
+ meta: Object.assign(Object.assign({}, meta), ("oauth2Config" in configVar ? (_a = configVar.oauth2Config) !== null && _a !== void 0 ? _a : {} : {})),
391
391
  };
392
392
  }
393
393
  if ((0, types_1.isConnectionReferenceConfigVar)(configVar)) {
@@ -402,7 +402,7 @@ const convertConfigVar = (key, configVar, referenceKey, componentRegistry) => {
402
402
  connection: Object.assign(Object.assign({}, ref), { template }),
403
403
  inputs,
404
404
  orgOnly,
405
- meta,
405
+ meta: Object.assign(Object.assign({}, meta), ("oauth2Config" in configVar ? (_b = configVar.oauth2Config) !== null && _b !== void 0 ? _b : {} : {})),
406
406
  };
407
407
  }
408
408
  const rawDefaultValue = "defaultValue" in configVar
@@ -426,7 +426,7 @@ const convertConfigVar = (key, configVar, referenceKey, componentRegistry) => {
426
426
  result.scheduleType = "custom";
427
427
  }
428
428
  if ((0, types_1.isJsonFormConfigVar)(configVar) || (0, types_1.isJsonFormDataSourceConfigVar)(configVar)) {
429
- result.meta = Object.assign(Object.assign({}, result.meta), { validationMode: (_a = configVar === null || configVar === void 0 ? void 0 : configVar.validationMode) !== null && _a !== void 0 ? _a : "ValidateAndShow" });
429
+ result.meta = Object.assign(Object.assign({}, result.meta), { validationMode: (_c = configVar === null || configVar === void 0 ? void 0 : configVar.validationMode) !== null && _c !== void 0 ? _c : "ValidateAndShow" });
430
430
  }
431
431
  if ((0, types_1.isDataSourceDefinitionConfigVar)(configVar)) {
432
432
  result.dataType = configVar.dataSourceType;
@@ -28,9 +28,13 @@ interface OAuth2Config {
28
28
  overrideGrantType?: string;
29
29
  allowedTokenParams?: string[];
30
30
  }
31
+ export interface OAuth2UrlOverrides {
32
+ oAuthSuccessRedirectUri?: string;
33
+ oAuthFailureRedirectUri?: string;
34
+ }
31
35
  interface OAuth2AuthorizationCodeConnectionDefinition extends BaseConnectionDefinition {
32
36
  oauth2Type: OAuth2Type.AuthorizationCode;
33
- oauth2Config?: OAuth2Config;
37
+ oauth2Config?: OAuth2Config & OAuth2UrlOverrides;
34
38
  /** The PKCE method (S256 or plain) that this OAuth 2.0 connection uses (if any) */
35
39
  oauth2PkceMethod?: OAuth2PkceMethod;
36
40
  inputs: {
@@ -44,6 +48,7 @@ interface OAuth2AuthorizationCodeConnectionDefinition extends BaseConnectionDefi
44
48
  }
45
49
  interface OAuth2ClientCredentialConnectionDefinition extends BaseConnectionDefinition {
46
50
  oauth2Type: OAuth2Type.ClientCredentials;
51
+ oauth2Config?: OAuth2UrlOverrides;
47
52
  inputs: {
48
53
  tokenUrl: ConnectionInput;
49
54
  scopes: ConnectionInput;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prismatic-io/spectral",
3
- "version": "10.0.0",
3
+ "version": "10.0.2",
4
4
  "description": "Utility library for building Prismatic components and code-native integrations",
5
5
  "keywords": ["prismatic"],
6
6
  "main": "dist/index.js",