@prismatic-io/spectral 10.17.2 → 10.18.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.
Files changed (53) hide show
  1. package/dist/clients/http/index.d.ts +84 -16
  2. package/dist/clients/http/index.js +85 -17
  3. package/dist/component.d.ts +3 -3
  4. package/dist/component.js +8 -8
  5. package/dist/conditionalLogic/index.js +3 -3
  6. package/dist/errors.d.ts +67 -0
  7. package/dist/errors.js +67 -0
  8. package/dist/generators/cniComponentManifest/cli.js +5 -5
  9. package/dist/generators/cniComponentManifest/index.d.ts +1 -1
  10. package/dist/generators/componentManifest/cli.js +6 -6
  11. package/dist/generators/componentManifest/createActions.d.ts +1 -1
  12. package/dist/generators/componentManifest/createActions.js +4 -4
  13. package/dist/generators/componentManifest/createConnections.d.ts +1 -1
  14. package/dist/generators/componentManifest/createConnections.js +4 -4
  15. package/dist/generators/componentManifest/createDataSources.d.ts +1 -1
  16. package/dist/generators/componentManifest/createDataSources.js +4 -4
  17. package/dist/generators/componentManifest/createStaticFiles.d.ts +1 -1
  18. package/dist/generators/componentManifest/createStaticFiles.js +1 -1
  19. package/dist/generators/componentManifest/createTriggers.d.ts +1 -1
  20. package/dist/generators/componentManifest/createTriggers.js +4 -4
  21. package/dist/generators/componentManifest/helpers.js +1 -1
  22. package/dist/generators/componentManifest/index.d.ts +2 -2
  23. package/dist/generators/componentManifest/index.js +1 -1
  24. package/dist/generators/utils/escapeSpecialCharacters.js +1 -1
  25. package/dist/index.d.ts +543 -53
  26. package/dist/index.js +545 -55
  27. package/dist/integration.d.ts +2 -2
  28. package/dist/integration.js +9 -9
  29. package/dist/serverTypes/asyncContext.d.ts +1 -1
  30. package/dist/serverTypes/context.d.ts +1 -1
  31. package/dist/serverTypes/context.js +2 -2
  32. package/dist/serverTypes/convertComponent.d.ts +2 -2
  33. package/dist/serverTypes/convertComponent.js +2 -2
  34. package/dist/serverTypes/convertIntegration.d.ts +3 -3
  35. package/dist/serverTypes/convertIntegration.js +13 -13
  36. package/dist/serverTypes/index.d.ts +2 -7
  37. package/dist/serverTypes/perform.d.ts +1 -1
  38. package/dist/serverTypes/perform.js +1 -1
  39. package/dist/testing.d.ts +195 -31
  40. package/dist/testing.js +199 -33
  41. package/dist/types/ActionPerformFunction.d.ts +6 -6
  42. package/dist/types/ConfigVars.d.ts +6 -6
  43. package/dist/types/ConnectionDefinition.d.ts +1 -1
  44. package/dist/types/FlowAttributes.d.ts +1 -1
  45. package/dist/types/index.d.ts +20 -20
  46. package/dist/types/index.js +20 -20
  47. package/dist/types/typeExportComponent.d.ts +15 -15
  48. package/dist/types/typeExportComponent.js +18 -18
  49. package/dist/types/typeExportIntegration.d.ts +17 -17
  50. package/dist/types/typeExportIntegration.js +17 -17
  51. package/dist/util.d.ts +29 -14
  52. package/dist/util.js +366 -108
  53. package/package.json +26 -28
@@ -14,30 +14,30 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./ComponentRegistry"), exports);
18
- __exportStar(require("./ConfigPages"), exports);
19
- __exportStar(require("./ConfigVars"), exports);
20
- __exportStar(require("./ScopedConfigVars"), exports);
21
- __exportStar(require("./Inputs"), exports);
22
- __exportStar(require("./ActionPerformReturn"), exports);
23
- __exportStar(require("./DataPayload"), exports);
24
17
  __exportStar(require("./ActionInputParameters"), exports);
25
18
  __exportStar(require("./ActionLogger"), exports);
26
19
  __exportStar(require("./ActionPerformFunction"), exports);
20
+ __exportStar(require("./ActionPerformReturn"), exports);
21
+ __exportStar(require("./ComponentManifest"), exports);
22
+ __exportStar(require("./ComponentRegistry"), exports);
23
+ __exportStar(require("./ConfigPages"), exports);
24
+ __exportStar(require("./ConfigVars"), exports);
25
+ __exportStar(require("./CustomerAttributes"), exports);
27
26
  __exportStar(require("./conditional-logic"), exports);
28
- __exportStar(require("./TriggerEventFunction"), exports);
29
- __exportStar(require("./TriggerResult"), exports);
30
- __exportStar(require("./TriggerPerformFunction"), exports);
31
- __exportStar(require("./HttpResponse"), exports);
32
- __exportStar(require("./TriggerPayload"), exports);
27
+ __exportStar(require("./DataPayload"), exports);
33
28
  __exportStar(require("./DataSourcePerformFunction"), exports);
