orizu 0.0.7 → 0.0.8

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/dist/http.js CHANGED
@@ -19,6 +19,17 @@ export function resolveBaseUrl(flags = runtimeFlags) {
19
19
  }
20
20
  return 'https://orizu.ai';
21
21
  }
22
+ export function resolveLoginBaseUrl(flags = runtimeFlags) {
23
+ const fromFlags = getFlagBaseUrl(flags);
24
+ if (fromFlags) {
25
+ return fromFlags;
26
+ }
27
+ const fromEnv = process.env.ORIZU_BASE_URL;
28
+ if (fromEnv) {
29
+ return normalizeBaseUrl(fromEnv);
30
+ }
31
+ return 'https://orizu.ai';
32
+ }
22
33
  export function getBaseUrl() {
23
34
  return resolveBaseUrl();
24
35
  }
package/dist/index.js CHANGED
@@ -10,7 +10,7 @@ import { clearServerCredentials, getServerCredentials, saveServerCredentials } f
10
10
  import { parseDatasetFile } from './file-parser.js';
11
11
  import { parseDatasetReference } from './dataset-download.js';
12
12
  import { parseGlobalFlags } from './global-flags.js';
13
- import { authedFetch, getBaseUrl, setGlobalFlags } from './http.js';
13
+ import { authedFetch, getBaseUrl, resolveLoginBaseUrl, setGlobalFlags } from './http.js';
14
14
  function printUsage() {
15
15
  console.log(`orizu global options:\n\n --local Use http://localhost:3000\n --server <url> Use a specific server origin (for example: https://preview.example.com)\n\norizu commands:\n\n orizu login\n orizu logout\n orizu whoami\n orizu teams list\n orizu teams create [--name <name>]\n orizu teams members list [--team <teamSlug>]\n orizu teams members add --email <email> [--team <teamSlug>]\n orizu teams members remove --email <email> [--team <teamSlug>]\n orizu teams members role --team <teamSlug> --email <email> --role <admin|member>\n orizu projects list [--team <teamSlug>]\n orizu projects create --name <name> [--team <teamSlug>]\n orizu apps list [--project <team/project>]\n orizu apps create --project <team/project> --name <name> --dataset <datasetId> --file <path> --input-schema <json-path> --output-schema <json-path> [--component <name>]\n orizu apps update [--app <appId>] [--project <team/project>] --file <path> --input-schema <json-path> --output-schema <json-path> [--component <name>]\n orizu apps link-dataset --dataset <datasetId> [--app <appId>] [--project <team/project>] [--version <n>]\n orizu tasks list [--project <team/project>]\n orizu tasks create --project <team/project> --dataset <datasetId> --app <appId> --title <title> --assignees <userId1,userId2> [--instructions <text>] [--labels-per-item <n>]\n orizu tasks assign --task <taskId> --assignees <userId1,userId2>\n orizu tasks status --task <taskId> [--json]\n orizu datasets upload --file <path> [--project <team/project>] [--name <name>]\n orizu datasets download [--dataset <datasetId|datasetUrl>] [--project <team/project>] [--format <csv|json|jsonl>] [--out <path>]\n orizu datasets append [--dataset <datasetId|datasetUrl>] [--project <team/project>] --file <path>\n orizu datasets delete-rows [--dataset <datasetId|datasetUrl>] [--project <team/project>] [--row-ids <id1,id2>] [--row-indices <n1,n2>]\n orizu tasks export [--task <taskId>] [--format <csv|json|jsonl>] [--out <path>]`);
16
16
  }
@@ -341,7 +341,7 @@ function printTaskStatusSummary(data) {
341
341
  }
342
342
  }
343
343
  async function login() {
344
- const baseUrl = getBaseUrl();
344
+ const baseUrl = resolveLoginBaseUrl();
345
345
  const codeVerifier = createCodeVerifier();
346
346
  const codeChallenge = createCodeChallenge(codeVerifier);
347
347
  const callbackCode = await new Promise((resolve, reject) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orizu",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "bin": {
package/src/http.ts CHANGED
@@ -27,6 +27,20 @@ export function resolveBaseUrl(flags: GlobalFlags = runtimeFlags): string {
27
27
  return 'https://orizu.ai'
28
28
  }
29
29
 
30
+ export function resolveLoginBaseUrl(flags: GlobalFlags = runtimeFlags): string {
31
+ const fromFlags = getFlagBaseUrl(flags)
32
+ if (fromFlags) {
33
+ return fromFlags
34
+ }
35
+
36
+ const fromEnv = process.env.ORIZU_BASE_URL
37
+ if (fromEnv) {
38
+ return normalizeBaseUrl(fromEnv)
39
+ }
40
+
41
+ return 'https://orizu.ai'
42
+ }
43
+
30
44
  export function getBaseUrl(): string {
31
45
  return resolveBaseUrl()
32
46
  }
package/src/index.ts CHANGED
@@ -10,7 +10,7 @@ import { clearServerCredentials, getServerCredentials, saveServerCredentials } f
10
10
  import { parseDatasetFile } from './file-parser.js'
11
11
  import { parseDatasetReference } from './dataset-download.js'
12
12
  import { parseGlobalFlags } from './global-flags.js'
13
- import { authedFetch, getBaseUrl, setGlobalFlags } from './http.js'
13
+ import { authedFetch, getBaseUrl, resolveLoginBaseUrl, setGlobalFlags } from './http.js'
14
14
  import { LoginResponse } from './types.js'
15
15
 
16
16
  interface Team {
@@ -594,7 +594,7 @@ function printTaskStatusSummary(data: TaskStatusPayload) {
594
594
  }
595
595
 
596
596
  async function login() {
597
- const baseUrl = getBaseUrl()
597
+ const baseUrl = resolveLoginBaseUrl()
598
598
  const codeVerifier = createCodeVerifier()
599
599
  const codeChallenge = createCodeChallenge(codeVerifier)
600
600