@prismatic-io/spectral
Advanced tools
Comparing version 5.0.0-rc.1 to 5.0.0-rc.2
@@ -10,3 +10,3 @@ /** | ||
*/ | ||
import { ActionDefinition, InputFieldDefinition, ActionPerformReturn, ComponentDefinition, ConnectionDefinition, Inputs, TriggerDefinition, TriggerResult } from "./types"; | ||
import { ActionDefinition, InputFieldDefinition, ActionPerformReturn, ComponentDefinition, DefaultConnectionDefinition, OAuth2ConnectionDefinition, Inputs, TriggerDefinition, TriggerResult } from "./types"; | ||
import { Component } from "./types/server-types"; | ||
@@ -53,6 +53,13 @@ /** | ||
* https://prismatic.io/docs/custom-components/writing-custom-components/#adding-connections. | ||
* @param definition A ConnectionfieldDefinition object that describes the type of a connection for a custom component action or trigger, and information on how it should be displayed in the Prismatic WebApp. | ||
* @param definition A DefaultConnectionDefinition object that describes the type of a connection for a custom component action or trigger, and information on how it should be displayed in the Prismatic WebApp. | ||
* @returns This functions validates the shape of the `definition` object provided and returns the same connection object. | ||
*/ | ||
export declare const connection: <T extends ConnectionDefinition>(definition: T) => T; | ||
export declare const connection: <T extends DefaultConnectionDefinition>(definition: T) => T; | ||
/** | ||
* For information on writing custom component connections, see | ||
* https://prismatic.io/docs/custom-components/writing-custom-components/#adding-connections. | ||
* @param definition An OAuth2ConnectionDefinition object that describes the type of a connection for a custom component action or trigger, and information on how it should be displayed in the Prismatic WebApp. | ||
* @returns This functions validates the shape of the `definition` object provided and returns the same connection object. | ||
*/ | ||
export declare const oauth2Connection: <T extends OAuth2ConnectionDefinition>(definition: T) => T; | ||
export { default as util } from "./util"; | ||
@@ -59,0 +66,0 @@ export * from "./types"; |
@@ -21,3 +21,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.testing = exports.util = exports.connection = exports.input = exports.trigger = exports.action = exports.component = void 0; | ||
exports.testing = exports.util = exports.oauth2Connection = exports.connection = exports.input = exports.trigger = exports.action = exports.component = void 0; | ||
const convertInput = (key, input) => (Object.assign(Object.assign({}, input), { key })); | ||
@@ -102,3 +102,3 @@ /** | ||
* https://prismatic.io/docs/custom-components/writing-custom-components/#adding-connections. | ||
* @param definition A ConnectionfieldDefinition object that describes the type of a connection for a custom component action or trigger, and information on how it should be displayed in the Prismatic WebApp. | ||
* @param definition A DefaultConnectionDefinition object that describes the type of a connection for a custom component action or trigger, and information on how it should be displayed in the Prismatic WebApp. | ||
* @returns This functions validates the shape of the `definition` object provided and returns the same connection object. | ||
@@ -108,2 +108,10 @@ */ | ||
exports.connection = connection; | ||
/** | ||
* For information on writing custom component connections, see | ||
* https://prismatic.io/docs/custom-components/writing-custom-components/#adding-connections. | ||
* @param definition An OAuth2ConnectionDefinition object that describes the type of a connection for a custom component action or trigger, and information on how it should be displayed in the Prismatic WebApp. | ||
* @returns This functions validates the shape of the `definition` object provided and returns the same connection object. | ||
*/ | ||
const oauth2Connection = (definition) => definition; | ||
exports.oauth2Connection = oauth2Connection; | ||
var util_1 = require("./util"); | ||
@@ -110,0 +118,0 @@ Object.defineProperty(exports, "util", { enumerable: true, get: function () { return __importDefault(util_1).default; } }); |
@@ -1,9 +0,41 @@ | ||
import { ConnectionInputs, OAuth2Type } from "."; | ||
export interface ConnectionDefinition { | ||
import { ConnectionInput } from "."; | ||
export declare enum OAuth2Type { | ||
ClientCredentials = "client_credentials", | ||
AuthorizationCode = "authorization_code" | ||
} | ||
interface BaseConnectionDefinition { | ||
key: string; | ||
label: string; | ||
comments?: string; | ||
iconPath?: string; | ||
oauth2Type?: OAuth2Type; | ||
iconPath?: string; | ||
inputs: ConnectionInputs; | ||
} | ||
export interface DefaultConnectionDefinition extends BaseConnectionDefinition { | ||
inputs: { | ||
[key: string]: ConnectionInput; | ||
}; | ||
} | ||
interface OAuth2AuthorizationCodeConnectionDefinition extends BaseConnectionDefinition { | ||
oauth2Type: OAuth2Type.AuthorizationCode; | ||
inputs: { | ||
authorizeUrl: ConnectionInput; | ||
tokenUrl: ConnectionInput; | ||
scopes: ConnectionInput; | ||
clientId: ConnectionInput; | ||
clientSecret: ConnectionInput; | ||
[key: string]: ConnectionInput; | ||
}; | ||
} | ||
interface OAuth2ClientCredentialConnectionDefinition extends BaseConnectionDefinition { | ||
oauth2Type: OAuth2Type.ClientCredentials; | ||
inputs: { | ||
tokenUrl: ConnectionInput; | ||
scopes: ConnectionInput; | ||
clientId: ConnectionInput; | ||
clientSecret: ConnectionInput; | ||
[key: string]: ConnectionInput; | ||
}; | ||
} | ||
export declare type OAuth2ConnectionDefinition = OAuth2AuthorizationCodeConnectionDefinition | OAuth2ClientCredentialConnectionDefinition; | ||
export declare type ConnectionDefinition = DefaultConnectionDefinition | OAuth2AuthorizationCodeConnectionDefinition | OAuth2ClientCredentialConnectionDefinition; | ||
export {}; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.OAuth2Type = void 0; | ||
var OAuth2Type; | ||
(function (OAuth2Type) { | ||
OAuth2Type["ClientCredentials"] = "client_credentials"; | ||
OAuth2Type["AuthorizationCode"] = "authorization_code"; | ||
})(OAuth2Type = exports.OAuth2Type || (exports.OAuth2Type = {})); |
import { InputFieldType } from "."; | ||
export declare type Inputs = Record<string, InputFieldDefinition>; | ||
export declare type ConnectionInputs = Record<string, DefaultInputFieldDefinition & { | ||
export declare type ConnectionInput = DefaultInputFieldDefinition & { | ||
shown?: boolean; | ||
}>; | ||
}; | ||
export declare type InputFieldDefinition = DefaultInputFieldDefinition | CodeInputFieldDefinition; | ||
@@ -34,6 +34,2 @@ interface BaseInputFieldDefinition { | ||
} | ||
export declare enum OAuth2Type { | ||
ClientCredentials = "client_credentials", | ||
AuthorizationCode = "authorization_code" | ||
} | ||
export interface Connection { | ||
@@ -40,0 +36,0 @@ /** Key of the Connection type. */ |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.OAuth2Type = void 0; | ||
var OAuth2Type; | ||
(function (OAuth2Type) { | ||
OAuth2Type["ClientCredentials"] = "client_credentials"; | ||
OAuth2Type["AuthorizationCode"] = "authorization_code"; | ||
})(OAuth2Type = exports.OAuth2Type || (exports.OAuth2Type = {})); |
{ | ||
"name": "@prismatic-io/spectral", | ||
"version": "5.0.0-rc.1", | ||
"version": "5.0.0-rc.2", | ||
"description": "Utility library for building Prismatic components", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
101019
1859