@andre1502/react-utilities 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (186) hide show
  1. package/README.md +340 -0
  2. package/dist/Config/Config.d.ts +28 -0
  3. package/dist/Config/Config.js +200 -0
  4. package/dist/Config/Config.js.map +1 -0
  5. package/dist/Config/GoogleAuth.d.ts +15 -0
  6. package/dist/Config/GoogleAuth.js +71 -0
  7. package/dist/Config/GoogleAuth.js.map +1 -0
  8. package/dist/Config/Locales.d.ts +18 -0
  9. package/dist/Config/Locales.js +62 -0
  10. package/dist/Config/Locales.js.map +1 -0
  11. package/dist/Config/Output.d.ts +10 -0
  12. package/dist/Config/Output.js +28 -0
  13. package/dist/Config/Output.js.map +1 -0
  14. package/dist/Config/Sitemap.d.ts +13 -0
  15. package/dist/Config/Sitemap.js +73 -0
  16. package/dist/Config/Sitemap.js.map +1 -0
  17. package/dist/Format/NumberFormat.d.ts +6 -0
  18. package/dist/Format/NumberFormat.js +77 -0
  19. package/dist/Format/NumberFormat.js.map +1 -0
  20. package/dist/Format/NumberParser.d.ts +9 -0
  21. package/dist/Format/NumberParser.js +51 -0
  22. package/dist/Format/NumberParser.js.map +1 -0
  23. package/dist/React-BaJ1KfGF.js +87 -0
  24. package/dist/React-BaJ1KfGF.js.map +1 -0
  25. package/dist/React-qUl0CBmE.js +109 -0
  26. package/dist/React-qUl0CBmE.js.map +1 -0
  27. package/dist/ReactNative-CqUrY2ZJ.js +3856 -0
  28. package/dist/ReactNative-CqUrY2ZJ.js.map +1 -0
  29. package/dist/ReactNative-mNnws-b5.js +3834 -0
  30. package/dist/ReactNative-mNnws-b5.js.map +1 -0
  31. package/dist/Sentry/Build.d.ts +9 -0
  32. package/dist/Sentry/Build.js +88 -0
  33. package/dist/Sentry/Build.js.map +1 -0
  34. package/dist/Sentry/React.d.ts +18 -0
  35. package/dist/Sentry/React.js +104 -0
  36. package/dist/Sentry/React.js.map +1 -0
  37. package/dist/Sentry/ReactNative.d.ts +18 -0
  38. package/dist/Sentry/ReactNative.js +114 -0
  39. package/dist/Sentry/ReactNative.js.map +1 -0
  40. package/dist/Sentry/Utils.d.ts +2 -0
  41. package/dist/Sentry/Utils.js +24 -0
  42. package/dist/Sentry/Utils.js.map +1 -0
  43. package/dist/Utils/Files.d.ts +7 -0
  44. package/dist/Utils/Files.js +52 -0
  45. package/dist/Utils/Files.js.map +1 -0
  46. package/dist/Utils-Cq948gfa.js +20 -0
  47. package/dist/Utils-Cq948gfa.js.map +1 -0
  48. package/dist/Utils-Dilye04y.js +22 -0
  49. package/dist/Utils-Dilye04y.js.map +1 -0
  50. package/dist/config-cli.cjs +471 -0
  51. package/dist/config-cli.cjs.map +1 -0
  52. package/dist/config-cli.d.ts +34 -0
  53. package/dist/config-cli.js +220 -0
  54. package/dist/config-cli.js.map +1 -0
  55. package/dist/config-cli.mjs +443 -0
  56. package/dist/config-cli.mjs.map +1 -0
  57. package/dist/enums/CurrencySymbolEnum.d.ts +5 -0
  58. package/dist/enums/CurrencySymbolEnum.js +13 -0
  59. package/dist/enums/CurrencySymbolEnum.js.map +1 -0
  60. package/dist/format.cjs +122 -0
  61. package/dist/format.cjs.map +1 -0
  62. package/dist/format.d.ts +3 -0
  63. package/dist/format.js +55 -0
  64. package/dist/format.js.map +1 -0
  65. package/dist/format.mjs +117 -0
  66. package/dist/format.mjs.map +1 -0
  67. package/dist/index-cli.cjs +24 -0
  68. package/dist/index-cli.cjs.map +1 -0
  69. package/dist/index-cli.d.ts +2 -0
  70. package/dist/index-cli.js +28 -0
  71. package/dist/index-cli.js.map +1 -0
  72. package/dist/index-cli.mjs +12 -0
  73. package/dist/index-cli.mjs.map +1 -0
  74. package/dist/index-fmt.cjs +16 -0
  75. package/dist/index-fmt.cjs.map +1 -0
  76. package/dist/index-fmt.d.ts +1 -0
  77. package/dist/index-fmt.js +17 -0
  78. package/dist/index-fmt.js.map +1 -0
  79. package/dist/index-fmt.mjs +3 -0
  80. package/dist/index-fmt.mjs.map +1 -0
  81. package/dist/index-rn.cjs +21 -0
  82. package/dist/index-rn.cjs.map +1 -0
  83. package/dist/index-rn.d.ts +2 -0
  84. package/dist/index-rn.js +28 -0
  85. package/dist/index-rn.js.map +1 -0
  86. package/dist/index-rn.mjs +6 -0
  87. package/dist/index-rn.mjs.map +1 -0
  88. package/dist/index.cjs +21 -0
  89. package/dist/index.cjs.map +1 -0
  90. package/dist/index.d.ts +2 -0
  91. package/dist/index.js +28 -0
  92. package/dist/index.js.map +1 -0
  93. package/dist/index.mjs +6 -0
  94. package/dist/index.mjs.map +1 -0
  95. package/dist/interfaces/Config/ConfigOptions.d.ts +8 -0
  96. package/dist/interfaces/Config/ConfigOptions.js +6 -0
  97. package/dist/interfaces/Config/ConfigOptions.js.map +1 -0
  98. package/dist/interfaces/Config/OutputMap.d.ts +3 -0
  99. package/dist/interfaces/Config/OutputMap.js +6 -0
  100. package/dist/interfaces/Config/OutputMap.js.map +1 -0
  101. package/dist/interfaces/Config/OutputOptions.d.ts +7 -0
  102. package/dist/interfaces/Config/OutputOptions.js +6 -0
  103. package/dist/interfaces/Config/OutputOptions.js.map +1 -0
  104. package/dist/interfaces/Config/SitemapMap.d.ts +5 -0
  105. package/dist/interfaces/Config/SitemapMap.js +6 -0
  106. package/dist/interfaces/Config/SitemapMap.js.map +1 -0
  107. package/dist/interfaces/Config/StringMap.d.ts +3 -0
  108. package/dist/interfaces/Config/StringMap.js +6 -0
  109. package/dist/interfaces/Config/StringMap.js.map +1 -0
  110. package/dist/interfaces/Format/FormatOptions.d.ts +14 -0
  111. package/dist/interfaces/Format/FormatOptions.js +6 -0
  112. package/dist/interfaces/Format/FormatOptions.js.map +1 -0
  113. package/dist/interfaces/Sentry/InitOptions.d.ts +20 -0
  114. package/dist/interfaces/Sentry/InitOptions.js +6 -0
  115. package/dist/interfaces/Sentry/InitOptions.js.map +1 -0
  116. package/dist/interfaces/Sentry/InitOptionsRN.d.ts +4 -0
  117. package/dist/interfaces/Sentry/InitOptionsRN.js +6 -0
  118. package/dist/interfaces/Sentry/InitOptionsRN.js.map +1 -0
  119. package/dist/interfaces/Sentry/SourceMapOptions.d.ts +7 -0
  120. package/dist/interfaces/Sentry/SourceMapOptions.js +6 -0
  121. package/dist/interfaces/Sentry/SourceMapOptions.js.map +1 -0
  122. package/dist/sentry-cli.cjs +119 -0
  123. package/dist/sentry-cli.cjs.map +1 -0
  124. package/dist/sentry-cli.d.ts +9 -0
  125. package/dist/sentry-cli.js +50 -0
  126. package/dist/sentry-cli.js.map +1 -0
  127. package/dist/sentry-cli.mjs +98 -0
  128. package/dist/sentry-cli.mjs.map +1 -0
  129. package/dist/sentry-rn.cjs +11 -0
  130. package/dist/sentry-rn.cjs.map +1 -0
  131. package/dist/sentry-rn.d.ts +2 -0
  132. package/dist/sentry-rn.js +28 -0
  133. package/dist/sentry-rn.js.map +1 -0
  134. package/dist/sentry-rn.mjs +4 -0
  135. package/dist/sentry-rn.mjs.map +1 -0
  136. package/dist/sentry.cjs +11 -0
  137. package/dist/sentry.cjs.map +1 -0
  138. package/dist/sentry.d.ts +2 -0
  139. package/dist/sentry.js +28 -0
  140. package/dist/sentry.js.map +1 -0
  141. package/dist/sentry.mjs +4 -0
  142. package/dist/sentry.mjs.map +1 -0
  143. package/dist/types/Config/OptionType.d.ts +2 -0
  144. package/dist/types/Config/OptionType.js +6 -0
  145. package/dist/types/Config/OptionType.js.map +1 -0
  146. package/dist/types/Format/OptionType.d.ts +3 -0
  147. package/dist/types/Format/OptionType.js +6 -0
  148. package/dist/types/Format/OptionType.js.map +1 -0
  149. package/dist/types/Sentry/OptionType.d.ts +1 -0
  150. package/dist/types/Sentry/OptionType.js +6 -0
  151. package/dist/types/Sentry/OptionType.js.map +1 -0
  152. package/package.json +139 -0
  153. package/src/Config/Config.ts +258 -0
  154. package/src/Config/GoogleAuth.ts +54 -0
  155. package/src/Config/Locales.ts +72 -0
  156. package/src/Config/Output.ts +29 -0
  157. package/src/Config/Sitemap.ts +67 -0
  158. package/src/Format/NumberFormat.ts +96 -0
  159. package/src/Format/NumberParser.ts +42 -0
  160. package/src/Sentry/Build.ts +67 -0
  161. package/src/Sentry/React.ts +127 -0
  162. package/src/Sentry/ReactNative.ts +133 -0
  163. package/src/Sentry/Utils.ts +26 -0
  164. package/src/Utils/Files.ts +51 -0
  165. package/src/config-cli.ts +152 -0
  166. package/src/enums/CurrencySymbolEnum.ts +5 -0
  167. package/src/format.ts +39 -0
  168. package/src/index-cli.ts +2 -0
  169. package/src/index-fmt.ts +1 -0
  170. package/src/index-rn.ts +2 -0
  171. package/src/index.ts +2 -0
  172. package/src/interfaces/Config/ConfigOptions.ts +9 -0
  173. package/src/interfaces/Config/OutputMap.ts +3 -0
  174. package/src/interfaces/Config/OutputOptions.ts +8 -0
  175. package/src/interfaces/Config/SitemapMap.ts +5 -0
  176. package/src/interfaces/Config/StringMap.ts +3 -0
  177. package/src/interfaces/Format/FormatOptions.ts +19 -0
  178. package/src/interfaces/Sentry/InitOptions.ts +23 -0
  179. package/src/interfaces/Sentry/InitOptionsRN.ts +5 -0
  180. package/src/interfaces/Sentry/SourceMapOptions.ts +7 -0
  181. package/src/sentry-cli.ts +16 -0
  182. package/src/sentry-rn.ts +2 -0
  183. package/src/sentry.ts +2 -0
  184. package/src/types/Config/OptionType.ts +2 -0
  185. package/src/types/Format/OptionType.ts +15 -0
  186. package/src/types/Sentry/OptionType.ts +1 -0
