@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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/entity-types/attachment.ts"],
4
- "sourcesContent": ["/**\n * Internal dependencies\n */\nimport type {\n\tContext,\n\tContextualField,\n\tMediaType,\n\tPostStatus,\n\tRenderedText,\n\tOmitNevers,\n\tCommentingStatus,\n\tPingStatus,\n} from './helpers';\n\nimport type { BaseEntityRecords as _BaseEntityRecords } from './base-entity-records';\n\ninterface MediaDetails {\n\twidth: number;\n\theight: number;\n\tfile: string;\n\tfilesize: number;\n\tsizes: { [ key: string ]: Size };\n\timage_meta: ImageMeta;\n\toriginal_image?: string;\n}\ninterface ImageMeta {\n\taperture: string;\n\tcredit: string;\n\tcamera: string;\n\tcaption: string;\n\tcreated_timestamp: string;\n\tcopyright: string;\n\tfocal_length: string;\n\tiso: string;\n\tshutter_speed: string;\n\ttitle: string;\n\torientation: string;\n\tkeywords: any[];\n}\n\ninterface Size {\n\tfile: string;\n\twidth: number;\n\theight: number;\n\tfilesize?: number;\n\tmime_type: string;\n\tsource_url: string;\n\tuncropped?: boolean;\n}\n\ndeclare module './base-entity-records' {\n\texport namespace BaseEntityRecords {\n\t\texport interface Attachment< C extends Context > {\n\t\t\t/**\n\t\t\t * The date the post was published, in the site's timezone.\n\t\t\t */\n\t\t\tdate: string | null;\n\t\t\t/**\n\t\t\t * The date the post was published, as GMT.\n\t\t\t */\n\t\t\tdate_gmt: ContextualField< string | null, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * The globally unique identifier for the post.\n\t\t\t */\n\t\t\tguid: ContextualField< RenderedText< C >, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * Unique identifier for the post.\n\t\t\t */\n\t\t\tid: number;\n\t\t\t/**\n\t\t\t * URL to the post.\n\t\t\t */\n\t\t\tlink: string;\n\t\t\t/**\n\t\t\t * The date the post was last modified, in the site's timezone.\n\t\t\t */\n\t\t\tmodified: ContextualField< string, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * The date the post was last modified, as GMT.\n\t\t\t */\n\t\t\tmodified_gmt: ContextualField< string, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * An alphanumeric identifier for the post unique to its type.\n\t\t\t */\n\t\t\tslug: string;\n\t\t\t/**\n\t\t\t * A named status for the post.\n\t\t\t */\n\t\t\tstatus: ContextualField< PostStatus, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * Type of post.\n\t\t\t */\n\t\t\ttype: string;\n\t\t\t/**\n\t\t\t * Permalink template for the post.\n\t\t\t */\n\t\t\tpermalink_template: ContextualField< string, 'edit', C >;\n\t\t\t/**\n\t\t\t * Slug automatically generated from the post title.\n\t\t\t */\n\t\t\tgenerated_slug: ContextualField< string, 'edit', C >;\n\t\t\t/**\n\t\t\t * The title for the post.\n\t\t\t */\n\t\t\ttitle: RenderedText< C >;\n\t\t\t/**\n\t\t\t * The ID for the author of the post.\n\t\t\t */\n\t\t\tauthor: number;\n\t\t\t/**\n\t\t\t * Whether or not comments are open on the post.\n\t\t\t */\n\t\t\tcomment_status: ContextualField<\n\t\t\t\tCommentingStatus,\n\t\t\t\t'view' | 'edit',\n\t\t\t\tC\n\t\t\t>;\n\t\t\t/**\n\t\t\t * Whether or not the post can be pinged.\n\t\t\t */\n\t\t\tping_status: ContextualField< PingStatus, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * Meta fields.\n\t\t\t */\n\t\t\tmeta: ContextualField<\n\t\t\t\tRecord< string, unknown >,\n\t\t\t\t'view' | 'edit',\n\t\t\t\tC\n\t\t\t>;\n\t\t\t/**\n\t\t\t * The theme file to use to display the post.\n\t\t\t */\n\t\t\ttemplate: ContextualField< string, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * Alternative text to display when attachment is not displayed.\n\t\t\t */\n\t\t\talt_text: string;\n\t\t\t/**\n\t\t\t * The attachment caption.\n\t\t\t */\n\t\t\tcaption: ContextualField< string, 'edit', C >;\n\t\t\t/**\n\t\t\t * The attachment description.\n\t\t\t */\n\t\t\tdescription: ContextualField<\n\t\t\t\tRenderedText< C >,\n\t\t\t\t'view' | 'edit',\n\t\t\t\tC\n\t\t\t>;\n\t\t\t/**\n\t\t\t * Attachment type.\n\t\t\t */\n\t\t\tmedia_type: MediaType;\n\t\t\t/**\n\t\t\t * The attachment MIME type.\n\t\t\t */\n\t\t\tmime_type: string;\n\t\t\t/**\n\t\t\t * Details about the media file, specific to its type.\n\t\t\t */\n\t\t\tmedia_details: MediaDetails;\n\t\t\t/**\n\t\t\t * The ID for the associated post of the attachment.\n\t\t\t */\n\t\t\tpost: ContextualField< number, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * URL to the original attachment file.\n\t\t\t */\n\t\t\tsource_url: string;\n\t\t\t/**\n\t\t\t * List of the missing image sizes of the attachment.\n\t\t\t */\n\t\t\tmissing_image_sizes: ContextualField< string[], 'edit', C >;\n\t\t}\n\t}\n}\n\nexport type Attachment< C extends Context = 'edit' > = OmitNevers<\n\t_BaseEntityRecords.Attachment< C >\n>;\n"],
4
+ "sourcesContent": ["/**\n * Internal dependencies\n */\nimport type {\n\tContext,\n\tContextualField,\n\tMediaType,\n\tPostStatus,\n\tRenderedText,\n\tOmitNevers,\n\tCommentingStatus,\n\tPingStatus,\n} from './helpers';\n\nimport type { BaseEntityRecords as _BaseEntityRecords } from './base-entity-records';\n\ninterface MediaDetails {\n\twidth?: number;\n\theight?: number;\n\tfile?: string;\n\tfilesize?: number;\n\tsizes: { [ key: string ]: Size };\n\timage_meta?: ImageMeta;\n\toriginal_image?: string;\n\t// Audio/video metadata\n\tbitrate?: number;\n\tmime_type?: string;\n\tlength?: number;\n\tlength_formatted?: string;\n\tfileformat?: string;\n\tdataformat?: string;\n\t// Audio-specific\n\tchannels?: number;\n\tsample_rate?: number;\n\tcodec?: string;\n\tencoder?: string;\n\tlossless?: boolean;\n\tencoder_options?: string;\n\tcompression_ratio?: number;\n\tchannelmode?: string;\n\tbitrate_mode?: string;\n\t// Video-specific\n\taudio?: {\n\t\tdataformat?: string;\n\t\tbitrate?: number;\n\t\tcodec?: string;\n\t\tsample_rate?: number;\n\t\tchannels?: number;\n\t\tbits_per_sample?: number;\n\t\tlossless?: boolean;\n\t\tchannelmode?: string;\n\t\tcompression_ratio?: number;\n\t};\n\tcreated_timestamp?: number;\n\t// Audio metadata fields\n\ttitle?: string;\n\tartist?: string;\n\ttrack_number?: string;\n\talbum?: string;\n\trecording_time?: string;\n\tgenre?: string;\n\tdate?: string;\n\tcomment?: string;\n\tband?: string;\n\tyear?: string;\n\timage?: {\n\t\tmime?: string;\n\t\twidth?: number;\n\t\theight?: number;\n\t};\n}\ninterface ImageMeta {\n\taperture: string;\n\tcredit: string;\n\tcamera: string;\n\tcaption: string;\n\tcreated_timestamp: string;\n\tcopyright: string;\n\tfocal_length: string;\n\tiso: string;\n\tshutter_speed: string;\n\ttitle: string;\n\torientation: string;\n\tkeywords: any[];\n}\n\ninterface Size {\n\tfile: string;\n\twidth: number;\n\theight: number;\n\tfilesize?: number;\n\tmime_type: string;\n\tsource_url: string;\n\tuncropped?: boolean;\n}\n\ndeclare module './base-entity-records' {\n\texport namespace BaseEntityRecords {\n\t\texport interface Attachment< C extends Context > {\n\t\t\t/**\n\t\t\t * The date the post was published, in the site's timezone.\n\t\t\t */\n\t\t\tdate: string | null;\n\t\t\t/**\n\t\t\t * The date the post was published, as GMT.\n\t\t\t */\n\t\t\tdate_gmt: ContextualField< string | null, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * The globally unique identifier for the post.\n\t\t\t */\n\t\t\tguid: ContextualField< RenderedText< C >, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * Unique identifier for the post.\n\t\t\t */\n\t\t\tid: number;\n\t\t\t/**\n\t\t\t * URL to the post.\n\t\t\t */\n\t\t\tlink: string;\n\t\t\t/**\n\t\t\t * The date the post was last modified, in the site's timezone.\n\t\t\t */\n\t\t\tmodified: ContextualField< string, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * The date the post was last modified, as GMT.\n\t\t\t */\n\t\t\tmodified_gmt: ContextualField< string, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * An alphanumeric identifier for the post unique to its type.\n\t\t\t */\n\t\t\tslug: string;\n\t\t\t/**\n\t\t\t * A named status for the post.\n\t\t\t */\n\t\t\tstatus: ContextualField< PostStatus, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * Type of post.\n\t\t\t */\n\t\t\ttype: string;\n\t\t\t/**\n\t\t\t * Permalink template for the post.\n\t\t\t */\n\t\t\tpermalink_template: ContextualField< string, 'edit', C >;\n\t\t\t/**\n\t\t\t * Slug automatically generated from the post title.\n\t\t\t */\n\t\t\tgenerated_slug: ContextualField< string, 'edit', C >;\n\t\t\t/**\n\t\t\t * The title for the post.\n\t\t\t */\n\t\t\ttitle: RenderedText< C >;\n\t\t\t/**\n\t\t\t * The ID for the author of the post.\n\t\t\t */\n\t\t\tauthor: number;\n\t\t\t/**\n\t\t\t * Whether or not comments are open on the post.\n\t\t\t */\n\t\t\tcomment_status: ContextualField<\n\t\t\t\tCommentingStatus,\n\t\t\t\t'view' | 'edit',\n\t\t\t\tC\n\t\t\t>;\n\t\t\t/**\n\t\t\t * Whether or not the post can be pinged.\n\t\t\t */\n\t\t\tping_status: ContextualField< PingStatus, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * Meta fields.\n\t\t\t */\n\t\t\tmeta: ContextualField<\n\t\t\t\tRecord< string, unknown > | [],\n\t\t\t\t'view' | 'edit',\n\t\t\t\tC\n\t\t\t>;\n\t\t\t/**\n\t\t\t * The theme file to use to display the post.\n\t\t\t */\n\t\t\ttemplate: ContextualField< string, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * Alternative text to display when attachment is not displayed.\n\t\t\t */\n\t\t\talt_text: string;\n\t\t\t/**\n\t\t\t * The attachment caption.\n\t\t\t */\n\t\t\tcaption: ContextualField< RenderedText< C >, 'edit', C >;\n\t\t\t/**\n\t\t\t * The attachment description.\n\t\t\t */\n\t\t\tdescription: ContextualField<\n\t\t\t\tRenderedText< C >,\n\t\t\t\t'view' | 'edit',\n\t\t\t\tC\n\t\t\t>;\n\t\t\t/**\n\t\t\t * Attachment type.\n\t\t\t */\n\t\t\tmedia_type: MediaType;\n\t\t\t/**\n\t\t\t * The attachment MIME type.\n\t\t\t */\n\t\t\tmime_type: string;\n\t\t\t/**\n\t\t\t * Details about the media file, specific to its type.\n\t\t\t */\n\t\t\tmedia_details: MediaDetails;\n\t\t\t/**\n\t\t\t * The ID for the associated post of the attachment.\n\t\t\t */\n\t\t\tpost: ContextualField< number | null, 'view' | 'edit', C >;\n\t\t\t/**\n\t\t\t * URL to the original attachment file.\n\t\t\t */\n\t\t\tsource_url: string;\n\t\t\t/**\n\t\t\t * List of the missing image sizes of the attachment.\n\t\t\t */\n\t\t\tmissing_image_sizes: ContextualField< string[], 'edit', C >;\n\t\t\t/**\n\t\t\t * The ID of the featured media of the attachment.\n\t\t\t */\n\t\t\tfeatured_media: number;\n\t\t\t/**\n\t\t\t * An array of class names for the post.\n\t\t\t */\n\t\t\tclass_list: string[];\n\t\t\t/**\n\t\t\t * Links to related resources.\n\t\t\t */\n\t\t\t_links?: Record< string, unknown >;\n\t\t}\n\t}\n}\n\nexport type Attachment< C extends Context = 'edit' > = OmitNevers<\n\t_BaseEntityRecords.Attachment< C >\n>;\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;AAAA;AAAA;",
6
6
  "names": []
7
7
  }
