@nina-protocol/nina-db 0.0.32 → 0.0.33
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/dist/models/Account.js
CHANGED
|
@@ -4,7 +4,7 @@ import Hub from './Hub.js';
|
|
|
4
4
|
import Post from './Post.js';
|
|
5
5
|
import Release from './Release.js';
|
|
6
6
|
import Verification from './Verification.js';
|
|
7
|
-
class Account extends Model {
|
|
7
|
+
export default class Account extends Model {
|
|
8
8
|
static tableName = 'accounts';
|
|
9
9
|
static idColumn = 'id';
|
|
10
10
|
static jsonSchema = {
|
|
@@ -113,4 +113,3 @@ class Account extends Model {
|
|
|
113
113
|
},
|
|
114
114
|
});
|
|
115
115
|
}
|
|
116
|
-
export default Account;
|
package/dist/models/Exchange.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Model } from 'objection';
|
|
2
2
|
import Account from './Account.js';
|
|
3
3
|
import Release from './Release.js';
|
|
4
|
-
class Exchange extends Model {
|
|
4
|
+
export default class Exchange extends Model {
|
|
5
5
|
static tableName = 'exchanges';
|
|
6
6
|
static idColum = 'id';
|
|
7
7
|
static jsonSchema = {
|
|
@@ -60,4 +60,3 @@ class Exchange extends Model {
|
|
|
60
60
|
},
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
|
-
export default Exchange;
|
package/dist/models/Hub.js
CHANGED
|
@@ -3,7 +3,7 @@ import { stripHtmlIfNeeded } from '../utils/index.js';
|
|
|
3
3
|
import Account from './Account.js';
|
|
4
4
|
import Release from './Release.js';
|
|
5
5
|
import Post from './Post.js';
|
|
6
|
-
class Hub extends Model {
|
|
6
|
+
export default class Hub extends Model {
|
|
7
7
|
static get tableName() {
|
|
8
8
|
return 'hubs';
|
|
9
9
|
}
|
|
@@ -81,4 +81,3 @@ class Hub extends Model {
|
|
|
81
81
|
},
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
|
-
export default Hub;
|
package/dist/models/Release.js
CHANGED
|
@@ -10,7 +10,7 @@ import axios from 'axios';
|
|
|
10
10
|
import { customAlphabet } from 'nanoid';
|
|
11
11
|
const alphabet = '0123456789abcdefghijklmnopqrstuvwxyz';
|
|
12
12
|
const randomStringGenerator = customAlphabet(alphabet, 12);
|
|
13
|
-
class Release extends Model {
|
|
13
|
+
export default class Release extends Model {
|
|
14
14
|
static tableName = 'releases';
|
|
15
15
|
static idColumn = 'id';
|
|
16
16
|
static jsonSchema = {
|
|
@@ -74,10 +74,12 @@ class Release extends Model {
|
|
|
74
74
|
return release;
|
|
75
75
|
};
|
|
76
76
|
static createRelease = async ({ publicKey, mint, metadata, datetime, publisherId, releaseAccount }) => {
|
|
77
|
+
const slug = await this.generateSlug(metadata);
|
|
77
78
|
const release = await Release.query().insertGraph({
|
|
78
79
|
publicKey,
|
|
79
80
|
mint,
|
|
80
81
|
metadata,
|
|
82
|
+
slug,
|
|
81
83
|
datetime,
|
|
82
84
|
publisherId,
|
|
83
85
|
});
|
|
@@ -203,4 +205,3 @@ class Release extends Model {
|
|
|
203
205
|
}
|
|
204
206
|
});
|
|
205
207
|
}
|
|
206
|
-
export default Release;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Model } from 'objection';
|
|
2
2
|
import Account from './Account.js';
|
|
3
|
-
class Verification extends Model {
|
|
3
|
+
export default class Verification extends Model {
|
|
4
4
|
static get tableName() {
|
|
5
5
|
return 'verifications';
|
|
6
6
|
}
|
|
@@ -48,4 +48,3 @@ class Verification extends Model {
|
|
|
48
48
|
},
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
|
-
export default Verification;
|
package/package.json
CHANGED
package/src/models/Release.js
CHANGED
|
@@ -83,10 +83,13 @@ export default class Release extends Model {
|
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
static createRelease = async ({publicKey, mint, metadata, datetime, publisherId, releaseAccount}) => {
|
|
86
|
+
const slug = await this.generateSlug(metadata);
|
|
87
|
+
|
|
86
88
|
const release = await Release.query().insertGraph({
|
|
87
89
|
publicKey,
|
|
88
90
|
mint,
|
|
89
91
|
metadata,
|
|
92
|
+
slug,
|
|
90
93
|
datetime,
|
|
91
94
|
publisherId,
|
|
92
95
|
})
|