mito-ai 0.1.39__py3-none-any.whl → 0.1.41__py3-none-any.whl
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.
Potentially problematic release.
This version of mito-ai might be problematic. Click here for more details.
- mito_ai/__init__.py +12 -6
- mito_ai/_version.py +1 -1
- mito_ai/app_builder/handlers.py +1 -2
- mito_ai/completions/handlers.py +1 -1
- mito_ai/completions/message_history.py +9 -1
- mito_ai/completions/models.py +1 -1
- mito_ai/completions/prompt_builders/agent_execution_prompt.py +2 -0
- mito_ai/completions/prompt_builders/agent_smart_debug_prompt.py +8 -0
- mito_ai/completions/prompt_builders/agent_system_message.py +17 -0
- mito_ai/constants.py +3 -2
- mito_ai/file_uploads/__init__.py +3 -0
- mito_ai/file_uploads/handlers.py +225 -0
- mito_ai/file_uploads/urls.py +21 -0
- mito_ai/openai_client.py +1 -1
- mito_ai/tests/file_uploads/__init__.py +2 -0
- mito_ai/tests/file_uploads/test_handlers.py +267 -0
- mito_ai/tests/message_history/test_message_history_utils.py +57 -4
- mito_ai/utils/mito_server_utils.py +7 -0
- mito_ai/utils/server_limits.py +1 -1
- mito_ai/utils/telemetry_utils.py +26 -9
- {mito_ai-0.1.39.data → mito_ai-0.1.41.data}/data/share/jupyter/labextensions/mito_ai/build_log.json +102 -100
- {mito_ai-0.1.39.data → mito_ai-0.1.41.data}/data/share/jupyter/labextensions/mito_ai/package.json +4 -2
- {mito_ai-0.1.39.data → mito_ai-0.1.41.data}/data/share/jupyter/labextensions/mito_ai/schemas/mito_ai/package.json.orig +3 -1
- mito_ai-0.1.39.data/data/share/jupyter/labextensions/mito_ai/static/lib_index_js.16b532b655cd2906e04a.js → mito_ai-0.1.41.data/data/share/jupyter/labextensions/mito_ai/static/lib_index_js.01a962c68c8fae380f30.js +1782 -891
- mito_ai-0.1.41.data/data/share/jupyter/labextensions/mito_ai/static/lib_index_js.01a962c68c8fae380f30.js.map +1 -0
- mito_ai-0.1.41.data/data/share/jupyter/labextensions/mito_ai/static/node_modules_aws-amplify_core_dist_esm_singleton_apis_fetchAuthSession_mjs.182232e7bc6311fe4528.js +63 -0
- mito_ai-0.1.41.data/data/share/jupyter/labextensions/mito_ai/static/node_modules_aws-amplify_core_dist_esm_singleton_apis_fetchAuthSession_mjs.182232e7bc6311fe4528.js.map +1 -0
- mito_ai-0.1.39.data/data/share/jupyter/labextensions/mito_ai/static/remoteEntry.606207904e6aaa42b1bf.js → mito_ai-0.1.41.data/data/share/jupyter/labextensions/mito_ai/static/remoteEntry.9a70f033717ba8689564.js +49 -25
- mito_ai-0.1.41.data/data/share/jupyter/labextensions/mito_ai/static/remoteEntry.9a70f033717ba8689564.js.map +1 -0
- mito_ai-0.1.41.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_auth_dist_esm_providers_cognito_tokenProvider_tokenProvider_mjs.16430abf3466c3153f59.js +4574 -0
- mito_ai-0.1.41.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_auth_dist_esm_providers_cognito_tokenProvider_tokenProvider_mjs.16430abf3466c3153f59.js.map +1 -0
- mito_ai-0.1.41.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_core_dist_esm_singleton_Amplify_mjs.3c0035b95fe369aede82.js +2345 -0
- mito_ai-0.1.41.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_core_dist_esm_singleton_Amplify_mjs.3c0035b95fe369aede82.js.map +1 -0
- mito_ai-0.1.41.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_core_dist_esm_singleton_apis_fetchAuthSession_mjs-node_modul-758875.dc495fd682071d97070c.js +7498 -0
- mito_ai-0.1.41.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_core_dist_esm_singleton_apis_fetchAuthSession_mjs-node_modul-758875.dc495fd682071d97070c.js.map +1 -0
- mito_ai-0.1.41.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_dist_esm_index_mjs.6bac1a8c4cc93f15f6b7.js +1021 -0
- mito_ai-0.1.41.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_dist_esm_index_mjs.6bac1a8c4cc93f15f6b7.js.map +1 -0
- mito_ai-0.1.41.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_ui-react_dist_esm_index_mjs.61289bff0db44828605b.js +60178 -0
- mito_ai-0.1.41.data/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_aws-amplify_ui-react_dist_esm_index_mjs.61289bff0db44828605b.js.map +1 -0
- {mito_ai-0.1.39.dist-info → mito_ai-0.1.41.dist-info}/METADATA +1 -1
- {mito_ai-0.1.39.dist-info → mito_ai-0.1.41.dist-info}/RECORD +53 -36
- mito_ai-0.1.39.data/data/share/jupyter/labextensions/mito_ai/static/lib_index_js.16b532b655cd2906e04a.js.map +0 -1
- mito_ai-0.1.39.data/data/share/jupyter/labextensions/mito_ai/static/remoteEntry.606207904e6aaa42b1bf.js.map +0 -1
- {mito_ai-0.1.39.data → mito_ai-0.1.41.data}/data/etc/jupyter/jupyter_server_config.d/mito_ai.json +0 -0
- {mito_ai-0.1.39.data → mito_ai-0.1.41.data}/data/share/jupyter/labextensions/mito_ai/schemas/mito_ai/toolbar-buttons.json +0 -0
- {mito_ai-0.1.39.data → mito_ai-0.1.41.data}/data/share/jupyter/labextensions/mito_ai/static/style.js +0 -0
- {mito_ai-0.1.39.data → mito_ai-0.1.41.data}/data/share/jupyter/labextensions/mito_ai/static/style_index_js.5876024bb17dbd6a3ee6.js +0 -0
- {mito_ai-0.1.39.data → mito_ai-0.1.41.data}/data/share/jupyter/labextensions/mito_ai/static/style_index_js.5876024bb17dbd6a3ee6.js.map +0 -0
- {mito_ai-0.1.39.data → mito_ai-0.1.41.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_semver_index_js.9795f79265ddb416864b.js +0 -0
- {mito_ai-0.1.39.data → mito_ai-0.1.41.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_semver_index_js.9795f79265ddb416864b.js.map +0 -0
- {mito_ai-0.1.39.data → mito_ai-0.1.41.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_vscode-diff_dist_index_js.ea55f1f9346638aafbcf.js +0 -0
- {mito_ai-0.1.39.data → mito_ai-0.1.41.data}/data/share/jupyter/labextensions/mito_ai/static/vendors-node_modules_vscode-diff_dist_index_js.ea55f1f9346638aafbcf.js.map +0 -0
- {mito_ai-0.1.39.dist-info → mito_ai-0.1.41.dist-info}/WHEEL +0 -0
- {mito_ai-0.1.39.dist-info → mito_ai-0.1.41.dist-info}/entry_points.txt +0 -0
- {mito_ai-0.1.39.dist-info → mito_ai-0.1.41.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vendors-node_modules_aws-amplify_dist_esm_index_mjs.6bac1a8c4cc93f15f6b7.js","mappings":";;;;;;;;;;;;;;;;;;;AAAsD;AACI;AACwB;AACU;AACjD;AACW;AACiE;AAC3E;;AAE5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC;AAChC;AACA,2CAA2C,sCAAsC;AACjF,oCAAoC,qBAAqB;AACzD;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,yDAAa;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,mBAAmB,kGAA2B;AAC9C,kBAAkB,oEAAiB;AACnC,0BAA0B,mIAAyC;AACnE;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,QAAQ,wFAAkB;AAC1B,kBAAkB,4DAAS;AAC3B;AACA;AACA,kBAAkB,4DAAS;AAC3B;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEqC;AACrC;;;;;;;;;;;;;;;;;;;ACzEkD;AAC6B;AACV;AACjB;;AAEpD;AACA;AACA,mBAAmB,4DAAa;AAChC;AACA;AACA,QAAQ,6FAA0B;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,6FAA0B;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,6FAA0B;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,iFAAkB,CAAC,6DAAqB,iBAAiB,SAAS;AAC7E;;AAEkC;AAClC;;;;;;;;;;;;;;;;;;;;;;;;;ACxEyF;AACV;AACrB;AACwB;AACU;AAC7B;AACT;AACiE;AAClD;AACzB;;AAE5C;AACA;AACA,mBAAmB,4DAAa;AAChC,wCAAwC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,SAAS;AACzB,gBAAgB,aAAa;AAC7B;AACA,YAAY,6FAA0B;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,eAAe;AAC/B;AACA,iCAAiC,kFAAyB;AAC1D;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,2EAAyB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,kGAA2B;AAClD,0CAA0C,wFAAqC;AAC/E,8BAA8B,mIAAyC;AACvE;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,6DAA6D,QAAQ;AACrE;AACA,aAAa;AACb;AACA;AACA,YAAY,wFAAkB;AAC9B,sBAAsB,4DAAS;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,4DAAS;AAC/B;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,yDAAa;AAC3B;AACA,uBAAuB,kGAA2B;AAClD,0CAA0C,wFAAqC;AAC/E,8BAA8B,mIAAyC;AACvE;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA,6DAA6D,QAAQ;AACrE;AACA;AACA,aAAa;AACb;AACA;AACA,YAAY,wFAAkB;AAC9B,sBAAsB,4DAAS;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,4DAAS;AAC/B;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEsD;AACtD;;;;;;;;;;;;;;;;;;;;AC3MmD;AACY;AACwB;;AAEvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,yCAAyC,GAAG;AAC5E;AACA;AACA,uCAAuC,gGAA0C,KAAK,wEAAsB,CAAC,6DAAc;;AAEjB;AAC1G;;;;;;;;;;;;;;;AClBA;AACA;AACA;AACA;AACA;;AAEiC;AACjC;;;;;;;;;;;;;;;;;ACP8D;AACJ;;AAE1D;AACA;AACA;AACA,mBAAmB,4EAAS;AAC5B;AACA;AACA,kBAAkB,4DAAS;AAC3B;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;AAEyB;AACzB;;;;;;;;;;;;;;;;;ACpBwE;AACT;;AAE/D;AACA;AACA,qDAAqD,kBAAkB;AACvE;AACA,iBAAiB,SAAS,yEAAU;AACpC;AACA,WAAW,sFAAmC;AAC9C;;AAEqD;AACrD;;;;;;;;;;;;;;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEwC;AACxC;;;;;;;;;;;;;;;;;;;;ACX8E;AACxC;AACO;AACc;AAChB;AACF;AAC3B;AACsD;AACT;AAC5B;AACI;AACK;AACA;AACgB;AACL;AAChB;AACkB;AACW;;AAEhE;AACA;AACA,+CAA+C,SAAS;AACxD,aAAa,mEAAU,YAAY,yEAA6B,CAAC,GAAG,OAAO,GAAG,iFAAY,SAAS;AACnG,CAAC;;AAE8C;AAC/C;;;;;;;;;;;;;;;;;;;;;AC1BsC;AACO;AAC8C;AACI;AACpC;AAChB;AACF;AAC3B;AAC6C;AAC5B;AACI;AACK;AACA;AACgB;AACL;AAChB;AACkB;AACe;;AAEpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,kGAAe,CAAC,mEAAc;AAChD,kBAAkB,0FAAe;AACjC;AACA;;AAE4E;AAC5E;;;;;;;;;;;;;;;;;;;;;;;;ACjCsC;AACO;AACc;AAChB;AACF;AAC3B;AAC6C;AAC5B;AACI;AACkC;AAC7B;AACgB;AACL;AAChB;AACkB;AACsB;AACQ;AACI;AACnB;AAC0B;AAClB;;AAE5E;AACA;AACA,0DAA0D,0FAAiB,CAAC,uGAA8B,EAAE,yFAAsB;AAClI,OAAO,6EAAiC;AACxC;AACA,oBAAoB,wEAAmB;AACvC,CAAC;AACD;AACA;AACA,4BAA4B,uEAAc;AAC1C;AACA;AACA,uBAAuB,sEAAa;AACpC;AACA;AACA;AACA,mBAAmB,8EAAa;AAChC;AACA;AACA,kCAAkC,sBAAsB,IAAI;AAC5D;AACA;AACA,CAAC;;AAEgD;AACjD;;;;;;;;;;;;;;;;;;;;;;;;AC/CsC;AACO;AACc;AAChB;AACF;AAC3B;AAC6C;AAC5B;AACI;AACkC;AAC7B;AACgB;AACL;AAChB;AACkB;AACsB;AACQ;AACI;AACnB;AAC0B;AAClB;;AAE5E;AACA;AACA,sCAAsC,0FAAiB,CAAC,uGAA8B,EAAE,yFAAsB;AAC9G,OAAO,6EAAiC;AACxC;AACA,oBAAoB,wEAAmB;AACvC,CAAC;AACD;AACA;AACA,4BAA4B,uEAAc;AAC1C;AACA;AACA,uBAAuB,sEAAa;AACpC;AACA;AACA,mBAAmB,8EAAa;AAChC;AACA;;AAE6B;AAC7B;;;;;;;;;;;;;;;;;;;;AC1CyC;AACO;AACiD;AACnC;AAChB;AACF;AAC9B;AACgD;AAC/B;AACI;AACQ;AACA;AACgB;AACL;AAChB;AACkB;AAC4C;AACA;;AAEpG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,oGAAsB,CAAC,6FAAsB,GAAG,sGAA4B;;AAEzE;AAC1C;;;;;;;;;;;;;;;;AC9BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,UAAU;AAC3D,CAAC;AACD,+BAA+B,KAAK;AACpC;AACA;AACA;AACA;AACA,CAAC;;AAEsD;AACvD;;;;;;;;;;;;;;;;ACnBgE;AAChE;;;;;;;;;;;;;;;;;;;;;;;ACD2E;AACJ;AACmG;;AAE1K;AACA;AACA;AACA;AACA,oCAAoC,sBAAsB,KAAK,qBAAqB;AACpF;AACA,kCAAkC,uBAAuB;AACzD;AACA,kCAAkC,sBAAsB;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,qFAAkB;AACzD,+CAA+C,4DAAa,GAAG,iBAAiB;AAChF;AACA;AACA,cAAc,6DAAc;AAC5B;AACA,kBAAkB,iGAA0C,KAAK,6EAAsB;AACvF,cAAc,iFAA0B;AACxC;AACA;AACA;AACA,YAAY,sDAAO;AACnB;AACA;AACA;AACA;AACA;AACA,YAAY,sDAAO;AACnB;AACA;AACA;AACA,aAAa,sDAAO;AACpB,YAAY,oFAA6B;AACzC,YAAY,oFAA6B;AACzC;AACA;AACA,YAAY,sDAAO;AACnB;AACA;AACA,mCAAmC,oFAA6B;AAChE;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,uCAAuC,sDAAO;AAC9C;AACA;AACA,gBAAgB,oFAA6B;AAC7C;AACA;AACA;AACA;AACA,YAAY,sDAAO;AACnB;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,QAAQ,sDAAO;AACf,KAAK;AACL;AACA,oBAAoB,uBAAuB;AAC3C;AACA;AACA,oBAAoB,uBAAuB;AAC3C;AACA;AACA,eAAe,sDAAO;AACtB,KAAK;AACL;;AAE0B;AAC1B","sources":["webpack://mito_ai/./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/credentialsProvider/IdentityIdProvider.mjs","webpack://mito_ai/./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/credentialsProvider/IdentityIdStore.mjs","webpack://mito_ai/./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/credentialsProvider/credentialsProvider.mjs","webpack://mito_ai/./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/credentialsProvider/index.mjs","webpack://mito_ai/./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/credentialsProvider/types.mjs","webpack://mito_ai/./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/credentialsProvider/utils.mjs","webpack://mito_ai/./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/factories/createCognitoIdentityPoolEndpointResolver.mjs","webpack://mito_ai/./node_modules/@aws-amplify/core/dist/esm/foundation/factories/middleware/createDisableCacheMiddleware.mjs","webpack://mito_ai/./node_modules/@aws-amplify/core/dist/esm/foundation/factories/serviceClients/cognitoIdentity/cognitoIdentityPoolEndpointResolver.mjs","webpack://mito_ai/./node_modules/@aws-amplify/core/dist/esm/foundation/factories/serviceClients/cognitoIdentity/constants.mjs","webpack://mito_ai/./node_modules/@aws-amplify/core/dist/esm/foundation/factories/serviceClients/cognitoIdentity/createGetCredentialsForIdentityClient.mjs","webpack://mito_ai/./node_modules/@aws-amplify/core/dist/esm/foundation/factories/serviceClients/cognitoIdentity/createGetIdClient.mjs","webpack://mito_ai/./node_modules/@aws-amplify/core/dist/esm/foundation/factories/serviceClients/cognitoIdentity/handler/cognitoIdentityTransferHandler.mjs","webpack://mito_ai/./node_modules/@aws-amplify/core/dist/esm/foundation/factories/serviceClients/cognitoIdentity/serde/createClientSerializer.mjs","webpack://mito_ai/./node_modules/aws-amplify/dist/esm/index.mjs","webpack://mito_ai/./node_modules/aws-amplify/dist/esm/initSingleton.mjs"],"sourcesContent":["import { createGetIdClient } from '@aws-amplify/core';\nimport { AuthError } from '../../../errors/AuthError.mjs';\nimport { assertServiceError } from '../../../errors/utils/assertServiceError.mjs';\nimport { getRegionFromIdentityPoolId } from '../../../foundation/parsers/regionParsers.mjs';\nimport '@aws-amplify/core/internals/utils';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport { createCognitoIdentityPoolEndpointResolver } from '../factories/createCognitoIdentityPoolEndpointResolver.mjs';\nimport { formLoginsMap } from './utils.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Provides a Cognito identityId\n *\n * @param tokens - The AuthTokens received after SignIn\n * @returns string\n * @throws configuration exceptions: `InvalidIdentityPoolIdException`\n * - Auth errors that may arise from misconfiguration.\n * @throws service exceptions: {@link GetIdException }\n */\nasync function cognitoIdentityIdProvider({ tokens, authConfig, identityIdStore, }) {\n identityIdStore.setAuthConfig({ Cognito: authConfig });\n // will return null only if there is no identityId cached or if there is an error retrieving it\n const identityId = await identityIdStore.loadIdentityId();\n if (identityId) {\n return identityId.id;\n }\n const logins = tokens?.idToken\n ? formLoginsMap(tokens.idToken.toString())\n : {};\n const generatedIdentityId = await generateIdentityId(logins, authConfig);\n // Store generated identityId\n identityIdStore.storeIdentityId({\n id: generatedIdentityId,\n type: tokens ? 'primary' : 'guest',\n });\n return generatedIdentityId;\n}\nasync function generateIdentityId(logins, authConfig) {\n const identityPoolId = authConfig?.identityPoolId;\n const region = getRegionFromIdentityPoolId(identityPoolId);\n const getId = createGetIdClient({\n endpointResolver: createCognitoIdentityPoolEndpointResolver({\n endpointOverride: authConfig.identityPoolEndpoint,\n }),\n });\n // IdentityId is absent so get it using IdentityPoolId with Cognito's GetId API\n let idResult;\n // for a first-time user, this will return a brand new identity\n // for a returning user, this will retrieve the previous identity assocaited with the logins\n try {\n idResult = (await getId({\n region,\n }, {\n IdentityPoolId: identityPoolId,\n Logins: logins,\n })).IdentityId;\n }\n catch (e) {\n assertServiceError(e);\n throw new AuthError(e);\n }\n if (!idResult) {\n throw new AuthError({\n name: 'GetIdResponseException',\n message: 'Received undefined response from getId operation',\n recoverySuggestion: 'Make sure to pass a valid identityPoolId in the configuration.',\n });\n }\n return idResult;\n}\n\nexport { cognitoIdentityIdProvider };\n//# sourceMappingURL=IdentityIdProvider.mjs.map\n","import { ConsoleLogger } from '@aws-amplify/core';\nimport { assertIdentityPoolIdConfig } from '@aws-amplify/core/internals/utils';\nimport { getAuthStorageKeys } from '../tokenProvider/TokenStore.mjs';\nimport { IdentityIdStorageKeys } from './types.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst logger = new ConsoleLogger('DefaultIdentityIdStore');\nclass DefaultIdentityIdStore {\n setAuthConfig(authConfigParam) {\n assertIdentityPoolIdConfig(authConfigParam.Cognito);\n this.authConfig = authConfigParam;\n this._authKeys = createKeysForAuthStorage('Cognito', authConfigParam.Cognito.identityPoolId);\n }\n constructor(keyValueStorage) {\n this._authKeys = {};\n this._hasGuestIdentityId = false;\n this.keyValueStorage = keyValueStorage;\n }\n async loadIdentityId() {\n assertIdentityPoolIdConfig(this.authConfig?.Cognito);\n try {\n if (this._primaryIdentityId) {\n return {\n id: this._primaryIdentityId,\n type: 'primary',\n };\n }\n else {\n const storedIdentityId = await this.keyValueStorage.getItem(this._authKeys.identityId);\n if (storedIdentityId) {\n this._hasGuestIdentityId = true;\n return {\n id: storedIdentityId,\n type: 'guest',\n };\n }\n return null;\n }\n }\n catch (err) {\n logger.log('Error getting stored IdentityId.', err);\n return null;\n }\n }\n async storeIdentityId(identity) {\n assertIdentityPoolIdConfig(this.authConfig?.Cognito);\n if (identity.type === 'guest') {\n this.keyValueStorage.setItem(this._authKeys.identityId, identity.id);\n // Clear in-memory storage of primary identityId\n this._primaryIdentityId = undefined;\n this._hasGuestIdentityId = true;\n }\n else {\n this._primaryIdentityId = identity.id;\n // Clear locally stored guest id\n if (this._hasGuestIdentityId) {\n this.keyValueStorage.removeItem(this._authKeys.identityId);\n this._hasGuestIdentityId = false;\n }\n }\n }\n async clearIdentityId() {\n this._primaryIdentityId = undefined;\n await this.keyValueStorage.removeItem(this._authKeys.identityId);\n }\n}\nconst createKeysForAuthStorage = (provider, identifier) => {\n return getAuthStorageKeys(IdentityIdStorageKeys)(`com.amplify.${provider}`, identifier);\n};\n\nexport { DefaultIdentityIdStore };\n//# sourceMappingURL=IdentityIdStore.mjs.map\n","import { ConsoleLogger, createGetCredentialsForIdentityClient } from '@aws-amplify/core';\nimport { assertIdentityPoolIdConfig } from '@aws-amplify/core/internals/utils';\nimport { AuthError } from '../../../errors/AuthError.mjs';\nimport { assertServiceError } from '../../../errors/utils/assertServiceError.mjs';\nimport { getRegionFromIdentityPoolId } from '../../../foundation/parsers/regionParsers.mjs';\nimport { assertIdTokenInAuthTokens } from '../utils/types.mjs';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport { createCognitoIdentityPoolEndpointResolver } from '../factories/createCognitoIdentityPoolEndpointResolver.mjs';\nimport { cognitoIdentityIdProvider } from './IdentityIdProvider.mjs';\nimport { formLoginsMap } from './utils.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst logger = new ConsoleLogger('CognitoCredentialsProvider');\nconst CREDENTIALS_TTL = 50 * 60 * 1000; // 50 min, can be modified on config if required in the future\nclass CognitoAWSCredentialsAndIdentityIdProvider {\n constructor(identityIdStore) {\n this._nextCredentialsRefresh = 0;\n this._identityIdStore = identityIdStore;\n }\n async clearCredentialsAndIdentityId() {\n logger.debug('Clearing out credentials and identityId');\n this._credentialsAndIdentityId = undefined;\n await this._identityIdStore.clearIdentityId();\n }\n async clearCredentials() {\n logger.debug('Clearing out in-memory credentials');\n this._credentialsAndIdentityId = undefined;\n }\n async getCredentialsAndIdentityId(getCredentialsOptions) {\n const isAuthenticated = getCredentialsOptions.authenticated;\n const { tokens } = getCredentialsOptions;\n const { authConfig } = getCredentialsOptions;\n try {\n assertIdentityPoolIdConfig(authConfig?.Cognito);\n }\n catch {\n // No identity pool configured, skipping\n return;\n }\n if (!isAuthenticated && !authConfig.Cognito.allowGuestAccess) {\n // TODO(V6): return partial result like Native platforms\n return;\n }\n const { forceRefresh } = getCredentialsOptions;\n const tokenHasChanged = this.hasTokenChanged(tokens);\n const identityId = await cognitoIdentityIdProvider({\n tokens,\n authConfig: authConfig.Cognito,\n identityIdStore: this._identityIdStore,\n });\n // Clear cached credentials when forceRefresh is true OR the cache token has changed\n if (forceRefresh || tokenHasChanged) {\n this.clearCredentials();\n }\n if (!isAuthenticated) {\n return this.getGuestCredentials(identityId, authConfig.Cognito);\n }\n else {\n assertIdTokenInAuthTokens(tokens);\n return this.credsForOIDCTokens(authConfig.Cognito, tokens, identityId);\n }\n }\n async getGuestCredentials(identityId, authConfig) {\n // Return existing in-memory cached credentials only if it exists, is not past it's lifetime and is unauthenticated credentials\n if (this._credentialsAndIdentityId &&\n !this.isPastTTL() &&\n this._credentialsAndIdentityId.isAuthenticatedCreds === false) {\n logger.info('returning stored credentials as they neither past TTL nor expired.');\n return this._credentialsAndIdentityId;\n }\n // Clear to discard if any authenticated credentials are set and start with a clean slate\n this.clearCredentials();\n const region = getRegionFromIdentityPoolId(authConfig.identityPoolId);\n const getCredentialsForIdentity = createGetCredentialsForIdentityClient({\n endpointResolver: createCognitoIdentityPoolEndpointResolver({\n endpointOverride: authConfig.identityPoolEndpoint,\n }),\n });\n // use identityId to obtain guest credentials\n // save credentials in-memory\n // No logins params should be passed for guest creds:\n // https://docs.aws.amazon.com/cognitoidentity/latest/APIReference/API_GetCredentialsForIdentity.html\n let clientResult;\n try {\n clientResult = await getCredentialsForIdentity({ region }, {\n IdentityId: identityId,\n });\n }\n catch (e) {\n assertServiceError(e);\n throw new AuthError(e);\n }\n if (clientResult?.Credentials?.AccessKeyId &&\n clientResult?.Credentials?.SecretKey) {\n this._nextCredentialsRefresh = new Date().getTime() + CREDENTIALS_TTL;\n const res = {\n credentials: {\n accessKeyId: clientResult.Credentials.AccessKeyId,\n secretAccessKey: clientResult.Credentials.SecretKey,\n sessionToken: clientResult.Credentials.SessionToken,\n expiration: clientResult.Credentials.Expiration,\n },\n identityId,\n };\n if (clientResult.IdentityId) {\n res.identityId = clientResult.IdentityId;\n this._identityIdStore.storeIdentityId({\n id: clientResult.IdentityId,\n type: 'guest',\n });\n }\n this._credentialsAndIdentityId = {\n ...res,\n isAuthenticatedCreds: false,\n };\n return res;\n }\n else {\n throw new AuthError({\n name: 'CredentialsNotFoundException',\n message: `Cognito did not respond with either Credentials, AccessKeyId or SecretKey.`,\n });\n }\n }\n async credsForOIDCTokens(authConfig, authTokens, identityId) {\n if (this._credentialsAndIdentityId &&\n !this.isPastTTL() &&\n this._credentialsAndIdentityId.isAuthenticatedCreds === true) {\n logger.debug('returning stored credentials as they neither past TTL nor expired.');\n return this._credentialsAndIdentityId;\n }\n // Clear to discard if any unauthenticated credentials are set and start with a clean slate\n this.clearCredentials();\n const logins = authTokens.idToken\n ? formLoginsMap(authTokens.idToken.toString())\n : {};\n const region = getRegionFromIdentityPoolId(authConfig.identityPoolId);\n const getCredentialsForIdentity = createGetCredentialsForIdentityClient({\n endpointResolver: createCognitoIdentityPoolEndpointResolver({\n endpointOverride: authConfig.identityPoolEndpoint,\n }),\n });\n let clientResult;\n try {\n clientResult = await getCredentialsForIdentity({ region }, {\n IdentityId: identityId,\n Logins: logins,\n });\n }\n catch (e) {\n assertServiceError(e);\n throw new AuthError(e);\n }\n if (clientResult?.Credentials?.AccessKeyId &&\n clientResult?.Credentials?.SecretKey) {\n this._nextCredentialsRefresh = new Date().getTime() + CREDENTIALS_TTL;\n const res = {\n credentials: {\n accessKeyId: clientResult.Credentials.AccessKeyId,\n secretAccessKey: clientResult.Credentials.SecretKey,\n sessionToken: clientResult.Credentials.SessionToken,\n expiration: clientResult.Credentials.Expiration,\n },\n identityId,\n };\n if (clientResult.IdentityId) {\n res.identityId = clientResult.IdentityId;\n // note: the following call removes guest identityId from the persistent store (localStorage)\n this._identityIdStore.storeIdentityId({\n id: clientResult.IdentityId,\n type: 'primary',\n });\n }\n // Store the credentials in-memory along with the expiration\n this._credentialsAndIdentityId = {\n ...res,\n isAuthenticatedCreds: true,\n associatedIdToken: authTokens.idToken?.toString(),\n };\n return res;\n }\n else {\n throw new AuthError({\n name: 'CredentialsException',\n message: `Cognito did not respond with either Credentials, AccessKeyId or SecretKey.`,\n });\n }\n }\n isPastTTL() {\n return this._nextCredentialsRefresh === undefined\n ? true\n : this._nextCredentialsRefresh <= Date.now();\n }\n hasTokenChanged(tokens) {\n return (!!tokens &&\n !!this._credentialsAndIdentityId?.associatedIdToken &&\n tokens.idToken?.toString() !==\n this._credentialsAndIdentityId.associatedIdToken);\n }\n}\n\nexport { CognitoAWSCredentialsAndIdentityIdProvider };\n//# sourceMappingURL=credentialsProvider.mjs.map\n","import { defaultStorage } from '@aws-amplify/core';\nimport { DefaultIdentityIdStore } from './IdentityIdStore.mjs';\nimport { CognitoAWSCredentialsAndIdentityIdProvider } from './credentialsProvider.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Cognito specific implmentation of the CredentialsProvider interface\n * that manages setting and getting of AWS Credentials.\n *\n * @throws configuration expections: `InvalidIdentityPoolIdException`\n * - Auth errors that may arise from misconfiguration.\n * @throws service expections: {@link GetCredentialsForIdentityException}, {@link GetIdException}\n *\n */\nconst cognitoCredentialsProvider = new CognitoAWSCredentialsAndIdentityIdProvider(new DefaultIdentityIdStore(defaultStorage));\n\nexport { CognitoAWSCredentialsAndIdentityIdProvider, DefaultIdentityIdStore, cognitoCredentialsProvider };\n//# sourceMappingURL=index.mjs.map\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst IdentityIdStorageKeys = {\n identityId: 'identityId',\n};\n\nexport { IdentityIdStorageKeys };\n//# sourceMappingURL=types.mjs.map\n","import { decodeJWT } from '@aws-amplify/core/internals/utils';\nimport { AuthError } from '../../../errors/AuthError.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nfunction formLoginsMap(idToken) {\n const issuer = decodeJWT(idToken).payload.iss;\n const res = {};\n if (!issuer) {\n throw new AuthError({\n name: 'InvalidIdTokenException',\n message: 'Invalid Idtoken.',\n });\n }\n const domainName = issuer.replace(/(^\\w+:|^)\\/\\//, '');\n res[domainName] = idToken;\n return res;\n}\n\nexport { formLoginsMap };\n//# sourceMappingURL=utils.mjs.map\n","import { cognitoIdentityPoolEndpointResolver } from '@aws-amplify/core';\nimport { AmplifyUrl } from '@aws-amplify/core/internals/utils';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst createCognitoIdentityPoolEndpointResolver = ({ endpointOverride }) => (input) => {\n if (endpointOverride) {\n return { url: new AmplifyUrl(endpointOverride) };\n }\n return cognitoIdentityPoolEndpointResolver(input);\n};\n\nexport { createCognitoIdentityPoolEndpointResolver };\n//# sourceMappingURL=createCognitoIdentityPoolEndpointResolver.mjs.map\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * A Cognito Identity-specific middleware that disables caching for all requests.\n */\nconst createDisableCacheMiddleware = () => next => async function disableCacheMiddleware(request) {\n request.headers['cache-control'] = 'no-store';\n return next(request);\n};\n\nexport { createDisableCacheMiddleware };\n//# sourceMappingURL=createDisableCacheMiddleware.mjs.map\n","import { getDnsSuffix } from '../../../../clients/endpoints/getDnsSuffix.mjs';\nimport '../../../../types/errors.mjs';\nimport '../../../../errors/errorHelpers.mjs';\nimport '../../../../utils/getClientInfo/getClientInfo.mjs';\nimport '../../../../utils/retry/retry.mjs';\nimport '../../../../parseAWSExports.mjs';\nimport 'uuid';\nimport { AmplifyUrl } from '../../../../utils/amplifyUrl/index.mjs';\nimport '../../../../singleton/Auth/utils/errorHelpers.mjs';\nimport '@aws-crypto/sha256-js';\nimport '@smithy/util-hex-encoding';\nimport '../../../../Platform/index.mjs';\nimport '../../../../Platform/types.mjs';\nimport '../../../../BackgroundProcessManager/types.mjs';\nimport '../../../../Reachability/Reachability.mjs';\nimport '../../../../Hub/index.mjs';\nimport '../../../../utils/sessionListener/index.mjs';\nimport { COGNITO_IDENTITY_SERVICE_NAME } from './constants.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst cognitoIdentityPoolEndpointResolver = ({ region, }) => ({\n url: new AmplifyUrl(`https://${COGNITO_IDENTITY_SERVICE_NAME}.${region}.${getDnsSuffix(region)}`),\n});\n\nexport { cognitoIdentityPoolEndpointResolver };\n//# sourceMappingURL=cognitoIdentityPoolEndpointResolver.mjs.map\n","import '../../../../types/errors.mjs';\nimport '../../../../errors/errorHelpers.mjs';\nimport { jitteredBackoff } from '../../../../clients/middleware/retry/jitteredBackoff.mjs';\nimport { getRetryDecider } from '../../../../clients/middleware/retry/defaultRetryDecider.mjs';\nimport '../../../../utils/getClientInfo/getClientInfo.mjs';\nimport '../../../../utils/retry/retry.mjs';\nimport '../../../../parseAWSExports.mjs';\nimport 'uuid';\nimport '../../../../singleton/Auth/utils/errorHelpers.mjs';\nimport '@aws-crypto/sha256-js';\nimport '@smithy/util-hex-encoding';\nimport '../../../../Platform/index.mjs';\nimport '../../../../Platform/types.mjs';\nimport '../../../../BackgroundProcessManager/types.mjs';\nimport '../../../../Reachability/Reachability.mjs';\nimport '../../../../Hub/index.mjs';\nimport '../../../../utils/sessionListener/index.mjs';\nimport { parseJsonError } from '../../../../clients/serde/json.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * The service name used to sign requests if the API requires authentication.\n */\nconst COGNITO_IDENTITY_SERVICE_NAME = 'cognito-identity';\nconst DEFAULT_SERVICE_CLIENT_API_CONFIG = {\n service: COGNITO_IDENTITY_SERVICE_NAME,\n retryDecider: getRetryDecider(parseJsonError),\n computeDelay: jitteredBackoff,\n cache: 'no-store',\n};\n\nexport { COGNITO_IDENTITY_SERVICE_NAME, DEFAULT_SERVICE_CLIENT_API_CONFIG };\n//# sourceMappingURL=constants.mjs.map\n","import '../../../../types/errors.mjs';\nimport '../../../../errors/errorHelpers.mjs';\nimport '../../../../utils/getClientInfo/getClientInfo.mjs';\nimport '../../../../utils/retry/retry.mjs';\nimport '../../../../parseAWSExports.mjs';\nimport 'uuid';\nimport '../../../../singleton/Auth/utils/errorHelpers.mjs';\nimport '@aws-crypto/sha256-js';\nimport '@smithy/util-hex-encoding';\nimport { getAmplifyUserAgent } from '../../../../Platform/index.mjs';\nimport '../../../../Platform/types.mjs';\nimport '../../../../BackgroundProcessManager/types.mjs';\nimport '../../../../Reachability/Reachability.mjs';\nimport '../../../../Hub/index.mjs';\nimport '../../../../utils/sessionListener/index.mjs';\nimport { parseMetadata } from '../../../../clients/serde/responseInfo.mjs';\nimport { parseJsonError, parseJsonBody } from '../../../../clients/serde/json.mjs';\nimport { composeServiceApi } from '../../../../clients/internal/composeServiceApi.mjs';\nimport { DEFAULT_SERVICE_CLIENT_API_CONFIG } from './constants.mjs';\nimport { cognitoIdentityTransferHandler } from './handler/cognitoIdentityTransferHandler.mjs';\nimport { createClientSerializer } from './serde/createClientSerializer.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst createGetCredentialsForIdentityClient = (config) => composeServiceApi(cognitoIdentityTransferHandler, createClientSerializer('GetCredentialsForIdentity'), getCredentialsForIdentityDeserializer, {\n ...DEFAULT_SERVICE_CLIENT_API_CONFIG,\n ...config,\n userAgentValue: getAmplifyUserAgent(),\n});\nconst getCredentialsForIdentityDeserializer = 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 Credentials: deserializeCredentials(body.Credentials),\n $metadata: parseMetadata(response),\n };\n};\nconst deserializeCredentials = ({ Expiration, ...rest } = {}) => ({\n ...rest,\n Expiration: Expiration && new Date(Expiration * 1000),\n});\n\nexport { createGetCredentialsForIdentityClient };\n//# sourceMappingURL=createGetCredentialsForIdentityClient.mjs.map\n","import '../../../../types/errors.mjs';\nimport '../../../../errors/errorHelpers.mjs';\nimport '../../../../utils/getClientInfo/getClientInfo.mjs';\nimport '../../../../utils/retry/retry.mjs';\nimport '../../../../parseAWSExports.mjs';\nimport 'uuid';\nimport '../../../../singleton/Auth/utils/errorHelpers.mjs';\nimport '@aws-crypto/sha256-js';\nimport '@smithy/util-hex-encoding';\nimport { getAmplifyUserAgent } from '../../../../Platform/index.mjs';\nimport '../../../../Platform/types.mjs';\nimport '../../../../BackgroundProcessManager/types.mjs';\nimport '../../../../Reachability/Reachability.mjs';\nimport '../../../../Hub/index.mjs';\nimport '../../../../utils/sessionListener/index.mjs';\nimport { parseMetadata } from '../../../../clients/serde/responseInfo.mjs';\nimport { parseJsonError, parseJsonBody } from '../../../../clients/serde/json.mjs';\nimport { composeServiceApi } from '../../../../clients/internal/composeServiceApi.mjs';\nimport { DEFAULT_SERVICE_CLIENT_API_CONFIG } from './constants.mjs';\nimport { cognitoIdentityTransferHandler } from './handler/cognitoIdentityTransferHandler.mjs';\nimport { createClientSerializer } from './serde/createClientSerializer.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst 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\nexport { createGetIdClient };\n//# sourceMappingURL=createGetIdClient.mjs.map\n","import '../../../../../types/errors.mjs';\nimport '../../../../../errors/errorHelpers.mjs';\nimport { unauthenticatedHandler } from '../../../../../clients/handlers/aws/unauthenticated.mjs';\nimport '../../../../../utils/getClientInfo/getClientInfo.mjs';\nimport '../../../../../utils/retry/retry.mjs';\nimport '../../../../../parseAWSExports.mjs';\nimport 'uuid';\nimport '../../../../../singleton/Auth/utils/errorHelpers.mjs';\nimport '@aws-crypto/sha256-js';\nimport '@smithy/util-hex-encoding';\nimport '../../../../../Platform/index.mjs';\nimport '../../../../../Platform/types.mjs';\nimport '../../../../../BackgroundProcessManager/types.mjs';\nimport '../../../../../Reachability/Reachability.mjs';\nimport '../../../../../Hub/index.mjs';\nimport '../../../../../utils/sessionListener/index.mjs';\nimport { composeTransferHandler } from '../../../../../clients/internal/composeTransferHandler.mjs';\nimport { createDisableCacheMiddleware } from '../../../middleware/createDisableCacheMiddleware.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * A Cognito Identity-specific transfer handler that does NOT sign requests, and\n * disables caching.\n *\n * @internal\n */\nconst cognitoIdentityTransferHandler = composeTransferHandler(unauthenticatedHandler, [createDisableCacheMiddleware]);\n\nexport { cognitoIdentityTransferHandler };\n//# sourceMappingURL=cognitoIdentityTransferHandler.mjs.map\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst createClientSerializer = (operation) => (input, endpoint) => {\n const headers = getSharedHeaders(operation);\n const body = JSON.stringify(input);\n return buildHttpRpcRequest(endpoint, headers, body);\n};\nconst getSharedHeaders = (operation) => ({\n 'content-type': 'application/x-amz-json-1.1',\n 'x-amz-target': `AWSCognitoIdentityService.${operation}`,\n});\nconst buildHttpRpcRequest = ({ url }, headers, body) => ({\n headers,\n url,\n body,\n method: 'POST',\n});\n\nexport { buildHttpRpcRequest, createClientSerializer };\n//# sourceMappingURL=createClientSerializer.mjs.map\n","export { DefaultAmplify as Amplify } from './initSingleton.mjs';\n//# sourceMappingURL=index.mjs.map\n","import { Amplify, CookieStorage, defaultStorage } from '@aws-amplify/core';\nimport { parseAmplifyConfig } from '@aws-amplify/core/internals/utils';\nimport { CognitoAWSCredentialsAndIdentityIdProvider, DefaultIdentityIdStore, cognitoCredentialsProvider, cognitoUserPoolsTokenProvider } from '@aws-amplify/auth/cognito';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst DefaultAmplify = {\n /**\n * Configures Amplify with the {@link resourceConfig} and {@link libraryOptions}.\n *\n * @param resourceConfig The {@link ResourcesConfig} object that is typically imported from the\n * `amplifyconfiguration.json` file. It can also be an object literal created inline when calling `Amplify.configure`.\n * @param libraryOptions The {@link LibraryOptions} additional options for the library.\n *\n * @example\n * import config from './amplifyconfiguration.json';\n *\n * Amplify.configure(config);\n */\n configure(resourceConfig, libraryOptions) {\n const resolvedResourceConfig = parseAmplifyConfig(resourceConfig);\n const cookieBasedKeyValueStorage = new CookieStorage({ sameSite: 'lax' });\n const resolvedKeyValueStorage = libraryOptions?.ssr\n ? cookieBasedKeyValueStorage\n : defaultStorage;\n const resolvedCredentialsProvider = libraryOptions?.ssr\n ? new CognitoAWSCredentialsAndIdentityIdProvider(new DefaultIdentityIdStore(cookieBasedKeyValueStorage))\n : cognitoCredentialsProvider;\n // If no Auth config is provided, no special handling will be required, configure as is.\n // Otherwise, we can assume an Auth config is provided from here on.\n if (!resolvedResourceConfig.Auth) {\n Amplify.configure(resolvedResourceConfig, libraryOptions);\n return;\n }\n // If Auth options are provided, always just configure as is.\n // Otherwise, we can assume no Auth libraryOptions were provided from here on.\n if (libraryOptions?.Auth) {\n Amplify.configure(resolvedResourceConfig, libraryOptions);\n return;\n }\n // If no Auth libraryOptions were previously configured, then always add default providers.\n if (!Amplify.libraryOptions.Auth) {\n cognitoUserPoolsTokenProvider.setAuthConfig(resolvedResourceConfig.Auth);\n cognitoUserPoolsTokenProvider.setKeyValueStorage(\n // TODO: allow configure with a public interface\n resolvedKeyValueStorage);\n Amplify.configure(resolvedResourceConfig, {\n ...libraryOptions,\n Auth: {\n tokenProvider: cognitoUserPoolsTokenProvider,\n credentialsProvider: resolvedCredentialsProvider,\n },\n });\n return;\n }\n // At this point, Auth libraryOptions would have been previously configured and no overriding\n // Auth options were given, so we should preserve the currently configured Auth libraryOptions.\n if (libraryOptions) {\n const authLibraryOptions = Amplify.libraryOptions.Auth;\n // If ssr is provided through libraryOptions, we should respect the intentional reconfiguration.\n if (libraryOptions.ssr !== undefined) {\n cognitoUserPoolsTokenProvider.setKeyValueStorage(\n // TODO: allow configure with a public interface\n resolvedKeyValueStorage);\n authLibraryOptions.credentialsProvider = resolvedCredentialsProvider;\n }\n Amplify.configure(resolvedResourceConfig, {\n Auth: authLibraryOptions,\n ...libraryOptions,\n });\n return;\n }\n // Finally, if there were no libraryOptions given at all, we should simply not touch the currently\n // configured libraryOptions.\n Amplify.configure(resolvedResourceConfig);\n },\n /**\n * Returns the {@link ResourcesConfig} object passed in as the `resourceConfig` parameter when calling\n * `Amplify.configure`.\n *\n * @returns An {@link ResourcesConfig} object.\n */\n getConfig() {\n return Amplify.getConfig();\n },\n};\n\nexport { DefaultAmplify };\n//# sourceMappingURL=initSingleton.mjs.map\n"],"names":[],"sourceRoot":""}
|