@prismatic-io/spectral 10.5.0 → 10.5.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 +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 +36 -24
- 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 +80 -57
- 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/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ValidationMode } from "@jsonforms/core";
|
|
2
2
|
import { type DataSourceDefinition, type ConnectionDefinition, type Inputs, type DataSourceType, type Connection, type JSONForm, type ObjectFieldMap, type ObjectSelection, type ConfigVarResultCollection, type Schedule, type CollectionDataSourceType, type DataSourceReference, type ConfigPage, type ConfigPages, type ConfigPageElement, type ComponentRegistryDataSource, type ComponentRegistryConnection, type UserLevelConfigPages, type OrganizationActivatedConnectionConfigVar, type ScopedConfigVarMap } from ".";
|
|
3
3
|
import type { Prettify, UnionToIntersection } from "./utils";
|
|
4
|
-
/** Supported data types for
|
|
4
|
+
/** Supported data types for config variables. */
|
|
5
5
|
export type ConfigVarDataType = "string" | "date" | "timestamp" | "picklist" | "code" | "boolean" | "number" | "schedule" | "objectSelection" | "objectFieldMap" | "jsonForm" | "htmlElement";
|
|
6
6
|
type ConfigVarDataTypeDefaultValueMap<TMap extends Record<ConfigVarDataType, unknown> = {
|
|
7
7
|
string: string;
|
|
@@ -31,60 +31,72 @@ type ConfigVarDataTypeRuntimeValueMap<TMap extends Record<ConfigVarDataType, unk
|
|
|
31
31
|
jsonForm: unknown;
|
|
32
32
|
htmlElement: string;
|
|
33
33
|
}> = TMap;
|
|
34
|
-
/** Choices of collection types for multi-value
|
|
34
|
+
/** Choices of collection types for multi-value config vars. */
|
|
35
35
|
export type CollectionType = "valuelist" | "keyvaluelist";
|
|
36
36
|
type ConfigVarSingleDataType = Extract<ConfigVarDataType, "schedule" | "objectSelection" | "objectFieldMap" | "jsonForm">;
|
|
37
37
|
export type PermissionAndVisibilityType = "customer" | "embedded" | "organization";
|
|
38
38
|
export interface ConfigVarVisibility {
|
|
39
39
|
/**
|
|
40
|
-
* Optional value that sets the permission and visibility of the
|
|
40
|
+
* Optional value that sets the permission and visibility of the config variable. See
|
|
41
|
+
* https://prismatic.io/docs/integrations/code-native/config-wizard/#config-variable-visibility-in-code-native
|
|
41
42
|
*
|
|
42
|
-
* "customer" - Customers can view and edit the
|
|
43
|
-
* "embedded" - Customers cannot view or update the
|
|
44
|
-
* "organization" - Customers cannot view or update the
|
|
43
|
+
* - `"customer"` - Customers can view and edit the config variable.
|
|
44
|
+
* - `"embedded"` - Customers cannot view or update the config variable as the value will be set programmatically.
|
|
45
|
+
* - `"organization"` - Customers cannot view or update the config variable as it will always have a default value or be set by the organization.
|
|
46
|
+
*
|
|
47
|
+
* @default `"customer"`
|
|
45
48
|
*/
|
|
46
49
|
permissionAndVisibilityType?: PermissionAndVisibilityType;
|
|
47
|
-
/**
|
|
50
|
+
/**
|
|
51
|
+
* Optional value that specifies whether this config var is visible to an organization deployer.
|
|
52
|
+
* @default true
|
|
53
|
+
*/
|
|
48
54
|
visibleToOrgDeployer?: boolean;
|
|
49
55
|
}
|
|
50
56
|
interface ConfigVarInputVisibility {
|
|
51
57
|
/**
|
|
52
|
-
* Optional value that sets the permission and visibility of the
|
|
58
|
+
* Optional value that sets the permission and visibility of the config variable input. See
|
|
59
|
+
* https://prismatic.io/docs/integrations/code-native/config-wizard/#config-variable-visibility-in-code-native
|
|
53
60
|
*
|
|
54
|
-
* "customer" - Customers can view and edit the
|
|
55
|
-
* "embedded" - Customers cannot view or update the
|
|
56
|
-
* "organization" - Customers cannot view or update the
|
|
61
|
+
* - `"customer"` - Customers can view and edit the config variable input.
|
|
62
|
+
* - `"embedded"` - Customers cannot view or update the config variable input as the value will be set programmatically.
|
|
63
|
+
* - `"organization"` - Customers cannot view or update the config variable input as it will always have a default value or be set by the organization.
|
|
64
|
+
*
|
|
65
|
+
* @default `"customer"`
|
|
57
66
|
*/
|
|
58
67
|
permissionAndVisibilityType?: PermissionAndVisibilityType;
|
|
59
|
-
/**
|
|
68
|
+
/**
|
|
69
|
+
* Optional value that specifies whether this config var input is visible to an organization deployer.
|
|
70
|
+
* @default true
|
|
71
|
+
*/
|
|
60
72
|
visibleToOrgDeployer?: boolean;
|
|
61
73
|
}
|
|
62
|
-
/** Common attribute shared by all types of
|
|
74
|
+
/** Common attribute shared by all types of config variables. */
|
|
63
75
|
type BaseConfigVar = {
|
|
64
|
-
/** A unique, unchanging value that is used to maintain identity for the
|
|
76
|
+
/** A unique, unchanging value that is used to maintain identity for the config variable even if the key changes. */
|
|
65
77
|
stableKey: string;
|
|
66
|
-
/**
|
|
78
|
+
/** Description for this config variable. */
|
|
67
79
|
description?: string;
|
|
68
80
|
} & ConfigVarVisibility;
|
|
69
81
|
type GetDynamicProperties<TValue, TCollectionType extends CollectionType | undefined> = TCollectionType extends undefined ? {
|
|
70
82
|
defaultValue?: TValue;
|
|
71
|
-
/**
|
|
83
|
+
/** Value to specify the type of collection if the config variable is multi-value. */
|
|
72
84
|
collectionType?: undefined;
|
|
73
85
|
} : TCollectionType extends "valuelist" ? {
|
|
74
86
|
defaultValue?: TValue[];
|
|
75
|
-
/**
|
|
87
|
+
/** Value to specify the type of collection if the config variable is multi-value. */
|
|
76
88
|
collectionType: "valuelist";
|
|
77
89
|
} : {
|
|
78
90
|
defaultValue?: Record<string, TValue> | Array<{
|
|
79
91
|
key: string;
|
|
80
92
|
value: TValue;
|
|
81
93
|
}>;
|
|
82
|
-
/**
|
|
94
|
+
/** Value to specify the type of collection if the config variable is multi-value. */
|
|
83
95
|
collectionType: "keyvaluelist";
|
|
84
96
|
};
|
|
85
97
|
type StandardConfigVarDynamicProperties<TDataType extends ConfigVarDataType> = CollectionType | undefined extends infer TCollectionType ? TCollectionType extends CollectionType | undefined ? TDataType extends ConfigVarSingleDataType ? TCollectionType extends undefined ? GetDynamicProperties<ConfigVarDataTypeDefaultValueMap[TDataType], undefined> : never : GetDynamicProperties<ConfigVarDataTypeDefaultValueMap[TDataType], TCollectionType> : never : never;
|
|
86
98
|
type CreateStandardConfigVar<TDataType extends ConfigVarDataType> = BaseConfigVar & StandardConfigVarDynamicProperties<TDataType> & {
|
|
87
|
-
/** The data type of the
|
|
99
|
+
/** The data type of the config variable. */
|
|
88
100
|
dataType: TDataType;
|
|
89
101
|
};
|
|
90
102
|
type StringConfigVar = CreateStandardConfigVar<"string">;
|
|
@@ -94,16 +106,16 @@ type PicklistConfigVar = CreateStandardConfigVar<"picklist"> & {
|
|
|
94
106
|
/** List of picklist values. */
|
|
95
107
|
pickList: string[];
|
|
96
108
|
};
|
|
97
|
-
/**
|
|
109
|
+
/** Syntax highlighting to use for this code config variable. */
|
|
98
110
|
export type CodeLanguageType = "json" | "xml" | "html";
|
|
99
111
|
type CodeConfigVar = CreateStandardConfigVar<"code"> & {
|
|
100
|
-
/** Value to specify the type of language of a code
|
|
112
|
+
/** Value to specify the type of language of a code config variable. */
|
|
101
113
|
codeLanguage: CodeLanguageType;
|
|
102
114
|
};
|
|
103
115
|
type BooleanConfigVar = CreateStandardConfigVar<"boolean">;
|
|
104
116
|
type NumberConfigVar = CreateStandardConfigVar<"number">;
|
|
105
117
|
type ScheduleConfigVar = CreateStandardConfigVar<"schedule"> & {
|
|
106
|
-
/**
|
|
118
|
+
/** Timezone for the schedule. */
|
|
107
119
|
timeZone?: string;
|
|
108
120
|
};
|
|
109
121
|
type ObjectSelectionConfigVar = CreateStandardConfigVar<"objectSelection">;
|
|
@@ -139,7 +151,7 @@ type DataSourceReferenceConfigVar = ComponentRegistryDataSource extends infer TD
|
|
|
139
151
|
dataSource: TDataSourceReference["reference"];
|
|
140
152
|
validationMode?: ValidationMode;
|
|
141
153
|
} : never;
|
|
142
|
-
/** Defines attributes of a data source
|
|
154
|
+
/** Defines attributes of a data source config variable. */
|
|
143
155
|
export type DataSourceConfigVar = DataSourceDefinitionConfigVar | DataSourceReferenceConfigVar;
|
|
144
156
|
type BaseConnectionConfigVar = BaseConfigVar & {
|
|
145
157
|
dataType: "connection";
|
|
@@ -163,7 +175,7 @@ type ConnectionReferenceConfigVar = ComponentRegistryConnection extends infer TC
|
|
|
163
175
|
onPremiseConnectionConfig?: undefined;
|
|
164
176
|
});
|
|
165
177
|
} : never : never;
|
|
166
|
-
/** Defines attributes of a
|
|
178
|
+
/** Defines attributes of a config variable that represents a connection. */
|
|
167
179
|
export type ConnectionConfigVar = ConnectionDefinitionConfigVar | ConnectionReferenceConfigVar;
|
|
168
180
|
export type ConfigVar = StandardConfigVar | DataSourceConfigVar | ConnectionConfigVar | OrganizationActivatedConnectionConfigVar;
|
|
169
181
|
type WithCollectionType<TValue, TCollectionType extends CollectionType | undefined> = undefined | unknown extends TCollectionType ? TValue : TCollectionType extends "valuelist" ? TValue[] : Array<{
|
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
import type { ConnectionDisplayDefinition, ConnectionInput, OnPremConnectionInput } from ".";
|
|
1
|
+
import type { ConnectionDisplayDefinition, ConnectionInput, ConnectionTemplateInputField, OnPremConnectionInput } from ".";
|
|
2
2
|
export declare enum OAuth2Type {
|
|
3
|
+
/**
|
|
4
|
+
* This connection uses the OAuth 2.0 client credentials flow. See
|
|
5
|
+
* https://prismatic.io/docs/integrations/connections/oauth2/client-credentials-grant-type/
|
|
6
|
+
*/
|
|
3
7
|
ClientCredentials = "client_credentials",
|
|
8
|
+
/**
|
|
9
|
+
* This connection uses the OAuth 2.0 auth code flow. See
|
|
10
|
+
* https://prismatic.io/docs/integrations/connections/oauth2/authorization-code-grant-type/
|
|
11
|
+
*/
|
|
4
12
|
AuthorizationCode = "authorization_code"
|
|
5
13
|
}
|
|
6
14
|
export declare enum OAuth2PkceMethod {
|
|
@@ -10,6 +18,10 @@ export declare enum OAuth2PkceMethod {
|
|
|
10
18
|
interface BaseConnectionDefinition {
|
|
11
19
|
key: string;
|
|
12
20
|
display: ConnectionDisplayDefinition;
|
|
21
|
+
/**
|
|
22
|
+
* If this connection implements OAuth 2.0, specify which flavor of OAuth 2.0. See
|
|
23
|
+
* https://prismatic.io/docs/custom-connectors/connections/#writing-oauth-20-connections
|
|
24
|
+
*/
|
|
13
25
|
oauth2Type?: OAuth2Type;
|
|
14
26
|
}
|
|
15
27
|
export interface DefaultConnectionDefinition extends BaseConnectionDefinition {
|
|
@@ -19,41 +31,108 @@ export interface DefaultConnectionDefinition extends BaseConnectionDefinition {
|
|
|
19
31
|
}
|
|
20
32
|
export interface OnPremConnectionDefinition extends BaseConnectionDefinition {
|
|
21
33
|
inputs: {
|
|
34
|
+
/**
|
|
35
|
+
* When on-prem is enabled for this connection, the `host` value will be
|
|
36
|
+
* overwritten with a local endpoint for the established on-prem tunnel. See
|
|
37
|
+
* https://prismatic.io/docs/integrations/connections/on-prem-agent/#supporting-on-prem-connections-in-a-custom-connector
|
|
38
|
+
*/
|
|
22
39
|
host: OnPremConnectionInput;
|
|
40
|
+
/**
|
|
41
|
+
* When on-prem is enabled for this connection, the `port` value will be
|
|
42
|
+
* overwritten with a local port for the established on-prem tunnel. See
|
|
43
|
+
* https://prismatic.io/docs/integrations/connections/on-prem-agent/#supporting-on-prem-connections-in-a-custom-connector
|
|
44
|
+
*/
|
|
23
45
|
port: OnPremConnectionInput;
|
|
24
46
|
[key: string]: ConnectionInput;
|
|
25
47
|
};
|
|
26
48
|
}
|
|
49
|
+
type TTemplateComplement<TRequired, TGiven> = {
|
|
50
|
+
[K in Exclude<keyof TRequired, keyof TGiven>]: ConnectionTemplateInputField;
|
|
51
|
+
};
|
|
52
|
+
interface OAuth2AuthorizationCodeInputs {
|
|
53
|
+
/**
|
|
54
|
+
* The OAuth 2.0 authorization URL where users can consent to granting you permissions
|
|
55
|
+
* to their third-party account. (e.g. `https://app.acme.com/oauth2/authorize`)
|
|
56
|
+
*/
|
|
57
|
+
authorizeUrl: ConnectionInput;
|
|
58
|
+
/**
|
|
59
|
+
* The OAuth 2.0 token URL which can be used to exchange an auth code or refresh
|
|
60
|
+
* token for an access token. (e.g. `https://app.acme.com/oauth2/token`)
|
|
61
|
+
*/
|
|
62
|
+
tokenUrl: ConnectionInput;
|
|
63
|
+
/** OAuth 2.0 permissions (scopes) to request from the authenticated user. */
|
|
64
|
+
scopes: ConnectionInput;
|
|
65
|
+
/** OAuth 2.0 client ID (sometimes called app key or client key). */
|
|
66
|
+
clientId: ConnectionInput;
|
|
67
|
+
/** OAuth 2.0 client secret (sometimes called app secret or secret key). */
|
|
68
|
+
clientSecret: ConnectionInput;
|
|
69
|
+
}
|
|
70
|
+
interface OAuth2ClientCredentialInputs {
|
|
71
|
+
/**
|
|
72
|
+
* The OAuth 2.0 token URL which can be used to exchange a client ID and secret
|
|
73
|
+
* for an access token. (e.g. `https://app.acme.com/oauth2/token`)
|
|
74
|
+
*/
|
|
75
|
+
tokenUrl: ConnectionInput;
|
|
76
|
+
/** OAuth 2.0 permissions (scopes) to request from the authenticated user. */
|
|
77
|
+
scopes: ConnectionInput;
|
|
78
|
+
/** OAuth 2.0 client ID (sometimes called app key or client key). */
|
|
79
|
+
clientId: ConnectionInput;
|
|
80
|
+
/** OAuth 2.0 client secret (sometimes called app secret or secret key). */
|
|
81
|
+
clientSecret: ConnectionInput;
|
|
82
|
+
}
|
|
83
|
+
export declare function templateConnectionInputs<TConnectionType extends "client_credentials" | "authorization_code" | null = null, TInputs extends Record<string, ConnectionInput> = Record<string, ConnectionInput>>(inputs: TConnectionType extends null | undefined ? Record<string, ConnectionInput> : TConnectionType extends OAuth2Type.ClientCredentials ? TInputs & Partial<OAuth2ClientCredentialInputs> & {
|
|
84
|
+
[key: string]: ConnectionInput;
|
|
85
|
+
} : TInputs & Partial<OAuth2AuthorizationCodeInputs> & {
|
|
86
|
+
[key: string]: ConnectionInput;
|
|
87
|
+
}, templateInputs: TConnectionType extends null | undefined ? {
|
|
88
|
+
[key: string]: ConnectionTemplateInputField;
|
|
89
|
+
} : TConnectionType extends "client_credentials" ? TTemplateComplement<OAuth2ClientCredentialInputs, TInputs> & {
|
|
90
|
+
[key: string]: ConnectionTemplateInputField;
|
|
91
|
+
} : TTemplateComplement<OAuth2AuthorizationCodeInputs, TInputs> & {
|
|
92
|
+
[key: string]: ConnectionTemplateInputField;
|
|
93
|
+
}, _authType?: TConnectionType): (TConnectionType extends null | undefined ? Record<string, ConnectionInput> : TConnectionType extends OAuth2Type.ClientCredentials ? TInputs & Partial<OAuth2ClientCredentialInputs> & {
|
|
94
|
+
[key: string]: ConnectionInput;
|
|
95
|
+
} : TInputs & Partial<OAuth2AuthorizationCodeInputs> & {
|
|
96
|
+
[key: string]: ConnectionInput;
|
|
97
|
+
}) & (TConnectionType extends null | undefined ? {
|
|
98
|
+
[key: string]: ConnectionTemplateInputField;
|
|
99
|
+
} : TConnectionType extends "client_credentials" ? TTemplateComplement<OAuth2ClientCredentialInputs, TInputs> & {
|
|
100
|
+
[key: string]: ConnectionTemplateInputField;
|
|
101
|
+
} : TTemplateComplement<OAuth2AuthorizationCodeInputs, TInputs> & {
|
|
102
|
+
[key: string]: ConnectionTemplateInputField;
|
|
103
|
+
});
|
|
27
104
|
interface OAuth2Config {
|
|
28
105
|
overrideGrantType?: string;
|
|
29
106
|
allowedTokenParams?: string[];
|
|
30
107
|
}
|
|
31
108
|
export interface OAuth2UrlOverrides {
|
|
109
|
+
/**
|
|
110
|
+
* Custom URI where users should be sent on OAuth success. See
|
|
111
|
+
* https://prismatic.io/docs/integrations/connections/oauth2/custom-redirects/
|
|
112
|
+
*/
|
|
32
113
|
oAuthSuccessRedirectUri?: string;
|
|
114
|
+
/**
|
|
115
|
+
* Custom URI where users should be sent on OAuth failure. See
|
|
116
|
+
* https://prismatic.io/docs/integrations/connections/oauth2/custom-redirects/
|
|
117
|
+
*/
|
|
33
118
|
oAuthFailureRedirectUri?: string;
|
|
34
119
|
}
|
|
35
120
|
interface OAuth2AuthorizationCodeConnectionDefinition extends BaseConnectionDefinition {
|
|
36
121
|
oauth2Type: OAuth2Type.AuthorizationCode;
|
|
37
122
|
oauth2Config?: OAuth2Config & OAuth2UrlOverrides;
|
|
38
|
-
/**
|
|
123
|
+
/**
|
|
124
|
+
* The PKCE method (S256 or plain) that this OAuth 2.0 connection uses (if any). See
|
|
125
|
+
* https://prismatic.io/docs/custom-connectors/connections/#supporting-pkce-with-oauth-20
|
|
126
|
+
*/
|
|
39
127
|
oauth2PkceMethod?: OAuth2PkceMethod;
|
|
40
|
-
inputs: {
|
|
41
|
-
authorizeUrl: ConnectionInput;
|
|
42
|
-
tokenUrl: ConnectionInput;
|
|
43
|
-
scopes: ConnectionInput;
|
|
44
|
-
clientId: ConnectionInput;
|
|
45
|
-
clientSecret: ConnectionInput;
|
|
128
|
+
inputs: OAuth2AuthorizationCodeInputs & {
|
|
46
129
|
[key: string]: ConnectionInput;
|
|
47
130
|
};
|
|
48
131
|
}
|
|
49
132
|
interface OAuth2ClientCredentialConnectionDefinition extends BaseConnectionDefinition {
|
|
50
133
|
oauth2Type: OAuth2Type.ClientCredentials;
|
|
51
134
|
oauth2Config?: OAuth2UrlOverrides;
|
|
52
|
-
inputs: {
|
|
53
|
-
tokenUrl: ConnectionInput;
|
|
54
|
-
scopes: ConnectionInput;
|
|
55
|
-
clientId: ConnectionInput;
|
|
56
|
-
clientSecret: ConnectionInput;
|
|
135
|
+
inputs: OAuth2ClientCredentialInputs & {
|
|
57
136
|
[key: string]: ConnectionInput;
|
|
58
137
|
};
|
|
59
138
|
}
|
|
@@ -1,9 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.OAuth2PkceMethod = exports.OAuth2Type = void 0;
|
|
7
|
+
exports.templateConnectionInputs = templateConnectionInputs;
|
|
8
|
+
const merge_1 = __importDefault(require("lodash/merge"));
|
|
4
9
|
var OAuth2Type;
|
|
5
10
|
(function (OAuth2Type) {
|
|
11
|
+
/**
|
|
12
|
+
* This connection uses the OAuth 2.0 client credentials flow. See
|
|
13
|
+
* https://prismatic.io/docs/integrations/connections/oauth2/client-credentials-grant-type/
|
|
14
|
+
*/
|
|
6
15
|
OAuth2Type["ClientCredentials"] = "client_credentials";
|
|
16
|
+
/**
|
|
17
|
+
* This connection uses the OAuth 2.0 auth code flow. See
|
|
18
|
+
* https://prismatic.io/docs/integrations/connections/oauth2/authorization-code-grant-type/
|
|
19
|
+
*/
|
|
7
20
|
OAuth2Type["AuthorizationCode"] = "authorization_code";
|
|
8
21
|
})(OAuth2Type || (exports.OAuth2Type = OAuth2Type = {}));
|
|
9
22
|
var OAuth2PkceMethod;
|
|
@@ -11,3 +24,6 @@ var OAuth2PkceMethod;
|
|
|
11
24
|
OAuth2PkceMethod["Plain"] = "plain";
|
|
12
25
|
OAuth2PkceMethod["S256"] = "S256";
|
|
13
26
|
})(OAuth2PkceMethod || (exports.OAuth2PkceMethod = OAuth2PkceMethod = {}));
|
|
27
|
+
function templateConnectionInputs(inputs, templateInputs, _authType) {
|
|
28
|
+
return (0, merge_1.default)(inputs, templateInputs);
|
|
29
|
+
}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
/** Contains attributes of the Customer for whom an Instance is being executed. */
|
|
2
2
|
export interface CustomerAttributes {
|
|
3
|
+
/** The programmatic ID of a customer. */
|
|
3
4
|
id: string;
|
|
5
|
+
/**
|
|
6
|
+
* The external ID you set for a customer. See
|
|
7
|
+
* https://prismatic.io/docs/customers/managing-customers/#customer-external-ids
|
|
8
|
+
*/
|
|
4
9
|
externalId: string;
|
|
10
|
+
/** The name of the customer. */
|
|
5
11
|
name: string;
|
|
6
12
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/** Binary data payload */
|
|
1
|
+
/** Binary data payload. */
|
|
2
2
|
export interface DataPayload {
|
|
3
|
-
/** Raw binary data as a Buffer */
|
|
3
|
+
/** Raw binary data as a Buffer. */
|
|
4
4
|
data: Buffer;
|
|
5
|
-
/** Content type of data contained within this payload */
|
|
5
|
+
/** Content type of data contained within this payload. */
|
|
6
6
|
contentType: string;
|
|
7
|
-
/** Suggested extension to use when writing the data */
|
|
7
|
+
/** Suggested extension to use when writing the data. */
|
|
8
8
|
suggestedExtension?: string;
|
|
9
9
|
}
|
|
@@ -1,19 +1,23 @@
|
|
|
1
1
|
import { ActionDisplayDefinition, DataSourcePerformFunction, Inputs, DataSourceType, ConfigVarResultCollection } from ".";
|
|
2
2
|
/**
|
|
3
3
|
* DataSourceDefinition is the type of the object that is passed in to `dataSource` function to
|
|
4
|
-
* define a
|
|
4
|
+
* define a data source. See
|
|
5
|
+
* https://prismatic.io/docs/custom-connectors/data-sources/
|
|
5
6
|
*/
|
|
6
7
|
export interface DataSourceDefinition<TInputs extends Inputs, TConfigVars extends ConfigVarResultCollection, TDataSourceType extends DataSourceType> {
|
|
7
|
-
/** Defines how the
|
|
8
|
+
/** Defines how the data source is displayed in the Prismatic UI. */
|
|
8
9
|
display: ActionDisplayDefinition;
|
|
9
|
-
/** Function to perform when this
|
|
10
|
+
/** Function to perform when this data source is invoked; fetches data from an external API and returns data to be presented in an integration config wizard UI. */
|
|
10
11
|
perform: DataSourcePerformFunction<TInputs, TConfigVars, TDataSourceType>;
|
|
11
|
-
/** The type of
|
|
12
|
+
/** The type of UI that will present the data the `perform` function returns. */
|
|
12
13
|
dataSourceType: TDataSourceType;
|
|
13
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* The inputs to present a low-code integration builder. Values of these inputs
|
|
16
|
+
* are passed to the `perform` function when the action is invoked.
|
|
17
|
+
*/
|
|
14
18
|
inputs: TInputs;
|
|
15
|
-
/** An example of the payload outputted by this
|
|
19
|
+
/** An example of the payload outputted by this data source. Must match the type of the object that the `perform` function returns. */
|
|
16
20
|
examplePayload?: Awaited<ReturnType<this["perform"]>>;
|
|
17
|
-
/** Specifies the name of a
|
|
21
|
+
/** Specifies the name of a data source in this component which can provide additional details about the content for this data source, such as example values when selecting particular API object fields. */
|
|
18
22
|
detailDataSource?: string;
|
|
19
23
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Inputs, DataSourceResult, DataSourceType, ActionInputParameters, ConfigVarResultCollection, ActionContext } from ".";
|
|
2
|
-
/** Context provided to perform method containing helpers and contextual data */
|
|
2
|
+
/** Context provided to perform method containing helpers and contextual data. */
|
|
3
3
|
export type DataSourceContext<TConfigVars extends ConfigVarResultCollection = ConfigVarResultCollection> = Pick<ActionContext<TConfigVars>, "logger" | "customer" | "instance" | "user" | "configVars">;
|
|
4
4
|
/** Definition of the function to perform when a Data Source is invoked. */
|
|
5
5
|
export type DataSourcePerformFunction<TInputs extends Inputs, TConfigVars extends ConfigVarResultCollection, TDataSourceType extends DataSourceType> = (context: DataSourceContext<TConfigVars>, params: ActionInputParameters<TInputs>) => Promise<DataSourceResult<TDataSourceType>>;
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
/** Represents an HTTP Response, which are required for some Triggers. */
|
|
2
2
|
export interface HttpResponse {
|
|
3
|
+
/**
|
|
4
|
+
* HTTP status code to return from a trigger. See
|
|
5
|
+
* https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status.
|
|
6
|
+
*/
|
|
3
7
|
statusCode: number;
|
|
8
|
+
/** The MIME type (`content-type` header) of the trigger's response. */
|
|
4
9
|
contentType: string;
|
|
10
|
+
/** Custom headers to return in the trigger's response. */
|
|
5
11
|
headers?: {
|
|
6
12
|
[key: string]: string;
|
|
7
13
|
};
|
|
14
|
+
/** The trigger's response body. When omitted, defaults to `{ "executionId": "SOME-ID" }` */
|
|
8
15
|
body?: string;
|
|
9
16
|
}
|