@prismicio/e2e-tests-utils 1.18.0 → 1.19.0-canary.d349d21
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 +154 -145
- package/dist/clients/coreApi.cjs.map +1 -1
- package/dist/clients/coreApi.d.cts +143 -0
- package/dist/clients/coreApi.d.cts.map +1 -0
- package/dist/clients/coreApi.d.ts +132 -109
- package/dist/clients/coreApi.d.ts.map +1 -0
- package/dist/clients/coreApi.js +153 -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 +595 -616
- package/dist/managers/repository.cjs.map +1 -1
- package/dist/managers/repository.d.cts +341 -0
- package/dist/managers/repository.d.cts.map +1 -0
- package/dist/managers/repository.d.ts +336 -307
- package/dist/managers/repository.d.ts.map +1 -0
- package/dist/managers/repository.js +595 -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 +111 -129
- package/src/clients/coreApi.ts +166 -117
- package/src/clients/customTypesApi.ts +54 -74
- 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 +410 -378
- 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,312 +1,341 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { IntegrationFieldsClient } from "../clients/integrationFields";
|
|
9
|
-
import { ManageV2Client } from "../clients/manageV2";
|
|
10
|
-
import { MigrationApiClient } from "../clients/migrationApi";
|
|
11
|
-
import {
|
|
1
|
+
import { IntegrationFieldConfig } from "../types.js";
|
|
2
|
+
import { AssetApiClient } from "../clients/assetApi.js";
|
|
3
|
+
import { AuthenticationApiClient } from "../clients/authenticationApi.js";
|
|
4
|
+
import { ContentApiClient } from "../clients/contentApi.js";
|
|
5
|
+
import { CoreApiClient, CoreApiDocumentCreationPayload, CoreApiDocumentCreationResponse, CoreApiDocumentData, CoreApiDocumentUpdatePayload, CoreApiDocumentsPayload, CoreApiDocumentsResponse, Release } from "../clients/coreApi.js";
|
|
6
|
+
import { CustomTypesApiClient } from "../clients/customTypesApi.js";
|
|
7
|
+
import { WroomClient } from "../clients/wroom.js";
|
|
8
|
+
import { IntegrationFieldsClient } from "../clients/integrationFields.js";
|
|
9
|
+
import { ManageV2Client } from "../clients/manageV2.js";
|
|
10
|
+
import { MigrationApiClient } from "../clients/migrationApi.js";
|
|
11
|
+
import { DynamicCustomTypeModel, SharedSliceModel } from "@prismicio/types-internal";
|
|
12
|
+
|
|
13
|
+
//#region src/managers/repository.d.ts
|
|
12
14
|
/** Utility to manage test data for a Prismic repository */
|
|
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
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
15
|
+
declare class RepositoryManager {
|
|
16
|
+
readonly name: string;
|
|
17
|
+
private readonly coreApiClient;
|
|
18
|
+
private readonly authApiClient;
|
|
19
|
+
private readonly wroomClient;
|
|
20
|
+
private readonly customTypesApiClient;
|
|
21
|
+
private readonly migrationApiClient;
|
|
22
|
+
private readonly assetApiClient;
|
|
23
|
+
private readonly manageV2Client;
|
|
24
|
+
private readonly integrationFieldsClient;
|
|
25
|
+
constructor(name: string, coreApiClient: CoreApiClient, authApiClient: AuthenticationApiClient, wroomClient: WroomClient, customTypesApiClient: CustomTypesApiClient, migrationApiClient: MigrationApiClient | undefined, assetApiClient: AssetApiClient, manageV2Client: ManageV2Client, integrationFieldsClient: IntegrationFieldsClient | undefined);
|
|
26
|
+
configure(config: RepositoryConfig): Promise<void>;
|
|
27
|
+
/** @returns The repository base url, like https://my-repo.prismic.io */
|
|
28
|
+
getBaseURL(): string;
|
|
29
|
+
/** @returns The repository base cdn url, like https://my-repo.cdn.prismic.io */
|
|
30
|
+
getBaseCdnURL(): string;
|
|
31
|
+
/**
|
|
32
|
+
* @returns A Content Type api client configured to target the repository CDN url. Uses Playwright
|
|
33
|
+
* for requests so if your project uses Playwright too, any network request will be present in
|
|
34
|
+
* Playwright test reports.
|
|
35
|
+
*/
|
|
36
|
+
getContentApiClient(config?: {
|
|
37
|
+
version?: "v1" | "v2";
|
|
38
|
+
accessToken?: string;
|
|
39
|
+
}): ContentApiClient;
|
|
40
|
+
/**
|
|
41
|
+
* @returns An instance of the Migration api client, see
|
|
42
|
+
* https://prismic.io/docs/migration-api-technical-reference
|
|
43
|
+
*/
|
|
44
|
+
getMigrationApiClient(): MigrationApiClient;
|
|
45
|
+
/**
|
|
46
|
+
* @returns An instance of the Asset api client, see
|
|
47
|
+
* https://prismic.io/docs/asset-api-technical-reference
|
|
48
|
+
*/
|
|
49
|
+
getAssetApiClient(): AssetApiClient;
|
|
50
|
+
/** @returns The Wroom commit hash deployed on the current repository */
|
|
51
|
+
getDeployedVersion(): Promise<string | undefined>;
|
|
52
|
+
/**
|
|
53
|
+
* Set additional standard locales for a repository in Wroom, does not fail if the locales already
|
|
54
|
+
* exist.
|
|
55
|
+
*
|
|
56
|
+
* @param locales - An array of all locales to be added to the repository.
|
|
57
|
+
* @throws Error if setting the locales fails.
|
|
58
|
+
*/
|
|
59
|
+
createLocales(locales: string[]): Promise<void>;
|
|
60
|
+
/**
|
|
61
|
+
* Set additional custom locale for a repository in Wroom, does not fail if the locales already
|
|
62
|
+
* exist.
|
|
63
|
+
*
|
|
64
|
+
* @param locale - The locale to be added to the repository.
|
|
65
|
+
* @throws Error if setting the locale fails.
|
|
66
|
+
*/
|
|
67
|
+
createCustomLocale(locale: CustomLocale): Promise<void>;
|
|
68
|
+
private failIfNot200;
|
|
69
|
+
/**
|
|
70
|
+
* Delete a locale from a repository.
|
|
71
|
+
*
|
|
72
|
+
* @param locale - Locale to remove from the repository configuration.
|
|
73
|
+
* @throws Error if deleting the locale fails.
|
|
74
|
+
*/
|
|
75
|
+
deleteLocale(locale: string): Promise<void>;
|
|
76
|
+
/**
|
|
77
|
+
* Create or update the default (master) locale for a repository in Wroom, the locale needs to
|
|
78
|
+
* exist in the repository.
|
|
79
|
+
*
|
|
80
|
+
* @param locale - The locale to be set as the default.
|
|
81
|
+
* @param endpoint - "createMasterLang" to create it, "defineAsMaster" to update it.
|
|
82
|
+
* @throws Error if setting the default locale fails.
|
|
83
|
+
*/
|
|
84
|
+
setDefaultLocale(locale: string, action: "create" | "update"): Promise<void>;
|
|
85
|
+
/**
|
|
86
|
+
* Retrieves documents.
|
|
87
|
+
*
|
|
88
|
+
* @param args - Configure which documents are retrieved.
|
|
89
|
+
* @returns A paginated set of documents.
|
|
90
|
+
*/
|
|
91
|
+
getDocuments(args: CoreApiDocumentsPayload): Promise<CoreApiDocumentsResponse>;
|
|
92
|
+
/**
|
|
93
|
+
* Creates a release.
|
|
94
|
+
*
|
|
95
|
+
* @param label - The label for the release.
|
|
96
|
+
* @returns A Promise that resolves when the release is created.
|
|
97
|
+
*/
|
|
98
|
+
createRelease(label: string): Promise<{
|
|
99
|
+
id: string;
|
|
100
|
+
}>;
|
|
101
|
+
/**
|
|
102
|
+
* Retrieves the migration release.
|
|
103
|
+
*
|
|
104
|
+
* @returns The migration relese metadata.
|
|
105
|
+
*/
|
|
106
|
+
getMigrationRelease(): Promise<Release>;
|
|
107
|
+
/**
|
|
108
|
+
* Publishes a release.
|
|
109
|
+
*
|
|
110
|
+
* @param id - The ID of the release.
|
|
111
|
+
* @returns A Promise that resolves when the release is published and a new master ref is
|
|
112
|
+
* available.
|
|
113
|
+
*/
|
|
114
|
+
publishRelease(id: string): Promise<void>;
|
|
115
|
+
/**
|
|
116
|
+
* Deletes a repository release.
|
|
117
|
+
*
|
|
118
|
+
* @param id - The ID of the release to be deleted.
|
|
119
|
+
*/
|
|
120
|
+
deleteRelease(id: string): Promise<void>;
|
|
121
|
+
/**
|
|
122
|
+
* Creates a preview for a repository.
|
|
123
|
+
*
|
|
124
|
+
* @param data - The data for creating the preview.
|
|
125
|
+
*/
|
|
126
|
+
createPreview(data: Preview): Promise<void>;
|
|
127
|
+
/**
|
|
128
|
+
* Set the simulator URL (table of slices) for a repository.
|
|
129
|
+
*
|
|
130
|
+
* @param data - The simulator URL to set.
|
|
131
|
+
*/
|
|
132
|
+
setSimulatorURL(simulatorURL: string): Promise<void>;
|
|
133
|
+
/**
|
|
134
|
+
* Deletes a preview from a repository.
|
|
135
|
+
*
|
|
136
|
+
* @param id - The ID of the preview to be deleted.
|
|
137
|
+
*/
|
|
138
|
+
deletePreview(id: string): Promise<void>;
|
|
139
|
+
/**
|
|
140
|
+
* Create a webhook.
|
|
141
|
+
*
|
|
142
|
+
* @returns A Promise that resolves with the webhook id.
|
|
143
|
+
*/
|
|
144
|
+
createWebhook(name: string, url: string, secret: string, triggers: {
|
|
145
|
+
documentsPublished?: boolean;
|
|
146
|
+
documentsUnpublished?: boolean;
|
|
147
|
+
releasesCreated?: boolean;
|
|
148
|
+
releasesUpdated?: boolean;
|
|
149
|
+
tagsCreated?: boolean;
|
|
150
|
+
tagsDeleted?: boolean;
|
|
151
|
+
}, active: boolean): Promise<string>;
|
|
152
|
+
/**
|
|
153
|
+
* Deletes a webhook.
|
|
154
|
+
*
|
|
155
|
+
* @param id - The webhook ID.
|
|
156
|
+
*/
|
|
157
|
+
deleteWebhook(id: string): Promise<void>;
|
|
158
|
+
/**
|
|
159
|
+
* Create Custom Types using the Custom types api.
|
|
160
|
+
*
|
|
161
|
+
* @param customTypes
|
|
162
|
+
*/
|
|
163
|
+
createCustomTypes(customTypes: DynamicCustomTypeModel[]): Promise<void>;
|
|
164
|
+
deleteCustomType(customTypeId: string): Promise<void>;
|
|
165
|
+
/**
|
|
166
|
+
* Create slices using the Custom types api.
|
|
167
|
+
*
|
|
168
|
+
* @param slices
|
|
169
|
+
*/
|
|
170
|
+
createSlices(slices: SharedSliceModel[]): Promise<void>;
|
|
171
|
+
/**
|
|
172
|
+
* Create an access token to query private items of the Content api.
|
|
173
|
+
*
|
|
174
|
+
* @param appName - Mandatory authorized application name
|
|
175
|
+
* @param tokenScope - Access token scope. Use "master" to when your content api is fully private
|
|
176
|
+
* or "master+releases" to access private releases
|
|
177
|
+
*/
|
|
178
|
+
createContentAPIToken(appName: string, tokenScope?: "master" | "master+releases"): Promise<string>;
|
|
179
|
+
/** Create a permanent access token to authenticate to Prismic public apis. */
|
|
180
|
+
createPermanentAccessToken(): Promise<string>;
|
|
181
|
+
/**
|
|
182
|
+
* Toggle the Role per Locale workflow
|
|
183
|
+
*
|
|
184
|
+
* @param enabled - The feature new status
|
|
185
|
+
*/
|
|
186
|
+
toggleRolePerLocal(enabled: boolean): Promise<void>;
|
|
187
|
+
/**
|
|
188
|
+
* Toggle the Custom Roles workflow
|
|
189
|
+
*
|
|
190
|
+
* @param enabled - The feature new status
|
|
191
|
+
*/
|
|
192
|
+
toggleCustomRoles(enabled: boolean): Promise<void>;
|
|
193
|
+
/**
|
|
194
|
+
* Toggle the Integration Fields feature
|
|
195
|
+
*
|
|
196
|
+
* @param enabled - The feature new status
|
|
197
|
+
*/
|
|
198
|
+
toggleIntegrationFields(enabled: boolean): Promise<void>;
|
|
199
|
+
/**
|
|
200
|
+
* Change the Repository Plan
|
|
201
|
+
*
|
|
202
|
+
* @param {string} newPlanId - The Id of the new Plan to apply
|
|
203
|
+
*/
|
|
204
|
+
changePlan(newPlanId: string): Promise<void>;
|
|
205
|
+
/**
|
|
206
|
+
* Add a new user to the repository
|
|
207
|
+
*
|
|
208
|
+
* @param {string} email - The email of the user
|
|
209
|
+
*/
|
|
210
|
+
addUser(email: string): Promise<void>;
|
|
211
|
+
/**
|
|
212
|
+
* Remove a user from the repository
|
|
213
|
+
*
|
|
214
|
+
* @param {string} email - The email of the user
|
|
215
|
+
*/
|
|
216
|
+
removeUser(email: string): Promise<void>;
|
|
217
|
+
/**
|
|
218
|
+
* Update the role of a user in a repository
|
|
219
|
+
*
|
|
220
|
+
* @param {string} email - The email of the user
|
|
221
|
+
* @param {string | Record<string, string>} role - The new Role of the user, either a string for
|
|
222
|
+
* basic workflow or an object such as `{ "lang_id": "Writer" }`
|
|
223
|
+
*
|
|
224
|
+
* Example of roles are
|
|
225
|
+
*
|
|
226
|
+
* - Administrator
|
|
227
|
+
* - Writer
|
|
228
|
+
* - Contributor
|
|
229
|
+
* - Manager (publisher)
|
|
230
|
+
*/
|
|
231
|
+
updateUserRole(email: string, role: string | Record<string, string>): Promise<void>;
|
|
232
|
+
/**
|
|
233
|
+
* Creates a document using the core api. If the Core api format is too specific, use the
|
|
234
|
+
* migration api client to create a document with the MigrationApiClient. See the
|
|
235
|
+
* `getMigrationApiClient()` method.
|
|
236
|
+
*
|
|
237
|
+
* @example
|
|
238
|
+
* To create a document by converting it from the Page Builder to
|
|
239
|
+
* Core api format
|
|
240
|
+
*
|
|
241
|
+
* ```js
|
|
242
|
+
* import { DocumentLegacy, UIDContentType } from '@prismicio/types-internal/lib/content';
|
|
243
|
+
*
|
|
244
|
+
* const document = {
|
|
245
|
+
* title: 'A new document',
|
|
246
|
+
* custom_type_id: 'home-page',
|
|
247
|
+
* locale: 'en-gb',
|
|
248
|
+
* integration_field_ids: [],
|
|
249
|
+
* tags: [],
|
|
250
|
+
* data: DocumentLegacy.encode({
|
|
251
|
+
* uid: {
|
|
252
|
+
* __TYPE__: UIDContentType,
|
|
253
|
+
* value: 'home-page',
|
|
254
|
+
* },
|
|
255
|
+
* })
|
|
256
|
+
* }
|
|
257
|
+
* await repository.createDocument(document, 'published');
|
|
258
|
+
* * ```
|
|
259
|
+
* ```
|
|
260
|
+
*
|
|
261
|
+
* @returns
|
|
262
|
+
*
|
|
263
|
+
* @param document - in the core api format.
|
|
264
|
+
*
|
|
265
|
+
* @param status - status of the document, if published, the function will
|
|
266
|
+
* wait for a new content api master ref to be created
|
|
267
|
+
*/
|
|
268
|
+
createDocument(document: CoreApiDocumentCreationPayload, status: "draft" | "published"): Promise<CoreApiDocumentCreationResponse>;
|
|
269
|
+
/**
|
|
270
|
+
* Updates an existing document using the core api by creating a new draft version on top of the
|
|
271
|
+
* given base version. If the status is published, the function will, unless disabled, wait for a
|
|
272
|
+
* new content api master ref to be created.
|
|
273
|
+
*
|
|
274
|
+
* @param documentId - The id of the document to update.
|
|
275
|
+
* @param data - The new version payload in the core api format.
|
|
276
|
+
* @param baseVersionId - The id of the version the draft is created from.
|
|
277
|
+
* @param status - Status of the new version, if published, the function will wait for a new
|
|
278
|
+
* content api master ref to be created.
|
|
279
|
+
* @param options - Additional options.
|
|
280
|
+
* @param options.skipMasterRefWait - When publishing, skip waiting for a new content api master
|
|
281
|
+
* ref to be available (default false). Set to true to return without waiting for the
|
|
282
|
+
* projection.
|
|
283
|
+
* @returns The updated document, including the new version's id. When publishing, the document is
|
|
284
|
+
* retrieved again after publication so that the returned versions reflect the published state.
|
|
285
|
+
*/
|
|
286
|
+
updateDocument(documentId: string, data: CoreApiDocumentUpdatePayload, baseVersionId: string, status: "draft" | "published", options?: {
|
|
287
|
+
skipMasterRefWait?: boolean;
|
|
288
|
+
}): Promise<CoreApiDocumentCreationResponse>;
|
|
289
|
+
/**
|
|
290
|
+
* Unpublishes (archives) a live document using the core api. Unless disabled, waits for a new
|
|
291
|
+
* content api master ref to be available.
|
|
292
|
+
*
|
|
293
|
+
* @param documentId - The id of the document to unpublish.
|
|
294
|
+
* @param options - Additional options.
|
|
295
|
+
* @param options.skipMasterRefWait - Skip waiting for a new content api master ref to be
|
|
296
|
+
* available (default false). Set to true to return without waiting for the projection.
|
|
297
|
+
*/
|
|
298
|
+
unpublishDocument(documentId: string, options?: {
|
|
299
|
+
skipMasterRefWait?: boolean;
|
|
300
|
+
}): Promise<void>;
|
|
301
|
+
/**
|
|
302
|
+
* Retrieves data for a specific document version.
|
|
303
|
+
*
|
|
304
|
+
* @param versionId - The document's version ID.
|
|
305
|
+
* @returns The document's version data.
|
|
306
|
+
*/
|
|
307
|
+
getDocumentData(versionId: string): Promise<CoreApiDocumentData>;
|
|
308
|
+
setupIntegrationFields(integrationFields: IntegrationFieldConfig[]): Promise<void>;
|
|
309
|
+
private waitForNewMasterRef;
|
|
284
310
|
}
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
311
|
+
type RepositoryConfig = {
|
|
312
|
+
customLocale?: CustomLocale;
|
|
313
|
+
locales?: string[];
|
|
314
|
+
defaultLocale?: string;
|
|
315
|
+
slices?: SharedSliceModel[];
|
|
316
|
+
customTypes?: DynamicCustomTypeModel[];
|
|
317
|
+
preview?: Preview;
|
|
318
|
+
simulatorURL?: string;
|
|
319
|
+
rolePerLocal?: boolean;
|
|
320
|
+
customRoles?: boolean;
|
|
321
|
+
integrationFields?: IntegrationFieldConfig[];
|
|
296
322
|
};
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
323
|
+
type Preview = {
|
|
324
|
+
name: string;
|
|
325
|
+
websiteURL: string;
|
|
326
|
+
resolverPath: string;
|
|
301
327
|
};
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
328
|
+
type CustomLocale = {
|
|
329
|
+
lang: {
|
|
330
|
+
label: string;
|
|
331
|
+
id: string;
|
|
332
|
+
useStandardAnalyzer?: boolean;
|
|
333
|
+
};
|
|
334
|
+
region: {
|
|
335
|
+
label: string;
|
|
336
|
+
id: string;
|
|
337
|
+
};
|
|
312
338
|
};
|
|
339
|
+
//#endregion
|
|
340
|
+
export { CustomLocale, Preview, RepositoryConfig, RepositoryManager };
|
|
341
|
+
//# sourceMappingURL=repository.d.ts.map
|