@dvelop-sdk/business-objects 1.0.0-beta.2 → 1.0.0-beta.3

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.
@@ -2,23 +2,30 @@ import { DvelopContext, DvelopHttpResponse as HttpResponse } from "@dvelop-sdk/c
2
2
  import { HttpConfig } from "../../utils/http";
3
3
  /**
4
4
  * Parameters for the {@link createBoEntity}-function.
5
+ * @template E Type for Entity. Defaults to `any`.
5
6
  * @category Entity
6
7
  */
7
- export interface CreateBoEntityParams {
8
+ export interface CreateBoEntityParams<E = any> {
9
+ /** Name of the model */
8
10
  modelName: string;
11
+ /** EntityName in plural (**Singular name won't work**) */
9
12
  pluralEntityName: string;
10
- entity: Object;
13
+ /** Entity to be created*/
14
+ entity: E;
11
15
  }
12
16
  /**
13
17
  * Factory for {@link createBoEntity}-function. See [Advanced Topics](https://github.com/d-velop/dvelop-sdk-node#advanced-topics) for more information.
14
- * @typeparam
18
+ * @template E Type for Entity to be created.
19
+ * @template R Return type of the {@link createBoEntity}-function. A corresponding transformFunction has to be supplied.
15
20
  * @internal
16
21
  * @category Entity
17
22
  */
18
- export declare function _createBoEntityFactory(httpRequestFunction: (context: DvelopContext, config: HttpConfig) => Promise<HttpResponse>, transformFunction: (response: HttpResponse, context: DvelopContext, params: CreateBoEntityParams) => void): (context: DvelopContext, params: CreateBoEntityParams) => Promise<void>;
23
+ export declare function _createBoEntityFactory<E, R>(httpRequestFunction: (context: DvelopContext, config: HttpConfig) => Promise<HttpResponse>, transformFunction: (response: HttpResponse, context: DvelopContext, params: CreateBoEntityParams<E>) => R): (context: DvelopContext, params: CreateBoEntityParams<E>) => Promise<R>;
19
24
  /**
20
25
  * Create a business object entity.
26
+ * @template E Type for Entity. Defaults to `any`.
21
27
  *
28
+ * @example
22
29
  * ```typescript
23
30
  * import { createBoEntity } from "@dvelop-sdk/business-objects";
24
31
  *
@@ -36,8 +43,11 @@ export declare function _createBoEntityFactory(httpRequestFunction: (context: Dv
36
43
  * }
37
44
  * });
38
45
  * ```
39
- * ---
46
+ * ---
47
+ *
40
48
  * You can also write your own function, for example to get a notification, if the entity was successfully created.
49
+ * @example
50
+ * ```typescript
41
51
  * import { createBoEntity } from "@dvelop-sdk/business-objects";
42
52
  *
43
53
  * const myCreateFunction = _createBoEntityFactory(_defaultHttpRequestFunction, (response:HttpResponse)=> {
@@ -62,5 +72,5 @@ export declare function _createBoEntityFactory(httpRequestFunction: (context: Dv
62
72
  * console.log(responseMessage); // Entity created successfully.
63
73
  * ```
64
74
  */
65
- export declare function createBoEntity(context: DvelopContext, params: CreateBoEntityParams): Promise<void>;
75
+ export declare function createBoEntity<E = any>(context: DvelopContext, params: CreateBoEntityParams<E>): Promise<void>;
66
76
  //# sourceMappingURL=create-entity.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-entity.d.ts","sourceRoot":"","sources":["../../../src/entities/create-entity/create-entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,kBAAkB,IAAI,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrF,OAAO,EAAE,UAAU,EAA+B,MAAM,kBAAkB,CAAC;AAE3E;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;CAClB;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,mBAAmB,EAAE,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,KAAK,OAAO,CAAC,YAAY,CAAC,EAC1F,iBAAiB,EAAE,CAAC,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,oBAAoB,KAAK,IAAI,GACxG,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,oBAAoB,KAAK,OAAO,CAAC,IAAI,CAAC,CAWzE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAEH,wBAAsB,cAAc,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAExG"}
1
+ {"version":3,"file":"create-entity.d.ts","sourceRoot":"","sources":["../../../src/entities/create-entity/create-entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,kBAAkB,IAAI,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrF,OAAO,EAAE,UAAU,EAA+B,MAAM,kBAAkB,CAAC;AAE3E;;;;GAIG;AACH,MAAM,WAAW,oBAAoB,CAAC,CAAC,GAAG,GAAG;IAC3C,wBAAwB;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,0DAA0D;IAC1D,gBAAgB,EAAE,MAAM,CAAC;IACzB,0BAA0B;IAC1B,MAAM,EAAE,CAAC,CAAC;CACX;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,EAAE,CAAC,EACzC,mBAAmB,EAAE,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,KAAK,OAAO,CAAC,YAAY,CAAC,EAC1F,iBAAiB,EAAE,CAAC,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,oBAAoB,CAAC,CAAC,CAAC,KAAK,CAAC,GACxG,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,oBAAoB,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,CAWzE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AAEH,wBAAsB,cAAc,CAAC,CAAC,GAAG,GAAG,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,oBAAoB,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAEpH"}
@@ -40,7 +40,8 @@ exports.createBoEntity = exports._createBoEntityFactory = void 0;
40
40
  var http_1 = require("../../utils/http");
41
41
  /**
42
42
  * Factory for {@link createBoEntity}-function. See [Advanced Topics](https://github.com/d-velop/dvelop-sdk-node#advanced-topics) for more information.
43
- * @typeparam
43
+ * @template E Type for Entity to be created.
44
+ * @template R Return type of the {@link createBoEntity}-function. A corresponding transformFunction has to be supplied.
44
45
  * @internal
45
46
  * @category Entity
46
47
  */
@@ -65,7 +66,9 @@ function _createBoEntityFactory(httpRequestFunction, transformFunction) {
65
66
  exports._createBoEntityFactory = _createBoEntityFactory;
66
67
  /**
67
68
  * Create a business object entity.
69
+ * @template E Type for Entity. Defaults to `any`.
68
70
  *
71
+ * @example
69
72
  * ```typescript
70
73
  * import { createBoEntity } from "@dvelop-sdk/business-objects";
71
74
  *
@@ -83,8 +86,11 @@ exports._createBoEntityFactory = _createBoEntityFactory;
83
86
  * }
84
87
  * });
85
88
  * ```
86
- * ---
89
+ * ---
90
+ *
87
91
  * You can also write your own function, for example to get a notification, if the entity was successfully created.
92
+ * @example
93
+ * ```typescript
88
94
  * import { createBoEntity } from "@dvelop-sdk/business-objects";
89
95
  *
90
96
  * const myCreateFunction = _createBoEntityFactory(_defaultHttpRequestFunction, (response:HttpResponse)=> {
@@ -1 +1 @@
1
- {"version":3,"file":"create-entity.js","sourceRoot":"","sources":["../../../src/entities/create-entity/create-entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,yCAA2E;AAY3E;;;;;GAKG;AACH,SAAgB,sBAAsB,CACpC,mBAA0F,EAC1F,iBAAyG;IAF3G,iBAcC;IAVC,OAAO,UAAO,OAAsB,EAAE,MAA4B;;;;wBAE/C,qBAAM,mBAAmB,CAAC,OAAO,EAAE;wBAClD,MAAM,EAAE,MAAM;wBACd,GAAG,EAAE,6BAA2B,MAAM,CAAC,SAAS,SAAI,MAAM,CAAC,gBAAkB;wBAC7E,IAAI,EAAE,MAAM,CAAC,MAAM;qBACpB,CAAC,E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OAAO,EAAE,MAAM,CAAC,EAAA;wBAArG,sBAAO,SAA8F,EAAC;;;;CACvG;AAFD,wCAEC"}
@@ -5,20 +5,24 @@ import { HttpConfig } from "../../utils/http";
5
5
  * @category Entity
6
6
  */
7
7
  export interface DeleteBoEntityParams {
8
+ /** Name of the model */
8
9
  modelName: string;
10
+ /** EntityName in plural (**Singular name won't work**) */
9
11
  pluralEntityName: string;
12
+ /** Value for the key-property of the entity */
10
13
  entityKeyValue: string | number;
11
14
  }
12
15
  /**
13
16
  * Factory for {@link deleteBoEntity}-function. See [Advanced Topics](https://github.com/d-velop/dvelop-sdk-node#advanced-topics) for more information.
14
- * @typeparam
17
+ * @template E Return type of the {@link deleteBoEntity}-function. A corresponding transformFunction has to be supplied.
15
18
  * @internal
16
19
  * @category Entity
17
20
  */
18
- export declare function _deleteBoEntityFactory(httpRequestFunction: (context: DvelopContext, config: HttpConfig) => Promise<HttpResponse>, transformFunction: (response: HttpResponse, context: DvelopContext, params: DeleteBoEntityParams) => void): (context: DvelopContext, params: DeleteBoEntityParams) => Promise<void>;
21
+ export declare function _deleteBoEntityFactory<T>(httpRequestFunction: (context: DvelopContext, config: HttpConfig) => Promise<HttpResponse>, transformFunction: (response: HttpResponse, context: DvelopContext, params: DeleteBoEntityParams) => T): (context: DvelopContext, params: DeleteBoEntityParams) => Promise<T>;
19
22
  /**
20
23
  * Delete a business object entity.
21
24
  *
25
+ * @example
22
26
  * ```typescript
23
27
  * import { deleteBoEntity } from "@dvelop-sdk/business-objects";
24
28
  *
@@ -33,6 +37,9 @@ export declare function _deleteBoEntityFactory(httpRequestFunction: (context: Dv
33
37
  * ```
34
38
  * ---
35
39
  * You can also write your own function, for example to get a notification, if the entity requested for deletion doesn't exist.
40
+ *
41
+ * @example
42
+ * ```typescript
36
43
  * import { deleteBoEntity } from "@dvelop-sdk/business-objects";
37
44
  *
38
45
  * const myDeleteFunction = _deleteBoEntityFactory(_defaultHttpRequestFunction, (response:HttpResponse)=> {
@@ -1 +1 @@
1
- {"version":3,"file":"delete-entity.d.ts","sourceRoot":"","sources":["../../../src/entities/delete-entity/delete-entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,kBAAkB,IAAI,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrF,OAAO,EAAE,UAAU,EAA+B,MAAM,kBAAkB,CAAC;AAE3E;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,MAAM,GAAC,MAAM,CAAC;CACjC;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,mBAAmB,EAAE,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,KAAK,OAAO,CAAC,YAAY,CAAC,EAC1F,iBAAiB,EAAE,CAAC,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,oBAAoB,KAAK,IAAI,GACxG,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,oBAAoB,KAAK,OAAO,CAAC,IAAI,CAAC,CAiBzE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,wBAAsB,cAAc,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAExG"}
1
+ {"version":3,"file":"delete-entity.d.ts","sourceRoot":"","sources":["../../../src/entities/delete-entity/delete-entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,kBAAkB,IAAI,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrF,OAAO,EAAE,UAAU,EAA+B,MAAM,kBAAkB,CAAC;AAE3E;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,wBAAwB;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,0DAA0D;IAC1D,gBAAgB,EAAE,MAAM,CAAC;IACzB,+CAA+C;IAC/C,cAAc,EAAE,MAAM,GAAG,MAAM,CAAC;CACjC;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,EACtC,mBAAmB,EAAE,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,KAAK,OAAO,CAAC,YAAY,CAAC,EAC1F,iBAAiB,EAAE,CAAC,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,oBAAoB,KAAK,CAAC,GACrG,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,oBAAoB,KAAK,OAAO,CAAC,CAAC,CAAC,CAiBtE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,wBAAsB,cAAc,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAExG"}
@@ -40,7 +40,7 @@ exports.deleteBoEntity = exports._deleteBoEntityFactory = void 0;
40
40
  var http_1 = require("../../utils/http");
41
41
  /**
42
42
  * Factory for {@link deleteBoEntity}-function. See [Advanced Topics](https://github.com/d-velop/dvelop-sdk-node#advanced-topics) for more information.
43
- * @typeparam
43
+ * @template E Return type of the {@link deleteBoEntity}-function. A corresponding transformFunction has to be supplied.
44
44
  * @internal
45
45
  * @category Entity
46
46
  */
@@ -72,6 +72,7 @@ exports._deleteBoEntityFactory = _deleteBoEntityFactory;
72
72
  /**
73
73
  * Delete a business object entity.
74
74
  *
75
+ * @example
75
76
  * ```typescript
76
77
  * import { deleteBoEntity } from "@dvelop-sdk/business-objects";
77
78
  *
@@ -86,6 +87,9 @@ exports._deleteBoEntityFactory = _deleteBoEntityFactory;
86
87
  * ```
87
88
  * ---
88
89
  * You can also write your own function, for example to get a notification, if the entity requested for deletion doesn't exist.
90
+ *
91
+ * @example
92
+ * ```typescript
89
93
  * import { deleteBoEntity } from "@dvelop-sdk/business-objects";
90
94
  *
91
95
  * const myDeleteFunction = _deleteBoEntityFactory(_defaultHttpRequestFunction, (response:HttpResponse)=> {
@@ -1 +1 @@
1
- {"version":3,"file":"delete-entity.js","sourceRoot":"","sources":["../../../src/entities/delete-entity/delete-entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,yCAA2E;AAY3E;;;;;GAKG;AACH,SAAgB,sBAAsB,CACpC,mBAA0F,EAC1F,iBAAyG;IAF3G,iBAoBC;IAhBC,OAAO,UAAO,OAAsB,EAAE,MAA4B;;;;;oBAGhE,IAAG,OAAO,MAAM,CAAC,cAAc,KAAK,QAAQ,EAAE;wBAC5C,iBAAiB,GAAG,MAAM,CAAC,cAAc,CAAC;qBAC3C;yBAAM;wBACL,iBAAiB,GAAG,MAAI,MAAM,CAAC,cAAc,MAAG,CAAC;qBAClD;oBAEgB,qBAAM,mBAAmB,CAAC,OAAO,EAAE;4BAClD,MAAM,EAAE,QAAQ;4BAChB,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,wDAoBC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,0BAA0B;AAC1B,SAAsB,cAAc,CAAC,OAAsB,EAAE,MAA4B;;;;wBAChF,qBAAM,sBAAsB,CAAC,kCAA2B,EAAE,cAAK,CAAC,CAAC,CAAE,OAAO,EAAE,MAAM,CAAC,EAAA;wBAA1F,sBAAO,SAAmF,EAAC;;;;CAC5F;AAFD,wCAEC"}
1
+ {"version":3,"file":"delete-entity.js","sourceRoot":"","sources":["../../../src/entities/delete-entity/delete-entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,yCAA2E;AAe3E;;;;;GAKG;AACH,SAAgB,sBAAsB,CACpC,mBAA0F,EAC1F,iBAAsG;IAFxG,iBAoBC;IAhBC,OAAO,UAAO,OAAsB,EAAE,MAA4B;;;;;oBAGhE,IAAI,OAAO,MAAM,CAAC,cAAc,KAAK,QAAQ,EAAE;wBAC7C,iBAAiB,GAAG,MAAM,CAAC,cAAc,CAAC;qBAC3C;yBAAM;wBACL,iBAAiB,GAAG,MAAI,MAAM,CAAC,cAAc,MAAG,CAAC;qBAClD;oBAEgB,qBAAM,mBAAmB,CAAC,OAAO,EAAE;4BAClD,MAAM,EAAE,QAAQ;4BAChB,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,wDAoBC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,0BAA0B;AAC1B,SAAsB,cAAc,CAAC,OAAsB,EAAE,MAA4B;;;;wBAChF,qBAAM,sBAAsB,CAAC,kCAA2B,EAAE,cAAQ,CAAC,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,EAAA;wBAA5F,sBAAO,SAAqF,EAAC;;;;CAC9F;AAFD,wCAEC"}
@@ -7,25 +7,28 @@ import { HttpConfig, HttpResponse } from "../../utils/http";
7
7
  export interface GetBoEntitiesParams {
8
8
  /** Name of the model */
9
9
  modelName: string;
10
- /** EntityName in plural (**regular won't work**) */
10
+ /** EntityName in plural (**Singular name won't work**) */
11
11
  pluralEntityName: string;
12
12
  }
13
13
  /**
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
+ * @template E Return type
15
16
  * @internal
16
17
  * @category Entities
17
18
  */
18
- export declare function _getBoEntitiesDefaultTransformFunction<T>(response: HttpResponse, _: DvelopContext, __: GetBoEntitiesParams): T[];
19
+ export declare function _getBoEntitiesDefaultTransformFunction<E>(response: HttpResponse, _: DvelopContext, __: GetBoEntitiesParams): E[];
19
20
  /**
20
21
  * Factory for {@link getBoEntities}-function. See [Advanced Topics](https://github.com/d-velop/dvelop-sdk-node#advanced-topics) for more information.
21
- * @typeparam T Return type of the getBoEntities-function. A corresponding transformFuntion has to be supplied.
22
+ * @template E Return type of the {@link getBoEntities}-function. A corresponding transformFunction has to be supplied.
22
23
  * @internal
23
24
  * @category Entities
24
25
  */
25
- export declare function _getBoEntitiesFactory<T>(httpRequestFunction: (context: DvelopContext, config: HttpConfig) => Promise<HttpResponse>, transformFunction: <T>(response: HttpResponse, context: DvelopContext, params: GetBoEntitiesParams) => T[]): (context: DvelopContext, params: GetBoEntitiesParams) => Promise<T[]>;
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[]>;
26
27
  /**
27
28
  * Returns all specified entities from a model.
29
+ * @template E Type for Entity. Defaults to `any`.
28
30
  *
31
+ * @example
29
32
  * ```typescript
30
33
  * import { getBoEntities } from "@dvelop-sdk/business-objects";
31
34
  *
@@ -33,12 +36,14 @@ export declare function _getBoEntitiesFactory<T>(httpRequestFunction: (context:
33
36
  * systemBaseUri: "https://sacred-heart-hospital.d-velop.cloud",
34
37
  * authSessionId: "3f3c428d452"
35
38
  * },{
36
- * modelName: "HOSPITALBASEDATA",
37
- * pluralEntityName: "employees",
39
+ * modelName: "HOSPITALBASEDATA",
40
+ * pluralEntityName: "employees",
38
41
  * });
39
42
  * console.log(result); // [{employeeid: '1', firstName: 'John', lastName: 'Dorian', jobTitel: 'senior physician'}, {employeeid: '2', firstName: 'Christopher', lastName: 'Turk', jobTitel: 'chief surgeon'}]
40
43
  * ```
41
44
  * ---
45
+ *
46
+ * @example
42
47
  * You can also use generics:
43
48
  * ```typescript
44
49
  * import { getBoEntities } from "@dvelop-sdk/business-objects";
@@ -62,5 +67,5 @@ export declare function _getBoEntitiesFactory<T>(httpRequestFunction: (context:
62
67
  * // Turk
63
68
  * ```
64
69
  */
65
- export declare function getBoEntities<T = any>(context: DvelopContext, params: GetBoEntitiesParams): Promise<T[]>;
70
+ export declare function getBoEntities<E = any>(context: DvelopContext, params: GetBoEntitiesParams): Promise<E[]>;
66
71
  //# sourceMappingURL=get-entities.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-entities.d.ts","sourceRoot":"","sources":["../../../src/entities/get-entities/get-entities.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,mBAAmB;IAChC,wBAAwB;IACxB,SAAS,EAAC,MAAM,CAAC;IACjB,oDAAoD;IACpD,gBAAgB,EAAC,MAAM,CAAC;CAC3B;AAED;;;;GAIG;AACH,wBAAgB,sCAAsC,CAAC,CAAC,EAAE,QAAQ,EAAE,YAAY,EAAE,CAAC,EAAE,aAAa,EAAE,EAAE,EAAE,mBAAmB,GAAE,CAAC,EAAE,CAE/H;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,EACrC,mBAAmB,EAAE,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,KAAK,OAAO,CAAC,YAAY,CAAC,EAC1F,iBAAiB,EAAE,CAAC,CAAC,EAAG,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,mBAAmB,KAAK,CAAC,EAAE,GAC1G,CAAC,OAA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G,GAAG,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC,CAE9G"}
@@ -40,6 +40,7 @@ exports.getBoEntities = exports._getBoEntitiesFactory = exports._getBoEntitiesDe
40
40
  var http_1 = require("../../utils/http");
41
41
  /**
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
+ * @template E Return type
43
44
  * @internal
44
45
  * @category Entities
45
46
  */
@@ -49,7 +50,7 @@ function _getBoEntitiesDefaultTransformFunction(response, _, __) {
49
50
  exports._getBoEntitiesDefaultTransformFunction = _getBoEntitiesDefaultTransformFunction;
50
51
  /**
51
52
  * Factory for {@link getBoEntities}-function. See [Advanced Topics](https://github.com/d-velop/dvelop-sdk-node#advanced-topics) for more information.
52
- * @typeparam T Return type of the getBoEntities-function. A corresponding transformFuntion has to be supplied.
53
+ * @template E Return type of the {@link getBoEntities}-function. A corresponding transformFunction has to be supplied.
53
54
  * @internal
54
55
  * @category Entities
55
56
  */
@@ -73,7 +74,9 @@ function _getBoEntitiesFactory(httpRequestFunction, transformFunction) {
73
74
  exports._getBoEntitiesFactory = _getBoEntitiesFactory;
74
75
  /**
75
76
  * Returns all specified entities from a model.
77
+ * @template E Type for Entity. Defaults to `any`.
76
78
  *
79
+ * @example
77
80
  * ```typescript
78
81
  * import { getBoEntities } from "@dvelop-sdk/business-objects";
79
82
  *
@@ -81,12 +84,14 @@ exports._getBoEntitiesFactory = _getBoEntitiesFactory;
81
84
  * systemBaseUri: "https://sacred-heart-hospital.d-velop.cloud",
82
85
  * authSessionId: "3f3c428d452"
83
86
  * },{
84
- * modelName: "HOSPITALBASEDATA",
85
- * pluralEntityName: "employees",
87
+ * modelName: "HOSPITALBASEDATA",
88
+ * pluralEntityName: "employees",
86
89
  * });
87
90
  * console.log(result); // [{employeeid: '1', firstName: 'John', lastName: 'Dorian', jobTitel: 'senior physician'}, {employeeid: '2', firstName: 'Christopher', lastName: 'Turk', jobTitel: 'chief surgeon'}]
88
91
  * ```
89
92
  * ---
93
+ *
94
+ * @example
90
95
  * You can also use generics:
91
96
  * ```typescript
92
97
  * import { getBoEntities } from "@dvelop-sdk/business-objects";
@@ -1 +1 @@
1
- {"version":3,"file":"get-entities.js","sourceRoot":"","sources":["../../../src/entities/get-entities/get-entities.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,yCAAyF;AAazF;;;;GAIG;AACH,SAAgB,sCAAsC,CAAI,QAAsB,EAAE,CAAgB,EAAE,EAAuB;IACzH,OAAO,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC;AAC7B,CAAC;AAFD,wFAEC;AAED;;;;;GAKG;AACH,SAAgB,qBAAqB,CACnC,mBAA0F,EAC1F,iBAA2G;IAF7G,iBAaC;IATC,OAAO,UAAO,OAAsB,EAAE,MAA2B;;;;wBAE9C,qBAAM,mBAAmB,CAAC,OAAO,EAAE;wBAClD,MAAM,EAAE,KAAK;wBACb,GAAG,EAAE,6BAA2B,MAAM,CAAC,SAAS,SAAI,MAAM,CAAC,gBAAkB;qBAC9E,CAAC,EAAA;;oBAHI,QAAQ,GAAG,SAGf;oBAEF,sBAAO,iBAAiB,CAAI,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,EAAC;;;SACxD,CAAC;AACJ,CAAC;AAbD,sDAaC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,0BAA0B;AAC1B,SAAsB,aAAa,CAAS,OAAsB,EAAE,MAA2B;;;;wBACtF,qBAAM,qBAAqB,CAAI,kCAA2B,EAAE,sCAAsC,CAAC,CAAE,OAAO,EAAE,MAAM,CAAC,EAAA;wBAA5H,sBAAO,SAAqH,EAAC;;;;CAC9H;AAFD,sCAEC"}
1
+ {"version":3,"file":"get-entities.js","sourceRoot":"","sources":["../../../src/entities/get-entities/get-entities.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,yCAAyF;AAazF;;;;;GAKG;AACH,SAAgB,sCAAsC,CAAI,QAAsB,EAAE,CAAgB,EAAE,EAAuB;IACzH,OAAO,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC;AAC7B,CAAC;AAFD,wFAEC;AAED;;;;;GAKG;AACH,SAAgB,qBAAqB,CACnC,mBAA0F,EAC1F,iBAAuG;IAFzG,iBAaC;IATC,OAAO,UAAO,OAAsB,EAAE,MAA2B;;;;wBAE9C,qBAAM,mBAAmB,CAAC,OAAO,EAAE;wBAClD,MAAM,EAAE,KAAK;wBACb,GAAG,EAAE,6BAA2B,MAAM,CAAC,SAAS,SAAI,MAAM,CAAC,gBAAkB;qBAC9E,CAAC,EAAA;;oBAHI,QAAQ,GAAG,SAGf;oBAEF,sBAAO,iBAAiB,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,EAAC;;;SACrD,CAAC;AACJ,CAAC;AAbD,sDAaC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,0BAA0B;AAC1B,SAAsB,aAAa,CAAU,OAAsB,EAAE,MAA2B;;;;wBACvF,qBAAM,qBAAqB,CAAI,kCAA2B,EAAE,sCAAsC,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,EAAA;wBAA3H,sBAAO,SAAoH,EAAC;;;;CAC7H;AAFD,sCAEC"}
@@ -5,8 +5,11 @@ import { HttpConfig, HttpResponse } from "../../utils/http";
5
5
  * @category Entity
6
6
  */
7
7
  export interface GetBoEntityParams {
8
+ /** Name of the model */
8
9
  modelName: string;
10
+ /** EntityName in plural (**Singular name won't work**) */
9
11
  pluralEntityName: string;
12
+ /** Value for the key-property of the entity */
10
13
  entityKeyValue: string | number;
11
14
  }
12
15
  /**
@@ -17,14 +20,16 @@ export interface GetBoEntityParams {
17
20
  export declare function _getBoEntityDefaultTransformFunction<T extends Object>(response: HttpResponse, _: DvelopContext, __: GetBoEntityParams): T;
18
21
  /**
19
22
  * Factory for {@link getBoEntity}-function. See [Advanced Topics](https://github.com/d-velop/dvelop-sdk-node#advanced-topics) for more information.
20
- * @typeparam T Return type of the getBoEntity-function. A corresponding transformFuntion has to be supplied.
23
+ * @template E Return type of the {@link getBoEntity}-function. A corresponding transformFunction has to be supplied.
21
24
  * @internal
22
25
  * @category Entity
23
26
  */
24
- export declare function _getBoEntityFactory<T>(httpRequestFunction: (context: DvelopContext, config: HttpConfig) => Promise<HttpResponse>, transformFunction: (response: HttpResponse, context: DvelopContext, params: GetBoEntityParams) => T): (context: DvelopContext, params: GetBoEntityParams) => Promise<T>;
27
+ export declare function _getBoEntityFactory<E>(httpRequestFunction: (context: DvelopContext, config: HttpConfig) => Promise<HttpResponse>, transformFunction: (response: HttpResponse, context: DvelopContext, params: GetBoEntityParams) => E): (context: DvelopContext, params: GetBoEntityParams) => Promise<E>;
25
28
  /**
26
29
  * Returns one specified entity from a model.
30
+ * @template E Type for Entity. Defaults to `any`.
27
31
  *
32
+ * @example
28
33
  * ```typescript
29
34
  * import { getBoEntity } from "@dvelop-sdk/business-objects";
30
35
  *
@@ -32,14 +37,15 @@ export declare function _getBoEntityFactory<T>(httpRequestFunction: (context: Dv
32
37
  * systemBaseUri: "https://sacred-heart-hospital.d-velop.cloud",
33
38
  * authSessionId: "3f3c428d452"
34
39
  * },{
35
- * modelName: "HOSPITALBASEDATA",
36
- pluralEntityName: "employees",
37
- entityKeyValue: "1"
40
+ * modelName: "HOSPITALBASEDATA",
41
+ * pluralEntityName: "employees",
42
+ * entityKeyValue: "1"
38
43
  * });
39
- * console.log(result); // {employeeid: '1', firstName: 'John', lastName: 'Dorian', jobTitel: 'senior physician'}
44
+ * console.log(result); // { employeeid: '1', firstName: 'John', lastName: 'Dorian', jobTitel: 'senior physician' }
40
45
  * ```
41
46
  * ---
42
47
  * You can also use generics:
48
+ * @example
43
49
  * ```typescript
44
50
  * import { getBoEntity } from "@dvelop-sdk/business-objects";
45
51
  *
@@ -59,5 +65,5 @@ export declare function _getBoEntityFactory<T>(httpRequestFunction: (context: Dv
59
65
  * console.log(entity.lastName); // Dorian
60
66
  * ```
61
67
  */
62
- export declare function getBoEntity<T>(context: DvelopContext, params: GetBoEntityParams): Promise<T>;
68
+ export declare function getBoEntity<E = any>(context: DvelopContext, params: GetBoEntityParams): Promise<E>;
63
69
  //# sourceMappingURL=get-entity.d.ts.map
@@ -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;IAC9B,SAAS,EAAC,MAAM,CAAC;IACjB,gBAAgB,EAAC,MAAM,CAAC;IACxB,cAAc,EAAC,MAAM,GAAC,MAAM,CAAC;CAChC;AAED;;;;GAIG;AACH,wBAAgB,oCAAoC,CAAE,CAAC,SAAS,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,CAAC,EAAE,aAAa,EAAE,EAAE,EAAE,iBAAiB,GAAG,CAAC,CAG1I;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EACnC,mBAAmB,EAAE,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,KAAK,OAAO,CAAC,YAAY,CAAC,EAC1F,iBAAiB,EAAE,CAAC,QAAQ,EAAE,YAAY,EAAE,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,wBAA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EntityDefaultTransformFunction(response, _, __) {
50
50
  exports._getBoEntityDefaultTransformFunction = _getBoEntityDefaultTransformFunction;
51
51
  /**
52
52
  * Factory for {@link getBoEntity}-function. See [Advanced Topics](https://github.com/d-velop/dvelop-sdk-node#advanced-topics) for more information.
53
- * @typeparam T Return type of the getBoEntity-function. A corresponding transformFuntion has to be supplied.
53
+ * @template E Return type of the {@link getBoEntity}-function. A corresponding transformFunction has to be supplied.
54
54
  * @internal
55
55
  * @category Entity
56
56
  */
@@ -81,7 +81,9 @@ function _getBoEntityFactory(httpRequestFunction, transformFunction) {
81
81
  exports._getBoEntityFactory = _getBoEntityFactory;
82
82
  /**
83
83
  * Returns one specified entity from a model.
84
+ * @template E Type for Entity. Defaults to `any`.
84
85
  *
86
+ * @example
85
87
  * ```typescript
86
88
  * import { getBoEntity } from "@dvelop-sdk/business-objects";
87
89
  *
@@ -89,14 +91,15 @@ exports._getBoEntityFactory = _getBoEntityFactory;
89
91
  * systemBaseUri: "https://sacred-heart-hospital.d-velop.cloud",
90
92
  * authSessionId: "3f3c428d452"
91
93
  * },{
92
- * modelName: "HOSPITALBASEDATA",
93
- pluralEntityName: "employees",
94
- entityKeyValue: "1"
94
+ * modelName: "HOSPITALBASEDATA",
95
+ * pluralEntityName: "employees",
96
+ * entityKeyValue: "1"
95
97
  * });
96
- * console.log(result); // {employeeid: '1', firstName: 'John', lastName: 'Dorian', jobTitel: 'senior physician'}
98
+ * console.log(result); // { employeeid: '1', firstName: 'John', lastName: 'Dorian', jobTitel: 'senior physician' }
97
99
  * ```
98
100
  * ---
99
101
  * You can also use generics:
102
+ * @example
100
103
  * ```typescript
101
104
  * import { getBoEntity } from "@dvelop-sdk/business-objects";
102
105
  *
@@ -1 +1 @@
1
- {"version":3,"file":"get-entity.js","sourceRoot":"","sources":["../../../src/entities/get-entity/get-entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,yCAAyF;AAYzF;;;;GAIG;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,CAAgB,EAAE,EAAqB;IACpI,8BAA8B;IAC9B,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,OAAO,MAAM,CAAC,cAAc,KAAK,QAAQ,EAAE;wBAC7C,iBAAiB,GAAG,MAAM,CAAC,cAAc,CAAC;qBAC3C;yBAAM;wBACL,iBAAiB,GAAG,MAAI,MAAM,CAAC,cAAc,MAAG,CAAC;qBAClD;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;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"}
@@ -2,24 +2,31 @@ import { DvelopContext } from "@dvelop-sdk/core";
2
2
  import { HttpConfig, HttpResponse } from "../../utils/http";
3
3
  /**
4
4
  * Parameters for the {@link updateBoEntity}-function.
5
+ * @template E Type for Entity. Defaults to `any`.
5
6
  * @category Entity
6
7
  */
7
- export interface UpdateBoEntityParams {
8
+ export interface UpdateBoEntityParams<E = any> {
9
+ /** Name of the model */
8
10
  modelName: string;
11
+ /** EntityName in plural (**Singular name won't work**) */
9
12
  pluralEntityName: string;
13
+ /** Value for the key-property of the entity */
10
14
  entityKeyValue: string | number;
11
- entityChange: Object;
15
+ /** [Partial](https://www.typescriptlang.org/docs/handbook/utility-types.html#partialtype) of `E`. Given properties will be updated. */
16
+ entityChange: Partial<E>;
12
17
  }
13
18
  /**
14
19
  * Factory for {@link updateBoEntity}-function. See [Advanced Topics](https://github.com/d-velop/dvelop-sdk-node#advanced-topics) for more information.
15
- * @typeparam
20
+ * @template E Return type of the {@link updateBoEntity}-function. A corresponding transformFunction has to be supplied.
16
21
  * @internal
17
22
  * @category Entity
18
23
  */
19
- export declare function _updateBoEntityFactory(httpRequestFunction: (context: DvelopContext, config: HttpConfig) => Promise<HttpResponse>, transformFunction: (response: HttpResponse, context: DvelopContext, params: UpdateBoEntityParams) => void): (context: DvelopContext, params: UpdateBoEntityParams) => Promise<void>;
24
+ export declare function _updateBoEntityFactory<E, R>(httpRequestFunction: (context: DvelopContext, config: HttpConfig) => Promise<HttpResponse>, transformFunction: (response: HttpResponse, context: DvelopContext, params: UpdateBoEntityParams<E>) => R): (context: DvelopContext, params: UpdateBoEntityParams) => Promise<R>;
20
25
  /**
21
26
  * Update a business object entity.
27
+ * @template E Type for Entity. Defaults to `any`.
22
28
  *
29
+ * @example
23
30
  * ```typescript
24
31
  * import { updateBoEntity } from "@dvelop-sdk/business-objects";
25
32
  *
@@ -35,8 +42,11 @@ export declare function _updateBoEntityFactory(httpRequestFunction: (context: Dv
35
42
  * }
36
43
  * });
37
44
  * ```
38
- * ---
45
+ * ---
39
46
  * You can also write your own function.
47
+ *
48
+ * @example
49
+ * ```typescript
40
50
  * import { updateBoEntity } from "@dvelop-sdk/business-objects";
41
51
  *
42
52
  * const myUpdateFunction = _updateBoEntityFactory(_defaultHttpRequestFunction, (response:HttpResponse)=> {
@@ -57,5 +67,5 @@ export declare function _updateBoEntityFactory(httpRequestFunction: (context: Dv
57
67
  * console.log(responseMessage); // My own transform function message
58
68
  * ```
59
69
  */
60
- export declare function updateBoEntity(context: DvelopContext, params: UpdateBoEntityParams): Promise<void>;
70
+ export declare function updateBoEntity<E = any>(context: DvelopContext, params: UpdateBoEntityParams<E>): Promise<void>;
61
71
  //# sourceMappingURL=update-entity.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"update-entity.d.ts","sourceRoot":"","sources":["../../../src/entities/update-entity/update-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,oBAAoB;IACjC,SAAS,EAAC,MAAM,CAAC;IACjB,gBAAgB,EAAC,MAAM,CAAC;IACxB,cAAc,EAAC,MAAM,GAAC,MAAM,CAAC;IAC7B,YAAY,EAAE,MAAM,CAAC;CACxB;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,mBAAmB,EAAE,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,KAAK,OAAO,CAAC,YAAY,CAAC,EAC1F,iBAAiB,EAAE,CAAC,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,oBAAoB,KAAK,IAAI,GACxG,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,oBAAoB,KAAK,OAAO,CAAC,IAAI,CAAC,CAkBzE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,wBAAsB,cAAc,CAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,oBAAoB,GAAE,OAAO,CAAC,IAAI,CAAC,CAExG"}
1
+ {"version":3,"file":"update-entity.d.ts","sourceRoot":"","sources":["../../../src/entities/update-entity/update-entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,YAAY,EAA+B,MAAM,kBAAkB,CAAC;AAEzF;;;;GAIG;AACH,MAAM,WAAW,oBAAoB,CAAC,CAAC,GAAG,GAAG;IAC3C,wBAAwB;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,0DAA0D;IAC1D,gBAAgB,EAAE,MAAM,CAAC;IACzB,+CAA+C;IAC/C,cAAc,EAAE,MAAM,GAAG,MAAM,CAAC;IAChC,uIAAuI;IACvI,YAAY,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;CAC1B;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,EAAE,CAAC,EACzC,mBAAmB,EAAE,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,KAAK,OAAO,CAAC,YAAY,CAAC,EAC1F,iBAAiB,EAAE,CAAC,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,oBAAoB,CAAC,CAAC,CAAC,KAAK,CAAC,GACxG,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,oBAAoB,KAAK,OAAO,CAAC,CAAC,CAAC,CAkBtE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAEH,wBAAsB,cAAc,CAAC,CAAC,GAAG,GAAG,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,oBAAoB,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAEpH"}
@@ -40,7 +40,7 @@ exports.updateBoEntity = exports._updateBoEntityFactory = void 0;
40
40
  var http_1 = require("../../utils/http");
41
41
  /**
42
42
  * Factory for {@link updateBoEntity}-function. See [Advanced Topics](https://github.com/d-velop/dvelop-sdk-node#advanced-topics) for more information.
43
- * @typeparam
43
+ * @template E Return type of the {@link updateBoEntity}-function. A corresponding transformFunction has to be supplied.
44
44
  * @internal
45
45
  * @category Entity
46
46
  */
@@ -72,7 +72,9 @@ function _updateBoEntityFactory(httpRequestFunction, transformFunction) {
72
72
  exports._updateBoEntityFactory = _updateBoEntityFactory;
73
73
  /**
74
74
  * Update a business object entity.
75
+ * @template E Type for Entity. Defaults to `any`.
75
76
  *
77
+ * @example
76
78
  * ```typescript
77
79
  * import { updateBoEntity } from "@dvelop-sdk/business-objects";
78
80
  *
@@ -88,8 +90,11 @@ exports._updateBoEntityFactory = _updateBoEntityFactory;
88
90
  * }
89
91
  * });
90
92
  * ```
91
- * ---
93
+ * ---
92
94
  * You can also write your own function.
95
+ *
96
+ * @example
97
+ * ```typescript
93
98
  * import { updateBoEntity } from "@dvelop-sdk/business-objects";
94
99
  *
95
100
  * const myUpdateFunction = _updateBoEntityFactory(_defaultHttpRequestFunction, (response:HttpResponse)=> {
@@ -1 +1 @@
1
- {"version":3,"file":"update-entity.js","sourceRoot":"","sources":["../../../src/entities/update-entity/update-entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,yCAAyF;AAazF;;;;;GAKG;AACH,SAAgB,sBAAsB,CACpC,mBAA0F,EAC1F,iBAAyG;IAF3G,iBAqBC;IAjBC,OAAO,UAAO,OAAsB,EAAE,MAA4B;;;;;oBAGhE,IAAG,OAAO,MAAM,CAAC,cAAc,KAAK,QAAQ,EAAE;wBAC5C,iBAAiB,GAAG,MAAM,CAAC,cAAc,CAAC;qBAC3C;yBAAM;wBACL,iBAAiB,GAAG,MAAI,MAAM,CAAC,cAAc,MAAG,CAAC;qBAClD;oBAEgB,qBAAM,mBAAmB,CAAC,OAAO,EAAE;4BAClD,MAAM,EAAE,KAAK;4BACb,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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;GA4CG;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/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.2",
4
+ "version": "1.0.0-beta.3",
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
+ }