@winible/winible-typed 2.70.4 → 2.70.5

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.
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ require("dotenv").config();
3
+ module.exports = {
4
+ development: {
5
+ dialect: "postgres",
6
+ host: process.env.TS_DB_HOST,
7
+ port: process.env.TS_DB_PORT,
8
+ database: process.env.TS_DB_NAME,
9
+ username: process.env.TS_DB_USER,
10
+ password: process.env.TS_DB_PASSWORD,
11
+ dialectOptions: {
12
+ ssl: false,
13
+ },
14
+ },
15
+ production: {
16
+ dialect: "postgres",
17
+ host: process.env.TS_DB_HOST,
18
+ port: process.env.TS_DB_PORT,
19
+ database: process.env.TS_DB_NAME,
20
+ username: process.env.TS_DB_USER,
21
+ password: process.env.TS_DB_PASSWORD,
22
+ dialectOptions: {
23
+ ssl: {
24
+ require: true,
25
+ rejectUnauthorized: false,
26
+ },
27
+ },
28
+ },
29
+ };
30
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../event-collector-models/config/config.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,QAAQ,CAAC,CAAC,MAAM,EAAE,CAAC;AAE3B,MAAM,CAAC,OAAO,GAAG;IACf,WAAW,EAAE;QACX,OAAO,EAAE,UAAU;QACnB,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,UAAU;QAC5B,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,UAAU;QAC5B,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,UAAU;QAChC,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,UAAU;QAChC,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,cAAc;QACpC,cAAc,EAAE;YACd,GAAG,EAAE,KAAK;SACX;KACF;IACD,UAAU,EAAE;QACV,OAAO,EAAE,UAAU;QACnB,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,UAAU;QAC5B,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,UAAU;QAC5B,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,UAAU;QAChC,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,UAAU;QAChC,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,cAAc;QACpC,cAAc,EAAE;YACd,GAAG,EAAE;gBACH,OAAO,EAAE,IAAI;gBACb,kBAAkB,EAAE,KAAK;aAC1B;SACF;KACF;CACF,CAAC"}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const sequelize_1 = require("sequelize");
4
+ exports.default = {
5
+ async up(queryInterface, sequelize) {
6
+ await queryInterface.createTable("recurly_payment_monitoring_whitelist", {
7
+ id: {
8
+ type: sequelize_1.DataTypes.BIGINT,
9
+ primaryKey: true,
10
+ allowNull: false,
11
+ autoIncrement: true,
12
+ },
13
+ user_id: {
14
+ type: sequelize_1.DataTypes.BIGINT,
15
+ allowNull: false,
16
+ references: {
17
+ model: "users",
18
+ key: "id",
19
+ },
20
+ onDelete: "CASCADE",
21
+ },
22
+ createdAt: {
23
+ type: sequelize_1.DataTypes.DATE,
24
+ allowNull: false,
25
+ defaultValue: sequelize.literal("NOW()"),
26
+ },
27
+ });
28
+ },
29
+ async down(queryInterface, sequelize) {
30
+ await queryInterface.dropTable("recurly_payment_monitoring_whitelist");
31
+ },
32
+ };
33
+ //# sourceMappingURL=20241123184623-recurly-payment-monitoring-whitelist.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"20241123184623-recurly-payment-monitoring-whitelist.js","sourceRoot":"","sources":["../../migrations/20241123184623-recurly-payment-monitoring-whitelist.ts"],"names":[],"mappings":";;AAAA,yCAAiE;AAEjE,kBAAe;IACb,KAAK,CAAC,EAAE,CAAC,cAA8B,EAAE,SAAoB;QAC3D,MAAM,cAAc,CAAC,WAAW,CAAC,sCAAsC,EAAE;YACvE,EAAE,EAAE;gBACF,IAAI,EAAE,qBAAS,CAAC,MAAM;gBACtB,UAAU,EAAE,IAAI;gBAChB,SAAS,EAAE,KAAK;gBAChB,aAAa,EAAE,IAAI;aACpB;YACD,OAAO,EAAE;gBACP,IAAI,EAAE,qBAAS,CAAC,MAAM;gBACtB,SAAS,EAAE,KAAK;gBAChB,UAAU,EAAE;oBACV,KAAK,EAAE,OAAO;oBACd,GAAG,EAAE,IAAI;iBACV;gBACD,QAAQ,EAAE,SAAS;aACpB;YACD,SAAS,EAAE;gBACT,IAAI,EAAE,qBAAS,CAAC,IAAI;gBACpB,SAAS,EAAE,KAAK;gBAChB,YAAY,EAAE,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC;aACzC;SACF,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,cAA8B,EAAE,SAAoB;QAC7D,MAAM,cAAc,CAAC,SAAS,CAAC,sCAAsC,CAAC,CAAC;IACzE,CAAC;CACF,CAAC"}
@@ -4,17 +4,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const sequelize_1 = require("sequelize");
7
- const pb_sequelize_1 = __importDefault(require("./pb-sequelize"));
8
7
  const user_1 = __importDefault(require("./user"));
