@thatopen/services 0.3.16 → 0.5.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 +62 -62
- package/dist/cli/commands/rhino.d.ts +11 -0
- package/dist/cli/lib/plugin-install.d.ts +24 -0
- package/dist/cli.js +124 -1
- package/dist/core/client.d.ts +1 -0
- package/dist/core/platform-client.d.ts +7 -0
- package/dist/index.cjs.js +2 -2
- package/dist/index.es.js +382 -370
- package/dist/vite-env.d.ts +1 -1
- package/docs/ai-quickstart.md +130 -130
- package/docs/cli/create.md +29 -29
- package/docs/cli/local-server.md +38 -38
- package/docs/cli/login.md +32 -32
- package/docs/cli/publish.md +31 -31
- package/docs/cli/run.md +26 -26
- package/docs/cli/serve.md +43 -43
- package/docs/cli/swap.md +30 -30
- package/docs/cloud/GaussianSplatConverter.md +43 -43
- package/docs/cloud/PointCloudConverter.md +53 -53
- package/docs/revit-collab-quickstart.md +256 -256
- package/package.json +95 -95
- package/resources/AGENTS.md +40 -40
- package/src/built-in/CDEManager/example.ts +214 -214
- package/src/built-in/CDEManager/examples/FileEditing/example.ts +226 -226
- package/src/built-in/CDEManager/examples/FileMoves/example.ts +186 -186
- package/src/built-in/CDEManager/examples/FileOperations/example.ts +295 -295
- package/src/built-in/CDEManager/examples/FileTransfers/example.ts +210 -210
- package/src/built-in/CDEManager/examples/FolderManagement/example.ts +230 -230
- package/src/built-in/CDEManager/examples/MetadataSchema/example.ts +230 -230
- package/src/built-in/CDEManager/examples/MetadataViews/example.ts +166 -166
- package/src/built-in/CDEManager/examples/ProjectConfig/example.ts +177 -177
- package/src/built-in/ClashesManager/example.ts +283 -283
- package/src/built-in/UIManager/src/app/example.ts +97 -97
- package/src/built-in/UIManager/src/app/examples/AppState/example.ts +140 -140
- package/src/built-in/UIManager/src/app/examples/Banner/example.ts +159 -159
- package/src/built-in/UIManager/src/app/examples/Contexts/example.ts +123 -123
- package/src/built-in/UIManager/src/app/examples/FileDrop/example.ts +124 -124
- package/src/built-in/UIManager/src/app/examples/FloatingLayout/example.ts +90 -90
- package/src/built-in/UIManager/src/app/examples/Modal/example.ts +163 -163
- package/src/built-in/UIManager/src/app/examples/Notifications/example.ts +133 -133
- package/src/built-in/UIManager/src/app/examples/Sidebar/example.ts +102 -102
- package/src/cli/templates/app/README.md +217 -217
- package/src/cli/templates/app/index.html +35 -35
- package/src/cli/templates/app/package.json +32 -32
- package/src/cli/templates/app/src/app.ts +37 -37
- package/src/cli/templates/app/src/assets/tool-placeholder.ts +50 -50
- package/src/cli/templates/app/src/bim-components/CloudRunner/index.ts +95 -95
- package/src/cli/templates/app/src/bim-components/CloudRunner/src/index.ts +1 -1
- package/src/cli/templates/app/src/bim-components/CloudRunner/src/types.ts +5 -5
- package/src/cli/templates/app/src/bim-components/index.ts +1 -1
- package/src/cli/templates/app/src/globals.ts +1 -1
- package/src/cli/templates/app/src/main.ts +199 -199
- package/src/cli/templates/app/src/setups/reality-capture/lib/hidden-tiles-plugin.ts +88 -88
- package/src/cli/templates/app/src/setups/reality-capture/lib/point-tile-plugin.ts +166 -166
- package/src/cli/templates/app/src/setups/reality-capture/lib/render-frame.ts +31 -31
- package/src/cli/templates/app/src/setups/reality-capture/lib/splat-tile-plugin.ts +51 -51
- package/src/cli/templates/app/src/setups/reality-capture-viewer.ts +1383 -1383
- package/src/cli/templates/app/src/ui-components/app-info-section/index.ts +26 -26
- package/src/cli/templates/app/src/ui-components/app-info-section/src/index.ts +1 -1
- package/src/cli/templates/app/src/ui-components/app-info-section/src/types.ts +15 -15
- package/src/cli/templates/app/src/ui-components/cloud-runner-section/index.ts +37 -37
- package/src/cli/templates/app/src/ui-components/cloud-runner-section/src/index.ts +1 -1
- package/src/cli/templates/app/src/ui-components/cloud-runner-section/src/types.ts +14 -14
- package/src/cli/templates/app/src/ui-components/index.ts +2 -2
- package/src/cli/templates/app/tsconfig.json +16 -16
- package/src/cli/templates/app/vite.config.js +57 -57
- package/src/cli/templates/cloud-component/README.md +205 -205
- package/src/cli/templates/cloud-component/_thatopen +5 -5
- package/src/cli/templates/cloud-component/declarations.json +4 -4
- package/src/cli/templates/cloud-component/package.json +21 -21
- package/src/cli/templates/cloud-component/src/main.ts +70 -70
- package/src/cli/templates/cloud-component/tsconfig.json +16 -16
- package/src/cli/templates/cloud-component/vite.config.js +46 -46
- package/src/cli/templates/shared/AGENTS.md +8 -8
- package/src/cli/templates/shared/CLAUDE.md +1 -1
- package/src/cli/templates/shared/_gitignore +5 -5
package/README.md
CHANGED
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
# @thatopen/services
|
|
2
|
-
|
|
3
|
-
Client library and CLI for building BIM apps and cloud components on [That Open Platform](https://platform.thatopen.com). Apps run inside the platform's browser environment; cloud components run server-side and can be triggered from any app.
|
|
4
|
-
|
|
5
|
-
> **Using an AI assistant?** Point it at this single file and it can take you from nothing to a running app:
|
|
6
|
-
> → [`docs/ai-quickstart.md`](https://raw.githubusercontent.com/ThatOpen/engine_services/main/docs/ai-quickstart.md)
|
|
7
|
-
|
|
8
|
-
## Quick Start
|
|
9
|
-
|
|
10
|
-
### 1. Install the CLI
|
|
11
|
-
|
|
12
|
-
```bash
|
|
13
|
-
npm install -g @thatopen/services@latest
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
### 2. Choose a project type
|
|
17
|
-
|
|
18
|
-
| Type | Template | Use when |
|
|
19
|
-
|------|----------|----------|
|
|
20
|
-
| **App** | `app` | You're building a BIM app that runs in the platform's browser UI |
|
|
21
|
-
| **Cloud component** | `cloud-component` | You're building server-side logic triggered by an app |
|
|
22
|
-
|
|
23
|
-
### 3. Scaffold
|
|
24
|
-
|
|
25
|
-
See the full command reference here:
|
|
26
|
-
→ [`docs/cli/create.md`](https://raw.githubusercontent.com/ThatOpen/engine_services/main/docs/cli/create.md)
|
|
27
|
-
|
|
28
|
-
To use beta engine libraries instead of the stable ones, see:
|
|
29
|
-
→ [`docs/cli/swap.md`](https://raw.githubusercontent.com/ThatOpen/engine_services/main/docs/cli/swap.md)
|
|
30
|
-
|
|
31
|
-
### 4. Next steps
|
|
32
|
-
|
|
33
|
-
Once scaffolded, open `AGENTS.md` in the scaffolded project root — it has everything needed to start building.
|
|
34
|
-
|
|
35
|
-
## Beta engine libraries (Founding Members)
|
|
36
|
-
|
|
37
|
-
Founding Members get early access to the private beta engine libraries (`@thatopen-platform/*-beta`). The CLI configures access automatically — no npm account or manual token needed.
|
|
38
|
-
|
|
39
|
-
```bash
|
|
40
|
-
thatopen login --token <your-token> # API token from the dashboard → Data → API Tokens
|
|
41
|
-
thatopen create my-app --beta # new project on the beta libraries
|
|
42
|
-
# or, in an existing project:
|
|
43
|
-
thatopen swap --beta # toggle the current project to beta
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
On `--beta`, the CLI fetches your read-only beta npm credentials and writes them to the project's `.npmrc`, so `npm install` resolves the private packages. The `.npmrc` is gitignored — it carries a credential, so don't commit or share it. Access is tied to your membership; non-Founding accounts get a clear message and the project is still created.
|
|
47
|
-
|
|
48
|
-
## What's in this repository
|
|
49
|
-
|
|
50
|
-
- **Library** — `EngineServicesClient` and `PlatformClient` for interacting with the That Open API (files, folders, apps, cloud components, executions, permissions).
|
|
51
|
-
- **CLI** — `thatopen` command for scaffolding and publishing.
|
|
52
|
-
- **Built-in component types** — TypeScript stubs for platform-hosted components.
|
|
53
|
-
|
|
54
|
-
## Docs
|
|
55
|
-
|
|
56
|
-
Full reference for all CLI commands and flags:
|
|
57
|
-
→ [`docs/cli/paths.json`](https://raw.githubusercontent.com/ThatOpen/engine_services/main/docs/cli/paths.json)
|
|
58
|
-
|
|
59
|
-
## Contributing
|
|
60
|
-
|
|
61
|
-
See [CONTRIBUTING.md](./CONTRIBUTING.md) for setup, build commands, and publishing workflow.
|
|
62
|
-
|
|
1
|
+
# @thatopen/services
|
|
2
|
+
|
|
3
|
+
Client library and CLI for building BIM apps and cloud components on [That Open Platform](https://platform.thatopen.com). Apps run inside the platform's browser environment; cloud components run server-side and can be triggered from any app.
|
|
4
|
+
|
|
5
|
+
> **Using an AI assistant?** Point it at this single file and it can take you from nothing to a running app:
|
|
6
|
+
> → [`docs/ai-quickstart.md`](https://raw.githubusercontent.com/ThatOpen/engine_services/main/docs/ai-quickstart.md)
|
|
7
|
+
|
|
8
|
+
## Quick Start
|
|
9
|
+
|
|
10
|
+
### 1. Install the CLI
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm install -g @thatopen/services@latest
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
### 2. Choose a project type
|
|
17
|
+
|
|
18
|
+
| Type | Template | Use when |
|
|
19
|
+
|------|----------|----------|
|
|
20
|
+
| **App** | `app` | You're building a BIM app that runs in the platform's browser UI |
|
|
21
|
+
| **Cloud component** | `cloud-component` | You're building server-side logic triggered by an app |
|
|
22
|
+
|
|
23
|
+
### 3. Scaffold
|
|
24
|
+
|
|
25
|
+
See the full command reference here:
|
|
26
|
+
→ [`docs/cli/create.md`](https://raw.githubusercontent.com/ThatOpen/engine_services/main/docs/cli/create.md)
|
|
27
|
+
|
|
28
|
+
To use beta engine libraries instead of the stable ones, see:
|
|
29
|
+
→ [`docs/cli/swap.md`](https://raw.githubusercontent.com/ThatOpen/engine_services/main/docs/cli/swap.md)
|
|
30
|
+
|
|
31
|
+
### 4. Next steps
|
|
32
|
+
|
|
33
|
+
Once scaffolded, open `AGENTS.md` in the scaffolded project root — it has everything needed to start building.
|
|
34
|
+
|
|
35
|
+
## Beta engine libraries (Founding Members)
|
|
36
|
+
|
|
37
|
+
Founding Members get early access to the private beta engine libraries (`@thatopen-platform/*-beta`). The CLI configures access automatically — no npm account or manual token needed.
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
thatopen login --token <your-token> # API token from the dashboard → Data → API Tokens
|
|
41
|
+
thatopen create my-app --beta # new project on the beta libraries
|
|
42
|
+
# or, in an existing project:
|
|
43
|
+
thatopen swap --beta # toggle the current project to beta
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
On `--beta`, the CLI fetches your read-only beta npm credentials and writes them to the project's `.npmrc`, so `npm install` resolves the private packages. The `.npmrc` is gitignored — it carries a credential, so don't commit or share it. Access is tied to your membership; non-Founding accounts get a clear message and the project is still created.
|
|
47
|
+
|
|
48
|
+
## What's in this repository
|
|
49
|
+
|
|
50
|
+
- **Library** — `EngineServicesClient` and `PlatformClient` for interacting with the That Open API (files, folders, apps, cloud components, executions, permissions).
|
|
51
|
+
- **CLI** — `thatopen` command for scaffolding and publishing.
|
|
52
|
+
- **Built-in component types** — TypeScript stubs for platform-hosted components.
|
|
53
|
+
|
|
54
|
+
## Docs
|
|
55
|
+
|
|
56
|
+
Full reference for all CLI commands and flags:
|
|
57
|
+
→ [`docs/cli/paths.json`](https://raw.githubusercontent.com/ThatOpen/engine_services/main/docs/cli/paths.json)
|
|
58
|
+
|
|
59
|
+
## Contributing
|
|
60
|
+
|
|
61
|
+
See [CONTRIBUTING.md](./CONTRIBUTING.md) for setup, build commands, and publishing workflow.
|
|
62
|
+
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* `thatopen rhino ...` — installs the That Open Rhino plug-in.
|
|
5
|
+
*
|
|
6
|
+
* Deliberately much smaller than the Revit group. The Rhino plug-in's whole job in the
|
|
7
|
+
* interoperability layer is to PUBLISH what Rhino has; it applies nothing, so there is nothing to
|
|
8
|
+
* drive from here. Everything that turns a Rhino model into a change in somebody else's model lives
|
|
9
|
+
* in the platform, not in a plug-in.
|
|
10
|
+
*/
|
|
11
|
+
export declare const rhinoCommand: Command;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { EngineServicesClient } from '../../core/client';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Downloads a private plug-in package and hands back the folder it unpacked into.
|
|
5
|
+
*
|
|
6
|
+
* npm does the work on purpose. It resolves what "latest" means, it authenticates against the
|
|
7
|
+
* restricted scope, and it verifies the tarball's integrity — three things this would otherwise
|
|
8
|
+
* hand-roll over HTTP and get subtly wrong. The only thing we add is the platform token, which
|
|
9
|
+
* `setupNpmrc` trades for registry credentials exactly as the `--beta` flows do. No npm account is
|
|
10
|
+
* involved and no npm token is ever asked for.
|
|
11
|
+
*/
|
|
12
|
+
export declare function fetchPluginPackage(client: EngineServicesClient, pkg: string, version?: string): Promise<{
|
|
13
|
+
dir: string;
|
|
14
|
+
cleanup: () => void;
|
|
15
|
+
}>;
|
|
16
|
+
/**
|
|
17
|
+
* Refuses to install while the host application is running.
|
|
18
|
+
*
|
|
19
|
+
* This is not caution, it is the difference between a failed install and a broken one. Both Revit
|
|
20
|
+
* and Rhino hold their plug-in assemblies open for the whole session, so a copy over a running host
|
|
21
|
+
* fails on the first locked file — AFTER copying the ones it reached. The result is a folder holding
|
|
22
|
+
* some new DLLs and some old, which loads, misbehaves, and looks like a bug in the product.
|
|
23
|
+
*/
|
|
24
|
+
export declare function assertHostClosed(processName: string, friendly: string): void;
|
package/dist/cli.js
CHANGED
|
@@ -6957,7 +6957,7 @@ class EngineServicesClient {
|
|
|
6957
6957
|
return this.accessToken;
|
|
6958
6958
|
}
|
|
6959
6959
|
async #requestApi(method, path2, requestData) {
|
|
6960
|
-
const { body, query, contentType, retries } = requestData || {};
|
|
6960
|
+
const { body, query, contentType, retries, responseType } = requestData || {};
|
|
6961
6961
|
const url2 = this.#buildUrl(path2);
|
|
6962
6962
|
const cleanQuery = this.#cleanData(query);
|
|
6963
6963
|
const token = await this.resolveAccessToken();
|
|
@@ -6986,6 +6986,9 @@ class EngineServicesClient {
|
|
|
6986
6986
|
textResponse
|
|
6987
6987
|
);
|
|
6988
6988
|
}
|
|
6989
|
+
if (responseType === "blob") {
|
|
6990
|
+
return await response.blob();
|
|
6991
|
+
}
|
|
6989
6992
|
return response.json().then((data) => data).catch(() => void 0);
|
|
6990
6993
|
} catch (e) {
|
|
6991
6994
|
let retriesAmmount = retries != null ? retries : this.retries;
|
|
@@ -11683,6 +11686,60 @@ const swapCommand = new Command2("swap").description("Toggle between stable publ
|
|
|
11683
11686
|
console.error("Failed to install dependencies. Run `npm install` manually.");
|
|
11684
11687
|
}
|
|
11685
11688
|
});
|
|
11689
|
+
async function fetchPluginPackage(client, pkg2, version = "latest") {
|
|
11690
|
+
const work = require$$3.mkdtempSync(require$$2.join(node_os.tmpdir(), "thatopen-plugin-"));
|
|
11691
|
+
const cleanup = () => {
|
|
11692
|
+
try {
|
|
11693
|
+
require$$3.rmSync(work, { recursive: true, force: true });
|
|
11694
|
+
} catch {
|
|
11695
|
+
}
|
|
11696
|
+
};
|
|
11697
|
+
try {
|
|
11698
|
+
const creds = await setupNpmrc(client, work);
|
|
11699
|
+
if (creds.status === "forbidden") {
|
|
11700
|
+
throw new Error(
|
|
11701
|
+
"Your account does not have access to the private plug-in packages. They need Founding access, the same as the beta engine libraries."
|
|
11702
|
+
);
|
|
11703
|
+
}
|
|
11704
|
+
if (creds.status === "error") {
|
|
11705
|
+
throw new Error(`Could not get registry credentials: ${creds.message}`);
|
|
11706
|
+
}
|
|
11707
|
+
require$$1.execFileSync("npm", ["pack", `${pkg2}@${version}`, "--silent"], {
|
|
11708
|
+
cwd: work,
|
|
11709
|
+
stdio: ["ignore", "ignore", "inherit"],
|
|
11710
|
+
shell: process.platform === "win32"
|
|
11711
|
+
});
|
|
11712
|
+
const tgz = require$$3.readdirSync(work).find((f) => f.endsWith(".tgz"));
|
|
11713
|
+
if (!tgz) throw new Error(`npm pack produced no tarball for ${pkg2}@${version}.`);
|
|
11714
|
+
require$$1.execFileSync("tar", ["-xzf", tgz], { cwd: work, stdio: "inherit" });
|
|
11715
|
+
const dir = require$$2.join(work, "package");
|
|
11716
|
+
if (!require$$3.existsSync(dir)) throw new Error(`${tgz} did not unpack into a package/ folder.`);
|
|
11717
|
+
return { dir, cleanup };
|
|
11718
|
+
} catch (err) {
|
|
11719
|
+
cleanup();
|
|
11720
|
+
throw err;
|
|
11721
|
+
}
|
|
11722
|
+
}
|
|
11723
|
+
function assertHostClosed(processName, friendly) {
|
|
11724
|
+
let running = false;
|
|
11725
|
+
try {
|
|
11726
|
+
const out = require$$1.execFileSync(
|
|
11727
|
+
"powershell",
|
|
11728
|
+
["-NoProfile", "-Command", `if (Get-Process -Name ${processName} -ErrorAction SilentlyContinue) { 'yes' }`],
|
|
11729
|
+
{ encoding: "utf-8" }
|
|
11730
|
+
);
|
|
11731
|
+
running = out.trim() === "yes";
|
|
11732
|
+
} catch {
|
|
11733
|
+
return;
|
|
11734
|
+
}
|
|
11735
|
+
if (running) {
|
|
11736
|
+
throw new Error(
|
|
11737
|
+
`${friendly} is running. Close it and run this again.
|
|
11738
|
+
|
|
11739
|
+
Its plug-in files are locked while it is open, so installing now would replace some of them and not others.`
|
|
11740
|
+
);
|
|
11741
|
+
}
|
|
11742
|
+
}
|
|
11686
11743
|
function discoveryFile() {
|
|
11687
11744
|
const appData = process.env.APPDATA || require$$2.join(node_os.homedir(), "AppData", "Roaming");
|
|
11688
11745
|
return require$$2.join(appData, "ThatOpen", "revit-addin.json");
|
|
@@ -11743,6 +11800,7 @@ async function configureAddin(apiUrl, accessToken) {
|
|
|
11743
11800
|
key: accessToken
|
|
11744
11801
|
});
|
|
11745
11802
|
}
|
|
11803
|
+
const REVIT_ADDIN_PACKAGE = "@thatopen-platform/flow-revit";
|
|
11746
11804
|
const revitCommand = new Command2("revit").description(
|
|
11747
11805
|
"Revit collaboration — drive the That Open Revit add-in from the CLI"
|
|
11748
11806
|
);
|
|
@@ -11826,6 +11884,70 @@ revitCommand.command("untake").description("Release a workset you own so teammat
|
|
|
11826
11884
|
const r = await callAddin("untake", { workset: opts.workset });
|
|
11827
11885
|
console.log(`Released workset "${r.released}".`);
|
|
11828
11886
|
});
|
|
11887
|
+
revitCommand.command("install").alias("update").description("Install or update the That Open Revit add-in (Revit must be closed)").option("--version <version>", "A specific version instead of the latest", "latest").action(async (opts) => {
|
|
11888
|
+
const cfg = requireResolvedConfig();
|
|
11889
|
+
assertHostClosed("Revit", "Revit");
|
|
11890
|
+
const client = new EngineServicesClient(cfg.accessToken, cfg.apiUrl);
|
|
11891
|
+
console.log(`Fetching ${REVIT_ADDIN_PACKAGE}@${opts.version}...`);
|
|
11892
|
+
const { dir, cleanup } = await fetchPluginPackage(
|
|
11893
|
+
client,
|
|
11894
|
+
REVIT_ADDIN_PACKAGE,
|
|
11895
|
+
opts.version
|
|
11896
|
+
);
|
|
11897
|
+
try {
|
|
11898
|
+
const installer = require$$2.join(dir, "install.ps1");
|
|
11899
|
+
if (!require$$3.existsSync(installer)) {
|
|
11900
|
+
throw new Error(`The package has no install.ps1. Got: ${require$$3.readdirSync(dir).join(", ")}`);
|
|
11901
|
+
}
|
|
11902
|
+
require$$1.execFileSync("powershell", ["-ExecutionPolicy", "Bypass", "-File", installer], {
|
|
11903
|
+
stdio: "inherit"
|
|
11904
|
+
});
|
|
11905
|
+
console.log("\nStart Revit. The That Open tab will be there.");
|
|
11906
|
+
} finally {
|
|
11907
|
+
cleanup();
|
|
11908
|
+
}
|
|
11909
|
+
});
|
|
11910
|
+
const RHINO_PLUGIN_PACKAGE = "@thatopen-platform/flow-rhino";
|
|
11911
|
+
const rhinoCommand = new Command2("rhino").description(
|
|
11912
|
+
"Rhino interoperability — install the That Open Rhino plug-in"
|
|
11913
|
+
);
|
|
11914
|
+
rhinoCommand.command("install").alias("update").description("Install or update the That Open Rhino plug-in (Rhino must be closed)").option("--version <version>", "A specific version instead of the latest", "latest").action(async (opts) => {
|
|
11915
|
+
const cfg = requireResolvedConfig();
|
|
11916
|
+
assertHostClosed("Rhino", "Rhino");
|
|
11917
|
+
const yak = findYak();
|
|
11918
|
+
if (!yak) {
|
|
11919
|
+
throw new Error(
|
|
11920
|
+
"Could not find Yak.exe. It ships with Rhino, at C:\\Program Files\\Rhino 8\\System\\Yak.exe. Is Rhino 8 installed?"
|
|
11921
|
+
);
|
|
11922
|
+
}
|
|
11923
|
+
const client = new EngineServicesClient(cfg.accessToken, cfg.apiUrl);
|
|
11924
|
+
console.log(`Fetching ${RHINO_PLUGIN_PACKAGE}@${opts.version}...`);
|
|
11925
|
+
const { dir, cleanup } = await fetchPluginPackage(client, RHINO_PLUGIN_PACKAGE, opts.version);
|
|
11926
|
+
try {
|
|
11927
|
+
const pkgDir = require$$2.join(dir, "pkg");
|
|
11928
|
+
const yakFile = require$$3.existsSync(pkgDir) ? require$$3.readdirSync(pkgDir).find((f) => f.endsWith(".yak")) : void 0;
|
|
11929
|
+
if (!yakFile) {
|
|
11930
|
+
throw new Error(`The package has no .yak under pkg/. Got: ${require$$3.readdirSync(dir).join(", ")}`);
|
|
11931
|
+
}
|
|
11932
|
+
require$$1.execFileSync(yak, ["install", "--source", ".", "rhino-flow"], {
|
|
11933
|
+
cwd: pkgDir,
|
|
11934
|
+
stdio: "inherit"
|
|
11935
|
+
});
|
|
11936
|
+
console.log(`
|
|
11937
|
+
Installed ${yakFile}.`);
|
|
11938
|
+
console.log("Start Rhino. The plug-in loads at startup, so its local server comes up with it.");
|
|
11939
|
+
} finally {
|
|
11940
|
+
cleanup();
|
|
11941
|
+
}
|
|
11942
|
+
});
|
|
11943
|
+
function findYak() {
|
|
11944
|
+
const candidates = [
|
|
11945
|
+
"C:\\Program Files\\Rhino 8\\System\\Yak.exe",
|
|
11946
|
+
"C:\\Program Files\\Rhino 9\\System\\Yak.exe",
|
|
11947
|
+
"C:\\Program Files\\Rhino 8 WIP\\System\\Yak.exe"
|
|
11948
|
+
];
|
|
11949
|
+
return candidates.find((p) => require$$3.existsSync(p));
|
|
11950
|
+
}
|
|
11829
11951
|
const pkg = JSON.parse(
|
|
11830
11952
|
require$$3.readFileSync(require$$2.join(__dirname, "..", "package.json"), "utf-8")
|
|
11831
11953
|
);
|
|
@@ -11854,4 +11976,5 @@ program.addCommand(runCommand);
|
|
|
11854
11976
|
program.addCommand(localServerCommand);
|
|
11855
11977
|
program.addCommand(swapCommand);
|
|
11856
11978
|
program.addCommand(revitCommand);
|
|
11979
|
+
program.addCommand(rhinoCommand);
|
|
11857
11980
|
program.parse(process.argv);
|
package/dist/core/client.d.ts
CHANGED
|
@@ -219,6 +219,7 @@ export declare class EngineServicesClient {
|
|
|
219
219
|
query?: object;
|
|
220
220
|
contentType?: 'application/json' | 'multipart/form-data' | 'application/x-www-form-urlencoded';
|
|
221
221
|
retries?: number;
|
|
222
|
+
responseType?: 'json' | 'blob';
|
|
222
223
|
}): Promise<T>;
|
|
223
224
|
/**
|
|
224
225
|
* Lists all files accessible by the current token.
|
|
@@ -86,6 +86,13 @@ export declare class PlatformClient extends EngineServicesClient {
|
|
|
86
86
|
* User data is stripped of sensitive fields server-side.
|
|
87
87
|
*/
|
|
88
88
|
getProjectData(projectId: string): Promise<ProjectData>;
|
|
89
|
+
/**
|
|
90
|
+
* Fetches a user's profile picture as raw image bytes, for showing member
|
|
91
|
+
* avatars inside an app. The route is bearer-authed, so it can't be used as
|
|
92
|
+
* an `<img src>` — turn the blob into an object URL with
|
|
93
|
+
* `URL.createObjectURL(blob)`. Rejects when the account has no avatar.
|
|
94
|
+
*/
|
|
95
|
+
getAvatar(accountId: string): Promise<Blob>;
|
|
89
96
|
/**
|
|
90
97
|
* Checks whether the caller has a specific permission within a project.
|
|
91
98
|
* Returns `{ hasPermission, scope }` where `scope` is `'global'` for
|