Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint"
"@typescript-eslint",
"header"
],
"parserOptions": {
"project": "tsconfig.json",
Expand All @@ -14,6 +15,15 @@
"plugin:prettier/recommended"
],
"rules": {
"header/header": [
2,
"line",
[
" Copyright (c) .NET Foundation. All rights reserved.",
" Licensed under the MIT License."
],
2
],
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
Expand Down
17 changes: 17 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"chai": "^4.2.0",
"chai-as-promised": "^7.1.1",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-header": "^3.1.1",
"eslint-plugin-prettier": "^4.0.0",
"eslint": "^7.32.0",
"husky": "^7.0.2",
Expand Down
3 changes: 3 additions & 0 deletions src/Context.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License.

import {
BindingDefinition,
Context,
Expand Down
3 changes: 3 additions & 0 deletions src/FunctionInfo.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License.

import { AzureFunctionsRpcMessages as rpc } from '../azure-functions-language-worker-protobuf/src/rpc';
import { toRpcHttp, toTypedData } from './converters';

Expand Down
3 changes: 3 additions & 0 deletions src/FunctionLoader.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License.

import * as url from 'url';
import { isFunction, isObject } from 'util';
import { AzureFunctionsRpcMessages as rpc } from '../azure-functions-language-worker-protobuf/src/rpc';
Expand Down
3 changes: 3 additions & 0 deletions src/GrpcService.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License.

import * as grpc from 'grpc';
import * as protobuf from 'protobufjs';
// import protobufjs json descriptor
Expand Down
3 changes: 3 additions & 0 deletions src/Worker.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License.

import * as parseArgs from 'minimist';
import { AzureFunctionsRpcMessages as rpc } from '../azure-functions-language-worker-protobuf/src/rpc';
import { FunctionLoader } from './FunctionLoader';
Expand Down
3 changes: 3 additions & 0 deletions src/WorkerChannel.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License.

import { Context } from '@azure/functions';
import { format, isFunction } from 'util';
import { AzureFunctionsRpcMessages as rpc } from '../azure-functions-language-worker-protobuf/src/rpc';
Expand Down
3 changes: 3 additions & 0 deletions src/augmenters/InvocationRequestAugmenters.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License.

import { AzureFunctionsRpcMessages as rpc } from '../../azure-functions-language-worker-protobuf/src/rpc';

/**
Expand Down
3 changes: 3 additions & 0 deletions src/augmenters/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License.

export * from './InvocationRequestAugmenters';
3 changes: 3 additions & 0 deletions src/converters/BindingConverters.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License.

import { BindingDefinition, ContextBindingData } from '@azure/functions';
import { AzureFunctionsRpcMessages as rpc } from '../../azure-functions-language-worker-protobuf/src/rpc';
import { FunctionInfo } from '../FunctionInfo';
Expand Down
3 changes: 3 additions & 0 deletions src/converters/RpcConverters.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License.

import { TraceContext } from '@azure/functions';
import { isLong } from 'long';
import {
Expand Down
3 changes: 3 additions & 0 deletions src/converters/RpcHttpConverters.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License.

import { Cookie, HttpMethod } from '@azure/functions';
import {
AzureFunctionsRpcMessages as rpc,
Expand Down
3 changes: 3 additions & 0 deletions src/converters/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License.

export * from './BindingConverters';
export * from './RpcConverters';
export * from './RpcHttpConverters';
3 changes: 2 additions & 1 deletion src/http/Request.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Licensed under the MIT License.

import { HttpMethod, HttpRequest } from '@azure/functions';

export class RequestProperties implements HttpRequest {
Expand Down
5 changes: 3 additions & 2 deletions src/http/Response.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License.

import { Cookie } from '@azure/functions';

// Copyright (c) .NET Foundation. All rights thiserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
interface IResponse {
statusCode?: string | number;
headers: {
Expand Down
3 changes: 3 additions & 0 deletions src/nodejsWorker.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License.

const logPrefix = 'LanguageWorkerConsoleLog';
const errorPrefix = logPrefix + '[error] ';
const warnPrefix = logPrefix + '[warn] ';
Expand Down
3 changes: 3 additions & 0 deletions src/utils/InternalException.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License.

export class InternalException extends Error {
public isAzureFunctionsInternalException = true;
}
7 changes: 5 additions & 2 deletions src/utils/Logger.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License.

/**
* Use these methods only if you want to guarantee the messages reach the host despite potential performance impact.
Otherwise, please stick to utilizing the gRPC channel to propagate these messages with category: RpcLogCategory.System
* Use these methods only if you want to guarantee the messages reach the host despite potential performance impact.
* Otherwise, please stick to utilizing the gRPC channel to propagate these messages with category: RpcLogCategory.System
**/

const logPrefix = 'LanguageWorkerConsoleLog';
Expand Down
3 changes: 3 additions & 0 deletions test/BindingConvertersTests.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License.

import { expect } from 'chai';
import { fromString } from 'long';
import 'mocha';
Expand Down
3 changes: 3 additions & 0 deletions test/ContextTests.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License.

import { Context } from '@azure/functions';
import { expect } from 'chai';
import 'mocha';
Expand Down
3 changes: 3 additions & 0 deletions test/FunctionInfoTests.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License.

import { expect } from 'chai';
import 'mocha';
import { AzureFunctionsRpcMessages as rpc } from '../azure-functions-language-worker-protobuf/src/rpc';
Expand Down
3 changes: 3 additions & 0 deletions test/FunctionLoaderTests.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License.

import 'mocha';
import { AzureFunctionsRpcMessages as rpc } from '../azure-functions-language-worker-protobuf/src/rpc';
import { FunctionLoader } from '../src/FunctionLoader';
Expand Down
3 changes: 3 additions & 0 deletions test/RpcConvertersTests.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License.

import { expect } from 'chai';
import 'mocha';
import { AzureFunctionsRpcMessages as rpc } from '../azure-functions-language-worker-protobuf/src/rpc';
Expand Down
3 changes: 3 additions & 0 deletions test/RpcHttpConverters.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License.

import { Cookie } from '@azure/functions';
import { expect } from 'chai';
import 'mocha';
Expand Down
3 changes: 3 additions & 0 deletions test/TestEventStream.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License.

import { EventEmitter } from 'events';
import * as sinon from 'sinon';
import { AzureFunctionsRpcMessages as rpc } from '../azure-functions-language-worker-protobuf/src/rpc';
Expand Down
3 changes: 3 additions & 0 deletions test/TypesTests.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License.

import { expect } from 'chai';
import * as cp from 'child_process';
import 'mocha';
Expand Down
3 changes: 3 additions & 0 deletions test/WorkerChannelTests.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License.

import { expect } from 'chai';
import 'mocha';
import * as sinon from 'sinon';
Expand Down
3 changes: 3 additions & 0 deletions test/WorkerTests.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License.

import { expect } from 'chai';
import 'mocha';
import { startNodeWorker } from '../src/Worker';
Expand Down
21 changes: 21 additions & 0 deletions types/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) .NET Foundation. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE
3 changes: 3 additions & 0 deletions types/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License.

declare module '@azure/functions' {
/**
* Interface for your Azure Function code. This function must be exported (via module.exports or exports)
Expand Down
3 changes: 3 additions & 0 deletions types/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License.

// This file will be compiled by multiple versions of TypeScript as decribed in ./test/TypesTests.ts to verify there are no errors

import { AzureFunction, Context, Cookie, HttpMethod, HttpRequest } from '@azure/functions';
Expand Down