-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Adds codename & collection support for assets (fixes #122)
- Loading branch information
Showing
12 changed files
with
196 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,43 @@ | ||
{ | ||
"id": "fcbb12e6-66a3-4672-85d9-d502d16b8d9c", | ||
"file_name": "which-brewing-fits-you-1080px.jpg", | ||
"title": "Coffee Brewing Techniques", | ||
"size": 125770, | ||
"file_name": "file_name.jpeg", | ||
"title": "Description of what the file contains", | ||
"size": 148636, | ||
"type": "image/jpeg", | ||
"image_width": 1000, | ||
"image_height": 666, | ||
"url": "https://assets-us-01.kc-usercontent.com/8d20758c-d74c-4f59-ae04-ee928c0816b7/adf26cd2-1acb-403f-9d1e-6d04e46c39f1/file_name.png", | ||
"image_width": 1280, | ||
"image_height": 548, | ||
"file_reference": { | ||
"id": "fcbb12e6-66a3-4672-85d9-d502d16b8d9c", | ||
"type": "internal" | ||
"id": "fcbb12e6-66a3-4672-85d9-d502d16b8d9c", | ||
"type": "internal" | ||
}, | ||
"folder": { | ||
"id": "8fe4ff47-0ca8-449d-bc63-c280efee44ea" | ||
}, | ||
"descriptions": [ | ||
{ | ||
"language": { | ||
"id": "00000000-0000-0000-0000-000000000000" | ||
}, | ||
"description": "Coffee Brewing Techniques" | ||
}, | ||
{ | ||
"language": { | ||
"id": "d1f95fde-af02-b3b5-bd9e-f232311ccab8" | ||
}, | ||
"description": "Técnicas para hacer café" | ||
} | ||
{ | ||
"language": { | ||
"id": "00000000-0000-0000-0000-000000000000" | ||
}, | ||
"description": "The asset's alt text in the default language describing what the file or image shows." | ||
} | ||
], | ||
"elements": [ | ||
{ | ||
"element": { | ||
"id": "c7c3b834-2222-5677-89c4-b46f04489109" | ||
}, | ||
"value": [ | ||
{ | ||
"id": "53a5eecb-f295-59b4-a07d-19655b6ad860" | ||
}, | ||
{ | ||
"id": "3f367e4f-75b7-4b48-be3b-1136bbaf1f53" | ||
} | ||
] | ||
} | ||
], | ||
"external_id": "which-brewing-fits-you", | ||
"codename": "xcodename", | ||
"external_id": "custom-asset-identifier", | ||
"last_modified": "2017-09-12T08:29:36.1645977Z" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,56 @@ | ||
{ | ||
"assets": [ | ||
{ | ||
"descriptions": [ | ||
{ | ||
"language": { | ||
"id": "00000000-0000-0000-0000-000000000000" | ||
{ | ||
"descriptions": [ | ||
{ | ||
"language": { | ||
"id": "00000000-0000-0000-0000-000000000000" | ||
}, | ||
"description": "The asset's alt text for the default language." | ||
} | ||
], | ||
"elements": [ | ||
{ | ||
"element": { | ||
"id": "c7c3b834-2222-5677-89c4-b46f04489109" | ||
}, | ||
"value": [ | ||
{ | ||
"id": "53a5eecb-f295-59b4-a07d-19655b6ad860" | ||
}, | ||
{ | ||
"id": "3f367e4f-75b7-4b48-be3b-1136bbaf1f53" | ||
} | ||
] | ||
} | ||
], | ||
"external_id": "custom-asset-identifier", | ||
"file_name": "file_name.png", | ||
"file_reference": { | ||
"id": "806ec84e-7c71-4856-9519-ee3dd3558583", | ||
"type": "internal" | ||
}, | ||
"description": "Alt text in default language for the asset." | ||
} | ||
], | ||
"external_id": "which-brewing-fits-you", | ||
"file_name": "which-brewing-fits-you-1080px.jpg", | ||
"file_reference": { | ||
"id": "806ec84e-7c71-4856-9519-ee3dd3558583", | ||
"type": "internal" | ||
}, | ||
"folder": { | ||
"id": "8fe4ff47-0ca8-449d-bc63-c280efee44ea" | ||
}, | ||
"id": "fcbb12e6-66a3-4672-85d9-d502d16b8d9c", | ||
"image_height": 666, | ||
"image_width": 1000, | ||
"last_modified": "2019-09-12T08:29:36.1645977Z", | ||
"size": 125770, | ||
"title": "Coffee brewing techniques", | ||
"type": "image/jpeg", | ||
"url": "https://assets-us-01.kc-usercontent.com/975bf280-fd91-488c-994c-2f04416e5ee3/fcbb12e6-66a3-4672-85d9-d502d16b8d9c/which-brewing-fits-you-1080px.jpg" | ||
} | ||
"folder": { | ||
"id": "8fe4ff47-0ca8-449d-bc63-c280efee44ea" | ||
}, | ||
"collection": { | ||
"reference": { | ||
"codename": "first_collection" | ||
} | ||
}, | ||
"id": "fcbb12e6-66a3-4672-85d9-d502d16b8d9c", | ||
"codename": "my_asset", | ||
"image_height": 548, | ||
"image_width": 1280, | ||
"last_modified": "2019-09-12T08:29:36.1645977Z", | ||
"size": 148636, | ||
"title": "Makes the asset easier to find when you need it", | ||
"type": "image/png", | ||
"url": "https://assets-us-01.kc-usercontent.com/8d20758c-d74c-4f59-ae04-ee928c0816b7/806ec84e-7c71-4856-9519-ee3dd3558583/file_name.png" | ||
} | ||
], | ||
"pagination": { | ||
"continuation_token": "+RID:~...", | ||
"next_page": "https://manage.kontent.ai/v2/projects/<project_id>/<resource>?continuationToken=%2bRID%3a~..." | ||
"continuation_token": "W3sidG9rZW4iOiIrUklEOn...", | ||
"next_page": "https://manage.kontent.ai/v2/your/chosen/list/endpoint" | ||
} | ||
} | ||
} |
75 changes: 46 additions & 29 deletions
75
test/browser/fake-responses/assets/fake-upsert-asset.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,49 @@ | ||
{ | ||
"id": "fcbb12e6-66a3-4672-85d9-d502d16b8d9c", | ||
"file_name": "which-brewing-fits-you-1080px.jpg", | ||
"title": "Coffee Brewing Techniques", | ||
"size": 125770, | ||
"type": "image/jpeg", | ||
"folder": { | ||
"external_id": "another-folder" | ||
}, | ||
"image_width": 1000, | ||
"image_height": 666, | ||
"file_reference": { | ||
"id": "fcbb12e6-66a3-4672-85d9-d502d16b8d9c", | ||
"type": "internal" | ||
}, | ||
"descriptions": [ | ||
{ | ||
"language": { | ||
"id": "00000000-0000-0000-0000-000000000000" | ||
}, | ||
"description": "Coffee Brewing Techniques" | ||
"folder": { | ||
"id": "4033071a-5bc1-48da-8342-d129bb967d1d" | ||
}, | ||
{ | ||
"language": { | ||
"id": "d1f95fde-af02-b3b5-bd9e-f232311ccab8" | ||
}, | ||
"description": "Técnicas para hacer café" | ||
} | ||
], | ||
"external_id": "which-brewing-fits-you", | ||
"last_modified": "2017-09-12T08:29:36.1645977Z" | ||
} | ||
"file_name": "which-brewing-fits-you-1080px.jpg", | ||
"title": "Coffee Brewing Techniques", | ||
"size": 125770, | ||
"type": "image/jpeg", | ||
"url": "https://assets-us-01.kc-usercontent.com/975bf280-fd91-488c-994c-2f04416e5ee3/fcbb12e6-66a3-4672-85d9-d502d16b8d9c/which-brewing-fits-you-1080px.jpg", | ||
"image_width": 1000, | ||
"image_height": 666, | ||
"file_reference": { | ||
"id": "fcbb12e6-66a3-4672-85d9-d502d16b8d9c", | ||
"type": "internal" | ||
}, | ||
"codename": "xcodename", | ||
"external_id": "xid", | ||
"descriptions": [ | ||
{ | ||
"language": { | ||
"id": "00000000-0000-0000-0000-000000000000" | ||
}, | ||
"description": "Coffee Brewing Techniques" | ||
}, | ||
{ | ||
"language": { | ||
"id": "d1f95fde-af02-b3b5-bd9e-f232311ccab8" | ||
}, | ||
"description": "Técnicas para hacer café" | ||
} | ||
], | ||
"elements": [ | ||
{ | ||
"element": { | ||
"id": "c7c3b834-2222-5677-89c4-b46f04489109" | ||
}, | ||
"value": [ | ||
{ | ||
"id": "53a5eecb-f295-59b4-a07d-19655b6ad860" | ||
}, | ||
{ | ||
"id": "3f367e4f-75b7-4b48-be3b-1136bbaf1f53" | ||
} | ||
] | ||
} | ||
], | ||
"last_modified": "2017-09-12T08:29:36.1645977Z" | ||
} |
Oops, something went wrong.