9
- // order of InferAttributes & InferCreationAttributes is important.
10
- class FeaturedCapper extends sequelize_1.Model {
8
+ const pb_sequelize_1 = __importDefault(require("./pb-sequelize"));
9
+ class RecurlyPaymentMonitoringWhitelist extends sequelize_1.Model {
11
10
  }
12
- FeaturedCapper.init({
11
+ RecurlyPaymentMonitoringWhitelist.init({
13
12
  id: {
14
13
  type: sequelize_1.DataTypes.BIGINT,
15
14
  primaryKey: true,
16
15
  allowNull: false,
17
- defaultValue: pb_sequelize_1.default.fn("next_id"),
16
+ autoIncrement: true,
18
17
  },
19
18
  userId: {
20
19
  type: sequelize_1.DataTypes.BIGINT,
@@ -22,30 +21,25 @@ FeaturedCapper.init({
22
21
  field: "user_id",
23
22
  references: {
24
23
  model: user_1.default,
24
+ key: "id",
25
25
  },
26
- },
27
- priority: {
28
- type: sequelize_1.DataTypes.SMALLINT,
29
- field: "priority",
30
- },
31
- customLabel: {
32
- type: sequelize_1.DataTypes.STRING,
33
- field: "custom_label",
26
+ onDelete: "CASCADE",
34
27
  },
35
28
  createdAt: sequelize_1.DataTypes.DATE,
36
- updatedAt: sequelize_1.DataTypes.DATE,
37
29
  }, {
38
- tableName: "featured_cappers",
39
30
  sequelize: pb_sequelize_1.default,
31
+ tableName: "recurly_payment_monitoring_whitelist",
32
+ timestamps: false,
40
33
  });
41
- user_1.default.hasOne(FeaturedCapper, {
34
+ user_1.default.hasOne(RecurlyPaymentMonitoringWhitelist, {
42
35
  foreignKey: "userId",
43
36
  sourceKey: "id",
37
+ as: "paymentMonitoringWhitelist",
44
38
  });
45
- FeaturedCapper.hasOne(user_1.default, {
46
- foreignKey: "id",
47
- sourceKey: "userId",
48
- onDelete: "NO ACTION",
39
+ RecurlyPaymentMonitoringWhitelist.belongsTo(user_1.default, {
40
+ foreignKey: "userId",
41
+ targetKey: "id",
42
+ as: "user",
49
43
  });
50
- exports.default = FeaturedCapper;
51
- //# sourceMappingURL=featured-capper.js.map
44
+ exports.default = RecurlyPaymentMonitoringWhitelist;
45
+ //# sourceMappingURL=recurly-payment-monitoring-whitelist.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recurly-payment-monitoring-whitelist.js","sourceRoot":"","sources":["../../typed-model/recurly-payment-monitoring-whitelist.ts"],"names":[],"mappings":";;;;;AAAA,yCAMmB;AAEnB,kDAA0B;AAE1B,kEAAuC;AAEvC,MAAM,iCAAkC,SAAQ,iBAG/C;CAIA;AAED,iCAAiC,CAAC,IAAI,CACpC;IACE,EAAE,EAAE;QACF,IAAI,EAAE,qBAAS,CAAC,MAAM;QACtB,UAAU,EAAE,IAAI;QAChB,SAAS,EAAE,KAAK;QAChB,aAAa,EAAE,IAAI;KACpB;IACD,MAAM,EAAE;QACN,IAAI,EAAE,qBAAS,CAAC,MAAM;QACtB,SAAS,EAAE,KAAK;QAChB,KAAK,EAAE,SAAS;QAChB,UAAU,EAAE;YACV,KAAK,EAAE,cAAI;YACX,GAAG,EAAE,IAAI;SACV;QACD,QAAQ,EAAE,SAAS;KACpB;IACD,SAAS,EAAE,qBAAS,CAAC,IAAI;CAC1B,EACD;IACE,SAAS,EAAT,sBAAS;IACT,SAAS,EAAE,sCAAsC;IACjD,UAAU,EAAE,KAAK;CAClB,CACF,CAAC;AAGF,cAAI,CAAC,MAAM,CAAC,iCAAiC,EAAE;IAC7C,UAAU,EAAE,QAAQ;IACpB,SAAS,EAAE,IAAI;IACf,EAAE,EAAE,4BAA4B;CACjC,CAAC,CAAC;AAEH,iCAAiC,CAAC,SAAS,CAAC,cAAI,EAAE;IAChD,UAAU,EAAE,QAAQ;IACpB,SAAS,EAAE,IAAI;IACf,EAAE,EAAE,MAAM;CACX,CAAC,CAAC;AAEH,kBAAe,iCAAiC,CAAC"}
@@ -133,7 +133,7 @@ User.init({
133
133
  platformFee: {
134
134
  type: sequelize_1.DataTypes.INTEGER,
135
135
  field: "platform_fee",
136
- defaultValue: 20,
136
+ defaultValue: 15,
137
137
  },
138
138
  profileViews: {
139
139
  type: sequelize_1.DataTypes.INTEGER,
@@ -0,0 +1,29 @@
1
+ require("dotenv").config();
2
+
3
+ module.exports = {
4
+ development: {
5
+ dialect: "postgres",
6
+ host: process.env.TS_DB_HOST,
7
+ port: process.env.TS_DB_PORT,
8
+ database: process.env.TS_DB_NAME,
9
+ username: process.env.TS_DB_USER,
10
+ password: process.env.TS_DB_PASSWORD,
11
+ dialectOptions: {
12
+ ssl: false,
13
+ },
14
+ },
15
+ production: {
16
+ dialect: "postgres",
17
+ host: process.env.TS_DB_HOST,
18
+ port: process.env.TS_DB_PORT,
19
+ database: process.env.TS_DB_NAME,
20
+ username: process.env.TS_DB_USER,
21
+ password: process.env.TS_DB_PASSWORD,
22
+ dialectOptions: {
23
+ ssl: {
24
+ require: true,
25
+ rejectUnauthorized: false,
26
+ },
27
+ },
28
+ },
29
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@winible/winible-typed",
3
- "version": "2.70.4",
3
+ "version": "2.70.5",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -186,7 +186,7 @@ User.init(
186
186
  platformFee: {
187
187
  type: DataTypes.INTEGER,
188
188
  field: "platform_fee",
189
- defaultValue: 20,
189
+ defaultValue: 15,
190
190
  },
191
191
  profileViews: {
192
192
  type: DataTypes.INTEGER,
@@ -1 +0,0 @@
1
- {"version":3,"file":"featured-capper.js","sourceRoot":"","sources":["../../typed-model/featured-capper.ts"],"names":[],"mappings":";;;;;AAAA,yCAMmB;AAEnB,kEAAuC;AACvC,kDAA0B;AAE1B,mEAAmE;AACnE,MAAM,cAAe,SAAQ,iBAG5B;CAUA;AAED,cAAc,CAAC,IAAI,CACjB;IACE,EAAE,EAAE;QACF,IAAI,EAAE,qBAAS,CAAC,MAAM;QACtB,UAAU,EAAE,IAAI;QAChB,SAAS,EAAE,KAAK;QAChB,YAAY,EAAE,sBAAS,CAAC,EAAE,CAAC,SAAS,CAAC;KACtC;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,QAAQ,EAAE;QACR,IAAI,EAAE,qBAAS,CAAC,QAAQ;QACxB,KAAK,EAAE,UAAU;KAClB;IACD,WAAW,EAAE;QACX,IAAI,EAAE,qBAAS,CAAC,MAAM;QACtB,KAAK,EAAE,cAAc;KACtB;IAED,SAAS,EAAE,qBAAS,CAAC,IAAI;IACzB,SAAS,EAAE,qBAAS,CAAC,IAAI;CAC1B,EACD;IACE,SAAS,EAAE,kBAAkB;IAC7B,SAAS,EAAT,sBAAS;CACV,CACF,CAAC;AAEF,cAAI,CAAC,MAAM,CAAC,cAAc,EAAE;IAC1B,UAAU,EAAE,QAAQ;IACpB,SAAS,EAAE,IAAI;CAChB,CAAC,CAAC;AAEH,cAAc,CAAC,MAAM,CAAC,cAAI,EAAE;IAC1B,UAAU,EAAE,IAAI;IAChB,SAAS,EAAE,QAAQ;IACnB,QAAQ,EAAE,WAAW;CACtB,CAAC,CAAC;AAEH,kBAAe,cAAc,CAAC"}
@@ -1,90 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- /**
4
- * @param message The log message
5
- * @param options Additional context for the log entry
6
- *
7
- * @example
8
- * // Basic usage
9
- * logger("User login successful");
10
- *
11
- * @example
12
- * // With user ID
13
- * logger("User login successful", { userId: "123456" });
14
- *
15
- * @example
16
- * // With error tracking (standard Error)
17
- * try {
18
- * throw new Error("Something went wrong");
19
- * } catch (error) {
20
- * logger("Operation failed", {
21
- * userId: "user123",
22
- * level: "error",
23
- * endpoint: "/auth",
24
- * method: "processPayment",
25
- * error
26
- * });
27
- * }
28
- *
29
- * @example
30
- * // With object-like error (e.g., from an API)
31
- * const apiError = { status: 403, message: "Forbidden", code: "ACCESS_DENIED" };
32
- * logger("API request failed", { error: apiError, level: "error" });
33
- *
34
- * @example
35
- * // With primitive error
36
- * logger("Validation failed", { error: "Invalid input", level: "warn" });
37
- *
38
- * @example
39
- * // With request tracking
40
- * logger("API request received", {
41
- * requestId: req.headers['x-request-id'],
42
- * endpoint: "/auth",
43
- * method: "validateToken"
44
- * action: "validateToken"
45
- * });
46
- */
47
- const logger = (message, options) => {
48
- const timestamp = new Date().toISOString();
49
- const environment = process.env.ENVIRONMENT || "development";
50
- const logEntry = Object.assign(Object.assign({ message, requestId: (options === null || options === void 0 ? void 0 : options.requestId) || "", timestamp, level: (options === null || options === void 0 ? void 0 : options.level) || "info", environment, endpoint: (options === null || options === void 0 ? void 0 : options.endpoint) || "", method: (options === null || options === void 0 ? void 0 : options.method) || "", action: (options === null || options === void 0 ? void 0 : options.action) || "", userId: (options === null || options === void 0 ? void 0 : options.userId) || "" }, ((options === null || options === void 0 ? void 0 : options.error)
51
- ? {
52
- error: (() => {
53
- var _a, _b, _c;
54
- // Handle different error types
55
- if (options.error instanceof Error) {
56
- // Standard Error object
57
- return {
58
- name: (_a = options.error) === null || _a === void 0 ? void 0 : _a.name,
59
- message: (_b = options.error) === null || _b === void 0 ? void 0 : _b.message,
60
- stack: (_c = options.error) === null || _c === void 0 ? void 0 : _c.stack,
61
- };
62
- }
63
- else if (typeof options.error === "object" &&
64
- options.error !== null) {
65
- // Object-like error but not an Error instance
66
- const errorObj = options.error;
67
- return {
68
- name: (errorObj === null || errorObj === void 0 ? void 0 : errorObj.name) || "UnknownError",
69
- message: (errorObj === null || errorObj === void 0 ? void 0 : errorObj.message) || String(errorObj),
70
- details: errorObj,
71
- };
72
- }
73
- else {
74
- // Primitive or other non-object error
75
- return {
76
- name: "UnknownError",
77
- message: String(options.error),
78
- };
79
- }
80
- })(),
81
- }
82
- : {})), ((options === null || options === void 0 ? void 0 : options.additionalData) ? { data: options.additionalData } : {}));
83
- // Log as JSON string on production for easier parsing in CloudWatch
84
- const outputLog = environment === "production"
85
- ? JSON.stringify(logEntry)
86
- : JSON.stringify(logEntry, null, 2);
87
- console.log(outputLog);
88
- };
89
- exports.default = logger;
90
- //# sourceMappingURL=logger.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"logger.js","sourceRoot":"","sources":["../../../utils/lambdaUtils/logger.ts"],"names":[],"mappings":";;AAWA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,MAAM,MAAM,GAAG,CAAC,OAAe,EAAE,OAAuB,EAAE,EAAE;IAC1D,MAAM,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC3C,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,aAAa,CAAC;IAE7D,MAAM,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