@live-change/content-service 0.3.2 → 0.3.3

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.
Files changed (2) hide show
  1. package/metadata.js +41 -20
  2. package/package.json +4 -4
package/metadata.js CHANGED
@@ -65,23 +65,24 @@ const Metadata = definition.model({
65
65
  properties: {
66
66
  title: {
67
67
  type: String,
68
- softValidation: ['nonEmpty', { name: 'maxLength', params: { maxLength: 64 } }]
68
+ validation: ['nonEmpty', { name: 'maxLength', params: { length: 64 } }]
69
69
  },
70
70
  description: {
71
71
  type: String,
72
- softValidation: ['nonEmpty', { name: 'maxLength', params: { maxLength: 155 } }]
72
+ input: 'textarea',
73
+ softValidation: ['nonEmpty', { name: 'maxLength', params: { length: 155 } }]
73
74
  },
74
75
  og: {
75
76
  type: Object,
76
77
  properties: {
77
78
  title: {
78
79
  type: String,
79
- softValidation: ['nonEmpty', { name: 'maxLength', params: { maxLength: 60 } }]
80
+ softValidation: ['nonEmpty', { name: 'maxLength', params: { length: 60 } }]
80
81
  },
81
82
  description: {
82
83
  type: String,
83
84
  input: 'textarea',
84
- softValidation: ['nonEmpty', { name: 'maxLength', params: { maxLength: 65 } }]
85
+ softValidation: ['nonEmpty', { name: 'maxLength', params: { length: 65 } }]
85
86
  },
86
87
  image: {
87
88
  type: 'Image',
@@ -108,49 +109,55 @@ const Metadata = definition.model({
108
109
  },*/
109
110
  type: {
110
111
  type: String,
112
+ input: 'select',
111
113
  softValidation: ['nonEmpty'],
114
+ defaultValue: 'website',
112
115
  options: [
113
- 'music.song', 'music.album', 'music.playlist', 'music.radio_station',
114
- 'video.movie', 'video.episode', 'video.tv_show', 'video.other',
116
+ 'website',
115
117
  'article',
116
118
  'book',
117
119
  'profile',
118
- 'website'
120
+ 'music.song', 'music.album', 'music.playlist', 'music.radio_station',
121
+ 'video.movie', 'video.episode', 'video.tv_show', 'video.other'
119
122
  ]
120
123
  },
121
124
  music: {
122
- if: App.isomorphic(({ props }) => props.og.type.split('.')[0] === 'music'),
125
+ if: App.isomorphic(({ props }) =>
126
+ ['music.radio_station', 'music.playlist', 'music.album', 'music.song'].includes(props?.og?.type)
127
+ ),
123
128
  type: Object,
124
129
  properties: {
125
130
  duration: {
126
- if: App.isomorphic(({ props }) => ['music.album', 'music.song'].includes(props.og.type)),
131
+ if: App.isomorphic(({ props }) => ['music.album', 'music.song'].includes(props?.og?.type)),
127
132
  ...durationType
128
133
  },
129
134
  song: {
130
- if: App.isomorphic(({ props }) => ['music.album', 'music.playlist'].includes(props.og.type)),
135
+ if: App.isomorphic(({ props }) => ['music.album', 'music.playlist'].includes(props?.og?.type)),
131
136
  ...musicSongsType
132
137
  },
133
138
  album: {
134
- if: App.isomorphic(({ props }) => props.og.type === 'music.song'),
139
+ if: App.isomorphic(({ props }) => props?.og?.type === 'music.song'),
135
140
  ...musicSongsType /// music.song list is compatible with music.album list
136
141
  },
137
142
  musician: {
138
- if: App.isomorphic(({ props }) => ['music.album', 'music.song'].includes(props.og.type)),
143
+ if: App.isomorphic(({ props }) => ['music.album', 'music.song'].includes(props?.og?.type)),
139
144
  ...urlArrayType
140
145
  },
141
146
  releaseDate: {
142
- if: App.isomorphic(({ props }) => props.og.type === 'music.album'),
147
+ if: App.isomorphic(({ props }) => props?.og?.type === 'music.album'),
143
148
  type: Date,
144
149
  },
145
150
  creator: {
146
- if: App.isomorphic(({ props }) => ['music.radio_station', 'music.playlist'].includes(props.og.type)),
151
+ if: App.isomorphic(({ props }) => ['music.radio_station', 'music.playlist'].includes(props?.og?.type)),
147
152
  ...urlArrayType
148
153
  },
149
154
  },
150
155
  softValidation: ['nonEmpty']
151
156
  },
152
157
  video: {
153
- if: App.isomorphic(({ props }) => props.og.type.split('.')[0] === 'video'),
158
+ if: App.isomorphic(({ props }) =>
159
+ ['video.movie', 'video.episode', 'video.tv_show', 'video.other'].includes(props?.og?.type)
160
+ ),
154
161
  type: Object,
155
162
  properties: {
156
163
  actor: {
@@ -168,19 +175,19 @@ const Metadata = definition.model({
168
175
  },
169
176
  director: urlArrayType,
170
177
  writer: urlArrayType,
171
- durationType: durationType,
178
+ duration: durationType,
172
179
  releaseDate: {
173
180
  type: Date,
174
181
  },
175
182
  tag: tagsType,
176
183
  series: {
177
- if: App.isomorphic(({ props }) => props.og.type === 'video.tv_show'),
184
+ if: App.isomorphic(({ props }) => props?.og?.type === 'video.tv_show'),
178
185
  ...urlType
179
186
  }
180
187
  }
181
188
  },
182
189
  article: {
183
- if: App.isomorphic(({ props }) => props.og.type === 'article'),
190
+ if: App.isomorphic(({ props }) => props?.og?.type === 'article'),
184
191
  type: Object,
185
192
  properties: {
186
193
  publishedTime: {
@@ -192,7 +199,7 @@ const Metadata = definition.model({
192
199
  expirationTime: {
193
200
  type: Date,
194
201
  },
195
- author: urlType,
202
+ author: urlArrayType,
196
203
  section: {
197
204
  type: String
198
205
  },
@@ -200,7 +207,7 @@ const Metadata = definition.model({
200
207
  }
201
208
  },
202
209
  profile: {
203
- if: App.isomorphic(({ props }) => props.og.type === 'profile'),
210
+ if: App.isomorphic(({ props }) => props?.og?.type === 'profile'),
204
211
  type: Object,
205
212
  properties: {
206
213
  firstName: {
@@ -217,6 +224,20 @@ const Metadata = definition.model({
217
224
  options: ['male', 'female']
218
225
  }
219
226
  }
227
+ },
228
+ book: {
229
+ if: App.isomorphic(({ props }) => props?.og?.type === 'book'),
230
+ type: Object,
231
+ properties: {
232
+ author: urlArrayType,
233
+ isbn: {
234
+ type: String
235
+ },
236
+ releaseDate: {
237
+ type: Date
238
+ },
239
+ tag: tagsType
240
+ }
220
241
  }
221
242
  }
222
243
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@live-change/content-service",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -21,12 +21,12 @@
21
21
  "url": "https://www.viamage.com/"
22
22
  },
23
23
  "dependencies": {
24
- "@live-change/framework": "0.7.4",
25
- "@live-change/relations-plugin": "0.7.4",
24
+ "@live-change/framework": "0.7.5",
25
+ "@live-change/relations-plugin": "0.7.5",
26
26
  "lru-cache": "^7.12.0",
27
27
  "pluralize": "8.0.0",
28
28
  "progress-stream": "^2.0.0",
29
29
  "prosemirror-model": "^1.18.1"
30
30
  },
31
- "gitHead": "bc5b4a025949ef0ee18730d69ac2edf204f40317"
31
+ "gitHead": "046ebbe0c5be36b156f5e814b627b926dd968a95"
32
32
  }