@seeka-labs/cli-apps 3.5.2 → 3.5.4
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 +47183 -0
- package/dist/index.js.map +7 -0
- package/dist/init-template/.gitlab-ci.yml +67 -0
- package/dist/init-template/.nvmrc +1 -0
- package/dist/init-template/README.md +27 -0
- package/dist/init-template/app/.eslintrc.cjs +13 -0
- package/dist/init-template/app/browser/README.md +1 -0
- package/dist/init-template/app/browser/package.json +37 -0
- package/dist/init-template/app/browser/scripts/esbuild/build-browser-plugin.mjs +130 -0
- package/dist/init-template/app/browser/scripts/esbuild/plugins/importAsGlobals.mjs +39 -0
- package/dist/init-template/app/browser/src/browser.ts +12 -0
- package/dist/init-template/app/browser/src/plugin/index.ts +61 -0
- package/dist/init-template/app/browser/tsconfig.json +34 -0
- 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-azurefunc/.funcignore +19 -0
- package/dist/init-template/app/server-azurefunc/README.md +105 -0
- package/dist/init-template/app/server-azurefunc/host.json +31 -0
- package/dist/init-template/app/server-azurefunc/local.settings.template.json +34 -0
- package/dist/init-template/app/server-azurefunc/package.json +67 -0
- package/dist/init-template/app/server-azurefunc/scripts/dev-queue-setup.js +55 -0
- 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-azurefunc/src/functions/healthCheck.ts +19 -0
- package/dist/init-template/app/server-azurefunc/src/functions/seekaAppWebhook.ts +202 -0
- package/dist/init-template/app/server-azurefunc/src/functions/trackActivityQueueHandler.ts +49 -0
- package/dist/init-template/app/server-azurefunc/src/functions/ui.ts +51 -0
- package/dist/init-template/app/server-azurefunc/tsconfig.json +24 -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 +38 -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 +44 -0
- package/dist/init-template/tsconfig.json +24 -0
- package/package.json +1 -1
- package/README.md +0 -1
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SeekaAppWizardStep,
|
|
3
|
+
SeekaAppWizardHeading,
|
|
4
|
+
SeekaAppWizardStepContent,
|
|
5
|
+
SeekaAppWizardStepActions,
|
|
6
|
+
appApi
|
|
7
|
+
} from "@seeka-labs/sdk-apps-react";
|
|
8
|
+
import { Button } from "@mui/material"
|
|
9
|
+
import seekaAppIcon from '../../../../assets/app-icon.svg'
|
|
10
|
+
|
|
11
|
+
type Props = {
|
|
12
|
+
onNext?: () => void
|
|
13
|
+
onBack?: () => void
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const AppSetupSecondStep = ({ onNext, onBack }: Props) => {
|
|
17
|
+
const convergeConfigQuery = appApi.endpoints.convergeGetDefaultSingleInstanceForBrand.useQuery({ organisationBrandId: window.seekaAppConfig.organisationBrandId })
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<SeekaAppWizardStep>
|
|
21
|
+
<SeekaAppWizardHeading title="Connect to ExampleApp™" image={seekaAppIcon}>
|
|
22
|
+
Update app settings
|
|
23
|
+
</SeekaAppWizardHeading>
|
|
24
|
+
<SeekaAppWizardStepContent title="Instructions" subtitle="ExampleApp settings">
|
|
25
|
+
<ol>
|
|
26
|
+
<li>Click the Authenticate ExampleApp button</li>
|
|
27
|
+
<li>Select the account that is authorised to your ExampleApp™ account</li>
|
|
28
|
+
<li>Follow the guided prompts to authorise Seeka.</li>
|
|
29
|
+
</ol>
|
|
30
|
+
</SeekaAppWizardStepContent>
|
|
31
|
+
|
|
32
|
+
<SeekaAppWizardStepActions>
|
|
33
|
+
{onBack && <Button variant='text' color="primary" onClick={onBack}>Back</Button>}
|
|
34
|
+
{onNext && <Button variant='contained' color="primary" onClick={onNext}>Next</Button>}
|
|
35
|
+
</SeekaAppWizardStepActions>
|
|
36
|
+
</SeekaAppWizardStep>
|
|
37
|
+
)
|
|
38
|
+
}
|
|
@@ -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-azurefunc/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
|
+
})
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "seeka-app-root",
|
|
3
|
+
"private": true,
|
|
4
|
+
"workspaces": [
|
|
5
|
+
"app/*"
|
|
6
|
+
],
|
|
7
|
+
"scripts": {
|
|
8
|
+
"start:server": "yarn dev:lib && yarn start:server:parallel",
|
|
9
|
+
"start:server:parallel": "concurrently -k --names \"server,browser,watch-server,tunnel\" \"yarn dev:server\" \"yarn dev:browser\" \"yarn watch:server\" \"yarn tunnel\"",
|
|
10
|
+
"start:all": "yarn dev:lib && yarn start:all:parallel",
|
|
11
|
+
"start:all:parallel": "concurrently -k --names \"ui,server,browser,watch-server,tunnel\" \"yarn dev:ui\" \"yarn dev:server\" \"yarn dev:browser\" \"yarn watch:server\" \"yarn tunnel\"",
|
|
12
|
+
"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-azurefunc run build",
|
|
13
|
+
"typecheck": "yarn workspaces foreach -pt --all run typecheck",
|
|
14
|
+
"lint": "yarn workspaces foreach --all -pt run lint",
|
|
15
|
+
"build:lib": "yarn workspace @example-org-name/example-app-name-lib run build",
|
|
16
|
+
"build:browser": "yarn workspace @example-org-name/example-app-name-browser run build",
|
|
17
|
+
"build:server:azurefunc": "yarn workspace @example-org-name/example-app-name-server-azurefunc run build",
|
|
18
|
+
"build:ui:test": "VITE_BASE_URL=/app/ yarn workspace @example-org-name/example-app-name-ui run build",
|
|
19
|
+
"dev:lib": "yarn workspace @example-org-name/example-app-name-lib run dev",
|
|
20
|
+
"dev:browser": "yarn workspace @example-org-name/example-app-name-browser run watch",
|
|
21
|
+
"dev": "yarn workspace @example-org-name/example-app-name-lib run dev && yarn workspace @example-org-name/example-app-name-server-azurefunc run build && yarn workspace @example-org-name/example-app-name-browser run watch",
|
|
22
|
+
"dev:init": "yarn workspace @example-org-name/example-app-name-server-azurefunc run dev:queue:create",
|
|
23
|
+
"dev:ui": "yarn workspace @example-org-name/example-app-name-ui run build:dev",
|
|
24
|
+
"dev:server": "yarn workspace @example-org-name/example-app-name-server-azurefunc run build && yarn workspace @example-org-name/example-app-name-server-azurefunc run dev",
|
|
25
|
+
"watch:server": "yarn workspace @example-org-name/example-app-name-server-azurefunc run build && yarn workspace @example-org-name/example-app-name-server-azurefunc run watch",
|
|
26
|
+
"deploy": "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-azurefunc run deploy",
|
|
27
|
+
"tunnel": "yarn workspace @example-org-name/example-app-name-server-azurefunc run tunnel",
|
|
28
|
+
"bump:patch": "yarn git:isclean && yarn workspaces foreach --all version patch --deferred && yarn bump:apply && yarn git:push",
|
|
29
|
+
"bump:minor": "yarn git:isclean && yarn workspaces foreach --all version minor --deferred && yarn bump:apply && yarn git:push",
|
|
30
|
+
"bump:major": "yarn git:isclean && yarn workspaces foreach --all version major --deferred && yarn bump:apply && yarn git:push",
|
|
31
|
+
"bump:apply": "yarn version apply --all",
|
|
32
|
+
"clean:packages": "rm -r node_modules && rm -r **/**/node_modules",
|
|
33
|
+
"git:isclean": "bash -c 'if [ -n \"$(git status --porcelain)\" ]; then echo \"✖ Working directory not clean. Commit or stash your changes first.\"; exit 1; fi'",
|
|
34
|
+
"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\")\"",
|
|
35
|
+
"clean": "yarn workspaces foreach --all -pt --include '@example-org-name/example-app-name-*' run clean",
|
|
36
|
+
"clean:all": "rimraf ./app/**/node_modules",
|
|
37
|
+
"dev:kill": "taskkill /f /t /im node.exe"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"concurrently": "^9",
|
|
41
|
+
"rimraf": "^6"
|
|
42
|
+
},
|
|
43
|
+
"packageManager": "yarn@4.11.0"
|
|
44
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"allowJs": true,
|
|
4
|
+
"skipLibCheck": true,
|
|
5
|
+
"strict": false,
|
|
6
|
+
"esModuleInterop": true,
|
|
7
|
+
"sourceMap": true,
|
|
8
|
+
"module": "CommonJS",
|
|
9
|
+
"target": "ES6",
|
|
10
|
+
"resolveJsonModule": true,
|
|
11
|
+
"isolatedModules": false,
|
|
12
|
+
"baseUrl": "."
|
|
13
|
+
},
|
|
14
|
+
"references": [
|
|
15
|
+
{ "path": "app/browser" },
|
|
16
|
+
{ "path": "app/server" },
|
|
17
|
+
{ "path": "app/ui" },
|
|
18
|
+
{ "path": "app/lib" }
|
|
19
|
+
],
|
|
20
|
+
"exclude": [
|
|
21
|
+
"node_modules",
|
|
22
|
+
"**/dist"
|
|
23
|
+
]
|
|
24
|
+
}
|
package/package.json
CHANGED
package/README.md
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
# Seeka Apps CLI
|