@mathrunet/masamune 2.8.3 → 2.8.4

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 CHANGED
@@ -1,3 +1,13 @@
1
+ ## [2.8.4](https://github.com/mathrunet/node_masamune/compare/v2.8.3...v2.8.4) (2024-10-09)
2
+
3
+
4
+ ### fix
5
+
6
+ * DatabaseId can be specified in FirestoreTriggeredProcessFunctionBase. ([44c56e4](https://github.com/mathrunet/node_masamune/commit/44c56e42de16b328b2639e41af68e256fa36e73f))
7
+ * Fix typo. ([a7a55bb](https://github.com/mathrunet/node_masamune/commit/a7a55bb4b3d3df021d192a9fa811c7506aa4bd81))
8
+
9
+
10
+
1
11
  ## [2.8.3](https://github.com/mathrunet/node_masamune/compare/v2.8.2...v2.8.3) (2024-09-13)
2
12
 
3
13
 
@@ -1,5 +1,5 @@
1
1
  import * as functions from "firebase-functions/v2";
2
- import { FunctionsBase, PathFunctionsOptions } from "./functions_base";
2
+ import { DatabasePathFunctionsOptions, FunctionsBase } from "./functions_base";
3
3
  /**
4
4
  * Base class for defining Function data for Firestore triggers.
5
5
  *
@@ -11,7 +11,7 @@ export declare abstract class FirestoreTriggeredProcessFunctionBase extends Func
11
11
  *
12
12
  * Firestoreのトリガー用のFunctionのデータを定義するためのベースクラス。
13
13
  */
14
- constructor(options?: PathFunctionsOptions);
14
+ constructor(options?: DatabasePathFunctionsOptions);
15
15
  /**
16
16
  * Specifies the path to be processed.
17
17
  *
@@ -20,6 +20,12 @@ export declare abstract class FirestoreTriggeredProcessFunctionBase extends Func
20
20
  * https://firebase.google.com/docs/functions/firestore-events
21
21
  */
22
22
  abstract path: string;
23
+ /**
24
+ * Specifies the database.
25
+ *
26
+ * データベースを指定します。
27
+ */
28
+ database: string | undefined | null;
23
29
  /**
24
30
  * Specify the actual contents of the process.
25
31
  *
@@ -48,12 +48,21 @@ class FirestoreTriggeredProcessFunctionBase extends functions_base_1.FunctionsBa
48
48
  */
49
49
  constructor(options = {}) {
50
50
  super({ options: options });
51
+ /**
52
+ * Specifies the database.
53
+ *
54
+ * データベースを指定します。
55
+ */
56
+ this.database = undefined;
51
57
  this.data = {};
52
58
  }
53
59
  build(regions) {
54
- var _a;
60
+ var _a, _b, _c;
55
61
  const options = this.options;
56
- return functions.firestore.onDocumentWritten((_a = options === null || options === void 0 ? void 0 : options.path) !== null && _a !== void 0 ? _a : this.path, (event) => __awaiter(this, void 0, void 0, function* () {
62
+ return functions.firestore.onDocumentWritten({
63
+ document: (_a = options === null || options === void 0 ? void 0 : options.path) !== null && _a !== void 0 ? _a : this.path,
64
+ database: (_c = (_b = options === null || options === void 0 ? void 0 : options.database) !== null && _b !== void 0 ? _b : this.database) !== null && _c !== void 0 ? _c : undefined,
65
+ }, (event) => __awaiter(this, void 0, void 0, function* () {
57
66
  return this.process(event);
58
67
  }));
59
68
  }
@@ -1 +1 @@
1
- {"version":3,"file":"firestore_triggered_process_function_base.js","sourceRoot":"","sources":["../../../src/lib/src/firestore_triggered_process_function_base.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iEAAmD;AACnD,qDAAuE;AAGvE;;;;GAIG;AACH,MAAsB,qCAAsC,SAAQ,8BAAa;IAC7E;;;;OAIG;IACH,YAAY,UAAgC,EAAE;QAC1C,KAAK,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;QAoBhC,SAAI,GAA2B,EAAE,CAAC;IAnBlC,CAAC;IAoBD,KAAK,CAAC,OAAiB;;QACnB,MAAM,OAAO,GAAG,IAAI,CAAC,OAAkD,CAAC;QACxE,OAAO,SAAS,CAAC,SAAS,CAAC,iBAAiB,CACxC,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,mCAAI,IAAI,CAAC,IAAI,EAC1B,CAAO,KAAK,EAAE,EAAE;YACZ,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAC/B,CAAC,CAAA,CACJ,CAAC;IACN,CAAC;CACJ;AArCD,sFAqCC"}
1
+ {"version":3,"file":"firestore_triggered_process_function_base.js","sourceRoot":"","sources":["../../../src/lib/src/firestore_triggered_process_function_base.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iEAAmD;AACnD,qDAA+E;AAG/E;;;;GAIG;AACH,MAAsB,qCAAsC,SAAQ,8BAAa;IAC7E;;;;OAIG;IACH,YAAY,UAAwC,EAAE;QAClD,KAAK,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;QAYhC;;;;WAIG;QACH,aAAQ,GAA8B,SAAS,CAAC;QAUhD,SAAI,GAA2B,EAAE,CAAC;IA1BlC,CAAC;IA2BD,KAAK,CAAC,OAAiB;;QACnB,MAAM,OAAO,GAAG,IAAI,CAAC,OAA0D,CAAC;QAChF,OAAO,SAAS,CAAC,SAAS,CAAC,iBAAiB,CACxC;YACI,QAAQ,EAAE,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,mCAAI,IAAI,CAAC,IAAI;YACpC,QAAQ,EAAE,MAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,mCAAI,IAAI,CAAC,QAAQ,mCAAI,SAAS;SAC5D,EACD,CAAO,KAAK,EAAE,EAAE;YACZ,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAC/B,CAAC,CAAA,CACJ,CAAC;IACN,CAAC;CACJ;AA/CD,sFA+CC"}
@@ -109,6 +109,31 @@ export interface PathFunctionsOptions extends FunctionsOptions {
109
109
  */
110
110
  region?: string | null;
111
111
  }
112
+ /**
113
+ * Specifies the options for the process.
114
+ *
115
+ * 処理のオプションを指定します。
116
+ */
117
+ export interface DatabasePathFunctionsOptions extends FunctionsOptions {
118
+ /**
119
+ * Specify the path to the target database.
120
+ *
121
+ * 対象のデータベースのパスを指定します。
122
+ */
123
+ path?: string | undefined | null;
124
+ /**
125
+ * Specifies the database.
126
+ *
127
+ * データベースを指定します。
128
+ */
129
+ database?: string | undefined | null;
130
+ /**
131
+ * Specifies an alternate region.
132
+ *
133
+ * 代替のリージョンを指定します。
134
+ */
135
+ region?: string | null;
136
+ }
112
137
  /**
113
138
  * Specifies the options for the process.
114
139
  *
@@ -20,7 +20,7 @@ export declare abstract class RequestProcessFunctionBase extends FunctionsBase {
20
20
  *
21
21
  * 実際の処理の中身を指定します。
22
22
  *
23
- * @param reqest
23
+ * @param request
24
24
  * Request passed to Functions.
25
25
  *
26
26
  * Functionsに渡されたRequest。
@@ -30,7 +30,7 @@ export declare abstract class RequestProcessFunctionBase extends FunctionsBase {
30
30
  *
31
31
  * Functionsに渡されたResponse。
32
32
  */
33
- abstract process(reqest: functions.https.Request, response: express.Response<any>): Promise<void>;
33
+ abstract process(request: functions.https.Request, response: express.Response<any>): Promise<void>;
34
34
  abstract id: string;
35
35
  data: {
36
36
  [key: string]: any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mathrunet/masamune",
3
- "version": "2.8.3",
3
+ "version": "2.8.4",
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",