@prismicio/e2e-tests-utils 1.12.0-alpha.6 → 1.13.0
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/dist/clients/assetApi.cjs +16 -0
- package/dist/clients/assetApi.cjs.map +1 -1
- package/dist/clients/assetApi.d.ts +21 -0
- package/dist/clients/assetApi.js +16 -0
- package/dist/clients/assetApi.js.map +1 -1
- package/dist/clients/contentApi.cjs.map +1 -1
- package/dist/clients/contentApi.d.ts +7 -1
- package/dist/clients/contentApi.js.map +1 -1
- package/dist/clients/coreApi.cjs +52 -0
- package/dist/clients/coreApi.cjs.map +1 -1
- package/dist/clients/coreApi.d.ts +39 -0
- package/dist/clients/coreApi.js +52 -0
- package/dist/clients/coreApi.js.map +1 -1
- package/dist/index.cjs +4 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/managers/repository.cjs +33 -0
- package/dist/managers/repository.cjs.map +1 -1
- package/dist/managers/repository.d.ts +23 -1
- package/dist/managers/repository.js +33 -0
- package/dist/managers/repository.js.map +1 -1
- package/package.json +1 -1
- package/src/clients/assetApi.ts +34 -0
- package/src/clients/contentApi.ts +8 -1
- package/src/clients/coreApi.ts +86 -0
- package/src/index.ts +2 -0
- package/src/managers/repository.ts +43 -0
package/src/index.ts
CHANGED
|
@@ -15,6 +15,10 @@ import {
|
|
|
15
15
|
CoreApiClient,
|
|
16
16
|
CoreApiDocumentCreationPayload,
|
|
17
17
|
CoreApiDocumentCreationResponse,
|
|
18
|
+
CoreApiDocumentData,
|
|
19
|
+
CoreApiDocumentsPayload,
|
|
20
|
+
CoreApiDocumentsResponse,
|
|
21
|
+
Release,
|
|
18
22
|
} from "../clients/coreApi";
|
|
19
23
|
import { CustomTypesApiClient } from "../clients/customTypesApi";
|
|
20
24
|
import { IntegrationFieldsClient } from "../clients/integrationFields";
|
|
@@ -279,6 +283,19 @@ export class RepositoryManager {
|
|
|
279
283
|
profiler.done({ message: `default locale set to '${locale}'` });
|
|
280
284
|
}
|
|
281
285
|
|
|
286
|
+
/**
|
|
287
|
+
* Retrieves documents.
|
|
288
|
+
*
|
|
289
|
+
* @param args - Configure which documents are retrieved.
|
|
290
|
+
*
|
|
291
|
+
* @returns A paginated set of documents.
|
|
292
|
+
*/
|
|
293
|
+
async getDocuments(
|
|
294
|
+
args: CoreApiDocumentsPayload,
|
|
295
|
+
): Promise<CoreApiDocumentsResponse> {
|
|
296
|
+
return this.coreApiClient.getDocuments(args);
|
|
297
|
+
}
|
|
298
|
+
|
|
282
299
|
/**
|
|
283
300
|
* Creates a release.
|
|
284
301
|
*
|
|
@@ -298,6 +315,21 @@ export class RepositoryManager {
|
|
|
298
315
|
return response.data;
|
|
299
316
|
}
|
|
300
317
|
|
|
318
|
+
/**
|
|
319
|
+
* Retrieves the migration release.
|
|
320
|
+
*
|
|
321
|
+
* @returns The migration relese metadata.
|
|
322
|
+
*/
|
|
323
|
+
async getMigrationRelease(): Promise<Release> {
|
|
324
|
+
const releases = await this.coreApiClient.getReleases();
|
|
325
|
+
const migrationRelease = releases.find((release) => release.migration);
|
|
326
|
+
if (!migrationRelease) {
|
|
327
|
+
throw new Error(`The repository does not have a migration release`);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
return migrationRelease;
|
|
331
|
+
}
|
|
332
|
+
|
|
301
333
|
/**
|
|
302
334
|
* Deletes a repository release.
|
|
303
335
|
*
|
|
@@ -753,6 +785,17 @@ export class RepositoryManager {
|
|
|
753
785
|
return result;
|
|
754
786
|
}
|
|
755
787
|
|
|
788
|
+
/**
|
|
789
|
+
* Retrieves data for a specific document version.
|
|
790
|
+
*
|
|
791
|
+
* @param versionId - The document's version ID.
|
|
792
|
+
*
|
|
793
|
+
* @returns The document's version data.
|
|
794
|
+
*/
|
|
795
|
+
async getDocumentData(versionId: string): Promise<CoreApiDocumentData> {
|
|
796
|
+
return await this.coreApiClient.getDocumentData(versionId);
|
|
797
|
+
}
|
|
798
|
+
|
|
756
799
|
async setupIntegrationFields(
|
|
757
800
|
integrationFields: IntegrationFieldConfig[],
|
|
758
801
|
): Promise<void> {
|