@aikirun/client 0.17.0 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -14,6 +14,7 @@ npm install @aikirun/client
14
14
  import { client } from "@aikirun/client";
15
15
  import { orderWorkflowV1 } from "./workflows.ts";
16
16
 
17
+ // Set AIKI_API_KEY env variable or pass apiKey option
17
18
  const aikiClient = client({
18
19
  url: "http://localhost:9850",
19
20
  redis: { host: "localhost", port: 6379 },
package/dist/index.js CHANGED
@@ -93,7 +93,7 @@ function getWorkerConsumerGroupName(workflowName, workflowVersionId, shard) {
93
93
 
94
94
  // ../../lib/array/utils.ts
95
95
  function isNonEmptyArray(value) {
96
- return value.length > 0;
96
+ return value !== void 0 && value.length > 0;
97
97
  }
98
98
  function shuffleArray(array) {
99
99
  const shuffledArray = Array.from(array);
@@ -552,7 +552,6 @@ function resolveSubscriberStrategy(client2, strategy, workflows, workerShards) {
552
552
  }
553
553
 
554
554
  // client.ts
555
- var AIKI_API_KEY_ENV_NAME = "AIKI_API_KEY";
556
555
  function client(params) {
557
556
  return new ClientImpl(params);
558
557
  }
@@ -560,9 +559,9 @@ var ClientImpl = class {
560
559
  constructor(params) {
561
560
  this.params = params;
562
561
  this.logger = params.logger ?? new ConsoleLogger();
563
- const apiKey = params.apiKey ?? process.env[AIKI_API_KEY_ENV_NAME];
562
+ const apiKey = params.apiKey ?? process.env.AIKI_API_KEY;
564
563
  if (!apiKey) {
565
- throw new Error(`API key is required. Provide it via 'apiKey' param or ${AIKI_API_KEY_ENV_NAME} env variable`);
564
+ throw new Error(`API key is required. Provide it via 'apiKey' param or AIKI_API_KEY env variable`);
566
565
  }
567
566
  const rpcLink = new RPCLink({
568
567
  url: `${params.url}/api`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aikirun/client",
3
- "version": "0.17.0",
3
+ "version": "0.18.0",
4
4
  "description": "Client SDK for Aiki - connect to the server, start workflows, and manage execution",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -18,7 +18,7 @@
18
18
  "build": "tsup"
19
19
  },
20
20
  "dependencies": {
21
- "@aikirun/types": "0.17.0",
21
+ "@aikirun/types": "0.18.0",
22
22
  "@orpc/client": "^1.9.3",
23
23
  "ioredis": "^5.4.1",
24
24
  "arktype": "^2.1.29"