@prismicio/editor-fields 0.4.36 → 0.4.37

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.
@@ -35,6 +35,8 @@ type SearchDocuments = {
35
35
  status: "published" | "release" | "archived" | "unclassified";
36
36
  localeId?: string;
37
37
  customTypeId?: string;
38
+ documentListOpenSearchEnabled: boolean;
39
+ documentSearchBaseUrl: URL;
38
40
  };
39
41
  type IntegrationFields = {
40
42
  integrationFields?: never;
@@ -53,6 +53,7 @@ export declare const mediaAssetType: z.ZodObject<{
53
53
  }>, "many">;
54
54
  }, "strip", z.ZodTypeAny, {
55
55
  id: string;
56
+ url: string;
56
57
  tags: {
57
58
  id: string;
58
59
  name: string;
@@ -64,7 +65,6 @@ export declare const mediaAssetType: z.ZodObject<{
64
65
  last_modified: number;
65
66
  kind: string;
66
67
  filename: string;
67
- url: string;
68
68
  size: number;
69
69
  extension?: string | undefined;
70
70
  width?: number | undefined;
@@ -80,6 +80,7 @@ export declare const mediaAssetType: z.ZodObject<{
80
80
  } | undefined;
81
81
  }, {
82
82
  id: string;
83
+ url: string;
83
84
  tags: {
84
85
  id: string;
85
86
  name: string;
@@ -91,7 +92,6 @@ export declare const mediaAssetType: z.ZodObject<{
91
92
  last_modified: number;
92
93
  kind: string;
93
94
  filename: string;
94
- url: string;
95
95
  size: number;
96
96
  extension?: string | undefined;
97
97
  width?: number | undefined;
@@ -165,6 +165,7 @@ export declare const mediaSearchResponse: z.ZodObject<{
165
165
  }>, "many">;
166
166
  }, "strip", z.ZodTypeAny, {
167
167
  id: string;
168
+ url: string;
168
169
  tags: {
169
170
  id: string;
170
171
  name: string;
@@ -176,7 +177,6 @@ export declare const mediaSearchResponse: z.ZodObject<{
176
177
  last_modified: number;
177
178
  kind: string;
178
179
  filename: string;
179
- url: string;
180
180
  size: number;
181
181
  extension?: string | undefined;
182
182
  width?: number | undefined;
@@ -192,6 +192,7 @@ export declare const mediaSearchResponse: z.ZodObject<{
192
192
  } | undefined;
193
193
  }, {
194
194
  id: string;
195
+ url: string;
195
196
  tags: {
196
197
  id: string;
197
198
  name: string;
@@ -203,7 +204,6 @@ export declare const mediaSearchResponse: z.ZodObject<{
203
204
  last_modified: number;
204
205
  kind: string;
205
206
  filename: string;
206
- url: string;
207
207
  size: number;
208
208
  extension?: string | undefined;
209
209
  width?: number | undefined;
@@ -222,6 +222,7 @@ export declare const mediaSearchResponse: z.ZodObject<{
222
222
  total: number;
223
223
  items: {
224
224
  id: string;
225
+ url: string;
225
226
  tags: {
226
227
  id: string;
227
228
  name: string;
@@ -233,7 +234,6 @@ export declare const mediaSearchResponse: z.ZodObject<{
233
234
  last_modified: number;
234
235
  kind: string;
235
236
  filename: string;
236
- url: string;
237
237
  size: number;
238
238
  extension?: string | undefined;
239
239
  width?: number | undefined;
@@ -253,6 +253,7 @@ export declare const mediaSearchResponse: z.ZodObject<{
253
253
  total: number;
254
254
  items: {
255
255
  id: string;
256
+ url: string;
256
257
  tags: {
257
258
  id: string;
258
259
  name: string;
@@ -264,7 +265,6 @@ export declare const mediaSearchResponse: z.ZodObject<{
264
265
  last_modified: number;
265
266
  kind: string;
266
267
  filename: string;
267
- url: string;
268
268
  size: number;
269
269
  extension?: string | undefined;
270
270
  width?: number | undefined;
@@ -305,6 +305,7 @@ export declare function searchMedia(baseUrl: URL | undefined, repository: string
305
305
  total: number;
306
306
  items: {
307
307
  id: string;
308
+ url: string;
308
309
  tags: {
309
310
  id: string;
310
311
  name: string;
@@ -316,7 +317,6 @@ export declare function searchMedia(baseUrl: URL | undefined, repository: string
316
317
  last_modified: number;
317
318
  kind: string;
318
319
  filename: string;
319
- url: string;
320
320
  size: number;
321
321
  extension?: string | undefined;
322
322
  width?: number | undefined;
@@ -344,6 +344,7 @@ export declare function useMediaSearch(args: UseMediaLibrarySearchArgs): {
344
344
  setTagIds: (newTagIds: string[]) => void;
345
345
  media: {
346
346
  id: string;
347
+ url: string;
347
348
  tags: {
348
349
  id: string;
349
350
  name: string;
@@ -355,7 +356,6 @@ export declare function useMediaSearch(args: UseMediaLibrarySearchArgs): {
355
356
  last_modified: number;
356
357
  kind: string;
357
358
  filename: string;
358
- url: string;
359
359
  size: number;
360
360
  extension?: string | undefined;
361
361
  width?: number | undefined;
@@ -393,6 +393,7 @@ declare function deleteSearchData(args: DeleteSearchDataArgs): void;
393
393
  type MediaPage = Awaited<ReturnType<typeof searchMedia>>;
394
394
  export declare function getMedia(allPages: MediaPage[], assetType: MediaAssetType, keyword: string, tags: string): {
395
395
  id: string;
396
+ url: string;
396
397
  tags: {
397
398
  id: string;
398
399
  name: string;
@@ -404,7 +405,6 @@ export declare function getMedia(allPages: MediaPage[], assetType: MediaAssetTyp
404
405
  last_modified: number;
405
406
  kind: string;
406
407
  filename: string;
407
- url: string;
408
408
  size: number;
409
409
  extension?: string | undefined;
410
410
  width?: number | undefined;
@@ -1,5 +1,6 @@
1
1
  export declare function useSelectedMedia(): {
2
2
  id: string;
3
+ url: string;
3
4
  tags: {
4
5
  id: string;
5
6
  name: string;
@@ -11,7 +12,6 @@ export declare function useSelectedMedia(): {
11
12
  last_modified: number;
12
13
  kind: string;
13
14
  filename: string;
14
- url: string;
15
15
  size: number;
16
16
  extension?: string | undefined;
17
17
  width?: number | undefined;
@@ -17,9 +17,9 @@ declare const unsplashImage: import("zod").ZodObject<{
17
17
  description: import("zod").ZodNullable<import("zod").ZodString>;
18
18
  }, "strip", import("zod").ZodTypeAny, {
19
19
  id: string;
20
+ description: string | null;
20
21
  width: number;
21
22
  height: number;
22
- description: string | null;
23
23
  urls: {
24
24
  small: string;
25
25
  full: string;
@@ -27,9 +27,9 @@ declare const unsplashImage: import("zod").ZodObject<{
27
27
  alt_description?: string | undefined;
28
28
  }, {
29
29
  id: string;
30
+ description: string | null;
30
31
  width: number;
31
32
  height: number;
32
- description: string | null;
33
33
  urls: {
34
34
  small: string;
35
35
  full: string;
@@ -55,9 +55,9 @@ export declare const unsplashSearchApiType: import("zod").ZodEffects<import("zod
55
55
  description: import("zod").ZodNullable<import("zod").ZodString>;
56
56
  }, "strip", import("zod").ZodTypeAny, {
57
57
  id: string;
58
+ description: string | null;
58
59
  width: number;
59
60
  height: number;
60
- description: string | null;
61
61
  urls: {
62
62
  small: string;
63
63
  full: string;
@@ -65,9 +65,9 @@ export declare const unsplashSearchApiType: import("zod").ZodEffects<import("zod
65
65
  alt_description?: string | undefined;
66
66
  }, {
67
67
  id: string;
68
+ description: string | null;
68
69
  width: number;
69
70
  height: number;
70
- description: string | null;
71
71
  urls: {
72
72
  small: string;
73
73
  full: string;
@@ -77,9 +77,9 @@ export declare const unsplashSearchApiType: import("zod").ZodEffects<import("zod
77
77
  }, "strip", import("zod").ZodTypeAny, {
78
78
  results: {
79
79
  id: string;
80
+ description: string | null;
80
81
  width: number;
81
82
  height: number;
82
- description: string | null;
83
83
  urls: {
84
84
  small: string;
85
85
  full: string;
@@ -89,9 +89,9 @@ export declare const unsplashSearchApiType: import("zod").ZodEffects<import("zod
89
89
  }, {
90
90
  results: {
91
91
  id: string;
92
+ description: string | null;
92
93
  width: number;
93
94
  height: number;
94
- description: string | null;
95
95
  urls: {
96
96
  small: string;
97
97
  full: string;
@@ -100,9 +100,9 @@ export declare const unsplashSearchApiType: import("zod").ZodEffects<import("zod
100
100
  }[];
101
101
  }>, {
102
102
  id: string;
103
+ description: string | null;
103
104
  width: number;
104
105
  height: number;
105
- description: string | null;
106
106
  urls: {
107
107
  small: string;
108
108
  full: string;
@@ -111,9 +111,9 @@ export declare const unsplashSearchApiType: import("zod").ZodEffects<import("zod
111
111
  }[], {
112
112
  results: {
113
113
  id: string;
114
+ description: string | null;
114
115
  width: number;
115
116
  height: number;
116
- description: string | null;
117
117
  urls: {
118
118
  small: string;
119
119
  full: string;
@@ -125,9 +125,9 @@ export type UnplashSearchApi = TypeOf<typeof unsplashSearchApiType>;
125
125
  export type UnsplashImage = TypeOf<typeof unsplashImage>;
126
126
  export declare function useUnsplashSearch(baseUrl: URL, term: string): {
127
127
  id: string;
128
+ description: string | null;
128
129
  width: number;
129
130
  height: number;
130
- description: string | null;
131
131
  urls: {
132
132
  small: string;
133
133
  full: string;
@@ -1,5 +1,6 @@
1
1
  import { z } from "zod";
2
2
  import type { AuthStrategy } from "../../EditorConfig";
3
+ import { searchDocumentStatus } from "../document";
3
4
  export declare const languageOkType: z.ZodObject<{
4
5
  id: z.ZodString;
5
6
  name: z.ZodString;
@@ -486,13 +487,72 @@ declare const documentsSearchAPISchemaOkType: z.ZodObject<{
486
487
  }[];
487
488
  cursor?: string | undefined;
488
489
  }>;
490
+ export declare const documentOkType: z.ZodObject<{
491
+ id: z.ZodString;
492
+ title: z.ZodString;
493
+ repository_id: z.ZodString;
494
+ tags: z.ZodOptional<z.ZodPipeline<z.ZodEffects<z.ZodString, string[], string>, z.ZodArray<z.ZodString, "many">>>;
495
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
496
+ id: z.ZodString;
497
+ title: z.ZodString;
498
+ repository_id: z.ZodString;
499
+ tags: z.ZodOptional<z.ZodPipeline<z.ZodEffects<z.ZodString, string[], string>, z.ZodArray<z.ZodString, "many">>>;
500
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
501
+ id: z.ZodString;
502
+ title: z.ZodString;
503
+ repository_id: z.ZodString;
504
+ tags: z.ZodOptional<z.ZodPipeline<z.ZodEffects<z.ZodString, string[], string>, z.ZodArray<z.ZodString, "many">>>;
505
+ }, z.ZodTypeAny, "passthrough">>;
506
+ declare const documentsFullTextSearchAPISchemaOkType: z.ZodObject<{
507
+ results: z.ZodArray<z.ZodObject<{
508
+ id: z.ZodString;
509
+ title: z.ZodString;
510
+ repository_id: z.ZodString;
511
+ tags: z.ZodOptional<z.ZodPipeline<z.ZodEffects<z.ZodString, string[], string>, z.ZodArray<z.ZodString, "many">>>;
512
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
513
+ id: z.ZodString;
514
+ title: z.ZodString;
515
+ repository_id: z.ZodString;
516
+ tags: z.ZodOptional<z.ZodPipeline<z.ZodEffects<z.ZodString, string[], string>, z.ZodArray<z.ZodString, "many">>>;
517
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
518
+ id: z.ZodString;
519
+ title: z.ZodString;
520
+ repository_id: z.ZodString;
521
+ tags: z.ZodOptional<z.ZodPipeline<z.ZodEffects<z.ZodString, string[], string>, z.ZodArray<z.ZodString, "many">>>;
522
+ }, z.ZodTypeAny, "passthrough">>, "many">;
523
+ }, "strip", z.ZodTypeAny, {
524
+ results: z.objectOutputType<{
525
+ id: z.ZodString;
526
+ title: z.ZodString;
527
+ repository_id: z.ZodString;
528
+ tags: z.ZodOptional<z.ZodPipeline<z.ZodEffects<z.ZodString, string[], string>, z.ZodArray<z.ZodString, "many">>>;
529
+ }, z.ZodTypeAny, "passthrough">[];
530
+ }, {
531
+ results: z.objectInputType<{
532
+ id: z.ZodString;
533
+ title: z.ZodString;
534
+ repository_id: z.ZodString;
535
+ tags: z.ZodOptional<z.ZodPipeline<z.ZodEffects<z.ZodString, string[], string>, z.ZodArray<z.ZodString, "many">>>;
536
+ }, z.ZodTypeAny, "passthrough">[];
537
+ }>;
489
538
  export type Language = z.TypeOf<typeof languageOkType>;
490
539
  export type DocumentSearchApi = z.TypeOf<typeof documentsSearchAPISchemaOkType>;
540
+ export type DocumentFullTextSearchApi = z.TypeOf<typeof documentsFullTextSearchAPISchemaOkType>;
491
541
  export type DocumentMeta = z.TypeOf<typeof documentMetaOkType>;
492
542
  export type DocumentVersion = z.TypeOf<typeof documentVersionOkType>;
493
543
  export type DocumentStatus = DocumentVersion["status"];
494
- export declare function searchDocuments(baseUrl: URL, authStrategy: AuthStrategy, searchTerm: string, limit?: number, cursor?: string): Promise<DocumentSearchApi>;
495
- export type SearchDocumentNames = "tags" | "language" | "customTypes" | "status" | "term" | "group_lang_id" | "document_id" | "uid" | "authors";
544
+ export declare function getDocuments(baseUrl: URL, authStrategy: AuthStrategy, queryString: string, limit?: number, cursor?: string): Promise<DocumentSearchApi>;
545
+ export declare function searchFullTextDocuments(baseUrl: URL, authStrategy: AuthStrategy, queryString: string): Promise<DocumentFullTextSearchApi>;
546
+ export declare function makeSearchFullTextDocumentsQueryString(args: {
547
+ searchTerm?: string;
548
+ tags?: string[];
549
+ localeId?: string;
550
+ customTypesIds?: string[];
551
+ }): string;
552
+ type GetDocumentsQueryFilters = "tags" | "language" | "customTypes" | "status" | "term" | "group_lang_id" | "document_id" | "uid" | "authors";
553
+ export type SearchDocumentParams = {
554
+ [S in GetDocumentsQueryFilters]?: string[];
555
+ };
496
556
  export declare function createSearchParams<T extends string>(params: {
497
557
  name: T;
498
558
  values: string[];
@@ -536,6 +596,7 @@ export declare function getDocumentsByReleaseId(baseUrl: URL, authStrategy: Auth
536
596
  }[];
537
597
  cursor?: string | undefined;
538
598
  }>;
599
+ export declare function getDocumentsByIdAndStatus(baseUrl: URL, authStrategy: AuthStrategy, ids: string[], status: keyof typeof searchDocumentStatus): Promise<DocumentSearchApi>;
539
600
  export declare const documentSchema: z.ZodEffects<z.ZodType<unknown, z.ZodTypeDef, unknown>, {
540
601
  [x: string]: import("@prismicio/types-internal/lib/content").GroupContent | {
541
602
  type: string;
@@ -2441,4 +2502,5 @@ export declare const documentSchema: z.ZodEffects<z.ZodType<unknown, z.ZodTypeDe
2441
2502
  }[];
2442
2503
  };
2443
2504
  }, unknown>;
2505
+ export declare function makeGetDocumentsQueryString(searchDocumentParams: SearchDocumentParams): string;
2444
2506
  export {};
@@ -39,8 +39,6 @@ export declare function useDocuments(params: {
39
39
  uid?: string | undefined;
40
40
  })[];
41
41
  }[];
42
- hasNextPage: boolean;
43
- fetchNextPage: () => void;
44
42
  response: {
45
43
  total: number;
46
44
  results: {