@esri/telemetry-amazon 0.3.2 → 0.4.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/README.md CHANGED
@@ -16,8 +16,8 @@ npm install @esri/telemetry-amazon
16
16
  Below is an example of how to use the telemetry-amazon plugin.
17
17
 
18
18
  ```js
19
- import Telemetry from '@esri/telemetry'
20
- import Amazon from '@esri/telemetry-amazon'
19
+ import Telemetry from '@esri/telemetry';
20
+ import Amazon from '@esri/telemetry-amazon';
21
21
 
22
22
  const amazonTracker = new Amazon({
23
23
  userPoolID: USER_POOL_ID,
@@ -27,7 +27,7 @@ const amazonTracker = new Amazon({
27
27
  id: APP_ID,
28
28
  version: APP_VERSION,
29
29
  },
30
- })
30
+ });
31
31
 
32
32
  const telemetryOptions = {
33
33
  plugins: [amazonTracker],
@@ -35,12 +35,12 @@ const telemetryOptions = {
35
35
  subscriptionInfo: {},
36
36
  user: {},
37
37
  },
38
- }
38
+ };
39
39
 
40
- const telemetry = new Telemetry(telemetryOptions)
40
+ const telemetry = new Telemetry(telemetryOptions);
41
41
 
42
- telemetry.logPageView()
43
- telemetry.logEvent()
42
+ telemetry.logPageView();
43
+ telemetry.logEvent();
44
44
  ```
45
45
 
46
46
  After initializing `Telemetry.js`with the `telemetry-amazon`plugin, telemetry data will be sent to the AWS Pinpoint instance of the provided App.
@@ -68,12 +68,12 @@ Additionally, you can disable individual trackers when initializing the `Telemet
68
68
  Post initialization, it is possible to disable & enable specific trackers using `disableTracker` and `enableTracker` methods.
69
69
 
70
70
  ```js
71
- telemetry.disableTracker('amazon')
72
- telemetry.logPageView() // no amazon page view logged
73
- telemetry.logEvent() // no amazon event logged
74
- telemetry.enableTracker('amazon')
75
- telemetry.logPageView() // amazon page view logged
76
- telemetry.logEvent() // amazon event logged
71
+ telemetry.disableTracker('amazon');
72
+ telemetry.logPageView(); // no amazon page view logged
73
+ telemetry.logEvent(); // no amazon event logged
74
+ telemetry.enableTracker('amazon');
75
+ telemetry.logPageView(); // amazon page view logged
76
+ telemetry.logEvent(); // amazon event logged
77
77
  ```
78
78
 
79
79
  ## Example
@@ -94,7 +94,42 @@ const event = {
94
94
  datasetID: '1ef',
95
95
  attribute: 'crime_type',
96
96
  user: 'amazing_map_woman',
97
+ };
98
+
99
+ telemetry.logEvent(event);
100
+ ```
101
+
102
+ ## Telemetry Sharing Permissions
103
+
104
+ ### Portal Items
105
+
106
+ `telemetry-amazon` contains static methods for setting and getting telemetry access for portal items.
107
+
108
+ ### Usage
109
+
110
+ ```js
111
+ import Amazon from '@esri/telemetry-amazon'
112
+
113
+ ...
114
+
115
+ const getAccessParams = {
116
+ id: '1ef',
117
+ authentication: PortalUserSession,
118
+ }
119
+
120
+ const access = await Amazon.getAccessPermissions(getAccessParams: IGetAccessPermissionsParams)
121
+
122
+ const setAccessParams = {
123
+ id: '1ef',
124
+ authentication: PortalUserSession,
125
+ username: 'dev_pre_a_hub_admin',
126
+ accessChangeset: [
127
+ {
128
+ action: 'add',
129
+ targetProperty: 'public',
130
+ }
131
+ ]
97
132
  }
98
133
 
99
- telemetry.logEvent(event)
134
+ const result = await Amazon.setAccessPermissions(setAccessParams: ISetAccessPermissionsParams)
100
135
  ```