Releases: thaitype/nammatham
Releases · thaitype/nammatham
v2.0.0-alpha.13
- Add HTTP Response Helper
- Make
initNammatham
create Azure Functions for default - Add new Azure Functions trigger for
storageQueue
What's Changed
- Add HTTP response Helper & Make initNammatham create Azure Functions for default by @mildronize in #131
Full Changelog: v2.0.0-alpha.12...v2.0.0-alpha.13
v2.0.0-alpha.12
Fix: pino-dev
package is missing when publish
Full Changelog: v2.0.0-alpha.11...v2.0.0-alpha.12
v2.0.0-alpha.11
Fix: pnpm package lock in v2.0.0-alpha.10
Full Changelog: v2.0.0-alpha.10...v2.0.0-alpha.11
v2.0.0-alpha.10
What's Changed
- Explicitly use of dev mode by @mildronize in #127
Before
app.register(expressPlugin());
After
const dev = process.env.NODE_ENV === 'development';
app.register(expressPlugin({ dev }));
Full Changelog: v2.0.0-alpha.9...v2.0.0-alpha.10
v2.0.0-alpha.9
What's Changed
- Make sure Nammatham v2 is testable by @mildronize in #106
- Rename tRpcAzureFunctionsPlugin to unstable prefix by @mildronize in #115
- improve CLI interface by @mildronize in #116
- Add setContext, helper for injecting other dependencies by @mildronize in #117
- Add main package for entry of nammatham package by @mildronize in #118
Full Changelog: v2.0.0-alpha.8...v2.0.0-alpha.9
v2.0.0-alpha.8
Note: Breaking Changes
Before: in handler uses 2 params like Azure Functions Official Lib, e.g.
(request: HttpRequest, ctx: NammathamContext) => HttpResponse
Full Example:
import { initNammatham } from '@nammatham/core';
import { AzureFunctionsAdapter } from '@nammatham/azure-functions';
const n = initNammatham.create(new AzureFunctionsAdapter());
export const func = n.func;
export default func
.httpGet('hello')
.handler(async (request, ctx) => ({ body: 'OK' }) );
After:
interface NammathamContext {
context: InvocationContext;
trigger: HttpTrigger; // Using `trigger` instead of `input` because preventing confuse with Azure Functions `extraInput` and `inputs` modules.
}
(ctx: NammathamContext) => HttpResponse
Full Example
import { AzureFunctionsAdapter } from "@nammatham/azure-functions";
import { initNammatham } from "@nammatham/core";
import { expressPlugin } from "@nammatham/express";
const n = initNammatham.create(new AzureFunctionsAdapter());
const func = n.func;
const app = n.app;
const helloFunction = func
.httpGet('hello', {
route: 'hello-world',
})
.handler(async ({trigger, context}) => {
context.log('HTTP trigger function processed a request.');
context.debug(`Http function processed request for url "${trigger.url}"`);
const name = trigger.query.get('name') || (await trigger.text()) || 'world';
return { body: `Hello, ${name}!` };
});
app.addFunctions(helloFunction);
app.register(expressPlugin());
app.start();
What's Changed
- Issue 98: Apply single params for Azure Functions Handler by @mildronize in #105
Full Changelog: v2.0.0-alpha.6...v2.0.0-alpha.8
v2.0.0-alpha.6
What's Changed
- Add timer trigger to Azure Functions Adapter (issues-93) by @mildronize in #94
Full Changelog: v2.0.0-alpha.5...v2.0.0-alpha.6
v2.0.0-alpha.5
Full Changelog: v2.0.0-alpha.4...v2.0.0-alpha.5
1.3.0
What's Changed
1. Add Blob Trigger and Bindings helper function and their types #67
2. Add Service Bus Trigger and Bindings helper function and their types #69
2.1 Add Context.bindingData
for trigger type
interface TypedContext {
bindingData: TypedContextBindingData<T>;
}
If binding type is serviceBusTrigger
, bindingData
will be below:
export interface ServiceBusTriggerContextBindingData {
/**
* Enqueue Time UTC
*/
enqueuedTimeUtc: any;
/**
* Delivery Count
*/
deliveryCount: any;
/**
* Message ID
*/
messageId: any;
}
If binding type is httpTrigger
, bindingData
will be below:
export interface HttpTriggerContextBindingData {
query: {
[name: string]: any;
};
headers: {
[name: string]: any;
};
sys: {
methodName: string;
utcNow: string;
randGuid: string;
};
}
4. Improve binding helper inline doc of each property #65
Before
After
Affected Binding Helpers
- binding.http()
- binding.http_withReturn()
- binding.timerTrigger()
- binding.cosmosDBTrigger_v2()
- binding.cosmosDBTrigger_v4()
- binding.cosmosDBTrigger()
- binding.cosmosDB_output_v2()
- binding.cosmosDB_output_v4()
- binding.cosmosDB_output()
- binding.cosmosDB_input_v2()
- binding.cosmosDB_input_v4()
- binding.cosmosDB_input()
- binding.blobTrigger()
- binding.blob_input()
- binding.blob_output()
- binding.serviceBusTrigger()
- binding.serviceBus_output()
Pull Requests
- Improve binding helper inline doc of each property by @mildronize in #65
- Add Blob Trigger and Bindings helper function and their types by @mildronize in #67
- Add Service Bus Trigger and Bindings helper function and their types by @mildronize in #69
Full Changelog: 1.2.0...1.3.0
1.2.0
What's Changed
- Release 1.1.1-beta by @mildronize in #62
- Editor Header Readme by @mildronize in #63
- feat: export
Context
andTypedContext
type utility by @mildronize in #64
Full Changelog: 1.1.1-beta...1.2.0