Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@integration-app/sdk

Package Overview
Dependencies
Maintainers
4
Versions
444
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@integration-app/sdk - npm Package Compare versions

Comparing version 0.16.72 to 0.16.73

src/connections/types.ts

213

bundle.d.ts

@@ -48,2 +48,3 @@ import { AxiosRequestConfig } from 'axios';

ACTION_RUN = "action_run",
ACTION_INSTANCE_SETUP = "action_instance_setup",
UNIT_RUN = "unit_run"

@@ -68,17 +69,2 @@ }

declare enum HttpRequestMethod {
GET = "GET",
POST = "POST",
PATCH = "PATCH",
PUT = "PUT",
DELETE = "DELETE"
}
interface HttpRequestSpec {
method?: HttpRequestMethod;
uri: any;
headers?: Record<string, any>;
query?: Record<string, any>;
body?: any;
}
interface SearchQuery {

@@ -102,5 +88,6 @@ search?: string;

autoCreate?: boolean;
instanceKey?: string;
userId?: string;
parentKey?: string;
parentId?: string;
instanceKey?: string;
}

@@ -193,6 +180,18 @@ interface IntegrationSpecificElementSelector {

lastActiveAt?: string;
isTest?: boolean;
}
type CreateAppDataSchemaRequest = Omit<AppDataSchema, 'id' | 'userId'>;
type UpdateAppDataSchemaRequest = CreateAppDataSchemaRequest;
type CreateAppDataSchemaRequest = {
key: string;
name: string;
schema?: any;
code?: string;
};
type UpdateAppDataSchemaRequest = {
key?: string;
name?: string;
schema?: any;
code?: string;
archivedAt?: string;
};
interface FindAppDataSchemasQuery extends PaginationQuery {

@@ -207,9 +206,10 @@ }

}
interface IAppDataSchemaInstanceUpdate {
interface UpdateAppDataSchemaInstanceRequest {
}
interface CreateAppDataSchemaInstanceRequest {
}
interface FindAppDataSchemaInstancesQuery extends PaginationQuery {
id?: string;
userId?: string;
appDataSchemaId?: string;
connectionId?: string;
integrationId?: string;
instanceKey?: string;

@@ -227,4 +227,6 @@ }

}
declare class AppDataSchemaInstanceAccessor extends ElementInstanceAccessor<AppDataSchemaInstance, AppDataSchemaInstanceSelector, IAppDataSchemaInstanceUpdate, IAppDataSchemaInstanceUpdate> {
declare class AppDataSchemaInstanceAccessor extends ElementInstanceAccessor<AppDataSchemaInstance, AppDataSchemaInstanceSelector, UpdateAppDataSchemaInstanceRequest, CreateAppDataSchemaInstanceRequest> {
private client;
constructor(client: IntegrationAppApiClient, selector: string | AppDataSchemaInstanceSelector);
setup(): Promise<void>;
}

@@ -237,4 +239,5 @@

schema: any;
request?: HttpRequestSpec;
code?: string;
archivedAt?: string;
revision?: string;
}

@@ -247,2 +250,3 @@ interface AppDataSchemaInstance {

appDataSchemaId: string;
appDataSchemaRevision: string;
appDataSchema?: AppDataSchema;

@@ -252,2 +256,3 @@ instanceKey?: string;

error?: ErrorData;
archivedAt?: string;
}

@@ -289,3 +294,3 @@

referenceCollection?: {
key: string;
key: any;
parameters?: Record<string, any>;

@@ -347,2 +352,17 @@ };

declare enum HttpRequestMethod {
GET = "GET",
POST = "POST",
PATCH = "PATCH",
PUT = "PUT",
DELETE = "DELETE"
}
interface HttpRequestSpec {
method?: HttpRequestMethod;
uri: any;
headers?: Record<string, any>;
query?: Record<string, any>;
body?: any;
}
interface RestApiMapping {

@@ -399,2 +419,3 @@ path: string;

credentialsSchema?: DataSchema;
makeApiClient?: ConnectorMethodImplementationBase;
refreshCredentials?: ConnectorMethodImplementationBase;

@@ -590,2 +611,3 @@ test?: ConnectorMethodImplementationBase;

CONTACTS = "contacts",
CREDIT_NOTES = "credit-notes",
CUSTOMERS = "customers",

@@ -596,3 +618,3 @@ DEAL_PRODUCTS = "deal-products",

INVOICES = "invoices",
INVOICES_LINE_ITEMS = "invoice-line-items",
JOURNAL_ENTRIES = "journal-entries",
LEADS = "leads",

@@ -609,3 +631,5 @@ LEDGER_ACCOUNTS = "ledger-accounts",

TAX_RATES = "tax-rates",
USERS = "users"
USERS = "users",
FILES = "files",
DRIVES = "drives"
}

@@ -681,2 +705,3 @@

hasUdm?: boolean;
hasAuth?: boolean;
}

@@ -732,2 +757,4 @@ type AppliedToIntegrations<Element> = {

getOperation(key: string): Promise<OperationSpec>;
getDataCollections(): Promise<DataLocationListItem[]>;
getDataCollection(key: string): Promise<DataLocationSpec>;
getDataLocations(): Promise<DataLocationListItem[]>;

@@ -770,3 +797,3 @@ getDataLocation(key: string): Promise<DataLocationSpec>;

archive(): Promise<void>;
request(path: any, data?: any): Promise<any>;
request(path: any, data?: null): Promise<any>;
get proxy(): ConnectionProxy;

@@ -803,2 +830,3 @@ operation(key: string): ConnectionOperationAccessor;

constructor(client: IntegrationAppApiClient, connectionAccessor: ConnectionAccessor, key: string, parameters: Record<string, any>);
get(): Promise<DataCollectionSpec>;
findById(request?: DataCollectionFindByIdRequest): Promise<DataCollectionFindByIdResponse>;

@@ -853,3 +881,4 @@ list(request?: DataCollectionListRequest): Promise<DataCollectionListResponse>;

FLOW = "flow",
INTEGRATION = "integration"
INTEGRATION = "integration",
ACTION = "action"
}

