@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/dist/BuildInfo.js +4 -4
- package/dist/TwinClient.d.ts +14 -0
- package/dist/TwinClient.d.ts.map +1 -1
- package/dist/TwinClient.js +10 -0
- package/dist/TwinClient.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/docs/assets/hierarchy.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/TwinClient.html +8 -2
- package/docs/hierarchy.html +1 -1
- package/docs/interfaces/ITwinClient.html +7 -3
- package/package.json +3 -3
- package/src/TwinClient.ts +18 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twinfinity/twin",
|
|
3
|
-
"version": "6.0
|
|
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
|
|
43
|
-
"@twinfinity/t8-client-model": "6.0
|
|
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,
|