@prismatic-io/spectral 10.18.6-preview.0 → 10.18.7-preview.1
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/clients/http/index.d.ts +1 -1
- package/dist/clients/http/index.js +17 -7
- package/dist/conditionalLogic/index.d.ts +1 -1
- package/dist/errors.d.ts +1 -1
- package/dist/generators/cniComponentManifest/index.d.ts +1 -1
- package/dist/generators/cniComponentManifest/index.js +17 -7
- package/dist/generators/cniComponentManifest/types.d.ts +3 -3
- package/dist/generators/componentManifest/createActions.d.ts +1 -1
- package/dist/generators/componentManifest/createConnections.d.ts +1 -1
- package/dist/generators/componentManifest/createDataSources.d.ts +1 -1
- package/dist/generators/componentManifest/createStaticFiles.d.ts +1 -1
- package/dist/generators/componentManifest/createTriggers.d.ts +1 -1
- package/dist/generators/componentManifest/docBlock.d.ts +1 -1
- package/dist/generators/componentManifest/getInputs.js +82 -10
- package/dist/generators/componentManifest/index.d.ts +1 -1
- package/dist/index.d.ts +43 -1
- package/dist/index.js +40 -1
- package/dist/serverTypes/asyncContext.d.ts +1 -1
- package/dist/serverTypes/context.d.ts +2 -2
- package/dist/serverTypes/convertComponent.d.ts +3 -3
- package/dist/serverTypes/convertComponent.js +11 -4
- package/dist/serverTypes/convertIntegration.d.ts +3 -3
- package/dist/serverTypes/index.d.ts +3 -2
- package/dist/serverTypes/perform.d.ts +1 -1
- package/dist/types/ActionInputParameters.d.ts +18 -4
- package/dist/types/Inputs.d.ts +37 -4
- package/dist/types/Inputs.js +1 -0
- package/dist/types/TriggerResult.d.ts +2 -2
- package/dist/types/typeExportComponent.js +17 -7
- package/dist/util.d.ts +1 -1
- package/package.json +13 -13
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AxiosInstance, AxiosRequestConfig, AxiosResponse } from "axios";
|
|
2
|
-
import { IAxiosRetryConfig } from "axios-retry";
|
|
2
|
+
import { type IAxiosRetryConfig } from "axios-retry";
|
|
3
3
|
import type { ActionInputParameters } from "../../types/ActionInputParameters";
|
|
4
4
|
import { inputs } from "./inputs";
|
|
5
5
|
export type HttpClient = AxiosInstance;
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
36
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
37
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ConditionalExpression } from "./types";
|
|
1
|
+
import { type ConditionalExpression } from "./types";
|
|
2
2
|
export type ValidationResult = [boolean] | [boolean, string];
|
|
3
3
|
export declare const validate: (expression: ConditionalExpression) => ValidationResult;
|
|
4
4
|
/** Convert stringified objects/values back to their native value, all other
|
package/dist/errors.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ConfigVarResultCollection, Inputs, TriggerPayload, TriggerResult } from "../../types";
|
|
2
|
-
import { FormattedAction, FormattedDataSource, FormattedTrigger } from "./types";
|
|
2
|
+
import type { FormattedAction, FormattedDataSource, FormattedTrigger } from "./types";
|
|
3
3
|
export declare const fetchComponentDataForManifest: <TInputs extends Inputs, TActionInputs extends Inputs, TConfigVars extends ConfigVarResultCollection = ConfigVarResultCollection, TPayload extends TriggerPayload = TriggerPayload, TAllowsBranching extends boolean = boolean, TResult extends TriggerResult<TAllowsBranching, TPayload> = TriggerResult<TAllowsBranching, TPayload>>({ componentKey, isPrivate, }: {
|
|
4
4
|
componentKey: string;
|
|
5
5
|
isPrivate: boolean;
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
36
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
37
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Action, Component, DataSource, Trigger, TriggerPayload } from "../../serverTypes";
|
|
2
|
-
import { ConfigVarResultCollection, Inputs } from "../../types";
|
|
3
|
-
import { TriggerResult } from "../../types/TriggerResult";
|
|
1
|
+
import type { Action, Component, DataSource, Trigger, TriggerPayload } from "../../serverTypes";
|
|
2
|
+
import type { ConfigVarResultCollection, Inputs } from "../../types";
|
|
3
|
+
import type { TriggerResult } from "../../types/TriggerResult";
|
|
4
4
|
export interface ComponentNode {
|
|
5
5
|
id: string;
|
|
6
6
|
label: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ConfigVarResultCollection, Inputs, TriggerPayload, TriggerResult } from "../../types";
|
|
1
|
+
import type { ConfigVarResultCollection, Inputs, TriggerPayload, TriggerResult } from "../../types";
|
|
2
2
|
import type { ComponentForManifest } from "../cniComponentManifest/types";
|
|
3
3
|
interface CreateActionsProps<TInputs extends Inputs, TActionInputs extends Inputs, TConfigVars extends ConfigVarResultCollection = ConfigVarResultCollection, TPayload extends TriggerPayload = TriggerPayload, TAllowsBranching extends boolean = boolean, TResult extends TriggerResult<TAllowsBranching, TPayload> = TriggerResult<TAllowsBranching, TPayload>> {
|
|
4
4
|
component: ComponentForManifest<TInputs, TActionInputs, TConfigVars, TPayload, TAllowsBranching, TResult>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ConfigVarResultCollection, Inputs, TriggerPayload, TriggerResult } from "../../types";
|
|
1
|
+
import type { ConfigVarResultCollection, Inputs, TriggerPayload, TriggerResult } from "../../types";
|
|
2
2
|
import type { ComponentForManifest } from "../cniComponentManifest/types";
|
|
3
3
|
interface CreateConnectionsProps<TInputs extends Inputs, TActionInputs extends Inputs, TConfigVars extends ConfigVarResultCollection = ConfigVarResultCollection, TPayload extends TriggerPayload = TriggerPayload, TAllowsBranching extends boolean = boolean, TResult extends TriggerResult<TAllowsBranching, TPayload> = TriggerResult<TAllowsBranching, TPayload>> {
|
|
4
4
|
component: ComponentForManifest<TInputs, TActionInputs, TConfigVars, TPayload, TAllowsBranching, TResult>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ConfigVarResultCollection, Inputs, TriggerPayload, TriggerResult } from "../../types";
|
|
1
|
+
import type { ConfigVarResultCollection, Inputs, TriggerPayload, TriggerResult } from "../../types";
|
|
2
2
|
import type { ComponentForManifest } from "../cniComponentManifest/types";
|
|
3
3
|
interface CreateDataSourcesProps<TInputs extends Inputs, TActionInputs extends Inputs, TConfigVars extends ConfigVarResultCollection = ConfigVarResultCollection, TPayload extends TriggerPayload = TriggerPayload, TAllowsBranching extends boolean = boolean, TResult extends TriggerResult<TAllowsBranching, TPayload> = TriggerResult<TAllowsBranching, TPayload>> {
|
|
4
4
|
component: ComponentForManifest<TInputs, TActionInputs, TConfigVars, TPayload, TAllowsBranching, TResult>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Component } from "../../serverTypes";
|
|
2
|
-
import { ConfigVarResultCollection, Inputs, TriggerPayload, TriggerResult } from "../../types";
|
|
2
|
+
import type { ConfigVarResultCollection, Inputs, TriggerPayload, TriggerResult } from "../../types";
|
|
3
3
|
export interface PackageDependencies {
|
|
4
4
|
spectral: string;
|
|
5
5
|
dependencies: Record<string, string>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ConfigVarResultCollection, Inputs, TriggerPayload, TriggerResult } from "../../types";
|
|
1
|
+
import type { ConfigVarResultCollection, Inputs, TriggerPayload, TriggerResult } from "../../types";
|
|
2
2
|
import type { ComponentForManifest } from "../cniComponentManifest/types";
|
|
3
3
|
interface CreateTriggersProps<TInputs extends Inputs, TActionInputs extends Inputs, TConfigVars extends ConfigVarResultCollection = ConfigVarResultCollection, TPayload extends TriggerPayload = TriggerPayload, TAllowsBranching extends boolean = boolean, TResult extends TriggerResult<TAllowsBranching, TPayload> = TriggerResult<TAllowsBranching, TPayload>> {
|
|
4
4
|
component: ComponentForManifest<TInputs, TActionInputs, TConfigVars, TPayload, TAllowsBranching, TResult>;
|
|
@@ -3,13 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.INPUT_TYPE_MAP = exports.getInputs = void 0;
|
|
4
4
|
const escapeSpecialCharacters_1 = require("../utils/escapeSpecialCharacters");
|
|
5
5
|
const docBlock_1 = require("./docBlock");
|
|
6
|
-
const getDefaultValue = (value, isCollection) => {
|
|
7
|
-
if (value === undefined || value === "") {
|
|
8
|
-
return isCollection ? [] : value;
|
|
9
|
-
}
|
|
10
|
-
const stringValue = typeof value === "string" ? value : JSON.stringify(value);
|
|
11
|
-
return (0, escapeSpecialCharacters_1.escapeSpecialCharacters)(stringValue);
|
|
12
|
-
};
|
|
13
6
|
const getInputs = ({ inputs, docBlock = docBlock_1.DOC_BLOCK_DEFAULT }) => {
|
|
14
7
|
return inputs.reduce((acc, input) => {
|
|
15
8
|
if ((typeof input.shown === "boolean" && input.shown === false) ||
|
|
@@ -68,11 +61,23 @@ exports.INPUT_TYPE_MAP = {
|
|
|
68
61
|
timestamp: "string",
|
|
69
62
|
flow: "string",
|
|
70
63
|
template: "string",
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
64
|
+
structuredObject: {
|
|
65
|
+
module: "@prismatic-io/spectral/dist/types",
|
|
66
|
+
type: "StructuredObject",
|
|
67
|
+
},
|
|
68
|
+
dynamicObject: {
|
|
69
|
+
module: "@prismatic-io/spectral/dist/types",
|
|
70
|
+
type: "DynamicObject",
|
|
71
|
+
},
|
|
74
72
|
};
|
|
75
73
|
const getInputValueType = (input) => {
|
|
74
|
+
var _a, _b;
|
|
75
|
+
if (input.type === "structuredObject") {
|
|
76
|
+
return structuredObjectTypeString((_a = input.inputs) !== null && _a !== void 0 ? _a : []);
|
|
77
|
+
}
|
|
78
|
+
if (input.type === "dynamicObject") {
|
|
79
|
+
return dynamicObjectTypeString((_b = input.inputs) !== null && _b !== void 0 ? _b : []);
|
|
80
|
+
}
|
|
76
81
|
const inputType = exports.INPUT_TYPE_MAP[input.type];
|
|
77
82
|
const valueType = input.model
|
|
78
83
|
? input.model
|
|
@@ -97,3 +102,70 @@ const getInputValueType = (input) => {
|
|
|
97
102
|
}
|
|
98
103
|
return valueType;
|
|
99
104
|
};
|
|
105
|
+
const getDefaultValue = (value, isCollection) => {
|
|
106
|
+
if (value === undefined || value === "") {
|
|
107
|
+
return isCollection ? [] : value;
|
|
108
|
+
}
|
|
109
|
+
const stringValue = typeof value === "string" ? value : JSON.stringify(value);
|
|
110
|
+
return (0, escapeSpecialCharacters_1.escapeSpecialCharacters)(stringValue);
|
|
111
|
+
};
|
|
112
|
+
const isValidIdentifier = (key) => /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(key);
|
|
113
|
+
const wrapCollection = (valueType, collection) => {
|
|
114
|
+
if (collection === "valuelist") {
|
|
115
|
+
return `Array<${valueType}>`;
|
|
116
|
+
}
|
|
117
|
+
if (collection === "keyvaluelist") {
|
|
118
|
+
return `Record<string, ${valueType}> | Array<{key: string, value: ${valueType}}>`;
|
|
119
|
+
}
|
|
120
|
+
return valueType;
|
|
121
|
+
};
|
|
122
|
+
const getLeafBaseType = (child) => {
|
|
123
|
+
var _a;
|
|
124
|
+
if ((_a = child.model) === null || _a === void 0 ? void 0 : _a.length) {
|
|
125
|
+
return child.model
|
|
126
|
+
.map(({ value }) => `\`${value.replaceAll("\r", "\\r").replaceAll("\n", "\\n")}\``)
|
|
127
|
+
.join(" | ");
|
|
128
|
+
}
|
|
129
|
+
const mapped = exports.INPUT_TYPE_MAP[child.type];
|
|
130
|
+
if (!mapped) {
|
|
131
|
+
return "unknown";
|
|
132
|
+
}
|
|
133
|
+
if (typeof mapped === "string") {
|
|
134
|
+
return mapped;
|
|
135
|
+
}
|
|
136
|
+
return `import("${mapped.module}").${mapped.type}`;
|
|
137
|
+
};
|
|
138
|
+
const getLeafTypeString = (child) => {
|
|
139
|
+
var _a;
|
|
140
|
+
if (child.type === "structuredObject") {
|
|
141
|
+
return structuredObjectTypeString((_a = child.inputs) !== null && _a !== void 0 ? _a : []);
|
|
142
|
+
}
|
|
143
|
+
return wrapCollection(getLeafBaseType(child), child.collection);
|
|
144
|
+
};
|
|
145
|
+
const SPECTRAL_TYPES_MODULE = "@prismatic-io/spectral/dist/types";
|
|
146
|
+
const structuredObjectTypeString = (inputs) => {
|
|
147
|
+
if (!inputs.length) {
|
|
148
|
+
return `import("${SPECTRAL_TYPES_MODULE}").StructuredObject`;
|
|
149
|
+
}
|
|
150
|
+
const fields = inputs
|
|
151
|
+
.map((child) => {
|
|
152
|
+
const key = isValidIdentifier(child.key) ? child.key : JSON.stringify(child.key);
|
|
153
|
+
return `${key}: ${getLeafTypeString(child)}`;
|
|
154
|
+
})
|
|
155
|
+
.join("; ");
|
|
156
|
+
return `{ ${fields} }`;
|
|
157
|
+
};
|
|
158
|
+
const dynamicObjectTypeString = (configurations) => {
|
|
159
|
+
if (!configurations.length) {
|
|
160
|
+
return `import("${SPECTRAL_TYPES_MODULE}").DynamicObject`;
|
|
161
|
+
}
|
|
162
|
+
return configurations
|
|
163
|
+
.map((config) => {
|
|
164
|
+
var _a;
|
|
165
|
+
const valuesType = ((_a = config.inputs) === null || _a === void 0 ? void 0 : _a.length)
|
|
166
|
+
? structuredObjectTypeString(config.inputs)
|
|
167
|
+
: `import("${SPECTRAL_TYPES_MODULE}").StructuredObject`;
|
|
168
|
+
return `{ configuration: ${JSON.stringify(config.key)}; values: ${valuesType} }`;
|
|
169
|
+
})
|
|
170
|
+
.join(" | ");
|
|
171
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Component } from "../../serverTypes";
|
|
2
|
-
import { ConfigVarResultCollection, Inputs, TriggerPayload, TriggerResult } from "../../types";
|
|
2
|
+
import type { ConfigVarResultCollection, Inputs, TriggerPayload, TriggerResult } from "../../types";
|
|
3
3
|
import { type PackageDependencies } from "./createStaticFiles";
|
|
4
4
|
interface CreateComponentManifestProps<TInputs extends Inputs, TActionInputs extends Inputs, TConfigVars extends ConfigVarResultCollection = ConfigVarResultCollection, TPayload extends TriggerPayload = TriggerPayload, TAllowsBranching extends boolean = boolean, TResult extends TriggerResult<TAllowsBranching, TPayload> = TriggerResult<TAllowsBranching, TPayload>> {
|
|
5
5
|
component: Component<TInputs, TActionInputs, TConfigVars, TPayload, TAllowsBranching, TResult>;
|
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { convertComponent } from "./serverTypes/convertComponent";
|
|
7
7
|
import { convertIntegration } from "./serverTypes/convertIntegration";
|
|
8
|
-
import { ActionDefinition, ActionPerformReturn, ComponentDefinition, ComponentManifest, ConfigPage, ConfigVarResultCollection, ConnectionConfigVar, CustomerActivatedConnectionConfigVar, DataSourceConfigVar, DataSourceDefinition, DataSourceType, DefaultConnectionDefinition, Flow, InputFieldDefinition, Inputs, IntegrationDefinition, OAuth2ConnectionDefinition, OnPremConnectionDefinition, OrganizationActivatedConnectionConfigVar, StandardConfigVar, StructuredObjectInputField, TriggerDefinition, TriggerPayload, TriggerResult } from "./types";
|
|
8
|
+
import type { ActionDefinition, ActionPerformReturn, ComponentDefinition, ComponentManifest, ConfigPage, ConfigVarResultCollection, ConnectionConfigVar, CustomerActivatedConnectionConfigVar, DataSourceConfigVar, DataSourceDefinition, DataSourceType, DefaultConnectionDefinition, DynamicObjectInputField, Flow, InputFieldDefinition, Inputs, IntegrationDefinition, OAuth2ConnectionDefinition, OnPremConnectionDefinition, OrganizationActivatedConnectionConfigVar, StandardConfigVar, StructuredObjectInputField, TriggerDefinition, TriggerPayload, TriggerResult } from "./types";
|
|
9
9
|
import type { PollingTriggerDefinition } from "./types/PollingTriggerDefinition";
|
|
10
10
|
/**
|
|
11
11
|
* This function creates a code-native integration object that can be
|
|
@@ -533,6 +533,48 @@ export declare const structuredObjectInput: <T extends Omit<StructuredObjectInpu
|
|
|
533
533
|
}>(definition: T) => T & {
|
|
534
534
|
type: "structuredObject";
|
|
535
535
|
};
|
|
536
|
+
/**
|
|
537
|
+
* Presents a discriminated set of input configurations; the integration builder
|
|
538
|
+
* picks a configuration and its inputs become available. Configurations may
|
|
539
|
+
* contain leaf inputs and structuredObject inputs but not nested dynamicObjects
|
|
540
|
+
* (the type signature enforces this at compile time).
|
|
541
|
+
*
|
|
542
|
+
* @example
|
|
543
|
+
* import { input, structuredObjectInput, dynamicObjectInput } from "@prismatic-io/spectral";
|
|
544
|
+
*
|
|
545
|
+
* const recordData = dynamicObjectInput({
|
|
546
|
+
* label: "Record Data",
|
|
547
|
+
* required: true,
|
|
548
|
+
* configurations: {
|
|
549
|
+
* contact: {
|
|
550
|
+
* label: "Contact",
|
|
551
|
+
* comments: "Create a new contact",
|
|
552
|
+
* inputs: {
|
|
553
|
+
* name: structuredObjectInput({
|
|
554
|
+
* label: "Name",
|
|
555
|
+
* inputs: {
|
|
556
|
+
* first: input({ type: "string", label: "First Name", required: true }),
|
|
557
|
+
* last: input({ type: "string", label: "Last Name", required: true }),
|
|
558
|
+
* },
|
|
559
|
+
* }),
|
|
560
|
+
* email: input({ type: "string", label: "Email", required: true }),
|
|
561
|
+
* },
|
|
562
|
+
* },
|
|
563
|
+
* account: {
|
|
564
|
+
* label: "Account",
|
|
565
|
+
* comments: "Create a new account",
|
|
566
|
+
* inputs: {
|
|
567
|
+
* companyName: input({ type: "string", label: "Company Name", required: true }),
|
|
568
|
+
* },
|
|
569
|
+
* },
|
|
570
|
+
* },
|
|
571
|
+
* });
|
|
572
|
+
*/
|
|
573
|
+
export declare const dynamicObjectInput: <T extends Omit<DynamicObjectInputField, "type"> & {
|
|
574
|
+
type?: never;
|
|
575
|
+
}>(definition: T) => T & {
|
|
576
|
+
type: "dynamicObject";
|
|
577
|
+
};
|
|
536
578
|
/**
|
|
537
579
|
* This function creates a connection that can be used by a code-native integration
|
|
538
580
|
* or custom component. Connections define the fields (API keys, tokens, etc.) needed
|
package/dist/index.js
CHANGED
|
@@ -22,7 +22,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
22
22
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
23
|
};
|
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
exports.util = exports.testing = exports.componentManifests = exports.oauth2Connection = exports.onPremConnection = exports.connection = exports.structuredObjectInput = exports.input = exports.dataSource = exports.pollingTrigger = exports.trigger = exports.action = exports.component = exports.componentManifest = exports.organizationActivatedConnection = exports.customerActivatedConnection = exports.connectionConfigVar = exports.dataSourceConfigVar = exports.configVar = exports.configPage = exports.flow = exports.integration = void 0;
|
|
25
|
+
exports.util = exports.testing = exports.componentManifests = exports.oauth2Connection = exports.onPremConnection = exports.connection = exports.dynamicObjectInput = exports.structuredObjectInput = exports.input = exports.dataSource = exports.pollingTrigger = exports.trigger = exports.action = exports.component = exports.componentManifest = exports.organizationActivatedConnection = exports.customerActivatedConnection = exports.connectionConfigVar = exports.dataSourceConfigVar = exports.configVar = exports.configPage = exports.flow = exports.integration = void 0;
|
|
26
26
|
const serverTypes_1 = require("./serverTypes");
|
|
27
27
|
const convertComponent_1 = require("./serverTypes/convertComponent");
|
|
28
28
|
const convertIntegration_1 = require("./serverTypes/convertIntegration");
|
|
@@ -575,6 +575,45 @@ exports.input = input;
|
|
|
575
575
|
*/
|
|
576
576
|
const structuredObjectInput = (definition) => (Object.assign(Object.assign({}, definition), { type: "structuredObject" }));
|
|
577
577
|
exports.structuredObjectInput = structuredObjectInput;
|
|
578
|
+
/**
|
|
579
|
+
* Presents a discriminated set of input configurations; the integration builder
|
|
580
|
+
* picks a configuration and its inputs become available. Configurations may
|
|
581
|
+
* contain leaf inputs and structuredObject inputs but not nested dynamicObjects
|
|
582
|
+
* (the type signature enforces this at compile time).
|
|
583
|
+
*
|
|
584
|
+
* @example
|
|
585
|
+
* import { input, structuredObjectInput, dynamicObjectInput } from "@prismatic-io/spectral";
|
|
586
|
+
*
|
|
587
|
+
* const recordData = dynamicObjectInput({
|
|
588
|
+
* label: "Record Data",
|
|
589
|
+
* required: true,
|
|
590
|
+
* configurations: {
|
|
591
|
+
* contact: {
|
|
592
|
+
* label: "Contact",
|
|
593
|
+
* comments: "Create a new contact",
|
|
594
|
+
* inputs: {
|
|
595
|
+
* name: structuredObjectInput({
|
|
596
|
+
* label: "Name",
|
|
597
|
+
* inputs: {
|
|
598
|
+
* first: input({ type: "string", label: "First Name", required: true }),
|
|
599
|
+
* last: input({ type: "string", label: "Last Name", required: true }),
|
|
600
|
+
* },
|
|
601
|
+
* }),
|
|
602
|
+
* email: input({ type: "string", label: "Email", required: true }),
|
|
603
|
+
* },
|
|
604
|
+
* },
|
|
605
|
+
* account: {
|
|
606
|
+
* label: "Account",
|
|
607
|
+
* comments: "Create a new account",
|
|
608
|
+
* inputs: {
|
|
609
|
+
* companyName: input({ type: "string", label: "Company Name", required: true }),
|
|
610
|
+
* },
|
|
611
|
+
* },
|
|
612
|
+
* },
|
|
613
|
+
* });
|
|
614
|
+
*/
|
|
615
|
+
const dynamicObjectInput = (definition) => (Object.assign(Object.assign({}, definition), { type: "dynamicObject" }));
|
|
616
|
+
exports.dynamicObjectInput = dynamicObjectInput;
|
|
578
617
|
/**
|
|
579
618
|
* This function creates a connection that can be used by a code-native integration
|
|
580
619
|
* or custom component. Connections define the fields (API keys, tokens, etc.) needed
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComponentRegistry, Inputs, IntegrationDefinition, TriggerPayload, TriggerResult } from "../types";
|
|
1
|
+
import type { ComponentRegistry, Inputs, IntegrationDefinition, TriggerPayload, TriggerResult } from "../types";
|
|
2
2
|
import type { ActionContext } from "../types/ActionPerformFunction";
|
|
3
3
|
export declare function runWithContext<T>(context: ActionContext, fn: () => T | Promise<T>): T | Promise<T>;
|
|
4
4
|
export declare function requireContext(): ActionContext;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ActionContext, ComponentManifest, ComponentRegistry, ConfigVarResultCollection, DebugContext, FlowInvoker } from "../types";
|
|
2
|
-
import { ActionContext as ServerActionContext } from ".";
|
|
1
|
+
import type { ActionContext, ComponentManifest, ComponentRegistry, ConfigVarResultCollection, DebugContext, FlowInvoker } from "../types";
|
|
2
|
+
import type { ActionContext as ServerActionContext } from ".";
|
|
3
3
|
export declare function createCNIContext<TConfigVars extends ConfigVarResultCollection = ConfigVarResultCollection, TComponentActions extends Record<string, ComponentManifest["actions"]> = Record<string, ComponentManifest["actions"]>, TFlows extends string[] = string[]>(context: ActionContext<TConfigVars, TComponentActions, TFlows>, componentRegistry: ComponentRegistry): ActionContext<TConfigVars, TComponentActions, TFlows>;
|
|
4
4
|
export declare function createDebugContext(context: ServerActionContext): DebugContext;
|
|
5
5
|
export declare function logDebugResults(context: ActionContext): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ComponentDefinition, ComponentHooks, ConfigVarResultCollection, ConnectionDefinition, ConnectionInput, ConnectionTemplateInputField, InputFieldDefinition, Inputs, OnPremConnectionInput, TriggerDefinition, TriggerPayload, TriggerResult } from "../types";
|
|
2
|
-
import { PollingTriggerDefinition } from "../types/PollingTriggerDefinition";
|
|
3
|
-
import { Component as ServerComponent, Connection as ServerConnection, Input as ServerInput, Trigger as ServerTrigger } from ".";
|
|
1
|
+
import { type ComponentDefinition, type ComponentHooks, type ConfigVarResultCollection, type ConnectionDefinition, type ConnectionInput, type ConnectionTemplateInputField, type InputFieldDefinition, type Inputs, type OnPremConnectionInput, type TriggerDefinition, type TriggerPayload, type TriggerResult } from "../types";
|
|
2
|
+
import { type PollingTriggerDefinition } from "../types/PollingTriggerDefinition";
|
|
3
|
+
import type { Component as ServerComponent, Connection as ServerConnection, Input as ServerInput, Trigger as ServerTrigger } from ".";
|
|
4
4
|
export declare const convertInput: (key: string, definition: InputFieldDefinition | OnPremConnectionInput | ConnectionInput) => ServerInput;
|
|
5
5
|
export declare const _isValidTemplateValue: (template: string, inputs: {
|
|
6
6
|
[key: string]: ConnectionInput | ConnectionTemplateInputField;
|
|
@@ -21,13 +21,20 @@ const PollingTriggerDefinition_1 = require("../types/PollingTriggerDefinition");
|
|
|
21
21
|
const perform_1 = require("./perform");
|
|
22
22
|
const cleanerFor = (input) => "clean" in input ? input.clean : undefined;
|
|
23
23
|
const convertInput = (key, definition) => {
|
|
24
|
-
// Cast: union
|
|
25
|
-
|
|
26
|
-
const _a = definition, { default: defaultValue, type, label, collection, inputs: childInputs } = _a, rest = __rest(_a, ["default", "type", "label", "collection", "inputs"]);
|
|
24
|
+
// Cast: the field union is wider than any single member; runtime guards below handle it.
|
|
25
|
+
const _a = definition, { default: defaultValue, type, label, collection, inputs: childInputs, configurations } = _a, rest = __rest(_a, ["default", "type", "label", "collection", "inputs", "configurations"]);
|
|
27
26
|
const keyLabel = collection === "keyvaluelist" && typeof label === "object" ? label.key : undefined;
|
|
28
27
|
const nestedInputs = type === "structuredObject" && childInputs
|
|
29
28
|
? Object.entries(childInputs).map(([childKey, childDef]) => (0, exports.convertInput)(childKey, childDef))
|
|
30
|
-
:
|
|
29
|
+
: type === "dynamicObject" && configurations
|
|
30
|
+
? Object.entries(configurations).map(([configKey, configDef]) => ({
|
|
31
|
+
key: configKey,
|
|
32
|
+
type: "structuredObject",
|
|
33
|
+
label: typeof configDef.label === "string" ? configDef.label : configDef.label.value,
|
|
34
|
+
comments: configDef.comments,
|
|
35
|
+
inputs: Object.entries(configDef.inputs).map(([childKey, childDef]) => (0, exports.convertInput)(childKey, childDef)),
|
|
36
|
+
}))
|
|
37
|
+
: undefined;
|
|
31
38
|
return Object.assign(Object.assign({}, (0, omit_1.default)(rest, [
|
|
32
39
|
"onPremControlled",
|
|
33
40
|
"permissionAndVisibilityType",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CollectionType, ComponentRegistry, ConfigPages, ConfigVar, ConfigVarResultCollection, Flow, Inputs, IntegrationDefinition, QueueConfig, StandardQueueConfig, TriggerResult as TriggerPerformResult, TriggerReference } from "../types";
|
|
2
|
-
import { ActionContext, Component as ServerComponent, TriggerPayload, TriggerResult } from ".";
|
|
3
|
-
import { ComponentReference as ServerComponentReference, ConfigPage as ServerConfigPage, RequiredConfigVariable as ServerRequiredConfigVariable } from "./integration";
|
|
1
|
+
import { type CollectionType, type ComponentRegistry, type ConfigPages, type ConfigVar, type ConfigVarResultCollection, type Flow, type Inputs, type IntegrationDefinition, type QueueConfig, type StandardQueueConfig, type TriggerResult as TriggerPerformResult, type TriggerReference } from "../types";
|
|
2
|
+
import type { ActionContext, Component as ServerComponent, TriggerPayload, TriggerResult } from ".";
|
|
3
|
+
import { type ComponentReference as ServerComponentReference, type ConfigPage as ServerConfigPage, type RequiredConfigVariable as ServerRequiredConfigVariable } from "./integration";
|
|
4
4
|
export declare const CONCURRENCY_LIMIT_MAX = 15;
|
|
5
5
|
export declare const CONCURRENCY_LIMIT_MIN = 2;
|
|
6
6
|
export declare const convertIntegration: <TInputs extends Inputs, TActionInputs extends Inputs, TPayload extends TriggerPayload = TriggerPayload, TAllowsBranching extends boolean = boolean, TResult extends TriggerPerformResult<TAllowsBranching, TPayload> = TriggerPerformResult<TAllowsBranching, TPayload>>(definition: IntegrationDefinition<TInputs, TActionInputs, TPayload, TAllowsBranching, TResult>) => ServerComponent<TInputs, TActionInputs, ConfigVarResultCollection, TPayload, TAllowsBranching, TResult>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComponentManifest, ConfigVarResultCollection, CustomerAttributes, DataSourceResultType, DataSourceType, DebugContext, ExecutionFrame, FlowAttributes, FlowInvoker, FlowSchemas, Inputs, InstanceAttributes, IntegrationAttributes, PollingTriggerPerformFunction, TriggerEventFunctionReturn, TriggerPerformFunction, TriggerResult as TriggerPerformResult, UserAttributes } from "../types";
|
|
1
|
+
import type { ComponentManifest, ConfigVarResultCollection, CustomerAttributes, DataSourceResultType, DataSourceType, DebugContext, ExecutionFrame, FlowAttributes, FlowInvoker, FlowSchemas, Inputs, InstanceAttributes, IntegrationAttributes, PollingTriggerPerformFunction, TriggerEventFunctionReturn, TriggerPerformFunction, TriggerResult as TriggerPerformResult, UserAttributes } from "../types";
|
|
2
2
|
import type { CNIPollingPerformFunction, ComponentRefTriggerPerformFunction } from "./triggerTypes";
|
|
3
3
|
interface DisplayDefinition {
|
|
4
4
|
label: string;
|
|
@@ -262,7 +262,8 @@ export interface Input {
|
|
|
262
262
|
onPremiseControlled?: boolean;
|
|
263
263
|
dataSource?: string;
|
|
264
264
|
shown?: boolean;
|
|
265
|
-
/** Nested
|
|
265
|
+
/** Nested children. For `structuredObject`, the declared inputs; for
|
|
266
|
+
* `dynamicObject`, one `structuredObject` per configuration. */
|
|
266
267
|
inputs?: Input[];
|
|
267
268
|
}
|
|
268
269
|
export * from "./asyncContext";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ActionContext, ComponentRegistry, ConfigVarResultCollection, ErrorHandler, Inputs, PollingContext, PollingTriggerDefinition, PollingTriggerPerformFunction, TriggerPayload, TriggerPerformFunction, TriggerReference, TriggerResult } from "../types";
|
|
2
|
-
import { ComponentReference as ServerComponentReference } from "./integration";
|
|
2
|
+
import type { ComponentReference as ServerComponentReference } from "./integration";
|
|
3
3
|
import type { CNIPollingPerformFunction, ComponentRefTriggerPerformFunction } from "./triggerTypes";
|
|
4
4
|
export type PerformFn = (...args: any[]) => Promise<any>;
|
|
5
5
|
interface CreatePollingContext {
|
|
@@ -1,8 +1,22 @@
|
|
|
1
1
|
import type { ConditionalExpression } from "./conditional-logic";
|
|
2
|
-
import type { Connection, InputCleanFunction, InputFieldCollection, Inputs, KeyValuePair, StructuredObjectInputField } from "./Inputs";
|
|
3
|
-
/** Resolves a single InputFieldDefinition's runtime value type.
|
|
4
|
-
*
|
|
5
|
-
|
|
2
|
+
import type { Connection, DynamicObjectInputField, InputCleanFunction, InputFieldCollection, Inputs, KeyValuePair, StructuredObjectInputField } from "./Inputs";
|
|
3
|
+
/** Resolves a single InputFieldDefinition's runtime value type.
|
|
4
|
+
* - structuredObject: record of declared children's resolved value types.
|
|
5
|
+
* - dynamicObject: discriminated union keyed by the selected configuration,
|
|
6
|
+
* with the configuration's resolved inputs nested under `values` to avoid
|
|
7
|
+
* collisions with the `configuration` discriminant key.
|
|
8
|
+
* The depth caps (`LeafInputFieldDefinition`, `StructuredOrLeafInputFieldDefinition`)
|
|
9
|
+
* prevent unbounded recursion. */
|
|
10
|
+
type InputValue<T> = T extends StructuredObjectInputField ? {
|
|
11
|
+
[K in keyof T["inputs"]]: InputValue<T["inputs"][K]>;
|
|
12
|
+
} : T extends DynamicObjectInputField ? {
|
|
13
|
+
[C in keyof T["configurations"]]: {
|
|
14
|
+
configuration: C;
|
|
15
|
+
values: {
|
|
16
|
+
[K in keyof T["configurations"][C]["inputs"]]: InputValue<T["configurations"][C]["inputs"][K]>;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
}[keyof T["configurations"]] : T extends {
|
|
6
20
|
clean: InputCleanFunction<any>;
|
|
7
21
|
} ? ReturnType<T["clean"]> : T extends {
|
|
8
22
|
type: "connection";
|
package/dist/types/Inputs.d.ts
CHANGED
|
@@ -63,6 +63,8 @@ export type JSONForm = {
|
|
|
63
63
|
};
|
|
64
64
|
export type DynamicObjectSelection = string;
|
|
65
65
|
export type DynamicFieldSelection = string;
|
|
66
|
+
export type StructuredObject = Record<string, unknown>;
|
|
67
|
+
export type DynamicObject = Record<string, unknown>;
|
|
66
68
|
/** InputField type enumeration. */
|
|
67
69
|
export type InputFieldType = InputFieldDefinition["type"];
|
|
68
70
|
export declare const InputFieldDefaultMap: Record<InputFieldType, string | undefined>;
|
|
@@ -83,7 +85,7 @@ export type OnPremConnectionInput = {
|
|
|
83
85
|
*/
|
|
84
86
|
onPremControlled: true;
|
|
85
87
|
} & ConnectionInput;
|
|
86
|
-
export type InputFieldDefinition = StringInputField | DataInputField | TextInputField | PasswordInputField | BooleanInputField | CodeInputField | ConditionalInputField | ConnectionInputField | ConnectionTemplateInputField | ObjectSelectionInputField | ObjectFieldMapInputField | JSONFormInputField | DynamicObjectSelectionInputField | DynamicFieldSelectionInputField | DateInputField | DateTimeInputField | FlowInputField | StructuredObjectInputField;
|
|
88
|
+
export type InputFieldDefinition = StringInputField | DataInputField | TextInputField | PasswordInputField | BooleanInputField | CodeInputField | ConditionalInputField | ConnectionInputField | ConnectionTemplateInputField | ObjectSelectionInputField | ObjectFieldMapInputField | JSONFormInputField | DynamicObjectSelectionInputField | DynamicFieldSelectionInputField | DateInputField | DateTimeInputField | FlowInputField | StructuredObjectInputField | DynamicObjectInputField;
|
|
87
89
|
export type InputCleanFunction<TValue, TResult = TValue> = (value: TValue) => TResult;
|
|
88
90
|
interface BaseInputField {
|
|
89
91
|
/** Name of this field to present in the UI. */
|
|
@@ -289,9 +291,13 @@ export type DateTimeInputField = BaseInputField & {
|
|
|
289
291
|
/** Clean function. */
|
|
290
292
|
clean?: InputCleanFunction<unknown>;
|
|
291
293
|
} & CollectionOptions<string>;
|
|
292
|
-
/** `InputFieldDefinition` minus
|
|
293
|
-
* structuredObject nesting at one level. */
|
|
294
|
-
export type LeafInputFieldDefinition = Exclude<InputFieldDefinition, StructuredObjectInputField>;
|
|
294
|
+
/** `InputFieldDefinition` minus container input types; used to cap
|
|
295
|
+
* structuredObject nesting at one level and to enforce leaf-only positions. */
|
|
296
|
+
export type LeafInputFieldDefinition = Exclude<InputFieldDefinition, StructuredObjectInputField | DynamicObjectInputField>;
|
|
297
|
+
/** `InputFieldDefinition` minus `DynamicObjectInputField`; used inside a
|
|
298
|
+
* dynamicObject's `configurations.<key>.inputs` to allow leaves *and*
|
|
299
|
+
* structuredObject children while still rejecting nested dynamicObjects. */
|
|
300
|
+
export type StructuredOrLeafInputFieldDefinition = Exclude<InputFieldDefinition, DynamicObjectInputField>;
|
|
295
301
|
/** Groups related primitive inputs under a single named container.
|
|
296
302
|
* Nesting is capped at one level. */
|
|
297
303
|
export type StructuredObjectInputField = Omit<BaseInputField, "dataSource"> & {
|
|
@@ -300,6 +306,33 @@ export type StructuredObjectInputField = Omit<BaseInputField, "dataSource"> & {
|
|
|
300
306
|
/** Nested input fields keyed by their local key. */
|
|
301
307
|
inputs: Record<string, LeafInputFieldDefinition>;
|
|
302
308
|
};
|
|
309
|
+
/** A single configuration within a dynamicObject. Each configuration declares
|
|
310
|
+
* a labeled set of inputs that become available when this configuration is
|
|
311
|
+
* selected at runtime. */
|
|
312
|
+
export interface DynamicObjectConfiguration {
|
|
313
|
+
/** Name of this configuration to present in the UI. */
|
|
314
|
+
label: {
|
|
315
|
+
key: string;
|
|
316
|
+
value: string;
|
|
317
|
+
} | string;
|
|
318
|
+
/** Additional text to give guidance to the user when this configuration is selected. */
|
|
319
|
+
comments?: string;
|
|
320
|
+
/** Inputs that become available when this configuration is selected. May
|
|
321
|
+
* include leaf inputs and structuredObject inputs; nested dynamicObjects
|
|
322
|
+
* are rejected at the type level. */
|
|
323
|
+
inputs: Record<string, StructuredOrLeafInputFieldDefinition>;
|
|
324
|
+
}
|
|
325
|
+
/** Presents a discriminated set of input groups; the user picks a configuration
|
|
326
|
+
* at integration-build time and that configuration's inputs become available.
|
|
327
|
+
* Nesting is capped: configurations may contain structuredObject children
|
|
328
|
+
* (depth-1) but never another dynamicObject. */
|
|
329
|
+
export type DynamicObjectInputField = Omit<BaseInputField, "dataSource"> & {
|
|
330
|
+
/** Data type the input will collect. */
|
|
331
|
+
type: "dynamicObject";
|
|
332
|
+
/** Available configurations keyed by their local key (used as the
|
|
333
|
+
* runtime discriminant). */
|
|
334
|
+
configurations: Record<string, DynamicObjectConfiguration>;
|
|
335
|
+
};
|
|
303
336
|
/** Defines a single Choice option for a InputField. */
|
|
304
337
|
export interface InputFieldChoice {
|
|
305
338
|
/** Label to display for this Choice. */
|
package/dist/types/Inputs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { HttpResponse } from "./HttpResponse";
|
|
2
|
-
import { TriggerPayload } from "./TriggerPayload";
|
|
1
|
+
import type { HttpResponse } from "./HttpResponse";
|
|
2
|
+
import type { TriggerPayload } from "./TriggerPayload";
|
|
3
3
|
/** Represents the result of a Trigger action. */
|
|
4
4
|
export interface TriggerBaseResult<TPayload extends TriggerPayload> {
|
|
5
5
|
/** The payload in the request that invoked the Integration, which is returned as a result for later use. */
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
26
36
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
27
37
|
};
|
package/dist/util.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
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 { ConnectionDefinition, DataPayload, Element, JSONForm, KeyValuePair, ObjectFieldMap, ObjectSelection } from "./types";
|
|
6
|
+
import type { 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
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prismatic-io/spectral",
|
|
3
|
-
"version": "10.18.
|
|
3
|
+
"version": "10.18.7-preview.1",
|
|
4
4
|
"description": "Utility library for building Prismatic connectors and code-native integrations",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"prismatic"
|
|
@@ -42,34 +42,34 @@
|
|
|
42
42
|
"dist/"
|
|
43
43
|
],
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"axios": "^1.
|
|
45
|
+
"axios": "^1.16.1",
|
|
46
46
|
"axios-retry": "^4.5.0",
|
|
47
47
|
"date-fns": "^4.1.0",
|
|
48
|
-
"ejs": "^
|
|
48
|
+
"ejs": "^5.0.2",
|
|
49
49
|
"form-data": "^4.0.5",
|
|
50
|
-
"fs-extra": "^11.
|
|
51
|
-
"jest-mock": "^30.
|
|
50
|
+
"fs-extra": "^11.3.5",
|
|
51
|
+
"jest-mock": "^30.4.1",
|
|
52
52
|
"lodash": "^4.18.1",
|
|
53
53
|
"object-sizeof": "^2.6.4",
|
|
54
54
|
"prettier": "^3.8.3",
|
|
55
55
|
"safe-stable-stringify": "^2.5.0",
|
|
56
56
|
"valid-url": "1.0.9",
|
|
57
|
-
"yaml": "^2.
|
|
57
|
+
"yaml": "^2.9.0"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"@biomejs/biome": "^2.4.
|
|
61
|
-
"@fast-check/vitest": "^0.4.
|
|
60
|
+
"@biomejs/biome": "^2.4.15",
|
|
61
|
+
"@fast-check/vitest": "^0.4.1",
|
|
62
62
|
"@types/ejs": "3.1.5",
|
|
63
63
|
"@types/fs-extra": "11.0.4",
|
|
64
64
|
"@types/lodash": "^4.17.24",
|
|
65
|
-
"@types/node": "^
|
|
65
|
+
"@types/node": "^25.7.0",
|
|
66
66
|
"@types/prettier": "^3.0.0",
|
|
67
67
|
"@types/sax": "^1.2.7",
|
|
68
68
|
"@types/valid-url": "^1.0.7",
|
|
69
|
-
"@vitest/ui": "^4.1.
|
|
69
|
+
"@vitest/ui": "^4.1.6",
|
|
70
70
|
"copyfiles": "2.4.1",
|
|
71
|
-
"fast-check": "^4.
|
|
72
|
-
"typescript": "
|
|
73
|
-
"vitest": "^4.1.
|
|
71
|
+
"fast-check": "^4.8.0",
|
|
72
|
+
"typescript": "6.0.3",
|
|
73
|
+
"vitest": "^4.1.6"
|
|
74
74
|
}
|
|
75
75
|
}
|