@mathrunet/masamune 2.6.2 → 2.6.3

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.
Files changed (137) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/lib/functions/firestore.js +14 -5
  3. package/dist/lib/functions/firestore.js.map +1 -1
  4. package/dist/lib/functions/send_notification.js +1 -1
  5. package/package.json +1 -1
  6. package/dist/converter/firestore_basic_converter.d.ts +0 -20
  7. package/dist/converter/firestore_basic_converter.js +0 -25
  8. package/dist/converter/firestore_basic_converter.js.map +0 -1
  9. package/dist/converter/firestore_enum_converter.d.ts +0 -20
  10. package/dist/converter/firestore_enum_converter.js +0 -25
  11. package/dist/converter/firestore_enum_converter.js.map +0 -1
  12. package/dist/converter/firestore_model_command_base_converter.d.ts +0 -20
  13. package/dist/converter/firestore_model_command_base_converter.js +0 -38
  14. package/dist/converter/firestore_model_command_base_converter.js.map +0 -1
  15. package/dist/converter/firestore_model_counter_converter.d.ts +0 -20
  16. package/dist/converter/firestore_model_counter_converter.js +0 -78
  17. package/dist/converter/firestore_model_counter_converter.js.map +0 -1
  18. package/dist/converter/firestore_model_date_converter.d.ts +0 -20
  19. package/dist/converter/firestore_model_date_converter.js +0 -95
  20. package/dist/converter/firestore_model_date_converter.js.map +0 -1
  21. package/dist/converter/firestore_model_geo_value_converter.d.ts +0 -20
  22. package/dist/converter/firestore_model_geo_value_converter.js +0 -77
  23. package/dist/converter/firestore_model_geo_value_converter.js.map +0 -1
  24. package/dist/converter/firestore_model_image_uri_converter.d.ts +0 -20
  25. package/dist/converter/firestore_model_image_uri_converter.js +0 -74
  26. package/dist/converter/firestore_model_image_uri_converter.js.map +0 -1
  27. package/dist/converter/firestore_model_locale_converter.d.ts +0 -20
  28. package/dist/converter/firestore_model_locale_converter.js +0 -74
  29. package/dist/converter/firestore_model_locale_converter.js.map +0 -1
  30. package/dist/converter/firestore_model_localized_value_converter.d.ts +0 -20
  31. package/dist/converter/firestore_model_localized_value_converter.js +0 -36
  32. package/dist/converter/firestore_model_localized_value_converter.js.map +0 -1
  33. package/dist/converter/firestore_model_ref_converter.d.ts +0 -20
  34. package/dist/converter/firestore_model_ref_converter.js +0 -60
  35. package/dist/converter/firestore_model_ref_converter.js.map +0 -1
  36. package/dist/converter/firestore_model_search_converter.d.ts +0 -20
  37. package/dist/converter/firestore_model_search_converter.js +0 -36
  38. package/dist/converter/firestore_model_search_converter.js.map +0 -1
  39. package/dist/converter/firestore_model_timestamp_converter.d.ts +0 -20
  40. package/dist/converter/firestore_model_timestamp_converter.js +0 -95
  41. package/dist/converter/firestore_model_timestamp_converter.js.map +0 -1
  42. package/dist/converter/firestore_model_token_converter.d.ts +0 -20
  43. package/dist/converter/firestore_model_token_converter.js +0 -36
  44. package/dist/converter/firestore_model_token_converter.js.map +0 -1
  45. package/dist/converter/firestore_model_uri_converter.d.ts +0 -20
  46. package/dist/converter/firestore_model_uri_converter.js +0 -74
  47. package/dist/converter/firestore_model_uri_converter.js.map +0 -1
  48. package/dist/converter/firestore_model_video_uri_converter.d.ts +0 -20
  49. package/dist/converter/firestore_model_video_uri_converter.js +0 -74
  50. package/dist/converter/firestore_model_video_uri_converter.js.map +0 -1
  51. package/dist/converter/firestore_null_converter.d.ts +0 -20
  52. package/dist/converter/firestore_null_converter.js +0 -25
  53. package/dist/converter/firestore_null_converter.js.map +0 -1
  54. package/dist/exntension/string.extension.d.ts +0 -179
  55. package/dist/exntension/string.extension.js +0 -190
  56. package/dist/exntension/string.extension.js.map +0 -1
  57. package/dist/functions/notification.d.ts +0 -1
  58. package/dist/functions/notification.js +0 -111
  59. package/dist/functions/notification.js.map +0 -1
  60. package/dist/functions/send_notification_schedule.d.ts +0 -1
  61. package/dist/functions/send_notification_schedule.js +0 -86
  62. package/dist/functions/send_notification_schedule.js.map +0 -1
  63. package/dist/functions/stripe_hook.d.ts +0 -1
  64. package/dist/functions/stripe_hook.js +0 -573
  65. package/dist/functions/stripe_hook.js.map +0 -1
  66. package/dist/functions/stripe_hook_connect.d.ts +0 -1
  67. package/dist/functions/stripe_hook_connect.js +0 -140
  68. package/dist/functions/stripe_hook_connect.js.map +0 -1
  69. package/dist/functions/stripe_hook_secure.d.ts +0 -1
  70. package/dist/functions/stripe_hook_secure.js +0 -150
  71. package/dist/functions/stripe_hook_secure.js.map +0 -1
  72. package/dist/lib/call_process_function_base.d.ts +0 -39
  73. package/dist/lib/call_process_function_base.js +0 -69
  74. package/dist/lib/call_process_function_base.js.map +0 -1
  75. package/dist/lib/default_firestore_model_field_value_converter.d.ts +0 -8
  76. package/dist/lib/default_firestore_model_field_value_converter.js +0 -44
  77. package/dist/lib/default_firestore_model_field_value_converter.js.map +0 -1
  78. package/dist/lib/firestore_model_field_value_converter.d.ts +0 -140
  79. package/dist/lib/firestore_model_field_value_converter.js +0 -127
  80. package/dist/lib/firestore_model_field_value_converter.js.map +0 -1
  81. package/dist/lib/functions_base.d.ts +0 -195
  82. package/dist/lib/functions_base.js +0 -37
  83. package/dist/lib/functions_base.js.map +0 -1
  84. package/dist/lib/functions_data.d.ts +0 -10
  85. package/dist/lib/functions_data.js +0 -19
  86. package/dist/lib/functions_data.js.map +0 -1
  87. package/dist/lib/gmail.d.ts +0 -39
  88. package/dist/lib/gmail.js +0 -65
  89. package/dist/lib/gmail.js.map +0 -1
  90. package/dist/lib/model_field_value.d.ts +0 -82
  91. package/dist/lib/model_field_value.js +0 -104
  92. package/dist/lib/model_field_value.js.map +0 -1
  93. package/dist/lib/request_process_function_base.d.ts +0 -39
  94. package/dist/lib/request_process_function_base.js +0 -69
  95. package/dist/lib/request_process_function_base.js.map +0 -1
  96. package/dist/lib/schedule_process_function_base.d.ts +0 -33
  97. package/dist/lib/schedule_process_function_base.js +0 -70
  98. package/dist/lib/schedule_process_function_base.js.map +0 -1
  99. package/dist/lib/send_gmail.d.ts +0 -34
  100. package/dist/lib/send_gmail.js +0 -90
  101. package/dist/lib/send_gmail.js.map +0 -1
  102. package/dist/lib/send_grid.d.ts +0 -33
  103. package/dist/lib/send_grid.js +0 -58
  104. package/dist/lib/send_grid.js.map +0 -1
  105. package/dist/lib/send_notification.d.ts +0 -59
  106. package/dist/lib/send_notification.js +0 -216
  107. package/dist/lib/send_notification.js.map +0 -1
  108. package/dist/lib/sql_api_base.d.ts +0 -185
  109. package/dist/lib/sql_api_base.js +0 -94
  110. package/dist/lib/sql_api_base.js.map +0 -1
  111. package/dist/lib/update_subscription.d.ts +0 -83
  112. package/dist/lib/update_subscription.js +0 -143
  113. package/dist/lib/update_subscription.js.map +0 -1
  114. package/dist/lib/update_unlock.d.ts +0 -13
  115. package/dist/lib/update_unlock.js +0 -64
  116. package/dist/lib/update_unlock.js.map +0 -1
  117. package/dist/lib/update_wallet.d.ts +0 -19
  118. package/dist/lib/update_wallet.js +0 -70
  119. package/dist/lib/update_wallet.js.map +0 -1
  120. package/dist/lib/verify_android.d.ts +0 -50
  121. package/dist/lib/verify_android.js +0 -121
  122. package/dist/lib/verify_android.js.map +0 -1
  123. package/dist/lib/verify_ios.d.ts +0 -26
  124. package/dist/lib/verify_ios.js +0 -110
  125. package/dist/lib/verify_ios.js.map +0 -1
  126. package/dist/src/functions/notification.d.ts +0 -1
  127. package/dist/src/functions/notification.js +0 -111
  128. package/dist/src/functions/notification.js.map +0 -1
  129. package/dist/src/functions.d.ts +0 -14
  130. package/dist/src/functions.js +0 -41
  131. package/dist/src/functions.js.map +0 -1
  132. package/dist/src/index.d.ts +0 -13
  133. package/dist/src/index.js +0 -51
  134. package/dist/src/index.js.map +0 -1
  135. package/dist/src/lib/functions_data.d.ts +0 -25
  136. package/dist/src/lib/functions_data.js +0 -31
  137. package/dist/src/lib/functions_data.js.map +0 -1
