@icure/api 8.0.20 → 8.0.22
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/icc-api/api/IccAccesslogApi.d.ts +11 -0
- package/icc-api/api/IccAccesslogApi.js +29 -0
- package/icc-api/api/IccAccesslogApi.js.map +1 -1
- package/icc-api/api/IccAgendaApi.d.ts +10 -0
- package/icc-api/api/IccAgendaApi.js +30 -6
- package/icc-api/api/IccAgendaApi.js.map +1 -1
- package/icc-api/api/IccArticleApi.d.ts +10 -0
- package/icc-api/api/IccArticleApi.js +26 -4
- package/icc-api/api/IccArticleApi.js.map +1 -1
- package/icc-api/api/IccCalendarItemApi.d.ts +22 -1
- package/icc-api/api/IccCalendarItemApi.js +52 -12
- package/icc-api/api/IccCalendarItemApi.js.map +1 -1
- package/icc-api/api/IccCalendarItemTypeApi.d.ts +18 -2
- package/icc-api/api/IccCalendarItemTypeApi.js +47 -10
- package/icc-api/api/IccCalendarItemTypeApi.js.map +1 -1
- package/icc-api/api/IccClassificationApi.d.ts +12 -1
- package/icc-api/api/IccClassificationApi.js +26 -1
- package/icc-api/api/IccClassificationApi.js.map +1 -1
- package/icc-api/api/IccClassificationTemplateApi.d.ts +12 -2
- package/icc-api/api/IccClassificationTemplateApi.js +26 -2
- package/icc-api/api/IccClassificationTemplateApi.js.map +1 -1
- package/icc-api/api/IccCodeApi.d.ts +2 -2
- package/icc-api/api/IccCodeApi.js +20 -7
- package/icc-api/api/IccCodeApi.js.map +1 -1
- package/icc-api/api/IccContactApi.d.ts +10 -0
- package/icc-api/api/IccContactApi.js +24 -0
- package/icc-api/api/IccContactApi.js.map +1 -1
- package/icc-api/api/IccDoctemplateApi.d.ts +10 -1
- package/icc-api/api/IccDoctemplateApi.js +25 -4
- package/icc-api/api/IccDoctemplateApi.js.map +1 -1
- package/icc-api/api/IccDocumentApi.d.ts +13 -2
- package/icc-api/api/IccDocumentApi.js +27 -2
- package/icc-api/api/IccDocumentApi.js.map +1 -1
- package/icc-api/api/IccFormApi.d.ts +12 -1
- package/icc-api/api/IccFormApi.js +27 -1
- package/icc-api/api/IccFormApi.js.map +1 -1
- package/icc-api/api/IccHcpartyApi.d.ts +3 -1
- package/icc-api/api/IccHcpartyApi.js +31 -24
- package/icc-api/api/IccHcpartyApi.js.map +1 -1
- package/icc-api/api/IccHelementApi.d.ts +13 -4
- package/icc-api/api/IccHelementApi.js +28 -4
- package/icc-api/api/IccHelementApi.js.map +1 -1
- package/icc-api/api/IccInvoiceApi.d.ts +11 -1
- package/icc-api/api/IccInvoiceApi.js +26 -1
- package/icc-api/api/IccInvoiceApi.js.map +1 -1
- package/icc-api/api/IccKeywordApi.d.ts +10 -2
- package/icc-api/api/IccKeywordApi.js +24 -6
- package/icc-api/api/IccKeywordApi.js.map +1 -1
- package/icc-api/api/IccMedicallocationApi.d.ts +10 -2
- package/icc-api/api/IccMedicallocationApi.js +25 -7
- package/icc-api/api/IccMedicallocationApi.js.map +1 -1
- package/icc-api/api/IccMessageApi.d.ts +10 -2
- package/icc-api/api/IccMessageApi.js +23 -2
- package/icc-api/api/IccMessageApi.js.map +1 -1
- package/icc-api/api/IccPatientApi.d.ts +2 -1
- package/icc-api/api/IccPatientApi.js +10 -9
- package/icc-api/api/IccPatientApi.js.map +1 -1
- package/icc-api/api/IccPlaceApi.d.ts +9 -1
- package/icc-api/api/IccPlaceApi.js +24 -6
- package/icc-api/api/IccPlaceApi.js.map +1 -1
- package/icc-api/model/PaginatedListAgenda.d.ts +9 -0
- package/icc-api/model/PaginatedListAgenda.js +10 -0
- package/icc-api/model/PaginatedListAgenda.js.map +1 -0
- package/icc-api/model/PaginatedListArticle.d.ts +9 -0
- package/icc-api/model/PaginatedListArticle.js +10 -0
- package/icc-api/model/PaginatedListArticle.js.map +1 -0
- package/icc-api/model/PaginatedListCalendarItem.d.ts +9 -0
- package/icc-api/model/PaginatedListCalendarItem.js +10 -0
- package/icc-api/model/PaginatedListCalendarItem.js.map +1 -0
- package/icc-api/model/PaginatedListCalendarItemType.d.ts +9 -0
- package/icc-api/model/PaginatedListCalendarItemType.js +10 -0
- package/icc-api/model/PaginatedListCalendarItemType.js.map +1 -0
- package/icc-api/model/PaginatedListDocumentTemplate.d.ts +9 -0
- package/icc-api/model/PaginatedListDocumentTemplate.js +10 -0
- package/icc-api/model/PaginatedListDocumentTemplate.js.map +1 -0
- package/icc-api/model/PaginatedListKeyword.d.ts +9 -0
- package/icc-api/model/PaginatedListKeyword.js +10 -0
- package/icc-api/model/PaginatedListKeyword.js.map +1 -0
- package/icc-api/model/PaginatedListPlace.d.ts +9 -0
- package/icc-api/model/PaginatedListPlace.js +10 -0
- package/icc-api/model/PaginatedListPlace.js.map +1 -0
- package/icc-x-api/icc-accesslog-x-api.d.ts +1 -0
- package/icc-x-api/icc-accesslog-x-api.js +14 -0
- package/icc-x-api/icc-accesslog-x-api.js.map +1 -1
- package/icc-x-api/icc-calendar-item-x-api.d.ts +13 -0
- package/icc-x-api/icc-calendar-item-x-api.js +59 -1
- package/icc-x-api/icc-calendar-item-x-api.js.map +1 -1
- package/icc-x-api/icc-classification-x-api.js.map +1 -1
- package/icc-x-api/icc-contact-x-api.d.ts +1 -0
- package/icc-x-api/icc-contact-x-api.js +15 -0
- package/icc-x-api/icc-contact-x-api.js.map +1 -1
- package/icc-x-api/icc-helement-x-api.d.ts +2 -0
- package/icc-x-api/icc-helement-x-api.js +18 -0
- package/icc-x-api/icc-helement-x-api.js.map +1 -1
- package/icc-x-api/icc-patient-x-api.d.ts +2 -2
- package/icc-x-api/icc-patient-x-api.js +3 -3
- package/icc-x-api/icc-patient-x-api.js.map +1 -1
- package/package.json +1 -1
- package/test/icc-api/api/IccAgendaApi.d.ts +1 -0
- package/test/icc-api/api/IccAgendaApi.js +64 -0
- package/test/icc-api/api/IccAgendaApi.js.map +1 -0
- package/test/icc-api/api/IccArticleApi.d.ts +1 -0
- package/test/icc-api/api/IccArticleApi.js +64 -0
- package/test/icc-api/api/IccArticleApi.js.map +1 -0
- package/test/icc-api/api/IccCalendarItemApi.d.ts +1 -0
- package/test/icc-api/api/IccCalendarItemApi.js +67 -0
- package/test/icc-api/api/IccCalendarItemApi.js.map +1 -0
- package/test/icc-api/api/IccCalendarItemTypeApi.d.ts +1 -0
- package/test/icc-api/api/IccCalendarItemTypeApi.js +96 -0
- package/test/icc-api/api/IccCalendarItemTypeApi.js.map +1 -0
- package/test/icc-api/api/IccCodeApi.d.ts +1 -0
- package/test/icc-api/api/IccCodeApi.js +38 -0
- package/test/icc-api/api/IccCodeApi.js.map +1 -0
- package/test/icc-api/api/IccKeywordApi.d.ts +1 -0
- package/test/icc-api/api/IccKeywordApi.js +64 -0
- package/test/icc-api/api/IccKeywordApi.js.map +1 -0
- package/test/icc-api/api/IccMedicalLocationApi.d.ts +1 -0
- package/test/icc-api/api/IccMedicalLocationApi.js +64 -0
- package/test/icc-api/api/IccMedicalLocationApi.js.map +1 -0
- package/test/icc-api/api/IccPlaceApi.d.ts +1 -0
- package/test/icc-api/api/IccPlaceApi.js +64 -0
- package/test/icc-api/api/IccPlaceApi.js.map +1 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const crypto_1 = require("crypto");
|
|
13
|
+
const test_utils_1 = require("../../utils/test_utils");
|
|
14
|
+
require("isomorphic-fetch");
|
|
15
|
+
var initMasterApi = test_utils_1.TestUtils.initMasterApi;
|
|
16
|
+
const chai_1 = require("chai");
|
|
17
|
+
const types_1 = require("@icure/test-setup/types");
|
|
18
|
+
const mocha_1 = require("mocha");
|
|
19
|
+
const Article_1 = require("../../../icc-api/model/Article");
|
|
20
|
+
(0, test_utils_1.setLocalStorage)(fetch);
|
|
21
|
+
let env;
|
|
22
|
+
let api;
|
|
23
|
+
const entities = [];
|
|
24
|
+
(0, mocha_1.describe)('IccArticleApi', () => {
|
|
25
|
+
before(function () {
|
|
26
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
27
|
+
this.timeout(600000);
|
|
28
|
+
const initializer = yield (0, test_utils_1.getEnvironmentInitializer)();
|
|
29
|
+
env = yield initializer.execute((0, types_1.getEnvVariables)());
|
|
30
|
+
api = (yield initMasterApi(env)).articleApi;
|
|
31
|
+
for (let i = 0; i < 10; i++) {
|
|
32
|
+
const entity = yield api.createArticle(new Article_1.Article({
|
|
33
|
+
id: (0, crypto_1.randomUUID)(),
|
|
34
|
+
name: (0, crypto_1.randomUUID)(),
|
|
35
|
+
}));
|
|
36
|
+
entities.push(entity);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
it('Should be able of getting the Articles using the deprecated method', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
41
|
+
const page = yield api.getArticles();
|
|
42
|
+
page.forEach((it) => {
|
|
43
|
+
const existingEntity = entities.find((a) => a.id === it.id);
|
|
44
|
+
(0, chai_1.expect)(existingEntity).not.to.be.undefined;
|
|
45
|
+
(0, chai_1.expect)(it.rev).to.be.eq(existingEntity.rev);
|
|
46
|
+
});
|
|
47
|
+
}));
|
|
48
|
+
it('Should be able of getting the Agendas with pagination', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
49
|
+
var _a;
|
|
50
|
+
const firstPage = yield api.getArticlesWithPagination(undefined, 6);
|
|
51
|
+
(0, chai_1.expect)(firstPage.nextKeyPair).not.to.be.undefined;
|
|
52
|
+
(0, chai_1.expect)(firstPage.rows).not.to.be.undefined;
|
|
53
|
+
const secondPage = yield api.getArticlesWithPagination((_a = firstPage.nextKeyPair) === null || _a === void 0 ? void 0 : _a.startKeyDocId, 6);
|
|
54
|
+
(0, chai_1.expect)(secondPage.nextKeyPair).to.be.undefined;
|
|
55
|
+
(0, chai_1.expect)(secondPage.rows).not.to.be.undefined;
|
|
56
|
+
const rows = firstPage.rows.concat(secondPage.rows);
|
|
57
|
+
rows.forEach((it) => {
|
|
58
|
+
const existingEntity = entities.find((a) => a.id === it.id);
|
|
59
|
+
(0, chai_1.expect)(existingEntity).not.to.be.undefined;
|
|
60
|
+
(0, chai_1.expect)(it.rev).to.be.eq(existingEntity.rev);
|
|
61
|
+
});
|
|
62
|
+
}));
|
|
63
|
+
});
|
|
64
|
+
//# sourceMappingURL=IccArticleApi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IccArticleApi.js","sourceRoot":"","sources":["../../../../test/icc-api/api/IccArticleApi.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,mCAAmC;AACnC,uDAA8F;AAC9F,4BAAyB;AACzB,IAAO,aAAa,GAAG,sBAAS,CAAC,aAAa,CAAA;AAC9C,+BAA6B;AAC7B,mDAAmE;AAEnE,iCAAgC;AAChC,4DAAwD;AAExD,IAAA,4BAAe,EAAC,KAAK,CAAC,CAAA;AAEtB,IAAI,GAAa,CAAA;AACjB,IAAI,GAAkB,CAAA;AACtB,MAAM,QAAQ,GAAc,EAAE,CAAA;AAE9B,IAAA,gBAAQ,EAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,MAAM,CAAC;;YACL,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;YACpB,MAAM,WAAW,GAAG,MAAM,IAAA,sCAAyB,GAAE,CAAA;YACrD,GAAG,GAAG,MAAM,WAAW,CAAC,OAAO,CAAC,IAAA,uB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AS,CAAA;QACjD,IAAA,aAAM,EAAC,SAAS,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,SAAS,CAAA;QAE1C,MAAM,UAAU,GAAG,MAAM,GAAG,CAAC,yBAAyB,CAAC,MAAA,SAAS,CAAC,WAAW,0CAAE,aAAa,EAAE,CAAC,CAAC,CAAA;QAC/F,IAAA,aAAM,EAAC,UAAU,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,SAAS,CAAA;QAC9C,IAAA,aAAM,EAAC,UAAU,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,SAAS,CAAA;QAE3C,MAAM,IAAI,GAAG,SAAS,CAAC,IAAM,CAAC,MAAM,CAAC,UAAU,CAAC,IAAM,CAAC,CAAA;QACvD,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE;YAClB,MAAM,cAAc,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAA;YAC3D,IAAA,aAAM,EAAC,cAAc,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,SAAS,CAAA;YAC1C,IAAA,aAAM,EAAC,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,cAAgB,CAAC,GAAK,CAAC,CAAA;QACjD,CAAC,CAAC,CAAA;IACJ,CAAC,CAAA,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA","sourcesContent":["import { randomUUID } from 'crypto'\nimport { getEnvironmentInitializer, setLocalStorage, TestUtils } from '../../utils/test_utils'\nimport 'isomorphic-fetch'\nimport initMasterApi = TestUtils.initMasterApi\nimport { expect } from 'chai'\nimport { getEnvVariables, TestVars } from '@icure/test-setup/types'\nimport { IccArticleApi } from '../../../icc-api'\nimport { describe } from 'mocha'\nimport { Article } from '../../../icc-api/model/Article'\n\nsetLocalStorage(fetch)\n\nlet env: TestVars\nlet api: IccArticleApi\nconst entities: Article[] = []\n\ndescribe('IccArticleApi', () => {\n before(async function () {\n this.timeout(600000)\n const initializer = await getEnvironmentInitializer()\n env = await initializer.execute(getEnvVariables())\n api = (await initMasterApi(env)).articleApi\n\n for (let i = 0; i < 10; i++) {\n const entity = await api.createArticle(\n new Article({\n id: randomUUID(),\n name: randomUUID(),\n })\n )\n entities.push(entity)\n }\n })\n\n it('Should be able of getting the Articles using the deprecated method', async () => {\n const page = await api.getArticles()\n page.forEach((it) => {\n const existingEntity = entities.find((a) => a.id === it.id)\n expect(existingEntity).not.to.be.undefined\n expect(it.rev).to.be.eq(existingEntity!!.rev!!)\n })\n })\n\n it('Should be able of getting the Agendas with pagination', async () => {\n const firstPage = await api.getArticlesWithPagination(undefined, 6)\n expect(firstPage.nextKeyPair).not.to.be.undefined\n expect(firstPage.rows).not.to.be.undefined\n\n const secondPage = await api.getArticlesWithPagination(firstPage.nextKeyPair?.startKeyDocId, 6)\n expect(secondPage.nextKeyPair).to.be.undefined\n expect(secondPage.rows).not.to.be.undefined\n\n const rows = firstPage.rows!!.concat(secondPage.rows!!)\n rows.forEach((it) => {\n const existingEntity = entities.find((a) => a.id === it.id)\n expect(existingEntity).not.to.be.undefined\n expect(it.rev).to.be.eq(existingEntity!!.rev!!)\n })\n })\n})\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import 'isomorphic-fetch';
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const crypto_1 = require("crypto");
|
|
13
|
+
const test_utils_1 = require("../../utils/test_utils");
|
|
14
|
+
require("isomorphic-fetch");
|
|
15
|
+
var initMasterApi = test_utils_1.TestUtils.initMasterApi;
|
|
16
|
+
const chai_1 = require("chai");
|
|
17
|
+
const types_1 = require("@icure/test-setup/types");
|
|
18
|
+
const mocha_1 = require("mocha");
|
|
19
|
+
const CalendarItem_1 = require("../../../icc-api/model/CalendarItem");
|
|
20
|
+
(0, test_utils_1.setLocalStorage)(fetch);
|
|
21
|
+
let env;
|
|
22
|
+
let api;
|
|
23
|
+
let user;
|
|
24
|
+
const entities = [];
|
|
25
|
+
(0, mocha_1.describe)('IccCalendarItemApi', () => {
|
|
26
|
+
before(function () {
|
|
27
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
+
this.timeout(600000);
|
|
29
|
+
const initializer = yield (0, test_utils_1.getEnvironmentInitializer)();
|
|
30
|
+
env = yield initializer.execute((0, types_1.getEnvVariables)());
|
|
31
|
+
const masterApi = yield initMasterApi(env);
|
|
32
|
+
user = yield masterApi.userApi.getCurrentUser();
|
|
33
|
+
api = masterApi.calendarItemApi;
|
|
34
|
+
for (let i = 0; i < 10; i++) {
|
|
35
|
+
const entity = (yield api.createCalendarItemWithHcParty(user, yield api.newInstance(user, new CalendarItem_1.CalendarItem({
|
|
36
|
+
id: (0, crypto_1.randomUUID)(),
|
|
37
|
+
name: (0, crypto_1.randomUUID)(),
|
|
38
|
+
}))));
|
|
39
|
+
entities.push(entity);
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
it('Should be able of getting the CalendarItems using the deprecated method', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
44
|
+
const page = (yield api.getCalendarItemsWithUser(user));
|
|
45
|
+
page.forEach((it) => {
|
|
46
|
+
const existingEntity = entities.find((a) => a.id === it.id);
|
|
47
|
+
(0, chai_1.expect)(existingEntity).not.to.be.undefined;
|
|
48
|
+
(0, chai_1.expect)(it.rev).to.be.eq(existingEntity.rev);
|
|
49
|
+
});
|
|
50
|
+
}));
|
|
51
|
+
it('Should be able of getting the CalendarItems with pagination', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
52
|
+
var _a;
|
|
53
|
+
const firstPage = yield api.getCalendarItemsWithPaginationWithUser(user, undefined, 6);
|
|
54
|
+
(0, chai_1.expect)(firstPage.nextKeyPair).not.to.be.undefined;
|
|
55
|
+
(0, chai_1.expect)(firstPage.rows).not.to.be.undefined;
|
|
56
|
+
const secondPage = yield api.getCalendarItemsWithPaginationWithUser(user, (_a = firstPage.nextKeyPair) === null || _a === void 0 ? void 0 : _a.startKeyDocId, 6);
|
|
57
|
+
(0, chai_1.expect)(secondPage.nextKeyPair).to.be.undefined;
|
|
58
|
+
(0, chai_1.expect)(secondPage.rows).not.to.be.undefined;
|
|
59
|
+
const rows = firstPage.rows.concat(secondPage.rows);
|
|
60
|
+
rows.forEach((it) => {
|
|
61
|
+
const existingEntity = entities.find((a) => a.id === it.id);
|
|
62
|
+
(0, chai_1.expect)(existingEntity).not.to.be.undefined;
|
|
63
|
+
(0, chai_1.expect)(it.rev).to.be.eq(existingEntity.rev);
|
|
64
|
+
});
|
|
65
|
+
}));
|
|
66
|
+
});
|
|
67
|
+
//# sourceMappingURL=IccCalendarItemApi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IccCalendarItemApi.js","sourceRoot":"","sources":["../../../../test/icc-api/api/IccCalendarItemApi.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,mCAAmC;AACnC,uDAA8F;AAC9F,4BAAyB;AACzB,IAAO,aAAa,GAAG,sBAAS,CAAC,aAAa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,EAAE,EAAE,EAAE;YAClB,MAAM,cAAc,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAA;YAC3D,IAAA,aAAM,EAAC,cAAc,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,SAAS,CAAA;YAC1C,IAAA,aAAM,EAAC,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,cAAgB,CAAC,GAAK,CAAC,CAAA;QACjD,CAAC,CAAC,CAAA;IACJ,CAAC,CAAA,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA","sourcesContent":["import { randomUUID } from 'crypto'\nimport { getEnvironmentInitializer, setLocalStorage, TestUtils } from '../../utils/test_utils'\nimport 'isomorphic-fetch'\nimport initMasterApi = TestUtils.initMasterApi\nimport { expect } from 'chai'\nimport { getEnvVariables, TestVars } from '@icure/test-setup/types'\nimport { describe } from 'mocha'\nimport { IccCalendarItemXApi } from '../../../icc-x-api'\nimport { CalendarItem } from '../../../icc-api/model/CalendarItem'\nimport { User } from '../../../icc-api/model/User'\n\nsetLocalStorage(fetch)\n\nlet env: TestVars\nlet api: IccCalendarItemXApi\nlet user: User\nconst entities: CalendarItem[] = []\n\ndescribe('IccCalendarItemApi', () => {\n before(async function () {\n this.timeout(600000)\n const initializer = await getEnvironmentInitializer()\n env = await initializer.execute(getEnvVariables())\n const masterApi = await initMasterApi(env)\n user = await masterApi.userApi.getCurrentUser()\n api = masterApi.calendarItemApi\n\n for (let i = 0; i < 10; i++) {\n const entity = (await api.createCalendarItemWithHcParty(\n user,\n await api.newInstance(\n user,\n new CalendarItem({\n id: randomUUID(),\n name: randomUUID(),\n })\n )\n )) as CalendarItem\n entities.push(entity)\n }\n })\n\n it('Should be able of getting the CalendarItems using the deprecated method', async () => {\n const page = (await api.getCalendarItemsWithUser(user)) as CalendarItem[]\n page.forEach((it) => {\n const existingEntity = entities.find((a) => a.id === it.id)\n expect(existingEntity).not.to.be.undefined\n expect(it.rev).to.be.eq(existingEntity!!.rev!!)\n })\n })\n\n it('Should be able of getting the CalendarItems with pagination', async () => {\n const firstPage = await api.getCalendarItemsWithPaginationWithUser(user, undefined, 6)\n expect(firstPage.nextKeyPair).not.to.be.undefined\n expect(firstPage.rows).not.to.be.undefined\n\n const secondPage = await api.getCalendarItemsWithPaginationWithUser(user, firstPage.nextKeyPair?.startKeyDocId, 6)\n expect(secondPage.nextKeyPair).to.be.undefined\n expect(secondPage.rows).not.to.be.undefined\n\n const rows = firstPage.rows!!.concat(secondPage.rows!!)\n rows.forEach((it) => {\n const existingEntity = entities.find((a) => a.id === it.id)\n expect(existingEntity).not.to.be.undefined\n expect(it.rev).to.be.eq(existingEntity!!.rev!!)\n })\n })\n})\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import 'isomorphic-fetch';
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const crypto_1 = require("crypto");
|
|
13
|
+
const test_utils_1 = require("../../utils/test_utils");
|
|
14
|
+
require("isomorphic-fetch");
|
|
15
|
+
var initMasterApi = test_utils_1.TestUtils.initMasterApi;
|
|
16
|
+
const chai_1 = require("chai");
|
|
17
|
+
const types_1 = require("@icure/test-setup/types");
|
|
18
|
+
const mocha_1 = require("mocha");
|
|
19
|
+
const CalendarItemType_1 = require("../../../icc-api/model/CalendarItemType");
|
|
20
|
+
(0, test_utils_1.setLocalStorage)(fetch);
|
|
21
|
+
let env;
|
|
22
|
+
let api;
|
|
23
|
+
const entities = [];
|
|
24
|
+
const deletedEntities = [];
|
|
25
|
+
(0, mocha_1.describe)('IccCalendarItemType', () => {
|
|
26
|
+
before(function () {
|
|
27
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
+
this.timeout(600000);
|
|
29
|
+
const initializer = yield (0, test_utils_1.getEnvironmentInitializer)();
|
|
30
|
+
env = yield initializer.execute((0, types_1.getEnvVariables)());
|
|
31
|
+
api = (yield initMasterApi(env)).calendarItemTypeApi;
|
|
32
|
+
for (let i = 0; i < 10; i++) {
|
|
33
|
+
const entity = yield api.createCalendarItemType(new CalendarItemType_1.CalendarItemType({
|
|
34
|
+
id: (0, crypto_1.randomUUID)(),
|
|
35
|
+
name: (0, crypto_1.randomUUID)(),
|
|
36
|
+
}));
|
|
37
|
+
entities.push(entity);
|
|
38
|
+
const deletedEntity = yield api.createCalendarItemType(new CalendarItemType_1.CalendarItemType({
|
|
39
|
+
id: (0, crypto_1.randomUUID)(),
|
|
40
|
+
deletionDate: new Date().getTime(),
|
|
41
|
+
name: (0, crypto_1.randomUUID)(),
|
|
42
|
+
}));
|
|
43
|
+
deletedEntities.push(deletedEntity);
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
it('Should be able of getting the CalendarItemTypes using the deprecated method', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
48
|
+
const page = yield api.getCalendarItemTypes();
|
|
49
|
+
page.forEach((it) => {
|
|
50
|
+
const existingEntity = entities.find((a) => a.id === it.id);
|
|
51
|
+
(0, chai_1.expect)(existingEntity).not.to.be.undefined;
|
|
52
|
+
(0, chai_1.expect)(it.rev).to.be.eq(existingEntity.rev);
|
|
53
|
+
});
|
|
54
|
+
}));
|
|
55
|
+
it('Should be able of getting the CalendarItemTypes with pagination', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
56
|
+
var _a;
|
|
57
|
+
const firstPage = yield api.getCalendarItemTypesWithPagination(undefined, 6);
|
|
58
|
+
(0, chai_1.expect)(firstPage.nextKeyPair).not.to.be.undefined;
|
|
59
|
+
(0, chai_1.expect)(firstPage.rows).not.to.be.undefined;
|
|
60
|
+
const secondPage = yield api.getCalendarItemTypesWithPagination((_a = firstPage.nextKeyPair) === null || _a === void 0 ? void 0 : _a.startKeyDocId, 6);
|
|
61
|
+
(0, chai_1.expect)(secondPage.nextKeyPair).to.be.undefined;
|
|
62
|
+
(0, chai_1.expect)(secondPage.rows).not.to.be.undefined;
|
|
63
|
+
const rows = firstPage.rows.concat(secondPage.rows);
|
|
64
|
+
rows.forEach((it) => {
|
|
65
|
+
const existingEntity = entities.find((a) => a.id === it.id);
|
|
66
|
+
(0, chai_1.expect)(existingEntity).not.to.be.undefined;
|
|
67
|
+
(0, chai_1.expect)(it.rev).to.be.eq(existingEntity.rev);
|
|
68
|
+
});
|
|
69
|
+
}));
|
|
70
|
+
it('Should be able of getting the CalendarItemTypes including deleted using the deprecated method', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
71
|
+
const page = yield api.getCalendarItemTypesIncludeDeleted();
|
|
72
|
+
const allEntities = entities.concat(deletedEntities);
|
|
73
|
+
page.forEach((it) => {
|
|
74
|
+
const existingEntity = allEntities.find((a) => a.id === it.id);
|
|
75
|
+
(0, chai_1.expect)(existingEntity).not.to.be.undefined;
|
|
76
|
+
(0, chai_1.expect)(it.rev).to.be.eq(existingEntity.rev);
|
|
77
|
+
});
|
|
78
|
+
}));
|
|
79
|
+
it('Should be able of getting the CalendarItemTypes including delete with pagination', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
80
|
+
var _b, _c;
|
|
81
|
+
const firstPage = yield api.getCalendarItemTypesIncludeDeletedWithPagination(undefined, undefined, 11);
|
|
82
|
+
(0, chai_1.expect)(firstPage.nextKeyPair).not.to.be.undefined;
|
|
83
|
+
(0, chai_1.expect)(firstPage.rows).not.to.be.undefined;
|
|
84
|
+
const secondPage = yield api.getCalendarItemTypesIncludeDeletedWithPagination((_b = firstPage.nextKeyPair) === null || _b === void 0 ? void 0 : _b.startKey, (_c = firstPage.nextKeyPair) === null || _c === void 0 ? void 0 : _c.startKeyDocId, 11);
|
|
85
|
+
(0, chai_1.expect)(secondPage.nextKeyPair).to.be.undefined;
|
|
86
|
+
(0, chai_1.expect)(secondPage.rows).not.to.be.undefined;
|
|
87
|
+
const rows = firstPage.rows.concat(secondPage.rows);
|
|
88
|
+
const allEntities = entities.concat(deletedEntities);
|
|
89
|
+
rows.forEach((it) => {
|
|
90
|
+
const existingEntity = allEntities.find((a) => a.id === it.id);
|
|
91
|
+
(0, chai_1.expect)(existingEntity).not.to.be.undefined;
|
|
92
|
+
(0, chai_1.expect)(it.rev).to.be.eq(existingEntity.rev);
|
|
93
|
+
});
|
|
94
|
+
}));
|
|
95
|
+
});
|
|
96
|
+
//# sourceMappingURL=IccCalendarItemTypeApi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IccCalendarItemTypeApi.js","sourceRoot":"","sources":["../../../../test/icc-api/api/IccCalendarItemTypeApi.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,mCAAmC;AACnC,uDAA8F;AAC9F,4BAAyB;AACzB,IAAO,aAAa,GAAG,sBAAS,CAAC,aAAa,CAAA;AAC9C,+BAA6B;AAC7B,mDAAmE;AAEnE,iCAAgC;AAChC,8EAA0E;AAE1E,IAAA,4BAAe,EAAC,KAAK,CAAC,CAAA;AAEtB,IAAI,GAAa,CAAA;AACjB,IAAI,GAA2B,CAAA;AAC/B,MAAM,QAAQ,GAAuB,EAAE,CAAA;AACvC,MAAM,eAAe,GAAuB,EAAE,CAAA;AAE9C,IAAA,gBAAQ,E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E1C,MAAM,UAAU,GAAG,MAAM,GAAG,CAAC,gDAAgD,CAC3E,MAAA,SAAS,CAAC,WAAW,0CAAE,QAAQ,EAC/B,MAAA,SAAS,CAAC,WAAW,0CAAE,aAAa,EACpC,EAAE,CACH,CAAA;QACD,IAAA,aAAM,EAAC,UAAU,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,SAAS,CAAA;QAC9C,IAAA,aAAM,EAAC,UAAU,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,SAAS,CAAA;QAE3C,MAAM,IAAI,GAAG,SAAS,CAAC,IAAM,CAAC,MAAM,CAAC,UAAU,CAAC,IAAM,CAAC,CAAA;QACvD,MAAM,WAAW,GAAG,QAAQ,CAAC,MAAM,CAAC,eAAe,CAAC,CAAA;QACpD,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE;YAClB,MAAM,cAAc,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAA;YAC9D,IAAA,aAAM,EAAC,cAAc,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,SAAS,CAAA;YAC1C,IAAA,aAAM,EAAC,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,cAAgB,CAAC,GAAK,CAAC,CAAA;QACjD,CAAC,CAAC,CAAA;IACJ,CAAC,CAAA,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA","sourcesContent":["import { randomUUID } from 'crypto'\nimport { getEnvironmentInitializer, setLocalStorage, TestUtils } from '../../utils/test_utils'\nimport 'isomorphic-fetch'\nimport initMasterApi = TestUtils.initMasterApi\nimport { expect } from 'chai'\nimport { getEnvVariables, TestVars } from '@icure/test-setup/types'\nimport { IccCalendarItemTypeApi } from '../../../icc-api'\nimport { describe } from 'mocha'\nimport { CalendarItemType } from '../../../icc-api/model/CalendarItemType'\n\nsetLocalStorage(fetch)\n\nlet env: TestVars\nlet api: IccCalendarItemTypeApi\nconst entities: CalendarItemType[] = []\nconst deletedEntities: CalendarItemType[] = []\n\ndescribe('IccCalendarItemType', () => {\n before(async function () {\n this.timeout(600000)\n const initializer = await getEnvironmentInitializer()\n env = await initializer.execute(getEnvVariables())\n api = (await initMasterApi(env)).calendarItemTypeApi\n\n for (let i = 0; i < 10; i++) {\n const entity = await api.createCalendarItemType(\n new CalendarItemType({\n id: randomUUID(),\n name: randomUUID(),\n })\n )\n entities.push(entity)\n const deletedEntity = await api.createCalendarItemType(\n new CalendarItemType({\n id: randomUUID(),\n deletionDate: new Date().getTime(),\n name: randomUUID(),\n })\n )\n deletedEntities.push(deletedEntity)\n }\n })\n\n it('Should be able of getting the CalendarItemTypes using the deprecated method', async () => {\n const page = await api.getCalendarItemTypes()\n page.forEach((it) => {\n const existingEntity = entities.find((a) => a.id === it.id)\n expect(existingEntity).not.to.be.undefined\n expect(it.rev).to.be.eq(existingEntity!!.rev!!)\n })\n })\n\n it('Should be able of getting the CalendarItemTypes with pagination', async () => {\n const firstPage = await api.getCalendarItemTypesWithPagination(undefined, 6)\n expect(firstPage.nextKeyPair).not.to.be.undefined\n expect(firstPage.rows).not.to.be.undefined\n\n const secondPage = await api.getCalendarItemTypesWithPagination(firstPage.nextKeyPair?.startKeyDocId, 6)\n expect(secondPage.nextKeyPair).to.be.undefined\n expect(secondPage.rows).not.to.be.undefined\n\n const rows = firstPage.rows!!.concat(secondPage.rows!!)\n rows.forEach((it) => {\n const existingEntity = entities.find((a) => a.id === it.id)\n expect(existingEntity).not.to.be.undefined\n expect(it.rev).to.be.eq(existingEntity!!.rev!!)\n })\n })\n\n it('Should be able of getting the CalendarItemTypes including deleted using the deprecated method', async () => {\n const page = await api.getCalendarItemTypesIncludeDeleted()\n const allEntities = entities.concat(deletedEntities)\n page.forEach((it) => {\n const existingEntity = allEntities.find((a) => a.id === it.id)\n expect(existingEntity).not.to.be.undefined\n expect(it.rev).to.be.eq(existingEntity!!.rev!!)\n })\n })\n\n it('Should be able of getting the CalendarItemTypes including delete with pagination', async () => {\n const firstPage = await api.getCalendarItemTypesIncludeDeletedWithPagination(undefined, undefined, 11)\n expect(firstPage.nextKeyPair).not.to.be.undefined\n expect(firstPage.rows).not.to.be.undefined\n\n const secondPage = await api.getCalendarItemTypesIncludeDeletedWithPagination(\n firstPage.nextKeyPair?.startKey,\n firstPage.nextKeyPair?.startKeyDocId,\n 11\n )\n expect(secondPage.nextKeyPair).to.be.undefined\n expect(secondPage.rows).not.to.be.undefined\n\n const rows = firstPage.rows!!.concat(secondPage.rows!!)\n const allEntities = entities.concat(deletedEntities)\n rows.forEach((it) => {\n const existingEntity = allEntities.find((a) => a.id === it.id)\n expect(existingEntity).not.to.be.undefined\n expect(it.rev).to.be.eq(existingEntity!!.rev!!)\n })\n })\n})\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import 'isomorphic-fetch';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const test_utils_1 = require("../../utils/test_utils");
|
|
13
|
+
require("isomorphic-fetch");
|
|
14
|
+
var initMasterApi = test_utils_1.TestUtils.initMasterApi;
|
|
15
|
+
const chai_1 = require("chai");
|
|
16
|
+
const types_1 = require("@icure/test-setup/types");
|
|
17
|
+
const mocha_1 = require("mocha");
|
|
18
|
+
const Code_1 = require("../../../icc-api/model/Code");
|
|
19
|
+
const crypto_1 = require("crypto");
|
|
20
|
+
(0, test_utils_1.setLocalStorage)(fetch);
|
|
21
|
+
let env;
|
|
22
|
+
let api;
|
|
23
|
+
(0, mocha_1.describe)('IccArticleApi', () => {
|
|
24
|
+
before(function () {
|
|
25
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
this.timeout(600000);
|
|
27
|
+
const initializer = yield (0, test_utils_1.getEnvironmentInitializer)();
|
|
28
|
+
env = yield initializer.execute((0, types_1.getEnvVariables)());
|
|
29
|
+
api = (yield initMasterApi(env)).codeApi;
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
it('Should be able of getting codes by id', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
33
|
+
const codes = yield api.createCodes([(0, crypto_1.randomUUID)(), (0, crypto_1.randomUUID)(), (0, crypto_1.randomUUID)()].map((code) => new Code_1.Code({ id: `ICURE|TEST-${code}|1`, type: 'ICURE', code: `TEST-${code}`, version: '1' })));
|
|
34
|
+
const retrievedCodes = yield api.getCodes(codes.map((it) => it.id));
|
|
35
|
+
retrievedCodes.forEach((code) => (0, chai_1.expect)(codes.find((it) => it.id === code.id)).not.to.be.undefined);
|
|
36
|
+
}));
|
|
37
|
+
});
|
|
38
|
+
//# sourceMappingURL=IccCodeApi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IccCodeApi.js","sourceRoot":"","sources":["../../../../test/icc-api/api/IccCodeApi.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,uDAA8F;AAC9F,4BAAyB;AACzB,IAAO,aAAa,GAAG,sBAAS,CAAC,aAAa,CAAA;AAC9C,+BAA6B;AAC7B,mDAAmE;AAEnE,iCAAgC;AAChC,sDAAkD;AAClD,mCAA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,SAAS,CAAC,CAAA;IACrG,CAAC,CAAA,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA","sourcesContent":["import { getEnvironmentInitializer, setLocalStorage, TestUtils } from '../../utils/test_utils'\nimport 'isomorphic-fetch'\nimport initMasterApi = TestUtils.initMasterApi\nimport { expect } from 'chai'\nimport { getEnvVariables, TestVars } from '@icure/test-setup/types'\nimport { IccCodeApi } from '../../../icc-api'\nimport { describe } from 'mocha'\nimport { Code } from '../../../icc-api/model/Code'\nimport { randomUUID } from 'crypto'\n\nsetLocalStorage(fetch)\n\nlet env: TestVars\nlet api: IccCodeApi\n\ndescribe('IccArticleApi', () => {\n before(async function () {\n this.timeout(600000)\n const initializer = await getEnvironmentInitializer()\n env = await initializer.execute(getEnvVariables())\n api = (await initMasterApi(env)).codeApi\n })\n\n it('Should be able of getting codes by id', async () => {\n const codes = await api.createCodes(\n [randomUUID(), randomUUID(), randomUUID()].map(\n (code) => new Code({ id: `ICURE|TEST-${code}|1`, type: 'ICURE', code: `TEST-${code}`, version: '1' })\n )\n )\n\n const retrievedCodes = await api.getCodes(codes.map((it) => it.id!))\n retrievedCodes.forEach((code) => expect(codes.find((it) => it.id === code.id)).not.to.be.undefined)\n })\n})\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import 'isomorphic-fetch';
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const crypto_1 = require("crypto");
|
|
13
|
+
const test_utils_1 = require("../../utils/test_utils");
|
|
14
|
+
require("isomorphic-fetch");
|
|
15
|
+
var initMasterApi = test_utils_1.TestUtils.initMasterApi;
|
|
16
|
+
const chai_1 = require("chai");
|
|
17
|
+
const types_1 = require("@icure/test-setup/types");
|
|
18
|
+
const mocha_1 = require("mocha");
|
|
19
|
+
const Keyword_1 = require("../../../icc-api/model/Keyword");
|
|
20
|
+
(0, test_utils_1.setLocalStorage)(fetch);
|
|
21
|
+
let env;
|
|
22
|
+
let api;
|
|
23
|
+
const entities = [];
|
|
24
|
+
(0, mocha_1.describe)('IccKeywordApi', () => {
|
|
25
|
+
before(function () {
|
|
26
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
27
|
+
this.timeout(600000);
|
|
28
|
+
const initializer = yield (0, test_utils_1.getEnvironmentInitializer)();
|
|
29
|
+
env = yield initializer.execute((0, types_1.getEnvVariables)());
|
|
30
|
+
api = (yield initMasterApi(env)).keywordApi;
|
|
31
|
+
for (let i = 0; i < 10; i++) {
|
|
32
|
+
const entity = yield api.createKeyword(new Keyword_1.Keyword({
|
|
33
|
+
id: (0, crypto_1.randomUUID)(),
|
|
34
|
+
name: (0, crypto_1.randomUUID)(),
|
|
35
|
+
}));
|
|
36
|
+
entities.push(entity);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
it('Should be able of getting the Keywords using the deprecated method', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
41
|
+
const page = yield api.getKeywords();
|
|
42
|
+
page.forEach((it) => {
|
|
43
|
+
const existingEntity = entities.find((a) => a.id === it.id);
|
|
44
|
+
(0, chai_1.expect)(existingEntity).not.to.be.undefined;
|
|
45
|
+
(0, chai_1.expect)(it.rev).to.be.eq(existingEntity.rev);
|
|
46
|
+
});
|
|
47
|
+
}));
|
|
48
|
+
it('Should be able of getting the Keywords with pagination', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
49
|
+
var _a;
|
|
50
|
+
const firstPage = yield api.getKeywordsWithPagination(undefined, 6);
|
|
51
|
+
(0, chai_1.expect)(firstPage.nextKeyPair).not.to.be.undefined;
|
|
52
|
+
(0, chai_1.expect)(firstPage.rows).not.to.be.undefined;
|
|
53
|
+
const secondPage = yield api.getKeywordsWithPagination((_a = firstPage.nextKeyPair) === null || _a === void 0 ? void 0 : _a.startKeyDocId, 6);
|
|
54
|
+
(0, chai_1.expect)(secondPage.nextKeyPair).to.be.undefined;
|
|
55
|
+
(0, chai_1.expect)(secondPage.rows).not.to.be.undefined;
|
|
56
|
+
const rows = firstPage.rows.concat(secondPage.rows);
|
|
57
|
+
rows.forEach((it) => {
|
|
58
|
+
const existingEntity = entities.find((a) => a.id === it.id);
|
|
59
|
+
(0, chai_1.expect)(existingEntity).not.to.be.undefined;
|
|
60
|
+
(0, chai_1.expect)(it.rev).to.be.eq(existingEntity.rev);
|
|
61
|
+
});
|
|
62
|
+
}));
|
|
63
|
+
});
|
|
64
|
+
//# sourceMappingURL=IccKeywordApi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IccKeywordApi.js","sourceRoot":"","sources":["../../../../test/icc-api/api/IccKeywordApi.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,mCAAmC;AACnC,uDAA8F;AAC9F,4BAAyB;AACzB,IAAO,aAAa,GAAG,sBAAS,CAAC,aAAa,CAAA;AAC9C,+BAA6B;AAC7B,mDAAmE;AAEnE,iCAAgC;AAChC,4DAAwD;AAExD,IAAA,4BAAe,EAAC,KAAK,CAAC,CAAA;AAEtB,IAAI,GAAa,CAAA;AACjB,IAAI,GAAkB,CAAA;AACtB,MAAM,QAAQ,GAAc,EAAE,CAAA;AAE9B,IAAA,gBAAQ,EAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,MAAM,CAAC;;YACL,I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nimport 'isomorphic-fetch'\nimport initMasterApi = TestUtils.initMasterApi\nimport { expect } from 'chai'\nimport { getEnvVariables, TestVars } from '@icure/test-setup/types'\nimport { IccKeywordApi } from '../../../icc-api'\nimport { describe } from 'mocha'\nimport { Keyword } from '../../../icc-api/model/Keyword'\n\nsetLocalStorage(fetch)\n\nlet env: TestVars\nlet api: IccKeywordApi\nconst entities: Keyword[] = []\n\ndescribe('IccKeywordApi', () => {\n before(async function () {\n this.timeout(600000)\n const initializer = await getEnvironmentInitializer()\n env = await initializer.execute(getEnvVariables())\n api = (await initMasterApi(env)).keywordApi\n\n for (let i = 0; i < 10; i++) {\n const entity = await api.createKeyword(\n new Keyword({\n id: randomUUID(),\n name: randomUUID(),\n })\n )\n entities.push(entity)\n }\n })\n\n it('Should be able of getting the Keywords using the deprecated method', async () => {\n const page = await api.getKeywords()\n page.forEach((it) => {\n const existingEntity = entities.find((a) => a.id === it.id)\n expect(existingEntity).not.to.be.undefined\n expect(it.rev).to.be.eq(existingEntity!!.rev!!)\n })\n })\n\n it('Should be able of getting the Keywords with pagination', async () => {\n const firstPage = await api.getKeywordsWithPagination(undefined, 6)\n expect(firstPage.nextKeyPair).not.to.be.undefined\n expect(firstPage.rows).not.to.be.undefined\n\n const secondPage = await api.getKeywordsWithPagination(firstPage.nextKeyPair?.startKeyDocId, 6)\n expect(secondPage.nextKeyPair).to.be.undefined\n expect(secondPage.rows).not.to.be.undefined\n\n const rows = firstPage.rows!!.concat(secondPage.rows!!)\n rows.forEach((it) => {\n const existingEntity = entities.find((a) => a.id === it.id)\n expect(existingEntity).not.to.be.undefined\n expect(it.rev).to.be.eq(existingEntity!!.rev!!)\n })\n })\n})\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import 'isomorphic-fetch';
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const crypto_1 = require("crypto");
|
|
13
|
+
const test_utils_1 = require("../../utils/test_utils");
|
|
14
|
+
require("isomorphic-fetch");
|
|
15
|
+
var initMasterApi = test_utils_1.TestUtils.initMasterApi;
|
|
16
|
+
const chai_1 = require("chai");
|
|
17
|
+
const types_1 = require("@icure/test-setup/types");
|
|
18
|
+
const mocha_1 = require("mocha");
|
|
19
|
+
const MedicalLocation_1 = require("../../../icc-api/model/MedicalLocation");
|
|
20
|
+
(0, test_utils_1.setLocalStorage)(fetch);
|
|
21
|
+
let env;
|
|
22
|
+
let api;
|
|
23
|
+
const entities = [];
|
|
24
|
+
(0, mocha_1.describe)('IccArticleApi', () => {
|
|
25
|
+
before(function () {
|
|
26
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
27
|
+
this.timeout(600000);
|
|
28
|
+
const initializer = yield (0, test_utils_1.getEnvironmentInitializer)();
|
|
29
|
+
env = yield initializer.execute((0, types_1.getEnvVariables)());
|
|
30
|
+
api = (yield initMasterApi(env)).medicalLocationApi;
|
|
31
|
+
for (let i = 0; i < 10; i++) {
|
|
32
|
+
const entity = yield api.createMedicalLocation(new MedicalLocation_1.MedicalLocation({
|
|
33
|
+
id: (0, crypto_1.randomUUID)(),
|
|
34
|
+
name: (0, crypto_1.randomUUID)(),
|
|
35
|
+
}));
|
|
36
|
+
entities.push(entity);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
it('Should be able of getting the Medical Locations using the deprecated method', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
41
|
+
const page = yield api.getMedicalLocations();
|
|
42
|
+
page.forEach((it) => {
|
|
43
|
+
const existingEntity = entities.find((a) => a.id === it.id);
|
|
44
|
+
(0, chai_1.expect)(existingEntity).not.to.be.undefined;
|
|
45
|
+
(0, chai_1.expect)(it.rev).to.be.eq(existingEntity.rev);
|
|
46
|
+
});
|
|
47
|
+
}));
|
|
48
|
+
it('Should be able of getting the Medical Locations with pagination', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
49
|
+
var _a;
|
|
50
|
+
const firstPage = yield api.getMedicalLocationsWithPagination(undefined, 6);
|
|
51
|
+
(0, chai_1.expect)(firstPage.nextKeyPair).not.to.be.undefined;
|
|
52
|
+
(0, chai_1.expect)(firstPage.rows).not.to.be.undefined;
|
|
53
|
+
const secondPage = yield api.getMedicalLocationsWithPagination((_a = firstPage.nextKeyPair) === null || _a === void 0 ? void 0 : _a.startKeyDocId, 6);
|
|
54
|
+
(0, chai_1.expect)(secondPage.nextKeyPair).to.be.undefined;
|
|
55
|
+
(0, chai_1.expect)(secondPage.rows).not.to.be.undefined;
|
|
56
|
+
const rows = firstPage.rows.concat(secondPage.rows);
|
|
57
|
+
rows.forEach((it) => {
|
|
58
|
+
const existingEntity = entities.find((a) => a.id === it.id);
|
|
59
|
+
(0, chai_1.expect)(existingEntity).not.to.be.undefined;
|
|
60
|
+
(0, chai_1.expect)(it.rev).to.be.eq(existingEntity.rev);
|
|
61
|
+
});
|
|
62
|
+
}));
|
|
63
|
+
});
|
|
64
|
+
//# sourceMappingURL=IccMedicalLocationApi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IccMedicalLocationApi.js","sourceRoot":"","sources":["../../../../test/icc-api/api/IccMedicalLocationApi.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,mCAAmC;AACnC,uDAA8F;AAC9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AAc,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,SAAS,CAAA;YAC1C,IAAA,aAAM,EAAC,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,cAAgB,CAAC,GAAK,CAAC,CAAA;QACjD,CAAC,CAAC,CAAA;IACJ,CAAC,CAAA,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA","sourcesContent":["import { randomUUID } from 'crypto'\nimport { getEnvironmentInitializer, setLocalStorage, TestUtils } from '../../utils/test_utils'\nimport 'isomorphic-fetch'\nimport initMasterApi = TestUtils.initMasterApi\nimport { expect } from 'chai'\nimport { getEnvVariables, TestVars } from '@icure/test-setup/types'\nimport { IccMedicallocationApi } from '../../../icc-api'\nimport { describe } from 'mocha'\nimport { MedicalLocation } from '../../../icc-api/model/MedicalLocation'\n\nsetLocalStorage(fetch)\n\nlet env: TestVars\nlet api: IccMedicallocationApi\nconst entities: MedicalLocation[] = []\n\ndescribe('IccArticleApi', () => {\n before(async function () {\n this.timeout(600000)\n const initializer = await getEnvironmentInitializer()\n env = await initializer.execute(getEnvVariables())\n api = (await initMasterApi(env)).medicalLocationApi\n\n for (let i = 0; i < 10; i++) {\n const entity = await api.createMedicalLocation(\n new MedicalLocation({\n id: randomUUID(),\n name: randomUUID(),\n })\n )\n entities.push(entity)\n }\n })\n\n it('Should be able of getting the Medical Locations using the deprecated method', async () => {\n const page = await api.getMedicalLocations()\n page.forEach((it) => {\n const existingEntity = entities.find((a) => a.id === it.id)\n expect(existingEntity).not.to.be.undefined\n expect(it.rev).to.be.eq(existingEntity!!.rev!!)\n })\n })\n\n it('Should be able of getting the Medical Locations with pagination', async () => {\n const firstPage = await api.getMedicalLocationsWithPagination(undefined, 6)\n expect(firstPage.nextKeyPair).not.to.be.undefined\n expect(firstPage.rows).not.to.be.undefined\n\n const secondPage = await api.getMedicalLocationsWithPagination(firstPage.nextKeyPair?.startKeyDocId, 6)\n expect(secondPage.nextKeyPair).to.be.undefined\n expect(secondPage.rows).not.to.be.undefined\n\n const rows = firstPage.rows!!.concat(secondPage.rows!!)\n rows.forEach((it) => {\n const existingEntity = entities.find((a) => a.id === it.id)\n expect(existingEntity).not.to.be.undefined\n expect(it.rev).to.be.eq(existingEntity!!.rev!!)\n })\n })\n})\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import 'isomorphic-fetch';
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const crypto_1 = require("crypto");
|
|
13
|
+
const test_utils_1 = require("../../utils/test_utils");
|
|
14
|
+
require("isomorphic-fetch");
|
|
15
|
+
var initMasterApi = test_utils_1.TestUtils.initMasterApi;
|
|
16
|
+
const chai_1 = require("chai");
|
|
17
|
+
const types_1 = require("@icure/test-setup/types");
|
|
18
|
+
const mocha_1 = require("mocha");
|
|
19
|
+
const Place_1 = require("../../../icc-api/model/Place");
|
|
20
|
+
(0, test_utils_1.setLocalStorage)(fetch);
|
|
21
|
+
let env;
|
|
22
|
+
let api;
|
|
23
|
+
const entities = [];
|
|
24
|
+
(0, mocha_1.describe)('IccArticleApi', () => {
|
|
25
|
+
before(function () {
|
|
26
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
27
|
+
this.timeout(600000);
|
|
28
|
+
const initializer = yield (0, test_utils_1.getEnvironmentInitializer)();
|
|
29
|
+
env = yield initializer.execute((0, types_1.getEnvVariables)());
|
|
30
|
+
api = (yield initMasterApi(env)).placeApi;
|
|
31
|
+
for (let i = 0; i < 10; i++) {
|
|
32
|
+
const entity = yield api.createPlace(new Place_1.Place({
|
|
33
|
+
id: (0, crypto_1.randomUUID)(),
|
|
34
|
+
name: (0, crypto_1.randomUUID)(),
|
|
35
|
+
}));
|
|
36
|
+
entities.push(entity);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
it('Should be able of getting the Places using the deprecated method', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
41
|
+
const page = yield api.getPlaces();
|
|
42
|
+
page.forEach((it) => {
|
|
43
|
+
const existingEntity = entities.find((a) => a.id === it.id);
|
|
44
|
+
(0, chai_1.expect)(existingEntity).not.to.be.undefined;
|
|
45
|
+
(0, chai_1.expect)(it.rev).to.be.eq(existingEntity.rev);
|
|
46
|
+
});
|
|
47
|
+
}));
|
|
48
|
+
it('Should be able of getting the Place with pagination', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
49
|
+
var _a;
|
|
50
|
+
const firstPage = yield api.getPlacesWithPagination(undefined, 6);
|
|
51
|
+
(0, chai_1.expect)(firstPage.nextKeyPair).not.to.be.undefined;
|
|
52
|
+
(0, chai_1.expect)(firstPage.rows).not.to.be.undefined;
|
|
53
|
+
const secondPage = yield api.getPlacesWithPagination((_a = firstPage.nextKeyPair) === null || _a === void 0 ? void 0 : _a.startKeyDocId, 6);
|
|
54
|
+
(0, chai_1.expect)(secondPage.nextKeyPair).to.be.undefined;
|
|
55
|
+
(0, chai_1.expect)(secondPage.rows).not.to.be.undefined;
|
|
56
|
+
const rows = firstPage.rows.concat(secondPage.rows);
|
|
57
|
+
rows.forEach((it) => {
|
|
58
|
+
const existingEntity = entities.find((a) => a.id === it.id);
|
|
59
|
+
(0, chai_1.expect)(existingEntity).not.to.be.undefined;
|
|
60
|
+
(0, chai_1.expect)(it.rev).to.be.eq(existingEntity.rev);
|
|
61
|
+
});
|
|
62
|
+
}));
|
|
63
|
+
});
|
|
64
|
+
//# sourceMappingURL=IccPlaceApi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IccPlaceApi.js","sourceRoot":"","sources":["../../../../test/icc-api/api/IccPlaceApi.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,mCAAmC;AACnC,uDAA8F;AAC9F,4BAAyB;AACzB,IAAO,aAAa,GAAG,sBAAS,CAAC,aAAa,CAAA;AAC9C,+BAA6B;AAC7B,mDAAmE;AAEnE,iCAAgC;AAChC,wDAAoD;AAEpD,IAAA,4BAAe,EAAC,KAAK,CAAC,CAAA;AAEtB,IAAI,GAAa,CAAA;AACjB,IAAI,GAAgB,CAAA;AACpB,MAAM,QAAQ,GAAY,EAAE,CAAA;AAE5B,IAAA,gBAAQ,EAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,MAAM,CAAC;;YACL,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;YACpB,MAAM,WAAW,GAAG,MAAM,IAAA,sCAAyB,GAAE,CAAA;YACrD,GAAG,GAAG,MAAM,WAAW,CAAC,OAAO,CAAC,IAAA,uBAAe,GAAE,CAAC,CAAA;YAClD,GAAG,GAAG,CAAC,MAAM,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAA;YAEzC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE;gBAC3B,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,WAAW,CAClC,IAAI,aAAK,CAAC;oBACR,EAAE,EAAE,IAAA,mBAAU,GAAE;oBAChB,IAAI,EAAE,IAAA,mBAAU,GAAE;iBACnB,CAAC,CACH,CAAA;gBACD,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;aACtB;QACH,CAA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QAE3C,MAAM,IAAI,GAAG,SAAS,CAAC,IAAM,CAAC,MAAM,CAAC,UAAU,CAAC,IAAM,CAAC,CAAA;QACvD,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE;YAClB,MAAM,cAAc,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAA;YAC3D,IAAA,aAAM,EAAC,cAAc,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,SAAS,CAAA;YAC1C,IAAA,aAAM,EAAC,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,cAAgB,CAAC,GAAK,CAAC,CAAA;QACjD,CAAC,CAAC,CAAA;IACJ,CAAC,CAAA,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA","sourcesContent":["import { randomUUID } from 'crypto'\nimport { getEnvironmentInitializer, setLocalStorage, TestUtils } from '../../utils/test_utils'\nimport 'isomorphic-fetch'\nimport initMasterApi = TestUtils.initMasterApi\nimport { expect } from 'chai'\nimport { getEnvVariables, TestVars } from '@icure/test-setup/types'\nimport { IccPlaceApi } from '../../../icc-api'\nimport { describe } from 'mocha'\nimport { Place } from '../../../icc-api/model/Place'\n\nsetLocalStorage(fetch)\n\nlet env: TestVars\nlet api: IccPlaceApi\nconst entities: Place[] = []\n\ndescribe('IccArticleApi', () => {\n before(async function () {\n this.timeout(600000)\n const initializer = await getEnvironmentInitializer()\n env = await initializer.execute(getEnvVariables())\n api = (await initMasterApi(env)).placeApi\n\n for (let i = 0; i < 10; i++) {\n const entity = await api.createPlace(\n new Place({\n id: randomUUID(),\n name: randomUUID(),\n })\n )\n entities.push(entity)\n }\n })\n\n it('Should be able of getting the Places using the deprecated method', async () => {\n const page = await api.getPlaces()\n page.forEach((it) => {\n const existingEntity = entities.find((a) => a.id === it.id)\n expect(existingEntity).not.to.be.undefined\n expect(it.rev).to.be.eq(existingEntity!!.rev!!)\n })\n })\n\n it('Should be able of getting the Place with pagination', async () => {\n const firstPage = await api.getPlacesWithPagination(undefined, 6)\n expect(firstPage.nextKeyPair).not.to.be.undefined\n expect(firstPage.rows).not.to.be.undefined\n\n const secondPage = await api.getPlacesWithPagination(firstPage.nextKeyPair?.startKeyDocId, 6)\n expect(secondPage.nextKeyPair).to.be.undefined\n expect(secondPage.rows).not.to.be.undefined\n\n const rows = firstPage.rows!!.concat(secondPage.rows!!)\n rows.forEach((it) => {\n const existingEntity = entities.find((a) => a.id === it.id)\n expect(existingEntity).not.to.be.undefined\n expect(it.rev).to.be.eq(existingEntity!!.rev!!)\n })\n })\n})\n"]}
|