@@ -4,15 +4,57 @@
4
4
  import type { Context, ContextualField, MediaType, PostStatus, RenderedText, OmitNevers, CommentingStatus, PingStatus } from './helpers';
5
5
  import type { BaseEntityRecords as _BaseEntityRecords } from './base-entity-records';
6
6
  interface MediaDetails {
7
- width: number;
8
- height: number;
9
- file: string;
10
- filesize: number;
7
+ width?: number;
8
+ height?: number;
9
+ file?: string;
10
+ filesize?: number;
11
11
  sizes: {
12
12
  [key: string]: Size;
13
13
  };
14
- image_meta: ImageMeta;
14
+ image_meta?: ImageMeta;
15
15
  original_image?: string;
16
+ bitrate?: number;
17
+ mime_type?: string;
18
+ length?: number;
19
+ length_formatted?: string;
20
+ fileformat?: string;
21
+ dataformat?: string;
22
+ channels?: number;
23
+ sample_rate?: number;
24
+ codec?: string;
25
+ encoder?: string;
26
+ lossless?: boolean;
27
+ encoder_options?: string;
28
+ compression_ratio?: number;
29
+ channelmode?: string;
30
+ bitrate_mode?: string;
31
+ audio?: {
32
+ dataformat?: string;
33
+ bitrate?: number;
34
+ codec?: string;
35
+ sample_rate?: number;
36
+ channels?: number;
37
+ bits_per_sample?: number;
38
+ lossless?: boolean;
39
+ channelmode?: string;
40
+ compression_ratio?: number;
41
+ };
42
+ created_timestamp?: number;
43
+ title?: string;
44
+ artist?: string;
45
+ track_number?: string;
46
+ album?: string;
47
+ recording_time?: string;
48
+ genre?: string;
49
+ date?: string;
50
+ comment?: string;
51
+ band?: string;
52
+ year?: string;
53
+ image?: {
54
+ mime?: string;
55
+ width?: number;
56
+ height?: number;
57
+ };
16
58
  }
