@contentstack/datasync-mongodb-sdk 1.0.9-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/codeql-analysis.yml +68 -0
- package/.github/workflows/jira.yml +33 -0
- package/.github/workflows/release.yml +77 -0
- package/.github/workflows/sast-scan.yml +11 -0
- package/.github/workflows/sca-scan.yml +15 -0
- package/.talismanrc +4 -0
- package/CODEOWNERS +1 -0
- package/LICENCE +21 -0
- package/README.md +191 -0
- package/SECURITY.md +27 -0
- package/contentstack-datasync-mongodb-sdk-1.0.9-beta.1.tgz +0 -0
- package/dist/config.js +47 -0
- package/dist/index.js +42 -0
- package/dist/stack.js +2272 -0
- package/dist/util.js +86 -0
- package/docs/fonts/OpenSans-Bold-webfont.eot +0 -0
- package/docs/fonts/OpenSans-Bold-webfont.svg +1830 -0
- package/docs/fonts/OpenSans-Bold-webfont.woff +0 -0
- package/docs/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
- package/docs/fonts/OpenSans-BoldItalic-webfont.svg +1830 -0
- package/docs/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
- package/docs/fonts/OpenSans-Italic-webfont.eot +0 -0
- package/docs/fonts/OpenSans-Italic-webfont.svg +1830 -0
- package/docs/fonts/OpenSans-Italic-webfont.woff +0 -0
- package/docs/fonts/OpenSans-Light-webfont.eot +0 -0
- package/docs/fonts/OpenSans-Light-webfont.svg +1831 -0
- package/docs/fonts/OpenSans-Light-webfont.woff +0 -0
- package/docs/fonts/OpenSans-LightItalic-webfont.eot +0 -0
- package/docs/fonts/OpenSans-LightItalic-webfont.svg +1835 -0
- package/docs/fonts/OpenSans-LightItalic-webfont.woff +0 -0
- package/docs/fonts/OpenSans-Regular-webfont.eot +0 -0
- package/docs/fonts/OpenSans-Regular-webfont.svg +1831 -0
- package/docs/fonts/OpenSans-Regular-webfont.woff +0 -0
- package/docs/global.html +7520 -0
- package/docs/global.html#Stack +1070 -0
- package/docs/index.html +291 -0
- package/docs/index.js.html +92 -0
- package/docs/scripts/linenumber.js +25 -0
- package/docs/scripts/prettify/Apache-License-2.0.txt +202 -0
- package/docs/scripts/prettify/lang-css.js +2 -0
- package/docs/stack.js.html +2244 -0
- package/docs/styles/jsdoc-default.css +358 -0
- package/docs/styles/prettify-jsdoc.css +111 -0
- package/docs/styles/prettify-tomorrow.css +132 -0
- package/example/index.js +56 -0
- package/package.json +59 -0
- package/test/comparison-operators.ts +257 -0
- package/test/conditional-operators.ts +106 -0
- package/test/config.ts +12 -0
- package/test/core.ts +333 -0
- package/test/count.ts +98 -0
- package/test/data/assets.ts +35 -0
- package/test/data/author.ts +168 -0
- package/test/data/blog.ts +138 -0
- package/test/data/category.ts +20 -0
- package/test/data/content_types.ts +164 -0
- package/test/data/products.ts +64 -0
- package/test/expressions.ts +108 -0
- package/test/include-exclude.ts +176 -0
- package/test/logical-operators.ts +140 -0
- package/test/projections.ts +109 -0
- package/test/queries.ts +143 -0
- package/test/references.ts +162 -0
- package/test/skip-limit.ts +150 -0
- package/test/sorting.ts +177 -0
- package/tslint.json +45 -0
- package/typings/config.d.ts +42 -0
- package/typings/index.d.ts +36 -0
- package/typings/stack.d.ts +1097 -0
- package/typings/util.d.ts +28 -0
package/test/count.ts
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description Test contentstack-mongodb-sdk basic methods
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { cloneDeep } from 'lodash'
|
|
6
|
+
import { Contentstack } from '../src'
|
|
7
|
+
import { config } from './config'
|
|
8
|
+
import { assets } from './data/assets'
|
|
9
|
+
import { entries as authors } from './data/author'
|
|
10
|
+
import { entries as blogs } from './data/blog'
|
|
11
|
+
import { entries as categories } from './data/category'
|
|
12
|
+
import { content_types } from './data/content_types'
|
|
13
|
+
|
|
14
|
+
const scriptConfig = cloneDeep(config)
|
|
15
|
+
const collNameConfig: any = scriptConfig.contentStore.collection
|
|
16
|
+
collNameConfig.asset = 'contents.count'
|
|
17
|
+
collNameConfig.entry = 'contents.count'
|
|
18
|
+
collNameConfig.schema = 'content_types.count'
|
|
19
|
+
|
|
20
|
+
const Stack = Contentstack.Stack(scriptConfig)
|
|
21
|
+
const collection = cloneDeep(collNameConfig)
|
|
22
|
+
const blogCount = blogs.length
|
|
23
|
+
|
|
24
|
+
collection.asset = `en-us.${collNameConfig.asset}`
|
|
25
|
+
collection.entry = `en-us.${collNameConfig.entry}`
|
|
26
|
+
collection.schema = `en-us.${collNameConfig.schema}`
|
|
27
|
+
|
|
28
|
+
let db
|
|
29
|
+
|
|
30
|
+
describe('# Count', () => {
|
|
31
|
+
|
|
32
|
+
beforeAll(() => {
|
|
33
|
+
return Stack.connect().then((dbInstance) => {
|
|
34
|
+
db = dbInstance
|
|
35
|
+
|
|
36
|
+
return
|
|
37
|
+
})
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
beforeAll(async () => {
|
|
41
|
+
await db.collection(collection.entry).insertMany(authors)
|
|
42
|
+
await db.collection(collection.entry).insertMany(blogs)
|
|
43
|
+
await db.collection(collection.entry).insertMany(categories)
|
|
44
|
+
await db.collection(collection.asset).insertMany(assets)
|
|
45
|
+
await db.collection(collection.schema).insertMany(content_types)
|
|
46
|
+
|
|
47
|
+
return
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
afterAll(async () => {
|
|
51
|
+
await db.collection(collection.entry).drop()
|
|
52
|
+
// await db.collection(collection.asset).drop()
|
|
53
|
+
await db.collection(collection.schema).drop()
|
|
54
|
+
|
|
55
|
+
return Stack.close()
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
describe('basic', () => {
|
|
59
|
+
test('.count()', () => {
|
|
60
|
+
return Stack.contentType('blog')
|
|
61
|
+
.entries()
|
|
62
|
+
.count()
|
|
63
|
+
.then((result: any) => {
|
|
64
|
+
expect(result).toHaveProperty('count')
|
|
65
|
+
expect(result).toHaveProperty('locale')
|
|
66
|
+
expect(result).toHaveProperty('content_type_uid')
|
|
67
|
+
expect(result.locale).toEqual('en-us')
|
|
68
|
+
expect(result.content_type_uid).toEqual('blog')
|
|
69
|
+
expect(result.count).toEqual(blogCount)
|
|
70
|
+
expect(Object.keys(result)).toHaveLength(3)
|
|
71
|
+
}).catch((error) => {
|
|
72
|
+
expect(error).toBeNull()
|
|
73
|
+
})
|
|
74
|
+
})
|
|
75
|
+
})
|
|
76
|
+
|
|
77
|
+
describe('querying', () => {
|
|
78
|
+
test('.count() + .queryReferences()', () => {
|
|
79
|
+
return Stack.contentType('blog')
|
|
80
|
+
.entries()
|
|
81
|
+
.include(['authors'])
|
|
82
|
+
.queryReferences({'authors.published_at': '2019-01-25T11:47:50.760Z'})
|
|
83
|
+
.count()
|
|
84
|
+
.then((result: any) => {
|
|
85
|
+
expect(result).toHaveProperty('count')
|
|
86
|
+
expect(result).toHaveProperty('locale')
|
|
87
|
+
expect(result).toHaveProperty('content_type_uid')
|
|
88
|
+
expect(result.locale).toEqual('en-us')
|
|
89
|
+
expect(result.content_type_uid).toEqual('blog')
|
|
90
|
+
expect(result.count).toEqual(1)
|
|
91
|
+
expect(Object.keys(result)).toHaveLength(3)
|
|
92
|
+
}).catch((error) => {
|
|
93
|
+
expect(error).toBeNull()
|
|
94
|
+
})
|
|
95
|
+
})
|
|
96
|
+
})
|
|
97
|
+
})
|
|
98
|
+
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export const assets = [
|
|
2
|
+
{
|
|
3
|
+
_version: 1,
|
|
4
|
+
// tslint:disable-next-line: object-literal-sort-keys
|
|
5
|
+
_content_type_uid: '_assets',
|
|
6
|
+
locale: 'en-us',
|
|
7
|
+
tags: ['1'],
|
|
8
|
+
title: 'A 1',
|
|
9
|
+
uid: 'a1',
|
|
10
|
+
url:
|
|
11
|
+
'https://images.contentstack.io/v3/assets/***REMOVED***/blt6788d40f2aaaab9a/5c5aae49005d89b20bb85c21/cnn.png',
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
_version: 1,
|
|
15
|
+
// tslint:disable-next-line: object-literal-sort-keys
|
|
16
|
+
_content_type_uid: '_assets',
|
|
17
|
+
locale: 'en-us',
|
|
18
|
+
tags: ['2'],
|
|
19
|
+
title: 'A 2',
|
|
20
|
+
uid: 'a2',
|
|
21
|
+
url:
|
|
22
|
+
'https://images.contentstack.io/v3/assets/***REMOVED***/blt6788d40f2aaaab9a/5c5aae49005d89b20bb85c21/cnn.png',
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
_version: 2,
|
|
26
|
+
// tslint:disable-next-line: object-literal-sort-keys
|
|
27
|
+
_content_type_uid: '_assets',
|
|
28
|
+
locale: 'en-us',
|
|
29
|
+
tags: ['3'],
|
|
30
|
+
title: 'A 3',
|
|
31
|
+
uid: 'a3',
|
|
32
|
+
url:
|
|
33
|
+
'https://images.contentstack.io/v3/assets/***REMOVED***/blt6788d40f2aaaab9a/5c5aae49005d89b20bb85c21/cnn.png',
|
|
34
|
+
},
|
|
35
|
+
]
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
export const entries = [
|
|
2
|
+
{
|
|
3
|
+
age: 1,
|
|
4
|
+
blogs: [
|
|
5
|
+
{
|
|
6
|
+
_content_type_uid: 'blog',
|
|
7
|
+
uid: 'b1',
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
_content_type_uid: 'blog',
|
|
11
|
+
uid: 'b2',
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
_content_type_uid: 'blog',
|
|
15
|
+
uid: 'b3',
|
|
16
|
+
},
|
|
17
|
+
],
|
|
18
|
+
// tslint:disable-next-line: object-literal-sort-keys
|
|
19
|
+
_content_type_uid: 'author',
|
|
20
|
+
_version: 3,
|
|
21
|
+
locale: 'en-us',
|
|
22
|
+
published_at: '2019-01-25T11:47:50.750Z',
|
|
23
|
+
self_reference: [
|
|
24
|
+
{
|
|
25
|
+
_content_type_uid: 'author',
|
|
26
|
+
uid: 'a1',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
_content_type_uid: 'author',
|
|
30
|
+
uid: 'a2',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
_content_type_uid: 'author',
|
|
34
|
+
uid: 'a3',
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
title: 'author One',
|
|
38
|
+
uid: 'a1',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
age: 2,
|
|
42
|
+
alive: true,
|
|
43
|
+
blogs: [
|
|
44
|
+
{
|
|
45
|
+
_content_type_uid: 'blog',
|
|
46
|
+
uid: 'b1',
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
_content_type_uid: 'blog',
|
|
50
|
+
uid: 'b2',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
_content_type_uid: 'blog',
|
|
54
|
+
uid: 'b3',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
_content_type_uid: 'blog',
|
|
58
|
+
uid: 'b4',
|
|
59
|
+
},
|
|
60
|
+
],
|
|
61
|
+
// tslint:disable-next-line: object-literal-sort-keys
|
|
62
|
+
_content_type_uid: 'author',
|
|
63
|
+
locale: 'en-us',
|
|
64
|
+
published_at: '2019-01-25T11:47:50.751Z',
|
|
65
|
+
self_reference: [
|
|
66
|
+
{
|
|
67
|
+
_content_type_uid: 'author',
|
|
68
|
+
uid: 'a1',
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
_content_type_uid: 'author',
|
|
72
|
+
uid: 'a2',
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
_content_type_uid: 'author',
|
|
76
|
+
uid: 'a3',
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
_content_type_uid: 'author',
|
|
80
|
+
uid: 'a4',
|
|
81
|
+
},
|
|
82
|
+
],
|
|
83
|
+
_version: 5,
|
|
84
|
+
tags: ['1'],
|
|
85
|
+
title: 'author Two',
|
|
86
|
+
uid: 'a2',
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
// tslint:disable-next-line: object-literal-sort-keys
|
|
90
|
+
_content_type_uid: 'author',
|
|
91
|
+
_version: 7,
|
|
92
|
+
uid: 'a3',
|
|
93
|
+
// tslint:disable-next-line: object-literal-sort-keys
|
|
94
|
+
age: 3,
|
|
95
|
+
locale: 'en-us',
|
|
96
|
+
published_at: '2019-01-25T11:47:50.752Z',
|
|
97
|
+
title: 'author Three',
|
|
98
|
+
self_reference: [
|
|
99
|
+
{
|
|
100
|
+
_content_type_uid: 'author',
|
|
101
|
+
uid: 'a1',
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
_content_type_uid: 'author',
|
|
105
|
+
uid: 'a2',
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
_content_type_uid: 'author',
|
|
109
|
+
uid: 'a3',
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
_content_type_uid: 'author',
|
|
113
|
+
uid: 'a5',
|
|
114
|
+
},
|
|
115
|
+
],
|
|
116
|
+
tags: ['2', '3'],
|
|
117
|
+
blogs: [
|
|
118
|
+
{
|
|
119
|
+
_content_type_uid: 'blog',
|
|
120
|
+
uid: 'b1',
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
_content_type_uid: 'blog',
|
|
124
|
+
uid: 'b2',
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
_content_type_uid: 'blog',
|
|
128
|
+
uid: 'b3',
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
_content_type_uid: 'blog',
|
|
132
|
+
uid: 'b5',
|
|
133
|
+
},
|
|
134
|
+
],
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
// tslint:disable-next-line: object-literal-sort-keys
|
|
138
|
+
_content_type_uid: 'author',
|
|
139
|
+
_version: 8,
|
|
140
|
+
uid: 'a9',
|
|
141
|
+
// tslint:disable-next-line: object-literal-sort-keys
|
|
142
|
+
age: 9,
|
|
143
|
+
locale: 'en-us',
|
|
144
|
+
published_at: '2019-01-25T11:47:50.755Z',
|
|
145
|
+
title: 'author nine',
|
|
146
|
+
tags: ['8'],
|
|
147
|
+
category: {
|
|
148
|
+
_content_type_uid: 'category',
|
|
149
|
+
uid: 'c1',
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
// tslint:disable-next-line: object-literal-sort-keys
|
|
154
|
+
_content_type_uid: 'author',
|
|
155
|
+
uid: 'a10',
|
|
156
|
+
// tslint:disable-next-line: object-literal-sort-keys
|
|
157
|
+
age: 10,
|
|
158
|
+
_version: 1,
|
|
159
|
+
locale: 'en-us',
|
|
160
|
+
published_at: '2019-01-25T11:47:50.760Z',
|
|
161
|
+
title: 'author ten',
|
|
162
|
+
tags: ['10'],
|
|
163
|
+
category: {
|
|
164
|
+
_content_type_uid: 'category',
|
|
165
|
+
uid: 'c2',
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
]
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
export const entries = [
|
|
2
|
+
{
|
|
3
|
+
authors: {
|
|
4
|
+
_content_type_uid: 'author',
|
|
5
|
+
uid: 'a1',
|
|
6
|
+
},
|
|
7
|
+
no: 1,
|
|
8
|
+
// tslint:disable-next-line: object-literal-sort-keys
|
|
9
|
+
_content_type_uid: 'blog',
|
|
10
|
+
created_at: '2019-07-21T13:59:39.196Z',
|
|
11
|
+
updated_at: '2019-07-21T13:59:39.196Z',
|
|
12
|
+
files: ['a1', 'a2'],
|
|
13
|
+
locale: 'en-us',
|
|
14
|
+
published_at: '2019-01-25T11:47:50.750Z',
|
|
15
|
+
self_reference: [
|
|
16
|
+
{
|
|
17
|
+
_content_type_uid: 'blog',
|
|
18
|
+
uid: 'b1',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
_content_type_uid: 'blog',
|
|
22
|
+
uid: 'b2',
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
_content_type_uid: 'blog',
|
|
26
|
+
uid: 'b3',
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
single_file: 'a1',
|
|
30
|
+
tags: ['first', 'not-last'],
|
|
31
|
+
title: 'Blog One',
|
|
32
|
+
uid: 'b1',
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
_content_type_uid: 'blog',
|
|
36
|
+
uid: 'b2',
|
|
37
|
+
// tslint:disable-next-line: object-literal-sort-keys
|
|
38
|
+
locale: 'en-us',
|
|
39
|
+
created_at: '2019-07-21T13:59:38.196Z',
|
|
40
|
+
updated_at: '2019-07-21T13:59:38.196Z',
|
|
41
|
+
published_at: '2019-01-25T11:47:50.751Z',
|
|
42
|
+
title: 'Blog Two',
|
|
43
|
+
self_reference: [
|
|
44
|
+
{
|
|
45
|
+
_content_type_uid: 'blog',
|
|
46
|
+
uid: 'b1',
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
_content_type_uid: 'blog',
|
|
50
|
+
uid: 'b2',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
_content_type_uid: 'blog',
|
|
54
|
+
uid: 'b3',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
_content_type_uid: 'blog',
|
|
58
|
+
uid: 'b4',
|
|
59
|
+
},
|
|
60
|
+
],
|
|
61
|
+
no: 3,
|
|
62
|
+
authors: {
|
|
63
|
+
_content_type_uid: 'author',
|
|
64
|
+
uid: 'a2',
|
|
65
|
+
},
|
|
66
|
+
tags: ['test'],
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
_content_type_uid: 'blog',
|
|
70
|
+
uid: 'b3',
|
|
71
|
+
// tslint:disable-next-line: object-literal-sort-keys
|
|
72
|
+
created_at: '2019-07-21T13:59:36.196Z',
|
|
73
|
+
updated_at: '2019-07-21T13:59:36.196Z',
|
|
74
|
+
locale: 'en-us',
|
|
75
|
+
published_at: '2019-01-25T11:47:50.755Z',
|
|
76
|
+
title: 'Blog Three',
|
|
77
|
+
self_reference: [
|
|
78
|
+
{
|
|
79
|
+
_content_type_uid: 'blog',
|
|
80
|
+
uid: 'b1',
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
_content_type_uid: 'blog',
|
|
84
|
+
uid: 'b2',
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
_content_type_uid: 'blog',
|
|
88
|
+
uid: 'b3',
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
_content_type_uid: 'blog',
|
|
92
|
+
uid: 'b5',
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
|
+
no: 6,
|
|
96
|
+
authors: [
|
|
97
|
+
{
|
|
98
|
+
_content_type_uid: 'author',
|
|
99
|
+
uid: 'a2',
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
_content_type_uid: 'author',
|
|
103
|
+
uid: 'a3',
|
|
104
|
+
},
|
|
105
|
+
],
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
_content_type_uid: 'blog',
|
|
109
|
+
uid: 'b9',
|
|
110
|
+
// tslint:disable-next-line: object-literal-sort-keys
|
|
111
|
+
created_at: '2019-07-21T13:59:37.196Z',
|
|
112
|
+
updated_at: '2019-07-21T13:59:37.196Z',
|
|
113
|
+
locale: 'en-us',
|
|
114
|
+
published_at: '2019-01-25T11:47:50.740Z',
|
|
115
|
+
title: 'Blog Nine',
|
|
116
|
+
authors: {
|
|
117
|
+
_content_type_uid: 'author',
|
|
118
|
+
uid: 'a9',
|
|
119
|
+
},
|
|
120
|
+
no: 2,
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
_content_type_uid: 'blog',
|
|
124
|
+
uid: 'b10',
|
|
125
|
+
// tslint:disable-next-line: object-literal-sort-keys
|
|
126
|
+
locale: 'en-us',
|
|
127
|
+
created_at: '2019-07-21T13:59:35.196Z',
|
|
128
|
+
updated_at: '2019-07-21T13:59:35.196Z',
|
|
129
|
+
published_at: '2019-01-25T11:47:50.730Z',
|
|
130
|
+
title: 'Blog Ten',
|
|
131
|
+
authors: {
|
|
132
|
+
_content_type_uid: 'author',
|
|
133
|
+
uid: 'a10',
|
|
134
|
+
},
|
|
135
|
+
no: 0,
|
|
136
|
+
tags: ['last'],
|
|
137
|
+
},
|
|
138
|
+
]
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export const entries = [
|
|
2
|
+
{
|
|
3
|
+
_content_type_uid: 'category',
|
|
4
|
+
uid: 'c1',
|
|
5
|
+
// tslint:disable-next-line: object-literal-sort-keys
|
|
6
|
+
type: 'horror',
|
|
7
|
+
locale: 'en-us',
|
|
8
|
+
title: 'Cat One',
|
|
9
|
+
tags: [],
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
_content_type_uid: 'category',
|
|
13
|
+
uid: 'c2',
|
|
14
|
+
// tslint:disable-next-line: object-literal-sort-keys
|
|
15
|
+
type: 'romance',
|
|
16
|
+
locale: 'en-us',
|
|
17
|
+
title: 'Cat One',
|
|
18
|
+
tags: [],
|
|
19
|
+
},
|
|
20
|
+
]
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
// tslint:disable-next-line: variable-name
|
|
2
|
+
export const content_types = [
|
|
3
|
+
{
|
|
4
|
+
_content_type_uid: '_content_types',
|
|
5
|
+
locale: 'en-us',
|
|
6
|
+
published_at: '2019-02-07T14:52:37.617Z',
|
|
7
|
+
schema: [
|
|
8
|
+
{
|
|
9
|
+
display_name : 'Title',
|
|
10
|
+
uid : 'title',
|
|
11
|
+
// tslint:disable-next-line: object-literal-sort-keys
|
|
12
|
+
data_type: 'text',
|
|
13
|
+
mandatory : true,
|
|
14
|
+
unique : true,
|
|
15
|
+
field_metadata : {
|
|
16
|
+
_default : true,
|
|
17
|
+
},
|
|
18
|
+
multiple : false,
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
display_name : 'URL',
|
|
22
|
+
uid : 'url',
|
|
23
|
+
// tslint:disable-next-line: object-literal-sort-keys
|
|
24
|
+
data_type: 'text',
|
|
25
|
+
mandatory : false,
|
|
26
|
+
field_metadata : {
|
|
27
|
+
_default : true,
|
|
28
|
+
},
|
|
29
|
+
multiple : false,
|
|
30
|
+
unique : false,
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
title: 'Blog',
|
|
34
|
+
uid: 'blog',
|
|
35
|
+
// tslint:disable-next-line: object-literal-sort-keys
|
|
36
|
+
_references: {
|
|
37
|
+
authors: 'author',
|
|
38
|
+
self_reference: 'blog',
|
|
39
|
+
},
|
|
40
|
+
_assets: {
|
|
41
|
+
single_file: '_assets',
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
_content_type_uid: '_content_types',
|
|
46
|
+
locale: 'en-us',
|
|
47
|
+
published_at: '2019-02-07T14:52:37.618Z',
|
|
48
|
+
schema: [
|
|
49
|
+
{
|
|
50
|
+
display_name : 'Title',
|
|
51
|
+
uid : 'title',
|
|
52
|
+
// tslint:disable-next-line: object-literal-sort-keys
|
|
53
|
+
data_type: 'text',
|
|
54
|
+
mandatory : true,
|
|
55
|
+
unique : true,
|
|
56
|
+
field_metadata : {
|
|
57
|
+
_default : true,
|
|
58
|
+
},
|
|
59
|
+
multiple : false,
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
display_name : 'URL',
|
|
63
|
+
uid : 'url',
|
|
64
|
+
// tslint:disable-next-line: object-literal-sort-keys
|
|
65
|
+
data_type: 'text',
|
|
66
|
+
mandatory : false,
|
|
67
|
+
field_metadata : {
|
|
68
|
+
_default : true,
|
|
69
|
+
},
|
|
70
|
+
multiple : false,
|
|
71
|
+
unique : false,
|
|
72
|
+
},
|
|
73
|
+
],
|
|
74
|
+
title: 'Author',
|
|
75
|
+
uid: 'author',
|
|
76
|
+
// tslint:disable-next-line: object-literal-sort-keys
|
|
77
|
+
references: {
|
|
78
|
+
blogs: 'blog',
|
|
79
|
+
category: 'category',
|
|
80
|
+
self_reference: 'author',
|
|
81
|
+
},
|
|
82
|
+
_assets: {
|
|
83
|
+
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
_content_type_uid: '_content_types',
|
|
88
|
+
locale: 'en-us',
|
|
89
|
+
published_at: '2019-02-07T14:52:37.616Z',
|
|
90
|
+
schema: [
|
|
91
|
+
{
|
|
92
|
+
display_name : 'Title',
|
|
93
|
+
uid : 'title',
|
|
94
|
+
// tslint:disable-next-line: object-literal-sort-keys
|
|
95
|
+
data_type: 'text',
|
|
96
|
+
mandatory : true,
|
|
97
|
+
unique : true,
|
|
98
|
+
field_metadata : {
|
|
99
|
+
_default : true,
|
|
100
|
+
},
|
|
101
|
+
multiple : false,
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
display_name : 'URL',
|
|
105
|
+
uid : 'url',
|
|
106
|
+
// tslint:disable-next-line: object-literal-sort-keys
|
|
107
|
+
data_type: 'text',
|
|
108
|
+
mandatory : false,
|
|
109
|
+
field_metadata : {
|
|
110
|
+
_default : true,
|
|
111
|
+
},
|
|
112
|
+
multiple : false,
|
|
113
|
+
unique : false,
|
|
114
|
+
},
|
|
115
|
+
],
|
|
116
|
+
title: 'Category',
|
|
117
|
+
uid: 'category',
|
|
118
|
+
// tslint:disable-next-line: object-literal-sort-keys
|
|
119
|
+
_references: {},
|
|
120
|
+
_assets: {},
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
_content_type_uid: '_content_types',
|
|
124
|
+
locale: 'en-us',
|
|
125
|
+
published_at: '2019-02-07T14:52:37.616Z',
|
|
126
|
+
schema: [
|
|
127
|
+
{
|
|
128
|
+
display_name : 'Title',
|
|
129
|
+
uid : 'title',
|
|
130
|
+
// tslint:disable-next-line: object-literal-sort-keys
|
|
131
|
+
data_type: 'text',
|
|
132
|
+
mandatory : true,
|
|
133
|
+
unique : true,
|
|
134
|
+
field_metadata : {
|
|
135
|
+
_default : true,
|
|
136
|
+
},
|
|
137
|
+
multiple : false,
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
display_name : 'URL',
|
|
141
|
+
uid : 'url',
|
|
142
|
+
// tslint:disable-next-line: object-literal-sort-keys
|
|
143
|
+
data_type: 'text',
|
|
144
|
+
mandatory : false,
|
|
145
|
+
field_metadata : {
|
|
146
|
+
_default : true,
|
|
147
|
+
},
|
|
148
|
+
multiple : false,
|
|
149
|
+
unique : false,
|
|
150
|
+
},
|
|
151
|
+
],
|
|
152
|
+
title: 'Products',
|
|
153
|
+
uid: 'products',
|
|
154
|
+
// tslint:disable-next-line: object-literal-sort-keys
|
|
155
|
+
_references: {
|
|
156
|
+
authors: 'author',
|
|
157
|
+
self_reference: 'blog',
|
|
158
|
+
},
|
|
159
|
+
_assets: {
|
|
160
|
+
files: '_assets',
|
|
161
|
+
single_file: '_assets',
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
]
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
export const entries = [
|
|
2
|
+
{
|
|
3
|
+
authors: {
|
|
4
|
+
_content_type_uid: 'author',
|
|
5
|
+
uid: 'a1',
|
|
6
|
+
},
|
|
7
|
+
no: 1,
|
|
8
|
+
// tslint:disable-next-line: object-literal-sort-keys
|
|
9
|
+
_content_type_uid: 'product',
|
|
10
|
+
files: ['a1', 'a2'],
|
|
11
|
+
locale: 'en-us',
|
|
12
|
+
published_at: '2019-01-25T11:47:50.750Z',
|
|
13
|
+
self_reference: [
|
|
14
|
+
{
|
|
15
|
+
_content_type_uid: 'blog',
|
|
16
|
+
uid: 'b1',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
_content_type_uid: 'blog',
|
|
20
|
+
uid: 'b2',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
_content_type_uid: 'blog',
|
|
24
|
+
uid: 'b3',
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
single_file: 'a1',
|
|
28
|
+
tags: ['first', 'not-last'],
|
|
29
|
+
title: 'Blog One',
|
|
30
|
+
uid: 'p2',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
_content_type_uid: 'product',
|
|
34
|
+
uid: 'p1',
|
|
35
|
+
// tslint:disable-next-line: object-literal-sort-keys
|
|
36
|
+
locale: 'es-es',
|
|
37
|
+
published_at: '2019-01-25T11:47:50.751Z',
|
|
38
|
+
title: 'Product Two',
|
|
39
|
+
self_reference: [
|
|
40
|
+
{
|
|
41
|
+
_content_type_uid: 'blog',
|
|
42
|
+
uid: 'b1',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
_content_type_uid: 'blog',
|
|
46
|
+
uid: 'b2',
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
_content_type_uid: 'blog',
|
|
50
|
+
uid: 'b3',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
_content_type_uid: 'blog',
|
|
54
|
+
uid: 'b4',
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
no: 3,
|
|
58
|
+
authors: {
|
|
59
|
+
_content_type_uid: 'author',
|
|
60
|
+
uid: 'a2',
|
|
61
|
+
},
|
|
62
|
+
tags: ['test'],
|
|
63
|
+
},
|
|
64
|
+
]
|