@microsoft/applicationinsights-offlinechannel-js 0.1.0-nightly3.2402-06
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/CODE_OF_CONDUCT.md +9 -0
- package/CONTRIBUTING.md +14 -0
- package/LICENSE.TXT +21 -0
- package/PRIVACY +3 -0
- package/README.md +63 -0
- package/SECURITY.md +41 -0
- package/SUPPORT.md +14 -0
- package/dist/es5/applicationinsights-offlinechannel-js.js +6391 -0
- package/dist/es5/applicationinsights-offlinechannel-js.js.map +1 -0
- package/dist/es5/applicationinsights-offlinechannel-js.min.js +6 -0
- package/dist/es5/applicationinsights-offlinechannel-js.min.js.map +1 -0
- package/dist-es5/Helpers/Utils.js +185 -0
- package/dist-es5/Helpers/Utils.js.map +1 -0
- package/dist-es5/InMemoryBatch.js +64 -0
- package/dist-es5/InMemoryBatch.js.map +1 -0
- package/dist-es5/Interfaces/IInMemoryBatch.js +8 -0
- package/dist-es5/Interfaces/IInMemoryBatch.js.map +1 -0
- package/dist-es5/Interfaces/IOfflineBatch.js +9 -0
- package/dist-es5/Interfaces/IOfflineBatch.js.map +1 -0
- package/dist-es5/Interfaces/IOfflineIndexDb.js +8 -0
- package/dist-es5/Interfaces/IOfflineIndexDb.js.map +1 -0
- package/dist-es5/Interfaces/IOfflineProvider.js +8 -0
- package/dist-es5/Interfaces/IOfflineProvider.js.map +1 -0
- package/dist-es5/Interfaces/ISender.js +8 -0
- package/dist-es5/Interfaces/ISender.js.map +1 -0
- package/dist-es5/OfflineBatchHandler.js +343 -0
- package/dist-es5/OfflineBatchHandler.js.map +1 -0
- package/dist-es5/OfflineChannel.js +465 -0
- package/dist-es5/OfflineChannel.js.map +1 -0
- package/dist-es5/PayloadHelper.js +62 -0
- package/dist-es5/PayloadHelper.js.map +1 -0
- package/dist-es5/Providers/IndexDbHelper.js +626 -0
- package/dist-es5/Providers/IndexDbHelper.js.map +1 -0
- package/dist-es5/Providers/IndexDbProvider.js +468 -0
- package/dist-es5/Providers/IndexDbProvider.js.map +1 -0
- package/dist-es5/Providers/WebStorageProvider.js +463 -0
- package/dist-es5/Providers/WebStorageProvider.js.map +1 -0
- package/dist-es5/Sender.js +572 -0
- package/dist-es5/Sender.js.map +1 -0
- package/dist-es5/__DynamicConstants.js +80 -0
- package/dist-es5/__DynamicConstants.js.map +1 -0
- package/dist-es5/applicationinsights-offlinechannel-js.js +11 -0
- package/dist-es5/applicationinsights-offlinechannel-js.js.map +1 -0
- package/package.json +65 -0
- package/tsconfig.json +28 -0
- package/types/applicationinsights-offlinechannel-js.d.ts +605 -0
- package/types/applicationinsights-offlinechannel-js.namespaced.d.ts +601 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Microsoft Open Source Code of Conduct
|
|
2
|
+
|
|
3
|
+
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
|
|
4
|
+
|
|
5
|
+
Resources:
|
|
6
|
+
|
|
7
|
+
- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/)
|
|
8
|
+
- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
|
|
9
|
+
- Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
This project welcomes contributions and suggestions. Most contributions require you to
|
|
4
|
+
agree to a Contributor License Agreement (CLA) declaring that you have the right to,
|
|
5
|
+
and actually do, grant us the rights to use your contribution. For details, visit
|
|
6
|
+
https://cla.microsoft.com.
|
|
7
|
+
|
|
8
|
+
When you submit a pull request, a CLA-bot will automatically determine whether you need
|
|
9
|
+
to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the
|
|
10
|
+
instructions provided by the bot. You will only need to do this once across all repositories using our CLA.
|
|
11
|
+
|
|
12
|
+
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
|
|
13
|
+
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
|
|
14
|
+
or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
|
package/LICENSE.TXT
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) Microsoft Corporation
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/PRIVACY
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
# Data Collection
|
|
2
|
+
|
|
3
|
+
The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft’s privacy statement. Our privacy statement is located at <https://go.microsoft.com/fwlink/?LinkID=824704>. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices.
|
package/README.md
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Microsoft Application Insights JavaScript SDK - Offline Channel
|
|
2
|
+
|
|
3
|
+
## [Beta]
|
|
4
|
+
|
|
5
|
+
## Description
|
|
6
|
+
|
|
7
|
+
The Offline Channel supports the saving of events when your application is offline and resending those events when the application is online.
|
|
8
|
+
|
|
9
|
+
### Note
|
|
10
|
+
|
|
11
|
+
- A post or sender channel is required for processing online events.
|
|
12
|
+
- Request header details will be stored in local/session storage or IndexedDB based on your configuration.
|
|
13
|
+
- If you are using the default endpoint `https://dc.services.visualstudio.com` for Application Insights, partial success is currently considered as success and events not sent in partial success will be dropped.
|
|
14
|
+
|
|
15
|
+
## Configuration
|
|
16
|
+
|
|
17
|
+
`IOfflineChannelConfiguration`
|
|
18
|
+
|
|
19
|
+
| Name | Type | Default | Description |
|
|
20
|
+
|------|------|---------|-------------|
|
|
21
|
+
| maxStorageSizeInBytes | [Optional]| 5000000 | The max size in bytes that should be used for storing events. |
|
|
22
|
+
| storageKeyPrefix | [Optional] | AIOffline | The storage key prefix that should be used when storing events in persistent storage. |
|
|
23
|
+
| minPersistenceLevel | [Optional] | `EventPersistence.Normal` or 1 | Identifies the minimum level that will be cached in the offline channel. Valid values of this setting are defined by the `EventPersistence` enum, currently Normal (1) and Critical (2) with the default value being Normal (1), which means all events without a persistence level set or with invalid persistence level will be marked as Normal(1) events.|
|
|
24
|
+
| providers | [Optional] | [`eStorageProviders.LocalStorage, eStorageProviders.IndexedDB`]| Identifies the StorageProviders that should be used by the system if available, the first available provider will be used. Valid available values are defined by the `eStorageProviders` enum. </br> Note: LocalStorage will be used to save unload events even if it is not in the providers list. |
|
|
25
|
+
| eventsLimitInMem | [Optional] | null | Identifies the maximum number of events to store in memory before sending to persistent storage. |
|
|
26
|
+
| autoClean | [Optional] | false | Identifies if events that have existed in storage longer than the maximum allowed time (configured in inStorageMaxTime) should be cleaned after connection with storage. |
|
|
27
|
+
| inMemoMaxTime | [Optional] | 15000 | Identifies the maximum time in ms that items should be in memory before being saved into storage. |
|
|
28
|
+
| inStorageMaxTime | [Optional] | 10080000 (around 7days) | Identifies the maximum time in ms that items should be in the configured persistent storage. |
|
|
29
|
+
| maxRetry | [Optional] | 1 | Identifies the maximum retry times for an event batch. |
|
|
30
|
+
| primaryOnlineChannelId | [Optional] | `[AppInsightsChannelPlugin, PostChannel]` | Identifies online channel IDs in order. The first available one will be used. |
|
|
31
|
+
| maxBatchsize | [Optional] | 63000 | Identifies the maximum size per batch in bytes that is saved in persistent storage. |
|
|
32
|
+
| senderCfg | [Optional] | `IOfflineSenderConfig` | Identifies offline sender properties. |
|
|
33
|
+
| maxSentBatchInterval | [Optional] | 15000 | Identifies the interval time in ms that previously stored offline event batches should be sent under online status. |
|
|
34
|
+
| EventsToDropPerTime | [Optional] | 10 | Identifies the maximum event batch count when cleaning or releasing space for persistent storage per time. |
|
|
35
|
+
| maxCriticalEvtsDropCnt | [Optional] | 2 | Identifies the maximum critical events count for an event batch to be able to drop when releasing space for persistent storage per time. |
|
|
36
|
+
| overrideInstrumentationKey | [Optional] | null | Identifies overridden for the Instrumentation key when the offline channel calls `processTelemetry`. |
|
|
37
|
+
|
|
38
|
+
`IOfflineSenderConfig`
|
|
39
|
+
|
|
40
|
+
| Name | Type | Default | Description |
|
|
41
|
+
|------|------|---------|-------------|
|
|
42
|
+
| retryCodes | [Optional] | `[401, 403, 408, 429, 500, 502, 503, 504]` | Identifies status codes for re-sending event batches. |
|
|
43
|
+
| transports | [Optional] | null | Either an array or single value identifying the requested TransportType type(s) that should be used for sending events. If not defined, the same transports will be used in the channel with the `primaryOnlineChannelI`. |
|
|
44
|
+
| httpXHROverride | [Optional] | null | The HTTP override that should be used to send requests, as an `IXHROverride` object. |
|
|
45
|
+
| alwaysUseXhrOverride | [Optional] | false | Identifies if provided httpXhrOverride will always be used. |
|
|
46
|
+
|
|
47
|
+
## Contributing
|
|
48
|
+
|
|
49
|
+
Read our [contributing guide](./CONTRIBUTING.md) to learn about our development process, how to propose bugfixes and improvements, and how to build and test your changes to Application Insights.
|
|
50
|
+
|
|
51
|
+
## Data Collection
|
|
52
|
+
|
|
53
|
+
As this SDK is designed to enable applications to perform data collection which is sent to the Microsoft collection endpoints the following is required to identify our privacy statement.
|
|
54
|
+
|
|
55
|
+
The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft�s privacy statement. Our privacy statement is located at <https://go.microsoft.com/fwlink/?LinkID=824704>. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices.
|
|
56
|
+
|
|
57
|
+
## Trademarks
|
|
58
|
+
|
|
59
|
+
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow [Microsoft�s Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general). Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party�s policies.
|
|
60
|
+
|
|
61
|
+
## License
|
|
62
|
+
|
|
63
|
+
[MIT](./LICENSE.TXT)
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<!-- BEGIN MICROSOFT SECURITY.MD V0.0.7 BLOCK -->
|
|
2
|
+
|
|
3
|
+
# Security
|
|
4
|
+
|
|
5
|
+
Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/).
|
|
6
|
+
|
|
7
|
+
If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below.
|
|
8
|
+
|
|
9
|
+
## Reporting Security Issues
|
|
10
|
+
|
|
11
|
+
**Please do not report security vulnerabilities through public GitHub issues.**
|
|
12
|
+
|
|
13
|
+
Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report).
|
|
14
|
+
|
|
15
|
+
If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey).
|
|
16
|
+
|
|
17
|
+
You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc).
|
|
18
|
+
|
|
19
|
+
Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
|
|
20
|
+
|
|
21
|
+
* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
|
|
22
|
+
* Full paths of source file(s) related to the manifestation of the issue
|
|
23
|
+
* The location of the affected source code (tag/branch/commit or direct URL)
|
|
24
|
+
* Any special configuration required to reproduce the issue
|
|
25
|
+
* Step-by-step instructions to reproduce the issue
|
|
26
|
+
* Proof-of-concept or exploit code (if possible)
|
|
27
|
+
* Impact of the issue, including how an attacker might exploit the issue
|
|
28
|
+
|
|
29
|
+
This information will help us triage your report more quickly.
|
|
30
|
+
|
|
31
|
+
If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs.
|
|
32
|
+
|
|
33
|
+
## Preferred Languages
|
|
34
|
+
|
|
35
|
+
We prefer all communications to be in English.
|
|
36
|
+
|
|
37
|
+
## Policy
|
|
38
|
+
|
|
39
|
+
Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd).
|
|
40
|
+
|
|
41
|
+
<!-- END MICROSOFT SECURITY.MD BLOCK -->
|
package/SUPPORT.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Support
|
|
2
|
+
|
|
3
|
+
## How to file issues and get help
|
|
4
|
+
|
|
5
|
+
This project uses GitHub Issues to track bugs and feature requests. Please search the existing
|
|
6
|
+
issues before filing new issues to avoid duplicates. For new issues, file your bug or
|
|
7
|
+
feature request as a new Issue.
|
|
8
|
+
|
|
9
|
+
For help and questions about using this project, please create a Support request issue on
|
|
10
|
+
<https://github.com/microsoft/ApplicationInsights-JS/issues>.
|
|
11
|
+
|
|
12
|
+
## Microsoft Support Policy
|
|
13
|
+
|
|
14
|
+
Support for this **PROJECT or PRODUCT** is limited to the resources listed above.
|