@integration-app/sdk
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "@integration-app/sdk", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "JavaScript SDK for Integration.app", | ||
@@ -22,3 +22,3 @@ "author": "Integration.app", | ||
"cleanPrevVersionFiles": "find . -type f \\( -name \"*.js\" -o -name \"*.d.ts\" -o -name \"*.js.map\" \\) -not -name \".eslintrc.js\" -not -path \"./node_modules/*\" -exec rm {} \\;", | ||
"clean": "rimraf ./dist ./bundle.js* ./bundle.d.ts", | ||
"clean": "rimraf --glob ./dist ./bundle.js* ./bundle.d.ts", | ||
"docs": "typedoc --plugin typedoc-plugin-missing-exports --tsconfig tsconfig.json", | ||
@@ -25,0 +25,0 @@ "docs:dev": "typedoc --plugin typedoc-plugin-missing-exports --tsconfig tsconfig.json --watch", |
export enum ConnectorCopilotSuggestionType { | ||
AuthType = 'auth-type', | ||
AuthImplementation = 'auth-implementation', | ||
AuthConnectionParameters = 'auth-connection-parameters', | ||
@@ -49,4 +50,5 @@ AuthApiClient = 'auth-api-client', | ||
AuthType = 'auth-type', | ||
AuthImplementation = 'auth-implementation', | ||
AuthConnectionParameters = 'auth-connection-parameters', | ||
AuthApiClient = 'auth-api-client', | ||
} |
@@ -16,2 +16,3 @@ import { ConnectorSpec } from '.' | ||
export type ConnectorAuthType = typeof CONNECTOR_AUTH_TYPES[number] | ||
export type ConnectorAuthOptions = { key: string; title?: string }[] | ||
@@ -149,2 +150,3 @@ interface ConnectorAuthMethodArgs { | ||
export interface ConnectorAuthBase { | ||
title?: string | ||
type: ConnectorAuthType | ||
@@ -184,3 +186,3 @@ credentialsSchema?: DataSchema | ||
export type ConnectorAuth = | ||
export type ConnectorAuth = ( | ||
| ConnectorAuthOAuth2 | ||
@@ -190,2 +192,14 @@ | ConnectorAuthOAuth1 | ||
| ConnectorAuthIntegrationAppToken | ||
) & { | ||
options?: { | ||
[key: string]: ( | ||
| ConnectorAuthOAuth2 | ||
| ConnectorAuthOAuth1 | ||
| ConnectorAuthClientCredentials | ||
| ConnectorAuthIntegrationAppToken | ||
) & { | ||
enabled?: any | ||
} | ||
} | ||
} | ||
@@ -232,4 +246,11 @@ export interface ConnectorAuthOAuth2Config { | ||
clientSecret: { type: 'string' }, | ||
authorizeUri: { type: 'string' }, | ||
tokenUri: { type: 'string' }, | ||
authorizeUri: { | ||
type: 'string', | ||
description: | ||
'URL to redirect user to when starting the authentication process', | ||
}, | ||
tokenUri: { | ||
type: 'string', | ||
description: 'URL used to exchnage code for access token', | ||
}, | ||
scopes: { type: 'array', items: { type: 'string' } }, | ||
@@ -240,10 +261,14 @@ clientAuthLocation: { | ||
default: 'headers', | ||
description: | ||
'Whether to send clientId and clientSecret in the request body or headers (different apps expect it in different places)', | ||
}, | ||
noRefreshToken: { | ||
type: 'boolean', | ||
description: 'Do not expect refresh_token in the token response', | ||
description: | ||
'Do not expect refresh_token in the token response. Use this if application does not support refresh tokens.', | ||
}, | ||
skipPkce: { | ||
type: 'boolean', | ||
description: 'Skip sending PKCE parameters in the token request', | ||
description: | ||
'Skip sending PKCE parameters in the token request. Some authentication processes error if PKCE is enabled.', | ||
}, | ||
@@ -253,3 +278,4 @@ extra: { | ||
additionalProperties: true, | ||
description: 'Additional parameters in the request query parameters', | ||
description: | ||
'Any additional parameters in the request query parameters that are not covered by the oAuth2 standard.', | ||
}, | ||
@@ -256,0 +282,0 @@ skipClientAuthInBody: { |
@@ -50,2 +50,3 @@ import { DataSchema } from '../data-schema' | ||
isReadOnly?: boolean | ||
workspaceId?: string | ||
} | ||
@@ -52,0 +53,0 @@ |
@@ -15,3 +15,2 @@ import { Integration } from '../integrations' | ||
APP_EVENT_TYPE = 'app-event-type', | ||
APP_DATA_COLLECTION = 'app-data-collection', | ||
DATA_SOURCE = 'data-source', | ||
@@ -18,0 +17,0 @@ SCHEMA = 'schema', |
@@ -199,7 +199,13 @@ import { IntegrationAppError } from '../errors' | ||
async connect(options?: ConnectOptions): Promise<Connection | undefined> { | ||
const { parameters, allowMultipleConnections } = options ?? {} | ||
const { parameters, allowMultipleConnections, authOptionKey } = | ||
options ?? {} | ||
const integration = await this.get() | ||
const connectorSpec = await this.getConnectorSpec() | ||
const isIframe = integration.authType === 'client-credentials' | ||
const authSpec = authOptionKey | ||
? connectorSpec.auth?.options?.[authOptionKey] | ||
: connectorSpec.auth | ||
const isIframe = authSpec?.type === 'client-credentials' | ||
let iframeElement | ||
@@ -218,3 +224,3 @@ if (isIframe) { | ||
parameters ? encodeURIComponent(JSON.stringify(parameters)) : '' | ||
}`, | ||
}&authOptionKey=${authOptionKey ?? ''}`, | ||
) | ||
@@ -221,0 +227,0 @@ |
import { Connection } from '../connections' | ||
import { ConnectorAuthType, ConnectorSpec } from '../connectors' | ||
import { | ||
ConnectorAuthOptions, | ||
ConnectorAuthType, | ||
ConnectorSpec, | ||
} from '../connectors' | ||
import { DataSchema } from '../data-schema' | ||
@@ -37,2 +41,4 @@ | ||
authOptions?: ConnectorAuthOptions | ||
oAuthCallbackUri?: string | ||
@@ -83,3 +89,4 @@ | ||
parameters?: any | ||
authOptionKey?: string | ||
allowMultipleConnections?: boolean | ||
} |
@@ -22,3 +22,5 @@ import { structuredClone } from '../_helper' | ||
import deals from './deals' | ||
import documents from './documents' | ||
import drives from './drives' | ||
import driveItems from './drive-items' | ||
import eeocs from './eeocs' | ||
@@ -63,3 +65,5 @@ import emails from './emails' | ||
DEALS = 'deals', | ||
DOCUMENTS = 'documents', | ||
DRIVES = 'drives', | ||
DRIVE_ITEMS = 'drive-items', | ||
EEOCS = 'eeocs', | ||
@@ -103,3 +107,5 @@ EMAILS = 'emails', | ||
[UDM.DEALS]: deals, | ||
[UDM.DOCUMENTS]: documents, | ||
[UDM.DRIVES]: drives, | ||
[UDM.DRIVE_ITEMS]: driveItems, | ||
[UDM.EEOCS]: eeocs, | ||
@@ -106,0 +112,0 @@ [UDM.EMAILS]: emails, |
@@ -23,3 +23,6 @@ import { PaginationQuery, SearchQuery } from '../entity-repository' | ||
export type FindCustomersQuery = PaginationQuery & SearchQuery | ||
export type FindCustomersQuery = PaginationQuery & | ||
SearchQuery & { | ||
isTest?: boolean | ||
} | ||
@@ -26,0 +29,0 @@ export type CustomerSelector = { id: string } |
@@ -96,2 +96,25 @@ import { CreateActionRequest } from '../actions' | ||
export enum WorkspaceElementType { | ||
Flow = 'flow', | ||
FlowInstance = 'flow-instance', | ||
FlowRun = 'flow-run', | ||
Action = 'action', | ||
Scenario = 'scenario', | ||
ActionInstance = 'action-instance', | ||
Connection = 'connection', | ||
FieldMapping = 'field-mapping', | ||
FieldMappingInstance = 'field-mapping-instance', | ||
DataSource = 'data-source', | ||
DataSourceInstance = 'data-source-instance', | ||
DataLinkTable = 'data-link-table', | ||
DataLinkTableInstance = 'data-link-table-instance', | ||
AppEventType = 'app-event-type', | ||
AppEventSubscription = 'app-event-subscription', | ||
AppDataSchema = 'app-data-schema', | ||
AppDataSchemaInstance = 'app-data-schema-instance', | ||
ExternalEventSubscription = 'external-event-subscription', | ||
ExternalEventLogRecord = 'external-event-log-record', | ||
ExternalEventPull = 'external-event-pull', | ||
} | ||
export enum WorkspaceEventType { | ||
@@ -98,0 +121,0 @@ ConnectionCreated = 'connection.created', |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
4884116
295
78918