@winible/winible-typed 2.6.5 → 2.6.7
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/typed-model/application.js +1 -1
- package/dist/typed-model/notification-preference.js +1 -2
- package/dist/typed-model/notification-preference.js.map +1 -1
- package/dist/typed-model/notification.js +1 -18
- package/dist/typed-model/notification.js.map +1 -1
- package/package.json +1 -1
- package/typed-model/application.ts +1 -1
- package/typed-model/notification-preference.ts +1 -1
- package/typed-model/notification.ts +7 -21
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const sequelize_1 = require("sequelize");
|
7
7
|
const pb_sequelize_1 = __importDefault(require("./pb-sequelize"));
|
8
8
|
const user_1 = __importDefault(require("./user"));
|
9
|
-
const notification_1 = require("./notification");
|
10
9
|
// order of InferAttributes & InferCreationAttributes is important.
|
11
10
|
class NotificationPreference extends sequelize_1.Model {
|
12
11
|
}
|
@@ -32,7 +31,7 @@ NotificationPreference.init({
|
|
32
31
|
},
|
33
32
|
types: {
|
34
33
|
field: "type",
|
35
|
-
type: sequelize_1.DataTypes.ARRAY(sequelize_1.DataTypes.
|
34
|
+
type: sequelize_1.DataTypes.ARRAY(sequelize_1.DataTypes.STRING),
|
36
35
|
},
|
37
36
|
createdAt: sequelize_1.DataTypes.DATE,
|
38
37
|
updatedAt: sequelize_1.DataTypes.DATE,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"notification-preference.js","sourceRoot":"","sources":["../../typed-model/notification-preference.ts"],"names":[],"mappings":";;;;;AAAA,yCAOmB;AAEnB,kEAAuC;AACvC,kDAA0B;
|
1
|
+
{"version":3,"file":"notification-preference.js","sourceRoot":"","sources":["../../typed-model/notification-preference.ts"],"names":[],"mappings":";;;;;AAAA,yCAOmB;AAEnB,kEAAuC;AACvC,kDAA0B;AAM1B,mEAAmE;AACnE,MAAM,sBAAuB,SAAQ,iBAGpC;CASA;AAED,sBAAsB,CAAC,IAAI,CACzB;IACE,EAAE,EAAE;QACF,IAAI,EAAE,qBAAS,CAAC,MAAM;QACtB,YAAY,EAAE,IAAA,cAAE,EAAC,SAAS,CAAC;QAC3B,SAAS,EAAE,KAAK;QAChB,UAAU,EAAE,IAAI;KACjB;IACD,MAAM,EAAE;QACN,IAAI,EAAE,qBAAS,CAAC,MAAM;QACtB,SAAS,EAAE,KAAK;QAChB,KAAK,EAAE,SAAS;QAChB,UAAU,EAAE;YACV,KAAK,EAAE,cAAI;SACZ;KACF;IACD,MAAM,EAAE;QACN,IAAI,EAAE,qBAAS,CAAC,MAAM;QACtB,SAAS,EAAE,KAAK;QAChB,KAAK,EAAE,QAAQ;KAChB;IACD,KAAK,EAAE;QACL,KAAK,EAAE,MAAM;QACb,IAAI,EAAE,qBAAS,CAAC,KAAK,CAAC,qBAAS,CAAC,MAAM,CAAC;KACxC;IACD,SAAS,EAAE,qBAAS,CAAC,IAAI;IACzB,SAAS,EAAE,qBAAS,CAAC,IAAI;CAC1B,EACD;IACE,SAAS,EAAE,0BAA0B;IACrC,SAAS,EAAT,sBAAS;CACV,CACF,CAAC;AAEF,cAAI,CAAC,OAAO,CAAC,sBAAsB,EAAE;IACnC,UAAU,EAAE,QAAQ;IACpB,QAAQ,EAAE,WAAW;IACrB,WAAW,EAAE,KAAK;CACnB,CAAC,CAAC;AAEH,sBAAsB,CAAC,MAAM,CAAC,cAAI,EAAE;IAClC,UAAU,EAAE,IAAI;IAChB,SAAS,EAAE,QAAQ;IACnB,QAAQ,EAAE,WAAW;IACrB,WAAW,EAAE,KAAK;CACnB,CAAC,CAAC;AAEH,kBAAe,sBAAsB,CAAC"}
|
@@ -3,19 +3,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
4
|
};
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
exports.NotificationType = void 0;
|
7
6
|
const sequelize_1 = require("sequelize");
|
8
7
|
const pb_sequelize_1 = __importDefault(require("./pb-sequelize"));
|
9
8
|
const content_like_1 = __importDefault(require("./content-like"));
|
10
9
|
const user_1 = __importDefault(require("./user"));
|
11
|
-
var NotificationType;
|
12
|
-
(function (NotificationType) {
|
13
|
-
NotificationType["LIKED"] = "LIKED";
|
14
|
-
NotificationType["PURCHASED_PLAN"] = "PURCHASED_PLAN";
|
15
|
-
NotificationType["PURCHASED_POST"] = "PURCHASED_POST";
|
16
|
-
NotificationType["SUBSCRIBED"] = "SUBSCRIBED";
|
17
|
-
NotificationType["VIEWED_PROFILE"] = "VIEWED_PROFILE";
|
18
|
-
})(NotificationType = exports.NotificationType || (exports.NotificationType = {}));
|
19
10
|
// order of InferAttributes & InferCreationAttributes is important.
|
20
11
|
class Notification extends sequelize_1.Model {
|
21
12
|
}
|
@@ -43,7 +34,7 @@ Notification.init({
|
|
43
34
|
},
|
44
35
|
type: {
|
45
36
|
field: "type",
|
46
|
-
type: sequelize_1.DataTypes.
|
37
|
+
type: sequelize_1.DataTypes.STRING,
|
47
38
|
},
|
48
39
|
transactionId: {
|
49
40
|
field: "transaction_id",
|
@@ -72,14 +63,6 @@ Notification.init({
|
|
72
63
|
Class functions
|
73
64
|
====================================================================
|
74
65
|
*/
|
75
|
-
// Notification.readNotifications = async (
|
76
|
-
// ownerId: string,
|
77
|
-
// type: NotificationType
|
78
|
-
// ) => {
|
79
|
-
// await sequelize.query(
|
80
|
-
// `UPDATE notifications SET is_read=true WHERE owner_id=${ownerId} AND type=${type}`
|
81
|
-
// );
|
82
|
-
// };
|
83
66
|
Notification.hasOne(user_1.default, {
|
84
67
|
foreignKey: "id",
|
85
68
|
sourceKey: "recipientId",
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"notification.js","sourceRoot":"","sources":["../../typed-model/notification.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"notification.js","sourceRoot":"","sources":["../../typed-model/notification.ts"],"names":[],"mappings":";;;;;AAAA,yCAOm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,cAAI,EAAE;IACxB,UAAU,EAAE,IAAI;IAChB,SAAS,EAAE,aAAa;IACxB,WAAW,EAAE,KAAK;CACnB,CAAC,CAAC;AAEH,YAAY,CAAC,MAAM,CAAC,sBAAW,EAAE;IAC/B,UAAU,EAAE,IAAI;IAChB,SAAS,EAAE,YAAY;IACvB,WAAW,EAAE,KAAK;CACnB,CAAC,CAAC;AAEH,kBAAe,YAAY,CAAC"}
|
package/package.json
CHANGED
@@ -11,13 +11,12 @@ import sequelize from "./pb-sequelize";
|
|
11
11
|
import ContentLike from "./content-like";
|
12
12
|
import User from "./user";
|
13
13
|
|
14
|
-
export
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
}
|
14
|
+
export type NotificationType =
|
15
|
+
| "LIKED"
|
16
|
+
| "PURCHASED_PLAN"
|
17
|
+
| "PURCHASED_POST"
|
18
|
+
| "SUBSCRIBED"
|
19
|
+
| "VIEWED_PROFILE";
|
21
20
|
|
22
21
|
// order of InferAttributes & InferCreationAttributes is important.
|
23
22
|
class Notification extends Model<
|
@@ -37,10 +36,6 @@ class Notification extends Model<
|
|
37
36
|
declare subscriptionPlanId?: string;
|
38
37
|
declare createdAt: CreationOptional<Date>;
|
39
38
|
declare updatedAt: CreationOptional<Date>;
|
40
|
-
static readNotifications: (
|
41
|
-
ownerId: string,
|
42
|
-
type: NotificationType
|
43
|
-
) => Promise<void>;
|
44
39
|
}
|
45
40
|
|
46
41
|
Notification.init(
|
@@ -68,7 +63,7 @@ Notification.init(
|
|
68
63
|
},
|
69
64
|
type: {
|
70
65
|
field: "type",
|
71
|
-
type: DataTypes.
|
66
|
+
type: DataTypes.STRING,
|
72
67
|
},
|
73
68
|
transactionId: {
|
74
69
|
field: "transaction_id",
|
@@ -101,15 +96,6 @@ Class functions
|
|
101
96
|
====================================================================
|
102
97
|
*/
|
103
98
|
|
104
|
-
// Notification.readNotifications = async (
|
105
|
-
// ownerId: string,
|
106
|
-
// type: NotificationType
|
107
|
-
// ) => {
|
108
|
-
// await sequelize.query(
|
109
|
-
// `UPDATE notifications SET is_read=true WHERE owner_id=${ownerId} AND type=${type}`
|
110
|
-
// );
|
111
|
-
// };
|
112
|
-
|
113
99
|
Notification.hasOne(User, {
|
114
100
|
foreignKey: "id",
|
115
101
|
sourceKey: "recipientId",
|