@mathrunet/masamune 3.6.0 → 3.8.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 +22 -0
- package/README.md +1 -1
- package/dist/functions/test.js +2 -2
- package/dist/functions/test.js.map +1 -1
- package/dist/functions.d.ts +2 -231
- package/dist/functions.js +2 -231
- package/dist/functions.js.map +1 -1
- package/dist/index.d.ts +4 -17
- package/dist/index.js +13 -15
- package/dist/index.js.map +1 -1
- package/package.json +10 -21
- package/.claude/settings.local.json +0 -12
- package/dist/functions/aggregate_model_firestore.d.ts +0 -1
- package/dist/functions/aggregate_model_firestore.js +0 -225
- package/dist/functions/aggregate_model_firestore.js.map +0 -1
- package/dist/functions/aggregation_model_firestore.d.ts +0 -1
- package/dist/functions/aggregation_model_firestore.js +0 -220
- package/dist/functions/aggregation_model_firestore.js.map +0 -1
- package/dist/functions/agora_cloud_recording.d.ts +0 -1
- package/dist/functions/agora_cloud_recording.js +0 -125
- package/dist/functions/agora_cloud_recording.js.map +0 -1
- package/dist/functions/agora_token.d.ts +0 -1
- package/dist/functions/agora_token.js +0 -144
- package/dist/functions/agora_token.js.map +0 -1
- package/dist/functions/algolia.d.ts +0 -1
- package/dist/functions/algolia.js +0 -145
- package/dist/functions/algolia.js.map +0 -1
- package/dist/functions/android_auth_code.d.ts +0 -1
- package/dist/functions/android_auth_code.js +0 -97
- package/dist/functions/android_auth_code.js.map +0 -1
- package/dist/functions/android_token.d.ts +0 -1
- package/dist/functions/android_token.js +0 -132
- package/dist/functions/android_token.js.map +0 -1
- package/dist/functions/collection_model_firestore.d.ts +0 -1
- package/dist/functions/collection_model_firestore.js +0 -222
- package/dist/functions/collection_model_firestore.js.map +0 -1
- package/dist/functions/consumable_verify_android.d.ts +0 -1
- package/dist/functions/consumable_verify_android.js +0 -172
- package/dist/functions/consumable_verify_android.js.map +0 -1
- package/dist/functions/consumable_verify_ios.d.ts +0 -1
- package/dist/functions/consumable_verify_ios.js +0 -136
- package/dist/functions/consumable_verify_ios.js.map +0 -1
- package/dist/functions/delete_documents.d.ts +0 -1
- package/dist/functions/delete_documents.js +0 -91
- package/dist/functions/delete_documents.js.map +0 -1
- package/dist/functions/delete_user.d.ts +0 -1
- package/dist/functions/delete_user.js +0 -87
- package/dist/functions/delete_user.js.map +0 -1
- package/dist/functions/document_model_firestore.d.ts +0 -1
- package/dist/functions/document_model_firestore.js +0 -218
- package/dist/functions/document_model_firestore.js.map +0 -1
- package/dist/functions/geocoding.d.ts +0 -1
- package/dist/functions/geocoding.js +0 -93
- package/dist/functions/geocoding.js.map +0 -1
- package/dist/functions/gmail.d.ts +0 -1
- package/dist/functions/gmail.js +0 -117
- package/dist/functions/gmail.js.map +0 -1
- package/dist/functions/google_token.d.ts +0 -1
- package/dist/functions/google_token.js +0 -100
- package/dist/functions/google_token.js.map +0 -1
- package/dist/functions/hls.d.ts +0 -1
- package/dist/functions/hls.js +0 -169
- package/dist/functions/hls.js.map +0 -1
- package/dist/functions/nonconsumable_verify_android.d.ts +0 -1
- package/dist/functions/nonconsumable_verify_android.js +0 -166
- package/dist/functions/nonconsumable_verify_android.js.map +0 -1
- package/dist/functions/nonconsumable_verify_ios.d.ts +0 -1
- package/dist/functions/nonconsumable_verify_ios.js +0 -130
- package/dist/functions/nonconsumable_verify_ios.js.map +0 -1
- package/dist/functions/openai_chat_gpt.d.ts +0 -1
- package/dist/functions/openai_chat_gpt.js +0 -117
- package/dist/functions/openai_chat_gpt.js.map +0 -1
- package/dist/functions/purchase_webhook_android.d.ts +0 -1
- package/dist/functions/purchase_webhook_android.js +0 -306
- package/dist/functions/purchase_webhook_android.js.map +0 -1
- package/dist/functions/purchase_webhook_ios.d.ts +0 -1
- package/dist/functions/purchase_webhook_ios.js +0 -182
- package/dist/functions/purchase_webhook_ios.js.map +0 -1
- package/dist/functions/scheduler.d.ts +0 -1
- package/dist/functions/scheduler.js +0 -144
- package/dist/functions/scheduler.js.map +0 -1
- package/dist/functions/send_grid.d.ts +0 -1
- package/dist/functions/send_grid.js +0 -111
- package/dist/functions/send_grid.js.map +0 -1
- package/dist/functions/send_notification.d.ts +0 -1
- package/dist/functions/send_notification.js +0 -207
- package/dist/functions/send_notification.js.map +0 -1
- package/dist/functions/storage_firebase.d.ts +0 -1
- package/dist/functions/storage_firebase.js +0 -286
- package/dist/functions/storage_firebase.js.map +0 -1
- package/dist/functions/stripe.d.ts +0 -1
- package/dist/functions/stripe.js +0 -1243
- package/dist/functions/stripe.js.map +0 -1
- package/dist/functions/stripe_webhook.d.ts +0 -1
- package/dist/functions/stripe_webhook.js +0 -605
- package/dist/functions/stripe_webhook.js.map +0 -1
- package/dist/functions/stripe_webhook_connect.d.ts +0 -1
- package/dist/functions/stripe_webhook_connect.js +0 -173
- package/dist/functions/stripe_webhook_connect.js.map +0 -1
- package/dist/functions/stripe_webhook_secure.d.ts +0 -1
- package/dist/functions/stripe_webhook_secure.js +0 -182
- package/dist/functions/stripe_webhook_secure.js.map +0 -1
- package/dist/functions/subscription_verify_android.d.ts +0 -1
- package/dist/functions/subscription_verify_android.js +0 -195
- package/dist/functions/subscription_verify_android.js.map +0 -1
- package/dist/functions/subscription_verify_ios.d.ts +0 -1
- package/dist/functions/subscription_verify_ios.js +0 -170
- package/dist/functions/subscription_verify_ios.js.map +0 -1
- package/dist/lib/api.d.ts +0 -185
- package/dist/lib/api.js +0 -172
- package/dist/lib/api.js.map +0 -1
- package/dist/lib/exntensions/string.extension.d.ts +0 -214
- package/dist/lib/exntensions/string.extension.js +0 -226
- package/dist/lib/exntensions/string.extension.js.map +0 -1
- package/dist/lib/functions/delete_documents.d.ts +0 -32
- package/dist/lib/functions/delete_documents.js +0 -111
- package/dist/lib/functions/delete_documents.js.map +0 -1
- package/dist/lib/functions/firestore.d.ts +0 -114
- package/dist/lib/functions/firestore.js +0 -347
- package/dist/lib/functions/firestore.js.map +0 -1
- package/dist/lib/functions/gmail.d.ts +0 -39
- package/dist/lib/functions/gmail.js +0 -64
- package/dist/lib/functions/gmail.js.map +0 -1
- package/dist/lib/functions/send_grid.d.ts +0 -33
- package/dist/lib/functions/send_grid.js +0 -57
- package/dist/lib/functions/send_grid.js.map +0 -1
- package/dist/lib/functions/send_notification.d.ts +0 -109
- package/dist/lib/functions/send_notification.js +0 -386
- package/dist/lib/functions/send_notification.js.map +0 -1
- package/dist/lib/functions/update_subscription.d.ts +0 -84
- package/dist/lib/functions/update_subscription.js +0 -150
- package/dist/lib/functions/update_subscription.js.map +0 -1
- package/dist/lib/functions/update_unlock.d.ts +0 -28
- package/dist/lib/functions/update_unlock.js +0 -84
- package/dist/lib/functions/update_unlock.js.map +0 -1
- package/dist/lib/functions/update_wallet.d.ts +0 -34
- package/dist/lib/functions/update_wallet.js +0 -91
- package/dist/lib/functions/update_wallet.js.map +0 -1
- package/dist/lib/functions/verify_android.d.ts +0 -50
- package/dist/lib/functions/verify_android.js +0 -130
- package/dist/lib/functions/verify_android.js.map +0 -1
- package/dist/lib/functions/verify_ios.d.ts +0 -73
- package/dist/lib/functions/verify_ios.js +0 -227
- package/dist/lib/functions/verify_ios.js.map +0 -1
- package/dist/lib/model_field_value/converters/firestore_basic_converter.d.ts +0 -25
- package/dist/lib/model_field_value/converters/firestore_basic_converter.js +0 -28
- package/dist/lib/model_field_value/converters/firestore_basic_converter.js.map +0 -1
- package/dist/lib/model_field_value/converters/firestore_enum_converter.d.ts +0 -25
- package/dist/lib/model_field_value/converters/firestore_enum_converter.js +0 -28
- package/dist/lib/model_field_value/converters/firestore_enum_converter.js.map +0 -1
- package/dist/lib/model_field_value/converters/firestore_model_command_base_converter.d.ts +0 -25
- package/dist/lib/model_field_value/converters/firestore_model_command_base_converter.js +0 -58
- package/dist/lib/model_field_value/converters/firestore_model_command_base_converter.js.map +0 -1
- package/dist/lib/model_field_value/converters/firestore_model_counter_converter.d.ts +0 -25
- package/dist/lib/model_field_value/converters/firestore_model_counter_converter.js +0 -177
- package/dist/lib/model_field_value/converters/firestore_model_counter_converter.js.map +0 -1
- package/dist/lib/model_field_value/converters/firestore_model_date_converter.d.ts +0 -26
- package/dist/lib/model_field_value/converters/firestore_model_date_converter.js +0 -174
- package/dist/lib/model_field_value/converters/firestore_model_date_converter.js.map +0 -1
- package/dist/lib/model_field_value/converters/firestore_model_date_range_converter.d.ts +0 -25
- package/dist/lib/model_field_value/converters/firestore_model_date_range_converter.js +0 -183
- package/dist/lib/model_field_value/converters/firestore_model_date_range_converter.js.map +0 -1
- package/dist/lib/model_field_value/converters/firestore_model_geo_value_converter.d.ts +0 -25
- package/dist/lib/model_field_value/converters/firestore_model_geo_value_converter.js +0 -163
- package/dist/lib/model_field_value/converters/firestore_model_geo_value_converter.js.map +0 -1
- package/dist/lib/model_field_value/converters/firestore_model_image_uri_converter.d.ts +0 -25
- package/dist/lib/model_field_value/converters/firestore_model_image_uri_converter.js +0 -134
- package/dist/lib/model_field_value/converters/firestore_model_image_uri_converter.js.map +0 -1
- package/dist/lib/model_field_value/converters/firestore_model_locale_converter.d.ts +0 -25
- package/dist/lib/model_field_value/converters/firestore_model_locale_converter.js +0 -163
- package/dist/lib/model_field_value/converters/firestore_model_locale_converter.js.map +0 -1
- package/dist/lib/model_field_value/converters/firestore_model_localized_value_converter.d.ts +0 -25
- package/dist/lib/model_field_value/converters/firestore_model_localized_value_converter.js +0 -89
- package/dist/lib/model_field_value/converters/firestore_model_localized_value_converter.js.map +0 -1
- package/dist/lib/model_field_value/converters/firestore_model_ref_converter.d.ts +0 -25
- package/dist/lib/model_field_value/converters/firestore_model_ref_converter.js +0 -113
- package/dist/lib/model_field_value/converters/firestore_model_ref_converter.js.map +0 -1
- package/dist/lib/model_field_value/converters/firestore_model_search_converter.d.ts +0 -25
- package/dist/lib/model_field_value/converters/firestore_model_search_converter.js +0 -91
- package/dist/lib/model_field_value/converters/firestore_model_search_converter.js.map +0 -1
- package/dist/lib/model_field_value/converters/firestore_model_time_converter.d.ts +0 -26
- package/dist/lib/model_field_value/converters/firestore_model_time_converter.js +0 -191
- package/dist/lib/model_field_value/converters/firestore_model_time_converter.js.map +0 -1
- package/dist/lib/model_field_value/converters/firestore_model_time_range_converter.d.ts +0 -25
- package/dist/lib/model_field_value/converters/firestore_model_time_range_converter.js +0 -183
- package/dist/lib/model_field_value/converters/firestore_model_time_range_converter.js.map +0 -1
- package/dist/lib/model_field_value/converters/firestore_model_timestamp_converter.d.ts +0 -26
- package/dist/lib/model_field_value/converters/firestore_model_timestamp_converter.js +0 -246
- package/dist/lib/model_field_value/converters/firestore_model_timestamp_converter.js.map +0 -1
- package/dist/lib/model_field_value/converters/firestore_model_timestamp_range_converter.d.ts +0 -25
- package/dist/lib/model_field_value/converters/firestore_model_timestamp_range_converter.js +0 -183
- package/dist/lib/model_field_value/converters/firestore_model_timestamp_range_converter.js.map +0 -1
- package/dist/lib/model_field_value/converters/firestore_model_token_converter.d.ts +0 -25
- package/dist/lib/model_field_value/converters/firestore_model_token_converter.js +0 -91
- package/dist/lib/model_field_value/converters/firestore_model_token_converter.js.map +0 -1
- package/dist/lib/model_field_value/converters/firestore_model_uri_converter.d.ts +0 -25
- package/dist/lib/model_field_value/converters/firestore_model_uri_converter.js +0 -134
- package/dist/lib/model_field_value/converters/firestore_model_uri_converter.js.map +0 -1
- package/dist/lib/model_field_value/converters/firestore_model_vector_value_converter.d.ts +0 -25
- package/dist/lib/model_field_value/converters/firestore_model_vector_value_converter.js +0 -80
- package/dist/lib/model_field_value/converters/firestore_model_vector_value_converter.js.map +0 -1
- package/dist/lib/model_field_value/converters/firestore_model_video_uri_converter.d.ts +0 -25
- package/dist/lib/model_field_value/converters/firestore_model_video_uri_converter.js +0 -134
- package/dist/lib/model_field_value/converters/firestore_model_video_uri_converter.js.map +0 -1
- package/dist/lib/model_field_value/converters/firestore_null_converter.d.ts +0 -25
- package/dist/lib/model_field_value/converters/firestore_null_converter.js +0 -45
- package/dist/lib/model_field_value/converters/firestore_null_converter.js.map +0 -1
- package/dist/lib/model_field_value/default_firestore_model_field_value_converter.d.ts +0 -61
- package/dist/lib/model_field_value/default_firestore_model_field_value_converter.js +0 -140
- package/dist/lib/model_field_value/default_firestore_model_field_value_converter.js.map +0 -1
- package/dist/lib/model_field_value/firestore_model_field_value_converter.d.ts +0 -154
- package/dist/lib/model_field_value/firestore_model_field_value_converter.js +0 -127
- package/dist/lib/model_field_value/firestore_model_field_value_converter.js.map +0 -1
- package/dist/lib/model_field_value/model_field_value.d.ts +0 -264
- package/dist/lib/model_field_value/model_field_value.js +0 -314
- package/dist/lib/model_field_value/model_field_value.js.map +0 -1
- package/dist/lib/regions.d.ts +0 -6
- package/dist/lib/regions.js +0 -3
- package/dist/lib/regions.js.map +0 -1
- package/dist/lib/schedulers/copy_document.d.ts +0 -35
- package/dist/lib/schedulers/copy_document.js +0 -59
- package/dist/lib/schedulers/copy_document.js.map +0 -1
- package/dist/lib/schedulers/delete_documents.d.ts +0 -35
- package/dist/lib/schedulers/delete_documents.js +0 -86
- package/dist/lib/schedulers/delete_documents.js.map +0 -1
- package/dist/lib/schedulers/notification.d.ts +0 -35
- package/dist/lib/schedulers/notification.js +0 -78
- package/dist/lib/schedulers/notification.js.map +0 -1
- package/dist/lib/src/call_process_function_base.d.ts +0 -39
- package/dist/lib/src/call_process_function_base.js +0 -82
- package/dist/lib/src/call_process_function_base.js.map +0 -1
- package/dist/lib/src/firebase_loader.d.ts +0 -30
- package/dist/lib/src/firebase_loader.js +0 -77
- package/dist/lib/src/firebase_loader.js.map +0 -1
- package/dist/lib/src/firestore_triggered_process_function_base.d.ts +0 -40
- package/dist/lib/src/firestore_triggered_process_function_base.js +0 -82
- package/dist/lib/src/firestore_triggered_process_function_base.js.map +0 -1
- package/dist/lib/src/functions_base.d.ts +0 -327
- package/dist/lib/src/functions_base.js +0 -38
- package/dist/lib/src/functions_base.js.map +0 -1
- package/dist/lib/src/functions_data.d.ts +0 -10
- package/dist/lib/src/functions_data.js +0 -19
- package/dist/lib/src/functions_data.js.map +0 -1
- package/dist/lib/src/request_process_function_base.d.ts +0 -39
- package/dist/lib/src/request_process_function_base.js +0 -80
- package/dist/lib/src/request_process_function_base.js.map +0 -1
- package/dist/lib/src/schedule_process_function_base.d.ts +0 -33
- package/dist/lib/src/schedule_process_function_base.js +0 -81
- package/dist/lib/src/schedule_process_function_base.js.map +0 -1
- package/dist/lib/src/sql_api_base.d.ts +0 -185
- package/dist/lib/src/sql_api_base.js +0 -94
- package/dist/lib/src/sql_api_base.js.map +0 -1
- package/dist/lib/utils.d.ts +0 -82
- package/dist/lib/utils.js +0 -142
- package/dist/lib/utils.js.map +0 -1
|
@@ -1,214 +0,0 @@
|
|
|
1
|
-
export {};
|
|
2
|
-
declare global {
|
|
3
|
-
interface String {
|
|
4
|
-
/**
|
|
5
|
-
* Encrypts a string.
|
|
6
|
-
* 文字列を暗号化します。
|
|
7
|
-
*
|
|
8
|
-
* @param {string} key
|
|
9
|
-
* Encryption key #1. (32 bytes)
|
|
10
|
-
* 暗号化キー1。(32バイト)
|
|
11
|
-
*
|
|
12
|
-
* @param {string} ivKey
|
|
13
|
-
* Encryption key 2. (16 bytes)
|
|
14
|
-
* 暗号化キー2。(16バイト)
|
|
15
|
-
*
|
|
16
|
-
* @return {string}
|
|
17
|
-
* Encrypted string.
|
|
18
|
-
* 暗号化された文字列。
|
|
19
|
-
*/
|
|
20
|
-
encrypt({ key, ivKey }: {
|
|
21
|
-
key: string;
|
|
22
|
-
ivKey: string;
|
|
23
|
-
}): string;
|
|
24
|
-
/**
|
|
25
|
-
* Decrypts a string.
|
|
26
|
-
* 文字列を復号化します。
|
|
27
|
-
*
|
|
28
|
-
* @param {string} key
|
|
29
|
-
* Encryption key #1. (32 bytes)
|
|
30
|
-
* 暗号化キー1。(32バイト)
|
|
31
|
-
* @param {string} ivKey
|
|
32
|
-
* Encryption key 2. (16 bytes)
|
|
33
|
-
* 暗号化キー2。(16バイト)
|
|
34
|
-
*
|
|
35
|
-
* @return {string}
|
|
36
|
-
* Decrypted string.
|
|
37
|
-
* 復号化された文字列。
|
|
38
|
-
*/
|
|
39
|
-
decrypt({ key, ivKey, }: {
|
|
40
|
-
key: string;
|
|
41
|
-
ivKey: string;
|
|
42
|
-
}): string;
|
|
43
|
-
/**
|
|
44
|
-
* Converts alphabets and numbers to full-width characters.
|
|
45
|
-
*
|
|
46
|
-
* アルファベットと数字を全角に変換します。
|
|
47
|
-
*
|
|
48
|
-
* ```typescript
|
|
49
|
-
* const text = "abcd";
|
|
50
|
-
* const converted = text.toZenkakuNumericAndAlphabet(); // "abcd"
|
|
51
|
-
* ```
|
|
52
|
-
*
|
|
53
|
-
* @return {string}
|
|
54
|
-
* Full-width string.
|
|
55
|
-
* 全角に変換された文字列。
|
|
56
|
-
*/
|
|
57
|
-
toZenkakuNumericAndAlphabet(): string;
|
|
58
|
-
/**
|
|
59
|
-
* Converts alphabets and numbers to half-width characters.
|
|
60
|
-
*
|
|
61
|
-
* アルファベットと数字を半角に変換します。
|
|
62
|
-
*
|
|
63
|
-
* ```typescript
|
|
64
|
-
* const text = "abcd";
|
|
65
|
-
* const converted = text.toHankakuNumericAndAlphabet(); // "abcd"
|
|
66
|
-
* ```
|
|
67
|
-
*
|
|
68
|
-
* @return {string}
|
|
69
|
-
* Half-width string.
|
|
70
|
-
* 半角に変換された文字列。
|
|
71
|
-
*/
|
|
72
|
-
toHankakuNumericAndAlphabet(): string;
|
|
73
|
-
/**
|
|
74
|
-
* Converts katakana to hiragana.
|
|
75
|
-
*
|
|
76
|
-
* カタカナをひらがなに変換します。
|
|
77
|
-
*
|
|
78
|
-
* ```typescript
|
|
79
|
-
* const text = "アイウエオ";
|
|
80
|
-
* const converted = text.toHiragana(); // "あいうえお"
|
|
81
|
-
* ```
|
|
82
|
-
*
|
|
83
|
-
* @return {string}
|
|
84
|
-
* Hiragana string.
|
|
85
|
-
* ひらがなに変換された文字列。
|
|
86
|
-
*/
|
|
87
|
-
toHiragana(): string;
|
|
88
|
-
/**
|
|
89
|
-
* Converts hiragana into katakana.
|
|
90
|
-
*
|
|
91
|
-
* ひらがなをカタカナに変換します。
|
|
92
|
-
*
|
|
93
|
-
* ```typescript
|
|
94
|
-
* const text = "あいうえお";
|
|
95
|
-
* const converted = text.toKatakana(); // "アイウエオ"
|
|
96
|
-
* ```
|
|
97
|
-
*
|
|
98
|
-
* @return {string}
|
|
99
|
-
* Katakana string.
|
|
100
|
-
* カタカナに変換された文字列。
|
|
101
|
-
*/
|
|
102
|
-
toKatakana(): string;
|
|
103
|
-
/**
|
|
104
|
-
* Converts half-width katakana to full-width katakana.
|
|
105
|
-
*
|
|
106
|
-
* 半角カタカナを全角カタカナに変換します。
|
|
107
|
-
*
|
|
108
|
-
* ```typescript
|
|
109
|
-
* const text = "アイウエオ";
|
|
110
|
-
* const converted = text.toZenkakuKatakana(); // "アイウエオ"
|
|
111
|
-
* ```
|
|
112
|
-
*
|
|
113
|
-
* @return {string}
|
|
114
|
-
* Full-width katakana string.
|
|
115
|
-
* 全角カタカナに変換された文字列。
|
|
116
|
-
*/
|
|
117
|
-
toZenkakuKatakana(): string;
|
|
118
|
-
/**
|
|
119
|
-
* Converts [String] to an array of one character at a time.
|
|
120
|
-
*
|
|
121
|
-
* [String]を1文字ずつの配列に変換します。
|
|
122
|
-
*
|
|
123
|
-
* ```typescript
|
|
124
|
-
* const text = "abcde";
|
|
125
|
-
* const characters = text.splitByCharacter(); // ["a", "b", "c", "d", "e"];
|
|
126
|
-
* ```
|
|
127
|
-
*
|
|
128
|
-
* @return {string[]}
|
|
129
|
-
* Array of one character at a time.
|
|
130
|
-
* 1文字ずつの配列。
|
|
131
|
-
*/
|
|
132
|
-
splitByCharacter(): string[];
|
|
133
|
-
/**
|
|
134
|
-
* Convert [String] to Bigram, i.e., an array of two characters each.
|
|
135
|
-
*
|
|
136
|
-
* [String]をBigram、つまり2文字ずつの配列に変換します。
|
|
137
|
-
*
|
|
138
|
-
* ```typescript
|
|
139
|
-
* const text = "abcde";
|
|
140
|
-
* const characters = text.splitByBigram(); // ["ab", "bc", "cd", "de"];
|
|
141
|
-
* ```
|
|
142
|
-
*
|
|
143
|
-
* @return {string[]}
|
|
144
|
-
* Array of two characters at a time.
|
|
145
|
-
* 2文字ずつの配列。
|
|
146
|
-
*/
|
|
147
|
-
splitByBigram(): string[];
|
|
148
|
-
/**
|
|
149
|
-
* Converts [String] into a one-character array and a two-character array.
|
|
150
|
-
*
|
|
151
|
-
* [String]を1文字ずつの配列と2文字ずつの配列に変換します。
|
|
152
|
-
*
|
|
153
|
-
* ```typescript
|
|
154
|
-
* const text = "abcde";
|
|
155
|
-
* const characters = text.splitByCharacterAndBigram(); // ["a", "b", "c", "d", "e", "ab", "bc", "cd", "de"];
|
|
156
|
-
* ```
|
|
157
|
-
*
|
|
158
|
-
* @return {string[]}
|
|
159
|
-
* Array of one character at a time and two characters at a time.
|
|
160
|
-
* 1文字ずつと2文字ずつの配列。
|
|
161
|
-
*/
|
|
162
|
-
splitByCharacterAndBigram(): string[];
|
|
163
|
-
/**
|
|
164
|
-
* Convert [String] to Trigram, i.e., an array of 3 characters each.
|
|
165
|
-
*
|
|
166
|
-
* [String]をTrigram、つまり3文字ずつの配列に変換します。
|
|
167
|
-
*
|
|
168
|
-
* ```typescript
|
|
169
|
-
* const text = "abcde";
|
|
170
|
-
* const characters = text.splitByTrigram(); // ["abc", "bcd", "cde"];
|
|
171
|
-
* ```
|
|
172
|
-
*
|
|
173
|
-
* @return {string[]}
|
|
174
|
-
* Array of three characters at a time.
|
|
175
|
-
* 3文字ずつの配列。
|
|
176
|
-
*/
|
|
177
|
-
splitByTrigram(): string[];
|
|
178
|
-
/**
|
|
179
|
-
* Removes only emojis from [String].
|
|
180
|
-
*
|
|
181
|
-
* [String]から絵文字のみを削除します。
|
|
182
|
-
*
|
|
183
|
-
* @return {string}
|
|
184
|
-
* String without emojis.
|
|
185
|
-
* 絵文字を削除した文字列。
|
|
186
|
-
*/
|
|
187
|
-
removeOnlyEmoji(): string;
|
|
188
|
-
/**
|
|
189
|
-
* Converts [string] to a valid Firestore map key by removing invalid characters.
|
|
190
|
-
*
|
|
191
|
-
* FirestoreのMapのキーとして使用できるように、[string]から無効な文字を削除します。
|
|
192
|
-
*
|
|
193
|
-
* Invalid characters removed: . / ~ * [ ]
|
|
194
|
-
* 削除される無効な文字: . / ~ * [ ]
|
|
195
|
-
*
|
|
196
|
-
* @return {string}
|
|
197
|
-
* String that can be used as a Firestore map key.
|
|
198
|
-
* FirestoreのMapのキーとして使用できる文字列。
|
|
199
|
-
*/
|
|
200
|
-
toFirestoreMapKey(): string;
|
|
201
|
-
/**
|
|
202
|
-
* Converts [string] to a searchable map.
|
|
203
|
-
*
|
|
204
|
-
* [string]を検索可能なマップに変換します。
|
|
205
|
-
*
|
|
206
|
-
* @return {{ [key: string]: any }}
|
|
207
|
-
* Searchable map.
|
|
208
|
-
* 検索可能なマップ。
|
|
209
|
-
*/
|
|
210
|
-
toSearchableMap(): {
|
|
211
|
-
[key: string]: any;
|
|
212
|
-
};
|
|
213
|
-
}
|
|
214
|
-
}
|
|
@@ -1,226 +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 () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
const crypto = __importStar(require("crypto"));
|
|
37
|
-
String.prototype.encrypt = function ({ key, ivKey }) {
|
|
38
|
-
const raw = this.valueOf();
|
|
39
|
-
const iv = Buffer.from(ivKey);
|
|
40
|
-
const cipher = crypto.createCipheriv("aes-256-cbc", Buffer.from(key), iv);
|
|
41
|
-
let encrypted = cipher.update(raw);
|
|
42
|
-
encrypted = Buffer.concat([encrypted, cipher.final()]);
|
|
43
|
-
return encrypted.toString("hex");
|
|
44
|
-
};
|
|
45
|
-
String.prototype.decrypt = function ({ key, ivKey }) {
|
|
46
|
-
const encrypted = this.valueOf();
|
|
47
|
-
const iv = Buffer.from(ivKey);
|
|
48
|
-
const encryptedText = Buffer.from(encrypted, "hex");
|
|
49
|
-
const decipher = crypto.createDecipheriv("aes-256-cbc", Buffer.from(key), iv);
|
|
50
|
-
let decrypted = decipher.update(encryptedText);
|
|
51
|
-
decrypted = Buffer.concat([decrypted, decipher.final()]);
|
|
52
|
-
return decrypted.toString();
|
|
53
|
-
};
|
|
54
|
-
String.prototype.toZenkakuNumericAndAlphabet = function () {
|
|
55
|
-
return this.valueOf().replace(/[A-Za-z0-9]/g, (s) => {
|
|
56
|
-
return String.fromCharCode(s.charCodeAt(0) + 65248);
|
|
57
|
-
});
|
|
58
|
-
};
|
|
59
|
-
String.prototype.toHankakuNumericAndAlphabet = function () {
|
|
60
|
-
return this.valueOf().replace(/[A-Za-z0-9]/g, (s) => {
|
|
61
|
-
return String.fromCharCode(s.charCodeAt(0) - 65248);
|
|
62
|
-
});
|
|
63
|
-
};
|
|
64
|
-
String.prototype.toHiragana = function () {
|
|
65
|
-
return this.valueOf().replace(/[\u30a1-\u30f6]/g, (s) => {
|
|
66
|
-
return String.fromCharCode(s.charCodeAt(0) - 0x60);
|
|
67
|
-
});
|
|
68
|
-
};
|
|
69
|
-
String.prototype.toKatakana = function () {
|
|
70
|
-
return this.valueOf().replace(/[\u3041-\u3096]/g, (s) => {
|
|
71
|
-
return String.fromCharCode(s.charCodeAt(0) + 0x60);
|
|
72
|
-
});
|
|
73
|
-
};
|
|
74
|
-
String.prototype.toZenkakuKatakana = function () {
|
|
75
|
-
let text = this.valueOf();
|
|
76
|
-
text = text.replace(/[ウカ-トハ-ホ]゙/g, (s) => {
|
|
77
|
-
var _a;
|
|
78
|
-
const dakuten = {
|
|
79
|
-
'ヴ': 'ヴ',
|
|
80
|
-
'ガ': 'ガ',
|
|
81
|
-
'ギ': 'ギ',
|
|
82
|
-
'グ': 'グ',
|
|
83
|
-
'ゲ': 'ゲ',
|
|
84
|
-
'ゴ': 'ゴ',
|
|
85
|
-
'ザ': 'ザ',
|
|
86
|
-
'ジ': 'ジ',
|
|
87
|
-
'ズ': 'ズ',
|
|
88
|
-
'ゼ': 'ゼ',
|
|
89
|
-
'ゾ': 'ゾ',
|
|
90
|
-
'ダ': 'ダ',
|
|
91
|
-
'ヂ': 'ヂ',
|
|
92
|
-
'ヅ': 'ヅ',
|
|
93
|
-
'デ': 'デ',
|
|
94
|
-
'ド': 'ド',
|
|
95
|
-
'バ': 'バ',
|
|
96
|
-
'ビ': 'ビ',
|
|
97
|
-
'ブ': 'ブ',
|
|
98
|
-
'ベ': 'ベ',
|
|
99
|
-
'ボ': 'ボ',
|
|
100
|
-
};
|
|
101
|
-
return (_a = dakuten[s]) !== null && _a !== void 0 ? _a : s;
|
|
102
|
-
});
|
|
103
|
-
text = text.replace(/[ハ-ホ]゚/g, (s) => {
|
|
104
|
-
var _a;
|
|
105
|
-
const handakuten = {
|
|
106
|
-
'パ': 'パ',
|
|
107
|
-
'ピ': 'ピ',
|
|
108
|
-
'プ': 'プ',
|
|
109
|
-
'ペ': 'ペ',
|
|
110
|
-
'ポ': 'ポ',
|
|
111
|
-
};
|
|
112
|
-
return (_a = handakuten[s]) !== null && _a !== void 0 ? _a : s;
|
|
113
|
-
});
|
|
114
|
-
text = text.replace(/[ヲ-ンー]/g, (s) => {
|
|
115
|
-
var _a;
|
|
116
|
-
const other = {
|
|
117
|
-
'ア': 'ア',
|
|
118
|
-
'イ': 'イ',
|
|
119
|
-
'ウ': 'ウ',
|
|
120
|
-
'エ': 'エ',
|
|
121
|
-
'オ': 'オ',
|
|
122
|
-
'ァ': 'ァ',
|
|
123
|
-
'ィ': 'ィ',
|
|
124
|
-
'ゥ': 'ゥ',
|
|
125
|
-
'ェ': 'ェ',
|
|
126
|
-
'ォ': 'ォ',
|
|
127
|
-
'カ': 'カ',
|
|
128
|
-
'キ': 'キ',
|
|
129
|
-
'ク': 'ク',
|
|
130
|
-
'ケ': 'ケ',
|
|
131
|
-
'コ': 'コ',
|
|
132
|
-
'サ': 'サ',
|
|
133
|
-
'シ': 'シ',
|
|
134
|
-
'ス': 'ス',
|
|
135
|
-
'セ': 'セ',
|
|
136
|
-
'ソ': 'ソ',
|
|
137
|
-
'タ': 'タ',
|
|
138
|
-
'チ': 'チ',
|
|
139
|
-
'ツ': 'ツ',
|
|
140
|
-
'テ': 'テ',
|
|
141
|
-
'ト': 'ト',
|
|
142
|
-
'ナ': 'ナ',
|
|
143
|
-
'ニ': 'ニ',
|
|
144
|
-
'ヌ': 'ヌ',
|
|
145
|
-
'ネ': 'ネ',
|
|
146
|
-
'ノ': 'ノ',
|
|
147
|
-
'ハ': 'ハ',
|
|
148
|
-
'ヒ': 'ヒ',
|
|
149
|
-
'フ': 'フ',
|
|
150
|
-
'ヘ': 'ヘ',
|
|
151
|
-
'ホ': 'ホ',
|
|
152
|
-
'マ': 'マ',
|
|
153
|
-
'ミ': 'ミ',
|
|
154
|
-
'ム': 'ム',
|
|
155
|
-
'メ': 'メ',
|
|
156
|
-
'モ': 'モ',
|
|
157
|
-
'ヤ': 'ヤ',
|
|
158
|
-
'ユ': 'ユ',
|
|
159
|
-
'ヨ': 'ヨ',
|
|
160
|
-
'ラ': 'ラ',
|
|
161
|
-
'リ': 'リ',
|
|
162
|
-
'ル': 'ル',
|
|
163
|
-
'レ': 'レ',
|
|
164
|
-
'ロ': 'ロ',
|
|
165
|
-
'ワ': 'ワ',
|
|
166
|
-
'ヲ': 'ヲ',
|
|
167
|
-
'ン': 'ン',
|
|
168
|
-
'ッ': 'ッ',
|
|
169
|
-
'ャ': 'ャ',
|
|
170
|
-
'ュ': 'ュ',
|
|
171
|
-
'ョ': 'ョ',
|
|
172
|
-
'ー': 'ー',
|
|
173
|
-
};
|
|
174
|
-
return (_a = other[s]) !== null && _a !== void 0 ? _a : s;
|
|
175
|
-
});
|
|
176
|
-
return text;
|
|
177
|
-
};
|
|
178
|
-
String.prototype.splitByCharacter = function () {
|
|
179
|
-
return this.valueOf().split("");
|
|
180
|
-
};
|
|
181
|
-
String.prototype.splitByBigram = function () {
|
|
182
|
-
const text = this.valueOf();
|
|
183
|
-
const result = [];
|
|
184
|
-
for (let i = 0; i < text.length - 1; i++) {
|
|
185
|
-
result.push(text.substring(i, Math.min(i + 2, text.length)));
|
|
186
|
-
}
|
|
187
|
-
return result;
|
|
188
|
-
};
|
|
189
|
-
String.prototype.splitByCharacterAndBigram = function () {
|
|
190
|
-
return [...this.splitByCharacter(), ...this.splitByBigram()];
|
|
191
|
-
};
|
|
192
|
-
String.prototype.splitByTrigram = function () {
|
|
193
|
-
const text = this.valueOf();
|
|
194
|
-
const result = [];
|
|
195
|
-
for (let i = 0; i < text.length - 2; i++) {
|
|
196
|
-
result.push(text.substring(i, Math.min(i + 3, text.length)));
|
|
197
|
-
}
|
|
198
|
-
return result;
|
|
199
|
-
};
|
|
200
|
-
String.prototype.removeOnlyEmoji = function () {
|
|
201
|
-
return this.valueOf().replace(/[\u{1F100}-\u{1F1FF}\u{1F600}-\u{1F64F}\u{1F300}-\u{1F5FF}\u{1F680}-\u{1F6FF}\u{1F700}-\u{1F77F}\u{1F780}-\u{1F7FF}\u{1F800}-\u{1F8FF}\u{1F900}-\u{1F9FF}\u{1FA00}-\u{1FA6F}\u{1FA70}-\u{1FAFF}\u{2600}-\u{26FF}\u{2700}-\u{27BF}]/gu, '');
|
|
202
|
-
};
|
|
203
|
-
String.prototype.toFirestoreMapKey = function () {
|
|
204
|
-
// FirestoreのMapのキーに使用できない文字を削除
|
|
205
|
-
// 使用できない文字: . / ~ * [ ]
|
|
206
|
-
return this.valueOf()
|
|
207
|
-
.replace(/[\.\/~\*\[\]]/g, '') // 禁止文字を削除
|
|
208
|
-
.trim(); // 先頭と末尾の空白を削除
|
|
209
|
-
};
|
|
210
|
-
String.prototype.toSearchableMap = function () {
|
|
211
|
-
const text = this.valueOf();
|
|
212
|
-
return text.replace(/ /g, " ")
|
|
213
|
-
.split(" ")
|
|
214
|
-
.flatMap((e) => e
|
|
215
|
-
.toLowerCase()
|
|
216
|
-
.replace(/\./g, "")
|
|
217
|
-
.toHankakuNumericAndAlphabet()
|
|
218
|
-
.toZenkakuKatakana()
|
|
219
|
-
.toKatakana()
|
|
220
|
-
.removeOnlyEmoji()
|
|
221
|
-
.toFirestoreMapKey()
|
|
222
|
-
.splitByCharacterAndBigram())
|
|
223
|
-
.filter((value, index, self) => self.indexOf(value) === index)
|
|
224
|
-
.reduce((acc, e) => (Object.assign(Object.assign({}, acc), { [e]: true })), {});
|
|
225
|
-
};
|
|
226
|
-
//# sourceMappingURL=string.extension.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"string.extension.js","sourceRoot":"","sources":["../../../src/lib/exntensions/string.extension.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AA0OjC,MAAM,CAAC,SAAS,CAAC,OAAO,GAAG,UAAU,EACjC,GAAG,EACH,KAAK,EAIR;IACG,MAAM,GAAG,GAAI,IAAe,CAAC,OAAO,EAAE,CAAC;IACvC,MAAM,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC9B,MAAM,MAAM,GAAG,MAAM,CAAC,cAAc,CAAC,aAAa,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC;IAC1E,IAAI,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACnC,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IACvD,OAAO,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AACrC,CAAC,CAAC;AAEF,MAAM,CAAC,SAAS,CAAC,OAAO,GAAG,UAAU,EACjC,GAAG,EACH,KAAK,EAIR;IACG,MAAM,SAAS,GAAI,IAAe,CAAC,OAAO,EAAE,CAAC;IAC7C,MAAM,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC9B,MAAM,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;IACpD,MAAM,QAAQ,GAAG,MAAM,CAAC,gBAAgB,CAAC,aAAa,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC;IAC9E,IAAI,SAAS,GAAG,QAAQ,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;I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;AAC7F,CAAC,CAAA"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Loads related collections and deletes data matching the criteria.
|
|
3
|
-
*
|
|
4
|
-
* 関連するコレクションをロードし、条件に一致するデータを削除します。
|
|
5
|
-
*
|
|
6
|
-
* @param collectionPath
|
|
7
|
-
* Specify the path of the collection to be deleted.
|
|
8
|
-
*
|
|
9
|
-
* 削除対象のコレクションのパスを指定します。
|
|
10
|
-
*
|
|
11
|
-
* @param wheres
|
|
12
|
-
* Specifies the conditions under which collections to be deleted are retrieved.
|
|
13
|
-
*
|
|
14
|
-
* 削除対象のコレクションを取得する際の条件を指定します。
|
|
15
|
-
*
|
|
16
|
-
* @param conditions
|
|
17
|
-
* Specify the conditions under which data is to be deleted.
|
|
18
|
-
*
|
|
19
|
-
* データを削除対象とする条件を指定します。
|
|
20
|
-
*/
|
|
21
|
-
export declare function deleteDocuments({ collectionPath, wheres, conditions, firestoreInstance, }: {
|
|
22
|
-
collectionPath: string;
|
|
23
|
-
wheres?: {
|
|
24
|
-
[key: string]: any;
|
|
25
|
-
}[] | undefined;
|
|
26
|
-
conditions?: {
|
|
27
|
-
[key: string]: any;
|
|
28
|
-
}[] | undefined;
|
|
29
|
-
firestoreInstance: FirebaseFirestore.Firestore;
|
|
30
|
-
}): Promise<{
|
|
31
|
-
[key: string]: any;
|
|
32
|
-
}>;
|
|
@@ -1,111 +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 () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
36
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
37
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
38
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
39
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
40
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
41
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
|
-
exports.deleteDocuments = deleteDocuments;
|
|
46
|
-
const utils_1 = require("../utils");
|
|
47
|
-
const firestore = __importStar(require("./firestore"));
|
|
48
|
-
/**
|
|
49
|
-
* Loads related collections and deletes data matching the criteria.
|
|
50
|
-
*
|
|
51
|
-
* 関連するコレクションをロードし、条件に一致するデータを削除します。
|
|
52
|
-
*
|
|
53
|
-
* @param collectionPath
|
|
54
|
-
* Specify the path of the collection to be deleted.
|
|
55
|
-
*
|
|
56
|
-
* 削除対象のコレクションのパスを指定します。
|
|
57
|
-
*
|
|
58
|
-
* @param wheres
|
|
59
|
-
* Specifies the conditions under which collections to be deleted are retrieved.
|
|
60
|
-
*
|
|
61
|
-
* 削除対象のコレクションを取得する際の条件を指定します。
|
|
62
|
-
*
|
|
63
|
-
* @param conditions
|
|
64
|
-
* Specify the conditions under which data is to be deleted.
|
|
65
|
-
*
|
|
66
|
-
* データを削除対象とする条件を指定します。
|
|
67
|
-
*/
|
|
68
|
-
function deleteDocuments(_a) {
|
|
69
|
-
return __awaiter(this, arguments, void 0, function* ({ collectionPath, wheres, conditions, firestoreInstance, }) {
|
|
70
|
-
const res = {};
|
|
71
|
-
try {
|
|
72
|
-
const collectionRef = firestore.where({
|
|
73
|
-
query: firestoreInstance.collection(collectionPath),
|
|
74
|
-
wheres: wheres
|
|
75
|
-
});
|
|
76
|
-
let cursor = null;
|
|
77
|
-
let collection = null;
|
|
78
|
-
do {
|
|
79
|
-
collection = yield firestore.cursor({ query: collectionRef, limit: 500, cursor: cursor }).get();
|
|
80
|
-
const deleteList = [];
|
|
81
|
-
for (let doc of collection.docs) {
|
|
82
|
-
const data = doc.data();
|
|
83
|
-
if (!(yield firestore.hasMatch({ data: data, conditions: conditions }))) {
|
|
84
|
-
continue;
|
|
85
|
-
}
|
|
86
|
-
deleteList.push(doc.ref);
|
|
87
|
-
}
|
|
88
|
-
const splitted = (0, utils_1.splitArray)(deleteList, 500);
|
|
89
|
-
for (let list of splitted) {
|
|
90
|
-
const batch = firestoreInstance.batch();
|
|
91
|
-
for (let doc of list) {
|
|
92
|
-
batch.delete(doc);
|
|
93
|
-
}
|
|
94
|
-
yield batch.commit();
|
|
95
|
-
}
|
|
96
|
-
if (collection.docs.length < 500) {
|
|
97
|
-
break;
|
|
98
|
-
}
|
|
99
|
-
cursor = collection.docs[collection.docs.length - 1];
|
|
100
|
-
} while (collection.docs.length >= 500);
|
|
101
|
-
}
|
|
102
|
-
catch (err) {
|
|
103
|
-
throw err;
|
|
104
|
-
}
|
|
105
|
-
return {
|
|
106
|
-
success: true,
|
|
107
|
-
results: res,
|
|
108
|
-
};
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
//# sourceMappingURL=delete_documents.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"delete_documents.js","sourceRoot":"","sources":["../../../src/lib/functions/delete_documents.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,0CAiDC;AAxED,oCAAsC;AACtC,uDAAyC;AAEzC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,SAAsB,eAAe;yDAAC,EAClC,cAAc,EACd,MAAM,EACN,UAAU,EACV,iBAAiB,GAMhB;QACD,MAAM,GAAG,GAA2B,EAAE,CAAC;QACvC,IAAI,CAAC;YACD,MAAM,aAAa,GAAG,SAAS,CAAC,KAAK,CAAC;gBAClC,KAAK,EAAE,iBAAiB,CAAC,UAAU,CAAC,cAAc,CAAC;gBACnD,MAAM,EAAE,MAAM;aACjB,CAAC,CAAC;YACH,IAAI,MAAM,GAAmD,IAAI,CAAC;YAClE,IAAI,UAAU,GAA2G,IAAI,CAAC;YAC9H,GAAG,CAAC;gBACA,UAAU,GAAG,MAAM,SAAS,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC;gBAChG,MAAM,UAAU,GAAoG,EAAE,CAAC;gBACvH,KA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