@nina-protocol/nina-db 0.0.43 → 0.0.44

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.
@@ -13,12 +13,11 @@ class Post extends Model {
13
13
  static get jsonSchema() {
14
14
  return {
15
15
  type: 'object',
16
- required: ['publicKey', 'data', 'datetime', 'version'],
16
+ required: ['publicKey', 'data', 'datetime'],
17
17
  properties: {
18
18
  publicKey: { type: 'string' },
19
19
  data: { type: 'object' },
20
20
  datetime: { type: 'string' },
21
- version: { type: 'string' },
22
21
  },
23
22
  };
24
23
  }
@@ -25,7 +25,7 @@ export const tweetNewRelease = async (metadata, publisherId) => {
25
25
  accessToken: process.env.TWITTER_ACCESS_TOKEN,
26
26
  accessSecret: process.env.TWITTER_ACCESS_TOKEN_SECRET,
27
27
  });
28
- let text = (`${metadata.properties.artist} - "${metadata.properties.title}"`).substr(0, 250);
28
+ let text = (`${metadata.properties.artist ? `${metadata.properties.artist} - ` : ''}${metadata.properties.title}`).substr(0, 250);
29
29
  const publisher = await Account.query().findById(publisherId);
30
30
  if (publisher) {
31
31
  const twitterVerification = (await publisher.$relatedQuery('verifications').where('type', 'twitter').andWhere('active', true))[0];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nina-protocol/nina-db",
3
- "version": "0.0.43",
3
+ "version": "0.0.44",
4
4
  "description": "",
5
5
  "source": "src/index.js",
6
6
  "main": "dist/index.js",
@@ -14,12 +14,11 @@ class Post extends Model {
14
14
  static get jsonSchema() {
15
15
  return {
16
16
  type: 'object',
17
- required: ['publicKey', 'data', 'datetime', 'version'],
17
+ required: ['publicKey', 'data', 'datetime'],
18
18
  properties: {
19
19
  publicKey: { type: 'string' },
20
20
  data: { type: 'object' },
21
21
  datetime: { type: 'string' },
22
- version: { type: 'string' },
23
22
  },
24
23
  };
25
24
  }
@@ -29,7 +29,7 @@ export const tweetNewRelease = async (metadata, publisherId) => {
29
29
  accessToken: process.env.TWITTER_ACCESS_TOKEN,
30
30
  accessSecret: process.env.TWITTER_ACCESS_TOKEN_SECRET,
31
31
  });
32
- let text = (`${metadata.properties.artist} - "${metadata.properties.title}"`).substr(0, 250)
32
+ let text = (`${metadata.properties.artist ? `${metadata.properties.artist} - ` : ''}${metadata.properties.title}`).substr(0, 250)
33
33
  const publisher = await Account.query().findById(publisherId);
34
34
  if (publisher) {
35
35
  const twitterVerification = (await publisher.$relatedQuery('verifications').where('type', 'twitter').andWhere('active', true))[0]
@@ -1,17 +0,0 @@
1
- /**
2
- * @param { import("knex").Knex } knex
3
- * @returns { Promise<void> }
4
- */
5
- export const up = function(knex) {
6
- return knex.schema.table('posts' , table => {
7
- table.string('version').notNullable().defaultTo('0.0.0');
8
- });
9
- };
10
-
11
- /**
12
- * @param { import("knex").Knex } knex
13
- * @returns { Promise<void> }
14
- */
15
- export const down = function(knex) {
16
-
17
- };