@falconeta/capacitor-aws-amplify 0.0.9 → 0.0.10

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/dist/esm/web.d.ts CHANGED
@@ -18,4 +18,5 @@ export declare class AwsAmplifyWeb extends WebPlugin implements AwsAmplifyPlugin
18
18
  status: AwsAmplifyPluginResponseStatus;
19
19
  }>;
20
20
  private getCognitoAuthSession;
21
+ private handleError;
21
22
  }
package/dist/esm/web.js CHANGED
@@ -15,10 +15,7 @@ export class AwsAmplifyWeb extends WebPlugin {
15
15
  return this.getCognitoAuthSession(user, this.cognitoConfig.aws_cognito_identity_pool_id);
16
16
  }
17
17
  catch (error) {
18
- const res = {
19
- status: AwsAmplifyPluginResponseStatus.Ko,
20
- };
21
- return res;
18
+ return this.handleError(error, 'signIn');
22
19
  }
23
20
  }
24
21
  async federatedSignIn(options) {
@@ -39,11 +36,7 @@ export class AwsAmplifyWeb extends WebPlugin {
39
36
  return cognitoAuthSession;
40
37
  }
41
38
  catch (error) {
42
- console.log(error);
43
- const res = {
44
- status: AwsAmplifyPluginResponseStatus.Ko,
45
- };
46
- return res;
39
+ return this.handleError(error, 'fetchAuthSession');
47
40
  }
48
41
  }
49
42
  async signOut() {
@@ -54,7 +47,7 @@ export class AwsAmplifyWeb extends WebPlugin {
54
47
  .then(() => ({
55
48
  status: AwsAmplifyPluginResponseStatus.Ok,
56
49
  }))
57
- .catch(() => ({ status: AwsAmplifyPluginResponseStatus.Ko }));
50
+ .catch(error => this.handleError(error, 'signOut'));
58
51
  }
59
52
  getCognitoAuthSession(user, identityId) {
60
53
  const userSession = user.getSignInUserSession();
@@ -70,5 +63,18 @@ export class AwsAmplifyWeb extends WebPlugin {
70
63
  };
71
64
  return res;
72
65
  }
66
+ handleError(error, from) {
67
+ console.error(`[CAPACITOR AWS AMPLIFY] - error from ${from}: `, error);
68
+ const res = {
69
+ status: AwsAmplifyPluginResponseStatus.Ko,
70
+ };
71
+ if (typeof error !== 'string') {
72
+ return res;
73
+ }
74
+ if (error.includes('not authenticated')) {
75
+ res.status = AwsAmplifyPluginResponseStatus.SignedOut;
76
+ }
77
+ return res;
78
+ }
73
79
  }
74
80
  //# sourceMappingURL=web.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAO5C,OAAO,EAAE,8BAA8B,EAAE,MAAM,eAAe,CAAC;AAE/D,MAAM,OAAO,aAAc,SAAQ,SAAS;IAG1C,KAAK,CAAC,IAAI,CAAC,OAA4C;QACrD,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;QAC3C,OAAO,CAAC,SAAS,mBAAM,OAAO,CAAC,aAAa,EAAG,CAAC;IAClD,CAAC;IACD,KAAK,CAAC,MAAM,CAAC,OAGZ;QACC,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE;YACvB,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;SACpC;QACD,IAAI;YACF,MAAM,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,MAAM,CAC7B,OAAO,CAAC,KAAK,EACb,OAAO,CAAC,QAAQ,CACjB,CAAgB,CAAC;YAElB,OAAO,IAAI,CAAC,qBAAqB,CAC/B,IAAI,EACJ,IAAI,CAAC,aAAa,CAAC,4BAA4B,CAChD,CAAC;SACH;QAAC,OAAO,KAAK,EAAE;YACd,MAAM,GAAG,GAAuB;gBAC9B,MAAM,EAAE,8BAA8B,CAAC,EAAE;aAC1C,CAAC;YACF,OAAO,GAAG,CAAC;SACZ;IACH,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,OAErB;QACC,oCAAoC;QACpC,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE;YACvB,MAAM,IAAI,KAAK,CAAC,iBA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,EAAE;YACxD,OAAO,EAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,UAAU,GAAG,WAAW,EAAE;YAChD,UAAU,EAAE,UAAU;YACtB,YAAY,EAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,eAAe,GAAG,QAAQ,EAAE;YACvD,SAAS,EAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,cAAc,GAAG,aAAa,GAAG,UAAU;YACnE,MAAM,EAAE,WAAW;gBACjB,CAAC,CAAC,8BAA8B,CAAC,EAAE;gBACnC,CAAC,CAAC,8BAA8B,CAAC,EAAE;SACtC,CAAC;QACF,OAAO,GAAG,CAAC;IACb,CAAC;CACF","sourcesContent":["import type { FederatedSignInOptions } from '@aws-amplify/auth/lib/types';\nimport { WebPlugin } from '@capacitor/core';\nimport type { CognitoUser } from 'amazon-cognito-identity-js';\nimport { Amplify, Auth } from 'aws-amplify';\n\nimport type {\n AwsAmplifyPlugin,\n AWSCognitoConfig,\n CognitoAuthSession,\n} from './definitions';\nimport { AwsAmplifyPluginResponseStatus } from './definitions';\n\nexport class AwsAmplifyWeb extends WebPlugin implements AwsAmplifyPlugin {\n private cognitoConfig?: AWSCognitoConfig;\n\n async load(options: { cognitoConfig: AWSCognitoConfig }): Promise<void> {\n this.cognitoConfig = options.cognitoConfig;\n Amplify.configure({ ...options.cognitoConfig });\n }\n async signIn(options: {\n email: string;\n password: string;\n }): Promise<CognitoAuthSession> {\n if (!this.cognitoConfig) {\n throw new Error('call load first');\n }\n try {\n const user = (await Auth.signIn(\n options.email,\n options.password,\n )) as CognitoUser;\n\n return this.getCognitoAuthSession(\n user,\n this.cognitoConfig.aws_cognito_identity_pool_id,\n );\n } catch (error) {\n const res: CognitoAuthSession = {\n status: AwsAmplifyPluginResponseStatus.Ko,\n };\n return res;\n }\n }\n\n async federatedSignIn(options: {\n provider: string;\n }): Promise<CognitoAuthSession> {\n // console.log(LOG_PREFIX, options);\n if (!this.cognitoConfig) {\n throw new Error('call load first');\n }\n await Auth.federatedSignIn(options as FederatedSignInOptions);\n return this.fetchAuthSession();\n }\n\n async fetchAuthSession(): Promise<CognitoAuthSession> {\n if (!this.cognitoConfig) {\n throw new Error('call load first');\n }\n try {\n const user = await Auth.currentAuthenticatedUser();\n const cognitoAuthSession: CognitoAuthSession = this.getCognitoAuthSession(\n user,\n this.cognitoConfig.aws_cognito_identity_pool_id,\n );\n\n return cognitoAuthSession;\n } catch (error) {\n console.log(error);\n const res: CognitoAuthSession = {\n status: AwsAmplifyPluginResponseStatus.Ko,\n };\n return res;\n }\n }\n\n async signOut(): Promise<{ status: AwsAmplifyPluginResponseStatus }> {\n if (!this.cognitoConfig) {\n throw new Error('call load first');\n }\n return Auth.signOut()\n .then(() => ({\n status: AwsAmplifyPluginResponseStatus.Ok,\n }))\n .catch(() => ({ status: AwsAmplifyPluginResponseStatus.Ko }));\n }\n\n private getCognitoAuthSession(user: CognitoUser, identityId: string) {\n const userSession = user.getSignInUserSession();\n\n const res: CognitoAuthSession = {\n accessToken: userSession?.getAccessToken().getJwtToken(),\n idToken: userSession?.getIdToken().getJwtToken(),\n identityId: identityId,\n refreshToken: userSession?.getRefreshToken().getToken(),\n deviceKey: userSession?.getAccessToken().decodePayload().device_key,\n status: userSession\n ? AwsAmplifyPluginResponseStatus.Ok\n : AwsAmplifyPluginResponseStatus.Ko,\n };\n return res;\n }\n}\n"]}
