@prismatic-io/spectral 10.5.0 → 10.5.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.
- package/dist/clients/http/index.d.ts +37 -0
- package/dist/clients/http/index.js +24 -0
- package/dist/generators/componentManifest/getInputs.js +1 -0
- package/dist/index.d.ts +71 -36
- package/dist/index.js +68 -33
- package/dist/serverTypes/convertComponent.d.ts +2 -1
- package/dist/serverTypes/convertComponent.js +12 -2
- package/dist/serverTypes/convertIntegration.js +17 -5
- package/dist/serverTypes/index.d.ts +1 -0
- package/dist/testing.d.ts +42 -4
- package/dist/testing.js +42 -4
- package/dist/types/ActionDefinition.d.ts +21 -10
- package/dist/types/ActionLogger.d.ts +3 -2
- package/dist/types/ActionLogger.js +1 -1
- package/dist/types/ActionPerformFunction.d.ts +12 -12
- package/dist/types/ActionPerformReturn.d.ts +11 -11
- package/dist/types/ComponentDefinition.d.ts +34 -11
- package/dist/types/ConfigVars.d.ts +37 -25
- package/dist/types/ConnectionDefinition.d.ts +92 -13
- package/dist/types/ConnectionDefinition.js +16 -0
- package/dist/types/CustomerAttributes.d.ts +6 -0
- package/dist/types/DataPayload.d.ts +4 -4
- package/dist/types/DataSourceDefinition.d.ts +11 -7
- package/dist/types/DataSourcePerformFunction.d.ts +1 -1
- package/dist/types/FlowAttributes.d.ts +2 -0
- package/dist/types/HttpResponse.d.ts +7 -0
- package/dist/types/Inputs.d.ts +82 -58
- package/dist/types/Inputs.js +1 -0
- package/dist/types/InstanceAttributes.d.ts +3 -1
- package/dist/types/IntegrationAttributes.d.ts +4 -1
- package/dist/types/IntegrationDefinition.d.ts +78 -41
- package/dist/types/TriggerDefinition.d.ts +29 -14
- package/dist/types/TriggerEventFunction.d.ts +4 -4
- package/dist/types/TriggerPayload.d.ts +6 -2
- package/dist/types/TriggerResult.d.ts +6 -6
- package/dist/types/UserAttributes.d.ts +11 -1
- package/dist/types/jsonforms/JsonSchema.d.ts +231 -0
- package/dist/types/jsonforms/JsonSchema.js +2 -0
- package/dist/types/jsonforms/UISchemaElement.d.ts +64 -0
- package/dist/types/jsonforms/UISchemaElement.js +24 -0
- package/dist/types/jsonforms/ValidationMode.d.ts +1 -0
- package/dist/types/jsonforms/ValidationMode.js +2 -0
- package/package.json +2 -7
|
@@ -1,23 +1,27 @@
|
|
|
1
1
|
import { InstanceAttributes, CustomerAttributes, UserAttributes, IntegrationAttributes, FlowAttributes } from ".";
|
|
2
2
|
/** Represents a Trigger Payload, which is data passed into a Trigger to invoke an Integration execution. */
|
|
3
3
|
export interface TriggerPayload {
|
|
4
|
+
/** The headers sent in the webhook request. */
|
|
4
5
|
headers: {
|
|
5
6
|
[key: string]: string;
|
|
6
7
|
};
|
|
8
|
+
/** The search parameters included in the URL of the webhook request. */
|
|
7
9
|
queryParameters: {
|
|
8
10
|
[key: string]: string;
|
|
9
11
|
};
|
|
12
|
+
/** The unparsed body of the webhook request. */
|
|
10
13
|
rawBody: {
|
|
11
14
|
data: unknown;
|
|
12
15
|
contentType?: string;
|
|
13
16
|
};
|
|
17
|
+
/** The parsed body of the webhook request. */
|
|
14
18
|
body: {
|
|
15
19
|
data: unknown;
|
|
16
20
|
contentType?: string;
|
|
17
21
|
};
|
|
18
|
-
/** Extended path information from the webhook trigger */
|
|
22
|
+
/** Extended path information from the webhook trigger. */
|
|
19
23
|
pathFragment: string;
|
|
20
|
-
/** The webhook URLs assigned to this integration's flows upon instance deploy */
|
|
24
|
+
/** The webhook URLs assigned to this integration's flows upon instance deploy. */
|
|
21
25
|
webhookUrls: {
|
|
22
26
|
[key: string]: string;
|
|
23
27
|
};
|
|
@@ -4,15 +4,15 @@ import { HttpResponse } from "./HttpResponse";
|
|
|
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. */
|
|
6
6
|
payload: TPayload;
|
|
7
|
-
/**
|
|
7
|
+
/** HTTP response to the request that invoked the integration. */
|
|
8
8
|
response?: HttpResponse;
|
|
9
|
-
/** An optional object, the keys and values of which will be persisted in the flow-specific instanceState and available for subsequent actions and executions */
|
|
9
|
+
/** An optional object, the keys and values of which will be persisted in the flow-specific instanceState and available for subsequent actions and executions. */
|
|
10
10
|
instanceState?: Record<string, unknown>;
|
|
11
|
-
/** An optional object, the keys and values of which will be persisted in the crossFlowState and available in any flow for subsequent actions and executions */
|
|
11
|
+
/** An optional object, the keys and values of which will be persisted in the crossFlowState and available in any flow for subsequent actions and executions. */
|
|
12
12
|
crossFlowState?: Record<string, unknown>;
|
|
13
|
-
/** An optional object, the keys and values of which will be persisted in the executionState and available for the duration of the execution */
|
|
13
|
+
/** An optional object, the keys and values of which will be persisted in the executionState and available for the duration of the execution. */
|
|
14
14
|
executionState?: Record<string, unknown>;
|
|
15
|
-
/** An optional object, the keys and values of which will be persisted in the integrationState and available in any flow of an Instance for any version of an Integration for subsequent actions and executions */
|
|
15
|
+
/** An optional object, the keys and values of which will be persisted in the integrationState and available in any flow of an Instance for any version of an Integration for subsequent actions and executions. */
|
|
16
16
|
integrationState?: Record<string, unknown>;
|
|
17
17
|
/** A field populated by the Prismatic platform which indicates whether the trigger failed with an error during execution. */
|
|
18
18
|
failed?: boolean;
|
|
@@ -26,5 +26,5 @@ export interface TriggerBranchingResult<TPayload extends TriggerPayload> extends
|
|
|
26
26
|
/** Name of the Branch to take. */
|
|
27
27
|
branch: string;
|
|
28
28
|
}
|
|
29
|
-
/** Required return type of all trigger perform functions */
|
|
29
|
+
/** Required return type of all trigger perform functions. */
|
|
30
30
|
export type TriggerResult<AllowsBranching extends boolean | undefined, TPayload extends TriggerPayload> = (AllowsBranching extends true ? TriggerBranchingResult<TPayload> : TriggerBaseResult<TPayload>) | undefined;
|
|
@@ -1,7 +1,17 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Contains attributes of the User whose user-level configuration is being used. See
|
|
3
|
+
* https://prismatic.io/docs/integrations/config-wizard/user-level-configuration/
|
|
4
|
+
*/
|
|
2
5
|
export interface UserAttributes {
|
|
6
|
+
/** Programmatic ID of the user whose user-level configuration is being used. */
|
|
3
7
|
id: string;
|
|
8
|
+
/** The email address (or embedded ID) of the user whose user-level configuration is being used. */
|
|
4
9
|
email: string;
|
|
10
|
+
/** The name of the user whose user-level configuration is being used. */
|
|
5
11
|
name: string;
|
|
12
|
+
/**
|
|
13
|
+
* The external ID you assign to the user whose user-level configuration is being used. See
|
|
14
|
+
* https://prismatic.io/docs/embed/authenticate-users/#create-and-sign-a-jwt
|
|
15
|
+
*/
|
|
6
16
|
externalId: string;
|
|
7
17
|
}
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
export type JsonSchema = JsonSchema4 | JsonSchema7;
|
|
2
|
+
interface JsonSchema4 {
|
|
3
|
+
$ref?: string;
|
|
4
|
+
/**
|
|
5
|
+
* This is important because it tells refs where
|
|
6
|
+
* the root of the document is located
|
|
7
|
+
*/
|
|
8
|
+
id?: string;
|
|
9
|
+
/**
|
|
10
|
+
* It is recommended that the meta-schema is
|
|
11
|
+
* included in the root of any JSON Schema
|
|
12
|
+
*/
|
|
13
|
+
$schema?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Title of the schema
|
|
16
|
+
*/
|
|
17
|
+
title?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Schema description
|
|
20
|
+
*/
|
|
21
|
+
description?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Default json for the object represented by
|
|
24
|
+
* this schema
|
|
25
|
+
*/
|
|
26
|
+
default?: any;
|
|
27
|
+
/**
|
|
28
|
+
* The value must be a multiple of the number
|
|
29
|
+
* (e.g. 10 is a multiple of 5)
|
|
30
|
+
*/
|
|
31
|
+
multipleOf?: number;
|
|
32
|
+
maximum?: number;
|
|
33
|
+
/**
|
|
34
|
+
* If true maximum must be > value, >= otherwise
|
|
35
|
+
*/
|
|
36
|
+
exclusiveMaximum?: boolean;
|
|
37
|
+
minimum?: number;
|
|
38
|
+
/**
|
|
39
|
+
* If true minimum must be < value, <= otherwise
|
|
40
|
+
*/
|
|
41
|
+
exclusiveMinimum?: boolean;
|
|
42
|
+
maxLength?: number;
|
|
43
|
+
minLength?: number;
|
|
44
|
+
/**
|
|
45
|
+
* This is a regex string that the value must
|
|
46
|
+
* conform to
|
|
47
|
+
*/
|
|
48
|
+
pattern?: string;
|
|
49
|
+
additionalItems?: boolean | JsonSchema4;
|
|
50
|
+
items?: JsonSchema4 | JsonSchema4[];
|
|
51
|
+
maxItems?: number;
|
|
52
|
+
minItems?: number;
|
|
53
|
+
uniqueItems?: boolean;
|
|
54
|
+
maxProperties?: number;
|
|
55
|
+
minProperties?: number;
|
|
56
|
+
required?: string[];
|
|
57
|
+
additionalProperties?: boolean | JsonSchema4;
|
|
58
|
+
/**
|
|
59
|
+
* Holds simple JSON Schema definitions for
|
|
60
|
+
* referencing from elsewhere.
|
|
61
|
+
*/
|
|
62
|
+
definitions?: {
|
|
63
|
+
[key: string]: JsonSchema4;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* The keys that can exist on the object with the
|
|
67
|
+
* json schema that should validate their value
|
|
68
|
+
*/
|
|
69
|
+
properties?: {
|
|
70
|
+
[property: string]: JsonSchema4;
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* The key of this object is a regex for which
|
|
74
|
+
* properties the schema applies to
|
|
75
|
+
*/
|
|
76
|
+
patternProperties?: {
|
|
77
|
+
[pattern: string]: JsonSchema4;
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* If the key is present as a property then the
|
|
81
|
+
* string of properties must also be present.
|
|
82
|
+
* If the value is a JSON Schema then it must
|
|
83
|
+
* also be valid for the object if the key is
|
|
84
|
+
* present.
|
|
85
|
+
*/
|
|
86
|
+
dependencies?: {
|
|
87
|
+
[key: string]: JsonSchema4 | string[];
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* Enumerates the values that this schema can be
|
|
91
|
+
* e.g.
|
|
92
|
+
* {"type": "string",
|
|
93
|
+
* "enum": ["red", "green", "blue"]}
|
|
94
|
+
*/
|
|
95
|
+
enum?: any[];
|
|
96
|
+
/**
|
|
97
|
+
* The basic type of this schema, can be one of
|
|
98
|
+
* [string, number, object, array, boolean, null]
|
|
99
|
+
* or an array of the acceptable types
|
|
100
|
+
*/
|
|
101
|
+
type?: string | string[];
|
|
102
|
+
allOf?: JsonSchema4[];
|
|
103
|
+
anyOf?: JsonSchema4[];
|
|
104
|
+
oneOf?: JsonSchema4[];
|
|
105
|
+
/**
|
|
106
|
+
* The entity being validated must not match this schema
|
|
107
|
+
*/
|
|
108
|
+
not?: JsonSchema4;
|
|
109
|
+
format?: string;
|
|
110
|
+
const?: any;
|
|
111
|
+
}
|
|
112
|
+
interface JsonSchema7 {
|
|
113
|
+
$ref?: string;
|
|
114
|
+
/**
|
|
115
|
+
* This is important because it tells refs where
|
|
116
|
+
* the root of the document is located
|
|
117
|
+
*/
|
|
118
|
+
$id?: string;
|
|
119
|
+
/**
|
|
120
|
+
* It is recommended that the meta-schema is
|
|
121
|
+
* included in the root of any JSON Schema
|
|
122
|
+
*/
|
|
123
|
+
$schema?: string;
|
|
124
|
+
/**
|
|
125
|
+
* Title of the schema
|
|
126
|
+
*/
|
|
127
|
+
title?: string;
|
|
128
|
+
/**
|
|
129
|
+
* Schema description
|
|
130
|
+
*/
|
|
131
|
+
description?: string;
|
|
132
|
+
/**
|
|
133
|
+
* Default json for the object represented by
|
|
134
|
+
* this schema
|
|
135
|
+
*/
|
|
136
|
+
default?: any;
|
|
137
|
+
/**
|
|
138
|
+
* The value must be a multiple of the number
|
|
139
|
+
* (e.g. 10 is a multiple of 5)
|
|
140
|
+
*/
|
|
141
|
+
multipleOf?: number;
|
|
142
|
+
maximum?: number;
|
|
143
|
+
/**
|
|
144
|
+
* If true maximum must be > value, >= otherwise
|
|
145
|
+
*/
|
|
146
|
+
exclusiveMaximum?: number;
|
|
147
|
+
minimum?: number;
|
|
148
|
+
/**
|
|
149
|
+
* If true minimum must be < value, <= otherwise
|
|
150
|
+
*/
|
|
151
|
+
exclusiveMinimum?: number;
|
|
152
|
+
maxLength?: number;
|
|
153
|
+
minLength?: number;
|
|
154
|
+
/**
|
|
155
|
+
* This is a regex string that the value must
|
|
156
|
+
* conform to
|
|
157
|
+
*/
|
|
158
|
+
pattern?: string;
|
|
159
|
+
additionalItems?: boolean | JsonSchema7;
|
|
160
|
+
items?: JsonSchema7 | JsonSchema7[];
|
|
161
|
+
maxItems?: number;
|
|
162
|
+
minItems?: number;
|
|
163
|
+
uniqueItems?: boolean;
|
|
164
|
+
maxProperties?: number;
|
|
165
|
+
minProperties?: number;
|
|
166
|
+
required?: string[];
|
|
167
|
+
additionalProperties?: boolean | JsonSchema7;
|
|
168
|
+
/**
|
|
169
|
+
* Holds simple JSON Schema definitions for
|
|
170
|
+
* referencing from elsewhere.
|
|
171
|
+
*/
|
|
172
|
+
definitions?: {
|
|
173
|
+
[key: string]: JsonSchema7;
|
|
174
|
+
};
|
|
175
|
+
/**
|
|
176
|
+
* The keys that can exist on the object with the
|
|
177
|
+
* json schema that should validate their value
|
|
178
|
+
*/
|
|
179
|
+
properties?: {
|
|
180
|
+
[property: string]: JsonSchema7;
|
|
181
|
+
};
|
|
182
|
+
/**
|
|
183
|
+
* The key of this object is a regex for which
|
|
184
|
+
* properties the schema applies to
|
|
185
|
+
*/
|
|
186
|
+
patternProperties?: {
|
|
187
|
+
[pattern: string]: JsonSchema7;
|
|
188
|
+
};
|
|
189
|
+
/**
|
|
190
|
+
* If the key is present as a property then the
|
|
191
|
+
* string of properties must also be present.
|
|
192
|
+
* If the value is a JSON Schema then it must
|
|
193
|
+
* also be valid for the object if the key is
|
|
194
|
+
* present.
|
|
195
|
+
*/
|
|
196
|
+
dependencies?: {
|
|
197
|
+
[key: string]: JsonSchema7 | string[];
|
|
198
|
+
};
|
|
199
|
+
/**
|
|
200
|
+
* Enumerates the values that this schema can be
|
|
201
|
+
* e.g.
|
|
202
|
+
* {"type": "string",
|
|
203
|
+
* "enum": ["red", "green", "blue"]}
|
|
204
|
+
*/
|
|
205
|
+
enum?: any[];
|
|
206
|
+
/**
|
|
207
|
+
* The basic type of this schema, can be one of
|
|
208
|
+
* [string, number, object, array, boolean, null]
|
|
209
|
+
* or an array of the acceptable types
|
|
210
|
+
*/
|
|
211
|
+
type?: string | string[];
|
|
212
|
+
allOf?: JsonSchema7[];
|
|
213
|
+
anyOf?: JsonSchema7[];
|
|
214
|
+
oneOf?: JsonSchema7[];
|
|
215
|
+
/**
|
|
216
|
+
* The entity being validated must not match this schema
|
|
217
|
+
*/
|
|
218
|
+
not?: JsonSchema7;
|
|
219
|
+
format?: string;
|
|
220
|
+
readOnly?: boolean;
|
|
221
|
+
writeOnly?: boolean;
|
|
222
|
+
examples?: any[];
|
|
223
|
+
contains?: JsonSchema7;
|
|
224
|
+
propertyNames?: JsonSchema7;
|
|
225
|
+
const?: any;
|
|
226
|
+
if?: JsonSchema7;
|
|
227
|
+
then?: JsonSchema7;
|
|
228
|
+
else?: JsonSchema7;
|
|
229
|
+
errorMessage?: any;
|
|
230
|
+
}
|
|
231
|
+
export {};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Common base interface for any UI schema element.
|
|
3
|
+
*/
|
|
4
|
+
export interface UISchemaElement {
|
|
5
|
+
/**
|
|
6
|
+
* The type of this UI schema element.
|
|
7
|
+
*/
|
|
8
|
+
type: string;
|
|
9
|
+
/**
|
|
10
|
+
* An optional rule.
|
|
11
|
+
*/
|
|
12
|
+
rule?: Rule;
|
|
13
|
+
/**
|
|
14
|
+
* Any additional options.
|
|
15
|
+
*/
|
|
16
|
+
options?: {
|
|
17
|
+
[key: string]: any;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* A rule that may be attached to any UI schema element.
|
|
22
|
+
*/
|
|
23
|
+
interface Rule {
|
|
24
|
+
/**
|
|
25
|
+
* The effect of the rule
|
|
26
|
+
*/
|
|
27
|
+
effect: RuleEffect;
|
|
28
|
+
/**
|
|
29
|
+
* The condition of the rule that must evaluate to true in order
|
|
30
|
+
* to trigger the effect.
|
|
31
|
+
*/
|
|
32
|
+
condition: Condition;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* The different rule effects.
|
|
36
|
+
*/
|
|
37
|
+
declare enum RuleEffect {
|
|
38
|
+
/**
|
|
39
|
+
* Effect that hides the associated element.
|
|
40
|
+
*/
|
|
41
|
+
HIDE = "HIDE",
|
|
42
|
+
/**
|
|
43
|
+
* Effect that shows the associated element.
|
|
44
|
+
*/
|
|
45
|
+
SHOW = "SHOW",
|
|
46
|
+
/**
|
|
47
|
+
* Effect that enables the associated element.
|
|
48
|
+
*/
|
|
49
|
+
ENABLE = "ENABLE",
|
|
50
|
+
/**
|
|
51
|
+
* Effect that disables the associated element.
|
|
52
|
+
*/
|
|
53
|
+
DISABLE = "DISABLE"
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Represents a condition to be evaluated.
|
|
57
|
+
*/
|
|
58
|
+
interface Condition {
|
|
59
|
+
/**
|
|
60
|
+
* The type of condition.
|
|
61
|
+
*/
|
|
62
|
+
readonly type?: string;
|
|
63
|
+
}
|
|
64
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/**
|
|
4
|
+
* The different rule effects.
|
|
5
|
+
*/
|
|
6
|
+
var RuleEffect;
|
|
7
|
+
(function (RuleEffect) {
|
|
8
|
+
/**
|
|
9
|
+
* Effect that hides the associated element.
|
|
10
|
+
*/
|
|
11
|
+
RuleEffect["HIDE"] = "HIDE";
|
|
12
|
+
/**
|
|
13
|
+
* Effect that shows the associated element.
|
|
14
|
+
*/
|
|
15
|
+
RuleEffect["SHOW"] = "SHOW";
|
|
16
|
+
/**
|
|
17
|
+
* Effect that enables the associated element.
|
|
18
|
+
*/
|
|
19
|
+
RuleEffect["ENABLE"] = "ENABLE";
|
|
20
|
+
/**
|
|
21
|
+
* Effect that disables the associated element.
|
|
22
|
+
*/
|
|
23
|
+
RuleEffect["DISABLE"] = "DISABLE";
|
|
24
|
+
})(RuleEffect || (RuleEffect = {}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type ValidationMode = "ValidateAndShow" | "ValidateAndHide" | "NoValidation";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prismatic-io/spectral",
|
|
3
|
-
"version": "10.5.
|
|
3
|
+
"version": "10.5.2",
|
|
4
4
|
"description": "Utility library for building Prismatic connectors and code-native integrations",
|
|
5
5
|
"keywords": ["prismatic"],
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -33,12 +33,10 @@
|
|
|
33
33
|
"format": "yarn run lint-fix && biome format --write .",
|
|
34
34
|
"check-format": "biome format .",
|
|
35
35
|
"check": "yarn run check-format && yarn run lint",
|
|
36
|
-
"test": "jest"
|
|
37
|
-
"docs": "rm -f sidebars.{js,jse} && typedoc"
|
|
36
|
+
"test": "jest"
|
|
38
37
|
},
|
|
39
38
|
"files": ["dist/"],
|
|
40
39
|
"dependencies": {
|
|
41
|
-
"@jsonforms/core": "3.0.0",
|
|
42
40
|
"axios": "1.8.3",
|
|
43
41
|
"axios-retry": "4.5.0",
|
|
44
42
|
"date-fns": "2.30.0",
|
|
@@ -71,9 +69,6 @@
|
|
|
71
69
|
"fast-check": "2.16.0",
|
|
72
70
|
"jest": "29.7.0",
|
|
73
71
|
"ts-jest": "29.1.2",
|
|
74
|
-
"typedoc": "0.17.7",
|
|
75
|
-
"typedoc-plugin-markdown": "2.4.2",
|
|
76
|
-
"typedoc-plugin-remove-references": "0.0.5",
|
|
77
72
|
"typescript": "5.5.3"
|
|
78
73
|
}
|
|
79
74
|
}
|