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
14 changes: 7 additions & 7 deletions README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
## ライブラリをインストールする

```sh
npm install https://github.com/codemonger-io/mapping-template-compose.git#v0.1.1
npm install https://github.com/codemonger-io/mapping-template-compose.git#v0.2.0
```

## 動機
Expand Down Expand Up @@ -109,7 +109,7 @@ const date = `"date": "$util.escapeJavaScript($util.urlDecode($input.params("dat
このライブラリを用いると前節の例は以下のように書き換えられます。

```ts
import { composeMappingTemplate, ifThen } from 'mapping-template-compose';
import { composeMappingTemplate, ifThen } from '@codemonger-io/mapping-template-compose';

composeMappingTemplate([
ifThen(
Expand All @@ -130,7 +130,7 @@ composeMappingTemplate([
さらにモジュール化することもできます。

```ts
import { type KeyValue, composeMappingTemplate, ifThen } from 'mapping-template-compose';
import { type KeyValue, composeMappingTemplate, ifThen } from '@codemonger-io/mapping-template-compose';

const username: KeyValue = ['username', `"$util.escapeJavaScript($util.urlDecode($input.params("username"))).replaceAll("\\'", "'")"`];
const signature: KeyValue = ['signature', '$input.json("$.signature")'];
Expand Down Expand Up @@ -163,23 +163,23 @@ APIドキュメントは[`./api-docs/markdown`フォルダ](./api-docs/markdown/
### 依存関係の解決

```sh
npm ci
pnpm install --frozen-lockfile
```

### ビルド

```sh
npm run build
pnpm build
```

### テスト

```sh
npm test
pnpm test
```

### APIドキュメントの生成

```sh
npm run build:doc
pnpm build:doc
```
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This library is especially powerful if you combine it with [AWS Cloud Developmen
## Installing this library

```sh
npm install https://github.com/codemonger-io/mapping-template-compose.git#v0.1.1
npm install https://github.com/codemonger-io/mapping-template-compose.git#v0.2.0
```

## Motivation
Expand Down Expand Up @@ -109,7 +109,7 @@ This library is intended to **relieve the pain of writing mapping templates** li
You can rewrite the example in the previous section with this library into:

```ts
import { composeMappingTemplate, ifThen } from 'mapping-template-compose';
import { composeMappingTemplate, ifThen } from '@codemonger-io/mapping-template-compose';

composeMappingTemplate([
ifThen(
Expand All @@ -130,7 +130,7 @@ composeMappingTemplate([
You can make it further modular:

```ts
import { type KeyValue, composeMappingTemplate, ifThen } from 'mapping-template-compose';
import { type KeyValue, composeMappingTemplate, ifThen } from '@codemonger-io/mapping-template-compose';

const username: KeyValue = ['username', `"$util.escapeJavaScript($util.urlDecode($input.params("username"))).replaceAll("\\'", "'")"`];
const signature: KeyValue = ['signature', '$input.json("$.signature")'];
Expand Down Expand Up @@ -163,23 +163,23 @@ You can find the API documentation in [`./api-docs/markdown` folder](./api-docs/
### Resolving dependencies

```sh
npm ci
pnpm install --frozen-lockfile
```

### Building

```sh
npm run build
pnpm build
```

### Testing

```sh
npm test
pnpm test
```

### Generating the API documentation

```sh
npm run build:doc
pnpm build:doc
```
2 changes: 1 addition & 1 deletion api-docs/mapping-template-compose.api.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## API Report File for "mapping-template-compose"
## API Report File for "@codemonger-io/mapping-template-compose"

> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).

Expand Down
25 changes: 22 additions & 3 deletions api-docs/markdown/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,26 @@

## Packages

| Package | Description |
| --- | --- |
| [mapping-template-compose](./mapping-template-compose.md) | Compose API Gateway mapping templates. |
<table><thead><tr><th>

Package


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

[@codemonger-io/mapping-template-compose](./mapping-template-compose.md)


</td><td>

Compose API Gateway mapping templates.


</td></tr>
</tbody></table>
35 changes: 31 additions & 4 deletions api-docs/markdown/mapping-template-compose.andcommaconditions.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [mapping-template-compose](./mapping-template-compose.md) &gt; [andCommaConditions](./mapping-template-compose.andcommaconditions.md)
[Home](./index.md) &gt; [@codemonger-io/mapping-template-compose](./mapping-template-compose.md) &gt; [andCommaConditions](./mapping-template-compose.andcommaconditions.md)

## andCommaConditions() function

Expand All @@ -17,10 +17,37 @@ export declare function andCommaConditions(...conditions: string[]): string;

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| conditions | string\[\] | |
<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

conditions


</td><td>

string\[\]


</td><td>


</td></tr>
</tbody></table>
**Returns:**

string
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [mapping-template-compose](./mapping-template-compose.md) &gt; [composeMappingTemplate](./mapping-template-compose.composemappingtemplate.md)
[Home](./index.md) &gt; [@codemonger-io/mapping-template-compose](./mapping-template-compose.md) &gt; [composeMappingTemplate](./mapping-template-compose.composemappingtemplate.md)

## composeMappingTemplate() function

Expand All @@ -17,10 +17,37 @@ export declare function composeMappingTemplate(items: MappingTemplateItem[]): st

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| items | [MappingTemplateItem](./mapping-template-compose.mappingtemplateitem.md)<!-- -->\[\] | |
<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

items


</td><td>

[MappingTemplateItem](./mapping-template-compose.mappingtemplateitem.md)<!-- -->\[\]


</td><td>


</td></tr>
</tbody></table>
**Returns:**

string
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [mapping-template-compose](./mapping-template-compose.md) &gt; [getCommaConditionAfterIfBlock](./mapping-template-compose.getcommaconditionafterifblock.md)
[Home](./index.md) &gt; [@codemonger-io/mapping-template-compose](./mapping-template-compose.md) &gt; [getCommaConditionAfterIfBlock](./mapping-template-compose.getcommaconditionafterifblock.md)

## getCommaConditionAfterIfBlock() function

Expand All @@ -17,10 +17,37 @@ export declare function getCommaConditionAfterIfBlock(ifBlock: IfBlock): string;

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| ifBlock | [IfBlock](./mapping-template-compose.ifblock.md) | |
<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

ifBlock


</td><td>

[IfBlock](./mapping-template-compose.ifblock.md)


</td><td>


</td></tr>
</tbody></table>
**Returns:**

string
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [mapping-template-compose](./mapping-template-compose.md) &gt; [getCommaConditionAfterItem](./mapping-template-compose.getcommaconditionafteritem.md)
[Home](./index.md) &gt; [@codemonger-io/mapping-template-compose](./mapping-template-compose.md) &gt; [getCommaConditionAfterItem](./mapping-template-compose.getcommaconditionafteritem.md)

## getCommaConditionAfterItem() function

Expand All @@ -17,10 +17,37 @@ export declare function getCommaConditionAfterItem(item: MappingTemplateItem): s

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| item | [MappingTemplateItem](./mapping-template-compose.mappingtemplateitem.md) | |
<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

item


</td><td>

[MappingTemplateItem](./mapping-template-compose.mappingtemplateitem.md)


</td><td>


</td></tr>
</tbody></table>
**Returns:**

string
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [mapping-template-compose](./mapping-template-compose.md) &gt; [IfBlock](./mapping-template-compose.ifblock.md) &gt; [blockType](./mapping-template-compose.ifblock.blocktype.md)
[Home](./index.md) &gt; [@codemonger-io/mapping-template-compose](./mapping-template-compose.md) &gt; [IfBlock](./mapping-template-compose.ifblock.md) &gt; [blockType](./mapping-template-compose.ifblock.blocktype.md)

## IfBlock.blockType property

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [mapping-template-compose](./mapping-template-compose.md) &gt; [IfBlock](./mapping-template-compose.ifblock.md) &gt; [condition](./mapping-template-compose.ifblock.condition.md)
[Home](./index.md) &gt; [@codemonger-io/mapping-template-compose](./mapping-template-compose.md) &gt; [IfBlock](./mapping-template-compose.ifblock.md) &gt; [condition](./mapping-template-compose.ifblock.condition.md)

## IfBlock.condition property

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [mapping-template-compose](./mapping-template-compose.md) &gt; [IfBlock](./mapping-template-compose.ifblock.md) &gt; [elseBlock](./mapping-template-compose.ifblock.elseblock.md)
[Home](./index.md) &gt; [@codemonger-io/mapping-template-compose](./mapping-template-compose.md) &gt; [IfBlock](./mapping-template-compose.ifblock.md) &gt; [elseBlock](./mapping-template-compose.ifblock.elseblock.md)

## IfBlock.elseBlock property

Expand Down
Loading