@onequery/cli 0.1.2-linux-x64 → 0.1.2

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.
Files changed (125) hide show
  1. package/bin/onequery.js +156 -0
  2. package/bin/package-constants.js +95 -0
  3. package/package.json +20 -15
  4. package/runtime/migrations/20260327065242_curious_nightmare.sql +403 -0
  5. package/runtime/migrations/meta/20260327065242_snapshot.json +2817 -0
  6. package/runtime/migrations/meta/_journal.json +13 -0
  7. package/runtime/web/assets/CompositeItem-BV7KhPQk.js +1 -0
  8. package/runtime/web/assets/CompositeList-CX7HHxYw.js +1 -0
  9. package/runtime/web/assets/DialogTitle-z5f0waCI.js +1 -0
  10. package/runtime/web/assets/IconArrowRight-DsOD7mDl.js +1 -0
  11. package/runtime/web/assets/IconCheck-Gc24xPT2.js +1 -0
  12. package/runtime/web/assets/IconChevronDown-B-39MA7-.js +1 -0
  13. package/runtime/web/assets/IconCoins-C7Nn0L6R.js +1 -0
  14. package/runtime/web/assets/IconHistory-BqAd-xl2.js +1 -0
  15. package/runtime/web/assets/IconLoader2-B3B6M8nQ.js +1 -0
  16. package/runtime/web/assets/IconPlus-C3-kRhGX.js +1 -0
  17. package/runtime/web/assets/IconX-BQkA009b.js +1 -0
  18. package/runtime/web/assets/Separator-vw4jPN_6.js +1 -0
  19. package/runtime/web/assets/_authenticated-C5CjK6Mu.js +1 -0
  20. package/runtime/web/assets/_org_slug-D94kykq2.js +1 -0
  21. package/runtime/web/assets/api-base-url-DIb6qukm.js +1 -0
  22. package/runtime/web/assets/api-client-w1GRwBWy.js +1 -0
  23. package/runtime/web/assets/api-error-KjK7uFAE.js +1 -0
  24. package/runtime/web/assets/api-paths-ClEWWGwS.js +1 -0
  25. package/runtime/web/assets/app-routes-DdRvA1bK.js +1 -0
  26. package/runtime/web/assets/audit-TXhp0u8O.js +1 -0
  27. package/runtime/web/assets/auth-bootstrap-query-BhAn1APx.js +1 -0
  28. package/runtime/web/assets/auth-client-BlMeXgb4.js +3 -0
  29. package/runtime/web/assets/avatar-DzUYMSvr.js +1 -0
  30. package/runtime/web/assets/badge-DHOXVqXh.js +1 -0
  31. package/runtime/web/assets/budget-BaZbMGkP.js +1 -0
  32. package/runtime/web/assets/callback-8KQafZFQ.js +1 -0
  33. package/runtime/web/assets/card-Bsy6azfK.js +1 -0
  34. package/runtime/web/assets/checkbox-L6MjK5Df.js +1 -0
  35. package/runtime/web/assets/compiler-runtime-DCc3R3Xn.js +1 -0
  36. package/runtime/web/assets/connect-database-DhHeQ0pY.js +1 -0
  37. package/runtime/web/assets/create-org-C60JHlxs.js +1 -0
  38. package/runtime/web/assets/createReactComponent-_L2mp4Ui.js +1 -0
  39. package/runtime/web/assets/data-source-connection-form-Dbf1vMmU.js +173 -0
  40. package/runtime/web/assets/device-BKmB0Ojy.js +1 -0
  41. package/runtime/web/assets/dropdown-menu-CEyg7UUK.js +1 -0
  42. package/runtime/web/assets/empty-COnWCwda.js +1 -0
  43. package/runtime/web/assets/getDisabledMountTransitionStyles-BYKRz4ha.js +1 -0
  44. package/runtime/web/assets/getPseudoElementBounds-InhM-dWf.js +12 -0
  45. package/runtime/web/assets/home-BN45-W_R.js +1 -0
  46. package/runtime/web/assets/index-Dh_88m70.js +10 -0
  47. package/runtime/web/assets/index-FAyK3-UK.css +2 -0
  48. package/runtime/web/assets/input-DZ9QHu2b.js +1 -0
  49. package/runtime/web/assets/integrations-BSVo3EhL.js +1 -0
  50. package/runtime/web/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2 +0 -0
  51. package/runtime/web/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2 +0 -0
  52. package/runtime/web/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2 +0 -0
  53. package/runtime/web/assets/inter-greek-wght-normal-CkhJZR-_.woff2 +0 -0
  54. package/runtime/web/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
  55. package/runtime/web/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
  56. package/runtime/web/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2 +0 -0
  57. package/runtime/web/assets/invite._invitationId-BFlHHn20.js +1 -0
  58. package/runtime/web/assets/jsx-runtime-DG_AJzB_.js +1 -0
  59. package/runtime/web/assets/label-CWOhoN_L.js +1 -0
  60. package/runtime/web/assets/link-Cgvqhh5w.js +1 -0
  61. package/runtime/web/assets/matchContext-CDajBC0L.js +1 -0
  62. package/runtime/web/assets/organization-permissions-BQQ5PJbI.js +1 -0
  63. package/runtime/web/assets/organization-query-keys-uOvv8Ob1.js +1 -0
  64. package/runtime/web/assets/query-timing-LGzitMXx.js +1 -0
  65. package/runtime/web/assets/queryOptions-BHw87wTZ.js +1 -0
  66. package/runtime/web/assets/removable-BfDesq3B.js +1 -0
  67. package/runtime/web/assets/routes-6XMkyZd6.js +1 -0
  68. package/runtime/web/assets/schemas-BdEYnr23.js +39 -0
  69. package/runtime/web/assets/select-CxmfKkmB.js +1 -0
  70. package/runtime/web/assets/separator-BQc-hryc.js +1 -0
  71. package/runtime/web/assets/settings-5_Ep5M2N.js +1 -0
  72. package/runtime/web/assets/signin-BtRJc1yx.js +1 -0
  73. package/runtime/web/assets/src-DCIPwIx0.js +1 -0
  74. package/runtime/web/assets/table-DCvfJyLS.js +1 -0
  75. package/runtime/web/assets/team-DrtYsBm8.js +1 -0
  76. package/runtime/web/assets/textarea-DiU04l_U.js +1 -0
  77. package/runtime/web/assets/theme-toggle-b9r_T-hF.js +1 -0
  78. package/runtime/web/assets/use-optimistic-mutation-BlewMk5s.js +1 -0
  79. package/runtime/web/assets/useBaseQuery-BATLGzdG.js +1 -0
  80. package/runtime/web/assets/useBaseUiId-BLFGpnYJ.js +1 -0
  81. package/runtime/web/assets/useCompositeItem-DkdkBgiU.js +1 -0
  82. package/runtime/web/assets/useControlled-C1S7R-1A.js +1 -0
  83. package/runtime/web/assets/useQuery-FSZF3_9j.js +1 -0
  84. package/runtime/web/assets/useRender-DFMo54_d.js +1 -0
  85. package/runtime/web/assets/useRouterState-DpT8luFk.js +1 -0
  86. package/runtime/web/assets/useSuspenseQuery-BGsqElb3.js +1 -0
  87. package/runtime/web/assets/useValueChanged-CqxkrqWn.js +1 -0
  88. package/runtime/web/assets/utils-C8DGLIgm.js +1 -0
  89. package/runtime/web/assets/xstate-react.esm-BlF76DuP.js +1 -0
  90. package/runtime/web/assets/zod-D2loGbpH.js +1 -0
  91. package/runtime/web/images/amplitude/step1_settings_sidebar.png +0 -0
  92. package/runtime/web/images/amplitude/step2_projects.png +0 -0
  93. package/runtime/web/images/amplitude/step3_project_keys.png +0 -0
  94. package/runtime/web/images/amplitude/step4_api_keys.png +0 -0
  95. package/runtime/web/images/bigquery/step1_service_accounts.png +0 -0
  96. package/runtime/web/images/bigquery/step2_bigquery_roles.png +0 -0
  97. package/runtime/web/images/bigquery/step3_add_key_menu.png +0 -0
  98. package/runtime/web/images/bigquery/step4_create_json_key.png +0 -0
  99. package/runtime/web/images/ga4/step1_service_accounts.png +0 -0
  100. package/runtime/web/images/ga4/step2_create_json_key.png +0 -0
  101. package/runtime/web/images/ga4/step3_add_user_viewer.png +0 -0
  102. package/runtime/web/images/ga4/step4_property_details.png +0 -0
  103. package/runtime/web/images/github-token-guide/step1_signin.png +0 -0
  104. package/runtime/web/images/github-token-guide/step2_new_fine_grained_token_sanitized.png +0 -0
  105. package/runtime/web/images/github-token-guide/step3_permissions_configured_sanitized.png +0 -0
  106. package/runtime/web/images/github-token-guide/step4_token_created_sanitized.png +0 -0
  107. package/runtime/web/images/mixpanel/step1_service_accounts.png +0 -0
  108. package/runtime/web/images/mixpanel/step2_create_service_account.png +0 -0
  109. package/runtime/web/images/mixpanel/step3_credentials.png +0 -0
  110. package/runtime/web/images/mixpanel/step4_project_settings.png +0 -0
  111. package/runtime/web/images/postgresql/step1_create_user.png +0 -0
  112. package/runtime/web/images/postgresql/step2_connection.png +0 -0
  113. package/runtime/web/images/rds/step1_connect.png +0 -0
  114. package/runtime/web/images/rds/step2_create_user.png +0 -0
  115. package/runtime/web/images/rds/step3_grant.png +0 -0
  116. package/runtime/web/images/rds/step4_info.png +0 -0
  117. package/runtime/web/images/sentry/step1_personal_tokens.png +0 -0
  118. package/runtime/web/images/sentry/step2_create_token_permissions.png +0 -0
  119. package/runtime/web/images/sentry/step3_organization_slug.png +0 -0
  120. package/runtime/web/images/sentry/step4_project_slug.png +0 -0
  121. package/runtime/web/index.html +47 -0
  122. package/runtime/web/linear.svg +1 -0
  123. package/runtime/web/onequery.svg +14 -0
  124. package/vendor/x86_64-unknown-linux-musl/onequery/onequery +0 -0
  125. package/vendor/x86_64-unknown-linux-musl/server/onequery-server +0 -0
