@prismatic-io/spectral 8.1.0-preview3 → 8.1.0-preview5
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/dist/index.d.ts +1 -1
- package/dist/testing.d.ts +2 -0
- package/dist/testing.js +11 -1
- package/dist/util.d.ts +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ import { convertIntegration } from "./serverTypes/convertIntegration";
|
|
|
14
14
|
* @param definition An IntegrationDefinition type object.
|
|
15
15
|
* @returns This function returns an integration object that has the shape the Prismatic API expects.
|
|
16
16
|
*/
|
|
17
|
-
export declare const integration: <
|
|
17
|
+
export declare const integration: <T extends IntegrationDefinition<any, any> = IntegrationDefinition<any, any>>(definition: T) => ReturnType<typeof convertIntegration>;
|
|
18
18
|
/**
|
|
19
19
|
* For information on writing Code Native Integrations, see
|
|
20
20
|
* https://prismatic.io/docs/code-native-integrations/#adding-flows.
|
package/dist/testing.d.ts
CHANGED
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
import { TriggerPayload, TriggerResult, ConnectionValue, ActionLogger, Component, ActionContext, ActionPerformReturn, DataSourceResult, DataSourceContext } from "./serverTypes";
|
|
8
8
|
import { ConnectionDefinition, ActionDefinition, TriggerDefinition, Inputs, ActionInputParameters, DataSourceDefinition, ActionPerformReturn as InvokeActionPerformReturn, TriggerResult as InvokeTriggerResult, DataSourceResult as InvokeDataSourceResult, TriggerEventFunctionReturn, Flow, ConfigVarResultCollection, ConfigPages, ComponentSelector } from "./types";
|
|
9
9
|
export declare const createConnection: <T extends ConnectionDefinition>({ key }: T, values: Record<string, unknown>, tokenValues?: Record<string, unknown> | undefined) => ConnectionValue;
|
|
10
|
+
export declare const defaultConnectionValueEnvironmentVariable = "PRISMATIC_CONNECTION_VALUE";
|
|
11
|
+
export declare const connectionValue: (envVarKey?: string) => ConnectionValue;
|
|
10
12
|
/**
|
|
11
13
|
* Pre-built mock of ActionLogger. Suitable for asserting logs are created as expected.
|
|
12
14
|
* See https://prismatic.io/docs/custom-components/writing-custom-components/#verifying-correct-logging-in-action-tests for information on testing correct logging behavior in your custom component.
|
package/dist/testing.js
CHANGED
|
@@ -15,7 +15,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
15
15
|
});
|
|
16
16
|
};
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.createHarness = exports.ComponentTestHarness = exports.invokeFlow = exports.invokeDataSource = exports.invokeTrigger = exports.defaultTriggerPayload = exports.invoke = exports.loggerMock = exports.createConnection = void 0;
|
|
18
|
+
exports.createHarness = exports.ComponentTestHarness = exports.invokeFlow = exports.invokeDataSource = exports.invokeTrigger = exports.defaultTriggerPayload = exports.invoke = exports.loggerMock = exports.connectionValue = exports.defaultConnectionValueEnvironmentVariable = exports.createConnection = void 0;
|
|
19
19
|
const jest_mock_1 = require("jest-mock");
|
|
20
20
|
const createConnection = ({ key }, values, tokenValues) => ({
|
|
21
21
|
configVarKey: "",
|
|
@@ -24,6 +24,16 @@ const createConnection = ({ key }, values, tokenValues) => ({
|
|
|
24
24
|
token: tokenValues,
|
|
25
25
|
});
|
|
26
26
|
exports.createConnection = createConnection;
|
|
27
|
+
exports.defaultConnectionValueEnvironmentVariable = "PRISMATIC_CONNECTION_VALUE";
|
|
28
|
+
const connectionValue = (envVarKey = exports.defaultConnectionValueEnvironmentVariable) => {
|
|
29
|
+
const value = process.env[envVarKey];
|
|
30
|
+
if (!value) {
|
|
31
|
+
throw new Error("Unable to find connection value.");
|
|
32
|
+
}
|
|
33
|
+
const result = Object.assign(Object.assign({}, JSON.parse(value)), { key: "" });
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
36
|
+
exports.connectionValue = connectionValue;
|
|
27
37
|
/**
|
|
28
38
|
* Pre-built mock of ActionLogger. Suitable for asserting logs are created as expected.
|
|
29
39
|
* See https://prismatic.io/docs/custom-components/writing-custom-components/#verifying-correct-logging-in-action-tests for information on testing correct logging behavior in your custom component.
|
package/dist/util.d.ts
CHANGED
|
@@ -58,7 +58,7 @@ declare const _default: {
|
|
|
58
58
|
isConnection: (value: unknown) => value is ConnectionDefinition;
|
|
59
59
|
isElement: (value: unknown) => value is Element;
|
|
60
60
|
toObject: (value: unknown) => object;
|
|
61
|
-
cleanObject: (obj: Record<string, unknown>, predicate?: ((v: any) => boolean) | undefined) =>
|
|
61
|
+
cleanObject: (obj: Record<string, unknown>, predicate?: ((v: any) => boolean) | undefined) => Record<string, unknown>;
|
|
62
62
|
};
|
|
63
63
|
};
|
|
64
64
|
export default _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prismatic-io/spectral",
|
|
3
|
-
"version": "8.1.0-
|
|
3
|
+
"version": "8.1.0-preview5",
|
|
4
4
|
"description": "Utility library for building Prismatic components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"prismatic"
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@types/jest": "29.5.12",
|
|
57
|
-
"@types/lodash": "4.
|
|
57
|
+
"@types/lodash": "4.17.0",
|
|
58
58
|
"@types/node": "14.14.35",
|
|
59
59
|
"@types/sax": "1.2.4",
|
|
60
60
|
"@types/url-join": "4.0.1",
|