dc-management-sdk-js
Version:
Amplience Dynamic Content Management SDK
1,294 lines (1,293 loc) • 156 kB
JavaScript
import { DynamicContent } from './DynamicContent';
import { HalMocks } from './hal/utils/HalMock';
/* tslint:disable:object-literal-sort-keys */
/**
* @hidden
*/
export const HUB = {
id: '5b32377e4cedfd01c45036d8',
name: 'anya-finn',
label: 'Anya Finn',
description: 'Content for anyafinn.com',
status: 'ACTIVE',
settings: {
virtualStagingEnvironment: {
hostname: '',
},
previewVirtualStagingEnvironment: {
hostname: '',
},
applications: [],
devices: [
{
name: 'Desktop',
width: 1024,
height: 768,
orientate: false,
},
{
name: 'Tablet',
width: 640,
height: 768,
orientate: false,
},
{
name: 'Mobile',
width: 320,
height: 512,
orientate: false,
},
],
publishing: {
platforms: {
amplience_dam: {
API_KEY: 'KEY',
endpoint: 'Endpoint',
},
},
},
},
createdBy: 'user',
createdDate: '2018-06-26T12:54:22.142Z',
lastModifiedBy: 'user',
lastModifiedDate: '2018-06-26T12:54:22.142Z',
_links: {
self: {
href: 'https://api.amplience.net/v2/content/hubs/5b32377e4cedfd01c45036d8',
},
hub: {
href: 'https://api.amplience.net/v2/content/hubs/5b32377e4cedfd01c45036d8',
},
snapshots: {
href: 'https://api.amplience.net/v2/content/hubs/5b32377e4cedfd01c45036d8/snapshots{?types}{&page,size,sort}',
templated: true,
},
'create-snapshot': {
href: 'https://api.amplience.net/v2/content/hubs/5b32377e4cedfd01c45036d8/snapshots',
},
events: {
href: 'https://api.amplience.net/v2/content/hubs/5b32377e4cedfd01c45036d8/events{?page,size,sort}',
templated: true,
},
'create-event': {
href: 'https://api.amplience.net/v2/content/hubs/5b32377e4cedfd01c45036d8/events',
},
extensions: {
href: 'https://api.amplience.net/v2/content/hubs/5b32377e4cedfd01c45036d8/extensions{?page,size,sort}',
templated: true,
},
'extensions-lite': {
href: 'https://api.amplience.net/v2/content/hubs/5b32377e4cedfd01c45036d8/extensions?show-full=false{&page,size,sort}',
templated: true,
},
'extension-by-name': {
href: 'https://api.amplience.net/v2/content/hubs/5b32377e4cedfd01c45036d8/extensions/{name}',
templated: true,
},
'create-extension': {
href: 'https://api.amplience.net/v2/content/hubs/5b32377e4cedfd01c45036d8/extensions',
},
update: {
href: 'https://api.amplience.net/v2/content/hubs/5b32377e4cedfd01c45036d8',
},
delete: {
href: 'https://api.amplience.net/v2/content/hubs/5b32377e4cedfd01c45036d8',
},
'update-settings': {
href: 'https://api.amplience.net/v2/content/hubs/5b32377e4cedfd01c45036d8/settings',
},
share: {
href: 'https://api.amplience.net/v2/content/hubs/5b32377e4cedfd01c45036d8/share',
},
'content-repositories': {
href: 'https://api.amplience.net/v2/content/hubs/5b32377e4cedfd01c45036d8/content-repositories{?page,size,sort}',
templated: true,
},
'create-content-repository': {
href: 'https://api.amplience.net/v2/content/hubs/5b32377e4cedfd01c45036d8/content-repositories',
},
'register-content-type': {
href: 'https://api.amplience.net/v2/content/hubs/5b32377e4cedfd01c45036d8/content-types',
},
'content-types': {
href: 'https://api.amplience.net/v2/content/hubs/5b32377e4cedfd01c45036d8/content-types{?page,size,sort,status}',
templated: true,
},
'list-content-type-schemas': {
href: 'https://api.amplience.net/v2/content/hubs/5d4aed7dc9e77c00015fa180/content-type-schemas{?page,size,sort}',
templated: true,
},
'create-content-type-schema': {
href: 'https://api.amplience.net/v2/content/hubs/5d4aed7dc9e77c00015fa180/content-type-schemas',
},
'search-content-items': {
href: 'https://api.amplience.net/v2/content/hubs/5b32377e4cedfd01c45036d8/content-items/find?q={query}{&page,size,sort}',
templated: true,
},
'facet-content-items': {
href: 'https://api.amplience.net/v2/content/hubs/5b32377e4cedfd01c45036d8/content-items/facet{?page,projection,query,size,sort}',
templated: true,
},
webhooks: {
href: 'https://api.amplience.net/v2/content/hubs/5b32377e4cedfd01c45036d8/webhooks{?page,size,sort}',
templated: true,
},
'create-webhook': {
href: 'https://api.amplience.net/v2/content/hubs/5b32377e4cedfd01c45036d8/webhooks',
},
'algolia-search-indexes': {
href: 'https://api.amplience.net/v2/content/algolia-search/5b32377e4cedfd01c45036d8/indexes{?parentId,projection,page,size,sort}',
templated: true,
},
'create-algolia-search-index': {
href: 'https://api.amplience.net/v2/content/algolia-search/5b32377e4cedfd01c45036d8/indexes',
},
'workflow-states': {
href: 'https://api.amplience.net/v2/content/hubs/5b32377e4cedfd01c45036d8/workflow-states{?page,size,sort}',
templated: true,
},
'create-workflow-state': {
href: 'https://api.amplience.net/v2/content/hubs/5b32377e4cedfd01c45036d8/workflow-states',
},
'batch-create-snapshots': {
href: 'https://api.amplience.net/v2/content/hubs/5b32377e4cedfd01c45036d8/snapshots/batch',
},
},
};
/**
* @hidden
*/
export const CONTENT_ITEM = {
id: 'a87fd535-fb25-44ee-b687-0db72bbab721',
folderId: '5b3237784cedfd01c4503658',
body: {
_meta: {
name: 'main-banner',
schema: 'http://deliver.bigcontent.io/schema/nested/nested-type.json',
},
},
version: 1,
label: 'Banner Ad Homepage',
status: 'ACTIVE',
createdBy: 'user',
createdDate: '2018-06-26T12:54:16.216Z',
lastModifiedBy: 'user',
lastModifiedDate: '2018-06-26T12:54:16.216Z',
deliveryId: 'a87fd535-fb25-44ee-b687-0db72bbab721',
_links: {
self: {
href: 'https://api.amplience.net/v2/content/content-items/a87fd535-fb25-44ee-b687-0db72bbab721',
},
'content-item': {
href: 'https://api.amplience.net/v2/content/content-items/a87fd535-fb25-44ee-b687-0db72bbab721',
},
publish: {
href: 'https://api.amplience.net/v2/content/content-items/a87fd535-fb25-44ee-b687-0db72bbab721/publish',
},
planned: {
href: 'https://api.amplience.net/v2/content/content-items/a87fd535-fb25-44ee-b687-0db72bbab721/planned{?epoch,time}',
templated: true,
},
update: {
href: 'https://api.amplience.net/v2/content/content-items/a87fd535-fb25-44ee-b687-0db72bbab721',
},
archive: {
href: 'https://api.amplience.net/v2/content/content-items/a87fd535-fb25-44ee-b687-0db72bbab721/archive',
},
unarchive: {
href: 'https://api.amplience.net/v2/content/content-items/a87fd535-fb25-44ee-b687-0db72bbab721/unarchive',
},
delete: {
href: 'https://api.amplience.net/v2/content/content-items/a87fd535-fb25-44ee-b687-0db72bbab721/versions/1',
},
'restore-version': {
href: 'https://api.amplience.net/v2/content/content-items/a87fd535-fb25-44ee-b687-0db72bbab721/restore',
},
'content-repository': {
href: 'https://api.amplience.net/v2/content/content-repositories/5b32377b4cedfd01c4503691',
},
'content-item-version': {
href: 'https://api.amplience.net/v2/content/content-items/a87fd535-fb25-44ee-b687-0db72bbab721/versions{/version}',
templated: true,
},
localizations: {
href: 'https://api.amplience.net/v2/content/content-items/a87fd535-fb25-44ee-b687-0db72bbab721/localizations{?page,size,sort}',
templated: true,
},
'content-item-versions': {
href: 'https://api.amplience.net/v2/content/content-items/a87fd535-fb25-44ee-b687-0db72bbab721/versions{?page,size,sort}',
templated: true,
},
'content-item-history': {
href: 'https://api.amplience.net/v2/content/content-items/a87fd535-fb25-44ee-b687-0db72bbab721/history{?page,size,sort}',
templated: true,
},
copy: {
href: 'https://api.amplience.net/v2/content/content-repositories/{id}/content-items?sourceContentItemId=a87fd535-fb25-44ee-b687-0db72bbab721',
templated: true,
},
folder: {
href: 'https://api.amplience.net/v2/content/folders/5b3237784cedfd01c4503658',
},
'content-item-with-children': {
href: 'https://api.amplience.net/v2/content/content-items/search/findByIdWithChildren?id=a87fd535-fb25-44ee-b687-0db72bbab721',
},
'set-locale': {
href: 'https://api.amplience.net/v2/content/content-items/a87fd535-fb25-44ee-b687-0db72bbab721/locale',
},
'edit-workflow': {
href: 'https://api.amplience.net/v2/content/content-items/a87fd535-fb25-44ee-b687-0db72bbab721/workflow',
},
},
};
/**
* @hidden
*/
export const CONTENT_ITEM_V2 = { ...CONTENT_ITEM };
CONTENT_ITEM_V2.version++;
/**
* @hidden
*/
export const CONTENT_ITEM_WITH_LOCALE = {
id: 'a87fd535-fb25-44ee-b687-0db72bbab721',
folderId: '5b3237784cedfd01c4503658',
body: {
_meta: {
name: 'main-banner',
schema: 'http://deliver.bigcontent.io/schema/nested/nested-type.json',
},
},
version: 1,
label: 'Banner Ad Homepage',
status: 'ACTIVE',
locale: 'en-GB',
createdBy: 'user',
createdDate: '2018-06-26T12:54:16.216Z',
lastModifiedBy: 'user',
lastModifiedDate: '2018-06-26T12:54:16.216Z',
deliveryId: 'a87fd535-fb25-44ee-b687-0db72bbab721',
_links: {
self: {
href: 'https://api.amplience.net/v2/content/content-items/a87fd535-fb25-44ee-b687-0db72bbab721',
},
'content-item': {
href: 'https://api.amplience.net/v2/content/content-items/a87fd535-fb25-44ee-b687-0db72bbab721',
},
publish: {
href: 'https://api.amplience.net/v2/content/content-items/a87fd535-fb25-44ee-b687-0db72bbab721/publish',
},
planned: {
href: 'https://api.amplience.net/v2/content/content-items/a87fd535-fb25-44ee-b687-0db72bbab721/planned{?epoch,time}',
templated: true,
},
update: {
href: 'https://api.amplience.net/v2/content/content-items/a87fd535-fb25-44ee-b687-0db72bbab721',
},
archive: {
href: 'https://api.amplience.net/v2/content/content-items/a87fd535-fb25-44ee-b687-0db72bbab721/archive',
},
unarchive: {
href: 'https://api.amplience.net/v2/content/content-items/a87fd535-fb25-44ee-b687-0db72bbab721/unarchive',
},
delete: {
href: 'https://api.amplience.net/v2/content/content-items/a87fd535-fb25-44ee-b687-0db72bbab721/versions/1',
},
'restore-version': {
href: 'https://api.amplience.net/v2/content/content-items/a87fd535-fb25-44ee-b687-0db72bbab721/restore',
},
'content-repository': {
href: 'https://api.amplience.net/v2/content/content-repositories/5b32377b4cedfd01c4503691',
},
'content-item-version': {
href: 'https://api.amplience.net/v2/content/content-items/a87fd535-fb25-44ee-b687-0db72bbab721/versions{/version}',
templated: true,
},
'content-item-versions': {
href: 'https://api.amplience.net/v2/content/content-items/a87fd535-fb25-44ee-b687-0db72bbab721/versions{?page,size,sort}',
templated: true,
},
'content-item-history': {
href: 'https://api.amplience.net/v2/content/content-items/a87fd535-fb25-44ee-b687-0db72bbab721/history{?page,size,sort}',
templated: true,
},
copy: {
href: 'https://api.amplience.net/v2/content/content-repositories/{id}/content-items?sourceContentItemId=a87fd535-fb25-44ee-b687-0db72bbab721',
templated: true,
},
folder: {
href: 'https://api.amplience.net/v2/content/folders/5b3237784cedfd01c4503658',
},
'content-item-with-children': {
href: 'https://api.amplience.net/v2/content/content-items/search/findByIdWithChildren?id=a87fd535-fb25-44ee-b687-0db72bbab721',
},
'set-locale': {
href: 'https://api.amplience.net/v2/content/content-items/a87fd535-fb25-44ee-b687-0db72bbab721/locale',
},
'create-localizations': {
href: 'http://api.amplience.net/v2/content/content-items/a87fd535-fb25-44ee-b687-0db72bbab721/localize',
},
'edit-workflow': {
href: 'https://api.amplience.net/v2/content/content-items/a87fd535-fb25-44ee-b687-0db72bbab721/workflow',
},
},
};
/**
* @hidden
*/
export const CONTENT_ITEM_WITH_ASSIGNEE = {
id: 'a87fd535-fb25-44ee-b687-0db72bbab722',
folderId: '5b3237784cedfd01c4503658',
body: {
_meta: {
name: 'main-banner',
schema: 'http://deliver.bigcontent.io/schema/nested/nested-type.json',
},
},
version: 1,
label: 'Banner Ad Homepage',
status: 'ACTIVE',
createdBy: 'user',
createdDate: '2018-06-26T12:54:16.216Z',
lastModifiedBy: 'user',
lastModifiedDate: '2018-06-26T12:54:16.216Z',
deliveryId: 'a87fd535-fb25-44ee-b687-0db72bbab722',
assignees: ['28cf43f6-7521-41c8-9892-8716adcc1e4f'],
assignedDate: '2018-06-27T12:54:16.216Z',
_links: {
self: {
href: 'https://api.amplience.net/v2/content/content-items/a87fd535-fb25-44ee-b687-0db72bbab722',
},
'content-item': {
href: 'https://api.amplience.net/v2/content/content-items/a87fd535-fb25-44ee-b687-0db72bbab722',
},
publish: {
href: 'https://api.amplience.net/v2/content/content-items/a87fd535-fb25-44ee-b687-0db72bbab722/publish',
},
planned: {
href: 'https://api.amplience.net/v2/content/content-items/a87fd535-fb25-44ee-b687-0db72bbab722/planned{?epoch,time}',
templated: true,
},
update: {
href: 'https://api.amplience.net/v2/content/content-items/a87fd535-fb25-44ee-b687-0db72bbab722',
},
delete: {
href: 'https://api.amplience.net/v2/content/content-items/a87fd535-fb25-44ee-b687-0db72bbab722/versions/1',
},
'restore-version': {
href: 'https://api.amplience.net/v2/content/content-items/a87fd535-fb25-44ee-b687-0db72bbab722/restore',
},
'content-repository': {
href: 'https://api.amplience.net/v2/content/content-repositories/5b32377b4cedfd01c4503691',
},
'content-item-version': {
href: 'https://api.amplience.net/v2/content/content-items/a87fd535-fb25-44ee-b687-0db72bbab722/versions{/version}',
templated: true,
},
'content-item-versions': {
href: 'https://api.amplience.net/v2/content/content-items/a87fd535-fb25-44ee-b687-0db72bbab722/versions{?page,size,sort}',
templated: true,
},
'content-item-history': {
href: 'https://api.amplience.net/v2/content/content-items/a87fd535-fb25-44ee-b687-0db72bbab722/history{?page,size,sort}',
templated: true,
},
copy: {
href: 'https://api.amplience.net/v2/content/content-repositories/{id}/content-items?sourceContentItemId=a87fd535-fb25-44ee-b687-0db72bbab722',
templated: true,
},
folder: {
href: 'https://api.amplience.net/v2/content/folders/5b3237784cedfd01c4503658',
},
'content-item-with-children': {
href: 'https://api.amplience.net/v2/content/content-items/search/findByIdWithChildren?id=a87fd535-fb25-44ee-b687-0db72bbab722',
},
'set-locale': {
href: 'https://api.amplience.net/v2/content/content-items/a87fd535-fb25-44ee-b687-0db72bbab722/locale',
},
'edit-workflow': {
href: 'https://api.amplience.net/v2/content/content-items/a87fd535-fb25-44ee-b687-0db72bbab721/workflow',
},
},
};
export const FACETED_CONTENT_ITEM = (() => {
const facetedContentItem = {
...CONTENT_ITEM,
schema: CONTENT_ITEM.body._meta.schema,
};
delete facetedContentItem.body;
return facetedContentItem;
})();
export const CONTENT_ITEMS_FACET = {
_embedded: {
'content-items': [FACETED_CONTENT_ITEM],
},
_links: {
first: {
href: 'https://api.amplience.net/v2/content/hubs/5d4aed7dc9e77c00015fa180/content-items/facet?query=status%3A%22ACTIVE%22contentRepositoryId%3A%225d4af2ccc9e77c00015fa183%22sss&sort=relevance&page=0&size=30',
},
last: {
href: 'https://api.amplience.net/v2/content/hubs/5d4aed7dc9e77c00015fa180/content-items/facet?query=status%3A%22ACTIVE%22contentRepositoryId%3A%225d4af2ccc9e77c00015fa183%22sss&sort=relevance&page=0&size=30',
},
self: {
href: 'https://api.amplience.net/v2/content/hubs/5d4aed7dc9e77c00015fa180/content-items/facet?query=status%3A%22ACTIVE%22contentRepositoryId%3A%225d4af2ccc9e77c00015fa183%22sss&sort=relevance&page=0&size=30',
},
},
page: {
size: 30,
totalElements: 0,
totalPages: 0,
number: 0,
},
_facets: {
schema: [
{
_id: 'http://deliver.bigcontent.io/schema/nested/nested-type.json',
count: 0,
},
],
'lastModifiedDate:Last 7 days': [],
root: [
{
_id: '0',
count: 0,
},
],
'lastModifiedDate:Last 60 days': [],
publishingStatus: [],
assignees: [
{
_id: '7078e5e7-d5bf-4015-9add-b75fb6f60537',
count: 0,
},
],
'lastModifiedDate:Last 30 days': [],
'workflow.state': [],
'lastModifiedDate:Last 14 days': [],
locale: [],
'lastModifiedDate:Over 60 days': [],
},
};
/**
* @hidden
*/
export const CONTENT_TYPE_SCHEMA = {
validationLevel: 'CONTENT_TYPE',
body: '{\n\t"$schema": "http://json-schema.org/draft-04/schema#",\n\t"id": "http://example.com/content-type-schema.json",\n\t"title": "Image",\n\t"description": "Image schema",\n\t"allOf": [\n\t\t{\n\t\t\t"$ref": "http://bigcontent.io/cms/schema/v1/core#/definitions/content"\n\t\t}\n\t],\n\t"type": "object",\n\t"properties": {\n\t\t"image": {\n\t\t\t"title": "Image",\n\t\t\t"description": "insert an image",\n\t\t\t"type": "object",\n\t\t\t"anyOf": [\n\t\t\t\t{\n\t\t\t\t\t"$ref": "http://bigcontent.io/cms/schema/v1/core#/definitions/image-link"\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t"altText": {\n\t\t\t"type": "string",\n\t\t\t"minLength": 0,\n\t\t\t"maxLength": 150,\n\t\t\t"title": "Alt text",\n\t\t\t"description": "insert image alt text"\n\t\t}\n\t},\n\t"propertyOrder": [\n\t\t"image",\n\t\t"altText"\n\t],\n\t"required": [\n\t\t"image",\n\t\t"altText"\n\t]\n}',
schemaId: 'http://example.com/content-type-schema.json',
createdBy: 'user',
createdDate: '2018-06-26T12:54:16.216Z',
lastModifiedBy: 'user',
lastModifiedDate: '2018-06-26T12:54:16.216Z',
version: 1,
id: '5d4af55ced6688002869d808',
status: 'ACTIVE',
_links: {
self: {
href: 'https://api.amplience.net/v2/content/content-type-schemas/5d4af55ced6688002869d808',
},
'content-type-schema': {
href: 'https://api.amplience.net/v2/content/content-type-schemas/5d4af55ced6688002869d808',
},
hub: {
href: 'https://api.amplience.net/v2/content/hubs/5d4aed7dc9e77c00015fa180',
},
history: {
href: 'https://api.amplience.net/v2/content/content-type-schemas/5d4af55ced6688002869d808/history',
},
getByVersion: {
href: 'https://api.amplience.net/v2/content/content-type-schemas/5d4af55ced6688002869d808/{version}',
templated: true,
},
update: {
href: 'https://api.amplience.net/v2/content/content-type-schemas/5d4af55ced6688002869d808',
},
archive: {
href: 'https://api.amplience.net/v2/content/content-type-schemas/5d4af55ced6688002869d808/archive',
},
unarchive: {
href: 'https://api.amplience.net/v2/content/content-type-schemas/5d4af55ced6688002869d808/unarchive',
},
restore: {
href: 'https://api.amplience.net/v2/content/content-type-schemas/5d4af55ced6688002869d808/restore',
},
},
};
/**
* @hidden
*/
export const CONTENT_TYPE_SCHEMA_V2 = { ...CONTENT_TYPE_SCHEMA };
CONTENT_TYPE_SCHEMA_V2.version++;
/**
* @hidden
*/
export const CONTENT_REPOSITORY = {
id: '5b32377b4cedfd01c4503691',
name: 'inspiration',
label: 'Inspiration',
status: 'ACTIVE',
features: [],
type: 'CONTENT',
contentTypes: [],
itemLocales: ['en', 'fr'],
_links: {
self: {
href: 'https://api.amplience.net/v2/content/content-repositories/5b32377b4cedfd01c4503691',
},
'content-repository': {
href: 'https://api.amplience.net/v2/content/content-repositories/5b32377b4cedfd01c4503691',
},
update: {
href: 'https://api.amplience.net/v2/content/content-repositories/5b32377b4cedfd01c4503691',
},
delete: {
href: 'https://api.amplience.net/v2/content/content-repositories/5b32377b4cedfd01c4503691',
},
hub: {
href: 'https://api.amplience.net/v2/content/hubs/5b32377b4cedfd01c4503690',
},
'create-content-item': {
href: 'https://api.amplience.net/v2/content/content-repositories/5b32377b4cedfd01c4503691/content-items',
},
'search-content-items': {
href: 'https://api.amplience.net/v2/content/hubs/5b32377b4cedfd01c4503690/content-items/find?q={query}{&page,size,sort}',
templated: true,
},
'content-items': {
href: 'https://api.amplience.net/v2/content/content-repositories/5b32377b4cedfd01c4503691/content-items{?page,size,sort}',
templated: true,
},
share: {
href: 'https://api.amplience.net/v2/content/content-repositories/5b32377b4cedfd01c4503691/share',
},
'assign-content-type': {
href: 'https://api.amplience.net/v2/content/content-repositories/5b32377b4cedfd01c4503691/content-types',
},
'unassign-content-type': {
href: 'https://api.amplience.net/v2/content/content-repositories/5b32377b4cedfd01c4503691/content-types/{id}',
templated: true,
},
folders: {
href: 'https://api.amplience.net/v2/content/content-repositories/5b32377b4cedfd01c4503691/folders{?page,size,sort}',
templated: true,
},
'create-folder': {
href: 'https://api.amplience.net/v2/content/content-repositories/5b32377b4cedfd01c4503691/folders',
},
features: {
href: 'https://api.amplience.net/v2/content/content-repositories/5b32377b4cedfd01c4503691/features?feature={feature}',
templated: true,
},
'update-content-items': {
href: 'https://api.amplience.net/v2/content/content-items',
},
},
};
/**
* @hidden
*/
export const CONTENT_REPOSITORY_SLOTS = {
id: '5b32377b4cedfd01c4503691',
name: 'slots',
label: 'Slots',
status: 'ACTIVE',
features: ['slots'],
type: 'CONTENT',
contentTypes: [],
itemLocales: ['en', 'fr'],
_links: {
self: {
href: 'https://api.amplience.net/v2/content/content-repositories/5b32377b4cedfd01c4503692',
},
'content-repository': {
href: 'https://api.amplience.net/v2/content/content-repositories/5b32377b4cedfd01c4503692',
},
update: {
href: 'https://api.amplience.net/v2/content/content-repositories/5b32377b4cedfd01c4503692',
},
delete: {
href: 'https://api.amplience.net/v2/content/content-repositories/5b32377b4cedfd01c4503692',
},
hub: {
href: 'https://api.amplience.net/v2/content/hubs/5b32377b4cedfd01c4503690',
},
'create-content-item': {
href: 'https://api.amplience.net/v2/content/content-repositories/5b32377b4cedfd01c4503692/content-items',
},
'search-content-items': {
href: 'https://api.amplience.net/v2/content/hubs/5b32377b4cedfd01c4503690/content-items/find?q={query}{&page,size,sort}',
templated: true,
},
'content-items': {
href: 'https://api.amplience.net/v2/content/content-repositories/5b32377b4cedfd01c4503692/content-items{?page,size,sort}',
templated: true,
},
share: {
href: 'https://api.amplience.net/v2/content/content-repositories/5b32377b4cedfd01c4503691/share',
},
'assign-content-type': {
href: 'https://api.amplience.net/v2/content/content-repositories/5b32377b4cedfd01c4503692/content-types',
},
'unassign-content-type': {
href: 'https://api.amplience.net/v2/content/content-repositories/5b32377b4cedfd01c4503692/content-types/{id}',
templated: true,
},
folders: {
href: 'https://api.amplience.net/v2/content/content-repositories/5b32377b4cedfd01c4503692/folders{?page,size,sort}',
templated: true,
},
'create-folder': {
href: 'https://api.amplience.net/v2/content/content-repositories/5b32377b4cedfd01c4503692/folders',
},
features: {
href: 'https://api.amplience.net/v2/content/content-repositories/5b32377b4cedfd01c4503692/features?feature={feature}',
templated: true,
},
'update-content-items': {
href: 'https://api.amplience.net/v2/content/content-items',
},
},
};
/**
* @hidden
*/
export const EVENT = {
id: '5b32379e4cedfd01c4504171',
name: 'January Sale',
comment: 'This is an event.',
start: '2017-01-01T00:00:00.000Z',
end: '2017-01-01T23:59:59.000Z',
brief: 'http://external.doc/mybrief',
_links: {
self: {
href: 'https://api.amplience.net/v2/content/events/5b32379e4cedfd01c4504171',
},
event: {
href: 'https://api.amplience.net/v2/content/events/5b32379e4cedfd01c4504171',
},
update: {
href: 'https://api.amplience.net/v2/content/events/5b32379e4cedfd01c4504171',
},
delete: {
href: 'https://api.amplience.net/v2/content/events/5b32379e4cedfd01c4504171',
},
archive: {
href: 'https://api.amplience.net/v2/content/events/5b32379e4cedfd01c4504171/archive',
},
hub: {
href: 'https://api.amplience.net/v2/content/hubs/5b32379e4cedfd01c4504170',
},
editions: {
href: 'https://api.amplience.net/v2/content/events/5b32379e4cedfd01c4504171/editions{?page,size,sort}',
templated: true,
},
'create-edition': {
href: 'https://api.amplience.net/v2/content/events/5b32379e4cedfd01c4504171/editions{?sourceEditionId}',
templated: true,
},
},
};
/**
* @hidden
*/
export const EVENT_V2 = { ...EVENT };
EVENT_V2.comment = 'updated';
/**
* @hidden
*/
export const EDITION = {
id: '5b32379e4cedfd01c4504172',
name: 'January Sale',
comment: 'This is an example edition.',
start: '2017-01-01T00:00:00.000Z',
end: '2017-01-01T23:59:59.000Z',
eventId: '5b32379e4cedfd01c4504171',
publishingStatus: 'DRAFT',
slotsRemaining: 200,
schedulingErrors: null,
activeEndDate: false,
publishingJobId: null,
statusUpdated: '2018-06-26T12:54:54.922Z',
schedulingUser: null,
createdBy: 'user',
createdDate: '2017-06-05T04:03:02.000Z',
lastModifiedBy: 'user',
lastModifiedDate: '2017-06-05T04:03:02.000Z',
stagedDate: null,
_links: {
self: {
href: 'https://api.amplience.net/v2/content/editions/5b32379e4cedfd01c4504172',
},
edition: {
href: 'https://api.amplience.net/v2/content/editions/5b32379e4cedfd01c4504172',
},
'create-preview': {
href: 'https://api.amplience.net/v2/content/editions/5b32379e4cedfd01c4504172/preview',
},
preview: {
href: 'https://api.amplience.net/v2/content/editions/5b32379e4cedfd01c4504172/preview',
},
schedule: {
href: 'https://api.amplience.net/v2/content/editions/5b32379e4cedfd01c4504172/schedule{?ignoreWarnings}',
templated: true,
},
update: {
href: 'https://api.amplience.net/v2/content/editions/5b32379e4cedfd01c4504172',
},
delete: {
href: 'https://api.amplience.net/v2/content/editions/5b32379e4cedfd01c4504172',
},
archive: {
href: 'https://api.amplience.net/v2/content/editions/5b32379e4cedfd01c4504172/archive',
},
slots: {
href: 'https://api.amplience.net/v2/content/editions/5b32379e4cedfd01c4504172/slots',
},
'list-slots': {
href: 'https://api.amplience.net/v2/content/editions/5b32379e4cedfd01c4504172/slots{?includedSlots}',
templated: true,
},
event: {
href: 'https://api.amplience.net/v2/content/events/5b32379e4cedfd01c4504171',
},
'edition-conflicts': {
href: 'https://api.amplience.net/v2/content/editions/5b32379e4cedfd01c4504172/conflicts',
},
'edition-conflict': {
href: 'https://api.amplience.net/v2/content/editions/5b32379e4cedfd01c4504172/conflicts/findByIdAndVersion{?id,version}',
templated: true,
},
},
};
/**
* @hidden
*/
export const EDITION_V2 = { ...EDITION };
EDITION_V2.comment = 'updated';
/**
* @hidden
*/
export const EDITION_SCHEDULE_ERROR = {
errors: [
{
level: 'WARNING',
code: 'EDITION_SCHEDULE_OVERLAP',
message: 'Edition Schedule Overlap. Please try again later.',
overlaps: [
{
editionId: '5b32379e4cedfd01c4504172',
name: 'Test schedule edition',
start: '2022-01-07T15:31:47.337Z',
},
],
},
{
level: 'WARNING',
code: 'EDITION_CONTAINS_SLOT_COLLISIONS',
message: 'Edition contains slots that collide with other editions.',
},
],
_links: {},
};
/**
* @hidden
*/
export const EDITION_CONFLICT = { ...EDITION };
EDITION_CONFLICT.id = '5b32379e4cedfd01c4504173';
EDITION_CONFLICT._links = { ...EDITION_CONFLICT._links };
EDITION_CONFLICT._links.self = {
...EDITION_CONFLICT._links.self,
href: 'https://api.amplience.net/v2/content/editions/5b32379e4cedfd01c4504173',
};
EDITION_CONFLICT._links.schedule = {
...EDITION_CONFLICT._links.schedule,
href: 'https://api.amplience.net/v2/content/editions/5b32379e4cedfd01c4504173/schedule{?ignoreWarnings}',
};
/**
* @hidden
*/
export const EDITION_SLOT = {
eventId: '5b32379e4cedfd01c4504171',
editionId: '5b32379e4cedfd01c4504172',
createdDate: '2017-06-05T04:03:04.000Z',
content: {
body: {
_meta: {
schema: 'http://deliver.bigcontent.io/schema/simple-slot-type.json',
name: 'slot',
},
},
updated: 'no',
},
status: 'VALID',
contentTypeId: '5b3237a24cedfd01c45041cf',
slotId: '7aa5f5d4-071c-42e3-b42e-02675c56d60e',
slotLabel: 'Simple Slot',
conflicts: false,
empty: true,
_links: {
self: {
href: 'https://api.amplience.net/v2/content/editions/5b3237a24cedfd01c45041d1/slots/5b3237a24cedfd01c45041d5',
},
'edition-slot': {
href: 'https://api.amplience.net/v2/content/editions/5b3237a24cedfd01c45041d1/slots/5b3237a24cedfd01c45041d5',
},
edition: {
href: 'https://api.amplience.net/v2/content/editions/5b3237a24cedfd01c45041d1',
},
slot: {
href: 'https://api.amplience.net/v2/content/content-items/7aa5f5d4-071c-42e3-b42e-02675c56d60e',
},
content: {
href: 'https://api.amplience.net/v2/content/editions/5b3237a24cedfd01c45041d1/slots/5b3237a24cedfd01c45041d5/content',
},
'safe-update-content': {
href: 'https://api.amplience.net/v2/content/editions/5b3237a24cedfd01c45041d1/slots/5b3237a24cedfd01c45041d5/content{?lastModifiedDate,page,size,sort}',
templated: true,
},
},
};
/**
* @hidden
*/
export const EDITION_SLOT_V2 = { ...EDITION_SLOT };
EDITION_SLOT_V2.content.updated = 'content';
/**
* @hidden
*/
export const EXTENSION = {
id: '5e441cd44cedfd0001889389',
hubId: '5b32377e4cedfd01c45036d8',
name: 'test-extension',
label: 'Test Extension',
description: 'A field for entering and modifying Rich Text, which will be stored as a JSON structure in the content type.',
url: 'https://example.net/index.html',
height: 200,
category: 'CONTENT_FIELD',
parameters: '{}',
snippets: [
{
label: 'Rich Text Editor (JSON)',
body: '{\n "type": "array",\n "ui:extension": {\n "name": "rich-text-block",\n "params": {\n "language": "json"\n }\n }\n}',
},
],
settings: '{"API":{"READ":false,"EDIT":false},"SANDBOX":{"SAME_ORIGIN":false,"MODALS":false,"NAVIGATION":false,"POPUPS":false,"POPUP_ESCAPE_SANDBOX":false,"DOWNLOADS":false,"FORMS":false}}',
status: 'ACTIVE',
createdBy: '4fdd7072-2634-457c-8d34-300e7054fc5b',
createdDate: '2020-02-12T15:42:12.536Z',
lastModifiedBy: 'd12ac106-5f27-4a9b-9544-0ff57c0bfa73',
lastModifiedDate: '2021-03-12T17:11:20.050Z',
_links: {
self: {
href: 'https://api.amplience.net/v2/content/extensions/5e441cd44cedfd0001889389',
},
extension: {
href: 'https://api.amplience.net/v2/content/extensions/5e441cd44cedfd0001889389',
},
hub: {
href: 'https://api.amplience.net/v2/content/hubs/5b32377e4cedfd01c45036d8',
},
update: {
href: 'https://api.amplience.net/v2/content/extensions/5e441cd44cedfd0001889389',
},
delete: {
href: 'https://api.amplience.net/v2/content/extensions/5e441cd44cedfd0001889389',
},
},
};
/**
* @hidden
*/
export const SNAPSHOT = {
id: '5b3237944cedfd01c45038ae',
comment: 'This is an example snapshot.',
createdDate: '2017-06-05T04:03:02Z',
createdBy: 'thor',
type: 'USER',
meta: [],
taggedEditions: [],
rootContentItem: {
label: 'Banner Ad Homepage',
contentTypeUri: 'http://deliver.bigcontent.io/schema/nested/nested-type.json',
},
_links: {
self: {
href: 'https://api.amplience.net/v2/content/snapshots/5b3237944cedfd01c45038ae',
},
snapshot: {
href: 'https://api.amplience.net/v2/content/snapshots/5b3237944cedfd01c45038ae',
},
'publishing-jobs': {
href: 'https://api.amplience.net/v2/content/snapshots/5b3237944cedfd01c45038ae/publishing-jobs{?page,size,sort}',
templated: true,
},
'create-publishing-job': {
href: 'https://api.amplience.net/v2/content/snapshots/5b3237944cedfd01c45038ae/publishing-jobs',
},
'edition-links': {
href: 'https://api.amplience.net/v2/content/snapshots/5b3237944cedfd01c45038ae/edition-links',
},
hub: {
href: 'https://api.amplience.net/v2/content/hubs/5b3237944cedfd01c45038a8',
},
'content-root': {
href: 'https://api.amplience.net/v2/content/content-items/e7a3d579-11fa-4f5e-b580-8f41c96382bf',
},
'snapshot-content-item': {
href: 'https://api.amplience.net/v2/content/snapshots/5b3237944cedfd01c45038ae/content-items{/id}',
templated: true,
},
},
};
/**
* @hidden
*/
export const SNAPSHOT_RESULTS = {
hubId: '5b32377e4cedfd01c45036d8',
snapshots: [SNAPSHOT],
_links: {},
};
/**
* @hidden
*/
export const LOCALIZATION_JOB = {
status: 'IN_PROGRESS',
rootContentItem: {
label: 'Text Content Item',
locale: 'en-GB',
id: 'a87fd535-fb25-44ee-b687-0db72bbab721',
},
requestedLocales: ['fr-FR'],
createdBy: 'user',
createdDate: '2018-10-23T21:46:06.169Z',
_links: {
'content-root': {
href: 'https://api.amplience.net/v2/content/content-items/a87fd535-fb25-44ee-b687-0db72bbab721',
},
findByRootContentItem: {
href: 'https://api.amplience.net/v2/content/localization-jobs/search/findByRootContentItem?id=a87fd535-fb25-44ee-b687-0db72bbab721{&page,size,sort}',
templated: true,
},
},
};
/**
* @hidden
*/
export const FOLDER = {
id: '5b72ed68d6018001c81ef05b',
name: 'A folder to end all folders',
_links: {
self: {
href: 'https://api.amplience.net/v2/content/folders/5b72ed68d6018001c81ef05b',
},
folder: {
href: 'https://api.amplience.net/v2/content/folders/5b72ed68d6018001c81ef05b',
},
folders: {
href: 'https://api.amplience.net/v2/content/folders/5b72ed68d6018001c81ef05b/folders',
},
'content-repository': {
href: 'https://api.amplience.net/v2/content/content-repositories/5b72ed67d6018001c81ef05a',
},
'content-items': {
href: 'https://api.amplience.net/v2/content/content-repositories/5b72ed67d6018001c81ef05a/content-items?folderId=5b72ed68d6018001c81ef05b',
},
'create-folder': {
href: 'https://api.amplience.net/v2/content/folders/5b72ed68d6018001c81ef05b/folders',
},
'delete-folder': {
href: 'https://api.amplience.net/v2/content/folders/5b72ed68d6018001c81ef05b',
},
'update-folder': {
href: 'https://api.amplience.net/v2/content/folders/5b72ed68d6018001c81ef05b',
},
},
};
/**
* @hidden
*/
export const NEW_FOLDER = {
id: '5b72ed68d6018001c81ef05c',
name: 'Another Folder',
_links: {
self: {
href: 'https://api.amplience.net/v2/content/folders/5b72ed68d6018001c81ef05c',
},
folder: {
href: 'https://api.amplience.net/v2/content/folders/5b72ed68d6018001c81ef05c',
},
folders: {
href: 'https://api.amplience.net/v2/content/folders/5b72ed68d6018001c81ef05c/folders',
},
'content-repository': {
href: 'https://api.amplience.net/v2/content/content-repositories/5b72ed67d6018001c81ef05a',
},
'content-items': {
href: 'https://api.amplience.net/v2/content/content-repositories/5b72ed67d6018001c81ef05a/content-items?folderId=5b72ed68d6018001c81ef05c',
},
'create-folder': {
href: 'https://api.amplience.net/v2/content/folders/5b72ed68d6018001c81ef05c/folders',
},
'delete-folder': {
href: 'https://api.amplience.net/v2/content/folders/5b72ed68d6018001c81ef05c',
},
'update-folder': {
href: 'https://api.amplience.net/v2/content/folders/5b72ed68d6018001c81ef05c',
},
},
};
/**
* @hidden
*/
export const SEARCH_INDEX = {
id: '00112233445566778899aabb',
replicaCount: 0,
name: 'anya-finn.my-index',
suffix: 'my-index',
label: 'My Index',
type: 'PRODUCTION',
createdDate: '2019-01-01T00:00:00.000Z',
lastModifiedDate: '2019-01-01T00:00:00.000Z',
_links: {
self: {
href: 'https://api.amplience.net/v2/content/algolia-search/5b32377e4cedfd01c45036d8/indexes/00112233445566778899aabb',
},
index: {
href: 'https://api.amplience.net/v2/content/algolia-search/5b32377e4cedfd01c45036d8/indexes{/id}',
templated: true,
},
'hub-search-key': {
href: 'https://api.amplience.net/v2/content/algolia-search/5b32377e4cedfd01c45036d8/indexes/00112233445566778899aabb/keys/00112233445566778899aabb',
},
update: {
href: 'https://api.amplience.net/v2/content/algolia-search/5b32377e4cedfd01c45036d8/indexes/00112233445566778899aabb',
},
delete: {
href: 'https://api.amplience.net/v2/content/algolia-search/5b32377e4cedfd01c45036d8/indexes/00112233445566778899aabb',
},
'list-replicas': {
href: 'https://api.amplience.net/v2/content/algolia-search/5b32377e4cedfd01c45036d8/indexes?parentId=00112233445566778899aabb{&projection,page,size,sort}',
templated: true,
},
hub: {
href: 'https://api.amplience.net/v2/content/hubs/5b32377e4cedfd01c45036d8',
},
settings: {
href: 'https://api.amplience.net/v2/content/algolia-search/5b32377e4cedfd01c45036d8/indexes/00112233445566778899aabb/settings',
},
'update-settings': {
href: 'https://api.amplience.net/v2/content/algolia-search/5b32377e4cedfd01c45036d8/indexes/00112233445566778899aabb/settings{?forwardToReplicas}',
templated: true,
},
'assigned-content-types': {
href: 'https://api.amplience.net/v2/content/algolia-search/5b32377e4cedfd01c45036d8/indexes/00112233445566778899aabb/assigned-content-types',
},
'create-assigned-content-types': {
href: 'https://api.amplience.net/v2/content/algolia-search/5b32377e4cedfd01c45036d8/indexes/00112233445566778899aabb/assigned-content-types',
},
clear: {
href: 'https://api.amplience.net/v2/content/algolia-search/5b32377e4cedfd01c45036d8/indexes/00112233445566778899aabb/clear',
},
stats: {
href: 'https://api.amplience.net/v2/content/algolia-search/5b32377e4cedfd01c45036d8/indexes/00112233445566778899aabb/stats{?period}',
templated: true,
},
'top-searches': {
href: 'https://api.amplience.net/v2/content/algolia-search/00112233445566778899aabb/indexes/00112233445566778899aabb/analytics/top-searches{?clickAnalytics,orderBy,direction,startDate,endDate,limit,offset,tags,includeReplicas}',
templated: true,
},
'top-hits': {
href: 'https://api.amplience.net/v2/content/algolia-search/00112233445566778899aabb/indexes/00112233445566778899aabb/analytics/top-hits{?search,startDate,endDate,limit,offset,tags}',
templated: true,
},
'searches-with-no-results': {
href: 'https://api.amplience.net/v2/content/algolia-search/00112233445566778899aabb/indexes/00112233445566778899aabb/analytics/searches-with-no-results{?startDate,endDate,limit,offset,tags}',
templated: true,
},
'top-filters-no-result-search': {
href: 'https://api.amplience.net/v2/content/algolia-search/00112233445566778899aabb/indexes/00112233445566778899aabb/analytics/top-filters-no-result-search{?search,startDate,endDate,limit,offset,tags}',
templated: true,
},
'users-count': {
href: 'https://api.amplience.net/v2/content/algolia-search/00112233445566778899aabb/indexes/00112233445566778899aabb/analytics/users-count{?startDate,endDate,tags,includeReplicas}',
templated: true,
},
'searches-count': {
href: 'https://api.amplience.net/v2/content/algolia-search/00112233445566778899aabb/indexes/00112233445566778899aabb/analytics/searches-count{?startDate,endDate,tags,includeReplicas}',
templated: true,
},
'no-results-rate': {
href: 'https://api.amplience.net/v2/content/algolia-search/00112233445566778899aabb/indexes/00112233445566778899aabb/analytics/no-results-rate{?startDate,endDate,tags,includeReplicas}',
templated: true,
},
},
};
/**
* @hidden
*/
export const SEARCH_INDEX_UPDATED = { ...SEARCH_INDEX, label: 'Updated Label' };
/**
* @hidden
*/
export const SEARCH_INDEX_REPLICA = {
...SEARCH_INDEX,
id: '00112233445566778899aabc',
parentId: '00112233445566778899aabb',
label: 'replica one',
};
/**
* @hidden
*/
export const SEARCH_INDEX_SETTINGS = {
replicas: ['replica one'],
_links: {
self: {
href: 'https://api.amplience.net/v2/content/algolia-search/5b32377e4cedfd01c45036d8/indexes/00112233445566778899aabb/settings',
},
hub: {
href: 'https://api.amplience.net/v2/content/hubs/5b32377e4cedfd01c45036d8',
},
settings: {
href: 'https://api.amplience.net/v2/content/algolia-search/5b32377e4cedfd01c45036d8/indexes/00112233445566778899aabb/settings',
templated: true,
},
index: {
href: 'https://api.amplience.net/v2/content/algolia-search/5b32377e4cedfd01c45036d8/indexes/00112233445566778899aabb',
},
},
};
/**
* @hidden
*/
export const SEARCH_INDEX_TOP_SEARCHES = {
search: 'q0',
count: 1,
nbHits: 1,
};
/**
* @hidden
*/
export const SEARCH_INDEX_TOP_HITS = {
hit: 'ObjectID',
count: 123,
};
/**
* @hidden
*/
export const SEARCH_INDEX_SEARCHES_WITH_NO_RESULTS = {
search: 'q0',
count: 3,
withFilterCount: 10,
};
/**
* @hidden
*/
export const SEARCH_INDEX_TOP_FILTER_NO_RESULT_SEARCH = {
count: 3,
values: [
{
attribute: 'brand',
operator: ':',
value: 'apple',
},
],
};
/**
* @hidden
*/
export const SEARCH_INDEX_USERS_COUNT = {
count: 1,
dates: [
{
count: 1,
date: '2020-08-01',
},
],
_links: {
self: {
href: 'https://api.amplience.net/v2/content/algolia-search/5b32377e4cedfd01c45036d8/indexes/00112233445566778899aabb/analytics/users-count',
},
hub: {
href: 'https://api.amplience.net/v2/content/hubs/5b32377e4cedfd01c45036d8',
},
'users-count': {
href: 'https://api.amplience.net/v2/content/algolia-search/5b32377e4cedfd01c45036d8/indexes/00112233445566778899aabb/analytics/users-count{?startDate,toDate,tags,includeReplicas}',
templated: true,
},
index: {
href: 'https://api.amplience.net/v2/content/algolia-search/5b32377e4cedfd01c45036d8/indexes/00112233445566778899aabb',
},
},
};
/**
* @hidden
*/
export const SEARCH_INDEX_SEARCHES_COUNT = {
count: 3,
dates: [
{
count: 3,
date: '2020-08-01',
},
],
_links: {
self: {
href: 'https://api.amplience.net/v2/content/algolia-search/5b32377e4cedfd01c45036d8/indexes/00112233445566778899aabb/analytics/searches-count',
},
hub: {
href: 'https://api.amplience.net/v2/content/hubs/5b32377e4cedfd01c45036d8',
},
'searches-count': {
href: 'https://api.amplience.net/v2/content/algolia-search/5b32377e4cedfd01c45036d8/indexes/00112233445566778899aabb/analytics/searches-count{?startDate,toDate,tags,includeReplicas}',
templated: true,
},
index: {
href: 'https://api.amplience.net/v2/content/algolia-search/5b32377e4cedfd01c45036d8/indexes/00112233445566778899aabb',
},
},
};
/**
* @hidden
*/
export const SEARCH_INDEX_NO_RESULTS_RATE = {
rate: 0.5,
count: 10,
noResultRate: 5,
dates: [
{
rate: 0.5,
count: 10,
noResultRate: 5,
date: '2020-08-01',
},
],
_links: {
self: {
href: 'https://api.amplience.net/v2/content/algolia-search/5b32377e4cedfd01c45036d8/indexes/00112233445566778899aabb/analytics/no-results-rate',
},
hub: {
href: 'https://api.amplience.net/v2/content/hubs/5b32377e4cedfd01c45036d8',
},
'no-results-rate': {
href: 'https://api.amplience.net/v2/content/algolia-search/5b32377e4cedfd01c45036d8/indexes/00112233445566778899aabb/analytics/no-results-rate{?startDate,toDate,tags,includeReplicas}',
templated: true,
},
index: {
href: 'https://api.amplience.net/v2/content/algolia-search/5b32377e4cedfd01c45036d8/indexes/00112233445566778899aabb',
},
},
};
/**
* @hidden
*/
export const SEARCH_INDEX_SETTINGS_UPDATED = {
...SEARCH_INDEX_SETTINGS,
hitsPerPage: 25,
};
/**
* @hidden
*/
export const SEARCH_INDEX_STATISTICS = {
totalRecords: 4,
totalRecordSize: 256,
averageRecordSize: 64,
usage: {