@mathrunet/masamune 2.6.2 → 2.6.3
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/CHANGELOG.md +9 -0
- package/dist/lib/functions/firestore.js +14 -5
- package/dist/lib/functions/firestore.js.map +1 -1
- package/dist/lib/functions/send_notification.js +1 -1
- package/package.json +1 -1
- package/dist/converter/firestore_basic_converter.d.ts +0 -20
- package/dist/converter/firestore_basic_converter.js +0 -25
- package/dist/converter/firestore_basic_converter.js.map +0 -1
- package/dist/converter/firestore_enum_converter.d.ts +0 -20
- package/dist/converter/firestore_enum_converter.js +0 -25
- package/dist/converter/firestore_enum_converter.js.map +0 -1
- package/dist/converter/firestore_model_command_base_converter.d.ts +0 -20
- package/dist/converter/firestore_model_command_base_converter.js +0 -38
- package/dist/converter/firestore_model_command_base_converter.js.map +0 -1
- package/dist/converter/firestore_model_counter_converter.d.ts +0 -20
- package/dist/converter/firestore_model_counter_converter.js +0 -78
- package/dist/converter/firestore_model_counter_converter.js.map +0 -1
- package/dist/converter/firestore_model_date_converter.d.ts +0 -20
- package/dist/converter/firestore_model_date_converter.js +0 -95
- package/dist/converter/firestore_model_date_converter.js.map +0 -1
- package/dist/converter/firestore_model_geo_value_converter.d.ts +0 -20
- package/dist/converter/firestore_model_geo_value_converter.js +0 -77
- package/dist/converter/firestore_model_geo_value_converter.js.map +0 -1
- package/dist/converter/firestore_model_image_uri_converter.d.ts +0 -20
- package/dist/converter/firestore_model_image_uri_converter.js +0 -74
- package/dist/converter/firestore_model_image_uri_converter.js.map +0 -1
- package/dist/converter/firestore_model_locale_converter.d.ts +0 -20
- package/dist/converter/firestore_model_locale_converter.js +0 -74
- package/dist/converter/firestore_model_locale_converter.js.map +0 -1
- package/dist/converter/firestore_model_localized_value_converter.d.ts +0 -20
- package/dist/converter/firestore_model_localized_value_converter.js +0 -36
- package/dist/converter/firestore_model_localized_value_converter.js.map +0 -1
- package/dist/converter/firestore_model_ref_converter.d.ts +0 -20
- package/dist/converter/firestore_model_ref_converter.js +0 -60
- package/dist/converter/firestore_model_ref_converter.js.map +0 -1
- package/dist/converter/firestore_model_search_converter.d.ts +0 -20
- package/dist/converter/firestore_model_search_converter.js +0 -36
- package/dist/converter/firestore_model_search_converter.js.map +0 -1
- package/dist/converter/firestore_model_timestamp_converter.d.ts +0 -20
- package/dist/converter/firestore_model_timestamp_converter.js +0 -95
- package/dist/converter/firestore_model_timestamp_converter.js.map +0 -1
- package/dist/converter/firestore_model_token_converter.d.ts +0 -20
- package/dist/converter/firestore_model_token_converter.js +0 -36
- package/dist/converter/firestore_model_token_converter.js.map +0 -1
- package/dist/converter/firestore_model_uri_converter.d.ts +0 -20
- package/dist/converter/firestore_model_uri_converter.js +0 -74
- package/dist/converter/firestore_model_uri_converter.js.map +0 -1
- package/dist/converter/firestore_model_video_uri_converter.d.ts +0 -20
- package/dist/converter/firestore_model_video_uri_converter.js +0 -74
- package/dist/converter/firestore_model_video_uri_converter.js.map +0 -1
- package/dist/converter/firestore_null_converter.d.ts +0 -20
- package/dist/converter/firestore_null_converter.js +0 -25
- package/dist/converter/firestore_null_converter.js.map +0 -1
- package/dist/exntension/string.extension.d.ts +0 -179
- package/dist/exntension/string.extension.js +0 -190
- package/dist/exntension/string.extension.js.map +0 -1
- package/dist/functions/notification.d.ts +0 -1
- package/dist/functions/notification.js +0 -111
- package/dist/functions/notification.js.map +0 -1
- package/dist/functions/send_notification_schedule.d.ts +0 -1
- package/dist/functions/send_notification_schedule.js +0 -86
- package/dist/functions/send_notification_schedule.js.map +0 -1
- package/dist/functions/stripe_hook.d.ts +0 -1
- package/dist/functions/stripe_hook.js +0 -573
- package/dist/functions/stripe_hook.js.map +0 -1
- package/dist/functions/stripe_hook_connect.d.ts +0 -1
- package/dist/functions/stripe_hook_connect.js +0 -140
- package/dist/functions/stripe_hook_connect.js.map +0 -1
- package/dist/functions/stripe_hook_secure.d.ts +0 -1
- package/dist/functions/stripe_hook_secure.js +0 -150
- package/dist/functions/stripe_hook_secure.js.map +0 -1
- package/dist/lib/call_process_function_base.d.ts +0 -39
- package/dist/lib/call_process_function_base.js +0 -69
- package/dist/lib/call_process_function_base.js.map +0 -1
- package/dist/lib/default_firestore_model_field_value_converter.d.ts +0 -8
- package/dist/lib/default_firestore_model_field_value_converter.js +0 -44
- package/dist/lib/default_firestore_model_field_value_converter.js.map +0 -1
- package/dist/lib/firestore_model_field_value_converter.d.ts +0 -140
- package/dist/lib/firestore_model_field_value_converter.js +0 -127
- package/dist/lib/firestore_model_field_value_converter.js.map +0 -1
- package/dist/lib/functions_base.d.ts +0 -195
- package/dist/lib/functions_base.js +0 -37
- package/dist/lib/functions_base.js.map +0 -1
- package/dist/lib/functions_data.d.ts +0 -10
- package/dist/lib/functions_data.js +0 -19
- package/dist/lib/functions_data.js.map +0 -1
- package/dist/lib/gmail.d.ts +0 -39
- package/dist/lib/gmail.js +0 -65
- package/dist/lib/gmail.js.map +0 -1
- package/dist/lib/model_field_value.d.ts +0 -82
- package/dist/lib/model_field_value.js +0 -104
- package/dist/lib/model_field_value.js.map +0 -1
- package/dist/lib/request_process_function_base.d.ts +0 -39
- package/dist/lib/request_process_function_base.js +0 -69
- package/dist/lib/request_process_function_base.js.map +0 -1
- package/dist/lib/schedule_process_function_base.d.ts +0 -33
- package/dist/lib/schedule_process_function_base.js +0 -70
- package/dist/lib/schedule_process_function_base.js.map +0 -1
- package/dist/lib/send_gmail.d.ts +0 -34
- package/dist/lib/send_gmail.js +0 -90
- package/dist/lib/send_gmail.js.map +0 -1
- package/dist/lib/send_grid.d.ts +0 -33
- package/dist/lib/send_grid.js +0 -58
- package/dist/lib/send_grid.js.map +0 -1
- package/dist/lib/send_notification.d.ts +0 -59
- package/dist/lib/send_notification.js +0 -216
- package/dist/lib/send_notification.js.map +0 -1
- package/dist/lib/sql_api_base.d.ts +0 -185
- package/dist/lib/sql_api_base.js +0 -94
- package/dist/lib/sql_api_base.js.map +0 -1
- package/dist/lib/update_subscription.d.ts +0 -83
- package/dist/lib/update_subscription.js +0 -143
- package/dist/lib/update_subscription.js.map +0 -1
- package/dist/lib/update_unlock.d.ts +0 -13
- package/dist/lib/update_unlock.js +0 -64
- package/dist/lib/update_unlock.js.map +0 -1
- package/dist/lib/update_wallet.d.ts +0 -19
- package/dist/lib/update_wallet.js +0 -70
- package/dist/lib/update_wallet.js.map +0 -1
- package/dist/lib/verify_android.d.ts +0 -50
- package/dist/lib/verify_android.js +0 -121
- package/dist/lib/verify_android.js.map +0 -1
- package/dist/lib/verify_ios.d.ts +0 -26
- package/dist/lib/verify_ios.js +0 -110
- package/dist/lib/verify_ios.js.map +0 -1
- package/dist/src/functions/notification.d.ts +0 -1
- package/dist/src/functions/notification.js +0 -111
- package/dist/src/functions/notification.js.map +0 -1
- package/dist/src/functions.d.ts +0 -14
- package/dist/src/functions.js +0 -41
- package/dist/src/functions.js.map +0 -1
- package/dist/src/index.d.ts +0 -13
- package/dist/src/index.js +0 -51
- package/dist/src/index.js.map +0 -1
- package/dist/src/lib/functions_data.d.ts +0 -25
- package/dist/src/lib/functions_data.js +0 -31
- package/dist/src/lib/functions_data.js.map +0 -1
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
exports.updateSubscription = void 0;
|
|
36
|
-
const path = __importStar(require("path"));
|
|
37
|
-
const utils = __importStar(require("./utils"));
|
|
38
|
-
const admin = __importStar(require("firebase-admin"));
|
|
39
|
-
/**
|
|
40
|
-
* Processes subscription updates.
|
|
41
|
-
*
|
|
42
|
-
* サブスクリプションのアップデート処理を行います。
|
|
43
|
-
*
|
|
44
|
-
* @param {String} targetCollectionPath
|
|
45
|
-
* Specify the path of the collection to be updated.
|
|
46
|
-
*
|
|
47
|
-
* アップデートを行うコレクションのパスを指定します。
|
|
48
|
-
*
|
|
49
|
-
* @param {String} targetDocumentId
|
|
50
|
-
* Specifies the ID of the document to be updated.
|
|
51
|
-
*
|
|
52
|
-
* アップデートを行うドキュメントのIDを指定します。
|
|
53
|
-
*
|
|
54
|
-
* @param {[key: string]: any} data
|
|
55
|
-
* Document data to be updated.
|
|
56
|
-
*
|
|
57
|
-
* 更新するドキュメントデータ。
|
|
58
|
-
*
|
|
59
|
-
* @param {[key: string]: any} additionalData
|
|
60
|
-
* Additional documentation data.
|
|
61
|
-
*
|
|
62
|
-
* 追加のドキュメントデータ。
|
|
63
|
-
*
|
|
64
|
-
* @param {String} userId
|
|
65
|
-
* ID of the user who purchased the subscription.
|
|
66
|
-
*
|
|
67
|
-
* サブスクリプションを購入したユーザーのID。
|
|
68
|
-
*
|
|
69
|
-
* @param {String} platform
|
|
70
|
-
* Subscription-based platform.
|
|
71
|
-
*
|
|
72
|
-
* サブスクリプションを利用するプラットフォーム。
|
|
73
|
-
*
|
|
74
|
-
* @param {String} orderId
|
|
75
|
-
* Subscription Order ID.
|
|
76
|
-
*
|
|
77
|
-
* サブスクリプションの注文ID。
|
|
78
|
-
*
|
|
79
|
-
* @param {String} productId Product ID.
|
|
80
|
-
* Subscription product ID.
|
|
81
|
-
*
|
|
82
|
-
* サブスクリプションのプロダクトID。
|
|
83
|
-
*
|
|
84
|
-
* @param {String} purchaseId
|
|
85
|
-
* Subscription purchase ID.
|
|
86
|
-
*
|
|
87
|
-
* サブスクリプションの購入ID。
|
|
88
|
-
*
|
|
89
|
-
* @param {String} packageName
|
|
90
|
-
* The package name of the application.
|
|
91
|
-
*
|
|
92
|
-
* アプリケーションのパッケージ名。
|
|
93
|
-
*
|
|
94
|
-
* @param {String} token
|
|
95
|
-
* Token issued at the time of purchase.
|
|
96
|
-
*
|
|
97
|
-
* 購入時に発行されたトークン。
|
|
98
|
-
*
|
|
99
|
-
* @param {number} expiryDate
|
|
100
|
-
* Subscription expiration date.
|
|
101
|
-
*
|
|
102
|
-
* サブスクリプションの有効期限。
|
|
103
|
-
*/
|
|
104
|
-
function updateSubscription(_a) {
|
|
105
|
-
return __awaiter(this, arguments, void 0, function* ({ targetCollectionPath, targetDocumentId, data, additionalData, userId, platform, orderId, productId, purchaseId, packageName, token, expiryDate, }) {
|
|
106
|
-
const update = {};
|
|
107
|
-
const firestoreInstance = admin.firestore();
|
|
108
|
-
for (const key in data) {
|
|
109
|
-
if (!data[key]) {
|
|
110
|
-
continue;
|
|
111
|
-
}
|
|
112
|
-
update[key] = utils.parse(data[key]);
|
|
113
|
-
}
|
|
114
|
-
if (additionalData) {
|
|
115
|
-
for (const key in additionalData) {
|
|
116
|
-
if (!additionalData[key]) {
|
|
117
|
-
continue;
|
|
118
|
-
}
|
|
119
|
-
update[key] = utils.parse(additionalData[key]);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
targetCollectionPath = `${targetCollectionPath}/${targetDocumentId}`;
|
|
123
|
-
update["expired"] = false;
|
|
124
|
-
update["paused"] = false;
|
|
125
|
-
update["token"] = token;
|
|
126
|
-
update["platform"] = platform;
|
|
127
|
-
update["productId"] = productId;
|
|
128
|
-
update["purchaseId"] = purchaseId;
|
|
129
|
-
update["packageName"] = packageName;
|
|
130
|
-
update["expiredTime"] = expiryDate;
|
|
131
|
-
update["orderId"] = orderId;
|
|
132
|
-
if (userId) {
|
|
133
|
-
update["userId"] = userId;
|
|
134
|
-
}
|
|
135
|
-
update["@time"] = new Date();
|
|
136
|
-
update["@uid"] = path.basename(targetCollectionPath);
|
|
137
|
-
yield firestoreInstance.doc(targetCollectionPath).set(update, {
|
|
138
|
-
merge: true,
|
|
139
|
-
});
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
exports.updateSubscription = updateSubscription;
|
|
143
|
-
//# sourceMappingURL=update_subscription.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update_subscription.js","sourceRoot":"","sources":["../../src/lib/update_subscription.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA6B;AAC7B,+CAAiC;AACjC,sDAAwC;AAExC;;;;;;;;;;;;;;;;;;;;;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W,CAAC;QACpC,MAAM,CAAC,aAAa,CAAC,GAAG,UAAU,CAAC;QACnC,MAAM,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC;QAC5B,IAAI,MAAM,EAAE,CAAC;YACT,MAAM,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC;QAC9B,CAAC;QACD,MAAM,CAAC,OAAO,CAAC,GAAG,IAAI,IAAI,EAAE,CAAC;QAC7B,MAAM,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAE,oBAAoB,CAAE,CAAC;QACvD,MAAM,iBAAiB,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC,GAAG,CAAC,MAAM,EAAE;YAC1D,KAAK,EAAE,IAAI;SACd,CAAC,CAAC;IACP,CAAC;CAAA;AA7DD,gDA6DC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Unlock function. Unlock information is stored in the form of an overwrite of the user data.
|
|
3
|
-
*
|
|
4
|
-
* 機能をアンロックします。アンロックの情報はユーザーデータに上書きされる形で保存されます。
|
|
5
|
-
*
|
|
6
|
-
* @param {String} targetDocumentFieldPath
|
|
7
|
-
* The path, including the key, of the field in the document where the unlock information is to be stored.
|
|
8
|
-
*
|
|
9
|
-
* アンロック情報を保存するドキュメント内のフィールドのキーを含めたパス。
|
|
10
|
-
*/
|
|
11
|
-
export declare function updateUnlock({ targetDocumentFieldPath, }: {
|
|
12
|
-
targetDocumentFieldPath: string;
|
|
13
|
-
}): Promise<void>;
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
exports.updateUnlock = void 0;
|
|
36
|
-
const path = __importStar(require("path"));
|
|
37
|
-
const admin = __importStar(require("firebase-admin"));
|
|
38
|
-
/**
|
|
39
|
-
* Unlock function. Unlock information is stored in the form of an overwrite of the user data.
|
|
40
|
-
*
|
|
41
|
-
* 機能をアンロックします。アンロックの情報はユーザーデータに上書きされる形で保存されます。
|
|
42
|
-
*
|
|
43
|
-
* @param {String} targetDocumentFieldPath
|
|
44
|
-
* The path, including the key, of the field in the document where the unlock information is to be stored.
|
|
45
|
-
*
|
|
46
|
-
* アンロック情報を保存するドキュメント内のフィールドのキーを含めたパス。
|
|
47
|
-
*/
|
|
48
|
-
function updateUnlock(_a) {
|
|
49
|
-
return __awaiter(this, arguments, void 0, function* ({ targetDocumentFieldPath, }) {
|
|
50
|
-
const update = {};
|
|
51
|
-
const key = path.basename(targetDocumentFieldPath);
|
|
52
|
-
const parent = targetDocumentFieldPath.replace(`/${key}`, "");
|
|
53
|
-
const uid = path.basename(parent);
|
|
54
|
-
const firestoreInstance = admin.firestore();
|
|
55
|
-
update[key] = true;
|
|
56
|
-
update["@uid"] = uid;
|
|
57
|
-
update["@time"] = new Date();
|
|
58
|
-
yield firestoreInstance.doc(parent).set(update, {
|
|
59
|
-
merge: true,
|
|
60
|
-
});
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
exports.updateUnlock = updateUnlock;
|
|
64
|
-
//# sourceMappingURL=update_unlock.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update_unlock.js","sourceRoot":"","sources":["../../src/lib/update_unlock.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA6B;AAC7B,sDAAwC;AAExC;;;;;;;;;GASG;AACH,SAAsB,YAAY;yDAAC,EAC/B,uBAAuB,GAG1B;QACG,MAAM,MAAM,GAA2B,EAAE,CAAC;QAC1C,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,uBAAuB,CAAC,CAAC;QACnD,MAAM,MAAM,GAAG,uBAAuB,CAAC,OAAO,CAAC,IAAI,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC;QAC9D,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QAClC,MAAM,iBAAiB,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;QAC5C,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;QACnB,MAAM,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC;QACrB,MAAM,CAAC,OAAO,CAAC,GAAG,IAAI,IAAI,EAAE,CAAC;QAC7B,MAAM,iBAAiB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,MAAM,EAAE;YAC5C,KAAK,EAAE,IAAI;SACd,CAAC,CAAC;IACP,CAAC;CAAA;AAhBD,oCAgBC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The amount of money in the in-app wallet is added to the in-app wallet due to in-app purchases. In-app wallet information is stored in a form that overwrites user data.
|
|
3
|
-
*
|
|
4
|
-
* アプリ内課金によるアプリ内ウォレットの金額の加算を行います。アプリ内ウォレットの情報はユーザーデータに上書きされる形で保存されます。
|
|
5
|
-
*
|
|
6
|
-
* @param {String} targetDocumentFieldPath
|
|
7
|
-
* The path, including the key, of the field in the document that stores the in-app wallet information.
|
|
8
|
-
*
|
|
9
|
-
* アプリ内ウォレット情報を保存するドキュメント内のフィールドのキーを含めたパス。
|
|
10
|
-
*
|
|
11
|
-
* @param {number} value
|
|
12
|
-
* Value of the amount to be added.
|
|
13
|
-
*
|
|
14
|
-
* 加算する金額の値。
|
|
15
|
-
*/
|
|
16
|
-
export declare function updateWallet({ targetDocumentFieldPath, value, }: {
|
|
17
|
-
targetDocumentFieldPath: string;
|
|
18
|
-
value: number;
|
|
19
|
-
}): Promise<void>;
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
exports.updateWallet = void 0;
|
|
36
|
-
const path = __importStar(require("path"));
|
|
37
|
-
const admin = __importStar(require("firebase-admin"));
|
|
38
|
-
/**
|
|
39
|
-
* The amount of money in the in-app wallet is added to the in-app wallet due to in-app purchases. In-app wallet information is stored in a form that overwrites user data.
|
|
40
|
-
*
|
|
41
|
-
* アプリ内課金によるアプリ内ウォレットの金額の加算を行います。アプリ内ウォレットの情報はユーザーデータに上書きされる形で保存されます。
|
|
42
|
-
*
|
|
43
|
-
* @param {String} targetDocumentFieldPath
|
|
44
|
-
* The path, including the key, of the field in the document that stores the in-app wallet information.
|
|
45
|
-
*
|
|
46
|
-
* アプリ内ウォレット情報を保存するドキュメント内のフィールドのキーを含めたパス。
|
|
47
|
-
*
|
|
48
|
-
* @param {number} value
|
|
49
|
-
* Value of the amount to be added.
|
|
50
|
-
*
|
|
51
|
-
* 加算する金額の値。
|
|
52
|
-
*/
|
|
53
|
-
function updateWallet(_a) {
|
|
54
|
-
return __awaiter(this, arguments, void 0, function* ({ targetDocumentFieldPath, value, }) {
|
|
55
|
-
const update = {};
|
|
56
|
-
const key = path.basename(targetDocumentFieldPath);
|
|
57
|
-
const parent = targetDocumentFieldPath.replace(`/${key}`, "");
|
|
58
|
-
const uid = path.basename(parent);
|
|
59
|
-
const firestoreInstance = admin.firestore();
|
|
60
|
-
const FieldValue = admin.firestore.FieldValue;
|
|
61
|
-
update[key] = FieldValue.increment(value);
|
|
62
|
-
update["@uid"] = uid;
|
|
63
|
-
update["@time"] = new Date();
|
|
64
|
-
yield firestoreInstance.doc(parent).set(update, {
|
|
65
|
-
merge: true,
|
|
66
|
-
});
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
exports.updateWallet = updateWallet;
|
|
70
|
-
//# sourceMappingURL=update_wallet.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update_wallet.js","sourceRoot":"","sources":["../../src/lib/update_wallet.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA6B;AAC7B,sDAAwC;AAExC;;;;;;;;;;;;;;GAcG;AACH,SAAsB,YAAY;yDAAC,EAC/B,uBAAuB,EACvB,KAAK,GAIR;QACG,MAAM,MAAM,GAA2B,EAAE,CAAC;QAC1C,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAE,uBAAuB,CAAE,CAAC;QACrD,MAAM,MAAM,GAAG,uBAAuB,CAAC,OAAO,CAAE,IAAI,GAAG,EAAE,EAAE,EAAE,CAAE,CAAC;QAChE,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QAClC,MAAM,iBAAiB,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;QAC5C,MAAM,UAAU,GAAG,KAAK,CAAC,SAAS,CAAC,UAAU,CAAC;QAC9C,MAAM,CAAC,GAAG,CAAC,GAAG,UAAU,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAC1C,MAAM,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC;QACrB,MAAM,CAAC,OAAO,CAAC,GAAG,IAAI,IAAI,EAAE,CAAC;QAC7B,MAAM,iBAAiB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,MAAM,EAAE;YAC5C,KAAK,EAAE,IAAI;SACd,CAAC,CAAC;IACP,CAAC;CAAA;AAnBD,oCAmBC"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Perform Android receipt verification.
|
|
3
|
-
*
|
|
4
|
-
* Android の受信確認を実行します。
|
|
5
|
-
*
|
|
6
|
-
* @param {"products" | "subscriptions"} type
|
|
7
|
-
* Item type(products or subscriptions)
|
|
8
|
-
*
|
|
9
|
-
* アイテムの種類(製品またはサブスクリプション)
|
|
10
|
-
*
|
|
11
|
-
* @param {String} serviceAccountEmail
|
|
12
|
-
* The email address of your Google Services account.
|
|
13
|
-
*
|
|
14
|
-
* Googleサービスアカウントのメールアドレス。
|
|
15
|
-
*
|
|
16
|
-
* @param {String} serviceAccountPrivateKey
|
|
17
|
-
* A private key for your Google Services account.
|
|
18
|
-
*
|
|
19
|
-
* Googleサービスアカウントのプライベートキー。
|
|
20
|
-
*
|
|
21
|
-
* @param {String} packageName
|
|
22
|
-
* Application package name.
|
|
23
|
-
*
|
|
24
|
-
* アプリケーションのパッケージ名。
|
|
25
|
-
*
|
|
26
|
-
* @param {String} productId
|
|
27
|
-
* Item ID issued by Google Play.
|
|
28
|
-
*
|
|
29
|
-
* GooglePlayで発行されたアイテムID。
|
|
30
|
-
*
|
|
31
|
-
* @param {String} purchaseToken
|
|
32
|
-
* The purchase token issued at the time of purchase.
|
|
33
|
-
*
|
|
34
|
-
* 購入したときに発行された購入トークン。
|
|
35
|
-
*
|
|
36
|
-
* @return {Promise<{ [key: string]: any; }}
|
|
37
|
-
* Receipt information for the item.
|
|
38
|
-
*
|
|
39
|
-
* アイテムの受領情報。
|
|
40
|
-
*/
|
|
41
|
-
export declare function verifyAndroid({ type, serviceAccountEmail, serviceAccountPrivateKey, packageName, productId, purchaseToken, }: {
|
|
42
|
-
type: "products" | "subscriptions";
|
|
43
|
-
serviceAccountEmail: string;
|
|
44
|
-
serviceAccountPrivateKey: string;
|
|
45
|
-
packageName: string;
|
|
46
|
-
productId: string;
|
|
47
|
-
purchaseToken: string;
|
|
48
|
-
}): Promise<{
|
|
49
|
-
[key: string]: any;
|
|
50
|
-
}>;
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
exports.verifyAndroid = void 0;
|
|
36
|
-
const functions = __importStar(require("firebase-functions/v2"));
|
|
37
|
-
const googleapis_1 = require("googleapis");
|
|
38
|
-
/**
|
|
39
|
-
* Perform Android receipt verification.
|
|
40
|
-
*
|
|
41
|
-
* Android の受信確認を実行します。
|
|
42
|
-
*
|
|
43
|
-
* @param {"products" | "subscriptions"} type
|
|
44
|
-
* Item type(products or subscriptions)
|
|
45
|
-
*
|
|
46
|
-
* アイテムの種類(製品またはサブスクリプション)
|
|
47
|
-
*
|
|
48
|
-
* @param {String} serviceAccountEmail
|
|
49
|
-
* The email address of your Google Services account.
|
|
50
|
-
*
|
|
51
|
-
* Googleサービスアカウントのメールアドレス。
|
|
52
|
-
*
|
|
53
|
-
* @param {String} serviceAccountPrivateKey
|
|
54
|
-
* A private key for your Google Services account.
|
|
55
|
-
*
|
|
56
|
-
* Googleサービスアカウントのプライベートキー。
|
|
57
|
-
*
|
|
58
|
-
* @param {String} packageName
|
|
59
|
-
* Application package name.
|
|
60
|
-
*
|
|
61
|
-
* アプリケーションのパッケージ名。
|
|
62
|
-
*
|
|
63
|
-
* @param {String} productId
|
|
64
|
-
* Item ID issued by Google Play.
|
|
65
|
-
*
|
|
66
|
-
* GooglePlayで発行されたアイテムID。
|
|
67
|
-
*
|
|
68
|
-
* @param {String} purchaseToken
|
|
69
|
-
* The purchase token issued at the time of purchase.
|
|
70
|
-
*
|
|
71
|
-
* 購入したときに発行された購入トークン。
|
|
72
|
-
*
|
|
73
|
-
* @return {Promise<{ [key: string]: any; }}
|
|
74
|
-
* Receipt information for the item.
|
|
75
|
-
*
|
|
76
|
-
* アイテムの受領情報。
|
|
77
|
-
*/
|
|
78
|
-
function verifyAndroid(_a) {
|
|
79
|
-
return __awaiter(this, arguments, void 0, function* ({ type, serviceAccountEmail, serviceAccountPrivateKey, packageName, productId, purchaseToken, }) {
|
|
80
|
-
try {
|
|
81
|
-
const authClient = new googleapis_1.google.auth.JWT({
|
|
82
|
-
email: serviceAccountEmail,
|
|
83
|
-
key: serviceAccountPrivateKey.replace(/\\n/g, "\n"),
|
|
84
|
-
scopes: ["https://www.googleapis.com/auth/androidpublisher"]
|
|
85
|
-
});
|
|
86
|
-
const playDeveloperApiClient = googleapis_1.google.androidpublisher({
|
|
87
|
-
version: "v3",
|
|
88
|
-
auth: authClient,
|
|
89
|
-
});
|
|
90
|
-
yield authClient.authorize();
|
|
91
|
-
if (type === "products") {
|
|
92
|
-
const res = yield playDeveloperApiClient.purchases.products.get({
|
|
93
|
-
packageName: packageName,
|
|
94
|
-
productId: productId,
|
|
95
|
-
token: purchaseToken,
|
|
96
|
-
});
|
|
97
|
-
if (res.status !== 200) {
|
|
98
|
-
throw new functions.https.HttpsError("not-found", "The validation data is empty.");
|
|
99
|
-
}
|
|
100
|
-
return res.data;
|
|
101
|
-
}
|
|
102
|
-
else if (type === "subscriptions") {
|
|
103
|
-
const res = yield playDeveloperApiClient.purchases.subscriptions.get({
|
|
104
|
-
packageName: packageName,
|
|
105
|
-
subscriptionId: productId,
|
|
106
|
-
token: purchaseToken,
|
|
107
|
-
});
|
|
108
|
-
if (res.status !== 200) {
|
|
109
|
-
throw new functions.https.HttpsError("not-found", "The validation data is empty.");
|
|
110
|
-
}
|
|
111
|
-
return res.data;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
catch (error) {
|
|
115
|
-
console.log(error);
|
|
116
|
-
}
|
|
117
|
-
throw new functions.https.HttpsError("not-found", "The validation data is empty.");
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
exports.verifyAndroid = verifyAndroid;
|
|
121
|
-
//# sourceMappingURL=verify_android.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"verify_android.js","sourceRoot":"","sources":["../../src/lib/verify_android.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iEAAmD;AAEnD,2CAAoC;AAEpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,SAAsB,aAAa;yDAAC,EAChC,IAAI,EACJ,mBAAmB,EACnB,wBAAwB,EACxB,WAAW,EACX,SAAS,EACT,aAAa,GAQhB;QACG,IAAI,CAAC;YACD,MAAM,UAAU,GAAG,IAAI,mBAAM,CAAC,IAAI,CAAC,GAAG,CAAC;gBACnC,KAAK,EAAE,mBAAmB;gBAC1B,GAAG,EAAE,wBAAwB,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC;gBACnD,MAAM,EAAE,CAAC,kDAAkD,CAAC;aAC/D,CAAC,CAAC;YACH,MAAM,sBAAsB,GAAG,mBAAM,CAAC,gBAAgB,CAAC;gBACnD,OAAO,EAAE,IAAI;gBACb,IAAI,EAAE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verification.
|
|
3
|
-
*
|
|
4
|
-
* IOSの受信確認を実行します。
|
|
5
|
-
*
|
|
6
|
-
* @param {String} receiptData
|
|
7
|
-
* Receipt data for purchases.
|
|
8
|
-
*
|
|
9
|
-
* 購入の際のレシートデータ。
|
|
10
|
-
*
|
|
11
|
-
* @param {String} password
|
|
12
|
-
* SharedSecret for AppStore, obtained from [Apps]->[App Info]->[Shared Secret for App] in the AppStore.
|
|
13
|
-
*
|
|
14
|
-
* AppStoreのSharedSecret。AppStoreの[アプリ]->[App情報]->[App用共有シークレット]から取得します。
|
|
15
|
-
*
|
|
16
|
-
* @return {Promise<{ [key: string]: any; }}
|
|
17
|
-
* Receipt information for the item.
|
|
18
|
-
*
|
|
19
|
-
* アイテムの受領情報。
|
|
20
|
-
*/
|
|
21
|
-
export declare function verifyIOS({ receiptData, password }: {
|
|
22
|
-
receiptData: string;
|
|
23
|
-
password: string;
|
|
24
|
-
}): Promise<{
|
|
25
|
-
[key: string]: any;
|
|
26
|
-
}>;
|
package/dist/lib/verify_ios.js
DELETED
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
exports.verifyIOS = void 0;
|
|
36
|
-
const functions = __importStar(require("firebase-functions/v2"));
|
|
37
|
-
const api_1 = require("./api");
|
|
38
|
-
/**
|
|
39
|
-
* Perform IOS receipt verification.
|
|
40
|
-
*
|
|
41
|
-
* IOSの受信確認を実行します。
|
|
42
|
-
*
|
|
43
|
-
* @param {String} receiptData
|
|
44
|
-
* Receipt data for purchases.
|
|
45
|
-
*
|
|
46
|
-
* 購入の際のレシートデータ。
|
|
47
|
-
*
|
|
48
|
-
* @param {String} password
|
|
49
|
-
* SharedSecret for AppStore, obtained from [Apps]->[App Info]->[Shared Secret for App] in the AppStore.
|
|
50
|
-
*
|
|
51
|
-
* AppStoreのSharedSecret。AppStoreの[アプリ]->[App情報]->[App用共有シークレット]から取得します。
|
|
52
|
-
*
|
|
53
|
-
* @return {Promise<{ [key: string]: any; }}
|
|
54
|
-
* Receipt information for the item.
|
|
55
|
-
*
|
|
56
|
-
* アイテムの受領情報。
|
|
57
|
-
*/
|
|
58
|
-
function verifyIOS(_a) {
|
|
59
|
-
return __awaiter(this, arguments, void 0, function* ({ receiptData, password }) {
|
|
60
|
-
let res = yield api_1.Api.post("https://buy.itunes.apple.com/verifyReceipt", {
|
|
61
|
-
timeout: 30 * 1000,
|
|
62
|
-
headers: {
|
|
63
|
-
"Content-Type": "application/json",
|
|
64
|
-
"Accept": "application/json",
|
|
65
|
-
},
|
|
66
|
-
data: JSON.stringify({
|
|
67
|
-
"receipt-data": receiptData,
|
|
68
|
-
"password": password,
|
|
69
|
-
"exclude-old-transactions": true,
|
|
70
|
-
}),
|
|
71
|
-
});
|
|
72
|
-
if (!res) {
|
|
73
|
-
throw new functions.https.HttpsError("not-found", "The validation data is empty.");
|
|
74
|
-
}
|
|
75
|
-
let json = (yield res.json());
|
|
76
|
-
console.log(json);
|
|
77
|
-
let status = json["status"];
|
|
78
|
-
if (status === 21007 || status === 21008) {
|
|
79
|
-
res = yield api_1.Api.post("https://sandbox.itunes.apple.com/verifyReceipt", {
|
|
80
|
-
timeout: 30 * 1000,
|
|
81
|
-
headers: {
|
|
82
|
-
"Content-Type": "application/json",
|
|
83
|
-
"Accept": "application/json",
|
|
84
|
-
},
|
|
85
|
-
data: JSON.stringify({
|
|
86
|
-
"receipt-data": receiptData,
|
|
87
|
-
"password": password,
|
|
88
|
-
"exclude-old-transactions": true,
|
|
89
|
-
}),
|
|
90
|
-
});
|
|
91
|
-
if (!res) {
|
|
92
|
-
throw new functions.https.HttpsError("not-found", "The validation data is empty.");
|
|
93
|
-
}
|
|
94
|
-
json = (yield res.json());
|
|
95
|
-
console.log(json);
|
|
96
|
-
status = json["status"];
|
|
97
|
-
if (status !== 0) {
|
|
98
|
-
throw new functions.https.HttpsError("not-found", "Illegal receipt.");
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
else {
|
|
102
|
-
if (status !== 0) {
|
|
103
|
-
throw new functions.https.HttpsError("not-found", "Illegal receipt.");
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
return json;
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
exports.verifyIOS = verifyIOS;
|
|
110
|
-
//# sourceMappingURL=verify_ios.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"verify_ios.js","sourceRoot":"","sources":["../../src/lib/verify_ios.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iEAAmD;AACnD,+BAA4B;AAE5B;;;;;;;;;;;;;;;;;;;GAmBG;AACH,SAAsB,SAAS;yDAAC,EAC5B,WAAW,EACX,QAAQ,EAIX;QACG,IAAI,GAAG,GAAG,MAAM,SAAG,CAAC,IAAI,CAAC,4CAA4C,EAAE;YACnE,OAAO,EAAE,EAAE,GAAG,IAAI;YAClB,OAAO,EAAE;gBACL,cAAc,EAAE,kBAAkB;gBAClC,QAAQ,EAAE,kBAAkB;aAC/B;YACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;gBACjB,cAAc,EAAE,WAAW;gBAC3B,UAAU,EAAE,QAAQ;gBACpB,0BAA0B,EAAE,IAAI;aACnC,CAAC;SACL,CAAC,CAAC;QACH,IAAI,CAAC,GAAG,EAAE,CAAC;YACP,MAAM,IAAI,SAAS,CAAC,KAAK,CAAC,UAAU,CAAC,WAAW,EAAE,+BAA+B,CAAC,CAAC;QACvF,CAAC;QACD,IAAI,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,CAA2B,CAAC;QACxD,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAClB,IAAI,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC5B,IAAI,MAAM,KAAK,KAAK,IAAI,MAAM,KAAK,KAAK,EAAE,CAAC;YACvC,GAAG,GAAG,MAAM,SAAG,CAAC,IAA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