@seeka-labs/cli-apps 1.1.6 → 1.1.7

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.
@@ -5,6 +5,7 @@ module.exports = {
5
5
  plugins: ['@typescript-eslint'],
6
6
  root: true,
7
7
  rules: {
8
- "@typescript-eslint/no-unused-vars": "warn"
8
+ "@typescript-eslint/no-unused-vars": "warn",
9
+ "@typescript-eslint/no-explicit-any": "off"
9
10
  }
10
11
  };
@@ -1,6 +1,7 @@
1
1
  import { createClient } from 'redis';
2
2
 
3
3
  import { getLogger } from '../../logging';
4
+ import winston from 'winston';
4
5
 
5
6
  const redisProtocol = process.env.REDIS_CONNECTION_TLS === 'true' ? 'rediss://' : 'redis://';
6
7
  const redisConn = `${redisProtocol}${process.env.REDIS_CONNECTION_USER}:${process.env.REDIS_CONNECTION_PASSWORD}@${process.env.REDIS_CONNECTION_HOST}:${process.env.REDIS_CONNECTION_PORT}`;
@@ -8,7 +9,7 @@ const redisConn = `${redisProtocol}${process.env.REDIS_CONNECTION_USER}:${proces
8
9
  const redisClient = createClient({
9
10
  url: redisConn
10
11
  })
11
- .on('error', err => getLogger().error('Redis Client ', { error: err }));
12
+ .on('error', (err: any) => getLogger().error('Redis Client ', { ex: winston.exceptions.getAllInfo(err) }));
12
13
 
13
14
  export const connect = async () => {
14
15
  await redisClient.connect();
@@ -5,6 +5,7 @@ module.exports = {
5
5
  plugins: ['@typescript-eslint'],
6
6
  root: true,
7
7
  rules: {
8
- "@typescript-eslint/no-unused-vars": "warn"
8
+ "@typescript-eslint/no-unused-vars": "warn",
9
+ "@typescript-eslint/no-explicit-any": "off"
9
10
  }
10
11
  };
@@ -17,7 +17,8 @@
17
17
  "prestart": "<packageManagerRunPrefix> clean && <packageManagerRunPrefix> build",
18
18
  "dev": "func start --port 7072",
19
19
  "tunnel": "node scripts/ngrok.js seeka-app-example-name-localdev",
20
- "deploy": "<packageManagerRunPrefix> clean && <packageManagerRunPrefix> build && func azure functionapp publish seeka-app-example-name --no-build --javascript"
20
+ "deploy": "<packageManagerRunPrefix> clean && <packageManagerRunPrefix> build && func azure functionapp publish seeka-app-example-name --no-build --javascript",
21
+ "dev:queue:create": "node scripts/dev-queue-setup.js sample-queue-name"
21
22
  },
22
23
  "dependencies": {
23
24
  "@azure/functions": "^4.1.0",
@@ -0,0 +1,18 @@
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
+ })();
@@ -13,7 +13,8 @@ app.storageQueue('queueExample', {
13
13
  });
14
14
 
15
15
  export async function queueExample(queueItem: string, context: InvocationContext): Promise<void> {
16
- const body = deserialiseQueuePayload<BackgroundJobRequestContext>(queueItem);
16
+ const body = typeof queueItem === 'string' ? deserialiseQueuePayload<BackgroundJobRequestContext>(queueItem) : queueItem as BackgroundJobRequestContext;
17
+
17
18
  const logger = backgroundJobLogger(queueNames.queueItemExampleQueueName, body, context);
18
19
  logger.profile(`queue.${queueNames.queueItemExampleQueueName}`)
19
20
 
@@ -1,6 +1,7 @@
1
1
  import { createClient } from 'redis';
2
2
 
3
3
  import { logger } from '../../logging';
4
+ import winston from 'winston';
4
5
 
5
6
  const redisProtocol = process.env.REDIS_CONNECTION_TLS === 'true' ? 'rediss://' : 'redis://';
6
7
  const redisConn = `${redisProtocol}${process.env.REDIS_CONNECTION_USER}:${process.env.REDIS_CONNECTION_PASSWORD}@${process.env.REDIS_CONNECTION_HOST}:${process.env.REDIS_CONNECTION_PORT}`;
@@ -8,7 +9,7 @@ const redisConn = `${redisProtocol}${process.env.REDIS_CONNECTION_USER}:${proces
8
9
  const redisClient = createClient({
9
10
  url: redisConn
10
11
  })
11
- .on('error', err => logger.error('Redis Client ', { error: err }));
12
+ .on('error', (err: any) => logger.error('Redis Client ', { ex: winston.exceptions.getAllInfo(err) }));
12
13
 
13
14
  export const connect = async () => {
14
15
  await redisClient.connect();
@@ -4,4 +4,8 @@ module.exports = {
4
4
  parser: '@typescript-eslint/parser',
5
5
  plugins: ['@typescript-eslint'],
6
6
  root: true,
7
+ rules: {
8
+ "@typescript-eslint/no-unused-vars": "warn",
9
+ "@typescript-eslint/no-explicit-any": "off"
10
+ }
7
11
  };
@@ -1,6 +1,7 @@
1
1
  import { createClient } from 'redis';
2
2
 
3
3
  import { logger } from '@/lib/logging';
4
+ import winston from 'winston';
4
5
 
5
6
  const redisProtocol = process.env.REDIS_CONNECTION_TLS === 'true' ? 'rediss://' : 'redis://';
6
7
  const redisConn = `${redisProtocol}${process.env.REDIS_CONNECTION_USER}:${process.env.REDIS_CONNECTION_PASSWORD}@${process.env.REDIS_CONNECTION_HOST}:${process.env.REDIS_CONNECTION_PORT}`;
@@ -8,7 +9,7 @@ const redisConn = `${redisProtocol}${process.env.REDIS_CONNECTION_USER}:${proces
8
9
  const redisClient = createClient({
9
10
  url: redisConn
10
11
  })
11
- .on('error', err => logger.error('Redis Client ', { error: err }));
12
+ .on('error', (err: any) => logger.error('Redis Client ', { ex: winston.exceptions.getAllInfo(err) }));
12
13
 
13
14
  export const connect = async () => {
14
15
  await redisClient.connect();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seeka-labs/cli-apps",
3
- "version": "1.1.6",
3
+ "version": "1.1.7",
4
4
  "description": "Seeka - Apps CLI",
5
5
  "author": "SEEKA <platform@seeka.co>",
6
6
  "license": "MIT",