bkper 2.6.2 → 2.6.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.
package/lib/index.d.ts CHANGED
@@ -310,7 +310,7 @@ export declare class Amount {
310
310
  /**
311
311
  * Defines an App on Bkper.
312
312
  *
313
- * Apps can be installed on Books by users.s
313
+ * Apps can be installed on Books by users.
314
314
  *
315
315
  * @public
316
316
  */
@@ -349,21 +349,34 @@ export declare class Bkper {
349
349
  *
350
350
  * @param id - The universal book id - The same bookId param of URL you access at app.bkper.com
351
351
  *
352
+ * @returns The retrieved Book, for chaining
352
353
  */
353
354
  static getBook(id: string): Promise<Book>;
354
355
  /**
355
356
  * Gets the current logged [[User]].
357
+ *
358
+ * @returns The retrieved User, for chaining
356
359
  */
357
360
  static getUser(): Promise<User>;
358
361
  /**
359
362
  * Sets the API [[Config]] object.
363
+ *
364
+ * @param config - The Config object
360
365
  */
361
366
  static setConfig(config: Config): void;
362
367
  /**
368
+ * Sets the API key to identify the agent.
369
+ *
370
+ * @param key - The API key
371
+ *
372
+ * @returns The defined [[App]] object
373
+ *
363
374
  * @deprecated Use `setConfig()` instead
364
375
  */
365
376
  static setApiKey(key: string): App;
366
377
  /**
378
+ * Sets the provider of the valid OAuth2 access token
379
+ *
367
380
  * @deprecated Use `setConfig()` instead
368
381
  */
369
382
  static setOAuthTokenProvider(oauthTokenProvider: () => Promise<string>): Promise<void>;
@@ -600,8 +613,27 @@ export declare class Book {
600
613
  * Trigger [Balances Audit](https://help.bkper.com/en/articles/4412038-balances-audit) async process.
601
614
  */
602
615
  audit(): void;
616
+ /**
617
+ * Gets the existing [[Integrations]] in the Book.
618
+ *
619
+ * @returns The existing Integration objects
620
+ */
603
621
  getIntegrations(): Promise<Integration[]>;
622
+ /**
623
+ * Creates a new [[Integration]] in the Book.
624
+ *
625
+ * @param integration - The Integration object or wrapped plain json
626
+ *
627
+ * @returns The created Integration object
628
+ */
604
629
  createIntegration(integration: bkper.Integration | Integration): Promise<Integration>;
630
+ /**
631
+ * Updates an existing [[Integration]] in the Book.
632
+ *
633
+ * @param integration - The Integration wrapped plain json
634
+ *
635
+ * @returns The updated Integration object
636
+ */
605
637
  updateIntegration(integration: bkper.Integration): Promise<Integration>;
606
638
  /**
607
639
  * Resumes a transaction iteration using a continuation token from a previous iterator.
@@ -761,7 +793,12 @@ export declare class Collection {
761
793
  getBooks(): Book[];
762
794
  }
763
795
 
764
- declare interface Config {
796
+ /**
797
+ * This class defines the [[Bkper]] API Config.
798
+ *
799
+ * @public
800
+ */
801
+ export declare interface Config {
765
802
  /**
766
803
  * The API key to identify the agent.
767
804
  *
@@ -770,6 +807,9 @@ declare interface Config {
770
807
  * See how to create your api key [here](https://cloud.google.com/docs/authentication/api-keys).
771
808
  */
772
809
  apiKeyProvider?: () => Promise<string>;
810
+ /**
811
+ * Issue a valid OAuth2 access token with **https://www.googleapis.com/auth/userinfo.email** scope authorized.
812
+ */
773
813
  oauthTokenProvider?: () => Promise<string>;
774
814
  /**
775
815
  * Provides additional headers to append to the API request
@@ -777,6 +817,9 @@ declare interface Config {
777
817
  requestHeadersProvider?: () => Promise<{
778
818
  [key: string]: string;
779
819
  }>;
820
+ /**
821
+ * Custom request error handler
822
+ */
780
823
  requestErrorHandler?: (error: any) => any;
781
824
  /**
782
825
  * Sets the base api url. Default to https://app.bkper.com/_ah/api/bkper
@@ -785,7 +828,7 @@ declare interface Config {
785
828
  }
786
829
 
787
830
  /**
788
- * This class defines a Connection from an User to an external service.
831
+ * This class defines a Connection from an [[User]] to an external service.
789
832
  *
790
833
  * @public
791
834
  */
@@ -793,77 +836,103 @@ export declare class Connection {
793
836
 
794
837
  constructor(json?: bkper.Connection);
795
838
  /**
796
- * @returns The wrapped plain json object
839
+ * Gets the wrapped plain json object of the Connection.
840
+ *
841
+ * @returns The Connection wrapped plain json object
797
842
  */
798
843
  json(): bkper.Connection;
799
844
  /**
800
- * @returns The id of this User
845
+ * Gets the id of the Connection.
846
+ *
847
+ * @returns The Connection's id
801
848
  */
802
849
  getId(): string;
803
850
  /**
804
- * @returns The Connection agentId
851
+ * Gets the agentId of the Connection.
852
+ *
853
+ * @returns The Connection's agentId
805
854
  */
806
855
  getAgentId(): string;
807
856
  /**
808
- * Sets the Connection agentId
857
+ * Sets the Connection agentId.
858
+ *
859
+ * @param agentId - The Connection agentId
809
860
  *
810
- * @returns This Connection, for chainning.
861
+ * @returns The Connection, for chainning
811
862
  */
812
863
  setAgentId(agentId: string): Connection;
813
864
  /**
814
- * @returns The name of this Connection
865
+ * Gets the name of the Connection.
866
+ *
867
+ * @returns The Connection name
815
868
  */
816
869
  getName(): string;
817
870
  /**
818
- * @returns The email of the owner of this Connection
871
+ * Gets the email of the owner of the Connection.
872
+ *
873
+ * @returns The Connection owner's email
819
874
  */
820
875
  getEmail(): string;
821
876
  /**
822
877
  * Sets the name of the Connection.
823
878
  *
824
- * @returns This Connection, for chainning.
879
+ * @param name - The name of the Connection
880
+ *
881
+ * @returns The Connection, for chainning
825
882
  */
826
883
  setName(name: string): Connection;
827
884
  /**
828
- * Sets the universal unique identifier of this connection.
885
+ * Sets the universal unique identifier of the Connection.
886
+ *
887
+ * @param uuid - The universal unique identifier of the Connection
829
888
  *
830
- * @returns This Connection, for chainning.
889
+ * @returns The Connection, for chainning
831
890
  */
832
891
  setUUID(uuid: string): Connection;
833
892
  /**
834
- * @returns The name of universal unique identifier of the connection
893
+ * Gets the universal unique identifier of this Connection.
894
+ *
895
+ * @returns The Connection's universal unique identifier name
835
896
  */
836
897
  getUUID(): string;
837
898
  /**
838
- * @returns The connection type
899
+ * Gets the type of the Connection.
900
+ *
901
+ * @returns The Connection type
839
902
  */
840
903
  getType(): "APP" | "BANK";
841
904
  /**
842
- * Sets the connection type.
905
+ * Sets the Connection type.
906
+ *
907
+ * @param type - The Connection type
843
908
  *
844
- * @returns This Connection, for chainning.
909
+ * @returns The Connection, for chainning
845
910
  */
846
911
  setType(type: "APP" | "BANK"): Connection;
847
912
  /**
848
- * Gets the custom properties stored in this Connection
913
+ * Gets the custom properties stored in the Connection
914
+ *
915
+ * @returns Object with key/value pair properties
849
916
  */
850
917
  getProperties(): {
851
918
  [key: string]: string;
852
919
  };
853
920
  /**
854
- * Sets the custom properties of the Connection
921
+ * Sets the custom properties of the Connection.
855
922
  *
856
923
  * @param properties - Object with key/value pair properties
857
924
  *
858
- * @returns This Connection, for chainning.
925
+ * @returns The Connection, for chainning
859
926
  */
860
927
  setProperties(properties: {
861
928
  [key: string]: string;
862
929
  }): Connection;
863
930
  /**
864
- * Gets the property value for given keys. First property found will be retrieved
931
+ * Gets the property value for given keys. First property found will be retrieved.
865
932
  *
866
933
  * @param keys - The property key
934
+ *
935
+ * @returns The retrieved property value
867
936
  */
868
937
  getProperty(...keys: string[]): string;
869
938
  /**
@@ -871,27 +940,38 @@ export declare class Connection {
871
940
  *
872
941
  * @param key - The property key
873
942
  * @param value - The property value
943
+ *
944
+ * @returns The Connection, for chaining
874
945
  */
875
946
  setProperty(key: string, value: string): Connection;
876
947
  /**
877
- * Delete a custom property
948
+ * Deletes a custom property stored in the Connection.
878
949
  *
879
950
  * @param key - The property key
880
951
  *
881
- * @returns This Connection, for chainning.
952
+ * @returns The Connection, for chainning
882
953
  */
883
954
  deleteProperty(key: string): Connection;
884
955
  /**
885
- * Clean any token property
956
+ * Cleans any token property stored in the Connection.
886
957
  */
887
958
  clearTokenProperties(): void;
888
959
  /**
889
960
  * Gets the custom properties keys stored in the Connection.
961
+ *
962
+ * @returns The retrieved property keys
890
963
  */
891
964
  getPropertyKeys(): string[];
965
+ /**
966
+ * Gets the existing [[Integrations]] on the Connection.
967
+ *
968
+ * @returns The existing Integration objects
969
+ */
892
970
  getIntegrations(): Promise<Integration[]>;
893
971
  /**
894
- * Perform create new connection.
972
+ * Performs create new Connection.
973
+ *
974
+ * @returns The Connection, for chaining
895
975
  */
896
976
  create(): Promise<Connection>;
897
977
  }
@@ -1092,7 +1172,7 @@ export declare class Group {
1092
1172
  }
1093
1173
 
1094
1174
  /**
1095
- * This class defines a Integration from an User to an external service.
1175
+ * This class defines a Integration from an [[User]] to an external service.
1096
1176
  *
1097
1177
  * @public
1098
1178
  */
@@ -1100,38 +1180,53 @@ export declare class Integration {
1100
1180
 
1101
1181
  constructor(json: bkper.Integration);
1102
1182
  /**
1103
- * @returns The wrapped plain json object
1183
+ * Gets the wrapped plain json object of the Integration.
1184
+ *
1185
+ * @returns The Integration wrapped plain json object
1104
1186
  */
1105
1187
  json(): bkper.Integration;
1188
+ /**
1189
+ * Gets the [[Book]] id of the Integration.
1190
+ *
1191
+ * @returns The Integration's Book id
1192
+ */
1106
1193
  getBookId(): string;
1107
1194
  /**
1108
- * @returns The id of this User
1195
+ * Gets the id of the Integration.
1196
+ *
1197
+ * @returns This Integration's id
1109
1198
  */
1110
1199
  getId(): string;
1111
1200
  /**
1112
- * @returns The name of this Integration
1201
+ * Gets the name of the Integration.
1202
+ *
1203
+ * @returns The Integration's name
1113
1204
  */
1114
1205
  getName(): string;
1115
1206
  /**
1116
- * Gets the custom properties stored in this Integration
1207
+ * Gets the custom properties stored in the Integration.
1208
+ *
1209
+ * @returns Object with key/value pair properties
1117
1210
  */
1118
1211
  getProperties(): {
1119
1212
  [key: string]: string;
1120
1213
  };
1121
1214
  /**
1122
- * Sets the custom properties of the Integration
1215
+ * Sets the custom properties of the Integration.
1123
1216
  *
1124
1217
  * @param properties - Object with key/value pair properties
1125
1218
  *
1126
- * @returns This Integration, for chainning.
1219
+ * @returns The Integration, for chainning
1127
1220
  */
1128
1221
  setProperties(properties: {
1129
1222
  [key: string]: string;
1130
1223
  }): Integration;
1131
1224
  /**
1132
- * Gets the property value for given keys. First property found will be retrieved
1225
+ * Gets the property value for given keys. First property found will be retrieved.
1133
1226
  *
1134
1227
  * @param keys - The property key
1228
+ *
1229
+ * @returns The retrieved property value
1135
1230
  */
1136
1231
  getProperty(...keys: string[]): string;
1137
1232
  /**
@@ -1139,14 +1234,16 @@ export declare class Integration {
1139
1234
  *
1140
1235
  * @param key - The property key
1141
1236
  * @param value - The property value
1237
+ *
1238
+ * @returns The Integration, for chaining
1142
1239
  */
1143
1240
  setProperty(key: string, value: string): Integration;
1144
1241
  /**
1145
- * Delete a custom property
1242
+ * Deletes a custom property stored in the Integration.
1146
1243
  *
1147
1244
  * @param key - The property key
1148
1245
  *
1149
- * @returns This Integration, for chainning.
1246
+ * @returns The Integration, for chainning
1150
1247
  */
1151
1248
  deleteProperty(key: string): Integration;
1152
1249
  }
@@ -1634,21 +1731,36 @@ export declare class User {
1634
1731
 
1635
1732
  constructor(wrapped: bkper.User);
1636
1733
  /**
1637
- * @returns The id of the User
1734
+ * Gets the id of the User.
1735
+ *
1736
+ * @returns The User's id
1638
1737
  */
1639
1738
  getId(): string;
1640
1739
  /**
1641
- * @returns The name of the User
1740
+ * Gets the name of the User.
1741
+ *
1742
+ * @returns The User's name
1642
1743
  */
1643
1744
  getName(): string;
1644
1745
  /**
1645
- * @returns The full name of the User
1746
+ * Gets the full name of the User.
1747
+ *
1748
+ * @returns The User's full name
1646
1749
  */
1647
1750
  getFullName(): string;
1648
1751
  /**
1649
- * @returns The User connections
1752
+ * Gets the [[Connections]] of the User.
1753
+ *
1754
+ * @returns The retrieved Connection objects
1650
1755
  */
1651
1756
  getConnections(): Promise<Connection[]>;
1757
+ /**
1758
+ * Gets a [[Connection]] of the User.
1759
+ *
1760
+ * @param id - The Connection's id
1761
+ *
1762
+ * @returns The retrieved Connection object
1763
+ */
1652
1764
  getConnection(id: string): Promise<Connection>;
1653
1765
  }
1654
1766
 
package/lib/model/App.js CHANGED
@@ -14,7 +14,7 @@ const app_service_1 = require("../service/app-service");
14
14
  /**
15
15
  * Defines an App on Bkper.
16
16
  *
17
- * Apps can be installed on Books by users.s
17
+ * Apps can be installed on Books by users.
18
18
  *
19
19
  * @public
20
20
  */
@@ -46,6 +46,7 @@ class Bkper {
46
46
  *
47
47
  * @param id - The universal book id - The same bookId param of URL you access at app.bkper.com
48
48
  *
49
+ * @returns The retrieved Book, for chaining
49
50
  */
50
51
  static getBook(id) {
51
52
  return __awaiter(this, void 0, void 0, function* () {
@@ -55,6 +56,8 @@ class Bkper {
55
56
  }
56
57
  /**
57
58
  * Gets the current logged [[User]].
59
+ *
60
+ * @returns The retrieved User, for chaining
58
61
  */
59
62
  static getUser() {
60
63
  return __awaiter(this, void 0, void 0, function* () {
@@ -64,11 +67,19 @@ class Bkper {
64
67
  }
65
68
  /**
66
69
  * Sets the API [[Config]] object.
70
+ *
71
+ * @param config - The Config object
67
72
  */
68
73
  static setConfig(config) {
69
74
  HttpApiRequest_1.HttpApiRequest.config = config;
70
75
  }
71
76
  /**
77
+ * Sets the API key to identify the agent.
78
+ *
79
+ * @param key - The API key
80
+ *
81
+ * @returns The defined [[App]] object
82
+ *
72
83
  * @deprecated Use `setConfig()` instead
73
84
  */
74
85
  static setApiKey(key) {
@@ -76,6 +87,8 @@ class Bkper {
76
87
  return new App_1.App();
77
88
  }
78
89
  /**
90
+ * Sets the provider of the valid OAuth2 access token
91
+ *
79
92
  * @deprecated Use `setConfig()` instead
80
93
  */
81
94
  static setOAuthTokenProvider(oauthTokenProvider) {
package/lib/model/Book.js CHANGED
@@ -400,6 +400,11 @@ class Book {
400
400
  audit() {
401
401
  BookService.audit(this.getId());
402
402
  }
403
+ /**
404
+ * Gets the existing [[Integrations]] in the Book.
405
+ *
406
+ * @returns The existing Integration objects
407
+ */
403
408
  getIntegrations() {
404
409
  return __awaiter(this, void 0, void 0, function* () {
405
410
  const integrationsPlain = yield IntegrationService.listIntegrations(this.getId());
@@ -407,6 +412,13 @@ class Book {
407
412
  return integrations;
408
413
  });
409
414
  }
415
+ /**
416
+ * Creates a new [[Integration]] in the Book.
417
+ *
418
+ * @param integration - The Integration object or wrapped plain json
419
+ *
420
+ * @returns The created Integration object
421
+ */
410
422
  createIntegration(integration) {
411
423
  return __awaiter(this, void 0, void 0, function* () {
412
424
  if (integration instanceof Integration_1.Integration) {
@@ -418,6 +430,13 @@ class Book {
418
430
  return new Integration_1.Integration(integration);
419
431
  });
420
432
  }
433
+ /**
434
+ * Updates an existing [[Integration]] in the Book.
435
+ *
436
+ * @param integration - The Integration wrapped plain json
437
+ *
438
+ * @returns The updated Integration object
439
+ */
421
440
  updateIntegration(integration) {
422
441
  return __awaiter(this, void 0, void 0, function* () {
423
442
  if (integration instanceof Integration_1.Integration) {
@@ -32,7 +32,7 @@ exports.Connection = void 0;
32
32
  const ConnectionService = __importStar(require("../service/connection-service"));
33
33
  const Integration_1 = require("./Integration");
34
34
  /**
35
- * This class defines a Connection from an User to an external service.
35
+ * This class defines a Connection from an [[User]] to an external service.
36
36
  *
37
37
  * @public
38
38
  */
@@ -41,40 +41,52 @@ class Connection {
41
41
  this.wrapped = json || {};
42
42
  }
43
43
  /**
44
- * @returns The wrapped plain json object
44
+ * Gets the wrapped plain json object of the Connection.
45
+ *
46
+ * @returns The Connection wrapped plain json object
45
47
  */
46
48
  json() {
47
49
  return this.wrapped;
48
50
  }
49
51
  /**
50
- * @returns The id of this User
52
+ * Gets the id of the Connection.
53
+ *
54
+ * @returns The Connection's id
51
55
  */
52
56
  getId() {
53
57
  return this.wrapped.id;
54
58
  }
55
59
  /**
56
- * @returns The Connection agentId
60
+ * Gets the agentId of the Connection.
61
+ *
62
+ * @returns The Connection's agentId
57
63
  */
58
64
  getAgentId() {
59
65
  return this.wrapped.agentId;
60
66
  }
61
67
  /**
62
- * Sets the Connection agentId
68
+ * Sets the Connection agentId.
63
69
  *
64
- * @returns This Connection, for chainning.
70
+ * @param agentId - The Connection agentId
71
+ *
72
+ * @returns The Connection, for chainning
65
73
  */
66
74
  setAgentId(agentId) {
67
75
  this.wrapped.agentId = agentId;
68
76
  return this;
69
77
  }
70
78
  /**
71
- * @returns The name of this Connection
79
+ * Gets the name of the Connection.
80
+ *
81
+ * @returns The Connection name
72
82
  */
73
83
  getName() {
74
84
  return this.wrapped.name;
75
85
  }
76
86
  /**
77
- * @returns The email of the owner of this Connection
87
+ * Gets the email of the owner of the Connection.
88
+ *
89
+ * @returns The Connection owner's email
78
90
  */
79
91
  getEmail() {
80
92
  return this.wrapped.email;
@@ -82,63 +94,77 @@ class Connection {
82
94
  /**
83
95
  * Sets the name of the Connection.
84
96
  *
85
- * @returns This Connection, for chainning.
97
+ * @param name - The name of the Connection
98
+ *
99
+ * @returns The Connection, for chainning
86
100
  */
87
101
  setName(name) {
88
102
  this.wrapped.name = name;
89
103
  return this;
90
104
  }
91
105
  /**
92
- * Sets the universal unique identifier of this connection.
106
+ * Sets the universal unique identifier of the Connection.
107
+ *
108
+ * @param uuid - The universal unique identifier of the Connection
93
109
  *
94
- * @returns This Connection, for chainning.
110
+ * @returns The Connection, for chainning
95
111
  */
96
112
  setUUID(uuid) {
97
113
  this.wrapped.uuid = uuid;
98
114
  return this;
99
115
  }
100
116
  /**
101
- * @returns The name of universal unique identifier of the connection
117
+ * Gets the universal unique identifier of this Connection.
118
+ *
119
+ * @returns The Connection's universal unique identifier name
102
120
  */
103
121
  getUUID() {
104
122
  return this.wrapped.uuid;
105
123
  }
106
124
  /**
107
- * @returns The connection type
125
+ * Gets the type of the Connection.
126
+ *
127
+ * @returns The Connection type
108
128
  */
109
129
  getType() {
110
130
  return this.wrapped.type;
111
131
  }
112
132
  /**
113
- * Sets the connection type.
133
+ * Sets the Connection type.
114
134
  *
115
- * @returns This Connection, for chainning.
135
+ * @param type - The Connection type
136
+ *
137
+ * @returns The Connection, for chainning
116
138
  */
117
139
  setType(type) {
118
140
  this.wrapped.type = type;
119
141
  return this;
120
142
  }
121
143
  /**
122
- * Gets the custom properties stored in this Connection
144
+ * Gets the custom properties stored in the Connection
145
+ *
146
+ * @returns Object with key/value pair properties
123
147
  */
124
148
  getProperties() {
125
149
  return this.wrapped.properties != null ? Object.assign({}, this.wrapped.properties) : {};
126
150
  }
127
151
  /**
128
- * Sets the custom properties of the Connection
152
+ * Sets the custom properties of the Connection.
129
153
  *
130
154
  * @param properties - Object with key/value pair properties
131
155
  *
132
- * @returns This Connection, for chainning.
156
+ * @returns The Connection, for chainning
133
157
  */
134
158
  setProperties(properties) {
135
159
  this.wrapped.properties = Object.assign({}, properties);
136
160
  return this;
137
161
  }
138
162
  /**
139
- * Gets the property value for given keys. First property found will be retrieved
163
+ * Gets the property value for given keys. First property found will be retrieved.
140
164
  *
141
165
  * @param keys - The property key
166
+ *
167
+ * @returns The retrieved property value
142
168
  */
143
169
  getProperty(...keys) {
144
170
  for (let index = 0; index < keys.length; index++) {
@@ -155,6 +181,8 @@ class Connection {
155
181
  *
156
182
  * @param key - The property key
157
183
  * @param value - The property value
184
+ *
185
+ * @returns The Connection, for chaining
158
186
  */
159
187
  setProperty(key, value) {
160
188
  if (key == null || key.trim() == '') {
@@ -167,24 +195,26 @@ class Connection {
167
195
  return this;
168
196
  }
169
197
  /**
170
- * Delete a custom property
198
+ * Deletes a custom property stored in the Connection.
171
199
  *
172
200
  * @param key - The property key
173
201
  *
174
- * @returns This Connection, for chainning.
202
+ * @returns The Connection, for chainning
175
203
  */
176
204
  deleteProperty(key) {
177
205
  this.setProperty(key, null);
178
206
  return this;
179
207
  }
180
208
  /**
181
- * Clean any token property
209
+ * Cleans any token property stored in the Connection.
182
210
  */
183
211
  clearTokenProperties() {
184
212
  this.getPropertyKeys().filter(key => key.includes("token")).forEach(key => this.deleteProperty(key));
185
213
  }
186
214
  /**
187
215
  * Gets the custom properties keys stored in the Connection.
216
+ *
217
+ * @returns The retrieved property keys
188
218
  */
189
219
  getPropertyKeys() {
190
220
  let properties = this.getProperties();
@@ -199,6 +229,11 @@ class Connection {
199
229
  propertyKeys = propertyKeys.sort();
200
230
  return propertyKeys;
201
231
  }
232
+ /**
233
+ * Gets the existing [[Integrations]] on the Connection.
234
+ *
235
+ * @returns The existing Integration objects
236
+ */
202
237
  getIntegrations() {
203
238
  return __awaiter(this, void 0, void 0, function* () {
204
239
  const integrationsPlain = yield ConnectionService.listIntegrations(this.getId());
@@ -207,7 +242,9 @@ class Connection {
207
242
  });
208
243
  }
209
244
  /**
210
- * Perform create new connection.
245
+ * Performs create new Connection.
246
+ *
247
+ * @returns The Connection, for chaining
211
248
  */
212
249
  create() {
213
250
  return __awaiter(this, void 0, void 0, function* () {
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Integration = void 0;
4
4
  /**
5
- * This class defines a Integration from an User to an external service.
5
+ * This class defines a Integration from an [[User]] to an external service.
6
6
  *
7
7
  * @public
8
8
  */
@@ -11,47 +11,62 @@ class Integration {
11
11
  this.wrapped = json;
12
12
  }
13
13
  /**
14
- * @returns The wrapped plain json object
14
+ * Gets the wrapped plain json object of the Integration.
15
+ *
16
+ * @returns The Integration wrapped plain json object
15
17
  */
16
18
  json() {
17
19
  return this.wrapped;
18
20
  }
21
+ /**
22
+ * Gets the [[Book]] id of the Integration.
23
+ *
24
+ * @returns The Integration's Book id
25
+ */
19
26
  getBookId() {
20
27
  return this.wrapped.bookId;
21
28
  }
22
29
  /**
23
- * @returns The id of this User
30
+ * Gets the id of the Integration.
31
+ *
32
+ * @returns This Integration's id
24
33
  */
25
34
  getId() {
26
35
  return this.wrapped.id;
27
36
  }
28
37
  /**
29
- * @returns The name of this Integration
38
+ * Gets the name of the Integration.
39
+ *
40
+ * @returns The Integration's name
30
41
  */
31
42
  getName() {
32
43
  return this.wrapped.name;
33
44
  }
34
45
  /**
35
- * Gets the custom properties stored in this Integration
46
+ * Gets the custom properties stored in the Integration.
47
+ *
48
+ * @returns Object with key/value pair properties
36
49
  */
37
50
  getProperties() {
38
51
  return this.wrapped.properties != null ? Object.assign({}, this.wrapped.properties) : {};
39
52
  }
40
53
  /**
41
- * Sets the custom properties of the Integration
54
+ * Sets the custom properties of the Integration.
42
55
  *
43
56
  * @param properties - Object with key/value pair properties
44
57
  *
45
- * @returns This Integration, for chainning.
58
+ * @returns The Integration, for chainning
46
59
  */
47
60
  setProperties(properties) {
48
61
  this.wrapped.properties = Object.assign({}, properties);
49
62
  return this;
50
63
  }
51
64
  /**
52
- * Gets the property value for given keys. First property found will be retrieved
65
+ * Gets the property value for given keys. First property found will be retrieved.
53
66
  *
54
67
  * @param keys - The property key
68
+ *
69
+ * @returns The retrieved property value
55
70
  */
56
71
  getProperty(...keys) {
57
72
  for (let index = 0; index < keys.length; index++) {
@@ -68,6 +83,8 @@ class Integration {
68
83
  *
69
84
  * @param key - The property key
70
85
  * @param value - The property value
86
+ *
87
+ * @returns The Integration, for chaining
71
88
  */
72
89
  setProperty(key, value) {
73
90
  if (key == null || key.trim() == '') {
@@ -80,11 +97,11 @@ class Integration {
80
97
  return this;
81
98
  }
82
99
  /**
83
- * Delete a custom property
100
+ * Deletes a custom property stored in the Integration.
84
101
  *
85
102
  * @param key - The property key
86
103
  *
87
- * @returns This Integration, for chainning.
104
+ * @returns The Integration, for chainning
88
105
  */
89
106
  deleteProperty(key) {
90
107
  this.setProperty(key, null);
package/lib/model/User.js CHANGED
@@ -41,25 +41,33 @@ class User {
41
41
  this.wrapped = wrapped;
42
42
  }
43
43
  /**
44
- * @returns The id of the User
44
+ * Gets the id of the User.
45
+ *
46
+ * @returns The User's id
45
47
  */
46
48
  getId() {
47
49
  return this.wrapped.id;
48
50
  }
49
51
  /**
50
- * @returns The name of the User
52
+ * Gets the name of the User.
53
+ *
54
+ * @returns The User's name
51
55
  */
52
56
  getName() {
53
57
  return this.wrapped.name;
54
58
  }
55
59
  /**
56
- * @returns The full name of the User
60
+ * Gets the full name of the User.
61
+ *
62
+ * @returns The User's full name
57
63
  */
58
64
  getFullName() {
59
65
  return this.wrapped.fullName;
60
66
  }
61
67
  /**
62
- * @returns The User connections
68
+ * Gets the [[Connections]] of the User.
69
+ *
70
+ * @returns The retrieved Connection objects
63
71
  */
64
72
  getConnections() {
65
73
  return __awaiter(this, void 0, void 0, function* () {
@@ -67,6 +75,13 @@ class User {
67
75
  return json.map(c => new Connection_1.Connection(c));
68
76
  });
69
77
  }
78
+ /**
79
+ * Gets a [[Connection]] of the User.
80
+ *
81
+ * @param id - The Connection's id
82
+ *
83
+ * @returns The retrieved Connection object
84
+ */
70
85
  getConnection(id) {
71
86
  return __awaiter(this, void 0, void 0, function* () {
72
87
  const json = yield ConnectionService.getConnection(id);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bkper",
3
- "version": "2.6.2",
3
+ "version": "2.6.3",
4
4
  "description": "Node.js client for Bkper REST API",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -46,7 +46,7 @@
46
46
  "open": "^7.3.1"
47
47
  },
48
48
  "devDependencies": {
49
- "@bkper/bkper-api-types": "^5.4.0",
49
+ "@bkper/bkper-api-types": "^5.5.0",
50
50
  "@microsoft/api-extractor": "^7.12.1",
51
51
  "@types/big.js": "^6.0.2",
52
52
  "@types/chai": "^4.2.14",