This commit is contained in:
Eric Jizba 2021-11-22 15:43:52 -08:00 коммит произвёл GitHub
Родитель 85cd3cfad8
Коммит e7fc8676ca
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
31 изменённых файлов: 132 добавлений и 6 удалений

Просмотреть файл

@ -1,7 +1,8 @@
{
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint"
"@typescript-eslint",
"header"
],
"parserOptions": {
"project": "tsconfig.json",
@ -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",

17
package-lock.json сгенерированный
Просмотреть файл

@ -26,6 +26,7 @@
"chalk": "^4.0.0",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-header": "^3.1.1",
"eslint-plugin-prettier": "^4.0.0",
"husky": "^7.0.2",
"jsdoc": "^3.6.3",
@ -1593,6 +1594,15 @@
"eslint": ">=7.0.0"
}
},
"node_modules/eslint-plugin-header": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/eslint-plugin-header/-/eslint-plugin-header-3.1.1.tgz",
"integrity": "sha512-9vlKxuJ4qf793CmeeSrZUvVClw6amtpghq3CuWcB5cUNnWHQhgcqy5eF8oVKFk1G3Y/CbchGfEaw3wiIJaNmVg==",
"dev": true,
"peerDependencies": {
"eslint": ">=7.7.0"
}
},
"node_modules/eslint-plugin-prettier": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.0.0.tgz",
@ -5930,6 +5940,13 @@
"dev": true,
"requires": {}
},
"eslint-plugin-header": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/eslint-plugin-header/-/eslint-plugin-header-3.1.1.tgz",
"integrity": "sha512-9vlKxuJ4qf793CmeeSrZUvVClw6amtpghq3CuWcB5cUNnWHQhgcqy5eF8oVKFk1G3Y/CbchGfEaw3wiIJaNmVg==",
"dev": true,
"requires": {}
},
"eslint-plugin-prettier": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.0.0.tgz",

Просмотреть файл

@ -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",

Просмотреть файл

@ -1,3 +1,6 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License.
import {
BindingDefinition,
Context,

Просмотреть файл

@ -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';

Просмотреть файл

@ -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';

Просмотреть файл

@ -1,3 +1,6 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License.
import * as grpc from '@grpc/grpc-js';
import { ServiceClientConstructor } from '@grpc/grpc-js/build/src/make-client';
import * as grpcloader from '@grpc/proto-loader';

Просмотреть файл

@ -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';

Просмотреть файл

@ -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';

Просмотреть файл

@ -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';

Просмотреть файл

@ -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 {

Просмотреть файл

@ -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,

Просмотреть файл

@ -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';

Просмотреть файл

@ -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 {

Просмотреть файл

@ -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: {

Просмотреть файл

@ -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] ';

Просмотреть файл

@ -1,3 +1,6 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License.
export class InternalException extends Error {
public isAzureFunctionsInternalException = true;
}

Просмотреть файл

@ -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';

Просмотреть файл

@ -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';

Просмотреть файл

@ -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';

Просмотреть файл

@ -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';

Просмотреть файл

@ -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';

Просмотреть файл

@ -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';

Просмотреть файл

@ -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';

Просмотреть файл

@ -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';

Просмотреть файл

@ -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';

Просмотреть файл

@ -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';

Просмотреть файл

@ -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';

21
types/LICENSE Normal file
Просмотреть файл

@ -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
types/index.d.ts поставляемый
Просмотреть файл

@ -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)

Просмотреть файл

@ -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';