@caiquecamargo/vite-plugin-netlify-cms 0.0.18 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +51 -1
- package/dist/chunk-JOUSWMWF.js +13 -0
- package/dist/chunk-JOUSWMWF.js.map +1 -0
- package/dist/index.d.ts +462 -41
- package/dist/index.js +204 -11
- package/dist/index.js.map +1 -1
- package/dist/src/oauth/astro-callback.d.ts +4 -0
- package/dist/src/oauth/astro-callback.js +67 -0
- package/dist/src/oauth/astro-callback.js.map +1 -0
- package/dist/src/oauth/astro-login.d.ts +4 -0
- package/dist/src/oauth/astro-login.js +14 -0
- package/dist/src/oauth/astro-login.js.map +1 -0
- package/package.json +8 -8
package/dist/index.d.ts
CHANGED
|
@@ -1,23 +1,57 @@
|
|
|
1
1
|
import { Plugin } from 'vite';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
interface OAuthPluginOptions {
|
|
4
|
+
/**
|
|
5
|
+
* OAuth login route
|
|
6
|
+
* @default '/oauth'
|
|
7
|
+
*/
|
|
8
|
+
loginRoute?: string;
|
|
9
|
+
/**
|
|
10
|
+
* OAuth callback route
|
|
11
|
+
* @default '/oauth/callback'
|
|
12
|
+
*/
|
|
13
|
+
callbackRoute?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Disable OAuth plugin
|
|
16
|
+
* @default false
|
|
17
|
+
*/
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Vite plugin for OAuth authentication routes
|
|
22
|
+
* Adds /oauth and /oauth/callback routes for GitHub authentication
|
|
23
|
+
*/
|
|
24
|
+
declare function oauthPlugin(options?: OAuthPluginOptions): Plugin;
|
|
25
|
+
|
|
26
|
+
type Widgets = 'boolean' | 'code' | 'color' | 'compute' | 'datetime' | 'hidden' | 'file' | 'image' | 'keyvalue' | 'list' | 'map' | 'markdown' | 'number' | 'object' | 'relation' | 'richtext' | 'select' | 'string' | 'text' | 'uuid';
|
|
27
|
+
type LocaleCode = string;
|
|
4
28
|
interface Widget {
|
|
5
29
|
name: string;
|
|
6
30
|
label?: string;
|
|
7
31
|
widget: Widgets;
|
|
8
|
-
required?: boolean;
|
|
9
|
-
pattern?: string
|
|
32
|
+
required?: boolean | LocaleCode[];
|
|
33
|
+
pattern?: [string, string];
|
|
10
34
|
comment?: string;
|
|
35
|
+
hint?: string;
|
|
36
|
+
preview?: boolean;
|
|
37
|
+
i18n?: boolean | 'duplicate' | 'translate' | 'none';
|
|
38
|
+
readonly?: boolean;
|
|
11
39
|
}
|
|
12
40
|
interface BooleanWidget extends Widget {
|
|
13
41
|
widget: 'boolean';
|
|
14
42
|
default?: boolean;
|
|
43
|
+
before_input?: string;
|
|
44
|
+
after_input?: string;
|
|
15
45
|
}
|
|
16
46
|
interface CodeWidget extends Widget {
|
|
17
47
|
widget: 'code';
|
|
48
|
+
default?: string | Record<string, string>;
|
|
18
49
|
default_language?: string;
|
|
19
50
|
allow_language_selection?: boolean;
|
|
20
|
-
keys?:
|
|
51
|
+
keys?: {
|
|
52
|
+
code: string;
|
|
53
|
+
lang: string;
|
|
54
|
+
};
|
|
21
55
|
output_code_only?: boolean;
|
|
22
56
|
}
|
|
23
57
|
interface ColorWidget extends Widget {
|
|
@@ -26,6 +60,10 @@ interface ColorWidget extends Widget {
|
|
|
26
60
|
allowInput?: boolean;
|
|
27
61
|
enableAlpha?: boolean;
|
|
28
62
|
}
|
|
63
|
+
interface ComputeWidget extends Widget {
|
|
64
|
+
widget: 'compute';
|
|
65
|
+
value: string;
|
|
66
|
+
}
|
|
29
67
|
interface DateTimeWidget extends Widget {
|
|
30
68
|
widget: 'datetime';
|
|
31
69
|
default?: string;
|
|
@@ -40,36 +78,61 @@ interface HiddenWidget extends Widget {
|
|
|
40
78
|
}
|
|
41
79
|
interface FileWidget extends Widget {
|
|
42
80
|
widget: 'file';
|
|
43
|
-
default?: string;
|
|
81
|
+
default?: string | string[];
|
|
44
82
|
media_library?: Record<string, unknown>;
|
|
45
83
|
allow_multiple?: boolean;
|
|
84
|
+
multiple?: boolean;
|
|
85
|
+
min?: number;
|
|
86
|
+
max?: number;
|
|
46
87
|
config?: Record<string, unknown>;
|
|
47
88
|
media_folder?: string;
|
|
89
|
+
public_folder?: string;
|
|
48
90
|
choose_url?: boolean;
|
|
91
|
+
accept?: string;
|
|
92
|
+
media_libraries?: Record<string, unknown>;
|
|
49
93
|
}
|
|
50
94
|
interface ImageWidget extends Widget {
|
|
51
95
|
widget: 'image';
|
|
52
|
-
default?: string;
|
|
96
|
+
default?: string | string[];
|
|
53
97
|
media_library?: Record<string, unknown>;
|
|
54
98
|
allow_multiple?: boolean;
|
|
99
|
+
multiple?: boolean;
|
|
100
|
+
min?: number;
|
|
101
|
+
max?: number;
|
|
55
102
|
config?: Record<string, unknown>;
|
|
56
103
|
media_folder?: string;
|
|
104
|
+
public_folder?: string;
|
|
57
105
|
choose_url?: boolean;
|
|
106
|
+
accept?: string;
|
|
107
|
+
media_libraries?: Record<string, unknown>;
|
|
108
|
+
}
|
|
109
|
+
interface KeyValueWidget extends Widget {
|
|
110
|
+
widget: 'keyvalue';
|
|
111
|
+
default?: Record<string, string>;
|
|
112
|
+
key_label?: string;
|
|
113
|
+
value_label?: string;
|
|
114
|
+
min?: number;
|
|
115
|
+
max?: number;
|
|
58
116
|
}
|
|
59
117
|
interface ListWidget extends Widget {
|
|
60
118
|
widget: 'list';
|
|
61
|
-
default?: string[] | CollectionField[]
|
|
119
|
+
default?: string[] | CollectionField[] | Record<string, unknown>;
|
|
62
120
|
allow_add?: boolean;
|
|
63
|
-
|
|
121
|
+
allow_remove?: boolean;
|
|
122
|
+
allow_reorder?: boolean;
|
|
123
|
+
collapsed?: boolean | 'auto';
|
|
124
|
+
minimize_collapsed?: boolean | 'auto';
|
|
64
125
|
summary?: string;
|
|
65
|
-
minimize_collapsed?: boolean;
|
|
66
126
|
label_singular?: string;
|
|
67
127
|
field?: CollectionField;
|
|
68
128
|
fields?: CollectionField[];
|
|
69
129
|
types?: ObjectWidget[];
|
|
130
|
+
typeKey?: string;
|
|
70
131
|
max?: number;
|
|
71
132
|
min?: number;
|
|
72
133
|
add_to_top?: boolean;
|
|
134
|
+
root?: boolean;
|
|
135
|
+
thumbnail?: string;
|
|
73
136
|
}
|
|
74
137
|
interface MapWidget extends Widget {
|
|
75
138
|
widget: 'map';
|
|
@@ -80,63 +143,108 @@ interface MapWidget extends Widget {
|
|
|
80
143
|
interface NumberWidget extends Widget {
|
|
81
144
|
widget: 'number';
|
|
82
145
|
default?: string | number;
|
|
83
|
-
value_type?: 'int' | 'float';
|
|
146
|
+
value_type?: 'int' | 'float' | 'int/string' | 'float/string';
|
|
84
147
|
min?: number;
|
|
85
148
|
max?: number;
|
|
86
149
|
step?: number;
|
|
150
|
+
before_input?: string;
|
|
151
|
+
after_input?: string;
|
|
87
152
|
}
|
|
88
153
|
interface ObjectWidget extends Widget {
|
|
89
154
|
widget: 'object';
|
|
90
|
-
default?: CollectionField[]
|
|
91
|
-
collapsed?: boolean;
|
|
155
|
+
default?: CollectionField[] | Record<string, unknown>;
|
|
156
|
+
collapsed?: boolean | 'auto';
|
|
92
157
|
summary?: string;
|
|
93
|
-
fields
|
|
158
|
+
fields?: CollectionField[];
|
|
159
|
+
types?: VariableFieldType[];
|
|
160
|
+
typeKey?: string;
|
|
161
|
+
}
|
|
162
|
+
interface VariableFieldType {
|
|
163
|
+
name: string;
|
|
164
|
+
label?: string;
|
|
165
|
+
widget?: 'object';
|
|
166
|
+
summary?: string;
|
|
167
|
+
fields?: CollectionField[];
|
|
94
168
|
}
|
|
95
169
|
interface RelationWidget extends Widget {
|
|
96
170
|
widget: 'relation';
|
|
97
|
-
default?: any;
|
|
171
|
+
default?: any | any[];
|
|
98
172
|
collection: string;
|
|
99
|
-
value_field
|
|
100
|
-
search_fields
|
|
173
|
+
value_field?: string;
|
|
174
|
+
search_fields?: string[];
|
|
101
175
|
file?: string;
|
|
102
176
|
display_fields?: string[];
|
|
103
177
|
multiple?: boolean;
|
|
104
178
|
min?: number;
|
|
105
179
|
max?: number;
|
|
106
180
|
options_length?: number;
|
|
181
|
+
dropdown_threshold?: number;
|
|
182
|
+
filters?: Array<{
|
|
183
|
+
field: string;
|
|
184
|
+
values: any[];
|
|
185
|
+
}>;
|
|
107
186
|
}
|
|
108
187
|
interface SelectWidget extends Widget {
|
|
109
188
|
widget: 'select';
|
|
110
|
-
default?: string | {
|
|
189
|
+
default?: string | number | null | {
|
|
111
190
|
label: string;
|
|
112
|
-
value: string;
|
|
113
|
-
}
|
|
114
|
-
options
|
|
191
|
+
value: string | number | null;
|
|
192
|
+
} | Array<string | number | null>;
|
|
193
|
+
options: Array<string | number | null | {
|
|
115
194
|
label: string;
|
|
116
|
-
value: string;
|
|
117
|
-
}
|
|
195
|
+
value: string | number | null;
|
|
196
|
+
}>;
|
|
118
197
|
multiple?: boolean;
|
|
119
198
|
min?: number;
|
|
120
199
|
max?: number;
|
|
200
|
+
dropdown_threshold?: number;
|
|
121
201
|
}
|
|
122
202
|
interface StringWidget extends Widget {
|
|
123
203
|
widget: 'string';
|
|
124
204
|
default?: string;
|
|
205
|
+
type?: 'text' | 'url' | 'email';
|
|
206
|
+
minlength?: number;
|
|
207
|
+
maxlength?: number;
|
|
208
|
+
prefix?: string;
|
|
209
|
+
suffix?: string;
|
|
210
|
+
before_input?: string;
|
|
211
|
+
after_input?: string;
|
|
125
212
|
}
|
|
126
213
|
interface TextWidget extends Widget {
|
|
127
214
|
widget: 'text';
|
|
128
215
|
default?: string;
|
|
216
|
+
minlength?: number;
|
|
217
|
+
maxlength?: number;
|
|
129
218
|
}
|
|
130
|
-
type MarkdownButtons = 'bold' | 'italic' | 'code' | 'link' | 'heading-one' | 'heading-two' | 'heading-three' | 'heading-four' | 'heading-five' | 'heading-six' | 'quote' | 'bulleted-list' | 'numbered-list';
|
|
219
|
+
type MarkdownButtons = 'bold' | 'italic' | 'code' | 'link' | 'heading-one' | 'heading-two' | 'heading-three' | 'heading-four' | 'heading-five' | 'heading-six' | 'quote' | 'bulleted-list' | 'numbered-list' | 'strikethrough';
|
|
220
|
+
type EditorComponent = 'code-block' | 'image' | string;
|
|
221
|
+
type EditorMode = 'rich_text' | 'raw';
|
|
131
222
|
interface MarkdownWidget extends Widget {
|
|
132
223
|
widget: 'markdown';
|
|
133
224
|
default?: string;
|
|
134
225
|
buttons?: MarkdownButtons[];
|
|
135
|
-
editor_components?:
|
|
136
|
-
modes?:
|
|
226
|
+
editor_components?: EditorComponent[];
|
|
227
|
+
modes?: EditorMode[];
|
|
137
228
|
sanitize_preview?: boolean;
|
|
229
|
+
minimal?: boolean;
|
|
230
|
+
linked_images?: boolean;
|
|
138
231
|
}
|
|
139
|
-
|
|
232
|
+
interface RichTextWidget extends Widget {
|
|
233
|
+
widget: 'richtext';
|
|
234
|
+
default?: string;
|
|
235
|
+
buttons?: MarkdownButtons[];
|
|
236
|
+
editor_components?: EditorComponent[];
|
|
237
|
+
modes?: EditorMode[];
|
|
238
|
+
sanitize_preview?: boolean;
|
|
239
|
+
minimal?: boolean;
|
|
240
|
+
linked_images?: boolean;
|
|
241
|
+
}
|
|
242
|
+
interface UuidWidget extends Widget {
|
|
243
|
+
widget: 'uuid';
|
|
244
|
+
default?: string;
|
|
245
|
+
prefix?: string;
|
|
246
|
+
}
|
|
247
|
+
type CollectionField = BooleanWidget | CodeWidget | ColorWidget | ComputeWidget | DateTimeWidget | HiddenWidget | FileWidget | ImageWidget | KeyValueWidget | ListWidget | MapWidget | NumberWidget | ObjectWidget | RelationWidget | SelectWidget | StringWidget | TextWidget | MarkdownWidget | RichTextWidget | UuidWidget;
|
|
140
248
|
interface Collection {
|
|
141
249
|
/**
|
|
142
250
|
* unique identifier for the collection, used as the key
|
|
@@ -163,6 +271,10 @@ interface Collection {
|
|
|
163
271
|
* optional text, displayed below the label when viewing a collection
|
|
164
272
|
*/
|
|
165
273
|
description?: string;
|
|
274
|
+
/**
|
|
275
|
+
* Material Symbols icon name
|
|
276
|
+
*/
|
|
277
|
+
icon?: string;
|
|
166
278
|
/**
|
|
167
279
|
* for publish_mode: editorial_workflow only;
|
|
168
280
|
* false hides UI publishing controls for a collection;
|
|
@@ -186,17 +298,21 @@ interface Collection {
|
|
|
186
298
|
/**
|
|
187
299
|
* These settings determine how collection files are parsed and saved.
|
|
188
300
|
*/
|
|
189
|
-
extension?: 'yml' | 'yaml' | 'toml' | 'json' | 'md' | 'markdown' | 'html';
|
|
301
|
+
extension?: 'yml' | 'yaml' | 'toml' | 'json' | 'md' | 'markdown' | 'html' | string;
|
|
190
302
|
/**
|
|
191
303
|
* These settings determine how collection files are parsed and saved.
|
|
192
304
|
*/
|
|
193
|
-
format?: 'yml' | 'yaml' | 'toml' | 'json' | 'frontmatter' | 'yaml-frontmatter' | 'toml-frontmatter' | 'json-frontmatter';
|
|
194
|
-
frontmatter_delimiter?: string;
|
|
305
|
+
format?: 'yml' | 'yaml' | 'toml' | 'json' | 'frontmatter' | 'yaml-frontmatter' | 'toml-frontmatter' | 'json-frontmatter' | 'raw' | string;
|
|
306
|
+
frontmatter_delimiter?: string | string[];
|
|
195
307
|
/**
|
|
196
308
|
* specifies a template for generating new filenames
|
|
197
309
|
* based on a file's creation date and title field
|
|
198
310
|
*/
|
|
199
311
|
slug?: string;
|
|
312
|
+
/**
|
|
313
|
+
* The maximum number of characters allowed for an entry slug
|
|
314
|
+
*/
|
|
315
|
+
slug_length?: number;
|
|
200
316
|
/**
|
|
201
317
|
* A string representing the path where content in this collection can be found on the live site.
|
|
202
318
|
*/
|
|
@@ -219,20 +335,97 @@ interface Collection {
|
|
|
219
335
|
/**
|
|
220
336
|
* An optional list of sort fields to show in the UI.
|
|
221
337
|
*/
|
|
222
|
-
sortable_fields?: string
|
|
338
|
+
sortable_fields?: string[] | {
|
|
339
|
+
fields: string[];
|
|
340
|
+
default?: {
|
|
341
|
+
field: string;
|
|
342
|
+
direction?: 'ascending' | 'descending';
|
|
343
|
+
};
|
|
344
|
+
};
|
|
223
345
|
/**
|
|
224
346
|
* An optional list of predefined view filters to show in the UI.
|
|
225
347
|
*/
|
|
226
|
-
view_filters?:
|
|
348
|
+
view_filters?: Array<{
|
|
349
|
+
name?: string;
|
|
350
|
+
label: string;
|
|
351
|
+
field: string;
|
|
352
|
+
pattern: string | boolean;
|
|
353
|
+
}> | {
|
|
354
|
+
filters: Array<{
|
|
355
|
+
name?: string;
|
|
356
|
+
label: string;
|
|
357
|
+
field: string;
|
|
358
|
+
pattern: string | boolean;
|
|
359
|
+
}>;
|
|
360
|
+
default?: string;
|
|
361
|
+
};
|
|
227
362
|
/**
|
|
228
363
|
* An optional list of predefined view groups to show in the UI.
|
|
229
364
|
*/
|
|
230
|
-
view_groups?:
|
|
365
|
+
view_groups?: Array<{
|
|
366
|
+
name?: string;
|
|
367
|
+
label: string;
|
|
368
|
+
field: string;
|
|
369
|
+
pattern?: string | boolean;
|
|
370
|
+
}> | {
|
|
371
|
+
groups: Array<{
|
|
372
|
+
name?: string;
|
|
373
|
+
label: string;
|
|
374
|
+
field: string;
|
|
375
|
+
pattern?: string | boolean;
|
|
376
|
+
}>;
|
|
377
|
+
default?: string;
|
|
378
|
+
};
|
|
379
|
+
/**
|
|
380
|
+
* Internal media folder path
|
|
381
|
+
*/
|
|
382
|
+
media_folder?: string;
|
|
383
|
+
/**
|
|
384
|
+
* Public media folder path
|
|
385
|
+
*/
|
|
386
|
+
public_folder?: string;
|
|
387
|
+
/**
|
|
388
|
+
* i18n options
|
|
389
|
+
*/
|
|
390
|
+
i18n?: boolean | {
|
|
391
|
+
structure: 'single_file' | 'multiple_files' | 'multiple_folders' | 'multiple_folders_i18n_root';
|
|
392
|
+
locales: string[];
|
|
393
|
+
default_locale?: string;
|
|
394
|
+
};
|
|
395
|
+
/**
|
|
396
|
+
* YAML quote option
|
|
397
|
+
* @deprecated Use global yaml output options instead
|
|
398
|
+
*/
|
|
399
|
+
yaml_quote?: boolean;
|
|
400
|
+
/**
|
|
401
|
+
* Entry thumbnail configuration
|
|
402
|
+
*/
|
|
403
|
+
thumbnail?: boolean | string | string[];
|
|
404
|
+
/**
|
|
405
|
+
* Maximum number of entries that can be created
|
|
406
|
+
*/
|
|
407
|
+
limit?: number;
|
|
231
408
|
}
|
|
232
409
|
interface FileCollection {
|
|
233
410
|
name: string;
|
|
234
411
|
label?: string;
|
|
412
|
+
label_singular?: string;
|
|
413
|
+
description?: string;
|
|
414
|
+
icon?: string;
|
|
235
415
|
files: FileCollectionEntry[];
|
|
416
|
+
media_folder?: string;
|
|
417
|
+
public_folder?: string;
|
|
418
|
+
hide?: boolean;
|
|
419
|
+
publish?: boolean;
|
|
420
|
+
format?: string;
|
|
421
|
+
frontmatter_delimiter?: string | string[];
|
|
422
|
+
i18n?: boolean | Record<string, unknown>;
|
|
423
|
+
preview_path?: string;
|
|
424
|
+
preview_path_date_field?: string;
|
|
425
|
+
editor?: {
|
|
426
|
+
preview?: boolean;
|
|
427
|
+
};
|
|
428
|
+
yaml_quote?: boolean;
|
|
236
429
|
}
|
|
237
430
|
interface FileCollectionEntry extends Collection {
|
|
238
431
|
/**
|
|
@@ -247,16 +440,54 @@ interface FolderCollection extends Collection {
|
|
|
247
440
|
* details in Collection Types
|
|
248
441
|
*/
|
|
249
442
|
folder: string;
|
|
443
|
+
/**
|
|
444
|
+
* Path template for entries
|
|
445
|
+
*/
|
|
446
|
+
path?: string;
|
|
250
447
|
/**
|
|
251
448
|
* optional filter for folder collections; details in Collection Types
|
|
252
449
|
*/
|
|
253
|
-
filter?:
|
|
450
|
+
filter?: {
|
|
451
|
+
field: string;
|
|
452
|
+
value?: any | any[];
|
|
453
|
+
pattern?: string;
|
|
454
|
+
};
|
|
254
455
|
/**
|
|
255
456
|
* true allows users to create new items in the collection;
|
|
256
457
|
*
|
|
257
|
-
* defaults to false
|
|
458
|
+
* defaults to false (in Decap), true (in Sveltia)
|
|
258
459
|
*/
|
|
259
460
|
create?: boolean;
|
|
461
|
+
/**
|
|
462
|
+
* Nested collection options
|
|
463
|
+
*/
|
|
464
|
+
nested?: {
|
|
465
|
+
depth?: number;
|
|
466
|
+
summary?: string;
|
|
467
|
+
subfolders?: boolean;
|
|
468
|
+
};
|
|
469
|
+
/**
|
|
470
|
+
* Meta data for nested collections
|
|
471
|
+
*/
|
|
472
|
+
meta?: {
|
|
473
|
+
path?: {
|
|
474
|
+
widget?: 'string';
|
|
475
|
+
label?: string;
|
|
476
|
+
index_file?: string;
|
|
477
|
+
};
|
|
478
|
+
};
|
|
479
|
+
/**
|
|
480
|
+
* Index file inclusion options
|
|
481
|
+
*/
|
|
482
|
+
index_file?: boolean | {
|
|
483
|
+
name?: string;
|
|
484
|
+
label?: string;
|
|
485
|
+
icon?: string;
|
|
486
|
+
fields?: CollectionField[];
|
|
487
|
+
editor?: {
|
|
488
|
+
preview?: boolean;
|
|
489
|
+
};
|
|
490
|
+
};
|
|
260
491
|
}
|
|
261
492
|
type Locales = 'bg' | 'ca' | 'cs' | 'da' | 'de' | 'en' | 'es' | 'fa' | 'fr' | 'he' | 'hr' | 'hu' | 'it' | 'ja' | 'ko' | 'lt' | 'nb_no' | 'nl' | 'nn_no' | 'pl' | 'pt' | 'ro' | 'ru' | 'sl' | 'sv' | 'th' | 'tr' | 'uk' | 'vi' | 'zh-Hans' | 'zh-Hant';
|
|
262
493
|
interface CloudinaryMediaLibrary {
|
|
@@ -333,11 +564,15 @@ interface NetlifyCMSConfig {
|
|
|
333
564
|
* @see https://decapcms.org/docs/beta-features/?#working-with-a-local-git-repository
|
|
334
565
|
*/
|
|
335
566
|
local_backend?: boolean;
|
|
567
|
+
/**
|
|
568
|
+
* Whether to load YAML/JSON CMS configuration file(s)
|
|
569
|
+
*/
|
|
570
|
+
load_config_file?: boolean;
|
|
336
571
|
backend: {
|
|
337
572
|
/**
|
|
338
573
|
* The name of the backend to use.
|
|
339
574
|
*/
|
|
340
|
-
name: 'git-gateway' | 'github' | 'gitlab' | 'bitbucket' | 'azure' | 'gitea';
|
|
575
|
+
name: 'git-gateway' | 'github' | 'gitlab' | 'bitbucket' | 'azure' | 'gitea' | 'test';
|
|
341
576
|
/**
|
|
342
577
|
* [org-or-username]/[repo-name] Required for github, gitlab,
|
|
343
578
|
* bitbucket, azure, gitea and ignored by git-gateway.
|
|
@@ -359,6 +594,10 @@ interface NetlifyCMSConfig {
|
|
|
359
594
|
* @default https://api.bitbucket.org/2.0 (Bitbucket)
|
|
360
595
|
*/
|
|
361
596
|
api_root?: string;
|
|
597
|
+
/**
|
|
598
|
+
* GraphQL API endpoint for the backend
|
|
599
|
+
*/
|
|
600
|
+
graphql_api_root?: string;
|
|
362
601
|
/**
|
|
363
602
|
* Sets the site_id query param sent to the API endpoint.
|
|
364
603
|
* Non-Netlify auth setups will often need to set this for
|
|
@@ -366,7 +605,7 @@ interface NetlifyCMSConfig {
|
|
|
366
605
|
*
|
|
367
606
|
* @default location.hostname (or cms.netlify.com when on localhost)
|
|
368
607
|
*/
|
|
369
|
-
|
|
608
|
+
site_domain?: string;
|
|
370
609
|
/**
|
|
371
610
|
* OAuth client hostname (just the base domain, no path).
|
|
372
611
|
* Required when using an external OAuth server or self-hosted GitLab.
|
|
@@ -375,6 +614,10 @@ interface NetlifyCMSConfig {
|
|
|
375
614
|
* @default https://gitlab.com (GitLab)
|
|
376
615
|
*/
|
|
377
616
|
base_url?: string;
|
|
617
|
+
/**
|
|
618
|
+
* OAuth grant type
|
|
619
|
+
*/
|
|
620
|
+
auth_type?: '' | 'pkce';
|
|
378
621
|
/**
|
|
379
622
|
* Path to append to base_url for authentication requests.
|
|
380
623
|
*
|
|
@@ -382,12 +625,52 @@ interface NetlifyCMSConfig {
|
|
|
382
625
|
* @default oauth/authorize (GitLab)
|
|
383
626
|
*/
|
|
384
627
|
auth_endpoint?: string;
|
|
628
|
+
/**
|
|
629
|
+
* OAuth application ID
|
|
630
|
+
*/
|
|
631
|
+
app_id?: string;
|
|
385
632
|
/**
|
|
386
633
|
* Pull (or Merge) Requests label prefix when using editorial workflow.
|
|
387
634
|
*
|
|
388
|
-
* @default
|
|
635
|
+
* @default sveltia-cms/
|
|
389
636
|
*/
|
|
390
637
|
cms_label_prefix?: string;
|
|
638
|
+
/**
|
|
639
|
+
* Whether to use squash merge for Editorial Workflow
|
|
640
|
+
*/
|
|
641
|
+
squash_merges?: boolean;
|
|
642
|
+
/**
|
|
643
|
+
* Deploy preview link context
|
|
644
|
+
*/
|
|
645
|
+
preview_context?: string;
|
|
646
|
+
/**
|
|
647
|
+
* Whether to use Open Authoring
|
|
648
|
+
*/
|
|
649
|
+
open_authoring?: boolean;
|
|
650
|
+
/**
|
|
651
|
+
* Authentication scope for Open Authoring
|
|
652
|
+
*/
|
|
653
|
+
auth_scope?: 'repo' | 'public_repo';
|
|
654
|
+
/**
|
|
655
|
+
* Custom commit messages
|
|
656
|
+
*/
|
|
657
|
+
commit_messages?: {
|
|
658
|
+
create?: string;
|
|
659
|
+
update?: string;
|
|
660
|
+
delete?: string;
|
|
661
|
+
uploadMedia?: string;
|
|
662
|
+
deleteMedia?: string;
|
|
663
|
+
openAuthoring?: string;
|
|
664
|
+
};
|
|
665
|
+
/**
|
|
666
|
+
* Whether to enable or disable automatic deployments
|
|
667
|
+
* @deprecated Use skip_ci instead
|
|
668
|
+
*/
|
|
669
|
+
automatic_deployments?: boolean;
|
|
670
|
+
/**
|
|
671
|
+
* Whether to enable or disable automatic deployments
|
|
672
|
+
*/
|
|
673
|
+
skip_ci?: boolean;
|
|
391
674
|
};
|
|
392
675
|
/**
|
|
393
676
|
* By default, all entries created or edited in the Decap CMS are committed directly
|
|
@@ -402,14 +685,14 @@ interface NetlifyCMSConfig {
|
|
|
402
685
|
*
|
|
403
686
|
* @see https://decapcms.org/docs/configuration-options/#publish-mode
|
|
404
687
|
*/
|
|
405
|
-
publish_mode?: 'editorial_workflow';
|
|
688
|
+
publish_mode?: '' | 'simple' | 'editorial_workflow';
|
|
406
689
|
/**
|
|
407
690
|
* The media_folder option specifies the folder path where
|
|
408
691
|
* uploaded files should be saved, relative to the base of the repo.
|
|
409
692
|
*
|
|
410
693
|
* @example media_folder: "static/images/uploads"
|
|
411
694
|
*/
|
|
412
|
-
media_folder
|
|
695
|
+
media_folder?: string;
|
|
413
696
|
/**
|
|
414
697
|
* The public_folder option specifies the folder path where the
|
|
415
698
|
* files uploaded by the media library will be accessed, relative to
|
|
@@ -425,11 +708,54 @@ interface NetlifyCMSConfig {
|
|
|
425
708
|
* Media library integrations are configured via the media_library property,
|
|
426
709
|
* and its value should be an object with at least a name property.
|
|
427
710
|
* A config property can also be used for options that should be passed to the library in use.
|
|
711
|
+
* @deprecated Use media_libraries instead
|
|
428
712
|
*/
|
|
429
713
|
media_library?: MediaLibrary;
|
|
714
|
+
/**
|
|
715
|
+
* Unified media library option that supports multiple libraries
|
|
716
|
+
*/
|
|
717
|
+
media_libraries?: {
|
|
718
|
+
default?: {
|
|
719
|
+
config?: {
|
|
720
|
+
multiple?: boolean;
|
|
721
|
+
max_file_size?: number;
|
|
722
|
+
slugify_filename?: boolean;
|
|
723
|
+
transformations?: Record<string, unknown>;
|
|
724
|
+
};
|
|
725
|
+
};
|
|
726
|
+
cloudinary?: {
|
|
727
|
+
output_filename_only?: boolean;
|
|
728
|
+
use_transformations?: boolean;
|
|
729
|
+
config?: Record<string, unknown>;
|
|
730
|
+
};
|
|
731
|
+
uploadcare?: {
|
|
732
|
+
config?: Record<string, unknown>;
|
|
733
|
+
settings?: {
|
|
734
|
+
autoFilename?: boolean;
|
|
735
|
+
defaultOperations?: string;
|
|
736
|
+
};
|
|
737
|
+
};
|
|
738
|
+
stock_assets?: {
|
|
739
|
+
providers?: ('pexels' | 'pixabay' | 'unsplash')[];
|
|
740
|
+
};
|
|
741
|
+
};
|
|
430
742
|
site_url?: string;
|
|
431
743
|
display_url?: string;
|
|
744
|
+
/**
|
|
745
|
+
* @deprecated Use logo.src instead
|
|
746
|
+
*/
|
|
432
747
|
logo_url?: string;
|
|
748
|
+
/**
|
|
749
|
+
* Site logo options
|
|
750
|
+
*/
|
|
751
|
+
logo?: {
|
|
752
|
+
src: string;
|
|
753
|
+
show_in_header?: boolean;
|
|
754
|
+
};
|
|
755
|
+
/**
|
|
756
|
+
* URL to redirect users to after logging out
|
|
757
|
+
*/
|
|
758
|
+
logout_redirect_url?: string;
|
|
433
759
|
/**
|
|
434
760
|
* Define the cms language,
|
|
435
761
|
*
|
|
@@ -453,8 +779,59 @@ interface NetlifyCMSConfig {
|
|
|
453
779
|
encoding?: 'unicode' | 'ascii';
|
|
454
780
|
clean_accents?: boolean;
|
|
455
781
|
sanitize_replacement?: string;
|
|
782
|
+
trim?: boolean;
|
|
783
|
+
};
|
|
784
|
+
/**
|
|
785
|
+
* Set of collections
|
|
786
|
+
*/
|
|
787
|
+
collections?: (FileCollection | FolderCollection | {
|
|
788
|
+
name?: string;
|
|
789
|
+
divider: boolean;
|
|
790
|
+
})[];
|
|
791
|
+
/**
|
|
792
|
+
* Set of singleton files
|
|
793
|
+
*/
|
|
794
|
+
singletons?: (FileCollectionEntry | {
|
|
795
|
+
name?: string;
|
|
796
|
+
divider: boolean;
|
|
797
|
+
})[];
|
|
798
|
+
/**
|
|
799
|
+
* Global i18n options
|
|
800
|
+
*/
|
|
801
|
+
i18n?: {
|
|
802
|
+
structure: 'single_file' | 'multiple_files' | 'multiple_folders' | 'multiple_folders_i18n_root';
|
|
803
|
+
locales: string[];
|
|
804
|
+
default_locale?: string;
|
|
805
|
+
initial_locales?: 'default' | 'all';
|
|
806
|
+
save_all_locales?: boolean;
|
|
807
|
+
canonical_slug?: {
|
|
808
|
+
key?: string;
|
|
809
|
+
value?: string;
|
|
810
|
+
};
|
|
811
|
+
omit_default_locale_from_filename?: boolean;
|
|
812
|
+
};
|
|
813
|
+
/**
|
|
814
|
+
* Editor view options
|
|
815
|
+
*/
|
|
816
|
+
editor?: {
|
|
817
|
+
preview?: boolean;
|
|
818
|
+
};
|
|
819
|
+
/**
|
|
820
|
+
* Data output options
|
|
821
|
+
*/
|
|
822
|
+
output?: {
|
|
823
|
+
omit_empty_optional_fields?: boolean;
|
|
824
|
+
encode_file_path?: boolean;
|
|
825
|
+
json?: {
|
|
826
|
+
indent_style?: 'space' | 'tab';
|
|
827
|
+
indent_size?: number;
|
|
828
|
+
};
|
|
829
|
+
yaml?: {
|
|
830
|
+
indent_size?: number;
|
|
831
|
+
indent_sequences?: boolean;
|
|
832
|
+
quote?: 'none' | 'single' | 'double';
|
|
833
|
+
};
|
|
456
834
|
};
|
|
457
|
-
collections: (FileCollection | FolderCollection)[];
|
|
458
835
|
}
|
|
459
836
|
|
|
460
837
|
declare function defineConfig(config: NetlifyCMSConfig): NetlifyCMSConfig;
|
|
@@ -464,10 +841,12 @@ declare const defineFileCollectionEntry: (collection: FileCollectionEntry) => Fi
|
|
|
464
841
|
declare function defineBooleanWidget(widget: Omit<BooleanWidget, 'widget'>): BooleanWidget;
|
|
465
842
|
declare function defineCodeWidget(widget: Omit<CodeWidget, 'widget'>): CodeWidget;
|
|
466
843
|
declare function defineColorWidget(widget: Omit<ColorWidget, 'widget'>): ColorWidget;
|
|
844
|
+
declare function defineComputeWidget(widget: Omit<ComputeWidget, 'widget'>): ComputeWidget;
|
|
467
845
|
declare function defineDateTimeWidget(widget: Omit<DateTimeWidget, 'widget'>): DateTimeWidget;
|
|
468
846
|
declare function defineHiddenWidget(widget: Omit<HiddenWidget, 'widget'>): HiddenWidget;
|
|
469
847
|
declare function defineFileWidget(widget: Omit<FileWidget, 'widget'>): FileWidget;
|
|
470
848
|
declare function defineImageWidget(widget: Omit<ImageWidget, 'widget'>): ImageWidget;
|
|
849
|
+
declare function defineKeyValueWidget(widget: Omit<KeyValueWidget, 'widget'>): KeyValueWidget;
|
|
471
850
|
declare function defineListWidget(widget: Omit<ListWidget, 'widget'>): ListWidget;
|
|
472
851
|
declare function defineMapWidget(widget: Omit<MapWidget, 'widget'>): MapWidget;
|
|
473
852
|
declare function defineNumberWidget(widget: Omit<NumberWidget, 'widget'>): NumberWidget;
|
|
@@ -477,6 +856,8 @@ declare function defineSelectWidget(widget: Omit<SelectWidget, 'widget'>): Selec
|
|
|
477
856
|
declare function defineStringWidget(widget: Omit<StringWidget, 'widget'>): StringWidget;
|
|
478
857
|
declare function defineTextWidget(widget: Omit<TextWidget, 'widget'>): TextWidget;
|
|
479
858
|
declare function defineMarkdownWidget(widget: Omit<MarkdownWidget, 'widget'>): MarkdownWidget;
|
|
859
|
+
declare function defineRichTextWidget(widget: Omit<RichTextWidget, 'widget'>): RichTextWidget;
|
|
860
|
+
declare function defineUuidWidget(widget: Omit<UuidWidget, 'widget'>): UuidWidget;
|
|
480
861
|
interface NetlifyCMSEntry {
|
|
481
862
|
/**
|
|
482
863
|
* Name of config file
|
|
@@ -516,8 +897,48 @@ interface NetlifyCMSEntry {
|
|
|
516
897
|
* @default true
|
|
517
898
|
*/
|
|
518
899
|
useIdentityWidget?: boolean;
|
|
900
|
+
/**
|
|
901
|
+
* Type of CMS to generate config for
|
|
902
|
+
*
|
|
903
|
+
* @default 'sveltia'
|
|
904
|
+
*/
|
|
905
|
+
type?: 'decap' | 'sveltia';
|
|
519
906
|
}
|
|
520
907
|
declare function createConfig(root: string, entry?: NetlifyCMSEntry): Promise<void>;
|
|
521
908
|
declare function export_default(entry?: NetlifyCMSEntry): Promise<Plugin>;
|
|
522
909
|
|
|
523
|
-
|
|
910
|
+
interface AstroOAuthOptions {
|
|
911
|
+
/**
|
|
912
|
+
* OAuth login route
|
|
913
|
+
* @default '/oauth'
|
|
914
|
+
*/
|
|
915
|
+
loginRoute?: string;
|
|
916
|
+
/**
|
|
917
|
+
* OAuth callback route
|
|
918
|
+
* @default '/oauth/callback'
|
|
919
|
+
*/
|
|
920
|
+
callbackRoute?: string;
|
|
921
|
+
/**
|
|
922
|
+
* Disable OAuth integration
|
|
923
|
+
* @default false
|
|
924
|
+
*/
|
|
925
|
+
disabled?: boolean;
|
|
926
|
+
}
|
|
927
|
+
/**
|
|
928
|
+
* Astro integration for OAuth authentication routes
|
|
929
|
+
* Adds /oauth and /oauth/callback routes for GitHub authentication
|
|
930
|
+
*
|
|
931
|
+
* @example
|
|
932
|
+
* ```ts
|
|
933
|
+
* import { defineConfig } from 'astro/config';
|
|
934
|
+
* import { githubOAuthIntegration } from 'vite-plugin-netlify-cms';
|
|
935
|
+
*
|
|
936
|
+
* export default defineConfig({
|
|
937
|
+
* integrations: [githubOAuthIntegration()],
|
|
938
|
+
* output: 'server', // or 'hybrid'
|
|
939
|
+
* });
|
|
940
|
+
* ```
|
|
941
|
+
*/
|
|
942
|
+
declare function githubOAuthIntegration(options?: AstroOAuthOptions): any;
|
|
943
|
+
|
|
944
|
+
export { type AstroOAuthOptions, type BooleanWidget, type CodeWidget, type Collection, type CollectionField, type ColorWidget, type ComputeWidget, type DateTimeWidget, type EditorComponent, type EditorMode, type FileCollection, type FileCollectionEntry, type FileWidget, type FolderCollection, type HiddenWidget, type ImageWidget, type KeyValueWidget, type ListWidget, type MapWidget, type MarkdownButtons, type MarkdownWidget, type NetlifyCMSConfig, type NetlifyCMSEntry, type NumberWidget, type OAuthPluginOptions, type ObjectWidget, type RelationWidget, type RichTextWidget, type SelectWidget, type StringWidget, type TextWidget, type UuidWidget, type VariableFieldType, type Widget, export_default as cmsPlugin, createConfig, export_default as default, defineBooleanWidget, defineCodeWidget, defineColorWidget, defineComputeWidget, defineConfig, defineDateTimeWidget, defineFileCollection, defineFileCollectionEntry, defineFileWidget, defineFolderCollection, defineHiddenWidget, defineImageWidget, defineKeyValueWidget, defineListWidget, defineMapWidget, defineMarkdownWidget, defineNumberWidget, defineObjectWidget, defineRelationWidget, defineRichTextWidget, defineSelectWidget, defineStringWidget, defineTextWidget, defineUuidWidget, githubOAuthIntegration, oauthPlugin };
|