@buerli.io/headless 0.13.1-beta.7.apiversion → 0.13.1-beta.8.apiversion

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.
@@ -25,7 +25,7 @@ const createRecursiveBufferGeometry = async (object, drawingId, bufferGeomArray)
25
25
  const tree = cDrawing.structure.tree;
26
26
  if (object.link || object.solids) {
27
27
  // Part
28
- const baseModeler = (0, classcad_1.api)(drawingId).v0.baseModeler;
28
+ const baseModeler = (0, classcad_1.createApi)(drawingId).v0.baseModeler;
29
29
  const solids = object.link ? tree[object.link].solids : object.solids;
30
30
  if (solids != undefined) {
31
31
  let geometries = [];
@@ -81,7 +81,7 @@ const createRecursiveScene = async (object, drawingId, root, result, options) =>
81
81
  const tree = cDrawing.structure.tree;
82
82
  if (object.link || object.solids) {
83
83
  // Part
84
- const baseModeler = (0, classcad_1.api)(drawingId).v0.baseModeler;
84
+ const baseModeler = (0, classcad_1.createApi)(drawingId).v0.baseModeler;
85
85
  const entities = object.link ? tree[object.link].solids : object.solids;
86
86
  if (entities != undefined) {
87
87
  const part = new three_1.Group();
@@ -222,11 +222,11 @@ class History {
222
222
  }
223
223
  init(callback) {
224
224
  const promise = new Promise(async (resolve, reject) => {
225
- const drawingId = await classcad_1.Connection.create();
225
+ const drawingId = await classcad_1.BuerliCadFacade.utils.connect('history');
226
226
  if (!drawingId)
227
227
  throw new Error('Connection/Drawing could not be created');
228
228
  this.drawingId = drawingId;
229
- const cc = (0, classcad_1.api)(drawingId);
229
+ const cc = (0, classcad_1.createApi)(drawingId);
230
230
  const featureAPI = cc.v0.feature;
231
231
  const sketcherAPI = cc.v0.sketcher;
232
232
  const baseModelerAPI = cc.v0.baseModeler;
@@ -1914,7 +1914,7 @@ class History {
1914
1914
  const featureName = name ? name : 'Import';
1915
1915
  const importFeatureId = await featureAPI.createFeature(rPartId, classcad_1.CCClasses.CCImport, featureName);
1916
1916
  if (importFeatureId !== null) {
1917
- const solids = await featureAPI.updateImport(importFeatureId, content, format, featureName);
1917
+ const solids = await featureAPI.updateImport(importFeatureId, content, format.toUpperCase(), featureName);
1918
1918
  if (solids !== null) {
1919
1919
  return importFeatureId;
1920
1920
  }
@@ -198,11 +198,11 @@ class Solid {
198
198
  }
199
199
  init(callback) {
200
200
  const promise = new Promise(async (resolve, reject) => {
201
- const drawingId = await classcad_1.Connection.create('solid');
201
+ const drawingId = await classcad_1.BuerliCadFacade.utils.connect('solid');
202
202
  if (!drawingId)
203
203
  throw new Error('Connection/Drawing could not be created');
204
204
  this.drawingId = drawingId;
205
- const { solid: solidAPI, baseModeler: baseModelerAPI, common: commonAPI } = (0, classcad_1.api)(drawingId).v0;
205
+ const { solid: solidAPI, baseModeler: baseModelerAPI, common: commonAPI } = (0, classcad_1.createApi)(drawingId).v0;
206
206
  await solidAPI.init();
207
207
  const publicApi = {
208
208
  getDrawingId: () => drawingId,
@@ -6,7 +6,7 @@ var __asyncValues = (this && this.__asyncValues) || function (o) {
6
6
  function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
7
7
  };
8
8
  /* eslint-disable max-lines */
9
- import { api as ccApi, CCClasses, ccUtils, DataType, SVGModusType, Connection, } from '@buerli.io/classcad';
9
+ import { createApi, CCClasses, ccUtils, DataType, SVGModusType, BuerliCadFacade, } from '@buerli.io/classcad';
10
10
  import { api, getDrawing, MathUtils, BuerliScope, createInfo, Measure, } from '@buerli.io/core';
11
11
  import { Group, Matrix4, Mesh, MeshStandardMaterial, Scene } from 'three';
12
12
  import { mergeBufferGeometries } from 'three-stdlib';
@@ -22,7 +22,7 @@ const createRecursiveBufferGeometry = async (object, drawingId, bufferGeomArray)
22
22
  const tree = cDrawing.structure.tree;
23
23
  if (object.link || object.solids) {
24
24
  // Part
25
- const baseModeler = ccApi(drawingId).v0.baseModeler;
25
+ const baseModeler = createApi(drawingId).v0.baseModeler;
26
26
  const solids = object.link ? tree[object.link].solids : object.solids;
27
27
  if (solids != undefined) {
28
28
  let geometries = [];
@@ -78,7 +78,7 @@ const createRecursiveScene = async (object, drawingId, root, result, options) =>
78
78
  const tree = cDrawing.structure.tree;
79
79
  if (object.link || object.solids) {
80
80
  // Part
81
- const baseModeler = ccApi(drawingId).v0.baseModeler;
81
+ const baseModeler = createApi(drawingId).v0.baseModeler;
82
82
  const entities = object.link ? tree[object.link].solids : object.solids;
83
83
  if (entities != undefined) {
84
84
  const part = new Group();
@@ -219,11 +219,11 @@ export class History {
219
219
  }
220
220
  init(callback) {
221
221
  const promise = new Promise(async (resolve, reject) => {
222
- const drawingId = await Connection.create();
222
+ const drawingId = await BuerliCadFacade.utils.connect('history');
223
223
  if (!drawingId)
224
224
  throw new Error('Connection/Drawing could not be created');
225
225
  this.drawingId = drawingId;
226
- const cc = ccApi(drawingId);
226
+ const cc = createApi(drawingId);
227
227
  const featureAPI = cc.v0.feature;
228
228
  const sketcherAPI = cc.v0.sketcher;
229
229
  const baseModelerAPI = cc.v0.baseModeler;
@@ -1911,7 +1911,7 @@ export class History {
1911
1911
  const featureName = name ? name : 'Import';
1912
1912
  const importFeatureId = await featureAPI.createFeature(rPartId, CCClasses.CCImport, featureName);
1913
1913
  if (importFeatureId !== null) {
1914
- const solids = await featureAPI.updateImport(importFeatureId, content, format, featureName);
1914
+ const solids = await featureAPI.updateImport(importFeatureId, content, format.toUpperCase(), featureName);
1915
1915
  if (solids !== null) {
1916
1916
  return importFeatureId;
1917
1917
  }
@@ -6,7 +6,7 @@ var __asyncValues = (this && this.__asyncValues) || function (o) {
6
6
  function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
7
7
  };
8
8
  /* eslint-disable max-lines */
9
- import { api as ccApi, Connection } from '@buerli.io/classcad';
9
+ import { createApi, BuerliCadFacade } from '@buerli.io/classcad';
10
10
  import { api, getDrawing } from '@buerli.io/core';
11
11
  import { Group, Mesh, MeshStandardMaterial, Scene } from 'three';
12
12
  import { mergeBufferGeometries } from 'three-stdlib';
@@ -194,11 +194,11 @@ export class Solid {
194
194
  }
195
195
  init(callback) {
196
196
  const promise = new Promise(async (resolve, reject) => {
197
- const drawingId = await Connection.create('solid');
197
+ const drawingId = await BuerliCadFacade.utils.connect('solid');
198
198
  if (!drawingId)
199
199
  throw new Error('Connection/Drawing could not be created');
200
200
  this.drawingId = drawingId;
201
- const { solid: solidAPI, baseModeler: baseModelerAPI, common: commonAPI } = ccApi(drawingId).v0;
201
+ const { solid: solidAPI, baseModeler: baseModelerAPI, common: commonAPI } = createApi(drawingId).v0;
202
202
  await solidAPI.init();
203
203
  const publicApi = {
204
204
  getDrawingId: () => drawingId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buerli.io/headless",
3
- "version": "0.13.1-beta.7.apiversion",
3
+ "version": "0.13.1-beta.8.apiversion",
4
4
  "description": "A non-manifold CAD workflow for the web",
5
5
  "author": "AWV Informatik AG <info@awv-informatik.ch>",
6
6
  "license": "ISC",
@@ -32,7 +32,7 @@
32
32
  "three-stdlib": ">=2.11.0"
33
33
  },
34
34
  "dependencies": {
35
- "@buerli.io/classcad": "0.13.1-beta.7.apiversion",
35
+ "@buerli.io/classcad": "0.13.1-beta.8.apiversion",
36
36
  "flat-promise": "^1.0.3"
37
37
  }
38
38
  }