@prismicio/e2e-tests-utils 1.17.1-alpha.0 → 1.18.0-canary.933a809
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 +24 -27
- package/dist/_virtual/_rolldown/runtime.cjs +23 -0
- package/dist/clients/apiClient.cjs +38 -38
- package/dist/clients/apiClient.cjs.map +1 -1
- package/dist/clients/apiClient.d.cts +30 -0
- package/dist/clients/apiClient.d.cts.map +1 -0
- package/dist/clients/apiClient.d.ts +23 -23
- package/dist/clients/apiClient.d.ts.map +1 -0
- package/dist/clients/apiClient.js +38 -38
- package/dist/clients/apiClient.js.map +1 -1
- package/dist/clients/assetApi.cjs +81 -93
- package/dist/clients/assetApi.cjs.map +1 -1
- package/dist/clients/assetApi.d.cts +105 -0
- package/dist/clients/assetApi.d.cts.map +1 -0
- package/dist/clients/assetApi.d.ts +96 -97
- package/dist/clients/assetApi.d.ts.map +1 -0
- package/dist/clients/assetApi.js +79 -91
- package/dist/clients/assetApi.js.map +1 -1
- package/dist/clients/authenticationApi.cjs +52 -73
- package/dist/clients/authenticationApi.cjs.map +1 -1
- package/dist/clients/authenticationApi.d.cts +20 -0
- package/dist/clients/authenticationApi.d.cts.map +1 -0
- package/dist/clients/authenticationApi.d.ts +18 -13
- package/dist/clients/authenticationApi.d.ts.map +1 -0
- package/dist/clients/authenticationApi.js +52 -73
- package/dist/clients/authenticationApi.js.map +1 -1
- package/dist/clients/contentApi.cjs +94 -103
- package/dist/clients/contentApi.cjs.map +1 -1
- package/dist/clients/contentApi.d.cts +116 -0
- package/dist/clients/contentApi.d.cts.map +1 -0
- package/dist/clients/contentApi.d.ts +102 -98
- package/dist/clients/contentApi.d.ts.map +1 -0
- package/dist/clients/contentApi.js +94 -103
- package/dist/clients/contentApi.js.map +1 -1
- package/dist/clients/coreApi.cjs +123 -145
- package/dist/clients/coreApi.cjs.map +1 -1
- package/dist/clients/coreApi.d.cts +122 -0
- package/dist/clients/coreApi.d.cts.map +1 -0
- package/dist/clients/coreApi.d.ts +111 -109
- package/dist/clients/coreApi.d.ts.map +1 -0
- package/dist/clients/coreApi.js +122 -144
- package/dist/clients/coreApi.js.map +1 -1
- package/dist/clients/customTypesApi.cjs +90 -99
- package/dist/clients/customTypesApi.cjs.map +1 -1
- package/dist/clients/customTypesApi.d.cts +46 -0
- package/dist/clients/customTypesApi.d.cts.map +1 -0
- package/dist/clients/customTypesApi.d.ts +45 -45
- package/dist/clients/customTypesApi.d.ts.map +1 -0
- package/dist/clients/customTypesApi.js +87 -98
- package/dist/clients/customTypesApi.js.map +1 -1
- package/dist/clients/integrationFields.cjs +96 -87
- package/dist/clients/integrationFields.cjs.map +1 -1
- package/dist/clients/integrationFields.d.cts +30 -0
- package/dist/clients/integrationFields.d.cts.map +1 -0
- package/dist/clients/integrationFields.d.ts +27 -22
- package/dist/clients/integrationFields.d.ts.map +1 -0
- package/dist/clients/integrationFields.js +93 -86
- package/dist/clients/integrationFields.js.map +1 -1
- package/dist/clients/manageV2.cjs +154 -171
- package/dist/clients/manageV2.cjs.map +1 -1
- package/dist/clients/manageV2.d.cts +105 -0
- package/dist/clients/manageV2.d.cts.map +1 -0
- package/dist/clients/manageV2.d.ts +103 -111
- package/dist/clients/manageV2.d.ts.map +1 -0
- package/dist/clients/manageV2.js +149 -169
- package/dist/clients/manageV2.js.map +1 -1
- package/dist/clients/migrationApi.cjs +37 -36
- package/dist/clients/migrationApi.cjs.map +1 -1
- package/dist/clients/migrationApi.d.cts +48 -0
- package/dist/clients/migrationApi.d.cts.map +1 -0
- package/dist/clients/migrationApi.d.ts +45 -39
- package/dist/clients/migrationApi.d.ts.map +1 -0
- package/dist/clients/migrationApi.js +35 -34
- package/dist/clients/migrationApi.js.map +1 -1
- package/dist/clients/wroom.cjs +101 -122
- package/dist/clients/wroom.cjs.map +1 -1
- package/dist/clients/wroom.d.cts +48 -0
- package/dist/clients/wroom.d.cts.map +1 -0
- package/dist/clients/wroom.d.ts +46 -47
- package/dist/clients/wroom.d.ts.map +1 -0
- package/dist/clients/wroom.js +99 -122
- package/dist/clients/wroom.js.map +1 -1
- package/dist/index.cjs +13 -15
- package/dist/index.d.cts +8 -0
- package/dist/index.d.ts +8 -7
- package/dist/index.js +5 -14
- package/dist/managers/repositories.cjs +159 -169
- package/dist/managers/repositories.cjs.map +1 -1
- package/dist/managers/repositories.d.cts +67 -0
- package/dist/managers/repositories.d.cts.map +1 -0
- package/dist/managers/repositories.d.ts +56 -63
- package/dist/managers/repositories.d.ts.map +1 -0
- package/dist/managers/repositories.js +148 -159
- package/dist/managers/repositories.js.map +1 -1
- package/dist/managers/repository.cjs +529 -616
- package/dist/managers/repository.cjs.map +1 -1
- package/dist/managers/repository.d.cts +308 -0
- package/dist/managers/repository.d.cts.map +1 -0
- package/dist/managers/repository.d.ts +303 -307
- package/dist/managers/repository.d.ts.map +1 -0
- package/dist/managers/repository.js +529 -616
- package/dist/managers/repository.js.map +1 -1
- package/dist/types.d.cts +41 -0
- package/dist/types.d.cts.map +1 -0
- package/dist/types.d.ts +35 -37
- package/dist/types.d.ts.map +1 -0
- package/dist/utils/cookies.cjs +19 -17
- package/dist/utils/cookies.cjs.map +1 -1
- package/dist/utils/cookies.js +20 -18
- package/dist/utils/cookies.js.map +1 -1
- package/dist/utils/envVariableManager.cjs +33 -34
- package/dist/utils/envVariableManager.cjs.map +1 -1
- package/dist/utils/envVariableManager.js +34 -35
- package/dist/utils/envVariableManager.js.map +1 -1
- package/dist/utils/log.cjs +18 -19
- package/dist/utils/log.cjs.map +1 -1
- package/dist/utils/log.js +18 -21
- package/dist/utils/log.js.map +1 -1
- package/dist/utils/random.cjs +13 -6
- package/dist/utils/random.cjs.map +1 -1
- package/dist/utils/random.js +13 -6
- package/dist/utils/random.js.map +1 -1
- package/dist/utils/strings.cjs +13 -7
- package/dist/utils/strings.cjs.map +1 -1
- package/dist/utils/strings.js +14 -8
- package/dist/utils/strings.js.map +1 -1
- package/dist/utils/urls.cjs +21 -10
- package/dist/utils/urls.cjs.map +1 -1
- package/dist/utils/urls.js +22 -12
- package/dist/utils/urls.js.map +1 -1
- package/package.json +42 -67
- package/src/clients/apiClient.ts +16 -21
- package/src/clients/assetApi.ts +75 -82
- package/src/clients/authenticationApi.ts +25 -27
- package/src/clients/contentApi.ts +109 -129
- package/src/clients/coreApi.ts +113 -117
- package/src/clients/customTypesApi.ts +54 -76
- package/src/clients/integrationFields.ts +59 -74
- package/src/clients/manageV2.ts +72 -96
- package/src/clients/migrationApi.ts +35 -39
- package/src/clients/wroom.ts +42 -56
- package/src/index.ts +7 -7
- package/src/managers/repositories.ts +85 -108
- package/src/managers/repository.ts +303 -368
- package/src/types.ts +31 -31
- package/src/utils/cookies.ts +8 -8
- package/src/utils/envVariableManager.ts +15 -15
- package/src/utils/log.ts +17 -21
- package/src/utils/random.ts +5 -6
- package/src/utils/strings.ts +7 -9
- package/src/utils/urls.ts +10 -12
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/utils/cookies.d.ts +0 -8
- package/dist/utils/envVariableManager.d.ts +0 -16
- package/dist/utils/log.d.ts +0 -5
- package/dist/utils/random.d.ts +0 -8
- package/dist/utils/strings.d.ts +0 -11
- package/dist/utils/urls.d.ts +0 -16
|
@@ -1,89 +1,98 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
const require_runtime = require("../_virtual/_rolldown/runtime.cjs");
|
|
2
|
+
const require_log = require("../utils/log.cjs");
|
|
3
|
+
const require_strings = require("../utils/strings.cjs");
|
|
4
|
+
let axios = require("axios");
|
|
5
|
+
axios = require_runtime.__toESM(axios, 1);
|
|
6
|
+
//#region src/clients/integrationFields.ts
|
|
7
|
+
/**
|
|
8
|
+
* Client for interacting with Integration Fields routes to create integration field catalogs and
|
|
9
|
+
* add them to custom type fields.
|
|
10
|
+
*/
|
|
11
|
+
var IntegrationFieldsClient = class {
|
|
12
|
+
baseURL;
|
|
13
|
+
customTypesApiClient;
|
|
14
|
+
wroomClient;
|
|
15
|
+
repository;
|
|
16
|
+
tokens = {};
|
|
17
|
+
constructor(baseURL, config) {
|
|
18
|
+
this.baseURL = baseURL;
|
|
19
|
+
this.customTypesApiClient = config.customTypesApiClient;
|
|
20
|
+
this.wroomClient = config.wroomClient;
|
|
21
|
+
this.repository = config.repository;
|
|
22
|
+
}
|
|
23
|
+
async getClient(catalogId) {
|
|
24
|
+
const token = this.tokens[catalogId] || await this.createToken(catalogId);
|
|
25
|
+
return axios.default.create({
|
|
26
|
+
baseURL: `${this.baseURL}/if/`,
|
|
27
|
+
withCredentials: true,
|
|
28
|
+
validateStatus: () => true,
|
|
29
|
+
headers: {
|
|
30
|
+
"User-Agent": "prismic-cli/prismic-e2e-tests-utils",
|
|
31
|
+
Authorization: `Bearer ${token}`
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
async addCatalog({ name, description }) {
|
|
36
|
+
const response = await this.wroomClient.post(this.repository, "app/settings/integrationfields/pushcustom", {
|
|
37
|
+
"catalog-name": name,
|
|
38
|
+
"catalog-description": description
|
|
39
|
+
});
|
|
40
|
+
const { data, status } = response;
|
|
41
|
+
if (!(status === 200 || status === 400 && data.includes("Already existing integration field"))) {
|
|
42
|
+
require_log.logHttpResponse(response);
|
|
43
|
+
throw new Error(`Could not add integration field catalog ${name}`);
|
|
44
|
+
}
|
|
45
|
+
return `${this.repository}--${require_strings.slugify(name)}`;
|
|
46
|
+
}
|
|
47
|
+
async createToken(catalogId) {
|
|
48
|
+
const response = await this.wroomClient.post(this.repository, `app/settings/integrationfields/pushcustom/${catalogId}/token`);
|
|
49
|
+
const { data: tokenData, status } = response;
|
|
50
|
+
if (status !== 201) {
|
|
51
|
+
require_log.logHttpResponse(response);
|
|
52
|
+
throw new Error(`Could not create token for integration field catalog ${catalogId}`);
|
|
53
|
+
}
|
|
54
|
+
const token = tokenData[0];
|
|
55
|
+
this.tokens[catalogId] = token;
|
|
56
|
+
return token;
|
|
57
|
+
}
|
|
58
|
+
async addDataToCatalog({ catalogId, data }) {
|
|
59
|
+
const response = await (await this.getClient(catalogId)).post(`/write/${catalogId}`, JSON.stringify(data));
|
|
60
|
+
const { status } = response;
|
|
61
|
+
if (status !== 200) {
|
|
62
|
+
require_log.logHttpResponse(response);
|
|
63
|
+
throw new Error(`Could not add data to integration field catalog ${catalogId}`);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
async addToCustomType({ catalogId, customTypeId, fieldId }) {
|
|
67
|
+
const customType = await this.customTypesApiClient.getTypeById(customTypeId);
|
|
68
|
+
const field = customType.json.Main[fieldId];
|
|
69
|
+
if (!field || field.type !== "IntegrationFields") throw new Error(`Field ${fieldId} not found or is not an Integration Field`);
|
|
70
|
+
field.config = {
|
|
71
|
+
...field.config,
|
|
72
|
+
catalog: catalogId
|
|
73
|
+
};
|
|
74
|
+
await this.customTypesApiClient.createCustomTypes([customType]);
|
|
75
|
+
}
|
|
76
|
+
async setupIntegrationFields(integrationFields) {
|
|
77
|
+
for (const integrationField of integrationFields) {
|
|
78
|
+
const { name, description, customTypeId, fieldId, data } = integrationField;
|
|
79
|
+
const catalogId = await this.addCatalog({
|
|
80
|
+
name,
|
|
81
|
+
description
|
|
82
|
+
});
|
|
83
|
+
await this.addDataToCatalog({
|
|
84
|
+
catalogId,
|
|
85
|
+
data
|
|
86
|
+
});
|
|
87
|
+
await this.addToCustomType({
|
|
88
|
+
catalogId,
|
|
89
|
+
customTypeId,
|
|
90
|
+
fieldId
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
}
|
|
7
94
|
};
|
|
8
|
-
|
|
9
|
-
const axios = require("axios");
|
|
10
|
-
const log = require("../utils/log.cjs");
|
|
11
|
-
const strings = require("../utils/strings.cjs");
|
|
12
|
-
class IntegrationFieldsClient {
|
|
13
|
-
constructor(baseURL, config) {
|
|
14
|
-
__publicField(this, "baseURL");
|
|
15
|
-
__publicField(this, "customTypesApiClient");
|
|
16
|
-
__publicField(this, "wroomClient");
|
|
17
|
-
__publicField(this, "repository");
|
|
18
|
-
__publicField(this, "tokens", {});
|
|
19
|
-
this.baseURL = baseURL;
|
|
20
|
-
this.customTypesApiClient = config.customTypesApiClient;
|
|
21
|
-
this.wroomClient = config.wroomClient;
|
|
22
|
-
this.repository = config.repository;
|
|
23
|
-
}
|
|
24
|
-
async getClient(catalogId) {
|
|
25
|
-
const token = this.tokens[catalogId] || await this.createToken(catalogId);
|
|
26
|
-
const client = axios.create({
|
|
27
|
-
baseURL: `${this.baseURL}/if/`,
|
|
28
|
-
withCredentials: true,
|
|
29
|
-
validateStatus: () => true,
|
|
30
|
-
headers: {
|
|
31
|
-
"User-Agent": "prismic-cli/prismic-e2e-tests-utils",
|
|
32
|
-
Authorization: `Bearer ${token}`
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
return client;
|
|
36
|
-
}
|
|
37
|
-
async addCatalog({ name, description }) {
|
|
38
|
-
const response = await this.wroomClient.post(this.repository, "app/settings/integrationfields/pushcustom", {
|
|
39
|
-
"catalog-name": name,
|
|
40
|
-
"catalog-description": description
|
|
41
|
-
});
|
|
42
|
-
const { data, status } = response;
|
|
43
|
-
const success = status === 200 || status === 400 && data.includes("Already existing integration field");
|
|
44
|
-
if (!success) {
|
|
45
|
-
log.logHttpResponse(response);
|
|
46
|
-
throw new Error(`Could not add integration field catalog ${name}`);
|
|
47
|
-
}
|
|
48
|
-
return `${this.repository}--${strings.slugify(name)}`;
|
|
49
|
-
}
|
|
50
|
-
async createToken(catalogId) {
|
|
51
|
-
const response = await this.wroomClient.post(this.repository, `app/settings/integrationfields/pushcustom/${catalogId}/token`);
|
|
52
|
-
const { data: tokenData, status } = response;
|
|
53
|
-
if (status !== 201) {
|
|
54
|
-
log.logHttpResponse(response);
|
|
55
|
-
throw new Error(`Could not create token for integration field catalog ${catalogId}`);
|
|
56
|
-
}
|
|
57
|
-
const token = tokenData[0];
|
|
58
|
-
this.tokens[catalogId] = token;
|
|
59
|
-
return token;
|
|
60
|
-
}
|
|
61
|
-
async addDataToCatalog({ catalogId, data }) {
|
|
62
|
-
const client = await this.getClient(catalogId);
|
|
63
|
-
const response = await client.post(`/write/${catalogId}`, JSON.stringify(data));
|
|
64
|
-
const { status } = response;
|
|
65
|
-
if (status !== 200) {
|
|
66
|
-
log.logHttpResponse(response);
|
|
67
|
-
throw new Error(`Could not add data to integration field catalog ${catalogId}`);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
async addToCustomType({ catalogId, customTypeId, fieldId }) {
|
|
71
|
-
const customType = await this.customTypesApiClient.getTypeById(customTypeId);
|
|
72
|
-
const field = customType.json.Main[fieldId];
|
|
73
|
-
if (!field || field.type !== "IntegrationFields") {
|
|
74
|
-
throw new Error(`Field ${fieldId} not found or is not an Integration Field`);
|
|
75
|
-
}
|
|
76
|
-
field.config = { ...field.config ?? {}, catalog: catalogId };
|
|
77
|
-
await this.customTypesApiClient.createCustomTypes([customType]);
|
|
78
|
-
}
|
|
79
|
-
async setupIntegrationFields(integrationFields) {
|
|
80
|
-
for (const integrationField of integrationFields) {
|
|
81
|
-
const { name, description, customTypeId, fieldId, data } = integrationField;
|
|
82
|
-
const catalogId = await this.addCatalog({ name, description });
|
|
83
|
-
await this.addDataToCatalog({ catalogId, data });
|
|
84
|
-
await this.addToCustomType({ catalogId, customTypeId, fieldId });
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
95
|
+
//#endregion
|
|
88
96
|
exports.IntegrationFieldsClient = IntegrationFieldsClient;
|
|
89
|
-
|
|
97
|
+
|
|
98
|
+
//# sourceMappingURL=integrationFields.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integrationFields.cjs","sources":["
|
|
1
|
+
{"version":3,"file":"integrationFields.cjs","names":["slugify"],"sources":["../../src/clients/integrationFields.ts"],"sourcesContent":["import type { AxiosInstance } from \"axios\"\nimport axios from \"axios\"\n\nimport type { IntegrationFieldConfig, IntegrationFieldData } from \"../types\"\nimport { logHttpResponse } from \"../utils/log\"\nimport { slugify } from \"../utils/strings\"\nimport type { CustomTypesApiClient } from \"./customTypesApi\"\nimport type { WroomClient } from \"./wroom\"\n\n/**\n * Client for interacting with Integration Fields routes to create integration field catalogs and\n * add them to custom type fields.\n */\nexport class IntegrationFieldsClient {\n\tprivate readonly baseURL: string\n\tprivate readonly customTypesApiClient: CustomTypesApiClient\n\tprivate readonly wroomClient: WroomClient\n\tprivate readonly repository: string\n\tprivate readonly tokens: Record<string, string> = {}\n\n\tconstructor(\n\t\tbaseURL: string,\n\t\tconfig: {\n\t\t\tcustomTypesApiClient: CustomTypesApiClient\n\t\t\twroomClient: WroomClient\n\t\t\trepository: string\n\t\t},\n\t) {\n\t\tthis.baseURL = baseURL\n\t\tthis.customTypesApiClient = config.customTypesApiClient\n\t\tthis.wroomClient = config.wroomClient\n\t\tthis.repository = config.repository\n\t}\n\n\tprivate async getClient(catalogId: string): Promise<AxiosInstance> {\n\t\tconst token = this.tokens[catalogId] || (await this.createToken(catalogId))\n\n\t\tconst client = axios.create({\n\t\t\tbaseURL: `${this.baseURL}/if/`,\n\t\t\twithCredentials: true,\n\t\t\tvalidateStatus: () => true,\n\t\t\theaders: {\n\t\t\t\t\"User-Agent\": \"prismic-cli/prismic-e2e-tests-utils\",\n\t\t\t\tAuthorization: `Bearer ${token}`,\n\t\t\t},\n\t\t})\n\n\t\treturn client\n\t}\n\n\tprivate async addCatalog({\n\t\tname,\n\t\tdescription,\n\t}: {\n\t\tname: string\n\t\tdescription: string\n\t}): Promise<string> {\n\t\tconst response = await this.wroomClient.post(\n\t\t\tthis.repository,\n\t\t\t\"app/settings/integrationfields/pushcustom\",\n\t\t\t{\n\t\t\t\t\"catalog-name\": name,\n\t\t\t\t\"catalog-description\": description,\n\t\t\t},\n\t\t)\n\n\t\tconst { data, status } = response\n\t\tconst success =\n\t\t\tstatus === 200 ||\n\t\t\t(status === 400 && (data as string).includes(\"Already existing integration field\"))\n\t\tif (!success) {\n\t\t\tlogHttpResponse(response)\n\t\t\tthrow new Error(`Could not add integration field catalog ${name}`)\n\t\t}\n\n\t\treturn `${this.repository}--${slugify(name)}`\n\t}\n\n\tprivate async createToken(catalogId: string): Promise<string> {\n\t\tconst response = await this.wroomClient.post(\n\t\t\tthis.repository,\n\t\t\t`app/settings/integrationfields/pushcustom/${catalogId}/token`,\n\t\t)\n\n\t\tconst { data: tokenData, status } = response\n\t\tif (status !== 201) {\n\t\t\tlogHttpResponse(response)\n\t\t\tthrow new Error(`Could not create token for integration field catalog ${catalogId}`)\n\t\t}\n\n\t\tconst token = tokenData[0]\n\t\tthis.tokens[catalogId] = token\n\n\t\treturn token\n\t}\n\n\tprivate async addDataToCatalog({\n\t\tcatalogId,\n\t\tdata,\n\t}: {\n\t\tcatalogId: string\n\t\tdata: IntegrationFieldData[]\n\t}): Promise<void> {\n\t\tconst client = await this.getClient(catalogId)\n\t\tconst response = await client.post(`/write/${catalogId}`, JSON.stringify(data))\n\n\t\tconst { status } = response\n\t\tif (status !== 200) {\n\t\t\tlogHttpResponse(response)\n\t\t\tthrow new Error(`Could not add data to integration field catalog ${catalogId}`)\n\t\t}\n\t}\n\n\tprivate async addToCustomType({\n\t\tcatalogId,\n\t\tcustomTypeId,\n\t\tfieldId,\n\t}: {\n\t\tcatalogId: string\n\t\tcustomTypeId: string\n\t\tfieldId: string\n\t}): Promise<void> {\n\t\tconst customType = await this.customTypesApiClient.getTypeById(customTypeId)\n\n\t\tconst field = customType.json.Main[fieldId]\n\t\tif (!field || field.type !== \"IntegrationFields\") {\n\t\t\tthrow new Error(`Field ${fieldId} not found or is not an Integration Field`)\n\t\t}\n\n\t\tfield.config = { ...field.config, catalog: catalogId }\n\n\t\tawait this.customTypesApiClient.createCustomTypes([customType])\n\t}\n\n\tasync setupIntegrationFields(integrationFields: IntegrationFieldConfig[]): Promise<void> {\n\t\tfor (const integrationField of integrationFields) {\n\t\t\tconst { name, description, customTypeId, fieldId, data } = integrationField\n\n\t\t\tconst catalogId = await this.addCatalog({ name, description })\n\t\t\tawait this.addDataToCatalog({ catalogId, data })\n\t\t\tawait this.addToCustomType({ catalogId, customTypeId, fieldId })\n\t\t}\n\t}\n}\n"],"mappings":";;;;;;;;;;AAaA,IAAa,0BAAb,MAAqC;CACpC;CACA;CACA;CACA;CACA,SAAkD,CAAC;CAEnD,YACC,SACA,QAKC;EACD,KAAK,UAAU;EACf,KAAK,uBAAuB,OAAO;EACnC,KAAK,cAAc,OAAO;EAC1B,KAAK,aAAa,OAAO;CAC1B;CAEA,MAAc,UAAU,WAA2C;EAClE,MAAM,QAAQ,KAAK,OAAO,cAAe,MAAM,KAAK,YAAY,SAAS;EAYzE,OAVe,MAAA,QAAM,OAAO;GAC3B,SAAS,GAAG,KAAK,QAAQ;GACzB,iBAAiB;GACjB,sBAAsB;GACtB,SAAS;IACR,cAAc;IACd,eAAe,UAAU;GAC1B;EACD,CAEY;CACb;CAEA,MAAc,WAAW,EACxB,MACA,eAImB;EACnB,MAAM,WAAW,MAAM,KAAK,YAAY,KACvC,KAAK,YACL,6CACA;GACC,gBAAgB;GAChB,uBAAuB;EACxB,CACD;EAEA,MAAM,EAAE,MAAM,WAAW;EAIzB,IAAI,EAFH,WAAW,OACV,WAAW,OAAQ,KAAgB,SAAS,oCAAoC,IACpE;GACb,YAAA,gBAAgB,QAAQ;GACxB,MAAM,IAAI,MAAM,2CAA2C,MAAM;EAClE;EAEA,OAAO,GAAG,KAAK,WAAW,IAAIA,gBAAAA,QAAQ,IAAI;CAC3C;CAEA,MAAc,YAAY,WAAoC;EAC7D,MAAM,WAAW,MAAM,KAAK,YAAY,KACvC,KAAK,YACL,6CAA6C,UAAU,OACxD;EAEA,MAAM,EAAE,MAAM,WAAW,WAAW;EACpC,IAAI,WAAW,KAAK;GACnB,YAAA,gBAAgB,QAAQ;GACxB,MAAM,IAAI,MAAM,wDAAwD,WAAW;EACpF;EAEA,MAAM,QAAQ,UAAU;EACxB,KAAK,OAAO,aAAa;EAEzB,OAAO;CACR;CAEA,MAAc,iBAAiB,EAC9B,WACA,QAIiB;EAEjB,MAAM,WAAW,OAAM,MADF,KAAK,UAAU,SAAS,EAAA,CACf,KAAK,UAAU,aAAa,KAAK,UAAU,IAAI,CAAC;EAE9E,MAAM,EAAE,WAAW;EACnB,IAAI,WAAW,KAAK;GACnB,YAAA,gBAAgB,QAAQ;GACxB,MAAM,IAAI,MAAM,mDAAmD,WAAW;EAC/E;CACD;CAEA,MAAc,gBAAgB,EAC7B,WACA,cACA,WAKiB;EACjB,MAAM,aAAa,MAAM,KAAK,qBAAqB,YAAY,YAAY;EAE3E,MAAM,QAAQ,WAAW,KAAK,KAAK;EACnC,IAAI,CAAC,SAAS,MAAM,SAAS,qBAC5B,MAAM,IAAI,MAAM,SAAS,QAAQ,0CAA0C;EAG5E,MAAM,SAAS;GAAE,GAAG,MAAM;GAAQ,SAAS;EAAU;EAErD,MAAM,KAAK,qBAAqB,kBAAkB,CAAC,UAAU,CAAC;CAC/D;CAEA,MAAM,uBAAuB,mBAA4D;EACxF,KAAK,MAAM,oBAAoB,mBAAmB;GACjD,MAAM,EAAE,MAAM,aAAa,cAAc,SAAS,SAAS;GAE3D,MAAM,YAAY,MAAM,KAAK,WAAW;IAAE;IAAM;GAAY,CAAC;GAC7D,MAAM,KAAK,iBAAiB;IAAE;IAAW;GAAK,CAAC;GAC/C,MAAM,KAAK,gBAAgB;IAAE;IAAW;IAAc;GAAQ,CAAC;EAChE;CACD;AACD"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { IntegrationFieldConfig } from "../types.cjs";
|
|
2
|
+
import { CustomTypesApiClient } from "./customTypesApi.cjs";
|
|
3
|
+
import { WroomClient } from "./wroom.cjs";
|
|
4
|
+
|
|
5
|
+
//#region src/clients/integrationFields.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Client for interacting with Integration Fields routes to create integration field catalogs and
|
|
8
|
+
* add them to custom type fields.
|
|
9
|
+
*/
|
|
10
|
+
declare class IntegrationFieldsClient {
|
|
11
|
+
private readonly baseURL;
|
|
12
|
+
private readonly customTypesApiClient;
|
|
13
|
+
private readonly wroomClient;
|
|
14
|
+
private readonly repository;
|
|
15
|
+
private readonly tokens;
|
|
16
|
+
constructor(baseURL: string, config: {
|
|
17
|
+
customTypesApiClient: CustomTypesApiClient;
|
|
18
|
+
wroomClient: WroomClient;
|
|
19
|
+
repository: string;
|
|
20
|
+
});
|
|
21
|
+
private getClient;
|
|
22
|
+
private addCatalog;
|
|
23
|
+
private createToken;
|
|
24
|
+
private addDataToCatalog;
|
|
25
|
+
private addToCustomType;
|
|
26
|
+
setupIntegrationFields(integrationFields: IntegrationFieldConfig[]): Promise<void>;
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
export { IntegrationFieldsClient };
|
|
30
|
+
//# sourceMappingURL=integrationFields.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integrationFields.d.cts","names":[],"sources":["../../src/clients/integrationFields.ts"],"mappings":";;;;;;;AAaA;;cAAa,uBAAA;EAAA,iBACK,OAAA;EAAA,iBACA,oBAAA;EAAA,iBACA,WAAA;EAAA,iBACA,UAAA;EAAA,iBACA,MAAA;cAGhB,OAAA,UACA,MAAA;IACC,oBAAA,EAAsB,oBAAA;IACtB,WAAA,EAAa,WAAA;IACb,UAAA;EAAA;EAAA,QASY,SAAA;EAAA,QAgBA,UAAA;EAAA,QA4BA,WAAA;EAAA,QAkBA,gBAAA;EAAA,QAiBA,eAAA;EAqBR,sBAAA,CAAuB,iBAAA,EAAmB,sBAAA,KAA2B,OAAA;AAAA"}
|
|
@@ -1,25 +1,30 @@
|
|
|
1
|
-
import { IntegrationFieldConfig } from "../types";
|
|
2
|
-
import { CustomTypesApiClient } from "./customTypesApi";
|
|
3
|
-
import { WroomClient } from "./wroom";
|
|
1
|
+
import { IntegrationFieldConfig } from "../types.js";
|
|
2
|
+
import { CustomTypesApiClient } from "./customTypesApi.js";
|
|
3
|
+
import { WroomClient } from "./wroom.js";
|
|
4
|
+
|
|
5
|
+
//#region src/clients/integrationFields.d.ts
|
|
4
6
|
/**
|
|
5
|
-
* Client for interacting with Integration Fields routes to create integration
|
|
6
|
-
*
|
|
7
|
+
* Client for interacting with Integration Fields routes to create integration field catalogs and
|
|
8
|
+
* add them to custom type fields.
|
|
7
9
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
10
|
+
declare class IntegrationFieldsClient {
|
|
11
|
+
private readonly baseURL;
|
|
12
|
+
private readonly customTypesApiClient;
|
|
13
|
+
private readonly wroomClient;
|
|
14
|
+
private readonly repository;
|
|
15
|
+
private readonly tokens;
|
|
16
|
+
constructor(baseURL: string, config: {
|
|
17
|
+
customTypesApiClient: CustomTypesApiClient;
|
|
18
|
+
wroomClient: WroomClient;
|
|
19
|
+
repository: string;
|
|
20
|
+
});
|
|
21
|
+
private getClient;
|
|
22
|
+
private addCatalog;
|
|
23
|
+
private createToken;
|
|
24
|
+
private addDataToCatalog;
|
|
25
|
+
private addToCustomType;
|
|
26
|
+
setupIntegrationFields(integrationFields: IntegrationFieldConfig[]): Promise<void>;
|
|
25
27
|
}
|
|
28
|
+
//#endregion
|
|
29
|
+
export { IntegrationFieldsClient };
|
|
30
|
+
//# sourceMappingURL=integrationFields.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integrationFields.d.ts","names":[],"sources":["../../src/clients/integrationFields.ts"],"mappings":";;;;;;;AAaA;;cAAa,uBAAA;EAAA,iBACK,OAAA;EAAA,iBACA,oBAAA;EAAA,iBACA,WAAA;EAAA,iBACA,UAAA;EAAA,iBACA,MAAA;cAGhB,OAAA,UACA,MAAA;IACC,oBAAA,EAAsB,oBAAA;IACtB,WAAA,EAAa,WAAA;IACb,UAAA;EAAA;EAAA,QASY,SAAA;EAAA,QAgBA,UAAA;EAAA,QA4BA,WAAA;EAAA,QAkBA,gBAAA;EAAA,QAiBA,eAAA;EAqBR,sBAAA,CAAuB,iBAAA,EAAmB,sBAAA,KAA2B,OAAA;AAAA"}
|
|
@@ -1,89 +1,96 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
-
var __publicField = (obj, key, value) => {
|
|
4
|
-
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
|
-
return value;
|
|
6
|
-
};
|
|
7
|
-
import axios from "axios";
|
|
8
1
|
import { logHttpResponse } from "../utils/log.js";
|
|
9
2
|
import { slugify } from "../utils/strings.js";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
3
|
+
import axios from "axios";
|
|
4
|
+
//#region src/clients/integrationFields.ts
|
|
5
|
+
/**
|
|
6
|
+
* Client for interacting with Integration Fields routes to create integration field catalogs and
|
|
7
|
+
* add them to custom type fields.
|
|
8
|
+
*/
|
|
9
|
+
var IntegrationFieldsClient = class {
|
|
10
|
+
baseURL;
|
|
11
|
+
customTypesApiClient;
|
|
12
|
+
wroomClient;
|
|
13
|
+
repository;
|
|
14
|
+
tokens = {};
|
|
15
|
+
constructor(baseURL, config) {
|
|
16
|
+
this.baseURL = baseURL;
|
|
17
|
+
this.customTypesApiClient = config.customTypesApiClient;
|
|
18
|
+
this.wroomClient = config.wroomClient;
|
|
19
|
+
this.repository = config.repository;
|
|
20
|
+
}
|
|
21
|
+
async getClient(catalogId) {
|
|
22
|
+
const token = this.tokens[catalogId] || await this.createToken(catalogId);
|
|
23
|
+
return axios.create({
|
|
24
|
+
baseURL: `${this.baseURL}/if/`,
|
|
25
|
+
withCredentials: true,
|
|
26
|
+
validateStatus: () => true,
|
|
27
|
+
headers: {
|
|
28
|
+
"User-Agent": "prismic-cli/prismic-e2e-tests-utils",
|
|
29
|
+
Authorization: `Bearer ${token}`
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
async addCatalog({ name, description }) {
|
|
34
|
+
const response = await this.wroomClient.post(this.repository, "app/settings/integrationfields/pushcustom", {
|
|
35
|
+
"catalog-name": name,
|
|
36
|
+
"catalog-description": description
|
|
37
|
+
});
|
|
38
|
+
const { data, status } = response;
|
|
39
|
+
if (!(status === 200 || status === 400 && data.includes("Already existing integration field"))) {
|
|
40
|
+
logHttpResponse(response);
|
|
41
|
+
throw new Error(`Could not add integration field catalog ${name}`);
|
|
42
|
+
}
|
|
43
|
+
return `${this.repository}--${slugify(name)}`;
|
|
44
|
+
}
|
|
45
|
+
async createToken(catalogId) {
|
|
46
|
+
const response = await this.wroomClient.post(this.repository, `app/settings/integrationfields/pushcustom/${catalogId}/token`);
|
|
47
|
+
const { data: tokenData, status } = response;
|
|
48
|
+
if (status !== 201) {
|
|
49
|
+
logHttpResponse(response);
|
|
50
|
+
throw new Error(`Could not create token for integration field catalog ${catalogId}`);
|
|
51
|
+
}
|
|
52
|
+
const token = tokenData[0];
|
|
53
|
+
this.tokens[catalogId] = token;
|
|
54
|
+
return token;
|
|
55
|
+
}
|
|
56
|
+
async addDataToCatalog({ catalogId, data }) {
|
|
57
|
+
const response = await (await this.getClient(catalogId)).post(`/write/${catalogId}`, JSON.stringify(data));
|
|
58
|
+
const { status } = response;
|
|
59
|
+
if (status !== 200) {
|
|
60
|
+
logHttpResponse(response);
|
|
61
|
+
throw new Error(`Could not add data to integration field catalog ${catalogId}`);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
async addToCustomType({ catalogId, customTypeId, fieldId }) {
|
|
65
|
+
const customType = await this.customTypesApiClient.getTypeById(customTypeId);
|
|
66
|
+
const field = customType.json.Main[fieldId];
|
|
67
|
+
if (!field || field.type !== "IntegrationFields") throw new Error(`Field ${fieldId} not found or is not an Integration Field`);
|
|
68
|
+
field.config = {
|
|
69
|
+
...field.config,
|
|
70
|
+
catalog: catalogId
|
|
71
|
+
};
|
|
72
|
+
await this.customTypesApiClient.createCustomTypes([customType]);
|
|
73
|
+
}
|
|
74
|
+
async setupIntegrationFields(integrationFields) {
|
|
75
|
+
for (const integrationField of integrationFields) {
|
|
76
|
+
const { name, description, customTypeId, fieldId, data } = integrationField;
|
|
77
|
+
const catalogId = await this.addCatalog({
|
|
78
|
+
name,
|
|
79
|
+
description
|
|
80
|
+
});
|
|
81
|
+
await this.addDataToCatalog({
|
|
82
|
+
catalogId,
|
|
83
|
+
data
|
|
84
|
+
});
|
|
85
|
+
await this.addToCustomType({
|
|
86
|
+
catalogId,
|
|
87
|
+
customTypeId,
|
|
88
|
+
fieldId
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}
|
|
88
92
|
};
|
|
89
|
-
//#
|
|
93
|
+
//#endregion
|
|
94
|
+
export { IntegrationFieldsClient };
|
|
95
|
+
|
|
96
|
+
//# sourceMappingURL=integrationFields.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integrationFields.js","sources":["
|
|
1
|
+
{"version":3,"file":"integrationFields.js","names":[],"sources":["../../src/clients/integrationFields.ts"],"sourcesContent":["import type { AxiosInstance } from \"axios\"\nimport axios from \"axios\"\n\nimport type { IntegrationFieldConfig, IntegrationFieldData } from \"../types\"\nimport { logHttpResponse } from \"../utils/log\"\nimport { slugify } from \"../utils/strings\"\nimport type { CustomTypesApiClient } from \"./customTypesApi\"\nimport type { WroomClient } from \"./wroom\"\n\n/**\n * Client for interacting with Integration Fields routes to create integration field catalogs and\n * add them to custom type fields.\n */\nexport class IntegrationFieldsClient {\n\tprivate readonly baseURL: string\n\tprivate readonly customTypesApiClient: CustomTypesApiClient\n\tprivate readonly wroomClient: WroomClient\n\tprivate readonly repository: string\n\tprivate readonly tokens: Record<string, string> = {}\n\n\tconstructor(\n\t\tbaseURL: string,\n\t\tconfig: {\n\t\t\tcustomTypesApiClient: CustomTypesApiClient\n\t\t\twroomClient: WroomClient\n\t\t\trepository: string\n\t\t},\n\t) {\n\t\tthis.baseURL = baseURL\n\t\tthis.customTypesApiClient = config.customTypesApiClient\n\t\tthis.wroomClient = config.wroomClient\n\t\tthis.repository = config.repository\n\t}\n\n\tprivate async getClient(catalogId: string): Promise<AxiosInstance> {\n\t\tconst token = this.tokens[catalogId] || (await this.createToken(catalogId))\n\n\t\tconst client = axios.create({\n\t\t\tbaseURL: `${this.baseURL}/if/`,\n\t\t\twithCredentials: true,\n\t\t\tvalidateStatus: () => true,\n\t\t\theaders: {\n\t\t\t\t\"User-Agent\": \"prismic-cli/prismic-e2e-tests-utils\",\n\t\t\t\tAuthorization: `Bearer ${token}`,\n\t\t\t},\n\t\t})\n\n\t\treturn client\n\t}\n\n\tprivate async addCatalog({\n\t\tname,\n\t\tdescription,\n\t}: {\n\t\tname: string\n\t\tdescription: string\n\t}): Promise<string> {\n\t\tconst response = await this.wroomClient.post(\n\t\t\tthis.repository,\n\t\t\t\"app/settings/integrationfields/pushcustom\",\n\t\t\t{\n\t\t\t\t\"catalog-name\": name,\n\t\t\t\t\"catalog-description\": description,\n\t\t\t},\n\t\t)\n\n\t\tconst { data, status } = response\n\t\tconst success =\n\t\t\tstatus === 200 ||\n\t\t\t(status === 400 && (data as string).includes(\"Already existing integration field\"))\n\t\tif (!success) {\n\t\t\tlogHttpResponse(response)\n\t\t\tthrow new Error(`Could not add integration field catalog ${name}`)\n\t\t}\n\n\t\treturn `${this.repository}--${slugify(name)}`\n\t}\n\n\tprivate async createToken(catalogId: string): Promise<string> {\n\t\tconst response = await this.wroomClient.post(\n\t\t\tthis.repository,\n\t\t\t`app/settings/integrationfields/pushcustom/${catalogId}/token`,\n\t\t)\n\n\t\tconst { data: tokenData, status } = response\n\t\tif (status !== 201) {\n\t\t\tlogHttpResponse(response)\n\t\t\tthrow new Error(`Could not create token for integration field catalog ${catalogId}`)\n\t\t}\n\n\t\tconst token = tokenData[0]\n\t\tthis.tokens[catalogId] = token\n\n\t\treturn token\n\t}\n\n\tprivate async addDataToCatalog({\n\t\tcatalogId,\n\t\tdata,\n\t}: {\n\t\tcatalogId: string\n\t\tdata: IntegrationFieldData[]\n\t}): Promise<void> {\n\t\tconst client = await this.getClient(catalogId)\n\t\tconst response = await client.post(`/write/${catalogId}`, JSON.stringify(data))\n\n\t\tconst { status } = response\n\t\tif (status !== 200) {\n\t\t\tlogHttpResponse(response)\n\t\t\tthrow new Error(`Could not add data to integration field catalog ${catalogId}`)\n\t\t}\n\t}\n\n\tprivate async addToCustomType({\n\t\tcatalogId,\n\t\tcustomTypeId,\n\t\tfieldId,\n\t}: {\n\t\tcatalogId: string\n\t\tcustomTypeId: string\n\t\tfieldId: string\n\t}): Promise<void> {\n\t\tconst customType = await this.customTypesApiClient.getTypeById(customTypeId)\n\n\t\tconst field = customType.json.Main[fieldId]\n\t\tif (!field || field.type !== \"IntegrationFields\") {\n\t\t\tthrow new Error(`Field ${fieldId} not found or is not an Integration Field`)\n\t\t}\n\n\t\tfield.config = { ...field.config, catalog: catalogId }\n\n\t\tawait this.customTypesApiClient.createCustomTypes([customType])\n\t}\n\n\tasync setupIntegrationFields(integrationFields: IntegrationFieldConfig[]): Promise<void> {\n\t\tfor (const integrationField of integrationFields) {\n\t\t\tconst { name, description, customTypeId, fieldId, data } = integrationField\n\n\t\t\tconst catalogId = await this.addCatalog({ name, description })\n\t\t\tawait this.addDataToCatalog({ catalogId, data })\n\t\t\tawait this.addToCustomType({ catalogId, customTypeId, fieldId })\n\t\t}\n\t}\n}\n"],"mappings":";;;;;;;;AAaA,IAAa,0BAAb,MAAqC;CACpC;CACA;CACA;CACA;CACA,SAAkD,CAAC;CAEnD,YACC,SACA,QAKC;EACD,KAAK,UAAU;EACf,KAAK,uBAAuB,OAAO;EACnC,KAAK,cAAc,OAAO;EAC1B,KAAK,aAAa,OAAO;CAC1B;CAEA,MAAc,UAAU,WAA2C;EAClE,MAAM,QAAQ,KAAK,OAAO,cAAe,MAAM,KAAK,YAAY,SAAS;EAYzE,OAVe,MAAM,OAAO;GAC3B,SAAS,GAAG,KAAK,QAAQ;GACzB,iBAAiB;GACjB,sBAAsB;GACtB,SAAS;IACR,cAAc;IACd,eAAe,UAAU;GAC1B;EACD,CAEY;CACb;CAEA,MAAc,WAAW,EACxB,MACA,eAImB;EACnB,MAAM,WAAW,MAAM,KAAK,YAAY,KACvC,KAAK,YACL,6CACA;GACC,gBAAgB;GAChB,uBAAuB;EACxB,CACD;EAEA,MAAM,EAAE,MAAM,WAAW;EAIzB,IAAI,EAFH,WAAW,OACV,WAAW,OAAQ,KAAgB,SAAS,oCAAoC,IACpE;GACb,gBAAgB,QAAQ;GACxB,MAAM,IAAI,MAAM,2CAA2C,MAAM;EAClE;EAEA,OAAO,GAAG,KAAK,WAAW,IAAI,QAAQ,IAAI;CAC3C;CAEA,MAAc,YAAY,WAAoC;EAC7D,MAAM,WAAW,MAAM,KAAK,YAAY,KACvC,KAAK,YACL,6CAA6C,UAAU,OACxD;EAEA,MAAM,EAAE,MAAM,WAAW,WAAW;EACpC,IAAI,WAAW,KAAK;GACnB,gBAAgB,QAAQ;GACxB,MAAM,IAAI,MAAM,wDAAwD,WAAW;EACpF;EAEA,MAAM,QAAQ,UAAU;EACxB,KAAK,OAAO,aAAa;EAEzB,OAAO;CACR;CAEA,MAAc,iBAAiB,EAC9B,WACA,QAIiB;EAEjB,MAAM,WAAW,OAAM,MADF,KAAK,UAAU,SAAS,EAAA,CACf,KAAK,UAAU,aAAa,KAAK,UAAU,IAAI,CAAC;EAE9E,MAAM,EAAE,WAAW;EACnB,IAAI,WAAW,KAAK;GACnB,gBAAgB,QAAQ;GACxB,MAAM,IAAI,MAAM,mDAAmD,WAAW;EAC/E;CACD;CAEA,MAAc,gBAAgB,EAC7B,WACA,cACA,WAKiB;EACjB,MAAM,aAAa,MAAM,KAAK,qBAAqB,YAAY,YAAY;EAE3E,MAAM,QAAQ,WAAW,KAAK,KAAK;EACnC,IAAI,CAAC,SAAS,MAAM,SAAS,qBAC5B,MAAM,IAAI,MAAM,SAAS,QAAQ,0CAA0C;EAG5E,MAAM,SAAS;GAAE,GAAG,MAAM;GAAQ,SAAS;EAAU;EAErD,MAAM,KAAK,qBAAqB,kBAAkB,CAAC,UAAU,CAAC;CAC/D;CAEA,MAAM,uBAAuB,mBAA4D;EACxF,KAAK,MAAM,oBAAoB,mBAAmB;GACjD,MAAM,EAAE,MAAM,aAAa,cAAc,SAAS,SAAS;GAE3D,MAAM,YAAY,MAAM,KAAK,WAAW;IAAE;IAAM;GAAY,CAAC;GAC7D,MAAM,KAAK,iBAAiB;IAAE;IAAW;GAAK,CAAC;GAC/C,MAAM,KAAK,gBAAgB;IAAE;IAAW;IAAc;GAAQ,CAAC;EAChE;CACD;AACD"}
|