@@ -0,0 +1,156 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { spawn } from "node:child_process";
4
+ import { chmodSync, existsSync, statSync } from "node:fs";
5
+ import { createRequire } from "node:module";
6
+ import path from "node:path";
7
+ import { fileURLToPath } from "node:url";
8
+
9
+ import {
10
+ CLI_BINARY_NAME,
11
+ CLI_PACKAGE_NAME,
12
+ CLI_SERVER_BINARY_NAME,
13
+ PLATFORM_PACKAGE_BY_TARGET,
14
+ resolveTargetTriple,
15
+ } from "./package-constants.js";
16
+
17
+ const __filename = fileURLToPath(import.meta.url);
18
+ const __dirname = path.dirname(__filename);
19
+ const require = createRequire(import.meta.url);
20
+
21
+ const { platform, arch } = process;
22
+ const targetTriple = resolveTargetTriple(platform, arch);
23
+
24
+ const platformPackage = PLATFORM_PACKAGE_BY_TARGET[targetTriple];
25
+ if (!platformPackage) {
26
+ throw new Error(`Unsupported target triple: ${targetTriple}`);
27
+ }
28
+
29
+ // CONTEXT: platform packages are installed through npm alias names so the
30
+ // launcher resolves the alias folder, not the underlying published package id.
31
+ const localVendorRoot = path.join(__dirname, "..", "vendor");
32
+ const localBinaryPath = path.join(
33
+ localVendorRoot,
34
+ targetTriple,
35
+ "onequery",
36
+ CLI_BINARY_NAME
37
+ );
38
+ const packageRoot = path.resolve(__dirname, "..");
39
+
40
+ let vendorRoot;
41
+ try {
42
+ const packageJsonPath = require.resolve(`${platformPackage}/package.json`);
43
+ vendorRoot = path.join(path.dirname(packageJsonPath), "vendor");
44
+ } catch {
45
+ if (existsSync(localBinaryPath)) {
46
+ vendorRoot = localVendorRoot;
47
+ } else {
48
+ const packageManager = detectPackageManager();
49
+ const reinstallCommand =
50
+ packageManager === "bun"
51
+ ? `bun install -g ${CLI_PACKAGE_NAME}@latest`
52
+ : `npm install -g ${CLI_PACKAGE_NAME}@latest`;
53
+ throw new Error(
54
+ `Missing optional dependency ${platformPackage}. Reinstall OneQuery CLI: ${reinstallCommand}`
55
+ );
56
+ }
57
+ }
58
+
59
+ const binaryPath = path.join(
60
+ vendorRoot,
61
+ targetTriple,
62
+ "onequery",
63
+ CLI_BINARY_NAME
64
+ );
65
+ const serverBinaryPath = path.join(
66
+ vendorRoot,
67
+ targetTriple,
68
+ "server",
69
+ CLI_SERVER_BINARY_NAME
70
+ );
71
+
72
+ ensureExecutable(binaryPath);
73
+ if (existsSync(serverBinaryPath)) {
74
+ ensureExecutable(serverBinaryPath);
75
+ }
76
+
77
+ const child = spawn(binaryPath, process.argv.slice(2), {
78
+ env: {
79
+ ...process.env,
80
+ ONEQUERY_NPM_ROOT: process.env.ONEQUERY_NPM_ROOT ?? packageRoot,
81
+ ONEQUERY_RUNTIME_ROOT: process.env.ONEQUERY_RUNTIME_ROOT ?? packageRoot,
82
+ ONEQUERY_SERVER_EXECUTABLE:
83
+ process.env.ONEQUERY_SERVER_EXECUTABLE ?? serverBinaryPath,
84
+ },
85
+ stdio: "inherit",
86
+ });
87
+
88
+ child.on("error", (error) => {
89
+ console.error(error);
90
+ process.exit(1);
91
+ });
92
+
93
+ const forwardSignal = (signal) => {
94
+ if (child.killed) {
95
+ return;
96
+ }
97
+
98
+ try {
99
+ child.kill(signal);
100
+ } catch {
101
+ // Ignore forwarding failures if the child already exited.
102
+ }
103
+ };
104
+
105
+ ["SIGINT", "SIGTERM", "SIGHUP"].forEach((signal) => {
106
+ process.on(signal, () => forwardSignal(signal));
107
+ });
108
+
109
+ const childResult = await new Promise((resolve) => {
110
+ child.on("exit", (code, signal) => {
111
+ if (signal) {
112
+ resolve({ signal, type: "signal" });
113
+ return;
114
+ }
115
+
116
+ resolve({ exitCode: code ?? 1, type: "code" });
117
+ });
118
+ });
119
+
120
+ if (childResult.type === "signal") {
121
+ process.kill(process.pid, childResult.signal);
122
+ } else {
123
+ process.exit(childResult.exitCode);
124
+ }
125
+
126
+ function detectPackageManager() {
127
+ const userAgent = process.env.npm_config_user_agent ?? "";
128
+ if (/\bbun\//.test(userAgent)) {
129
+ return "bun";
130
+ }
131
+
132
+ const execPath = process.env.npm_execpath ?? "";
133
+ if (execPath.includes("bun")) {
134
+ return "bun";
135
+ }
136
+
137
+ if (
138
+ __dirname.includes(".bun/install/global") ||
139
+ __dirname.includes(".bun\\install\\global")
140
+ ) {
141
+ return "bun";
142
+ }
143
+
144
+ return userAgent ? "npm" : null;
145
+ }
146
+
147
+ function ensureExecutable(filePath) {
148
+ const currentMode = statSync(filePath).mode & 0o777;
149
+ if ((currentMode & 0o111) !== 0) {
150
+ return;
151
+ }
152
+
153
+ // CONTEXT: npm tarballs store vendored native binaries without execute bits,
154
+ // so restore the expected mode before spawning the packaged CLI binary.
155
+ chmodSync(filePath, currentMode | 0o755);
156
+ }
@@ -0,0 +1,95 @@
1
+ export const CLI_PACKAGE_NAME = "@onequery/cli";
2
+ export const CLI_BINARY_NAME = "onequery";
3
+ export const CLI_SERVER_BINARY_NAME = "onequery-server";
4
+ export const CLI_NPM_TARBALL_PREFIX = "onequery-npm";
5
+ export const CLI_NPM_STAGE_DIR_PREFIX = `${CLI_NPM_TARBALL_PREFIX}-stage-`;
6
+ export const CLI_NPM_PACK_DIR_PREFIX = `${CLI_NPM_TARBALL_PREFIX}-pack-`;
7
+ export const CLI_STAGE_PACKAGE_DIR_PREFIX = "onequery-cli-";
8
+
9
+ export const PLATFORM_PACKAGES = {
10
+ "cli-darwin-arm64": {
11
+ optionalDependencyName: "onequery-darwin-arm64",
12
+ npmTag: "darwin-arm64",
13
+ targetTriple: "aarch64-apple-darwin",
14
+ os: "darwin",
15
+ cpu: "arm64",
16
+ },
17
+ "cli-darwin-x64": {
18
+ optionalDependencyName: "onequery-darwin-x64",
19
+ npmTag: "darwin-x64",
20
+ targetTriple: "x86_64-apple-darwin",
21
+ os: "darwin",
22
+ cpu: "x64",
23
+ },
24
+ "cli-linux-arm64": {
25
+ optionalDependencyName: "onequery-linux-arm64",
26
+ npmTag: "linux-arm64",
27
+ targetTriple: "aarch64-unknown-linux-musl",
28
+ os: "linux",
29
+ cpu: "arm64",
30
+ },
31
+ "cli-linux-x64": {
32
+ optionalDependencyName: "onequery-linux-x64",
33
+ npmTag: "linux-x64",
34
+ targetTriple: "x86_64-unknown-linux-musl",
35
+ os: "linux",
36
+ cpu: "x64",
37
+ },
38
+ };
39
+
40
+ export const PLATFORM_PACKAGE_BY_TARGET = Object.fromEntries(
41
+ Object.values(PLATFORM_PACKAGES).map((platformPackage) => [
42
+ platformPackage.targetTriple,
43
+ platformPackage.optionalDependencyName,
44
+ ])
45
+ );
46
+
47
+ export const SERVER_COMPILE_TARGET_BY_RUST_TARGET = {
48
+ "aarch64-apple-darwin": "bun-darwin-arm64",
49
+ "aarch64-unknown-linux-musl": "bun-linux-arm64-musl",
50
+ "x86_64-apple-darwin": "bun-darwin-x64",
51
+ "x86_64-unknown-linux-musl": "bun-linux-x64-musl",
52
+ };
53
+
54
+ export function packageStagingDirPrefix(packageName) {
55
+ return `${CLI_STAGE_PACKAGE_DIR_PREFIX}${packageName}-`;
56
+ }
57
+
58
+ export function resolveTargetTriple(platform, arch) {
59
+ switch (platform) {
60
+ case "linux":
61
+ case "android": {
62
+ switch (arch) {
63
+ case "x64":
64
+ return "x86_64-unknown-linux-musl";
65
+ case "arm64":
66
+ return "aarch64-unknown-linux-musl";
67
+ default:
68
+ break;
69
+ }
70
+ break;
71
+ }
72
+ case "darwin": {
73
+ switch (arch) {
74
+ case "x64":
75
+ return "x86_64-apple-darwin";
76
+ case "arm64":
77
+ return "aarch64-apple-darwin";
78
+ default:
79
+ break;
80
+ }
81
+ break;
82
+ }
83
+ default: {
84
+ break;
85
+ }
86
+ }
87
+
88
+ if (platform === "win32") {
89
+ throw new Error(
90
+ "Unsupported platform: win32. The published OneQuery package currently supports macOS and Linux only."
91
+ );
92
+ }
93
+
94
+ throw new Error(`Unsupported platform: ${platform} (${arch})`);
95
+ }
package/package.json CHANGED
@@ -1,27 +1,32 @@
1
1
  {
2
- "cpu": [
3
- "x64"
4
- ],
2
+ "name": "@onequery/cli",
3
+ "version": "0.1.2",
5
4
  "description": "OneQuery CLI",
6
- "files": [
7
- "vendor",
8
- "README.md"
9
- ],
10
5
  "license": "Apache-2.0",
11
- "name": "@onequery/cli",
12
- "os": [
13
- "linux"
14
- ],
15
- "publishConfig": {
16
- "access": "public"
17
- },
18
6
  "repository": {
19
7
  "type": "git",
20
8
  "url": "git+https://github.com/wordbricks/onequery.git",
21
9
  "directory": "apps/cli"
22
10
  },
23
- "version": "0.1.2-linux-x64",
11
+ "bin": {
12
+ "onequery": "bin/onequery.js"
13
+ },
14
+ "files": [
15
+ "bin",
16
+ "runtime",
17
+ "README.md"
18
+ ],
19
+ "type": "module",
20
+ "publishConfig": {
21
+ "access": "public"
22
+ },
24
23
  "engines": {
25
24
  "node": ">=18"
25
+ },
26
+ "optionalDependencies": {
27
+ "onequery-darwin-arm64": "npm:@onequery/cli@0.1.2-darwin-arm64",
28
+ "onequery-darwin-x64": "npm:@onequery/cli@0.1.2-darwin-x64",
29
+ "onequery-linux-arm64": "npm:@onequery/cli@0.1.2-linux-arm64",
30
+ "onequery-linux-x64": "npm:@onequery/cli@0.1.2-linux-x64"
26
31
  }
27
32
  }