@dvelop-sdk/business-objects 2.0.1 → 2.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/lib/entities/get-entities/get-entities.d.ts +29 -14
- package/lib/entities/get-entities/get-entities.d.ts.map +1 -1
- package/lib/entities/get-entities/get-entities.js +24 -9
- package/lib/entities/get-entities/get-entities.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -14,11 +14,11 @@ export interface GetBoEntitiesParams {
|
|
|
14
14
|
* Page of a searchResult. There might be more than one page.
|
|
15
15
|
* @category Entity
|
|
16
16
|
*/
|
|
17
|
-
export interface
|
|
17
|
+
export interface GetBoEntitiesResultPage<E = any> {
|
|
18
18
|
/** Array of entitiess found */
|
|
19
19
|
value: E[];
|
|
20
20
|
/** Function that returns the next page. Undefined if there is none. */
|
|
21
|
-
getNextPage?: () => Promise<
|
|
21
|
+
getNextPage?: () => Promise<GetBoEntitiesResultPage<E>>;
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
24
|
* 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.
|
|
@@ -26,56 +26,71 @@ export interface GetEntitiesResultPage<E = any> {
|
|
|
26
26
|
* @internal
|
|
27
27
|
* @category Entity
|
|
28
28
|
*/
|
|
29
|
-
export declare function _getBoEntitiesDefaultTransformFunctionFactory<E>(httpRequestFunction: (context: DvelopContext, config: HttpConfig) => Promise<HttpResponse>): (response: HttpResponse, context: DvelopContext, params: GetBoEntitiesParams) =>
|
|
29
|
+
export declare function _getBoEntitiesDefaultTransformFunctionFactory<E>(httpRequestFunction: (context: DvelopContext, config: HttpConfig) => Promise<HttpResponse>): (response: HttpResponse, context: DvelopContext, params: GetBoEntitiesParams) => GetBoEntitiesResultPage<E>;
|
|
30
30
|
/**
|
|
31
31
|
* Factory for {@link getBoEntities}-function. See [Advanced Topics](https://github.com/d-velop/dvelop-sdk-node#advanced-topics) for more information.
|
|
32
32
|
* @template E Return type of the {@link getBoEntities}-function. A corresponding transformFunction has to be supplied.
|
|
33
33
|
* @internal
|
|
34
34
|
* @category Entity
|
|
35
35
|
*/
|
|
36
|
-
export declare function _getBoEntitiesFactory<E>(httpRequestFunction: (context: DvelopContext, config: HttpConfig) => Promise<HttpResponse>, transformFunction: (response: HttpResponse, context: DvelopContext, params: GetBoEntitiesParams) =>
|
|
36
|
+
export declare function _getBoEntitiesFactory<E>(httpRequestFunction: (context: DvelopContext, config: HttpConfig) => Promise<HttpResponse>, transformFunction: (response: HttpResponse, context: DvelopContext, params: GetBoEntitiesParams) => GetBoEntitiesResultPage<E>): (context: DvelopContext, params: GetBoEntitiesParams) => Promise<GetBoEntitiesResultPage<E>>;
|
|
37
37
|
/**
|
|
38
|
-
* Returns all specified entities from a model.
|
|
39
|
-
*
|
|
38
|
+
* Returns all specified entities from a model. This result might be partial due to the default page size.
|
|
39
|
+
* You can navigate to the next pages using the function ```getNextPage```. If the function is undefined, the page does not exist.
|
|
40
40
|
*
|
|
41
41
|
* @example
|
|
42
42
|
* ```typescript
|
|
43
43
|
* import { getBoEntities } from "@dvelop-sdk/business-objects";
|
|
44
44
|
*
|
|
45
|
-
* const
|
|
45
|
+
* const resultPage: GetEntitiesResultPage = await getBoEntities({
|
|
46
46
|
* systemBaseUri: "https://sacred-heart-hospital.d-velop.cloud",
|
|
47
47
|
* authSessionId: "3f3c428d452"
|
|
48
48
|
* },{
|
|
49
49
|
* modelName: "HOSPITALBASEDATA",
|
|
50
|
-
* pluralEntityName: "employees"
|
|
50
|
+
* pluralEntityName: "employees"
|
|
51
51
|
* });
|
|
52
|
-
*
|
|
52
|
+
*
|
|
53
|
+
* let employees = await resultPage.value;
|
|
54
|
+
*
|
|
55
|
+
* // Use this for paging
|
|
56
|
+
* while (resultPage.getNextPage) {
|
|
57
|
+
* const nextPage: GetBoEntitiesResultPage = await resultPage.getNextPage();
|
|
58
|
+
* employees = employees.concat(nextPage.value);
|
|
59
|
+
* }
|
|
53
60
|
* ```
|
|
54
61
|
* ---
|
|
55
62
|
* You can also use generics:
|
|
56
|
-
* @example
|
|
63
|
+
* * @example
|
|
57
64
|
* ```typescript
|
|
58
65
|
* import { getBoEntities } from "@dvelop-sdk/business-objects";
|
|
59
66
|
*
|
|
60
|
-
*
|
|
67
|
+
* interface Employee {
|
|
61
68
|
* employeeId: string;
|
|
62
69
|
* firstName: string;
|
|
63
70
|
* lastName: string;
|
|
64
71
|
* jobTitel: string;
|
|
65
72
|
* }
|
|
66
73
|
*
|
|
67
|
-
* const
|
|
74
|
+
* const resultPage: GetBoEntitiesResultPage<Employee> = await getBoEntities({
|
|
68
75
|
* systemBaseUri: "https://sacred-heart-hospital.d-velop.cloud",
|
|
69
76
|
* authSessionId: "3f3c428d452"
|
|
70
|
-
* },{
|
|
77
|
+
* }, {
|
|
71
78
|
* modelName: "HOSPITALBASEDATA",
|
|
72
79
|
* pluralEntityName: "employees"
|
|
73
80
|
* });
|
|
74
81
|
*
|
|
82
|
+
* let employees: Employee[] = await resultPage.value;
|
|
83
|
+
*
|
|
84
|
+
* // Use this for paging
|
|
85
|
+
* while (resultPage.getNextPage) {
|
|
86
|
+
* const nextPage: GetBoEntitiesResultPage<Employee> = await resultPage.getNextPage();
|
|
87
|
+
* employees = employees.concat(nextPage.value);
|
|
88
|
+
* }
|
|
89
|
+
*
|
|
75
90
|
* employees.forEach(e => console.log(e.lastName));
|
|
76
91
|
* // Dorian
|
|
77
92
|
* // Turk
|
|
78
93
|
* ```
|
|
79
94
|
*/
|
|
80
|
-
export declare function getBoEntities<E = any>(context: DvelopContext, params: GetBoEntitiesParams): Promise<
|
|
95
|
+
export declare function getBoEntities<E = any>(context: DvelopContext, params: GetBoEntitiesParams): Promise<GetBoEntitiesResultPage<E>>;
|
|
81
96
|
//# 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;IAClC,wBAAwB;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,0DAA0D;IAC1D,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED;;;GAGG;AACH,MAAM,WAAW,
|
|
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;IAClC,wBAAwB;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,0DAA0D;IAC1D,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED;;;GAGG;AACH,MAAM,WAAW,uBAAuB,CAAC,CAAC,GAAG,GAAG;IAC9C,+BAA+B;IAC/B,KAAK,EAAE,CAAC,EAAE,CAAA;IACV,uEAAuE;IACvE,WAAW,CAAC,EAAE,MAAM,OAAO,CAAC,uBAAuB,CAAC,CAAC,CAAC,CAAC,CAAC;CACzD;AAED;;;;;GAKG;AACH,wBAAgB,6CAA6C,CAAC,CAAC,EAAE,mBAAmB,EAAE,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,KAAK,OAAO,CAAC,YAAY,CAAC,GAAG,CAAC,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,mBAAmB,KAAK,uBAAuB,CAAC,CAAC,CAAC,CAmBxQ;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,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,mBAAmB,KAAK,uBAAuB,CAAC,CAAC,CAAC,GAC7H,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,mBAAmB,KAAK,OAAO,CAAC,uBAAuB,CAAC,CAAC,CAAC,CAAC,CAU9F;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AAEH,wBAAsB,aAAa,CAAC,CAAC,GAAG,GAAG,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC,CAAC,CAAC,CAErI"}
|
|
@@ -95,43 +95,58 @@ function _getBoEntitiesFactory(httpRequestFunction, transformFunction) {
|
|
|
95
95
|
}
|
|
96
96
|
exports._getBoEntitiesFactory = _getBoEntitiesFactory;
|
|
97
97
|
/**
|
|
98
|
-
* Returns all specified entities from a model.
|
|
99
|
-
*
|
|
98
|
+
* Returns all specified entities from a model. This result might be partial due to the default page size.
|
|
99
|
+
* You can navigate to the next pages using the function ```getNextPage```. If the function is undefined, the page does not exist.
|
|
100
100
|
*
|
|
101
101
|
* @example
|
|
102
102
|
* ```typescript
|
|
103
103
|
* import { getBoEntities } from "@dvelop-sdk/business-objects";
|
|
104
104
|
*
|
|
105
|
-
* const
|
|
105
|
+
* const resultPage: GetEntitiesResultPage = await getBoEntities({
|
|
106
106
|
* systemBaseUri: "https://sacred-heart-hospital.d-velop.cloud",
|
|
107
107
|
* authSessionId: "3f3c428d452"
|
|
108
108
|
* },{
|
|
109
109
|
* modelName: "HOSPITALBASEDATA",
|
|
110
|
-
* pluralEntityName: "employees"
|
|
110
|
+
* pluralEntityName: "employees"
|
|
111
111
|
* });
|
|
112
|
-
*
|
|
112
|
+
*
|
|
113
|
+
* let employees = await resultPage.value;
|
|
114
|
+
*
|
|
115
|
+
* // Use this for paging
|
|
116
|
+
* while (resultPage.getNextPage) {
|
|
117
|
+
* const nextPage: GetBoEntitiesResultPage = await resultPage.getNextPage();
|
|
118
|
+
* employees = employees.concat(nextPage.value);
|
|
119
|
+
* }
|
|
113
120
|
* ```
|
|
114
121
|
* ---
|
|
115
122
|
* You can also use generics:
|
|
116
|
-
* @example
|
|
123
|
+
* * @example
|
|
117
124
|
* ```typescript
|
|
118
125
|
* import { getBoEntities } from "@dvelop-sdk/business-objects";
|
|
119
126
|
*
|
|
120
|
-
*
|
|
127
|
+
* interface Employee {
|
|
121
128
|
* employeeId: string;
|
|
122
129
|
* firstName: string;
|
|
123
130
|
* lastName: string;
|
|
124
131
|
* jobTitel: string;
|
|
125
132
|
* }
|
|
126
133
|
*
|
|
127
|
-
* const
|
|
134
|
+
* const resultPage: GetBoEntitiesResultPage<Employee> = await getBoEntities({
|
|
128
135
|
* systemBaseUri: "https://sacred-heart-hospital.d-velop.cloud",
|
|
129
136
|
* authSessionId: "3f3c428d452"
|
|
130
|
-
* },{
|
|
137
|
+
* }, {
|
|
131
138
|
* modelName: "HOSPITALBASEDATA",
|
|
132
139
|
* pluralEntityName: "employees"
|
|
133
140
|
* });
|
|
134
141
|
*
|
|
142
|
+
* let employees: Employee[] = await resultPage.value;
|
|
143
|
+
*
|
|
144
|
+
* // Use this for paging
|
|
145
|
+
* while (resultPage.getNextPage) {
|
|
146
|
+
* const nextPage: GetBoEntitiesResultPage<Employee> = await resultPage.getNextPage();
|
|
147
|
+
* employees = employees.concat(nextPage.value);
|
|
148
|
+
* }
|
|
149
|
+
*
|
|
135
150
|
* employees.forEach(e => console.log(e.lastName));
|
|
136
151
|
* // Dorian
|
|
137
152
|
* // Turk
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-entities.js","sourceRoot":"","sources":["../../../src/entities/get-entities/get-entities.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,yCAAyF;AAwBzF;;;;;GAKG;AACH,SAAgB,6CAA6C,CAAI,mBAA0F;IAA3J,iBAmBC;IAlBC,OAAO,UAAI,QAAsB,EAAE,OAAsB,EAAE,MAA2B;QAEpF,IAAI,MAAM,
|
|
1
|
+
{"version":3,"file":"get-entities.js","sourceRoot":"","sources":["../../../src/entities/get-entities/get-entities.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,yCAAyF;AAwBzF;;;;;GAKG;AACH,SAAgB,6CAA6C,CAAI,mBAA0F;IAA3J,iBAmBC;IAlBC,OAAO,UAAI,QAAsB,EAAE,OAAsB,EAAE,MAA2B;QAEpF,IAAI,MAAM,GAA+B;YACvC,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC,KAAK;SAC3B,CAAC;QAEF,IAAI,QAAQ,CAAC,IAAI,CAAC,iBAAiB,CAAC,EAAE;YACpC,MAAM,CAAC,WAAW,GAAG;;;;gCACgB,qBAAM,mBAAmB,CAAC,OAAO,EAAE;gCACpE,MAAM,EAAE,KAAK;gCACb,GAAG,EAAE,QAAQ,CAAC,IAAI,CAAC,iBAAiB,CAAC;6BACtC,CAAC,EAAA;;4BAHI,YAAY,GAAiB,SAGjC;4BACF,sBAAO,6CAA6C,CAAI,mBAAmB,CAAC,CAAC,YAAY,EAAE,OAAO,EAAE,MAAM,CAAC,EAAC;;;iBAC7G,CAAC;SACH;QAED,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC;AAnBD,sGAmBC;AAED;;;;;GAKG;AACH,SAAgB,qBAAqB,CACnC,mBAA0F,EAC1F,iBAA8H;IAFhI,iBAaC;IATC,OAAO,UAAO,OAAsB,EAAE,MAA2B;;;;wBAE9C,qBAAM,mBAAmB,CAAC,OAAO,EAAE;wBAClD,MAAM,EAAE,KAAK;wBACb,GAAG,EAAE,kCAA2B,MAAM,CAAC,SAAS,cAAI,MAAM,CAAC,gBAAgB,CAAE;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AACH,0BAA0B;AAC1B,SAAsB,aAAa,CAAU,OAAsB,EAAE,MAA2B;;;;wBACvF,qBAAM,qBAAqB,CAAI,kCAA2B,EAAE,6CAA6C,CAAC,kCAA2B,CAAC,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,EAAA;wBAA/J,sBAAO,SAAwJ,EAAC;;;;CACjK;AAFD,sCAEC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
export { DvelopContext, BadInputError, UnauthorizedError, ForbiddenError, NotFoundError } from "@dvelop-sdk/core";
|
|
27
27
|
export { BusinessObjectsError } from "./utils/http";
|
|
28
28
|
export * as internals from "./internal";
|
|
29
|
-
export { GetBoEntitiesParams, getBoEntities,
|
|
29
|
+
export { GetBoEntitiesParams, getBoEntities, GetBoEntitiesResultPage } from "./entities/get-entities/get-entities";
|
|
30
30
|
export { GetBoEntityParams, getBoEntity } from "./entities/get-entity/get-entity";
|
|
31
31
|
export { CreateBoEntityParams, createBoEntity } from "./entities/create-entity/create-entity";
|
|
32
32
|
export { UpdateBoEntityParams, updateBoEntity } from "./entities/update-entity/update-entity";
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAGH,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,iBAAiB,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAClH,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,KAAK,SAAS,MAAM,YAAY,CAAC;AAExC,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAGH,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,iBAAiB,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAClH,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,KAAK,SAAS,MAAM,YAAY,CAAC;AAExC,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AACnH,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAClF,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AAC9F,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AAC9F,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC"}
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,OAAO;AACP,yCAAkH;AAA1F,qGAAA,aAAa,OAAA;AAAE,yGAAA,iBAAiB,OAAA;AAAE,sGAAA,cAAc,OAAA;AAAE,qGAAA,aAAa,OAAA;AACvF,qCAAoD;AAA3C,4GAAA,oBAAoB,OAAA;AAC7B,wDAAwC;AAExC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,OAAO;AACP,yCAAkH;AAA1F,qGAAA,aAAa,OAAA;AAAE,yGAAA,iBAAiB,OAAA;AAAE,sGAAA,cAAc,OAAA;AAAE,qGAAA,aAAa,OAAA;AACvF,qCAAoD;AAA3C,4GAAA,oBAAoB,OAAA;AAC7B,wDAAwC;AAExC,qEAAmH;AAArF,6GAAA,aAAa,OAAA;AAC3C,+DAAkF;AAAtD,yGAAA,WAAW,OAAA;AACvC,wEAA8F;AAA/D,+GAAA,cAAc,OAAA;AAC7C,wEAA8F;AAA/D,+GAAA,cAAc,OAAA;AAC7C,wEAA8F;AAA/D,+GAAA,cAAc,OAAA"}
|
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": "2.0.
|
|
4
|
+
"version": "2.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.2.1"
|
|
27
27
|
}
|
|
28
|
-
}
|
|
28
|
+
}
|