@integration-app/react
Advanced tools
Comparing version 0.3.1 to 0.3.2
import * as _integration_app_sdk from '@integration-app/sdk'; | ||
import { IntegrationAppClient, ConnectionAccessor, Connection, CreateConnectionRequest, UpdateConnectionRequest, FindConnectionsQuery, ConnectionSpec, IntegrationAccessor, Integration, CreateIntegrationRequest, UpdateIntegrationRequest, FindIntegrationsQuery, FieldMappingSelector, CreateFieldMappingRequest, FieldMapping, UpdateFieldMappingRequest, FieldMappingAccessor, FieldMappingInstanceSelector, CreateFieldMappingInstanceRequest, FieldMappingInstance, UpdateFieldMappingInstanceRequest, FieldMappingInstanceAccessor, OpenFieldMappingInstanceConfigurationOptions, FindFieldMappingInstancesQuery, FindFieldMappingsQuery, DataSourceSelector, CreateDataSourceRequest, DataSource, DataSourceAccessor, FindDataSourceEventsQuery, DataSourceEvent, DataSourceInstanceSelector, CreateDataSourceInstanceRequest, DataSourceInstance, UpdateDataSourceInstanceRequest, DataSourceInstanceAccessor, OpenDataSourceConfigurationOptions, DataCollectionListRequest, DataCollectionFindRequest, DataCollectionCreateRequest, DataCollectionUpdateRequest, DataDirectoryListRequest, DataCollectionSpec, DataDirectoryListResponse, FindDataSourceInstancesQuery, FindDataSourcesQuery, AppEventSubscriptionSelector, AppEventSubscriptionAccessor, AppEventSubscription, IAppEventSubscriptionUpdate, FindAppEventSubscriptionsQuery, AppEventTypeAccessor, AppEventType, CreateAppEventTypeRequest, FindAppEventTypesQuery, FindAppEventsQuery, AppEvent, FlowSelector, CreateFlowRequest, Flow, UpdateFlowRequest, FlowAccessor, FindFlowsRequest, FlowInstanceSelector, UpdateFlowInstanceRequest, FlowInstance, FlowInstanceAccessor, OpenFlowInstanceConfigurationOptions, RunFlowOptions, FindFlowInstancesQuery, FlowRun, FindFlowRunsRequest, DataLinkTableAccessor, DataLinkTable, CreateDataLinkTableRequest, DataLinkTableInstanceSelector, CreateDataLinkTableInstanceRequest, DataLinkTableInstance, UpdateDataLinkTableInstanceRequest, DataLinkTableInstanceAccessor, FindDataLinkTableInstancesQuery, FindDataLinkTablesQuery, ActionSelector, CreateActionRequest, Action, UpdateActionRequest, ActionAccessor, ActionInstanceSelector, CreateActionInstanceRequest, ActionInstance, UpdateActionInstanceRequest, ActionInstanceAccessor, OpenActionConfigurationOptions, FindActionInstancesQuery, FindActionsQuery, ScreenSelector, ScreenAccessor, Screen, CreateScreenRequest, UpdateScreenRequest } from '@integration-app/sdk'; | ||
import { IntegrationAppClient, ConnectionAccessor, Connection, CreateConnectionRequest, UpdateConnectionRequest, FindConnectionsQuery, ConnectionSpec, IntegrationAccessor, Integration, CreateIntegrationRequest, UpdateIntegrationRequest, FindIntegrationsQuery, FieldMappingSelector, CreateFieldMappingRequest, FieldMapping, UpdateFieldMappingRequest, FieldMappingAccessor, FieldMappingInstanceSelector, CreateFieldMappingInstanceRequest, FieldMappingInstance, UpdateFieldMappingInstanceRequest, FieldMappingInstanceAccessor, OpenFieldMappingInstanceConfigurationOptions, FindFieldMappingInstancesQuery, FindFieldMappingsQuery, DataSourceSelector, CreateDataSourceRequest, DataSource, DataSourceAccessor, FindDataSourceEventsQuery, DataSourceEvent, DataSourceInstanceSelector, CreateDataSourceInstanceRequest, DataSourceInstance, UpdateDataSourceInstanceRequest, DataSourceInstanceAccessor, OpenDataSourceConfigurationOptions, DataCollectionListRequest, DataCollectionFindRequest, DataCollectionCreateRequest, DataCollectionUpdateRequest, DataDirectoryListRequest, DataCollectionSpec, DataDirectoryListResponse, FindDataSourceInstancesQuery, FindDataSourcesQuery, AppEventSubscriptionSelector, AppEventSubscriptionAccessor, AppEventSubscription, IAppEventSubscriptionUpdate, FindAppEventSubscriptionsQuery, AppEventTypeAccessor, AppEventType, CreateAppEventTypeRequest, FindAppEventTypesQuery, FindAppEventsQuery, AppEvent, FlowSelector, CreateFlowRequest, Flow, UpdateFlowRequest, FlowAccessor, FindFlowsRequest, FlowInstanceSelector, UpdateFlowInstanceRequest, FlowInstance, FlowInstanceAccessor, OpenFlowInstanceConfigurationOptions, RunFlowOptions, FindFlowInstancesQuery, FlowRun, FindFlowRunsRequest, DataLinkTableAccessor, DataLinkTable, CreateDataLinkTableRequest, DataLinkTableInstanceSelector, CreateDataLinkTableInstanceRequest, DataLinkTableInstance, UpdateDataLinkTableInstanceRequest, DataLinkTableInstanceAccessor, FindDataLinkTableInstancesQuery, FindDataLinkTablesQuery, ActionSelector, CreateActionRequest, Action, UpdateActionRequest, ActionAccessor, ActionInstanceSelector, CreateActionInstanceRequest, ActionInstance, UpdateActionInstanceRequest, ActionInstanceAccessor, OpenActionConfigurationOptions, FindActionInstancesQuery, FindActionsQuery, ScreenSelector, ScreenAccessor, Screen, CreateScreenRequest, UpdateScreenRequest, UserSelector, UserAccessor, User, UpdateUserRequest, FindUsersQuery } from '@integration-app/sdk'; | ||
export { DataForm } from '@integration-app/sdk'; | ||
@@ -502,2 +502,27 @@ import { ReactNode } from 'react'; | ||
declare function useCustomer(selector: UserSelector | string): { | ||
accessor: UserAccessor; | ||
loading: boolean; | ||
saving: boolean; | ||
error: any; | ||
refresh: () => Promise<User>; | ||
refreshing: boolean; | ||
create: (data: User) => Promise<User>; | ||
patch: (data: Partial<UpdateUserRequest>) => Promise<void>; | ||
put: (data: UpdateUserRequest) => Promise<void>; | ||
archive: () => Promise<void>; | ||
customer: User; | ||
}; | ||
declare function useCustomers(query?: FindUsersQuery): { | ||
items: User[]; | ||
refresh: () => Promise<void>; | ||
refreshing: boolean; | ||
loadMore: () => Promise<void>; | ||
loadingMore: boolean; | ||
loading: boolean; | ||
error: any; | ||
customers: User[]; | ||
}; | ||
declare function useDataCollectionSpec({ path, key, integrationId, }: { | ||
@@ -509,2 +534,2 @@ path?: string; | ||
export { IntegrationAppProvider, useAction, useActionInstance, useActionInstances, useActions, useAppEventSubscription, useAppEventSubscriptions, useAppEventType, useAppEventTypes, useAppEvents, useConnection, useConnections, useConnectorSpec, useDataCollectionSpec, useDataLinkTable, useDataLinkTableInstance, useDataLinkTableInstances, useDataLinkTables, useDataSource, useDataSourceEvents, useDataSourceInstance, useDataSourceInstanceCollection, useDataSourceInstanceLocations, useDataSourceInstances, useDataSources, useFieldMapping, useFieldMappingInstance, useFieldMappingInstances, useFieldMappings, useFlow, useFlowInstance, useFlowInstances, useFlowRun, useFlowRuns, useFlows, useIntegration, useIntegrationApp, useIntegrationAppSWR, useIntegrations, useScreen }; | ||
export { IntegrationAppProvider, useAction, useActionInstance, useActionInstances, useActions, useAppEventSubscription, useAppEventSubscriptions, useAppEventType, useAppEventTypes, useAppEvents, useConnection, useConnections, useConnectorSpec, useCustomer, useCustomers, useDataCollectionSpec, useDataLinkTable, useDataLinkTableInstance, useDataLinkTableInstances, useDataLinkTables, useDataSource, useDataSourceEvents, useDataSourceInstance, useDataSourceInstanceCollection, useDataSourceInstanceLocations, useDataSourceInstances, useDataSources, useFieldMapping, useFieldMappingInstance, useFieldMappingInstances, useFieldMappings, useFlow, useFlowInstance, useFlowInstances, useFlowRun, useFlowRuns, useFlows, useIntegration, useIntegrationApp, useIntegrationAppSWR, useIntegrations, useScreen }; |
@@ -193,3 +193,5 @@ 'use strict'; | ||
const integrationApp = useIntegrationApp(); | ||
const { data, isLoading, error } = useSWR(`/integrations/${integrationIdOrKey}/connector-spec`, () => integrationApp.integration(integrationIdOrKey).getConnectorSpec()); | ||
const { data, isLoading, error } = useSWR(integrationIdOrKey | ||
? `/integrations/${integrationIdOrKey}/connector-spec` | ||
: undefined, () => integrationApp.integration(integrationIdOrKey).getConnectorSpec()); | ||
return { data, loading: isLoading, error }; | ||
@@ -649,2 +651,15 @@ } | ||
function useCustomer(selector) { | ||
const { item: customer, ...rest } = useElement(selector, (c) => c.customer(selector)); | ||
return { customer, ...rest }; | ||
} | ||
function useCustomers(query) { | ||
const { ...rest } = useElements('users', query); | ||
return { | ||
customers: rest.items, | ||
...rest, | ||
}; | ||
} | ||
function useDataCollectionSpec({ path, key, integrationId, }) { | ||
@@ -677,2 +692,4 @@ var _a; | ||
exports.useConnectorSpec = useConnectorSpec; | ||
exports.useCustomer = useCustomer; | ||
exports.useCustomers = useCustomers; | ||
exports.useDataCollectionSpec = useDataCollectionSpec; | ||
@@ -679,0 +696,0 @@ exports.useDataLinkTable = useDataLinkTable; |
import * as _integration_app_sdk from '@integration-app/sdk'; | ||
import { IntegrationAppClient, ConnectionAccessor, Connection, CreateConnectionRequest, UpdateConnectionRequest, FindConnectionsQuery, ConnectionSpec, IntegrationAccessor, Integration, CreateIntegrationRequest, UpdateIntegrationRequest, FindIntegrationsQuery, FieldMappingSelector, CreateFieldMappingRequest, FieldMapping, UpdateFieldMappingRequest, FieldMappingAccessor, FieldMappingInstanceSelector, CreateFieldMappingInstanceRequest, FieldMappingInstance, UpdateFieldMappingInstanceRequest, FieldMappingInstanceAccessor, OpenFieldMappingInstanceConfigurationOptions, FindFieldMappingInstancesQuery, FindFieldMappingsQuery, DataSourceSelector, CreateDataSourceRequest, DataSource, DataSourceAccessor, FindDataSourceEventsQuery, DataSourceEvent, DataSourceInstanceSelector, CreateDataSourceInstanceRequest, DataSourceInstance, UpdateDataSourceInstanceRequest, DataSourceInstanceAccessor, OpenDataSourceConfigurationOptions, DataCollectionListRequest, DataCollectionFindRequest, DataCollectionCreateRequest, DataCollectionUpdateRequest, DataDirectoryListRequest, DataCollectionSpec, DataDirectoryListResponse, FindDataSourceInstancesQuery, FindDataSourcesQuery, AppEventSubscriptionSelector, AppEventSubscriptionAccessor, AppEventSubscription, IAppEventSubscriptionUpdate, FindAppEventSubscriptionsQuery, AppEventTypeAccessor, AppEventType, CreateAppEventTypeRequest, FindAppEventTypesQuery, FindAppEventsQuery, AppEvent, FlowSelector, CreateFlowRequest, Flow, UpdateFlowRequest, FlowAccessor, FindFlowsRequest, FlowInstanceSelector, UpdateFlowInstanceRequest, FlowInstance, FlowInstanceAccessor, OpenFlowInstanceConfigurationOptions, RunFlowOptions, FindFlowInstancesQuery, FlowRun, FindFlowRunsRequest, DataLinkTableAccessor, DataLinkTable, CreateDataLinkTableRequest, DataLinkTableInstanceSelector, CreateDataLinkTableInstanceRequest, DataLinkTableInstance, UpdateDataLinkTableInstanceRequest, DataLinkTableInstanceAccessor, FindDataLinkTableInstancesQuery, FindDataLinkTablesQuery, ActionSelector, CreateActionRequest, Action, UpdateActionRequest, ActionAccessor, ActionInstanceSelector, CreateActionInstanceRequest, ActionInstance, UpdateActionInstanceRequest, ActionInstanceAccessor, OpenActionConfigurationOptions, FindActionInstancesQuery, FindActionsQuery, ScreenSelector, ScreenAccessor, Screen, CreateScreenRequest, UpdateScreenRequest } from '@integration-app/sdk'; | ||
import { IntegrationAppClient, ConnectionAccessor, Connection, CreateConnectionRequest, UpdateConnectionRequest, FindConnectionsQuery, ConnectionSpec, IntegrationAccessor, Integration, CreateIntegrationRequest, UpdateIntegrationRequest, FindIntegrationsQuery, FieldMappingSelector, CreateFieldMappingRequest, FieldMapping, UpdateFieldMappingRequest, FieldMappingAccessor, FieldMappingInstanceSelector, CreateFieldMappingInstanceRequest, FieldMappingInstance, UpdateFieldMappingInstanceRequest, FieldMappingInstanceAccessor, OpenFieldMappingInstanceConfigurationOptions, FindFieldMappingInstancesQuery, FindFieldMappingsQuery, DataSourceSelector, CreateDataSourceRequest, DataSource, DataSourceAccessor, FindDataSourceEventsQuery, DataSourceEvent, DataSourceInstanceSelector, CreateDataSourceInstanceRequest, DataSourceInstance, UpdateDataSourceInstanceRequest, DataSourceInstanceAccessor, OpenDataSourceConfigurationOptions, DataCollectionListRequest, DataCollectionFindRequest, DataCollectionCreateRequest, DataCollectionUpdateRequest, DataDirectoryListRequest, DataCollectionSpec, DataDirectoryListResponse, FindDataSourceInstancesQuery, FindDataSourcesQuery, AppEventSubscriptionSelector, AppEventSubscriptionAccessor, AppEventSubscription, IAppEventSubscriptionUpdate, FindAppEventSubscriptionsQuery, AppEventTypeAccessor, AppEventType, CreateAppEventTypeRequest, FindAppEventTypesQuery, FindAppEventsQuery, AppEvent, FlowSelector, CreateFlowRequest, Flow, UpdateFlowRequest, FlowAccessor, FindFlowsRequest, FlowInstanceSelector, UpdateFlowInstanceRequest, FlowInstance, FlowInstanceAccessor, OpenFlowInstanceConfigurationOptions, RunFlowOptions, FindFlowInstancesQuery, FlowRun, FindFlowRunsRequest, DataLinkTableAccessor, DataLinkTable, CreateDataLinkTableRequest, DataLinkTableInstanceSelector, CreateDataLinkTableInstanceRequest, DataLinkTableInstance, UpdateDataLinkTableInstanceRequest, DataLinkTableInstanceAccessor, FindDataLinkTableInstancesQuery, FindDataLinkTablesQuery, ActionSelector, CreateActionRequest, Action, UpdateActionRequest, ActionAccessor, ActionInstanceSelector, CreateActionInstanceRequest, ActionInstance, UpdateActionInstanceRequest, ActionInstanceAccessor, OpenActionConfigurationOptions, FindActionInstancesQuery, FindActionsQuery, ScreenSelector, ScreenAccessor, Screen, CreateScreenRequest, UpdateScreenRequest, UserSelector, UserAccessor, User, UpdateUserRequest, FindUsersQuery } from '@integration-app/sdk'; | ||
export { DataForm } from '@integration-app/sdk'; | ||
@@ -502,2 +502,27 @@ import { ReactNode } from 'react'; | ||
declare function useCustomer(selector: UserSelector | string): { | ||
accessor: UserAccessor; | ||
loading: boolean; | ||
saving: boolean; | ||
error: any; | ||
refresh: () => Promise<User>; | ||
refreshing: boolean; | ||
create: (data: User) => Promise<User>; | ||
patch: (data: Partial<UpdateUserRequest>) => Promise<void>; | ||
put: (data: UpdateUserRequest) => Promise<void>; | ||
archive: () => Promise<void>; | ||
customer: User; | ||
}; | ||
declare function useCustomers(query?: FindUsersQuery): { | ||
items: User[]; | ||
refresh: () => Promise<void>; | ||
refreshing: boolean; | ||
loadMore: () => Promise<void>; | ||
loadingMore: boolean; | ||
loading: boolean; | ||
error: any; | ||
customers: User[]; | ||
}; | ||
declare function useDataCollectionSpec({ path, key, integrationId, }: { | ||
@@ -509,2 +534,2 @@ path?: string; | ||
export { IntegrationAppProvider, useAction, useActionInstance, useActionInstances, useActions, useAppEventSubscription, useAppEventSubscriptions, useAppEventType, useAppEventTypes, useAppEvents, useConnection, useConnections, useConnectorSpec, useDataCollectionSpec, useDataLinkTable, useDataLinkTableInstance, useDataLinkTableInstances, useDataLinkTables, useDataSource, useDataSourceEvents, useDataSourceInstance, useDataSourceInstanceCollection, useDataSourceInstanceLocations, useDataSourceInstances, useDataSources, useFieldMapping, useFieldMappingInstance, useFieldMappingInstances, useFieldMappings, useFlow, useFlowInstance, useFlowInstances, useFlowRun, useFlowRuns, useFlows, useIntegration, useIntegrationApp, useIntegrationAppSWR, useIntegrations, useScreen }; | ||
export { IntegrationAppProvider, useAction, useActionInstance, useActionInstances, useActions, useAppEventSubscription, useAppEventSubscriptions, useAppEventType, useAppEventTypes, useAppEvents, useConnection, useConnections, useConnectorSpec, useCustomer, useCustomers, useDataCollectionSpec, useDataLinkTable, useDataLinkTableInstance, useDataLinkTableInstances, useDataLinkTables, useDataSource, useDataSourceEvents, useDataSourceInstance, useDataSourceInstanceCollection, useDataSourceInstanceLocations, useDataSourceInstances, useDataSources, useFieldMapping, useFieldMappingInstance, useFieldMappingInstances, useFieldMappings, useFlow, useFlowInstance, useFlowInstances, useFlowRun, useFlowRuns, useFlows, useIntegration, useIntegrationApp, useIntegrationAppSWR, useIntegrations, useScreen }; |
import * as _integration_app_sdk from '@integration-app/sdk'; | ||
import { IntegrationAppClient, ConnectionAccessor, Connection, CreateConnectionRequest, UpdateConnectionRequest, FindConnectionsQuery, ConnectionSpec, IntegrationAccessor, Integration, CreateIntegrationRequest, UpdateIntegrationRequest, FindIntegrationsQuery, FieldMappingSelector, CreateFieldMappingRequest, FieldMapping, UpdateFieldMappingRequest, FieldMappingAccessor, FieldMappingInstanceSelector, CreateFieldMappingInstanceRequest, FieldMappingInstance, UpdateFieldMappingInstanceRequest, FieldMappingInstanceAccessor, OpenFieldMappingInstanceConfigurationOptions, FindFieldMappingInstancesQuery, FindFieldMappingsQuery, DataSourceSelector, CreateDataSourceRequest, DataSource, DataSourceAccessor, FindDataSourceEventsQuery, DataSourceEvent, DataSourceInstanceSelector, CreateDataSourceInstanceRequest, DataSourceInstance, UpdateDataSourceInstanceRequest, DataSourceInstanceAccessor, OpenDataSourceConfigurationOptions, DataCollectionListRequest, DataCollectionFindRequest, DataCollectionCreateRequest, DataCollectionUpdateRequest, DataDirectoryListRequest, DataCollectionSpec, DataDirectoryListResponse, FindDataSourceInstancesQuery, FindDataSourcesQuery, AppEventSubscriptionSelector, AppEventSubscriptionAccessor, AppEventSubscription, IAppEventSubscriptionUpdate, FindAppEventSubscriptionsQuery, AppEventTypeAccessor, AppEventType, CreateAppEventTypeRequest, FindAppEventTypesQuery, FindAppEventsQuery, AppEvent, FlowSelector, CreateFlowRequest, Flow, UpdateFlowRequest, FlowAccessor, FindFlowsRequest, FlowInstanceSelector, UpdateFlowInstanceRequest, FlowInstance, FlowInstanceAccessor, OpenFlowInstanceConfigurationOptions, RunFlowOptions, FindFlowInstancesQuery, FlowRun, FindFlowRunsRequest, DataLinkTableAccessor, DataLinkTable, CreateDataLinkTableRequest, DataLinkTableInstanceSelector, CreateDataLinkTableInstanceRequest, DataLinkTableInstance, UpdateDataLinkTableInstanceRequest, DataLinkTableInstanceAccessor, FindDataLinkTableInstancesQuery, FindDataLinkTablesQuery, ActionSelector, CreateActionRequest, Action, UpdateActionRequest, ActionAccessor, ActionInstanceSelector, CreateActionInstanceRequest, ActionInstance, UpdateActionInstanceRequest, ActionInstanceAccessor, OpenActionConfigurationOptions, FindActionInstancesQuery, FindActionsQuery, ScreenSelector, ScreenAccessor, Screen, CreateScreenRequest, UpdateScreenRequest } from '@integration-app/sdk'; | ||
import { IntegrationAppClient, ConnectionAccessor, Connection, CreateConnectionRequest, UpdateConnectionRequest, FindConnectionsQuery, ConnectionSpec, IntegrationAccessor, Integration, CreateIntegrationRequest, UpdateIntegrationRequest, FindIntegrationsQuery, FieldMappingSelector, CreateFieldMappingRequest, FieldMapping, UpdateFieldMappingRequest, FieldMappingAccessor, FieldMappingInstanceSelector, CreateFieldMappingInstanceRequest, FieldMappingInstance, UpdateFieldMappingInstanceRequest, FieldMappingInstanceAccessor, OpenFieldMappingInstanceConfigurationOptions, FindFieldMappingInstancesQuery, FindFieldMappingsQuery, DataSourceSelector, CreateDataSourceRequest, DataSource, DataSourceAccessor, FindDataSourceEventsQuery, DataSourceEvent, DataSourceInstanceSelector, CreateDataSourceInstanceRequest, DataSourceInstance, UpdateDataSourceInstanceRequest, DataSourceInstanceAccessor, OpenDataSourceConfigurationOptions, DataCollectionListRequest, DataCollectionFindRequest, DataCollectionCreateRequest, DataCollectionUpdateRequest, DataDirectoryListRequest, DataCollectionSpec, DataDirectoryListResponse, FindDataSourceInstancesQuery, FindDataSourcesQuery, AppEventSubscriptionSelector, AppEventSubscriptionAccessor, AppEventSubscription, IAppEventSubscriptionUpdate, FindAppEventSubscriptionsQuery, AppEventTypeAccessor, AppEventType, CreateAppEventTypeRequest, FindAppEventTypesQuery, FindAppEventsQuery, AppEvent, FlowSelector, CreateFlowRequest, Flow, UpdateFlowRequest, FlowAccessor, FindFlowsRequest, FlowInstanceSelector, UpdateFlowInstanceRequest, FlowInstance, FlowInstanceAccessor, OpenFlowInstanceConfigurationOptions, RunFlowOptions, FindFlowInstancesQuery, FlowRun, FindFlowRunsRequest, DataLinkTableAccessor, DataLinkTable, CreateDataLinkTableRequest, DataLinkTableInstanceSelector, CreateDataLinkTableInstanceRequest, DataLinkTableInstance, UpdateDataLinkTableInstanceRequest, DataLinkTableInstanceAccessor, FindDataLinkTableInstancesQuery, FindDataLinkTablesQuery, ActionSelector, CreateActionRequest, Action, UpdateActionRequest, ActionAccessor, ActionInstanceSelector, CreateActionInstanceRequest, ActionInstance, UpdateActionInstanceRequest, ActionInstanceAccessor, OpenActionConfigurationOptions, FindActionInstancesQuery, FindActionsQuery, ScreenSelector, ScreenAccessor, Screen, CreateScreenRequest, UpdateScreenRequest, UserSelector, UserAccessor, User, UpdateUserRequest, FindUsersQuery } from '@integration-app/sdk'; | ||
export { DataForm } from '@integration-app/sdk'; | ||
@@ -502,2 +502,27 @@ import { ReactNode } from 'react'; | ||
declare function useCustomer(selector: UserSelector | string): { | ||
accessor: UserAccessor; | ||
loading: boolean; | ||
saving: boolean; | ||
error: any; | ||
refresh: () => Promise<User>; | ||
refreshing: boolean; | ||
create: (data: User) => Promise<User>; | ||
patch: (data: Partial<UpdateUserRequest>) => Promise<void>; | ||
put: (data: UpdateUserRequest) => Promise<void>; | ||
archive: () => Promise<void>; | ||
customer: User; | ||
}; | ||
declare function useCustomers(query?: FindUsersQuery): { | ||
items: User[]; | ||
refresh: () => Promise<void>; | ||
refreshing: boolean; | ||
loadMore: () => Promise<void>; | ||
loadingMore: boolean; | ||
loading: boolean; | ||
error: any; | ||
customers: User[]; | ||
}; | ||
declare function useDataCollectionSpec({ path, key, integrationId, }: { | ||
@@ -509,2 +534,2 @@ path?: string; | ||
export { IntegrationAppProvider, useAction, useActionInstance, useActionInstances, useActions, useAppEventSubscription, useAppEventSubscriptions, useAppEventType, useAppEventTypes, useAppEvents, useConnection, useConnections, useConnectorSpec, useDataCollectionSpec, useDataLinkTable, useDataLinkTableInstance, useDataLinkTableInstances, useDataLinkTables, useDataSource, useDataSourceEvents, useDataSourceInstance, useDataSourceInstanceCollection, useDataSourceInstanceLocations, useDataSourceInstances, useDataSources, useFieldMapping, useFieldMappingInstance, useFieldMappingInstances, useFieldMappings, useFlow, useFlowInstance, useFlowInstances, useFlowRun, useFlowRuns, useFlows, useIntegration, useIntegrationApp, useIntegrationAppSWR, useIntegrations, useScreen }; | ||
export { IntegrationAppProvider, useAction, useActionInstance, useActionInstances, useActions, useAppEventSubscription, useAppEventSubscriptions, useAppEventType, useAppEventTypes, useAppEvents, useConnection, useConnections, useConnectorSpec, useCustomer, useCustomers, useDataCollectionSpec, useDataLinkTable, useDataLinkTableInstance, useDataLinkTableInstances, useDataLinkTables, useDataSource, useDataSourceEvents, useDataSourceInstance, useDataSourceInstanceCollection, useDataSourceInstanceLocations, useDataSourceInstances, useDataSources, useFieldMapping, useFieldMappingInstance, useFieldMappingInstances, useFieldMappings, useFlow, useFlowInstance, useFlowInstances, useFlowRun, useFlowRuns, useFlows, useIntegration, useIntegrationApp, useIntegrationAppSWR, useIntegrations, useScreen }; |
@@ -189,3 +189,5 @@ (function (global, factory) { | ||
const integrationApp = useIntegrationApp(); | ||
const { data, isLoading, error } = useSWR(`/integrations/${integrationIdOrKey}/connector-spec`, () => integrationApp.integration(integrationIdOrKey).getConnectorSpec()); | ||
const { data, isLoading, error } = useSWR(integrationIdOrKey | ||
? `/integrations/${integrationIdOrKey}/connector-spec` | ||
: undefined, () => integrationApp.integration(integrationIdOrKey).getConnectorSpec()); | ||
return { data, loading: isLoading, error }; | ||
@@ -645,2 +647,15 @@ } | ||
function useCustomer(selector) { | ||
const { item: customer, ...rest } = useElement(selector, (c) => c.customer(selector)); | ||
return { customer, ...rest }; | ||
} | ||
function useCustomers(query) { | ||
const { ...rest } = useElements('users', query); | ||
return { | ||
customers: rest.items, | ||
...rest, | ||
}; | ||
} | ||
function useDataCollectionSpec({ path, key, integrationId, }) { | ||
@@ -673,2 +688,4 @@ var _a; | ||
exports.useConnectorSpec = useConnectorSpec; | ||
exports.useCustomer = useCustomer; | ||
exports.useCustomers = useCustomers; | ||
exports.useDataCollectionSpec = useDataCollectionSpec; | ||
@@ -675,0 +692,0 @@ exports.useDataLinkTable = useDataLinkTable; |
{ | ||
"name": "@integration-app/react", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"description": "", | ||
@@ -37,3 +37,3 @@ "author": "Integration.app", | ||
"dependencies": { | ||
"@integration-app/sdk": "^0.16.71", | ||
"@integration-app/sdk": "^0.16.72", | ||
"awesome-debounce-promise": "^2.1.0", | ||
@@ -40,0 +40,0 @@ "query-string": "^7.1.1", |
import { ConnectionSpec } from '@integration-app/sdk' | ||
import useSWR from 'swr' | ||
import { useIntegrationApp } from '../contexts/integration-app-context' | ||
import useSWR from 'swr' | ||
@@ -9,3 +9,5 @@ export function useConnectorSpec(integrationIdOrKey: string) { | ||
const { data, isLoading, error } = useSWR<ConnectionSpec>( | ||
`/integrations/${integrationIdOrKey}/connector-spec`, | ||
integrationIdOrKey | ||
? `/integrations/${integrationIdOrKey}/connector-spec` | ||
: undefined, | ||
() => integrationApp.integration(integrationIdOrKey).getConnectorSpec(), | ||
@@ -12,0 +14,0 @@ ) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
257119
59
4701
0