@@ -869,2 +898,3 @@ interface IntegrationElementInstance {

DeleteDataRecord = "delete-data-record",
SearchDataRecords = "search-data-record",
ConnectorOperation = "connector-operation",

@@ -896,4 +926,6 @@ ApiRequestToExternalApp = "api-request-to-external-app",

config?: any;
outputMapping?: any;
customOutputSchema?: DataSchema;
defaultOutputSchema?: DataSchema;
outputMapping?: any;
transformedOutputSchema?: DataSchema;
outputSchema?: DataSchema;

@@ -932,2 +964,3 @@ isConfigurationMissing?: boolean;

isCustomized?: boolean;
isOutdated?: boolean;
state: ActionInstanceState;

@@ -962,2 +995,4 @@ errors?: ErrorData[];

interface FindActionInstancesQuery extends PaginationQuery {
integrationKey?: string;
integrationId?: string;
userId?: string;

@@ -1003,38 +1038,2 @@ connectionId?: string;

declare enum WorkspaceOnboardingStep {
AddConnectors = "add-connectors",
ConnectYourApp = "connect-your-app",
BuildIntegrations = "build-integrations",
Completed = "completed"
}
interface Workspace {
id: string;
key: string;
secret: string;
name: string;
engineId: string;
engine?: {
id: string;
apiUri: string;
uiUri: string;
};
engineAccessToken?: string;
createdAt: Date;
updatedAt: Date;
onboardingStep?: WorkspaceOnboardingStep;
trialEndDate?: string;
}
declare class SelfAccessor {
private client;
constructor(client: IntegrationAppApiClient);
get(): Promise<Self>;
patch(data: Partial<Self>): Promise<Self>;
}
interface Self {
user: User;
workspace: Workspace;
}
type CreateDataLinkTableRequest = Omit<DataLinkTable, 'id' | 'userId'>;

@@ -1309,2 +1308,4 @@ type UpdateDataLinkTableRequest = CreateDataLinkTableRequest;

dataSourceInstanceId?: string;
integrationKey?: string;
integrationId?: string;
}

@@ -1465,2 +1466,3 @@ interface UpdateFieldMappingRequest {

declare enum FlowDependencyType {
Action = "Action",
FieldMapping = "FieldMapping",

@@ -1540,2 +1542,4 @@ DataSource = "DataSource",

connectionId?: string;
integrationKey?: string;
integrationId?: string;
}

@@ -1693,2 +1697,32 @@ interface CreateDataSourceInstanceRequest {

declare enum WorkspaceOnboardingStep {
AddConnectors = "add-connectors",
ConnectYourApp = "connect-your-app",
BuildIntegrations = "build-integrations",
Completed = "completed"
}
interface Workspace {
id: string;
key: string;
secret: string;
name: string;
engineAccessToken?: string;
createdAt: Date;
updatedAt: Date;
onboardingStep?: WorkspaceOnboardingStep;
trialEndDate?: string;
}
declare class SelfAccessor {
private client;
constructor(client: IntegrationAppApiClient);
get(): Promise<Self>;
patch(data: Partial<Self>): Promise<Self>;
}
interface Self {
user: User;
workspace: Workspace;
}
declare enum ScreenType {

@@ -1738,7 +1772,15 @@ Integration = "integration"

type CreateAppEventTypeRequest = Omit<AppEventType, 'id' | 'userId'>;
type UpdateAppEventTypeRequest = CreateAppEventTypeRequest;
interface FindAppEventTypesQuery extends PaginationQuery {
interface UpdateAppEventTypeRequest {
key?: string;
name?: string;
subscribeRequest?: HttpRequestSpec;
example?: any;
schema?: DataSchema;
userIdFormula?: any;
}
interface AppEventSubscriptionSelector extends ElementInstanceSelector {
interface CreateAppEventTypeRequest extends UpdateAppEventTypeRequest {
key: string;
name: string;
}
interface AppEventSubscriptionSelector extends Omit<ElementInstanceSelector, 'parentKey' | 'parentId'> {
appEventTypeKey?: string;

@@ -1748,11 +1790,23 @@ appEventTypeId?: string;

}
interface IAppEventSubscriptionUpdate {
interface AppEventSubscriptionUpdateRequest {
}
interface FindAppEventTypesQuery extends PaginationQuery {
includeArchived?: boolean;
}
interface FindAppEventSubscriptionsQuery extends PaginationQuery {
id?: string;
userId?: string;
instanceKey?: string;
appEventTypeId?: string;
instanceKey?: string;
isSubscribed?: boolean;
}
interface FindAppEventsQuery extends PaginationQuery {
id?: string;
userId?: string;
instanceKey?: string;
appEventTypeId?: string;
appEventSubscriptionId?: string;
startDatetime?: string;
endDatetime?: string;
}

@@ -1764,3 +1818,2 @@ declare class AppEventTypesAccessor extends ElementListAccessor<AppEventType, FindAppEventTypesQuery, CreateAppEventTypeRequest> {

constructor(client: IntegrationAppApiClient, idOrKey: string);
publish(): Promise<any>;
}

@@ -1770,3 +1823,3 @@ declare class AppEventSubscriptionsAccessor extends ElementInstanceListAccessor<AppEventSubscription, FindAppEventSubscriptionsQuery> {

}
declare class AppEventSubscriptionAccessor extends ElementInstanceAccessor<AppEventSubscription, AppEventSubscriptionSelector, IAppEventSubscriptionUpdate, IAppEventSubscriptionUpdate> {
declare class AppEventSubscriptionAccessor extends ElementInstanceAccessor<AppEventSubscription, AppEventSubscriptionSelector, AppEventSubscriptionUpdateRequest, AppEventSubscriptionUpdateRequest> {
constructor(client: IntegrationAppApiClient, selector: string | AppEventSubscriptionSelector);

@@ -1784,9 +1837,8 @@ subscribe(): Promise<void>;

revision: string;
publishedRevision?: string;
archivedAt?: string;
subscribeRequest?: HttpRequestSpec;
example?: any;
schema?: any;
schema?: DataSchema;
globalWebhookUri: string;
userIdFormula?: any;
archivedAt?: string;
}

@@ -1820,11 +1872,2 @@ interface AppEventSubscription {

}
interface FindAppEventsQuery extends PaginationQuery {
id?: string;
userId?: string;
appEventTypeId?: string;
appEventSubscriptionId?: string;
startDatetime?: string;
endDatetime?: string;
instanceKey?: string;
}

@@ -1831,0 +1874,0 @@ interface OpenIntegrationAppConfigurationOptions extends OpenConfigurationOptions {

{
"name": "@integration-app/sdk",
"version": "0.16.72",
"version": "0.16.73",
"description": "JavaScript SDK for Integration.app",

@@ -50,8 +50,8 @@ "author": "Integration.app",

"ts-node": "^10.2.0",
"typedoc": "^0.24.6",
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "^5.0.4"
"typedoc": "^0.25.4",
"typedoc-plugin-missing-exports": "^2.1.0",
"typescript": "^5.2.2"
},
"dependencies": {
"@sinclair/typebox": "^0.28.6",
"@sinclair/typebox": "^0.31.28",
"@types/node": "^18.16.2",

@@ -58,0 +58,0 @@ "@ungap/structured-clone": "^1.1.0",

@@ -7,3 +7,4 @@ import structuredClonePolyfill from '@ungap/structured-clone'

export const structuredClone: StructuredCloneType =
// @ts-ignore
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2339): Property 'default' does not exist on type '<T exte... Remove this comment to see the full error message
structuredClonePolyfill?.default || structuredClonePolyfill

@@ -10,0 +11,0 @@

@@ -12,5 +12,7 @@ import qs from 'qs'

autoCreate?: boolean
instanceKey?: string
userId?: string
parentKey?: string
parentId?: string
instanceKey?: string
}

@@ -74,2 +76,4 @@

async find(query?: FindQuery): Promise<PaginationResponse<Element>> {
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'FindQuery | undefined' is not... Remove this comment to see the full error message
return this.client.get(this.path, query)

@@ -115,2 +119,4 @@ }

async find(query?: FindQuery): Promise<PaginationResponse<ElementInstance>> {
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'FindQuery | undefined' is not... Remove this comment to see the full error message
return this.client.get(this.path, query)

@@ -128,2 +134,4 @@ }

> {
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2564): Property 'id' has no initializer and is not defini... Remove this comment to see the full error message
private id: string

@@ -130,0 +138,0 @@

@@ -111,4 +111,6 @@ import {

/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2322): Type '(() => void) | undefined' is not assignable ... Remove this comment to see the full error message
return openIframe(uri, { onClose })
}
}

@@ -6,4 +6,2 @@ import { ActionType } from './types'

export const DEFAULT_ACTION_OUTPUT_MAPPING = { $var: 'output' }
/**

@@ -10,0 +8,0 @@ * Returns true if action type requires data collections

@@ -22,5 +22,4 @@ import {

DeleteDataRecord = 'delete-data-record',
SearchDataRecords = 'search-data-record',
// SearchDataRecord = 'search-data-record',
ConnectorOperation = 'connector-operation',

@@ -63,11 +62,21 @@

outputMapping?: any
/**
* calculated from config
* defined by user
*/
customOutputSchema?: DataSchema
/**
* calculated from action implementation
*/
defaultOutputSchema?: DataSchema
outputMapping?: any
/**
* calculated schema from `defaultOutputSchema` and outputMapping
*/
transformedOutputSchema?: DataSchema
/**
* calculated from outputMapping and defaultOutputSchema
* calculated from `customOutputSchema` or `parent.customOutputSchema` or `transformedOutputSchema` or `defaultOutputSchema` in this exact order.
*/

@@ -141,2 +150,4 @@ outputSchema?: DataSchema

isOutdated?: boolean
state: ActionInstanceState

@@ -190,2 +201,6 @@

export interface FindActionInstancesQuery extends PaginationQuery {
integrationKey?: string
integrationId?: string
userId?: string

@@ -192,0 +207,0 @@

@@ -28,2 +28,4 @@ import axios, { AxiosRequestConfig } from 'axios'

public uiUri?: string
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2564): Property 'token' has no initializer and is not def... Remove this comment to see the full error message
public token: string

@@ -30,0 +32,0 @@

@@ -1,3 +0,8 @@

import { AppDataSchema, AppDataSchemaInstance } from '.'
import {
AppDataSchema,
AppDataSchemaInstance,
CreateAppDataSchemaInstanceRequest,
UpdateAppDataSchemaInstanceRequest,
} from '.'
import {
ElementAccessor,

@@ -14,3 +19,2 @@ ElementInstanceAccessor,

FindAppDataSchemasQuery,
IAppDataSchemaInstanceUpdate,
UpdateAppDataSchemaRequest,

@@ -54,7 +58,7 @@ } from './api'

AppDataSchemaInstanceSelector,
IAppDataSchemaInstanceUpdate,
IAppDataSchemaInstanceUpdate
UpdateAppDataSchemaInstanceRequest,
CreateAppDataSchemaInstanceRequest
> {
constructor(
client: IntegrationAppApiClient,
private client: IntegrationAppApiClient,
selector: string | AppDataSchemaInstanceSelector,

@@ -68,2 +72,6 @@ ) {

}
async setup(): Promise<void> {
await this.client.post(this.getPath('setup'))
}
}

@@ -1,8 +0,25 @@

import { AppDataSchema } from '.'
import { PaginationQuery } from '../entity-repository'
export type CreateAppDataSchemaRequest = Omit<AppDataSchema, 'id' | 'userId'>
export type CreateAppDataSchemaRequest = {
key: string
export type UpdateAppDataSchemaRequest = CreateAppDataSchemaRequest
name: string
schema?: any
code?: string
}
export type UpdateAppDataSchemaRequest = {
key?: string
name?: string
schema?: any
code?: string
archivedAt?: string
}
export interface FindAppDataSchemasQuery extends PaginationQuery {}

@@ -12,16 +29,21 @@

id?: string
appDataSchemaKey?: string
appDataSchemaId?: string
instanceKey?: string
autoCreate?: boolean
}
export interface IAppDataSchemaInstanceUpdate {}
export interface UpdateAppDataSchemaInstanceRequest {}
export interface CreateAppDataSchemaInstanceRequest {}
export interface FindAppDataSchemaInstancesQuery extends PaginationQuery {
id?: string
userId?: string
appDataSchemaId?: string
connectionId?: string
integrationId?: string
instanceKey?: string
}
import { ErrorData } from '../errors'
import { HttpRequestSpec } from '../http-requests'
import { User } from '../users'

@@ -17,5 +16,7 @@

request?: HttpRequestSpec
code?: string
code?: string
archivedAt?: string
revision?: string
}

@@ -34,2 +35,4 @@

appDataSchemaRevision: string
appDataSchema?: AppDataSchema

@@ -42,2 +45,4 @@

error?: ErrorData
archivedAt?: string
}

@@ -19,3 +19,3 @@ import {

FindAppEventTypesQuery,
IAppEventSubscriptionUpdate,
AppEventSubscriptionUpdateRequest,
UpdateAppEventTypeRequest,

@@ -45,6 +45,2 @@ } from './api'

}
async publish() {
return this.options.client.post(this.getPath('publish'))
}
}

@@ -64,4 +60,4 @@

AppEventSubscriptionSelector,
IAppEventSubscriptionUpdate,
IAppEventSubscriptionUpdate
AppEventSubscriptionUpdateRequest,
AppEventSubscriptionUpdateRequest
> {

@@ -80,4 +76,3 @@ constructor(

async subscribe(): Promise<void> {
const id = await this.getId()
return this.options.client.post(`app-event-subscriptions/${id}/subscribe`)
return this.options.client.post(this.getPath('subscribe'))
}

@@ -84,0 +79,0 @@ }

@@ -1,12 +0,28 @@

import { AppEventType } from '.'
import { ElementInstanceSelector } from '../accessors'
import { PaginationQuery } from '../entity-repository'
import { HttpRequestSpec } from '../http-requests'
import { DataSchema } from '../data-schema'
export type CreateAppEventTypeRequest = Omit<AppEventType, 'id' | 'userId'>
export interface UpdateAppEventTypeRequest {
key?: string
export type UpdateAppEventTypeRequest = CreateAppEventTypeRequest
name?: string
export interface FindAppEventTypesQuery extends PaginationQuery {}
subscribeRequest?: HttpRequestSpec
export interface AppEventSubscriptionSelector extends ElementInstanceSelector {
example?: any
schema?: DataSchema
userIdFormula?: any
}
export interface CreateAppEventTypeRequest extends UpdateAppEventTypeRequest {
key: string
name: string
}
export interface AppEventSubscriptionSelector
extends Omit<ElementInstanceSelector, 'parentKey' | 'parentId'> {
appEventTypeKey?: string

@@ -19,4 +35,10 @@

export interface IAppEventSubscriptionUpdate {}
export interface AppEventSubscriptionCreateRequest {}
export interface AppEventSubscriptionUpdateRequest {}
export interface FindAppEventTypesQuery extends PaginationQuery {
includeArchived?: boolean
}
export interface FindAppEventSubscriptionsQuery extends PaginationQuery {

@@ -27,7 +49,23 @@ id?: string

instanceKey?: string
appEventTypeId?: string
isSubscribed?: boolean
}
export interface FindAppEventsQuery extends PaginationQuery {
id?: string
userId?: string
instanceKey?: string
isSubscribed?: boolean
appEventTypeId?: string
appEventSubscriptionId?: string
startDatetime?: string
endDatetime?: string
}
import { DataSchema } from '../data-schema'
import { PaginationQuery, PaginationResponse } from '../entity-repository'
import { HttpRequestSpec } from '../http-requests'

@@ -18,3 +17,3 @@ import { User } from '../users'

publishedRevision?: string
archivedAt?: string

@@ -25,3 +24,3 @@ subscribeRequest?: HttpRequestSpec

schema?: any
schema?: DataSchema

@@ -31,4 +30,2 @@ globalWebhookUri: string

userIdFormula?: any
archivedAt?: string
}

@@ -85,19 +82,1 @@

}
export interface FindAppEventsQuery extends PaginationQuery {
id?: string
userId?: string
appEventTypeId?: string
appEventSubscriptionId?: string
startDatetime?: string
endDatetime?: string
instanceKey?: string
}
export interface FindAppEventsResponse extends PaginationResponse<AppEvent> {}

@@ -97,2 +97,4 @@ import {

return openIframe(uri, {
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2322): Type '(() => void) | undefined' is not assignable ... Remove this comment to see the full error message
onClose,

@@ -99,0 +101,0 @@ })

@@ -24,2 +24,3 @@ import urljoin from 'url-join'

DataCollectionSearchResponse,
DataCollectionSpec,
DataCollectionUpdateRequest,

@@ -88,2 +89,4 @@ DataCollectionUpdateResponse,

key,
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'Record<string, any> | undefined'... Remove this comment to see the full error message
parameters,

@@ -101,2 +104,4 @@ )

key,
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'Record<string, any> | undefined'... Remove this comment to see the full error message
parameters,

@@ -116,2 +121,4 @@ )

