decord/source/actions/GiftCodeActionCreators.tsx

163 lines
5.7 KiB
TypeScript
Raw Normal View History

2026-07-24 07:16:23 +00:00
// Module ID: 8239
// Function ID: 65017
2026-07-20 16:05:17 +00:00
// Name: resolveGiftCode
2026-07-24 07:16:23 +00:00
// Dependencies: [5, 4167, 6774, 6782, 653, 1851, 686, 4366, 5463, 6773, 4029, 507, 8240, 8241, 2]
2026-07-20 16:05:17 +00:00
// Exports: resolveGiftCode
2026-07-24 07:16:23 +00:00
// Module 8239 (resolveGiftCode)
2026-07-23 10:11:24 +00:00
import GuildFeatures from "GuildFeatures";
import _isNativeReflectConstruct from "_isNativeReflectConstruct";
import closure_5 from "_isNativeReflectConstruct";
import { isUnknownCollectiblesItemRecord as closure_6 } from "_isNativeReflectConstruct";
import ME from "ME";
import { PREMIUM_SUBSCRIPTION_APPLICATION as closure_10 } from "GuildFeatures";
let closure_7;
let closure_8;
let closure_9;
const require = arg1;
2026-07-20 16:05:17 +00:00
function resolveGiftCode() {
return _resolveGiftCode(...arguments);
}
async function _resolveGiftCode(arg0, arg1) {
2026-07-23 10:11:24 +00:00
let iter = (function*(code) {
2026-07-20 16:05:17 +00:00
let flag = arg1;
let flag2 = arg2;
if (flag === undefined) {
flag = false;
}
if (flag2 === undefined) {
flag2 = false;
}
yield undefined;
2026-07-23 10:11:24 +00:00
let obj = outer2_1(outer2_2[6]);
2026-07-20 16:05:17 +00:00
obj = { type: "GIFT_CODE_RESOLVE", code };
obj.dispatch(obj);
2026-07-23 10:11:24 +00:00
const tmp3 = yield outer2_0(outer2_2[7]).resolveGiftCode(code, flag, flag2);
2026-07-20 16:05:17 +00:00
if (null != tmp3.application_id) {
2026-07-23 10:11:24 +00:00
if (tmp4.application_id !== outer2_10) {
if (null == outer2_4.getApplication(tmp4.application_id)) {
yield outer2_1(outer2_2[8]).fetchApplication(tmp4.application_id);
const obj4 = outer2_1(outer2_2[8]);
2026-07-20 16:05:17 +00:00
}
}
}
while (true) {
let tmp13 = tmp3;
2026-07-23 10:11:24 +00:00
let tmp14 = outer2_7;
if (tmp4.application_id !== outer2_7) {
2026-07-20 16:05:17 +00:00
break;
} else {
2026-07-23 10:11:24 +00:00
let tmp15 = outer2_0;
let tmp16 = outer2_2;
2026-07-20 16:05:17 +00:00
let num2 = 9;
2026-07-23 10:11:24 +00:00
let obj5 = outer2_0(outer2_2[9]);
2026-07-20 16:05:17 +00:00
let tmp17 = tmp3;
let tmp18 = yield obj5.fetchCollectiblesProduct(tmp4.sku_id);
2026-07-23 10:11:24 +00:00
let tmp19 = outer2_5;
2026-07-20 16:05:17 +00:00
let tmp20 = tmp3;
2026-07-23 10:11:24 +00:00
let product = outer2_5.getProduct(tmp4.sku_id);
2026-07-20 16:05:17 +00:00
let tmp22 = product;
let someResult;
if (null != product) {
let items = product.items;
2026-07-23 10:11:24 +00:00
let tmp24 = outer2_6;
someResult = items.some(outer2_6);
2026-07-20 16:05:17 +00:00
}
let flag3 = true;
if (true !== someResult) {
break;
} else {
2026-07-23 10:11:24 +00:00
let tmp28 = outer2_0;
let tmp29 = outer2_2;
2026-07-20 16:05:17 +00:00
let num3 = 10;
2026-07-23 10:11:24 +00:00
let ClientOutdatedAcceptGiftError = outer2_0(outer2_2[10]).ClientOutdatedAcceptGiftError;
2026-07-20 16:05:17 +00:00
let prototype = ClientOutdatedAcceptGiftError.prototype;
let tmp30 = new.target;
let str2 = "Client update required to redeem this gift";
let tmp31 = new.target;
let clientOutdatedAcceptGiftError = new ClientOutdatedAcceptGiftError("Client update required to redeem this gift");
let tmp33 = clientOutdatedAcceptGiftError;
throw clientOutdatedAcceptGiftError;
}
}
2026-07-23 10:11:24 +00:00
let tmp25 = outer2_1;
let tmp26 = outer2_2;
let obj6 = outer2_1(outer2_2[6]);
2026-07-20 16:05:17 +00:00
obj = {};
let str = "GIFT_CODE_RESOLVE_SUCCESS";
obj.type = "GIFT_CODE_RESOLVE_SUCCESS";
obj.giftCode = tmp3;
let dispatchResult1 = obj6.dispatch(obj);
let obj1 = { giftCode: tmp3 };
return obj1;
}
2026-07-23 10:11:24 +00:00
})();
iter.next();
return iter;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
({ COLLECTIBLES_APPLICATION_ID: closure_7, Endpoints: closure_8, RPCCommands: closure_9 } = ME);
const merged = Object.assign(require("redeemGiftCode").default);
const result = require("_isNativeReflectConstruct").fileFinishedImporting("actions/GiftCodeActionCreators.tsx");
export default {
2026-07-20 16:05:17 +00:00
resolveGiftCode,
fetchUserGiftCodesForSKU(skuId, subscriptionPlanId) {
let tmp = subscriptionPlanId;
2026-07-23 10:11:24 +00:00
let closure_0 = skuId;
2026-07-20 16:05:17 +00:00
if (subscriptionPlanId === undefined) {
tmp = null;
}
const importDefault = tmp;
return callback(async () => {
2026-07-23 10:11:24 +00:00
let obj = callback2(outer2_2[6]);
obj = { type: "GIFT_CODES_FETCH", skuId: outer1_0, subscriptionPlanId: outer1_1 };
2026-07-20 16:05:17 +00:00
obj.dispatch(obj);
2026-07-23 10:11:24 +00:00
const HTTP = callback(outer2_2[11]).HTTP;
obj = { url: outer2_8.USER_GIFT_CODES, query: obj1, oldFormErrors: true, rejectWithError: true };
obj1 = { sku_id: outer1_0, subscription_plan_id: outer1_1 };
2026-07-20 16:05:17 +00:00
const tmp2 = yield HTTP.get(obj);
2026-07-23 10:11:24 +00:00
callback2(outer2_2[6]).dispatch({ type: "GIFT_CODES_FETCH_SUCCESS", giftCodes: tmp2.body, skuId: outer1_0, subscriptionPlanId: outer1_1 });
2026-07-20 16:05:17 +00:00
})();
},
createGiftCode(skuId, subscriptionPlanId, giftStyle) {
let tmp = subscriptionPlanId;
let tmp2 = giftStyle;
2026-07-23 10:11:24 +00:00
let closure_0 = skuId;
2026-07-20 16:05:17 +00:00
if (subscriptionPlanId === undefined) {
tmp = null;
}
const importDefault = tmp;
if (tmp2 === undefined) {
tmp2 = null;
}
const dependencyMap = tmp2;
return callback(async () => {
2026-07-23 10:11:24 +00:00
let obj = callback2(686);
obj = { type: "GIFT_CODE_CREATE_START", skuId: outer1_0, subscriptionPlanId: outer1_1 };
2026-07-20 16:05:17 +00:00
obj.dispatch(obj);
2026-07-23 10:11:24 +00:00
const HTTP = callback(507).HTTP;
obj = { url: outer2_8.USER_GIFT_CODE_CREATE, body: obj1, oldFormErrors: true, rejectWithError: true };
2026-07-20 16:05:17 +00:00
const tmp2 = yield HTTP.post(obj);
2026-07-23 10:11:24 +00:00
callback2(686).dispatch({ type: "GIFT_CODE_CREATE_SUCCESS", giftCode: tmp2.body });
2026-07-20 16:05:17 +00:00
return tmp2.body;
})();
},
revokeGiftCode(arg0) {
2026-07-23 10:11:24 +00:00
let closure_0 = arg0;
2026-07-20 16:05:17 +00:00
return callback(async () => {
2026-07-23 10:11:24 +00:00
let obj = outer2_1(outer2_2[6]);
obj = { type: "GIFT_CODE_REVOKE", code: outer1_0 };
2026-07-20 16:05:17 +00:00
obj.dispatch(obj);
2026-07-23 10:11:24 +00:00
const HTTP = callback(outer2_2[11]).HTTP;
obj = { url: outer2_8.USER_GIFT_CODE_REVOKE(outer1_0), oldFormErrors: true, rejectWithError: true };
2026-07-20 16:05:17 +00:00
yield HTTP.del(obj);
2026-07-23 10:11:24 +00:00
outer2_1(outer2_2[6]).dispatch({ type: "GIFT_CODE_REVOKE_SUCCESS", code: outer1_0 });
2026-07-20 16:05:17 +00:00
})();
},
openNativeGiftCodeModal(arg0) {
2026-07-24 07:16:23 +00:00
importDefault(8240).openNativeAppModal(arg0, constants.GIFT_CODE_BROWSER);
2026-07-20 16:05:17 +00:00
}
};
export { resolveGiftCode };