-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Nammatham] Marked version 1 and write doc v2 (#3)
- Loading branch information
Showing
17 changed files
with
1,017 additions
and
229 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
apps/nammatham/versioned_docs/version-1.x/community/_category_.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"label": "Community", | ||
"position": 3, | ||
"link": { | ||
"type": "generated-index" | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
apps/nammatham/versioned_docs/version-1.x/community/local-dev.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
sidebar_position: 1 | ||
--- | ||
|
||
# Local Development | ||
|
||
```sh | ||
npx nx build nammatham | ||
# or | ||
npx nx run nammatham:build | ||
npx nx run nammatham:dev | ||
|
||
npx nx run nammatham:test:watch | ||
|
||
|
||
# Publish npm with nx | ||
pnpm --filter nammatham publish | ||
``` | ||
|
8 changes: 8 additions & 0 deletions
8
apps/nammatham/versioned_docs/version-1.x/concept/_category_.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"label": "Concepts", | ||
"position": 2, | ||
"link": { | ||
"type": "generated-index", | ||
"description": "Nammatham Concepts." | ||
} | ||
} |
130 changes: 130 additions & 0 deletions
130
apps/nammatham/versioned_docs/version-1.x/concept/binding-type.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
--- | ||
sidebar_position: 3 | ||
--- | ||
# All Built-in Binding Type | ||
|
||
You can see all built-in binding type in [test case](https://github.com/thaitype/nammatham/blob/v1.x/packages/core/src/test-usecases/all-bindings/fixtures/functions/all-bindings.function.ts) as shown below: | ||
|
||
```ts | ||
import { BaseFunction, binding, functionName } from '../../../../main'; | ||
import { responseHelper } from '../../../response-helper'; | ||
import { HttpRequest, HttpResponse, Timer } from '@azure/functions'; | ||
|
||
const bindings = [ | ||
binding.httpTrigger({ name: 'req' as const }), // make string to literal type | ||
binding.http({ name: 'res' as const }), // make string to literal type | ||
binding.http_withReturn(), | ||
binding.timerTrigger({ name: 'timer' as const, schedule: '*' }), // make string to literal type | ||
binding.cosmosDBTrigger_v2({ | ||
name: 'document_trigger_v2' as const, | ||
collectionName: '', | ||
connectionStringSetting: '', | ||
databaseName: '', | ||
}), | ||
binding.cosmosDBTrigger_v4({ | ||
name: 'document_trigger_v4' as const, | ||
connection: '', | ||
containerName: '', | ||
databaseName: '', | ||
}), | ||
binding.cosmosDBTrigger({ | ||
name: 'document_trigger_default' as const, | ||
connection: '', | ||
containerName: '', | ||
databaseName: '', | ||
}), | ||
binding.cosmosDB_output_v2({ | ||
name: 'document_output_v2' as const, | ||
collectionName: '', | ||
connectionStringSetting: '', | ||
createIfNotExists: true, | ||
databaseName: '', | ||
}), | ||
binding.cosmosDB_output_v4({ | ||
name: 'document_output_v4' as const, | ||
createIfNotExists: true, | ||
databaseName: '', | ||
connection: '', | ||
containerName: '', | ||
}), | ||
binding.cosmosDB_output({ | ||
name: 'document_output_default' as const, | ||
createIfNotExists: true, | ||
databaseName: '', | ||
connection: '', | ||
containerName: '', | ||
}), | ||
binding.cosmosDB_input_v2({ | ||
name: 'document_input_v2' as const, | ||
collectionName: '', | ||
connectionStringSetting: '', | ||
databaseName: '', | ||
id: '', | ||
partitionKey: '', | ||
sqlQuery: '', | ||
}), | ||
binding.cosmosDB_input_v4({ | ||
name: 'document_input_v4' as const, | ||
databaseName: '', | ||
id: '', | ||
partitionKey: '', | ||
sqlQuery: '', | ||
connection: '', | ||
containerName: '', | ||
}), | ||
binding.cosmosDB_input({ | ||
name: 'document_input_default' as const, | ||
databaseName: '', | ||
id: '', | ||
partitionKey: '', | ||
sqlQuery: '', | ||
connection: '', | ||
containerName: '', | ||
}), | ||
binding.blobTrigger({ | ||
connection: '', | ||
name: 'blob_trigger' as const, | ||
path: '', | ||
}), | ||
binding.blob_input({ | ||
connection: '', | ||
name: 'blob_input' as const, | ||
path: '', | ||
}), | ||
binding.blob_output({ | ||
connection: '', | ||
name: 'blob_output' as const, | ||
path: '', | ||
}), | ||
] as const; | ||
|
||
const customBindings = binding.custom({ name: 'req' as const, type: 'custom', direction: 'in' }); | ||
|
||
@functionName('AllBindingsFunction', ...bindings, customBindings) | ||
export class AllBindingsFunction extends BaseFunction<typeof bindings> { | ||
public override execute() { | ||
const req: HttpRequest = this.bindings.req; | ||
const res: HttpResponse = this.bindings.res; | ||
const timer: Timer = this.bindings.timer; | ||
|
||
const document_output_v2: any = this.bindings.document_output_v2; | ||
const document_output_v4: any = this.bindings.document_output_v4; | ||
const document_output_default: any = this.bindings.document_output_default; | ||
|
||
const document_input_v2: any = this.bindings.document_input_v2; | ||
const document_input_v4: any = this.bindings.document_input_v4; | ||
const document_input_default: any = this.bindings.document_input_default; | ||
|
||
const document_trigger_v2: any = this.bindings.document_trigger_v2; | ||
const document_trigger_v4: any = this.bindings.document_trigger_v4; | ||
const document_trigger_default: any = this.bindings.document_trigger_default; | ||
|
||
const blob_trigger: any = this.bindings.blob_trigger; | ||
const blob_input: any = this.bindings.blob_input; | ||
const blob_output: any = this.bindings.blob_output; | ||
|
||
const { name } = this.req.query; | ||
this.res.send(responseHelper(name)); | ||
} | ||
} | ||
``` |
Oops, something went wrong.