package/src/format.ts ADDED
@@ -0,0 +1,39 @@
1
+ import { CurrencySymbolEnum } from './enums/CurrencySymbolEnum';
2
+
3
+ require('@formatjs/intl-getcanonicallocales/polyfill');
4
+ require('@formatjs/intl-locale/polyfill');
5
+
6
+ require('@formatjs/intl-pluralrules/polyfill');
7
+ require('@formatjs/intl-pluralrules/locale-data/en');
8
+ require('@formatjs/intl-pluralrules/locale-data/vi');
9
+ require('@formatjs/intl-pluralrules/locale-data/zh');
10
+
11
+ require('@formatjs/intl-displaynames/polyfill');
12
+ require('@formatjs/intl-displaynames/locale-data/en');
13
+ require('@formatjs/intl-displaynames/locale-data/vi');
14
+ require('@formatjs/intl-displaynames/locale-data/zh');
15
+
16
+ require('@formatjs/intl-listformat/polyfill');
17
+ require('@formatjs/intl-listformat/locale-data/en');
18
+ require('@formatjs/intl-listformat/locale-data/vi');
19
+ require('@formatjs/intl-listformat/locale-data/zh');
20
+
21
+ require('@formatjs/intl-numberformat/polyfill');
22
+ require('@formatjs/intl-numberformat/locale-data/en');
23
+ require('@formatjs/intl-numberformat/locale-data/vi');
24
+ require('@formatjs/intl-numberformat/locale-data/zh');
25
+
26
+ require('@formatjs/intl-relativetimeformat/polyfill');
27
+ require('@formatjs/intl-relativetimeformat/locale-data/en');
28
+ require('@formatjs/intl-relativetimeformat/locale-data/vi');
29
+ require('@formatjs/intl-relativetimeformat/locale-data/zh');
30
+
31
+ require('@formatjs/intl-datetimeformat/polyfill');
32
+ require('@formatjs/intl-datetimeformat/locale-data/en');
33
+ require('@formatjs/intl-datetimeformat/locale-data/vi');
34
+ require('@formatjs/intl-datetimeformat/locale-data/zh');
35
+
36
+ require('@formatjs/intl-datetimeformat/add-golden-tz.js');
37
+
38
+ export * from './Format/NumberFormat';
39
+ export { CurrencySymbolEnum };
@@ -0,0 +1,2 @@
1
+ export * from './config-cli';
2
+ export * from './sentry-cli';
@@ -0,0 +1 @@
1
+ export * from './format';
@@ -0,0 +1,2 @@
1
+ export * from './format';
2
+ export * from './sentry-rn';
package/src/index.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from './format';
2
+ export * from './sentry';
@@ -0,0 +1,9 @@
1
+ import { FormatAs } from '../../types/Config/OptionType';
2
+ import { OutputOptions } from './OutputOptions';
3
+
4
+ export interface ConfigOptions {
5
+ spreadsheetId: string;
6
+ spreadsheetTab: string;
7
+ formatAs: FormatAs;
8
+ output: OutputOptions;
9
+ }
@@ -0,0 +1,3 @@
1
+ export interface OutputMap {
2
+ [key: string]: any;
3
+ }
@@ -0,0 +1,8 @@
1
+ import { ExportAs } from '../../types/Config/OptionType';
2
+
3
+ export interface OutputOptions {
4
+ folder: string;
5
+ filename: string;
6
+ isFilenameLowercase?: boolean;
7
+ exportAs?: ExportAs;
8
+ }
@@ -0,0 +1,5 @@
1
+ export interface SitemapMap {
2
+ url: string;
3
+ changeFreq: string;
4
+ priority: number;
5
+ }
@@ -0,0 +1,3 @@
1
+ export interface StringMap {
2
+ [key: string]: string;
3
+ }
@@ -0,0 +1,19 @@
1
+ import {
2
+ CurrencyDisplay,
3
+ StyleCurrency,
4
+ TrailingZeroDisplay,
5
+ } from '../../types/Format/OptionType';
6
+
7
+ export interface FormatOptions {
8
+ lang: string;
9
+ currency: string;
10
+ value: number;
11
+ styleCurrency?: StyleCurrency;
12
+ currencyDisplay?: CurrencyDisplay;
13
+ showValue?: boolean;
14
+ showCurrency?: boolean;
15
+ minimumFractionDigits?: number;
16
+ maximumFractionDigits?: number;
17
+ trailingZeroDisplay?: TrailingZeroDisplay;
18
+ options?: any;
19
+ }
@@ -0,0 +1,23 @@
1
+ import { StringRegexArr } from '../../types/Sentry/OptionType';
2
+
3
+ export interface HttpClientIntegrationOptions {
4
+ failedRequestStatusCodes: ([number, number] | number)[];
5
+ failedRequestTargets: StringRegexArr;
6
+ }
7
+
8
+ export interface CaptureConsoleIntegrationOptions {
9
+ levels: string[];
10
+ }
11
+
12
+ export interface InitOptions {
13
+ env: string;
14
+ dsn: string;
15
+ debug: boolean;
16
+ release: string;
17
+ requiredEnvForSendToSentry?: string[];
18
+ ignoreErrorsOptions?: StringRegexArr;
19
+ httpClientIntegrationOptions?: HttpClientIntegrationOptions;
20
+ captureConsoleIntegrationOptions?: CaptureConsoleIntegrationOptions;
21
+ beforeSend?: (event: any, hint: any) => any;
22
+ options?: any;
23
+ }
@@ -0,0 +1,5 @@
1
+ import { InitOptions } from './InitOptions';
2
+
3
+ export interface InitOptionsRN extends Omit<InitOptions, 'release'> {
4
+ release?: string;
5
+ }
@@ -0,0 +1,7 @@
1
+ export interface SourceMapOptions {
2
+ env: string;
3
+ release: string;
4
+ includeFolder: string[];
5
+ urlPrefix: string;
6
+ requiredEnvForSourceMap: string[];
7
+ }
@@ -0,0 +1,16 @@
1
+ import { releaseSourceMap } from './Sentry/Build';
2
+ import { SourceMapOptions } from './interfaces/Sentry/SourceMapOptions';
3
+
4
+ export * from './interfaces/Sentry/SourceMapOptions';
5
+
6
+ /**
7
+ * Create and upload sentry release source map.
8
+ *
9
+ * @param {SourceMapOption} options
10
+ * @return {Promise<void>}
11
+ */
12
+ export const releaseSentrySourceMap = async (
13
+ options: SourceMapOptions,
14
+ ): Promise<void> => {
15
+ await releaseSourceMap(options);
16
+ };
@@ -0,0 +1,2 @@
1
+ export * from './Sentry/ReactNative';
2
+ export * from './interfaces/Sentry/InitOptionsRN';
package/src/sentry.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from './Sentry/React';
2
+ export * from './interfaces/Sentry/InitOptions';
@@ -0,0 +1,2 @@
1
+ export type ExportAs = 'ts' | 'json' | 'js' | 'env';
2
+ export type FormatAs = 'locales' | 'config';
@@ -0,0 +1,15 @@
1
+ export type StyleCurrency =
2
+ | 'currency'
3
+ | 'unit'
4
+ | 'decimal'
5
+ | 'percent'
6
+ | undefined;
7
+
8
+ export type CurrencyDisplay =
9
+ | 'symbol'
10
+ | 'code'
11
+ | 'name'
12
+ | 'narrowSymbol'
13
+ | undefined;
14
+
15
+ export type TrailingZeroDisplay = 'auto' | 'stripIfInteger';
@@ -0,0 +1 @@
1
+ export type StringRegexArr = (string | RegExp)[];