{"version":3,"file":"identifyUser.native.mjs","sources":["../../../../../../src/pushNotifications/providers/pinpoint/apis/identifyUser.native.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { PushNotificationAction } from '@aws-amplify/core/internals/utils';\nimport { getEndpointId, updateEndpoint, } from '@aws-amplify/core/internals/providers/pinpoint';\nimport { assertIsInitialized } from '../../../errors/errorHelpers';\nimport { getPushNotificationUserAgentString, resolveCredentials, } from '../../../utils';\nimport { getChannelType, getInflightDeviceRegistration, resolveConfig, } from '../utils';\nexport const identifyUser = async ({ userId, userProfile, options, }) => {\n    assertIsInitialized();\n    const { credentials, identityId } = await resolveCredentials();\n    const { appId, region } = resolveConfig();\n    const { address, optOut, userAttributes } = options ?? {};\n    if (!(await getEndpointId(appId, 'PushNotification'))) {\n        // if there is no cached endpoint id, wait for successful endpoint creation before continuing\n        await getInflightDeviceRegistration();\n    }\n    await updateEndpoint({\n        address,\n        channelType: getChannelType(),\n        optOut,\n        appId,\n        category: 'PushNotification',\n        credentials,\n        identityId,\n        region,\n        userAttributes,\n        userId,\n        userProfile,\n        userAgentValue: getPushNotificationUserAgentString(PushNotificationAction.IdentifyUser),\n    });\n};\n"],"names":[],"mappings":";;;;;;;;;;AAAA;AACA;AAMY,MAAC,YAAY,GAAG,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,GAAG,KAAK;AACzE,IAAI,mBAAmB,EAAE;AACzB,IAAI,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,MAAM,kBAAkB,EAAE;AAClE,IAAI,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,aAAa,EAAE;AAC7C,IAAI,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,GAAG,OAAO,IAAI,EAAE;AAC7D,IAAI,IAAI,EAAE,MAAM,aAAa,CAAC,KAAK,EAAE,kBAAkB,CAAC,CAAC,EAAE;AAC3D;AACA,QAAQ,MAAM,6BAA6B,EAAE;AAC7C,IAAI;AACJ,IAAI,MAAM,cAAc,CAAC;AACzB,QAAQ,OAAO;AACf,QAAQ,WAAW,EAAE,cAAc,EAAE;AACrC,QAAQ,MAAM;AACd,QAAQ,KAAK;AACb,QAAQ,QAAQ,EAAE,kBAAkB;AACpC,QAAQ,WAAW;AACnB,QAAQ,UAAU;AAClB,QAAQ,MAAM;AACd,QAAQ,cAAc;AACtB,QAAQ,MAAM;AACd,QAAQ,WAAW;AACnB,QAAQ,cAAc,EAAE,kCAAkC,CAAC,sBAAsB,CAAC,YAAY,CAAC;AAC/F,KAAK,CAAC;AACN;;;;"}