@prismicio/e2e-tests-utils 1.4.0-alpha.2 → 1.4.1
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/README.md +16 -9
- package/dist/clients/apiClient.cjs +39 -0
- package/dist/clients/apiClient.cjs.map +1 -0
- package/dist/clients/apiClient.d.ts +30 -0
- package/dist/clients/apiClient.js +39 -0
- package/dist/clients/apiClient.js.map +1 -0
- package/dist/clients/authenticationApi.cjs +54 -34
- package/dist/clients/authenticationApi.cjs.map +1 -1
- package/dist/clients/authenticationApi.d.ts +13 -5
- package/dist/clients/authenticationApi.js +55 -35
- package/dist/clients/authenticationApi.js.map +1 -1
- package/dist/clients/contentApi.cjs +20 -50
- package/dist/clients/contentApi.cjs.map +1 -1
- package/dist/clients/contentApi.d.ts +27 -37
- package/dist/clients/contentApi.js +20 -50
- package/dist/clients/contentApi.js.map +1 -1
- package/dist/clients/coreApi.cjs +36 -31
- package/dist/clients/coreApi.cjs.map +1 -1
- package/dist/clients/coreApi.d.ts +21 -3
- package/dist/clients/coreApi.js +37 -32
- package/dist/clients/coreApi.js.map +1 -1
- package/dist/clients/customTypesApi.cjs +48 -42
- package/dist/clients/customTypesApi.cjs.map +1 -1
- package/dist/clients/customTypesApi.d.ts +34 -6
- package/dist/clients/customTypesApi.js +49 -43
- package/dist/clients/customTypesApi.js.map +1 -1
- package/dist/clients/migrationApi.cjs +30 -29
- package/dist/clients/migrationApi.cjs.map +1 -1
- package/dist/clients/migrationApi.d.ts +27 -5
- package/dist/clients/migrationApi.js +31 -30
- package/dist/clients/migrationApi.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/dist/managers/repositories.cjs +19 -9
- package/dist/managers/repositories.cjs.map +1 -1
- package/dist/managers/repositories.d.ts +2 -2
- package/dist/managers/repositories.js +23 -13
- package/dist/managers/repositories.js.map +1 -1
- package/dist/managers/repository.cjs +9 -1
- package/dist/managers/repository.cjs.map +1 -1
- package/dist/managers/repository.d.ts +6 -4
- package/dist/managers/repository.js +9 -1
- package/dist/managers/repository.js.map +1 -1
- package/dist/utils/log.cjs +4 -0
- package/dist/utils/log.cjs.map +1 -1
- package/dist/utils/log.d.ts +2 -0
- package/dist/utils/log.js +4 -0
- package/dist/utils/log.js.map +1 -1
- package/package.json +3 -1
- package/src/clients/apiClient.ts +48 -0
- package/src/clients/authenticationApi.ts +52 -50
- package/src/clients/contentApi.ts +54 -45
- package/src/clients/coreApi.ts +36 -42
- package/src/clients/customTypesApi.ts +34 -59
- package/src/clients/migrationApi.ts +36 -45
- package/src/managers/repositories.ts +26 -20
- package/src/managers/repository.ts +21 -8
- package/src/utils/log.ts +11 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customTypesApi.cjs","sources":["../../../src/clients/customTypesApi.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"customTypesApi.cjs","sources":["../../../src/clients/customTypesApi.ts"],"sourcesContent":["import isEqual from \"lodash.isequal\";\n\nimport {\n\tCustomType,\n\tSharedSlice,\n} from \"@prismicio/types-internal/lib/customtypes\";\n\nimport { logPlaywrightApiResponse, logger } from \"../utils/log\";\n\nimport { AuthServerToken, AuthenticatedApiClient } from \"./apiClient\";\n\ntype ItemType = CustomType | SharedSlice;\ntype ItemTypePath = \"customtypes\" | \"slices\";\ntype ItemOperation = \"insert\" | \"update\";\n\n/**\n * Client for interacting with the Custom Types API to create/update custom\n * types and slices.\n */\nexport class CustomTypesApiClient extends AuthenticatedApiClient {\n\tconstructor(\n\t\tbaseURL: string,\n\t\tconfig: { authToken: AuthServerToken; repository: string },\n\t) {\n\t\tsuper(baseURL, config.authToken, { repository: config.repository });\n\t}\n\n\t/**\n\t * Create or update a custom type or slice.\n\t *\n\t * @param endpoint - - The API endpoint for custom types or slices\n\t * ('customtypes' or 'slices').\n\t * @param data - - The data representing the custom type or slice.\n\t *\n\t * @throws Error if the item status cannot be retrieved or the item cannot be\n\t * created/updated.\n\t */\n\tprivate async upsert(\n\t\tendpoint: ItemTypePath,\n\t\toperation: ItemOperation,\n\t\tdata: ItemType,\n\t) {\n\t\tconst profiler = logger.startTimer();\n\t\tconst path = `${endpoint}/${operation}`;\n\n\t\tconst context = await this.getContext();\n\t\tconst result = await context.post(path, { data });\n\t\tif (!result.ok()) {\n\t\t\tlogPlaywrightApiResponse(result);\n\t\t\tthrow new Error(`Could not ${operation} item`);\n\t\t}\n\t\tprofiler.done({\n\t\t\tmessage: `called customtypes api /${path} for item with id '${data.id}'`,\n\t\t});\n\t}\n\n\tprivate async getRemoteItems(\n\t\tendpoint: ItemTypePath,\n\t): Promise<CustomType[] | SharedSlice[]> {\n\t\tconst context = await this.getContext();\n\t\tconst result = await context.get(endpoint);\n\n\t\tif (!result.ok()) {\n\t\t\tlogPlaywrightApiResponse(result);\n\t\t\tthrow new Error(\"Could not get items status from the Custom Type api.\");\n\t\t}\n\n\t\treturn result.json();\n\t}\n\n\tprivate async getDifference(\n\t\tremoteItems: CustomType[] | SharedSlice[],\n\t\tlocal: ItemType,\n\t): Promise<ItemOperation | undefined> {\n\t\tconst remoteItem = remoteItems.find(\n\t\t\t(remote: CustomType | SharedSlice) => remote.id === local.id,\n\t\t);\n\t\tif (!remoteItem) {\n\t\t\treturn \"insert\";\n\t\t}\n\t\tif (!isEqual(local, remoteItem)) {\n\t\t\treturn \"update\";\n\t\t}\n\n\t\treturn;\n\t}\n\n\t/** Create items only if they have changed compared to their remote status */\n\tprivate async upsertIfChanged(\n\t\titemType: ItemTypePath,\n\t\tlocalItems: ItemType[] = [],\n\t): Promise<void> {\n\t\tconst remoteItems = await this.getRemoteItems(itemType);\n\t\tawait Promise.all(\n\t\t\tlocalItems.map(async (localItem) => {\n\t\t\t\tconst operation = await this.getDifference(remoteItems, localItem);\n\n\t\t\t\treturn operation && this.upsert(itemType, operation, localItem);\n\t\t\t}),\n\t\t);\n\t}\n\n\t/**\n\t * Create Custom Types using the Custom types api.\n\t *\n\t * @param customTypes -\n\t */\n\tasync createCustomTypes(customTypes: CustomType[] = []): Promise<void> {\n\t\tawait this.upsertIfChanged(\"customtypes\", customTypes);\n\t}\n\n\t/**\n\t * Create slices using the Custom types api.\n\t *\n\t * @param slices -\n\t */\n\tasync createSlices(slices: SharedSlice[] = []): Promise<void> {\n\t\tawait this.upsertIfChanged(\"slices\", slices);\n\t}\n}\n"],"names":["AuthenticatedApiClient","logger","logPlaywrightApiResponse"],"mappings":";;;;;AAmBM,MAAO,6BAA6BA,UAAAA,uBAAsB;AAAA,EAC/D,YACC,SACA,QAA0D;AAE1D,UAAM,SAAS,OAAO,WAAW,EAAE,YAAY,OAAO,YAAY;AAAA,EACnE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYQ,MAAM,OACb,UACA,WACA,MAAc;AAER,UAAA,WAAWC,WAAO;AACxB,UAAM,OAAO,GAAG,QAAQ,IAAI,SAAS;AAE/B,UAAA,UAAU,MAAM,KAAK;AAC3B,UAAM,SAAS,MAAM,QAAQ,KAAK,MAAM,EAAE,MAAM;AAC5C,QAAA,CAAC,OAAO,MAAM;AACjBC,UAAA,yBAAyB,MAAM;AAC/B,YAAM,IAAI,MAAM,aAAa,SAAS,OAAO;AAAA,IAC9C;AACA,aAAS,KAAK;AAAA,MACb,SAAS,2BAA2B,IAAI,sBAAsB,KAAK,EAAE;AAAA,IAAA,CACrE;AAAA,EACF;AAAA,EAEQ,MAAM,eACb,UAAsB;AAEhB,UAAA,UAAU,MAAM,KAAK;AAC3B,UAAM,SAAS,MAAM,QAAQ,IAAI,QAAQ;AAErC,QAAA,CAAC,OAAO,MAAM;AACjBA,UAAA,yBAAyB,MAAM;AACzB,YAAA,IAAI,MAAM,sDAAsD;AAAA,IACvE;AAEA,WAAO,OAAO;EACf;AAAA,EAEQ,MAAM,cACb,aACA,OAAe;AAET,UAAA,aAAa,YAAY,KAC9B,CAAC,WAAqC,OAAO,OAAO,MAAM,EAAE;AAE7D,QAAI,CAAC,YAAY;AACT,aAAA;AAAA,IACR;AACA,QAAI,CAAC,QAAQ,OAAO,UAAU,GAAG;AACzB,aAAA;AAAA,IACR;AAEA;AAAA,EACD;AAAA;AAAA,EAGQ,MAAM,gBACb,UACA,aAAyB,IAAE;AAE3B,UAAM,cAAc,MAAM,KAAK,eAAe,QAAQ;AACtD,UAAM,QAAQ,IACb,WAAW,IAAI,OAAO,cAAa;AAClC,YAAM,YAAY,MAAM,KAAK,cAAc,aAAa,SAAS;AAEjE,aAAO,aAAa,KAAK,OAAO,UAAU,WAAW,SAAS;AAAA,IAC9D,CAAA,CAAC;AAAA,EAEJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,kBAAkB,cAA4B,IAAE;AAC/C,UAAA,KAAK,gBAAgB,eAAe,WAAW;AAAA,EACtD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,aAAa,SAAwB,IAAE;AACtC,UAAA,KAAK,gBAAgB,UAAU,MAAM;AAAA,EAC5C;AACA;;"}
|
|
@@ -1,11 +1,39 @@
|
|
|
1
1
|
import { CustomType, SharedSlice } from "@prismicio/types-internal/lib/customtypes";
|
|
2
|
-
import {
|
|
3
|
-
export type CustomTypesClient = {
|
|
4
|
-
createCustomTypes(customTypes: CustomType[]): Promise<void>;
|
|
5
|
-
createSlices(slices: SharedSlice[]): Promise<void>;
|
|
6
|
-
};
|
|
2
|
+
import { AuthServerToken, AuthenticatedApiClient } from "./apiClient";
|
|
7
3
|
/**
|
|
8
4
|
* Client for interacting with the Custom Types API to create/update custom
|
|
9
5
|
* types and slices.
|
|
10
6
|
*/
|
|
11
|
-
export declare
|
|
7
|
+
export declare class CustomTypesApiClient extends AuthenticatedApiClient {
|
|
8
|
+
constructor(baseURL: string, config: {
|
|
9
|
+
authToken: AuthServerToken;
|
|
10
|
+
repository: string;
|
|
11
|
+
});
|
|
12
|
+
/**
|
|
13
|
+
* Create or update a custom type or slice.
|
|
14
|
+
*
|
|
15
|
+
* @param endpoint - - The API endpoint for custom types or slices
|
|
16
|
+
* ('customtypes' or 'slices').
|
|
17
|
+
* @param data - - The data representing the custom type or slice.
|
|
18
|
+
*
|
|
19
|
+
* @throws Error if the item status cannot be retrieved or the item cannot be
|
|
20
|
+
* created/updated.
|
|
21
|
+
*/
|
|
22
|
+
private upsert;
|
|
23
|
+
private getRemoteItems;
|
|
24
|
+
private getDifference;
|
|
25
|
+
/** Create items only if they have changed compared to their remote status */
|
|
26
|
+
private upsertIfChanged;
|
|
27
|
+
/**
|
|
28
|
+
* Create Custom Types using the Custom types api.
|
|
29
|
+
*
|
|
30
|
+
* @param customTypes -
|
|
31
|
+
*/
|
|
32
|
+
createCustomTypes(customTypes?: CustomType[]): Promise<void>;
|
|
33
|
+
/**
|
|
34
|
+
* Create slices using the Custom types api.
|
|
35
|
+
*
|
|
36
|
+
* @param slices -
|
|
37
|
+
*/
|
|
38
|
+
createSlices(slices?: SharedSlice[]): Promise<void>;
|
|
39
|
+
}
|
|
@@ -1,44 +1,43 @@
|
|
|
1
|
-
import axios from "axios";
|
|
2
1
|
import isEqual from "lodash.isequal";
|
|
3
|
-
import { logger,
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
});
|
|
21
|
-
async function upsert(endpoint, operation, data) {
|
|
2
|
+
import { logger, logPlaywrightApiResponse } from "../utils/log.js";
|
|
3
|
+
import { AuthenticatedApiClient } from "./apiClient.js";
|
|
4
|
+
class CustomTypesApiClient extends AuthenticatedApiClient {
|
|
5
|
+
constructor(baseURL, config) {
|
|
6
|
+
super(baseURL, config.authToken, { repository: config.repository });
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Create or update a custom type or slice.
|
|
10
|
+
*
|
|
11
|
+
* @param endpoint - - The API endpoint for custom types or slices
|
|
12
|
+
* ('customtypes' or 'slices').
|
|
13
|
+
* @param data - - The data representing the custom type or slice.
|
|
14
|
+
*
|
|
15
|
+
* @throws Error if the item status cannot be retrieved or the item cannot be
|
|
16
|
+
* created/updated.
|
|
17
|
+
*/
|
|
18
|
+
async upsert(endpoint, operation, data) {
|
|
22
19
|
const profiler = logger.startTimer();
|
|
23
20
|
const path = `${endpoint}/${operation}`;
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
const context = await this.getContext();
|
|
22
|
+
const result = await context.post(path, { data });
|
|
23
|
+
if (!result.ok()) {
|
|
24
|
+
logPlaywrightApiResponse(result);
|
|
27
25
|
throw new Error(`Could not ${operation} item`);
|
|
28
26
|
}
|
|
29
27
|
profiler.done({
|
|
30
28
|
message: `called customtypes api /${path} for item with id '${data.id}'`
|
|
31
29
|
});
|
|
32
30
|
}
|
|
33
|
-
async
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
async getRemoteItems(endpoint) {
|
|
32
|
+
const context = await this.getContext();
|
|
33
|
+
const result = await context.get(endpoint);
|
|
34
|
+
if (!result.ok()) {
|
|
35
|
+
logPlaywrightApiResponse(result);
|
|
37
36
|
throw new Error("Could not get items status from the Custom Type api.");
|
|
38
37
|
}
|
|
39
|
-
return result.
|
|
38
|
+
return result.json();
|
|
40
39
|
}
|
|
41
|
-
async
|
|
40
|
+
async getDifference(remoteItems, local) {
|
|
42
41
|
const remoteItem = remoteItems.find((remote) => remote.id === local.id);
|
|
43
42
|
if (!remoteItem) {
|
|
44
43
|
return "insert";
|
|
@@ -48,25 +47,32 @@ const createCustomTypesApiClient = (baseURL, repository, authClient) => {
|
|
|
48
47
|
}
|
|
49
48
|
return;
|
|
50
49
|
}
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
/** Create items only if they have changed compared to their remote status */
|
|
51
|
+
async upsertIfChanged(itemType, localItems = []) {
|
|
52
|
+
const remoteItems = await this.getRemoteItems(itemType);
|
|
53
53
|
await Promise.all(localItems.map(async (localItem) => {
|
|
54
|
-
const operation = await getDifference(remoteItems, localItem);
|
|
55
|
-
return operation && upsert(itemType, operation, localItem);
|
|
54
|
+
const operation = await this.getDifference(remoteItems, localItem);
|
|
55
|
+
return operation && this.upsert(itemType, operation, localItem);
|
|
56
56
|
}));
|
|
57
57
|
}
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
/**
|
|
59
|
+
* Create Custom Types using the Custom types api.
|
|
60
|
+
*
|
|
61
|
+
* @param customTypes -
|
|
62
|
+
*/
|
|
63
|
+
async createCustomTypes(customTypes = []) {
|
|
64
|
+
await this.upsertIfChanged("customtypes", customTypes);
|
|
60
65
|
}
|
|
61
|
-
|
|
62
|
-
|
|
66
|
+
/**
|
|
67
|
+
* Create slices using the Custom types api.
|
|
68
|
+
*
|
|
69
|
+
* @param slices -
|
|
70
|
+
*/
|
|
71
|
+
async createSlices(slices = []) {
|
|
72
|
+
await this.upsertIfChanged("slices", slices);
|
|
63
73
|
}
|
|
64
|
-
|
|
65
|
-
createCustomTypes,
|
|
66
|
-
createSlices
|
|
67
|
-
};
|
|
68
|
-
};
|
|
74
|
+
}
|
|
69
75
|
export {
|
|
70
|
-
|
|
76
|
+
CustomTypesApiClient
|
|
71
77
|
};
|
|
72
78
|
//# sourceMappingURL=customTypesApi.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customTypesApi.js","sources":["../../../src/clients/customTypesApi.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"customTypesApi.js","sources":["../../../src/clients/customTypesApi.ts"],"sourcesContent":["import isEqual from \"lodash.isequal\";\n\nimport {\n\tCustomType,\n\tSharedSlice,\n} from \"@prismicio/types-internal/lib/customtypes\";\n\nimport { logPlaywrightApiResponse, logger } from \"../utils/log\";\n\nimport { AuthServerToken, AuthenticatedApiClient } from \"./apiClient\";\n\ntype ItemType = CustomType | SharedSlice;\ntype ItemTypePath = \"customtypes\" | \"slices\";\ntype ItemOperation = \"insert\" | \"update\";\n\n/**\n * Client for interacting with the Custom Types API to create/update custom\n * types and slices.\n */\nexport class CustomTypesApiClient extends AuthenticatedApiClient {\n\tconstructor(\n\t\tbaseURL: string,\n\t\tconfig: { authToken: AuthServerToken; repository: string },\n\t) {\n\t\tsuper(baseURL, config.authToken, { repository: config.repository });\n\t}\n\n\t/**\n\t * Create or update a custom type or slice.\n\t *\n\t * @param endpoint - - The API endpoint for custom types or slices\n\t * ('customtypes' or 'slices').\n\t * @param data - - The data representing the custom type or slice.\n\t *\n\t * @throws Error if the item status cannot be retrieved or the item cannot be\n\t * created/updated.\n\t */\n\tprivate async upsert(\n\t\tendpoint: ItemTypePath,\n\t\toperation: ItemOperation,\n\t\tdata: ItemType,\n\t) {\n\t\tconst profiler = logger.startTimer();\n\t\tconst path = `${endpoint}/${operation}`;\n\n\t\tconst context = await this.getContext();\n\t\tconst result = await context.post(path, { data });\n\t\tif (!result.ok()) {\n\t\t\tlogPlaywrightApiResponse(result);\n\t\t\tthrow new Error(`Could not ${operation} item`);\n\t\t}\n\t\tprofiler.done({\n\t\t\tmessage: `called customtypes api /${path} for item with id '${data.id}'`,\n\t\t});\n\t}\n\n\tprivate async getRemoteItems(\n\t\tendpoint: ItemTypePath,\n\t): Promise<CustomType[] | SharedSlice[]> {\n\t\tconst context = await this.getContext();\n\t\tconst result = await context.get(endpoint);\n\n\t\tif (!result.ok()) {\n\t\t\tlogPlaywrightApiResponse(result);\n\t\t\tthrow new Error(\"Could not get items status from the Custom Type api.\");\n\t\t}\n\n\t\treturn result.json();\n\t}\n\n\tprivate async getDifference(\n\t\tremoteItems: CustomType[] | SharedSlice[],\n\t\tlocal: ItemType,\n\t): Promise<ItemOperation | undefined> {\n\t\tconst remoteItem = remoteItems.find(\n\t\t\t(remote: CustomType | SharedSlice) => remote.id === local.id,\n\t\t);\n\t\tif (!remoteItem) {\n\t\t\treturn \"insert\";\n\t\t}\n\t\tif (!isEqual(local, remoteItem)) {\n\t\t\treturn \"update\";\n\t\t}\n\n\t\treturn;\n\t}\n\n\t/** Create items only if they have changed compared to their remote status */\n\tprivate async upsertIfChanged(\n\t\titemType: ItemTypePath,\n\t\tlocalItems: ItemType[] = [],\n\t): Promise<void> {\n\t\tconst remoteItems = await this.getRemoteItems(itemType);\n\t\tawait Promise.all(\n\t\t\tlocalItems.map(async (localItem) => {\n\t\t\t\tconst operation = await this.getDifference(remoteItems, localItem);\n\n\t\t\t\treturn operation && this.upsert(itemType, operation, localItem);\n\t\t\t}),\n\t\t);\n\t}\n\n\t/**\n\t * Create Custom Types using the Custom types api.\n\t *\n\t * @param customTypes -\n\t */\n\tasync createCustomTypes(customTypes: CustomType[] = []): Promise<void> {\n\t\tawait this.upsertIfChanged(\"customtypes\", customTypes);\n\t}\n\n\t/**\n\t * Create slices using the Custom types api.\n\t *\n\t * @param slices -\n\t */\n\tasync createSlices(slices: SharedSlice[] = []): Promise<void> {\n\t\tawait this.upsertIfChanged(\"slices\", slices);\n\t}\n}\n"],"names":[],"mappings":";;;AAmBM,MAAO,6BAA6B,uBAAsB;AAAA,EAC/D,YACC,SACA,QAA0D;AAE1D,UAAM,SAAS,OAAO,WAAW,EAAE,YAAY,OAAO,YAAY;AAAA,EACnE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYQ,MAAM,OACb,UACA,WACA,MAAc;AAER,UAAA,WAAW,OAAO;AACxB,UAAM,OAAO,GAAG,QAAQ,IAAI,SAAS;AAE/B,UAAA,UAAU,MAAM,KAAK;AAC3B,UAAM,SAAS,MAAM,QAAQ,KAAK,MAAM,EAAE,MAAM;AAC5C,QAAA,CAAC,OAAO,MAAM;AACjB,+BAAyB,MAAM;AAC/B,YAAM,IAAI,MAAM,aAAa,SAAS,OAAO;AAAA,IAC9C;AACA,aAAS,KAAK;AAAA,MACb,SAAS,2BAA2B,IAAI,sBAAsB,KAAK,EAAE;AAAA,IAAA,CACrE;AAAA,EACF;AAAA,EAEQ,MAAM,eACb,UAAsB;AAEhB,UAAA,UAAU,MAAM,KAAK;AAC3B,UAAM,SAAS,MAAM,QAAQ,IAAI,QAAQ;AAErC,QAAA,CAAC,OAAO,MAAM;AACjB,+BAAyB,MAAM;AACzB,YAAA,IAAI,MAAM,sDAAsD;AAAA,IACvE;AAEA,WAAO,OAAO;EACf;AAAA,EAEQ,MAAM,cACb,aACA,OAAe;AAET,UAAA,aAAa,YAAY,KAC9B,CAAC,WAAqC,OAAO,OAAO,MAAM,EAAE;AAE7D,QAAI,CAAC,YAAY;AACT,aAAA;AAAA,IACR;AACA,QAAI,CAAC,QAAQ,OAAO,UAAU,GAAG;AACzB,aAAA;AAAA,IACR;AAEA;AAAA,EACD;AAAA;AAAA,EAGQ,MAAM,gBACb,UACA,aAAyB,IAAE;AAE3B,UAAM,cAAc,MAAM,KAAK,eAAe,QAAQ;AACtD,UAAM,QAAQ,IACb,WAAW,IAAI,OAAO,cAAa;AAClC,YAAM,YAAY,MAAM,KAAK,cAAc,aAAa,SAAS;AAEjE,aAAO,aAAa,KAAK,OAAO,UAAU,WAAW,SAAS;AAAA,IAC9D,CAAA,CAAC;AAAA,EAEJ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,kBAAkB,cAA4B,IAAE;AAC/C,UAAA,KAAK,gBAAgB,eAAe,WAAW;AAAA,EACtD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,aAAa,SAAwB,IAAE;AACtC,UAAA,KAAK,gBAAgB,UAAU,MAAM;AAAA,EAC5C;AACA;"}
|
|
@@ -1,36 +1,37 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const axios = require("axios");
|
|
4
3
|
const log = require("../utils/log.cjs");
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
4
|
+
const apiClient = require("./apiClient.cjs");
|
|
5
|
+
class MigrationApiClient extends apiClient.AuthenticatedApiClient {
|
|
6
|
+
/**
|
|
7
|
+
* @example To instantiate the class:
|
|
8
|
+
*
|
|
9
|
+
* ```js
|
|
10
|
+
* new MigrationApiClient("https://migration.prismic.io", {
|
|
11
|
+
* authToken: "my-secret-token",
|
|
12
|
+
* repository: "my-repo-name",
|
|
13
|
+
* });
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* @param baseURL - the api base URL like https://migration.prismic.io
|
|
17
|
+
* @param config - Optional configuration
|
|
18
|
+
*
|
|
19
|
+
* - {@link config.authToken}: Api token generated from the auth service or a
|
|
20
|
+
* function to fetch it when it's needed.
|
|
21
|
+
* - {@link config.repository}: Repository name.
|
|
22
|
+
*/
|
|
23
|
+
constructor(baseURL, config) {
|
|
24
|
+
super(baseURL, config.authToken, { repository: config.repository });
|
|
25
|
+
}
|
|
26
|
+
async createDocument(data) {
|
|
27
|
+
const context = await this.getContext();
|
|
28
|
+
const result = await context.post("documents", { data });
|
|
29
|
+
if (201 !== result.status()) {
|
|
30
|
+
await log.logPlaywrightApiResponse(result);
|
|
27
31
|
throw new Error("Could not create a document with the migration api.");
|
|
28
32
|
}
|
|
29
|
-
return result.
|
|
33
|
+
return result.json();
|
|
30
34
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
exports.createMigrationApiClient = createMigrationApiClient;
|
|
35
|
+
}
|
|
36
|
+
exports.MigrationApiClient = MigrationApiClient;
|
|
36
37
|
//# sourceMappingURL=migrationApi.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrationApi.cjs","sources":["../../../src/clients/migrationApi.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"migrationApi.cjs","sources":["../../../src/clients/migrationApi.ts"],"sourcesContent":["import { logPlaywrightApiResponse } from \"../utils/log\";\n\nimport { AuthServerToken, AuthenticatedApiClient } from \"./apiClient\";\n\nexport type DocumentPayload = {\n\tuid?: string | null;\n\ttype: string;\n\tlang: string;\n\ttitle: string;\n\ttags?: string[];\n\talternate_language_id?: string;\n\tdata: Record<string, unknown>;\n\t// if true, the document will be part of the documents list instead of in the migration release\n\tinDocuments?: boolean;\n};\nexport type DocumentResponse = {\n\tid: string;\n\ttype: string;\n\tlang: string;\n\ttitle: string;\n\tuid?: string;\n};\n\nexport class MigrationApiClient extends AuthenticatedApiClient {\n\t/**\n\t * @example To instantiate the class:\n\t *\n\t * ```js\n\t * new MigrationApiClient(\"https://migration.prismic.io\", {\n\t * \tauthToken: \"my-secret-token\",\n\t * \trepository: \"my-repo-name\",\n\t * });\n\t * ```\n\t *\n\t * @param baseURL - the api base URL like https://migration.prismic.io\n\t * @param config - Optional configuration\n\t *\n\t * - {@link config.authToken}: Api token generated from the auth service or a\n\t * function to fetch it when it's needed.\n\t * - {@link config.repository}: Repository name.\n\t */\n\tconstructor(\n\t\tbaseURL: string,\n\t\tconfig: { authToken: AuthServerToken; repository: string },\n\t) {\n\t\tsuper(baseURL, config.authToken, { repository: config.repository });\n\t}\n\n\tasync createDocument(data: DocumentPayload): Promise<DocumentResponse> {\n\t\tconst context = await this.getContext();\n\t\tconst result = await context.post(\"documents\", { data });\n\n\t\tif (201 !== result.status()) {\n\t\t\tawait logPlaywrightApiResponse(result);\n\t\t\tthrow new Error(\"Could not create a document with the migration api.\");\n\t\t}\n\n\t\treturn result.json();\n\t}\n}\n"],"names":["AuthenticatedApiClient","logPlaywrightApiResponse"],"mappings":";;;;AAuBM,MAAO,2BAA2BA,UAAAA,uBAAsB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAkB7D,YACC,SACA,QAA0D;AAE1D,UAAM,SAAS,OAAO,WAAW,EAAE,YAAY,OAAO,YAAY;AAAA,EACnE;AAAA,EAEA,MAAM,eAAe,MAAqB;AACnC,UAAA,UAAU,MAAM,KAAK;AAC3B,UAAM,SAAS,MAAM,QAAQ,KAAK,aAAa,EAAE,MAAM;AAEnD,QAAA,QAAQ,OAAO,UAAU;AAC5B,YAAMC,IAAAA,yBAAyB,MAAM;AAC/B,YAAA,IAAI,MAAM,qDAAqD;AAAA,IACtE;AAEA,WAAO,OAAO;EACf;AACA;;"}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export type MigrationClient = {
|
|
3
|
-
createDocument(data: DocumentPayload): Promise<DocumentResponse>;
|
|
4
|
-
};
|
|
1
|
+
import { AuthServerToken, AuthenticatedApiClient } from "./apiClient";
|
|
5
2
|
export type DocumentPayload = {
|
|
6
3
|
uid?: string | null;
|
|
4
|
+
type: string;
|
|
7
5
|
lang: string;
|
|
8
6
|
title: string;
|
|
9
7
|
tags?: string[];
|
|
10
8
|
alternate_language_id?: string;
|
|
11
9
|
data: Record<string, unknown>;
|
|
10
|
+
inDocuments?: boolean;
|
|
12
11
|
};
|
|
13
12
|
export type DocumentResponse = {
|
|
14
13
|
id: string;
|
|
@@ -17,4 +16,27 @@ export type DocumentResponse = {
|
|
|
17
16
|
title: string;
|
|
18
17
|
uid?: string;
|
|
19
18
|
};
|
|
20
|
-
export declare
|
|
19
|
+
export declare class MigrationApiClient extends AuthenticatedApiClient {
|
|
20
|
+
/**
|
|
21
|
+
* @example To instantiate the class:
|
|
22
|
+
*
|
|
23
|
+
* ```js
|
|
24
|
+
* new MigrationApiClient("https://migration.prismic.io", {
|
|
25
|
+
* authToken: "my-secret-token",
|
|
26
|
+
* repository: "my-repo-name",
|
|
27
|
+
* });
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* @param baseURL - the api base URL like https://migration.prismic.io
|
|
31
|
+
* @param config - Optional configuration
|
|
32
|
+
*
|
|
33
|
+
* - {@link config.authToken}: Api token generated from the auth service or a
|
|
34
|
+
* function to fetch it when it's needed.
|
|
35
|
+
* - {@link config.repository}: Repository name.
|
|
36
|
+
*/
|
|
37
|
+
constructor(baseURL: string, config: {
|
|
38
|
+
authToken: AuthServerToken;
|
|
39
|
+
repository: string;
|
|
40
|
+
});
|
|
41
|
+
createDocument(data: DocumentPayload): Promise<DocumentResponse>;
|
|
42
|
+
}
|
|
@@ -1,36 +1,37 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
import { logPlaywrightApiResponse } from "../utils/log.js";
|
|
2
|
+
import { AuthenticatedApiClient } from "./apiClient.js";
|
|
3
|
+
class MigrationApiClient extends AuthenticatedApiClient {
|
|
4
|
+
/**
|
|
5
|
+
* @example To instantiate the class:
|
|
6
|
+
*
|
|
7
|
+
* ```js
|
|
8
|
+
* new MigrationApiClient("https://migration.prismic.io", {
|
|
9
|
+
* authToken: "my-secret-token",
|
|
10
|
+
* repository: "my-repo-name",
|
|
11
|
+
* });
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* @param baseURL - the api base URL like https://migration.prismic.io
|
|
15
|
+
* @param config - Optional configuration
|
|
16
|
+
*
|
|
17
|
+
* - {@link config.authToken}: Api token generated from the auth service or a
|
|
18
|
+
* function to fetch it when it's needed.
|
|
19
|
+
* - {@link config.repository}: Repository name.
|
|
20
|
+
*/
|
|
21
|
+
constructor(baseURL, config) {
|
|
22
|
+
super(baseURL, config.authToken, { repository: config.repository });
|
|
23
|
+
}
|
|
24
|
+
async createDocument(data) {
|
|
25
|
+
const context = await this.getContext();
|
|
26
|
+
const result = await context.post("documents", { data });
|
|
27
|
+
if (201 !== result.status()) {
|
|
28
|
+
await logPlaywrightApiResponse(result);
|
|
25
29
|
throw new Error("Could not create a document with the migration api.");
|
|
26
30
|
}
|
|
27
|
-
return result.
|
|
31
|
+
return result.json();
|
|
28
32
|
}
|
|
29
|
-
|
|
30
|
-
createDocument
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
+
}
|
|
33
34
|
export {
|
|
34
|
-
|
|
35
|
+
MigrationApiClient
|
|
35
36
|
};
|
|
36
37
|
//# sourceMappingURL=migrationApi.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrationApi.js","sources":["../../../src/clients/migrationApi.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"migrationApi.js","sources":["../../../src/clients/migrationApi.ts"],"sourcesContent":["import { logPlaywrightApiResponse } from \"../utils/log\";\n\nimport { AuthServerToken, AuthenticatedApiClient } from \"./apiClient\";\n\nexport type DocumentPayload = {\n\tuid?: string | null;\n\ttype: string;\n\tlang: string;\n\ttitle: string;\n\ttags?: string[];\n\talternate_language_id?: string;\n\tdata: Record<string, unknown>;\n\t// if true, the document will be part of the documents list instead of in the migration release\n\tinDocuments?: boolean;\n};\nexport type DocumentResponse = {\n\tid: string;\n\ttype: string;\n\tlang: string;\n\ttitle: string;\n\tuid?: string;\n};\n\nexport class MigrationApiClient extends AuthenticatedApiClient {\n\t/**\n\t * @example To instantiate the class:\n\t *\n\t * ```js\n\t * new MigrationApiClient(\"https://migration.prismic.io\", {\n\t * \tauthToken: \"my-secret-token\",\n\t * \trepository: \"my-repo-name\",\n\t * });\n\t * ```\n\t *\n\t * @param baseURL - the api base URL like https://migration.prismic.io\n\t * @param config - Optional configuration\n\t *\n\t * - {@link config.authToken}: Api token generated from the auth service or a\n\t * function to fetch it when it's needed.\n\t * - {@link config.repository}: Repository name.\n\t */\n\tconstructor(\n\t\tbaseURL: string,\n\t\tconfig: { authToken: AuthServerToken; repository: string },\n\t) {\n\t\tsuper(baseURL, config.authToken, { repository: config.repository });\n\t}\n\n\tasync createDocument(data: DocumentPayload): Promise<DocumentResponse> {\n\t\tconst context = await this.getContext();\n\t\tconst result = await context.post(\"documents\", { data });\n\n\t\tif (201 !== result.status()) {\n\t\t\tawait logPlaywrightApiResponse(result);\n\t\t\tthrow new Error(\"Could not create a document with the migration api.\");\n\t\t}\n\n\t\treturn result.json();\n\t}\n}\n"],"names":[],"mappings":";;AAuBM,MAAO,2BAA2B,uBAAsB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAkB7D,YACC,SACA,QAA0D;AAE1D,UAAM,SAAS,OAAO,WAAW,EAAE,YAAY,OAAO,YAAY;AAAA,EACnE;AAAA,EAEA,MAAM,eAAe,MAAqB;AACnC,UAAA,UAAU,MAAM,KAAK;AAC3B,UAAM,SAAS,MAAM,QAAQ,KAAK,aAAa,EAAE,MAAM;AAEnD,QAAA,QAAQ,OAAO,UAAU;AAC5B,YAAM,yBAAyB,MAAM;AAC/B,YAAA,IAAI,MAAM,qDAAqD;AAAA,IACtE;AAEA,WAAO,OAAO;EACf;AACA;"}
|
package/dist/index.cjs
CHANGED
|
@@ -8,5 +8,5 @@ exports.RepositoriesManager = repositories.RepositoriesManager;
|
|
|
8
8
|
exports.createRepositoriesManager = repositories.createRepositoriesManager;
|
|
9
9
|
exports.RepositoryManager = repository.RepositoryManager;
|
|
10
10
|
exports.ContentApiClient = contentApi.ContentApiClient;
|
|
11
|
-
exports.
|
|
11
|
+
exports.MigrationApiClient = migrationApi.MigrationApiClient;
|
|
12
12
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { RepositoriesManager, createRepositoriesManager } from "./managers/repositories.js";
|
|
2
2
|
import { RepositoryManager } from "./managers/repository.js";
|
|
3
3
|
import { ContentApiClient } from "./clients/contentApi.js";
|
|
4
|
-
import {
|
|
4
|
+
import { MigrationApiClient } from "./clients/migrationApi.js";
|
|
5
5
|
export {
|
|
6
6
|
ContentApiClient,
|
|
7
|
+
MigrationApiClient,
|
|
7
8
|
RepositoriesManager,
|
|
8
9
|
RepositoryManager,
|
|
9
|
-
createMigrationApiClient,
|
|
10
10
|
createRepositoriesManager
|
|
11
11
|
};
|
|
12
12
|
//# sourceMappingURL=index.js.map
|
|
@@ -42,7 +42,7 @@ class RepositoriesManager {
|
|
|
42
42
|
urlConfig: typeof configuration.urlConfig === "string" ? this.inferUrls(configuration.urlConfig) : configuration.urlConfig
|
|
43
43
|
};
|
|
44
44
|
this.wroomClient = new wroom.WroomClient(this.config.urlConfig.baseURL, this.config.authConfig);
|
|
45
|
-
this.authClient = authenticationApi.
|
|
45
|
+
this.authClient = new authenticationApi.AuthenticationApiClient(this.config.urlConfig.authenticationApi, this.config.authConfig);
|
|
46
46
|
this.manageV2Client = new manageV2.ManageV2Client(this.config.urlConfig.baseURL, this.config.manageV2Config);
|
|
47
47
|
}
|
|
48
48
|
/**
|
|
@@ -90,8 +90,11 @@ class RepositoriesManager {
|
|
|
90
90
|
throw new Error(`Could not create repository ${repositoryName}`);
|
|
91
91
|
}
|
|
92
92
|
this.repositories.add(repositoryName);
|
|
93
|
-
profiler.done({ message: `created repository '${repositoryName}'` });
|
|
94
93
|
const repository2 = this.getRepositoryManager(repositoryName);
|
|
94
|
+
const version = await repository2.getDeployedVersion();
|
|
95
|
+
profiler.done({
|
|
96
|
+
message: `created repository '${repositoryName}', Wroom version is "${version}"`
|
|
97
|
+
});
|
|
95
98
|
await repository2.configure(config);
|
|
96
99
|
return repository2;
|
|
97
100
|
}
|
|
@@ -132,15 +135,22 @@ class RepositoriesManager {
|
|
|
132
135
|
/**
|
|
133
136
|
* Return a repository utilities object for a repository.
|
|
134
137
|
*
|
|
135
|
-
* @param
|
|
138
|
+
* @param repository - The name of the repository.
|
|
136
139
|
*/
|
|
137
|
-
getRepositoryManager(
|
|
140
|
+
getRepositoryManager(repository$1) {
|
|
138
141
|
const { urlConfig } = this.config;
|
|
139
|
-
const
|
|
140
|
-
const
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
142
|
+
const authToken = () => this.authClient.getToken();
|
|
143
|
+
const customTypeClient = new customTypesApi.CustomTypesApiClient(urlConfig.customTypesApi, {
|
|
144
|
+
authToken,
|
|
145
|
+
repository: repository$1
|
|
146
|
+
});
|
|
147
|
+
const coreApiUrl = urls.getRepositoryUrl(urlConfig.baseURL, repository$1);
|
|
148
|
+
const coreApiClient = new coreApi.CoreApiClient(coreApiUrl, authToken);
|
|
149
|
+
const migrationApiClient = urlConfig.migrationApi ? new migrationApi.MigrationApiClient(urlConfig.migrationApi, {
|
|
150
|
+
authToken,
|
|
151
|
+
repository: repository$1
|
|
152
|
+
}) : void 0;
|
|
153
|
+
return new repository.RepositoryManager(repository$1, coreApiClient, this.authClient, this.wroomClient, customTypeClient, migrationApiClient, this.manageV2Client);
|
|
144
154
|
}
|
|
145
155
|
}
|
|
146
156
|
exports.RepositoriesManager = RepositoriesManager;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repositories.cjs","sources":["../../../src/managers/repositories.ts"],"sourcesContent":["import { SetupConfiguration, UrlConfig } from \"../types\";\n\nimport {\n\tAuthenticationClient,\n\tcreateAuthenticationApiClient,\n} from \"../clients/authenticationApi\";\nimport { createCoreApiClient } from \"../clients/coreApi\";\nimport { createCustomTypesApiClient } from \"../clients/customTypesApi\";\nimport { ManageV2Client } from \"../clients/manageV2\";\nimport { createMigrationApiClient } from \"../clients/migrationApi\";\nimport { WroomClient } from \"../clients/wroom\";\nimport { EnvVariableManager } from \"../utils/envVariableManager\";\nimport { logHttpResponse, logger } from \"../utils/log\";\nimport { randomString } from \"../utils/random\";\nimport { getRepositoryUrl } from \"../utils/urls\";\n\nimport { RepositoryConfig, RepositoryManager } from \"./repository\";\n\n/**\n * Factory method to create a RepositoriesManager to manage repositories test\n * data.\n *\n * @param configuration - Global object containing the different configurations\n * required to setup the RepositoriesManager.\n *\n * - {@link configuration.urlConfig}: Configuration around the API's URLs management.\n * - {@link configuration.authConfig}: Configuration around the authentication of a user.\n * - {@link configuration.manageV2Config}: Optional Configuration used to make calls to ManageV2.\n *\n * @returns An instance of {@link RepositoriesManager} to manage test data.\n */\nexport const createRepositoriesManager = (\n\tconfiguration: SetupConfiguration,\n): RepositoriesManager => {\n\treturn new RepositoriesManager(configuration);\n};\n\n/** Utility object to manage Prismic test data */\nexport class RepositoriesManager {\n\tprivate readonly config: Omit<SetupConfiguration, \"urlConfig\"> & {\n\t\turlConfig: UrlConfig;\n\t};\n\tprivate readonly wroomClient: WroomClient;\n\tprivate readonly authClient: AuthenticationClient;\n\tprivate readonly manageV2Client: ManageV2Client;\n\t/**\n\t * helper to keep track of repositories across independent test phases (setup,\n\t * teardown)\n\t */\n\tprivate readonly repositories = new EnvVariableManager(\n\t\t\"_PRISMIC_E2E_TESTS_REPOS\",\n\t);\n\n\t/**\n\t * @param configuration - Global object containing the different configuration\n\t * required to setup the different clients.\n\t * @param credentials - Authentication credentials (email and password)\n\t */\n\tconstructor(configuration: SetupConfiguration) {\n\t\tthis.config = {\n\t\t\t...configuration,\n\t\t\t// When a string is provided, treat it as the 'base' property\n\t\t\turlConfig:\n\t\t\t\ttypeof configuration.urlConfig === \"string\"\n\t\t\t\t\t? this.inferUrls(configuration.urlConfig)\n\t\t\t\t\t: configuration.urlConfig,\n\t\t};\n\n\t\tthis.wroomClient = new WroomClient(\n\t\t\tthis.config.urlConfig.baseURL,\n\t\t\tthis.config.authConfig,\n\t\t);\n\t\tthis.authClient = createAuthenticationApiClient(\n\t\t\tthis.config.urlConfig.authenticationApi,\n\t\t\tthis.config.authConfig,\n\t\t);\n\t\tthis.manageV2Client = new ManageV2Client(\n\t\t\tthis.config.urlConfig.baseURL,\n\t\t\tthis.config.manageV2Config,\n\t\t);\n\t}\n\n\t/**\n\t * If the baseURL is prismic.io, assume the other services have the format\n\t * <name>.prismic.io\n\t */\n\tprivate inferUrls(baseURL: string): UrlConfig {\n\t\tconst url = new URL(baseURL);\n\t\tconst protocol = url.protocol.slice(0, -1); // Remove the trailing colon from the protocol\n\n\t\treturn {\n\t\t\tbaseURL: baseURL,\n\t\t\tauthenticationApi: `${protocol}://auth.${url.hostname}`,\n\t\t\tcustomTypesApi: `${protocol}://customtypes.${url.hostname}`,\n\t\t\tmigrationApi: `${protocol}://migration.${url.hostname}`,\n\t\t};\n\t}\n\n\t/**\n\t * Generate a user token from the authentication service.\n\t *\n\t * @returns a JWT token\n\t */\n\tasync getUserApiToken(): Promise<string> {\n\t\treturn this.authClient.getToken();\n\t}\n\n\t/**\n\t * Create a new repository in Wroom.\n\t *\n\t * @param repositoryName - The name of the repository.\n\t *\n\t * @throws Error if the repository creation fails.\n\t */\n\tasync createRepository(\n\t\tconfig: {\n\t\t\tprefix?: string;\n\t\t} & RepositoryConfig = {},\n\t): Promise<RepositoryManager> {\n\t\tconst profiler = logger.startTimer();\n\n\t\tconst { prefix = \"e2e-tests\" } = config;\n\t\tconst repositoryName = `${prefix}-${randomString()}`;\n\n\t\tconst response = await this.wroomClient.post(\n\t\t\tnull,\n\t\t\t\"authentication/newrepository\",\n\t\t\t{\n\t\t\t\tdomain: repositoryName,\n\t\t\t\tframework: \"vue\",\n\t\t\t\tplan: \"personal\",\n\t\t\t\tisAnnual: \"false\",\n\t\t\t\trole: \"developer\",\n\t\t\t},\n\t\t);\n\t\tif (response.status !== 200) {\n\t\t\tlogHttpResponse(response);\n\t\t\tthrow new Error(`Could not create repository ${repositoryName}`);\n\t\t}\n\t\tthis.repositories.add(repositoryName);\n\n\t\tprofiler.done({ message: `created repository '${repositoryName}'` });\n\n\t\tconst repository = this.getRepositoryManager(repositoryName);\n\t\tawait repository.configure(config);\n\n\t\treturn repository;\n\t}\n\n\t/**\n\t * Delete a repository from Wroom.\n\t *\n\t * @param repository - The name of the repository.\n\t *\n\t * @throws Error if the repository deletion fails.\n\t */\n\tasync deleteRepository(repository: string): Promise<void> {\n\t\tconst profiler = logger.startTimer();\n\n\t\tconst post = async () =>\n\t\t\tthis.wroomClient.post(repository, \"app/settings/delete\", {\n\t\t\t\tconfirm: repository,\n\t\t\t\tpassword: this.config.authConfig.password,\n\t\t\t});\n\t\tconst response = await post();\n\t\tif (response.status !== 200) {\n\t\t\t// sometimes the deletion returns 500 but actually succeeds\n\t\t\t// we run the query again and check the repo is actually deleted (404)\n\t\t\tconst retry = await post();\n\t\t\tif (retry.status !== 404) {\n\t\t\t\tlogHttpResponse(response);\n\t\t\t\tthrow new Error(`Could not delete repository ${repository}`);\n\t\t\t}\n\t\t}\n\t\tthis.repositories.remove(repository);\n\t\tprofiler.done({ message: `deleted repository '${repository}'` });\n\t}\n\n\t/**\n\t * Cleanup test data. For example, it deletes repositories created using\n\t * createRepository()\n\t */\n\tasync tearDown(): Promise<void> {\n\t\tconst repositories = this.repositories.getAll();\n\t\tfor (const repository of repositories) {\n\t\t\tawait this.deleteRepository(repository);\n\t\t}\n\t}\n\n\t/**\n\t * Return a repository utilities object for a repository.\n\t *\n\t * @param name - The name of the repository.\n\t */\n\tgetRepositoryManager(name: string): RepositoryManager {\n\t\tconst { urlConfig } = this.config;\n\t\tconst customTypeClient = createCustomTypesApiClient(\n\t\t\turlConfig.customTypesApi,\n\t\t\tname,\n\t\t\tthis.authClient,\n\t\t);\n\t\tconst coreApiUrl = getRepositoryUrl(urlConfig.baseURL, name);\n\t\tconst coreApiClient = createCoreApiClient(coreApiUrl, this.authClient);\n\t\tconst migrationApiClient = urlConfig.migrationApi\n\t\t\t? createMigrationApiClient(urlConfig.migrationApi, name, this.authClient)\n\t\t\t: undefined;\n\n\t\treturn new RepositoryManager(\n\t\t\tname,\n\t\t\tcoreApiClient,\n\t\t\tthis.authClient,\n\t\t\tthis.wroomClient,\n\t\t\tcustomTypeClient,\n\t\t\tmigrationApiClient,\n\t\t\tthis.manageV2Client,\n\t\t);\n\t}\n}\n"],"names":["EnvVariableManager","WroomClient","createAuthenticationApiClient","ManageV2Client","logger","randomString","logHttpResponse","repository","createCustomTypesApiClient","getRepositoryUrl","createCoreApiClient","createMigrationApiClient","RepositoryManager"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"repositories.cjs","sources":["../../../src/managers/repositories.ts"],"sourcesContent":["import { SetupConfiguration, UrlConfig } from \"../types\";\n\nimport { AuthenticationApiClient } from \"../clients/authenticationApi\";\nimport { CoreApiClient } from \"../clients/coreApi\";\nimport { CustomTypesApiClient } from \"../clients/customTypesApi\";\nimport { ManageV2Client } from \"../clients/manageV2\";\nimport { MigrationApiClient } from \"../clients/migrationApi\";\nimport { WroomClient } from \"../clients/wroom\";\nimport { EnvVariableManager } from \"../utils/envVariableManager\";\nimport { logHttpResponse, logger } from \"../utils/log\";\nimport { randomString } from \"../utils/random\";\nimport { getRepositoryUrl } from \"../utils/urls\";\n\nimport { RepositoryConfig, RepositoryManager } from \"./repository\";\n\n/**\n * Factory method to create a RepositoriesManager to manage repositories test\n * data.\n *\n * @param configuration - Global object containing the different configurations\n * required to setup the RepositoriesManager.\n *\n * - {@link configuration.urlConfig}: Configuration around the API's URLs management.\n * - {@link configuration.authConfig}: Configuration around the authentication of a user.\n * - {@link configuration.manageV2Config}: Optional Configuration used to make calls to ManageV2.\n *\n * @returns An instance of {@link RepositoriesManager} to manage test data.\n */\nexport const createRepositoriesManager = (\n\tconfiguration: SetupConfiguration,\n): RepositoriesManager => {\n\treturn new RepositoriesManager(configuration);\n};\n\n/** Utility object to manage Prismic test data */\nexport class RepositoriesManager {\n\tprivate readonly config: Omit<SetupConfiguration, \"urlConfig\"> & {\n\t\turlConfig: UrlConfig;\n\t};\n\tprivate readonly wroomClient: WroomClient;\n\tprivate readonly authClient: AuthenticationApiClient;\n\tprivate readonly manageV2Client: ManageV2Client;\n\t/**\n\t * helper to keep track of repositories across independent test phases (setup,\n\t * teardown)\n\t */\n\tprivate readonly repositories = new EnvVariableManager(\n\t\t\"_PRISMIC_E2E_TESTS_REPOS\",\n\t);\n\n\t/**\n\t * @param configuration - Global object containing the different configuration\n\t * required to setup the different clients.\n\t * @param credentials - Authentication credentials (email and password)\n\t */\n\tconstructor(configuration: SetupConfiguration) {\n\t\tthis.config = {\n\t\t\t...configuration,\n\t\t\t// When a string is provided, treat it as the 'base' property\n\t\t\turlConfig:\n\t\t\t\ttypeof configuration.urlConfig === \"string\"\n\t\t\t\t\t? this.inferUrls(configuration.urlConfig)\n\t\t\t\t\t: configuration.urlConfig,\n\t\t};\n\n\t\tthis.wroomClient = new WroomClient(\n\t\t\tthis.config.urlConfig.baseURL,\n\t\t\tthis.config.authConfig,\n\t\t);\n\t\tthis.authClient = new AuthenticationApiClient(\n\t\t\tthis.config.urlConfig.authenticationApi,\n\t\t\tthis.config.authConfig,\n\t\t);\n\t\tthis.manageV2Client = new ManageV2Client(\n\t\t\tthis.config.urlConfig.baseURL,\n\t\t\tthis.config.manageV2Config,\n\t\t);\n\t}\n\n\t/**\n\t * If the baseURL is prismic.io, assume the other services have the format\n\t * <name>.prismic.io\n\t */\n\tprivate inferUrls(baseURL: string): UrlConfig {\n\t\tconst url = new URL(baseURL);\n\t\tconst protocol = url.protocol.slice(0, -1); // Remove the trailing colon from the protocol\n\n\t\treturn {\n\t\t\tbaseURL: baseURL,\n\t\t\tauthenticationApi: `${protocol}://auth.${url.hostname}`,\n\t\t\tcustomTypesApi: `${protocol}://customtypes.${url.hostname}`,\n\t\t\tmigrationApi: `${protocol}://migration.${url.hostname}`,\n\t\t};\n\t}\n\n\t/**\n\t * Generate a user token from the authentication service.\n\t *\n\t * @returns a JWT token\n\t */\n\tasync getUserApiToken(): Promise<string> {\n\t\treturn this.authClient.getToken();\n\t}\n\n\t/**\n\t * Create a new repository in Wroom.\n\t *\n\t * @param repositoryName - The name of the repository.\n\t *\n\t * @throws Error if the repository creation fails.\n\t */\n\tasync createRepository(\n\t\tconfig: {\n\t\t\tprefix?: string;\n\t\t} & RepositoryConfig = {},\n\t): Promise<RepositoryManager> {\n\t\tconst profiler = logger.startTimer();\n\n\t\tconst { prefix = \"e2e-tests\" } = config;\n\t\tconst repositoryName = `${prefix}-${randomString()}`;\n\n\t\tconst response = await this.wroomClient.post(\n\t\t\tnull,\n\t\t\t\"authentication/newrepository\",\n\t\t\t{\n\t\t\t\tdomain: repositoryName,\n\t\t\t\tframework: \"vue\",\n\t\t\t\tplan: \"personal\",\n\t\t\t\tisAnnual: \"false\",\n\t\t\t\trole: \"developer\",\n\t\t\t},\n\t\t);\n\t\tif (response.status !== 200) {\n\t\t\tlogHttpResponse(response);\n\t\t\tthrow new Error(`Could not create repository ${repositoryName}`);\n\t\t}\n\t\tthis.repositories.add(repositoryName);\n\n\t\tconst repository = this.getRepositoryManager(repositoryName);\n\t\tconst version = await repository.getDeployedVersion();\n\n\t\tprofiler.done({\n\t\t\tmessage: `created repository '${repositoryName}', Wroom version is \"${version}\"`,\n\t\t});\n\t\tawait repository.configure(config);\n\n\t\treturn repository;\n\t}\n\n\t/**\n\t * Delete a repository from Wroom.\n\t *\n\t * @param repository - The name of the repository.\n\t *\n\t * @throws Error if the repository deletion fails.\n\t */\n\tasync deleteRepository(repository: string): Promise<void> {\n\t\tconst profiler = logger.startTimer();\n\n\t\tconst post = async () =>\n\t\t\tthis.wroomClient.post(repository, \"app/settings/delete\", {\n\t\t\t\tconfirm: repository,\n\t\t\t\tpassword: this.config.authConfig.password,\n\t\t\t});\n\t\tconst response = await post();\n\t\tif (response.status !== 200) {\n\t\t\t// sometimes the deletion returns 500 but actually succeeds\n\t\t\t// we run the query again and check the repo is actually deleted (404)\n\t\t\tconst retry = await post();\n\t\t\tif (retry.status !== 404) {\n\t\t\t\tlogHttpResponse(response);\n\t\t\t\tthrow new Error(`Could not delete repository ${repository}`);\n\t\t\t}\n\t\t}\n\t\tthis.repositories.remove(repository);\n\t\tprofiler.done({ message: `deleted repository '${repository}'` });\n\t}\n\n\t/**\n\t * Cleanup test data. For example, it deletes repositories created using\n\t * createRepository()\n\t */\n\tasync tearDown(): Promise<void> {\n\t\tconst repositories = this.repositories.getAll();\n\t\tfor (const repository of repositories) {\n\t\t\tawait this.deleteRepository(repository);\n\t\t}\n\t}\n\n\t/**\n\t * Return a repository utilities object for a repository.\n\t *\n\t * @param repository - The name of the repository.\n\t */\n\tgetRepositoryManager(repository: string): RepositoryManager {\n\t\tconst { urlConfig } = this.config;\n\t\tconst authToken = () => this.authClient.getToken();\n\t\tconst customTypeClient = new CustomTypesApiClient(\n\t\t\turlConfig.customTypesApi,\n\t\t\t{\n\t\t\t\tauthToken,\n\t\t\t\trepository,\n\t\t\t},\n\t\t);\n\t\tconst coreApiUrl = getRepositoryUrl(urlConfig.baseURL, repository);\n\t\tconst coreApiClient = new CoreApiClient(coreApiUrl, authToken);\n\t\tconst migrationApiClient = urlConfig.migrationApi\n\t\t\t? new MigrationApiClient(urlConfig.migrationApi, {\n\t\t\t\t\tauthToken,\n\t\t\t\t\trepository,\n\t\t\t\t})\n\t\t\t: undefined;\n\n\t\treturn new RepositoryManager(\n\t\t\trepository,\n\t\t\tcoreApiClient,\n\t\t\tthis.authClient,\n\t\t\tthis.wroomClient,\n\t\t\tcustomTypeClient,\n\t\t\tmigrationApiClient,\n\t\t\tthis.manageV2Client,\n\t\t);\n\t}\n}\n"],"names":["EnvVariableManager","WroomClient","AuthenticationApiClient","ManageV2Client","logger","randomString","logHttpResponse","repository","CustomTypesApiClient","getRepositoryUrl","CoreApiClient","MigrationApiClient","RepositoryManager"],"mappings":"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"}
|
|
@@ -68,7 +68,7 @@ export declare class RepositoriesManager {
|
|
|
68
68
|
/**
|
|
69
69
|
* Return a repository utilities object for a repository.
|
|
70
70
|
*
|
|
71
|
-
* @param
|
|
71
|
+
* @param repository - The name of the repository.
|
|
72
72
|
*/
|
|
73
|
-
getRepositoryManager(
|
|
73
|
+
getRepositoryManager(repository: string): RepositoryManager;
|
|
74
74
|
}
|