void openIframe(uri, {
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'null' is not assignable to param... Remove this comment to see the full error message
onClose: () => resolve(null),

@@ -189,2 +196,8 @@ onSuccess: (connection) => resolve(connection),

async get(): Promise<DataCollectionSpec> {
return this.client.get(
this.connectionAccessor.getPath(`data/${this.key}`, this.parameters),
)
}
async findById(

@@ -191,0 +204,0 @@ request?: DataCollectionFindByIdRequest,

@@ -11,4 +11,8 @@ import { PaginationQuery, PaginationResponse } from '../entity-repository'

export class CreateConnectionRequest {
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2564): Property 'name' has no initializer and is not defi... Remove this comment to see the full error message
name: string
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2564): Property 'integrationId' has no initializer and is... Remove this comment to see the full error message
integrationId: string

@@ -15,0 +19,0 @@

@@ -6,2 +6,3 @@ import { User } from '../users'

export * from './api'
export * from './types'
import {

@@ -19,2 +20,4 @@ ConnectorSpec,

*/
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2564): Property 'id' has no initializer and is not defini... Remove this comment to see the full error message
id: string

@@ -25,4 +28,8 @@

*/
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2564): Property 'name' has no initializer and is not defi... Remove this comment to see the full error message
name: string
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2564): Property 'userId' has no initializer and is not de... Remove this comment to see the full error message
userId: string

@@ -42,2 +49,4 @@

*/
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2564): Property 'integrationId' has no initializer and is... Remove this comment to see the full error message
integrationId: string

@@ -57,4 +66,8 @@

/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2564): Property 'createdAt' has no initializer and is not... Remove this comment to see the full error message
createdAt: string
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2564): Property 'updatedAt' has no initializer and is not... Remove this comment to see the full error message
updatedAt: string

@@ -66,2 +79,4 @@

// Backward compatibility
/* FIXME: temporary fix to pass eslint test */
/* eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging */
export interface ConnectionSpec extends ConnectorSpec {}

@@ -72,2 +87,4 @@ export type ConnectionUiSpec = ConnectorUiSpec

/* FIXME: temporary fix to pass eslint test */
/* eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging */
export class ConnectionSpec {

@@ -74,0 +91,0 @@ constructor(opts: ConnectionSpec) {

@@ -35,3 +35,7 @@ import { ConnectorSpec } from '.'

properties: {
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2322): Type 'DataSchema | undefined' is not assignable to... Remove this comment to see the full error message
connectorParameters: args.connectorSpec?.parametersSchema,
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2322): Type 'DataSchema | undefined' is not assignable to... Remove this comment to see the full error message
connectionParameters: args.connectorSpec?.ui?.schema,

@@ -52,2 +56,4 @@ },

getOutputSchema: ({ connectorSpec }) =>
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2532): Object is possibly 'undefined'.
(connectorSpec.auth as ConnectorAuth)?.type === 'oauth1'

@@ -65,2 +71,4 @@ ? OAUTH1_CONFIG_SCHEMA

getInputSchema: getDefaultAuthInputSchema,
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2322): Type '({ connectorSpec }: ConnectorAuthMethodArgs)... Remove this comment to see the full error message
getOutputSchema: ({ connectorSpec }) =>

@@ -87,2 +95,4 @@ connectorSpec?.auth?.credentialsSchema,

getInputSchema: getDefaultAuthInputSchema,
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2322): Type '({ connectorSpec }: ConnectorAuthMethodArgs)... Remove this comment to see the full error message
getOutputSchema: ({ connectorSpec }) =>

