@wordpress/core-data 7.35.0 → 7.35.1-next.16d95556a.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/build/entity-types/attachment.js.map +1 -1
- package/build-types/entity-types/attachment.d.ts +62 -8
- package/build-types/entity-types/attachment.d.ts.map +1 -1
- package/package.json +18 -18
- package/src/entity-types/attachment.ts +66 -8
- package/src/entity-types/test/attachment.test.ts +96 -0
- package/src/entity-types/test/fixtures/attachment-audio.json +138 -0
- package/src/entity-types/test/fixtures/attachment-image.json +175 -0
- package/src/entity-types/test/fixtures/attachment-video.json +121 -0
- package/src/entity-types/test/fixtures/attachment-zip.json +101 -0
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": 71,
|
|
3
|
+
"date": "2025-11-03T05:34:25",
|
|
4
|
+
"date_gmt": "2025-11-03T05:34:25",
|
|
5
|
+
"guid": {
|
|
6
|
+
"rendered": "http://localhost:8888/wp-content/uploads/2025/11/IMG_8141.jpeg",
|
|
7
|
+
"raw": "http://localhost:8888/wp-content/uploads/2025/11/IMG_8141.jpeg"
|
|
8
|
+
},
|
|
9
|
+
"modified": "2025-11-12T23:17:38",
|
|
10
|
+
"modified_gmt": "2025-11-12T23:17:38",
|
|
11
|
+
"slug": "img_8141",
|
|
12
|
+
"status": "inherit",
|
|
13
|
+
"type": "attachment",
|
|
14
|
+
"link": "http://localhost:8888/?attachment_id=71",
|
|
15
|
+
"title": {
|
|
16
|
+
"raw": "IMG_8141",
|
|
17
|
+
"rendered": "IMG_8141"
|
|
18
|
+
},
|
|
19
|
+
"author": 1,
|
|
20
|
+
"featured_media": 0,
|
|
21
|
+
"comment_status": "open",
|
|
22
|
+
"ping_status": "closed",
|
|
23
|
+
"template": "",
|
|
24
|
+
"meta": [],
|
|
25
|
+
"permalink_template": "http://localhost:8888/?attachment_id=71",
|
|
26
|
+
"generated_slug": "img_8141",
|
|
27
|
+
"class_list": [
|
|
28
|
+
"post-71",
|
|
29
|
+
"attachment",
|
|
30
|
+
"type-attachment",
|
|
31
|
+
"status-inherit",
|
|
32
|
+
"hentry"
|
|
33
|
+
],
|
|
34
|
+
"description": {
|
|
35
|
+
"raw": "",
|
|
36
|
+
"rendered": "<p class=\"attachment\"><a href='http://localhost:8888/wp-content/uploads/2025/11/IMG_8141-scaled.jpeg'><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"225\" src=\"http://localhost:8888/wp-content/uploads/2025/11/IMG_8141-300x225.jpeg\" class=\"attachment-medium size-medium\" alt=\"\" srcset=\"http://localhost:8888/wp-content/uploads/2025/11/IMG_8141-300x225.jpeg 300w, http://localhost:8888/wp-content/uploads/2025/11/IMG_8141-1024x768.jpeg 1024w, http://localhost:8888/wp-content/uploads/2025/11/IMG_8141-768x576.jpeg 768w, http://localhost:8888/wp-content/uploads/2025/11/IMG_8141-1536x1152.jpeg 1536w, http://localhost:8888/wp-content/uploads/2025/11/IMG_8141-2048x1536.jpeg 2048w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" /></a></p>\n"
|
|
37
|
+
},
|
|
38
|
+
"caption": {
|
|
39
|
+
"raw": "A caption for the image",
|
|
40
|
+
"rendered": "<p>A caption for the image</p>\n"
|
|
41
|
+
},
|
|
42
|
+
"alt_text": "",
|
|
43
|
+
"media_type": "image",
|
|
44
|
+
"mime_type": "image/jpeg",
|
|
45
|
+
"media_details": {
|
|
46
|
+
"width": 2560,
|
|
47
|
+
"height": 1920,
|
|
48
|
+
"file": "2025/11/IMG_8141-scaled.jpeg",
|
|
49
|
+
"filesize": 751579,
|
|
50
|
+
"sizes": {
|
|
51
|
+
"medium": {
|
|
52
|
+
"file": "IMG_8141-300x225.jpeg",
|
|
53
|
+
"width": 300,
|
|
54
|
+
"height": 225,
|
|
55
|
+
"filesize": 22105,
|
|
56
|
+
"mime_type": "image/jpeg",
|
|
57
|
+
"source_url": "http://localhost:8888/wp-content/uploads/2025/11/IMG_8141-300x225.jpeg"
|
|
58
|
+
},
|
|
59
|
+
"large": {
|
|
60
|
+
"file": "IMG_8141-1024x768.jpeg",
|
|
61
|
+
"width": 1024,
|
|
62
|
+
"height": 768,
|
|
63
|
+
"filesize": 155739,
|
|
64
|
+
"mime_type": "image/jpeg",
|
|
65
|
+
"source_url": "http://localhost:8888/wp-content/uploads/2025/11/IMG_8141-1024x768.jpeg"
|
|
66
|
+
},
|
|
67
|
+
"thumbnail": {
|
|
68
|
+
"file": "IMG_8141-150x150.jpeg",
|
|
69
|
+
"width": 150,
|
|
70
|
+
"height": 150,
|
|
71
|
+
"filesize": 10260,
|
|
72
|
+
"mime_type": "image/jpeg",
|
|
73
|
+
"source_url": "http://localhost:8888/wp-content/uploads/2025/11/IMG_8141-150x150.jpeg"
|
|
74
|
+
},
|
|
75
|
+
"medium_large": {
|
|
76
|
+
"file": "IMG_8141-768x576.jpeg",
|
|
77
|
+
"width": 768,
|
|
78
|
+
"height": 576,
|
|
79
|
+
"filesize": 97570,
|
|
80
|
+
"mime_type": "image/jpeg",
|
|
81
|
+
"source_url": "http://localhost:8888/wp-content/uploads/2025/11/IMG_8141-768x576.jpeg"
|
|
82
|
+
},
|
|
83
|
+
"1536x1536": {
|
|
84
|
+
"file": "IMG_8141-1536x1152.jpeg",
|
|
85
|
+
"width": 1536,
|
|
86
|
+
"height": 1152,
|
|
87
|
+
"filesize": 303572,
|
|
88
|
+
"mime_type": "image/jpeg",
|
|
89
|
+
"source_url": "http://localhost:8888/wp-content/uploads/2025/11/IMG_8141-1536x1152.jpeg"
|
|
90
|
+
},
|
|
91
|
+
"2048x2048": {
|
|
92
|
+
"file": "IMG_8141-2048x1536.jpeg",
|
|
93
|
+
"width": 2048,
|
|
94
|
+
"height": 1536,
|
|
95
|
+
"filesize": 502729,
|
|
96
|
+
"mime_type": "image/jpeg",
|
|
97
|
+
"source_url": "http://localhost:8888/wp-content/uploads/2025/11/IMG_8141-2048x1536.jpeg"
|
|
98
|
+
},
|
|
99
|
+
"full": {
|
|
100
|
+
"file": "IMG_8141-scaled.jpeg",
|
|
101
|
+
"width": 2560,
|
|
102
|
+
"height": 1920,
|
|
103
|
+
"mime_type": "image/jpeg",
|
|
104
|
+
"source_url": "http://localhost:8888/wp-content/uploads/2025/11/IMG_8141-scaled.jpeg"
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
"image_meta": {
|
|
108
|
+
"aperture": "1.78",
|
|
109
|
+
"credit": "",
|
|
110
|
+
"camera": "iPhone 14 Pro",
|
|
111
|
+
"caption": "",
|
|
112
|
+
"created_timestamp": "1761765212",
|
|
113
|
+
"copyright": "",
|
|
114
|
+
"focal_length": "6.86",
|
|
115
|
+
"iso": "1600",
|
|
116
|
+
"shutter_speed": "0.058823529411765",
|
|
117
|
+
"title": "",
|
|
118
|
+
"orientation": "1",
|
|
119
|
+
"keywords": []
|
|
120
|
+
},
|
|
121
|
+
"original_image": "IMG_8141.jpeg"
|
|
122
|
+
},
|
|
123
|
+
"post": 49,
|
|
124
|
+
"source_url": "http://localhost:8888/wp-content/uploads/2025/11/IMG_8141-scaled.jpeg",
|
|
125
|
+
"missing_image_sizes": [],
|
|
126
|
+
"_links": {
|
|
127
|
+
"self": [
|
|
128
|
+
{
|
|
129
|
+
"href": "http://localhost:8888/wp-json/wp/v2/media/71",
|
|
130
|
+
"targetHints": {
|
|
131
|
+
"allow": [ "GET", "POST", "PUT", "PATCH", "DELETE" ]
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
],
|
|
135
|
+
"collection": [
|
|
136
|
+
{
|
|
137
|
+
"href": "http://localhost:8888/wp-json/wp/v2/media"
|
|
138
|
+
}
|
|
139
|
+
],
|
|
140
|
+
"about": [
|
|
141
|
+
{
|
|
142
|
+
"href": "http://localhost:8888/wp-json/wp/v2/types/attachment"
|
|
143
|
+
}
|
|
144
|
+
],
|
|
145
|
+
"author": [
|
|
146
|
+
{
|
|
147
|
+
"embeddable": true,
|
|
148
|
+
"href": "http://localhost:8888/wp-json/wp/v2/users/1"
|
|
149
|
+
}
|
|
150
|
+
],
|
|
151
|
+
"replies": [
|
|
152
|
+
{
|
|
153
|
+
"embeddable": true,
|
|
154
|
+
"href": "http://localhost:8888/wp-json/wp/v2/comments?post=71"
|
|
155
|
+
}
|
|
156
|
+
],
|
|
157
|
+
"wp:action-unfiltered-html": [
|
|
158
|
+
{
|
|
159
|
+
"href": "http://localhost:8888/wp-json/wp/v2/media/71"
|
|
160
|
+
}
|
|
161
|
+
],
|
|
162
|
+
"wp:action-assign-author": [
|
|
163
|
+
{
|
|
164
|
+
"href": "http://localhost:8888/wp-json/wp/v2/media/71"
|
|
165
|
+
}
|
|
166
|
+
],
|
|
167
|
+
"curies": [
|
|
168
|
+
{
|
|
169
|
+
"name": "wp",
|
|
170
|
+
"href": "https://api.w.org/{rel}",
|
|
171
|
+
"templated": true
|
|
172
|
+
}
|
|
173
|
+
]
|
|
174
|
+
}
|
|
175
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": 93,
|
|
3
|
+
"date": "2025-11-06T05:11:23",
|
|
4
|
+
"date_gmt": "2025-11-06T05:11:23",
|
|
5
|
+
"guid": {
|
|
6
|
+
"rendered": "http://localhost:8888/wp-content/uploads/2025/11/sample-5s.mp4",
|
|
7
|
+
"raw": "http://localhost:8888/wp-content/uploads/2025/11/sample-5s.mp4"
|
|
8
|
+
},
|
|
9
|
+
"modified": "2025-11-06T05:11:23",
|
|
10
|
+
"modified_gmt": "2025-11-06T05:11:23",
|
|
11
|
+
"slug": "sample-video",
|
|
12
|
+
"status": "inherit",
|
|
13
|
+
"type": "attachment",
|
|
14
|
+
"link": "http://localhost:8888/sample-video/",
|
|
15
|
+
"title": {
|
|
16
|
+
"raw": "Sample Video",
|
|
17
|
+
"rendered": "Sample Video"
|
|
18
|
+
},
|
|
19
|
+
"author": 1,
|
|
20
|
+
"featured_media": 0,
|
|
21
|
+
"comment_status": "open",
|
|
22
|
+
"ping_status": "closed",
|
|
23
|
+
"template": "",
|
|
24
|
+
"meta": [],
|
|
25
|
+
"permalink_template": "http://localhost:8888/?attachment_id=93",
|
|
26
|
+
"generated_slug": "sample-video",
|
|
27
|
+
"class_list": [
|
|
28
|
+
"post-93",
|
|
29
|
+
"attachment",
|
|
30
|
+
"type-attachment",
|
|
31
|
+
"status-inherit",
|
|
32
|
+
"hentry"
|
|
33
|
+
],
|
|
34
|
+
"description": {
|
|
35
|
+
"raw": "",
|
|
36
|
+
"rendered": "<div style=\"width: 1920px;\" class=\"wp-video\"><!--[if lt IE 9]><script>document.createElement('video');</script><![endif]-->\n<video class=\"wp-video-shortcode\" id=\"video-93-1\" width=\"1920\" height=\"1080\" preload=\"metadata\" controls=\"controls\"><source type=\"video/mp4\" src=\"http://localhost:8888/wp-content/uploads/2025/11/sample-5s.mp4?_=1\" /><a href=\"http://localhost:8888/wp-content/uploads/2025/11/sample-5s.mp4\">http://localhost:8888/wp-content/uploads/2025/11/sample-5s.mp4</a></video></div>\n"
|
|
37
|
+
},
|
|
38
|
+
"caption": {
|
|
39
|
+
"raw": "",
|
|
40
|
+
"rendered": "<p>Sample video file</p>\n"
|
|
41
|
+
},
|
|
42
|
+
"alt_text": "",
|
|
43
|
+
"media_type": "file",
|
|
44
|
+
"mime_type": "video/mp4",
|
|
45
|
+
"media_details": {
|
|
46
|
+
"bitrate": 3828466,
|
|
47
|
+
"filesize": 2848208,
|
|
48
|
+
"mime_type": "video/mp4",
|
|
49
|
+
"length": 6,
|
|
50
|
+
"length_formatted": "0:06",
|
|
51
|
+
"width": 1920,
|
|
52
|
+
"height": 1080,
|
|
53
|
+
"fileformat": "mp4",
|
|
54
|
+
"dataformat": "quicktime",
|
|
55
|
+
"audio": {
|
|
56
|
+
"dataformat": "mp4",
|
|
57
|
+
"bitrate": 127998,
|
|
58
|
+
"codec": "ISO/IEC 14496-3 AAC",
|
|
59
|
+
"sample_rate": 44100,
|
|
60
|
+
"channels": 2,
|
|
61
|
+
"bits_per_sample": 16,
|
|
62
|
+
"lossless": false,
|
|
63
|
+
"channelmode": "stereo",
|
|
64
|
+
"compression_ratio": 0.0907015306122449
|
|
65
|
+
},
|
|
66
|
+
"created_timestamp": -2082844800,
|
|
67
|
+
"sizes": {}
|
|
68
|
+
},
|
|
69
|
+
"post": 75,
|
|
70
|
+
"source_url": "http://localhost:8888/wp-content/uploads/2025/11/sample-5s.mp4",
|
|
71
|
+
"missing_image_sizes": [],
|
|
72
|
+
"_links": {
|
|
73
|
+
"self": [
|
|
74
|
+
{
|
|
75
|
+
"href": "http://localhost:8888/wp-json/wp/v2/media/93",
|
|
76
|
+
"targetHints": {
|
|
77
|
+
"allow": [ "GET", "POST", "PUT", "PATCH", "DELETE" ]
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
],
|
|
81
|
+
"collection": [
|
|
82
|
+
{
|
|
83
|
+
"href": "http://localhost:8888/wp-json/wp/v2/media"
|
|
84
|
+
}
|
|
85
|
+
],
|
|
86
|
+
"about": [
|
|
87
|
+
{
|
|
88
|
+
"href": "http://localhost:8888/wp-json/wp/v2/types/attachment"
|
|
89
|
+
}
|
|
90
|
+
],
|
|
91
|
+
"author": [
|
|
92
|
+
{
|
|
93
|
+
"embeddable": true,
|
|
94
|
+
"href": "http://localhost:8888/wp-json/wp/v2/users/1"
|
|
95
|
+
}
|
|
96
|
+
],
|
|
97
|
+
"replies": [
|
|
98
|
+
{
|
|
99
|
+
"embeddable": true,
|
|
100
|
+
"href": "http://localhost:8888/wp-json/wp/v2/comments?post=93"
|
|
101
|
+
}
|
|
102
|
+
],
|
|
103
|
+
"wp:action-unfiltered-html": [
|
|
104
|
+
{
|
|
105
|
+
"href": "http://localhost:8888/wp-json/wp/v2/media/93"
|
|
106
|
+
}
|
|
107
|
+
],
|
|
108
|
+
"wp:action-assign-author": [
|
|
109
|
+
{
|
|
110
|
+
"href": "http://localhost:8888/wp-json/wp/v2/media/93"
|
|
111
|
+
}
|
|
112
|
+
],
|
|
113
|
+
"curies": [
|
|
114
|
+
{
|
|
115
|
+
"name": "wp",
|
|
116
|
+
"href": "https://api.w.org/{rel}",
|
|
117
|
+
"templated": true
|
|
118
|
+
}
|
|
119
|
+
]
|
|
120
|
+
}
|
|
121
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": 95,
|
|
3
|
+
"date": "2025-11-06T05:13:54",
|
|
4
|
+
"date_gmt": "2025-11-06T05:13:54",
|
|
5
|
+
"guid": {
|
|
6
|
+
"rendered": "http://localhost:8888/wp-content/uploads/2025/11/gutenberg-v22-0-0.zip",
|
|
7
|
+
"raw": "http://localhost:8888/wp-content/uploads/2025/11/gutenberg-v22-0-0.zip"
|
|
8
|
+
},
|
|
9
|
+
"modified": "2025-11-06T05:13:54",
|
|
10
|
+
"modified_gmt": "2025-11-06T05:13:54",
|
|
11
|
+
"slug": "gutenberg-v22-0-0",
|
|
12
|
+
"status": "inherit",
|
|
13
|
+
"type": "attachment",
|
|
14
|
+
"link": "http://localhost:8888/gutenberg-v22-0-0/",
|
|
15
|
+
"title": {
|
|
16
|
+
"raw": "gutenberg-v22-0-0",
|
|
17
|
+
"rendered": "gutenberg-v22-0-0"
|
|
18
|
+
},
|
|
19
|
+
"author": 1,
|
|
20
|
+
"featured_media": 0,
|
|
21
|
+
"comment_status": "open",
|
|
22
|
+
"ping_status": "closed",
|
|
23
|
+
"template": "",
|
|
24
|
+
"meta": [],
|
|
25
|
+
"permalink_template": "http://localhost:8888/?attachment_id=95",
|
|
26
|
+
"generated_slug": "gutenberg-v22-0-0",
|
|
27
|
+
"class_list": [
|
|
28
|
+
"post-95",
|
|
29
|
+
"attachment",
|
|
30
|
+
"type-attachment",
|
|
31
|
+
"status-inherit",
|
|
32
|
+
"hentry"
|
|
33
|
+
],
|
|
34
|
+
"description": {
|
|
35
|
+
"raw": "",
|
|
36
|
+
"rendered": "<p class=\"attachment\"><a href='http://localhost:8888/wp-content/uploads/2025/11/gutenberg-v22-0-0.zip'>gutenberg-v22-0-0</a></p>\n"
|
|
37
|
+
},
|
|
38
|
+
"caption": {
|
|
39
|
+
"raw": "",
|
|
40
|
+
"rendered": "<p>gutenberg-v22-0-0</p>\n"
|
|
41
|
+
},
|
|
42
|
+
"alt_text": "",
|
|
43
|
+
"media_type": "file",
|
|
44
|
+
"mime_type": "application/zip",
|
|
45
|
+
"media_details": {
|
|
46
|
+
"filesize": 19988723,
|
|
47
|
+
"sizes": {}
|
|
48
|
+
},
|
|
49
|
+
"post": null,
|
|
50
|
+
"source_url": "http://localhost:8888/wp-content/uploads/2025/11/gutenberg-v22-0-0.zip",
|
|
51
|
+
"missing_image_sizes": [],
|
|
52
|
+
"_links": {
|
|
53
|
+
"self": [
|
|
54
|
+
{
|
|
55
|
+
"href": "http://localhost:8888/wp-json/wp/v2/media/95",
|
|
56
|
+
"targetHints": {
|
|
57
|
+
"allow": [ "GET", "POST", "PUT", "PATCH", "DELETE" ]
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
],
|
|
61
|
+
"collection": [
|
|
62
|
+
{
|
|
63
|
+
"href": "http://localhost:8888/wp-json/wp/v2/media"
|
|
64
|
+
}
|
|
65
|
+
],
|
|
66
|
+
"about": [
|
|
67
|
+
{
|
|
68
|
+
"href": "http://localhost:8888/wp-json/wp/v2/types/attachment"
|
|
69
|
+
}
|
|
70
|
+
],
|
|
71
|
+
"author": [
|
|
72
|
+
{
|
|
73
|
+
"embeddable": true,
|
|
74
|
+
"href": "http://localhost:8888/wp-json/wp/v2/users/1"
|
|
75
|
+
}
|
|
76
|
+
],
|
|
77
|
+
"replies": [
|
|
78
|
+
{
|
|
79
|
+
"embeddable": true,
|
|
80
|
+
"href": "http://localhost:8888/wp-json/wp/v2/comments?post=95"
|
|
81
|
+
}
|
|
82
|
+
],
|
|
83
|
+
"wp:action-unfiltered-html": [
|
|
84
|
+
{
|
|
85
|
+
"href": "http://localhost:8888/wp-json/wp/v2/media/95"
|
|
86
|
+
}
|
|
87
|
+
],
|
|
88
|
+
"wp:action-assign-author": [
|
|
89
|
+
{
|
|
90
|
+
"href": "http://localhost:8888/wp-json/wp/v2/media/95"
|
|
91
|
+
}
|
|
92
|
+
],
|
|
93
|
+
"curies": [
|
|
94
|
+
{
|
|
95
|
+
"name": "wp",
|
|
96
|
+
"href": "https://api.w.org/{rel}",
|
|
97
|
+
"templated": true
|
|
98
|
+
}
|
|
99
|
+
]
|
|
100
|
+
}
|
|
101
|
+
}
|