expo-apple-authentication 4.0.2 → 4.2.0

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/CHANGELOG.md CHANGED
@@ -10,7 +10,13 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
- ## 4.0.22021-10-15
13
+ ## 4.2.0 — 2022-04-18
14
+
15
+ ### 💡 Others
16
+
17
+ - Updated `@expo/config-plugins` from `4.0.2` to `4.0.14` ([#15621](https://github.com/expo/expo/pull/15621) by [@EvanBacon](https://github.com/EvanBacon))
18
+
19
+ ## 4.1.0 — 2021-12-03
14
20
 
15
21
  _This version does not introduce any user-facing changes._
16
22
 
package/README.md CHANGED
@@ -4,16 +4,16 @@ This library provides Apple authentication for iOS standalone apps in the manage
4
4
 
5
5
  # API documentation
6
6
 
7
- - [Documentation for the master branch](https://github.com/expo/expo/blob/master/docs/pages/versions/unversioned/sdk/apple-authentication.md)
8
- - [Documentation for the latest stable release](https://docs.expo.io/versions/latest/sdk/apple-authentication/)
7
+ - [Documentation for the main branch](https://github.com/expo/expo/blob/main/docs/pages/versions/unversioned/sdk/apple-authentication.md)
8
+ - [Documentation for the latest stable release](https://docs.expo.dev/versions/latest/sdk/apple-authentication/)
9
9
 
10
10
  # Installation in managed Expo projects
11
11
 
12
- For managed [managed](https://docs.expo.io/versions/latest/introduction/managed-vs-bare/) Expo projects, please follow the installation instructions in the [API documentation for the latest stable release](https://docs.expo.io/versions/latest/sdk/apple-authentication/).
12
+ For [managed](https://docs.expo.dev/versions/latest/introduction/managed-vs-bare/) Expo projects, please follow the installation instructions in the [API documentation for the latest stable release](https://docs.expo.dev/versions/latest/sdk/apple-authentication/).
13
13
 
14
14
  # Installation in bare React Native projects
15
15
 
16
- For bare React Native projects, you must ensure that you have [installed and configured the `react-native-unimodules` package](https://github.com/expo/expo/tree/master/packages/react-native-unimodules) before continuing.
16
+ For bare React Native projects, you must ensure that you have [installed and configured the `expo` package](https://docs.expo.dev/bare/installing-expo-modules/) before continuing.
17
17
 
18
18
  ### Add the package to your npm dependencies
19
19
 
@@ -25,7 +25,29 @@ export declare function isAvailableAsync(): Promise<boolean>;
25
25
  * sign-in operation.
26
26
  */
27
27
  export declare function signInAsync(options?: AppleAuthenticationSignInOptions): Promise<AppleAuthenticationCredential>;
28
+ /**
29
+ * An operation that refreshes the logged-in user’s credentials.
30
+ * Calling this method will show the sign in modal before actually refreshing the user credentials.
31
+ *
32
+ * @param options An [`AppleAuthenticationRefreshOptions`](#appleauthenticationrefreshoptions) object
33
+ * @returns A promise that fulfills with an [`AppleAuthenticationCredential`](#appleauthenticationcredential)
34
+ * object after a successful authentication, and rejects with `ERR_CANCELED` if the user cancels the
35
+ * refresh operation.
36
+ */
28
37
  export declare function refreshAsync(options: AppleAuthenticationRefreshOptions): Promise<AppleAuthenticationCredential>;
38
+ /**
39
+ * An operation that ends the authenticated session.
40
+ * Calling this method will show the sign in modal before actually signing the user out.
41
+ *
42
+ * It is not recommended to use this method to sign out the user as it works counterintuitively.
43
+ * Instead of using this method it is recommended to simply clear all the user's data collected
44
+ * from using [`signInAsync`](./#signinasync) or [`refreshAsync`](./#refreshasync) methods.
45
+ *
46
+ * @param options An [`AppleAuthenticationSignOutOptions`](#appleauthenticationsignoutoptions) object
47
+ * @returns A promise that fulfills with an [`AppleAuthenticationCredential`](#appleauthenticationcredential)
48
+ * object after a successful authentication, and rejects with `ERR_CANCELED` if the user cancels the
49
+ * sign-out operation.
50
+ */
29
51
  export declare function signOutAsync(options: AppleAuthenticationSignOutOptions): Promise<AppleAuthenticationCredential>;
30
52
  /**
31
53
  * Queries the current state of a user credential, to determine if it is still valid or if it has been revoked.
@@ -39,3 +61,4 @@ export declare function signOutAsync(options: AppleAuthenticationSignOutOptions)
39
61
  export declare function getCredentialStateAsync(user: string): Promise<AppleAuthenticationCredentialState>;
40
62
  export declare function addRevokeListener(listener: () => void): Subscription;
41
63
  export { Subscription };
64
+ //# sourceMappingURL=AppleAuthentication.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AppleAuthentication.d.ts","sourceRoot":"","sources":["../src/AppleAuthentication.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,YAAY,EAAuB,MAAM,mBAAmB,CAAC;AAEhG,OAAO,EACL,6BAA6B,EAC7B,kCAAkC,EAElC,iCAAiC,EACjC,gCAAgC,EAChC,iCAAiC,EAClC,MAAM,6BAA6B,CAAC;AAIrC;;;GAGG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,OAAO,CAAC,CAKzD;AAGD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,WAAW,CAC/B,OAAO,CAAC,EAAE,gCAAgC,GACzC,OAAO,CAAC,6BAA6B,CAAC,CAgBxC;AAGD;;;;;;;;GAQG;AACH,wBAAsB,YAAY,CAChC,OAAO,EAAE,iCAAiC,GACzC,OAAO,CAAC,6BAA6B,CAAC,CAgBxC;AAGD;;;;;;;;;;;;GAYG;AACH,wBAAsB,YAAY,CAChC,OAAO,EAAE,iCAAiC,GACzC,OAAO,CAAC,6BAA6B,CAAC,CASxC;AAGD;;;;;;;;GAQG;AACH,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,kCAAkC,CAAC,CAK7C;AAKD,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,YAAY,CAEpE;AAED,OAAO,EAAE,YAAY,EAAE,CAAC"}
@@ -46,7 +46,16 @@ export async function signInAsync(options) {
46
46
  }
47
47
  return credential;
48
48
  }
49
- // @docsMissing
49
+ // @needsAudit
50
+ /**
51
+ * An operation that refreshes the logged-in user’s credentials.
52
+ * Calling this method will show the sign in modal before actually refreshing the user credentials.
53
+ *
54
+ * @param options An [`AppleAuthenticationRefreshOptions`](#appleauthenticationrefreshoptions) object
55
+ * @returns A promise that fulfills with an [`AppleAuthenticationCredential`](#appleauthenticationcredential)
56
+ * object after a successful authentication, and rejects with `ERR_CANCELED` if the user cancels the
57
+ * refresh operation.
58
+ */
50
59
  export async function refreshAsync(options) {
51
60
  if (!ExpoAppleAuthentication || !ExpoAppleAuthentication.requestAsync) {
52
61
  throw new UnavailabilityError('expo-apple-authentication', 'refreshAsync');
@@ -61,7 +70,20 @@ export async function refreshAsync(options) {
61
70
  }
62
71
  return credential;
63
72
  }
64
- // @docsMissing
73
+ // @needsAudit
74
+ /**
75
+ * An operation that ends the authenticated session.
76
+ * Calling this method will show the sign in modal before actually signing the user out.
77
+ *
78
+ * It is not recommended to use this method to sign out the user as it works counterintuitively.
79
+ * Instead of using this method it is recommended to simply clear all the user's data collected
80
+ * from using [`signInAsync`](./#signinasync) or [`refreshAsync`](./#refreshasync) methods.
81
+ *
82
+ * @param options An [`AppleAuthenticationSignOutOptions`](#appleauthenticationsignoutoptions) object
83
+ * @returns A promise that fulfills with an [`AppleAuthenticationCredential`](#appleauthenticationcredential)
84
+ * object after a successful authentication, and rejects with `ERR_CANCELED` if the user cancels the
85
+ * sign-out operation.
86
+ */
65
87
  export async function signOutAsync(options) {
66
88
  if (!ExpoAppleAuthentication || !ExpoAppleAuthentication.requestAsync) {
67
89
  throw new UnavailabilityError('expo-apple-authentication', 'signOutAsync');
@@ -1 +1 @@
1
- {"version":3,"file":"AppleAuthentication.js","sourceRoot":"","sources":["../src/AppleAuthentication.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAgB,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAEhG,OAAO,EAGL,4BAA4B,GAI7B,MAAM,6BAA6B,CAAC;AACrC,OAAO,uBAAuB,MAAM,2BAA2B,CAAC;AAEhE,cAAc;AACd;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB;IACpC,IAAI,CAAC,uBAAuB,IAAI,CAAC,uBAAuB,CAAC,gBAAgB,EAAE;QACzE,OAAO,KAAK,CAAC;KACd;IACD,OAAO,uBAAuB,CAAC,gBAAgB,EAAE,CAAC;AACpD,CAA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ChC,OAA0C;IAE1C,IAAI,CAAC,uBAAuB,IAAI,CAAC,uBAAuB,CAAC,YAAY,EAAE;QACrE,MAAM,IAAI,mBAAmB,CAAC,2BAA2B,EAAE,cAAc,CAAC,CAAC;KAC5E;IACD,MAAM,cAAc,GAAG;QACrB,GAAG,OAAO;QACV,kBAAkB,EAAE,4BAA4B,CAAC,MAAM;KACxD,CAAC;IACF,OAAO,uBAAuB,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC;AAC9D,CAAC;AAED,cAAc;AACd;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,IAAY;IAEZ,IAAI,CAAC,uBAAuB,IAAI,CAAC,uBAAuB,CAAC,uBAAuB,EAAE;QAChF,MAAM,IAAI,mBAAmB,CAAC,2BAA2B,EAAE,yBAAyB,CAAC,CAAC;KACvF;IACD,OAAO,uBAAuB,CAAC,uBAAuB,CAAC,IAAI,CAAC,CAAC;AAC/D,CAAC;AAED,MAAM,mCAAmC,GAAG,IAAI,YAAY,CAAC,uBAAuB,CAAC,CAAC;AAEtF,eAAe;AACf,MAAM,UAAU,iBAAiB,CAAC,QAAoB;IACpD,OAAO,mCAAmC,CAAC,WAAW,CAAC,+BAA+B,EAAE,QAAQ,CAAC,CAAC;AACpG,CAAC","sourcesContent":["import { CodedError, EventEmitter, Subscription, UnavailabilityError } from 'expo-modules-core';\n\nimport {\n AppleAuthenticationCredential,\n AppleAuthenticationCredentialState,\n AppleAuthenticationOperation,\n AppleAuthenticationRefreshOptions,\n AppleAuthenticationSignInOptions,\n AppleAuthenticationSignOutOptions,\n} from './AppleAuthentication.types';\nimport ExpoAppleAuthentication from './ExpoAppleAuthentication';\n\n// @needsAudit\n/**\n * Determine if the current device's operating system supports Apple authentication.\n * @return A promise that fulfills with `true` if the system supports Apple authentication, and `false` otherwise.\n */\nexport async function isAvailableAsync(): Promise<boolean> {\n if (!ExpoAppleAuthentication || !ExpoAppleAuthentication.isAvailableAsync) {\n return false;\n }\n return ExpoAppleAuthentication.isAvailableAsync();\n}\n\n// @needsAudit\n/**\n * Sends a request to the operating system to initiate the Apple authentication flow, which will\n * present a modal to the user over your app and allow them to sign in.\n *\n * You can request access to the user's full name and email address in this method, which allows you\n * to personalize your UI for signed in users. However, users can deny access to either or both\n * of these options at runtime.\n *\n * Additionally, you will only receive Apple Authentication Credentials the first time users sign\n * into your app, so you must store it for later use. It's best to store this information either\n * server-side, or using [SecureStore](./securestore), so that the data persists across app installs.\n * You can use [`AppleAuthenticationCredential.user`](#appleauthenticationcredential) to identify\n * the user, since this remains the same for apps released by the same developer.\n *\n * @param options An optional [`AppleAuthenticationSignInOptions`](#appleauthenticationsigninoptions) object\n * @return A promise that fulfills with an [`AppleAuthenticationCredential`](#appleauthenticationcredential)\n * object after a successful authentication, and rejects with `ERR_CANCELED` if the user cancels the\n * sign-in operation.\n */\nexport async function signInAsync(\n options?: AppleAuthenticationSignInOptions\n): Promise<AppleAuthenticationCredential> {\n if (!ExpoAppleAuthentication || !ExpoAppleAuthentication.requestAsync) {\n throw new UnavailabilityError('expo-apple-authentication', 'signInAsync');\n }\n const requestOptions = {\n ...options,\n requestedOperation: AppleAuthenticationOperation.LOGIN,\n };\n const credential = await ExpoAppleAuthentication.requestAsync(requestOptions);\n if (!credential.authorizationCode || !credential.identityToken || !credential.user) {\n throw new CodedError(\n 'ERR_APPLE_AUTHENTICATION_REQUEST_FAILED',\n 'The credential returned by `signInAsync` is missing one or more required fields.'\n );\n }\n return credential;\n}\n\n// @docsMissing\nexport async function refreshAsync(\n options: AppleAuthenticationRefreshOptions\n): Promise<AppleAuthenticationCredential> {\n if (!ExpoAppleAuthentication || !ExpoAppleAuthentication.requestAsync) {\n throw new UnavailabilityError('expo-apple-authentication', 'refreshAsync');\n }\n const requestOptions = {\n ...options,\n requestedOperation: AppleAuthenticationOperation.REFRESH,\n };\n const credential = await ExpoAppleAuthentication.requestAsync(requestOptions);\n if (!credential.authorizationCode || !credential.identityToken || !credential.user) {\n throw new CodedError(\n 'ERR_APPLE_AUTHENTICATION_REQUEST_FAILED',\n 'The credential returned by `refreshAsync` is missing one or more required fields.'\n );\n }\n return credential;\n}\n\n// @docsMissing\nexport async function signOutAsync(\n options: AppleAuthenticationSignOutOptions\n): Promise<AppleAuthenticationCredential> {\n if (!ExpoAppleAuthentication || !ExpoAppleAuthentication.requestAsync) {\n throw new UnavailabilityError('expo-apple-authentication', 'signOutAsync');\n }\n const requestOptions = {\n ...options,\n requestedOperation: AppleAuthenticationOperation.LOGOUT,\n };\n return ExpoAppleAuthentication.requestAsync(requestOptions);\n}\n\n// @needsAudit\n/**\n * Queries the current state of a user credential, to determine if it is still valid or if it has been revoked.\n * > **Note:** This method must be tested on a real device. On the iOS simulator it always throws an error.\n *\n * @param user The unique identifier for the user whose credential state you'd like to check.\n * This should come from the user field of an [`AppleAuthenticationCredential`](#appleauthenticationcredentialstate) object.\n * @return A promise that fulfills with an [`AppleAuthenticationCredentialState`](#appleauthenticationcredentialstate)\n * value depending on the state of the credential.\n */\nexport async function getCredentialStateAsync(\n user: string\n): Promise<AppleAuthenticationCredentialState> {\n if (!ExpoAppleAuthentication || !ExpoAppleAuthentication.getCredentialStateAsync) {\n throw new UnavailabilityError('expo-apple-authentication', 'getCredentialStateAsync');\n }\n return ExpoAppleAuthentication.getCredentialStateAsync(user);\n}\n\nconst ExpoAppleAuthenticationEventEmitter = new EventEmitter(ExpoAppleAuthentication);\n\n// @docsMissing\nexport function addRevokeListener(listener: () => void): Subscription {\n return ExpoAppleAuthenticationEventEmitter.addListener('Expo.appleIdCredentialRevoked', listener);\n}\n\nexport { Subscription };\n"]}
1
+ {"version":3,"file":"AppleAuthentication.js","sourceRoot":"","sources":["../src/AppleAuthentication.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAgB,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAEhG,OAAO,EAGL,4BAA4B,GAI7B,MAAM,6BAA6B,CAAC;AACrC,OA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C,CAAC;IAC9E,IAAI,CAAC,UAAU,CAAC,iBAAiB,IAAI,CAAC,UAAU,CAAC,aAAa,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE;QAClF,MAAM,IAAI,UAAU,CAClB,yCAAyC,EACzC,mFAAmF,CACpF,CAAC;KACH;IACD,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,cAAc;AACd;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,OAA0C;IAE1C,IAAI,CAAC,uBAAuB,IAAI,CAAC,uBAAuB,CAAC,YAAY,EAAE;QACrE,MAAM,IAAI,mBAAmB,CAAC,2BAA2B,EAAE,cAAc,CAAC,CAAC;KAC5E;IACD,MAAM,cAAc,GAAG;QACrB,GAAG,OAAO;QACV,kBAAkB,EAAE,4BAA4B,CAAC,MAAM;KACxD,CAAC;IACF,OAAO,uBAAuB,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC;AAC9D,CAAC;AAED,cAAc;AACd;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,IAAY;IAEZ,IAAI,CAAC,uBAAuB,IAAI,CAAC,uBAAuB,CAAC,uBAAuB,EAAE;QAChF,MAAM,IAAI,mBAAmB,CAAC,2BAA2B,EAAE,yBAAyB,CAAC,CAAC;KACvF;IACD,OAAO,uBAAuB,CAAC,uBAAuB,CAAC,IAAI,CAAC,CAAC;AAC/D,CAAC;AAED,MAAM,mCAAmC,GAAG,IAAI,YAAY,CAAC,uBAAuB,CAAC,CAAC;AAEtF,eAAe;AACf,MAAM,UAAU,iBAAiB,CAAC,QAAoB;IACpD,OAAO,mCAAmC,CAAC,WAAW,CAAC,+BAA+B,EAAE,QAAQ,CAAC,CAAC;AACpG,CAAC","sourcesContent":["import { CodedError, EventEmitter, Subscription, UnavailabilityError } from 'expo-modules-core';\n\nimport {\n AppleAuthenticationCredential,\n AppleAuthenticationCredentialState,\n AppleAuthenticationOperation,\n AppleAuthenticationRefreshOptions,\n AppleAuthenticationSignInOptions,\n AppleAuthenticationSignOutOptions,\n} from './AppleAuthentication.types';\nimport ExpoAppleAuthentication from './ExpoAppleAuthentication';\n\n// @needsAudit\n/**\n * Determine if the current device's operating system supports Apple authentication.\n * @return A promise that fulfills with `true` if the system supports Apple authentication, and `false` otherwise.\n */\nexport async function isAvailableAsync(): Promise<boolean> {\n if (!ExpoAppleAuthentication || !ExpoAppleAuthentication.isAvailableAsync) {\n return false;\n }\n return ExpoAppleAuthentication.isAvailableAsync();\n}\n\n// @needsAudit\n/**\n * Sends a request to the operating system to initiate the Apple authentication flow, which will\n * present a modal to the user over your app and allow them to sign in.\n *\n * You can request access to the user's full name and email address in this method, which allows you\n * to personalize your UI for signed in users. However, users can deny access to either or both\n * of these options at runtime.\n *\n * Additionally, you will only receive Apple Authentication Credentials the first time users sign\n * into your app, so you must store it for later use. It's best to store this information either\n * server-side, or using [SecureStore](./securestore), so that the data persists across app installs.\n * You can use [`AppleAuthenticationCredential.user`](#appleauthenticationcredential) to identify\n * the user, since this remains the same for apps released by the same developer.\n *\n * @param options An optional [`AppleAuthenticationSignInOptions`](#appleauthenticationsigninoptions) object\n * @return A promise that fulfills with an [`AppleAuthenticationCredential`](#appleauthenticationcredential)\n * object after a successful authentication, and rejects with `ERR_CANCELED` if the user cancels the\n * sign-in operation.\n */\nexport async function signInAsync(\n options?: AppleAuthenticationSignInOptions\n): Promise<AppleAuthenticationCredential> {\n if (!ExpoAppleAuthentication || !ExpoAppleAuthentication.requestAsync) {\n throw new UnavailabilityError('expo-apple-authentication', 'signInAsync');\n }\n const requestOptions = {\n ...options,\n requestedOperation: AppleAuthenticationOperation.LOGIN,\n };\n const credential = await ExpoAppleAuthentication.requestAsync(requestOptions);\n if (!credential.authorizationCode || !credential.identityToken || !credential.user) {\n throw new CodedError(\n 'ERR_APPLE_AUTHENTICATION_REQUEST_FAILED',\n 'The credential returned by `signInAsync` is missing one or more required fields.'\n );\n }\n return credential;\n}\n\n// @needsAudit\n/**\n * An operation that refreshes the logged-in user’s credentials.\n * Calling this method will show the sign in modal before actually refreshing the user credentials.\n *\n * @param options An [`AppleAuthenticationRefreshOptions`](#appleauthenticationrefreshoptions) object\n * @returns A promise that fulfills with an [`AppleAuthenticationCredential`](#appleauthenticationcredential)\n * object after a successful authentication, and rejects with `ERR_CANCELED` if the user cancels the\n * refresh operation.\n */\nexport async function refreshAsync(\n options: AppleAuthenticationRefreshOptions\n): Promise<AppleAuthenticationCredential> {\n if (!ExpoAppleAuthentication || !ExpoAppleAuthentication.requestAsync) {\n throw new UnavailabilityError('expo-apple-authentication', 'refreshAsync');\n }\n const requestOptions = {\n ...options,\n requestedOperation: AppleAuthenticationOperation.REFRESH,\n };\n const credential = await ExpoAppleAuthentication.requestAsync(requestOptions);\n if (!credential.authorizationCode || !credential.identityToken || !credential.user) {\n throw new CodedError(\n 'ERR_APPLE_AUTHENTICATION_REQUEST_FAILED',\n 'The credential returned by `refreshAsync` is missing one or more required fields.'\n );\n }\n return credential;\n}\n\n// @needsAudit\n/**\n * An operation that ends the authenticated session.\n * Calling this method will show the sign in modal before actually signing the user out.\n *\n * It is not recommended to use this method to sign out the user as it works counterintuitively.\n * Instead of using this method it is recommended to simply clear all the user's data collected\n * from using [`signInAsync`](./#signinasync) or [`refreshAsync`](./#refreshasync) methods.\n *\n * @param options An [`AppleAuthenticationSignOutOptions`](#appleauthenticationsignoutoptions) object\n * @returns A promise that fulfills with an [`AppleAuthenticationCredential`](#appleauthenticationcredential)\n * object after a successful authentication, and rejects with `ERR_CANCELED` if the user cancels the\n * sign-out operation.\n */\nexport async function signOutAsync(\n options: AppleAuthenticationSignOutOptions\n): Promise<AppleAuthenticationCredential> {\n if (!ExpoAppleAuthentication || !ExpoAppleAuthentication.requestAsync) {\n throw new UnavailabilityError('expo-apple-authentication', 'signOutAsync');\n }\n const requestOptions = {\n ...options,\n requestedOperation: AppleAuthenticationOperation.LOGOUT,\n };\n return ExpoAppleAuthentication.requestAsync(requestOptions);\n}\n\n// @needsAudit\n/**\n * Queries the current state of a user credential, to determine if it is still valid or if it has been revoked.\n * > **Note:** This method must be tested on a real device. On the iOS simulator it always throws an error.\n *\n * @param user The unique identifier for the user whose credential state you'd like to check.\n * This should come from the user field of an [`AppleAuthenticationCredential`](#appleauthenticationcredentialstate) object.\n * @return A promise that fulfills with an [`AppleAuthenticationCredentialState`](#appleauthenticationcredentialstate)\n * value depending on the state of the credential.\n */\nexport async function getCredentialStateAsync(\n user: string\n): Promise<AppleAuthenticationCredentialState> {\n if (!ExpoAppleAuthentication || !ExpoAppleAuthentication.getCredentialStateAsync) {\n throw new UnavailabilityError('expo-apple-authentication', 'getCredentialStateAsync');\n }\n return ExpoAppleAuthentication.getCredentialStateAsync(user);\n}\n\nconst ExpoAppleAuthenticationEventEmitter = new EventEmitter(ExpoAppleAuthentication);\n\n// @docsMissing\nexport function addRevokeListener(listener: () => void): Subscription {\n return ExpoAppleAuthenticationEventEmitter.addListener('Expo.appleIdCredentialRevoked', listener);\n}\n\nexport { Subscription };\n"]}
@@ -252,3 +252,4 @@ export declare enum AppleAuthenticationButtonStyle {
252
252
  */
253
253
  BLACK = 2
254
254
  }
255
+ //# sourceMappingURL=AppleAuthentication.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AppleAuthentication.types.d.ts","sourceRoot":"","sources":["../src/AppleAuthentication.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAG/D,MAAM,CAAC,OAAO,MAAM,8BAA8B,GAAG,SAAS,GAAG;IAC/D;;;OAGG;IACH,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB;;OAEG;IACH,UAAU,EAAE,6BAA6B,CAAC;IAC1C;;OAEG;IACH,WAAW,EAAE,8BAA8B,CAAC;IAC5C;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,KAAK,CAAC,EAAE,SAA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AE,MAAM,GAAG,IAAI,CAAC;IAC1B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,CAAC;AAGF;;;;;;;;;GASG;AACH,oBAAY,wBAAwB;IAClC,SAAS,IAAI;IACb,KAAK,IAAI;CACV;AAGD,oBAAY,4BAA4B;IACtC;;OAEG;IACH,QAAQ,IAAI;IACZ,KAAK,IAAI;IACT,OAAO,IAAI;IACX,MAAM,IAAI;CACX;AAGD;;;;;;GAMG;AACH,oBAAY,kCAAkC;IAC5C,OAAO,IAAI;IACX,UAAU,IAAI;IACd,SAAS,IAAI;IACb,WAAW,IAAI;CAChB;AAGD;;;;;;GAMG;AACH,oBAAY,sCAAsC;IAChD;;OAEG;IACH,WAAW,IAAI;IACf;;OAEG;IACH,OAAO,IAAI;IACX;;OAEG;IACH,WAAW,IAAI;CAChB;AAGD;;GAEG;AACH,oBAAY,6BAA6B;IACvC;;OAEG;IACH,OAAO,IAAI;IACX;;OAEG;IACH,QAAQ,IAAI;IACZ;;OAEG;IACH,OAAO,IAAI;CACZ;AAGD;;GAEG;AACH,oBAAY,8BAA8B;IACxC;;OAEG;IACH,KAAK,IAAI;IACT;;OAEG;IACH,aAAa,IAAI;IACjB;;OAEG;IACH,KAAK,IAAI;CACV"}
@@ -25,3 +25,4 @@ import { AppleAuthenticationButtonProps } from './AppleAuthentication.types';
25
25
  */
26
26
  declare const AppleAuthenticationButton: React.FC<AppleAuthenticationButtonProps>;
27
27
  export default AppleAuthenticationButton;
28
+ //# sourceMappingURL=AppleAuthenticationButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AppleAuthenticationButton.d.ts","sourceRoot":"","sources":["../src/AppleAuthenticationButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EACL,8BAA8B,EAG/B,MAAM,6BAA6B,CAAC;AAcrC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,QAAA,MAAM,yBAAyB,EAAE,KAAK,CAAC,EAAE,CAAC,8BAA8B,CAgBvE,CAAC;AA0BF,eAAe,yBAAyB,CAAC"}
@@ -1,2 +1,3 @@
1
1
  declare const _default: import("expo-modules-core").ProxyNativeModule;
2
2
  export default _default;
3
+ //# sourceMappingURL=ExpoAppleAuthentication.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExpoAppleAuthentication.d.ts","sourceRoot":"","sources":["../src/ExpoAppleAuthentication.ts"],"names":[],"mappings":";AAEA,wBAKY"}
@@ -8,3 +8,4 @@ declare let ExpoAppleAuthenticationButtonSignUpWhite: any;
8
8
  declare let ExpoAppleAuthenticationButtonSignUpWhiteOutline: any;
9
9
  declare let ExpoAppleAuthenticationButtonSignUpBlack: any;
10
10
  export { ExpoAppleAuthenticationButtonSignInWhite, ExpoAppleAuthenticationButtonSignInWhiteOutline, ExpoAppleAuthenticationButtonSignInBlack, ExpoAppleAuthenticationButtonContinueWhite, ExpoAppleAuthenticationButtonContinueWhiteOutline, ExpoAppleAuthenticationButtonContinueBlack, ExpoAppleAuthenticationButtonSignUpWhite, ExpoAppleAuthenticationButtonSignUpWhiteOutline, ExpoAppleAuthenticationButtonSignUpBlack, };
11
+ //# sourceMappingURL=ExpoAppleAuthenticationButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExpoAppleAuthenticationButton.d.ts","sourceRoot":"","sources":["../src/ExpoAppleAuthenticationButton.ts"],"names":[],"mappings":"AAGA,QAAA,IAAI,wCAAwC,EAAE,GAAG,CAAC;AAClD,QAAA,IAAI,+CAA+C,EAAE,GAAG,CAAC;AACzD,QAAA,IAAI,wCAAwC,EAAE,GAAG,CAAC;AAClD,QAAA,IAAI,0CAA0C,EAAE,GAAG,CAAC;AACpD,QAAA,IAAI,iDAAiD,EAAE,GAAG,CAAC;AAC3D,QAAA,IAAI,0CAA0C,EAAE,GAAG,CAAC;AACpD,QAAA,IAAI,wCAAwC,EAAE,GAAG,CAAC;AAClD,QAAA,IAAI,+CAA+C,EAAE,GAAG,CAAC;AACzD,QAAA,IAAI,wCAAwC,EAAE,GAAG,CAAC;AAgClD,OAAO,EACL,wCAAwC,EACxC,+CAA+C,EAC/C,wCAAwC,EACxC,0CAA0C,EAC1C,iDAAiD,EACjD,0CAA0C,EAC1C,wCAAwC,EACxC,+CAA+C,EAC/C,wCAAwC,GACzC,CAAC"}
package/build/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from './AppleAuthentication';
2
2
  export * from './AppleAuthentication.types';
3
3
  export { default as AppleAuthenticationButton } from './AppleAuthenticationButton';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAAM,6BAA6B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-apple-authentication",
3
- "version": "4.0.2",
3
+ "version": "4.2.0",
4
4
  "description": "A unimodule that provides SignIn With Apple",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -32,11 +32,13 @@
32
32
  "license": "MIT",
33
33
  "homepage": "https://docs.expo.dev/versions/latest/sdk/apple-authentication/",
34
34
  "dependencies": {
35
- "@expo/config-plugins": "^3.1.0",
36
- "expo-modules-core": "~0.4.3"
35
+ "@expo/config-plugins": "^4.0.14"
37
36
  },
38
37
  "devDependencies": {
39
38
  "expo-module-scripts": "^2.0.0"
40
39
  },
41
- "gitHead": "d23e1ac491da96b51c25eb2533efcd56499ee287"
40
+ "peerDependencies": {
41
+ "expo": "*"
42
+ },
43
+ "gitHead": "89a27c0ca0ca8becd7546697298e874a15e94faf"
42
44
  }
@@ -4,7 +4,7 @@ const config_plugins_1 = require("@expo/config-plugins");
4
4
  const withAppleAuthIOS_1 = require("./withAppleAuthIOS");
5
5
  const pkg = require('expo-apple-authentication/package.json');
6
6
  const withAppleAuth = (config) => {
7
- config = withAppleAuthIOS_1.withAppleAuthIOS(config);
7
+ config = (0, withAppleAuthIOS_1.withAppleAuthIOS)(config);
8
8
  return config;
9
9
  };
10
- exports.default = config_plugins_1.createRunOncePlugin(withAppleAuth, pkg.name, pkg.version);
10
+ exports.default = (0, config_plugins_1.createRunOncePlugin)(withAppleAuth, pkg.name, pkg.version);
@@ -10,7 +10,7 @@ const config_plugins_1 = require("@expo/config-plugins");
10
10
  * @returns
11
11
  */
12
12
  const withIOSMixedLocales = (config) => {
13
- return config_plugins_1.withInfoPlist(config, (config) => {
13
+ return (0, config_plugins_1.withInfoPlist)(config, (config) => {
14
14
  var _a;
15
15
  config.modResults.CFBundleAllowMixedLocalizations =
16
16
  (_a = config.modResults.CFBundleAllowMixedLocalizations) !== null && _a !== void 0 ? _a : true;
@@ -19,8 +19,8 @@ const withIOSMixedLocales = (config) => {
19
19
  };
20
20
  exports.withIOSMixedLocales = withIOSMixedLocales;
21
21
  const withAppleAuthIOS = (config) => {
22
- config = exports.withIOSMixedLocales(config);
23
- return config_plugins_1.withEntitlementsPlist(config, (config) => {
22
+ config = (0, exports.withIOSMixedLocales)(config);
23
+ return (0, config_plugins_1.withEntitlementsPlist)(config, (config) => {
24
24
  config.modResults['com.apple.developer.applesignin'] = ['Default'];
25
25
  return config;
26
26
  });
@@ -62,7 +62,16 @@ export async function signInAsync(
62
62
  return credential;
63
63
  }
64
64
 
65
- // @docsMissing
65
+ // @needsAudit
66
+ /**
67
+ * An operation that refreshes the logged-in user’s credentials.
68
+ * Calling this method will show the sign in modal before actually refreshing the user credentials.
69
+ *
70
+ * @param options An [`AppleAuthenticationRefreshOptions`](#appleauthenticationrefreshoptions) object
71
+ * @returns A promise that fulfills with an [`AppleAuthenticationCredential`](#appleauthenticationcredential)
72
+ * object after a successful authentication, and rejects with `ERR_CANCELED` if the user cancels the
73
+ * refresh operation.
74
+ */
66
75
  export async function refreshAsync(
67
76
  options: AppleAuthenticationRefreshOptions
68
77
  ): Promise<AppleAuthenticationCredential> {
@@ -83,7 +92,20 @@ export async function refreshAsync(
83
92
  return credential;
84
93
  }
85
94
 
86
- // @docsMissing
95
+ // @needsAudit
96
+ /**
97
+ * An operation that ends the authenticated session.
98
+ * Calling this method will show the sign in modal before actually signing the user out.
99
+ *
100
+ * It is not recommended to use this method to sign out the user as it works counterintuitively.
101
+ * Instead of using this method it is recommended to simply clear all the user's data collected
102
+ * from using [`signInAsync`](./#signinasync) or [`refreshAsync`](./#refreshasync) methods.
103
+ *
104
+ * @param options An [`AppleAuthenticationSignOutOptions`](#appleauthenticationsignoutoptions) object
105
+ * @returns A promise that fulfills with an [`AppleAuthenticationCredential`](#appleauthenticationcredential)
106
+ * object after a successful authentication, and rejects with `ERR_CANCELED` if the user cancels the
107
+ * sign-out operation.
108
+ */
87
109
  export async function signOutAsync(
88
110
  options: AppleAuthenticationSignOutOptions
89
111
  ): Promise<AppleAuthenticationCredential> {