UNPKG

@aws-amplify/core

Version:
1 lines 1.84 kB
{"version":3,"file":"createGetIdClient.mjs","sources":["../../../../../../src/foundation/factories/serviceClients/cognitoIdentity/createGetIdClient.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { parseJsonBody, parseJsonError, parseMetadata, } from '../../../../clients';\nimport { composeServiceApi } from '../../../../clients/internal';\nimport { getAmplifyUserAgent } from '../../../../Platform';\nimport { DEFAULT_SERVICE_CLIENT_API_CONFIG } from './constants';\nimport { cognitoIdentityTransferHandler } from './handler';\nimport { createClientSerializer } from './serde';\nexport const createGetIdClient = (config) => composeServiceApi(cognitoIdentityTransferHandler, createClientSerializer('GetId'), getIdDeserializer, {\n ...DEFAULT_SERVICE_CLIENT_API_CONFIG,\n ...config,\n userAgentValue: getAmplifyUserAgent(),\n});\nconst getIdDeserializer = async (response) => {\n if (response.statusCode >= 300) {\n const error = await parseJsonError(response);\n throw error;\n }\n const body = await parseJsonBody(response);\n return {\n IdentityId: body.IdentityId,\n $metadata: parseMetadata(response),\n };\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AAOY,MAAC,iBAAiB,GAAG,CAAC,MAAM,KAAK,iBAAiB,CAAC,8BAA8B,EAAE,sBAAsB,CAAC,OAAO,CAAC,EAAE,iBAAiB,EAAE;AACnJ,IAAI,GAAG,iCAAiC;AACxC,IAAI,GAAG,MAAM;AACb,IAAI,cAAc,EAAE,mBAAmB,EAAE;AACzC,CAAC;AACD,MAAM,iBAAiB,GAAG,OAAO,QAAQ,KAAK;AAC9C,IAAI,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,EAAE;AACpC,QAAQ,MAAM,KAAK,GAAG,MAAM,cAAc,CAAC,QAAQ,CAAC;AACpD,QAAQ,MAAM,KAAK;AACnB;AACA,IAAI,MAAM,IAAI,GAAG,MAAM,aAAa,CAAC,QAAQ,CAAC;AAC9C,IAAI,OAAO;AACX,QAAQ,UAAU,EAAE,IAAI,CAAC,UAAU;AACnC,QAAQ,SAAS,EAAE,aAAa,CAAC,QAAQ,CAAC;AAC1C,KAAK;AACL,CAAC;;;;"}