@prismicio/e2e-tests-utils 1.18.0 → 1.19.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/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 +66 -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 +65 -72
- 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 +54 -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
package/src/types.ts
CHANGED
|
@@ -1,51 +1,51 @@
|
|
|
1
1
|
export type UrlConfig = {
|
|
2
2
|
/** Prismic base url */
|
|
3
|
-
baseURL: string
|
|
3
|
+
baseURL: string
|
|
4
4
|
/** Custom types api base url */
|
|
5
|
-
customTypesApi: string
|
|
5
|
+
customTypesApi: string
|
|
6
6
|
/** Auth service api base url */
|
|
7
|
-
authenticationApi: string
|
|
7
|
+
authenticationApi: string
|
|
8
8
|
/** Prismic migration api base url */
|
|
9
|
-
migrationApi?: string
|
|
9
|
+
migrationApi?: string
|
|
10
10
|
/** Asset api base url */
|
|
11
|
-
assetApi: string
|
|
11
|
+
assetApi: string
|
|
12
12
|
/** Integration fields api base url */
|
|
13
|
-
integrationFieldApi?: string
|
|
14
|
-
}
|
|
13
|
+
integrationFieldApi?: string
|
|
14
|
+
}
|
|
15
15
|
|
|
16
16
|
export type AuthConfig = {
|
|
17
|
-
email: string
|
|
18
|
-
password: string
|
|
19
|
-
}
|
|
17
|
+
email: string
|
|
18
|
+
password: string
|
|
19
|
+
}
|
|
20
20
|
|
|
21
21
|
export type ManageV2Config = {
|
|
22
|
-
secret: string
|
|
23
|
-
audience: string
|
|
24
|
-
}
|
|
22
|
+
secret: string
|
|
23
|
+
audience: string
|
|
24
|
+
}
|
|
25
25
|
|
|
26
26
|
// Global configuration Object
|
|
27
27
|
export type SetupConfiguration = {
|
|
28
28
|
// If provided as a string: It is treated as the base URL for Prismic. Other
|
|
29
29
|
// URLs (Custom Types API, Auth API) will be derived from it.
|
|
30
|
-
urlConfig: UrlConfig | string
|
|
31
|
-
authConfig: AuthConfig
|
|
32
|
-
manageV2Config?: ManageV2Config
|
|
33
|
-
cluster?: string
|
|
34
|
-
environment?: string
|
|
35
|
-
integrationFieldsConfig?: IntegrationFieldConfig[]
|
|
36
|
-
}
|
|
30
|
+
urlConfig: UrlConfig | string
|
|
31
|
+
authConfig: AuthConfig
|
|
32
|
+
manageV2Config?: ManageV2Config
|
|
33
|
+
cluster?: string
|
|
34
|
+
environment?: string
|
|
35
|
+
integrationFieldsConfig?: IntegrationFieldConfig[]
|
|
36
|
+
}
|
|
37
37
|
|
|
38
38
|
export type IntegrationFieldData = {
|
|
39
|
-
id: string
|
|
40
|
-
title: string
|
|
41
|
-
description: string
|
|
42
|
-
blob: Record<string, unknown
|
|
43
|
-
}
|
|
39
|
+
id: string
|
|
40
|
+
title: string
|
|
41
|
+
description: string
|
|
42
|
+
blob: Record<string, unknown>
|
|
43
|
+
}
|
|
44
44
|
|
|
45
45
|
export type IntegrationFieldConfig = {
|
|
46
|
-
name: string
|
|
47
|
-
description: string
|
|
48
|
-
customTypeId: string
|
|
49
|
-
fieldId: string
|
|
50
|
-
data: IntegrationFieldData[]
|
|
51
|
-
}
|
|
46
|
+
name: string
|
|
47
|
+
description: string
|
|
48
|
+
customTypeId: string
|
|
49
|
+
fieldId: string
|
|
50
|
+
data: IntegrationFieldData[]
|
|
51
|
+
}
|
package/src/utils/cookies.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AxiosHeaderValue } from "axios"
|
|
1
|
+
import type { AxiosHeaderValue } from "axios"
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Extract the value of a specific cookie from Axios cookies.
|
|
@@ -10,21 +10,21 @@ export const extractCookie = (
|
|
|
10
10
|
cookies: AxiosHeaderValue | undefined,
|
|
11
11
|
cookieName: string,
|
|
12
12
|
): string | undefined => {
|
|
13
|
-
const regex = new RegExp(`${cookieName}=([^;]+)`, "i")
|
|
13
|
+
const regex = new RegExp(`${cookieName}=([^;]+)`, "i") // 'i' flag for case-insensitivity
|
|
14
14
|
|
|
15
15
|
if (typeof cookies === "string") {
|
|
16
|
-
const match = cookies.match(regex)
|
|
16
|
+
const match = cookies.match(regex)
|
|
17
17
|
|
|
18
|
-
return match ? match[1] : undefined
|
|
18
|
+
return match ? match[1] : undefined
|
|
19
19
|
}
|
|
20
20
|
if (Array.isArray(cookies)) {
|
|
21
21
|
for (const cookie of cookies) {
|
|
22
|
-
const match = cookie.match(regex)
|
|
22
|
+
const match = cookie.match(regex)
|
|
23
23
|
if (match) {
|
|
24
|
-
return match[1]
|
|
24
|
+
return match[1]
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
return undefined
|
|
30
|
-
}
|
|
29
|
+
return undefined
|
|
30
|
+
}
|
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Manage a list of strings within an environment variable. This is useful to
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* Manage a list of strings within an environment variable. This is useful to share data across
|
|
3
|
+
* different test phases (setup, teardown, test execution) as most test frameworks run these in
|
|
4
|
+
* independent states
|
|
5
5
|
*/
|
|
6
6
|
export class EnvVariableManager {
|
|
7
7
|
constructor(private variableName: string) {}
|
|
8
8
|
|
|
9
|
-
/**
|
|
9
|
+
/** Add a string and persist it in the environment variable */
|
|
10
10
|
add(value: string): void {
|
|
11
|
-
const existingValues = this.getAll()
|
|
12
|
-
existingValues.push(value)
|
|
11
|
+
const existingValues = this.getAll()
|
|
12
|
+
existingValues.push(value)
|
|
13
13
|
|
|
14
|
-
this.setAll(existingValues)
|
|
14
|
+
this.setAll(existingValues)
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
/**
|
|
17
|
+
/** Remove a string from the environment variable */
|
|
18
18
|
remove(value: string): void {
|
|
19
|
-
const existingValues = this.getAll()
|
|
20
|
-
const updatedValues = existingValues.filter((item) => item !== value)
|
|
19
|
+
const existingValues = this.getAll()
|
|
20
|
+
const updatedValues = existingValues.filter((item) => item !== value)
|
|
21
21
|
|
|
22
|
-
this.setAll(updatedValues)
|
|
22
|
+
this.setAll(updatedValues)
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
/**
|
|
25
|
+
/** Return all items stored in the environment variable */
|
|
26
26
|
getAll(): string[] {
|
|
27
|
-
const value = process.env[this.variableName] || "[]"
|
|
27
|
+
const value = process.env[this.variableName] || "[]"
|
|
28
28
|
|
|
29
|
-
return JSON.parse(value)
|
|
29
|
+
return JSON.parse(value)
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
private setAll(values: string[]): void {
|
|
33
|
-
process.env[this.variableName] = JSON.stringify(values)
|
|
33
|
+
process.env[this.variableName] = JSON.stringify(values)
|
|
34
34
|
}
|
|
35
35
|
}
|
package/src/utils/log.ts
CHANGED
|
@@ -1,43 +1,39 @@
|
|
|
1
|
-
import { APIResponse } from "@playwright/test"
|
|
2
|
-
import { AxiosResponse } from "axios"
|
|
3
|
-
import { createLogger, format, transports } from "winston"
|
|
1
|
+
import type { APIResponse } from "@playwright/test"
|
|
2
|
+
import type { AxiosResponse } from "axios"
|
|
3
|
+
import { createLogger, format, transports } from "winston"
|
|
4
4
|
|
|
5
5
|
export const logHttpResponse = (response: AxiosResponse): void => {
|
|
6
|
-
const { status, data } = response
|
|
7
|
-
const { baseURL = "", url = "" } = response.config
|
|
6
|
+
const { status, data } = response
|
|
7
|
+
const { baseURL = "", url = "" } = response.config
|
|
8
8
|
// make sure the url always shows baseURL + path.
|
|
9
9
|
// Depending on how the AxiosInstance was called, the url already contains the baseURL
|
|
10
|
-
const fullUrl = url.startsWith("http") ? url : `${baseURL}/${url}
|
|
10
|
+
const fullUrl = url.startsWith("http") ? url : `${baseURL}/${url}`
|
|
11
11
|
|
|
12
|
-
logger.info(
|
|
13
|
-
|
|
14
|
-
);
|
|
15
|
-
};
|
|
12
|
+
logger.info(`Call to ${fullUrl} failed, received [${status}] ${JSON.stringify(data)}`)
|
|
13
|
+
}
|
|
16
14
|
|
|
17
|
-
export const logPlaywrightApiResponse = async (
|
|
18
|
-
response: APIResponse,
|
|
19
|
-
): Promise<void> => {
|
|
15
|
+
export const logPlaywrightApiResponse = async (response: APIResponse): Promise<void> => {
|
|
20
16
|
logger.info(
|
|
21
17
|
`Call to ${response.url()} failed, received [${response.status()}] ${JSON.stringify(
|
|
22
18
|
await response.text(),
|
|
23
19
|
)}`,
|
|
24
|
-
)
|
|
25
|
-
}
|
|
20
|
+
)
|
|
21
|
+
}
|
|
26
22
|
|
|
27
|
-
const { combine, printf } = format
|
|
23
|
+
const { combine, printf } = format
|
|
28
24
|
|
|
29
25
|
const customFormat = printf(({ message, durationMs }) => {
|
|
30
|
-
const baseMsg = `[test data] ${message}
|
|
26
|
+
const baseMsg = `[test data] ${message}`
|
|
31
27
|
if (durationMs) {
|
|
32
|
-
return `${baseMsg} in ${durationMs}ms
|
|
28
|
+
return `${baseMsg} in ${durationMs}ms`
|
|
33
29
|
}
|
|
34
30
|
|
|
35
|
-
return baseMsg
|
|
36
|
-
})
|
|
31
|
+
return baseMsg
|
|
32
|
+
})
|
|
37
33
|
|
|
38
34
|
export const logger = createLogger({
|
|
39
35
|
silent: process.env["prismic_e2e_tests_utils_silent"] === "true",
|
|
40
36
|
level: process.env["prismic_e2e_tests_utils_log_level"] || "info",
|
|
41
37
|
format: combine(customFormat),
|
|
42
38
|
transports: [new transports.Console()],
|
|
43
|
-
})
|
|
39
|
+
})
|
package/src/utils/random.ts
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { createHash } from "crypto"
|
|
1
|
+
import { createHash } from "crypto"
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Generate a random string
|
|
5
5
|
*
|
|
6
|
-
* @param length -
|
|
7
|
-
*
|
|
6
|
+
* @param length - Max 32
|
|
8
7
|
* @returns
|
|
9
8
|
*/
|
|
10
9
|
export const randomString = (length = 16): string => {
|
|
11
|
-
const uniqueInput = Math.random().toString()
|
|
10
|
+
const uniqueInput = Math.random().toString()
|
|
12
11
|
|
|
13
|
-
return createHash("md5").update(uniqueInput).digest("hex").slice(0, length)
|
|
14
|
-
}
|
|
12
|
+
return createHash("md5").update(uniqueInput).digest("hex").slice(0, length)
|
|
13
|
+
}
|
package/src/utils/strings.ts
CHANGED
|
@@ -2,16 +2,14 @@
|
|
|
2
2
|
* Convert string to a slug suitable for Integration Fields.
|
|
3
3
|
*
|
|
4
4
|
* @param str - The input string to slugify.
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* Inspired by the Wroom slugify function:
|
|
5
|
+
* @returns The slugified string (empty string if no valid characters remain). Inspired by the Wroom
|
|
6
|
+
* slugify function:
|
|
9
7
|
* https://github.com/prismicio/wroom/blob/09452b75fa5fabdaf3cd81383741cd02d30c9c9f/subprojects/common/app/utils/String.scala#L55
|
|
10
8
|
*/
|
|
11
9
|
export const slugify = (str: string): string => {
|
|
12
|
-
const noWhitespace = str.trim().replace(/ /g, "_")
|
|
13
|
-
const normalized = noWhitespace.normalize("NFD").replace(/\p{M}+/gu, "")
|
|
14
|
-
const slug = normalized.replace(/[^A-Za-z0-9_-]/g, "").toLowerCase()
|
|
10
|
+
const noWhitespace = str.trim().replace(/ /g, "_")
|
|
11
|
+
const normalized = noWhitespace.normalize("NFD").replace(/\p{M}+/gu, "")
|
|
12
|
+
const slug = normalized.replace(/[^A-Za-z0-9_-]/g, "").toLowerCase()
|
|
15
13
|
|
|
16
|
-
return slug || ""
|
|
17
|
-
}
|
|
14
|
+
return slug || ""
|
|
15
|
+
}
|
package/src/utils/urls.ts
CHANGED
|
@@ -1,28 +1,26 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Build a repository base url from the prismic base url
|
|
3
3
|
*
|
|
4
|
-
* @param baseUrl -
|
|
5
|
-
* @param repository -
|
|
6
|
-
*
|
|
7
|
-
* @returns the repository url like https://my-repo.prismic.io
|
|
4
|
+
* @param baseUrl - Prismic base url like prismic.io
|
|
5
|
+
* @param repository - The repository name
|
|
6
|
+
* @returns The repository url like https://my-repo.prismic.io
|
|
8
7
|
*/
|
|
9
8
|
export function getRepositoryUrl(baseUrl: string, repository: string): string {
|
|
10
|
-
const url = new URL(baseUrl)
|
|
11
|
-
url.hostname = `${repository}.${url.hostname}
|
|
9
|
+
const url = new URL(baseUrl)
|
|
10
|
+
url.hostname = `${repository}.${url.hostname}`
|
|
12
11
|
|
|
13
|
-
return url.toString()
|
|
12
|
+
return url.toString()
|
|
14
13
|
}
|
|
15
14
|
|
|
16
15
|
/**
|
|
17
|
-
* Prevent issues when building urls using `URL` that contain sub path without
|
|
18
|
-
* trailing slashes.
|
|
16
|
+
* Prevent issues when building urls using `URL` that contain sub path without trailing slashes.
|
|
19
17
|
*
|
|
20
|
-
* @returns
|
|
18
|
+
* @returns The original url with a trailing slash, if needed.
|
|
21
19
|
*/
|
|
22
20
|
export function appendTrailingSlash(url: string): string {
|
|
23
21
|
if (!url.endsWith("/")) {
|
|
24
|
-
return url + "/"
|
|
22
|
+
return url + "/"
|
|
25
23
|
}
|
|
26
24
|
|
|
27
|
-
return url
|
|
25
|
+
return url
|
|
28
26
|
}
|
package/dist/index.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;"}
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
|
package/dist/utils/cookies.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { AxiosHeaderValue } from "axios";
|
|
2
|
-
/**
|
|
3
|
-
* Extract the value of a specific cookie from Axios cookies.
|
|
4
|
-
*
|
|
5
|
-
* @param cookies - Axios cookies, can be a string or an array
|
|
6
|
-
* @param cookieName - The name of the cookie to extract.
|
|
7
|
-
*/
|
|
8
|
-
export declare const extractCookie: (cookies: AxiosHeaderValue | undefined, cookieName: string) => string | undefined;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Manage a list of strings within an environment variable. This is useful to
|
|
3
|
-
* share data across different test phases (setup, teardown, test execution) as
|
|
4
|
-
* most test frameworks run these in independent states
|
|
5
|
-
*/
|
|
6
|
-
export declare class EnvVariableManager {
|
|
7
|
-
private variableName;
|
|
8
|
-
constructor(variableName: string);
|
|
9
|
-
/** add a string and persist it in the environment variable */
|
|
10
|
-
add(value: string): void;
|
|
11
|
-
/** remove a string from the environment variable */
|
|
12
|
-
remove(value: string): void;
|
|
13
|
-
/** return all items stored in the environment variable */
|
|
14
|
-
getAll(): string[];
|
|
15
|
-
private setAll;
|
|
16
|
-
}
|
package/dist/utils/log.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { APIResponse } from "@playwright/test";
|
|
2
|
-
import { AxiosResponse } from "axios";
|
|
3
|
-
export declare const logHttpResponse: (response: AxiosResponse) => void;
|
|
4
|
-
export declare const logPlaywrightApiResponse: (response: APIResponse) => Promise<void>;
|
|
5
|
-
export declare const logger: import("winston").Logger;
|
package/dist/utils/random.d.ts
DELETED
package/dist/utils/strings.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Convert string to a slug suitable for Integration Fields.
|
|
3
|
-
*
|
|
4
|
-
* @param str - The input string to slugify.
|
|
5
|
-
*
|
|
6
|
-
* @returns The slugified string (empty string if no valid characters remain).
|
|
7
|
-
*
|
|
8
|
-
* Inspired by the Wroom slugify function:
|
|
9
|
-
* https://github.com/prismicio/wroom/blob/09452b75fa5fabdaf3cd81383741cd02d30c9c9f/subprojects/common/app/utils/String.scala#L55
|
|
10
|
-
*/
|
|
11
|
-
export declare const slugify: (str: string) => string;
|
package/dist/utils/urls.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Build a repository base url from the prismic base url
|
|
3
|
-
*
|
|
4
|
-
* @param baseUrl - prismic base url like prismic.io
|
|
5
|
-
* @param repository - the repository name
|
|
6
|
-
*
|
|
7
|
-
* @returns the repository url like https://my-repo.prismic.io
|
|
8
|
-
*/
|
|
9
|
-
export declare function getRepositoryUrl(baseUrl: string, repository: string): string;
|
|
10
|
-
/**
|
|
11
|
-
* Prevent issues when building urls using `URL` that contain sub path without
|
|
12
|
-
* trailing slashes.
|
|
13
|
-
*
|
|
14
|
-
* @returns the original url with a trailing slash, if needed.
|
|
15
|
-
*/
|
|
16
|
-
export declare function appendTrailingSlash(url: string): string;
|