@mathrunet/masamune 2.1.0 → 2.2.0
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 +47 -44
- package/dist/functions/agora_cloud_recording.js.map +1 -1
- package/dist/functions/agora_token.js +37 -34
- package/dist/functions/agora_token.js.map +1 -1
- package/dist/functions/algolia.js +16 -16
- package/dist/functions/algolia.js.map +1 -1
- package/dist/functions/android_auth_code.js +22 -19
- package/dist/functions/android_auth_code.js.map +1 -1
- package/dist/functions/android_token.js +42 -39
- package/dist/functions/android_token.js.map +1 -1
- package/dist/functions/consumable_verify_android.js +41 -38
- package/dist/functions/consumable_verify_android.js.map +1 -1
- package/dist/functions/consumable_verify_ios.js +36 -33
- package/dist/functions/consumable_verify_ios.js.map +1 -1
- package/dist/functions/geocoding.js +26 -23
- package/dist/functions/geocoding.js.map +1 -1
- package/dist/functions/gmail.js +33 -30
- package/dist/functions/gmail.js.map +1 -1
- package/dist/functions/nonconsumable_verify_android.js +40 -37
- package/dist/functions/nonconsumable_verify_android.js.map +1 -1
- package/dist/functions/nonconsumable_verify_ios.js +35 -32
- package/dist/functions/nonconsumable_verify_ios.js.map +1 -1
- package/dist/functions/openai_chat_gpt.js +37 -34
- 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 +85 -82
- 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 +33 -30
- package/dist/functions/send_grid.js.map +1 -1
- package/dist/functions/send_notification.js +35 -32
- package/dist/functions/send_notification.js.map +1 -1
- package/dist/functions/stripe.js +856 -853
- package/dist/functions/stripe.js.map +1 -1
- package/dist/functions/stripe_webhook.js +358 -355
- package/dist/functions/stripe_webhook.js.map +1 -1
- package/dist/functions/stripe_webhook_connect.js +68 -65
- package/dist/functions/stripe_webhook_connect.js.map +1 -1
- package/dist/functions/stripe_webhook_secure.js +66 -63
- package/dist/functions/stripe_webhook_secure.js.map +1 -1
- package/dist/functions/subscription_verify_android.js +57 -54
- package/dist/functions/subscription_verify_android.js.map +1 -1
- package/dist/functions/subscription_verify_ios.js +57 -54
- package/dist/functions/subscription_verify_ios.js.map +1 -1
- package/dist/lib/call_process_function_base.d.ts +16 -1
- package/dist/lib/call_process_function_base.js +15 -8
- package/dist/lib/call_process_function_base.js.map +1 -1
- package/dist/lib/functions_base.d.ts +44 -0
- package/dist/lib/request_process_function_base.d.ts +16 -1
- package/dist/lib/request_process_function_base.js +15 -8
- package/dist/lib/request_process_function_base.js.map +1 -1
- package/dist/lib/schedule_process_function_base.js +8 -7
- package/dist/lib/schedule_process_function_base.js.map +1 -1
- package/package.json +3 -3
|
@@ -75,60 +75,63 @@ const subscriber = __importStar(require("../lib/update_subscription"));
|
|
|
75
75
|
*
|
|
76
76
|
* サブスクリプションを購入したユーザーのID。
|
|
77
77
|
*/
|
|
78
|
-
module.exports = (regions, options, data) =>
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
78
|
+
module.exports = (regions, options, data) => {
|
|
79
|
+
var _a;
|
|
80
|
+
return functions.https.onCall({
|
|
81
|
+
region: (_a = options.region) !== null && _a !== void 0 ? _a : regions,
|
|
82
|
+
timeoutSeconds: options.timeoutSeconds,
|
|
83
|
+
memory: options.memory,
|
|
84
|
+
minInstances: options.minInstances,
|
|
85
|
+
concurrency: options.concurrency,
|
|
86
|
+
maxInstances: options.maxInstances,
|
|
87
|
+
}, (query) => __awaiter(void 0, void 0, void 0, function* () {
|
|
88
|
+
var _b, _c;
|
|
89
|
+
try {
|
|
90
|
+
/* ==== IOS検証ここから ==== */
|
|
91
|
+
if (!query.data.userId) {
|
|
92
|
+
throw new functions.https.HttpsError("invalid-argument", "User is empty.");
|
|
93
|
+
}
|
|
94
|
+
const res = yield verifier.verifyIOS({
|
|
95
|
+
receiptData: query.data.receiptData,
|
|
96
|
+
password: (_b = process.env.PURCHASE_IOS_SHAREDSECRET) !== null && _b !== void 0 ? _b : "",
|
|
97
|
+
});
|
|
98
|
+
const status = res["status"];
|
|
99
|
+
if (status !== 0) {
|
|
100
|
+
throw new functions.https.HttpsError("not-found", "Illegal receipt.");
|
|
101
|
+
}
|
|
102
|
+
const time = new Date().getTime();
|
|
103
|
+
const info = res["latest_receipt_info"];
|
|
104
|
+
const startTimeMillis = parseInt(info[info.length - 1]["purchase_date_ms"]);
|
|
105
|
+
const expiryTimeMillis = parseInt(info[info.length - 1]["expires_date_ms"]);
|
|
106
|
+
if (res === null || isNaN(startTimeMillis) || isNaN(expiryTimeMillis) || startTimeMillis <= 0) {
|
|
107
|
+
throw new functions.https.HttpsError("not-found", "Illegal receipt.");
|
|
108
|
+
}
|
|
109
|
+
if (expiryTimeMillis <= time) {
|
|
110
|
+
info[info.length - 1]["expired"] = true;
|
|
111
|
+
}
|
|
112
|
+
/* ==== ここまでIOS検証 ==== */
|
|
113
|
+
/* ==== Firestoreの更新ここから ==== */
|
|
114
|
+
yield subscriber.updateSubscription({
|
|
115
|
+
targetCollectionPath: (_c = query.data.path) !== null && _c !== void 0 ? _c : process.env.PURCHASE_SUBSCRIPTIONPATH,
|
|
116
|
+
targetDocumentId: info[info.length - 1]["original_transaction_id"],
|
|
117
|
+
data: info[info.length - 1],
|
|
118
|
+
additionalData: query.data,
|
|
119
|
+
userId: query.data.userId,
|
|
120
|
+
platform: "IOS",
|
|
121
|
+
orderId: info[info.length - 1]["original_transaction_id"],
|
|
122
|
+
productId: query.data.productId,
|
|
123
|
+
purchaseId: query.data.purchaseId,
|
|
124
|
+
packageName: res["receipt"]["bundle_id"],
|
|
125
|
+
token: query.data.receiptData,
|
|
126
|
+
expiryDate: expiryTimeMillis,
|
|
127
|
+
});
|
|
128
|
+
/* ==== ここまでFirestoreの更新 ==== */
|
|
129
|
+
return res;
|
|
91
130
|
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
});
|
|
96
|
-
const status = res["status"];
|
|
97
|
-
if (status !== 0) {
|
|
98
|
-
throw new functions.https.HttpsError("not-found", "Illegal receipt.");
|
|
131
|
+
catch (err) {
|
|
132
|
+
console.error(err);
|
|
133
|
+
throw new functions.https.HttpsError("unknown", "Unknown error.");
|
|
99
134
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
const startTimeMillis = parseInt(info[info.length - 1]["purchase_date_ms"]);
|
|
103
|
-
const expiryTimeMillis = parseInt(info[info.length - 1]["expires_date_ms"]);
|
|
104
|
-
if (res === null || isNaN(startTimeMillis) || isNaN(expiryTimeMillis) || startTimeMillis <= 0) {
|
|
105
|
-
throw new functions.https.HttpsError("not-found", "Illegal receipt.");
|
|
106
|
-
}
|
|
107
|
-
if (expiryTimeMillis <= time) {
|
|
108
|
-
info[info.length - 1]["expired"] = true;
|
|
109
|
-
}
|
|
110
|
-
/* ==== ここまでIOS検証 ==== */
|
|
111
|
-
/* ==== Firestoreの更新ここから ==== */
|
|
112
|
-
yield subscriber.updateSubscription({
|
|
113
|
-
targetCollectionPath: (_b = query.data.path) !== null && _b !== void 0 ? _b : process.env.PURCHASE_SUBSCRIPTIONPATH,
|
|
114
|
-
targetDocumentId: info[info.length - 1]["original_transaction_id"],
|
|
115
|
-
data: info[info.length - 1],
|
|
116
|
-
additionalData: query.data,
|
|
117
|
-
userId: query.data.userId,
|
|
118
|
-
platform: "IOS",
|
|
119
|
-
orderId: info[info.length - 1]["original_transaction_id"],
|
|
120
|
-
productId: query.data.productId,
|
|
121
|
-
purchaseId: query.data.purchaseId,
|
|
122
|
-
packageName: res["receipt"]["bundle_id"],
|
|
123
|
-
token: query.data.receiptData,
|
|
124
|
-
expiryDate: expiryTimeMillis,
|
|
125
|
-
});
|
|
126
|
-
/* ==== ここまでFirestoreの更新 ==== */
|
|
127
|
-
return res;
|
|
128
|
-
}
|
|
129
|
-
catch (err) {
|
|
130
|
-
console.error(err);
|
|
131
|
-
throw new functions.https.HttpsError("unknown", "Unknown error.");
|
|
132
|
-
}
|
|
133
|
-
}));
|
|
135
|
+
}));
|
|
136
|
+
};
|
|
134
137
|
//# sourceMappingURL=subscription_verify_ios.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscription_verify_ios.js","sourceRoot":"","sources":["../../src/functions/subscription_verify_ios.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iEAAmD;AACnD,4DAA8C;AAC9C,uEAAyD;AAGzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,MAAM,CAAC,OAAO,GAAG,CACb,OAAiB,EACjB,
|
|
1
|
+
{"version":3,"file":"subscription_verify_ios.js","sourceRoot":"","sources":["../../src/functions/subscription_verify_ios.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as functions from "firebase-functions/v2";
|
|
2
|
-
import { FunctionsBase } from "./functions_base";
|
|
2
|
+
import { FunctionsBase, HttpFunctionsOptions } from "./functions_base";
|
|
3
3
|
export { CallableRequest } from "firebase-functions/v2/https";
|
|
4
4
|
/**
|
|
5
5
|
* Base class for defining the data of Functions for executing the Call method of Functions.
|
|
@@ -7,6 +7,21 @@ export { CallableRequest } from "firebase-functions/v2/https";
|
|
|
7
7
|
* FunctionsのCallメソッド実行用のFunctionのデータを定義するためのベースクラス。
|
|
8
8
|
*/
|
|
9
9
|
export declare abstract class CallProcessFunctionBase extends FunctionsBase {
|
|
10
|
+
/**
|
|
11
|
+
* Base class for defining the data of Functions for executing the Call method of Functions.
|
|
12
|
+
*
|
|
13
|
+
* FunctionsのCallメソッド実行用のFunctionのデータを定義するためのベースクラス。
|
|
14
|
+
*/
|
|
15
|
+
constructor({ id, func, data, options, }: {
|
|
16
|
+
id: string;
|
|
17
|
+
func: (region: string[], options: HttpFunctionsOptions, data: {
|
|
18
|
+
[key: string]: string;
|
|
19
|
+
}) => Function;
|
|
20
|
+
data?: {
|
|
21
|
+
[key: string]: string;
|
|
22
|
+
};
|
|
23
|
+
options?: HttpFunctionsOptions | undefined | null;
|
|
24
|
+
});
|
|
10
25
|
/**
|
|
11
26
|
* Specify the actual contents of the process.
|
|
12
27
|
*
|
|
@@ -41,18 +41,25 @@ const functions_base_1 = require("./functions_base");
|
|
|
41
41
|
* FunctionsのCallメソッド実行用のFunctionのデータを定義するためのベースクラス。
|
|
42
42
|
*/
|
|
43
43
|
class CallProcessFunctionBase extends functions_base_1.FunctionsBase {
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
/**
|
|
45
|
+
* Base class for defining the data of Functions for executing the Call method of Functions.
|
|
46
|
+
*
|
|
47
|
+
* FunctionsのCallメソッド実行用のFunctionのデータを定義するためのベースクラス。
|
|
48
|
+
*/
|
|
49
|
+
constructor({ id, func, data = {}, options, }) {
|
|
50
|
+
super({ id: id, func: func, data: data, options: options });
|
|
46
51
|
this.data = {};
|
|
47
52
|
}
|
|
48
53
|
build(regions) {
|
|
54
|
+
var _a;
|
|
55
|
+
const options = this.options;
|
|
49
56
|
return functions.https.onCall({
|
|
50
|
-
region: regions,
|
|
51
|
-
timeoutSeconds:
|
|
52
|
-
memory:
|
|
53
|
-
minInstances:
|
|
54
|
-
concurrency:
|
|
55
|
-
maxInstances:
|
|
57
|
+
region: (_a = options === null || options === void 0 ? void 0 : options.region) !== null && _a !== void 0 ? _a : regions,
|
|
58
|
+
timeoutSeconds: options === null || options === void 0 ? void 0 : options.timeoutSeconds,
|
|
59
|
+
memory: options === null || options === void 0 ? void 0 : options.memory,
|
|
60
|
+
minInstances: options === null || options === void 0 ? void 0 : options.minInstances,
|
|
61
|
+
concurrency: options === null || options === void 0 ? void 0 : options.concurrency,
|
|
62
|
+
maxInstances: options === null || options === void 0 ? void 0 : options.maxInstances,
|
|
56
63
|
}, (query) => __awaiter(this, void 0, void 0, function* () {
|
|
57
64
|
return this.process(query);
|
|
58
65
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"call_process_function_base.js","sourceRoot":"","sources":["../../src/lib/call_process_function_base.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iEAAmD;AACnD,
|
|
1
|
+
{"version":3,"file":"call_process_function_base.js","sourceRoot":"","sources":["../../src/lib/call_process_function_base.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iEAAmD;AACnD,qDAAuE;AAGvE;;;;GAIG;AACH,MAAsB,uBAAwB,SAAQ,8BAAa;IAC/D;;;;OAIG;IACH,YAAY,EACR,EAAE,EACF,IAAI,EACJ,IAAI,GAAG,EAAE,EACT,OAAO,GAUV;QACG,KAAK,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;QAoBhE,SAAI,GAA8B,EAAE,CAAC;IAnBrC,CAAC;IAoBD,KAAK,CAAC,OAAiB;;QACnB,MAAM,OAAO,GAAG,IAAI,CAAC,OAAkD,CAAC;QACxE,OAAO,SAAS,CAAC,KAAK,CAAC,MAAM,CACzB;YACI,MAAM,EAAE,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,mCAAI,OAAO;YAClC,cAAc,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,cAAc;YACvC,MAAM,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM;YACvB,YAAY,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,YAAY;YACnC,WAAW,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW;YACjC,YAAY,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,YAAY;SACtC,EACD,CAAO,KAAK,EAAE,EAAE;YACZ,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAC/B,CAAC,CAAA,CACJ,CAAC;IACN,CAAC;CACJ;AA1DD,0DA0DC"}
|
|
@@ -83,6 +83,12 @@ export interface SchedulerFunctionsOptions extends FunctionsOptions {
|
|
|
83
83
|
* * AppEngine形式の場合は、`every 1 minutes`のように指定します。
|
|
84
84
|
*/
|
|
85
85
|
schedule?: string | undefined | null;
|
|
86
|
+
/**
|
|
87
|
+
* Specifies an alternate region.
|
|
88
|
+
*
|
|
89
|
+
* 代替のリージョンを指定します。
|
|
90
|
+
*/
|
|
91
|
+
region?: string | null;
|
|
86
92
|
}
|
|
87
93
|
/**
|
|
88
94
|
* Specifies the options for the process.
|
|
@@ -96,6 +102,12 @@ export interface PathFunctionsOptions extends FunctionsOptions {
|
|
|
96
102
|
* 対象のデータベースのパスを指定します。
|
|
97
103
|
*/
|
|
98
104
|
path?: string | undefined | null;
|
|
105
|
+
/**
|
|
106
|
+
* Specifies an alternate region.
|
|
107
|
+
*
|
|
108
|
+
* 代替のリージョンを指定します。
|
|
109
|
+
*/
|
|
110
|
+
region?: string | null;
|
|
99
111
|
}
|
|
100
112
|
/**
|
|
101
113
|
* Specifies the options for the process.
|
|
@@ -111,6 +123,38 @@ export interface PubsubFunctionsOptions extends FunctionsOptions {
|
|
|
111
123
|
* GCPのpub/subに`purchasing`のトピックを作成しプリンシパルに「google-play-developer-notifications@system.gserviceaccount.com」を設定することで通知を受け取ることができるようになります。
|
|
112
124
|
*/
|
|
113
125
|
topic?: string | undefined | null;
|
|
126
|
+
/**
|
|
127
|
+
* Specifies an alternate region.
|
|
128
|
+
*
|
|
129
|
+
* 代替のリージョンを指定します。
|
|
130
|
+
*/
|
|
131
|
+
region?: string | null;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Specifies the options for the process.
|
|
135
|
+
*
|
|
136
|
+
* 処理のオプションを指定します。
|
|
137
|
+
*/
|
|
138
|
+
export interface HttpFunctionsOptions extends FunctionsOptions {
|
|
139
|
+
/**
|
|
140
|
+
* Specifies an alternate region.
|
|
141
|
+
*
|
|
142
|
+
* 代替のリージョンを指定します。
|
|
143
|
+
*/
|
|
144
|
+
region?: string | string[] | null;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Specifies the options for the process.
|
|
148
|
+
*
|
|
149
|
+
* 処理のオプションを指定します。
|
|
150
|
+
*/
|
|
151
|
+
export interface StorageFunctionsOptions extends FunctionsOptions {
|
|
152
|
+
/**
|
|
153
|
+
* Specifies an alternate region.
|
|
154
|
+
*
|
|
155
|
+
* 代替のリージョンを指定します。
|
|
156
|
+
*/
|
|
157
|
+
region?: string | null;
|
|
114
158
|
}
|
|
115
159
|
/**
|
|
116
160
|
* Specifies the options for the process.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as functions from "firebase-functions/v2";
|
|
2
|
-
import { FunctionsBase } from "./functions_base";
|
|
2
|
+
import { FunctionsBase, HttpFunctionsOptions } from "./functions_base";
|
|
3
3
|
import * as express from "express";
|
|
4
4
|
export { Request } from "firebase-functions/v2/https";
|
|
5
5
|
export { Response } from "express";
|
|
@@ -9,6 +9,21 @@ export { Response } from "express";
|
|
|
9
9
|
* HTTPリクエスト実行用のFunctionのデータを定義するためのベースクラス。
|
|
10
10
|
*/
|
|
11
11
|
export declare abstract class RequestProcessFunctionBase extends FunctionsBase {
|
|
12
|
+
/**
|
|
13
|
+
* Base class for defining Function data for HTTP request execution.
|
|
14
|
+
*
|
|
15
|
+
* HTTPリクエスト実行用のFunctionのデータを定義するためのベースクラス。
|
|
16
|
+
*/
|
|
17
|
+
constructor({ id, func, data, options, }: {
|
|
18
|
+
id: string;
|
|
19
|
+
func: (region: string[], options: HttpFunctionsOptions, data: {
|
|
20
|
+
[key: string]: string;
|
|
21
|
+
}) => Function;
|
|
22
|
+
data?: {
|
|
23
|
+
[key: string]: string;
|
|
24
|
+
};
|
|
25
|
+
options?: HttpFunctionsOptions | undefined | null;
|
|
26
|
+
});
|
|
12
27
|
/**
|
|
13
28
|
* Specify the actual contents of the process.
|
|
14
29
|
*
|
|
@@ -41,18 +41,25 @@ const functions_base_1 = require("./functions_base");
|
|
|
41
41
|
* HTTPリクエスト実行用のFunctionのデータを定義するためのベースクラス。
|
|
42
42
|
*/
|
|
43
43
|
class RequestProcessFunctionBase extends functions_base_1.FunctionsBase {
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
/**
|
|
45
|
+
* Base class for defining Function data for HTTP request execution.
|
|
46
|
+
*
|
|
47
|
+
* HTTPリクエスト実行用のFunctionのデータを定義するためのベースクラス。
|
|
48
|
+
*/
|
|
49
|
+
constructor({ id, func, data = {}, options, }) {
|
|
50
|
+
super({ id: id, func: func, data: data, options: options });
|
|
46
51
|
this.data = {};
|
|
47
52
|
}
|
|
48
53
|
build(regions) {
|
|
54
|
+
var _a;
|
|
55
|
+
const options = this.options;
|
|
49
56
|
return functions.https.onRequest({
|
|
50
|
-
region: regions,
|
|
51
|
-
timeoutSeconds:
|
|
52
|
-
memory:
|
|
53
|
-
minInstances:
|
|
54
|
-
concurrency:
|
|
55
|
-
maxInstances:
|
|
57
|
+
region: (_a = options === null || options === void 0 ? void 0 : options.region) !== null && _a !== void 0 ? _a : regions,
|
|
58
|
+
timeoutSeconds: options === null || options === void 0 ? void 0 : options.timeoutSeconds,
|
|
59
|
+
memory: options === null || options === void 0 ? void 0 : options.memory,
|
|
60
|
+
minInstances: options === null || options === void 0 ? void 0 : options.minInstances,
|
|
61
|
+
concurrency: options === null || options === void 0 ? void 0 : options.concurrency,
|
|
62
|
+
maxInstances: options === null || options === void 0 ? void 0 : options.maxInstances,
|
|
56
63
|
}, (req, res) => __awaiter(this, void 0, void 0, function* () {
|
|
57
64
|
return this.process(req, res);
|
|
58
65
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request_process_function_base.js","sourceRoot":"","sources":["../../src/lib/request_process_function_base.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iEAAmD;AACnD,
|
|
1
|
+
{"version":3,"file":"request_process_function_base.js","sourceRoot":"","sources":["../../src/lib/request_process_function_base.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iEAAmD;AACnD,qDAAuE;AAKvE;;;;GAIG;AACH,MAAsB,0BAA2B,SAAQ,8BAAa;IAClE;;;;OAIG;IACH,YAAY,EACR,EAAE,EACF,IAAI,EACJ,IAAI,GAAG,EAAE,EACT,OAAO,GAUV;QACG,KAAK,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;QAoBhE,SAAI,GAA8B,EAAE,CAAC;IAnBrC,CAAC;IAoBD,KAAK,CAAC,OAAiB;;QACnB,MAAM,OAAO,GAAG,IAAI,CAAC,OAAkD,CAAC;QACxE,OAAO,SAAS,CAAC,KAAK,CAAC,SAAS,CAC5B;YACI,MAAM,EAAE,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,mCAAI,OAAO;YAClC,cAAc,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,cAAc;YACvC,MAAM,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM;YACvB,YAAY,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,YAAY;YACnC,WAAW,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW;YACjC,YAAY,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,YAAY;SACtC,EACD,CAAO,GAAG,EAAE,GAAG,EAAE,EAAE;YACf,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QAClC,CAAC,CAAA,CACJ,CAAC;IACN,CAAC;CACJ;AA1DD,gEA0DC"}
|
|
@@ -52,14 +52,15 @@ class ScheduleProcessFunctionBase extends functions_base_1.FunctionsBase {
|
|
|
52
52
|
}
|
|
53
53
|
build(regions) {
|
|
54
54
|
var _a, _b;
|
|
55
|
+
const options = this.options;
|
|
55
56
|
return functions.scheduler.onSchedule({
|
|
56
|
-
schedule: (
|
|
57
|
-
region: regions[0],
|
|
58
|
-
timeoutSeconds:
|
|
59
|
-
memory:
|
|
60
|
-
minInstances:
|
|
61
|
-
concurrency:
|
|
62
|
-
maxInstances:
|
|
57
|
+
schedule: (_a = options === null || options === void 0 ? void 0 : options.schedule) !== null && _a !== void 0 ? _a : this.schedule,
|
|
58
|
+
region: (_b = options === null || options === void 0 ? void 0 : options.region) !== null && _b !== void 0 ? _b : regions[0],
|
|
59
|
+
timeoutSeconds: options === null || options === void 0 ? void 0 : options.timeoutSeconds,
|
|
60
|
+
memory: options === null || options === void 0 ? void 0 : options.memory,
|
|
61
|
+
minInstances: options === null || options === void 0 ? void 0 : options.minInstances,
|
|
62
|
+
concurrency: options === null || options === void 0 ? void 0 : options.concurrency,
|
|
63
|
+
maxInstances: options === null || options === void 0 ? void 0 : options.maxInstances,
|
|
63
64
|
}, (event) => __awaiter(this, void 0, void 0, function* () {
|
|
64
65
|
return this.process();
|
|
65
66
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schedule_process_function_base.js","sourceRoot":"","sources":["../../src/lib/schedule_process_function_base.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iEAAmD;AACnD,qDAA4E;AAE5E;;;;GAIG;AACH,MAAsB,2BAA4B,SAAQ,8BAAa;IACnE;;;;OAIG;IACH,YAAY,EACR,EAAE,EACF,IAAI,EACJ,IAAI,GAAG,EAAE,EACT,OAAO,GAUV;QACG,KAAK,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;QAmBhE,SAAI,GAA8B,EAAE,CAAC;IAlBrC,CAAC;IAmBD,KAAK,CAAC,OAAiB;;QACnB,OAAO,SAAS,CAAC,SAAS,CAAC,UAAU,CACjC;YACI,QAAQ,EAAE,MAAA,
|
|
1
|
+
{"version":3,"file":"schedule_process_function_base.js","sourceRoot":"","sources":["../../src/lib/schedule_process_function_base.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iEAAmD;AACnD,qDAA4E;AAE5E;;;;GAIG;AACH,MAAsB,2BAA4B,SAAQ,8BAAa;IACnE;;;;OAIG;IACH,YAAY,EACR,EAAE,EACF,IAAI,EACJ,IAAI,GAAG,EAAE,EACT,OAAO,GAUV;QACG,KAAK,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;QAmBhE,SAAI,GAA8B,EAAE,CAAC;IAlBrC,CAAC;IAmBD,KAAK,CAAC,OAAiB;;QACnB,MAAM,OAAO,GAAG,IAAI,CAAC,OAAuD,CAAC;QAC7E,OAAO,SAAS,CAAC,SAAS,CAAC,UAAU,CACjC;YACI,QAAQ,EAAE,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,mCAAI,IAAI,CAAC,QAAQ;YAC5C,MAAM,EAAE,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,mCAAI,OAAO,CAAC,CAAC,CAAC;YACrC,cAAc,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,cAAc;YACvC,MAAM,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM;YACvB,YAAY,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,YAAY;YACnC,WAAW,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW;YACjC,YAAY,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,YAAY;SACtC,EACD,CAAO,KAAK,EAAE,EAAE;YACZ,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC;QAC1B,CAAC,CAAA,CACJ,CAAC;IACN,CAAC;CACJ;AA1DD,kEA0DC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mathrunet/masamune",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "Manages packages for the server portion (NodeJS) of the Masamune framework.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"agora-token": "^2.0.2",
|
|
39
39
|
"algoliasearch": "^4.22.1",
|
|
40
40
|
"crypto": "^1.0.1",
|
|
41
|
-
"firebase-admin": "^11.
|
|
42
|
-
"firebase-functions": "^4.
|
|
41
|
+
"firebase-admin": "^11.11.1",
|
|
42
|
+
"firebase-functions": "^4.6.0",
|
|
43
43
|
"form-data": "^4.0.0",
|
|
44
44
|
"node-fetch": "^2.6.9",
|
|
45
45
|
"nodemailer": "^6.9.2",
|