@mathrunet/masamune 0.0.8 → 0.1.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 +13 -0
- package/dist/functions/send_notification.js +1 -1
- package/dist/functions/send_notification.js.map +1 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/dist/lib/functions_data.d.ts +2 -2
- package/dist/lib/functions_data.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
# [0.1.0](https://github.com/mathrunet/node_masamune/compare/v0.0.8...v0.1.0) (2023-02-08)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### chore
|
|
5
|
+
|
|
6
|
+
* Edit .gitignore. ([de837ef](https://github.com/mathrunet/node_masamune/commit/de837ef8e831c6fba55e8fa94c0e33fa6cf8b7ff))
|
|
7
|
+
|
|
8
|
+
### feat
|
|
9
|
+
|
|
10
|
+
* Allow region to be specified externally. ([782d805](https://github.com/mathrunet/node_masamune/commit/782d805ac88c3991eabb3017f78cca083dd42f33))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
1
14
|
## [0.0.8](https://github.com/mathrunet/node_masamune/compare/v0.0.7...v0.0.8) (2023-01-17)
|
|
2
15
|
|
|
3
16
|
|
|
@@ -69,7 +69,7 @@ const admin = __importStar(require("firebase-admin"));
|
|
|
69
69
|
*
|
|
70
70
|
* FCMのトピックを指定します。
|
|
71
71
|
*/
|
|
72
|
-
module.exports = functions.region(
|
|
72
|
+
module.exports = (region) => functions.region(region).https.onCall((query) => __awaiter(void 0, void 0, void 0, function* () {
|
|
73
73
|
try {
|
|
74
74
|
const title = query.title;
|
|
75
75
|
const body = query.body;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"send_notification.js","sourceRoot":"","sources":["../../src/functions/send_notification.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8DAAgD;AAChD,sDAAwC;AAExC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAM,CAAC,OAAO,GAAG,SAAS,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"send_notification.js","sourceRoot":"","sources":["../../src/functions/send_notification.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8DAAgD;AAChD,sDAAwC;AAExC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAM,CAAC,OAAO,GAAG,CAAC,MAAc,EAAE,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,MAAM,CACtE,CAAO,KAAK,EAAE,EAAE;IACZ,IAAI;QACA,MAAM,KAAK,GAAG,KAAK,CAAC,KAAe,CAAC;QACpC,MAAM,IAAI,GAAG,KAAK,CAAC,IAAc,CAAC;QAClC,MAAM,SAAS,GAAG,KAAK,CAAC,UAAgC,CAAC;QACzD,MAAM,IAAI,GAAG,KAAK,CAAC,IAA6C,CAAC;QACjE,MAAM,KAAK,GAAG,KAAK,CAAC,KAA2B,CAAC;QAChD,MAAM,KAAK,GAAG,KAAK,CAAC,KAA2B,CAAC;QAChD,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,SAAS,EAAE;YAC5C,MAAM,IAAI,SAAS,CAAC,KAAK,CAAC,UAAU,CAAC,kBAAkB,EAAE,8CAA8C,CAAC,CAAC;SAC5G;QACD,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,SAAS,EAAE,CAAC,IAAI,CACpC;YACI,YAAY,EAAE;gBACV,KAAK,EAAE,KAAK;gBACZ,IAAI,EAAE,IAAI;aACb;YACD,OAAO,EAAE;gBACL,QAAQ,EAAE,MAAM;gBAChB,YAAY,EAAE;oBACV,KAAK,EAAE,KAAK;oBACZ,IAAI,EAAE,IAAI;oBACV,WAAW,EAAE,4BAA4B;oBACzC,SAAS,EAAE,SAAS;iBACvB;aACJ;YACD,IAAI,EAAE,IAAI;YACV,KAAK,EAAE,KAAK;YACZ,KAAK,EAAE,KAAK;SACf,CACJ,CAAC;QACF,OAAO;YACH,OAAO,EAAE,IAAI;YACb,UAAU,EAAE,GAAG;SAClB,CAAC;KACL;IAAC,OAAO,GAAG,EAAE;QACV,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACjB,MAAM,GAAG,CAAC;KACb;AACL,CAAC,CAAA,CACJ,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -11,9 +11,14 @@ export * from "./lib/functions_data";
|
|
|
11
11
|
*
|
|
12
12
|
* `exports`をそのまま渡します。
|
|
13
13
|
*
|
|
14
|
+
* @param region
|
|
15
|
+
* Specify a region such as `asia-northeast1`.
|
|
16
|
+
*
|
|
17
|
+
* `asia-northeast1`などのリージョンを指定します。
|
|
18
|
+
*
|
|
14
19
|
* @param deployFunctions
|
|
15
20
|
* The elements defined in [Functions] are passed as an array. The passed method is deployed.
|
|
16
21
|
*
|
|
17
22
|
* [Functions]で定義された要素を配列として渡します。渡されたメソッドがデプロイされます。
|
|
18
23
|
*/
|
|
19
|
-
export declare function deploy(exports: any, deployFunctions: data.FunctionsData[]): void;
|
|
24
|
+
export declare function deploy(exports: any, region: string, deployFunctions: data.FunctionsData[]): void;
|
package/dist/index.js
CHANGED
|
@@ -40,16 +40,21 @@ __exportStar(require("./lib/functions_data"), exports);
|
|
|
40
40
|
*
|
|
41
41
|
* `exports`をそのまま渡します。
|
|
42
42
|
*
|
|
43
|
+
* @param region
|
|
44
|
+
* Specify a region such as `asia-northeast1`.
|
|
45
|
+
*
|
|
46
|
+
* `asia-northeast1`などのリージョンを指定します。
|
|
47
|
+
*
|
|
43
48
|
* @param deployFunctions
|
|
44
49
|
* The elements defined in [Functions] are passed as an array. The passed method is deployed.
|
|
45
50
|
*
|
|
46
51
|
* [Functions]で定義された要素を配列として渡します。渡されたメソッドがデプロイされます。
|
|
47
52
|
*/
|
|
48
|
-
function deploy(exports, deployFunctions) {
|
|
53
|
+
function deploy(exports, region, deployFunctions) {
|
|
49
54
|
admin.initializeApp();
|
|
50
55
|
for (const data of deployFunctions) {
|
|
51
56
|
if (!process.env.FUNCTION_NAME || process.env.FUNCTION_NAME === data.id) {
|
|
52
|
-
exports[data.id] = data.func;
|
|
57
|
+
exports[data.id] = data.func(region);
|
|
53
58
|
}
|
|
54
59
|
}
|
|
55
60
|
}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,sDAAwC;AACxC,8CAA4B;AAC5B,uDAAqC;AAErC
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,sDAAwC;AACxC,8CAA4B;AAC5B,uDAAqC;AAErC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,SAAgB,MAAM,CAAC,OAAY,EAAE,MAAc,EAAE,eAAqC;IACtF,KAAK,CAAC,aAAa,EAAE,CAAC;IACtB,KAAK,MAAM,IAAI,IAAI,eAAe,EAAE;QAChC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,OAAO,CAAC,GAAG,CAAC,aAAa,KAAK,IAAI,CAAC,EAAE,EAAE;YACrE,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;SACxC;KACJ;AACL,CAAC;AAPD,wBAOC"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export declare class FunctionsData {
|
|
7
7
|
readonly id: string;
|
|
8
|
-
readonly func: Function;
|
|
8
|
+
readonly func: (region: string) => Function;
|
|
9
9
|
/**
|
|
10
10
|
* Define Function data for FirebaseFunctions.
|
|
11
11
|
*
|
|
@@ -21,5 +21,5 @@ export declare class FunctionsData {
|
|
|
21
21
|
*
|
|
22
22
|
* 実際の処理の中身を指定します。
|
|
23
23
|
*/
|
|
24
|
-
constructor(id: string, func: Function);
|
|
24
|
+
constructor(id: string, func: (region: string) => Function);
|
|
25
25
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"functions_data.js","sourceRoot":"","sources":["../../src/lib/functions_data.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,MAAa,aAAa;IACxB;;;;;;;;;;;;;;OAcG;IACH,YAAqB,EAAU,EAAW,
|
|
1
|
+
{"version":3,"file":"functions_data.js","sourceRoot":"","sources":["../../src/lib/functions_data.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,MAAa,aAAa;IACxB;;;;;;;;;;;;;;OAcG;IACH,YAAqB,EAAU,EAAW,IAAkC;QAAvD,OAAE,GAAF,EAAE,CAAQ;QAAW,SAAI,GAAJ,IAAI,CAA8B;IAAG,CAAC;CACjF;AAjBD,sCAiBC"}
|