@twinfinity/twin 6.0.2 → 6.1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twinfinity/twin",
3
- "version": "6.0.2",
3
+ "version": "6.1.0",
4
4
  "description": "Twinfinity Twin Service client",
5
5
  "source": "src/index.ts",
6
6
  "main": "dist/index.js",
@@ -39,8 +39,8 @@
39
39
  "docs"
40
40
  ],
41
41
  "peerDependencies": {
42
- "@twinfinity/authentication": "6.0.2",
43
- "@twinfinity/t8-client-model": "6.0.2-beta"
42
+ "@twinfinity/authentication": "6.1.0",
43
+ "@twinfinity/t8-client-model": "6.1.0-beta"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@vitest/coverage-v8": "^3.2.3",
package/src/TwinClient.ts CHANGED
@@ -94,6 +94,13 @@ import { Twin } from './types/Twin';
94
94
  import { TwinGeometryInfo } from './types/TwinGeometryInfo';
95
95
 
96
96
  export interface ITwinClient {
97
+ /**
98
+ * Rooted twins base URL — typically `<host>/sites/<container>/_ps/twins`.
99
+ * Use this when constructing related URLs (e.g. twin content) that need
100
+ * to live in the same auth scope as the metadata calls.
101
+ */
102
+ readonly baseUrl: string;
103
+
97
104
  /**
98
105
  * @param relatedTo - Filter twins by container ID.
99
106
  * @throws {TwinValidationError} On invalid query parameters (400).
@@ -646,6 +653,17 @@ export class TwinClient implements ITwinClient {
646
653
  this._assetTypeCatalogUrl = `${base}/_ps/asset-type-catalog`;
647
654
  }
648
655
 
656
+ /**
657
+ * Rooted twins base URL — typically `<host>/sites/<container>/_ps/twins`.
658
+ * Exposed so callers that want to build content URLs in the same auth
659
+ * scope as the metadata calls can derive them from here. The bare
660
+ * `<host>/_ps/twins/...` variant is not necessarily an authorized route
661
+ * on all deployments.
662
+ */
663
+ get baseUrl(): string {
664
+ return this._baseUrl;
665
+ }
666
+
649
667
  async listTwins(
650
668
  relatedTo?: string,
651
669
  page: string | undefined = undefined,