@itwin/core-frontend 3.3.0-dev.50 → 3.3.0-dev.51

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 (161) hide show
  1. package/lib/cjs/DisplayStyleState.d.ts +12 -14
  2. package/lib/cjs/DisplayStyleState.d.ts.map +1 -1
  3. package/lib/cjs/DisplayStyleState.js +84 -69
  4. package/lib/cjs/DisplayStyleState.js.map +1 -1
  5. package/lib/cjs/DrawingViewState.js +1 -1
  6. package/lib/cjs/DrawingViewState.js.map +1 -1
  7. package/lib/cjs/IModelConnection.js +1 -1
  8. package/lib/cjs/IModelConnection.js.map +1 -1
  9. package/lib/cjs/RealityDataSource.d.ts.map +1 -1
  10. package/lib/cjs/RealityDataSource.js +6 -2
  11. package/lib/cjs/RealityDataSource.js.map +1 -1
  12. package/lib/cjs/SheetViewState.js +1 -1
  13. package/lib/cjs/SheetViewState.js.map +1 -1
  14. package/lib/cjs/ViewState.d.ts +1 -2
  15. package/lib/cjs/ViewState.d.ts.map +1 -1
  16. package/lib/cjs/ViewState.js +2 -2
  17. package/lib/cjs/ViewState.js.map +1 -1
  18. package/lib/cjs/Viewport.d.ts.map +1 -1
  19. package/lib/cjs/Viewport.js +9 -4
  20. package/lib/cjs/Viewport.js.map +1 -1
  21. package/lib/cjs/core-frontend.d.ts +0 -2
  22. package/lib/cjs/core-frontend.d.ts.map +1 -1
  23. package/lib/cjs/core-frontend.js +0 -2
  24. package/lib/cjs/core-frontend.js.map +1 -1
  25. package/lib/cjs/render/FeatureSymbology.js +2 -2
  26. package/lib/cjs/render/FeatureSymbology.js.map +1 -1
  27. package/lib/cjs/render/GraphicBranch.d.ts +15 -9
  28. package/lib/cjs/render/GraphicBranch.d.ts.map +1 -1
  29. package/lib/cjs/render/GraphicBranch.js +38 -1
  30. package/lib/cjs/render/GraphicBranch.js.map +1 -1
  31. package/lib/cjs/render/primitives/EdgeParams.d.ts +11 -0
  32. package/lib/cjs/render/primitives/EdgeParams.d.ts.map +1 -1
  33. package/lib/cjs/render/primitives/EdgeParams.js +36 -29
  34. package/lib/cjs/render/primitives/EdgeParams.js.map +1 -1
  35. package/lib/cjs/render/primitives/VertexTable.d.ts +11 -4
  36. package/lib/cjs/render/primitives/VertexTable.d.ts.map +1 -1
  37. package/lib/cjs/render/primitives/VertexTable.js +13 -6
  38. package/lib/cjs/render/primitives/VertexTable.js.map +1 -1
  39. package/lib/cjs/render/primitives/VertexTableSplitter.d.ts +41 -0
  40. package/lib/cjs/render/primitives/VertexTableSplitter.d.ts.map +1 -0
  41. package/lib/cjs/render/primitives/VertexTableSplitter.js +662 -0
  42. package/lib/cjs/render/primitives/VertexTableSplitter.js.map +1 -0
  43. package/lib/cjs/render-primitives.d.ts +1 -0
  44. package/lib/cjs/render-primitives.d.ts.map +1 -1
  45. package/lib/cjs/render-primitives.js +1 -0
  46. package/lib/cjs/render-primitives.js.map +1 -1
  47. package/lib/cjs/tile/ClassifierTileTree.d.ts.map +1 -1
  48. package/lib/cjs/tile/ClassifierTileTree.js +8 -8
  49. package/lib/cjs/tile/ClassifierTileTree.js.map +1 -1
  50. package/lib/cjs/tile/IModelTile.d.ts.map +1 -1
  51. package/lib/cjs/tile/IModelTile.js +1 -0
  52. package/lib/cjs/tile/IModelTile.js.map +1 -1
  53. package/lib/cjs/tile/IModelTileTree.d.ts +3 -1
  54. package/lib/cjs/tile/IModelTileTree.d.ts.map +1 -1
  55. package/lib/cjs/tile/IModelTileTree.js +1 -0
  56. package/lib/cjs/tile/IModelTileTree.js.map +1 -1
  57. package/lib/cjs/tile/ImdlReader.d.ts +9 -4
  58. package/lib/cjs/tile/ImdlReader.d.ts.map +1 -1
  59. package/lib/cjs/tile/ImdlReader.js +174 -60
  60. package/lib/cjs/tile/ImdlReader.js.map +1 -1
  61. package/lib/cjs/tile/PrimaryTileTree.d.ts +7 -6
  62. package/lib/cjs/tile/PrimaryTileTree.d.ts.map +1 -1
  63. package/lib/cjs/tile/PrimaryTileTree.js +30 -25
  64. package/lib/cjs/tile/PrimaryTileTree.js.map +1 -1
  65. package/lib/cjs/tile/TileAdmin.d.ts +21 -2
  66. package/lib/cjs/tile/TileAdmin.d.ts.map +1 -1
  67. package/lib/cjs/tile/TileAdmin.js +30 -12
  68. package/lib/cjs/tile/TileAdmin.js.map +1 -1
  69. package/lib/esm/DisplayStyleState.d.ts +12 -14
  70. package/lib/esm/DisplayStyleState.d.ts.map +1 -1
  71. package/lib/esm/DisplayStyleState.js +84 -69
  72. package/lib/esm/DisplayStyleState.js.map +1 -1
  73. package/lib/esm/DrawingViewState.js +1 -1
  74. package/lib/esm/DrawingViewState.js.map +1 -1
  75. package/lib/esm/IModelConnection.js +1 -1
  76. package/lib/esm/IModelConnection.js.map +1 -1
  77. package/lib/esm/RealityDataSource.d.ts.map +1 -1
  78. package/lib/esm/RealityDataSource.js +6 -2
  79. package/lib/esm/RealityDataSource.js.map +1 -1
  80. package/lib/esm/SheetViewState.js +1 -1
  81. package/lib/esm/SheetViewState.js.map +1 -1
  82. package/lib/esm/ViewState.d.ts +1 -2
  83. package/lib/esm/ViewState.d.ts.map +1 -1
  84. package/lib/esm/ViewState.js +2 -2
  85. package/lib/esm/ViewState.js.map +1 -1
  86. package/lib/esm/Viewport.d.ts.map +1 -1
  87. package/lib/esm/Viewport.js +9 -4
  88. package/lib/esm/Viewport.js.map +1 -1
  89. package/lib/esm/core-frontend.d.ts +0 -2
  90. package/lib/esm/core-frontend.d.ts.map +1 -1
  91. package/lib/esm/core-frontend.js +0 -2
  92. package/lib/esm/core-frontend.js.map +1 -1
  93. package/lib/esm/render/FeatureSymbology.js +2 -2
  94. package/lib/esm/render/FeatureSymbology.js.map +1 -1
  95. package/lib/esm/render/GraphicBranch.d.ts +15 -9
  96. package/lib/esm/render/GraphicBranch.d.ts.map +1 -1
  97. package/lib/esm/render/GraphicBranch.js +36 -0
  98. package/lib/esm/render/GraphicBranch.js.map +1 -1
  99. package/lib/esm/render/primitives/EdgeParams.d.ts +11 -0
  100. package/lib/esm/render/primitives/EdgeParams.d.ts.map +1 -1
  101. package/lib/esm/render/primitives/EdgeParams.js +34 -28
  102. package/lib/esm/render/primitives/EdgeParams.js.map +1 -1
  103. package/lib/esm/render/primitives/VertexTable.d.ts +11 -4
  104. package/lib/esm/render/primitives/VertexTable.d.ts.map +1 -1
  105. package/lib/esm/render/primitives/VertexTable.js +14 -7
  106. package/lib/esm/render/primitives/VertexTable.js.map +1 -1
  107. package/lib/esm/render/primitives/VertexTableSplitter.d.ts +41 -0
  108. package/lib/esm/render/primitives/VertexTableSplitter.d.ts.map +1 -0
  109. package/lib/esm/render/primitives/VertexTableSplitter.js +655 -0
  110. package/lib/esm/render/primitives/VertexTableSplitter.js.map +1 -0
  111. package/lib/esm/render-primitives.d.ts +1 -0
  112. package/lib/esm/render-primitives.d.ts.map +1 -1
  113. package/lib/esm/render-primitives.js +1 -0
  114. package/lib/esm/render-primitives.js.map +1 -1
  115. package/lib/esm/tile/ClassifierTileTree.d.ts.map +1 -1
  116. package/lib/esm/tile/ClassifierTileTree.js +10 -10
  117. package/lib/esm/tile/ClassifierTileTree.js.map +1 -1
  118. package/lib/esm/tile/IModelTile.d.ts.map +1 -1
  119. package/lib/esm/tile/IModelTile.js +1 -0
  120. package/lib/esm/tile/IModelTile.js.map +1 -1
  121. package/lib/esm/tile/IModelTileTree.d.ts +3 -1
  122. package/lib/esm/tile/IModelTileTree.d.ts.map +1 -1
  123. package/lib/esm/tile/IModelTileTree.js +1 -0
  124. package/lib/esm/tile/IModelTileTree.js.map +1 -1
  125. package/lib/esm/tile/ImdlReader.d.ts +9 -4
  126. package/lib/esm/tile/ImdlReader.d.ts.map +1 -1
  127. package/lib/esm/tile/ImdlReader.js +174 -60
  128. package/lib/esm/tile/ImdlReader.js.map +1 -1
  129. package/lib/esm/tile/PrimaryTileTree.d.ts +7 -6
  130. package/lib/esm/tile/PrimaryTileTree.d.ts.map +1 -1
  131. package/lib/esm/tile/PrimaryTileTree.js +31 -26
  132. package/lib/esm/tile/PrimaryTileTree.js.map +1 -1
  133. package/lib/esm/tile/TileAdmin.d.ts +21 -2
  134. package/lib/esm/tile/TileAdmin.d.ts.map +1 -1
  135. package/lib/esm/tile/TileAdmin.js +31 -13
  136. package/lib/esm/tile/TileAdmin.js.map +1 -1
  137. package/package.json +20 -20
  138. package/lib/cjs/RenderScheduleState.d.ts +0 -24
  139. package/lib/cjs/RenderScheduleState.d.ts.map +0 -1
  140. package/lib/cjs/RenderScheduleState.js +0 -76
  141. package/lib/cjs/RenderScheduleState.js.map +0 -1
  142. package/lib/cjs/extension/providers/ExtensionServiceClient.d.ts +0 -54
  143. package/lib/cjs/extension/providers/ExtensionServiceClient.d.ts.map +0 -1
  144. package/lib/cjs/extension/providers/ExtensionServiceClient.js +0 -138
  145. package/lib/cjs/extension/providers/ExtensionServiceClient.js.map +0 -1
  146. package/lib/cjs/extension/providers/ServiceExtensionProvider.d.ts +0 -38
  147. package/lib/cjs/extension/providers/ServiceExtensionProvider.d.ts.map +0 -1
  148. package/lib/cjs/extension/providers/ServiceExtensionProvider.js +0 -73
  149. package/lib/cjs/extension/providers/ServiceExtensionProvider.js.map +0 -1
  150. package/lib/esm/RenderScheduleState.d.ts +0 -24
  151. package/lib/esm/RenderScheduleState.d.ts.map +0 -1
  152. package/lib/esm/RenderScheduleState.js +0 -71
  153. package/lib/esm/RenderScheduleState.js.map +0 -1
  154. package/lib/esm/extension/providers/ExtensionServiceClient.d.ts +0 -54
  155. package/lib/esm/extension/providers/ExtensionServiceClient.d.ts.map +0 -1
  156. package/lib/esm/extension/providers/ExtensionServiceClient.js +0 -134
  157. package/lib/esm/extension/providers/ExtensionServiceClient.js.map +0 -1
  158. package/lib/esm/extension/providers/ServiceExtensionProvider.d.ts +0 -38
  159. package/lib/esm/extension/providers/ServiceExtensionProvider.d.ts.map +0 -1
  160. package/lib/esm/extension/providers/ServiceExtensionProvider.js +0 -69
  161. package/lib/esm/extension/providers/ServiceExtensionProvider.js.map +0 -1
