@seeka-labs/cli-apps 1.1.39 → 2.0.7-rc.1
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 +31 -36
- package/dist/index.js.map +4 -4
- package/dist/init-template/.gitlab-ci.yml +47 -0
- package/dist/init-template/.yarnrc.yml +8 -0
- package/dist/init-template/README.md +7 -0
- package/dist/{init-templates → init-template/app}/browser/jest.config.js +11 -11
- package/dist/{init-templates → init-template/app}/browser/package.json +16 -12
- package/dist/{init-templates → init-template/app}/browser/scripts/esbuild/build-browser-plugin.mjs +110 -110
- package/dist/{init-templates → init-template/app}/browser/scripts/esbuild/plugins/importAsGlobals.mjs +38 -38
- package/dist/{init-templates → init-template/app}/browser/src/browser.ts +12 -12
- package/dist/{init-templates → init-template/app}/browser/src/plugin/index.test.ts +6 -6
- package/dist/{init-templates → init-template/app}/browser/src/plugin/index.ts +47 -49
- package/dist/{init-templates → init-template/app}/browser/tsconfig.json +34 -34
- package/dist/{init-templates/netlify-function → init-template/app/server-azure-function}/.eslintrc.cjs +2 -10
- package/dist/{init-templates/azure-function → init-template/app/server-azure-function}/.funcignore +12 -7
- package/dist/init-template/app/server-azure-function/.nvmrc +1 -0
- package/dist/{init-templates/azure-function → init-template/app/server-azure-function}/README.md +104 -107
- package/dist/{init-templates/azure-function → init-template/app/server-azure-function}/host.json +1 -10
- package/dist/init-template/app/server-azure-function/package.json +52 -0
- package/dist/{init-templates/azure-function → init-template/app/server-azure-function}/src/functions/seekaAppWebhook.ts +235 -236
- package/dist/{init-templates/azure-function → init-template/app/server-azure-function}/src/lib/browser/index.ts +54 -54
- package/dist/{init-templates/azure-function → init-template/app/server-azure-function}/src/lib/jobs/index.ts +1 -1
- package/dist/{init-templates/azure-function → init-template/app/server-azure-function}/src/lib/logging/index.ts +92 -92
- package/dist/{init-templates/azure-function/src/lib/browser → init-template/app/server-azure-function/src/lib}/models/index.ts +6 -6
- package/dist/{init-templates/azure-function → init-template/app/server-azure-function}/src/lib/state/redis/index.ts +96 -65
- package/dist/{init-templates/azure-function → init-template/app/server-azure-function}/src/lib/state/seeka/installations.ts +64 -66
- package/dist/{init-templates/azure-function → init-template/app/server-azure-function}/tsconfig.json +1 -1
- package/dist/init-template/package.json +28 -0
- package/dist/init-template/tsconfig.json +25 -0
- package/package.json +5 -4
- package/dist/init-templates/aws-lambda/.env.example +0 -15
- package/dist/init-templates/aws-lambda/.eslintrc.cjs +0 -19
- package/dist/init-templates/aws-lambda/.example.gitignore +0 -49
- package/dist/init-templates/aws-lambda/.gitlab-ci.yml +0 -39
- package/dist/init-templates/aws-lambda/.nvmrc +0 -1
- package/dist/init-templates/aws-lambda/.vscode/extensions.json +0 -5
- package/dist/init-templates/aws-lambda/.vscode/launch.json +0 -20
- package/dist/init-templates/aws-lambda/.vscode/settings.json +0 -3
- package/dist/init-templates/aws-lambda/.vscode/tasks.json +0 -12
- package/dist/init-templates/aws-lambda/README.md +0 -77
- package/dist/init-templates/aws-lambda/jest.config.js +0 -5
- package/dist/init-templates/aws-lambda/package.json +0 -53
- package/dist/init-templates/aws-lambda/scripts/ngrok.js +0 -28
- package/dist/init-templates/aws-lambda/src/index.test.ts +0 -7
- package/dist/init-templates/aws-lambda/src/index.ts +0 -33
- package/dist/init-templates/aws-lambda/src/lib/logging/index.ts +0 -88
- package/dist/init-templates/aws-lambda/src/lib/services/index.ts +0 -41
- package/dist/init-templates/aws-lambda/src/lib/state/redis/index.ts +0 -65
- package/dist/init-templates/aws-lambda/src/lib/state/seeka/installations.ts +0 -67
- package/dist/init-templates/aws-lambda/src/routes/seekaAppWebhook.ts +0 -194
- package/dist/init-templates/aws-lambda/tsconfig.json +0 -31
- package/dist/init-templates/aws-lambda/yarn.lock +0 -4392
- package/dist/init-templates/azure-function/.eslintrc.cjs +0 -19
- package/dist/init-templates/azure-function/.example.gitignore +0 -48
- package/dist/init-templates/azure-function/.gitlab-ci.yml +0 -48
- package/dist/init-templates/azure-function/.nvmrc +0 -1
- package/dist/init-templates/azure-function/.vscode/extensions.json +0 -7
- package/dist/init-templates/azure-function/.vscode/launch.json +0 -13
- package/dist/init-templates/azure-function/.vscode/settings.json +0 -9
- package/dist/init-templates/azure-function/.vscode/tasks.json +0 -39
- package/dist/init-templates/azure-function/jest.config.js +0 -5
- package/dist/init-templates/azure-function/package.json +0 -47
- package/dist/init-templates/azure-function/scripts/dev-queue-setup.js +0 -30
- package/dist/init-templates/azure-function/src/index.test.ts +0 -7
- package/dist/init-templates/azure-function/yarn.lock +0 -3772
- package/dist/init-templates/browser/.editorconfig +0 -14
- package/dist/init-templates/browser/.eslintrc.cjs +0 -1
- package/dist/init-templates/browser/.yarnrc +0 -1
- package/dist/init-templates/browser/yarn.lock +0 -3045
- package/dist/init-templates/netlify-function/.env.example +0 -18
- package/dist/init-templates/netlify-function/.example.gitignore +0 -36
- package/dist/init-templates/netlify-function/.nvmrc +0 -1
- package/dist/init-templates/netlify-function/.vscode/launch.json +0 -45
- package/dist/init-templates/netlify-function/README.md +0 -62
- package/dist/init-templates/netlify-function/jest.config.js +0 -5
- package/dist/init-templates/netlify-function/netlify.toml +0 -7
- package/dist/init-templates/netlify-function/package.json +0 -39
- package/dist/init-templates/netlify-function/src/api/example-job-background/index.ts +0 -52
- package/dist/init-templates/netlify-function/src/api/polling-example-job-scheduled/index.ts +0 -46
- package/dist/init-templates/netlify-function/src/api/seeka-app-webhook/index.ts +0 -217
- package/dist/init-templates/netlify-function/src/index.test.ts +0 -7
- package/dist/init-templates/netlify-function/src/lib/jobs/index.ts +0 -68
- package/dist/init-templates/netlify-function/src/lib/logging/index.ts +0 -91
- package/dist/init-templates/netlify-function/src/lib/services/index.ts +0 -41
- package/dist/init-templates/netlify-function/src/lib/state/redis/index.ts +0 -65
- package/dist/init-templates/netlify-function/src/lib/state/seeka/installations.ts +0 -67
- package/dist/init-templates/netlify-function/tsconfig.json +0 -25
- package/dist/init-templates/netlify-function/yarn.lock +0 -9337
- /package/dist/{init-templates → init-template/app}/browser/README.md +0 -0
- /package/dist/{init-templates/azure-function → init-template/app/server-azure-function}/local.settings.example.json +0 -0
- /package/dist/{init-templates/azure-function → init-template/app/server-azure-function}/scripts/ngrok.js +0 -0
- /package/dist/{init-templates/azure-function → init-template/app/server-azure-function}/src/functions/healthCheck.ts +0 -0
- /package/dist/{init-templates/azure-function → init-template/app/server-azure-function}/src/functions/pollingExample.ts +0 -0
- /package/dist/{init-templates/azure-function → init-template/app/server-azure-function}/src/functions/queueExample.ts +0 -0
- /package/dist/{init-templates/azure-function → init-template/app/server-azure-function}/src/lib/services/index.ts +0 -0
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/* eslint-env node */
|
|
2
|
-
module.exports = {
|
|
3
|
-
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
|
|
4
|
-
parser: '@typescript-eslint/parser',
|
|
5
|
-
plugins: ['@typescript-eslint'],
|
|
6
|
-
root: true,
|
|
7
|
-
rules: {
|
|
8
|
-
"@typescript-eslint/no-unused-vars": "warn",
|
|
9
|
-
"@typescript-eslint/no-explicit-any": "off"
|
|
10
|
-
},
|
|
11
|
-
overrides: [
|
|
12
|
-
{
|
|
13
|
-
files: ["**/*/*.test.ts"],
|
|
14
|
-
env: {
|
|
15
|
-
jest: true
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
]
|
|
19
|
-
};
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
bin
|
|
2
|
-
obj
|
|
3
|
-
csx
|
|
4
|
-
.vs
|
|
5
|
-
edge
|
|
6
|
-
Publish
|
|
7
|
-
|
|
8
|
-
*.user
|
|
9
|
-
*.suo
|
|
10
|
-
*.cscfg
|
|
11
|
-
*.Cache
|
|
12
|
-
project.lock.json
|
|
13
|
-
|
|
14
|
-
/packages
|
|
15
|
-
/TestResults
|
|
16
|
-
|
|
17
|
-
/tools/NuGet.exe
|
|
18
|
-
/App_Data
|
|
19
|
-
/secrets
|
|
20
|
-
/data
|
|
21
|
-
.secrets
|
|
22
|
-
appsettings.json
|
|
23
|
-
local.settings.json
|
|
24
|
-
|
|
25
|
-
node_modules
|
|
26
|
-
dist
|
|
27
|
-
|
|
28
|
-
# Local python packages
|
|
29
|
-
.python_packages/
|
|
30
|
-
|
|
31
|
-
# Python Environments
|
|
32
|
-
.env
|
|
33
|
-
.venv
|
|
34
|
-
env/
|
|
35
|
-
venv/
|
|
36
|
-
ENV/
|
|
37
|
-
env.bak/
|
|
38
|
-
venv.bak/
|
|
39
|
-
|
|
40
|
-
# Byte-compiled / optimized / DLL files
|
|
41
|
-
__pycache__/
|
|
42
|
-
*.py[cod]
|
|
43
|
-
*$py.class
|
|
44
|
-
|
|
45
|
-
# Azurite artifacts
|
|
46
|
-
__blobstorage__
|
|
47
|
-
__queuestorage__
|
|
48
|
-
__azurite_db*__.json
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
stages:
|
|
2
|
-
- deploy
|
|
3
|
-
|
|
4
|
-
variables:
|
|
5
|
-
AZURE_FUNC_RESOURCE_NAME: seeka-app-example-name
|
|
6
|
-
CI_DEBUG_TRACE: "true"
|
|
7
|
-
|
|
8
|
-
workflow:
|
|
9
|
-
rules:
|
|
10
|
-
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
|
|
11
|
-
when: never
|
|
12
|
-
- if: '$CI_COMMIT_BRANCH == "main" && ($CI_PIPELINE_SOURCE == "push" || $CI_PIPELINE_SOURCE == "web")'
|
|
13
|
-
variables:
|
|
14
|
-
# AZURE_FUNC_SLOT: ""
|
|
15
|
-
HOSTING_REGION_NAME: auea
|
|
16
|
-
HOSTING_ENV_NAME: prod
|
|
17
|
-
when: always
|
|
18
|
-
- if: '$CI_COMMIT_BRANCH == "staging" && ($CI_PIPELINE_SOURCE == "push" || $CI_PIPELINE_SOURCE == "web")'
|
|
19
|
-
variables:
|
|
20
|
-
# AZURE_FUNC_SLOT: staging
|
|
21
|
-
HOSTING_REGION_NAME: auea
|
|
22
|
-
HOSTING_ENV_NAME: stag
|
|
23
|
-
when: always
|
|
24
|
-
|
|
25
|
-
deploy:
|
|
26
|
-
stage: deploy
|
|
27
|
-
image: node:20
|
|
28
|
-
environment:
|
|
29
|
-
name: $HOSTING_REGION_NAME/$HOSTING_ENV_NAME/apps
|
|
30
|
-
before_script:
|
|
31
|
-
- echo "installing azure cli"
|
|
32
|
-
- curl -sL https://aka.ms/InstallAzureCLIDeb | bash
|
|
33
|
-
- az --version
|
|
34
|
-
- echo "logging in to azure"
|
|
35
|
-
- az login --service-principal --username "$AZURE_SERVICEPRINCIPAL_CLIENTID" --password "$AZURE_SERVICEPRINCIPAL_SECRET" --tenant "$AZURE_TENANT_ID"
|
|
36
|
-
- az account set --subscription "$AZURE_SUBSCRIPTION_ID"
|
|
37
|
-
script:
|
|
38
|
-
- echo "deploying azure func $AZURE_FUNC_RESOURCE_NAME to slot $AZURE_FUNC_SLOT from branch $CI_COMMIT_BRANCH"
|
|
39
|
-
- yarn install --production=false
|
|
40
|
-
# START: component:browser
|
|
41
|
-
- cd src/browser
|
|
42
|
-
- yarn install --production=false
|
|
43
|
-
- cd ../../
|
|
44
|
-
# END: component:browser
|
|
45
|
-
- yarn run clean && yarn run build && yarn func azure functionapp publish $AZURE_FUNC_RESOURCE_NAME --no-build --javascript
|
|
46
|
-
only:
|
|
47
|
-
- main
|
|
48
|
-
- staging
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
v20
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"azureFunctions.deploySubpath": ".",
|
|
3
|
-
"azureFunctions.postDeployTask": "yarn install (functions)",
|
|
4
|
-
"azureFunctions.projectLanguage": "TypeScript",
|
|
5
|
-
"azureFunctions.projectRuntime": "~4",
|
|
6
|
-
"debug.internalConsoleOptions": "neverOpen",
|
|
7
|
-
"azureFunctions.projectLanguageModel": 4,
|
|
8
|
-
"azureFunctions.preDeployTask": "yarn prune (functions)"
|
|
9
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": "2.0.0",
|
|
3
|
-
"tasks": [
|
|
4
|
-
{
|
|
5
|
-
"type": "func",
|
|
6
|
-
"label": "func: host start",
|
|
7
|
-
"command": "host start --port 7072",
|
|
8
|
-
"problemMatcher": "$func-node-watch",
|
|
9
|
-
"isBackground": true,
|
|
10
|
-
"dependsOn": "yarn build (functions)"
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
"type": "shell",
|
|
14
|
-
"label": "yarn build (functions)",
|
|
15
|
-
"command": "yarn run watch",
|
|
16
|
-
"dependsOn": "yarn clean (functions)",
|
|
17
|
-
"problemMatcher": "$tsc-watch",
|
|
18
|
-
"isBackground": true
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
"type": "shell",
|
|
22
|
-
"label": "yarn install (functions)",
|
|
23
|
-
"command": "yarn install"
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
"type": "shell",
|
|
27
|
-
"label": "yarn prune (functions)",
|
|
28
|
-
"command": "yarn prune --production",
|
|
29
|
-
"dependsOn": "yarn build (functions)",
|
|
30
|
-
"problemMatcher": []
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
"type": "shell",
|
|
34
|
-
"label": "yarn clean (functions)",
|
|
35
|
-
"command": "yarn run clean",
|
|
36
|
-
"dependsOn": "yarn install (functions)"
|
|
37
|
-
}
|
|
38
|
-
]
|
|
39
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "seeka-app-example-name",
|
|
3
|
-
"version": "0.0.1",
|
|
4
|
-
"description": "Seeka example app for hosting on Azure serverless functions",
|
|
5
|
-
"author": "Seeka <platform@seeka.co>",
|
|
6
|
-
"license": "MIT",
|
|
7
|
-
"main": "dist/src/functions/*.js",
|
|
8
|
-
"private": true,
|
|
9
|
-
"engines": {
|
|
10
|
-
"node": ">=20"
|
|
11
|
-
},
|
|
12
|
-
"scripts": {
|
|
13
|
-
"lint": "eslint",
|
|
14
|
-
"build": "<packageManagerRunPrefix> clean && tsc",
|
|
15
|
-
"watch": "tsc -w",
|
|
16
|
-
"test": "<packageManagerRunPrefix> jest",
|
|
17
|
-
"clean": "<packageManagerRunPrefix> rimraf dist",
|
|
18
|
-
"prestart": "<packageManagerRunPrefix> clean && <packageManagerRunPrefix> build",
|
|
19
|
-
"dev": "<packageManagerRunPrefix> build && func start --port 7072",
|
|
20
|
-
"tunnel": "node scripts/ngrok.js seeka-app-example-name-localdev",
|
|
21
|
-
"deploy": "<packageManagerRunPrefix> clean && <packageManagerRunPrefix> build && func azure functionapp publish seeka-app-example-name --no-build --javascript",
|
|
22
|
-
"dev:queue:create": "node scripts/dev-queue-setup.js sample-queue-name"
|
|
23
|
-
},
|
|
24
|
-
"dependencies": {
|
|
25
|
-
"@azure/functions": "^4.6.0",
|
|
26
|
-
"@azure/storage-queue": "^12.25.0",
|
|
27
|
-
"@datalust/winston-seq": "^2.0.0",
|
|
28
|
-
"@seeka-labs/sdk-apps-server": "^1.1.26",
|
|
29
|
-
"lodash-es": "^4.17.21",
|
|
30
|
-
"redis": "^4.7.0",
|
|
31
|
-
"winston": "^3.17.0"
|
|
32
|
-
},
|
|
33
|
-
"devDependencies": {
|
|
34
|
-
"@jest/globals": "^29.7.0",
|
|
35
|
-
"@types/lodash-es": "^4.17.12",
|
|
36
|
-
"@types/node": "^20",
|
|
37
|
-
"@typescript-eslint/eslint-plugin": "^8.22.0",
|
|
38
|
-
"@typescript-eslint/parser": "^8.22.0",
|
|
39
|
-
"azure-functions-core-tools": "^4.x",
|
|
40
|
-
"eslint": "^9",
|
|
41
|
-
"jest": "^29.7.0",
|
|
42
|
-
"ngrok": "^5.0.0-beta.2",
|
|
43
|
-
"rimraf": "^6.0.1",
|
|
44
|
-
"ts-jest": "^29.2.5",
|
|
45
|
-
"typescript": "^5.7.3"
|
|
46
|
-
}
|
|
47
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
2
|
-
/* eslint-disable no-undef */
|
|
3
|
-
const { QueueClient } = require("@azure/storage-queue");
|
|
4
|
-
|
|
5
|
-
(async function () {
|
|
6
|
-
// https://learn.microsoft.com/en-us/azure/storage/common/storage-use-azurite?tabs=visual-studio%2Cqueue-storage#azure-sdks
|
|
7
|
-
// Dev / emulator / azurite
|
|
8
|
-
var client = new QueueClient(
|
|
9
|
-
`UseDevelopmentStorage=true`, process.argv[2]
|
|
10
|
-
);
|
|
11
|
-
const res = await client.createIfNotExists();
|
|
12
|
-
if (res.succeeded) {
|
|
13
|
-
console.log("Queue created");
|
|
14
|
-
}
|
|
15
|
-
else {
|
|
16
|
-
console.log("Queue already exists");
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
// // https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-storage-queue-trigger?tabs=python-v2%2Cisolated-process%2Cnodejs-v4%2Cextensionv5&pivots=programming-language-typescript#poison-messages
|
|
20
|
-
var poisonClient = new QueueClient(
|
|
21
|
-
`UseDevelopmentStorage=true`, `${process.argv[2]}-poison`
|
|
22
|
-
);
|
|
23
|
-
const resPoison = await poisonClient.createIfNotExists();
|
|
24
|
-
if (resPoison.succeeded) {
|
|
25
|
-
console.log("Poison queue created");
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
console.log("Poison queue already exists");
|
|
29
|
-
}
|
|
30
|
-
})();
|