@pikku/azure-functions 0.6.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/CHANGELOG.md ADDED
@@ -0,0 +1,56 @@
1
+ # @pikku/azure-functions
2
+
3
+ ## 0.6.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 0a92fa7: refactor: pulling schema into seperate package since ajv doesnt work on cloudflare (also keeps bundle size small!)
8
+ - Updated dependencies [0a92fa7]
9
+ - @pikku/core@0.6.7
10
+
11
+ ## 0.6
12
+
13
+ Marking a major release to include channels and scheduled tasks
14
+
15
+ ## 0.5.4
16
+
17
+ ### Patch Changes
18
+
19
+ - 886a2fb: refactor: moving singletons (like routes and channels) to global to avoid nodemodule overrides
20
+ - Updated dependencies [a768bad]
21
+ - Updated dependencies [886a2fb]
22
+ - Updated dependencies [886a2fb]
23
+ - @pikku/core@0.5.28
24
+
25
+ ## 0.5.3
26
+
27
+ ### Patch Changes
28
+
29
+ - 0f96787: refactor: dropping cjs support
30
+ - 64e4a1e: refactor: seperating core into cleaner sub-packages
31
+ - c23524a: refactor: bump to versions to ensure correct package usage
32
+ - Updated dependencies [0f96787]
33
+ - Updated dependencies [64e4a1e]
34
+ - Updated dependencies [c23524a]
35
+ - @pikku/core@0.5.25
36
+
37
+ ## 0.5.2
38
+
39
+ ### Patch Changes
40
+
41
+ - bba25cc: chore: updating all packages to reflect major changes
42
+ - Updated dependencies [bba25cc]
43
+ - Updated dependencies [9deb482]
44
+ - Updated dependencies [ee0c6ea]
45
+ - @pikku/core@0.5.24
46
+
47
+ ## 0.5.1
48
+
49
+ ### Patch Changes
50
+
51
+ - d58c440: refactor: making http requests explicit to support other types
52
+ - b01ecbf: fix: adding index file
53
+ - Updated dependencies [cbcc75b]
54
+ - Updated dependencies [d58c440]
55
+ - Updated dependencies [11c50d4]
56
+ - @pikku/core@0.5.19
package/README.md ADDED
File without changes
@@ -0,0 +1,2 @@
1
+ export * from './pikku-az-functions-logger.js';
2
+ export * from './pikku-az-timer-request.js';
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ export * from './pikku-az-functions-logger.js';
2
+ export * from './pikku-az-timer-request.js';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAA;AAC9C,cAAc,6BAA6B,CAAA"}
@@ -0,0 +1,12 @@
1
+ import { InvocationContext } from '@azure/functions';
2
+ import { Logger, LogLevel } from '@pikku/core/services';
3
+ export declare class AzInvocationLogger implements Logger {
4
+ private context;
5
+ constructor(context: InvocationContext);
6
+ info(messageOrObj: string | Record<string, any>): void;
7
+ warn(messageOrObj: string | Record<string, any>): void;
8
+ error(messageOrObj: string | Record<string, any> | Error): void;
9
+ debug(message: string): void;
10
+ trace(message: string): void;
11
+ setLevel(level: LogLevel): void;
12
+ }
@@ -0,0 +1,24 @@
1
+ export class AzInvocationLogger {
2
+ context;
3
+ constructor(context) {
4
+ this.context = context;
5
+ }
6
+ info(messageOrObj) {
7
+ this.context.info(messageOrObj);
8
+ }
9
+ warn(messageOrObj) {
10
+ this.context.warn(messageOrObj);
11
+ }
12
+ error(messageOrObj) {
13
+ this.context.error(messageOrObj);
14
+ }
15
+ debug(message) {
16
+ this.context.debug(message);
17
+ }
18
+ trace(message) {
19
+ this.context.trace(message);
20
+ }
21
+ setLevel(level) {
22
+ }
23
+ }
24
+ //# sourceMappingURL=pikku-az-functions-logger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pikku-az-functions-logger.js","sourceRoot":"","sources":["../src/pikku-az-functions-logger.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,kBAAkB;IAGT;IAApB,YAAoB,OAA0B;QAA1B,YAAO,GAAP,OAAO,CAAmB;IAAG,CAAC;IAE3C,IAAI,CAAC,YAA0C;QACpD,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA;IACjC,CAAC;IAEM,IAAI,CAAC,YAA0C;QACpD,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA;IACjC,CAAC;IAEM,KAAK,CAAC,YAAkD;QAC7D,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,YAAY,CAAC,CAAA;IAClC,CAAC;IAEM,KAAK,CAAC,OAAe;QAC1B,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;IAC7B,CAAC;IAEM,KAAK,CAAC,OAAe;QAC1B,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;IAC7B,CAAC;IAEM,QAAQ,CAAC,KAAe;IAE/B,CAAC;CACF"}
@@ -0,0 +1,5 @@
1
+ import { InvocationContext } from '@azure/functions';
2
+ import { PikkuRequest } from '@pikku/core';
3
+ export declare class PikkuAZTimerRequest<In = any> extends PikkuRequest<In> {
4
+ constructor(_context: InvocationContext, data: In);
5
+ }
@@ -0,0 +1,7 @@
1
+ import { PikkuRequest } from '@pikku/core';
2
+ export class PikkuAZTimerRequest extends PikkuRequest {
3
+ constructor(_context, data) {
4
+ super(data);
5
+ }
6
+ }
7
+ //# sourceMappingURL=pikku-az-timer-request.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pikku-az-timer-request.js","sourceRoot":"","sources":["../src/pikku-az-timer-request.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE1C,MAAM,OAAO,mBAA8B,SAAQ,YAAgB;IACjE,YAAY,QAA2B,EAAE,IAAQ;QAC/C,KAAK,CAAC,IAAI,CAAC,CAAA;IACb,CAAC;CACF"}
package/package.json ADDED
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "@pikku/azure-functions",
3
+ "version": "0.6.1",
4
+ "license": "MIT",
5
+ "author": "yasser.fadl@gmail.com",
6
+ "module": "dist/index.js",
7
+ "main": "dist/index.js",
8
+ "type": "module",
9
+ "scripts": {
10
+ "tsc": "tsc",
11
+ "build:esm": "tsc -b",
12
+ "build": "yarn build:esm",
13
+ "release": "npm run build && npm test",
14
+ "ncu": "ncu",
15
+ "test": "bash run-tests.sh",
16
+ "test:watch": "bash run-tests.sh --watch",
17
+ "test:coverage": "bash run-tests.sh --coverage"
18
+ },
19
+ "peerDependencies": {
20
+ "@pikku/core": "^0.6.7"
21
+ },
22
+ "devDependencies": {
23
+ "typescript": "^5.6.3"
24
+ },
25
+ "engines": {
26
+ "node": ">=18"
27
+ }
28
+ }
package/run-tests.sh ADDED
@@ -0,0 +1,53 @@
1
+ #!/bin/bash
2
+
3
+ # Enable nullglob to handle cases where no files match the pattern
4
+ shopt -s nullglob
5
+
6
+ # Initialize variables for options
7
+ watch_mode=false
8
+ coverage_mode=false
9
+
10
+ # Parse command-line options
11
+ while [[ $# -gt 0 ]]; do
12
+ case $1 in
13
+ --watch)
14
+ watch_mode=true
15
+ shift
16
+ ;;
17
+ --coverage)
18
+ coverage_mode=true
19
+ shift
20
+ ;;
21
+ *)
22
+ echo "Unknown option: $1"
23
+ exit 1
24
+ ;;
25
+ esac
26
+ done
27
+
28
+ # Define the pattern to match your test files
29
+ pattern="src/*.test.ts"
30
+
31
+ # Expand the pattern into an array of files
32
+ files=($(find src -type f -name "*.test.ts"))
33
+
34
+ # Check if any files matched the pattern
35
+ if [ ${#files[@]} -eq 0 ]; then
36
+ echo "No test files found matching pattern: $pattern"
37
+ exit 0
38
+ fi
39
+
40
+ # Construct the node command
41
+ node_cmd="node --import tsx --test"
42
+
43
+ # Append options based on flags
44
+ if [ "$watch_mode" = true ]; then
45
+ node_cmd="$node_cmd --watch"
46
+ fi
47
+
48
+ if [ "$coverage_mode" = true ]; then
49
+ node_cmd="$node_cmd --experimental-test-coverage --test-reporter=lcov --test-reporter-destination=lcov.info"
50
+ fi
51
+
52
+ # Execute the node command with the expanded list of files
53
+ $node_cmd "${files[@]}"
package/src/index.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from './pikku-az-functions-logger.js'
2
+ export * from './pikku-az-timer-request.js'
@@ -0,0 +1,32 @@
1
+ import { InvocationContext } from '@azure/functions'
2
+ import { Logger, LogLevel } from '@pikku/core/services'
3
+
4
+ export class AzInvocationLogger implements Logger {
5
+ // private logLevel: LogLevel = LogLevel.info
6
+
7
+ constructor(private context: InvocationContext) {}
8
+
9
+ public info(messageOrObj: string | Record<string, any>): void {
10
+ this.context.info(messageOrObj)
11
+ }
12
+
13
+ public warn(messageOrObj: string | Record<string, any>): void {
14
+ this.context.warn(messageOrObj)
15
+ }
16
+
17
+ public error(messageOrObj: string | Record<string, any> | Error): void {
18
+ this.context.error(messageOrObj)
19
+ }
20
+
21
+ public debug(message: string): void {
22
+ this.context.debug(message)
23
+ }
24
+
25
+ public trace(message: string): void {
26
+ this.context.trace(message)
27
+ }
28
+
29
+ public setLevel(level: LogLevel): void {
30
+ // this.logLevel = level
31
+ }
32
+ }
@@ -0,0 +1,8 @@
1
+ import { InvocationContext } from '@azure/functions'
2
+ import { PikkuRequest } from '@pikku/core'
3
+
4
+ export class PikkuAZTimerRequest<In = any> extends PikkuRequest<In> {
5
+ constructor(_context: InvocationContext, data: In) {
6
+ super(data)
7
+ }
8
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,17 @@
1
+ {
2
+ "extends": "../../../tsconfig.json",
3
+ "compilerOptions": {
4
+ "rootDir": "./src",
5
+ "module": "Node16",
6
+ "outDir": "dist",
7
+ "target": "esnext",
8
+ "declaration": true
9
+ },
10
+ "include": ["bin/**/*.ts", "src/**/*.ts"],
11
+ "exclude": ["**/*.test.ts", "node_modules", "bin/dist"],
12
+ "references": [
13
+ {
14
+ "path": "../../core/tsconfig.json"
15
+ }
16
+ ]
17
+ }
@@ -0,0 +1 @@
1
+ {"root":["./src/index.ts","./src/pikku-az-functions-logger.ts","./src/pikku-az-timer-request.ts"],"version":"5.7.3"}