1
+ {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAO5C,OAAO,EAAE,8BAA8B,EAAE,MAAM,eAAe,CAAC;AAE/D,MAAM,OAAO,aAAc,SAAQ,SAAS;IAG1C,KAAK,CAAC,IAAI,CAAC,OAA4C;QACrD,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;QAC3C,OAA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AAE;YAC7B,OAAO,GAAG,CAAC;SACZ;QACD,IAAI,KAAK,CAAC,QAAQ,CAAC,mBAAmB,CAAC,EAAE;YACvC,GAAG,CAAC,MAAM,GAAG,8BAA8B,CAAC,SAAS,CAAC;SACvD;QACD,OAAO,GAAG,CAAC;IACb,CAAC;CACF","sourcesContent":["import type { FederatedSignInOptions } from '@aws-amplify/auth/lib/types';\nimport { WebPlugin } from '@capacitor/core';\nimport type { CognitoUser } from 'amazon-cognito-identity-js';\nimport { Amplify, Auth } from 'aws-amplify';\n\nimport type {\n AwsAmplifyPlugin,\n AWSCognitoConfig,\n CognitoAuthSession,\n} from './definitions';\nimport { AwsAmplifyPluginResponseStatus } from './definitions';\n\nexport class AwsAmplifyWeb extends WebPlugin implements AwsAmplifyPlugin {\n private cognitoConfig?: AWSCognitoConfig;\n\n async load(options: { cognitoConfig: AWSCognitoConfig }): Promise<void> {\n this.cognitoConfig = options.cognitoConfig;\n Amplify.configure({ ...options.cognitoConfig });\n }\n async signIn(options: {\n email: string;\n password: string;\n }): Promise<CognitoAuthSession> {\n if (!this.cognitoConfig) {\n throw new Error('call load first');\n }\n try {\n const user = (await Auth.signIn(\n options.email,\n options.password,\n )) as CognitoUser;\n\n return this.getCognitoAuthSession(\n user,\n this.cognitoConfig.aws_cognito_identity_pool_id,\n );\n } catch (error) {\n return this.handleError(error, 'signIn');\n }\n }\n\n async federatedSignIn(options: {\n provider: string;\n }): Promise<CognitoAuthSession> {\n // console.log(LOG_PREFIX, options);\n if (!this.cognitoConfig) {\n throw new Error('call load first');\n }\n await Auth.federatedSignIn(options as FederatedSignInOptions);\n return this.fetchAuthSession();\n }\n\n async fetchAuthSession(): Promise<CognitoAuthSession> {\n if (!this.cognitoConfig) {\n throw new Error('call load first');\n }\n try {\n const user = await Auth.currentAuthenticatedUser();\n const cognitoAuthSession: CognitoAuthSession = this.getCognitoAuthSession(\n user,\n this.cognitoConfig.aws_cognito_identity_pool_id,\n );\n\n return cognitoAuthSession;\n } catch (error) {\n return this.handleError(error, 'fetchAuthSession');\n }\n }\n\n async signOut(): Promise<{ status: AwsAmplifyPluginResponseStatus }> {\n if (!this.cognitoConfig) {\n throw new Error('call load first');\n }\n return Auth.signOut()\n .then(() => ({\n status: AwsAmplifyPluginResponseStatus.Ok,\n }))\n .catch(error => this.handleError(error, 'signOut'));\n }\n\n private getCognitoAuthSession(user: CognitoUser, identityId: string) {\n const userSession = user.getSignInUserSession();\n\n const res: CognitoAuthSession = {\n accessToken: userSession?.getAccessToken().getJwtToken(),\n idToken: userSession?.getIdToken().getJwtToken(),\n identityId: identityId,\n refreshToken: userSession?.getRefreshToken().getToken(),\n deviceKey: userSession?.getAccessToken().decodePayload().device_key,\n status: userSession\n ? AwsAmplifyPluginResponseStatus.Ok\n : AwsAmplifyPluginResponseStatus.Ko,\n };\n return res;\n }\n\n private handleError(error: any, from: string): CognitoAuthSession {\n console.error(`[CAPACITOR AWS AMPLIFY] - error from ${from}: `, error);\n const res: CognitoAuthSession = {\n status: AwsAmplifyPluginResponseStatus.Ko,\n };\n if (typeof error !== 'string') {\n return res;\n }\n if (error.includes('not authenticated')) {\n res.status = AwsAmplifyPluginResponseStatus.SignedOut;\n }\n return res;\n }\n}\n"]}
@@ -39,10 +39,7 @@ class AwsAmplifyWeb extends core.WebPlugin {
39
39
  return this.getCognitoAuthSession(user, this.cognitoConfig.aws_cognito_identity_pool_id);
40
40
  }
41
41
  catch (error) {
42
- const res = {
43
- status: exports.AwsAmplifyPluginResponseStatus.Ko,
44
- };
45
- return res;
42
+ return this.handleError(error, 'signIn');
46
43
  }
47
44
  }
48
45
  async federatedSignIn(options) {
@@ -63,11 +60,7 @@ class AwsAmplifyWeb extends core.WebPlugin {
63
60
  return cognitoAuthSession;
64
61
  }
65
62
  catch (error) {
66
- console.log(error);
67
- const res = {
68
- status: exports.AwsAmplifyPluginResponseStatus.Ko,
69
- };
70
- return res;
63
+ return this.handleError(error, 'fetchAuthSession');
71
64
  }
72
65
  }
73
66
  async signOut() {
@@ -78,7 +71,7 @@ class AwsAmplifyWeb extends core.WebPlugin {
78
71
  .then(() => ({
79
72
  status: exports.AwsAmplifyPluginResponseStatus.Ok,
80
73
  }))
81
- .catch(() => ({ status: exports.AwsAmplifyPluginResponseStatus.Ko }));
74
+ .catch(error => this.handleError(error, 'signOut'));
82
75
  }
83
76
  getCognitoAuthSession(user, identityId) {
84
77
  const userSession = user.getSignInUserSession();
@@ -94,6 +87,19 @@ class AwsAmplifyWeb extends core.WebPlugin {
94
87
  };
95
88
  return res;
96
89
  }
90
+ handleError(error, from) {
91
+ console.error(`[CAPACITOR AWS AMPLIFY] - error from ${from}: `, error);
92
+ const res = {
93
+ status: exports.AwsAmplifyPluginResponseStatus.Ko,
94
+ };
95
+ if (typeof error !== 'string') {
96
+ return res;
97
+ }
98
+ if (error.includes('not authenticated')) {
99
+ res.status = exports.AwsAmplifyPluginResponseStatus.SignedOut;
100
+ }
101
+ return res;
102
+ }
97
103
  }
98
104
 
99
105
  var web = /*#__PURE__*/Object.freeze({
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.cjs.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["export var AwsAmplifyPluginResponseStatus;\n(function (AwsAmplifyPluginResponseStatus) {\n AwsAmplifyPluginResponseStatus[AwsAmplifyPluginResponseStatus[\"Ok\"] = 0] = \"Ok\";\n AwsAmplifyPluginResponseStatus[AwsAmplifyPluginResponseStatus[\"Ko\"] = -1] = \"Ko\";\n AwsAmplifyPluginResponseStatus[AwsAmplifyPluginResponseStatus[\"Cancelled\"] = -2] = \"Cancelled\";\n AwsAmplifyPluginResponseStatus[AwsAmplifyPluginResponseStatus[\"SignedOut\"] = -3] = \"SignedOut\";\n})(AwsAmplifyPluginResponseStatus || (AwsAmplifyPluginResponseStatus = {}));\nexport var CognitoHostedUIIdentityProvider;\n(function (CognitoHostedUIIdentityProvider) {\n CognitoHostedUIIdentityProvider[\"Cognito\"] = \"COGNITO\";\n CognitoHostedUIIdentityProvider[\"Google\"] = \"Google\";\n CognitoHostedUIIdentityProvider[\"Facebook\"] = \"Facebook\";\n CognitoHostedUIIdentityProvider[\"Amazon\"] = \"LoginWithAmazon\";\n CognitoHostedUIIdentityProvider[\"Apple\"] = \"SignInWithApple\";\n})(CognitoHostedUIIdentityProvider || (CognitoHostedUIIdentityProvider = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst AwsAmplify = registerPlugin('AwsAmplify', {\n web: () => import('./web').then(m => new m.AwsAmplifyWeb()),\n});\nexport * from './definitions';\nexport { AwsAmplify };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nimport { Amplify, Auth } from 'aws-amplify';\nimport { AwsAmplifyPluginResponseStatus } from './definitions';\nexport class AwsAmplifyWeb extends WebPlugin {\n async load(options) {\n this.cognitoConfig = options.cognitoConfig;\n Amplify.configure(Object.assign({}, options.cognitoConfig));\n }\n async signIn(options) {\n if (!this.cognitoConfig) {\n throw new Error('call load first');\n }\n try {\n const user = (await Auth.signIn(options.email, options.password));\n return this.getCognitoAuthSession(user, this.cognitoConfig.aws_cognito_identity_pool_id);\n }\n catch (error) {\n const res = {\n status: AwsAmplifyPluginResponseStatus.Ko,\n };\n return res;\n }\n }\n async federatedSignIn(options) {\n // console.log(LOG_PREFIX, options);\n if (!this.cognitoConfig) {\n throw new Error('call load first');\n }\n await Auth.federatedSignIn(options);\n return this.fetchAuthSession();\n }\n async fetchAuthSession() {\n if (!this.cognitoConfig) {\n throw new Error('call load first');\n }\n try {\n const user = await Auth.currentAuthenticatedUser();\n const cognitoAuthSession = this.getCognitoAuthSession(user, this.cognitoConfig.aws_cognito_identity_pool_id);\n return cognitoAuthSession;\n }\n catch (error) {\n console.log(error);\n const res = {\n status: AwsAmplifyPluginResponseStatus.Ko,\n };\n return res;\n }\n }\n async signOut() {\n if (!this.cognitoConfig) {\n throw new Error('call load first');\n }\n return Auth.signOut()\n .then(() => ({\n status: AwsAmplifyPluginResponseStatus.Ok,\n }))\n .catch(() => ({ status: AwsAmplifyPluginResponseStatus.Ko }));\n }\n getCognitoAuthSession(user, identityId) {\n const userSession = user.getSignInUserSession();\n const res = {\n accessToken: userSession === null || userSession === void 0 ? void 0 : userSession.getAccessToken().getJwtToken(),\n idToken: userSession === null || userSession === void 0 ? void 0 : userSession.getIdToken().getJwtToken(),\n identityId: identityId,\n refreshToken: userSession === null || userSession === void 0 ? void 0 : userSession.getRefreshToken().getToken(),\n deviceKey: userSession === null || userSession === void 0 ? void 0 : userSession.getAccessToken().decodePayload().device_key,\n status: userSession\n ? AwsAmplifyPluginResponseStatus.Ok\n : AwsAmplifyPluginResponseStatus.Ko,\n };\n return res;\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["AwsAmplifyPluginResponseStatus","CognitoHostedUIIdentityProvider","registerPlugin","WebPlugin","Amplify","Auth"],"mappings":";;;;;;;AAAWA,gDAA+B;AAC1C,CAAC,UAAU,8BAA8B,EAAE;AAC3C,IAAI,8BAA8B,CAAC,8BAA8B,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC;AACpF,IAAI,8BAA8B,CAAC,8BAA8B,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;AACrF,IAAI,8BAA8B,CAAC,8BAA8B,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC;AACnG,IAAI,8BAA8B,CAAC,8BAA8B,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC;AACnG,CAAC,EAAEA,sCAA8B,KAAKA,sCAA8B,GAAG,EAAE,CAAC,CAAC,CAAC;AACjEC,iDAAgC;AAC3C,CAAC,UAAU,+BAA+B,EAAE;AAC5C,IAAI,+BAA+B,CAAC,SAAS,CAAC,GAAG,SAAS,CAAC;AAC3D,IAAI,+BAA+B,CAAC,QAAQ,CAAC,GAAG,QAAQ,CAAC;AACzD,IA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SAAS,CAAC,CAAC;AACX,aAAa,KAAK,CAAC,OAAO,EAAE,MAAM,EAAEA,sCAA8B,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;AAC1E,KAAK;AACL,IAAI,qBAAqB,CAAC,IAAI,EAAE,UAAU,EAAE;AAC5C,QAAQ,MAAM,WAAW,GAAG,IAAI,CAAC,oBAAoB,EAAE,CAAC;AACxD,QAAQ,MAAM,GAAG,GAAG;AACpB,YAAY,WAAW,EAAE,WAAW,KAAK,IAAI,IAAI,WAAW,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAG,WAAW,CAAC,cAAc,EAAE,CAAC,WAAW,EAAE;AAC7H,YAAY,OAAO,EAAE,WAAW,KAAK,IAAI,IAAI,WAAW,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAG,WAAW,CAAC,UAAU,EAAE,CAAC,WAAW,EAAE;AACrH,YAAY,UAAU,EAAE,UAAU;AAClC,YAAY,YAAY,EAAE,WAAW,KAAK,IAAI,IAAI,WAAW,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAG,WAAW,CAAC,eAAe,EAAE,CAAC,QAAQ,EAAE;AAC5H,YAAY,SAAS,EAAE,WAAW,KAAK,IAAI,IAAI,WAAW,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAG,WAAW,CAAC,cAAc,EAAE,CAAC,aAAa,EAAE,CAAC,UAAU;AACxI,YAAY,MAAM,EAAE,WAAW;AAC/B,kBAAkBA,sCAA8B,CAAC,EAAE;AACnD,kBAAkBA,sCAA8B,CAAC,EAAE;AACnD,SAAS,CAAC;AACV,QAAQ,OAAO,GAAG,CAAC;AACnB,KAAK;AACL;;;;;;;;;"}
1
+ {"version":3,"file":"plugin.cjs.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["export var AwsAmplifyPluginResponseStatus;\n(function (AwsAmplifyPluginResponseStatus) {\n AwsAmplifyPluginResponseStatus[AwsAmplifyPluginResponseStatus[\"Ok\"] = 0] = \"Ok\";\n AwsAmplifyPluginResponseStatus[AwsAmplifyPluginResponseStatus[\"Ko\"] = -1] = \"Ko\";\n AwsAmplifyPluginResponseStatus[AwsAmplifyPluginResponseStatus[\"Cancelled\"] = -2] = \"Cancelled\";\n AwsAmplifyPluginResponseStatus[AwsAmplifyPluginResponseStatus[\"SignedOut\"] = -3] = \"SignedOut\";\n})(AwsAmplifyPluginResponseStatus || (AwsAmplifyPluginResponseStatus = {}));\nexport var CognitoHostedUIIdentityProvider;\n(function (CognitoHostedUIIdentityProvider) {\n CognitoHostedUIIdentityProvider[\"Cognito\"] = \"COGNITO\";\n CognitoHostedUIIdentityProvider[\"Google\"] = \"Google\";\n CognitoHostedUIIdentityProvider[\"Facebook\"] = \"Facebook\";\n CognitoHostedUIIdentityProvider[\"Amazon\"] = \"LoginWithAmazon\";\n CognitoHostedUIIdentityProvider[\"Apple\"] = \"SignInWithApple\";\n})(CognitoHostedUIIdentityProvider || (CognitoHostedUIIdentityProvider = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst AwsAmplify = registerPlugin('AwsAmplify', {\n web: () => import('./web').then(m => new m.AwsAmplifyWeb()),\n});\nexport * from './definitions';\nexport { AwsAmplify };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nimport { Amplify, Auth } from 'aws-amplify';\nimport { AwsAmplifyPluginResponseStatus } from './definitions';\nexport class AwsAmplifyWeb extends WebPlugin {\n async load(options) {\n this.cognitoConfig = options.cognitoConfig;\n Amplify.configure(Object.assign({}, options.cognitoConfig));\n }\n async signIn(options) {\n if (!this.cognitoConfig) {\n throw new Error('call load first');\n }\n try {\n const user = (await Auth.signIn(options.email, options.password));\n return this.getCognitoAuthSession(user, this.cognitoConfig.aws_cognito_identity_pool_id);\n }\n catch (error) {\n return this.handleError(error, 'signIn');\n }\n }\n async federatedSignIn(options) {\n // console.log(LOG_PREFIX, options);\n if (!this.cognitoConfig) {\n throw new Error('call load first');\n }\n await Auth.federatedSignIn(options);\n return this.fetchAuthSession();\n }\n async fetchAuthSession() {\n if (!this.cognitoConfig) {\n throw new Error('call load first');\n }\n try {\n const user = await Auth.currentAuthenticatedUser();\n const cognitoAuthSession = this.getCognitoAuthSession(user, this.cognitoConfig.aws_cognito_identity_pool_id);\n return cognitoAuthSession;\n }\n catch (error) {\n return this.handleError(error, 'fetchAuthSession');\n }\n }\n async signOut() {\n if (!this.cognitoConfig) {\n throw new Error('call load first');\n }\n return Auth.signOut()\n .then(() => ({\n status: AwsAmplifyPluginResponseStatus.Ok,\n }))\n .catch(error => this.handleError(error, 'signOut'));\n }\n getCognitoAuthSession(user, identityId) {\n const userSession = user.getSignInUserSession();\n const res = {\n accessToken: userSession === null || userSession === void 0 ? void 0 : userSession.getAccessToken().getJwtToken(),\n idToken: userSession === null || userSession === void 0 ? void 0 : userSession.getIdToken().getJwtToken(),\n identityId: identityId,\n refreshToken: userSession === null || userSession === void 0 ? void 0 : userSession.getRefreshToken().getToken(),\n deviceKey: userSession === null || userSession === void 0 ? void 0 : userSession.getAccessToken().decodePayload().device_key,\n status: userSession\n ? AwsAmplifyPluginResponseStatus.Ok\n : AwsAmplifyPluginResponseStatus.Ko,\n };\n return res;\n }\n handleError(error, from) {\n console.error(`[CAPACITOR AWS AMPLIFY] - error from ${from}: `, error);\n const res = {\n status: AwsAmplifyPluginResponseStatus.Ko,\n };\n if (typeof error !== 'string') {\n return res;\n }\n if (error.includes('not authenticated')) {\n res.status = AwsAmplifyPluginResponseStatus.SignedOut;\n }\n return res;\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["AwsAmplifyPluginResponseStatus","CognitoHostedUIIdentityProvider","registerPlugin","WebPlugin","Amplify","Auth"],"mappings":";;;;;;;AAAWA,gDAA+B;AAC1C,CAAC,UAAU,8BAA8B,EAAE;AAC3C,IAAI,8BAA8B,CAAC,8BAA8B,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC;AACpF,IAAI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AAU;AACxI,YAAY,MAAM,EAAE,WAAW;AAC/B,kBAAkBA,sCAA8B,CAAC,EAAE;AACnD,kBAAkBA,sCAA8B,CAAC,EAAE;AACnD,SAAS,CAAC;AACV,QAAQ,OAAO,GAAG,CAAC;AACnB,KAAK;AACL,IAAI,WAAW,CAAC,KAAK,EAAE,IAAI,EAAE;AAC7B,QAAQ,OAAO,CAAC,KAAK,CAAC,CAAC,qCAAqC,EAAE,IAAI,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;AAC/E,QAAQ,MAAM,GAAG,GAAG;AACpB,YAAY,MAAM,EAAEA,sCAA8B,CAAC,EAAE;AACrD,SAAS,CAAC;AACV,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AACvC,YAAY,OAAO,GAAG,CAAC;AACvB,SAAS;AACT,QAAQ,IAAI,KAAK,CAAC,QAAQ,CAAC,mBAAmB,CAAC,EAAE;AACjD,YAAY,GAAG,CAAC,MAAM,GAAGA,sCAA8B,CAAC,SAAS,CAAC;AAClE,SAAS;AACT,QAAQ,OAAO,GAAG,CAAC;AACnB,KAAK;AACL;;;;;;;;;"}
package/dist/plugin.js CHANGED
@@ -35,10 +35,7 @@ var capacitorAwsAmplify = (function (exports, core, awsAmplify) {
35
35
  return this.getCognitoAuthSession(user, this.cognitoConfig.aws_cognito_identity_pool_id);
36
36
  }
37
37
  catch (error) {
38
- const res = {
39
- status: exports.AwsAmplifyPluginResponseStatus.Ko,
40
- };
41
- return res;
38
+ return this.handleError(error, 'signIn');
42
39
  }
43
40
  }
44
41
  async federatedSignIn(options) {
@@ -59,11 +56,7 @@ var capacitorAwsAmplify = (function (exports, core, awsAmplify) {
59
56
  return cognitoAuthSession;
60
57
  }
61
58
  catch (error) {
62
- console.log(error);
63
- const res = {
64
- status: exports.AwsAmplifyPluginResponseStatus.Ko,
65
- };
66
- return res;
59
+ return this.handleError(error, 'fetchAuthSession');
67
60
  }
68
61
  }
69
62
  async signOut() {
@@ -74,7 +67,7 @@ var capacitorAwsAmplify = (function (exports, core, awsAmplify) {
74
67
  .then(() => ({
75
68
  status: exports.AwsAmplifyPluginResponseStatus.Ok,
76
69
  }))
77
- .catch(() => ({ status: exports.AwsAmplifyPluginResponseStatus.Ko }));
70
+ .catch(error => this.handleError(error, 'signOut'));
78
71
  }
79
72
  getCognitoAuthSession(user, identityId) {
80
73
  const userSession = user.getSignInUserSession();
@@ -90,6 +83,19 @@ var capacitorAwsAmplify = (function (exports, core, awsAmplify) {
90
83
  };
91
84
  return res;
92
85
  }
86
+ handleError(error, from) {
87
+ console.error(`[CAPACITOR AWS AMPLIFY] - error from ${from}: `, error);
88
+ const res = {
89
+ status: exports.AwsAmplifyPluginResponseStatus.Ko,
90
+ };
91
+ if (typeof error !== 'string') {
92
+ return res;
93
+ }
94
+ if (error.includes('not authenticated')) {
95
+ res.status = exports.AwsAmplifyPluginResponseStatus.SignedOut;
96
+ }
97
+ return res;
98
+ }
93
99
  }
94
100
 
95
101
  var web = /*#__PURE__*/Object.freeze({
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["export var AwsAmplifyPluginResponseStatus;\n(function (AwsAmplifyPluginResponseStatus) {\n AwsAmplifyPluginResponseStatus[AwsAmplifyPluginResponseStatus[\"Ok\"] = 0] = \"Ok\";\n AwsAmplifyPluginResponseStatus[AwsAmplifyPluginResponseStatus[\"Ko\"] = -1] = \"Ko\";\n AwsAmplifyPluginResponseStatus[AwsAmplifyPluginResponseStatus[\"Cancelled\"] = -2] = \"Cancelled\";\n AwsAmplifyPluginResponseStatus[AwsAmplifyPluginResponseStatus[\"SignedOut\"] = -3] = \"SignedOut\";\n})(AwsAmplifyPluginResponseStatus || (AwsAmplifyPluginResponseStatus = {}));\nexport var CognitoHostedUIIdentityProvider;\n(function (CognitoHostedUIIdentityProvider) {\n CognitoHostedUIIdentityProvider[\"Cognito\"] = \"COGNITO\";\n CognitoHostedUIIdentityProvider[\"Google\"] = \"Google\";\n CognitoHostedUIIdentityProvider[\"Facebook\"] = \"Facebook\";\n CognitoHostedUIIdentityProvider[\"Amazon\"] = \"LoginWithAmazon\";\n CognitoHostedUIIdentityProvider[\"Apple\"] = \"SignInWithApple\";\n})(CognitoHostedUIIdentityProvider || (CognitoHostedUIIdentityProvider = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst AwsAmplify = registerPlugin('AwsAmplify', {\n web: () => import('./web').then(m => new m.AwsAmplifyWeb()),\n});\nexport * from './definitions';\nexport { AwsAmplify };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nimport { Amplify, Auth } from 'aws-amplify';\nimport { AwsAmplifyPluginResponseStatus } from './definitions';\nexport class AwsAmplifyWeb extends WebPlugin {\n async load(options) {\n this.cognitoConfig = options.cognitoConfig;\n Amplify.configure(Object.assign({}, options.cognitoConfig));\n }\n async signIn(options) {\n if (!this.cognitoConfig) {\n throw new Error('call load first');\n }\n try {\n const user = (await Auth.signIn(options.email, options.password));\n return this.getCognitoAuthSession(user, this.cognitoConfig.aws_cognito_identity_pool_id);\n }\n catch (error) {\n const res = {\n status: AwsAmplifyPluginResponseStatus.Ko,\n };\n return res;\n }\n }\n async federatedSignIn(options) {\n // console.log(LOG_PREFIX, options);\n if (!this.cognitoConfig) {\n throw new Error('call load first');\n }\n await Auth.federatedSignIn(options);\n return this.fetchAuthSession();\n }\n async fetchAuthSession() {\n if (!this.cognitoConfig) {\n throw new Error('call load first');\n }\n try {\n const user = await Auth.currentAuthenticatedUser();\n const cognitoAuthSession = this.getCognitoAuthSession(user, this.cognitoConfig.aws_cognito_identity_pool_id);\n return cognitoAuthSession;\n }\n catch (error) {\n console.log(error);\n const res = {\n status: AwsAmplifyPluginResponseStatus.Ko,\n };\n return res;\n }\n }\n async signOut() {\n if (!this.cognitoConfig) {\n throw new Error('call load first');\n }\n return Auth.signOut()\n .then(() => ({\n status: AwsAmplifyPluginResponseStatus.Ok,\n }))\n .catch(() => ({ status: AwsAmplifyPluginResponseStatus.Ko }));\n }\n getCognitoAuthSession(user, identityId) {\n const userSession = user.getSignInUserSession();\n const res = {\n accessToken: userSession === null || userSession === void 0 ? void 0 : userSession.getAccessToken().getJwtToken(),\n idToken: userSession === null || userSession === void 0 ? void 0 : userSession.getIdToken().getJwtToken(),\n identityId: identityId,\n refreshToken: userSession === null || userSession === void 0 ? void 0 : userSession.getRefreshToken().getToken(),\n deviceKey: userSession === null || userSession === void 0 ? void 0 : userSession.getAccessToken().decodePayload().device_key,\n status: userSession\n ? AwsAmplifyPluginResponseStatus.Ok\n : AwsAmplifyPluginResponseStatus.Ko,\n };\n return res;\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["AwsAmplifyPluginResponseStatus","CognitoHostedUIIdentityProvider","registerPlugin","WebPlugin","Amplify","Auth"],"mappings":";;;AAAWA,oDAA+B;IAC1C,CAAC,UAAU,8BAA8B,EAAE;IAC3C,IAAI,8BAA8B,CAAC,8BAA8B,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC;IACpF,IAAI,8BAA8B,CAAC,8BAA8B,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;IACrF,IAAI,8BAA8B,CAAC,8BAA8B,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC;IACnG,IAAI,8BAA8B,CAAC,8BAA8B,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC;IACnG,CAAC,EAAEA,sCAA8B,KAAKA,sCAA8B,GAAG,EAAE,CAAC,CAAC,CAAC;AACjEC,qDAAgC;IAC3C,CAAC,UAAU,+BAA+B,EAAE;IAC5C,IAAI,+BAA+B,CAAC,SAAS,CAAC,GAAG,SAAS,CAAC;IAC3D,IAAI,+BAA+B,CAAC,QAAQ,CAAC,GAAG,QAAQ,CAAC;IACzD,IAAI,+BAA+B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,CAAC;IACX,aAAa,KAAK,CAAC,OAAO,EAAE,MAAM,EAAEA,sCAA8B,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IAC1E,KAAK;IACL,IAAI,qBAAqB,CAAC,IAAI,EAAE,UAAU,EAAE;IAC5C,QAAQ,MAAM,WAAW,GAAG,IAAI,CAAC,oBAAoB,EAAE,CAAC;IACxD,QAAQ,MAAM,GAAG,GAAG;IACpB,YAAY,WAAW,EAAE,WAAW,KAAK,IAAI,IAAI,WAAW,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAG,WAAW,CAAC,cAAc,EAAE,CAAC,WAAW,EAAE;IAC7H,YAAY,OAAO,EAAE,WAAW,KAAK,IAAI,IAAI,WAAW,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAG,WAAW,CAAC,UAAU,EAAE,CAAC,WAAW,EAAE;IACrH,YAAY,UAAU,EAAE,UAAU;IAClC,YAAY,YAAY,EAAE,WAAW,KAAK,IAAI,IAAI,WAAW,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAG,WAAW,CAAC,eAAe,EAAE,CAAC,QAAQ,EAAE;IAC5H,YAAY,SAAS,EAAE,WAAW,KAAK,IAAI,IAAI,WAAW,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAG,WAAW,CAAC,cAAc,EAAE,CAAC,aAAa,EAAE,CAAC,UAAU;IACxI,YAAY,MAAM,EAAE,WAAW;IAC/B,kBAAkBA,sCAA8B,CAAC,EAAE;IACnD,kBAAkBA,sCAA8B,CAAC,EAAE;IACnD,SAAS,CAAC;IACV,QAAQ,OAAO,GAAG,CAAC;IACnB,KAAK;IACL;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"plugin.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["export var AwsAmplifyPluginResponseStatus;\n(function (AwsAmplifyPluginResponseStatus) {\n AwsAmplifyPluginResponseStatus[AwsAmplifyPluginResponseStatus[\"Ok\"] = 0] = \"Ok\";\n AwsAmplifyPluginResponseStatus[AwsAmplifyPluginResponseStatus[\"Ko\"] = -1] = \"Ko\";\n AwsAmplifyPluginResponseStatus[AwsAmplifyPluginResponseStatus[\"Cancelled\"] = -2] = \"Cancelled\";\n AwsAmplifyPluginResponseStatus[AwsAmplifyPluginResponseStatus[\"SignedOut\"] = -3] = \"SignedOut\";\n})(AwsAmplifyPluginResponseStatus || (AwsAmplifyPluginResponseStatus = {}));\nexport var CognitoHostedUIIdentityProvider;\n(function (CognitoHostedUIIdentityProvider) {\n CognitoHostedUIIdentityProvider[\"Cognito\"] = \"COGNITO\";\n CognitoHostedUIIdentityProvider[\"Google\"] = \"Google\";\n CognitoHostedUIIdentityProvider[\"Facebook\"] = \"Facebook\";\n CognitoHostedUIIdentityProvider[\"Amazon\"] = \"LoginWithAmazon\";\n CognitoHostedUIIdentityProvider[\"Apple\"] = \"SignInWithApple\";\n})(CognitoHostedUIIdentityProvider || (CognitoHostedUIIdentityProvider = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst AwsAmplify = registerPlugin('AwsAmplify', {\n web: () => import('./web').then(m => new m.AwsAmplifyWeb()),\n});\nexport * from './definitions';\nexport { AwsAmplify };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nimport { Amplify, Auth } from 'aws-amplify';\nimport { AwsAmplifyPluginResponseStatus } from './definitions';\nexport class AwsAmplifyWeb extends WebPlugin {\n async load(options) {\n this.cognitoConfig = options.cognitoConfig;\n Amplify.configure(Object.assign({}, options.cognitoConfig));\n }\n async signIn(options) {\n if (!this.cognitoConfig) {\n throw new Error('call load first');\n }\n try {\n const user = (await Auth.signIn(options.email, options.password));\n return this.getCognitoAuthSession(user, this.cognitoConfig.aws_cognito_identity_pool_id);\n }\n catch (error) {\n return this.handleError(error, 'signIn');\n }\n }\n async federatedSignIn(options) {\n // console.log(LOG_PREFIX, options);\n if (!this.cognitoConfig) {\n throw new Error('call load first');\n }\n await Auth.federatedSignIn(options);\n return this.fetchAuthSession();\n }\n async fetchAuthSession() {\n if (!this.cognitoConfig) {\n throw new Error('call load first');\n }\n try {\n const user = await Auth.currentAuthenticatedUser();\n const cognitoAuthSession = this.getCognitoAuthSession(user, this.cognitoConfig.aws_cognito_identity_pool_id);\n return cognitoAuthSession;\n }\n catch (error) {\n return this.handleError(error, 'fetchAuthSession');\n }\n }\n async signOut() {\n if (!this.cognitoConfig) {\n throw new Error('call load first');\n }\n return Auth.signOut()\n .then(() => ({\n status: AwsAmplifyPluginResponseStatus.Ok,\n }))\n .catch(error => this.handleError(error, 'signOut'));\n }\n getCognitoAuthSession(user, identityId) {\n const userSession = user.getSignInUserSession();\n const res = {\n accessToken: userSession === null || userSession === void 0 ? void 0 : userSession.getAccessToken().getJwtToken(),\n idToken: userSession === null || userSession === void 0 ? void 0 : userSession.getIdToken().getJwtToken(),\n identityId: identityId,\n refreshToken: userSession === null || userSession === void 0 ? void 0 : userSession.getRefreshToken().getToken(),\n deviceKey: userSession === null || userSession === void 0 ? void 0 : userSession.getAccessToken().decodePayload().device_key,\n status: userSession\n ? AwsAmplifyPluginResponseStatus.Ok\n : AwsAmplifyPluginResponseStatus.Ko,\n };\n return res;\n }\n handleError(error, from) {\n console.error(`[CAPACITOR AWS AMPLIFY] - error from ${from}: `, error);\n const res = {\n status: AwsAmplifyPluginResponseStatus.Ko,\n };\n if (typeof error !== 'string') {\n return res;\n }\n if (error.includes('not authenticated')) {\n res.status = AwsAmplifyPluginResponseStatus.SignedOut;\n }\n return res;\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["AwsAmplifyPluginResponseStatus","CognitoHostedUIIdentityProvider","registerPlugin","WebPlugin","Amplify","Auth"],"mappings":";;;AAAWA,oDAA+B;IAC1C,CAAC,UAAU,8BAA8B,EAAE;IAC3C,IAAI,8BAA8B,CAAC,8BAA8B,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC;IACpF,IAAI,8BAA8B,C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YAAY,MAAM,EAAE,WAAW;IAC/B,kBAAkBA,sCAA8B,CAAC,EAAE;IACnD,kBAAkBA,sCAA8B,CAAC,EAAE;IACnD,SAAS,CAAC;IACV,QAAQ,OAAO,GAAG,CAAC;IACnB,KAAK;IACL,IAAI,WAAW,CAAC,KAAK,EAAE,IAAI,EAAE;IAC7B,QAAQ,OAAO,CAAC,KAAK,CAAC,CAAC,qCAAqC,EAAE,IAAI,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;IAC/E,QAAQ,MAAM,GAAG,GAAG;IACpB,YAAY,MAAM,EAAEA,sCAA8B,CAAC,EAAE;IACrD,SAAS,CAAC;IACV,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;IACvC,YAAY,OAAO,GAAG,CAAC;IACvB,SAAS;IACT,QAAQ,IAAI,KAAK,CAAC,QAAQ,CAAC,mBAAmB,CAAC,EAAE;IACjD,YAAY,GAAG,CAAC,MAAM,GAAGA,sCAA8B,CAAC,SAAS,CAAC;IAClE,SAAS;IACT,QAAQ,OAAO,GAAG,CAAC;IACnB,KAAK;IACL;;;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@falconeta/capacitor-aws-amplify",
3
- "version": "0.0.9",
3
+ "version": "0.0.10",
4
4
  "description": "plugin that handle amplify features",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",