@@ -1,216 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
- return new (P || (P = Promise))(function (resolve, reject) {
28
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
- step((generator = generator.apply(thisArg, _arguments || [])).next());
32
- });
33
- };
34
- Object.defineProperty(exports, "__esModule", { value: true });
35
- exports.sendNotification = void 0;
36
- const functions = __importStar(require("firebase-functions/v2"));
37
- const admin = __importStar(require("firebase-admin"));
38
- /**
39
- * Define the process for PUSH notification.
40
- *
41
- * PUSH通知を行うための処理を定義します。
42
- *
43
- * @param title
44
- * The title of the notice should be listed.
45
- *
46
- * 通知タイトルを記載します。
47
- *
48
- * @param body
49
- * The contents of the notice will be described.
50
- *
51
- * 通知内容を記載します。
52
- *
53
- * @param channel_id
54
- * Describe ChannelId for Android.
55
- *
56
- * Android向けのChannelIdを記載します。
57
- *
58
- * @param data
59
- * Specify the data to be placed on the notification.
60
- *
61
- * 通知に乗せるデータを指定します。
62
- *
63
- * @param token
64
- * Specifies the FCM token.
65
- *
66
- * FCMトークンを指定します。
67
- *
68
- * @param topic
69
- * Specifies the topic of the FCM.
70
- *
71
- * FCMのトピックを指定します。
72
- *
73
- * @param badgeCount
74
- * Specifies the badge count of the notification.
75
- *
76
- * 通知のバッジカウントを指定します。
77
- *
78
- * @param sound
79
- * Specifies the sound of the notification.
80
- *
81
- * 通知のサウンドを指定します。
82
- */
83
- function sendNotification(_a) {
84
- return __awaiter(this, arguments, void 0, function* ({ title, body, data, channelId, token, topic, badgeCount, sound, }) {
85
- const res = {};
86
- try {
87
- if ((token === undefined || token === null) && (topic === undefined || topic === null)) {
88
- throw new functions.https.HttpsError("invalid-argument", "Either [token] or [topic] must be specified.");
89
- }
90
- if (token !== undefined && token !== null) {
91
- if (typeof token === "string") {
92
- token = [token];
93
- }
94
- for (let t of token) {
95
- try {
96
- const messageId = yield admin.messaging().send({
97
- notification: {
98
- title: title,
99
- body: body,
100
- },
101
- android: {
102
- priority: "high",
103
- notification: {
104
- title: title,
105
- body: body,
106
- clickAction: "FLUTTER_NOTIFICATION_CLICK",
107
- channelId: channelId !== null && channelId !== void 0 ? channelId : undefined,
108
- sound: sound !== null && sound !== void 0 ? sound : undefined,
109
- },
110
- },
111
- apns: {
112
- payload: {
113
- aps: {
114
- sound: sound !== null && sound !== void 0 ? sound : undefined,
115
- badge: badgeCount !== null && badgeCount !== void 0 ? badgeCount : undefined,
116
- },
117
- }
118
- },
119
- data: data,
120
- token: t,
121
- });
122
- res[t] = messageId;
123
- }
124
- catch (e) {
125
- console.log(e);
126
- console.log({
127
- notification: {
128
- title: title,
129
- body: body,
130
- },
131
- android: {
132
- priority: "high",
133
- notification: {
134
- title: title,
135
- body: body,
136
- clickAction: "FLUTTER_NOTIFICATION_CLICK",
137
- channelId: channelId !== null && channelId !== void 0 ? channelId : undefined,
138
- sound: sound !== null && sound !== void 0 ? sound : undefined,
139
- },
140
- },
141
- apns: {
142
- payload: {
143
- aps: {
144
- sound: sound !== null && sound !== void 0 ? sound : undefined,
145
- badge: badgeCount !== null && badgeCount !== void 0 ? badgeCount : undefined,
146
- },
147
- }
148
- },
149
- data: data,
150
- token: t,
151
- });
152
- }
153
- }
154
- return {
155
- success: true,
156
- results: res,
157
- };
158
- }
159
- else if (topic !== undefined && topic !== null) {
160
- try {
161
- const messageId = yield admin.messaging().send({
162
- notification: {
163
- title: title,
164
- body: body,
165
- },
166
- android: {
167
- priority: "high",
168
- notification: {
169
- title: title,
170
- body: body,
171
- clickAction: "FLUTTER_NOTIFICATION_CLICK",
172
- channelId: channelId !== null && channelId !== void 0 ? channelId : undefined,
173
- },
174
- },
175
- data: data,
176
- topic: topic,
177
- });
178
- res[topic] = messageId;
179
- }
180
- catch (e) {
181
- console.log(e);
182
- console.log({
183
- notification: {
184
- title: title,
185
- body: body,
186
- },
187
- android: {
188
- priority: "high",
189
- notification: {
190
- title: title,
191
- body: body,
192
- clickAction: "FLUTTER_NOTIFICATION_CLICK",
193
- channelId: channelId !== null && channelId !== void 0 ? channelId : undefined,
194
- },
195
- },
196
- data: data,
197
- topic: topic,
198
- });
199
- }
200
- return {
201
- success: true,
202
- results: res,
203
- };
204
- }
205
- }
206
- catch (err) {
207
- throw err;
208
- }
209
- return {
210
- success: true,
211
- results: res,
212
- };
213
- });
214
- }
215
- exports.sendNotification = sendNotification;
216
- //# sourceMappingURL=send_notification.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"send_notification.js","sourceRoot":"","sources":["../../src/lib/send_notification.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iEAAmD;AACnD,sDAAwC;AAExC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,SAAsB,gBAAgB;yDAAC,EACnC,KAAK,EACL,IAAI,EACJ,IAAI,EACJ,SAAS,EACT,KAAK,EACL,KAAK,EACL,UAAU,EACV,KAAK,GAUJ;QACD,MAAM,GAAG,GAA2B,EAA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C,SAAS,EAAE,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,SAAS;6BACpC;yBACJ;wBACD,IAAI,EAAE,IAAI;wBACV,KAAK,EAAE,KAAK;qBACf,CACJ,CAAC;oBACF,GAAG,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC;gBAC3B,CAAC;gBAAC,OAAO,CAAC,EAAE,CAAC;oBACT,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;oBACf,OAAO,CAAC,GAAG,CAAC;wBACR,YAAY,EAAE;4BACV,KAAK,EAAE,KAAK;4BACZ,IAAI,EAAE,IAAI;yBACb;wBACD,OAAO,EAAE;4BACL,QAAQ,EAAE,MAAM;4BAChB,YAAY,EAAE;gCACV,KAAK,EAAE,KAAK;gCACZ,IAAI,EAAE,IAAI;gCACV,WAAW,EAAE,4BAA4B;gCACzC,SAAS,EAAE,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,SAAS;6BACpC;yBACJ;wBACD,IAAI,EAAE,IAAI;wBACV,KAAK,EAAE,KAAK;qBACf,CAAC,CAAC;gBACP,CAAC;gBACD,OAAO;oBACH,OAAO,EAAE,IAAI;oBACb,OAAO,EAAE,GAAG;iBACf,CAAC;YACN,CAAC;QACL,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACX,MAAM,GAAG,CAAC;QACd,CAAC;QACD,OAAO;YACH,OAAO,EAAE,IAAI;YACb,OAAO,EAAE,GAAG;SACf,CAAC;IAEN,CAAC;CAAA;AApJD,4CAoJC"}
@@ -1,185 +0,0 @@
1
- /**
2
- * Base class for the API's model.
3
- *
4
- * Inherit this to create a model for the API.
5
- *
6
- * APIのモデルの基底クラス。
7
- *
8
- * これを継承してAPIのモデルを作成します。
9
- */
10
- export declare abstract class SqlApiModelBase {
11
- /**
12
- * Convert [SqlApiModelBase] to a format that can be handled by Json.
13
- *
14
- * [SqlApiModelBase]をJsonで扱える形式に変換します。
15
- *
16
- * @returns {{ [key: string]: any }}
17
- * Json format.
18
- *
19
- * Json形式。
20
- */
21
- abstract toJson(): {
22
- [key: string]: any;
23
- };
24
- }
25
- /**
26
- * Base class for the API.
27
- *
28
- * Inherit this to create an API.
29
- *
30
- * APIの基底クラス。
31
- *
32
- * これを継承してAPIを作成します。
33
- */
34
- export declare abstract class SqlApiBase<T extends SqlApiModelBase> {
35
- /**
36
- * Name of table to be used.
37
- *
38
- * 使用するテーブル名。
39
- */
40
- abstract table: string;
41
- /**
42
- * Get the data from the table.
43
- *
44
- * テーブルからデータを取得します。
45
- *
46
- * @param {{ [key: string]: any }[]} where
47
- * Specify the conditions for retrieving data from Sql.
48
- *
49
- * Sqlからデータを取得するための条件を指定します。
50
- *
51
- * @returns {Promise<T[]>}
52
- * Data from the table.
53
- *
54
- * テーブルからのデータ。
55
- */
56
- abstract get(where: {
57
- [key: string]: any;
58
- }[]): Promise<T[]>;
59
- /**
60
- * Get the number of records matching [where].
61
- *
62
- * [where]に一致するレコードの数を取得します。
63
- *
64
- * @param {{ [key: string]: any }[]} where
65
- * Specify the conditions for retrieving data from Sql.
66
- *
67
- * Sqlからデータを取得するための条件を指定します。
68
- *
69
- * @returns {Promise<number>}
70
- * Number of records matching [where].
71
- *
72
- * [where]に一致するレコードの数。
73
- */
74
- abstract count(where: {
75
- [key: string]: any;
76
- }[]): Promise<number>;
77
- /**
78
- * Add data to the table.
79
- *
80
- * テーブルにデータを追加します。
81
- *
82
- * @param {{ [key: string]: any }} value
83
- * Data to be added to the table.
84
- *
85
- * テーブルに追加するデータ。
86
- *
87
- * @param {{ [key: string]: any }[]} where
88
- * Specify the conditions for adding data from Sql.
89
- *
90
- * Sqlからデータを追加するための条件を指定します。
91
- *
92
- * @returns {Promise<T>}
93
- * Data added to the table.
94
- *
95
- * テーブルに追加されたデータ。
96
- */
97
- abstract post(value: {
98
- [key: string]: any;
99
- }, where: {
100
- [key: string]: any;
101
- }[]): Promise<T>;
102
- /**
103
- * Update the data in the table.
104
- *
105
- * テーブルのデータを更新します。
106
- *
107
- * @param {{ [key: string]: any }} value
108
- * Data to be updated in the table.
109
- *
110
- * テーブルの更新するデータ。
111
- *
112
- * @param {{ [key: string]: any }[]} where
113
- * Specify the conditions for updating data from Sql.
114
- *
115
- * Sqlからデータを更新するための条件を指定します。
116
- *
117
- * @returns {Promise<T>}
118
- * Updated data for the table.
119
- *
120
- * テーブルの更新されたデータ。
121
- */
122
- abstract put(value: {
123
- [key: string]: any;
124
- }, where: {
125
- [key: string]: any;
126
- }[]): Promise<T>;
127
- /**
128
- * Deletes data from the table.
129
- *
130
- * テーブルからデータを削除します。
131
- *
132
- * @param { [key: string]: any }[] where
133
- * Specify the conditions for deleting data from Sql.
134
- *
135
- * Sqlからデータを削除するための条件を指定します。
136
- *
137
- * @returns {Promise<void>}
138
- */
139
- abstract delete(where: {
140
- [key: string]: any;
141
- }[]): Promise<void>;
142
- /**
143
- *
144
- * @param {string} table
145
- * Table Name.
146
- *
147
- * テーブル名。
148
- *
149
- * @param {"GET" | "POST" | "DELETE" | "PUT" | "COUNT"} method
150
- * Specify the method to be used.
151
- *
152
- * 使用するメソッドを指定します。
153
- *
154
- * @param {{ [key: string]: any }[]} where
155
- * Specify the conditions for retrieving data from Sql.
156
- *
157
- * Sqlからデータを取得するための条件を指定します。
158
- *
159
- * @param {{ [key: string]: any } | undefined} value
160
- * Data to be added to the table.
161
- *
162
- * テーブルに追加するデータ。
163
- *
164
- * @returns {Promise<{ [key: string]: any }[] | number | null>}
165
- * When [null] is returned, the condition is not met.
166
- *
167
- * Otherwise, it returns the retrieved data.
168
- *
169
- * [null]が返却されたときは条件に一致しないとき。
170
- *
171
- * その他の場合は取得されたデータを返します。
172
- */
173
- process({ table, method, where, value, }: {
174
- table: string;
175
- method: "GET" | "POST" | "DELETE" | "PUT" | "COUNT";
176
- where?: {
177
- [key: string]: any;
178
- }[] | undefined;
179
- value?: {
180
- [key: string]: any;
181
- } | undefined;
182
- }): Promise<{
183
- [key: string]: any;
184
- }[] | number | null>;
185
- }
@@ -1,94 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.SqlApiBase = exports.SqlApiModelBase = void 0;
13
- /**
14
- * Base class for the API's model.
15
- *
16
- * Inherit this to create a model for the API.
17
- *
18
- * APIのモデルの基底クラス。
19
- *
20
- * これを継承してAPIのモデルを作成します。
21
- */
22
- class SqlApiModelBase {
23
- }
24
- exports.SqlApiModelBase = SqlApiModelBase;
25
- /**
26
- * Base class for the API.
27
- *
28
- * Inherit this to create an API.
29
- *
30
- * APIの基底クラス。
31
- *
32
- * これを継承してAPIを作成します。
33
- */
34
- class SqlApiBase {
35
- /**
36
- *
37
- * @param {string} table
38
- * Table Name.
39
- *
40
- * テーブル名。
41
- *
42
- * @param {"GET" | "POST" | "DELETE" | "PUT" | "COUNT"} method
43
- * Specify the method to be used.
44
- *
45
- * 使用するメソッドを指定します。
46
- *
47
- * @param {{ [key: string]: any }[]} where
48
- * Specify the conditions for retrieving data from Sql.
49
- *
50
- * Sqlからデータを取得するための条件を指定します。
51
- *
52
- * @param {{ [key: string]: any } | undefined} value
53
- * Data to be added to the table.
54
- *
55
- * テーブルに追加するデータ。
56
- *
57
- * @returns {Promise<{ [key: string]: any }[] | number | null>}
58
- * When [null] is returned, the condition is not met.
59
- *
60
- * Otherwise, it returns the retrieved data.
61
- *
62
- * [null]が返却されたときは条件に一致しないとき。
63
- *
64
- * その他の場合は取得されたデータを返します。
65
- */
66
- process(_a) {
67
- return __awaiter(this, arguments, void 0, function* ({ table, method, where, value, }) {
68
- if (table !== this.table) {
69
- return null;
70
- }
71
- switch (method) {
72
- case "GET": {
73
- return (yield this.get(where !== null && where !== void 0 ? where : [])).map((e) => { return e.toJson(); });
74
- }
75
- case "COUNT": {
76
- yield this.count(where !== null && where !== void 0 ? where : []);
77
- return [];
78
- }
79
- case "POST": {
80
- return [(yield this.post(value !== null && value !== void 0 ? value : {}, where !== null && where !== void 0 ? where : [])).toJson()];
81
- }
82
- case "PUT": {
83
- return [(yield this.put(value !== null && value !== void 0 ? value : {}, where !== null && where !== void 0 ? where : [])).toJson()];
84
- }
85
- case "DELETE": {
86
- yield this.delete(where !== null && where !== void 0 ? where : []);
87
- return [];
88
- }
89
- }
90
- });
91
- }
92
- }
93
- exports.SqlApiBase = SqlApiBase;
94
- //# sourceMappingURL=sql_api_base.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sql_api_base.js","sourceRoot":"","sources":["../../src/lib/sql_api_base.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA;;;;;;;;GAQG;AACH,MAAsB,eAAe;CAYpC;AAZD,0CAYC;AAED;;;;;;;;GAQG;AACH,MAAsB,UAAU;IAoG5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;IACG,OAAO;6DAAC,EACV,KAAK,EACL,MAAM,EACN,KAAK,EACL,KAAK,GAMJ;YACD,IAAI,KAAK,KAAK,IAAI,CAAC,KAAK,EAAE,CAAC;gBACvB,OAAO,IAAI,CAAC;YAChB,CAAC;YACD,QAAQ,MAAM,EAAE,CAAC;gBACb,KAAK,KAAK,CAAC,CAAC,CAAC;oBACT,OAAO,CAAC,MAAM,IAAI,CAAC,GAAG,CAAC,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,GAAG,OAAO,CAAC,CAAC,MAAM,EAAE,CAAA,CAAC,CAAC,CAAC,CAAC;gBAC3E,CAAC;gBACD,KAAK,OAAO,CAAC,CAAC,CAAC;oBACX,MAAM,IAAI,CAAC,KAAK,CAAC,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,EAAE,CAAC,CAAC;oBAC9B,OAAO,EAAE,CAAC;gBACd,CAAC;gBACD,KAAK,MAAM,CAAC,CAAC,CAAC;oBACV,OAAO,CAAC,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,EAAE,EAAE,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;gBAClE,CAAC;gBACD,KAAK,KAAK,CAAC,CAAC,CAAC;oBACT,OAAO,CAAC,CAAC,MAAM,IAAI,CAAC,GAAG,CAAC,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,EAAE,EAAE,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;gBACjE,CAAC;gBACD,KAAK,QAAQ,CAAC,CAAC,CAAC;oBACZ,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,EAAE,CAAC,CAAC;oBAC/B,OAAO,EAAE,CAAC;gBACd,CAAC;YACL,CAAC;QACL,CAAC;KAAA;CACJ;AArKD,gCAqKC"}
@@ -1,83 +0,0 @@
1
- /**
2
- * Processes subscription updates.
3
- *
4
- * サブスクリプションのアップデート処理を行います。
5
- *
6
- * @param {String} targetCollectionPath
7
- * Specify the path of the collection to be updated.
8
- *
9
- * アップデートを行うコレクションのパスを指定します。
10
- *
11
- * @param {String} targetDocumentId
12
- * Specifies the ID of the document to be updated.
13
- *
14
- * アップデートを行うドキュメントのIDを指定します。
15
- *
16
- * @param {[key: string]: any} data
17
- * Document data to be updated.
18
- *
19
- * 更新するドキュメントデータ。
20
- *
21
- * @param {[key: string]: any} additionalData
22
- * Additional documentation data.
23
- *
24
- * 追加のドキュメントデータ。
25
- *
26
- * @param {String} userId
27
- * ID of the user who purchased the subscription.
28
- *
29
- * サブスクリプションを購入したユーザーのID。
30
- *
31
- * @param {String} platform
32
- * Subscription-based platform.
33
- *
34
- * サブスクリプションを利用するプラットフォーム。
35
- *
36
- * @param {String} orderId
37
- * Subscription Order ID.
38
- *
39
- * サブスクリプションの注文ID。
40
- *
41
- * @param {String} productId Product ID.
42
- * Subscription product ID.
43
- *
44
- * サブスクリプションのプロダクトID。
45
- *
46
- * @param {String} purchaseId
47
- * Subscription purchase ID.
48
- *
49
- * サブスクリプションの購入ID。
50
- *
51
- * @param {String} packageName
52
- * The package name of the application.
53
- *
54
- * アプリケーションのパッケージ名。
55
- *
56
- * @param {String} token
57
- * Token issued at the time of purchase.
58
- *
59
- * 購入時に発行されたトークン。
60
- *
61
- * @param {number} expiryDate
62
- * Subscription expiration date.
63
- *
64
- * サブスクリプションの有効期限。
65
- */
66
- export declare function updateSubscription({ targetCollectionPath, targetDocumentId, data, additionalData, userId, platform, orderId, productId, purchaseId, packageName, token, expiryDate, }: {
67
- targetCollectionPath: string;
68
- targetDocumentId: string;
69
- data: {
70
- [key: string]: any;
71
- };
72
- additionalData: {
73
- [key: string]: any;
74
- };
75
- userId: string;
76
- platform: string;
77
- orderId: string;
78
- productId: string;
79
- purchaseId: string;
80
- packageName: string;
81
- token: string;
82
- expiryDate: number;
83
- }): Promise<void>;