@seeka-labs/cli-apps 1.1.39 → 2.0.7-rc.2

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.
Files changed (95) hide show
  1. package/dist/index.js +31 -36
  2. package/dist/index.js.map +4 -4
  3. package/dist/init-template/.gitlab-ci.yml +47 -0
  4. package/dist/init-template/.yarnrc.yml +8 -0
  5. package/dist/init-template/README.md +7 -0
  6. package/dist/{init-templates → init-template/app}/browser/jest.config.js +11 -11
  7. package/dist/{init-templates → init-template/app}/browser/package.json +16 -12
  8. package/dist/{init-templates → init-template/app}/browser/scripts/esbuild/build-browser-plugin.mjs +110 -110
  9. package/dist/{init-templates → init-template/app}/browser/scripts/esbuild/plugins/importAsGlobals.mjs +38 -38
  10. package/dist/{init-templates → init-template/app}/browser/src/browser.ts +12 -12
  11. package/dist/{init-templates → init-template/app}/browser/src/plugin/index.test.ts +6 -6
  12. package/dist/{init-templates → init-template/app}/browser/src/plugin/index.ts +47 -49
  13. package/dist/{init-templates → init-template/app}/browser/tsconfig.json +34 -34
  14. package/dist/{init-templates/netlify-function → init-template/app/server-azure-function}/.eslintrc.cjs +2 -10
  15. package/dist/{init-templates/azure-function → init-template/app/server-azure-function}/.funcignore +12 -7
  16. package/dist/init-template/app/server-azure-function/.nvmrc +1 -0
  17. package/dist/{init-templates/azure-function → init-template/app/server-azure-function}/README.md +104 -107
  18. package/dist/{init-templates/azure-function → init-template/app/server-azure-function}/host.json +1 -10
  19. package/dist/init-template/app/server-azure-function/package.json +52 -0
  20. package/dist/{init-templates/azure-function → init-template/app/server-azure-function}/src/functions/seekaAppWebhook.ts +235 -236
  21. package/dist/{init-templates/azure-function → init-template/app/server-azure-function}/src/lib/browser/index.ts +54 -54
  22. package/dist/{init-templates/azure-function → init-template/app/server-azure-function}/src/lib/jobs/index.ts +1 -1
  23. package/dist/{init-templates/azure-function → init-template/app/server-azure-function}/src/lib/logging/index.ts +92 -92
  24. package/dist/{init-templates/azure-function/src/lib/browser → init-template/app/server-azure-function/src/lib}/models/index.ts +6 -6
  25. package/dist/{init-templates/azure-function → init-template/app/server-azure-function}/src/lib/state/redis/index.ts +96 -65
  26. package/dist/{init-templates/azure-function → init-template/app/server-azure-function}/src/lib/state/seeka/installations.ts +64 -66
  27. package/dist/{init-templates/azure-function → init-template/app/server-azure-function}/tsconfig.json +1 -1
  28. package/dist/init-template/package.json +28 -0
  29. package/dist/init-template/tsconfig.json +25 -0
  30. package/package.json +5 -4
  31. package/dist/init-templates/aws-lambda/.env.example +0 -15
  32. package/dist/init-templates/aws-lambda/.eslintrc.cjs +0 -19
  33. package/dist/init-templates/aws-lambda/.example.gitignore +0 -49
  34. package/dist/init-templates/aws-lambda/.gitlab-ci.yml +0 -39
  35. package/dist/init-templates/aws-lambda/.nvmrc +0 -1
  36. package/dist/init-templates/aws-lambda/.vscode/extensions.json +0 -5
  37. package/dist/init-templates/aws-lambda/.vscode/launch.json +0 -20
  38. package/dist/init-templates/aws-lambda/.vscode/settings.json +0 -3
  39. package/dist/init-templates/aws-lambda/.vscode/tasks.json +0 -12
  40. package/dist/init-templates/aws-lambda/README.md +0 -77
  41. package/dist/init-templates/aws-lambda/jest.config.js +0 -5
  42. package/dist/init-templates/aws-lambda/package.json +0 -53
  43. package/dist/init-templates/aws-lambda/scripts/ngrok.js +0 -28
  44. package/dist/init-templates/aws-lambda/src/index.test.ts +0 -7
  45. package/dist/init-templates/aws-lambda/src/index.ts +0 -33
  46. package/dist/init-templates/aws-lambda/src/lib/logging/index.ts +0 -88
  47. package/dist/init-templates/aws-lambda/src/lib/services/index.ts +0 -41
  48. package/dist/init-templates/aws-lambda/src/lib/state/redis/index.ts +0 -65
  49. package/dist/init-templates/aws-lambda/src/lib/state/seeka/installations.ts +0 -67
  50. package/dist/init-templates/aws-lambda/src/routes/seekaAppWebhook.ts +0 -194
  51. package/dist/init-templates/aws-lambda/tsconfig.json +0 -31
  52. package/dist/init-templates/aws-lambda/yarn.lock +0 -4392
  53. package/dist/init-templates/azure-function/.eslintrc.cjs +0 -19
  54. package/dist/init-templates/azure-function/.example.gitignore +0 -48
  55. package/dist/init-templates/azure-function/.gitlab-ci.yml +0 -48
  56. package/dist/init-templates/azure-function/.nvmrc +0 -1
  57. package/dist/init-templates/azure-function/.vscode/extensions.json +0 -7
  58. package/dist/init-templates/azure-function/.vscode/launch.json +0 -13
  59. package/dist/init-templates/azure-function/.vscode/settings.json +0 -9
  60. package/dist/init-templates/azure-function/.vscode/tasks.json +0 -39
  61. package/dist/init-templates/azure-function/jest.config.js +0 -5
  62. package/dist/init-templates/azure-function/package.json +0 -47
  63. package/dist/init-templates/azure-function/scripts/dev-queue-setup.js +0 -30
  64. package/dist/init-templates/azure-function/src/index.test.ts +0 -7
  65. package/dist/init-templates/azure-function/yarn.lock +0 -3772
  66. package/dist/init-templates/browser/.editorconfig +0 -14
  67. package/dist/init-templates/browser/.eslintrc.cjs +0 -1
  68. package/dist/init-templates/browser/.yarnrc +0 -1
  69. package/dist/init-templates/browser/yarn.lock +0 -3045
  70. package/dist/init-templates/netlify-function/.env.example +0 -18
  71. package/dist/init-templates/netlify-function/.example.gitignore +0 -36
  72. package/dist/init-templates/netlify-function/.nvmrc +0 -1
  73. package/dist/init-templates/netlify-function/.vscode/launch.json +0 -45
  74. package/dist/init-templates/netlify-function/README.md +0 -62
  75. package/dist/init-templates/netlify-function/jest.config.js +0 -5
  76. package/dist/init-templates/netlify-function/netlify.toml +0 -7
  77. package/dist/init-templates/netlify-function/package.json +0 -39
  78. package/dist/init-templates/netlify-function/src/api/example-job-background/index.ts +0 -52
  79. package/dist/init-templates/netlify-function/src/api/polling-example-job-scheduled/index.ts +0 -46
  80. package/dist/init-templates/netlify-function/src/api/seeka-app-webhook/index.ts +0 -217
  81. package/dist/init-templates/netlify-function/src/index.test.ts +0 -7
  82. package/dist/init-templates/netlify-function/src/lib/jobs/index.ts +0 -68
  83. package/dist/init-templates/netlify-function/src/lib/logging/index.ts +0 -91
  84. package/dist/init-templates/netlify-function/src/lib/services/index.ts +0 -41
  85. package/dist/init-templates/netlify-function/src/lib/state/redis/index.ts +0 -65
  86. package/dist/init-templates/netlify-function/src/lib/state/seeka/installations.ts +0 -67
  87. package/dist/init-templates/netlify-function/tsconfig.json +0 -25
  88. package/dist/init-templates/netlify-function/yarn.lock +0 -9337
  89. /package/dist/{init-templates → init-template/app}/browser/README.md +0 -0
  90. /package/dist/{init-templates/azure-function → init-template/app/server-azure-function}/local.settings.example.json +0 -0
  91. /package/dist/{init-templates/azure-function → init-template/app/server-azure-function}/scripts/ngrok.js +0 -0
  92. /package/dist/{init-templates/azure-function → init-template/app/server-azure-function}/src/functions/healthCheck.ts +0 -0
  93. /package/dist/{init-templates/azure-function → init-template/app/server-azure-function}/src/functions/pollingExample.ts +0 -0
  94. /package/dist/{init-templates/azure-function → init-template/app/server-azure-function}/src/functions/queueExample.ts +0 -0
  95. /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,7 +0,0 @@
1
- {
2
- "recommendations": [
3
- "ms-azuretools.vscode-azurefunctions",
4
- "ms-vscode.vscode-node-azure-pack",
5
- "dbaeumer.vscode-eslint"
6
- ]
7
- }
@@ -1,13 +0,0 @@
1
- {
2
- "version": "0.2.0",
3
- "configurations": [
4
- {
5
- "name": "Attach to Node Functions",
6
- "type": "node",
7
- "request": "attach",
8
- "port": 9229,
9
- "preLaunchTask": "func: host start",
10
- "restart": true
11
- }
12
- ]
13
- }
@@ -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,5 +0,0 @@
1
- /** @type {import('ts-jest').JestConfigWithTsJest} */
2
- module.exports = {
3
- preset: 'ts-jest',
4
- testEnvironment: 'node',
5
- };
@@ -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
- })();
@@ -1,7 +0,0 @@
1
- import { describe, expect, test } from '@jest/globals';
2
-
3
- describe('test example module', () => {
4
- test('should be false', () => {
5
- expect(false).toBeFalsy();
6
- });
7
- });