bimplus-websdk 1.0.10 → 1.0.11

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 CHANGED
@@ -113,3 +113,6 @@ Content of the confluence file can be inserted into Confluence page :
113
113
  - in popup window choose to Insert Markdown format
114
114
  - copy content of the converted confluence markdown file into the field in Confluence
115
115
  - save it (Please note that page links doesn't work in page preview mode)
116
+
117
+ ### Typescript definitions
118
+ - typescript definition file is located in subfolder 'types'
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "bimplus-websdk",
3
- "version": "1.0.10",
3
+ "version": "1.0.11",
4
4
  "description": "bim+ websdk",
5
+ "types": "types/bimplus-websdk.d.ts",
5
6
  "keywords": [
6
7
  "Allplan",
7
8
  "Bimplus",
@@ -35,7 +36,7 @@
35
36
  "test-watch": "npm run test -- --browsers=Chrome --single-run=false --auto-watch"
36
37
  },
37
38
  "devDependencies": {
38
- "@babel/core": "^7.24.8",
39
+ "@babel/core": "^7.24.9",
39
40
  "@babel/plugin-transform-runtime": "^7.24.7",
40
41
  "@babel/preset-env": "^7.24.8",
41
42
  "@babel/runtime": "^7.24.8",
@@ -54,7 +55,7 @@
54
55
  "karma-jquery": "^0.2.4",
55
56
  "karma-qunit": "^4.2.0",
56
57
  "karma-webpack": "^5.0.1",
57
- "qunit": "^2.21.0",
58
+ "qunit": "^2.21.1",
58
59
  "terser-webpack-plugin": "^5.3.10",
59
60
  "webpack": "^5.93.0",
60
61
  "webpack-cli": "^5.1.4",
@@ -0,0 +1,268 @@
1
+ declare module 'bimplus-websdk' {
2
+
3
+ export type Guid = string;
4
+ export type ProjectId = Guid;
5
+ export type ModelId = Guid;
6
+ export type LayerId = Guid;
7
+ export type DivisionTopologyId = Guid;
8
+ export type RevisionId = string;
9
+ export type VisualObjectId = string;
10
+
11
+ export type TeamSlug = string;
12
+ export type AccessToken = string;
13
+ export type AccessTokenType = string;
14
+
15
+ export function createDefaultConfig(env?: string): ApiConfig;
16
+
17
+ export interface ApiConfig {
18
+ protocol: string;
19
+ host: string;
20
+ version?: string;
21
+ cache?: boolean;
22
+ }
23
+
24
+ export interface AuthorizeData {
25
+ access_token: string;
26
+ }
27
+ export class Authorize {
28
+ constructor(api: Api);
29
+
30
+ // Define methods and properties of the Teams class here
31
+
32
+ post(username: string, password: string, applicationId: string): Promise<AuthorizeData>;
33
+ }
34
+
35
+ export interface TeamData {
36
+ slug: string;
37
+ id: string;
38
+ name: string;
39
+ }
40
+
41
+ export interface Subscription {
42
+ settingName?: string;
43
+ expirationDate?: string;
44
+ id?: string;
45
+ teamId?: string;
46
+ value?: string;
47
+ status?: string;
48
+ }
49
+
50
+ export class Teams {
51
+ constructor(api: Api);
52
+
53
+ slug: string;
54
+
55
+ // Define methods and properties of the Teams class here
56
+
57
+ get(teamId?: string, filterEmpty?: boolean): Promise<TeamData[]>;
58
+ getAccountSettings(teamId?: string): Promise<Array<Subscription>>;
59
+ }
60
+
61
+ export interface UserData {
62
+ id: string;
63
+ name: string;
64
+ preferedLanguage: string;
65
+ }
66
+ export class User {
67
+ constructor(api: Api);
68
+
69
+ // Define methods and properties of the Teams class here
70
+
71
+ get(token: AccessToken | null): Promise<UserData>;
72
+ put(userdata): Promise<UserData>;
73
+ getSubscriptions(): Promise<Array<Subscription>>;
74
+ }
75
+
76
+ type AdditionalParams = {
77
+ [key: string]: string; // This allows key-value pairs as in json string
78
+ };
79
+
80
+ export interface Project {
81
+ id: ProjectId;
82
+ name: string;
83
+ teamSlug: TeamSlug;
84
+ teamName: string | undefined;
85
+ rights: object;
86
+ }
87
+
88
+ export class Projects {
89
+ constructor(api: Api);
90
+ get(id?: ProjectId, noDisciplines?: boolean, teamSlug?: TeamSlug, alsoRecycleBin?: boolean, additionalParams?: AdditionalParams): Promise<Project | Project[]>;
91
+ }
92
+
93
+ export interface ConnexisData {
94
+ projectId: ProjectId,
95
+ modelId: ModelId,
96
+ elements: Guid[];
97
+ settings: {
98
+ connectionMethod: string;
99
+ createRevision?: boolean;
100
+ designCode: string;
101
+ replace: string;
102
+ };
103
+ }
104
+
105
+ export interface Sds2ConnexisData {
106
+ SDS2: ConnexisData;
107
+ }
108
+ // export interface IdeaStaticaConnexisData {
109
+ // IdeaStatica: ConnexisData;
110
+ // }
111
+
112
+ export class Connexis {
113
+ constructor(api: Api);
114
+ post(data: Sds2ConnexisData /* | IdeaStaticaConnexisData */);
115
+ }
116
+
117
+ export interface ObjectFilter {
118
+ id?: string
119
+ module: string
120
+ category: string
121
+ disciplineID: string
122
+ name: string
123
+ filterString: string
124
+ isDefault: boolean
125
+ disableSortByModels: boolean
126
+ readableValues?: Record<string, string>
127
+ }
128
+
129
+ export type ObjectFiltersResponse = Array<ObjectFilter>;
130
+
131
+ export class ObjectFilters {
132
+ constructor(api: Api);
133
+ get(layerId: Guid | undefined, projectId: Guid | undefined): Promise<ObjectFiltersResponse>
134
+ getSelectionFilteredObjects(selectionId: Guid, filterId: Guid, properties: boolean | undefined, topology: boolean | undefined): Promise<ObjectFilterStructureResponse>
135
+ post(data: string, projectId: string): Promise<ObjectFilter>;
136
+ delete(id: string);
137
+ }
138
+
139
+ export interface ObjectsTopologyNode { }
140
+
141
+ export interface ObjectTopologyResponse {
142
+ id: string;
143
+ children?: ObjectsTopologyNode[];
144
+ ifcType?: string;
145
+ ifcId?: string;
146
+ elementTypeId?: string;
147
+ isChild?: boolean;
148
+ parent: string;
149
+ name: string;
150
+ type: string;
151
+ layerid?: string;
152
+ number: number;
153
+ level: number;
154
+ }
155
+
156
+ export type ObjectComplexPropertyTopologyResponse = ObjectTopologyResponse;
157
+
158
+ export class Objects {
159
+ constructor(api: Api);
160
+ get(objectId: string, revision: number | undefined, properties: string | undefined, projectId: string | undefined, shortInfo: boolean | undefined, type: string | undefined);
161
+ getTopology(objectId: string, revision: number | undefined, hideElements: boolean, shortInfo: boolean, batch: string | undefined): Promise<ObjectTopologyResponse>;
162
+ getComplexPropertiesTopology(objectId: string, revision: number | undefined): Promise<ObjectComplexPropertyTopologyResponse>;
163
+ }
164
+
165
+ export interface SelectionObjectTopologyNode {
166
+ id: string;
167
+ visible: boolean;
168
+ opaque: boolean;
169
+ opacity: number;
170
+ }
171
+
172
+ export interface SelectionObjectLayer {
173
+ revision: number;
174
+ id: string;
175
+ name?: string;
176
+ divisionId: string;
177
+ divisionName?: string;
178
+ visible?: boolean;
179
+ opaque?: boolean;
180
+ opacity?: number;
181
+ valid?: boolean;
182
+ }
183
+
184
+ export interface SelectionObjectTopology {
185
+ topology: SelectionObjectTopologyNode[];
186
+ layers: SelectionObjectLayer[];
187
+ }
188
+
189
+ export interface SelectionObjectTopologyStructure {
190
+ layers: SelectionObjectLayer[];
191
+ structures: string[];
192
+ }
193
+
194
+ export interface SelectionObject {
195
+ id?: string;
196
+ projectid: string;
197
+ divisionid?: string;
198
+ singleuse: boolean;
199
+ revisionnr?: string;
200
+ type: string;
201
+ elements?: string[];
202
+ revisionelements?: string[];
203
+ filter?: string;
204
+ topology?: SelectionObjectTopology;
205
+ topologyStructure?: SelectionObjectTopologyStructure
206
+ }
207
+
208
+ export interface ExportObject {
209
+ description: string;
210
+ id?: string;
211
+ name: string;
212
+ projectId: string;
213
+ singleUse: boolean;
214
+ selection: SelectionObject
215
+ }
216
+
217
+ export class ExportService {
218
+ constructor(api: Api);
219
+ createExportSelection(projectId: Guid, data: string): Promise<ExportObject>;
220
+ }
221
+
222
+ export interface StructureNode {
223
+ id: string;
224
+ parent?: string;
225
+ name: string;
226
+ type: string;
227
+ children?: StructureNode[];
228
+ lastTopologyId?: string;
229
+ count: number;
230
+ level: number;
231
+ nodeInfo: string;
232
+ hasGeometry?: boolean;
233
+ }
234
+
235
+ export interface ObjectFilterStructureResponse {
236
+ structure: StructureNode;
237
+ structureDepth: number;
238
+ }
239
+
240
+ export interface IDBCache { }
241
+
242
+ export class Api {
243
+ constructor(config: ApiConfig);
244
+
245
+ // Define methods and properties of the Teams class here
246
+
247
+ authorize: Authorize;
248
+ teams: Teams;
249
+ user: User;
250
+ projects: Projects;
251
+ connexis: Connexis;
252
+ objectFilters: ObjectFilters;
253
+ objects: Objects;
254
+ exportService: ExportService;
255
+
256
+ setAccessToken(token: AccessToken): void;
257
+ getAccessToken(): AccessToken | null;
258
+
259
+ setTokenType(tokenType: AccessTokenType): void;
260
+ getTokenType(): AccessTokenType | null;
261
+
262
+ setAccessTokenAndType(token: AccessToken, tokenType: AccessTokenType): void;
263
+ getAccessTokenAndType(): { token: AccessToken | null, tokenType: AccessTokenType | null };
264
+
265
+ setTeamSlug(slug: TeamSlug): void;
266
+ getCache(): IDBCache;
267
+ }
268
+ }