bkper-js 2.16.1 → 2.16.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/model/Bkper.js +2 -2
- package/lib/model/Book.js +7 -7
- package/lib/model/Collection.js +4 -4
- package/lib/model/Connection.js +1 -1
- package/lib/model/Event.js +1 -1
- package/lib/model/User.js +2 -2
- package/package.json +1 -1
package/lib/model/Bkper.js
CHANGED
|
@@ -125,7 +125,7 @@ export class Bkper {
|
|
|
125
125
|
getApps() {
|
|
126
126
|
return __awaiter(this, void 0, void 0, function* () {
|
|
127
127
|
let apps = yield AppService.getApps(this.config);
|
|
128
|
-
return apps.map((app) => new App(app));
|
|
128
|
+
return apps.map((app) => new App(app, this.config));
|
|
129
129
|
});
|
|
130
130
|
}
|
|
131
131
|
/**
|
|
@@ -136,7 +136,7 @@ export class Bkper {
|
|
|
136
136
|
getTemplates() {
|
|
137
137
|
return __awaiter(this, void 0, void 0, function* () {
|
|
138
138
|
let templates = yield TemplateService.getTemplates(this.config);
|
|
139
|
-
return templates.map((template) => new Template(template));
|
|
139
|
+
return templates.map((template) => new Template(template, this.config));
|
|
140
140
|
});
|
|
141
141
|
}
|
|
142
142
|
/**
|
package/lib/model/Book.js
CHANGED
|
@@ -192,7 +192,7 @@ export class Book extends ResourceProperty {
|
|
|
192
192
|
*/
|
|
193
193
|
getCollection() {
|
|
194
194
|
if (this.payload.collection != null && this.collection == null) {
|
|
195
|
-
this.collection = new Collection(this.payload.collection);
|
|
195
|
+
this.collection = new Collection(this.payload.collection, this.config);
|
|
196
196
|
}
|
|
197
197
|
return this.collection;
|
|
198
198
|
}
|
|
@@ -612,7 +612,7 @@ export class Book extends ResourceProperty {
|
|
|
612
612
|
return this.apps;
|
|
613
613
|
}
|
|
614
614
|
const appsPlain = yield BookService.getApps(this.getId(), this.getConfig());
|
|
615
|
-
this.apps = appsPlain.map((a) => new App(a));
|
|
615
|
+
this.apps = appsPlain.map((a) => new App(a, this.config));
|
|
616
616
|
return this.apps;
|
|
617
617
|
});
|
|
618
618
|
}
|
|
@@ -624,7 +624,7 @@ export class Book extends ResourceProperty {
|
|
|
624
624
|
getIntegrations() {
|
|
625
625
|
return __awaiter(this, void 0, void 0, function* () {
|
|
626
626
|
const integrationsPlain = yield IntegrationService.listIntegrations(this.getId(), this.getConfig());
|
|
627
|
-
const integrations = integrationsPlain.map((i) => new Integration(i));
|
|
627
|
+
const integrations = integrationsPlain.map((i) => new Integration(i, this.config));
|
|
628
628
|
return integrations;
|
|
629
629
|
});
|
|
630
630
|
}
|
|
@@ -643,7 +643,7 @@ export class Book extends ResourceProperty {
|
|
|
643
643
|
else {
|
|
644
644
|
integration = yield IntegrationService.createIntegration(this.getId(), integration, this.getConfig());
|
|
645
645
|
}
|
|
646
|
-
return new Integration(integration);
|
|
646
|
+
return new Integration(integration, this.config);
|
|
647
647
|
});
|
|
648
648
|
}
|
|
649
649
|
/**
|
|
@@ -661,7 +661,7 @@ export class Book extends ResourceProperty {
|
|
|
661
661
|
else {
|
|
662
662
|
integration = yield IntegrationService.updateIntegration(this.getId(), integration, this.getConfig());
|
|
663
663
|
}
|
|
664
|
-
return new Integration(integration);
|
|
664
|
+
return new Integration(integration, this.config);
|
|
665
665
|
});
|
|
666
666
|
}
|
|
667
667
|
/**
|
|
@@ -1100,7 +1100,7 @@ export class Book extends ResourceProperty {
|
|
|
1100
1100
|
copy(name, copyTransactions, fromDate) {
|
|
1101
1101
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1102
1102
|
const copiedBookPayload = yield BookService.copyBook(this.getId(), name, copyTransactions, fromDate, this.getConfig());
|
|
1103
|
-
return new Book(copiedBookPayload);
|
|
1103
|
+
return new Book(copiedBookPayload, this.config);
|
|
1104
1104
|
});
|
|
1105
1105
|
}
|
|
1106
1106
|
/**
|
|
@@ -1188,7 +1188,7 @@ export class Book extends ResourceProperty {
|
|
|
1188
1188
|
getBacklog() {
|
|
1189
1189
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1190
1190
|
const backlogPayload = yield EventService.getBacklog(this, this.getConfig());
|
|
1191
|
-
return new Backlog(backlogPayload);
|
|
1191
|
+
return new Backlog(backlogPayload, this.config);
|
|
1192
1192
|
});
|
|
1193
1193
|
}
|
|
1194
1194
|
}
|
package/lib/model/Collection.js
CHANGED
|
@@ -81,7 +81,7 @@ export class Collection extends Resource {
|
|
|
81
81
|
return books;
|
|
82
82
|
}
|
|
83
83
|
for (const bookPayload of this.payload.books) {
|
|
84
|
-
let book = new Book(bookPayload);
|
|
84
|
+
let book = new Book(bookPayload, this.config);
|
|
85
85
|
books.push(book);
|
|
86
86
|
}
|
|
87
87
|
return books;
|
|
@@ -99,7 +99,7 @@ export class Collection extends Resource {
|
|
|
99
99
|
if (collectionId && books.length > 0) {
|
|
100
100
|
const bookList = { items: books.map((b) => b.json()) };
|
|
101
101
|
let addedBooks = yield CollectionService.addBooksToCollection(collectionId, bookList, this.getConfig());
|
|
102
|
-
return addedBooks.map((book) => new Book(book));
|
|
102
|
+
return addedBooks.map((book) => new Book(book, this.config));
|
|
103
103
|
}
|
|
104
104
|
return [];
|
|
105
105
|
});
|
|
@@ -117,7 +117,7 @@ export class Collection extends Resource {
|
|
|
117
117
|
if (collectionId && books.length > 0) {
|
|
118
118
|
const bookList = { items: books.map((b) => b.json()) };
|
|
119
119
|
let removedBooks = yield CollectionService.removeBooksFromCollection(collectionId, bookList, this.getConfig());
|
|
120
|
-
return removedBooks.map((book) => new Book(book));
|
|
120
|
+
return removedBooks.map((book) => new Book(book, this.config));
|
|
121
121
|
}
|
|
122
122
|
return [];
|
|
123
123
|
});
|
|
@@ -160,7 +160,7 @@ export class Collection extends Resource {
|
|
|
160
160
|
remove() {
|
|
161
161
|
return __awaiter(this, void 0, void 0, function* () {
|
|
162
162
|
let books = yield CollectionService.deleteCollection(this.payload, this.getConfig());
|
|
163
|
-
return books.map((book) => new Book(book));
|
|
163
|
+
return books.map((book) => new Book(book, this.config));
|
|
164
164
|
});
|
|
165
165
|
}
|
|
166
166
|
}
|
package/lib/model/Connection.js
CHANGED
|
@@ -153,7 +153,7 @@ export class Connection extends ResourceProperty {
|
|
|
153
153
|
return [];
|
|
154
154
|
}
|
|
155
155
|
const integrationsPlain = yield ConnectionService.listIntegrations(id, this.getConfig());
|
|
156
|
-
const integrations = integrationsPlain.map((i) => new Integration(i));
|
|
156
|
+
const integrations = integrationsPlain.map((i) => new Integration(i, this.config));
|
|
157
157
|
return integrations;
|
|
158
158
|
});
|
|
159
159
|
}
|
package/lib/model/Event.js
CHANGED
|
@@ -45,7 +45,7 @@ export class Event {
|
|
|
45
45
|
* @returns The user who performed the Event
|
|
46
46
|
*/
|
|
47
47
|
getUser() {
|
|
48
|
-
return this.payload.user ? new User(this.payload.user) : undefined;
|
|
48
|
+
return this.payload.user ? new User(this.payload.user, this.book.getConfig()) : undefined;
|
|
49
49
|
}
|
|
50
50
|
/**
|
|
51
51
|
* Gets the Agent who performed the Event.
|
package/lib/model/User.js
CHANGED
|
@@ -133,7 +133,7 @@ export class User extends Resource {
|
|
|
133
133
|
getConnections() {
|
|
134
134
|
return __awaiter(this, void 0, void 0, function* () {
|
|
135
135
|
const json = yield ConnectionService.listConnections(this.getConfig());
|
|
136
|
-
return json.map((c) => new Connection(c));
|
|
136
|
+
return json.map((c) => new Connection(c, this.config));
|
|
137
137
|
});
|
|
138
138
|
}
|
|
139
139
|
/**
|
|
@@ -146,7 +146,7 @@ export class User extends Resource {
|
|
|
146
146
|
getConnection(id) {
|
|
147
147
|
return __awaiter(this, void 0, void 0, function* () {
|
|
148
148
|
const json = yield ConnectionService.getConnection(id, this.getConfig());
|
|
149
|
-
return new Connection(json);
|
|
149
|
+
return new Connection(json, this.config);
|
|
150
150
|
});
|
|
151
151
|
}
|
|
152
152
|
}
|