@symbiote-native/apple-authentication 0.0.0-stage → 0.1.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.
Files changed (78) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +264 -2
  3. package/build/angular/apple-authentication-button/index.d.ts +12 -0
  4. package/build/angular/apple-authentication-button/index.js +98 -0
  5. package/build/angular/index.d.ts +2 -0
  6. package/build/angular/index.js +3 -0
  7. package/build/core/apple-authentication-button.d.ts +20 -0
  8. package/build/core/apple-authentication-button.js +28 -0
  9. package/build/core/apple-authentication.d.ts +34 -0
  10. package/build/core/apple-authentication.js +85 -0
  11. package/build/core/constants.d.ts +2 -0
  12. package/build/core/constants.js +3 -0
  13. package/build/core/index.d.ts +5 -0
  14. package/build/core/index.js +4 -0
  15. package/build/core/native-module.d.ts +10 -0
  16. package/build/core/native-module.js +8 -0
  17. package/build/core/types.d.ts +104 -0
  18. package/build/core/types.js +56 -0
  19. package/build/react/apple-authentication-button.d.ts +6 -0
  20. package/build/react/apple-authentication-button.js +7 -0
  21. package/build/react/index.d.ts +3 -0
  22. package/build/react/index.js +3 -0
  23. package/build/solid/apple-authentication-button.d.ts +3 -0
  24. package/build/solid/apple-authentication-button.js +4 -0
  25. package/build/solid/index.d.ts +3 -0
  26. package/build/solid/index.js +3 -0
  27. package/build/svelte/apple-authentication-button.svelte +17 -0
  28. package/build/svelte/apple-authentication-button.svelte.d.ts +4 -0
  29. package/build/svelte/index.d.ts +2 -0
  30. package/build/svelte/index.js +3 -0
  31. package/build/vue/apple-authentication-button.d.ts +3 -0
  32. package/build/vue/apple-authentication-button.js +15 -0
  33. package/build/vue/index.d.ts +3 -0
  34. package/build/vue/index.js +3 -0
  35. package/build-ngc/angular/apple-authentication-button/index.d.ts +15 -0
  36. package/build-ngc/angular/apple-authentication-button/index.js +48 -0
  37. package/build-ngc/angular/apple-authentication-button/index.js.map +1 -0
  38. package/build-ngc/angular/index.d.ts +2 -0
  39. package/build-ngc/angular/index.js +4 -0
  40. package/build-ngc/angular/index.js.map +1 -0
  41. package/build-ngc/core/apple-authentication-button.d.ts +20 -0
  42. package/build-ngc/core/apple-authentication-button.js +29 -0
  43. package/build-ngc/core/apple-authentication-button.js.map +1 -0
  44. package/build-ngc/core/apple-authentication.d.ts +34 -0
  45. package/build-ngc/core/apple-authentication.js +86 -0
  46. package/build-ngc/core/apple-authentication.js.map +1 -0
  47. package/build-ngc/core/constants.d.ts +2 -0
  48. package/build-ngc/core/constants.js +4 -0
  49. package/build-ngc/core/constants.js.map +1 -0
  50. package/build-ngc/core/index.d.ts +5 -0
  51. package/build-ngc/core/index.js +5 -0
  52. package/build-ngc/core/index.js.map +1 -0
  53. package/build-ngc/core/native-module.d.ts +10 -0
  54. package/build-ngc/core/native-module.js +9 -0
  55. package/build-ngc/core/native-module.js.map +1 -0
  56. package/build-ngc/core/types.d.ts +104 -0
  57. package/build-ngc/core/types.js +57 -0
  58. package/build-ngc/core/types.js.map +1 -0
  59. package/native-link.json +11 -0
  60. package/package.json +145 -3
  61. package/src/angular/apple-authentication-button/index.ts +36 -0
  62. package/src/angular/index.ts +28 -0
  63. package/src/core/apple-authentication-button.ts +69 -0
  64. package/src/core/apple-authentication.ts +130 -0
  65. package/src/core/constants.ts +5 -0
  66. package/src/core/index.ts +31 -0
  67. package/src/core/native-module.ts +38 -0
  68. package/src/core/types.ts +121 -0
  69. package/src/react/apple-authentication-button.ts +12 -0
  70. package/src/react/index.ts +28 -0
  71. package/src/solid/apple-authentication-button.ts +9 -0
  72. package/src/solid/index.ts +28 -0
  73. package/src/svelte/apple-authentication-button.svelte +17 -0
  74. package/src/svelte/index.ts +4 -0
  75. package/src/svelte/svelte-ambient.d.ts +3 -0
  76. package/src/svelte/svelte-compile.test-helper.ts +6 -0
  77. package/src/vue/apple-authentication-button.ts +18 -0
  78. package/src/vue/index.ts +28 -0