@@ -101,2 +111,4 @@ connectorSpec?.auth?.credentialsSchema,

],
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2322): Type '({ connectorSpec }: ConnectorAuthMethodArgs)... Remove this comment to see the full error message
getInputSchema: ({ connectorSpec }) => ({

@@ -118,2 +130,3 @@ type: 'object',

getOutputSchema: () => ({
title: 'Connection Is Active',
type: 'boolean',

@@ -128,2 +141,3 @@ }),

credentialsSchema?: DataSchema
makeApiClient?: ConnectorMethodImplementationBase
refreshCredentials?: ConnectorMethodImplementationBase

@@ -130,0 +144,0 @@ test?: ConnectorMethodImplementationBase

@@ -18,2 +18,4 @@ import { DataSchema } from '../../../../../data-schema'

fileKey: 'custom-pull-subscribe',
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2322): Type '({ collection }: ConnectorDataCollectionEven... Remove this comment to see the full error message
getInputSchema: ({ collection }) => ({

@@ -34,2 +36,4 @@ type: 'object',

fileKey: 'custom-pull-collect-events',
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2322): Type '({ collection }: ConnectorDataCollectionEven... Remove this comment to see the full error message
getInputSchema: ({ collection }) => ({

@@ -41,2 +45,4 @@ type: 'object',

}),
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2322): Type '({ collection }: ConnectorDataCollectionEven... Remove this comment to see the full error message
getOutputSchema: ({ collection }) => ({

@@ -43,0 +49,0 @@ type: 'object',

@@ -23,2 +23,4 @@ import { DataRecord } from '../../../../../data-collections'

fileKey: 'pull-latest-records',
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2322): Type '({ collection }: ConnectorDataCollectionEven... Remove this comment to see the full error message
getInputSchema: ({ collection }) => ({

@@ -25,0 +27,0 @@ type: 'object',

@@ -36,2 +36,4 @@ import {

fileKey: 'webhook-subscribe',
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2322): Type '({ collection }: ConnectorDataCollectionEven... Remove this comment to see the full error message
getInputSchema: ({ collection }) => ({

@@ -44,2 +46,4 @@ type: 'object',

}),
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2322): Type '({ event }: ConnectorDataCollectionEventMeth... Remove this comment to see the full error message
getOutputSchema: ({ event }) => ({

@@ -61,2 +65,4 @@ type: 'object',

fileKey: 'webhook-unsubscribe',
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2322): Type '({ collection, event }: ConnectorDataCollect... Remove this comment to see the full error message
getInputSchema: ({ collection, event }) => ({

@@ -69,2 +75,4 @@ type: 'object',

}),
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2322): Type '() => null' is not assignable to type '(args... Remove this comment to see the full error message
getOutputSchema: () => null,

@@ -81,2 +89,4 @@ supportedImplementationTypes: [

fileKey: 'webhook-handle',
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2322): Type '({ collection, event }: ConnectorDataCollect... Remove this comment to see the full error message
getInputSchema: ({ collection, event }) => ({

@@ -83,0 +93,0 @@ type: 'object',

@@ -52,2 +52,4 @@ import { DataSchema } from '../../../data-schema'

{
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2322): Type '({ collectionSpec }: ConnectorDataCollection... Remove this comment to see the full error message
getInputSchema: ({ collectionSpec }) => ({

@@ -106,2 +108,4 @@ type: 'object',

},
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2322): Type '({ collectionSpec }: ConnectorDataCollection... Remove this comment to see the full error message
getOutputSchema: ({ collectionSpec }) => collectionSpec?.fieldsSchema,

@@ -115,2 +119,4 @@ supportedImplementationTypes: [ConnectorMethodImplementationType.javascript],

"Transform fieldsSchema into format accepted by the application's API",
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2322): Type '({ collectionSpec }: ConnectorDataCollection... Remove this comment to see the full error message
getInputSchema: ({ collectionSpec }) => ({

@@ -117,0 +123,0 @@ type: 'object',

@@ -44,2 +44,4 @@ import {

if (method?.fields) {
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'DataSchema | undefined' is not a... Remove this comment to see the full error message
fieldsSchema = pickFieldsFromSchema(fieldsSchema, method.fields)

@@ -49,2 +51,4 @@ }

fieldsSchema = excludeFieldsFromSchema(
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'DataSchema | undefined' is not a... Remove this comment to see the full error message
fieldsSchema,

@@ -51,0 +55,0 @@ method.excludedFields,

@@ -18,4 +18,6 @@ import { DataLocationMethodImplementationTypes } from '../../methods'

},
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2322): Type '() => null' is not assignable to type '(args... Remove this comment to see the full error message
getOutputSchema: () => null,
supportedImplementationTypes: DataLocationMethodImplementationTypes,
}

@@ -42,2 +42,4 @@ import { Static, Type } from '@sinclair/typebox'

const queryFieldsSchema = pickFieldsFromSchema(
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'DataSchema | undefined' is not a... Remove this comment to see the full error message
collectionSpec?.fieldsSchema,

@@ -44,0 +46,0 @@ method?.queryFields,

@@ -37,2 +37,4 @@ import { locatorToField } from '../../../../data-builder'

if (method?.filterFields) {
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'DataSchema | undefined' is not a... Remove this comment to see the full error message
filterSchema = pickFieldsFromSchema(fieldsSchema, method.filterFields)

@@ -43,2 +45,4 @@ }

properties: nonEmptyObjectProperties({
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2454): Variable 'filterSchema' is used before being assig... Remove this comment to see the full error message
filter: filterSchema,

@@ -45,0 +49,0 @@ cursor: {

@@ -35,2 +35,4 @@ import {

const fieldsSchema = pickFieldsFromSchema(
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'DataSchema | undefined' is not a... Remove this comment to see the full error message
collectionSpec?.fieldsSchema,

@@ -37,0 +39,0 @@ method?.fields,

@@ -48,2 +48,4 @@ import {

if (method?.fields) {
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'DataSchema | undefined' is not a... Remove this comment to see the full error message
fieldsSchema = pickFieldsFromSchema(fieldsSchema, method.fields)

@@ -53,2 +55,4 @@ }

fieldsSchema = excludeFieldsFromSchema(
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'DataSchema | undefined' is not a... Remove this comment to see the full error message
fieldsSchema,

@@ -55,0 +59,0 @@ method.excludedFields,

@@ -9,2 +9,4 @@ import { ConnectorDataLocationTypes } from '../..'

description: 'List collections and directories inside this directory',
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2322): Type '({ directory }: ConnectorDataDirectoryMethod... Remove this comment to see the full error message
getInputSchema: ({ directory }) => ({

@@ -11,0 +13,0 @@ type: 'object',

@@ -10,2 +10,4 @@ import { DataLocationType } from './types'

it('should return undefined if spec is undefined', () => {
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'undefined' is not assignable to ... Remove this comment to see the full error message
expect(getDataCollectionCreateFields(undefined)).toBeUndefined()

@@ -103,2 +105,4 @@ })

it('should return undefined if spec is undefined', () => {
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'undefined' is not assignable to ... Remove this comment to see the full error message
expect(getDataCollectionUpdateFields(undefined)).toBeUndefined()

@@ -175,2 +179,4 @@ })

it('should return undefined if spec is undefined', () => {
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'undefined' is not assignable to ... Remove this comment to see the full error message
expect(getWritableFieldsSchema(undefined)).toBeUndefined()

@@ -177,0 +183,0 @@ })

import deepEqual from 'fast-deep-equal'
import { toKebabCase } from 'js-convert-case'
import urljoin from 'url-join'
import { isNil, omitBy } from '../../_helper'
import {

@@ -10,2 +9,3 @@ ConnectorDataLocation,

} from '.'
import { isNil, omitBy } from '../../_helper'
import {

@@ -48,3 +48,3 @@ DataSchema,

export function parseDataLocationPath(
path: string,
path: string | undefined,
): DataLocationPointer | undefined {

@@ -69,14 +69,19 @@ if (!path) {

export function makeDataLocationPath(pointer: DataLocationPointer): string
export function makeDataLocationPath(
pointer: DataLocationPointer,
pointer: DataLocationPointer | undefined,
): string | undefined
export function makeDataLocationPath(
pointer: DataLocationPointer | undefined,
): string | undefined {
if (!pointer?.key) {
if (pointer?.key) {
let path = `/data/${pointer.key}`
const parameters = omitBy(pointer.parameters ?? {}, isNil)
if (Object.keys(parameters).length > 0) {
path += `?${new URLSearchParams(parameters).toString()}`
}
return path
} else {
return undefined
}
let path = `/data/${pointer.key}`
const parameters = omitBy(pointer.parameters ?? {}, isNil)
if (Object.keys(parameters).length > 0) {
path += `?${new URLSearchParams(parameters).toString()}`
}
return path
}

@@ -136,2 +141,4 @@

if (spec.create.fields) {
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'DataSchema | undefined' is not a... Remove this comment to see the full error message
schema = pickFieldsFromSchema(schema, spec.create.fields)

@@ -141,2 +148,4 @@ }

if (spec.create.excludedFields) {
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'DataSchema | undefined' is not a... Remove this comment to see the full error message
schema = excludeFieldsFromSchema(schema, spec.create.excludedFields)

@@ -158,2 +167,4 @@ }

if (spec.update.fields) {
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'DataSchema | undefined' is not a... Remove this comment to see the full error message
schema = pickFieldsFromSchema(schema, spec.update.fields)

@@ -163,2 +174,4 @@ }

if (spec.update.excludedFields) {
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'DataSchema | undefined' is not a... Remove this comment to see the full error message
schema = excludeFieldsFromSchema(schema, spec.update.excludedFields)

@@ -165,0 +178,0 @@ }

@@ -26,3 +26,3 @@ import { DataSchema } from '../data-schema'

export interface Connector {
export type Connector = ConnectorSpec & {
id: string

@@ -44,2 +44,4 @@ key: string

udms?: string[]
isReadOnly?: boolean
}

@@ -46,0 +48,0 @@

@@ -33,3 +33,7 @@ import {

dataLocationParametersMatch({
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2322): Type 'Record<string, any> | undefined' is not assi... Remove this comment to see the full error message
targetParameters: mapping.parameters,
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2322): Type 'Record<string, any> | undefined' is not assi... Remove this comment to see the full error message
locationParameters: parameters,

@@ -36,0 +40,0 @@ }),

@@ -49,2 +49,4 @@ import { BadRequestError, FlowConfigurationError } from '../errors'

if (processedVal !== undefined) {
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'any' is not assignable to parame... Remove this comment to see the full error message
result.push(processedVal)

@@ -104,2 +106,4 @@ }

data.map((item, idx) => {
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'string' is not assignable to par... Remove this comment to see the full error message
locators.push(...doGetVariableLocators(item, `${locator}[${idx}]`))

@@ -112,2 +116,4 @@ })

locators.push(
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'string' is not assignable to par... Remove this comment to see the full error message
...doGetVariableLocators(

@@ -152,2 +158,4 @@ value,

if (processedVal !== undefined) {
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'any' is not assignable to parame... Remove this comment to see the full error message
result.push(processedVal)

@@ -209,2 +217,4 @@ }

}
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'DataLocatorStep' is not assignab... Remove this comment to see the full error message
curLocator.push(locatorStep)

@@ -222,2 +232,4 @@ }

if (processedVal !== undefined) {
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'any' is not assignable to parame... Remove this comment to see the full error message
result.push(processedVal)

@@ -224,0 +236,0 @@ }

@@ -53,3 +53,5 @@ import { Formula } from '.'

}
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2322): Type 'undefined' is not assignable to type 'DataBu... Remove this comment to see the full error message
return undefined
}

@@ -63,2 +63,4 @@ import { getFormula } from '../formula-types'

it('should work with undefined value', () => {
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'undefined' is not assignable to ... Remove this comment to see the full error message
const formula = new DataBuilderFormulaCase(undefined)

@@ -65,0 +67,0 @@ expect(formula.getValue(variables)).toBeUndefined()

@@ -18,2 +18,4 @@ import { backwardCompatibleFilterMatch } from '../../data-filter'

export class DataBuilderFormulaCase extends DataBuilderFormulaBase {
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2564): Property 'value' has no initializer and is not def... Remove this comment to see the full error message
public value: CaseFormulaValue

@@ -20,0 +22,0 @@

@@ -77,2 +77,4 @@ import {

} else {
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2322): Type 'null' is not assignable to type 'EvalOperato... Remove this comment to see the full error message
return null

@@ -79,0 +81,0 @@ }

@@ -17,2 +17,4 @@ import { parseDatetime } from '../../datetime'

} else {
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2322): Type 'undefined' is not assignable to type 'string... Remove this comment to see the full error message
return undefined

@@ -19,0 +21,0 @@ }

@@ -39,2 +39,4 @@ import { buildDataSchema } from '../../data-schema'

if (newItem) {
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'any' is not assignable to parame... Remove this comment to see the full error message
result.push(newItem)

@@ -41,0 +43,0 @@ }

@@ -23,2 +23,4 @@ import { getFormula } from '../formula-types'

it('should work with undefined value', () => {
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'undefined' is not assignable to ... Remove this comment to see the full error message
const formula = new DataBuilderFormulaMap(undefined)

@@ -31,2 +33,4 @@ expect(formula.getValue(null)).toBeUndefined()

value: 'foo',
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2322): Type 'undefined' is not assignable to type 'Mappin... Remove this comment to see the full error message
mapping: undefined,

@@ -33,0 +37,0 @@ })

@@ -23,2 +23,4 @@ import { getFormula } from '../formula-types'

it('should work with empty args', () => {
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'undefined' is not assignable to ... Remove this comment to see the full error message
const formula = new DataBuilderFormulaTpl(undefined)

@@ -39,2 +41,4 @@ expect(formula.getValue(null)).toBeUndefined()

template: '{key}',
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2322): Type 'null' is not assignable to type 'Record<stri... Remove this comment to see the full error message
values: null,

@@ -41,0 +45,0 @@ })

@@ -178,2 +178,4 @@ import { BadRequestError } from '../errors'

it('should throw on incorrect value', () => {
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'null' is not assignable to param... Remove this comment to see the full error message
expect(() => locatorToSteps(null)).toThrow(BadRequestError)

@@ -381,3 +383,7 @@ expect(() => locatorToSteps('')).toThrow(BadRequestError)

it('should convert undefined, null, and empty array values to a root locator', () => {
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'undefined' is not assignable to ... Remove this comment to see the full error message
expect(stepsToLocator(undefined)).toEqual('$')
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'null' is not assignable to param... Remove this comment to see the full error message
expect(stepsToLocator(null)).toEqual('$')

@@ -410,3 +416,7 @@ expect(stepsToLocator([])).toEqual('$')

it('should keep empty values empty', () => {
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'undefined' is not assignable to ... Remove this comment to see the full error message
expect(locatorToString(undefined)).toBeUndefined()
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'null' is not assignable to param... Remove this comment to see the full error message
expect(locatorToString(null)).toEqual(null)

@@ -746,3 +756,7 @@ })

it('should pick empty list of fields', () => {
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'undefined' is not assignable to ... Remove this comment to see the full error message
expect(pickFieldsFromValue(value, undefined)).toBeUndefined()
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'null' is not assignable to param... Remove this comment to see the full error message
expect(pickFieldsFromValue(value, null)).toBeUndefined()

@@ -826,2 +840,4 @@ expect(pickFieldsFromValue(value, [])).toBeUndefined()

expect(getLocatorsFromSchema(undefined)).toEqual([])
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'null' is not assignable to param... Remove this comment to see the full error message
expect(getLocatorsFromSchema(null)).toEqual([])

@@ -904,5 +920,9 @@ expect(getLocatorsFromSchema({})).toEqual([])

})
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'null' is not assignable to param... Remove this comment to see the full error message
expect(excludeFieldsFromValue({ key: 'value' }, null)).toEqual({
key: 'value',
})
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'undefined' is not assignable to ... Remove this comment to see the full error message
expect(excludeFieldsFromValue({ key: 'value' }, undefined)).toEqual({

@@ -909,0 +929,0 @@ key: 'value',

@@ -13,2 +13,4 @@ import { toHeaderCase } from 'js-convert-case'

export class DataLocatorStep {
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2564): Property 'type' has no initializer and is not defi... Remove this comment to see the full error message
type: DataLocatorStepType

@@ -35,5 +37,9 @@ }

export function locatorToField(locator: string) {
if (typeof locator !== 'string') return undefined
return locator.replace(/^\$\./, '')
export function locatorToField(locator: string): string {
if (typeof locator == 'string') {
return locator.replace(/^\$\./, '')
} else {
// This is just a sanity check in case this function gets something unexpected
return locator
}
}

@@ -354,2 +360,4 @@

}
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'DataLocatorStep' is not assignab... Remove this comment to see the full error message
fieldSteps.push(step)

@@ -403,3 +411,3 @@ }

const schemaSteps = walkSchema(schema, locator)
return schemaSteps?.map((s) => s.title).filter((t) => !!t)
return schemaSteps?.map((s) => s.title).filter((t) => !!t) as string[]
}

@@ -420,2 +428,4 @@

if (locator === undefined || locator === null || !isValidLocator(locator))
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2322): Type 'undefined' is not assignable to type 'string... Remove this comment to see the full error message
return undefined

@@ -425,2 +435,4 @@

const schemaSteps = walkSchema(schema, locator)
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2322): Type 'string | undefined' is not assignable to typ... Remove this comment to see the full error message
return (

@@ -453,2 +465,4 @@ schemaSteps &&

locators.push(
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'any' is not assignable to parame... Remove this comment to see the full error message
...getLocatorsFromData(

@@ -497,2 +511,4 @@ value,

if (!curSchema) {
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2322): Type 'null' is not assignable to type 'SchemaStep[... Remove this comment to see the full error message
return null

@@ -507,2 +523,4 @@ }

} else {
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2322): Type 'null' is not assignable to type 'SchemaStep[... Remove this comment to see the full error message
return null

@@ -516,2 +534,4 @@ }

} else {
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2322): Type 'null' is not assignable to type 'SchemaStep[... Remove this comment to see the full error message
return null

@@ -522,2 +542,4 @@ }

// This locator is not pointing anywhere
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2322): Type 'null' is not assignable to type 'SchemaStep[... Remove this comment to see the full error message
return null

@@ -584,2 +606,4 @@ }

}
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'DataLocatorStepObjectProperty' i... Remove this comment to see the full error message
locators.push(new DataLocatorStepObjectProperty(part))

@@ -603,2 +627,4 @@ cursorPosition = closingIndex

}
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'DataLocatorStepArrayItem' is not... Remove this comment to see the full error message
locators.push(new DataLocatorStepArrayItem(arrayIndex))

@@ -689,2 +715,4 @@ cursorPosition = closingIndex + 1

data.map((item, idx) => {
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'string' is not assignable to par... Remove this comment to see the full error message
locators.push(...doGetFormulaLocators(item, `${locator}[${idx}]`))

@@ -697,2 +725,4 @@ })

locators.push(
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'string' is not assignable to par... Remove this comment to see the full error message
...doGetFormulaLocators(

@@ -699,0 +729,0 @@ value,

@@ -6,4 +6,10 @@ import { DataFilterCondition } from './index'

it('should match any data to empty filter', () => {
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'null' is not assignable to param... Remove this comment to see the full error message
expect(doesMatchFilter(null, null)).toBe(true)
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'null' is not assignable to param... Remove this comment to see the full error message
expect(doesMatchFilter('string', null)).toBe(true)
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'null' is not assignable to param... Remove this comment to see the full error message
expect(doesMatchFilter({ key: 'value' }, null)).toBe(true)

@@ -10,0 +16,0 @@ })

@@ -62,3 +62,3 @@ import { buildData } from '../data-builder'

}
const results = []
const results: DataFilterOperator[] = []
for (const [type, operator] of Object.entries(OPERATORS)) {

@@ -65,0 +65,0 @@ if (operator.applicableToSchema(schema)) {

@@ -70,2 +70,4 @@ import {

applicableToSchema: (schema) =>
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2322): Type 'boolean | undefined' is not assignable to ty... Remove this comment to see the full error message
schema?.type === 'string' && schemaAllowsCustomValue(schema),

@@ -79,2 +81,4 @@ getOperandSchema: () => ({ type: 'string' }),

applicableToSchema: (schema) =>
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2322): Type 'boolean | undefined' is not assignable to ty... Remove this comment to see the full error message
schema?.type === 'string' && schemaAllowsCustomValue(schema),

@@ -81,0 +85,0 @@ getOperandSchema: () => ({ type: 'string' }),

@@ -21,4 +21,8 @@ import { toHeaderCase } from 'js-convert-case'

/* FIXME: temporary fix to pass eslint test */
/* eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging */
export interface DataForm extends DataFormArgs {}
/* FIXME: temporary fix to pass eslint test */
/* eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging */
export class DataForm {

@@ -38,2 +42,4 @@ public constructor(args: DataFormArgs) {

default:
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'null' is not assignable to param... Remove this comment to see the full error message
return [this.makeDataField(null, this.schema)]

@@ -40,0 +46,0 @@ }

@@ -40,4 +40,8 @@ import { toHeaderCase } from 'js-convert-case'

/* FIXME: temporary fix to pass eslint test */
/* eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging */
export interface DataField extends IDataField {}
/* FIXME: temporary fix to pass eslint test */
/* eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging */
export class DataField {

@@ -47,2 +51,4 @@ constructor(data: IDataField) {

/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2532): Object is possibly 'undefined'.
this.name = this.name ?? this.schema.title ?? toHeaderCase(this.key)

@@ -96,4 +102,8 @@

fields.push(
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'DataField' is not assignable to ... Remove this comment to see the full error message
new DataField({
key,
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2322): Type 'null' is not assignable to type 'DataSchema ... Remove this comment to see the full error message
schema: null,

@@ -114,2 +124,4 @@ value: value,

fields.push(
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'DataField' is not assignable to ... Remove this comment to see the full error message
new DataField({

@@ -116,0 +128,0 @@ key,

@@ -1,3 +0,158 @@

import { mergeSchemas } from './merge'
import { mergeSchemas, patchSchema } from './merge'
describe('patchSchema', () => {
it('should work with empty and incomplete schemas', () => {
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'undefined' is not assignable to ... Remove this comment to see the full error message
expect(patchSchema(undefined, undefined)).toEqual(undefined)
expect(
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'undefined' is not assignable to ... Remove this comment to see the full error message
patchSchema(undefined, undefined, { readOnly: true, writeOnly: true }),
).toEqual(undefined)
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'undefined' is not assignable to ... Remove this comment to see the full error message
expect(patchSchema(undefined, { type: 'object' })).toEqual({
type: 'object',
})
expect(
patchSchema(
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'undefined' is not assignable to ... Remove this comment to see the full error message
undefined,
{ type: 'object' },
{ readOnly: true, writeOnly: true },
),
).toEqual({
type: 'object',
})
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'undefined' is not assignable to ... Remove this comment to see the full error message
expect(patchSchema({ type: 'object' }, undefined)).toEqual({
type: 'object',
})
expect(
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'undefined' is not assignable to ... Remove this comment to see the full error message
patchSchema({ type: 'object' }, undefined, {
readOnly: true,
writeOnly: true,
}),
).toEqual({
type: 'object',
})
expect(patchSchema({ type: 'object' }, { type: 'object' })).toEqual({
type: 'object',
})
expect(
patchSchema(
{ type: 'object' },
{ type: 'object' },
{ readOnly: true, writeOnly: true },
),
).toEqual({
type: 'object',
})
expect(
patchSchema(
{ type: 'object' },
{ type: 'object', properties: { str: { type: 'string' } } },
),
).toEqual({
type: 'object',
properties: { str: { type: 'string' } },
})
expect(
patchSchema(
{ type: 'object' },
{ type: 'object', properties: { str: { type: 'string' } } },
{ readOnly: true, writeOnly: true },
),
).toEqual({
type: 'object',
properties: { str: { type: 'string', readOnly: true, writeOnly: true } },
})
})
it('should add properties from patch schema', () => {
const source = { type: 'object', properties: { prop1: {} } }
const patch = { type: 'object', properties: { prop2: {} } }
const mergedSchema = patchSchema(source, patch)
expect(mergedSchema).toEqual({
type: 'object',
properties: { prop1: {}, prop2: {} },
})
})
it('should add properties as read-only if readOnly flag is set', () => {
const source = { type: 'object', properties: { prop1: {} } }
const patch = {
type: 'object',
properties: { prop2: { readOnly: true } },
}
const mergedSchema = patchSchema(source, patch)
expect(mergedSchema).toEqual({
type: 'object',
properties: { prop1: {}, prop2: { readOnly: true } },
})
})
it('should add properties as write-only if write-only flag is set', () => {
const source = { type: 'object', properties: { prop1: {} } }
const patch = {
type: 'object',
properties: { prop2: { writeOnly: true } },
}
const mergedSchema = patchSchema(source, patch)
expect(mergedSchema).toEqual({
type: 'object',
properties: { prop1: {}, prop2: { writeOnly: true } },
})
})
it('should remove read-only flag if patch is not read-only', () => {
const source = {
type: 'object',
properties: {
prop1: {},
prop2: { readOnly: true },
prop3: { readOnly: true },
},
}
const patch = {
type: 'object',
properties: { prop2: {}, prop3: { readOnly: true } },
}
const mergedSchema = patchSchema(source, patch)
expect(mergedSchema).toEqual({
type: 'object',
properties: { prop1: {}, prop2: {}, prop3: { readOnly: true } },
})
})
it('should remove write-only flag if patch is not write-only', () => {
const source = {
type: 'object',
properties: {
prop1: {},
prop2: { writeOnly: true },
prop3: { writeOnly: true },
},
}
const patch = {
type: 'object',
properties: { prop2: {}, prop3: { writeOnly: true } },
}
const mergedSchema = patchSchema(source, patch)
expect(mergedSchema).toEqual({
type: 'object',
properties: { prop1: {}, prop2: {}, prop3: { writeOnly: true } },
})
})
})
describe('mergeSchemas', () => {

@@ -4,0 +159,0 @@ it('should merge simple schemas', () => {

@@ -9,4 +9,14 @@ /*

import {
getLocatorsFromSchema,
getSchemaByLocator,
setSchemaAtLocator,
} from '../data-builder'
import { DataSchema } from './types'
export interface PatchSchemaOption {
readOnly?: boolean
writeOnly?: boolean
}
export function mergeSchemas(schemas: any[]): any {

@@ -17,2 +27,57 @@ const mergedSchema = combineSchemas(schemas)

export function patchSchema(
source: DataSchema,
patch: DataSchema,
options?: PatchSchemaOption,
): any {
const mergedSchema = combineSchemas([source, patch])
if (options?.readOnly) {
// If patch is read-only, iterate over its properties and if properties did not exist
// in the source schema, mark them as read-only.
const properties = Object.keys(patch?.properties ?? {})
for (const prop of properties) {
const sourceProperty = source?.properties?.[prop]
if (!sourceProperty) {
mergedSchema.properties[prop].readOnly = true
}
}
} else {
// If some properties were marked as readOnly, but they are not read-only in the patch, remove the readOnly flag
const locators = getLocatorsFromSchema(patch)
for (const locator of locators) {
const sourceProperty = getSchemaByLocator(source, locator)
const patchProperty = getSchemaByLocator(patch, locator)
if (sourceProperty?.readOnly && !patchProperty?.readOnly) {
const mergedProperty = getSchemaByLocator(mergedSchema, locator)
delete mergedProperty.readOnly
setSchemaAtLocator(mergedSchema, locator, mergedProperty)
}
}
}
if (options?.writeOnly) {
// If patch is write-only, iterate over its properties and if properties did not exist
// in the source schema, mark them as write-only.
const properties = Object.keys(patch?.properties ?? {})
for (const prop of properties) {
const sourceProperty = source?.properties?.[prop]
if (!sourceProperty) {
mergedSchema.properties[prop].writeOnly = true
}
}
} else {
// If some properties were marked as writeOnly, but they are not write-only in the patch, remove the writeOnly flag
const locators = getLocatorsFromSchema(patch)
for (const locator of locators) {
const sourceProperty = getSchemaByLocator(source, locator)
const patchProperty = getSchemaByLocator(patch, locator)
if (sourceProperty?.writeOnly && !patchProperty?.writeOnly) {
const mergedProperty = getSchemaByLocator(mergedSchema, locator)
delete mergedProperty.writeOnly
setSchemaAtLocator(mergedSchema, locator, mergedProperty)
}
}
}
return mergedSchema
}
function combineSchemas(schemas: any[]): any {

@@ -194,6 +259,12 @@ const schemasByType: Record<string, any[]> = {

if (Array.isArray(subSchema.type)) {
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'any' is not assignable to parame... Remove this comment to see the full error message
simpleSchemas.push(...subSchema.type)
} else if (isSimpleSchema(subSchema)) {
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'any' is not assignable to parame... Remove this comment to see the full error message
simpleSchemas.push((subSchema as any).type)
} else {
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'any' is not assignable to parame... Remove this comment to see the full error message
complexSchemas.push(subSchema)

@@ -205,3 +276,3 @@ }

}
const anyOf = []
const anyOf: Record<'type', any>[] = []
if (simpleSchemas.length > 0) {

@@ -208,0 +279,0 @@ anyOf.push({

@@ -48,3 +48,3 @@ import { DataRecord } from '../data-collections'

referenceCollection?: {
key: string
key: any
parameters?: Record<string, any>

@@ -51,0 +51,0 @@ }

@@ -289,2 +289,4 @@ import {

it('should work with null schema', () => {
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'null' is not assignable to param... Remove this comment to see the full error message
expect(addRequiredFieldsToSchema(null, ['key'])).toEqual(undefined)

@@ -577,2 +579,4 @@ })

it('should return true for empty schema', () => {
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'undefined' is not assignable to ... Remove this comment to see the full error message
expect(isSchemaEmpty(undefined)).toBeTruthy()

@@ -595,3 +599,7 @@ expect(isSchemaEmpty({})).toBeTruthy()

expect(populateSchemaTitles({})).toEqual({})
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'null' is not assignable to param... Remove this comment to see the full error message
expect(populateSchemaTitles(null)).toEqual(null)
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'undefined' is not assignable to ... Remove this comment to see the full error message
expect(populateSchemaTitles(undefined)).toEqual(undefined)

@@ -729,3 +737,7 @@ })

expect(getRequiredFieldsFromSchema({})).toEqual([])
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'null' is not assignable to param... Remove this comment to see the full error message
expect(getRequiredFieldsFromSchema(null)).toEqual([])
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'undefined' is not assignable to ... Remove this comment to see the full error message
expect(getRequiredFieldsFromSchema(undefined)).toEqual([])

@@ -957,3 +969,7 @@ })

expect(getMissingRequiredFields({}, null)).toEqual([])
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'null' is not assignable to param... Remove this comment to see the full error message
expect(getMissingRequiredFields(null, undefined)).toEqual([])
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'undefined' is not assignable to ... Remove this comment to see the full error message
expect(getMissingRequiredFields(undefined, undefined)).toEqual([])

@@ -1068,3 +1084,7 @@ })

expect(removeRequiredFieldsFromSchema({})).toEqual({})
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'null' is not assignable to param... Remove this comment to see the full error message
expect(removeRequiredFieldsFromSchema(null)).toEqual(null)
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'undefined' is not assignable to ... Remove this comment to see the full error message
expect(removeRequiredFieldsFromSchema(undefined)).toEqual(undefined)

@@ -1071,0 +1091,0 @@ })

@@ -83,2 +83,4 @@ import { structuredClone } from '../_helper'

schemas.push(
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'any' is not assignable to parame... Remove this comment to see the full error message
getSchemaFromValue(item, variablesSchema, ignoreFormulas),

@@ -197,3 +199,3 @@ )

} else if (value) {
throwError(`Expected true or false but got "${value}"`)
throwError(`Expected true or false but got "${value}" (${typeof value})`)
}

@@ -408,2 +410,4 @@ return undefined

const lastStep = steps.pop()
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2532): Object is possibly 'undefined'.
if (lastStep.type === DataLocatorStepType.OBJECT_PROPERTY) {

@@ -437,2 +441,4 @@ const objectLocator = stepsToLocator(steps)

key,
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'unknown' is not assignable to pa... Remove this comment to see the full error message
removeRequiredFieldsFromSchema(propertySchema),

@@ -459,2 +465,4 @@ )

if (getValueByLocator(value, field) === undefined) {
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'string' is not assignable to par... Remove this comment to see the full error message
missingFields.push(field)

@@ -546,2 +554,4 @@ }

type: 'array',
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'DataSchema | undefined' is not a... Remove this comment to see the full error message
items: compressDataSchema(schema.items),

@@ -548,0 +558,0 @@ }

@@ -168,2 +168,4 @@ import {

return openIframe(uri, {
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2322): Type '(() => void) | undefined' is not assignable ... Remove this comment to see the full error message
onClose,

@@ -170,0 +172,0 @@ })

@@ -54,2 +54,6 @@ import { PaginationQuery, PaginationResponse } from '../entity-repository'

connectionId?: string
integrationKey?: string
integrationId?: string
}

@@ -56,0 +60,0 @@

@@ -16,4 +16,6 @@ /**

} else {
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2322): Type 'null' is not assignable to type 'Date'.
return null
}
}

@@ -11,4 +11,6 @@ export interface SearchQuery {

export class PaginationResponse<T> {
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2564): Property 'items' has no initializer and is not def... Remove this comment to see the full error message
items: T[]
cursor?: string
}

@@ -42,2 +42,3 @@ import { ErrorDoc } from './error-doc-enum'

ACTION_RUN = 'action_run',
ACTION_INSTANCE_SETUP = 'action_instance_setup',

@@ -81,2 +82,4 @@ UNIT_RUN = 'unit_run',

/* FIXME: temporary fix to pass eslint test */
/* eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging */
export class ErrorData implements ErrorDataFields {

@@ -101,2 +104,4 @@ constructor(arg: ErrorConstructorArg) {

/* FIXME: temporary fix to pass eslint test */
/* eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging */
export interface ErrorData extends ErrorDataFields {}

@@ -176,2 +181,9 @@

export class ActionInstanceSetupError extends IntegrationAppError {
constructor(arg: ErrorConstructorArg) {
super(arg)
this.data.type = ErrorType.ACTION_INSTANCE_SETUP
}
}
export class UnitRunError extends IntegrationAppError {

@@ -221,2 +233,3 @@ constructor(arg: ErrorConstructorArg) {

[ErrorType.ACTION_RUN]: ActionRunError,
[ErrorType.ACTION_INSTANCE_SETUP]: ActionInstanceSetupError,
[ErrorType.UNIT_RUN]: UnitRunError,

@@ -223,0 +236,0 @@ }

@@ -111,2 +111,4 @@ import { FieldMapping, FieldMappingInstance, FieldMappingSelector } from '.'

return openIframe(uri, {
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2322): Type '(() => void) | undefined' is not assignable ... Remove this comment to see the full error message
onClose,

@@ -113,0 +115,0 @@ })

@@ -29,2 +29,6 @@ import { PaginationQuery, PaginationResponse } from '../entity-repository'

dataSourceInstanceId?: string
integrationKey?: string
integrationId?: string
}

@@ -31,0 +35,0 @@

@@ -13,2 +13,4 @@ import { isFormula } from '../../data-builder'

for (let i = 0; i < length; i++) {
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'any' is not assignable to parame... Remove this comment to see the full error message
merged.push(mergeWithFormulas(a[i], b[i]))

@@ -15,0 +17,0 @@ }

@@ -128,2 +128,4 @@ import { FlowRun, FlowRunState } from '../flow-runs'

return openIframe(uri, {
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2322): Type '(() => void) | undefined' is not assignable ... Remove this comment to see the full error message
onClose: options.onClose,

@@ -130,0 +132,0 @@ })

import { FieldMappingDirection } from '../../field-mappings'
/* FIXME: temporary fix to pass eslint test */
/* eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging */
export interface FlowNodeSpec {

@@ -15,2 +17,4 @@ name: string

/* FIXME: temporary fix to pass eslint test */
/* eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging */
export class FlowNodeSpec implements FlowNodeSpec {

@@ -17,0 +21,0 @@ constructor(args: FlowNodeSpec) {

import { FlowNodeSpec } from './base'
import RunAction from './run-action'
import ApiTrigger from './api-trigger'

@@ -9,2 +10,3 @@ import ScheduleTrigger from './schedule-trigger'

import DataRecordDeletedTrigger from './data-record-deleted-trigger'
import SearchDataRecords from './search-data-records'
import ListDataRecords from './list-data-records'

@@ -41,3 +43,3 @@ import LookupDataRecord from './lookup-data-record'

TransformData = 'transform-data',
SearchDataRecords = 'search-data-records',
ListDataRecords = 'list-data-records',

@@ -50,3 +52,3 @@ FindOrCreateDataRecord = 'find-or-create-data-record',

DeleteDataRecord = 'delete-data-record',
Filter = 'filter',
CreateDataLink = 'create-data-link',

@@ -56,2 +58,5 @@ FindDataLink = 'find-data-link',

TransformData = 'transform-data',
Filter = 'filter',
ForEachV2 = 'for-each-v2',

@@ -68,2 +73,4 @@

RunAction = 'run-action',
/**

@@ -89,2 +96,3 @@ * @deprecated Use for-each-v2 instead

[FlowNodeType.SearchDataRecords]: SearchDataRecords,
[FlowNodeType.ListDataRecords]: ListDataRecords,

@@ -116,2 +124,4 @@ [FlowNodeType.LookupDataRecord]: LookupDataRecord,

[FlowNodeType.ApiRequest]: ApiRequest,
[FlowNodeType.RunAction]: RunAction,
}

@@ -125,2 +125,3 @@ import { Connection } from '../connections'

export enum FlowDependencyType {
Action = 'Action',
FieldMapping = 'FieldMapping',

@@ -127,0 +128,0 @@ DataSource = 'DataSource',

@@ -123,2 +123,4 @@ import { Flow, hasCycles } from '.'

/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type '{ a: { type: string; links: ({ k... Remove this comment to see the full error message
expect(hasCycles(nodes)).toBe(false)

@@ -125,0 +127,0 @@ })

@@ -13,2 +13,4 @@ import { toHeaderCase } from 'js-convert-case'

): FlowNode {
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2322): Type 'FlowNode | FlowInstanceNode | undefined' is ... Remove this comment to see the full error message
return flow.nodes?.[nodeKey]

@@ -79,6 +81,12 @@ }

const nodeLinks = node?.links || []
return nodeLinks
.map((nodeLink) => nodeLink.key)
.filter(Boolean)
.filter((k) => !!flow.nodes?.[k])
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2322): Type '(string | undefined)[]' is not assignable to... Remove this comment to see the full error message
return (
nodeLinks
.map((nodeLink) => nodeLink.key)
.filter(Boolean)
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2538): Type 'undefined' cannot be used as an index type.
.filter((k) => !!flow.nodes?.[k])
)
}

@@ -203,2 +211,4 @@

for (const link of node.links) {
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'string | undefined' is not assig... Remove this comment to see the full error message
if (dfs(link.key, visited, stack, nodes)) {

@@ -205,0 +215,0 @@ return true

@@ -41,2 +41,4 @@ import { insertCss } from 'insert-css'

const container = getContainer()
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2531): Object is possibly 'null'.
container.classList.add(CONTAINER_ELEMENT_CLASS__LOADER)

@@ -47,2 +49,4 @@ }

const container = getContainer()
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2531): Object is possibly 'null'.
container.classList.remove(CONTAINER_ELEMENT_CLASS__LOADER)

@@ -190,2 +194,4 @@ }

const container = getContainer()
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2531): Object is possibly 'null'.
container.classList.add(CONTAINER_ELEMENT_CLASS__VISIBLE)

@@ -196,2 +202,4 @@ }

const container = getContainer()
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2531): Object is possibly 'null'.
container.classList.remove(CONTAINER_ELEMENT_CLASS__VISIBLE)

@@ -202,2 +210,4 @@ }

const container = getContainer()
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2531): Object is possibly 'null'.
container.appendChild(el)

@@ -208,5 +218,9 @@ }

const container = getContainer()
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2531): Object is possibly 'null'.
if (container.firstChild) {
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2531): Object is possibly 'null'.
container.removeChild(container.firstChild)
}
}

@@ -7,2 +7,3 @@ export * from './accessors'

export * from './connections'
export * from './connector-copilot'
export * from './connectors'

@@ -9,0 +10,0 @@ export * from './data-builder'

@@ -10,2 +10,3 @@ export enum IntegrationElementType {

INTEGRATION = 'integration',
ACTION = 'action',
}

@@ -12,0 +13,0 @@

@@ -34,2 +34,4 @@ import { IntegrationAppError } from 'errors'

> {
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2564): Property 'baseUri' has no initializer and is not d... Remove this comment to see the full error message
public baseUri: string

@@ -78,2 +80,4 @@

return openIframe(uri, {
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2322): Type '(() => void) | undefined' is not assignable ... Remove this comment to see the full error message
onClose,

@@ -101,2 +105,4 @@ })

return openIframe(uri, {
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'null' is not assignable to param... Remove this comment to see the full error message
onClose: () => resolve(null),

@@ -148,2 +154,4 @@ onSuccess: (connection) => resolve(connection),

} else if (message.type == 'newConnectionCancel') {
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'null' is not assignable to param... Remove this comment to see the full error message
resolve(null)

@@ -190,2 +198,4 @@ } else if (message.type == 'newConnectionFailure') {

urlObj.toString(),
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'null' is not assignable to param... Remove this comment to see the full error message
null,

@@ -208,2 +218,4 @@ `popup,width=${width},height=${height},left=${left},top=${top}`,

cleanup()
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'null' is not assignable to param... Remove this comment to see the full error message
resolve(null)

@@ -238,2 +250,13 @@ }

async getDataCollections(): Promise<DataLocationListItem[]> {
return this.client.get(this.getPath('data'))
}
async getDataCollection(key: string): Promise<DataLocationSpec> {
return this.client.get(this.getPath(`data/${key}`))
}
/**
* @deprecated
*/
async getDataLocations(): Promise<DataLocationListItem[]> {

@@ -243,2 +266,5 @@ return this.client.get(this.getPath('data'))

/**
* @deprecated
*/
async getDataLocation(key: string): Promise<DataLocationSpec> {

@@ -245,0 +271,0 @@ return this.client.get(this.getPath(`data/${key}`))

@@ -65,2 +65,4 @@ import { Connection } from '../connections'

hasUdm?: boolean
hasAuth?: boolean
}

@@ -67,0 +69,0 @@

@@ -6,2 +6,4 @@ import activitySpec from './activities'

expect(
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2722): Cannot invoke an object which is possibly 'undefin... Remove this comment to see the full error message
activitySpec.populateFields({

@@ -20,2 +22,4 @@ dueTime: null,

expect(
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2722): Cannot invoke an object which is possibly 'undefin... Remove this comment to see the full error message
activitySpec.populateFields({

@@ -34,2 +38,4 @@ dueTime: null,

expect(
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2722): Cannot invoke an object which is possibly 'undefin... Remove this comment to see the full error message
activitySpec.populateFields({

@@ -36,0 +42,0 @@ dueTime: '2022-01-01T00:00:00.000Z',

@@ -124,2 +124,12 @@ import { UnifiedDataModel } from './base'

fieldsSchema: FIELDS_SCHEMA,
list: {
filterFields: [
'type',
'companyId',
'contactId',
'dealId',
'leadId',
'ownerId',
],
},
create: {

@@ -126,0 +136,0 @@ excludedFields: ['createdTime', 'createdBy', 'updatedTime', 'updatedBy'],

@@ -21,7 +21,23 @@ import { UnifiedDataModel } from './base'

},
lineItemsIds: {
lineItems: {
type: 'array',
items: {
type: 'string',
referenceUdm: 'invoice-line-items',
type: 'object',
properties: {
id: { type: 'string' },
itemName: { type: 'string' },
description: { type: 'string' },
code: { type: 'string' },
type: { type: 'string' },
companyId: { type: 'string', referenceUdm: 'companies' },
ledgerAccountId: { type: 'string', referenceUdm: 'ledger-accounts' },
quantity: { type: 'number' },
unitPrice: { type: 'number' },
unitOfMeasure: { type: 'string' },
purchasePrice: { type: 'number' },
salesPrice: { type: 'number' },
taxable: { type: 'boolean' },
taxAmount: { type: 'number' },
totalAmount: { type: 'number' },
},
},

@@ -28,0 +44,0 @@ },

@@ -81,2 +81,5 @@ import { AddressSchema, PhoneEmailSchema, UnifiedDataModel } from './base'

fieldsSchema: FIELDS_SCHEMA,
list: {
filterFields: ['ownerId'],
},
find: {

@@ -83,0 +86,0 @@ queryFields: ['name', 'websiteUrl'],

@@ -82,2 +82,14 @@ import { UnifiedDataModel } from './base'

fieldsSchema: FIELDS_SCHEMA,
list: {
filterFields: [
'companyId',
'stage',
'status',
'contactId',
'campaignId',
'source',
'type',
'ownerId',
],
},
find: {

@@ -84,0 +96,0 @@ queryFields: ['name'],

@@ -17,8 +17,11 @@ import { structuredClone } from '../_helper'

import contacts from './contacts'
import creditnotes from './credit-notes'
import customers from './customers'
import dealproducts from './deal-products'
import deals from './deals'
import drives from './drives'
import emails from './emails'
import lineitems from './invoice-line-items'
import files from './files'
import invoices from './invoices'
import journalentries from './journal-entries'
import leads from './leads'

@@ -45,2 +48,3 @@ import ledgeraccounts from './ledger-accounts'

CONTACTS = 'contacts',
CREDIT_NOTES = 'credit-notes',
CUSTOMERS = 'customers',

@@ -51,3 +55,3 @@ DEAL_PRODUCTS = 'deal-products',

INVOICES = 'invoices',
INVOICES_LINE_ITEMS = 'invoice-line-items',
JOURNAL_ENTRIES = 'journal-entries',
LEADS = 'leads',

@@ -65,2 +69,4 @@ LEDGER_ACCOUNTS = 'ledger-accounts',

USERS = 'users',
FILES = 'files',
DRIVES = 'drives',
}

@@ -74,2 +80,3 @@

[UDM.CONTACTS]: contacts,
[UDM.CREDIT_NOTES]: creditnotes,
[UDM.CUSTOMERS]: customers,

@@ -80,3 +87,3 @@ [UDM.DEAL_PRODUCTS]: dealproducts,

[UDM.INVOICES]: invoices,
[UDM.INVOICES_LINE_ITEMS]: lineitems,
[UDM.JOURNAL_ENTRIES]: journalentries,
[UDM.LEADS]: leads,

@@ -94,2 +101,4 @@ [UDM.LEDGER_ACCOUNTS]: ledgeraccounts,

[UDM.USERS]: users,
[UDM.FILES]: files,
[UDM.DRIVES]: drives,
}

@@ -228,2 +237,4 @@

) as DataBuilderFormulaVar
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2345): Argument of type 'string' is not assignable to par... Remove this comment to see the full error message
varLocators.push(formula.locator)

@@ -230,0 +241,0 @@ }

@@ -21,7 +21,25 @@ import { UnifiedDataModel } from './base'

},
lineItemsIds: {
lineItems: {
type: 'array',
items: {
type: 'string',
referenceUdm: 'invoice-line-items',
type: 'object',
properties: {
id: { type: 'string' },
itemName: { type: 'string' },
description: { type: 'string' },
code: { type: 'string' },
type: { type: 'string' },
status: { type: 'string' },
companyId: { type: 'string', referenceUdm: 'companies' },
ledgerAccountId: { type: 'string', referenceUdm: 'ledger-accounts' },
quantity: { type: 'number' },
unitOfMeasure: { type: 'string' },
unitPrice: { type: 'number' },
purchasePrice: { type: 'number' },
salesPrice: { type: 'number' },
taxable: { type: 'boolean' },
taxAmount: { type: 'number' },
totalAmount: { type: 'number' },
inventoryDate: { type: 'string', format: 'date-time' },
},
},

@@ -28,0 +46,0 @@ },

@@ -93,2 +93,12 @@ import { UnifiedDataModel } from './base'

fieldsSchema: FIELDS_SCHEMA,
list: {
filterFields: [
'companyId',
'contactId',
'dealId',
'leadId',
'ownerId',
'status',
],
},
create: {

@@ -95,0 +105,0 @@ excludedFields: ['createdTime', 'createdBy', 'updatedTime', 'updatedBy'],

@@ -54,2 +54,12 @@ import { FallbackFieldsMap } from './activities'

fieldsSchema: FIELDS_SCHEMA,
list: {
filterFields: [
'companyId',
'contactId',
'dealId',
'leadId',
'ownerId',
'status',
],
},
create: {

@@ -56,0 +66,0 @@ excludedFields: ['createdTime', 'createdBy', 'updatedTime', 'updatedBy'],

@@ -55,2 +55,5 @@ import { AddressSchema, UnifiedDataModel } from './base'

fieldsSchema: FIELDS_SCHEMA,
list: {
filterFields: ['customerId'],
},
find: {

@@ -57,0 +60,0 @@ queryFields: ['name'],

@@ -15,3 +15,3 @@ import { UnifiedDataModel } from './base'

customerId: { type: 'string', referenceUdm: 'customers' },
accountId: { type: 'string', referenceUdm: 'ledger-accounts' },
ledgerAccountId: { type: 'string', referenceUdm: 'ledger-accounts' },
paymentMethod: { type: 'string' },

@@ -31,4 +31,15 @@ transactionDate: { type: 'string', format: 'date-time' },

fieldsSchema: FIELDS_SCHEMA,
list: {
filterFields: [
'customerId',
'type',
'status',
'supplierId',
'ledgerAccountId',
'paymentMethod',
'isReconciled',
],
},
}
export default udm

@@ -54,4 +54,7 @@ import { AddressSchema, PhoneEmailSchema, UnifiedDataModel } from './base'

fieldsSchema: FIELDS_SCHEMA,
list: {
filterFields: ['companyId', 'status'],
},
}
export default udm

@@ -84,2 +84,17 @@ import { FallbackFieldsMap } from './activities'

fieldsSchema: FIELDS_SCHEMA,
list: {
filterFields: [
'companyId',
'contactId',
'dealId',
'leadId',
'ownerId',
'status',
'type',
'priority',
'assigneeId',
'parentTaskId',
'projectId',
],
},
create: {

@@ -86,0 +101,0 @@ excludedFields: ['createdTime', 'createdBy', 'updatedTime', 'updatedBy'],

@@ -10,2 +10,3 @@ export * from './accessors'

lastActiveAt?: string
isTest?: boolean
}

@@ -11,2 +11,4 @@ import { DataSchema } from './data-schema'

getUpstreamNodeKeys(flow, nodeKey).forEach((prevNodeKey) => {
/* FIXME: strictNullCheck temporary fix */
// @ts-expect-error TS(2532): Object is possibly 'undefined'.
const prevNode = flow.nodes[prevNodeKey]

@@ -13,0 +15,0 @@ if (prevNode.outputSchema) {

@@ -0,3 +1,8 @@

import { Action } from '../actions'
import { ConnectorAuth, RestApiClientOptions } from '../connectors'
import { DataLink } from '../data-links'
import { DataSchema } from '../data-schema'
import { DataSource } from '../data-sources'
import { FieldMapping } from '../field-mappings'
import { Flow } from '../flows'
import { User } from '../users'

@@ -21,10 +26,2 @@

engineId: string
engine?: {
id: string
apiUri: string
uiUri: string
}
engineAccessToken?: string

@@ -85,2 +82,10 @@

export interface WorkspaceElements {
flows: Record<string, Flow>
actions: Record<string, Action>
fieldMappings: Record<string, FieldMapping>
dataSources: Record<string, DataSource>
dataLinks: Record<string, DataLink>
}
export enum WorkspaceEventType {

@@ -87,0 +92,0 @@ ConnectionCreated = 'connection.created',

@@ -5,4 +5,6 @@ {

"target": "es2018",
"lib": ["es2019", "DOM"],
"lib": ["es2019", "dom", "dom.iterable"],
"types": ["node","jest"],
"strict": true,
"strictNullChecks": true,
"outDir": "./dist",

@@ -9,0 +11,0 @@ "baseUrl": "./src",

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc