@crimson-education/browser-logger 5.0.0-beta.2 → 5.0.0-beta.21

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.
@@ -1,33 +0,0 @@
1
- import { PinpointClient, UpdateEndpointCommand } from '@aws-sdk/client-pinpoint';
2
- export async function updatePinpointEndpoint(config, logger, allMetadata) {
3
- try {
4
- if (config.identityPoolId === false)
5
- return;
6
- // // Get credentials from Amplify Auth if available
7
- // let credentials;
8
- // if ((Amplify.Auth as any)?.currentCredentials) {
9
- // credentials = await (Amplify.Auth as any).currentCredentials();
10
- // } else {
11
- // logger.error('No supported method to get AWS credentials from Amplify.Auth');
12
- // return;
13
- // }
14
- const client = new PinpointClient({
15
- region: config.region,
16
- });
17
- const input = {
18
- ApplicationId: config.analyticsAppId,
19
- EndpointId: config.endpointId,
20
- EndpointRequest: {
21
- Attributes: Object.fromEntries(Object.entries(allMetadata)
22
- .filter(([, v]) => v !== null)
23
- .map(([k, v]) => [k, Array.isArray(v) ? v : [v]])),
24
- // Optionally add more fields here (e.g., Demographic, Location, etc.)
25
- },
26
- };
27
- await client.send(new UpdateEndpointCommand(input));
28
- }
29
- catch (err) {
30
- logger.error('Failed to update Pinpoint endpoint', err);
31
- }
32
- }
33
- //# sourceMappingURL=updateEndpoint.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"updateEndpoint.js","sourceRoot":"","sources":["../../src/reporters/updateEndpoint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAGjF,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,MAA6B,EAC7B,MAAW,EACX,WAAqD;IAErD,IAAI,CAAC;QACH,IAAI,MAAM,CAAC,cAAc,KAAK,KAAK;YAAE,OAAO;QAC5C,oDAAoD;QACpD,mBAAmB;QACnB,mDAAmD;QACnD,oEAAoE;QACpE,WAAW;QACX,kFAAkF;QAClF,YAAY;QACZ,IAAI;QAEJ,MAAM,MAAM,GAAG,IAAI,cAAc,CAAC;YAChC,MAAM,EAAE,MAAM,CAAC,MAAM;SACtB,CAAC,CAAC;QACH,MAAM,KAAK,GAAG;YACZ,aAAa,EAAE,MAAM,CAAC,cAAc;YACpC,UAAU,EAAE,MAAM,CAAC,UAAU;YAC7B,eAAe,EAAE;gBACf,UAAU,EAAE,MAAM,CAAC,WAAW,CAC5B,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC;qBACxB,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC;qBAC7B,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAW,CAAC,CAAC,CAAC,CAClC;gBAC7B,sEAAsE;aACvE;SACF,CAAC;QACF,MAAM,MAAM,CAAC,IAAI,CAAC,IAAI,qBAAqB,CAAC,KAAK,CAAC,CAAC,CAAC;IACtD,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,CAAC,KAAK,CAAC,oCAAoC,EAAE,GAAG,CAAC,CAAC;IAC1D,CAAC;AACH,CAAC"}
@@ -1,39 +0,0 @@
1
- import { PinpointClient, UpdateEndpointCommand } from '@aws-sdk/client-pinpoint';
2
- import { AmplifyReporterConfig } from './amplifyReporter';
3
-
4
- export async function updatePinpointEndpoint(
5
- config: AmplifyReporterConfig,
6
- logger: any,
7
- allMetadata: Record<string, string[] | string | null>,
8
- ) {
9
- try {
10
- if (config.identityPoolId === false) return;
11
- // // Get credentials from Amplify Auth if available
12
- // let credentials;
13
- // if ((Amplify.Auth as any)?.currentCredentials) {
14
- // credentials = await (Amplify.Auth as any).currentCredentials();
15
- // } else {
16
- // logger.error('No supported method to get AWS credentials from Amplify.Auth');
17
- // return;
18
- // }
19
-
20
- const client = new PinpointClient({
21
- region: config.region,
22
- });
23
- const input = {
24
- ApplicationId: config.analyticsAppId,
25
- EndpointId: config.endpointId,
26
- EndpointRequest: {
27
- Attributes: Object.fromEntries(
28
- Object.entries(allMetadata)
29
- .filter(([, v]) => v !== null)
30
- .map(([k, v]) => [k, Array.isArray(v) ? v : [v as string]]),
31
- ) as Record<string, string[]>,
32
- // Optionally add more fields here (e.g., Demographic, Location, etc.)
33
- },
34
- };
35
- await client.send(new UpdateEndpointCommand(input));
36
- } catch (err) {
37
- logger.error('Failed to update Pinpoint endpoint', err);
38
- }
39
- }