@mathrunet/masamune 2.0.0 → 2.0.1
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/functions/agora_cloud_recording.js +44 -47
- package/dist/functions/agora_cloud_recording.js.map +1 -1
- package/dist/functions/agora_token.js +34 -37
- package/dist/functions/agora_token.js.map +1 -1
- package/dist/functions/android_auth_code.js +19 -22
- package/dist/functions/android_auth_code.js.map +1 -1
- package/dist/functions/android_token.js +39 -42
- package/dist/functions/android_token.js.map +1 -1
- package/dist/functions/consumable_verify_android.js +38 -41
- package/dist/functions/consumable_verify_android.js.map +1 -1
- package/dist/functions/consumable_verify_ios.js +33 -36
- package/dist/functions/consumable_verify_ios.js.map +1 -1
- package/dist/functions/geocoding.js +23 -26
- package/dist/functions/geocoding.js.map +1 -1
- package/dist/functions/gmail.js +30 -33
- package/dist/functions/gmail.js.map +1 -1
- package/dist/functions/nonconsumable_verify_android.js +37 -40
- package/dist/functions/nonconsumable_verify_android.js.map +1 -1
- package/dist/functions/nonconsumable_verify_ios.js +32 -35
- package/dist/functions/nonconsumable_verify_ios.js.map +1 -1
- package/dist/functions/openai_chat_gpt.js +34 -37
- package/dist/functions/openai_chat_gpt.js.map +1 -1
- package/dist/functions/purchase_webhook_android.js +2 -2
- package/dist/functions/purchase_webhook_android.js.map +1 -1
- package/dist/functions/purchase_webhook_ios.js +82 -85
- package/dist/functions/purchase_webhook_ios.js.map +1 -1
- package/dist/functions/scheduler.js +4 -4
- package/dist/functions/scheduler.js.map +1 -1
- package/dist/functions/send_grid.js +30 -33
- package/dist/functions/send_grid.js.map +1 -1
- package/dist/functions/send_notification.js +32 -35
- package/dist/functions/send_notification.js.map +1 -1
- package/dist/functions/stripe.js +853 -856
- package/dist/functions/stripe.js.map +1 -1
- package/dist/functions/stripe_webhook.js +355 -358
- package/dist/functions/stripe_webhook.js.map +1 -1
- package/dist/functions/stripe_webhook_connect.js +65 -68
- package/dist/functions/stripe_webhook_connect.js.map +1 -1
- package/dist/functions/stripe_webhook_secure.js +63 -66
- package/dist/functions/stripe_webhook_secure.js.map +1 -1
- package/dist/functions/subscription_verify_android.js +54 -57
- package/dist/functions/subscription_verify_android.js.map +1 -1
- package/dist/functions/subscription_verify_ios.js +54 -57
- package/dist/functions/subscription_verify_ios.js.map +1 -1
- package/dist/lib/call_process_function_base.d.ts +3 -1
- package/dist/lib/call_process_function_base.js +1 -2
- package/dist/lib/call_process_function_base.js.map +1 -1
- package/dist/lib/functions_base.d.ts +1 -1
- package/dist/lib/functions_base.js +1 -0
- package/dist/lib/functions_base.js.map +1 -1
- package/dist/lib/request_process_function_base.d.ts +2 -0
- package/dist/lib/request_process_function_base.js +1 -2
- package/dist/lib/request_process_function_base.js.map +1 -1
- package/dist/lib/schedule_process_function_base.js +2 -2
- package/dist/lib/schedule_process_function_base.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
## [2.0.1](https://github.com/mathrunet/node_masamune/compare/v2.0.0...v2.0.1) (2024-01-15)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### fix
|
|
5
|
+
|
|
6
|
+
* Set the value of MaxInstances to 100. ([076b75d](https://github.com/mathrunet/node_masamune/commit/076b75d453792d8f3eb2a019b1abce154b2edb2c))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
1
10
|
# [2.0.0](https://github.com/mathrunet/node_masamune/compare/v1.10.4...v2.0.0) (2024-01-15)
|
|
2
11
|
|
|
3
12
|
|
|
@@ -43,72 +43,69 @@ const admin = __importStar(require("firebase-admin"));
|
|
|
43
43
|
*
|
|
44
44
|
* FirebaseStorageにファイルが保存されたタイミングで実行されます。
|
|
45
45
|
*/
|
|
46
|
-
module.exports = (regions, options, data) => {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
46
|
+
module.exports = (regions, options, data) => functions.storage.onObjectFinalized({
|
|
47
|
+
region: regions[0],
|
|
48
|
+
timeoutSeconds: options.timeoutSeconds,
|
|
49
|
+
memory: options.memory,
|
|
50
|
+
minInstances: options.minInstances,
|
|
51
|
+
concurrency: options.concurrency,
|
|
52
|
+
maxInstances: options.maxInstances,
|
|
53
|
+
}, (object) => __awaiter(void 0, void 0, void 0, function* () {
|
|
54
|
+
try {
|
|
55
|
+
const source = object.data.name;
|
|
56
|
+
if (!source) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
const bucket = admin.storage().bucket(object.bucket);
|
|
60
|
+
const targetScreenShot = source.toString().match(/([a-z0-9A-Z]+)_([a-z0-9A-Z]+)__uid_s_([0-9]+)__uid_e_video_([0-9]+).jp(e)?g/);
|
|
61
|
+
if (targetScreenShot) {
|
|
62
|
+
const target = targetScreenShot[2] + ".jpg";
|
|
63
|
+
if (target == source.toString()) {
|
|
64
|
+
console.log("Jpeg file is not replaced.");
|
|
59
65
|
return;
|
|
60
66
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
67
|
+
yield bucket.file(source).copy(target, {
|
|
68
|
+
contentType: "image/jpeg",
|
|
69
|
+
});
|
|
70
|
+
yield bucket.file(source).delete();
|
|
71
|
+
yield bucket.file(target).makePublic();
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
const targetM3U8 = source.toString().match(/([a-z0-9A-Z]+)_([a-z0-9A-Z]+).m3u8/);
|
|
75
|
+
if (targetM3U8) {
|
|
76
|
+
const target = targetM3U8[2] + ".m3u8";
|
|
65
77
|
if (target == source.toString()) {
|
|
66
|
-
console.log("
|
|
78
|
+
console.log("M3U8 file is not replaced.");
|
|
67
79
|
return;
|
|
68
80
|
}
|
|
69
81
|
yield bucket.file(source).copy(target, {
|
|
70
|
-
|
|
82
|
+
cacheControl: "no-cache",
|
|
83
|
+
contentType: "application/x-mpegURL",
|
|
71
84
|
});
|
|
72
85
|
yield bucket.file(source).delete();
|
|
73
86
|
yield bucket.file(target).makePublic();
|
|
74
87
|
}
|
|
75
88
|
else {
|
|
76
|
-
const
|
|
77
|
-
if (
|
|
78
|
-
const target =
|
|
89
|
+
const targetTS = source.toString().match(/([a-z0-9A-Z]+)_([a-z0-9A-Z]+)_([a-z0-9A-Z]+).ts/);
|
|
90
|
+
if (targetTS) {
|
|
91
|
+
const target = targetTS[0];
|
|
79
92
|
if (target == source.toString()) {
|
|
80
|
-
console.log("
|
|
93
|
+
console.log("Ts file is not replaced.");
|
|
81
94
|
return;
|
|
82
95
|
}
|
|
96
|
+
console.log("Ts file is replaced.");
|
|
83
97
|
yield bucket.file(source).copy(target, {
|
|
84
|
-
|
|
85
|
-
contentType: "application/x-mpegURL",
|
|
98
|
+
contentType: "video/MP2T",
|
|
86
99
|
});
|
|
87
100
|
yield bucket.file(source).delete();
|
|
88
101
|
yield bucket.file(target).makePublic();
|
|
89
102
|
}
|
|
90
|
-
else {
|
|
91
|
-
const targetTS = source.toString().match(/([a-z0-9A-Z]+)_([a-z0-9A-Z]+)_([a-z0-9A-Z]+).ts/);
|
|
92
|
-
if (targetTS) {
|
|
93
|
-
const target = targetTS[0];
|
|
94
|
-
if (target == source.toString()) {
|
|
95
|
-
console.log("Ts file is not replaced.");
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
console.log("Ts file is replaced.");
|
|
99
|
-
yield bucket.file(source).copy(target, {
|
|
100
|
-
contentType: "video/MP2T",
|
|
101
|
-
});
|
|
102
|
-
yield bucket.file(source).delete();
|
|
103
|
-
yield bucket.file(target).makePublic();
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
103
|
}
|
|
107
104
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}
|
|
113
|
-
};
|
|
105
|
+
}
|
|
106
|
+
catch (err) {
|
|
107
|
+
console.error(err);
|
|
108
|
+
throw err;
|
|
109
|
+
}
|
|
110
|
+
}));
|
|
114
111
|
//# sourceMappingURL=agora_cloud_recording.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agora_cloud_recording.js","sourceRoot":"","sources":["../../src/functions/agora_cloud_recording.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iEAAmD;AACnD,sDAAwC;AAGxC;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,GAAG,CACb,OAAiB,EACjB,OAAyB,EACzB,IAA+B,EACjC,EAAE
|
|
1
|
+
{"version":3,"file":"agora_cloud_recording.js","sourceRoot":"","sources":["../../src/functions/agora_cloud_recording.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iEAAmD;AACnD,sDAAwC;AAGxC;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,GAAG,CACb,OAAiB,EACjB,OAAyB,EACzB,IAA+B,EACjC,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,iBAAiB,CACpC;IACI,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAClB,cAAc,EAAE,OAAO,CAAC,cAAc;IACtC,MAAM,EAAE,OAAO,CAAC,MAAM;IACtB,YAAY,EAAE,OAAO,CAAC,YAAY;IAClC,WAAW,EAAE,OAAO,CAAC,WAAW;IAChC,YAAY,EAAE,OAAO,CAAC,YAAY;CACrC,EACD,CAAO,MAAM,EAAE,EAAE;IACb,IAAI;QACA,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;QAChC,IAAI,CAAC,MAAM,EAAE;YACT,OAAO;SACV;QACD,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACrD,MAAM,gBAAgB,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC,KAA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AC;gBAC5F,IAAI,QAAQ,EAAE;oBACV,MAAM,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;oBAC3B,IAAI,MAAM,IAAI,MAAM,CAAC,QAAQ,EAAE,EAAE;wBAC7B,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;wBACxC,OAAO;qBACV;oBACD,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;oBACpC,MAAM,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,CAC1B,MAAM,EACN;wBACI,WAAW,EAAE,YAAY;qBAC5B,CACJ,CAAC;oBACF,MAAM,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,CAAC;oBACnC,MAAM,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,CAAC;iBAC1C;aACJ;SACJ;KACJ;IAAC,OAAO,GAAG,EAAE;QACV,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACnB,MAAM,GAAG,CAAC;KACb;AACL,CAAC,CAAA,CACJ,CAAC"}
|
|
@@ -74,43 +74,40 @@ const agora_token_1 = require("agora-token");
|
|
|
74
74
|
*
|
|
75
75
|
* 役割。"audience"か"broadcaster"が指定できます。
|
|
76
76
|
*/
|
|
77
|
-
module.exports = (regions, options, data) => {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
if (query.data.role === "audience") {
|
|
94
|
-
role = agora_token_1.RtcRole.SUBSCRIBER;
|
|
95
|
-
}
|
|
96
|
-
const channelName = query.data.name;
|
|
97
|
-
let uid = 0;
|
|
98
|
-
if (query.data.uid) {
|
|
99
|
-
uid = query.data.uid;
|
|
100
|
-
}
|
|
101
|
-
if (!channelName) {
|
|
102
|
-
throw new functions.https.HttpsError("invalid-argument", "Channel is invalid.");
|
|
103
|
-
}
|
|
104
|
-
const token = agora_token_1.RtcTokenBuilder.buildTokenWithUid(appId, appCertificate, channelName, uid, role, expirationTimeInSeconds, expirationTimeInSeconds);
|
|
105
|
-
return {
|
|
106
|
-
channel: channelName,
|
|
107
|
-
token: token,
|
|
108
|
-
};
|
|
77
|
+
module.exports = (regions, options, data) => functions.https.onCall({
|
|
78
|
+
region: regions,
|
|
79
|
+
timeoutSeconds: options.timeoutSeconds,
|
|
80
|
+
memory: options.memory,
|
|
81
|
+
minInstances: options.minInstances,
|
|
82
|
+
concurrency: options.concurrency,
|
|
83
|
+
maxInstances: options.maxInstances,
|
|
84
|
+
}, (query) => __awaiter(void 0, void 0, void 0, function* () {
|
|
85
|
+
var _a, _b;
|
|
86
|
+
try {
|
|
87
|
+
const appId = (_a = process.env.AGORA_APPID) !== null && _a !== void 0 ? _a : "";
|
|
88
|
+
const appCertificate = (_b = process.env.AGORA_APPCERTIFICATE) !== null && _b !== void 0 ? _b : "";
|
|
89
|
+
const expirationTimeInSeconds = 3600;
|
|
90
|
+
let role = agora_token_1.RtcRole.PUBLISHER;
|
|
91
|
+
if (query.data.role === "audience") {
|
|
92
|
+
role = agora_token_1.RtcRole.SUBSCRIBER;
|
|
109
93
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
94
|
+
const channelName = query.data.name;
|
|
95
|
+
let uid = 0;
|
|
96
|
+
if (query.data.uid) {
|
|
97
|
+
uid = query.data.uid;
|
|
113
98
|
}
|
|
114
|
-
|
|
115
|
-
|
|
99
|
+
if (!channelName) {
|
|
100
|
+
throw new functions.https.HttpsError("invalid-argument", "Channel is invalid.");
|
|
101
|
+
}
|
|
102
|
+
const token = agora_token_1.RtcTokenBuilder.buildTokenWithUid(appId, appCertificate, channelName, uid, role, expirationTimeInSeconds, expirationTimeInSeconds);
|
|
103
|
+
return {
|
|
104
|
+
channel: channelName,
|
|
105
|
+
token: token,
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
catch (err) {
|
|
109
|
+
console.error(err);
|
|
110
|
+
throw err;
|
|
111
|
+
}
|
|
112
|
+
}));
|
|
116
113
|
//# sourceMappingURL=agora_token.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agora_token.js","sourceRoot":"","sources":["../../src/functions/agora_token.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iEAAmD;AACnD,6CAAuD;AAGvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,MAAM,CAAC,OAAO,GAAG,CACb,OAAiB,EACjB,OAAyB,EACzB,IAA+B,EACjC,EAAE
|
|
1
|
+
{"version":3,"file":"agora_token.js","sourceRoot":"","sources":["../../src/functions/agora_token.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iEAAmD;AACnD,6CAAuD;AAGvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,MAAM,CAAC,OAAO,GAAG,CACb,OAAiB,EACjB,OAAyB,EACzB,IAA+B,EACjC,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,CACvB;IACI,MAAM,EAAE,OAAO;IACf,cAAc,EAAE,OAAO,CAAC,cAAc;IACtC,MAAM,EAAE,OAAO,CAAC,MAAM;IACtB,YAAY,EAAE,OAAO,CAAC,YAAY;IAClC,WAAW,EAAE,OAAO,CAAC,WAAW;IAChC,YAAY,EAAE,OAAO,CAAC,YAAY;CACrC,EACD,CAAO,KAAK,EAAE,EAAE;;IACZ,IAAI;QACA,MAAM,KAAK,GAAG,MAAA,OAAO,CAAC,GAAG,CAAC,WAAW,mCAAI,EAAE,CAAC;QAC5C,MAAM,cAAc,GAAG,MAAA,OAAO,CAAC,GAAG,CAAC,oBAAoB,mCAAI,EAAE,CAAC;QAC9D,MAAM,uBAAuB,GAAG,IAAI,CAAC;QACrC,IAAI,IAAI,GAAG,qBAAO,CAAC,SAAS,CAAC;QAC7B,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,KAAK,UAAU,EAAE;YAChC,IAAI,GAAG,qBAAO,CAAC,UAAU,CAAC;SAC7B;QACD,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;QACpC,IAAI,GAAG,GAAG,CAAC,CAAC;QACZ,IAAI,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE;YAChB,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC;SACxB;QACD,IAAI,CAAC,WAAW,EAAE;YACd,MAAM,IAAI,SAAS,CAAC,KAAK,CAAC,UAAU,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,CAAC;SACnF;QACD,MAAM,KAAK,GAAG,6BAAe,CAAC,iBAAiB,CAC3C,KAAK,EACL,cAAc,EACd,WAAW,EACX,GAAG,EACH,IAAI,EACJ,uBAAuB,EACvB,uBAAuB,CAC1B,CAAC;QACF,OAAO;YACH,OAAO,EAAE,WAAW;YACpB,KAAK,EAAE,KAAK;SACf,CAAC;KACL;IAAC,OAAO,GAAG,EAAE;QACV,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACnB,MAAM,GAAG,CAAC;KACb;AACL,CAAC,CAAA,CACJ,CAAC"}
|
|
@@ -60,27 +60,24 @@ const functions = __importStar(require("firebase-functions/v2"));
|
|
|
60
60
|
* その後、認証情報からOAuth 2.0 クライアントIDを作成します。
|
|
61
61
|
* https://console.cloud.google.com/apis/credentials
|
|
62
62
|
*/
|
|
63
|
-
module.exports = (regions, options, data) => {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
if (!req.query.id || !redirectUri) {
|
|
76
|
-
throw new functions.https.HttpsError("invalid-argument", "Query parameter is invalid.");
|
|
77
|
-
}
|
|
78
|
-
res.redirect(`https://accounts.google.com/o/oauth2/auth?response_type=code&client_id=${req.query.id}&redirect_uri=${redirectUri}&scope=https://www.googleapis.com/auth/androidpublisher&access_type=offline&approval_prompt=force`);
|
|
63
|
+
module.exports = (regions, options, data) => functions.https.onRequest({
|
|
64
|
+
region: regions,
|
|
65
|
+
timeoutSeconds: options.timeoutSeconds,
|
|
66
|
+
memory: options.memory,
|
|
67
|
+
minInstances: options.minInstances,
|
|
68
|
+
concurrency: options.concurrency,
|
|
69
|
+
maxInstances: options.maxInstances,
|
|
70
|
+
}, (req, res) => __awaiter(void 0, void 0, void 0, function* () {
|
|
71
|
+
try {
|
|
72
|
+
const redirectUri = process.env.PURCHASE_ANDROID_REDIRECTURI;
|
|
73
|
+
if (!req.query.id || !redirectUri) {
|
|
74
|
+
throw new functions.https.HttpsError("invalid-argument", "Query parameter is invalid.");
|
|
79
75
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}
|
|
76
|
+
res.redirect(`https://accounts.google.com/o/oauth2/auth?response_type=code&client_id=${req.query.id}&redirect_uri=${redirectUri}&scope=https://www.googleapis.com/auth/androidpublisher&access_type=offline&approval_prompt=force`);
|
|
77
|
+
}
|
|
78
|
+
catch (err) {
|
|
79
|
+
console.error(err);
|
|
80
|
+
res.end();
|
|
81
|
+
}
|
|
82
|
+
}));
|
|
86
83
|
//# sourceMappingURL=android_auth_code.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"android_auth_code.js","sourceRoot":"","sources":["../../src/functions/android_auth_code.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iEAAmD;AAGnD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,CAAC,OAAO,GAAG,CACb,OAAiB,EACjB,OAAyB,EACzB,IAA+B,EACjC,EAAE
|
|
1
|
+
{"version":3,"file":"android_auth_code.js","sourceRoot":"","sources":["../../src/functions/android_auth_code.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iEAAmD;AAGnD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,CAAC,OAAO,GAAG,CACb,OAAiB,EACjB,OAAyB,EACzB,IAA+B,EACjC,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,SAAS,CAC1B;IACI,MAAM,EAAE,OAAO;IACf,cAAc,EAAE,OAAO,CAAC,cAAc;IACtC,MAAM,EAAE,OAAO,CAAC,MAAM;IACtB,YAAY,EAAE,OAAO,CAAC,YAAY;IAClC,WAAW,EAAE,OAAO,CAAC,WAAW;IAChC,YAAY,EAAE,OAAO,CAAC,YAAY;CACrC,EACD,CAAO,GAAG,EAAE,GAAG,EAAE,EAAE;IACf,IAAI;QACA,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC;QAC7D,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,WAAW,EAAE;YAC/B,MAAM,IAAI,SAAS,CAAC,KAAK,CAAC,UAAU,CAAC,kBAAkB,EAAE,6BAA6B,CAAC,CAAC;SAC3F;QACD,GAAG,CAAC,QAAQ,CACR,0EAA0E,GAAG,CAAC,KAAK,CAAC,EAAE,iBAAiB,WAAW,mGAAmG,CACxN,CAAC;KACL;IAAC,OAAO,GAAG,EAAE;QACV,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACnB,GAAG,CAAC,GAAG,EAAE,CAAC;KACb;AACL,CAAC,CAAA,CACJ,CAAC"}
|
|
@@ -74,48 +74,45 @@ const api_1 = require("../lib/api");
|
|
|
74
74
|
* その後、認証情報からOAuth 2.0 クライアントIDを作成します。
|
|
75
75
|
* https://console.cloud.google.com/apis/credentials
|
|
76
76
|
*/
|
|
77
|
-
module.exports = (regions, options, data) => {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
if (!req.query.code || !clientId || !clientSecret || !redirectUri) {
|
|
92
|
-
throw new functions.https.HttpsError("invalid-argument", "Query parameter is invalid.");
|
|
93
|
-
}
|
|
94
|
-
const resp = yield api_1.Api.post("https://accounts.google.com/o/oauth2/token", {
|
|
95
|
-
timeout: 30 * 1000,
|
|
96
|
-
data: {
|
|
97
|
-
"grant_type": "authorization_code",
|
|
98
|
-
"client_id": clientId,
|
|
99
|
-
"client_secret": clientSecret,
|
|
100
|
-
"redirect_uri": redirectUri,
|
|
101
|
-
"access_type": "offline",
|
|
102
|
-
"code": req.query.code,
|
|
103
|
-
},
|
|
104
|
-
});
|
|
105
|
-
if (!resp) {
|
|
106
|
-
throw new functions.https.HttpsError("data-loss", "Cannot get access token.");
|
|
107
|
-
}
|
|
108
|
-
const json = (yield resp.json());
|
|
109
|
-
if (json === null) {
|
|
110
|
-
throw new functions.https.HttpsError("data-loss", "Cannot get access token.");
|
|
111
|
-
}
|
|
112
|
-
console.log(json);
|
|
113
|
-
res.send(`RefreshToken:${json["refresh_token"]}`);
|
|
77
|
+
module.exports = (regions, options, data) => functions.https.onRequest({
|
|
78
|
+
region: regions,
|
|
79
|
+
timeoutSeconds: options.timeoutSeconds,
|
|
80
|
+
memory: options.memory,
|
|
81
|
+
minInstances: options.minInstances,
|
|
82
|
+
concurrency: options.concurrency,
|
|
83
|
+
maxInstances: options.maxInstances,
|
|
84
|
+
}, (req, res) => __awaiter(void 0, void 0, void 0, function* () {
|
|
85
|
+
try {
|
|
86
|
+
const redirectUri = process.env.PURCHASE_ANDROID_REDIRECTURI;
|
|
87
|
+
const clientId = process.env.PURCHASE_ANDROID_CLIENTID;
|
|
88
|
+
const clientSecret = process.env.PURCHASE_ANDROID_CLIENTSECRET;
|
|
89
|
+
if (!req.query.code || !clientId || !clientSecret || !redirectUri) {
|
|
90
|
+
throw new functions.https.HttpsError("invalid-argument", "Query parameter is invalid.");
|
|
114
91
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
92
|
+
const resp = yield api_1.Api.post("https://accounts.google.com/o/oauth2/token", {
|
|
93
|
+
timeout: 30 * 1000,
|
|
94
|
+
data: {
|
|
95
|
+
"grant_type": "authorization_code",
|
|
96
|
+
"client_id": clientId,
|
|
97
|
+
"client_secret": clientSecret,
|
|
98
|
+
"redirect_uri": redirectUri,
|
|
99
|
+
"access_type": "offline",
|
|
100
|
+
"code": req.query.code,
|
|
101
|
+
},
|
|
102
|
+
});
|
|
103
|
+
if (!resp) {
|
|
104
|
+
throw new functions.https.HttpsError("data-loss", "Cannot get access token.");
|
|
118
105
|
}
|
|
119
|
-
|
|
120
|
-
|
|
106
|
+
const json = (yield resp.json());
|
|
107
|
+
if (json === null) {
|
|
108
|
+
throw new functions.https.HttpsError("data-loss", "Cannot get access token.");
|
|
109
|
+
}
|
|
110
|
+
console.log(json);
|
|
111
|
+
res.send(`RefreshToken:${json["refresh_token"]}`);
|
|
112
|
+
}
|
|
113
|
+
catch (err) {
|
|
114
|
+
console.error(err);
|
|
115
|
+
res.end();
|
|
116
|
+
}
|
|
117
|
+
}));
|
|
121
118
|
//# sourceMappingURL=android_token.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"android_token.js","sourceRoot":"","sources":["../../src/functions/android_token.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iEAAmD;AACnD,oCAAiC;AAIjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,MAAM,CAAC,OAAO,GAAG,CACb,OAAiB,EACjB,OAAyB,EACzB,IAA+B,EACjC,EAAE
|
|
1
|
+
{"version":3,"file":"android_token.js","sour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AAC,KAAK,CAAC,IAAI;aACzB;SACJ,CAAC,CAAC;QACH,IAAI,CAAC,IAAI,EAAE;YACP,MAAM,IAAI,SAAS,CAAC,KAAK,CAAC,UAAU,CAAC,WAAW,EAAE,0BAA0B,CAAC,CAAC;SACjF;QACD,MAAM,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,CAA2B,CAAC;QAC3D,IAAI,IAAI,KAAK,IAAI,EAAE;YACf,MAAM,IAAI,SAAS,CAAC,KAAK,CAAC,UAAU,CAAC,WAAW,EAAE,0BAA0B,CAAC,CAAC;SACjF;QACD,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAClB,GAAG,CAAC,IAAI,CAAC,gBAAgB,IAAI,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;KACrD;IAAC,OAAO,GAAG,EAAE;QACV,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACnB,GAAG,CAAC,GAAG,EAAE,CAAC;KACb;AACL,CAAC,CAAA,CACJ,CAAC"}
|
|
@@ -96,47 +96,44 @@ const updater = __importStar(require("../lib/update_wallet"));
|
|
|
96
96
|
*
|
|
97
97
|
* 購入したときに発行された購入トークン。
|
|
98
98
|
*/
|
|
99
|
-
module.exports = (regions, options, data) => {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
if (res["purchaseState"] !== 0) {
|
|
122
|
-
throw new functions.https.HttpsError("unauthenticated", "Illegal receipt.");
|
|
123
|
-
}
|
|
124
|
-
/* ==== ここまでAndroid検証 ==== */
|
|
125
|
-
if (!query.data.path || !query.data.value) {
|
|
126
|
-
return res;
|
|
127
|
-
}
|
|
128
|
-
/* ==== Firestoreの更新ここから ==== */
|
|
129
|
-
yield updater.updateWallet({
|
|
130
|
-
targetDocumentFieldPath: query.data.path,
|
|
131
|
-
value: query.data.value,
|
|
132
|
-
});
|
|
133
|
-
/* ==== ここまでFirestoreの更新 ==== */
|
|
134
|
-
return res;
|
|
99
|
+
module.exports = (regions, options, data) => functions.https.onCall({
|
|
100
|
+
region: regions,
|
|
101
|
+
timeoutSeconds: options.timeoutSeconds,
|
|
102
|
+
memory: options.memory,
|
|
103
|
+
minInstances: options.minInstances,
|
|
104
|
+
concurrency: options.concurrency,
|
|
105
|
+
maxInstances: options.maxInstances,
|
|
106
|
+
}, (query) => __awaiter(void 0, void 0, void 0, function* () {
|
|
107
|
+
var _a, _b, _c;
|
|
108
|
+
try {
|
|
109
|
+
/* ==== Android検証ここから ==== */
|
|
110
|
+
const res = yield verifier.verifyAndroid({
|
|
111
|
+
type: "products",
|
|
112
|
+
clientId: (_a = process.env.PURCHASE_ANDROID_CLIENTID) !== null && _a !== void 0 ? _a : "",
|
|
113
|
+
clientSecret: (_b = process.env.PURCHASE_ANDROID_CLIENTSECRET) !== null && _b !== void 0 ? _b : "",
|
|
114
|
+
refreshToken: (_c = process.env.PURCHASE_ANDROID_REFRESHTOKEN) !== null && _c !== void 0 ? _c : "",
|
|
115
|
+
packageName: query.data.packageName,
|
|
116
|
+
productId: query.data.productId,
|
|
117
|
+
purchaseToken: query.data.purchaseToken,
|
|
118
|
+
});
|
|
119
|
+
if (res["purchaseState"] !== 0) {
|
|
120
|
+
throw new functions.https.HttpsError("unauthenticated", "Illegal receipt.");
|
|
135
121
|
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
122
|
+
/* ==== ここまでAndroid検証 ==== */
|
|
123
|
+
if (!query.data.path || !query.data.value) {
|
|
124
|
+
return res;
|
|
139
125
|
}
|
|
140
|
-
|
|
141
|
-
|
|
126
|
+
/* ==== Firestoreの更新ここから ==== */
|
|
127
|
+
yield updater.updateWallet({
|
|
128
|
+
targetDocumentFieldPath: query.data.path,
|
|
129
|
+
value: query.data.value,
|
|
130
|
+
});
|
|
131
|
+
/* ==== ここまでFirestoreの更新 ==== */
|
|
132
|
+
return res;
|
|
133
|
+
}
|
|
134
|
+
catch (err) {
|
|
135
|
+
console.error(err);
|
|
136
|
+
throw err;
|
|
137
|
+
}
|
|
138
|
+
}));
|
|
142
139
|
//# sourceMappingURL=consumable_verify_android.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consumable_verify_android.js","sourceRoot":"","sources":["../../src/functions/consumable_verify_android.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iEAAmD;AACnD,gEAAkD;AAClD,8DAAgD;AAGhD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4DG;AACH,MAAM,CAAC,OAAO,GAAG,CACb,OAAiB,EACjB,OAAyB,EACzB,IAA+B,EACjC,EAAE
|
|
1
|
+
{"version":3,"file":"consumable_verify_android.js","sourceRoot":"","sources":["../../src/functions/consumable_verify_android.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iEAAmD;AACnD,gEAAkD;AAClD,8DAAgD;AAGhD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4DG;AACH,MAAM,CAAC,OAAO,GAAG,CACb,OAAiB,EACjB,OAAyB,EACzB,IAA+B,EACjC,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,CACvB;IACI,MAAM,EAAE,OAAO;IACf,cAAc,EAAE,OAAO,CAAC,cAAc;IACtC,MAAM,EAAE,OAAO,CAAC,MAAM;IACtB,YAAY,EAAE,OAAO,CAAC,YAAY;IAClC,WAAW,EAAE,OAAO,CAAC,WAAW;IAChC,YAAY,EAAE,OAAO,CAAC,YAAY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* 購入の際のレシートデータ。
|
|
62
62
|
*/
|
|
63
|
-
module.exports = (regions, options, data) => {
|
|
63
|
+
module.exports = (regions, options, data) => functions.https.onCall({
|
|
64
|
+
region: regions,
|
|
65
|
+
timeoutSeconds: options.timeoutSeconds,
|
|
66
|
+
memory: options.memory,
|
|
67
|
+
minInstances: options.minInstances,
|
|
68
|
+
concurrency: options.concurrency,
|
|
69
|
+
maxInstances: options.maxInstances,
|
|
70
|
+
}, (query) => __awaiter(void 0, void 0, void 0, function* () {
|
|
64
71
|
var _a;
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
try {
|
|
75
|
-
/* ==== IOS検証ここから ==== */
|
|
76
|
-
const res = yield verifier.verifyIOS({
|
|
77
|
-
receiptData: query.data.receiptData,
|
|
78
|
-
password: (_b = process.env.PURCHASE_IOS_SHAREDSECRET) !== null && _b !== void 0 ? _b : "",
|
|
79
|
-
});
|
|
80
|
-
const status = res["status"];
|
|
81
|
-
if (status !== 0) {
|
|
82
|
-
throw new functions.https.HttpsError("unauthenticated", "Illegal receipt.");
|
|
83
|
-
}
|
|
84
|
-
/* ==== ここまでIOS検証 ==== */
|
|
85
|
-
if (!query.data.path || !query.data.value) {
|
|
86
|
-
return res;
|
|
87
|
-
}
|
|
88
|
-
/* ==== Firestoreの更新ここから ==== */
|
|
89
|
-
yield updater.updateWallet({
|
|
90
|
-
targetDocumentFieldPath: query.data.path,
|
|
91
|
-
value: query.data.value,
|
|
92
|
-
});
|
|
93
|
-
/* ==== ここまでFirestoreの更新 ==== */
|
|
94
|
-
return res;
|
|
72
|
+
try {
|
|
73
|
+
/* ==== IOS検証ここから ==== */
|
|
74
|
+
const res = yield verifier.verifyIOS({
|
|
75
|
+
receiptData: query.data.receiptData,
|
|
76
|
+
password: (_a = process.env.PURCHASE_IOS_SHAREDSECRET) !== null && _a !== void 0 ? _a : "",
|
|
77
|
+
});
|
|
78
|
+
const status = res["status"];
|
|
79
|
+
if (status !== 0) {
|
|
80
|
+
throw new functions.https.HttpsError("unauthenticated", "Illegal receipt.");
|
|
95
81
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
82
|
+
/* ==== ここまでIOS検証 ==== */
|
|
83
|
+
if (!query.data.path || !query.data.value) {
|
|
84
|
+
return res;
|
|
99
85
|
}
|
|
100
|
-
|
|
101
|
-
|
|
86
|
+
/* ==== Firestoreの更新ここから ==== */
|
|
87
|
+
yield updater.updateWallet({
|
|
88
|
+
targetDocumentFieldPath: query.data.path,
|
|
89
|
+
value: query.data.value,
|
|
90
|
+
});
|
|
91
|
+
/* ==== ここまでFirestoreの更新 ==== */
|
|
92
|
+
return res;
|
|
93
|
+
}
|
|
94
|
+
catch (err) {
|
|
95
|
+
console.error(err);
|
|
96
|
+
throw err;
|
|
97
|
+
}
|
|
98
|
+
}));
|
|
102
99
|
//# sourceMappingURL=consumable_verify_ios.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consumable_verify_ios.js","sourceRoot":"","sources":["../../src/functions/consumable_verify_ios.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iEAAmD;AACnD,4DAA8C;AAC9C,8DAAgD;AAGhD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,OAAO,GAAG,CACb,OAAiB,EACjB,OAAyB,EACzB,IAA+B,EACjC,EAAE
|
|
1
|
+
{"version":3,"file":"consumable_verify_ios.js","sourceRoot":"","sources":["../../src/functions/consumable_verify_ios.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iEAAmD;AACnD,4DAA8C;AAC9C,8DAAgD;AAGhD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,OAAO,GAAG,CACb,OAAiB,EACjB,OAAyB,EACzB,IAA+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