Skip to content

Commit bd32aa0

Browse files
Merge pull request #4 from Azure/swapnil/serviceBusSdkBindingImpl
Azure Functions Service Bus Extensions with Message Settlement
2 parents ef3ceb5 + 7e6d987 commit bd32aa0

37 files changed

+11329
-1
lines changed

.gitignore

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,3 +398,47 @@ FodyWeavers.xsd
398398

399399
# JetBrains Rider
400400
*.sln.iml
401+
# Logs
402+
logs
403+
*.log
404+
npm-debug.log*
405+
406+
# Runtime data
407+
pids
408+
*.pid
409+
*.seed
410+
411+
# Directory for instrumented libs generated by jscoverage/JSCover
412+
lib-cov
413+
414+
# Coverage directory used by tools like istanbul
415+
coverage
416+
417+
# nyc test coverage
418+
.nyc_output
419+
420+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
421+
.grunt
422+
423+
# node-waf configuration
424+
.lock-wscript
425+
426+
# Compiled binary addons (http://nodejs.org/api/addons.html)
427+
build/Release
428+
429+
# Dependency directories
430+
node_modules
431+
jspm_packages
432+
433+
# Optional npm cache directory
434+
.npm
435+
436+
# Optional REPL history
437+
.node_repl_history
438+
439+
dist
440+
out
441+
pkg
442+
*.tgz
443+
444+
**/*-test-results.xml

azure-functions-nodejs-extensions-base/types/resourceFactory.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export interface ModelBindingData {
88
version?: string | null;
99
}
1010

11-
export type ResourceFactory = (modelBindingData: ModelBindingData) => unknown;
11+
export type ResourceFactory = (modelBindingData: ModelBindingData | ModelBindingData[]) => unknown;
1212

1313
export class ResourceFactoryResolver {
1414
private constructor();
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"parser": "@typescript-eslint/parser",
3+
"plugins": ["@typescript-eslint", "header", "deprecation", "simple-import-sort", "import"],
4+
"parserOptions": {
5+
"project": "tsconfig.json",
6+
"sourceType": "module"
7+
},
8+
"extends": [
9+
"eslint:recommended",
10+
"plugin:@typescript-eslint/recommended",
11+
"plugin:@typescript-eslint/recommended-requiring-type-checking",
12+
"plugin:prettier/recommended"
13+
],
14+
"rules": {
15+
"header/header": [
16+
2,
17+
"line",
18+
[" Copyright (c) .NET Foundation. All rights reserved.", " Licensed under the MIT License."],
19+
2
20+
],
21+
"deprecation/deprecation": "error",
22+
"@typescript-eslint/no-empty-interface": "off",
23+
"@typescript-eslint/no-explicit-any": "off",
24+
"@typescript-eslint/no-namespace": "off",
25+
"@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_", "ignoreRestSiblings": true }],
26+
"prefer-const": ["error", { "destructuring": "all" }],
27+
"@typescript-eslint/explicit-member-accessibility": [
28+
"error",
29+
{
30+
"accessibility": "no-public"
31+
}
32+
],
33+
"no-return-await": "off",
34+
"@typescript-eslint/return-await": "error",
35+
"eqeqeq": "error",
36+
"@typescript-eslint/no-empty-function": "off",
37+
"simple-import-sort/imports": [
38+
"error",
39+
{
40+
"groups": [["^\\u0000", "^node:", "^@?\\w", "^", "^\\."]]
41+
}
42+
],
43+
"simple-import-sort/exports": "error",
44+
"import/first": "error",
45+
"import/newline-after-import": "error",
46+
"import/no-duplicates": "error"
47+
},
48+
"ignorePatterns": ["**/*.js", "**/*.mjs", "**/*.cjs", "out", "dist"]
49+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
out
2+
dist
3+
node_modules
4+
5+
# Exclude markdown until this bug is fixed: https://github.com/prettier/prettier/issues/5019
6+
*.md
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"tabWidth": 4,
3+
"singleQuote": true,
4+
"printWidth": 120,
5+
"endOfLine": "auto"
6+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"]
3+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"type": "node",
6+
"request": "attach",
7+
"name": "Attach by Process ID",
8+
"processId": "${command:PickProcess}"
9+
},
10+
{
11+
"name": "Launch Unit Tests",
12+
"runtimeExecutable": "npm",
13+
"runtimeArgs": ["test"],
14+
"request": "launch",
15+
"skipFiles": ["<node_internals>/**"],
16+
"type": "node"
17+
}
18+
]
19+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"azureFunctions.showProjectWarning": false,
3+
"editor.codeActionsOnSave": ["source.fixAll"],
4+
"editor.formatOnSave": true,
5+
"editor.defaultFormatter": "esbenp.prettier-vscode",
6+
"typescript.tsdk": "node_modules/typescript/lib",
7+
"typescript.preferences.importModuleSpecifier": "relative"
8+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "npm: watch",
6+
"type": "npm",
7+
"script": "watch",
8+
"group": {
9+
"kind": "build",
10+
"isDefault": true
11+
},
12+
"problemMatcher": ["$ts-checker-webpack-watch"],
13+
"isBackground": true,
14+
"presentation": {
15+
"reveal": "never"
16+
}
17+
},
18+
{
19+
"type": "npm",
20+
"script": "lint",
21+
"problemMatcher": "$eslint-stylish",
22+
"label": "npm: lint"
23+
}
24+
]
25+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Contributing
2+
3+
- Clone the repository locally and open in VS Code
4+
- Run "Extensions: Show Recommended Extensions" from the [command palette](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette) and install all extensions listed under "Workspace Recommendations"
5+
- Run `npm install`
6+
- Run `npm run build`
7+
- Run `npm link`
8+
- Create or open a local function app to test with
9+
- In the local function app:
10+
- Follow the steps in the "Usage" section of the README for this repo
11+
- Run `npm link @azure/functions-extensions-servicebus`. This will point your app to the local repository for the `@azure/functions-extensions-servicebus` package
12+
- Add the following settings to your "local.settings.json" file or configure them directly as environment variables
13+
- `languageWorkers__node__arguments`: `--inspect`
14+
> 💡 Tip: Set `logging__logLevel__Worker` to `debug` if you want to view worker-specific logs in the output of `func start`
15+
- Start the app (i.e. run `func start` or press <kbd>F5</kbd>)
16+
- Back in this repository, press <kbd>F5</kbd> and select the process for your running function app
17+
- Before you submit a PR, run `npm test` and fix any issues. If you want to debug the tests, switch your [launch profile](https://code.visualstudio.com/docs/editor/debugging) in VS Code to "Launch Unit Tests" and press <kbd>F5</kbd>.
18+
19+
## Code of Conduct
20+
21+
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [[email protected]](mailto:[email protected]) with any additional questions or comments.
22+
23+
## Contributing to type definitions
24+
25+
The type definitions are located in the `types` folder. Please make sure to update the tests in `./test/types/index.test.ts` as well.

0 commit comments

Comments
 (0)