Bump actions/stale from 8.0.0 to 9.0.0 (#108)

Bumps [actions/stale](https://github.com/actions/stale) from 8.0.0 to 9.0.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/actions/stale/releases">actions/stale's releases</a>.</em></p>
<blockquote>
<h2>v9.0.0</h2>
<h2>Breaking Changes</h2>
<ol>
<li>Action is now stateful: If the action ends because of <a href="https://github.com/actions/stale#operations-per-run">operations-per-run</a> then the next run will start from the first unprocessed issue skipping the issues processed during the previous run(s). The state is reset when all the issues are processed. This should be considered for scheduling workflow runs.</li>
<li>Version 9 of this action updated the runtime to Node.js 20. All scripts are now run with Node.js 20 instead of Node.js 16 and are affected by any breaking changes between Node.js 16 and 20.</li>
</ol>
<h2>What Else Changed</h2>
<ol>
<li>Performance optimization that removes unnecessary API calls by <a href="https://github.com/dsame"><code>@​dsame</code></a> <a href="https://redirect.github.com/actions/stale/pull/1033/">#1033</a> fixes <a href="https://redirect.github.com/actions/stale/issues/792">#792</a></li>
<li>Logs displaying current github API rate limit by <a href="https://github.com/dsame"><code>@​dsame</code></a> <a href="https://redirect.github.com/actions/stale/pull/1032">#1032</a> addresses <a href="https://redirect.github.com/actions/stale/issues/1029">#1029</a></li>
</ol>
<p>For more information, please read the <a href="https://github.com/actions/stale#readme">action documentation</a> and its <a href="https://github.com/actions/stale#statefulness">section about statefulness</a></p>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/jmeridth"><code>@​jmeridth</code></a> made their first contribution in <a href="https://redirect.github.com/actions/stale/pull/984">actions/stale#984</a></li>
<li><a href="https://github.com/nikolai-laevskii"><code>@​nikolai-laevskii</code></a> made their first contribution in <a href="https://redirect.github.com/actions/stale/pull/1020">actions/stale#1020</a></li>
<li><a href="https://github.com/dusan-trickovic"><code>@​dusan-trickovic</code></a> made their first contribution in <a href="https://redirect.github.com/actions/stale/pull/1056">actions/stale#1056</a></li>
<li><a href="https://github.com/aparnajyothi-y"><code>@​aparnajyothi-y</code></a> made their first contribution in <a href="https://redirect.github.com/actions/stale/pull/1110">actions/stale#1110</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a href="https://github.com/actions/stale/compare/v8...v9.0.0">https://github.com/actions/stale/compare/v8...v9.0.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/actions/stale/commit/28ca1036281a5e5922ead5184a1bbf96e5fc984e"><code>28ca103</code></a> Upgrade Node to v20 (<a href="https://redirect.github.com/actions/stale/issues/1110">#1110</a>)</li>
<li><a href="https://github.com/actions/stale/commit/b69b346013879cedbf50c69f572cd85439a41936"><code>b69b346</code></a> build(deps-dev): bump <code>@​types/node</code> from 18.16.18 to 20.5.1 (<a href="https://redirect.github.com/actions/stale/issues/1079">#1079</a>)</li>
<li><a href="https://github.com/actions/stale/commit/88a6f4f6cbe6984b66da80d3d448d5f0c4d1a42d"><code>88a6f4f</code></a> build(deps-dev): bump typescript from 5.1.3 to 5.2.2 (<a href="https://redirect.github.com/actions/stale/issues/1083">#1083</a>)</li>
<li><a href="https://github.com/actions/stale/commit/796531a7b39835671cd9f436d7205b1556bbcff6"><code>796531a</code></a> Merge pull request <a href="https://redirect.github.com/actions/stale/issues/1080">#1080</a> from akv-platform/fix-delete-cache</li>
<li><a href="https://github.com/actions/stale/commit/8986f6218b4935e254d5b844e8c36b4d953f2643"><code>8986f62</code></a> Don not try to delete cache if it does not exists</li>
<li><a href="https://github.com/actions/stale/commit/cab99b362baa5afbbd8c7c78234e6b071b80687d"><code>cab99b3</code></a> fix typo proceeded/processed</li>
<li><a href="https://github.com/actions/stale/commit/184e7afe930f6b5c7ce52c4b3f087692c6e912f3"><code>184e7af</code></a> Merge pull request <a href="https://redirect.github.com/actions/stale/issues/1064">#1064</a> from actions/dependabot/npm_and_yarn/typescript-esli...</li>
<li><a href="https://github.com/actions/stale/commit/523885cf3c115dcdcbed573c7eaf0f5621f124e2"><code>523885c</code></a> chore: update eslint-plugin, parser and eslint-plugin-jest</li>
<li><a href="https://github.com/actions/stale/commit/2487a1dc2b501176ca975d2d8b4d3293d72180a2"><code>2487a1d</code></a> build(deps-dev): bump <code>@​typescript-eslint/eslint-plugin</code></li>
<li><a href="https://github.com/actions/stale/commit/60c722ee97faafece819a7c41b03ec113f99717d"><code>60c722e</code></a> Merge pull request <a href="https://redirect.github.com/actions/stale/issues/1063">#1063</a> from actions/dependabot/npm_and_yarn/jest-29.6.2</li>
<li>Additional commits viewable in <a href="https://github.com/actions/stale/compare/1160a2240286f5da8ec72b1c0816ce2481aabf84...28ca1036281a5e5922ead5184a1bbf96e5fc984e">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/stale&package-manager=github_actions&previous-version=8.0.0&new-version=9.0.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

</details>
1 file changed
tree: 9ff9a361f4e0e78bc6efd149e6501659eef313b2
  1. .github/
  2. example/
  3. lib/
  4. test/
  5. .gitignore
  6. .test_config
  7. analysis_options.yaml
  8. CHANGELOG.md
  9. LICENSE
  10. pubspec.yaml
  11. README.md
README.md

Dart CI pub package package publisher

A library that implements the JSON-RPC 2.0 spec.

Server

A JSON-RPC 2.0 server exposes a set of methods that can be called by clients. These methods can be registered using Server.registerMethod:

import 'dart:io';

import 'package:json_rpc_2/json_rpc_2.dart';
import 'package:web_socket_channel/io.dart';
import 'package:web_socket_channel/web_socket_channel.dart';

void main() async {
  var httpServer = await HttpServer.bind(InternetAddress.loopbackIPv4, 4321);
  var connectedChannels =
      httpServer.transform(WebSocketTransformer()).map(IOWebSocketChannel.new);
  connectedChannels.listen(handleClient);
}

void handleClient(WebSocketChannel socket) {
  // The socket is a `StreamChannel<dynamic>` because it might emit binary
  // `List<int>`, but JSON RPC 2 only works with Strings so we assert it only
  // emits those by casting it.
  var server = Server(socket.cast<String>());

  // Any string may be used as a method name. JSON-RPC 2.0 methods are
  // case-sensitive.
  var i = 0;
  server.registerMethod('count', () {
    // Just return the value to be sent as a response to the client. This can
    // be anything JSON-serializable, or a Future that completes to something
    // JSON-serializable.
    return i++;
  });

  // Methods can take parameters. They're presented as a `Parameters` object
  // which makes it easy to validate that the expected parameters exist.
  server.registerMethod('echo', (Parameters params) {
    // If the request doesn't have a "message" parameter this will
    // automatically send a response notifying the client that the request
    // was invalid.
    return params['message'].value;
  });

  // `Parameters` has methods for verifying argument types.
  server.registerMethod('subtract', (Parameters params) {
    // If "minuend" or "subtrahend" aren't numbers, this will reject the
    // request.
    return params['minuend'].asNum - params['subtrahend'].asNum;
  });

  // [Parameters] also supports optional arguments.
  server.registerMethod('sort', (Parameters params) {
    var list = params['list'].asList;
    list.sort();
    if (params['descendint'].asBoolOr(false)) {
      return list.reversed;
    } else {
      return list;
    }
  });

  // A method can send an error response by throwing a `RpcException`.
  // Any positive number may be used as an application- defined error code.
  const dividByZero = 1;
  server.registerMethod('divide', (Parameters params) {
    var divisor = params['divisor'].asNum;
    if (divisor == 0) {
      throw RpcException(dividByZero, 'Cannot divide by zero.');
    }

    return params['dividend'].asNum / divisor;
  });

  // To give you time to register all your methods, the server won't start
  // listening for requests until you call `listen`. Messages are buffered until
  // listen is called. The returned Future won't complete until the connection
  // is closed.
  server.listen();
}

Client

A JSON-RPC 2.0 client calls methods on a server and handles the server's responses to those method calls. These methods can be called using Client.sendRequest:

import 'package:json_rpc_2/json_rpc_2.dart';
import 'package:pedantic/pedantic.dart';
import 'package:web_socket_channel/web_socket_channel.dart';

void main() async {
  var socket = WebSocketChannel.connect(Uri.parse('ws://localhost:4321'));
  var client = Client(socket.cast<String>());

  // The client won't subscribe to the input stream until you call `listen`.
  // The returned Future won't complete until the connection is closed.
  unawaited(client.listen());

  // This calls the "count" method on the server. A Future is returned that
  // will complete to the value contained in the server's response.
  var count = await client.sendRequest('count');
  print('Count is $count');

  // Parameters are passed as a simple Map or, for positional parameters, an
  // Iterable. Make sure they're JSON-serializable!
  var echo = await client.sendRequest('echo', {'message': 'hello'});
  print('Echo says "$echo"!');

  // A notification is a way to call a method that tells the server that no
  // result is expected. Its return type is `void`; even if it causes an
  // error, you won't hear back.
  client.sendNotification('count');

  // If the server sends an error response, the returned Future will complete
  // with an RpcException. You can catch this error and inspect its error
  // code, message, and any data that the server sent along with it.
  try {
    await client.sendRequest('divide', {'dividend': 2, 'divisor': 0});
  } on RpcException catch (error) {
    print('RPC error ${error.code}: ${error.message}');
  }

  await client.close();
}

Peer

Although JSON-RPC 2.0 only explicitly describes clients and servers, it also mentions that two-way communication can be supported by making each endpoint both a client and a server. This package supports this directly using the Peer class, which implements both Client and Server. It supports the same methods as those classes, and automatically makes sure that every message from the other endpoint is routed and handled correctly.

Publishing automation

For information about our publishing automation and release process, see https://github.com/dart-lang/ecosystem/wiki/Publishing-automation.