@dvelop-sdk/business-objects 1.0.0-beta.5 → 1.0.2

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
@@ -9,7 +9,7 @@
9
9
  <a href="https://github.com/d-velop/dvelop-sdk-node">
10
10
  <img alt="GitHub" src="https://img.shields.io/badge/GitHub-dvelop--sdk--node-%23ff0844?logo=github&style=for-the-badge">
11
11
  </a>
12
- <a href="https://github.com/d-velop/dvelop-sdk-node/blob/master/LICENSE">
12
+ <a href="https://github.com/d-velop/dvelop-sdk-node/blob/main/LICENSE">
13
13
  <img alt="license" src="https://img.shields.io/github/license/d-velop/dvelop-sdk-node?style=for-the-badge">
14
14
  </a
15
15
 
@@ -17,7 +17,7 @@
17
17
 
18
18
  <p>This package contains functionality for the <a href="https://dv-businessobjects-assets.s3.eu-central-1.amazonaws.com/documentation/latest/business_objects_api.html">BusinessObjects-App</a> in the d.velop cloud.</p>
19
19
 
20
- <a href="https://d-velop.github.io/dvelop-sdk-node/modules/business-objects.html"><strong>Explore the docs »</strong></a>
20
+ <a href="https://d-velop.github.io/dvelop-sdk-node/modules/business_objects.html"><strong>Explore the docs »</strong></a>
21
21
 
22
22
  </br>
23
23
 
@@ -27,4 +27,27 @@
27
27
 
28
28
  <a href="https://github.com/d-velop/dvelop-sdk-node"><strong>Check us out on GitHub »</strong></a>
29
29
 
