@prismatic-io/spectral 10.6.1 → 10.6.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.
@@ -24,7 +24,8 @@ const getInputs = ({ inputs, docBlock = docBlock_1.DOC_BLOCK_DEFAULT }) => {
24
24
  label: input.label,
25
25
  inputType: input.type,
26
26
  valueType: getInputValueType(input),
27
- required: input.required && (input.default === undefined || input.default === ""),
27
+ required: input.required &&
28
+ (input.default === undefined || input.default === null || input.default === ""),
28
29
  collection: input.collection,
29
30
  onPremControlled: input.onPremiseControlled || input.onPremControlled,
30
31
  docBlock: docBlock(input),
@@ -1,6 +1,6 @@
1
1
  <%- include('../partials/generatedHeader.ejs') -%>
2
2
  <%- include('../partials/imports.ejs', { imports, helpers }) %>
3
- import { requireContext } from "@prismatic-io/spectral";
3
+ import { requireContext } from "@prismatic-io/spectral/dist/serverTypes";
4
4
 
5
5
  export interface <%= action.typeInterface %>Values {
6
6
  <%- include('../partials/performArgs.ejs', { inputs: action.inputs, helpers }) -%>
package/dist/index.d.ts CHANGED
@@ -189,4 +189,3 @@ export { default as util } from "./util";
189
189
  export * from "./types";
190
190
  export { default as testing } from "./testing";
191
191
  export * from "./errors";
192
- export * from "./serverTypes/asyncContext";
package/dist/index.js CHANGED
@@ -237,4 +237,3 @@ __exportStar(require("./types"), exports);
237
237
  var testing_1 = require("./testing");
238
238
  Object.defineProperty(exports, "testing", { enumerable: true, get: function () { return __importDefault(testing_1).default; } });
239
239
  __exportStar(require("./errors"), exports);
240
- __exportStar(require("./serverTypes/asyncContext"), exports);
@@ -2,9 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.runWithContext = runWithContext;
4
4
  exports.requireContext = requireContext;
5
- const node_async_hooks_1 = require("node:async_hooks");
6
- const actionContextStorage = new node_async_hooks_1.AsyncLocalStorage();
5
+ // Only import async_hooks in Node.js environments
6
+ const asyncHooks = typeof window === "undefined" ? require("node:async_hooks") : null;
7
+ const actionContextStorage = asyncHooks ? new asyncHooks.AsyncLocalStorage() : null;
7
8
  function runWithContext(context, fn) {
9
+ if (!actionContextStorage) {
10
+ // This shouldn't be running in a browser environment anyway.
11
+ return fn();
12
+ }
8
13
  return actionContextStorage.run(context, fn);
9
14
  }
10
15
  function requireContext() {
@@ -252,3 +252,4 @@ export interface Input {
252
252
  dataSource?: string;
253
253
  shown?: boolean;
254
254
  }
255
+ export * from "./asyncContext";
@@ -1,6 +1,20 @@
1
1
  "use strict";
2
2
  /* Types used to describe the format the platform expects for
3
3
  * component and integration definitions. */
4
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
5
+ if (k2 === undefined) k2 = k;
6
+ var desc = Object.getOwnPropertyDescriptor(m, k);
7
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
8
+ desc = { enumerable: true, get: function() { return m[k]; } };
9
+ }
10
+ Object.defineProperty(o, k2, desc);
11
+ }) : (function(o, m, k, k2) {
12
+ if (k2 === undefined) k2 = k;
13
+ o[k2] = m[k];
14
+ }));
15
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
17
+ };
4
18
  Object.defineProperty(exports, "__esModule", { value: true });
5
19
  exports.OAuth2Type = void 0;
6
20
  var OAuth2Type;
@@ -8,3 +22,4 @@ var OAuth2Type;
8
22
  OAuth2Type["ClientCredentials"] = "client_credentials";
9
23
  OAuth2Type["AuthorizationCode"] = "authorization_code";
10
24
  })(OAuth2Type || (exports.OAuth2Type = OAuth2Type = {}));
25
+ __exportStar(require("./asyncContext"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prismatic-io/spectral",
3
- "version": "10.6.1",
3
+ "version": "10.6.2",
4
4
  "description": "Utility library for building Prismatic connectors and code-native integrations",
5
5
  "keywords": ["prismatic"],
6
6
  "main": "dist/index.js",