@winible/winible-typed 1.0.6 → 1.0.8
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/index.d.ts +3 -0
- package/dist/migrations/20220601151258-custom_name_describing_your_migration.d.ts +6 -0
- package/dist/migrations/20220605225655-create-dashboard-user-permissions.d.ts +6 -0
- package/dist/migrations/20220606001300-update-dashboard-user-permissions.d.ts +6 -0
- package/dist/migrations/20220607091109-add-read-date-for-message.d.ts +6 -0
- package/dist/migrations/20220616225456-add-delete-columns.d.ts +6 -0
- package/dist/migrations/20220709202211-disable-feed.d.ts +6 -0
- package/dist/migrations/20220723215213-limit-promotion-claims.d.ts +6 -0
- package/dist/migrations/20220723220233-num_claims.d.ts +6 -0
- package/dist/migrations/20220723221907-default_false_promos.d.ts +6 -0
- package/dist/migrations/20220724172559-default_zero_claims.d.ts +6 -0
- package/dist/migrations/20220724201419-pinned_post.d.ts +6 -0
- package/dist/migrations/20220729164625-unsend_mass.d.ts +6 -0
- package/dist/migrations/20220823033002-interval-unit.d.ts +6 -0
- package/dist/migrations/20220830193530-processorId.d.ts +6 -0
- package/dist/migrations/20220907121932-add-processor-to-sub.d.ts +6 -0
- package/dist/migrations/20220907212232-add-trans-id.d.ts +6 -0
- package/dist/migrations/20220907220423-big-int-trans.d.ts +6 -0
- package/dist/migrations/20220909161902-add-stale.d.ts +6 -0
- package/dist/migrations/20220922000225-verified-spender.d.ts +6 -0
- package/dist/migrations/20220922212108-verified-spender-2.d.ts +6 -0
- package/dist/migrations/20221013223648-product-subscription-list.d.ts +6 -0
- package/dist/migrations/20221014001037-product-subscription-list.d.ts +6 -0
- package/dist/migrations/20221026055245-update-type.d.ts +6 -0
- package/dist/migrations/20221108060019-recurly-sub.d.ts +6 -0
- package/dist/migrations/20221110170148-rename-recurly-account.d.ts +6 -0
- package/dist/migrations/20221112212510-archive-promo.d.ts +6 -0
- package/dist/migrations/20221117044529-sub-status.d.ts +6 -0
- package/dist/migrations/20221122051433-default-plan.d.ts +6 -0
- package/dist/migrations/20221128034620-invoice-id.d.ts +6 -0
- package/dist/migrations/20221128034620-invoice-id.js +12 -0
- package/dist/migrations/20221128034620-invoice-id.js.map +1 -0
- package/dist/migrations/20230104055346-oddsjam.js +501 -0
- package/dist/migrations/20230104055346-oddsjam.js.map +1 -0
- package/dist/migrations/20230104233909-markets.js +28 -0
- package/dist/migrations/20230104233909-markets.js.map +1 -0
- package/dist/migrations/20230105005418-sportsbook.js +24 -0
- package/dist/migrations/20230105005418-sportsbook.js.map +1 -0
- package/dist/migrations/20230106044910-player-result.js +59 -0
- package/dist/migrations/20230106044910-player-result.js.map +1 -0
- package/dist/scripts/bet-syncing/gradeBets.js +109 -0
- package/dist/scripts/bet-syncing/gradeBets.js.map +1 -0
- package/dist/scripts/bet-syncing/pullGames.js +198 -0
- package/dist/scripts/bet-syncing/pullGames.js.map +1 -0
- package/dist/scripts/bet-syncing/pullLiveScores.js +187 -0
- package/dist/scripts/bet-syncing/pullLiveScores.js.map +1 -0
- package/dist/scripts/bet-syncing/pullOdds.js +255 -0
- package/dist/scripts/bet-syncing/pullOdds.js.map +1 -0
- package/dist/scripts/bet-syncing/pullPlayerResults.js +63 -0
- package/dist/scripts/bet-syncing/pullPlayerResults.js.map +1 -0
- package/dist/scripts/bet-syncing/pullPlayers.js +59 -0
- package/dist/scripts/bet-syncing/pullPlayers.js.map +1 -0
- package/dist/scripts/bet-syncing/pullScores.js +183 -0
- package/dist/scripts/bet-syncing/pullScores.js.map +1 -0
- package/dist/scripts/bet-syncing/pullTeams.d.ts +1 -0
- package/dist/scripts/bet-syncing/pullTeams.js +85 -0
- package/dist/scripts/bet-syncing/pullTeams.js.map +1 -0
- package/dist/scripts/cleanupRecurlyPlans.d.ts +1 -0
- package/dist/scripts/createDashboardLink.d.ts +1 -0
- package/dist/scripts/createDashboardLink.js +4 -4
- package/dist/scripts/createDashboardLink.js.map +1 -1
- package/dist/scripts/createRecurlyPlans.d.ts +1 -0
- package/dist/scripts/deleteMalformedImages.d.ts +1 -0
- package/dist/scripts/fixSaltedPasswords.js +40 -0
- package/dist/scripts/fixSaltedPasswords.js.map +1 -0
- package/dist/scripts/mapCurrentPaymentsToInvoiceId.d.ts +1 -0
- package/dist/scripts/mapCurrentPaymentsToInvoiceId.js +91 -0
- package/dist/scripts/mapCurrentPaymentsToInvoiceId.js.map +1 -0
- package/dist/scripts/payoutRecurlySubs.d.ts +1 -0
- package/dist/scripts/payoutRecurlySubs.js +8 -1
- package/dist/scripts/payoutRecurlySubs.js.map +1 -1
- package/dist/scripts/payoutSubscriptions.d.ts +1 -0
- package/dist/scripts/payoutSubscriptions.js +18 -10
- package/dist/scripts/payoutSubscriptions.js.map +1 -1
- package/dist/scripts/removeUnreferenceSubs.d.ts +1 -0
- package/dist/scripts/test.d.ts +1 -0
- package/dist/scripts/test.js +3 -21
- package/dist/scripts/test.js.map +1 -1
- package/dist/slack/index.d.ts +1 -0
- package/dist/{server → slack}/index.js +0 -4
- package/dist/slack/index.js.map +1 -0
- package/dist/slack/v1/bypassCreator.d.ts +8 -0
- package/dist/slack/v1/bypassCreator.js.map +1 -0
- package/dist/slack/v1/cancelSubscription.d.ts +6 -0
- package/dist/slack/v1/cancelSubscription.js.map +1 -0
- package/dist/slack/v1/changeName.d.ts +8 -0
- package/dist/slack/v1/changeName.js.map +1 -0
- package/dist/slack/v1/checkAuthSub.d.ts +6 -0
- package/dist/{server → slack}/v1/checkAuthSub.js +5 -5
- package/dist/slack/v1/checkAuthSub.js.map +1 -0
- package/dist/slack/v1/dashboardLink.d.ts +8 -0
- package/dist/{server → slack}/v1/dashboardLink.js +1 -1
- package/dist/slack/v1/dashboardLink.js.map +1 -0
- package/dist/slack/v1/index.d.ts +7 -0
- package/dist/{server → slack}/v1/index.js +1 -8
- package/dist/slack/v1/index.js.map +1 -0
- package/dist/slack/v1/refund.d.ts +6 -0
- package/dist/slack/v1/refund.js +42 -0
- package/dist/slack/v1/refund.js.map +1 -0
- package/dist/slack/v1/searchUser.d.ts +6 -0
- package/dist/slack/v1/searchUser.js.map +1 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/src/pk-client.d.ts +151 -0
- package/dist/src/pk-sub.d.ts +77 -0
- package/dist/src/recurlyInstance.d.ts +3 -0
- package/dist/src/types.d.ts +30 -0
- package/dist/support/index.d.ts +2 -0
- package/dist/support/slack-client.d.ts +3 -0
- package/dist/support/uploadcare.d.ts +14 -0
- package/dist/support/utils.d.ts +2 -0
- package/dist/typed-model/asset-category.d.ts +9 -0
- package/dist/typed-model/asset-constent-person.d.ts +13 -0
- package/dist/typed-model/bet.d.ts +12 -0
- package/dist/typed-model/bet.js +64 -0
- package/dist/typed-model/bet.js.map +1 -0
- package/dist/typed-model/blocked-ip.d.ts +8 -0
- package/dist/typed-model/category-tag.d.ts +9 -0
- package/dist/typed-model/consent-person.d.ts +13 -0
- package/dist/typed-model/content-category-tag.d.ts +9 -0
- package/dist/typed-model/content-like.d.ts +10 -0
- package/dist/typed-model/credit-payment.d.ts +34 -0
- package/dist/typed-model/credit-payment.js +10 -6
- package/dist/typed-model/credit-payment.js.map +1 -1
- package/dist/typed-model/credit-payout.d.ts +10 -0
- package/dist/typed-model/credit-purchase.d.ts +10 -0
- package/dist/typed-model/customer-profile.d.ts +17 -0
- package/dist/typed-model/dashboard-user-permissions.d.ts +9 -0
- package/dist/typed-model/dashboard-user.d.ts +20 -0
- package/dist/typed-model/fan-list.d.ts +10 -0
- package/dist/typed-model/fraud.d.ts +9 -0
- package/dist/typed-model/game.d.ts +56 -0
- package/dist/typed-model/game.js +234 -0
- package/dist/typed-model/game.js.map +1 -0
- package/dist/typed-model/index.d.ts +46 -0
- package/dist/typed-model/index.js +15 -1
- package/dist/typed-model/index.js.map +1 -1
- package/dist/typed-model/league.d.ts +9 -0
- package/dist/typed-model/league.js +35 -0
- package/dist/typed-model/league.js.map +1 -0
- package/dist/typed-model/list-member.d.ts +9 -0
- package/dist/typed-model/market.js +36 -0
- package/dist/typed-model/market.js.map +1 -0
- package/dist/typed-model/mass-message.d.ts +11 -0
- package/dist/typed-model/media-asset.d.ts +15 -0
- package/dist/typed-model/media-category.d.ts +10 -0
- package/dist/typed-model/media.d.ts +14 -0
- package/dist/typed-model/message-media.d.ts +9 -0
- package/dist/typed-model/message.d.ts +27 -0
- package/dist/typed-model/notification.d.ts +18 -0
- package/dist/typed-model/odds.d.ts +30 -0
- package/dist/typed-model/odds.js +155 -0
- package/dist/typed-model/odds.js.map +1 -0
- package/dist/typed-model/parlay.d.ts +8 -0
- package/dist/typed-model/parlay.js +30 -0
- package/dist/typed-model/parlay.js.map +1 -0
- package/dist/typed-model/pb-sequelize.d.ts +3 -0
- package/dist/typed-model/phone-chat-participation.d.ts +20 -0
- package/dist/typed-model/phone-chat.d.ts +16 -0
- package/dist/typed-model/phone-owner.d.ts +53 -0
- package/dist/typed-model/phone-user.d.ts +21 -0
- package/dist/typed-model/player-result.js +67 -0
- package/dist/typed-model/player-result.js.map +1 -0
- package/dist/typed-model/player.d.ts +22 -0
- package/dist/typed-model/player.js +87 -0
- package/dist/typed-model/player.js.map +1 -0
- package/dist/typed-model/premium-content.d.ts +23 -0
- package/dist/typed-model/purchased-content.d.ts +11 -0
- package/dist/typed-model/recurly-account.d.ts +9 -0
- package/dist/typed-model/short-url.d.ts +12 -0
- package/dist/typed-model/sportsbook.js +31 -0
- package/dist/typed-model/sportsbook.js.map +1 -0
- package/dist/typed-model/subscription-bundle.d.ts +12 -0
- package/dist/typed-model/subscription-category-tags.d.ts +9 -0
- package/dist/typed-model/subscription-plan.d.ts +27 -0
- package/dist/typed-model/subscription-plan.js +1 -0
- package/dist/typed-model/subscription-plan.js.map +1 -1
- package/dist/typed-model/subscription-promotion.d.ts +19 -0
- package/dist/typed-model/subscription.d.ts +26 -0
- package/dist/typed-model/team.d.ts +16 -0
- package/dist/typed-model/team.js +70 -0
- package/dist/typed-model/team.js.map +1 -0
- package/dist/typed-model/twilio-phone.d.ts +17 -0
- package/dist/typed-model/user-follow.d.ts +13 -0
- package/dist/typed-model/verification-code.d.ts +11 -0
- package/dist/webhooks/index.d.ts +1 -0
- package/dist/webhooks/index.js +48 -0
- package/dist/webhooks/index.js.map +1 -0
- package/dist/webhooks/payment/index.d.ts +1 -0
- package/dist/webhooks/payment/index.js +9 -0
- package/dist/webhooks/payment/index.js.map +1 -0
- package/dist/webhooks/payment/refund.d.ts +2 -0
- package/dist/webhooks/payment/refund.js +39 -0
- package/dist/webhooks/payment/refund.js.map +1 -0
- package/package.json +3 -1
- package/typed-model/bet.ts +84 -0
- package/typed-model/credit-payment.ts +14 -9
- package/typed-model/game.ts +311 -0
- package/typed-model/index.ts +7 -0
- package/typed-model/league.ts +53 -0
- package/typed-model/market.ts +54 -0
- package/typed-model/odds.ts +232 -0
- package/typed-model/parlay.ts +47 -0
- package/typed-model/player-result.ts +93 -0
- package/typed-model/player.ts +118 -0
- package/typed-model/sportsbook.ts +48 -0
- package/typed-model/team.ts +91 -0
- package/dist/scripts/authorizeTransfer.js +0 -188
- package/dist/scripts/authorizeTransfer.js.map +0 -1
- package/dist/server/index.js.map +0 -1
- package/dist/server/v1/bypassCreator.js.map +0 -1
- package/dist/server/v1/cancelSubscription.js.map +0 -1
- package/dist/server/v1/changeName.js.map +0 -1
- package/dist/server/v1/checkAuthSub.js.map +0 -1
- package/dist/server/v1/dashboardLink.js.map +0 -1
- package/dist/server/v1/getSuspendedSubs.js +0 -76
- package/dist/server/v1/getSuspendedSubs.js.map +0 -1
- package/dist/server/v1/index.js.map +0 -1
- package/dist/server/v1/manualCreateSub.js +0 -159
- package/dist/server/v1/manualCreateSub.js.map +0 -1
- package/dist/server/v1/refund.js +0 -78
- package/dist/server/v1/refund.js.map +0 -1
- package/dist/server/v1/retrySubscription.js +0 -81
- package/dist/server/v1/retrySubscription.js.map +0 -1
- package/dist/server/v1/searchUser.js.map +0 -1
- /package/dist/{server → slack}/v1/bypassCreator.js +0 -0
- /package/dist/{server → slack}/v1/cancelSubscription.js +0 -0
- /package/dist/{server → slack}/v1/changeName.js +0 -0
- /package/dist/{server → slack}/v1/searchUser.js +0 -0
|
@@ -3,7 +3,7 @@ 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.
|
|
6
|
+
exports.dashboardlink = exports.changeName = exports.bypassCreator = exports.checkAuthSub = exports.cancelSubscription = exports.searchUser = exports.refund = void 0;
|
|
7
7
|
var refund_1 = require("./refund");
|
|
8
8
|
Object.defineProperty(exports, "refund", { enumerable: true, get: function () { return __importDefault(refund_1).default; } });
|
|
9
9
|
var searchUser_1 = require("./searchUser");
|
|
@@ -12,17 +12,10 @@ var cancelSubscription_1 = require("./cancelSubscription");
|
|
|
12
12
|
Object.defineProperty(exports, "cancelSubscription", { enumerable: true, get: function () { return __importDefault(cancelSubscription_1).default; } });
|
|
13
13
|
var checkAuthSub_1 = require("./checkAuthSub");
|
|
14
14
|
Object.defineProperty(exports, "checkAuthSub", { enumerable: true, get: function () { return __importDefault(checkAuthSub_1).default; } });
|
|
15
|
-
var retrySubscription_1 = require("./retrySubscription");
|
|
16
|
-
Object.defineProperty(exports, "retrySubscription", { enumerable: true, get: function () { return __importDefault(retrySubscription_1).default; } });
|
|
17
|
-
var getSuspendedSubs_1 = require("./getSuspendedSubs");
|
|
18
|
-
Object.defineProperty(exports, "getSuspendedSubs", { enumerable: true, get: function () { return __importDefault(getSuspendedSubs_1).default; } });
|
|
19
15
|
var bypassCreator_1 = require("./bypassCreator");
|
|
20
16
|
Object.defineProperty(exports, "bypassCreator", { enumerable: true, get: function () { return __importDefault(bypassCreator_1).default; } });
|
|
21
17
|
var changeName_1 = require("./changeName");
|
|
22
18
|
Object.defineProperty(exports, "changeName", { enumerable: true, get: function () { return __importDefault(changeName_1).default; } });
|
|
23
19
|
var dashboardLink_1 = require("./dashboardLink");
|
|
24
20
|
Object.defineProperty(exports, "dashboardlink", { enumerable: true, get: function () { return __importDefault(dashboardLink_1).default; } });
|
|
25
|
-
var manualCreateSub_1 = require("./manualCreateSub");
|
|
26
|
-
Object.defineProperty(exports, "manualCreateSub", { enumerable: true, get: function () { return __importDefault(manualCreateSub_1).default; } });
|
|
27
|
-
Object.defineProperty(exports, "responseToManualCreateSub", { enumerable: true, get: function () { return manualCreateSub_1.responseToManualCreateSub; } });
|
|
28
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../slack/v1/index.ts"],"names":[],"mappings":";;;;;;AAAA,mCAA6C;AAApC,iHAAA,OAAO,OAAU;AAC1B,2CAAqD;AAA5C,yHAAA,OAAO,OAAc;AAC9B,2DAAqE;AAA5D,yIAAA,OAAO,OAAsB;AACtC,+CAAyD;AAAhD,6HAAA,OAAO,OAAgB;AAChC,iDAA2D;AAAlD,+HAAA,OAAO,OAAiB;AACjC,2CAAqD;AAA5C,yHAAA,OAAO,OAAc;AAC9B,iDAA2D;AAAlD,+HAAA,OAAO,OAAiB"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const src_1 = require("../../src");
|
|
4
|
+
const typed_model_1 = require("../../typed-model");
|
|
5
|
+
exports.default = async ({ ack, say, payload }) => {
|
|
6
|
+
await ack();
|
|
7
|
+
let creditPaymentId = payload.text;
|
|
8
|
+
let creditPayment = await typed_model_1.CreditPayments.findByPk(creditPaymentId);
|
|
9
|
+
await say("Attempting to refund credit payment id: " + creditPaymentId);
|
|
10
|
+
if (!creditPayment) {
|
|
11
|
+
await say("Credit payment does not exist");
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
let invoceId = creditPayment === null || creditPayment === void 0 ? void 0 : creditPayment.invoiceId;
|
|
15
|
+
if (creditPayment.earningAmountInCents <= 0) {
|
|
16
|
+
return await say("Already refunded");
|
|
17
|
+
}
|
|
18
|
+
if (!invoceId) {
|
|
19
|
+
return await say("Credit payment does have invoce Id. Please handle manually");
|
|
20
|
+
}
|
|
21
|
+
let invoice = await src_1.recurlyInstance.getInvoice(invoceId);
|
|
22
|
+
await src_1.recurlyInstance.refundInvoice(invoceId, {
|
|
23
|
+
type: "line_items",
|
|
24
|
+
lineItems: [{ prorate: false, id: invoice.lineItems[0].id }],
|
|
25
|
+
});
|
|
26
|
+
if (!creditPayment.payoutDate) {
|
|
27
|
+
await say("Emptying credit payment");
|
|
28
|
+
creditPayment.creditAmountInCents = 0;
|
|
29
|
+
creditPayment.earningAmountInCents = 0;
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
await say("Reversing credit payment");
|
|
33
|
+
creditPayment.creditAmountInCents = 0;
|
|
34
|
+
creditPayment.earningAmountInCents =
|
|
35
|
+
creditPayment.earningAmountInCents * -1;
|
|
36
|
+
creditPayment.payoutDate = undefined;
|
|
37
|
+
creditPayment.setAttributes("payoutDate", undefined);
|
|
38
|
+
}
|
|
39
|
+
await creditPayment.save();
|
|
40
|
+
await say("Refund completed");
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=refund.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refund.js","sourceRoot":"","sources":["../../../slack/v1/refund.ts"],"names":[],"mappings":";;AAAA,mCAA4C;AAI5C,mDAAoE;AAGpE,kBAAe,KAAK,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE;IAC7C,MAAM,GAAG,EAAE,CAAC;IACZ,IAAI,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IACnC,IAAI,aAAa,GAAG,MAAM,4BAAc,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC;IACnE,MAAM,GAAG,CAAC,0CAA0C,GAAG,eAAe,CAAC,CAAC;IAExE,IAAI,CAAC,aAAa,EAAE;QA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AgB,EAAE;yBAChD;wBACD;4BACE,IAAI,EAAE,QAAQ;4BACd,IAAI,EAAE,gBAAgB,GAAG,CAAC,WAAW,EAAE;yBACxC;wBACD;4BACE,IAAI,EAAE,QAAQ;4BACd,IAAI,EAAE,eAAe,GAAG,CAAC,gBAAgB,EAAE;yBAC5C;wBACD;4BACE,IAAI,EAAE,QAAQ;4BACd,IAAI,EAAE,SAAS,GAAG,CAAC,EAAE,EAAE;yBACxB;qBACF;iBACF,CAAC;YACJ,CAAC,CAAC;SACH;KACF,CAAC,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import PKCustomerProfile, { ProcessorId } from "../typed-model/customer-profile";
|
|
2
|
+
import PhoneUser from "../typed-model/phone-user";
|
|
3
|
+
import { APIContracts } from "authorizenet";
|
|
4
|
+
import { TransactionData, PkSubStatus } from "./types";
|
|
5
|
+
import { Subscription } from "../typed-model";
|
|
6
|
+
export declare type TransactionStatus = "authorizedPendingCapture" | "capturedPendingSettlement" | "communicationError" | "refundSettledSuccessfully" | "refundPendingSettlement" | "approvedReview" | "declined" | "couldNotVoid" | "expired" | "generalError" | "failedReview" | "settledSuccessfully" | "settlementError" | "underReview" | "voided" | "FDSPendingReview" | "FDSAuthorizedPendingReview" | "returnedItem";
|
|
7
|
+
export declare const createCustomerProfile: (user: PhoneUser, data: TransactionData) => Promise<unknown>;
|
|
8
|
+
export declare const getCustomerProfile: (customerProfileId?: string, userId?: string) => Promise<any>;
|
|
9
|
+
export declare const getCustomerPaymentProfile: (customerProfileId: string, customerPaymentProfileId: string) => Promise<TransactionData>;
|
|
10
|
+
export declare const addPaymentProfile: (customerProfileId: string, data: TransactionData) => Promise<string>;
|
|
11
|
+
export declare const deleteCustomerProfile: (customerProfileId: string, customerPaymentProfileId: string) => Promise<unknown>;
|
|
12
|
+
export declare const updateCustomerProfile: (customerProfileId: string, customerPaymentProfileId: string, data: TransactionData) => Promise<{
|
|
13
|
+
customerPaymentProfileId: string;
|
|
14
|
+
processorId: ProcessorId;
|
|
15
|
+
}>;
|
|
16
|
+
export declare const chargeCreditCardAndCreateProfile: (user: PhoneUser, data: TransactionData, amountInCents: number, description: string, skipProfileCreation?: boolean, useCoachingMid?: boolean) => Promise<{
|
|
17
|
+
amountInCents: number;
|
|
18
|
+
transactionId: string;
|
|
19
|
+
pkCustomerProfileId?: string | undefined;
|
|
20
|
+
pkCustomerPaymentProfileId?: string | undefined;
|
|
21
|
+
processorId: ProcessorId;
|
|
22
|
+
}>;
|
|
23
|
+
export declare const purchaseCreditsWithCreditCardAndCreatorProfile: (user: PhoneUser, data: TransactionData, amountInCents: number) => Promise<{
|
|
24
|
+
amountInCents: number;
|
|
25
|
+
transactionId: string;
|
|
26
|
+
processorId: ProcessorId;
|
|
27
|
+
}>;
|
|
28
|
+
export declare const purchaseCreditsWithCustomerProfile: (customerProfileId: string, customerPaymentProfileId: string, amountInCents: number) => Promise<{
|
|
29
|
+
amountInCents: number;
|
|
30
|
+
transactionId: string;
|
|
31
|
+
processorId: ProcessorId;
|
|
32
|
+
}>;
|
|
33
|
+
export declare const chargeCustomerByPaymentProfile: (customerProfileId: string, customerPaymentProfileId: string, amountInCents: number, description: string) => Promise<{
|
|
34
|
+
amountInCents: number;
|
|
35
|
+
transactionId: string;
|
|
36
|
+
processorId: ProcessorId;
|
|
37
|
+
}>;
|
|
38
|
+
export declare function createSubscription({ intervalCount, intervalUnit, trialLength, amountInCents, trialAmountInCents, customerProfileId, customerPaymentProfileId, creatorName, processorId, startDate, }: {
|
|
39
|
+
intervalCount: number;
|
|
40
|
+
intervalUnit: "months" | "days";
|
|
41
|
+
trialAmountInCents: number;
|
|
42
|
+
trialLength: number;
|
|
43
|
+
amountInCents: number;
|
|
44
|
+
customerProfileId: string;
|
|
45
|
+
customerPaymentProfileId: string;
|
|
46
|
+
creatorName: string;
|
|
47
|
+
processorId: ProcessorId;
|
|
48
|
+
startDate?: Date;
|
|
49
|
+
}): Promise<{
|
|
50
|
+
pkSubId: string;
|
|
51
|
+
}>;
|
|
52
|
+
export declare function createSubscriptionWithCreditCard({ intervalCount, intervalUnit, trialLength, amountInCents, trialAmountInCents, data, creatorName, processorId: processorId, }: {
|
|
53
|
+
intervalCount: number;
|
|
54
|
+
intervalUnit: "months" | "days";
|
|
55
|
+
trialAmountInCents: number;
|
|
56
|
+
trialLength: number;
|
|
57
|
+
amountInCents: number;
|
|
58
|
+
data: TransactionData;
|
|
59
|
+
creatorName: string;
|
|
60
|
+
processorId: ProcessorId;
|
|
61
|
+
}): Promise<{
|
|
62
|
+
pkSubId: string;
|
|
63
|
+
paymentProfile: {
|
|
64
|
+
pkCustomerProfileId?: string;
|
|
65
|
+
pkCustomerPaymentProfileId?: string;
|
|
66
|
+
processorId: ProcessorId;
|
|
67
|
+
};
|
|
68
|
+
}>;
|
|
69
|
+
export declare function cancelSubscription(subscription: Subscription, processorId: ProcessorId): Promise<unknown>;
|
|
70
|
+
export declare function updateSubscription({ authSubscriptionId, intervalCount, intervalUnit, processorId: processorId, }: {
|
|
71
|
+
authSubscriptionId: number;
|
|
72
|
+
intervalCount: number;
|
|
73
|
+
intervalUnit: "months" | "days";
|
|
74
|
+
processorId: ProcessorId;
|
|
75
|
+
}): Promise<unknown>;
|
|
76
|
+
export declare function getSubscription(subscriptionId: string, processorId: ProcessorId): Promise<unknown>;
|
|
77
|
+
export declare function getSubscriptionStatus(subscriptionId: string, processorId: ProcessorId): Promise<PkSubStatus>;
|
|
78
|
+
export declare function getSubscriptionList(processorId: ProcessorId, inactive?: boolean): Promise<APIContracts.SubscriptionDetail[]>;
|
|
79
|
+
export declare function voidTransaction(transactionId: string, processorId: ProcessorId): Promise<unknown>;
|
|
80
|
+
export declare const updateUserPaymentProfile: (userId: string, customerProfileId: string, processorId: ProcessorId, pkCustomerPaymentProfileId?: string) => Promise<PKCustomerProfile>;
|
|
81
|
+
export declare function getTransactionsForCustomerProfile({ customerProfileId, processorId, }: {
|
|
82
|
+
customerProfileId: string;
|
|
83
|
+
processorId: ProcessorId;
|
|
84
|
+
}): Promise<{
|
|
85
|
+
transId: string;
|
|
86
|
+
amountInCents: number;
|
|
87
|
+
status: string;
|
|
88
|
+
}[]>;
|
|
89
|
+
export declare function refundTransaction({ transId, creditCard, customerProfile, amountInCents, processorId, }: {
|
|
90
|
+
transId: number;
|
|
91
|
+
creditCard?: APIContracts.CreditCardMaskedType;
|
|
92
|
+
customerProfile?: APIContracts.CustomerProfileIdType;
|
|
93
|
+
amountInCents: number;
|
|
94
|
+
processorId: ProcessorId;
|
|
95
|
+
}): Promise<{
|
|
96
|
+
refundTransactionId: string;
|
|
97
|
+
}>;
|
|
98
|
+
export declare function getTransactionStatus({ transId, processorId, }: {
|
|
99
|
+
transId: number;
|
|
100
|
+
processorId: ProcessorId;
|
|
101
|
+
}): Promise<{
|
|
102
|
+
status: TransactionStatus;
|
|
103
|
+
transId: number;
|
|
104
|
+
code: "1" | "2" | "3" | "4";
|
|
105
|
+
settleAmountInCents: number;
|
|
106
|
+
creditCard?: APIContracts.CreditCardMaskedType;
|
|
107
|
+
customerProfile?: APIContracts.CustomerProfileIdType;
|
|
108
|
+
}>;
|
|
109
|
+
declare const _default: {
|
|
110
|
+
createCustomerProfile: (user: PhoneUser, data: TransactionData) => Promise<unknown>;
|
|
111
|
+
getCustomerProfile: (customerProfileId?: string | undefined, userId?: string | undefined) => Promise<any>;
|
|
112
|
+
addPaymentProfile: (customerProfileId: string, data: TransactionData) => Promise<string>;
|
|
113
|
+
deleteCustomerProfile: (customerProfileId: string, customerPaymentProfileId: string) => Promise<unknown>;
|
|
114
|
+
updateCustomerProfile: (customerProfileId: string, customerPaymentProfileId: string, data: TransactionData) => Promise<{
|
|
115
|
+
customerPaymentProfileId: string;
|
|
116
|
+
processorId: ProcessorId;
|
|
117
|
+
}>;
|
|
118
|
+
purchaseCreditsWithCustomerProfile: (customerProfileId: string, customerPaymentProfileId: string, amountInCents: number) => Promise<{
|
|
119
|
+
amountInCents: number;
|
|
120
|
+
transactionId: string;
|
|
121
|
+
processorId: ProcessorId;
|
|
122
|
+
}>;
|
|
123
|
+
purchaseCreditsWithCreditCardAndCreatorProfile: (user: PhoneUser, data: TransactionData, amountInCents: number) => Promise<{
|
|
124
|
+
amountInCents: number;
|
|
125
|
+
transactionId: string;
|
|
126
|
+
processorId: ProcessorId;
|
|
127
|
+
}>;
|
|
128
|
+
createSubscription: typeof createSubscription;
|
|
129
|
+
cancelSubscription: typeof cancelSubscription;
|
|
130
|
+
getSubscription: typeof getSubscription;
|
|
131
|
+
getSubscriptionStatus: typeof getSubscriptionStatus;
|
|
132
|
+
chargeCustomerByPaymentProfile: (customerProfileId: string, customerPaymentProfileId: string, amountInCents: number, description: string) => Promise<{
|
|
133
|
+
amountInCents: number;
|
|
134
|
+
transactionId: string;
|
|
135
|
+
processorId: ProcessorId;
|
|
136
|
+
}>;
|
|
137
|
+
getSubscriptionList: typeof getSubscriptionList;
|
|
138
|
+
updateUserPaymentProfile: (userId: string, customerProfileId: string, processorId: ProcessorId, pkCustomerPaymentProfileId?: string | undefined) => Promise<PKCustomerProfile>;
|
|
139
|
+
voidTransaction: typeof voidTransaction;
|
|
140
|
+
chargeCreditCardAndCreateProfile: (user: PhoneUser, data: TransactionData, amountInCents: number, description: string, skipProfileCreation?: boolean | undefined, useCoachingMid?: boolean | undefined) => Promise<{
|
|
141
|
+
amountInCents: number;
|
|
142
|
+
transactionId: string;
|
|
143
|
+
pkCustomerProfileId?: string | undefined;
|
|
144
|
+
pkCustomerPaymentProfileId?: string | undefined;
|
|
145
|
+
processorId: ProcessorId;
|
|
146
|
+
}>;
|
|
147
|
+
getTransactionsForCustomerProfile: typeof getTransactionsForCustomerProfile;
|
|
148
|
+
getTransactionStatus: typeof getTransactionStatus;
|
|
149
|
+
refundTransaction: typeof refundTransaction;
|
|
150
|
+
};
|
|
151
|
+
export default _default;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import PhoneUser from "../typed-model/phone-user";
|
|
2
|
+
import PhoneOwner from "../typed-model/phone-owner";
|
|
3
|
+
import SubscriptionPlan from "../typed-model/subscription-plan";
|
|
4
|
+
import SubscriptionBundle from "../typed-model/subscription-bundle";
|
|
5
|
+
import { TransactionData } from "./types";
|
|
6
|
+
import { ProcessorId } from "../typed-model/customer-profile";
|
|
7
|
+
export declare class SubscriptionInitException extends Error {
|
|
8
|
+
constructor(message: string);
|
|
9
|
+
}
|
|
10
|
+
export declare class SubscriptionChargeException extends Error {
|
|
11
|
+
constructor(message: string);
|
|
12
|
+
}
|
|
13
|
+
export declare class SubscriptionChargeCreditCardException extends SubscriptionChargeException {
|
|
14
|
+
constructor(message: string);
|
|
15
|
+
}
|
|
16
|
+
export declare class SubscriptionChargeProfileException extends SubscriptionChargeException {
|
|
17
|
+
constructor(message: string);
|
|
18
|
+
}
|
|
19
|
+
export declare class CreatePaymentProfileException extends Error {
|
|
20
|
+
constructor(message: string);
|
|
21
|
+
}
|
|
22
|
+
export declare class InvalidSubscriptionRequestException extends Error {
|
|
23
|
+
constructor(message: string);
|
|
24
|
+
}
|
|
25
|
+
export declare class CliqSubscriptionCreationException extends Error {
|
|
26
|
+
constructor(message: string);
|
|
27
|
+
}
|
|
28
|
+
export declare class CliqPaymentCreationException extends Error {
|
|
29
|
+
constructor();
|
|
30
|
+
}
|
|
31
|
+
export declare class CreatePKSubscriptionException extends Error {
|
|
32
|
+
constructor(name: string, message: string);
|
|
33
|
+
}
|
|
34
|
+
export declare class PKSub {
|
|
35
|
+
user: PhoneUser;
|
|
36
|
+
creator: PhoneOwner;
|
|
37
|
+
subscriptionPlan: SubscriptionPlan;
|
|
38
|
+
trialAmount: number;
|
|
39
|
+
trialLength: number;
|
|
40
|
+
amountInCents: number;
|
|
41
|
+
intervalCount: number;
|
|
42
|
+
intervalUnit: "months" | "days";
|
|
43
|
+
transactionData?: TransactionData;
|
|
44
|
+
useCoachingMid: boolean;
|
|
45
|
+
paymentProfile?: {
|
|
46
|
+
customerProfileId: string;
|
|
47
|
+
customerPaymentProfileId: string;
|
|
48
|
+
};
|
|
49
|
+
constructor(user: PhoneUser, creator: PhoneOwner, subscriptionPlan: SubscriptionPlan, subscriptionBundle?: SubscriptionBundle, isPreviouslySubscribed?: boolean, useCoachingMid?: boolean);
|
|
50
|
+
_charge(amount: number, description: string): Promise<{
|
|
51
|
+
amountInCents: number;
|
|
52
|
+
transactionId: string;
|
|
53
|
+
pkCustomerProfileId?: string;
|
|
54
|
+
pkCustomerPaymentProfileId?: string;
|
|
55
|
+
processorId: ProcessorId;
|
|
56
|
+
} | undefined>;
|
|
57
|
+
_chargeFirstPayment(): Promise<{
|
|
58
|
+
amountInCents: number;
|
|
59
|
+
transactionId: string;
|
|
60
|
+
pkCustomerProfileId?: string;
|
|
61
|
+
pkCustomerPaymentProfileId?: string;
|
|
62
|
+
processorId: ProcessorId;
|
|
63
|
+
}>;
|
|
64
|
+
_initializePkSubscription(processorId: ProcessorId): Promise<{
|
|
65
|
+
pkSubId: string;
|
|
66
|
+
}>;
|
|
67
|
+
setTransactionData(transactionData: TransactionData): void;
|
|
68
|
+
setPaymentProfile(paymentProfile: {
|
|
69
|
+
customerProfileId: string;
|
|
70
|
+
customerPaymentProfileId: string;
|
|
71
|
+
}): void;
|
|
72
|
+
buildSubscription(): Promise<{
|
|
73
|
+
subscription: any;
|
|
74
|
+
creditPayment: any;
|
|
75
|
+
pkSubId: string;
|
|
76
|
+
}>;
|
|
77
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare type CreditCard = {
|
|
2
|
+
cardNumber: string;
|
|
3
|
+
expirationDate: string;
|
|
4
|
+
cardCode: string;
|
|
5
|
+
};
|
|
6
|
+
export declare type Payment = {
|
|
7
|
+
creditCard: CreditCard;
|
|
8
|
+
};
|
|
9
|
+
export declare type Address = {
|
|
10
|
+
firstName: string;
|
|
11
|
+
lastName: string;
|
|
12
|
+
address: string;
|
|
13
|
+
city: string;
|
|
14
|
+
zip: string;
|
|
15
|
+
country: string;
|
|
16
|
+
state: string;
|
|
17
|
+
};
|
|
18
|
+
export declare type TransactionData = {
|
|
19
|
+
payment: Payment;
|
|
20
|
+
billTo: Address;
|
|
21
|
+
defaultPaymentProfile: string;
|
|
22
|
+
};
|
|
23
|
+
export declare type PkSubStatus = "active" | "expired" | "suspended" | "canceled" | "terminated";
|
|
24
|
+
export declare type ArbTransaction = {
|
|
25
|
+
getTransId: () => string;
|
|
26
|
+
getResponse: () => string;
|
|
27
|
+
getSubmitTimeUTC: () => string;
|
|
28
|
+
getPayNum: () => number;
|
|
29
|
+
getAttemptNum: () => string;
|
|
30
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import crypto = require("crypto");
|
|
3
|
+
export default function (public_key: string, private_key: crypto.BinaryLike | crypto.KeyObject, options: {}): {
|
|
4
|
+
files: {
|
|
5
|
+
store: (fileId: string, callback: any) => void;
|
|
6
|
+
storeCustom: (fileId: any, target: any, callback: any) => void;
|
|
7
|
+
info: (fileId: string, callback: any) => void;
|
|
8
|
+
remove: (fileId: string, callback: any) => void;
|
|
9
|
+
removeMultiple: (fileIds: any, callback: any) => void;
|
|
10
|
+
};
|
|
11
|
+
videos: {
|
|
12
|
+
convert: (fileId: string, callback: any) => void;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Model, InferAttributes, InferCreationAttributes, CreationOptional } from "sequelize";
|
|
2
|
+
declare class AssetCategory extends Model<InferAttributes<AssetCategory>, InferCreationAttributes<AssetCategory>> {
|
|
3
|
+
id: CreationOptional<string>;
|
|
4
|
+
mediaAssetId: string;
|
|
5
|
+
mediaCategoryId: string;
|
|
6
|
+
createdAt: CreationOptional<Date>;
|
|
7
|
+
updatedAt: CreationOptional<Date>;
|
|
8
|
+
}
|
|
9
|
+
export default AssetCategory;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Model, InferAttributes, InferCreationAttributes, CreationOptional, NonAttribute } from "sequelize";
|
|
2
|
+
import ConsentPerson from "./consent-person";
|
|
3
|
+
import MediaAsset from "./media-asset";
|
|
4
|
+
declare class AssetConsentPerson extends Model<InferAttributes<AssetConsentPerson>, InferCreationAttributes<AssetConsentPerson>> {
|
|
5
|
+
id: CreationOptional<string>;
|
|
6
|
+
consentPersonId: string;
|
|
7
|
+
mediaAssetId: string;
|
|
8
|
+
createdAt: CreationOptional<Date>;
|
|
9
|
+
updatedAt: CreationOptional<Date>;
|
|
10
|
+
consent_person?: NonAttribute<ConsentPerson>;
|
|
11
|
+
media_asset?: NonAttribute<MediaAsset[]>;
|
|
12
|
+
}
|
|
13
|
+
export default AssetConsentPerson;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Model, InferAttributes, InferCreationAttributes, CreationOptional } from "sequelize";
|
|
2
|
+
declare class Bet extends Model<InferAttributes<Bet>, InferCreationAttributes<Bet>> {
|
|
3
|
+
id: CreationOptional<string>;
|
|
4
|
+
oddsJamOddsId: string;
|
|
5
|
+
oddsId: string;
|
|
6
|
+
price: number;
|
|
7
|
+
userId: string;
|
|
8
|
+
parlayId?: string;
|
|
9
|
+
createdAt: CreationOptional<Date>;
|
|
10
|
+
updatedAt: CreationOptional<Date>;
|
|
11
|
+
}
|
|
12
|
+
export default Bet;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const sequelize_1 = require("sequelize");
|
|
7
|
+
const parlay_1 = __importDefault(require("./parlay"));
|
|
8
|
+
const pb_sequelize_1 = __importDefault(require("./pb-sequelize"));
|
|
9
|
+
const phone_user_1 = __importDefault(require("./phone-user"));
|
|
10
|
+
// order of InferAttributes & InferCreationAttributes is important.
|
|
11
|
+
class Bet extends sequelize_1.Model {
|
|
12
|
+
}
|
|
13
|
+
Bet.init({
|
|
14
|
+
id: {
|
|
15
|
+
type: sequelize_1.DataTypes.BIGINT,
|
|
16
|
+
primaryKey: true,
|
|
17
|
+
allowNull: false,
|
|
18
|
+
defaultValue: pb_sequelize_1.default.fn("next_id"),
|
|
19
|
+
},
|
|
20
|
+
oddsJamOddsId: {
|
|
21
|
+
type: sequelize_1.DataTypes.STRING,
|
|
22
|
+
field: "odds_jam_odds_id",
|
|
23
|
+
},
|
|
24
|
+
oddsId: {
|
|
25
|
+
type: sequelize_1.DataTypes.STRING,
|
|
26
|
+
field: "odds_id",
|
|
27
|
+
},
|
|
28
|
+
price: {
|
|
29
|
+
type: sequelize_1.DataTypes.DOUBLE,
|
|
30
|
+
field: "price",
|
|
31
|
+
},
|
|
32
|
+
userId: {
|
|
33
|
+
type: sequelize_1.DataTypes.STRING,
|
|
34
|
+
field: "user_id",
|
|
35
|
+
},
|
|
36
|
+
parlayId: {
|
|
37
|
+
type: sequelize_1.DataTypes.STRING,
|
|
38
|
+
field: "parlay_id",
|
|
39
|
+
},
|
|
40
|
+
createdAt: sequelize_1.DataTypes.DATE,
|
|
41
|
+
updatedAt: sequelize_1.DataTypes.DATE,
|
|
42
|
+
}, {
|
|
43
|
+
// Other model options go here
|
|
44
|
+
tableName: "bets",
|
|
45
|
+
sequelize: pb_sequelize_1.default,
|
|
46
|
+
});
|
|
47
|
+
Bet.hasOne(parlay_1.default, {
|
|
48
|
+
foreignKey: "id",
|
|
49
|
+
sourceKey: "parlayId",
|
|
50
|
+
});
|
|
51
|
+
parlay_1.default.hasMany(Bet, {
|
|
52
|
+
foreignKey: "parlay_id",
|
|
53
|
+
sourceKey: "id",
|
|
54
|
+
});
|
|
55
|
+
Bet.hasOne(phone_user_1.default, {
|
|
56
|
+
foreignKey: "id",
|
|
57
|
+
sourceKey: "userId",
|
|
58
|
+
});
|
|
59
|
+
phone_user_1.default.hasMany(Bet, {
|
|
60
|
+
foreignKey: "user_id",
|
|
61
|
+
sourceKey: "id",
|
|
62
|
+
});
|
|
63
|
+
exports.default = Bet;
|
|
64
|
+
//# sourceMappingURL=bet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bet.js","sourceRoot":"","sources":["../../typed-model/bet.ts"],"names":[],"mappings":";;;;;AAAA,yCAOmB;AACnB,sDAA8B;AAE9B,kEAAuC;AACvC,8DAAqC;AAErC,mEAAmE;AACnE,MAAM,GAAI,SAAQ,iBAAyD;CAW1E;AAED,GAAG,CAAC,IAAI,CACN;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,aAAa,EAAE;QACb,IAAI,EAAE,qBAAS,CAAC,MAAM;QACtB,KAAK,EAAE,kBAAkB;KAC1B;IACD,MAAM,EAAE;QACN,IAAI,EAAE,qBAAS,CAAC,MAAM;QACtB,KAAK,EAAE,SAAS;KACjB;IACD,KAAK,EAAE;QACL,IAAI,EAAE,qBAAS,CAAC,MAAM;QACtB,KAAK,EAAE,OAAO;KACf;IACD,MAAM,EAAE;QACN,IAAI,EAAE,qBAAS,CAAC,MAAM;QACtB,KAAK,EAAE,SAAS;KACjB;IACD,QAAQ,EAAE;QACR,IAAI,EAAE,qBAAS,CAAC,MAAM;QACtB,KAAK,EAAE,WAAW;KACnB;IACD,SAAS,EAAE,qBAAS,CAAC,IAAI;IACzB,SAAS,EAAE,qBAAS,CAAC,IAAI;CAC1B,EACD;IACE,8BAA8B;IAC9B,SAAS,EAAE,MAAM;IACjB,SAAS,EAAT,sBAAS;CACV,CACF,CAAC;AAEF,GAAG,CAAC,MAAM,CAAC,gBAAM,EAAE;IACjB,UAAU,EAAE,IAAI;IAChB,SAAS,EAAE,UAAU;CACtB,CAAC,CAAC;AACH,gBAAM,CAAC,OAAO,CAAC,GAAG,EAAE;IAClB,UAAU,EAAE,WAAW;IACvB,SAAS,EAAE,IAAI;CAChB,CAAC,CAAC;AAEH,GAAG,CAAC,MAAM,CAAC,oBAAS,EAAE;IACpB,UAAU,EAAE,IAAI;IAChB,SAAS,EAAE,QAAQ;CACpB,CAAC,CAAC;AACH,oBAAS,CAAC,OAAO,CAAC,GAAG,EAAE;IACrB,UAAU,EAAE,SAAS;IACrB,SAAS,EAAE,IAAI;CAChB,CAAC,CAAC;AAEH,kBAAe,GAAG,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Model, InferAttributes, InferCreationAttributes, CreationOptional } from "sequelize";
|
|
2
|
+
declare class BlockedIP extends Model<InferAttributes<BlockedIP>, InferCreationAttributes<BlockedIP>> {
|
|
3
|
+
id: CreationOptional<string>;
|
|
4
|
+
ipAddress: string;
|
|
5
|
+
createdAt: CreationOptional<Date>;
|
|
6
|
+
updatedAt: CreationOptional<Date>;
|
|
7
|
+
}
|
|
8
|
+
export default BlockedIP;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Model, InferAttributes, InferCreationAttributes, CreationOptional } from "sequelize";
|
|
2
|
+
declare class CategoryTag extends Model<InferAttributes<CategoryTag>, InferCreationAttributes<CategoryTag>> {
|
|
3
|
+
id: CreationOptional<string>;
|
|
4
|
+
ownerId: string;
|
|
5
|
+
name: string;
|
|
6
|
+
createdAt: CreationOptional<Date>;
|
|
7
|
+
updatedAt: CreationOptional<Date>;
|
|
8
|
+
}
|
|
9
|
+
export default CategoryTag;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Model, InferAttributes, InferCreationAttributes, CreationOptional } from "sequelize";
|
|
2
|
+
declare class ConsentPerson extends Model<InferAttributes<ConsentPerson>, InferCreationAttributes<ConsentPerson>> {
|
|
3
|
+
id: CreationOptional<string>;
|
|
4
|
+
ownerId: string;
|
|
5
|
+
fullName: string;
|
|
6
|
+
birthday: Date;
|
|
7
|
+
consentFormKey: string;
|
|
8
|
+
idImageKey: string;
|
|
9
|
+
reviewStatus: "pending" | "approved";
|
|
10
|
+
createdAt: CreationOptional<Date>;
|
|
11
|
+
updatedAt: CreationOptional<Date>;
|
|
12
|
+
}
|
|
13
|
+
export default ConsentPerson;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Model, InferAttributes, InferCreationAttributes, CreationOptional } from "sequelize";
|
|
2
|
+
declare class ContentCategoryTag extends Model<InferAttributes<ContentCategoryTag>, InferCreationAttributes<ContentCategoryTag>> {
|
|
3
|
+
id: CreationOptional<string>;
|
|
4
|
+
contentId: string;
|
|
5
|
+
tagId: string;
|
|
6
|
+
createdAt: CreationOptional<Date>;
|
|
7
|
+
updatedAt: CreationOptional<Date>;
|
|
8
|
+
}
|
|
9
|
+
export default ContentCategoryTag;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Model, InferAttributes, InferCreationAttributes, CreationOptional } from "sequelize";
|
|
2
|
+
declare class ContentLike extends Model<InferAttributes<ContentLike>, InferCreationAttributes<ContentLike>> {
|
|
3
|
+
id: CreationOptional<string>;
|
|
4
|
+
contentId: string;
|
|
5
|
+
userId: string;
|
|
6
|
+
createdAt: CreationOptional<Date>;
|
|
7
|
+
updatedAt: CreationOptional<Date>;
|
|
8
|
+
static getById: (id: string) => Promise<ContentLike | null>;
|
|
9
|
+
}
|
|
10
|
+
export default ContentLike;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Transaction } from "sequelize";
|
|
2
|
+
import { Model, InferAttributes, InferCreationAttributes, CreationOptional } from "sequelize";
|
|
3
|
+
import PhoneOwner from "./phone-owner";
|
|
4
|
+
import PhoneUser from "./phone-user";
|
|
5
|
+
import PremiumContent from "./premium-content";
|
|
6
|
+
import Message from "./message";
|
|
7
|
+
import Subscription from "./subscription";
|
|
8
|
+
declare type InteractionType = "subscription" | "tip" | "text" | "unlock_message" | "content" | "unlock" | "audio" | "referral" | "video";
|
|
9
|
+
declare class CreditPayments extends Model<InferAttributes<CreditPayments>, InferCreationAttributes<CreditPayments>> {
|
|
10
|
+
id: CreationOptional<string>;
|
|
11
|
+
userId?: string;
|
|
12
|
+
ownerId: string;
|
|
13
|
+
creditAmountInCents: number;
|
|
14
|
+
interactionType: InteractionType;
|
|
15
|
+
payoutDate?: Date;
|
|
16
|
+
metadata?: string;
|
|
17
|
+
earningAmountInCents: number;
|
|
18
|
+
payoutId?: string;
|
|
19
|
+
referredCreditPaymentId?: string;
|
|
20
|
+
transId?: number;
|
|
21
|
+
invoiceId?: string;
|
|
22
|
+
createdAt: CreationOptional<Date>;
|
|
23
|
+
updatedAt: CreationOptional<Date>;
|
|
24
|
+
static getById: (id: string) => Promise<CreditPayments | null>;
|
|
25
|
+
static logContentPurchase: (user: PhoneUser, contentId: string, owner: PhoneOwner, alreadyPaid?: boolean, transaction?: Transaction, invoiceId?: string) => Promise<CreditPayments>;
|
|
26
|
+
static logMessage: (user: PhoneUser, owner: PhoneOwner, chatRateInCents: number) => Promise<CreditPayments>;
|
|
27
|
+
static logTip: (user: PhoneUser, owner: PhoneOwner, tipAmountInCents: number) => Promise<CreditPayments>;
|
|
28
|
+
static logAudioCall: (user: PhoneUser, owner: PhoneOwner, callAmountInCents: number) => Promise<CreditPayments>;
|
|
29
|
+
static logVideoCall: (user: PhoneUser, owner: PhoneOwner, callAmountInCents: number) => Promise<CreditPayments>;
|
|
30
|
+
static logUnlockMessage: (user: PhoneUser, owner: PhoneOwner, message: Message, alreadyPaid?: boolean, transaction?: Transaction, invoiceId?: string) => Promise<CreditPayments>;
|
|
31
|
+
static logSubscriptionPayment: (userId: string, owner: PhoneOwner, subscriptionAmountInCents: number, subscription: Subscription, transaction: Transaction | undefined, invoiceId?: string) => Promise<CreditPayments>;
|
|
32
|
+
static logUnlockedContent: (user: PhoneUser, owner: PhoneOwner, lockedContent: PremiumContent) => Promise<CreditPayments>;
|
|
33
|
+
}
|
|
34
|
+
export default CreditPayments;
|