diff --git a/.changeset/perfect-icons-vanish.md b/.changeset/perfect-icons-vanish.md new file mode 100644 index 0000000..f08605d --- /dev/null +++ b/.changeset/perfect-icons-vanish.md @@ -0,0 +1,5 @@ +--- +"async-call-rpc": minor +--- + +rename AsyncCallStrictJSONRPC to AsyncCallStrictOptions diff --git a/api/base.api.md b/api/base.api.md index d5a0814..387dded 100644 --- a/api/base.api.md +++ b/api/base.api.md @@ -36,8 +36,12 @@ export interface AsyncCallOptions Warning: This API is now obsolete. +> +> renamed to [AsyncCallStrictOptions](./async-call-rpc.asynccallstrictoptions.md) +> + Strict options **Signature:** ```typescript -export interface AsyncCallStrictJSONRPC +export interface AsyncCallStrictJSONRPC extends AsyncCallStrictOptions ``` +**Extends:** [AsyncCallStrictOptions](./async-call-rpc.asynccallstrictoptions.md) ## Remarks Control the behavior that different from the JSON-RPC specification. -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [methodNotFound?](./async-call-rpc.asynccallstrictjsonrpc.methodnotfound.md) | | boolean | _(Optional)_ Controls if AsyncCall send an ErrorResponse when the requested method is not defined. | -| [unknownMessage?](./async-call-rpc.asynccallstrictjsonrpc.unknownmessage.md) | | boolean | _(Optional)_ Controls if AsyncCall send an ErrorResponse when the message is not valid. | - diff --git a/docs/async-call-rpc.asynccallstrictoptions.md b/docs/async-call-rpc.asynccallstrictoptions.md new file mode 100644 index 0000000..0bee8ad --- /dev/null +++ b/docs/async-call-rpc.asynccallstrictoptions.md @@ -0,0 +1,25 @@ + + +[Home](./index.md) > [async-call-rpc](./async-call-rpc.md) > [AsyncCallStrictOptions](./async-call-rpc.asynccallstrictoptions.md) + +## AsyncCallStrictOptions interface + +Strict options + +**Signature:** + +```typescript +export interface AsyncCallStrictOptions +``` + +## Remarks + +Control the behavior that different from the JSON-RPC specification. + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [methodNotFound?](./async-call-rpc.asynccallstrictoptions.methodnotfound.md) | | boolean | _(Optional)_ Controls if AsyncCall send an ErrorResponse when the requested method is not defined. | +| [unknownMessage?](./async-call-rpc.asynccallstrictoptions.unknownmessage.md) | | boolean | _(Optional)_ Controls if AsyncCall send an ErrorResponse when the message is not valid. | + diff --git a/docs/async-call-rpc.asynccallstrictjsonrpc.methodnotfound.md b/docs/async-call-rpc.asynccallstrictoptions.methodnotfound.md similarity index 65% rename from docs/async-call-rpc.asynccallstrictjsonrpc.methodnotfound.md rename to docs/async-call-rpc.asynccallstrictoptions.methodnotfound.md index 8e90f08..9f00806 100644 --- a/docs/async-call-rpc.asynccallstrictjsonrpc.methodnotfound.md +++ b/docs/async-call-rpc.asynccallstrictoptions.methodnotfound.md @@ -1,18 +1,18 @@ - - -[Home](./index.md) > [async-call-rpc](./async-call-rpc.md) > [AsyncCallStrictJSONRPC](./async-call-rpc.asynccallstrictjsonrpc.md) > [methodNotFound](./async-call-rpc.asynccallstrictjsonrpc.methodnotfound.md) - -## AsyncCallStrictJSONRPC.methodNotFound property - -Controls if AsyncCall send an ErrorResponse when the requested method is not defined. - -**Signature:** - -```typescript -methodNotFound?: boolean; -``` - -## Remarks - -If this option is set to false, AsyncCall will ignore the request and print a log if the method is not defined. - + + +[Home](./index.md) > [async-call-rpc](./async-call-rpc.md) > [AsyncCallStrictOptions](./async-call-rpc.asynccallstrictoptions.md) > [methodNotFound](./async-call-rpc.asynccallstrictoptions.methodnotfound.md) + +## AsyncCallStrictOptions.methodNotFound property + +Controls if AsyncCall send an ErrorResponse when the requested method is not defined. + +**Signature:** + +```typescript +methodNotFound?: boolean; +``` + +## Remarks + +If this option is set to false, AsyncCall will ignore the request and print a log if the method is not defined. + diff --git a/docs/async-call-rpc.asynccallstrictjsonrpc.unknownmessage.md b/docs/async-call-rpc.asynccallstrictoptions.unknownmessage.md similarity index 69% rename from docs/async-call-rpc.asynccallstrictjsonrpc.unknownmessage.md rename to docs/async-call-rpc.asynccallstrictoptions.unknownmessage.md index ae397c6..be06b1b 100644 --- a/docs/async-call-rpc.asynccallstrictjsonrpc.unknownmessage.md +++ b/docs/async-call-rpc.asynccallstrictoptions.unknownmessage.md @@ -1,18 +1,18 @@ - - -[Home](./index.md) > [async-call-rpc](./async-call-rpc.md) > [AsyncCallStrictJSONRPC](./async-call-rpc.asynccallstrictjsonrpc.md) > [unknownMessage](./async-call-rpc.asynccallstrictjsonrpc.unknownmessage.md) - -## AsyncCallStrictJSONRPC.unknownMessage property - -Controls if AsyncCall send an ErrorResponse when the message is not valid. - -**Signature:** - -```typescript -unknownMessage?: boolean; -``` - -## Remarks - -If this option is set to false, AsyncCall will ignore the request that cannot be parsed as a valid JSON RPC payload. This is useful when the message channel is also used to transfer other kinds of messages. - + + +[Home](./index.md) > [async-call-rpc](./async-call-rpc.md) > [AsyncCallStrictOptions](./async-call-rpc.asynccallstrictoptions.md) > [unknownMessage](./async-call-rpc.asynccallstrictoptions.unknownmessage.md) + +## AsyncCallStrictOptions.unknownMessage property + +Controls if AsyncCall send an ErrorResponse when the message is not valid. + +**Signature:** + +```typescript +unknownMessage?: boolean; +``` + +## Remarks + +If this option is set to false, AsyncCall will ignore the request that cannot be parsed as a valid JSON RPC payload. This is useful when the message channel is also used to transfer other kinds of messages. + diff --git a/docs/async-call-rpc.md b/docs/async-call-rpc.md index 954cd55..bbdf795 100644 --- a/docs/async-call-rpc.md +++ b/docs/async-call-rpc.md @@ -28,6 +28,7 @@ See the introduction at [Github](https://github.com/Jack-Works/async-call) | [AsyncCallLogLevel](./async-call-rpc.asynccallloglevel.md) | Log options | | [AsyncCallOptions](./async-call-rpc.asynccalloptions.md) | Options for [AsyncCall()](./async-call-rpc.asynccall.md) | | [AsyncCallStrictJSONRPC](./async-call-rpc.asynccallstrictjsonrpc.md) | Strict options | +| [AsyncCallStrictOptions](./async-call-rpc.asynccallstrictoptions.md) | Strict options | | [CallbackBasedChannel](./async-call-rpc.callbackbasedchannel.md) | This interface represents a "callback" model. | | [ClientEncoding](./async-call-rpc.clientencoding.md) | Encoder of the client. | | [ConsoleInterface](./async-call-rpc.consoleinterface.md) | The minimal Console interface that AsyncCall needs. | diff --git a/src/types.ts b/src/types.ts index 2be5b37..62aba74 100644 --- a/src/types.ts +++ b/src/types.ts @@ -97,10 +97,8 @@ export interface AsyncCallLogLevel { * @remarks * Control the behavior that different from the JSON-RPC specification. * @public - * @privateRemarks - * TODO: rename to AsyncCallStrictOptions */ -export interface AsyncCallStrictJSONRPC { +export interface AsyncCallStrictOptions { /** * Controls if AsyncCall send an ErrorResponse when the requested method is not defined. * @remarks @@ -117,6 +115,14 @@ export interface AsyncCallStrictJSONRPC { */ unknownMessage?: boolean } +/** + * Strict options + * @remarks + * Control the behavior that different from the JSON-RPC specification. + * @public + * @deprecated renamed to {@link AsyncCallStrictOptions} + */ +export interface AsyncCallStrictJSONRPC extends AsyncCallStrictOptions {} /** * Options for {@link AsyncCall}