@@ -0,0 +1,104 @@
1
+ /** Scopes for `signInAsync`, the user may deny any of them, so handle `null` fields */
2
+ export declare enum AppleAuthenticationScope {
3
+ FULL_NAME = 0,
4
+ EMAIL = 1
5
+ }
6
+ export declare enum AppleAuthenticationOperation {
7
+ /** An operation that depends on the particular kind of credential provider */
8
+ IMPLICIT = 0,
9
+ LOGIN = 1,
10
+ REFRESH = 2,
11
+ LOGOUT = 3
12
+ }
13
+ /** The state of a credential checked with `getCredentialStateAsync` */
14
+ export declare enum AppleAuthenticationCredentialState {
15
+ REVOKED = 0,
16
+ AUTHORIZED = 1,
17
+ NOT_FOUND = 2,
18
+ TRANSFERRED = 3
19
+ }
20
+ /** The system's guess of how likely the user is a real person */
21
+ export declare enum AppleAuthenticationUserDetectionStatus {
22
+ /** The system does not support this determination and there is no data */
23
+ UNSUPPORTED = 0,
24
+ /** The system has not determined whether the user might be a real person */
25
+ UNKNOWN = 1,
26
+ /** The user appears to be a real person */
27
+ LIKELY_REAL = 2
28
+ }
29
+ /** Which pre-defined text the button shows */
30
+ export declare enum AppleAuthenticationButtonType {
31
+ /** "Sign in with Apple" */
32
+ SIGN_IN = 0,
33
+ /** "Continue with Apple" */
34
+ CONTINUE = 1,
35
+ /**
36
+ * "Sign up with Apple"
37
+ * @platform ios 13.2+
38
+ */
39
+ SIGN_UP = 2
40
+ }
41
+ /** Which pre-defined color scheme the button uses */
42
+ export declare enum AppleAuthenticationButtonStyle {
43
+ /** White button with black text */
44
+ WHITE = 0,
45
+ /** White button with a black outline and black text */
46
+ WHITE_OUTLINE = 1,
47
+ /** Black button with white text */
48
+ BLACK = 2
49
+ }
50
+ /** The style a name is formatted in, see `formatFullName` */
51
+ export type IAppleAuthenticationFullNameFormatStyle = 'default' | 'short' | 'medium' | 'long' | 'abbreviated';
52
+ /** The tokenized portions of the user's name, only what the user allowed is not `null` */
53
+ export type IAppleAuthenticationFullName = {
54
+ namePrefix: string | null;
55
+ givenName: string | null;
56
+ middleName: string | null;
57
+ familyName: string | null;
58
+ nameSuffix: string | null;
59
+ nickname: string | null;
60
+ };
61
+ type IRequestOptions = {
62
+ /**
63
+ * Scopes the app asks for, they come only the first time a user signs in
64
+ * @default []
65
+ */
66
+ requestedScopes?: AppleAuthenticationScope[];
67
+ /** An arbitrary string returned unmodified in the credential, it guards against replay attacks */
68
+ state?: string;
69
+ };
70
+ /** Options for `signInAsync`, none is required */
71
+ export type IAppleAuthenticationSignInOptions = IRequestOptions & {
72
+ /** An arbitrary string that prevents replay attacks */
73
+ nonce?: string;
74
+ };
75
+ /** Options for `refreshAsync`, `user` is the id of the user whose credentials refresh */
76
+ export type IAppleAuthenticationRefreshOptions = IRequestOptions & {
77
+ user: string;
78
+ };
79
+ /** Options for `signOutAsync`, `user` is the id of the user to sign out */
80
+ export type IAppleAuthenticationSignOutOptions = {
81
+ user: string;
82
+ state?: string;
83
+ };
84
+ /** What a successful `signInAsync`, `refreshAsync` or `signOutAsync` resolves with */
85
+ export type IAppleAuthenticationCredential = {
86
+ /** Stable across apps of one development team, use it to check the user later */
87
+ user: string;
88
+ /** The `state` the request carried, `null` when none was given */
89
+ state: string | null;
90
+ /** `null` without the `FULL_NAME` scope, on a denial, or after the first sign-in */
91
+ fullName: IAppleAuthenticationFullName | null;
92
+ /** Obscured with an Apple domain when the user withholds the address */
93
+ email: string | null;
94
+ realUserStatus: AppleAuthenticationUserDetectionStatus;
95
+ /** A JSON Web Token with information about the user */
96
+ identityToken: string | null;
97
+ /** A short-lived session token for the app's server, it changes every session */
98
+ authorizationCode: string | null;
99
+ };
100
+ /** What the native module accepts: the options of a call plus the operation it performs */
101
+ export type IAppleAuthenticationRequest = (IAppleAuthenticationSignInOptions | IAppleAuthenticationRefreshOptions | IAppleAuthenticationSignOutOptions) & {
102
+ requestedOperation: AppleAuthenticationOperation;
103
+ };
104
+ export {};
@@ -0,0 +1,56 @@
1
+ // Типы и enum-ы `expo-apple-authentication`, порт `AppleAuthentication.types.ts`
2
+ /** Scopes for `signInAsync`, the user may deny any of them, so handle `null` fields */
3
+ export var AppleAuthenticationScope;
4
+ (function (AppleAuthenticationScope) {
5
+ AppleAuthenticationScope[AppleAuthenticationScope["FULL_NAME"] = 0] = "FULL_NAME";
6
+ AppleAuthenticationScope[AppleAuthenticationScope["EMAIL"] = 1] = "EMAIL";
7
+ })(AppleAuthenticationScope || (AppleAuthenticationScope = {}));
8
+ export var AppleAuthenticationOperation;
9
+ (function (AppleAuthenticationOperation) {
10
+ /** An operation that depends on the particular kind of credential provider */
11
+ AppleAuthenticationOperation[AppleAuthenticationOperation["IMPLICIT"] = 0] = "IMPLICIT";
12
+ AppleAuthenticationOperation[AppleAuthenticationOperation["LOGIN"] = 1] = "LOGIN";
13
+ AppleAuthenticationOperation[AppleAuthenticationOperation["REFRESH"] = 2] = "REFRESH";
14
+ AppleAuthenticationOperation[AppleAuthenticationOperation["LOGOUT"] = 3] = "LOGOUT";
15
+ })(AppleAuthenticationOperation || (AppleAuthenticationOperation = {}));
16
+ /** The state of a credential checked with `getCredentialStateAsync` */
17
+ export var AppleAuthenticationCredentialState;
18
+ (function (AppleAuthenticationCredentialState) {
19
+ AppleAuthenticationCredentialState[AppleAuthenticationCredentialState["REVOKED"] = 0] = "REVOKED";
20
+ AppleAuthenticationCredentialState[AppleAuthenticationCredentialState["AUTHORIZED"] = 1] = "AUTHORIZED";
21
+ AppleAuthenticationCredentialState[AppleAuthenticationCredentialState["NOT_FOUND"] = 2] = "NOT_FOUND";
22
+ AppleAuthenticationCredentialState[AppleAuthenticationCredentialState["TRANSFERRED"] = 3] = "TRANSFERRED";
23
+ })(AppleAuthenticationCredentialState || (AppleAuthenticationCredentialState = {}));
24
+ /** The system's guess of how likely the user is a real person */
25
+ export var AppleAuthenticationUserDetectionStatus;
26
+ (function (AppleAuthenticationUserDetectionStatus) {
27
+ /** The system does not support this determination and there is no data */
28
+ AppleAuthenticationUserDetectionStatus[AppleAuthenticationUserDetectionStatus["UNSUPPORTED"] = 0] = "UNSUPPORTED";
29
+ /** The system has not determined whether the user might be a real person */
30
+ AppleAuthenticationUserDetectionStatus[AppleAuthenticationUserDetectionStatus["UNKNOWN"] = 1] = "UNKNOWN";
31
+ /** The user appears to be a real person */
32
+ AppleAuthenticationUserDetectionStatus[AppleAuthenticationUserDetectionStatus["LIKELY_REAL"] = 2] = "LIKELY_REAL";
33
+ })(AppleAuthenticationUserDetectionStatus || (AppleAuthenticationUserDetectionStatus = {}));
34
+ /** Which pre-defined text the button shows */
35
+ export var AppleAuthenticationButtonType;
36
+ (function (AppleAuthenticationButtonType) {
37
+ /** "Sign in with Apple" */
38
+ AppleAuthenticationButtonType[AppleAuthenticationButtonType["SIGN_IN"] = 0] = "SIGN_IN";
39
+ /** "Continue with Apple" */
40
+ AppleAuthenticationButtonType[AppleAuthenticationButtonType["CONTINUE"] = 1] = "CONTINUE";
41
+ /**
42
+ * "Sign up with Apple"
43
+ * @platform ios 13.2+
44
+ */
45
+ AppleAuthenticationButtonType[AppleAuthenticationButtonType["SIGN_UP"] = 2] = "SIGN_UP";
46
+ })(AppleAuthenticationButtonType || (AppleAuthenticationButtonType = {}));
47
+ /** Which pre-defined color scheme the button uses */
48
+ export var AppleAuthenticationButtonStyle;
49
+ (function (AppleAuthenticationButtonStyle) {
50
+ /** White button with black text */
51
+ AppleAuthenticationButtonStyle[AppleAuthenticationButtonStyle["WHITE"] = 0] = "WHITE";
52
+ /** White button with a black outline and black text */
53
+ AppleAuthenticationButtonStyle[AppleAuthenticationButtonStyle["WHITE_OUTLINE"] = 1] = "WHITE_OUTLINE";
54
+ /** Black button with white text */
55
+ AppleAuthenticationButtonStyle[AppleAuthenticationButtonStyle["BLACK"] = 2] = "BLACK";
56
+ })(AppleAuthenticationButtonStyle || (AppleAuthenticationButtonStyle = {}));
@@ -0,0 +1,6 @@
1
+ import type { ReactElement } from 'react';
2
+ import type { IAppleAuthenticationButtonProps } from '../core/apple-authentication-button';
3
+ /** React twin of `expo-apple-authentication`'s `AppleAuthenticationButton`, iOS only */
4
+ export declare function AppleAuthenticationButton(props: IAppleAuthenticationButtonProps & {
5
+ className?: string;
6
+ }): ReactElement | null;
@@ -0,0 +1,7 @@
1
+ import { descriptorToReact } from '@symbiote-native/react';
2
+ import { renderAppleAuthenticationButton } from '../core/apple-authentication-button.js';
3
+ /** React twin of `expo-apple-authentication`'s `AppleAuthenticationButton`, iOS only */
4
+ export function AppleAuthenticationButton(props) {
5
+ const descriptor = renderAppleAuthenticationButton(props);
6
+ return descriptor ? descriptorToReact(descriptor) : null;
7
+ }
@@ -0,0 +1,3 @@
1
+ export { AppleAuthenticationButton } from './apple-authentication-button';
2
+ export type { IAppleAuthenticationButtonProps } from '../core';
3
+ export { APPLE_AUTHENTICATION_MODULE_NAME, AppleAuthenticationButtonStyle, AppleAuthenticationButtonType, AppleAuthenticationCredentialState, AppleAuthenticationOperation, AppleAuthenticationScope, AppleAuthenticationUserDetectionStatus, addRevokeListener, appleAuthenticationButtonViewName, formatFullName, getCredentialStateAsync, isAvailableAsync, refreshAsync, signInAsync, signOutAsync, type EventSubscription, type IAppleAuthenticationCredential, type IAppleAuthenticationFullName, type IAppleAuthenticationFullNameFormatStyle, type IAppleAuthenticationRefreshOptions, type IAppleAuthenticationSignInOptions, type IAppleAuthenticationSignOutOptions, } from '../core';
@@ -0,0 +1,3 @@
1
+ // @symbiote-native/apple-authentication/react: кнопка и поток входа на общем ядре
2
+ export { AppleAuthenticationButton } from './apple-authentication-button.js';
3
+ export { APPLE_AUTHENTICATION_MODULE_NAME, AppleAuthenticationButtonStyle, AppleAuthenticationButtonType, AppleAuthenticationCredentialState, AppleAuthenticationOperation, AppleAuthenticationScope, AppleAuthenticationUserDetectionStatus, addRevokeListener, appleAuthenticationButtonViewName, formatFullName, getCredentialStateAsync, isAvailableAsync, refreshAsync, signInAsync, signOutAsync, } from '../core/index.js';
@@ -0,0 +1,3 @@
1
+ import type { IAppleAuthenticationButtonProps } from '../core/apple-authentication-button';
2
+ /** Solid twin of `expo-apple-authentication`'s `AppleAuthenticationButton`, iOS only */
3
+ export declare const AppleAuthenticationButton: (props: IAppleAuthenticationButtonProps) => import("@symbiote-native/engine").ISymbioteNode | null;
@@ -0,0 +1,4 @@
1
+ import { defineOptionalDescriptorComponent } from '@symbiote-native/solid';
2
+ import { renderAppleAuthenticationButton } from '../core/apple-authentication-button.js';
3
+ /** Solid twin of `expo-apple-authentication`'s `AppleAuthenticationButton`, iOS only */
4
+ export const AppleAuthenticationButton = defineOptionalDescriptorComponent(renderAppleAuthenticationButton);
@@ -0,0 +1,3 @@
1
+ export { AppleAuthenticationButton } from './apple-authentication-button';
2
+ export type { IAppleAuthenticationButtonProps } from '../core';
3
+ export { APPLE_AUTHENTICATION_MODULE_NAME, AppleAuthenticationButtonStyle, AppleAuthenticationButtonType, AppleAuthenticationCredentialState, AppleAuthenticationOperation, AppleAuthenticationScope, AppleAuthenticationUserDetectionStatus, addRevokeListener, appleAuthenticationButtonViewName, formatFullName, getCredentialStateAsync, isAvailableAsync, refreshAsync, signInAsync, signOutAsync, type EventSubscription, type IAppleAuthenticationCredential, type IAppleAuthenticationFullName, type IAppleAuthenticationFullNameFormatStyle, type IAppleAuthenticationRefreshOptions, type IAppleAuthenticationSignInOptions, type IAppleAuthenticationSignOutOptions, } from '../core';
@@ -0,0 +1,3 @@
1
+ // @symbiote-native/apple-authentication/solid: кнопка и поток входа на общем ядре
2
+ export { AppleAuthenticationButton } from './apple-authentication-button.js';
3
+ export { APPLE_AUTHENTICATION_MODULE_NAME, AppleAuthenticationButtonStyle, AppleAuthenticationButtonType, AppleAuthenticationCredentialState, AppleAuthenticationOperation, AppleAuthenticationScope, AppleAuthenticationUserDetectionStatus, addRevokeListener, appleAuthenticationButtonViewName, formatFullName, getCredentialStateAsync, isAvailableAsync, refreshAsync, signInAsync, signOutAsync, } from '../core/index.js';
@@ -0,0 +1,17 @@
1
+ <script lang="ts">
2
+ // The native view name is mixed-case, which a literal tag would parse as a component reference,
3
+ // so the tag is dynamic
4
+ import { hostProps } from '@symbiote-native/svelte/native-view-bridge';
5
+ import { renderAppleAuthenticationButton } from '../core/apple-authentication-button';
6
+ import type { IAppleAuthenticationButtonProps } from '../core/apple-authentication-button';
7
+
8
+ const props: IAppleAuthenticationButtonProps = $props();
9
+ const descriptor = $derived(renderAppleAuthenticationButton({ ...props }));
10
+ </script>
11
+
12
+ {#if descriptor}
13
+ <svelte:element
14
+ this={descriptor.type}
15
+ {@attach hostProps(descriptor.props)}
16
+ />
17
+ {/if}
@@ -0,0 +1,4 @@
1
+ import type { IAppleAuthenticationButtonProps } from '../core/apple-authentication-button';
2
+ declare const AppleAuthenticationButton: import("svelte").Component<IAppleAuthenticationButtonProps, {}, "">;
3
+ type AppleAuthenticationButton = ReturnType<typeof AppleAuthenticationButton>;
4
+ export default AppleAuthenticationButton;
@@ -0,0 +1,2 @@
1
+ export { default as AppleAuthenticationButton } from './apple-authentication-button.svelte';
2
+ export * from '../core';
@@ -0,0 +1,3 @@
1
+ // @symbiote-native/apple-authentication/svelte: кнопка и поток входа на общем ядре
2
+ export { default as AppleAuthenticationButton } from './apple-authentication-button.svelte';
3
+ export * from '../core/index.js';
@@ -0,0 +1,3 @@
1
+ import { type VNode } from '@vue/runtime-core';
2
+ /** Vue twin of `expo-apple-authentication`'s `AppleAuthenticationButton`, iOS only */
3
+ export declare const AppleAuthenticationButton: import("vue").DefineComponent<{}, () => VNode | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,15 @@
1
+ import { defineComponent } from '@vue/runtime-core';
2
+ import { descriptorToVue, normalizeVueAttrs } from '@symbiote-native/vue';
3
+ import { renderAppleAuthenticationButton } from '../core/apple-authentication-button.js';
4
+ /** Vue twin of `expo-apple-authentication`'s `AppleAuthenticationButton`, iOS only */
5
+ export const AppleAuthenticationButton = defineComponent({
6
+ name: 'AppleAuthenticationButton',
7
+ // Все атрибуты это пропсы нативного view, на обёртку ничего не должно просочиться
8
+ inheritAttrs: false,
9
+ setup(_props, { attrs }) {
10
+ return () => {
11
+ const descriptor = renderAppleAuthenticationButton(normalizeVueAttrs(attrs));
12
+ return descriptor ? descriptorToVue(descriptor) : null;
13
+ };
14
+ },
15
+ });
@@ -0,0 +1,3 @@
1
+ export { AppleAuthenticationButton } from './apple-authentication-button';
2
+ export type { IAppleAuthenticationButtonProps } from '../core';
3
+ export { APPLE_AUTHENTICATION_MODULE_NAME, AppleAuthenticationButtonStyle, AppleAuthenticationButtonType, AppleAuthenticationCredentialState, AppleAuthenticationOperation, AppleAuthenticationScope, AppleAuthenticationUserDetectionStatus, addRevokeListener, appleAuthenticationButtonViewName, formatFullName, getCredentialStateAsync, isAvailableAsync, refreshAsync, signInAsync, signOutAsync, type EventSubscription, type IAppleAuthenticationCredential, type IAppleAuthenticationFullName, type IAppleAuthenticationFullNameFormatStyle, type IAppleAuthenticationRefreshOptions, type IAppleAuthenticationSignInOptions, type IAppleAuthenticationSignOutOptions, } from '../core';
@@ -0,0 +1,3 @@
1
+ // @symbiote-native/apple-authentication/vue: кнопка и поток входа на общем ядре
2
+ export { AppleAuthenticationButton } from './apple-authentication-button.js';
3
+ export { APPLE_AUTHENTICATION_MODULE_NAME, AppleAuthenticationButtonStyle, AppleAuthenticationButtonType, AppleAuthenticationCredentialState, AppleAuthenticationOperation, AppleAuthenticationScope, AppleAuthenticationUserDetectionStatus, addRevokeListener, appleAuthenticationButtonViewName, formatFullName, getCredentialStateAsync, isAvailableAsync, refreshAsync, signInAsync, signOutAsync, } from '../core/index.js';
@@ -0,0 +1,15 @@
1
+ import { NativeViewBase } from '@symbiote-native/angular';
2
+ import type { IDescriptor } from '@symbiote-native/components';
3
+ import type { IAppleAuthenticationButtonProps } from '../../core/apple-authentication-button';
4
+ import * as i0 from "@angular/core";
5
+ /** Angular twin of `expo-apple-authentication`'s `AppleAuthenticationButton`, iOS only */
6
+ export declare class AppleAuthenticationButton extends NativeViewBase {
7
+ onPress: IAppleAuthenticationButtonProps['onPress'];
8
+ buttonType: IAppleAuthenticationButtonProps['buttonType'];
9
+ buttonStyle: IAppleAuthenticationButtonProps['buttonStyle'];
10
+ cornerRadius?: IAppleAuthenticationButtonProps['cornerRadius'];
11
+ protected readonly propNames: readonly ["onPress", "buttonType", "buttonStyle", "cornerRadius"];
12
+ protected renderView(props: object): IDescriptor | null;
13
+ static ɵfac: i0.ɵɵFactoryDeclaration<AppleAuthenticationButton, never>;
14
+ static ɵcmp: i0.ɵɵComponentDeclaration<AppleAuthenticationButton, "AppleAuthenticationButton", never, { "onPress": { "alias": "onPress"; "required": true; }; "buttonType": { "alias": "buttonType"; "required": true; }; "buttonStyle": { "alias": "buttonStyle"; "required": true; }; "cornerRadius": { "alias": "cornerRadius"; "required": false; }; }, {}, never, never, true, never>;
15
+ }
@@ -0,0 +1,48 @@
1
+ import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
2
+ import { DescriptorOutlet, NativeViewBase } from '@symbiote-native/angular';
3
+ import { renderAppleAuthenticationButton } from '../../core/apple-authentication-button';
4
+ import * as i0 from "@angular/core";
5
+ /** Angular twin of `expo-apple-authentication`'s `AppleAuthenticationButton`, iOS only */
6
+ export class AppleAuthenticationButton extends NativeViewBase {
7
+ onPress;
8
+ buttonType;
9
+ buttonStyle;
10
+ cornerRadius;
11
+ propNames = [
12
+ 'onPress',
13
+ 'buttonType',
14
+ 'buttonStyle',
15
+ 'cornerRadius',
16
+ ];
17
+ renderView(props) {
18
+ return renderAppleAuthenticationButton(props);
19
+ }
20
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AppleAuthenticationButton, deps: null, target: i0.ɵɵFactoryTarget.Component });
21
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: AppleAuthenticationButton, isStandalone: true, selector: "AppleAuthenticationButton", inputs: { onPress: "onPress", buttonType: "buttonType", buttonStyle: "buttonStyle", cornerRadius: "cornerRadius" }, usesInheritance: true, ngImport: i0, template: `@if (descriptor; as node) {
22
+ <symbiote-descriptor-outlet [node]="node" />
23
+ }`, isInline: true, dependencies: [{ kind: "component", type: DescriptorOutlet, selector: "symbiote-descriptor-outlet", inputs: ["node"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
24
+ }
25
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AppleAuthenticationButton, decorators: [{
26
+ type: Component,
27
+ args: [{
28
+ selector: 'AppleAuthenticationButton',
29
+ standalone: true,
30
+ imports: [DescriptorOutlet],
31
+ changeDetection: ChangeDetectionStrategy.OnPush,
32
+ template: `@if (descriptor; as node) {
33
+ <symbiote-descriptor-outlet [node]="node" />
34
+ }`,
35
+ }]
36
+ }], propDecorators: { onPress: [{
37
+ type: Input,
38
+ args: [{ required: true }]
39
+ }], buttonType: [{
40
+ type: Input,
41
+ args: [{ required: true }]
42
+ }], buttonStyle: [{
43
+ type: Input,
44
+ args: [{ required: true }]
45
+ }], cornerRadius: [{
46
+ type: Input
47
+ }] } });
48
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/angular/apple-authentication-button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE5E,OAAO,EAAE,+BAA+B,EAAE,MAAM,wCAAwC,CAAC;;AAGzF,0FAA0F;AAU1F,MAAM,OAAO,yBAA0B,SAAQ,cAAc;IAE3D,OAAO,CAA8C;IAErD,UAAU,CAAiD;IAE3D,WAAW,CAAkD;IACpD,YAAY,CAAmD;IAE5C,SAAS,GAAG;QACtC,SAAS;QACT,YAAY;QACZ,aAAa;QACb,cAAc;KACiD,CAAC;IAE/C,UAAU,CAAC,KAAa;QACzC,OAAO,+BAA+B,CAAC,KAAK,CAAC,CAAC;IAChD,CAAC;uGAlBU,yBAAyB;2FAAzB,yBAAyB,gOAJ1B;;IAER,4DAJQ,gBAAgB;;2FAMf,yBAAyB;kBATrC,SAAS;mBAAC;oBACT,QAAQ,EAAE,2BAA2B;oBACrC,UAAU,EAAE,IAAI;oBAChB,OAAO,EAAE,CAAC,gBAAgB,CAAC;oBAC3B,eAAe,EAAE,uBAAuB,CAAC,MAAM;oBAC/C,QAAQ,EAAE;;IAER;iBACH;;sBAEE,KAAK;uBAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;;sBAExB,KAAK;uBAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;;sBAExB,KAAK;uBAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;;sBAExB,KAAK"}
@@ -0,0 +1,2 @@
1
+ export { AppleAuthenticationButton } from './apple-authentication-button';
2
+ export { APPLE_AUTHENTICATION_MODULE_NAME, AppleAuthenticationButtonStyle, AppleAuthenticationButtonType, AppleAuthenticationCredentialState, AppleAuthenticationOperation, AppleAuthenticationScope, AppleAuthenticationUserDetectionStatus, addRevokeListener, appleAuthenticationButtonViewName, formatFullName, getCredentialStateAsync, isAvailableAsync, refreshAsync, signInAsync, signOutAsync, type EventSubscription, type IAppleAuthenticationButtonProps, type IAppleAuthenticationCredential, type IAppleAuthenticationFullName, type IAppleAuthenticationFullNameFormatStyle, type IAppleAuthenticationRefreshOptions, type IAppleAuthenticationSignInOptions, type IAppleAuthenticationSignOutOptions, } from '../core';
@@ -0,0 +1,4 @@
1
+ // @symbiote-native/apple-authentication/angular: кнопка и поток входа на общем ядре
2
+ export { AppleAuthenticationButton } from './apple-authentication-button';
3
+ export { APPLE_AUTHENTICATION_MODULE_NAME, AppleAuthenticationButtonStyle, AppleAuthenticationButtonType, AppleAuthenticationCredentialState, AppleAuthenticationOperation, AppleAuthenticationScope, AppleAuthenticationUserDetectionStatus, addRevokeListener, appleAuthenticationButtonViewName, formatFullName, getCredentialStateAsync, isAvailableAsync, refreshAsync, signInAsync, signOutAsync, } from '../core';
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/angular/index.ts"],"names":[],"mappings":"AAAA,oFAAoF;AAEpF,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EACL,gCAAgC,EAChC,8BAA8B,EAC9B,6BAA6B,EAC7B,kCAAkC,EAClC,4BAA4B,EAC5B,wBAAwB,EACxB,sCAAsC,EACtC,iBAAiB,EACjB,iCAAiC,EACjC,cAAc,EACd,uBAAuB,EACvB,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,YAAY,GASb,MAAM,SAAS,CAAC"}
@@ -0,0 +1,20 @@
1
+ import type { IAccessibilityProps, IAriaProps, IDescriptor, IResponderProps } from '@symbiote-native/components';
2
+ import type { IStyleProp, ISymbioteEvent, IViewStyle } from '@symbiote-native/engine';
3
+ import type { AppleAuthenticationButtonStyle, AppleAuthenticationButtonType } from './types';
4
+ export type IAppleAuthenticationButtonProps = IAccessibilityProps & IAriaProps & IResponderProps & {
5
+ /** Call `signInAsync` in here */
6
+ onPress: () => void;
7
+ buttonType: AppleAuthenticationButtonType;
8
+ buttonStyle: AppleAuthenticationButtonStyle;
9
+ /** Works like `style.borderRadius` of a View */
10
+ cornerRadius?: number;
11
+ /** Needs a width and a height, or the button does not appear */
12
+ style?: IStyleProp<Omit<IViewStyle, 'backgroundColor' | 'borderRadius'>>;
13
+ testID?: string;
14
+ nativeID?: string;
15
+ onLayout?: (event: ISymbioteEvent) => void;
16
+ };
17
+ export declare const appleAuthenticationButtonViewName: () => string;
18
+ export declare function ensureAppleAuthenticationButtonRegistered(): boolean;
19
+ /** `null` means the caller renders nothing, the system button exists only on iOS */
20
+ export declare function renderAppleAuthenticationButton(props: object): IDescriptor | null;
@@ -0,0 +1,29 @@
1
+ // Ядро `AppleAuthenticationButton`: нативный view системной кнопки Sign in with Apple, только iOS
2
+ import { Platform, requireNativeViewManager } from 'expo-modules-core';
3
+ import { el } from '@symbiote-native/components';
4
+ import { defineExpoNativeView, isDevBuild } from '@symbiote-native/engine';
5
+ import { APPLE_AUTHENTICATION_MODULE_NAME } from './constants';
6
+ const PRESS_EVENT_PROP = 'onButtonPress';
7
+ // Регистрация идёт при рендере: побочный эффект барреля теряется в release
8
+ const buttonView = defineExpoNativeView(requireNativeViewManager, APPLE_AUTHENTICATION_MODULE_NAME);
9
+ export const appleAuthenticationButtonViewName = buttonView.name;
10
+ export function ensureAppleAuthenticationButtonRegistered() {
11
+ if (!Platform.select({ ios: true, default: false }))
12
+ return false;
13
+ return buttonView.ensureRegistered();
14
+ }
15
+ /** `null` means the caller renders nothing, the system button exists only on iOS */
16
+ export function renderAppleAuthenticationButton(props) {
17
+ if (!ensureAppleAuthenticationButtonRegistered()) {
18
+ if (isDevBuild()) {
19
+ console.warn("'AppleAuthenticationButton' is not available.");
20
+ }
21
+ return null;
22
+ }
23
+ const { onPress, ...viewProps } = Object.fromEntries(Object.entries(props));
24
+ return el(appleAuthenticationButtonViewName(), {
25
+ ...viewProps,
26
+ [PRESS_EVENT_PROP]: onPress,
27
+ });
28
+ }
29
+ //# sourceMappingURL=apple-authentication-button.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apple-authentication-button.js","sourceRoot":"","sources":["../../src/core/apple-authentication-button.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,OAAO,EAAE,QAAQ,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAAE,EAAE,EAAE,MAAM,6BAA6B,CAAC;AAOjD,OAAO,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAM3E,OAAO,EAAE,gCAAgC,EAAE,MAAM,aAAa,CAAC;AAM/D,MAAM,gBAAgB,GAAG,eAAe,CAAC;AAmBzC,2EAA2E;AAC3E,MAAM,UAAU,GAAG,oBAAoB,CACrC,wBAAwB,EACxB,gCAAgC,CACjC,CAAC;AAEF,MAAM,CAAC,MAAM,iCAAiC,GAAG,UAAU,CAAC,IAAI,CAAC;AAEjE,MAAM,UAAU,yCAAyC;IACvD,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;QAAE,OAAO,KAAK,CAAC;IAClE,OAAO,UAAU,CAAC,gBAAgB,EAAE,CAAC;AACvC,CAAC;AAED,oFAAoF;AACpF,MAAM,UAAU,+BAA+B,CAC7C,KAAa;IAEb,IAAI,CAAC,yCAAyC,EAAE,EAAE,CAAC;QACjD,IAAI,UAAU,EAAE,EAAE,CAAC;YACjB,OAAO,CAAC,IAAI,CAAC,+CAA+C,CAAC,CAAC;QAChE,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,EAAE,OAAO,EAAE,GAAG,SAAS,EAAE,GAAG,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;IAC5E,OAAO,EAAE,CAAC,iCAAiC,EAAE,EAAE;QAC7C,GAAG,SAAS;QACZ,CAAC,gBAAgB,CAAC,EAAE,OAAO;KAC5B,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,34 @@
1
+ import type { EventSubscription } from 'expo-modules-core';
2
+ import type { AppleAuthenticationCredentialState, IAppleAuthenticationCredential, IAppleAuthenticationFullName, IAppleAuthenticationFullNameFormatStyle, IAppleAuthenticationRefreshOptions, IAppleAuthenticationSignInOptions, IAppleAuthenticationSignOutOptions } from './types';
3
+ /**
4
+ * Whether the device's operating system supports Apple authentication
5
+ * @returns `true` when the system supports it, `false` otherwise
6
+ */
7
+ export declare function isAvailableAsync(): Promise<boolean>;
8
+ /**
9
+ * Starts the Apple authentication flow, which presents a modal over the app
10
+ * The credential carries the name and email only the first time a user signs in, store it
11
+ * @returns The credential, rejects with `ERR_REQUEST_CANCELED` when the user cancels
12
+ */
13
+ export declare function signInAsync(options?: IAppleAuthenticationSignInOptions): Promise<IAppleAuthenticationCredential>;
14
+ /**
15
+ * Refreshes the credentials of the logged-in user, the sign in modal shows first
16
+ * @returns The credential, rejects with `ERR_REQUEST_CANCELED` when the user cancels
17
+ */
18
+ export declare function refreshAsync(options: IAppleAuthenticationRefreshOptions): Promise<IAppleAuthenticationCredential>;
19
+ /**
20
+ * Ends the authenticated session, the sign in modal shows first
21
+ * Clearing the stored user data after `signInAsync` is the recommended way to sign out
22
+ * @returns The credential, rejects with `ERR_REQUEST_CANCELED` when the user cancels
23
+ */
24
+ export declare function signOutAsync(options: IAppleAuthenticationSignOutOptions): Promise<IAppleAuthenticationCredential>;
25
+ /**
26
+ * Whether the credential of a user is still valid or was revoked
27
+ * On the iOS simulator it always throws, test on a real device
28
+ * @param user The `user` field of an `IAppleAuthenticationCredential`
29
+ */
30
+ export declare function getCredentialStateAsync(user: string): Promise<AppleAuthenticationCredentialState>;
31
+ /** A locale-aware string of a person's name built from its tokenized portions */
32
+ export declare function formatFullName(fullName: IAppleAuthenticationFullName, formatStyle?: IAppleAuthenticationFullNameFormatStyle): string;
33
+ /** Calls the listener when the user revokes the credential of the app in the system settings */
34
+ export declare function addRevokeListener(listener: () => void): EventSubscription;
@@ -0,0 +1,86 @@
1
+ import { CodedError, UnavailabilityError } from 'expo-modules-core';
2
+ import { REVOKE_EVENT_NAME } from './constants';
3
+ import { expoAppleAuthentication } from './native-module';
4
+ import { AppleAuthenticationOperation } from './types';
5
+ const NATIVE_MODULE_NAME = 'expo-apple-authentication';
6
+ // Сообщение ссылается на имя вызванной функции, поэтому оно приходит параметром
7
+ async function requestCredential(functionName, request) {
8
+ if (!expoAppleAuthentication.requestAsync) {
9
+ throw new UnavailabilityError(NATIVE_MODULE_NAME, functionName);
10
+ }
11
+ return expoAppleAuthentication.requestAsync(request);
12
+ }
13
+ // Вход и обновление возвращают токены, без них учётные данные бесполезны
14
+ async function requestCompleteCredential(functionName, request) {
15
+ const credential = await requestCredential(functionName, request);
16
+ if (!credential.authorizationCode ||
17
+ !credential.identityToken ||
18
+ !credential.user) {
19
+ throw new CodedError('ERR_REQUEST_FAILED', `The credential returned by \`${functionName}\` is missing one or more required fields.`);
20
+ }
21
+ return credential;
22
+ }
23
+ /**
24
+ * Whether the device's operating system supports Apple authentication
25
+ * @returns `true` when the system supports it, `false` otherwise
26
+ */
27
+ export async function isAvailableAsync() {
28
+ if (!expoAppleAuthentication.isAvailableAsync)
29
+ return false;
30
+ return expoAppleAuthentication.isAvailableAsync();
31
+ }
32
+ /**
33
+ * Starts the Apple authentication flow, which presents a modal over the app
34
+ * The credential carries the name and email only the first time a user signs in, store it
35
+ * @returns The credential, rejects with `ERR_REQUEST_CANCELED` when the user cancels
36
+ */
37
+ export async function signInAsync(options) {
38
+ return requestCompleteCredential('signInAsync', {
39
+ ...options,
40
+ requestedOperation: AppleAuthenticationOperation.LOGIN,
41
+ });
42
+ }
43
+ /**
44
+ * Refreshes the credentials of the logged-in user, the sign in modal shows first
45
+ * @returns The credential, rejects with `ERR_REQUEST_CANCELED` when the user cancels
46
+ */
47
+ export async function refreshAsync(options) {
48
+ return requestCompleteCredential('refreshAsync', {
49
+ ...options,
50
+ requestedOperation: AppleAuthenticationOperation.REFRESH,
51
+ });
52
+ }
53
+ /**
54
+ * Ends the authenticated session, the sign in modal shows first
55
+ * Clearing the stored user data after `signInAsync` is the recommended way to sign out
56
+ * @returns The credential, rejects with `ERR_REQUEST_CANCELED` when the user cancels
57
+ */
58
+ export async function signOutAsync(options) {
59
+ return requestCredential('signOutAsync', {
60
+ ...options,
61
+ requestedOperation: AppleAuthenticationOperation.LOGOUT,
62
+ });
63
+ }
64
+ /**
65
+ * Whether the credential of a user is still valid or was revoked
66
+ * On the iOS simulator it always throws, test on a real device
67
+ * @param user The `user` field of an `IAppleAuthenticationCredential`
68
+ */
69
+ export async function getCredentialStateAsync(user) {
70
+ if (!expoAppleAuthentication.getCredentialStateAsync) {
71
+ throw new UnavailabilityError(NATIVE_MODULE_NAME, 'getCredentialStateAsync');
72
+ }
73
+ return expoAppleAuthentication.getCredentialStateAsync(user);
74
+ }
75
+ /** A locale-aware string of a person's name built from its tokenized portions */
76
+ export function formatFullName(fullName, formatStyle) {
77
+ if (!expoAppleAuthentication.formatFullName) {
78
+ throw new UnavailabilityError(NATIVE_MODULE_NAME, 'formatFullName');
79
+ }
80
+ return expoAppleAuthentication.formatFullName(fullName, formatStyle);
81
+ }
82
+ /** Calls the listener when the user revokes the credential of the app in the system settings */
83
+ export function addRevokeListener(listener) {
84
+ return expoAppleAuthentication.addListener(REVOKE_EVENT_NAME, listener);
85
+ }
86
+ //# sourceMappingURL=apple-authentication.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apple-authentication.js","sourceRoot":"","sources":["../../src/core/apple-authentication.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAEpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,4BAA4B,EAAE,MAAM,SAAS,CAAC;AAYvD,MAAM,kBAAkB,GAAG,2BAA2B,CAAC;AAEvD,gFAAgF;AAChF,KAAK,UAAU,iBAAiB,CAC9B,YAAoB,EACpB,OAAoC;IAEpC,IAAI,CAAC,uBAAuB,CAAC,YAAY,EAAE,CAAC;QAC1C,MAAM,IAAI,mBAAmB,CAAC,kBAAkB,EAAE,YAAY,CAAC,CAAC;IAClE,CAAC;IACD,OAAO,uBAAuB,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;AACvD,CAAC;AAED,yEAAyE;AACzE,KAAK,UAAU,yBAAyB,CACtC,YAAoB,EACpB,OAAoC;IAEpC,MAAM,UAAU,GAAG,MAAM,iBAAiB,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IAClE,IACE,CAAC,UAAU,CAAC,iBAAiB;QAC7B,CAAC,UAAU,CAAC,aAAa;QACzB,CAAC,UAAU,CAAC,IAAI,EAChB,CAAC;QACD,MAAM,IAAI,UAAU,CAClB,oBAAoB,EACpB,gCAAgC,YAAY,4CAA4C,CACzF,CAAC;IACJ,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB;IACpC,IAAI,CAAC,uBAAuB,CAAC,gBAAgB;QAAE,OAAO,KAAK,CAAC;IAC5D,OAAO,uBAAuB,CAAC,gBAAgB,EAAE,CAAC;AACpD,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,OAA2C;IAE3C,OAAO,yBAAyB,CAAC,aAAa,EAAE;QAC9C,GAAG,OAAO;QACV,kBAAkB,EAAE,4BAA4B,CAAC,KAAK;KACvD,CAAC,CAAC;AACL,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,OAA2C;IAE3C,OAAO,yBAAyB,CAAC,cAAc,EAAE;QAC/C,GAAG,OAAO;QACV,kBAAkB,EAAE,4BAA4B,CAAC,OAAO;KACzD,CAAC,CAAC;AACL,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,OAA2C;IAE3C,OAAO,iBAAiB,CAAC,cAAc,EAAE;QACvC,GAAG,OAAO;QACV,kBAAkB,EAAE,4BAA4B,CAAC,MAAM;KACxD,CAAC,CAAC;AACL,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,IAAY;IAEZ,IAAI,CAAC,uBAAuB,CAAC,uBAAuB,EAAE,CAAC;QACrD,MAAM,IAAI,mBAAmB,CAC3B,kBAAkB,EAClB,yBAAyB,CAC1B,CAAC;IACJ,CAAC;IACD,OAAO,uBAAuB,CAAC,uBAAuB,CAAC,IAAI,CAAC,CAAC;AAC/D,CAAC;AAED,iFAAiF;AACjF,MAAM,UAAU,cAAc,CAC5B,QAAsC,EACtC,WAAqD;IAErD,IAAI,CAAC,uBAAuB,CAAC,cAAc,EAAE,CAAC;QAC5C,MAAM,IAAI,mBAAmB,CAAC,kBAAkB,EAAE,gBAAgB,CAAC,CAAC;IACtE,CAAC;IACD,OAAO,uBAAuB,CAAC,cAAc,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;AACvE,CAAC;AAED,gGAAgG;AAChG,MAAM,UAAU,iBAAiB,CAAC,QAAoB;IACpD,OAAO,uBAAuB,CAAC,WAAW,CAAC,iBAAiB,EAAE,QAAQ,CAAC,CAAC;AAC1E,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const APPLE_AUTHENTICATION_MODULE_NAME = "ExpoAppleAuthentication";
2
+ export declare const REVOKE_EVENT_NAME = "Expo.appleIdCredentialRevoked";
@@ -0,0 +1,4 @@
1
+ // Отдельно от `native-module`: оно резолвит нативный модуль при импорте, а имя нужно и view
2
+ export const APPLE_AUTHENTICATION_MODULE_NAME = 'ExpoAppleAuthentication';
3
+ export const REVOKE_EVENT_NAME = 'Expo.appleIdCredentialRevoked';
4
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/core/constants.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAE5F,MAAM,CAAC,MAAM,gCAAgC,GAAG,yBAAyB,CAAC;AAE1E,MAAM,CAAC,MAAM,iBAAiB,GAAG,+BAA+B,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { addRevokeListener, formatFullName, getCredentialStateAsync, isAvailableAsync, refreshAsync, signInAsync, signOutAsync, } from './apple-authentication';
2
+ export { appleAuthenticationButtonViewName, ensureAppleAuthenticationButtonRegistered, renderAppleAuthenticationButton, type IAppleAuthenticationButtonProps, } from './apple-authentication-button';
3
+ export { APPLE_AUTHENTICATION_MODULE_NAME } from './constants';
4
+ export { AppleAuthenticationButtonStyle, AppleAuthenticationButtonType, AppleAuthenticationCredentialState, AppleAuthenticationOperation, AppleAuthenticationScope, AppleAuthenticationUserDetectionStatus, type IAppleAuthenticationCredential, type IAppleAuthenticationFullName, type IAppleAuthenticationFullNameFormatStyle, type IAppleAuthenticationRefreshOptions, type IAppleAuthenticationSignInOptions, type IAppleAuthenticationSignOutOptions, } from './types';
5
+ export type { EventSubscription } from 'expo-modules-core';
@@ -0,0 +1,5 @@
1
+ export { addRevokeListener, formatFullName, getCredentialStateAsync, isAvailableAsync, refreshAsync, signInAsync, signOutAsync, } from './apple-authentication';
2
+ export { appleAuthenticationButtonViewName, ensureAppleAuthenticationButtonRegistered, renderAppleAuthenticationButton, } from './apple-authentication-button';
3
+ export { APPLE_AUTHENTICATION_MODULE_NAME } from './constants';
4
+ export { AppleAuthenticationButtonStyle, AppleAuthenticationButtonType, AppleAuthenticationCredentialState, AppleAuthenticationOperation, AppleAuthenticationScope, AppleAuthenticationUserDetectionStatus, } from './types';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,uBAAuB,EACvB,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,YAAY,GACb,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,iCAAiC,EACjC,yCAAyC,EACzC,+BAA+B,GAEhC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,gCAAgC,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EACL,8BAA8B,EAC9B,6BAA6B,EAC7B,kCAAkC,EAClC,4BAA4B,EAC5B,wBAAwB,EACxB,sCAAsC,GAOvC,MAAM,SAAS,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { EventSubscription } from 'expo-modules-core';
2
+ import type { IAppleAuthenticationCredential, IAppleAuthenticationFullName, IAppleAuthenticationFullNameFormatStyle, IAppleAuthenticationRequest, AppleAuthenticationCredentialState } from './types';
3
+ export type INativeAppleAuthenticationModule = {
4
+ addListener(eventName: string, listener: () => void): EventSubscription;
5
+ isAvailableAsync?(): Promise<boolean>;
6
+ requestAsync?(options: IAppleAuthenticationRequest): Promise<IAppleAuthenticationCredential>;
7
+ getCredentialStateAsync?(user: string): Promise<AppleAuthenticationCredentialState>;
8
+ formatFullName?(fullName: IAppleAuthenticationFullName, formatStyle?: IAppleAuthenticationFullNameFormatStyle): string;
9
+ };
10
+ export declare const expoAppleAuthentication: INativeAppleAuthenticationModule;
@@ -0,0 +1,9 @@
1
+ import { requireOptionalNativeModule } from 'expo-modules-core';
2
+ import { APPLE_AUTHENTICATION_MODULE_NAME } from './constants';
3
+ // Вместо `null` на неподдерживаемой платформе, чтобы `isAvailableAsync` отвечал `false`
4
+ const unsupportedModule = {
5
+ isAvailableAsync: () => Promise.resolve(false),
6
+ addListener: () => ({ remove: () => undefined }),
7
+ };
8
+ export const expoAppleAuthentication = requireOptionalNativeModule(APPLE_AUTHENTICATION_MODULE_NAME) ?? unsupportedModule;
9
+ //# sourceMappingURL=native-module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"native-module.js","sourceRoot":"","sources":["../../src/core/native-module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAEhE,OAAO,EAAE,gCAAgC,EAAE,MAAM,aAAa,CAAC;AA0B/D,wFAAwF;AACxF,MAAM,iBAAiB,GAAqC;IAC1D,gBAAgB,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC;IAC9C,WAAW,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,SAAS,EAAE,CAAC;CACjD,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAClC,2BAA2B,CACzB,gCAAgC,CACjC,IAAI,iBAAiB,CAAC"}