30
- </div>
30
+ </div>
31
+
32
+ ## A note on datatypes in OData and Javascript
33
+ D.velop BusinessObjects uses OData as data model. When working with BusinessObject Models you can refer to the [propertyType-section](https://dv-businessobjects-assets.s3.eu-central-1.amazonaws.com/documentation/latest/business_objects_api.html#propertytype).
34
+
35
+ BO property type | Javascript type | Example
36
+ --- | --- | ---
37
+ boolean | boolean | true
38
+ string | string | "Hi it's me string"
39
+ `list<string>` | Array | ["Hi", "it's", "me", "list"]
40
+ guid | string | "ED7BA470-8E54-465E-825C-99712043E01C"
41
+ date | string | "2011-04-17"
42
+ dateTimeOffset | string | "2011-04-17T20:00:00.000Z"
43
+ single | number* | 3.14159
44
+ double | number* | 3.14159
45
+ decimal | number* | 3.14159
46
+ int16 | number* | 42
47
+ int32 | number* | 42
48
+ int64 | number* | 42
49
+ byte | number | 255
50
+ sByte | number | -8
51
+ binary | string | "23ABFF"
52
+
53
+ _* When working with numbers please mind [Javascript Numbers](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)_
@@ -2,7 +2,7 @@ import { DvelopContext } from "@dvelop-sdk/core";
2
2
  import { HttpConfig, HttpResponse } from "../../utils/http";
3
3
  /**
4
4
  * Parameters for the {@link getBoEntities}-function.
5
- * @category Entities
5
+ * @category Entity
6
6
  */
7
7
  export interface GetBoEntitiesParams {
8
8
  /** Name of the model */
@@ -14,14 +14,14 @@ export interface GetBoEntitiesParams {
14
14
  * Default transform-function provided to the {@link getBoEntities}-function. See [Advanced Topics](https://github.com/d-velop/dvelop-sdk-node#advanced-topics) for more information.
15
15
  * @template E Return type
16
16
  * @internal
17
- * @category Entities
17
+ * @category Entity
18
18
  */
19
19
  export declare function _getBoEntitiesDefaultTransformFunction<E>(response: HttpResponse, _: DvelopContext, __: GetBoEntitiesParams): E[];
20
20
  /**
21
21
  * Factory for {@link getBoEntities}-function. See [Advanced Topics](https://github.com/d-velop/dvelop-sdk-node#advanced-topics) for more information.
22
22
  * @template E Return type of the {@link getBoEntities}-function. A corresponding transformFunction has to be supplied.
23
23
  * @internal
24
- * @category Entities
24
+ * @category Entity
25
25
  */
26
26
  export declare function _getBoEntitiesFactory<E>(httpRequestFunction: (context: DvelopContext, config: HttpConfig) => Promise<HttpResponse>, transformFunction: (response: HttpResponse, context: DvelopContext, params: GetBoEntitiesParams) => E[]): (context: DvelopContext, params: GetBoEntitiesParams) => Promise<E[]>;
27
27
  /**
@@ -42,7 +42,7 @@ var http_1 = require("../../utils/http");
42
42
  * Default transform-function provided to the {@link getBoEntities}-function. See [Advanced Topics](https://github.com/d-velop/dvelop-sdk-node#advanced-topics) for more information.
43
43
  * @template E Return type
44
44
  * @internal
45
- * @category Entities
45
+ * @category Entity
46
46
  */
47
47
  function _getBoEntitiesDefaultTransformFunction(response, _, __) {
48
48
  return response.data.value;
@@ -52,7 +52,7 @@ exports._getBoEntitiesDefaultTransformFunction = _getBoEntitiesDefaultTransformF
52
52
  * Factory for {@link getBoEntities}-function. See [Advanced Topics](https://github.com/d-velop/dvelop-sdk-node#advanced-topics) for more information.
53
53
  * @template E Return type of the {@link getBoEntities}-function. A corresponding transformFunction has to be supplied.
54
54
  * @internal
55
- * @category Entities
55
+ * @category Entity
56
56
  */
57
57
  function _getBoEntitiesFactory(httpRequestFunction, transformFunction) {
58
58
  var _this = this;
@@ -1 +1 @@
1
- {"version":3,"file":"get-entity.d.ts","sourceRoot":"","sources":["../../../src/entities/get-entity/get-entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,YAAY,EAA+B,MAAM,kBAAkB,CAAC;AAEzF;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,wBAAwB;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,0DAA0D;IAC1D,gBAAgB,EAAE,MAAM,CAAC;IACzB,+BAA+B;IAC/B,eAAe,EAAE,QAAQ,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC9C,iDAAiD;IACjD,gBAAgB,EAAE,MAAM,GAAG,MAAM,CAAC;CACnC;AAED;;;;;GAKG;AACH,wBAAgB,oCAAoC,CAAC,CAAC,GAAG,GAAG,EAAE,QAAQ,EAAE,YAAY,EAAE,CAAC,EAAE,aAAa,EAAE,EAAE,EAAE,iBAAiB,GAAG,CAAC,CAGhI;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EACnC,mBAAmB,EAAE,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,KAAK,OAAO,CAAC,YAAY,CAA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OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,iBAAiB,KAAK,CAAC,GAClG,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,iBAAiB,KAAK,OAAO,CAAC,CAAC,CAAC,CAiBnE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAEH,wBAAsB,WAAW,CAAC,CAAC,GAAG,GAAG,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,CAAC,CAAC,CAExG"}
@@ -45,7 +45,10 @@ var http_1 = require("../../utils/http");
45
45
  * @category Entity
46
46
  */
47
47
  function _getBoEntityDefaultTransformFunction(response, _, __) {
48
- // TODO: delete @odata.context!
48
+ var entity = response.data;
49
+ if (typeof entity === "object" && entity["@odata.context"]) {
50
+ delete entity["@odata.context"];
51
+ }
49
52
  return response.data;
50
53
  }
51
54
  exports._getBoEntityDefaultTransformFunction = _getBoEntityDefaultTransformFunction;
@@ -1 +1 @@
1
- {"version":3,"file":"get-entity.js","sourceRoot":"","sources":["../../../src/entities/get-entity/get-entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,yCAAyF;AAiBzF;;;;;GAKG;AACH,SAAgB,oCAAoC,CAAU,QAAsB,EAAE,CAAgB,EAAE,EAAqB;IAC3H,+BAA+B;IAC/B,OAAO,QAAQ,CAAC,IAAI,CAAC;AACvB,CAAC;AAHD,oFAGC;AAED;;;;;GAKG;AACH,SAAgB,mBAAmB,CACjC,mBAA0F,EAC1F,iBAAmG;IAFrG,iBAoBC;IAhBC,OAAO,UAAO,OAAsB,EAAE,MAAyB;;;;;oBAG7D,IAAI,MAAM,CAAC,eAAe,KAAK,QAAQ,IAAI,MAAM,CAAC,eAAe,KAAK,MAAM,EAAE;wBAC5E,iBAAiB,GAAG,MAAM,CAAC,gBAAgB,CAAC;qBAC7C;yBAAM;wBACL,iBAAiB,GAAG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7D,IAAI,MAAM,CAAC,eAAe,KAAK,QAAQ,IAAI,MAAM,CAAC,eAAe,KAAK,MAAM,EAAE;wBAC5E,iBAAiB,GAAG,MAAM,CAAC,gBAAgB,CAAC;qBAC7C;yBAAM;wBACL,iBAAiB,GAAG,MAAI,MAAM,CAAC,gBAAgB,MAAG,CAAC;qBACpD;oBAEgB,qBAAM,mBAAmB,CAAC,OAAO,EAAE;4BAClD,MAAM,EAAE,KAAK;4BACb,GAAG,EAAE,6BAA2B,MAAM,CAAC,SAAS,SAAI,MAAM,CAAC,gBAAgB,SAAI,iBAAiB,MAAG;yBACpG,CAAC,EAAA;;oBAHI,QAAQ,GAAG,SAGf;oBAEF,sBAAO,iBAAiB,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,EAAC;;;SACrD,CAAC;AACJ,CAAC;AApBD,kDAoBC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,0BAA0B;AAC1B,SAAsB,WAAW,CAAU,OAAsB,EAAE,MAAyB;;;;wBACnF,qBAAM,mBAAmB,CAAI,kCAA2B,EAAE,oCAAoC,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,EAAA;wBAAvH,sBAAO,SAAgH,EAAC;;;;CACzH;AAFD,kCAEC"}
@@ -58,7 +58,7 @@ function _updateBoEntityFactory(httpRequestFunction, transformFunction) {
58
58
  urlEntityKeyValue = "'" + params.keyPropertyValue + "'";
59
59
  }
60
60
  return [4 /*yield*/, httpRequestFunction(context, {
61
- method: "PUT",
61
+ method: "PATCH",
62
62
  url: "/businessobjects/custom/" + params.modelName + "/" + params.pluralEntityName + "(" + urlEntityKeyValue + ")",
63
63
  data: params.entityChange
64
64
  })];
@@ -1 +1 @@
1
- {"version":3,"file":"update-entity.js","sourceRoot":"","sources":["../../../src/entities/update-entity/update-entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,yCAAyF;AAo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AAsB,EAAE,MAA+B;;;;;oBAGnE,IAAI,MAAM,CAAC,eAAe,KAAK,QAAQ,IAAI,MAAM,CAAC,eAAe,KAAK,MAAM,EAAE;wBAC5E,iBAAiB,GAAG,MAAM,CAAC,gBAAgB,CAAC;qBAC7C;yBAAM;wBACL,iBAAiB,GAAG,MAAI,MAAM,CAAC,gBAAgB,MAAG,CAAC;qBACpD;oBAEgB,qBAAM,mBAAmB,CAAC,OAAO,EAAE;4BAClD,MAAM,EAAE,OAAO;4BACf,GAAG,EAAE,6BAA2B,MAAM,CAAC,SAAS,SAAI,MAAM,CAAC,gBAAgB,SAAI,iBAAiB,MAAG;4BACnG,IAAI,EAAE,MAAM,CAAC,YAAY;yBAC1B,CAAC,EAAA;;oBAJI,QAAQ,GAAG,SAIf;oBAEF,sBAAO,iBAAiB,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,EAAC;;;SACrD,CAAC;AACJ,CAAC;AArBD,wDAqBC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,0BAA0B;AAC1B,SAAsB,cAAc,CAAU,OAAsB,EAAE,MAA+B;;;;wBAC5F,qBAAM,sBAAsB,CAAU,kCAA2B,EAAE,cAAQ,CAAC,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,EAAA;wBAArG,sBAAO,SAA8F,EAAC;;;;CACvG;AAFD,wCAEC"}
package/lib/index.d.ts CHANGED
@@ -10,7 +10,7 @@
10
10
  <a href="https://github.com/d-velop/dvelop-sdk-node">
11
11
  <img alt="GitHub" src="https://img.shields.io/badge/GitHub-dvelop--sdk--node-%23ff0844?logo=github&style=for-the-badge">
12
12
  </a>
13
- <a href="https://github.com/d-velop/dvelop-sdk-node/blob/master/LICENSE">
13
+ <a href="https://github.com/d-velop/dvelop-sdk-node/blob/main/LICENSE">
14
14
  <img alt="license" src="https://img.shields.io/github/license/d-velop/dvelop-sdk-node?style=for-the-badge">
15
15
  </a
16
16
  </br>
package/lib/index.js CHANGED
@@ -11,7 +11,7 @@
11
11
  <a href="https://github.com/d-velop/dvelop-sdk-node">
12
12
  <img alt="GitHub" src="https://img.shields.io/badge/GitHub-dvelop--sdk--node-%23ff0844?logo=github&style=for-the-badge">
13
13
  </a>
14
- <a href="https://github.com/d-velop/dvelop-sdk-node/blob/master/LICENSE">
14
+ <a href="https://github.com/d-velop/dvelop-sdk-node/blob/main/LICENSE">
15
15
  <img alt="license" src="https://img.shields.io/github/license/d-velop/dvelop-sdk-node?style=for-the-badge">
16
16
  </a
17
17
  </br>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dvelop-sdk/business-objects",
3
3
  "description": "This package contains functionality for the BusinessObjects-App in the d.velop cloud.",
4
- "version": "1.0.0-beta.5",
4
+ "version": "1.0.2",
5
5
  "license": "Apache-2.0",
6
6
  "main": "lib/index.js",
7
7
  "types": "lib/index.d.ts",
@@ -25,4 +25,4 @@
25
25
  "dependencies": {
26
26
  "@dvelop-sdk/core": "^2.0.0"
27
27
  }
28
- }
28
+ }