@mathrunet/masamune 1.10.4 → 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 +18 -0
- package/dist/functions/agora_cloud_recording.js +10 -3
- package/dist/functions/agora_cloud_recording.js.map +1 -1
- package/dist/functions/agora_token.js +18 -11
- package/dist/functions/agora_token.js.map +1 -1
- package/dist/functions/android_auth_code.js +14 -7
- package/dist/functions/android_auth_code.js.map +1 -1
- package/dist/functions/android_token.js +19 -10
- package/dist/functions/android_token.js.map +1 -1
- package/dist/functions/consumable_verify_android.js +22 -15
- package/dist/functions/consumable_verify_android.js.map +1 -1
- package/dist/functions/consumable_verify_ios.js +16 -9
- package/dist/functions/consumable_verify_ios.js.map +1 -1
- package/dist/functions/geocoding.js +13 -6
- package/dist/functions/geocoding.js.map +1 -1
- package/dist/functions/gmail.js +15 -8
- package/dist/functions/gmail.js.map +1 -1
- package/dist/functions/nonconsumable_verify_android.js +21 -14
- package/dist/functions/nonconsumable_verify_android.js.map +1 -1
- package/dist/functions/nonconsumable_verify_ios.js +15 -8
- package/dist/functions/nonconsumable_verify_ios.js.map +1 -1
- package/dist/functions/openai_chat_gpt.js +15 -8
- package/dist/functions/openai_chat_gpt.js.map +1 -1
- package/dist/functions/purchase_webhook_android.js +25 -17
- package/dist/functions/purchase_webhook_android.js.map +1 -1
- package/dist/functions/purchase_webhook_ios.js +16 -5
- package/dist/functions/purchase_webhook_ios.js.map +1 -1
- package/dist/functions/scheduler.js +14 -8
- package/dist/functions/scheduler.js.map +1 -1
- package/dist/functions/send_grid.js +14 -7
- package/dist/functions/send_grid.js.map +1 -1
- package/dist/functions/send_notification.js +18 -8
- package/dist/functions/send_notification.js.map +1 -1
- package/dist/functions/stripe.js +101 -96
- package/dist/functions/stripe.js.map +1 -1
- package/dist/functions/stripe_webhook.js +27 -23
- package/dist/functions/stripe_webhook.js.map +1 -1
- package/dist/functions/stripe_webhook_connect.js +16 -10
- package/dist/functions/stripe_webhook_connect.js.map +1 -1
- package/dist/functions/stripe_webhook_secure.js +18 -12
- package/dist/functions/stripe_webhook_secure.js.map +1 -1
- package/dist/functions/subscription_verify_android.js +28 -22
- package/dist/functions/subscription_verify_android.js.map +1 -1
- package/dist/functions/subscription_verify_ios.js +20 -14
- package/dist/functions/subscription_verify_ios.js.map +1 -1
- package/dist/functions.d.ts +22 -68
- package/dist/functions.js +22 -22
- package/dist/functions.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/call_process_function_base.d.ts +4 -15
- package/dist/lib/call_process_function_base.js +12 -13
- package/dist/lib/call_process_function_base.js.map +1 -1
- package/dist/lib/functions_base.d.ts +97 -9
- package/dist/lib/functions_base.js +11 -7
- package/dist/lib/functions_base.js.map +1 -1
- package/dist/lib/functions_data.d.ts +2 -36
- package/dist/lib/functions_data.js +2 -29
- package/dist/lib/functions_data.js.map +1 -1
- package/dist/lib/gmail.d.ts +2 -2
- package/dist/lib/gmail.js +4 -29
- package/dist/lib/gmail.js.map +1 -1
- package/dist/lib/request_process_function_base.d.ts +6 -16
- package/dist/lib/request_process_function_base.js +12 -13
- package/dist/lib/request_process_function_base.js.map +1 -1
- package/dist/lib/schedule_process_function_base.d.ts +13 -11
- package/dist/lib/schedule_process_function_base.js +15 -9
- package/dist/lib/schedule_process_function_base.js.map +1 -1
- package/dist/lib/send_grid.d.ts +1 -1
- package/dist/lib/send_grid.js +3 -27
- package/dist/lib/send_grid.js.map +1 -1
- package/dist/lib/send_notification.js +1 -1
- package/dist/lib/send_notification.js.map +1 -1
- package/dist/lib/verify_android.js +1 -1
- package/dist/lib/verify_android.js.map +1 -1
- package/dist/lib/verify_ios.js +1 -1
- package/dist/lib/verify_ios.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
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
|
+
|
|
10
|
+
# [2.0.0](https://github.com/mathrunet/node_masamune/compare/v1.10.4...v2.0.0) (2024-01-15)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### feat
|
|
14
|
+
|
|
15
|
+
* Compatible with FirebaseFunctionsV2. ([df2cc6d](https://github.com/mathrunet/node_masamune/commit/df2cc6d050fe249781fe42afb5633e6d39b32f74))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
1
19
|
## [1.10.4](https://github.com/mathrunet/node_masamune/compare/v1.10.3...v1.10.4) (2024-01-03)
|
|
2
20
|
|
|
3
21
|
|
|
@@ -32,7 +32,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
32
32
|
});
|
|
33
33
|
};
|
|
34
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
const functions = __importStar(require("firebase-functions"));
|
|
35
|
+
const functions = __importStar(require("firebase-functions/v2"));
|
|
36
36
|
const admin = __importStar(require("firebase-admin"));
|
|
37
37
|
/**
|
|
38
38
|
* Convert files generated by Agora.io's cloud recording into an easy-to-handle format from within the app.
|
|
@@ -43,9 +43,16 @@ const admin = __importStar(require("firebase-admin"));
|
|
|
43
43
|
*
|
|
44
44
|
* FirebaseStorageにファイルが保存されたタイミングで実行されます。
|
|
45
45
|
*/
|
|
46
|
-
module.exports = (regions,
|
|
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* () {
|
|
47
54
|
try {
|
|
48
|
-
const source = object.name;
|
|
55
|
+
const source = object.data.name;
|
|
49
56
|
if (!source) {
|
|
50
57
|
return;
|
|
51
58
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agora_cloud_recording.js","sourceRoot":"","sources":["../../src/functions/agora_cloud_recording.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,
|
|
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,KAAK,CAAC,6EAA6E,CAAC,CAAC;QAChI,IAAI,gBAAgB,EAAE;YAClB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,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"}
|
|
@@ -32,14 +32,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
32
32
|
});
|
|
33
33
|
};
|
|
34
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
const functions = __importStar(require("firebase-functions"));
|
|
35
|
+
const functions = __importStar(require("firebase-functions/v2"));
|
|
36
36
|
const agora_token_1 = require("agora-token");
|
|
37
37
|
/**
|
|
38
38
|
* Obtain an Agora.io security token.
|
|
39
39
|
*
|
|
40
40
|
* Agora.ioのセキュリティトークンを取得します。
|
|
41
41
|
*
|
|
42
|
-
* @param
|
|
42
|
+
* @param process.env.AGORA_APPID
|
|
43
43
|
* AppID for Agora.
|
|
44
44
|
* Log in to the following URL and create a project.
|
|
45
45
|
* After the project is created, the AppID can be copied.
|
|
@@ -50,7 +50,7 @@ const agora_token_1 = require("agora-token");
|
|
|
50
50
|
*
|
|
51
51
|
* https://console.agora.io/projects
|
|
52
52
|
*
|
|
53
|
-
* @param
|
|
53
|
+
* @param process.env.AGORA_APPCERTIFICATE
|
|
54
54
|
* AppCertificate for Agora.
|
|
55
55
|
* You can obtain the certificate after entering the project you created and activating it in Security -> App certificate.
|
|
56
56
|
*
|
|
@@ -74,20 +74,27 @@ const agora_token_1 = require("agora-token");
|
|
|
74
74
|
*
|
|
75
75
|
* 役割。"audience"か"broadcaster"が指定できます。
|
|
76
76
|
*/
|
|
77
|
-
module.exports = (regions,
|
|
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;
|
|
78
86
|
try {
|
|
79
|
-
const
|
|
80
|
-
const
|
|
81
|
-
const appCertificate = config.app_certificate;
|
|
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 : "";
|
|
82
89
|
const expirationTimeInSeconds = 3600;
|
|
83
90
|
let role = agora_token_1.RtcRole.PUBLISHER;
|
|
84
|
-
if (query.role === "audience") {
|
|
91
|
+
if (query.data.role === "audience") {
|
|
85
92
|
role = agora_token_1.RtcRole.SUBSCRIBER;
|
|
86
93
|
}
|
|
87
|
-
const channelName = query.name;
|
|
94
|
+
const channelName = query.data.name;
|
|
88
95
|
let uid = 0;
|
|
89
|
-
if (query.uid) {
|
|
90
|
-
uid = query.uid;
|
|
96
|
+
if (query.data.uid) {
|
|
97
|
+
uid = query.data.uid;
|
|
91
98
|
}
|
|
92
99
|
if (!channelName) {
|
|
93
100
|
throw new functions.https.HttpsError("invalid-argument", "Channel is invalid.");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agora_token.js","sourceRoot":"","sources":["../../src/functions/agora_token.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,
|
|
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"}
|
|
@@ -32,7 +32,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
32
32
|
});
|
|
33
33
|
};
|
|
34
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
const functions = __importStar(require("firebase-functions"));
|
|
35
|
+
const functions = __importStar(require("firebase-functions/v2"));
|
|
36
36
|
/**
|
|
37
37
|
* After being redirected from [android_auth_code], you will get a refresh token to connect to Google's API.
|
|
38
38
|
* Please execute [android_auth_code] after registering the required information.
|
|
@@ -40,14 +40,14 @@ const functions = __importStar(require("firebase-functions"));
|
|
|
40
40
|
* [android_auth_code]からリダイレクトされた後、GoogleのAPIに接続するためのリフレッシュトークンを取得します。
|
|
41
41
|
* 必要情報を登録した後[android_auth_code]を実行してください。
|
|
42
42
|
*
|
|
43
|
-
* @param
|
|
43
|
+
* @param process.env.PURCHASE_ANDROID_REDIRECTURI
|
|
44
44
|
* Describe the absolute URL where [android_token] exists.
|
|
45
45
|
* You will be redirected to this URL to obtain a refresh token.
|
|
46
46
|
*
|
|
47
47
|
* [android_token]が存在する絶対URLを記述します。
|
|
48
48
|
* このURLにリダイレクトされリフレッシュトークンを取得できます。
|
|
49
49
|
*
|
|
50
|
-
* @param
|
|
50
|
+
* @param process.env.PURCHASE_ANDROID_CLIENTID
|
|
51
51
|
* Google's OAuth 2.0 client ID.
|
|
52
52
|
* Create an OAuth consent screen from the URL below.
|
|
53
53
|
* https://console.cloud.google.com/apis/credentials/consent
|
|
@@ -60,13 +60,20 @@ const functions = __importStar(require("firebase-functions"));
|
|
|
60
60
|
* その後、認証情報からOAuth 2.0 クライアントIDを作成します。
|
|
61
61
|
* https://console.cloud.google.com/apis/credentials
|
|
62
62
|
*/
|
|
63
|
-
module.exports = (regions,
|
|
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* () {
|
|
64
71
|
try {
|
|
65
|
-
const
|
|
66
|
-
if (!req.query.id || !
|
|
72
|
+
const redirectUri = process.env.PURCHASE_ANDROID_REDIRECTURI;
|
|
73
|
+
if (!req.query.id || !redirectUri) {
|
|
67
74
|
throw new functions.https.HttpsError("invalid-argument", "Query parameter is invalid.");
|
|
68
75
|
}
|
|
69
|
-
res.redirect(`https://accounts.google.com/o/oauth2/auth?response_type=code&client_id=${req.query.id}&redirect_uri=${
|
|
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`);
|
|
70
77
|
}
|
|
71
78
|
catch (err) {
|
|
72
79
|
console.error(err);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"android_auth_code.js","sourceRoot":"","sources":["../../src/functions/android_auth_code.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,
|
|
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"}
|
|
@@ -32,7 +32,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
32
32
|
});
|
|
33
33
|
};
|
|
34
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
const functions = __importStar(require("firebase-functions"));
|
|
35
|
+
const functions = __importStar(require("firebase-functions/v2"));
|
|
36
36
|
const api_1 = require("../lib/api");
|
|
37
37
|
/**
|
|
38
38
|
* After being redirected from [android_auth_code], you will get a refresh token to connect to Google's API.
|
|
@@ -41,14 +41,14 @@ const api_1 = require("../lib/api");
|
|
|
41
41
|
* [android_auth_code]からリダイレクトされた後、GoogleのAPIに接続するためのリフレッシュトークンを取得します。
|
|
42
42
|
* 必要情報を登録した後[android_auth_code]を実行してください。
|
|
43
43
|
*
|
|
44
|
-
* @param
|
|
44
|
+
* @param process.env.PURCHASE_ANDROID_REDIRECTURI
|
|
45
45
|
* Describe the absolute URL where [android_token] exists.
|
|
46
46
|
* You will be redirected to this URL to obtain a refresh token.
|
|
47
47
|
*
|
|
48
48
|
* [android_token]が存在する絶対URLを記述します。
|
|
49
49
|
* このURLにリダイレクトされリフレッシュトークンを取得できます。
|
|
50
50
|
*
|
|
51
|
-
* @param
|
|
51
|
+
* @param process.env.PURCHASE_ANDROID_CLIENTID
|
|
52
52
|
* Google's OAuth 2.0 client ID.
|
|
53
53
|
* Create an OAuth consent screen from the URL below.
|
|
54
54
|
* https://console.cloud.google.com/apis/credentials/consent
|
|
@@ -61,7 +61,7 @@ const api_1 = require("../lib/api");
|
|
|
61
61
|
* その後、認証情報からOAuth 2.0 クライアントIDを作成します。
|
|
62
62
|
* https://console.cloud.google.com/apis/credentials
|
|
63
63
|
*
|
|
64
|
-
* @param
|
|
64
|
+
* @param process.env.PURCHASE_ANDROID_CLIENTSECRET
|
|
65
65
|
* Google's OAuth 2.0 client secret.
|
|
66
66
|
* Create an OAuth consent screen from the URL below.
|
|
67
67
|
* https://console.cloud.google.com/apis/credentials/consent
|
|
@@ -74,19 +74,28 @@ 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,
|
|
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* () {
|
|
78
85
|
try {
|
|
79
|
-
const
|
|
80
|
-
|
|
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) {
|
|
81
90
|
throw new functions.https.HttpsError("invalid-argument", "Query parameter is invalid.");
|
|
82
91
|
}
|
|
83
92
|
const resp = yield api_1.Api.post("https://accounts.google.com/o/oauth2/token", {
|
|
84
93
|
timeout: 30 * 1000,
|
|
85
94
|
data: {
|
|
86
95
|
"grant_type": "authorization_code",
|
|
87
|
-
"client_id":
|
|
88
|
-
"client_secret":
|
|
89
|
-
"redirect_uri":
|
|
96
|
+
"client_id": clientId,
|
|
97
|
+
"client_secret": clientSecret,
|
|
98
|
+
"redirect_uri": redirectUri,
|
|
90
99
|
"access_type": "offline",
|
|
91
100
|
"code": req.query.code,
|
|
92
101
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"android_token.js","sourceRoot":"","sources":["../../src/functions/android_token.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"android_token.js","sourceRoot":"","sources":["../../src/functions/android_token.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iEAAmD;AACnD,oCAAiC;AAIjC;;;;;;;;;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AAW,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"}
|
|
@@ -32,7 +32,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
32
32
|
});
|
|
33
33
|
};
|
|
34
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
const functions = __importStar(require("firebase-functions"));
|
|
35
|
+
const functions = __importStar(require("firebase-functions/v2"));
|
|
36
36
|
const verifier = __importStar(require("../lib/verify_android"));
|
|
37
37
|
const updater = __importStar(require("../lib/update_wallet"));
|
|
38
38
|
/**
|
|
@@ -40,12 +40,12 @@ const updater = __importStar(require("../lib/update_wallet"));
|
|
|
40
40
|
*
|
|
41
41
|
* 消費型のアプリ内課金を行います。[path]に指定したドキュメント内のフィールドの値を[value]に加算します。
|
|
42
42
|
*
|
|
43
|
-
* @param
|
|
43
|
+
* @param process.env.PURCHASE_ANDROID_REFRESHTOKEN
|
|
44
44
|
* Describe the refresh token that can be obtained by accessing [android_auth_code].
|
|
45
45
|
*
|
|
46
46
|
* [android_auth_code]にアクセスすることで取得できるリフレッシュトークンを記述します。
|
|
47
47
|
*
|
|
48
|
-
* @param
|
|
48
|
+
* @param process.env.PURCHASE_ANDROID_CLIENTID
|
|
49
49
|
* Google's OAuth 2.0 client ID.
|
|
50
50
|
* Create an OAuth consent screen from the URL below.
|
|
51
51
|
* https://console.cloud.google.com/apis/credentials/consent
|
|
@@ -58,7 +58,7 @@ const updater = __importStar(require("../lib/update_wallet"));
|
|
|
58
58
|
* その後、認証情報からOAuth 2.0 クライアントIDを作成します。
|
|
59
59
|
* https://console.cloud.google.com/apis/credentials
|
|
60
60
|
*
|
|
61
|
-
* @param
|
|
61
|
+
* @param process.env.PURCHASE_ANDROID_CLIENTSECRET
|
|
62
62
|
* Google's OAuth 2.0 client secret.
|
|
63
63
|
* Create an OAuth consent screen from the URL below.
|
|
64
64
|
* https://console.cloud.google.com/apis/credentials/consent
|
|
@@ -96,30 +96,37 @@ const updater = __importStar(require("../lib/update_wallet"));
|
|
|
96
96
|
*
|
|
97
97
|
* 購入したときに発行された購入トークン。
|
|
98
98
|
*/
|
|
99
|
-
module.exports = (regions,
|
|
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;
|
|
100
108
|
try {
|
|
101
|
-
const config = functions.config().purchase;
|
|
102
109
|
/* ==== Android検証ここから ==== */
|
|
103
110
|
const res = yield verifier.verifyAndroid({
|
|
104
111
|
type: "products",
|
|
105
|
-
clientId:
|
|
106
|
-
clientSecret:
|
|
107
|
-
refreshToken:
|
|
108
|
-
packageName: query.packageName,
|
|
109
|
-
productId: query.productId,
|
|
110
|
-
purchaseToken: query.purchaseToken,
|
|
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,
|
|
111
118
|
});
|
|
112
119
|
if (res["purchaseState"] !== 0) {
|
|
113
120
|
throw new functions.https.HttpsError("unauthenticated", "Illegal receipt.");
|
|
114
121
|
}
|
|
115
122
|
/* ==== ここまでAndroid検証 ==== */
|
|
116
|
-
if (!query.path || !query.value) {
|
|
123
|
+
if (!query.data.path || !query.data.value) {
|
|
117
124
|
return res;
|
|
118
125
|
}
|
|
119
126
|
/* ==== Firestoreの更新ここから ==== */
|
|
120
127
|
yield updater.updateWallet({
|
|
121
|
-
targetDocumentFieldPath: query.path,
|
|
122
|
-
value: query.value,
|
|
128
|
+
targetDocumentFieldPath: query.data.path,
|
|
129
|
+
value: query.data.value,
|
|
123
130
|
});
|
|
124
131
|
/* ==== ここまでFirestoreの更新 ==== */
|
|
125
132
|
return res;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consumable_verify_android.js","sourceRoot":"","sources":["../../src/functions/consumable_verify_android.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,
|
|
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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d;IAAC,OAAO,GAAG,EAAE;QACV,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACnB,MAAM,GAAG,CAAC;KACb;AACL,CAAC,CAAA,CACJ,CAAC"}
|
|
@@ -32,7 +32,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
32
32
|
});
|
|
33
33
|
};
|
|
34
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
const functions = __importStar(require("firebase-functions"));
|
|
35
|
+
const functions = __importStar(require("firebase-functions/v2"));
|
|
36
36
|
const verifier = __importStar(require("../lib/verify_ios"));
|
|
37
37
|
const updater = __importStar(require("../lib/update_wallet"));
|
|
38
38
|
/**
|
|
@@ -40,7 +40,7 @@ const updater = __importStar(require("../lib/update_wallet"));
|
|
|
40
40
|
*
|
|
41
41
|
* 消費型のアプリ内課金を行います。[path]に指定したドキュメント内のフィールドの値を[value]に加算します。
|
|
42
42
|
*
|
|
43
|
-
* @param
|
|
43
|
+
* @param process.env.PURCHASE_IOS_SHAREDSECRET
|
|
44
44
|
* SharedSecret for AppStore, obtained from [Apps]->[App Info]->[Shared Secret for App] in the AppStore.
|
|
45
45
|
*
|
|
46
46
|
* AppStoreのSharedSecret。AppStoreの[アプリ]->[App情報]->[App用共有シークレット]から取得します。
|
|
@@ -60,26 +60,33 @@ const updater = __importStar(require("../lib/update_wallet"));
|
|
|
60
60
|
*
|
|
61
61
|
* 購入の際のレシートデータ。
|
|
62
62
|
*/
|
|
63
|
-
module.exports = (regions,
|
|
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* () {
|
|
71
|
+
var _a;
|
|
64
72
|
try {
|
|
65
|
-
const config = functions.config().purchase;
|
|
66
73
|
/* ==== IOS検証ここから ==== */
|
|
67
74
|
const res = yield verifier.verifyIOS({
|
|
68
|
-
receiptData: query.receiptData,
|
|
69
|
-
password:
|
|
75
|
+
receiptData: query.data.receiptData,
|
|
76
|
+
password: (_a = process.env.PURCHASE_IOS_SHAREDSECRET) !== null && _a !== void 0 ? _a : "",
|
|
70
77
|
});
|
|
71
78
|
const status = res["status"];
|
|
72
79
|
if (status !== 0) {
|
|
73
80
|
throw new functions.https.HttpsError("unauthenticated", "Illegal receipt.");
|
|
74
81
|
}
|
|
75
82
|
/* ==== ここまでIOS検証 ==== */
|
|
76
|
-
if (!query.path || !query.value) {
|
|
83
|
+
if (!query.data.path || !query.data.value) {
|
|
77
84
|
return res;
|
|
78
85
|
}
|
|
79
86
|
/* ==== Firestoreの更新ここから ==== */
|
|
80
87
|
yield updater.updateWallet({
|
|
81
|
-
targetDocumentFieldPath: query.path,
|
|
82
|
-
value: query.value,
|
|
88
|
+
targetDocumentFieldPath: query.data.path,
|
|
89
|
+
value: query.data.value,
|
|
83
90
|
});
|
|
84
91
|
/* ==== ここまでFirestoreの更新 ==== */
|
|
85
92
|
return res;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consumable_verify_ios.js","sourceRoot":"","sources":["../../src/functions/consumable_verify_ios.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,
|
|
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,CAAC,SAAS,CAAC,KAAK,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|
};
|
|
34
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
const functions = __importStar(require("firebase-functions"));
|
|
35
|
+
const functions = __importStar(require("firebase-functions/v2"));
|
|
36
36
|
const api_1 = require("../lib/api");
|
|
37
37
|
/**
|
|
38
38
|
* Get latitude and longitude with GeocodingAPI.
|
|
39
39
|
*
|
|
40
40
|
* GeocodingAPIで緯度経度を取得します。
|
|
41
41
|
*
|
|
42
|
-
* @param {string}
|
|
42
|
+
* @param {string} process.env.MAP_GEOCODING_APIKEY
|
|
43
43
|
* API key for GoogleMapGeocodingAPI. Follow the steps below to issue it.
|
|
44
44
|
* https://mathru.notion.site/Google-Map-API-API-e9a65fba9795450fb9a252ab4e631ace?pvs=4
|
|
45
45
|
* GoogleMapGeocodingAPI用のAPIキー。下記の手順で発行します。
|
|
@@ -49,11 +49,18 @@ const api_1 = require("../lib/api");
|
|
|
49
49
|
* Address or postal code.
|
|
50
50
|
* アドレスもしくは郵便番号。
|
|
51
51
|
*/
|
|
52
|
-
module.exports = (regions,
|
|
52
|
+
module.exports = (regions, options, data) => functions.https.onCall({
|
|
53
|
+
region: regions,
|
|
54
|
+
timeoutSeconds: options.timeoutSeconds,
|
|
55
|
+
memory: options.memory,
|
|
56
|
+
minInstances: options.minInstances,
|
|
57
|
+
concurrency: options.concurrency,
|
|
58
|
+
maxInstances: options.maxInstances,
|
|
59
|
+
}, (query) => __awaiter(void 0, void 0, void 0, function* () {
|
|
60
|
+
var _a;
|
|
53
61
|
try {
|
|
54
|
-
const address = query.address;
|
|
55
|
-
const
|
|
56
|
-
const apiKey = config.api_key;
|
|
62
|
+
const address = query.data.address;
|
|
63
|
+
const apiKey = (_a = process.env.MAP_GEOCODING_APIKEY) !== null && _a !== void 0 ? _a : "";
|
|
57
64
|
if (!address) {
|
|
58
65
|
throw new functions.https.HttpsError("invalid-argument", "Query parameter is invalid.");
|
|
59
66
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geocoding.js","sourceRoot":"","sources":["../../src/functions/geocoding.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"geocoding.js","sourceRoot":"","sources":["../../src/functions/geocoding.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iEAAmD;AACnD,oCAAiC;AAGjC;;;;;;;;;;;;;;GAcG;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,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,OAAoC,CAAC;QAChE,MAAM,MAAM,GAAG,MAAA,OAAO,CAAC,GAAG,CAAC,oBAAoB,mCAAI,EAAE,CAAC;QACtD,IAAI,CAAC,OAAO,EAAE;YACV,MAAM,IAAI,SAAS,CAAC,KAAK,CAAC,UAAU,CAAC,kBAAkB,EAAE,6BAA6B,CAAC,CAAC;SAC3F;QACD,MAAM,GAAG,GAAG,MAAM,SAAG,CAAC,GAAG,CACrB,6DAA6D,kBAAkB,CAAC,OAAO,CAAC,QAAQ,MAAM,EAAE,CAC3G,CAAC;QACF,MAAM,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,CAA2B,CAAC;QAC1D,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAClB,uBACI,OAAO,EAAE,IAAI,IACV,IAAI,EACT;KACL;IAAC,OAAO,GAAG,EAAE;QACV,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACnB,MAAM,GAAG,CAAC;KACb;AACL,CAAC,CAAA,CACJ,CAAC"}
|
package/dist/functions/gmail.js
CHANGED
|
@@ -32,14 +32,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
32
32
|
});
|
|
33
33
|
};
|
|
34
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
const functions = __importStar(require("firebase-functions"));
|
|
35
|
+
const functions = __importStar(require("firebase-functions/v2"));
|
|
36
36
|
const gmail = __importStar(require("../lib/gmail"));
|
|
37
37
|
/**
|
|
38
38
|
* Send email via Gmail.
|
|
39
39
|
*
|
|
40
40
|
* Gmailでメールを送信します。
|
|
41
41
|
*
|
|
42
|
-
* @param {string}
|
|
42
|
+
* @param {string} process.env.MAIL_GMAIL_ID
|
|
43
43
|
* Gmail user ID. Follow the steps below to obtain a Gmail user ID.
|
|
44
44
|
* 1. Press your icon in the upper right corner of the Google top screen and open "Manage Google Account".
|
|
45
45
|
* 2. open "Security" on the left side of the screen and open "App Password
|
|
@@ -47,7 +47,7 @@ const gmail = __importStar(require("../lib/gmail"));
|
|
|
47
47
|
* 1. Googleのトップ画面の画面右上の自分のアイコンを押下し、「Google アカウントを管理」を開く
|
|
48
48
|
* 2. 画面左の「セキュリティ」を開き、「アプリ パスワード」を開く
|
|
49
49
|
*
|
|
50
|
-
* @param {string}
|
|
50
|
+
* @param {string} process.env.MAIL_GMAIL_PASSWORD
|
|
51
51
|
* Gmail user password. Enter the password obtained in the above procedure.
|
|
52
52
|
* Gmailのユーザーパスワード。上記の手順で取得したパスワードを入力します。
|
|
53
53
|
*
|
|
@@ -67,12 +67,19 @@ const gmail = __importStar(require("../lib/gmail"));
|
|
|
67
67
|
* Email content.
|
|
68
68
|
* メール本文。
|
|
69
69
|
*/
|
|
70
|
-
module.exports = (regions,
|
|
70
|
+
module.exports = (regions, options, data) => functions.https.onCall({
|
|
71
|
+
region: regions,
|
|
72
|
+
timeoutSeconds: options.timeoutSeconds,
|
|
73
|
+
memory: options.memory,
|
|
74
|
+
minInstances: options.minInstances,
|
|
75
|
+
concurrency: options.concurrency,
|
|
76
|
+
maxInstances: options.maxInstances,
|
|
77
|
+
}, (query) => __awaiter(void 0, void 0, void 0, function* () {
|
|
71
78
|
try {
|
|
72
|
-
const from = query.from;
|
|
73
|
-
const to = query.to;
|
|
74
|
-
const title = query.title;
|
|
75
|
-
const content = query.content;
|
|
79
|
+
const from = query.data.from;
|
|
80
|
+
const to = query.data.to;
|
|
81
|
+
const title = query.data.title;
|
|
82
|
+
const content = query.data.content;
|
|
76
83
|
if (!from || !to || !title || !content) {
|
|
77
84
|
throw new functions.https.HttpsError("invalid-argument", "Query parameter is invalid.");
|
|
78
85
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gmail.js","sourceRoot":"","sources":["../../src/functions/gmail.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"gmail.js","sourceRoot":"","sources":["../../src/functions/gmail.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iEAAmD;AACnD,oDAAsC;AAGtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;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,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