@integration-app/react 1.1.4 → 2.0.0-beta.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +1 -1
- package/bundle-tests/test-frameworks/README.md +4 -0
- package/bundle-tests/test-frameworks/cra5react17/package-lock.json +30749 -0
- package/bundle-tests/test-frameworks/cra5react17/package.json +42 -0
- package/bundle-tests/test-frameworks/cra5react17/patches/react-scripts+5.0.0.patch +15 -0
- package/bundle-tests/test-frameworks/cra5react17/public/favicon.ico +0 -0
- package/bundle-tests/test-frameworks/cra5react17/public/index.html +43 -0
- package/bundle-tests/test-frameworks/cra5react17/public/logo192.png +0 -0
- package/bundle-tests/test-frameworks/cra5react17/public/logo512.png +0 -0
- package/bundle-tests/test-frameworks/cra5react17/public/manifest.json +25 -0
- package/bundle-tests/test-frameworks/cra5react17/public/robots.txt +3 -0
- package/bundle-tests/test-frameworks/cra5react17/src/IntegrationsTest.jsx +42 -0
- package/bundle-tests/test-frameworks/cra5react17/src/index.tsx +10 -0
- package/bundle-tests/test-frameworks/cra5react17/src/react-app-env.d.ts +1 -0
- package/bundle-tests/test-frameworks/cra5react17/tsconfig.json +26 -0
- package/bundle-tests/test-frameworks/cra5react18/package-lock.json +30328 -0
- package/bundle-tests/test-frameworks/cra5react18/package.json +38 -0
- package/bundle-tests/test-frameworks/cra5react18/public/favicon.ico +0 -0
- package/bundle-tests/test-frameworks/cra5react18/public/index.html +43 -0
- package/bundle-tests/test-frameworks/cra5react18/public/logo192.png +0 -0
- package/bundle-tests/test-frameworks/cra5react18/public/logo512.png +0 -0
- package/bundle-tests/test-frameworks/cra5react18/public/manifest.json +25 -0
- package/bundle-tests/test-frameworks/cra5react18/public/robots.txt +3 -0
- package/bundle-tests/test-frameworks/cra5react18/src/IntegrationsTest.jsx +42 -0
- package/bundle-tests/test-frameworks/cra5react18/src/index.tsx +10 -0
- package/bundle-tests/test-frameworks/cra5react18/src/logo.svg +1 -0
- package/bundle-tests/test-frameworks/cra5react18/src/react-app-env.d.ts +1 -0
- package/bundle-tests/test-frameworks/cra5react18/tsconfig.json +26 -0
- package/bundle-tests/test-frameworks/next12react17/next.config.js +6 -0
- package/bundle-tests/test-frameworks/next12react17/package.json +18 -0
- package/bundle-tests/test-frameworks/next12react17/pages/_app.js +5 -0
- package/bundle-tests/test-frameworks/next12react17/pages/index.js +5 -0
- package/bundle-tests/test-frameworks/next12react17/src/IntegrationsTest.jsx +25 -0
- package/bundle-tests/test-frameworks/next12react18/next.config.js +6 -0
- package/bundle-tests/test-frameworks/next12react18/package.json +18 -0
- package/bundle-tests/test-frameworks/next12react18/pages/_app.js +5 -0
- package/bundle-tests/test-frameworks/next12react18/pages/index.js +5 -0
- package/bundle-tests/test-frameworks/next12react18/src/IntegrationsTest.jsx +41 -0
- package/bundle-tests/test-frameworks/next13react18/app/layout.tsx +18 -0
- package/bundle-tests/test-frameworks/next13react18/app/page.tsx +5 -0
- package/bundle-tests/test-frameworks/next13react18/next-env.d.ts +5 -0
- package/bundle-tests/test-frameworks/next13react18/next.config.js +6 -0
- package/bundle-tests/test-frameworks/next13react18/package.json +22 -0
- package/bundle-tests/test-frameworks/next13react18/src/IntegrationsTest.tsx +43 -0
- package/bundle-tests/test-frameworks/next13react18/src/IntegrationsTestReact.tsx +28 -0
- package/bundle-tests/test-frameworks/next13react18/src/IntegrationsTestSdk.tsx +19 -0
- package/bundle-tests/test-frameworks/next13react18/tsconfig.json +34 -0
- package/bundle-tests/test-frameworks/parcel2react17/package.json +21 -0
- package/bundle-tests/test-frameworks/parcel2react17/src/IntegrationsTest.js +41 -0
- package/bundle-tests/test-frameworks/parcel2react17/src/index.html +12 -0
- package/bundle-tests/test-frameworks/parcel2react17/src/index.js +12 -0
- package/bundle-tests/test-frameworks/parcel2react18/package.json +21 -0
- package/bundle-tests/test-frameworks/parcel2react18/src/IntegrationsTest.js +41 -0
- package/bundle-tests/test-frameworks/parcel2react18/src/index.html +12 -0
- package/bundle-tests/test-frameworks/parcel2react18/src/index.js +11 -0
- package/bundle-tests/test-frameworks/vite3react17/index.html +12 -0
- package/bundle-tests/test-frameworks/vite3react17/package.json +26 -0
- package/bundle-tests/test-frameworks/vite3react17/src/IntegrationsTest.tsx +41 -0
- package/bundle-tests/test-frameworks/vite3react17/src/main.tsx +10 -0
- package/bundle-tests/test-frameworks/vite3react17/src/vite-env.d.ts +1 -0
- package/bundle-tests/test-frameworks/vite3react17/tsconfig.json +25 -0
- package/bundle-tests/test-frameworks/vite3react17/tsconfig.node.json +10 -0
- package/bundle-tests/test-frameworks/vite3react17/vite.config.ts +7 -0
- package/bundle-tests/test-frameworks/vite4react17/index.html +12 -0
- package/bundle-tests/test-frameworks/vite4react17/package.json +26 -0
- package/bundle-tests/test-frameworks/vite4react17/src/IntegrationsTest.tsx +41 -0
- package/bundle-tests/test-frameworks/vite4react17/src/main.tsx +10 -0
- package/bundle-tests/test-frameworks/vite4react17/src/vite-env.d.ts +1 -0
- package/bundle-tests/test-frameworks/vite4react17/tsconfig.json +25 -0
- package/bundle-tests/test-frameworks/vite4react17/tsconfig.node.json +10 -0
- package/bundle-tests/test-frameworks/vite4react17/vite.config.ts +7 -0
- package/bundle-tests/test-frameworks/vite4react18/index.html +12 -0
- package/bundle-tests/test-frameworks/vite4react18/package.json +26 -0
- package/bundle-tests/test-frameworks/vite4react18/src/IntegrationsTest.tsx +41 -0
- package/bundle-tests/test-frameworks/vite4react18/src/main.tsx +11 -0
- package/bundle-tests/test-frameworks/vite4react18/src/vite-env.d.ts +1 -0
- package/bundle-tests/test-frameworks/vite4react18/tsconfig.json +25 -0
- package/bundle-tests/test-frameworks/vite4react18/tsconfig.node.json +10 -0
- package/bundle-tests/test-frameworks/vite4react18/vite.config.ts +7 -0
- package/bundle-tests/test-package/package.json +10 -0
- package/bundle-tests/test-package/test-cjs.js +11 -0
- package/bundle-tests/test-package/test-esm.mjs +11 -0
- package/bundle-tests/test-package/test-umd.js +25 -0
- package/bundle-tests/test-package/test.sh +29 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/index.module.d.ts +3 -3
- package/dist/index.module.mjs +2 -2
- package/dist/index.module.mjs.map +1 -1
- package/dist/index.umd.d.ts +3 -3
- package/dist/index.umd.js +4 -4
- package/dist/index.umd.js.map +1 -1
- package/package.json +14 -12
- package/src/{actions → hooks/actions}/useAction.ts +1 -1
- package/src/{actions → hooks/actions}/useActionInstance.ts +1 -1
- package/src/{actions → hooks/actions}/useActionInstances.ts +1 -1
- package/src/{actions → hooks/actions}/useActions.ts +1 -1
- package/src/{app-data-schemas → hooks/app-data-schemas}/useAppDataSchema.ts +1 -1
- package/src/{app-data-schemas → hooks/app-data-schemas}/useAppDataSchemaInstance.ts +1 -1
- package/src/{app-data-schemas → hooks/app-data-schemas}/useAppDataSchemaInstances.ts +1 -1
- package/src/{app-data-schemas → hooks/app-data-schemas}/useAppDataSchemas.ts +1 -1
- package/src/{app-events → hooks/app-events}/useAppEventSubscription.ts +1 -1
- package/src/{app-events → hooks/app-events}/useAppEventSubscriptions.ts +1 -1
- package/src/{app-events → hooks/app-events}/useAppEventType.ts +1 -1
- package/src/{app-events → hooks/app-events}/useAppEventTypes.ts +1 -1
- package/src/{app-events → hooks/app-events}/useAppEvents.ts +1 -1
- package/src/{customers → hooks/customers}/useCustomer.ts +1 -1
- package/src/{customers → hooks/customers}/useCustomers.ts +1 -1
- package/src/{data-links → hooks/data-links}/useDataLinkTable.ts +1 -1
- package/src/{data-links → hooks/data-links}/useDataLinkTableInstance.ts +1 -1
- package/src/{data-links → hooks/data-links}/useDataLinkTableInstances.ts +1 -1
- package/src/{data-links → hooks/data-links}/useDataLinkTables.ts +1 -1
- package/src/{data-sources → hooks/data-sources}/useDataSource.ts +1 -1
- package/src/{data-sources → hooks/data-sources}/useDataSourceInstance.ts +1 -1
- package/src/{data-sources → hooks/data-sources}/useDataSourceInstanceCollection.ts +1 -1
- package/src/{data-sources → hooks/data-sources}/useDataSourceInstances.ts +1 -1
- package/src/{data-sources → hooks/data-sources}/useDataSources.ts +1 -1
- package/src/{external-events → hooks/external-events}/useExternalEventSubscription.ts +1 -1
- package/src/{external-events → hooks/external-events}/useExternalEventSubscriptions.ts +1 -1
- package/src/{field-mappings → hooks/field-mappings}/useFieldMapping.ts +1 -1
- package/src/{field-mappings → hooks/field-mappings}/useFieldMappingInstance.ts +1 -1
- package/src/{field-mappings → hooks/field-mappings}/useFieldMappingInstances.ts +1 -1
- package/src/{field-mappings → hooks/field-mappings}/useFieldMappings.ts +1 -1
- package/src/{flows → hooks/flows}/useFlow.ts +1 -1
- package/src/{flows → hooks/flows}/useFlowInstance.ts +6 -5
- package/src/{flows → hooks/flows}/useFlowInstances.ts +1 -1
- package/src/{flows → hooks/flows}/useFlowRun.ts +1 -1
- package/src/{flows → hooks/flows}/useFlowRuns.ts +1 -1
- package/src/{flows → hooks/flows}/useFlows.ts +1 -1
- package/src/{integrations → hooks/integrations}/useConnection.ts +1 -1
- package/src/{integrations → hooks/integrations}/useConnections.ts +1 -1
- package/src/{integrations → hooks/integrations}/useConnectorSpec.ts +1 -1
- package/src/{integrations → hooks/integrations}/useIntegration.ts +1 -1
- package/src/{integrations → hooks/integrations}/useIntegrations.ts +1 -1
- package/src/{scenarios → hooks/scenarios}/useScenario.tsx +1 -1
- package/src/{scenarios → hooks/scenarios}/useScenarios.tsx +1 -1
- package/src/{screens → hooks/screens}/useScreen.ts +1 -1
- package/src/index.tsx +45 -45
- package/tsconfig.json +1 -1
- /package/src/{data-collections → hooks/data-collections}/useDataCollectionSpec.ts +0 -0
- /package/src/{data-form → hooks/data-form}/index.tsx +0 -0
@@ -0,0 +1,21 @@
|
|
1
|
+
{
|
2
|
+
"name": "parcel",
|
3
|
+
"version": "1.0.0",
|
4
|
+
"description": "",
|
5
|
+
"source": "src/index.html",
|
6
|
+
"scripts": {
|
7
|
+
"dev": "parcel ./src/index.html",
|
8
|
+
"build": "parcel build ./src/index.html --public-url ./"
|
9
|
+
},
|
10
|
+
"author": "",
|
11
|
+
"license": "ISC",
|
12
|
+
"dependencies": {
|
13
|
+
"@integration-app/react": "latest",
|
14
|
+
"@integration-app/sdk": "latest",
|
15
|
+
"react": "^18",
|
16
|
+
"react-dom": "^18"
|
17
|
+
},
|
18
|
+
"devDependencies": {
|
19
|
+
"parcel": "^2"
|
20
|
+
}
|
21
|
+
}
|
@@ -0,0 +1,41 @@
|
|
1
|
+
import {
|
2
|
+
IntegrationAppProvider,
|
3
|
+
useIntegrations,
|
4
|
+
useActionInstance,
|
5
|
+
} from '@integration-app/react'
|
6
|
+
import { IntegrationAppClient } from '@integration-app/sdk'
|
7
|
+
|
8
|
+
const token =
|
9
|
+
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjEyMzEyMyIsIm5hbWUiOiIxMjMxMjMxMjMiLCJpc3MiOiJlYjc3ZjgzMS0zNjBjLTQ0YmMtOWQzYi0zNDJjYTY5MDU4NGEiLCJleHAiOjE3MjkwODUwNjh9.rDu2Mthgc-j4xVjIfW0Ox_eO50zJKJDUO6a4LnqDH20'
|
10
|
+
|
11
|
+
export function IntegrationsTest() {
|
12
|
+
return (
|
13
|
+
<IntegrationAppProvider token={token}>
|
14
|
+
<IntegrationsTestReact />
|
15
|
+
<IntegrationsTestSdk />
|
16
|
+
</IntegrationAppProvider>
|
17
|
+
)
|
18
|
+
}
|
19
|
+
|
20
|
+
function IntegrationsTestReact() {
|
21
|
+
try {
|
22
|
+
useIntegrations()
|
23
|
+
useActionInstance('some-action-instance-id')
|
24
|
+
} catch (e) {
|
25
|
+
throw new Error('@integration-app/react error')
|
26
|
+
}
|
27
|
+
return <>Integrations</>
|
28
|
+
}
|
29
|
+
|
30
|
+
function IntegrationsTestSdk() {
|
31
|
+
try {
|
32
|
+
const client = new IntegrationAppClient({ token: token })
|
33
|
+
void client
|
34
|
+
.get('/integrations')
|
35
|
+
.then(() => undefined)
|
36
|
+
.catch(() => undefined)
|
37
|
+
} catch (e) {
|
38
|
+
throw new Error('@integration-app/sdk error')
|
39
|
+
}
|
40
|
+
return <>SDK</>
|
41
|
+
}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import { createRoot } from 'react-dom/client'
|
3
|
+
import { IntegrationsTest } from './IntegrationsTest'
|
4
|
+
|
5
|
+
const container = document.getElementById('app')
|
6
|
+
const root = createRoot(container)
|
7
|
+
root.render(
|
8
|
+
<React.StrictMode>
|
9
|
+
<IntegrationsTest />
|
10
|
+
</React.StrictMode>,
|
11
|
+
)
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html lang="en">
|
3
|
+
<head>
|
4
|
+
<meta charset="UTF-8" />
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
6
|
+
<title>Vite + React + TS</title>
|
7
|
+
</head>
|
8
|
+
<body>
|
9
|
+
<div id="root"></div>
|
10
|
+
<script type="module" src="/src/main.tsx"></script>
|
11
|
+
</body>
|
12
|
+
</html>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
{
|
2
|
+
"name": "vite",
|
3
|
+
"private": true,
|
4
|
+
"version": "0.0.0",
|
5
|
+
"type": "module",
|
6
|
+
"scripts": {
|
7
|
+
"dev": "vite",
|
8
|
+
"build": "tsc && vite build",
|
9
|
+
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
10
|
+
"preview": "vite preview"
|
11
|
+
},
|
12
|
+
"dependencies": {
|
13
|
+
"@integration-app/react": "latest",
|
14
|
+
"@integration-app/sdk": "latest",
|
15
|
+
"react": "^17",
|
16
|
+
"react-dom": "^17"
|
17
|
+
},
|
18
|
+
"devDependencies": {
|
19
|
+
"@types/react": "^17",
|
20
|
+
"@types/react-dom": "^17",
|
21
|
+
"@vitejs/plugin-react": "^2",
|
22
|
+
"eslint": "^8.45.0",
|
23
|
+
"typescript": "^5.2.2",
|
24
|
+
"vite": "^3.0.0"
|
25
|
+
}
|
26
|
+
}
|
@@ -0,0 +1,41 @@
|
|
1
|
+
import {
|
2
|
+
IntegrationAppProvider,
|
3
|
+
useIntegrations,
|
4
|
+
useActionInstance,
|
5
|
+
} from '@integration-app/react'
|
6
|
+
import { IntegrationAppClient } from '@integration-app/sdk'
|
7
|
+
|
8
|
+
const token =
|
9
|
+
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjEyMzEyMyIsIm5hbWUiOiIxMjMxMjMxMjMiLCJpc3MiOiJlYjc3ZjgzMS0zNjBjLTQ0YmMtOWQzYi0zNDJjYTY5MDU4NGEiLCJleHAiOjE3MjkwODUwNjh9.rDu2Mthgc-j4xVjIfW0Ox_eO50zJKJDUO6a4LnqDH20'
|
10
|
+
|
11
|
+
export function IntegrationsTest() {
|
12
|
+
return (
|
13
|
+
<IntegrationAppProvider token={token}>
|
14
|
+
<IntegrationsTestReact />
|
15
|
+
<IntegrationsTestSdk />
|
16
|
+
</IntegrationAppProvider>
|
17
|
+
)
|
18
|
+
}
|
19
|
+
|
20
|
+
function IntegrationsTestReact() {
|
21
|
+
try {
|
22
|
+
useIntegrations()
|
23
|
+
useActionInstance('some-action-instance-id')
|
24
|
+
} catch (e) {
|
25
|
+
throw new Error('@integration-app/react error')
|
26
|
+
}
|
27
|
+
return <>Integrations</>
|
28
|
+
}
|
29
|
+
|
30
|
+
function IntegrationsTestSdk() {
|
31
|
+
try {
|
32
|
+
const client = new IntegrationAppClient({ token: token })
|
33
|
+
void client
|
34
|
+
.get('/integrations')
|
35
|
+
.then(() => undefined)
|
36
|
+
.catch(() => undefined)
|
37
|
+
} catch (e) {
|
38
|
+
throw new Error('@integration-app/sdk error')
|
39
|
+
}
|
40
|
+
return <>SDK</>
|
41
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
/// <reference types="vite/client" />
|
@@ -0,0 +1,25 @@
|
|
1
|
+
{
|
2
|
+
"compilerOptions": {
|
3
|
+
"target": "ES2020",
|
4
|
+
"useDefineForClassFields": true,
|
5
|
+
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
6
|
+
"module": "ESNext",
|
7
|
+
"skipLibCheck": true,
|
8
|
+
|
9
|
+
/* Bundler mode */
|
10
|
+
"moduleResolution": "bundler",
|
11
|
+
"allowImportingTsExtensions": true,
|
12
|
+
"resolveJsonModule": true,
|
13
|
+
"isolatedModules": true,
|
14
|
+
"noEmit": true,
|
15
|
+
"jsx": "react-jsx",
|
16
|
+
|
17
|
+
/* Linting */
|
18
|
+
"strict": true,
|
19
|
+
"noUnusedLocals": true,
|
20
|
+
"noUnusedParameters": true,
|
21
|
+
"noFallthroughCasesInSwitch": true
|
22
|
+
},
|
23
|
+
"include": ["src"],
|
24
|
+
"references": [{ "path": "./tsconfig.node.json" }]
|
25
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html lang="en">
|
3
|
+
<head>
|
4
|
+
<meta charset="UTF-8" />
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
6
|
+
<title>Vite + React + TS</title>
|
7
|
+
</head>
|
8
|
+
<body>
|
9
|
+
<div id="root"></div>
|
10
|
+
<script type="module" src="/src/main.tsx"></script>
|
11
|
+
</body>
|
12
|
+
</html>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
{
|
2
|
+
"name": "vite",
|
3
|
+
"private": true,
|
4
|
+
"version": "0.0.0",
|
5
|
+
"type": "module",
|
6
|
+
"scripts": {
|
7
|
+
"dev": "vite",
|
8
|
+
"build": "tsc && vite build",
|
9
|
+
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
10
|
+
"preview": "vite preview"
|
11
|
+
},
|
12
|
+
"dependencies": {
|
13
|
+
"@integration-app/react": "latest",
|
14
|
+
"@integration-app/sdk": "latest",
|
15
|
+
"react": "^17",
|
16
|
+
"react-dom": "^17"
|
17
|
+
},
|
18
|
+
"devDependencies": {
|
19
|
+
"@types/react": "^17",
|
20
|
+
"@types/react-dom": "^17",
|
21
|
+
"@vitejs/plugin-react": "^4.0.0",
|
22
|
+
"eslint": "^8.45.0",
|
23
|
+
"typescript": "^5.2.2",
|
24
|
+
"vite": "^4.0.0"
|
25
|
+
}
|
26
|
+
}
|
@@ -0,0 +1,41 @@
|
|
1
|
+
import {
|
2
|
+
IntegrationAppProvider,
|
3
|
+
useIntegrations,
|
4
|
+
useActionInstance,
|
5
|
+
} from '@integration-app/react'
|
6
|
+
import { IntegrationAppClient } from '@integration-app/sdk'
|
7
|
+
|
8
|
+
const token =
|
9
|
+
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjEyMzEyMyIsIm5hbWUiOiIxMjMxMjMxMjMiLCJpc3MiOiJlYjc3ZjgzMS0zNjBjLTQ0YmMtOWQzYi0zNDJjYTY5MDU4NGEiLCJleHAiOjE3MjkwODUwNjh9.rDu2Mthgc-j4xVjIfW0Ox_eO50zJKJDUO6a4LnqDH20'
|
10
|
+
|
11
|
+
export function IntegrationsTest() {
|
12
|
+
return (
|
13
|
+
<IntegrationAppProvider token={token}>
|
14
|
+
<IntegrationsTestReact />
|
15
|
+
<IntegrationsTestSdk />
|
16
|
+
</IntegrationAppProvider>
|
17
|
+
)
|
18
|
+
}
|
19
|
+
|
20
|
+
function IntegrationsTestReact() {
|
21
|
+
try {
|
22
|
+
useIntegrations()
|
23
|
+
useActionInstance('some-action-instance-id')
|
24
|
+
} catch (e) {
|
25
|
+
throw new Error('@integration-app/react error')
|
26
|
+
}
|
27
|
+
return <>Integrations</>
|
28
|
+
}
|
29
|
+
|
30
|
+
function IntegrationsTestSdk() {
|
31
|
+
try {
|
32
|
+
const client = new IntegrationAppClient({ token: token })
|
33
|
+
void client
|
34
|
+
.get('/integrations')
|
35
|
+
.then(() => undefined)
|
36
|
+
.catch(() => undefined)
|
37
|
+
} catch (e) {
|
38
|
+
throw new Error('@integration-app/sdk error')
|
39
|
+
}
|
40
|
+
return <>SDK</>
|
41
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
/// <reference types="vite/client" />
|
@@ -0,0 +1,25 @@
|
|
1
|
+
{
|
2
|
+
"compilerOptions": {
|
3
|
+
"target": "ES2020",
|
4
|
+
"useDefineForClassFields": true,
|
5
|
+
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
6
|
+
"module": "ESNext",
|
7
|
+
"skipLibCheck": true,
|
8
|
+
|
9
|
+
/* Bundler mode */
|
10
|
+
"moduleResolution": "bundler",
|
11
|
+
"allowImportingTsExtensions": true,
|
12
|
+
"resolveJsonModule": true,
|
13
|
+
"isolatedModules": true,
|
14
|
+
"noEmit": true,
|
15
|
+
"jsx": "react-jsx",
|
16
|
+
|
17
|
+
/* Linting */
|
18
|
+
"strict": true,
|
19
|
+
"noUnusedLocals": true,
|
20
|
+
"noUnusedParameters": true,
|
21
|
+
"noFallthroughCasesInSwitch": true
|
22
|
+
},
|
23
|
+
"include": ["src"],
|
24
|
+
"references": [{ "path": "./tsconfig.node.json" }]
|
25
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html lang="en">
|
3
|
+
<head>
|
4
|
+
<meta charset="UTF-8" />
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
6
|
+
<title>Vite + React + TS</title>
|
7
|
+
</head>
|
8
|
+
<body>
|
9
|
+
<div id="root"></div>
|
10
|
+
<script type="module" src="/src/main.tsx"></script>
|
11
|
+
</body>
|
12
|
+
</html>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
{
|
2
|
+
"name": "vite",
|
3
|
+
"private": true,
|
4
|
+
"version": "0.0.0",
|
5
|
+
"type": "module",
|
6
|
+
"scripts": {
|
7
|
+
"dev": "vite",
|
8
|
+
"build": "tsc && vite build",
|
9
|
+
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
10
|
+
"preview": "vite preview"
|
11
|
+
},
|
12
|
+
"dependencies": {
|
13
|
+
"@integration-app/react": "latest",
|
14
|
+
"@integration-app/sdk": "latest",
|
15
|
+
"react": "^18",
|
16
|
+
"react-dom": "^18"
|
17
|
+
},
|
18
|
+
"devDependencies": {
|
19
|
+
"@types/react": "^18",
|
20
|
+
"@types/react-dom": "^18",
|
21
|
+
"@vitejs/plugin-react": "^4.0.0",
|
22
|
+
"eslint": "^8.45.0",
|
23
|
+
"typescript": "^5.2.2",
|
24
|
+
"vite": "^4.0.0"
|
25
|
+
}
|
26
|
+
}
|
@@ -0,0 +1,41 @@
|
|
1
|
+
import {
|
2
|
+
IntegrationAppProvider,
|
3
|
+
useIntegrations,
|
4
|
+
useActionInstance,
|
5
|
+
} from '@integration-app/react'
|
6
|
+
import { IntegrationAppClient } from '@integration-app/sdk'
|
7
|
+
|
8
|
+
const token =
|
9
|
+
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjEyMzEyMyIsIm5hbWUiOiIxMjMxMjMxMjMiLCJpc3MiOiJlYjc3ZjgzMS0zNjBjLTQ0YmMtOWQzYi0zNDJjYTY5MDU4NGEiLCJleHAiOjE3MjkwODUwNjh9.rDu2Mthgc-j4xVjIfW0Ox_eO50zJKJDUO6a4LnqDH20'
|
10
|
+
|
11
|
+
export function IntegrationsTest() {
|
12
|
+
return (
|
13
|
+
<IntegrationAppProvider token={token}>
|
14
|
+
<IntegrationsTestReact />
|
15
|
+
<IntegrationsTestSdk />
|
16
|
+
</IntegrationAppProvider>
|
17
|
+
)
|
18
|
+
}
|
19
|
+
|
20
|
+
function IntegrationsTestReact() {
|
21
|
+
try {
|
22
|
+
useIntegrations()
|
23
|
+
useActionInstance('some-action-instance-id')
|
24
|
+
} catch (e) {
|
25
|
+
throw new Error('@integration-app/react error')
|
26
|
+
}
|
27
|
+
return <>Integrations</>
|
28
|
+
}
|
29
|
+
|
30
|
+
function IntegrationsTestSdk() {
|
31
|
+
try {
|
32
|
+
const client = new IntegrationAppClient({ token: token })
|
33
|
+
void client
|
34
|
+
.get('/integrations')
|
35
|
+
.then(() => undefined)
|
36
|
+
.catch(() => undefined)
|
37
|
+
} catch (e) {
|
38
|
+
throw new Error('@integration-app/sdk error')
|
39
|
+
}
|
40
|
+
return <>SDK</>
|
41
|
+
}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import { createRoot } from 'react-dom/client'
|
3
|
+
import { IntegrationsTest } from './IntegrationsTest'
|
4
|
+
|
5
|
+
const container = document.getElementById('root') as HTMLElement
|
6
|
+
const root = createRoot(container)
|
7
|
+
root.render(
|
8
|
+
<React.StrictMode>
|
9
|
+
<IntegrationsTest />
|
10
|
+
</React.StrictMode>,
|
11
|
+
)
|
@@ -0,0 +1 @@
|
|
1
|
+
/// <reference types="vite/client" />
|
@@ -0,0 +1,25 @@
|
|
1
|
+
{
|
2
|
+
"compilerOptions": {
|
3
|
+
"target": "ES2020",
|
4
|
+
"useDefineForClassFields": true,
|
5
|
+
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
6
|
+
"module": "ESNext",
|
7
|
+
"skipLibCheck": true,
|
8
|
+
|
9
|
+
/* Bundler mode */
|
10
|
+
"moduleResolution": "bundler",
|
11
|
+
"allowImportingTsExtensions": true,
|
12
|
+
"resolveJsonModule": true,
|
13
|
+
"isolatedModules": true,
|
14
|
+
"noEmit": true,
|
15
|
+
"jsx": "react-jsx",
|
16
|
+
|
17
|
+
/* Linting */
|
18
|
+
"strict": true,
|
19
|
+
"noUnusedLocals": true,
|
20
|
+
"noUnusedParameters": true,
|
21
|
+
"noFallthroughCasesInSwitch": true
|
22
|
+
},
|
23
|
+
"include": ["src"],
|
24
|
+
"references": [{ "path": "./tsconfig.node.json" }]
|
25
|
+
}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
const integrationAppReact = require('@integration-app/react')
|
2
|
+
|
3
|
+
if (typeof integrationAppReact !== 'object') {
|
4
|
+
throw new Error('React package is not exported')
|
5
|
+
}
|
6
|
+
|
7
|
+
if (typeof integrationAppReact.useIntegrationApp !== 'function') {
|
8
|
+
throw new Error(
|
9
|
+
'React package is not exported correctly. useIntegrationApp is missed',
|
10
|
+
)
|
11
|
+
}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import * as integrationAppReact from '@integration-app/react'
|
2
|
+
|
3
|
+
if (typeof integrationAppReact !== 'object') {
|
4
|
+
throw new Error('React package is not exported')
|
5
|
+
}
|
6
|
+
|
7
|
+
if (typeof integrationAppReact.useIntegrationApp !== 'function') {
|
8
|
+
throw new Error(
|
9
|
+
'React package is not exported correctly. useIntegrationApp is missed',
|
10
|
+
)
|
11
|
+
}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
/*
|
2
|
+
# Testing UMD Bundle
|
3
|
+
|
4
|
+
The Universal Module Definition (UMD) format is compatible with the CommonJS (CJS) format,
|
5
|
+
and we are using it for testing purposes.
|
6
|
+
|
7
|
+
1) Import the UMD file directly
|
8
|
+
|
9
|
+
We cannot use require('@integration-app/react') as it returns a CJS module.
|
10
|
+
To import the UMD file, we need to import it directly from the node_modules folder.
|
11
|
+
|
12
|
+
2) Verify the variable exists
|
13
|
+
|
14
|
+
*/
|
15
|
+
const integrationAppReact = require('./node_modules/@integration-app/react/dist/index.umd.js')
|
16
|
+
|
17
|
+
if (typeof integrationAppReact !== 'object') {
|
18
|
+
throw new Error('React package is not exported')
|
19
|
+
}
|
20
|
+
|
21
|
+
if (typeof integrationAppReact.useIntegrationApp !== 'function') {
|
22
|
+
throw new Error(
|
23
|
+
'React package is not exported correctly. useIntegrationApp is missed',
|
24
|
+
)
|
25
|
+
}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
|
3
|
+
ColorOff='\033[0m' # Text Reset
|
4
|
+
Red='\033[0;31m' # Red
|
5
|
+
BRed='\033[1;31m' # Bold Red
|
6
|
+
BGreen='\033[1;32m' # Bold Green
|
7
|
+
|
8
|
+
rm -rf node_modules
|
9
|
+
|
10
|
+
npm install --quiet
|
11
|
+
|
12
|
+
check_bundle() {
|
13
|
+
OUTPUT=$(node $2 2>&1)
|
14
|
+
|
15
|
+
if [ "${OUTPUT}" = "" ]
|
16
|
+
then
|
17
|
+
echo -e "${BGreen}SUCCESS: ${1}${ColorOff}"
|
18
|
+
else
|
19
|
+
echo -e "${BRed}FAIL: ${1}${ColorOff}"
|
20
|
+
echo -e "${Red}${OUTPUT}${ColorOff}\n"
|
21
|
+
exit 1;
|
22
|
+
fi
|
23
|
+
}
|
24
|
+
|
25
|
+
check_bundle "CommonJS build" "./test-cjs.js"
|
26
|
+
check_bundle "ESModule build" "./test-esm.mjs"
|
27
|
+
check_bundle "UMD build" "./test-umd.js"
|
28
|
+
|
29
|
+
exit 0;
|
package/dist/index.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import * as _integration_app_sdk from '@integration-app/sdk';
|
2
|
-
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, UpdateDataSourceRequest, DataSourceAccessor, DataSourceInstanceSelector, CreateDataSourceInstanceRequest, DataSourceInstance, UpdateDataSourceInstanceRequest, DataSourceInstanceAccessor, OpenDataSourceConfigurationOptions, DataCollectionListRequest, DataCollectionFindRequest, DataCollectionCreateRequest, DataCollectionUpdateRequest, DataCollectionSpec, FindDataSourceInstancesQuery, FindDataSourcesQuery, AppEventSubscriptionSelector, AppEventSubscriptionAccessor, AppEventSubscription, AppEventSubscriptionUpdateRequest, FindAppEventSubscriptionsQuery, AppEventTypeAccessor, AppEventType, CreateAppEventTypeRequest, UpdateAppEventTypeRequest, FindAppEventTypesQuery, FindAppEventsQuery, AppEvent, AppDataSchemaAccessor, AppDataSchema, CreateAppDataSchemaRequest, UpdateAppDataSchemaRequest, FindAppDataSchemasQuery, AppDataSchemaInstanceSelector, CreateAppDataSchemaInstanceRequest, AppDataSchemaInstance, UpdateAppDataSchemaInstanceRequest, AppDataSchemaInstanceAccessor, FindAppDataSchemaInstancesQuery, FlowSelector, CreateFlowRequest, Flow, UpdateFlowRequest, FlowAccessor, FindFlowsQuery, FlowInstanceSelector,
|
2
|
+
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, UpdateDataSourceRequest, DataSourceAccessor, DataSourceInstanceSelector, CreateDataSourceInstanceRequest, DataSourceInstance, UpdateDataSourceInstanceRequest, DataSourceInstanceAccessor, OpenDataSourceConfigurationOptions, DataCollectionListRequest, DataCollectionFindRequest, DataCollectionCreateRequest, DataCollectionUpdateRequest, DataCollectionSpec, FindDataSourceInstancesQuery, FindDataSourcesQuery, AppEventSubscriptionSelector, AppEventSubscriptionAccessor, AppEventSubscription, AppEventSubscriptionUpdateRequest, FindAppEventSubscriptionsQuery, AppEventTypeAccessor, AppEventType, CreateAppEventTypeRequest, UpdateAppEventTypeRequest, FindAppEventTypesQuery, FindAppEventsQuery, AppEvent, AppDataSchemaAccessor, AppDataSchema, CreateAppDataSchemaRequest, UpdateAppDataSchemaRequest, FindAppDataSchemasQuery, AppDataSchemaInstanceSelector, CreateAppDataSchemaInstanceRequest, AppDataSchemaInstance, UpdateAppDataSchemaInstanceRequest, AppDataSchemaInstanceAccessor, FindAppDataSchemaInstancesQuery, FlowSelector, CreateFlowRequest, Flow, UpdateFlowRequest, FlowAccessor, FindFlowsQuery, FlowInstanceSelector, CreateFlowInstanceRequestById, FlowInstance, UpdateFlowInstanceRequest, FlowInstanceAccessor, ResetFlowInstanceOptions, OpenFlowInstanceConfigurationOptions, RunFlowOptions, FindFlowInstancesQuery, FlowRun, FindFlowRunsQuery, 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, CustomerSelector, CustomerAccessor, Customer, CreateCustomerRequest, UpdateCustomerRequest, FindCustomersQuery, ScenarioAccessor, Scenario, CreateScenarioRequest, UpdateScenarioRequest, FindScenariosQuery, FindExternalEventSubscriptionsQuery, ExternalEventSubscription, ExternalEventSubscriptionAccessor } from '@integration-app/sdk';
|
3
3
|
export * from '@integration-app/sdk';
|
4
4
|
export { DataForm } from '@integration-app/sdk';
|
5
5
|
import { ReactNode } from 'react';
|
@@ -344,7 +344,7 @@ declare function useFlowInstance(selector: string | FlowInstanceSelector | undef
|
|
344
344
|
saving: boolean;
|
345
345
|
error: any;
|
346
346
|
refreshing: boolean;
|
347
|
-
create: (data:
|
347
|
+
create: (data: CreateFlowInstanceRequestById) => Promise<FlowInstance | undefined>;
|
348
348
|
patch: (data: Partial<UpdateFlowInstanceRequest>) => Promise<void>;
|
349
349
|
put: (data: UpdateFlowInstanceRequest) => Promise<void>;
|
350
350
|
archive: () => Promise<void>;
|
@@ -353,7 +353,7 @@ declare function useFlowInstance(selector: string | FlowInstanceSelector | undef
|
|
353
353
|
refresh: () => Promise<FlowInstance>;
|
354
354
|
enable: () => Promise<void>;
|
355
355
|
disable: () => Promise<void>;
|
356
|
-
reset: () => Promise<void>;
|
356
|
+
reset: (options?: ResetFlowInstanceOptions) => Promise<void>;
|
357
357
|
setup: () => Promise<void>;
|
358
358
|
openConfiguration: (options: OpenFlowInstanceConfigurationOptions) => Promise<void | undefined>;
|
359
359
|
run: (options?: RunFlowOptions) => Promise<_integration_app_sdk.FlowRun | undefined>;
|