diff --git a/packages/azure-functions/package.json b/packages/azure-functions/package.json index 0089250..541ed3c 100644 --- a/packages/azure-functions/package.json +++ b/packages/azure-functions/package.json @@ -37,7 +37,9 @@ }, "devDependencies": { "@types/express": "^4.17.21", + "@types/lodash.camelcase": "^4.3.9", "@types/uuid": "^9.0.7", + "import": "^0.0.6", "node-mocks-http": "^1.14.1" } } \ No newline at end of file diff --git a/packages/azure-functions/src/handler.ts b/packages/azure-functions/src/handler.ts index 5ebf542..066147d 100644 --- a/packages/azure-functions/src/handler.ts +++ b/packages/azure-functions/src/handler.ts @@ -6,6 +6,8 @@ import type { HandlerFunction, RegisterFunctionOption, AzureFunctionsEndpoint, F import { NammathamContext } from './nammatham-context'; +import camelCase from 'lodash.camelcase'; + export class AzureFunctionsHandler< TTriggerType, TReturnType, @@ -37,7 +39,7 @@ export class AzureFunctionsHandler< return { ...this.functionOption, type: 'azure-functions', - name: this.funcName, + name: camelCase(this.funcName), invokeHandler, registerFunc: this.registerFunc, }; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 393a224..6db6750 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -280,9 +280,15 @@ importers: '@types/express': specifier: ^4.17.21 version: 4.17.21 + '@types/lodash.camelcase': + specifier: ^4.3.9 + version: 4.3.9 '@types/uuid': specifier: ^9.0.7 version: 9.0.7 + import: + specifier: ^0.0.6 + version: 0.0.6 node-mocks-http: specifier: ^1.14.1 version: 1.14.1 @@ -840,6 +846,12 @@ packages: '@types/jsonfile@6.1.4': resolution: {integrity: sha512-D5qGUYwjvnNNextdU59/+fI+spnwtTFmyQP0h+PfIOSkNfpU6AOICUOkm4i0OnSk+NyjdPJrxCDro0sJsWlRpQ==} + '@types/lodash.camelcase@4.3.9': + resolution: {integrity: sha512-ys9/hGBfsKxzmFI8hckII40V0ASQ83UM2pxfQRghHAwekhH4/jWtjz/3/9YDy7ZpUd/H0k2STSqmPR28dnj7Zg==} + + '@types/lodash@4.17.1': + resolution: {integrity: sha512-X+2qazGS3jxLAIz5JDXDzglAF3KpijdhFxlf/V1+hEsOUc+HnWi81L/uv/EvGuV90WY+7mPGFCUDGfQC3Gj95Q==} + '@types/mime@1.3.5': resolution: {integrity: sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==} @@ -1760,6 +1772,11 @@ packages: resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} engines: {node: '>=6'} + import@0.0.6: + resolution: {integrity: sha512-QPhTdjy9J4wUzmWSG7APkSgMFuPGPw+iJTYUblcfc2AfpqaatbwgCldK1HoLYx+v/+lWvab63GWZtNkcnj9JcQ==} + engines: {node: '>=0.10.0'} + hasBin: true + imurmurhash@0.1.4: resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} engines: {node: '>=0.8.19'} @@ -2207,6 +2224,9 @@ packages: resolution: {integrity: sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==} engines: {node: '>=12'} + optimist@0.3.7: + resolution: {integrity: sha512-TCx0dXQzVtSCg2OgY/bO9hjM9cV4XYx09TVK+s3+FhkjT6LovsLe+pPMzpWf+6yXK/hUizs2gUoTw3jHM0VaTQ==} + optionator@0.9.3: resolution: {integrity: sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==} engines: {node: '>= 0.8.0'} @@ -2976,6 +2996,10 @@ packages: engines: {node: '>=8'} hasBin: true + wordwrap@0.0.3: + resolution: {integrity: sha512-1tMA907+V4QmxV7dbRvb4/8MaRALK6q9Abid3ndMYnbyo8piisCmeONVqVSXqQA3KaP4SLt5b7ud6E2sqP8TFw==} + engines: {node: '>=0.4.0'} + wrap-ansi@6.2.0: resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} engines: {node: '>=8'} @@ -3432,6 +3456,12 @@ snapshots: dependencies: '@types/node': 18.19.8 + '@types/lodash.camelcase@4.3.9': + dependencies: + '@types/lodash': 4.17.1 + + '@types/lodash@4.17.1': {} + '@types/mime@1.3.5': {} '@types/mime@3.0.4': {} @@ -4536,6 +4566,10 @@ snapshots: parent-module: 1.0.1 resolve-from: 4.0.0 + import@0.0.6: + dependencies: + optimist: 0.3.7 + imurmurhash@0.1.4: {} inflight@1.0.6: @@ -4998,6 +5032,10 @@ snapshots: is-docker: 2.2.1 is-wsl: 2.2.0 + optimist@0.3.7: + dependencies: + wordwrap: 0.0.3 + optionator@0.9.3: dependencies: '@aashutoshrathi/word-wrap': 1.2.6 @@ -5800,6 +5838,8 @@ snapshots: siginfo: 2.0.0 stackback: 0.0.2 + wordwrap@0.0.3: {} + wrap-ansi@6.2.0: dependencies: ansi-styles: 4.3.0