@@ -1,54 +0,0 @@
1
- import { AccessToken } from "@itwin/core-bentley";
2
- /** Structure of extensions from the ExtensionService
3
- * @internal
4
- */
5
- export interface ExtensionMetadata {
6
- contextId: string;
7
- extensionName: string;
8
- version: string;
9
- files: FileInfo[];
10
- uploadedBy: string;
11
- timestamp: Date;
12
- status: ExtensionUploadStatus;
13
- isPublic: boolean;
14
- }
15
- interface ExtensionUploadStatus {
16
- updateTime: Date;
17
- status: string;
18
- }
19
- interface FileInfo {
20
- url: string;
21
- expires: Date;
22
- checksum: string;
23
- }
24
- /**
25
- * Client for querying, publishing and deleting iModel.js Extensions.
26
- *
27
- * The `imodel-extension-service-api` OIDC scope is required for all operations and the `imodel-extension-service:modify` is
28
- * required for modification operations (modify, publish, and deleting).
29
- * @alpha
30
- */
31
- export declare class ExtensionClient {
32
- private readonly _baseUrl;
33
- constructor();
34
- private get _endpoint();
35
- private parseExtensionMetadataArray;
36
- /**
37
- * Gets information on extensions. If extensionName is undefined, will return all extensions in the iTwin.
38
- * If extensionName is defined, will return all versions of that extension.
39
- * If iTwinId is undefined, will default to the public extensions.
40
- * @param extensionName Extension name (optional)
41
- * @param iTwinId iTwin Id (optional)
42
- */
43
- getExtensions(accessToken: AccessToken, extensionName?: string, iTwinId?: string): Promise<ExtensionMetadata[]>;
44
- /**
45
- * Gets information about an extension's specific version
46
- * If iTwinId is undefined, will assume the extension was published publicly.
47
- * @param extensionName Extension name
48
- * @param version Extension version
49
- * @param iTwinId iTwin Id (optional)
50
- */
51
- getExtensionMetadata(accessToken: AccessToken, extensionName: string, version: string, iTwinId?: string): Promise<ExtensionMetadata | undefined>;
52
- }
53
- export {};
54
- //# sourceMappingURL=ExtensionServiceClient.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ExtensionServiceClient.d.ts","sourceRoot":"","sources":["../../../../src/extension/providers/ExtensionServiceClient.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAQ,MAAM,qBAAqB,CAAC;AAIxD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,IAAI,CAAC;IAChB,MAAM,EAAE,qBAAqB,CAAC;IAC9B,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,UAAU,qBAAqB;IAC7B,UAAU,EAAE,IAAI,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,QAAQ;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,IAAI,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;GAMG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;;IAKlC,OAAO,KAAK,SAAS,GAWpB;IAED,OAAO,CAAC,2BAA2B;IAcnC;;;;;;OAMG;IACU,aAAa,CAAC,WAAW,EAAE,WAAW,EAAE,aAAa,CAAC,EAAE,MAAM,EAAE,OAAO,SAAa,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAahI;;;;;;OAMG;IACU,oBAAoB,CAAC,WAAW,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,SAAa,GAAG,OAAO,CAAC,iBAAiB,GAAG,SAAS,CAAC;CAelK"}
@@ -1,138 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ExtensionClient = void 0;
4
- /*---------------------------------------------------------------------------------------------
5
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
6
- * See LICENSE.md in the project root for license terms and full copyright notice.
7
- *--------------------------------------------------------------------------------------------*/
8
- const core_bentley_1 = require("@itwin/core-bentley");
9
- const Request_1 = require("../../request/Request");
10
- /**
11
- * Client for querying, publishing and deleting iModel.js Extensions.
12
- *
13
- * The `imodel-extension-service-api` OIDC scope is required for all operations and the `imodel-extension-service:modify` is
14
- * required for modification operations (modify, publish, and deleting).
15
- * @alpha
16
- */
17
- class ExtensionClient {
18
- constructor() {
19
- this._baseUrl = "https://api.bentley.com/iModelExtensionService/";
20
- }
21
- get _endpoint() {
22
- const prefix = process.env.IMJS_URL_PREFIX;
23
- const baseUrl = new URL(this._baseUrl);
24
- if (prefix)
25
- baseUrl.hostname = prefix + new URL(baseUrl).hostname;
26
- if (!baseUrl.pathname.endsWith("/"))
27
- baseUrl.pathname += "/";
28
- baseUrl.pathname += "v1.0/";
29
- return baseUrl.toString();
30
- }
31
- parseExtensionMetadataArray(json) {
32
- if (!(json instanceof Array))
33
- return [];
34
- const ret = [];
35
- json.forEach((extensionJson) => {
36
- const extension = extensionMetadataFromJSON(extensionJson);
37
- if (extension !== undefined)
38
- ret.push(extension);
39
- });
40
- return ret;
41
- }
42
- /**
43
- * Gets information on extensions. If extensionName is undefined, will return all extensions in the iTwin.
44
- * If extensionName is defined, will return all versions of that extension.
45
- * If iTwinId is undefined, will default to the public extensions.
46
- * @param extensionName Extension name (optional)
47
- * @param iTwinId iTwin Id (optional)
48
- */
49
- async getExtensions(accessToken, extensionName, iTwinId = core_bentley_1.Guid.empty) {
50
- const options = { method: "GET" };
51
- options.headers = { authorization: accessToken };
52
- const response = await (0, Request_1.request)(`${this._endpoint}${iTwinId}/IModelExtension/${extensionName !== null && extensionName !== void 0 ? extensionName : ""}`, options);
53
- if (response.status !== 200)
54
- throw new Error(`Server returned status: ${response.status}, message: ${response.body.message}`);
55
- if (!(response.body instanceof Array) || response.body.length < 1)
56
- return [];
57
- return this.parseExtensionMetadataArray(response.body);
58
- }
59
- /**
60
- * Gets information about an extension's specific version
61
- * If iTwinId is undefined, will assume the extension was published publicly.
62
- * @param extensionName Extension name
63
- * @param version Extension version
64
- * @param iTwinId iTwin Id (optional)
65
- */
66
- async getExtensionMetadata(accessToken, extensionName, version, iTwinId = core_bentley_1.Guid.empty) {
67
- const options = { method: "GET" };
68
- options.headers = { authorization: accessToken };
69
- const response = await (0, Request_1.request)(`${this._endpoint}${iTwinId}/IModelExtension/${extensionName}/${version}`, options);
70
- if (response.status !== 200)
71
- throw new Error(`Server returned status: ${response.status}, message: ${response.body.message}`);
72
- if (!(response.body instanceof Array) || response.body.length < 1)
73
- return undefined;
74
- if (response.body.length > 1)
75
- throw new Error("Server returned too many extensions");
76
- return extensionMetadataFromJSON(response.body[0]);
77
- }
78
- }
79
- exports.ExtensionClient = ExtensionClient;
80
- /**
81
- * Validates JSON and returns ExtensionMetadata
82
- */
83
- function extensionMetadataFromJSON(jsonObject) {
84
- if (jsonObject.contextId === undefined || typeof jsonObject.contextId !== "string" ||
85
- jsonObject.extensionName === undefined || typeof jsonObject.extensionName !== "string" ||
86
- jsonObject.version === undefined || typeof jsonObject.version !== "string" ||
87
- jsonObject.files === undefined || !(jsonObject.files instanceof Array) ||
88
- jsonObject.uploadedBy === undefined || typeof jsonObject.uploadedBy !== "string" ||
89
- jsonObject.timestamp === undefined || typeof jsonObject.timestamp !== "string" ||
90
- jsonObject.isPublic === undefined || typeof jsonObject.isPublic !== "boolean" ||
91
- jsonObject.extensionStatus === undefined) {
92
- return undefined;
93
- }
94
- const status = statusFromJSON(jsonObject.extensionStatus);
95
- if (status === undefined)
96
- return undefined;
97
- const files = new Array(jsonObject.files.length);
98
- for (let i = 0; i < jsonObject.files.length; i++) {
99
- const parsed = fileInfoFromJSON(jsonObject.files[i]);
100
- if (parsed === undefined)
101
- return undefined;
102
- files[i] = parsed;
103
- }
104
- return {
105
- contextId: jsonObject.contextId,
106
- extensionName: jsonObject.extensionName,
107
- version: jsonObject.version,
108
- files,
109
- uploadedBy: jsonObject.uploadedBy,
110
- timestamp: new Date(jsonObject.timestamp),
111
- isPublic: jsonObject.isPublic,
112
- status,
113
- };
114
- }
115
- function statusFromJSON(jsonObject) {
116
- var _a;
117
- if (jsonObject.statusUpdateTime === undefined || typeof jsonObject.statusUpdateTime !== "string" ||
118
- jsonObject.status === undefined || (jsonObject.status !== null && typeof jsonObject.status !== "string")) {
119
- return undefined;
120
- }
121
- return {
122
- updateTime: new Date(jsonObject.statusUpdateTime),
123
- status: (_a = jsonObject.status) !== null && _a !== void 0 ? _a : "Valid",
124
- };
125
- }
126
- function fileInfoFromJSON(jsonObject) {
127
- if (jsonObject.url === undefined || typeof jsonObject.url !== "string" ||
128
- jsonObject.expiresAt === undefined || typeof jsonObject.expiresAt !== "string" ||
129
- jsonObject.checksum === undefined || (typeof jsonObject.checksum !== "string" && jsonObject.checksum !== null)) {
130
- return undefined;
131
- }
132
- return {
133
- url: jsonObject.url,
134
- expires: new Date(jsonObject.expiresAt),
135
- checksum: jsonObject.checksum,
136
- };
137
- }
138
- //# sourceMappingURL=ExtensionServiceClient.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ExtensionServiceClient.js","sourceRoot":"","sources":["../../../../src/extension/providers/ExtensionServiceClient.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,sDAAwD;AAExD,mDAAgE;AA2BhE;;;;;;GAMG;AACH,MAAa,eAAe;IAE1B;QACE,IAAI,CAAC,QAAQ,GAAG,iDAAiD,CAAC;IACpE,CAAC;IAED,IAAY,SAAS;QACnB,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC;QAC3C,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACvC,IAAI,MAAM;YACR,OAAO,CAAC,QAAQ,GAAG,MAAM,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC;QAExD,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC;YACjC,OAAO,CAAC,QAAQ,IAAI,GAAG,CAAC;QAE1B,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC;QAC5B,OAAO,OA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OAAO,UAAU,CAAC,gBAAgB,KAAK,QAAQ;QAC9F,UAAU,CAAC,MAAM,KAAK,SAAS,IAAI,CAAC,UAAU,CAAC,MAAM,KAAK,IAAI,IAAI,OAAO,UAAU,CAAC,MAAM,KAAK,QAAQ,CAAC,EAAE;QAE1G,OAAO,SAAS,CAAC;KAClB;IAED,OAAO;QACL,UAAU,EAAE,IAAI,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC;QACjD,MAAM,EAAE,MAAA,UAAU,CAAC,MAAM,mCAAI,OAAO;KACrC,CAAC;AACJ,CAAC;AAED,SAAS,gBAAgB,CAAC,UAAe;IACvC,IAAI,UAAU,CAAC,GAAG,KAAK,SAAS,IAAI,OAAO,UAAU,CAAC,GAAG,KAAK,QAAQ;QACpE,UAAU,CAAC,SAAS,KAAK,SAAS,IAAI,OAAO,UAAU,CAAC,SAAS,KAAK,QAAQ;QAC9E,UAAU,CAAC,QAAQ,KAAK,SAAS,IAAI,CAAC,OAAO,UAAU,CAAC,QAAQ,KAAK,QAAQ,IAAI,UAAU,CAAC,QAAQ,KAAK,IAAI,CAAC,EAAE;QAEhH,OAAO,SAAS,CAAC;KAClB;IAED,OAAO;QACL,GAAG,EAAE,UAAU,CAAC,GAAG;QACnB,OAAO,EAAE,IAAI,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC;QACvC,QAAQ,EAAE,UAAU,CAAC,QAAQ;KAC9B,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\nimport { AccessToken, Guid } from \"@itwin/core-bentley\";\r\n\r\nimport { request, RequestOptions } from \"../../request/Request\";\r\n\r\n/** Structure of extensions from the ExtensionService\r\n * @internal\r\n */\r\nexport interface ExtensionMetadata {\r\n contextId: string;\r\n extensionName: string;\r\n version: string;\r\n files: FileInfo[];\r\n uploadedBy: string;\r\n timestamp: Date;\r\n status: ExtensionUploadStatus;\r\n isPublic: boolean;\r\n}\r\n\r\ninterface ExtensionUploadStatus {\r\n updateTime: Date;\r\n status: string;\r\n}\r\n\r\ninterface FileInfo {\r\n url: string;\r\n expires: Date;\r\n checksum: string;\r\n}\r\n\r\n/**\r\n * Client for querying, publishing and deleting iModel.js Extensions.\r\n *\r\n * The `imodel-extension-service-api` OIDC scope is required for all operations and the `imodel-extension-service:modify` is\r\n * required for modification operations (modify, publish, and deleting).\r\n * @alpha\r\n */\r\nexport class ExtensionClient {\r\n private readonly _baseUrl: string;\r\n public constructor() {\r\n this._baseUrl = \"https://api.bentley.com/iModelExtensionService/\";\r\n }\r\n\r\n private get _endpoint(): string {\r\n const prefix = process.env.IMJS_URL_PREFIX;\r\n const baseUrl = new URL(this._baseUrl);\r\n if (prefix)\r\n baseUrl.hostname = prefix + new URL(baseUrl).hostname;\r\n\r\n if (!baseUrl.pathname.endsWith(\"/\"))\r\n baseUrl.pathname += \"/\";\r\n\r\n baseUrl.pathname += \"v1.0/\";\r\n return baseUrl.toString();\r\n }\r\n\r\n private parseExtensionMetadataArray(json: any): ExtensionMetadata[] {\r\n if (!(json instanceof Array))\r\n return [];\r\n\r\n const ret: ExtensionMetadata[] = [];\r\n json.forEach((extensionJson) => {\r\n const extension = extensionMetadataFromJSON(extensionJson);\r\n if (extension !== undefined)\r\n ret.push(extension);\r\n });\r\n\r\n return ret;\r\n }\r\n\r\n /**\r\n * Gets information on extensions. If extensionName is undefined, will return all extensions in the iTwin.\r\n * If extensionName is defined, will return all versions of that extension.\r\n * If iTwinId is undefined, will default to the public extensions.\r\n * @param extensionName Extension name (optional)\r\n * @param iTwinId iTwin Id (optional)\r\n */\r\n public async getExtensions(accessToken: AccessToken, extensionName?: string, iTwinId = Guid.empty): Promise<ExtensionMetadata[]> {\r\n const options: RequestOptions = { method: \"GET\" };\r\n options.headers = { authorization: accessToken };\r\n const response = await request(`${this._endpoint}${iTwinId}/IModelExtension/${extensionName ?? \"\"}`, options);\r\n if (response.status !== 200)\r\n throw new Error(`Server returned status: ${response.status}, message: ${response.body.message}`);\r\n\r\n if (!(response.body instanceof Array) || response.body.length < 1)\r\n return [];\r\n\r\n return this.parseExtensionMetadataArray(response.body);\r\n }\r\n\r\n /**\r\n * Gets information about an extension's specific version\r\n * If iTwinId is undefined, will assume the extension was published publicly.\r\n * @param extensionName Extension name\r\n * @param version Extension version\r\n * @param iTwinId iTwin Id (optional)\r\n */\r\n public async getExtensionMetadata(accessToken: AccessToken, extensionName: string, version: string, iTwinId = Guid.empty): Promise<ExtensionMetadata | undefined> {\r\n\r\n const options: RequestOptions = { method: \"GET\" };\r\n options.headers = { authorization: accessToken };\r\n const response = await request(`${this._endpoint}${iTwinId}/IModelExtension/${extensionName}/${version}`, options);\r\n if (response.status !== 200)\r\n throw new Error(`Server returned status: ${response.status}, message: ${response.body.message}`);\r\n\r\n if (!(response.body instanceof Array) || response.body.length < 1)\r\n return undefined;\r\n if (response.body.length > 1)\r\n throw new Error(\"Server returned too many extensions\");\r\n\r\n return extensionMetadataFromJSON(response.body[0]);\r\n }\r\n}\r\n\r\n/**\r\n * Validates JSON and returns ExtensionMetadata\r\n */\r\nfunction extensionMetadataFromJSON(jsonObject: any): ExtensionMetadata | undefined {\r\n if (jsonObject.contextId === undefined || typeof jsonObject.contextId !== \"string\" ||\r\n jsonObject.extensionName === undefined || typeof jsonObject.extensionName !== \"string\" ||\r\n jsonObject.version === undefined || typeof jsonObject.version !== \"string\" ||\r\n jsonObject.files === undefined || !(jsonObject.files instanceof Array) ||\r\n jsonObject.uploadedBy === undefined || typeof jsonObject.uploadedBy !== \"string\" ||\r\n jsonObject.timestamp === undefined || typeof jsonObject.timestamp !== \"string\" ||\r\n jsonObject.isPublic === undefined || typeof jsonObject.isPublic !== \"boolean\" ||\r\n jsonObject.extensionStatus === undefined) {\r\n\r\n return undefined;\r\n }\r\n\r\n const status = statusFromJSON(jsonObject.extensionStatus);\r\n if (status === undefined)\r\n return undefined;\r\n\r\n const files = new Array(jsonObject.files.length);\r\n for (let i = 0; i < jsonObject.files.length; i++) {\r\n const parsed = fileInfoFromJSON(jsonObject.files[i]);\r\n if (parsed === undefined)\r\n return undefined;\r\n files[i] = parsed;\r\n }\r\n\r\n return {\r\n contextId: jsonObject.contextId,\r\n extensionName: jsonObject.extensionName,\r\n version: jsonObject.version,\r\n files,\r\n uploadedBy: jsonObject.uploadedBy,\r\n timestamp: new Date(jsonObject.timestamp),\r\n isPublic: jsonObject.isPublic,\r\n status,\r\n };\r\n}\r\n\r\nfunction statusFromJSON(jsonObject: any) {\r\n if (jsonObject.statusUpdateTime === undefined || typeof jsonObject.statusUpdateTime !== \"string\" ||\r\n jsonObject.status === undefined || (jsonObject.status !== null && typeof jsonObject.status !== \"string\")) {\r\n\r\n return undefined;\r\n }\r\n\r\n return {\r\n updateTime: new Date(jsonObject.statusUpdateTime),\r\n status: jsonObject.status ?? \"Valid\",\r\n };\r\n}\r\n\r\nfunction fileInfoFromJSON(jsonObject: any) {\r\n if (jsonObject.url === undefined || typeof jsonObject.url !== \"string\" ||\r\n jsonObject.expiresAt === undefined || typeof jsonObject.expiresAt !== \"string\" ||\r\n jsonObject.checksum === undefined || (typeof jsonObject.checksum !== \"string\" && jsonObject.checksum !== null)) {\r\n\r\n return undefined;\r\n }\r\n\r\n return {\r\n url: jsonObject.url,\r\n expires: new Date(jsonObject.expiresAt),\r\n checksum: jsonObject.checksum,\r\n };\r\n}\r\n"]}
@@ -1,38 +0,0 @@
1
- import type { ExtensionManifest, ExtensionProvider } from "../Extension";
2
- import type { AccessToken } from "@itwin/core-bentley";
3
- /**
4
- * Required props for an extension uploaded to Bentley's Extension Service
5
- * @alpha
6
- */
7
- export interface ServiceExtensionProviderProps {
8
- /** Name of the uploaded extension */
9
- name: string;
10
- /** Version number (optional - if undefined, assumes the latest version) */
11
- version?: string;
12
- /** iTwin Id (optional - if undefined, assumes the extension is public) */
13
- iTwinId?: string;
14
- /** @internal */
15
- getAccessToken?: () => Promise<AccessToken>;
16
- }
17
- /**
18
- * Implements an Extension from the Extension Service via the ServiceExtensionProviderProps.
19
- * Service extensions are extensions hosted on Bentley's Extension Service.
20
- * The execute() and getManifest() methods are used by the ExtensionAdmin to load and execute the extension.
21
- * @alpha
22
- */
23
- export declare class ServiceExtensionProvider implements ExtensionProvider {
24
- private readonly _props;
25
- constructor(_props: ServiceExtensionProviderProps);
26
- /** Returns the extension's manifest (package.json) from the ExtensionService.
27
- * Throws an error if the manifest cannot be found.
28
- */
29
- getManifest(): Promise<ExtensionManifest>;
30
- /** Executes the javascript main file (the bundled index.js) of an extension from the Extension Service.
31
- * Throws an error if the file cannot be found.
32
- */
33
- execute(): Promise<any>;
34
- /** Fetches the extension from the ExtensionService.
35
- */
36
- private _getExtensionFiles;
37
- }
38
- //# sourceMappingURL=ServiceExtensionProvider.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ServiceExtensionProvider.d.ts","sourceRoot":"","sources":["../../../../src/extension/providers/ServiceExtensionProvider.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EACV,iBAAiB,EAAE,iBAAiB,EACrC,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD;;;GAGG;AACH,MAAM,WAAW,6BAA6B;IAC5C,qCAAqC;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,2EAA2E;IAC3E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,0EAA0E;IAC1E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gBAAgB;IAChB,cAAc,CAAC,EAAE,MAAM,OAAO,CAAC,WAAW,CAAC,CAAC;CAC7C;AAED;;;;;GAKG;AACH,qBAAa,wBAAyB,YAAW,iBAAiB;IAEpD,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,6BAA6B;IAElE;;OAEG;IACU,WAAW,IAAI,OAAO,CAAC,iBAAiB,CAAC;IAetD;;OAEG;IACU,OAAO,IAAI,OAAO,CAAC,GAAG,CAAC;IAQpC;OACG;YACW,kBAAkB;CAyBjC"}
@@ -1,73 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ServiceExtensionProvider = void 0;
4
- /*---------------------------------------------------------------------------------------------
5
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
6
- * See LICENSE.md in the project root for license terms and full copyright notice.
7
- *--------------------------------------------------------------------------------------------*/
8
- const semver_1 = require("semver");
9
- const IModelApp_1 = require("../../IModelApp");
10
- const Request_1 = require("../../request/Request");
11
- const ExtensionLoadScript_1 = require("./ExtensionLoadScript");
12
- const ExtensionServiceClient_1 = require("./ExtensionServiceClient");
13
- /**
14
- * Implements an Extension from the Extension Service via the ServiceExtensionProviderProps.
15
- * Service extensions are extensions hosted on Bentley's Extension Service.
16
- * The execute() and getManifest() methods are used by the ExtensionAdmin to load and execute the extension.
17
- * @alpha
18
- */
19
- class ServiceExtensionProvider {
20
- constructor(_props) {
21
- this._props = _props;
22
- }
23
- /** Returns the extension's manifest (package.json) from the ExtensionService.
24
- * Throws an error if the manifest cannot be found.
25
- */
26
- async getManifest() {
27
- const loadedExtensionProps = await this._getExtensionFiles(this._props);
28
- if (!loadedExtensionProps)
29
- throw new Error(`Error loading manifest for Extension ${this._props.name}.`);
30
- const options = { method: "GET" };
31
- const response = await (0, Request_1.request)(loadedExtensionProps.manifest.url, options);
32
- const data = response.body || (() => {
33
- if (!response.text)
34
- throw new Error("Manifest file was empty.");
35
- return JSON.parse(response.text);
36
- })();
37
- return data;
38
- }
39
- /** Executes the javascript main file (the bundled index.js) of an extension from the Extension Service.
40
- * Throws an error if the file cannot be found.
41
- */
42
- async execute() {
43
- const loadedExtensionProps = await this._getExtensionFiles(this._props);
44
- if (!loadedExtensionProps)
45
- throw new Error(`Error executing Extension ${this._props.name}.`);
46
- return (0, ExtensionLoadScript_1.loadScript)(loadedExtensionProps.main.url);
47
- }
48
- /** Fetches the extension from the ExtensionService.
49
- */
50
- async _getExtensionFiles(props) {
51
- var _a, _b, _c;
52
- const extensionClient = new ExtensionServiceClient_1.ExtensionClient();
53
- const accessToken = await ((_b = (_a = props.getAccessToken) === null || _a === void 0 ? void 0 : _a.call(props)) !== null && _b !== void 0 ? _b : (_c = IModelApp_1.IModelApp.authorizationClient) === null || _c === void 0 ? void 0 : _c.getAccessToken());
54
- if (!accessToken)
55
- return undefined;
56
- let extensionProps;
57
- if (props.version !== undefined)
58
- extensionProps = await extensionClient.getExtensionMetadata(accessToken, props.name, props.version, props.iTwinId);
59
- else {
60
- const propsArr = await extensionClient.getExtensions(accessToken, props.name, props.iTwinId);
61
- extensionProps = propsArr.sort((ext1, ext2) => (0, semver_1.rcompare)(ext1.version, ext2.version, true))[0];
62
- }
63
- if (extensionProps === undefined || extensionProps.files.length < 1)
64
- return undefined;
65
- const manifest = extensionProps.files.find((f) => f.url.indexOf("package.json?") > -1);
66
- const main = extensionProps.files.find((f) => f.url.indexOf("index.js?") > -1);
67
- if (!manifest || !main)
68
- return undefined;
69
- return { manifest, main };
70
- }
71
- }
72
- exports.ServiceExtensionProvider = ServiceExtensionProvider;
73
- //# sourceMappingURL=ServiceExtensionProvider.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ServiceExtensionProvider.js","sourceRoot":"","sources":["../../../../src/extension/providers/ServiceExtensionProvider.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,mCAAkC;AAElC,+CAA4C;AAC5C,mDAAgE;AAChE,+DAAmD;AACnD,qEAA8E;AAsB9E;;;;;GAKG;AACH,MAAa,wBAAwB;IAEnC,YAA6B,MAAqC;QAArC,WAAM,GAAN,MAAM,CAA+B;IAAI,CAAC;IAEvE;;OAEG;IACI,KAAK,CAAC,WAAW;QACtB,MAAM,oBAAoB,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACxE,IAAI,CAAC,oBAAo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KAAK,SAAS;YAC7B,cAAc,GAAG,MAAM,eAAe,CAAC,oBAAoB,CAAC,WAAW,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;aAChH;YACH,MAAM,QAAQ,GAAG,MAAM,eAAe,CAAC,aAAa,CAAC,WAAW,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;YAC7F,cAAc,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,IAAA,iBAAQ,EAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SAC/F;QAED,IAAI,cAAc,KAAK,SAAS,IAAI,cAAc,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC;YACjE,OAAO,SAAS,CAAC;QAEnB,MAAM,QAAQ,GAAG,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACvF,MAAM,IAAI,GAAG,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAC/E,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI;YACpB,OAAO,SAAS,CAAC;QAEnB,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC5B,CAAC;CACF;AA5DD,4DA4DC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\nimport { rcompare } from \"semver\";\r\n\r\nimport { IModelApp } from \"../../IModelApp\";\r\nimport { request, RequestOptions } from \"../../request/Request\";\r\nimport { loadScript } from \"./ExtensionLoadScript\";\r\nimport { ExtensionClient, ExtensionMetadata } from \"./ExtensionServiceClient\";\r\n\r\nimport type {\r\n ExtensionManifest, ExtensionProvider,\r\n} from \"../Extension\";\r\nimport type { AccessToken } from \"@itwin/core-bentley\";\r\n\r\n/**\r\n * Required props for an extension uploaded to Bentley's Extension Service\r\n * @alpha\r\n */\r\nexport interface ServiceExtensionProviderProps {\r\n /** Name of the uploaded extension */\r\n name: string;\r\n /** Version number (optional - if undefined, assumes the latest version) */\r\n version?: string;\r\n /** iTwin Id (optional - if undefined, assumes the extension is public) */\r\n iTwinId?: string;\r\n /** @internal */\r\n getAccessToken?: () => Promise<AccessToken>;\r\n}\r\n\r\n/**\r\n * Implements an Extension from the Extension Service via the ServiceExtensionProviderProps.\r\n * Service extensions are extensions hosted on Bentley's Extension Service.\r\n * The execute() and getManifest() methods are used by the ExtensionAdmin to load and execute the extension.\r\n * @alpha\r\n */\r\nexport class ServiceExtensionProvider implements ExtensionProvider {\r\n\r\n constructor(private readonly _props: ServiceExtensionProviderProps) { }\r\n\r\n /** Returns the extension's manifest (package.json) from the ExtensionService.\r\n * Throws an error if the manifest cannot be found.\r\n */\r\n public async getManifest(): Promise<ExtensionManifest> {\r\n const loadedExtensionProps = await this._getExtensionFiles(this._props);\r\n if (!loadedExtensionProps)\r\n throw new Error(`Error loading manifest for Extension ${this._props.name}.`);\r\n\r\n const options: RequestOptions = { method: \"GET\" };\r\n const response = await request(loadedExtensionProps.manifest.url, options);\r\n const data = response.body || (() => {\r\n if (!response.text)\r\n throw new Error(\"Manifest file was empty.\");\r\n return JSON.parse(response.text);\r\n })();\r\n return data;\r\n }\r\n\r\n /** Executes the javascript main file (the bundled index.js) of an extension from the Extension Service.\r\n * Throws an error if the file cannot be found.\r\n */\r\n public async execute(): Promise<any> {\r\n const loadedExtensionProps = await this._getExtensionFiles(this._props);\r\n if (!loadedExtensionProps)\r\n throw new Error(`Error executing Extension ${this._props.name}.`);\r\n\r\n return loadScript(loadedExtensionProps.main.url);\r\n }\r\n\r\n /** Fetches the extension from the ExtensionService.\r\n */\r\n private async _getExtensionFiles(props: ServiceExtensionProviderProps) {\r\n const extensionClient = new ExtensionClient();\r\n\r\n const accessToken = await (props.getAccessToken?.() ?? IModelApp.authorizationClient?.getAccessToken());\r\n if (!accessToken)\r\n return undefined;\r\n\r\n let extensionProps: ExtensionMetadata | undefined;\r\n if (props.version !== undefined)\r\n extensionProps = await extensionClient.getExtensionMetadata(accessToken, props.name, props.version, props.iTwinId);\r\n else {\r\n const propsArr = await extensionClient.getExtensions(accessToken, props.name, props.iTwinId);\r\n extensionProps = propsArr.sort((ext1, ext2) => rcompare(ext1.version, ext2.version, true))[0];\r\n }\r\n\r\n if (extensionProps === undefined || extensionProps.files.length < 1)\r\n return undefined;\r\n\r\n const manifest = extensionProps.files.find((f) => f.url.indexOf(\"package.json?\") > -1);\r\n const main = extensionProps.files.find((f) => f.url.indexOf(\"index.js?\") > -1);\r\n if (!manifest || !main)\r\n return undefined;\r\n\r\n return { manifest, main };\r\n }\r\n}\r\n"]}
@@ -1,24 +0,0 @@
1
- /** @packageDocumentation
2
- * @module Views
3
- */
4
- import { Id64String } from "@itwin/core-bentley";
5
- import { Range1d, Transform } from "@itwin/core-geometry";
6
- import { RenderSchedule } from "@itwin/core-common";
7
- import { FeatureSymbology } from "./render/FeatureSymbology";
8
- import { AnimationBranchStates } from "./render/GraphicBranch";
9
- /** @internal */
10
- export declare function formatAnimationBranchId(modelId: Id64String, branchId: number): string;
11
- /** Provides frontend-specific APIs for applying a RenderSchedule.Script to a view via a DisplayStyleState.
12
- * The methods it adds are for internal use by the display system.
13
- * @internal
14
- */
15
- export declare class RenderScheduleState extends RenderSchedule.ScriptReference {
16
- get duration(): Range1d;
17
- get containsFeatureOverrides(): boolean;
18
- getAnimationBranches(time: number): AnimationBranchStates | undefined;
19
- getTransformNodeIds(modelId: Id64String): ReadonlyArray<number> | undefined;
20
- getTransform(modelId: Id64String, nodeId: number, time: number): Readonly<Transform> | undefined;
21
- getSymbologyOverrides(overrides: FeatureSymbology.Overrides, time: number): void;
22
- getModelAnimationId(modelId: Id64String): Id64String | undefined;
23
- }
24
- //# sourceMappingURL=RenderScheduleState.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RenderScheduleState.d.ts","sourceRoot":"","sources":["../../src/RenderScheduleState.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAQ,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAwB,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAErF,gBAAgB;AAChB,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAKrF;AASD;;;GAGG;AACH,qBAAa,mBAAoB,SAAQ,cAAc,CAAC,eAAe;IACrE,IAAW,QAAQ,IAAI,OAAO,CAE7B;IAED,IAAW,wBAAwB,IAAI,OAAO,CAE7C;IAEM,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,qBAAqB,GAAG,SAAS;IAqBrE,mBAAmB,CAAC,OAAO,EAAE,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,GAAG,SAAS;IAI3E,YAAY,CAAC,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,QAAQ,CAAC,SAAS,CAAC,GAAG,SAAS;IAIhG,qBAAqB,CAAC,SAAS,EAAE,gBAAgB,CAAC,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI;IAIhF,mBAAmB,CAAC,OAAO,EAAE,UAAU,GAAG,UAAU,GAAG,SAAS;CAWxE"}
@@ -1,71 +0,0 @@
1
- /*---------------------------------------------------------------------------------------------
2
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
- * See LICENSE.md in the project root for license terms and full copyright notice.
4
- *--------------------------------------------------------------------------------------------*/
5
- /** @packageDocumentation
6
- * @module Views
7
- */
8
- import { Id64 } from "@itwin/core-bentley";
9
- import { RenderSchedule } from "@itwin/core-common";
10
- import { IModelApp } from "./IModelApp";
11
- /** @internal */
12
- export function formatAnimationBranchId(modelId, branchId) {
13
- if (branchId < 0)
14
- return modelId;
15
- return `${modelId}_Node_${branchId.toString()}`;
16
- }
17
- function addAnimationBranch(modelId, timeline, branchId, branches, time) {
18
- const clipVector = timeline.getClipVector(time);
19
- const clip = clipVector ? IModelApp.renderSystem.createClipVolume(clipVector) : undefined;
20
- if (clip)
21
- branches.set(formatAnimationBranchId(modelId, branchId), { clip });
22
- }
23
- /** Provides frontend-specific APIs for applying a RenderSchedule.Script to a view via a DisplayStyleState.
24
- * The methods it adds are for internal use by the display system.
25
- * @internal
26
- */
27
- export class RenderScheduleState extends RenderSchedule.ScriptReference {
28
- get duration() {
29
- return this.script.duration;
30
- }
31
- get containsFeatureOverrides() {
32
- return this.script.containsFeatureOverrides;
33
- }
34
- getAnimationBranches(time) {
35
- if (!this.script.containsModelClipping && !this.script.requiresBatching)
36
- return undefined;
37
- const branches = new Map();
38
- for (const model of this.script.modelTimelines) {
39
- addAnimationBranch(model.modelId, model, -1, branches, time);
40
- for (const elem of model.elementTimelines) {
41
- if (elem.getVisibility(time) <= 0)
42
- branches.set(formatAnimationBranchId(model.modelId, elem.batchId), { omit: true });
43
- else
44
- addAnimationBranch(model.modelId, elem, elem.batchId, branches, time);
45
- }
46
- }
47
- return {
48
- branchStates: branches,
49
- transformNodeIds: this.script.transformBatchIds,
50
- };
51
- }
52
- getTransformNodeIds(modelId) {
53
- return this.script.getTransformBatchIds(modelId);
54
- }
55
- getTransform(modelId, nodeId, time) {
56
- return this.script.getTransform(modelId, nodeId, time);
57
- }
58
- getSymbologyOverrides(overrides, time) {
59
- this.script.addSymbologyOverrides(overrides, time);
60
- }
61
- getModelAnimationId(modelId) {
62
- // Only if the script contains animation (cutting plane, transform or visibility by node ID) do we require separate tilesets for animations.
63
- if (Id64.isTransient(modelId))
64
- return undefined;
65
- for (const modelTimeline of this.script.modelTimelines)
66
- if (modelTimeline.modelId === modelId && modelTimeline.requiresBatching)
67
- return this.sourceId;
68
- return undefined;
69
- }
70
- }
71
- //# sourceMappingURL=RenderScheduleState.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RenderScheduleState.js","sourceRoot":"","sources":["../../src/RenderScheduleState.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,IAAI,EAAc,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAIxC,gBAAgB;AAChB,MAAM,UAAU,uBAAuB,CAAC,OAAmB,EAAE,QAAgB;IAC3E,IAAI,QAAQ,GAAG,CAAC;QACd,OAAO,OAAO,CAAC;IAEjB,OAAO,GAAG,OAAO,SAAS,QAAQ,CAAC,QAAQ,EAAE,EAAE,CAAC;AAClD,CAAC;AAED,SAAS,kBAAkB,CAAC,OAAmB,EAAE,QAAiC,EAAE,QAAgB,EAAE,QAA2C,EAAE,IAAY;IAC7J,MAAM,UAAU,GAAG,QAAQ,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IAChD,MAAM,IAAI,GAAG,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,YAAY,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC1F,IAAI,IAAI;QACN,QAAQ,CAAC,GAAG,CAAC,uBAAuB,CAAC,OAAO,EAAE,QAAQ,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C,OAAO,CAAC,CAAC;IACnD,CAAC;IAEM,YAAY,CAAC,OAAmB,EAAE,MAAc,EAAE,IAAY;QACnE,OAAO,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;IACzD,CAAC;IAEM,qBAAqB,CAAC,SAAqC,EAAE,IAAY;QAC9E,IAAI,CAAC,MAAM,CAAC,qBAAqB,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IACrD,CAAC;IAEM,mBAAmB,CAAC,OAAmB;QAC5C,4IAA4I;QAC5I,IAAI,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC;YAC3B,OAAO,SAAS,CAAC;QAEnB,KAAK,MAAM,aAAa,IAAI,IAAI,CAAC,MAAM,CAAC,cAAc;YACpD,IAAI,aAAa,CAAC,OAAO,KAAK,OAAO,IAAI,aAAa,CAAC,gBAAgB;gBACrE,OAAO,IAAI,CAAC,QAAQ,CAAC;QAEzB,OAAO,SAAS,CAAC;IACnB,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Views\r\n */\r\n\r\nimport { Id64, Id64String } from \"@itwin/core-bentley\";\r\nimport { Range1d, Transform } from \"@itwin/core-geometry\";\r\nimport { RenderSchedule } from \"@itwin/core-common\";\r\nimport { IModelApp } from \"./IModelApp\";\r\nimport { FeatureSymbology } from \"./render/FeatureSymbology\";\r\nimport { AnimationBranchState, AnimationBranchStates } from \"./render/GraphicBranch\";\r\n\r\n/** @internal */\r\nexport function formatAnimationBranchId(modelId: Id64String, branchId: number): string {\r\n if (branchId < 0)\r\n return modelId;\r\n\r\n return `${modelId}_Node_${branchId.toString()}`;\r\n}\r\n\r\nfunction addAnimationBranch(modelId: Id64String, timeline: RenderSchedule.Timeline, branchId: number, branches: Map<string, AnimationBranchState>, time: number): void {\r\n const clipVector = timeline.getClipVector(time);\r\n const clip = clipVector ? IModelApp.renderSystem.createClipVolume(clipVector) : undefined;\r\n if (clip)\r\n branches.set(formatAnimationBranchId(modelId, branchId), { clip });\r\n}\r\n\r\n/** Provides frontend-specific APIs for applying a RenderSchedule.Script to a view via a DisplayStyleState.\r\n * The methods it adds are for internal use by the display system.\r\n * @internal\r\n */\r\nexport class RenderScheduleState extends RenderSchedule.ScriptReference {\r\n public get duration(): Range1d {\r\n return this.script.duration;\r\n }\r\n\r\n public get containsFeatureOverrides(): boolean {\r\n return this.script.containsFeatureOverrides;\r\n }\r\n\r\n public getAnimationBranches(time: number): AnimationBranchStates | undefined {\r\n if (!this.script.containsModelClipping && !this.script.requiresBatching)\r\n return undefined;\r\n\r\n const branches = new Map<string, AnimationBranchState>();\r\n for (const model of this.script.modelTimelines) {\r\n addAnimationBranch(model.modelId, model, -1, branches, time);\r\n for (const elem of model.elementTimelines) {\r\n if (elem.getVisibility(time) <= 0)\r\n branches.set(formatAnimationBranchId(model.modelId, elem.batchId), { omit: true });\r\n else\r\n addAnimationBranch(model.modelId, elem, elem.batchId, branches, time);\r\n }\r\n }\r\n\r\n return {\r\n branchStates: branches,\r\n transformNodeIds: this.script.transformBatchIds,\r\n };\r\n }\r\n\r\n public getTransformNodeIds(modelId: Id64String): ReadonlyArray<number> | undefined {\r\n return this.script.getTransformBatchIds(modelId);\r\n }\r\n\r\n public getTransform(modelId: Id64String, nodeId: number, time: number): Readonly<Transform> | undefined {\r\n return this.script.getTransform(modelId, nodeId, time);\r\n }\r\n\r\n public getSymbologyOverrides(overrides: FeatureSymbology.Overrides, time: number): void {\r\n this.script.addSymbologyOverrides(overrides, time);\r\n }\r\n\r\n public getModelAnimationId(modelId: Id64String): Id64String | undefined {\r\n // Only if the script contains animation (cutting plane, transform or visibility by node ID) do we require separate tilesets for animations.\r\n if (Id64.isTransient(modelId))\r\n return undefined;\r\n\r\n for (const modelTimeline of this.script.modelTimelines)\r\n if (modelTimeline.modelId === modelId && modelTimeline.requiresBatching)\r\n return this.sourceId;\r\n\r\n return undefined;\r\n }\r\n}\r\n"]}
@@ -1,54 +0,0 @@
1
- import { AccessToken } from "@itwin/core-bentley";
2
- /** Structure of extensions from the ExtensionService
3
- * @internal
4
- */
5
- export interface ExtensionMetadata {
6
- contextId: string;
7
- extensionName: string;
8
- version: string;
9
- files: FileInfo[];
10
- uploadedBy: string;
11
- timestamp: Date;
12
- status: ExtensionUploadStatus;
13
- isPublic: boolean;
14
- }
15
- interface ExtensionUploadStatus {
16
- updateTime: Date;
17
- status: string;
18
- }
19
- interface FileInfo {
20
- url: string;
21
- expires: Date;
22
- checksum: string;
23
- }
24
- /**
25
- * Client for querying, publishing and deleting iModel.js Extensions.
26
- *
27
- * The `imodel-extension-service-api` OIDC scope is required for all operations and the `imodel-extension-service:modify` is
28
- * required for modification operations (modify, publish, and deleting).
29
- * @alpha
30
- */
31
- export declare class ExtensionClient {
32
- private readonly _baseUrl;
33
- constructor();
34
- private get _endpoint();
35
- private parseExtensionMetadataArray;
36
- /**
37
- * Gets information on extensions. If extensionName is undefined, will return all extensions in the iTwin.
38
- * If extensionName is defined, will return all versions of that extension.
39
- * If iTwinId is undefined, will default to the public extensions.
40
- * @param extensionName Extension name (optional)
41
- * @param iTwinId iTwin Id (optional)
42
- */
43
- getExtensions(accessToken: AccessToken, extensionName?: string, iTwinId?: string): Promise<ExtensionMetadata[]>;
44
- /**
45
- * Gets information about an extension's specific version
46
- * If iTwinId is undefined, will assume the extension was published publicly.
47
- * @param extensionName Extension name
48
- * @param version Extension version
49
- * @param iTwinId iTwin Id (optional)
50
- */
51
- getExtensionMetadata(accessToken: AccessToken, extensionName: string, version: string, iTwinId?: string): Promise<ExtensionMetadata | undefined>;
52
- }
53
- export {};
54
- //# sourceMappingURL=ExtensionServiceClient.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ExtensionServiceClient.d.ts","sourceRoot":"","sources":["../../../../src/extension/providers/ExtensionServiceClient.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAQ,MAAM,qBAAqB,CAAC;AAIxD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,IAAI,CAAC;IAChB,MAAM,EAAE,qBAAqB,CAAC;IAC9B,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,UAAU,qBAAqB;IAC7B,UAAU,EAAE,IAAI,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,QAAQ;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,IAAI,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;GAMG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;;IAKlC,OAAO,KAAK,SAAS,GAWpB;IAED,OAAO,CAAC,2BAA2B;IAcnC;;;;;;OAMG;IACU,aAAa,CAAC,WAAW,EAAE,WAAW,EAAE,aAAa,CAAC,EAAE,MAAM,EAAE,OAAO,SAAa,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAahI;;;;;;OAMG;IACU,oBAAoB,CAAC,WAAW,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,SAAa,GAAG,OAAO,CAAC,iBAAiB,GAAG,SAAS,CAAC;CAelK"}