17
59
  interface ImageMeta {
18
60
  aperture: string;
@@ -107,7 +149,7 @@ declare module './base-entity-records' {
107
149
  /**
108
150
  * Meta fields.
109
151
  */
110
- meta: ContextualField<Record<string, unknown>, 'view' | 'edit', C>;
152
+ meta: ContextualField<Record<string, unknown> | [], 'view' | 'edit', C>;
111
153
  /**
112
154
  * The theme file to use to display the post.
113
155
  */
@@ -119,7 +161,7 @@ declare module './base-entity-records' {
119
161
  /**
120
162
  * The attachment caption.
121
163
  */
122
- caption: ContextualField<string, 'edit', C>;
164
+ caption: ContextualField<RenderedText<C>, 'edit', C>;
123
165
  /**
124
166
  * The attachment description.
125
167
  */
@@ -139,7 +181,7 @@ declare module './base-entity-records' {
139
181
  /**
140
182
  * The ID for the associated post of the attachment.
141
183
  */
142
- post: ContextualField<number, 'view' | 'edit', C>;
184
+ post: ContextualField<number | null, 'view' | 'edit', C>;
143
185
  /**
144
186
  * URL to the original attachment file.
145
187
  */
@@ -148,6 +190,18 @@ declare module './base-entity-records' {
148
190
  * List of the missing image sizes of the attachment.
149
191
  */
150
192
  missing_image_sizes: ContextualField<string[], 'edit', C>;
193
+ /**
194
+ * The ID of the featured media of the attachment.
195
+ */
196
+ featured_media: number;
197
+ /**
198
+ * An array of class names for the post.
199
+ */
200
+ class_list: string[];
201
+ /**
202
+ * Links to related resources.
203
+ */
204
+ _links?: Record<string, unknown>;
151
205
  }
152
206
  }
153
207
  }
@@ -1 +1 @@
1
- {"version":3,"file":"attachment.d.ts","sourceRoot":"","sources":["../../src/entity-types/attachment.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EACX,OAAO,EACP,eAAe,EACf,SAAS,EACT,UAAU,EACV,YAAY,EACZ,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,MAAM,WAAW,CAAC;AAEnB,OAAO,KAAK,EAAE,iBAAiB,IAAI,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAErF,UAAU,YAAY;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE;QAAE,CAAE,GAAG,EAAE,MAAM,GAAI,IAAI,CAAA;KAAE,CAAC;IACjC,UAAU,EAAE,SAAS,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;CACxB;AACD,UAAU,SAAS;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAA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AAC,CAAE,CAAC;YAC3D;;eAEG;YACH,UAAU,EAAE,MAAM,CAAC;YACnB;;eAEG;YACH,mBAAmB,EAAE,eAAe,CAAE,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,CAAE,CAAC;YAC5D;;eAEG;YACH,cAAc,EAAE,MAAM,CAAC;YACvB;;eAEG;YACH,UAAU,EAAE,MAAM,EAAE,CAAC;YACrB;;eAEG;YACH,MAAM,CAAC,EAAE,MAAM,CAAE,MAAM,EAAE,OAAO,CAAE,CAAC;SACnC;KACD;CACD;AAED,MAAM,MAAM,UAAU,CAAE,CAAC,SAAS,OAAO,GAAG,MAAM,IAAK,UAAU,CAChE,kBAAkB,CAAC,UAAU,CAAE,CAAC,CAAE,CAClC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/core-data",
3
- "version": "7.35.0",
3
+ "version": "7.35.1-next.16d95556a.0",
4
4
  "description": "Access to and manipulation of core WordPress entities.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -40,22 +40,22 @@
40
40
  "{src,build,build-module}/index.js"
41
41
  ],
42
42
  "dependencies": {
43
- "@wordpress/api-fetch": "^7.35.0",
44
- "@wordpress/block-editor": "^15.8.0",
45
- "@wordpress/blocks": "^15.8.0",
46
- "@wordpress/compose": "^7.35.0",
47
- "@wordpress/data": "^10.35.0",
48
- "@wordpress/deprecated": "^4.35.0",
49
- "@wordpress/element": "^6.35.0",
50
- "@wordpress/html-entities": "^4.35.0",
51
- "@wordpress/i18n": "^6.8.0",
52
- "@wordpress/is-shallow-equal": "^5.35.0",
53
- "@wordpress/private-apis": "^1.35.0",
54
- "@wordpress/rich-text": "^7.35.0",
55
- "@wordpress/sync": "^1.35.0",
56
- "@wordpress/undo-manager": "^1.35.0",
57
- "@wordpress/url": "^4.35.0",
58
- "@wordpress/warning": "^3.35.0",
43
+ "@wordpress/api-fetch": "^7.35.1-next.16d95556a.0",
44
+ "@wordpress/block-editor": "^15.8.1-next.16d95556a.0",
45
+ "@wordpress/blocks": "^15.8.1-next.16d95556a.0",
46
+ "@wordpress/compose": "^7.35.1-next.16d95556a.0",
47
+ "@wordpress/data": "^10.35.1-next.16d95556a.0",
48
+ "@wordpress/deprecated": "^4.35.1-next.16d95556a.0",
49
+ "@wordpress/element": "^6.35.1-next.16d95556a.0",
50
+ "@wordpress/html-entities": "^4.35.1-next.16d95556a.0",
51
+ "@wordpress/i18n": "^6.8.1-next.16d95556a.0",
52
+ "@wordpress/is-shallow-equal": "^5.35.1-next.16d95556a.0",
53
+ "@wordpress/private-apis": "^1.35.1-next.16d95556a.0",
54
+ "@wordpress/rich-text": "^7.35.1-next.16d95556a.0",
55
+ "@wordpress/sync": "^1.35.1-next.16d95556a.0",
56
+ "@wordpress/undo-manager": "^1.35.1-next.16d95556a.0",
57
+ "@wordpress/url": "^4.35.1-next.16d95556a.0",
58
+ "@wordpress/warning": "^3.35.1-next.16d95556a.0",
59
59
  "change-case": "^4.1.2",
60
60
  "equivalent-key-map": "^0.2.2",
61
61
  "fast-deep-equal": "^3.1.3",
@@ -69,5 +69,5 @@
69
69
  "publishConfig": {
70
70
  "access": "public"
71
71
  },
72
- "gitHead": "77aa1f194edceafe8ac2a1b9438bf84b557e76e3"
72
+ "gitHead": "59a9383612bbe16e21af84d13b035bfbca7fe833"
73
73
  }
@@ -15,13 +15,59 @@ import type {
15
15
  import type { BaseEntityRecords as _BaseEntityRecords } from './base-entity-records';
16
16
 
17
17
  interface MediaDetails {
18
- width: number;
19
- height: number;
20
- file: string;
21
- filesize: number;
18
+ width?: number;
19
+ height?: number;
20
+ file?: string;
21
+ filesize?: number;
22
22
  sizes: { [ key: string ]: Size };
23
- image_meta: ImageMeta;
23
+ image_meta?: ImageMeta;
24
24
  original_image?: string;
25
+ // Audio/video metadata
26
+ bitrate?: number;
27
+ mime_type?: string;
28
+ length?: number;
29
+ length_formatted?: string;
30
+ fileformat?: string;
31
+ dataformat?: string;
32
+ // Audio-specific
33
+ channels?: number;
34
+ sample_rate?: number;
35
+ codec?: string;
36
+ encoder?: string;
37
+ lossless?: boolean;
38
+ encoder_options?: string;
39
+ compression_ratio?: number;
40
+ channelmode?: string;
41
+ bitrate_mode?: string;
42
+ // Video-specific
43
+ audio?: {
44
+ dataformat?: string;
45
+ bitrate?: number;
46
+ codec?: string;
47
+ sample_rate?: number;
48
+ channels?: number;
49
+ bits_per_sample?: number;
50
+ lossless?: boolean;
51
+ channelmode?: string;
52
+ compression_ratio?: number;
53
+ };
54
+ created_timestamp?: number;
55
+ // Audio metadata fields
56
+ title?: string;
57
+ artist?: string;
58
+ track_number?: string;
59
+ album?: string;
60
+ recording_time?: string;
61
+ genre?: string;
62
+ date?: string;
63
+ comment?: string;
64
+ band?: string;
65
+ year?: string;
66
+ image?: {
67
+ mime?: string;
68
+ width?: number;
69
+ height?: number;
70
+ };
25
71
  }
26
72
  interface ImageMeta {
27
73
  aperture: string;
@@ -123,7 +169,7 @@ declare module './base-entity-records' {
123
169
  * Meta fields.
124
170
  */
125
171
  meta: ContextualField<
126
- Record< string, unknown >,
172
+ Record< string, unknown > | [],
127
173
  'view' | 'edit',
128
174
  C
129
175
  >;
@@ -138,7 +184,7 @@ declare module './base-entity-records' {
138
184
  /**
139
185
  * The attachment caption.
140
186
  */
141
- caption: ContextualField< string, 'edit', C >;
187
+ caption: ContextualField< RenderedText< C >, 'edit', C >;
142
188
  /**
143
189
  * The attachment description.
144
190
  */
@@ -162,7 +208,7 @@ declare module './base-entity-records' {
162
208
  /**
163
209
  * The ID for the associated post of the attachment.
164
210
  */
165
- post: ContextualField< number, 'view' | 'edit', C >;
211
+ post: ContextualField< number | null, 'view' | 'edit', C >;
166
212
  /**
167
213
  * URL to the original attachment file.
168
214
  */
@@ -171,6 +217,18 @@ declare module './base-entity-records' {
171
217
  * List of the missing image sizes of the attachment.
172
218
  */
173
219
  missing_image_sizes: ContextualField< string[], 'edit', C >;
220
+ /**
221
+ * The ID of the featured media of the attachment.
222
+ */
223
+ featured_media: number;
224
+ /**
225
+ * An array of class names for the post.
226
+ */
227
+ class_list: string[];
228
+ /**
229
+ * Links to related resources.
230
+ */
231
+ _links?: Record< string, unknown >;
174
232
  }
175
233
  }
176
234
  }
@@ -0,0 +1,96 @@
1
+ /**
2
+ * Tests for the Attachment type against real REST API responses.
3
+ *
4
+ * These tests validate the Attachment type definition by comparing it with
5
+ * real JSON responses from the WordPress REST API's media endpoint. The fixtures
6
+ * are from the REST API's edit context, which includes edit-only fields like
7
+ * permalink_template, generated_slug, and missing_image_sizes.
8
+ */
9
+
10
+ /**
11
+ * Internal dependencies
12
+ */
13
+ import type { Attachment } from '../attachment';
14
+ import imageAttachmentFixture from './fixtures/attachment-image.json';
15
+ import zipAttachmentFixture from './fixtures/attachment-zip.json';
16
+ import audioAttachmentFixture from './fixtures/attachment-audio.json';
17
+ import videoAttachmentFixture from './fixtures/attachment-video.json';
18
+
19
+ describe( 'Attachment type', () => {
20
+ describe( 'Image attachment', () => {
21
+ it( 'should validate against real image attachment from REST API', () => {
22
+ const attachment: Attachment< 'edit' > =
23
+ imageAttachmentFixture as Attachment< 'edit' >;
24
+
25
+ // Edit-context fields
26
+ expect( attachment.permalink_template ).toBeDefined();
27
+ expect( attachment.generated_slug ).toBeDefined();
28
+ expect( attachment.missing_image_sizes ).toBeDefined();
29
+
30
+ // Image-specific properties
31
+ expect( attachment.media_type ).toBe( 'image' );
32
+ expect( attachment.media_details.width ).toBeGreaterThan( 0 );
33
+ expect( attachment.media_details.height ).toBeGreaterThan( 0 );
34
+ expect( attachment.media_details.sizes ).toBeDefined();
35
+ } );
36
+ } );
37
+
38
+ describe( 'Zip file attachment', () => {
39
+ it( 'should validate against real zip file attachment from REST API', () => {
40
+ const attachment: Attachment< 'edit' > =
41
+ zipAttachmentFixture as Attachment< 'edit' >;
42
+
43
+ // Edit-context fields
44
+ expect( attachment.permalink_template ).toBeDefined();
45
+ expect( attachment.generated_slug ).toBeDefined();
46
+
47
+ // File-type properties
48
+ expect( attachment.media_type ).toBe( 'file' );
49
+ expect( attachment.mime_type ).toBe( 'application/zip' );
50
+ expect( attachment.media_details.filesize ).toBeGreaterThan( 0 );
51
+
52
+ // Files don't have dimensions
53
+ expect( attachment.media_details.width ).toBeUndefined();
54
+ expect( attachment.media_details.height ).toBeUndefined();
55
+ } );
56
+ } );
57
+
58
+ describe( 'Audio file attachment', () => {
59
+ it( 'should validate against real audio attachment from REST API', () => {
60
+ const attachment: Attachment< 'edit' > =
61
+ audioAttachmentFixture as Attachment< 'edit' >;
62
+
63
+ // Edit-context fields
64
+ expect( attachment.permalink_template ).toBeDefined();
65
+ expect( attachment.generated_slug ).toBeDefined();
66
+
67
+ // Audio-type properties
68
+ expect( attachment.media_type ).toBe( 'file' );
69
+ expect( attachment.mime_type ).toBe( 'audio/mpeg' );
70
+ expect( attachment.media_details.length ).toBeGreaterThan( 0 );
71
+ expect( attachment.media_details.bitrate ).toBeGreaterThan( 0 );
72
+
73
+ // Audio files don't have dimensions
74
+ expect( attachment.media_details.width ).toBeUndefined();
75
+ expect( attachment.media_details.height ).toBeUndefined();
76
+ } );
77
+ } );
78
+
79
+ describe( 'Video file attachment', () => {
80
+ it( 'should validate against real video attachment from REST API', () => {
81
+ const attachment: Attachment< 'edit' > =
82
+ videoAttachmentFixture as Attachment< 'edit' >;
83
+
84
+ // Edit-context fields
85
+ expect( attachment.permalink_template ).toBeDefined();
86
+ expect( attachment.generated_slug ).toBeDefined();
87
+
88
+ // Video-type properties
89
+ expect( attachment.media_type ).toBe( 'file' );
90
+ expect( attachment.mime_type ).toBe( 'video/mp4' );
91
+ expect( attachment.media_details.width ).toBeGreaterThan( 0 );
92
+ expect( attachment.media_details.height ).toBeGreaterThan( 0 );
93
+ expect( attachment.media_details.length ).toBeGreaterThan( 0 );
94
+ } );
95
+ } );
96
+ } );
@@ -0,0 +1,138 @@
1
+ {
2
+ "id": 125,
3
+ "date": "2025-11-12T23:02:13",
4
+ "date_gmt": "2025-11-12T23:02:13",
5
+ "guid": {
6
+ "rendered": "http://localhost:8888/wp-content/uploads/2025/11/sample.mp3",
7
+ "raw": "http://localhost:8888/wp-content/uploads/2025/11/sample.mp3"
8
+ },
9
+ "modified": "2025-11-12T23:03:26",
10
+ "modified_gmt": "2025-11-12T23:03:26",
11
+ "slug": "sample-audio",
12
+ "status": "inherit",
13
+ "type": "attachment",
14
+ "link": "http://localhost:8888/sample-audio/",
15
+ "title": {
16
+ "raw": "Sample Audio",
17
+ "rendered": "Sample Audio"
18
+ },
19
+ "author": 1,
20
+ "featured_media": 126,
21
+ "comment_status": "open",
22
+ "ping_status": "closed",
23
+ "template": "",
24
+ "meta": [],
25
+ "permalink_template": "http://localhost:8888/?attachment_id=125",
26
+ "generated_slug": "sample-audio",
27
+ "class_list": [
28
+ "post-125",
29
+ "attachment",
30
+ "type-attachment",
31
+ "status-inherit",
32
+ "has-post-thumbnail",
33
+ "hentry"
34
+ ],
35
+ "description": {
36
+ "raw": "Sample audio file",
37
+ "rendered": "<!--[if lt IE 9]><script>document.createElement('audio');</script><![endif]-->\n<audio class=\"wp-audio-shortcode\" id=\"audio-125-1\" preload=\"none\" style=\"width: 100%;\" controls=\"controls\"><source type=\"audio/mpeg\" src=\"http://localhost:8888/wp-content/uploads/2025/11/sample.mp3?_=1\" /><a href=\"http://localhost:8888/wp-content/uploads/2025/11/sample.mp3\">http://localhost:8888/wp-content/uploads/2025/11/sample.mp3</a></audio>\n<p>Sample audio file</p>\n"
38
+ },
39
+ "caption": {
40
+ "raw": "",
41
+ "rendered": "<p>Sample audio file</p>\n"
42
+ },
43
+ "alt_text": "",
44
+ "media_type": "file",
45
+ "mime_type": "audio/mpeg",
46
+ "media_details": {
47
+ "dataformat": "mp3",
48
+ "channels": 2,
49
+ "sample_rate": 44100,
50
+ "bitrate": 320000,
51
+ "channelmode": "joint stereo",
52
+ "bitrate_mode": "cbr",
53
+ "codec": "LAME",
54
+ "encoder": "LAME3.99r",
55
+ "lossless": false,
56
+ "encoder_options": "--preset insane",
57
+ "compression_ratio": 0.22675736961451248,
58
+ "fileformat": "mp3",
59
+ "filesize": 7373059,
60
+ "mime_type": "audio/mpeg",
61
+ "length": 182,
62
+ "length_formatted": "3:02",
63
+ "title": "Sample Audio",
64
+ "artist": "",
65
+ "track_number": "",
66
+ "album": "",
67
+ "recording_time": "2025-11-12T23:02:13",
68
+ "genre": "",
69
+ "date": "2025-11-12 23:02:13",
70
+ "comment": "",
71
+ "band": "",
72
+ "year": "",
73
+ "image": {
74
+ "mime": "image/jpeg",
75
+ "width": 700,
76
+ "height": 700
77
+ },
78
+ "sizes": {}
79
+ },
80
+ "post": null,
81
+ "source_url": "http://localhost:8888/wp-content/uploads/2025/11/sample.mp3",
82
+ "missing_image_sizes": [],
83
+ "_links": {
84
+ "self": [
85
+ {
86
+ "href": "http://localhost:8888/wp-json/wp/v2/media/125",
87
+ "targetHints": {
88
+ "allow": [ "GET", "POST", "PUT", "PATCH", "DELETE" ]
89
+ }
90
+ }
91
+ ],
92
+ "collection": [
93
+ {
94
+ "href": "http://localhost:8888/wp-json/wp/v2/media"
95
+ }
96
+ ],
97
+ "about": [
98
+ {
99
+ "href": "http://localhost:8888/wp-json/wp/v2/types/attachment"
100
+ }
101
+ ],
102
+ "author": [
103
+ {
104
+ "embeddable": true,
105
+ "href": "http://localhost:8888/wp-json/wp/v2/users/1"
106
+ }
107
+ ],
108
+ "replies": [
109
+ {
110
+ "embeddable": true,
111
+ "href": "http://localhost:8888/wp-json/wp/v2/comments?post=125"
112
+ }
113
+ ],
114
+ "wp:featuredmedia": [
115
+ {
116
+ "embeddable": true,
117
+ "href": "http://localhost:8888/wp-json/wp/v2/media/126"
118
+ }
119
+ ],
120
+ "wp:action-unfiltered-html": [
121
+ {
122
+ "href": "http://localhost:8888/wp-json/wp/v2/media/125"
123
+ }
124
+ ],
125
+ "wp:action-assign-author": [
126
+ {
127
+ "href": "http://localhost:8888/wp-json/wp/v2/media/125"
128
+ }
129
+ ],
130
+ "curies": [
131
+ {
132
+ "name": "wp",
133
+ "href": "https://api.w.org/{rel}",
134
+ "templated": true
135
+ }
136
+ ]
137
+ }
138
+ }