@seeka-labs/cli-apps 2.2.6 → 3.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +46919 -35
- package/dist/index.js.map +4 -4
- package/dist/init-template/.gitlab-ci.yml +29 -8
- package/dist/init-template/.nvmrc +1 -0
- package/dist/init-template/README.md +18 -3
- package/dist/init-template/app/{server-azure-function/.eslintrc.cjs → .eslintrc.cjs} +2 -0
- package/dist/init-template/app/browser/README.md +1 -1
- package/dist/init-template/app/browser/package.json +22 -24
- package/dist/init-template/app/browser/scripts/esbuild/build-browser-plugin.mjs +14 -6
- package/dist/init-template/app/browser/src/browser.ts +6 -6
- package/dist/init-template/app/browser/src/plugin/index.ts +57 -44
- package/dist/init-template/app/browser/tsconfig.json +1 -2
- package/dist/init-template/app/lib/package.json +46 -0
- package/dist/init-template/app/lib/src/index.ts +4 -0
- package/dist/init-template/app/lib/src/models/index.ts +29 -0
- package/dist/init-template/app/lib/src/validation/index.ts +14 -0
- package/dist/init-template/app/lib/tsconfig.json +22 -0
- package/dist/init-template/app/server-azurefunc/.eslintrc.cjs +4 -0
- package/dist/init-template/app/{server-azure-function → server-azurefunc}/.funcignore +0 -3
- package/dist/init-template/app/{server-azure-function → server-azurefunc}/README.md +3 -3
- package/dist/init-template/app/{server-azure-function → server-azurefunc}/host.json +11 -0
- package/dist/init-template/app/server-azurefunc/package.json +69 -0
- package/dist/init-template/app/server-azurefunc/scripts/dev-queue-setup.js +18 -0
- package/dist/init-template/app/{server-azure-function → server-azurefunc}/scripts/ngrok.js +4 -1
- package/dist/init-template/app/server-azurefunc/src/app/api/router.ts +14 -0
- package/dist/init-template/app/server-azurefunc/src/app/api/routes/getInstallationSettings.ts +13 -0
- package/dist/init-template/app/server-azurefunc/src/app/api/routes/setInstallationSettings.ts +35 -0
- package/dist/init-template/app/server-azurefunc/src/app/jobs/index.ts +61 -0
- package/dist/init-template/app/server-azurefunc/src/app/logging/index.ts +4 -0
- package/dist/init-template/app/server-azurefunc/src/app/models/index.ts +12 -0
- package/dist/init-template/app/server-azurefunc/src/app/services/activites.ts +8 -0
- package/dist/init-template/app/{server-azure-function → server-azurefunc}/src/functions/healthCheck.ts +7 -1
- package/dist/init-template/app/server-azurefunc/src/functions/seekaAppWebhook.ts +201 -0
- package/dist/init-template/app/server-azurefunc/src/functions/trackActivityQueueHandler.ts +48 -0
- package/dist/init-template/app/server-azurefunc/src/functions/ui.ts +46 -0
- package/dist/init-template/app/{server-azure-function/local.settings.example.json → server-azurefunc/template.settings.json} +18 -10
- package/dist/init-template/app/{server-azure-function → server-azurefunc}/tsconfig.json +8 -2
- package/dist/init-template/app/ui/.env +9 -0
- package/dist/init-template/app/ui/README.md +40 -0
- package/dist/init-template/app/ui/index.html +21 -0
- package/dist/init-template/app/ui/package.json +72 -0
- package/dist/init-template/app/ui/public/favicon.ico +0 -0
- package/dist/init-template/app/ui/scripts/copy-output.mjs +30 -0
- package/dist/init-template/app/ui/src/App.tsx +72 -0
- package/dist/init-template/app/ui/src/assets/app-icon.svg +1 -0
- package/dist/init-template/app/ui/src/components/setup/steps/complete/index.tsx +32 -0
- package/dist/init-template/app/ui/src/components/setup/steps/first/index.tsx +27 -0
- package/dist/init-template/app/ui/src/components/setup/steps/index.tsx +22 -0
- package/dist/init-template/app/ui/src/components/setup/steps/second/index.tsx +29 -0
- package/dist/init-template/app/ui/src/index.tsx +45 -0
- package/dist/init-template/app/ui/src/routes/home/index.tsx +21 -0
- package/dist/init-template/app/ui/src/vite-env.d.ts +13 -0
- package/dist/init-template/app/ui/tsconfig.json +35 -0
- package/dist/init-template/app/ui/tsconfig.node.json +10 -0
- package/dist/init-template/app/ui/vite.config.mts +48 -0
- package/dist/init-template/package.json +19 -11
- package/dist/init-template/tsconfig.json +5 -6
- package/package.json +13 -4
- package/dist/init-template/app/browser/jest.config.js +0 -11
- package/dist/init-template/app/browser/src/plugin/index.test.ts +0 -6
- package/dist/init-template/app/server-azure-function/.nvmrc +0 -1
- package/dist/init-template/app/server-azure-function/package.json +0 -51
- package/dist/init-template/app/server-azure-function/src/functions/pollingExample.ts +0 -39
- package/dist/init-template/app/server-azure-function/src/functions/queueExample.ts +0 -67
- package/dist/init-template/app/server-azure-function/src/functions/seekaAppWebhook.ts +0 -236
- package/dist/init-template/app/server-azure-function/src/lib/browser/index.ts +0 -55
- package/dist/init-template/app/server-azure-function/src/lib/jobs/index.ts +0 -96
- package/dist/init-template/app/server-azure-function/src/lib/logging/index.ts +0 -93
- package/dist/init-template/app/server-azure-function/src/lib/models/index.ts +0 -7
- package/dist/init-template/app/server-azure-function/src/lib/services/index.ts +0 -41
- package/dist/init-template/app/server-azure-function/src/lib/state/redis/index.ts +0 -96
- package/dist/init-template/app/server-azure-function/src/lib/state/seeka/installations.ts +0 -65
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@example-org-name/example-app-name-ui",
|
|
3
|
+
"version": "3.2.3",
|
|
4
|
+
"description": "Seeka app UI for example-app-name",
|
|
5
|
+
"author": "Seeka <administrator@seeka.co>",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"homepage": "/app",
|
|
8
|
+
"private": true,
|
|
9
|
+
"dependencies": {
|
|
10
|
+
"@emotion/react": "^11",
|
|
11
|
+
"@emotion/styled": "^11",
|
|
12
|
+
"@example-org-name/example-app-name-lib": "workspace:*",
|
|
13
|
+
"@hookform/resolvers": "^5",
|
|
14
|
+
"@mui/icons-material": "7",
|
|
15
|
+
"@mui/lab": "7.0.1-beta.20",
|
|
16
|
+
"@mui/material": "^7",
|
|
17
|
+
"@mui/styles": "^6",
|
|
18
|
+
"@mui/system": "^7",
|
|
19
|
+
"@reduxjs/toolkit": "^2",
|
|
20
|
+
"@seeka-labs/converge": "^1",
|
|
21
|
+
"@seeka-labs/sdk-apps-core": "../../workspace:* || ^3",
|
|
22
|
+
"@seeka-labs/sdk-apps-react": "../../workspace:* || ^3",
|
|
23
|
+
"lodash-es": "^4",
|
|
24
|
+
"material-ui-confirm": "^4",
|
|
25
|
+
"notistack": "^3",
|
|
26
|
+
"query-string": "^9",
|
|
27
|
+
"react": "^18",
|
|
28
|
+
"react-dom": "^18",
|
|
29
|
+
"react-hook-form": "^7",
|
|
30
|
+
"react-redux": "^9",
|
|
31
|
+
"react-router-dom": "^7",
|
|
32
|
+
"redux": "^5",
|
|
33
|
+
"redux-persist": "^6",
|
|
34
|
+
"uuid": "^13",
|
|
35
|
+
"vite-plugin-svgr": "^4",
|
|
36
|
+
"yup": "^1"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@types/fs-extra": "^11",
|
|
40
|
+
"@types/lodash-es": "^4",
|
|
41
|
+
"@types/react": "^18",
|
|
42
|
+
"@types/react-dom": "^18",
|
|
43
|
+
"@vitejs/plugin-react": "^5",
|
|
44
|
+
"cross-env": "^10",
|
|
45
|
+
"fs-extra": "^11",
|
|
46
|
+
"rimraf": "^6",
|
|
47
|
+
"typescript": "^5",
|
|
48
|
+
"vite": "^7"
|
|
49
|
+
},
|
|
50
|
+
"scripts": {
|
|
51
|
+
"start": "vite",
|
|
52
|
+
"typecheck": "tsc --noEmit",
|
|
53
|
+
"clean": "rimraf build package dist",
|
|
54
|
+
"copy-output": "node ./scripts/copy-output.mjs",
|
|
55
|
+
"dev": "cross-env NODE_ENV=development cross-env VITE_RELEASE_TAG=$(date +%Y%m%d%H%M%S) cross-env VITE_BASE_URL=/app/ vite",
|
|
56
|
+
"build": "vite build && yarn copy-output",
|
|
57
|
+
"build:dev": "cross-env NODE_ENV=development VITE_RELEASE_TAG=$(date +%Y%m%d%H%M%S) VITE_BASE_URL=/app/ vite build --watch",
|
|
58
|
+
"preview": "vite preview"
|
|
59
|
+
},
|
|
60
|
+
"browserslist": {
|
|
61
|
+
"production": [
|
|
62
|
+
">0.2%",
|
|
63
|
+
"not dead",
|
|
64
|
+
"not op_mini all"
|
|
65
|
+
],
|
|
66
|
+
"development": [
|
|
67
|
+
"last 1 chrome version",
|
|
68
|
+
"last 1 firefox version",
|
|
69
|
+
"last 1 safari version"
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
|
|
2
|
+
import { existsSync, mkdirSync, cpSync } from 'fs';
|
|
3
|
+
import { resolve } from 'path';
|
|
4
|
+
import {rmSync} from "node:fs";
|
|
5
|
+
|
|
6
|
+
const postBuild = () => {
|
|
7
|
+
const serverDirNames = ['server-azurefunc']
|
|
8
|
+
|
|
9
|
+
serverDirNames.forEach(dirName => {
|
|
10
|
+
if (existsSync(resolve(`../${dirName}`))) {
|
|
11
|
+
|
|
12
|
+
if (!existsSync(resolve(`../${dirName}/dist/src/ui`))) {
|
|
13
|
+
mkdirSync(resolve(`../${dirName}/dist/src/ui`), {
|
|
14
|
+
recursive: true,
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
rmSync(resolve(`../${dirName}/dist/src/ui`), { recursive: true });
|
|
18
|
+
mkdirSync(resolve(`../${dirName}/dist/src/ui`), {
|
|
19
|
+
recursive: true,
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
// Copy all files in current working dir ../build dir and all files to `../${dirName}/dist/src/ui
|
|
23
|
+
cpSync(resolve(`./build`), resolve(`../${dirName}/dist/src/ui/build`), {
|
|
24
|
+
recursive: true,
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
})
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
postBuild();
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { Container, Paper } from '@mui/material';
|
|
2
|
+
import Box from '@mui/material/Box';
|
|
3
|
+
import { ConfirmProvider } from 'material-ui-confirm';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import {
|
|
6
|
+
createBrowserRouter,
|
|
7
|
+
Outlet,
|
|
8
|
+
RouterProvider,
|
|
9
|
+
} from "react-router-dom";
|
|
10
|
+
import { Index } from './routes/home';
|
|
11
|
+
import {TokenProvider, SeekaCoreApiReduxProvider} from "@seeka-labs/sdk-apps-react";
|
|
12
|
+
import {ExampleAppAppUiClientInitConfig} from "@example-org-name/example-app-name-lib";
|
|
13
|
+
|
|
14
|
+
let basename = (import.meta as any).env.BASE_URL
|
|
15
|
+
// trim last /
|
|
16
|
+
basename = basename.substring(0, basename.length - 1);
|
|
17
|
+
|
|
18
|
+
function AppLayout() {
|
|
19
|
+
return (
|
|
20
|
+
<TokenProvider>
|
|
21
|
+
<SeekaCoreApiReduxProvider>
|
|
22
|
+
<ConfirmProvider>
|
|
23
|
+
<Outlet />
|
|
24
|
+
</ConfirmProvider>
|
|
25
|
+
</SeekaCoreApiReduxProvider>
|
|
26
|
+
</TokenProvider>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const router = createBrowserRouter([
|
|
31
|
+
{
|
|
32
|
+
element: <AppLayout />,
|
|
33
|
+
children: [
|
|
34
|
+
{ path: '/', element: <Index /> },
|
|
35
|
+
// other routes…
|
|
36
|
+
],
|
|
37
|
+
},
|
|
38
|
+
], { basename });
|
|
39
|
+
|
|
40
|
+
declare global {
|
|
41
|
+
interface Window {
|
|
42
|
+
seekaAppConfig: ExampleAppAppUiClientInitConfig
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export default function App() {
|
|
47
|
+
const [loaded, setLoaded] = React.useState(Boolean(window.seekaAppConfig));
|
|
48
|
+
|
|
49
|
+
let interval: any = null;
|
|
50
|
+
if (!loaded && !interval) {
|
|
51
|
+
interval = setInterval(() => {
|
|
52
|
+
setLoaded(Boolean(window.seekaAppConfig || process.env.NODE_ENV === 'development'));
|
|
53
|
+
}, 200);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
React.useEffect(() => {
|
|
57
|
+
if (loaded && interval) {
|
|
58
|
+
clearInterval(interval);
|
|
59
|
+
}
|
|
60
|
+
}, [loaded]);
|
|
61
|
+
|
|
62
|
+
return (
|
|
63
|
+
!loaded ? <></> : (
|
|
64
|
+
<Box sx={{ my: 4, mx: 2 }}>
|
|
65
|
+
<Container maxWidth='lg'>
|
|
66
|
+
<Paper sx={{ bgcolor: 'white', p: 3 }} elevation={0}>
|
|
67
|
+
<RouterProvider router={router} />
|
|
68
|
+
</Paper></Container>
|
|
69
|
+
</Box>
|
|
70
|
+
)
|
|
71
|
+
);
|
|
72
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<?xml version='1.0' encoding='utf-8'?><!-- Generator: Adobe Illustrator 25.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) --><svg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 268.4 84.7' style='enable-background:new 0 0 268.4 84.7;' xml:space='preserve'><style type='text/css'> .st0{fill:#722ED1;} .st1{enable-background:new ;} </style><path d='M0,72.5c0,6.7,5.5,12.2,12.2,12.2l0,0l0,0l0,0c3.2,0,6.3-1.3,8.6-3.6l12.5-12.6c-0.4,0-0.7,0-1.1,0l0,0 c-4.2,0-8.4-1.7-11.4-4.7l-8.6-8.6l-8.6,8.6C1.3,66.1,0,69.3,0,72.5z'/><g><path d='M40.9,3.6C38.6,1.3,35.6,0,32.3,0S26,1.3,23.7,3.6L11.1,16.1c0.4,0,0.7,0,1.1,0c4.1,0,8.3,1.6,11.5,4.7l8.6,8.6l8.6-8.6 C45.7,16.1,45.7,8.3,40.9,3.6z'/><path d='M2.2,22.2L2.2,22.2L2.2,22.2z'/></g><path class='st0' d='M3.7,41L3.7,41c2.3,2.3,5.3,3.5,8.5,3.5c0,0,0,0,0.1,0c3.2,0,6.3-1.3,8.6-3.6l8.6-8.6l-8.6-8.6 c-2.4-2.4-5.5-3.6-8.6-3.6S6,21.3,3.6,23.7C-1.2,28.4-1.2,36.2,3.7,41L3.7,41z'/><g class='st1'><path d='M76.3,62.6C66,62.6,59.7,57.2,59.6,49h12.5c0,2.8,1.9,4,4.4,4c1.9,0,3.7-1,3.7-2.9c0-2.2-2.9-2.8-6.5-3.4 c-5.9-1-13.6-2.7-13.6-11.9c0-7.6,6.5-12.5,16.1-12.5s15.9,5.1,16,12.8H80.1c0-2.4-1.6-3.5-4-3.5c-2.1,0-3.5,1-3.5,2.8 c0,2.2,2.9,2.7,6.5,3.3C85,38.7,93,40,93,49.5C93,57.4,86.3,62.6,76.3,62.6L76.3,62.6z'/></g><g class='st1'><path d='M138,42.1c0,1.1-0.1,2.3-0.3,3.4h-28.1c0.9,4.3,3.6,6.6,7.7,6.6c3,0,5.6-1.3,6.8-3.5h13c-2.7,8.6-10.3,14-19.8,14 c-11.8,0-20.5-8.6-20.5-20.2s8.7-20.1,20.5-20.1C129.6,22.3,138,31,138,42.1L138,42.1z M109.9,38.3h15.3c-1.1-3.8-3.9-5.8-7.8-5.8 C113.6,32.5,111,34.6,109.9,38.3z'/></g><g class='st1'><path d='M183.6,42.1c0,1.1-0.1,2.3-0.3,3.4h-28.1c0.9,4.3,3.6,6.6,7.7,6.6c3,0,5.6-1.3,6.8-3.5h13c-2.7,8.6-10.3,14-19.8,14 c-11.8,0-20.5-8.6-20.5-20.2s8.7-20.1,20.5-20.1C175.1,22.3,183.6,31,183.6,42.1L183.6,42.1z M155.5,38.3h15.3 c-1.1-3.8-3.9-5.8-7.8-5.8C159.2,32.5,156.5,34.6,155.5,38.3z'/></g><g class='st1'><path d='M211.1,61.4l-9.5-16v16h-13V9.9h13v28.5l9-14.8h14.6l-11.8,18l13,19.8H211.1z'/><path d='M268.4,23.5v37.8h-10.1l-1.1-2.7c-3.1,2.5-7,4-11.4,4c-11.6,0-19.8-8.4-19.8-20.2c0-11.7,8.3-20,19.8-20 c4.5,0,8.4,1.5,11.6,4.1l1.3-2.9L268.4,23.5z M256,42.5c0-4.9-3.6-8.6-8.5-8.6s-8.5,3.7-8.5,8.6s3.6,8.6,8.5,8.6S256,47.4,256,42.5 z'/></g><path d='M12.2,48.5c-0.3,0-0.7,0-1,0L23.7,61c2.3,2.3,5.4,3.6,8.6,3.6l0,0l0,0l0,0c3.3,0,6.3-1.3,8.6-3.6c4.8-4.8,4.7-12.5,0-17.3 l-8.6-8.6l-8.6,8.6C20.7,46.8,16.5,48.5,12.2,48.5L12.2,48.5z'/></svg>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Button, Typography } from "@mui/material"
|
|
2
|
+
import { Stack } from "@mui/system"
|
|
3
|
+
import {SeekaAppWizardStep, SeekaAppWizardHeading, SeekaAppWizardStepContent, SeekaBotHappy, SeekaAppWizardStepActions, sendSeekaCoreAppCommand} from "@seeka-labs/sdk-apps-react";
|
|
4
|
+
|
|
5
|
+
type Props = {
|
|
6
|
+
onBack?: () => void
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const AppSetupCompletedStep = ({ onBack }: Props) => {
|
|
10
|
+
return (
|
|
11
|
+
<SeekaAppWizardStep>
|
|
12
|
+
<Stack direction={"row"} sx={{ width: '100%' }} gap={12} alignItems="center" justifyContent={"center"}>
|
|
13
|
+
<SeekaBotHappy style={{ width: '260px' }} />
|
|
14
|
+
<Stack gap={6} alignItems="flex-start" justifyContent={"center"}>
|
|
15
|
+
<Stack gap={3}>
|
|
16
|
+
<SeekaAppWizardHeading title="Success!" />_b
|
|
17
|
+
|
|
18
|
+
<Typography>ExampleApp™ is now connected to Seeka</Typography>
|
|
19
|
+
</Stack>
|
|
20
|
+
|
|
21
|
+
<SeekaAppWizardStepActions StackProps={{ gap: 3 }}>
|
|
22
|
+
<Button variant='text' color="primary" onClick={onBack}>Back</Button>
|
|
23
|
+
<Button variant='contained' color="primary" onClick={() => sendSeekaCoreAppCommand('dashboard')}>Back to dashboard</Button>
|
|
24
|
+
<Button variant='outlined' color="primary" onClick={() => sendSeekaCoreAppCommand('appsList')}>Connect another app</Button>
|
|
25
|
+
</SeekaAppWizardStepActions>
|
|
26
|
+
</Stack>
|
|
27
|
+
|
|
28
|
+
</Stack>
|
|
29
|
+
|
|
30
|
+
</SeekaAppWizardStep>
|
|
31
|
+
)
|
|
32
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Button } from "@mui/material"
|
|
2
|
+
import seekaAppIcon from '../../../../assets/app-icon.svg'
|
|
3
|
+
import {SeekaAppWizardStep, SeekaAppWizardHeading, SeekaAppWizardStepContent, SeekaAppWizardStepActions} from "@seeka-labs/sdk-apps-react";
|
|
4
|
+
|
|
5
|
+
type Props = {
|
|
6
|
+
onNext?: () => void
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const AppSetupFirstStep = ({ onNext }: Props) => { return (
|
|
10
|
+
<SeekaAppWizardStep>
|
|
11
|
+
<SeekaAppWizardHeading title="Connect to ExampleApp™" image={seekaAppIcon}>
|
|
12
|
+
Connecting your ExampleApp™ to Seeka is super easy and can be done in around 3 minutes by anyone with Admin access to ExampleApp™.
|
|
13
|
+
</SeekaAppWizardHeading>
|
|
14
|
+
<SeekaAppWizardStepContent title="Instructions" subtitle="Authenticate ExampleApp">
|
|
15
|
+
<ol>
|
|
16
|
+
<li>Click the Authenticate ExampleApp button</li>
|
|
17
|
+
<li>Select the account that is authorised to your ExampleApp™ account</li>
|
|
18
|
+
<li>Follow the guided prompts to authorise Seeka.</li>
|
|
19
|
+
</ol>
|
|
20
|
+
</SeekaAppWizardStepContent>
|
|
21
|
+
|
|
22
|
+
<SeekaAppWizardStepActions>
|
|
23
|
+
{onNext && <Button variant='contained' color="primary" onClick={onNext}>Next</Button>}
|
|
24
|
+
</SeekaAppWizardStepActions>
|
|
25
|
+
</SeekaAppWizardStep>
|
|
26
|
+
)
|
|
27
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
|
|
2
|
+
import { Box } from "@mui/material";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { AppSetupFirstStep } from "./first";
|
|
5
|
+
import { AppSetupSecondStep } from "./second";
|
|
6
|
+
import { AppSetupCompletedStep } from "./complete";
|
|
7
|
+
import {SeekaAppLoadingSpinner} from "@seeka-labs/sdk-apps-react";
|
|
8
|
+
|
|
9
|
+
export const SetupSteps = () => {
|
|
10
|
+
const [activeStep, setActiveStep] = useState<number | null>(0)
|
|
11
|
+
const [loading, setLoading] = useState(true)
|
|
12
|
+
|
|
13
|
+
if (activeStep === null || loading) return <Box><SeekaAppLoadingSpinner /></Box>
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<Box>
|
|
17
|
+
{activeStep === 0 && <AppSetupFirstStep onNext={() => setActiveStep(1)} />}
|
|
18
|
+
{activeStep === 0 && <AppSetupSecondStep onNext={() => setActiveStep(2)} onBack={() => setActiveStep(1)} />}
|
|
19
|
+
{activeStep === 3 && <AppSetupCompletedStep onBack={() => setActiveStep(1)} />}
|
|
20
|
+
</Box>
|
|
21
|
+
)
|
|
22
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import {SeekaAppWizardStep, SeekaAppWizardHeading, SeekaAppWizardStepContent, SeekaAppWizardStepActions} from "@seeka-labs/sdk-apps-react";
|
|
2
|
+
import { Button } from "@mui/material"
|
|
3
|
+
import seekaAppIcon from '../../../../assets/app-icon.svg'
|
|
4
|
+
|
|
5
|
+
type Props = {
|
|
6
|
+
onNext?: () => void
|
|
7
|
+
onBack?: () => void
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const AppSetupSecondStep = ({ onNext, onBack }: Props) => { return (
|
|
11
|
+
<SeekaAppWizardStep>
|
|
12
|
+
<SeekaAppWizardHeading title="Connect to ExampleApp™" image={seekaAppIcon}>
|
|
13
|
+
Update app settings
|
|
14
|
+
</SeekaAppWizardHeading>
|
|
15
|
+
<SeekaAppWizardStepContent title="Instructions" subtitle="ExampleApp settings">
|
|
16
|
+
<ol>
|
|
17
|
+
<li>Click the Authenticate ExampleApp button</li>
|
|
18
|
+
<li>Select the account that is authorised to your ExampleApp™ account</li>
|
|
19
|
+
<li>Follow the guided prompts to authorise Seeka.</li>
|
|
20
|
+
</ol>
|
|
21
|
+
</SeekaAppWizardStepContent>
|
|
22
|
+
|
|
23
|
+
<SeekaAppWizardStepActions>
|
|
24
|
+
{onBack && <Button variant='text' color="primary" onClick={onBack}>Back</Button>}
|
|
25
|
+
{onNext && <Button variant='contained' color="primary" onClick={onNext}>Next</Button>}
|
|
26
|
+
</SeekaAppWizardStepActions>
|
|
27
|
+
</SeekaAppWizardStep>
|
|
28
|
+
)
|
|
29
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import CssBaseline from '@mui/material/CssBaseline';
|
|
2
|
+
import { ThemeProvider } from '@mui/material/styles';
|
|
3
|
+
import { SnackbarProvider } from 'notistack';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import * as ReactDOM from 'react-dom/client';
|
|
6
|
+
import App from './App';
|
|
7
|
+
|
|
8
|
+
import { fetchBaseQuery } from '@reduxjs/toolkit/query';
|
|
9
|
+
|
|
10
|
+
import { appAccessTokenQueryParamName, coreApiAccessTokenQueryParamName } from '@seeka-labs/sdk-apps-core';
|
|
11
|
+
import queryString from 'query-string';
|
|
12
|
+
import {SeekaAppMaterialUiTheme, setBaseQueryFn} from "@seeka-labs/sdk-apps-react";
|
|
13
|
+
|
|
14
|
+
setBaseQueryFn(
|
|
15
|
+
fetchBaseQuery({
|
|
16
|
+
baseUrl: (import.meta as any).env.VITE_URLS_SEEKA_API_CORE || "https://api.seeka.services",
|
|
17
|
+
prepareHeaders(headers, api) {
|
|
18
|
+
const searchParams = new URLSearchParams(location.search);
|
|
19
|
+
const appAccessToken = searchParams.get(appAccessTokenQueryParamName);
|
|
20
|
+
const coreApiAccessToken = searchParams.get(coreApiAccessTokenQueryParamName);
|
|
21
|
+
|
|
22
|
+
headers.set('Authorization', 'Bearer ' + coreApiAccessToken);
|
|
23
|
+
return headers;
|
|
24
|
+
},
|
|
25
|
+
paramsSerializer(params) {
|
|
26
|
+
return queryString.stringify(params);
|
|
27
|
+
},
|
|
28
|
+
})
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
const rootElement = document.getElementById('root');
|
|
32
|
+
const root = ReactDOM.createRoot(rootElement!);
|
|
33
|
+
|
|
34
|
+
root.render(
|
|
35
|
+
<React.StrictMode>
|
|
36
|
+
<ThemeProvider theme={SeekaAppMaterialUiTheme}>
|
|
37
|
+
<CssBaseline />
|
|
38
|
+
|
|
39
|
+
<SnackbarProvider anchorOrigin={{ horizontal: 'right', vertical: 'top' }} >
|
|
40
|
+
<App />
|
|
41
|
+
</SnackbarProvider>
|
|
42
|
+
|
|
43
|
+
</ThemeProvider>
|
|
44
|
+
</React.StrictMode>
|
|
45
|
+
);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SetupSteps } from "@/components/setup/steps";
|
|
2
|
+
import { Alert, AlertTitle, Container } from "@mui/material";
|
|
3
|
+
import { useLocation } from 'react-router-dom';
|
|
4
|
+
|
|
5
|
+
export const Index = () => {
|
|
6
|
+
const location = useLocation();
|
|
7
|
+
const searchParams = new URLSearchParams(location.search);
|
|
8
|
+
const errorMessage = searchParams.get('error') || null;
|
|
9
|
+
|
|
10
|
+
if (errorMessage) {
|
|
11
|
+
return (
|
|
12
|
+
<Container maxWidth="md">
|
|
13
|
+
<Alert severity="error"><AlertTitle>Error</AlertTitle>{errorMessage}</Alert>
|
|
14
|
+
</Container>
|
|
15
|
+
)
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<SetupSteps />
|
|
20
|
+
);
|
|
21
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="vite/client" />
|
|
2
|
+
/// <reference types="vite-plugin-svgr/client" />
|
|
3
|
+
interface ViteTypeOptions {
|
|
4
|
+
strictImportMetaEnv: unknown
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
interface ImportMetaEnv {
|
|
8
|
+
readonly VITE_BASE_URL: string
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
interface ImportMeta {
|
|
12
|
+
readonly env: ImportMetaEnv
|
|
13
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2020",
|
|
4
|
+
"useDefineForClassFields": true,
|
|
5
|
+
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
|
6
|
+
"module": "ESNext",
|
|
7
|
+
"skipLibCheck": true,
|
|
8
|
+
"allowJs": true,
|
|
9
|
+
|
|
10
|
+
/* Bundler mode */
|
|
11
|
+
"moduleResolution": "bundler",
|
|
12
|
+
"allowImportingTsExtensions": true,
|
|
13
|
+
"resolveJsonModule": true,
|
|
14
|
+
"isolatedModules": true,
|
|
15
|
+
"noEmit": true,
|
|
16
|
+
"jsx": "react-jsx",
|
|
17
|
+
|
|
18
|
+
/* Linting */
|
|
19
|
+
"strict": true,
|
|
20
|
+
"noUnusedLocals": false,
|
|
21
|
+
"noUnusedParameters": false,
|
|
22
|
+
"noFallthroughCasesInSwitch": true,
|
|
23
|
+
"forceConsistentCasingInFileNames": true,
|
|
24
|
+
"esModuleInterop": true,
|
|
25
|
+
"allowSyntheticDefaultImports": true,
|
|
26
|
+
|
|
27
|
+
/* Paths */
|
|
28
|
+
"baseUrl": ".",
|
|
29
|
+
"paths": {
|
|
30
|
+
"@/*": ["src/*"]
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"include": ["src", "vite.config.ts"],
|
|
34
|
+
"references": [{ "path": "./tsconfig.node.json" }]
|
|
35
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import react from '@vitejs/plugin-react';
|
|
2
|
+
import fs from 'fs-extra';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
import { defineConfig } from 'vite';
|
|
5
|
+
import svgr from "vite-plugin-svgr";
|
|
6
|
+
function getBase() {
|
|
7
|
+
if (!process.env["VITE_BASE_URL"]) {
|
|
8
|
+
throw new Error("VITE_BASE_URL environment variable is required");
|
|
9
|
+
}
|
|
10
|
+
return process.env["VITE_BASE_URL"];
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const devMode = process.env.NODE_ENV === 'development';
|
|
14
|
+
|
|
15
|
+
// https://vitejs.dev/config/
|
|
16
|
+
export default defineConfig({
|
|
17
|
+
plugins: [
|
|
18
|
+
react(),
|
|
19
|
+
svgr(),
|
|
20
|
+
...(!devMode ? [] : [
|
|
21
|
+
{
|
|
22
|
+
name: 'copy-ui-to-server',
|
|
23
|
+
writeBundle() {
|
|
24
|
+
const dest = '../server/dist/src/ui/build'
|
|
25
|
+
fs.removeSync(dest)
|
|
26
|
+
fs.copySync('build', dest)
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
])
|
|
30
|
+
],
|
|
31
|
+
// get exposed to your app as import.meta.env.BASE_URL
|
|
32
|
+
base: getBase(),
|
|
33
|
+
build: {
|
|
34
|
+
outDir: 'build',
|
|
35
|
+
emptyOutDir: true,
|
|
36
|
+
sourcemap: devMode ? 'inline' : false,
|
|
37
|
+
minify: devMode ? false : 'esbuild',
|
|
38
|
+
watch: devMode ? {} : undefined,
|
|
39
|
+
},
|
|
40
|
+
server: {
|
|
41
|
+
port: 3000,
|
|
42
|
+
},
|
|
43
|
+
resolve: {
|
|
44
|
+
alias: {
|
|
45
|
+
'@': path.resolve(__dirname, './src'),
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
})
|
|
@@ -1,27 +1,35 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "seeka-app-
|
|
3
|
-
"version": "2.2.1",
|
|
2
|
+
"name": "seeka-app-root",
|
|
4
3
|
"private": true,
|
|
5
4
|
"workspaces": [
|
|
6
5
|
"app/*"
|
|
7
6
|
],
|
|
8
7
|
"scripts": {
|
|
9
|
-
"
|
|
8
|
+
"build": "yarn workspace @example-org-name/example-app-name-lib run build && yarn workspace @example-org-name/example-app-name-browser run build && yarn workspace @example-org-name/example-app-name-ui run build && yarn workspace @example-org-name/example-app-name-server run build",
|
|
9
|
+
"typecheck": "yarn workspaces foreach -pt --include @example-org-name/example-app-name-* run typecheck",
|
|
10
10
|
"lint": "yarn workspaces foreach --all -pt run lint",
|
|
11
|
-
"build:
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
11
|
+
"build:lib": "yarn workspace @example-org-name/example-app-name-lib run build",
|
|
12
|
+
"build:browser": "yarn workspace @example-org-name/example-app-name-browser run build",
|
|
13
|
+
"build:server:azurefunc": "yarn workspace @example-org-name/example-app-name-server-azurefunc run build",
|
|
14
|
+
"build:ui:test": "VITE_BASE_URL=/app/ yarn workspace @example-org-name/example-app-name-ui run build",
|
|
15
|
+
"dev": "yarn workspace @example-org-name/example-app-name-lib run dev && yarn workspace @example-org-name/example-app-name-server run build && yarn workspace @example-org-name/example-app-name-browser run watch",
|
|
16
|
+
"dev:ui": "yarn workspace @example-org-name/example-app-name-ui run build:dev",
|
|
17
|
+
"dev:server": "yarn workspace @example-org-name/example-app-name-server run build && yarn workspace @example-org-name/example-app-name-server run dev",
|
|
18
|
+
"watch:server": "yarn workspace @example-org-name/example-app-name-server run build && yarn workspace @example-org-name/example-app-name-server run watch",
|
|
19
|
+
"deploy": "yarn clean && VITE_RELEASE_TAG=localdevbuild VITE_BASE_URL=/example-app-name-app/ VITE_URLS_SEEKA_API_CORE=https://api.seeka.services VITE_URLS_SEEKA_APP_CORE_ORIGIN=https://seeka.app yarn build && yarn workspace @example-org-name/example-app-name-server run deploy",
|
|
20
|
+
"tunnel": "yarn workspace @example-org-name/example-app-name-server run tunnel",
|
|
15
21
|
"bump:patch": "yarn git:isclean && yarn workspaces foreach --all version patch --deferred && yarn bump:apply && yarn git:push",
|
|
16
22
|
"bump:minor": "yarn git:isclean && yarn workspaces foreach --all version minor --deferred && yarn bump:apply && yarn git:push",
|
|
17
23
|
"bump:major": "yarn git:isclean && yarn workspaces foreach --all version major --deferred && yarn bump:apply && yarn git:push",
|
|
18
|
-
"bump:alpha": "yarn git:isclean && yarn workspaces foreach --all version prerelease --deferred && yarn bump:apply && yarn git:push",
|
|
19
24
|
"bump:apply": "yarn version apply --all",
|
|
20
25
|
"git:isclean": "bash -c 'if [ -n \"$(git status --porcelain)\" ]; then echo \"✖ Working directory not clean. Commit or stash your changes first.\"; exit 1; fi'",
|
|
21
|
-
"git:push": "git add -A && git commit -m \"v$(node -p \"require('./package.json').version\")\" && git tag -a v$(node -p \"require('./package.json').version\") -m \"v$(node -p \"require('./package.json').version\")\""
|
|
26
|
+
"git:push": "git add -A && git commit -m \"v$(node -p \"require('./package.json').version\")\" && git tag -a v$(node -p \"require('./package.json').version\") -m \"v$(node -p \"require('./package.json').version\")\"",
|
|
27
|
+
"clean": "yarn workspaces foreach --all -pt run clean",
|
|
28
|
+
"clean:all": "yarn clean && rimraf ./app/**/node_modules",
|
|
29
|
+
"dev:kill": "taskkill /f /t /im node.exe"
|
|
22
30
|
},
|
|
23
31
|
"devDependencies": {
|
|
24
|
-
"
|
|
32
|
+
"rimraf": "^6"
|
|
25
33
|
},
|
|
26
|
-
"packageManager": "yarn@4.
|
|
34
|
+
"packageManager": "yarn@4.11.0"
|
|
27
35
|
}
|
|
@@ -9,14 +9,13 @@
|
|
|
9
9
|
"target": "ES6",
|
|
10
10
|
"resolveJsonModule": true,
|
|
11
11
|
"isolatedModules": false,
|
|
12
|
-
"baseUrl": "."
|
|
13
|
-
"paths": {
|
|
14
|
-
"@seeka-app-example-name/*": ["app/*/src"]
|
|
15
|
-
}
|
|
12
|
+
"baseUrl": "."
|
|
16
13
|
},
|
|
17
14
|
"references": [
|
|
18
|
-
{ "path": "app/
|
|
19
|
-
{ "path": "app/
|
|
15
|
+
{ "path": "app/browser" },
|
|
16
|
+
{ "path": "app/server" },
|
|
17
|
+
{ "path": "app/ui" },
|
|
18
|
+
{ "path": "app/lib" }
|
|
20
19
|
],
|
|
21
20
|
"exclude": [
|
|
22
21
|
"node_modules",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seeka-labs/cli-apps",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.2.3",
|
|
4
4
|
"description": "Seeka - Apps CLI",
|
|
5
5
|
"author": "SEEKA <platform@seeka.co>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -21,12 +21,14 @@
|
|
|
21
21
|
},
|
|
22
22
|
"scripts": {
|
|
23
23
|
"test": "cross-env NODE_TLS_REJECT_UNAUTHORIZED=0 jest",
|
|
24
|
-
"
|
|
25
|
-
"build": "yarn build:templates && tsc --noEmit && esbuild src/index.ts --bundle --sourcemap --platform=node --target=
|
|
24
|
+
"typecheck": "tsc --noEmit",
|
|
25
|
+
"build:ci": "yarn build:templates && tsc --noEmit && esbuild src/index.ts --bundle --sourcemap --platform=node --target=node22 --outfile=dist/index.js",
|
|
26
|
+
"build": "yarn build:templates && tsc --noEmit && esbuild src/index.ts --bundle --sourcemap --platform=node --target=node22 --outfile=dist/index.js",
|
|
26
27
|
"build:templates": "node ./scripts/build-templates.js",
|
|
27
28
|
"watch": "tsc -w",
|
|
28
29
|
"clean": "rimraf dist",
|
|
29
30
|
"dev": "yarn run clean && yarn build && rimraf seeka-app-test1 && node dist/index.js init seeka-app-test1 --template azure-function --email 'dev@seeka.co' --developer Seeka --noDependencies --browser --npmUsername testy --npmPassword passworddd --env 'SEEKA_APP_ID=123' 'SEEKA_APP_SECRET=345' --packageManager yarn",
|
|
31
|
+
"scaffold:azurefunc": "yarn run clean && yarn build && rimraf test-scaffold/test-azurefunc && node dist/index.js init test-azurefunc test-orgname --template azure-function --email 'dev@seeka.co' --developer Seeka --noDependencies --outDir '../../../../../test-app-scaffold' --env 'SEEKA_APP_ID=123' 'SEEKA_APP_SECRET=345' --force --npmUsername internal-seeka-developers-apps --npmPassword 2b999f0e3d774bb180f5a5d2759d1358",
|
|
30
32
|
"dev:nobrowser": "yarn run clean && yarn build && rimraf seeka-app-test1 && node dist/index.js init seeka-app-test1 --template azure-function --email 'dev@seeka.co' --developer Seeka --noDependencies --env 'SEEKA_APP_ID=123' 'SEEKA_APP_SECRET=345' --packageManager yarn",
|
|
31
33
|
"dev:skipSubDir": "yarn run clean && yarn build && rimraf seeka-app-test1 && mkdir seeka-app-test1 && cd seeka-app-test1 && mkdir rootfolder && cd rootfolder && node ../../dist/index.js init seeka-app-test1 --template azure-function --skipSubDir --email 'dev@seeka.co' --developer Seeka --noDependencies --browser --env 'SEEKA_APP_ID=123' 'SEEKA_APP_SECRET=345' --packageManager yarn",
|
|
32
34
|
"dev:skipSubDir2": "yarn run clean && yarn build && cd seeka-app-test2 && node ../dist/index.js init seeka-app-test1 --template azure-function --skipSubDir --email 'dev@seeka.co' --developer Seeka --noDependencies --browser --env 'SEEKA_APP_ID=123' 'SEEKA_APP_SECRET=345' --packageManager yarn"
|
|
@@ -34,18 +36,25 @@
|
|
|
34
36
|
"devDependencies": {
|
|
35
37
|
"@jest/globals": "^30",
|
|
36
38
|
"@types/cross-spawn": "^6",
|
|
39
|
+
"@types/inquirer": "^9.0.7",
|
|
37
40
|
"@types/jest": "^30",
|
|
38
41
|
"@types/lodash-es": "^4",
|
|
39
42
|
"camelcase": "^9",
|
|
40
43
|
"commander": "^14",
|
|
44
|
+
"cross-env": "^10.1.0",
|
|
41
45
|
"cross-spawn": "^7",
|
|
42
46
|
"esbuild": "^0",
|
|
47
|
+
"extract-zip": "^2.0.1",
|
|
43
48
|
"glob": "^13",
|
|
49
|
+
"ignore": "^7",
|
|
50
|
+
"inquirer": "^9.2.23",
|
|
44
51
|
"jest": "^30",
|
|
52
|
+
"jsonpath-plus": "^10.3.0",
|
|
53
|
+
"jszip": "^3.10.1",
|
|
45
54
|
"lodash-es": "^4",
|
|
46
55
|
"source-map-support": "^0",
|
|
47
56
|
"ts-jest": "^29",
|
|
48
57
|
"typescript": "^5"
|
|
49
58
|
},
|
|
50
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "2e406e463088cdf6ccdb2e2b15eb35c369b729c0"
|
|
51
60
|
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
roots: ['<rootDir>/src'],
|
|
3
|
-
testMatch: [
|
|
4
|
-
"**/*.test.ts"
|
|
5
|
-
],
|
|
6
|
-
transform: {
|
|
7
|
-
"^.+\\.(ts|tsx)$": "ts-jest"
|
|
8
|
-
},
|
|
9
|
-
collectCoverageFrom: ["src/**/*.ts", "!**/node_modules/**"],
|
|
10
|
-
coverageReporters: ["html", "text", "text-summary", "cobertura"],
|
|
11
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
20
|