34
29
  __exportStar(require("./DataSourceResult"), exports);
30
+ __exportStar(require("./FlowAttributes"), exports);
31
+ __exportStar(require("./FlowSchemas"), exports);
32
+ __exportStar(require("./HttpResponse"), exports);
33
+ __exportStar(require("./Inputs"), exports);
35
34
  __exportStar(require("./InstanceAttributes"), exports);
36
- __exportStar(require("./CustomerAttributes"), exports);
37
- __exportStar(require("./UserAttributes"), exports);
38
35
  __exportStar(require("./IntegrationAttributes"), exports);
39
- __exportStar(require("./FlowAttributes"), exports);
40
36
  __exportStar(require("./IntegrationDefinition"), exports);
41
- __exportStar(require("./ComponentManifest"), exports);
42
37
  __exportStar(require("./ScopedConfigVars"), exports);
43
- __exportStar(require("./FlowSchemas"), exports);
38
+ __exportStar(require("./ScopedConfigVars"), exports);
39
+ __exportStar(require("./TriggerEventFunction"), exports);
40
+ __exportStar(require("./TriggerPayload"), exports);
41
+ __exportStar(require("./TriggerPerformFunction"), exports);
42
+ __exportStar(require("./TriggerResult"), exports);
43
+ __exportStar(require("./UserAttributes"), exports);
package/dist/util.d.ts CHANGED
@@ -3,31 +3,46 @@
3
3
  * Many functions in the `util` module are used to coerce data into a particular type, and can be accessed through `util.types`.
4
4
  * For example, `util.types.toInt("5.5")` will return an integer, `5`.
5
5
  */
6
- import { KeyValuePair, DataPayload, ObjectSelection, ObjectFieldMap, JSONForm, ConnectionDefinition, Element } from "./types";
6
+ import { ConnectionDefinition, DataPayload, Element, JSONForm, KeyValuePair, ObjectFieldMap, ObjectSelection } from "./types";
7
7
  export declare const isObjectWithOneTruthyKey: (value: unknown, keys: string[]) => boolean;
8
8
  export declare const isObjectWithTruthyKeys: (value: unknown, keys: string[]) => boolean;
9
9
  /**
10
- * This function returns a lower cased version of the headers passed to it.
10
+ * This function returns a version of the headers object where all header
11
+ * names (keys) are lower-cased. Header values are left unchanged.
11
12
  *
12
- * - `lowerCaseHeaders({"Content-Type": "Application/JSON"})` will return `{"content-type": "Application/JSON"}`
13
- * - `lowerCaseHeaders({"Cache-Control": "max-age=604800"})` will return `{"cache-control": "max-age=604800"}`
14
- * - `lowerCaseHeaders({"Accept-Language": "en-us"})` will return `{"accept-language": "en-us"}`
15
- * @param headers The headers to convert to lower case
16
- * @returns This function returns a header object
17
- * */
13
+ * @param headers The headers to convert to lower case.
14
+ * @returns A new header object with lower-cased keys.
15
+ * @example
16
+ * import { util } from "@prismatic-io/spectral";
17
+ *
18
+ * util.types.lowerCaseHeaders({ "Content-Type": "application/json" });
19
+ * // { "content-type": "application/json" }
20
+ *
21
+ * util.types.lowerCaseHeaders({
22
+ * "Cache-Control": "max-age=604800",
23
+ * "Accept-Language": "en-us",
24
+ * });
25
+ * // { "cache-control": "max-age=604800", "accept-language": "en-us" }
26
+ */
18
27
  export declare const lowerCaseHeaders: (headers: Record<string, string>) => Record<string, string>;
19
28
  /**
20
- * This function parses a JSON string (if JSON) and returns an object, or returns the object.
29
+ * This function parses a JSON string and returns the resulting object,
30
+ * or returns the value as-is if it is already an object.
21
31
  *
22
- * - `toObject('{"foo":"bar","baz":123}')` will return object `{foo: "bar", baz: 123}`
23
- * - `toObject({foo:"bar",baz:123})` will return object `{foo: "bar", baz: 123}`
32
+ * @param value The JSON string or object to convert.
33
+ * @returns An object, parsing JSON as necessary.
34
+ * @example
35
+ * import { util } from "@prismatic-io/spectral";
24
36
  *
25
- * @param value The JSON string or object to convert
26
- * @returns This function returns an object, parsing JSON as necessary
37
+ * util.types.toObject('{"foo":"bar","baz":123}');
38
+ * // { foo: "bar", baz: 123 }
39
+ *
40
+ * util.types.toObject({ foo: "bar", baz: 123 });
41
+ * // { foo: "bar", baz: 123 } (returned as-is)
27
42
  */
28
43
  export declare const toObject: (value: unknown) => object;
29
- export * from "./errors";
30
44
  export * from "./conditionalLogic";
45
+ export * from "./errors";
31
46
  declare const _default: {
32
47
  types: {
33
48
  isBool: (value: unknown) => value is boolean;