@kiosinc/commons-rn 0.1.61 → 0.1.63

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 (103) hide show
  1. package/lib/commonjs/api/customer.js +75 -0
  2. package/lib/commonjs/api/customer.js.map +1 -0
  3. package/lib/commonjs/auth/hooks/useAuthentication.js +6 -0
  4. package/lib/commonjs/auth/hooks/useAuthentication.js.map +1 -1
  5. package/lib/commonjs/auth/hooks/useTermsOfService.js +8 -10
  6. package/lib/commonjs/auth/hooks/useTermsOfService.js.map +1 -1
  7. package/lib/commonjs/auth/providers/authentication/AuthenticationProvider.js +2 -1
  8. package/lib/commonjs/auth/providers/authentication/AuthenticationProvider.js.map +1 -1
  9. package/lib/commonjs/auth/providers/authentication/reducer/authentication.reducer.js +19 -1
  10. package/lib/commonjs/auth/providers/authentication/reducer/authentication.reducer.js.map +1 -1
  11. package/lib/commonjs/hooks/useCheckCustomer.js +57 -0
  12. package/lib/commonjs/hooks/useCheckCustomer.js.map +1 -0
  13. package/lib/commonjs/hooks/useCustomer.js +251 -0
  14. package/lib/commonjs/hooks/useCustomer.js.map +1 -0
  15. package/lib/commonjs/index.js +32 -0
  16. package/lib/commonjs/index.js.map +1 -1
  17. package/lib/commonjs/screens/SavedCards/CardRow.js +79 -0
  18. package/lib/commonjs/screens/SavedCards/CardRow.js.map +1 -0
  19. package/lib/commonjs/screens/SavedCards/SavedCards.js +180 -0
  20. package/lib/commonjs/screens/SavedCards/SavedCards.js.map +1 -0
  21. package/lib/commonjs/selectBusiness/queryKeys.js +6 -1
  22. package/lib/commonjs/selectBusiness/queryKeys.js.map +1 -1
  23. package/lib/commonjs/types/customer.d.js +7 -0
  24. package/lib/commonjs/types/customer.d.js.map +1 -0
  25. package/lib/commonjs/utils/checkout.js +11 -0
  26. package/lib/commonjs/utils/checkout.js.map +1 -0
  27. package/lib/commonjs/utils/currency.js +17 -0
  28. package/lib/commonjs/utils/currency.js.map +1 -0
  29. package/lib/commonjs/utils/square.js +39 -0
  30. package/lib/commonjs/utils/square.js.map +1 -0
  31. package/lib/module/api/customer.js +59 -0
  32. package/lib/module/api/customer.js.map +1 -0
  33. package/lib/module/auth/hooks/useAuthentication.js +6 -0
  34. package/lib/module/auth/hooks/useAuthentication.js.map +1 -1
  35. package/lib/module/auth/hooks/useTermsOfService.js +8 -10
  36. package/lib/module/auth/hooks/useTermsOfService.js.map +1 -1
  37. package/lib/module/auth/providers/authentication/AuthenticationProvider.js +2 -1
  38. package/lib/module/auth/providers/authentication/AuthenticationProvider.js.map +1 -1
  39. package/lib/module/auth/providers/authentication/reducer/authentication.reducer.js +19 -1
  40. package/lib/module/auth/providers/authentication/reducer/authentication.reducer.js.map +1 -1
  41. package/lib/module/hooks/useCheckCustomer.js +50 -0
  42. package/lib/module/hooks/useCheckCustomer.js.map +1 -0
  43. package/lib/module/hooks/useCustomer.js +243 -0
  44. package/lib/module/hooks/useCustomer.js.map +1 -0
  45. package/lib/module/index.js +4 -0
  46. package/lib/module/index.js.map +1 -1
  47. package/lib/module/screens/SavedCards/CardRow.js +71 -0
  48. package/lib/module/screens/SavedCards/CardRow.js.map +1 -0
  49. package/lib/module/screens/SavedCards/SavedCards.js +170 -0
  50. package/lib/module/screens/SavedCards/SavedCards.js.map +1 -0
  51. package/lib/module/selectBusiness/queryKeys.js +6 -1
  52. package/lib/module/selectBusiness/queryKeys.js.map +1 -1
  53. package/lib/module/types/customer.d.js +5 -0
  54. package/lib/module/types/customer.d.js.map +1 -0
  55. package/lib/module/utils/checkout.js +4 -0
  56. package/lib/module/utils/checkout.js.map +1 -0
  57. package/lib/module/utils/currency.js +10 -0
  58. package/lib/module/utils/currency.js.map +1 -0
  59. package/lib/module/utils/square.js +36 -0
  60. package/lib/module/utils/square.js.map +1 -0
  61. package/lib/typescript/src/api/customer.d.ts +23 -0
  62. package/lib/typescript/src/api/customer.d.ts.map +1 -0
  63. package/lib/typescript/src/auth/hooks/useAuthentication.d.ts.map +1 -1
  64. package/lib/typescript/src/auth/hooks/useTermsOfService.d.ts.map +1 -1
  65. package/lib/typescript/src/auth/providers/authentication/AuthenticationProvider.d.ts.map +1 -1
  66. package/lib/typescript/src/auth/providers/authentication/reducer/authentication.reducer.d.ts.map +1 -1
  67. package/lib/typescript/src/auth/providers/authentication/types/authentication.types.d.ts +1 -0
  68. package/lib/typescript/src/auth/providers/authentication/types/authentication.types.d.ts.map +1 -1
  69. package/lib/typescript/src/hooks/useCheckCustomer.d.ts +4 -0
  70. package/lib/typescript/src/hooks/useCheckCustomer.d.ts.map +1 -0
  71. package/lib/typescript/src/hooks/useCustomer.d.ts +58 -0
  72. package/lib/typescript/src/hooks/useCustomer.d.ts.map +1 -0
  73. package/lib/typescript/src/index.d.ts +4 -0
  74. package/lib/typescript/src/index.d.ts.map +1 -1
  75. package/lib/typescript/src/screens/SavedCards/CardRow.d.ts +11 -0
  76. package/lib/typescript/src/screens/SavedCards/CardRow.d.ts.map +1 -0
  77. package/lib/typescript/src/screens/SavedCards/SavedCards.d.ts +7 -0
  78. package/lib/typescript/src/screens/SavedCards/SavedCards.d.ts.map +1 -0
  79. package/lib/typescript/src/selectBusiness/queryKeys.d.ts +5 -0
  80. package/lib/typescript/src/selectBusiness/queryKeys.d.ts.map +1 -1
  81. package/lib/typescript/src/utils/checkout.d.ts +3 -0
  82. package/lib/typescript/src/utils/checkout.d.ts.map +1 -0
  83. package/lib/typescript/src/utils/currency.d.ts +5 -0
  84. package/lib/typescript/src/utils/currency.d.ts.map +1 -0
  85. package/lib/typescript/src/utils/square.d.ts +6 -0
  86. package/lib/typescript/src/utils/square.d.ts.map +1 -0
  87. package/package.json +3 -1
  88. package/src/api/customer.ts +112 -0
  89. package/src/auth/hooks/useAuthentication.ts +4 -0
  90. package/src/auth/hooks/useTermsOfService.ts +8 -11
  91. package/src/auth/providers/authentication/AuthenticationProvider.tsx +1 -0
  92. package/src/auth/providers/authentication/reducer/authentication.reducer.ts +20 -0
  93. package/src/auth/providers/authentication/types/authentication.types.ts +1 -0
  94. package/src/hooks/useCheckCustomer.ts +42 -0
  95. package/src/hooks/useCustomer.ts +331 -0
  96. package/src/index.tsx +6 -0
  97. package/src/screens/SavedCards/CardRow.tsx +94 -0
  98. package/src/screens/SavedCards/SavedCards.tsx +197 -0
  99. package/src/selectBusiness/queryKeys.ts +5 -0
  100. package/src/types/customer.d.ts +70 -0
  101. package/src/utils/checkout.ts +5 -0
  102. package/src/utils/currency.ts +10 -0
  103. package/src/utils/square.ts +50 -0
@@ -0,0 +1,170 @@
1
+ import React, { useEffect, useState } from 'react';
2
+ import { Alert, Button, LineLoader, RefreshControl, Text, View } from '../../components';
3
+ import { ActivityIndicator, useTheme } from 'react-native-paper';
4
+ import uuid from 'react-native-uuid';
5
+ import { useTranslation } from 'react-i18next';
6
+ import { FlatList } from 'react-native';
7
+ import { onStartCardEntry } from '../../utils/square';
8
+ import { useCustomerQueries } from '../../hooks/useCustomer';
9
+ import { useCheckCustomer } from '../../hooks/useCheckCustomer';
10
+ import { CardRow } from './CardRow';
11
+ export const SavedCards = ({
12
+ onCheckout,
13
+ total
14
+ }) => {
15
+ const {
16
+ t
17
+ } = useTranslation();
18
+ const theme = useTheme();
19
+ const {
20
+ customer
21
+ } = useCheckCustomer();
22
+ const {
23
+ useSaveCustomerCard,
24
+ useFetchSavedCards,
25
+ useDisableCard,
26
+ useUpdateCustomer
27
+ } = useCustomerQueries();
28
+ const {
29
+ saveCard,
30
+ saveCardLoading
31
+ } = useSaveCustomerCard();
32
+ const {
33
+ disableCard,
34
+ disableCardLoading
35
+ } = useDisableCard();
36
+ const [selectedPaymentId, onSelectPaymentId] = useState('');
37
+ const {
38
+ updateCustomer,
39
+ updateCustomerLoading
40
+ } = useUpdateCustomer();
41
+ useEffect(() => {
42
+ if (customer?.paymentId) {
43
+ onSelectPaymentId(customer.paymentId);
44
+ }
45
+ }, [customer?.paymentId, onSelectPaymentId]);
46
+ const {
47
+ data: cards = [],
48
+ isFetching,
49
+ isLoading,
50
+ refetch
51
+ } = useFetchSavedCards();
52
+ const onAddPress = () => {
53
+ onStartCardEntry(cardDetails => {
54
+ saveCard({
55
+ sourceId: cardDetails.nonce,
56
+ idempotentKey: uuid.v4()
57
+ });
58
+ }, () => {});
59
+ };
60
+ const label = cards.length > 0 ? t('checkout.payAndPlaceOrder') : t('checkout.payByCard');
61
+ if (isLoading) {
62
+ return /*#__PURE__*/React.createElement(ActivityIndicator, null);
63
+ }
64
+ const onUseCard = () => {
65
+ if (cards.length === 0) {
66
+ // If no cards then initiate add card flow.
67
+ onStartCardEntry(cardDetails => {
68
+ saveCard({
69
+ sourceId: cardDetails.nonce,
70
+ idempotentKey: uuid.v4()
71
+ });
72
+ }, () => {});
73
+ } else if (!customer.paymentId) {
74
+ Alert.show({
75
+ title: 'Select a card'
76
+ });
77
+ } else {
78
+ // Make payment
79
+ const selectedCard = cards.find(card => card.linkedObjectId === customer.paymentId);
80
+ if (selectedCard) {
81
+ onCheckout?.(selectedCard);
82
+ } else {
83
+ Alert.show({
84
+ title: 'Select a card'
85
+ });
86
+ }
87
+ }
88
+ };
89
+ return /*#__PURE__*/React.createElement(View, {
90
+ flex: 1
91
+ }, /*#__PURE__*/React.createElement(View, {
92
+ px: "16",
93
+ bg: "background",
94
+ flex: 1
95
+ }, /*#__PURE__*/React.createElement(LineLoader, {
96
+ isLoading: isFetching || disableCardLoading || updateCustomerLoading
97
+ }), /*#__PURE__*/React.createElement(FlatList, {
98
+ extraData: {
99
+ selectedPaymentId,
100
+ disableCardLoading
101
+ },
102
+ refreshControl: /*#__PURE__*/React.createElement(RefreshControl, {
103
+ refreshing: false,
104
+ onRefresh: refetch
105
+ }),
106
+ data: cards,
107
+ showsVerticalScrollIndicator: false,
108
+ renderItem: ({
109
+ item: card,
110
+ index
111
+ }) => /*#__PURE__*/React.createElement(CardRow, {
112
+ isDisabled: disableCardLoading,
113
+ isSelected: selectedPaymentId === card.linkedObjectId,
114
+ isSelectable: !!onCheckout,
115
+ key: index,
116
+ card: card,
117
+ onDelete: id => {
118
+ disableCard(id);
119
+ },
120
+ onSelect: linkedObjectId => {
121
+ onSelectPaymentId(linkedObjectId);
122
+ updateCustomer({
123
+ paymentId: linkedObjectId,
124
+ addressId: customer.addressId,
125
+ squareCustomerId: customer.squareCustomerId
126
+ });
127
+ }
128
+ }),
129
+ ListHeaderComponent: /*#__PURE__*/React.createElement(React.Fragment, null, cards.length > 0 ? /*#__PURE__*/React.createElement(Text, {
130
+ mb: "8",
131
+ variant: "titleMedium"
132
+ }, t('checkout.paymentMethods')) : /*#__PURE__*/React.createElement(Text, {
133
+ variant: "bodyLarge",
134
+ color: "outline"
135
+ }, t('checkout.noSavedCards'))),
136
+ ListFooterComponent: /*#__PURE__*/React.createElement(View, {
137
+ alignItems: "flex-start"
138
+ }, /*#__PURE__*/React.createElement(Button, {
139
+ pt: '16',
140
+ loading: saveCardLoading,
141
+ onPress: onAddPress,
142
+ icon: "plus",
143
+ mode: "text"
144
+ }, t('checkout.addCard')))
145
+ })), !!onCheckout && /*#__PURE__*/React.createElement(View, {
146
+ bg: "secondaryContainer",
147
+ height: 84,
148
+ padding: "16",
149
+ justifyContent: "space-between",
150
+ flexDirection: "row",
151
+ width: "100%"
152
+ }, /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(Text, {
153
+ variant: "bodyLarge",
154
+ color: "onSurface"
155
+ }, t('order.total')), /*#__PURE__*/React.createElement(Text, {
156
+ variant: "titleLarge",
157
+ color: "onSurface"
158
+ }, total)), /*#__PURE__*/React.createElement(Button, {
159
+ mode: "contained",
160
+ height: 40,
161
+ width: 'auto',
162
+ alignSelf: "center",
163
+ bg: "primary",
164
+ labelStyle: [{
165
+ color: theme.colors.background
166
+ }],
167
+ onPress: onUseCard
168
+ }, label)));
169
+ };
170
+ //# sourceMappingURL=SavedCards.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","useEffect","useState","Alert","Button","LineLoader","RefreshControl","Text","View","ActivityIndicator","useTheme","uuid","useTranslation","FlatList","onStartCardEntry","useCustomerQueries","useCheckCustomer","CardRow","SavedCards","onCheckout","total","t","theme","customer","useSaveCustomerCard","useFetchSavedCards","useDisableCard","useUpdateCustomer","saveCard","saveCardLoading","disableCard","disableCardLoading","selectedPaymentId","onSelectPaymentId","updateCustomer","updateCustomerLoading","paymentId","data","cards","isFetching","isLoading","refetch","onAddPress","cardDetails","sourceId","nonce","idempotentKey","v4","label","length","createElement","onUseCard","show","title","selectedCard","find","card","linkedObjectId","flex","px","bg","extraData","refreshControl","refreshing","onRefresh","showsVerticalScrollIndicator","renderItem","item","index","isDisabled","isSelected","isSelectable","key","onDelete","id","onSelect","addressId","squareCustomerId","ListHeaderComponent","Fragment","mb","variant","color","ListFooterComponent","alignItems","pt","loading","onPress","icon","mode","height","padding","justifyContent","flexDirection","width","alignSelf","labelStyle","colors","background"],"sourceRoot":"../../../../src","sources":["screens/SavedCards/SavedCards.tsx"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAClD,SACEC,KAAK,EACLC,MAAM,EACNC,UAAU,EACVC,cAAc,EACdC,IAAI,EACJC,IAAI,QACC,kBAAkB;AACzB,SAASC,iBAAiB,EAAEC,QAAQ,QAAQ,oBAAoB;AAChE,OAAOC,IAAI,MAAM,mBAAmB;AACpC,SAASC,cAAc,QAAQ,eAAe;AAC9C,SAASC,QAAQ,QAAQ,cAAc;AACvC,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,kBAAkB,QAAQ,yBAAyB;AAC5D,SAASC,gBAAgB,QAAQ,8BAA8B;AAC/D,SAASC,OAAO,QAAQ,WAAW;AAGnC,OAAO,MAAMC,UAAU,GAAGA,CAAC;EACzBC,UAAU;EACVC;AAIF,CAAC,KAAK;EACJ,MAAM;IAAEC;EAAE,CAAC,GAAGT,cAAc,CAAC,CAAC;EAC9B,MAAMU,KAAK,GAAGZ,QAAQ,CAAC,CAAC;EACxB,MAAM;IAAEa;EA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5
+ CARDS: 'CARDS',
6
+ CUSTOMER: 'CUSTOMER',
7
+ PROGRAM: 'PROGRAM',
8
+ LOYALTY: 'LOYALTY',
9
+ REWARDS: 'REWARDS'
5
10
  };
6
11
  export const DEFAULT_STALE_TIME = 60 * (60 * 1000); // 60 mins
7
12
  //# sourceMappingURL=queryKeys.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["queryKeys","BUSINESSES","TERMS_AND_CONDITIONS","TERMS_AND_CONDITIONS_URL","DEFAULT_STALE_TIME"],"sourceRoot":"../../../src","sources":["selectBusiness/queryKeys.ts"],"mappings":"AAAA,OAAO,MAAMA,SAAS,GAAG;EACvBC,UAAU,EAAE,YAAY;EACxBC,oBAAoB,EAAE,sBAAsB;EAC5CC,wBAAwB,EAAE;AAC5B,CAAC;AAED,OAAO,MAAMC,kBAAkB,GAAG,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC"}
1
+ {"version":3,"names":["queryKeys","BUSINESSES","TERMS_AND_CONDITIONS","TERMS_AND_CONDITIONS_URL","CARDS","CUSTOMER","PROGRAM","LOYALTY","REWARDS","DEFAULT_STALE_TIME"],"sourceRoot":"../../../src","sources":["selectBusiness/queryKeys.ts"],"mappings":"AAAA,OAAO,MAAMA,SAAS,GAAG;EACvBC,UAAU,EAAE,YAAY;EACxBC,oBAAoB,EAAE,sBAAsB;EAC5CC,wBAAwB,EAAE,0BAA0B;EACpDC,KAAK,EAAE,OAAO;EACdC,QAAQ,EAAE,UAAU;EACpBC,OAAO,EAAE,SAAS;EAClBC,OAAO,EAAE,SAAS;EAClBC,OAAO,EAAE;AACX,CAAC;AAED,OAAO,MAAMC,kBAAkB,GAAG,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ var PaymentType = /*#__PURE__*/function (PaymentType) {
2
+ PaymentType["card"] = "card";
3
+ return PaymentType;
4
+ }(PaymentType || {});
5
+ //# sourceMappingURL=customer.d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["PaymentType"],"sourceRoot":"../../../src","sources":["types/customer.d.ts"],"mappings":"IAwCKA,WAAW,0BAAXA,WAAW;EAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA,EAAXA,WAAW"}
@@ -0,0 +1,4 @@
1
+ export const getCardName = card => {
2
+ return card.cardDetails.cardBrand + ' **** ' + card.cardDetails.last4;
3
+ };
4
+ //# sourceMappingURL=checkout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["getCardName","card","cardDetails","cardBrand","last4"],"sourceRoot":"../../../src","sources":["utils/checkout.ts"],"mappings":"AAEA,OAAO,MAAMA,WAAW,GAAIC,IAAyB,IAAK;EACxD,OAAOA,IAAI,CAACC,WAAW,CAACC,SAAS,GAAG,QAAQ,GAAGF,IAAI,CAACC,WAAW,CAACE,KAAK;AACvE,CAAC"}
@@ -0,0 +1,10 @@
1
+ export class Currency {
2
+ static usdFormatter = new Intl.NumberFormat('en-US', {
3
+ style: 'currency',
4
+ currency: 'USD'
5
+ });
6
+ static formatToUsd(amount) {
7
+ return this.usdFormatter.format(amount / 100);
8
+ }
9
+ }
10
+ //# sourceMappingURL=currency.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Currency","usdFormatter","Intl","NumberFormat","style","currency","formatToUsd","amount","format"],"sourceRoot":"../../../src","sources":["utils/currency.ts"],"mappings":"AAAA,OAAO,MAAMA,QAAQ,CAAC;EACpB,OAAOC,YAAY,GAAG,IAAIC,IAAI,CAACC,YAAY,CAAC,OAAO,EAAE;IACnDC,KAAK,EAAE,UAAU;IACjBC,QAAQ,EAAE;EACZ,CAAC,CAAC;EAEF,OAAOC,WAAWA,CAACC,MAAc,EAAE;IACjC,OAAO,IAAI,CAACN,YAAY,CAACO,MAAM,CAACD,MAAM,GAAG,GAAG,CAAC;EAC/C;AACF"}
@@ -0,0 +1,36 @@
1
+ import { SQIPCardEntry
2
+ // @ts-ignore
3
+ } from 'react-native-square-in-app-payments';
4
+
5
+ /**
6
+ * Callback when successfully get the card nonce details for processig
7
+ * card entry is still open and waiting for processing card nonce details
8
+ * @param {*} cardDetails
9
+ * @param onCompleteCallback
10
+ */
11
+ async function onCardNonceRequestSuccess(cardDetails, onCompleteCallback) {
12
+ try {
13
+ // take payment with the card details
14
+ // await chargeCard(cardDetails);
15
+
16
+ // payment finished successfully
17
+ // you must call this method to close card entry
18
+ await SQIPCardEntry.completeCardEntry(() => onCompleteCallback(cardDetails));
19
+ } catch (ex) {
20
+ // payment failed to complete due to error
21
+ // notify card entry to show processing error
22
+ // @ts-ignore
23
+ await SQIPCardEntry.showCardNonceProcessingError(ex.message);
24
+ }
25
+ }
26
+
27
+ /**
28
+ * An event listener to start card entry flow
29
+ */
30
+ export async function onStartCardEntry(onSuccessCallback, onCancelCallback) {
31
+ const cardEntryConfig = {
32
+ collectPostalCode: false
33
+ };
34
+ await SQIPCardEntry.startCardEntryFlow(cardEntryConfig, cardDetails => onCardNonceRequestSuccess(cardDetails, onSuccessCallback), onCancelCallback);
35
+ }
36
+ //# sourceMappingURL=square.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["SQIPCardEntry","onCardNonceRequestSuccess","cardDetails","onCompleteCallback","completeCardEntry","ex","showCardNonceProcessingError","message","onStartCardEntry","onSuccessCallback","onCancelCallback","cardEntryConfig","collectPostalCode","startCardEntryFlow"],"sourceRoot":"../../../src","sources":["utils/square.ts"],"mappings":"AAAA,SAEEA;AACA;AAAA,OACK,qCAAqC;;AAE5C;AACA;AACA;AACA;AACA;AACA;AACA,eAAeC,yBAAyBA,CACtCC,WAAwB,EACxBC,kBAAsD,EACtD;EACA,IAAI;IACF;IACA;;IAEA;IACA;IACA,MAAMH,aAAa,CAACI,iBAAiB,CAAC,MACpCD,kBAAkB,CAACD,WAAW,CAChC,CAAC;EACH,CAAC,CAAC,OAAOG,EAAE,EAAE;IACX;IACA;IACA;IACA,MAAML,aAAa,CAACM,4BAA4B,CAACD,EAAE,CAACE,OAAO,CAAC;EAC9D;AACF;;AAEA;AACA;AACA;AACA,OAAO,eAAeC,gBAAgBA,CACpCC,iBAAqD,EACrDC,gBAA4B,EAC5B;EACA,MAAMC,eAAe,GAAG;IACtBC,iBAAiB,EAAE;EACrB,CAAC;EACD,MAAMZ,aAAa,CAACa,kBAAkB,CACpCF,eAAe,EACdT,WAAwB,IACvBD,yBAAyB,CAACC,WAAW,EAAEO,iBAAiB,CAAC,EAC3DC,gBACF,CAAC;AACH"}
@@ -0,0 +1,23 @@
1
+ import { Address, ConnectSquareCustomerRequest, CustomerProfileProps, SaveCardRequest } from '../types/customer';
2
+ export declare const getCustomer: (userId: string) => Promise<import("axios").AxiosResponse<any, any>>;
3
+ export declare const createCustomer: ({ uid, address, }: {
4
+ uid: string;
5
+ address?: Address | null | undefined;
6
+ }) => Promise<import("axios").AxiosResponse<any, any>>;
7
+ export declare const updateCustomerProfile: ({ uid, props, }: {
8
+ uid: string;
9
+ props: CustomerProfileProps;
10
+ }) => Promise<import("axios").AxiosResponse<any, any>>;
11
+ export declare const saveCustomerAddress: ({ uid, address, }: {
12
+ uid: string;
13
+ address: Address;
14
+ }) => Promise<import("axios").AxiosResponse<any, any>>;
15
+ export declare const saveCustomerCard: ({ uid, props, }: {
16
+ uid: string;
17
+ props: SaveCardRequest;
18
+ }) => Promise<import("axios").AxiosResponse<any, any>>;
19
+ export declare const connectSquareLoyalty: (uid: string, props: ConnectSquareCustomerRequest) => Promise<import("axios").AxiosResponse<any, any>>;
20
+ export declare const connectSquareCustomer: (uid: string, props: ConnectSquareCustomerRequest) => Promise<import("axios").AxiosResponse<any, any>>;
21
+ export declare const fetchSquareLoyalty: (uid: string, businessId: string) => Promise<import("axios").AxiosResponse<any, any>>;
22
+ export declare const fetchLoyaltyRewards: (businessId: string) => Promise<import("axios").AxiosResponse<any, any>>;
23
+ //# sourceMappingURL=customer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customer.d.ts","sourceRoot":"","sources":["../../../../src/api/customer.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,4BAA4B,EAC5B,oBAAoB,EACpB,eAAe,EAChB,MAAM,mBAAmB,CAAC;AAK3B,eAAO,MAAM,WAAW,WAAkB,MAAM,qDAE/C,CAAC;AAEF,eAAO,MAAM,cAAc;SAIpB,MAAM;;sDASZ,CAAC;AAEF,eAAO,MAAM,qBAAqB;SAI3B,MAAM;WACJ,oBAAoB;sDAQ5B,CAAC;AAEF,eAAO,MAAM,mBAAmB;SAIzB,MAAM;aACF,OAAO;sDAQjB,CAAC;AAEF,eAAO,MAAM,gBAAgB;SAItB,MAAM;WACJ,eAAe;sDAQvB,CAAC;AAEF,eAAO,MAAM,oBAAoB,QAC1B,MAAM,SACJ,4BAA4B,qDAQpC,CAAC;AAEF,eAAO,MAAM,qBAAqB,QAC3B,MAAM,SACJ,4BAA4B,qDAQpC,CAAC;AAEF,eAAO,MAAM,kBAAkB,QAAe,MAAM,cAAc,MAAM,qDAOvE,CAAC;AAEF,eAAO,MAAM,mBAAmB,eAAsB,MAAM,qDAI3D,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"useAuthentication.d.ts","sourceRoot":"","sources":["../../../../../src/auth/hooks/useAuthentication.ts"],"names":[],"mappings":"AAqBA,MAAM,MAAM,SAAS,GAAG;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,iBAAiB;;gBAQa,SAAS;cAAQ,MAAM;;;;;;;;;cAoDvB,MAAM;;;qBAOQ,MAAM;;;;eAmClB,MAAM;;CAgBlD,CAAC"}
1
+ {"version":3,"file":"useAuthentication.d.ts","sourceRoot":"","sources":["../../../../../src/auth/hooks/useAuthentication.ts"],"names":[],"mappings":"AAsBA,MAAM,MAAM,SAAS,GAAG;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,iBAAiB;;gBAQa,SAAS;cAAQ,MAAM;;;;;;;;;cAuDvB,MAAM;;;qBAOQ,MAAM;;;;eAmClB,MAAM;;CAgBlD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"useTermsOfService.d.ts","sourceRoot":"","sources":["../../../../../src/auth/hooks/useTermsOfService.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,iBAAiB;;;;CA8E7B,CAAC"}
1
+ {"version":3,"file":"useTermsOfService.d.ts","sourceRoot":"","sources":["../../../../../src/auth/hooks/useTermsOfService.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,iBAAiB;;;;CA0E7B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"AuthenticationProvider.d.ts","sourceRoot":"","sources":["../../../../../../src/auth/providers/authentication/AuthenticationProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAGZ,KAAK,EAAE,EAKR,MAAM,OAAO,CAAC;AAGf,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACzB,MAAM,8BAA8B,CAAC;AAQtC,eAAO,MAAM,iBAAiB,2BAC4B,CAAC;AAC3D,eAAO,MAAM,yBAAyB,4CACuC,CAAC;AAE9E,eAAO,MAAM,sBAAsB,EAAE,EAAE,CAAC;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,CAwCpE,CAAC"}
1
+ {"version":3,"file":"AuthenticationProvider.d.ts","sourceRoot":"","sources":["../../../../../../src/auth/providers/authentication/AuthenticationProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAGZ,KAAK,EAAE,EAKR,MAAM,OAAO,CAAC;AAGf,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACzB,MAAM,8BAA8B,CAAC;AAQtC,eAAO,MAAM,iBAAiB,2BAC4B,CAAC;AAC3D,eAAO,MAAM,yBAAyB,4CACuC,CAAC;AAE9E,eAAO,MAAM,sBAAsB,EAAE,EAAE,CAAC;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,CAyCpE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"authentication.reducer.d.ts","sourceRoot":"","sources":["../../../../../../../src/auth/providers/authentication/reducer/authentication.reducer.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,oBAAoB,EAEzB,KAAK,mBAAmB,EACzB,MAAM,+BAA+B,CAAC;AAEvC,eAAO,MAAM,qBAAqB,UACzB,mBAAmB,UAClB,oBAAoB,KAC3B,mBAWF,CAAC"}
1
+ {"version":3,"file":"authentication.reducer.d.ts","sourceRoot":"","sources":["../../../../../../../src/auth/providers/authentication/reducer/authentication.reducer.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,oBAAoB,EAEzB,KAAK,mBAAmB,EACzB,MAAM,+BAA+B,CAAC;AAoBvC,eAAO,MAAM,qBAAqB,UACzB,mBAAmB,UAClB,oBAAoB,KAC3B,mBAYF,CAAC"}
@@ -11,5 +11,6 @@ export type AuthenticationAction = {
11
11
  export interface AuthenticationState {
12
12
  user: User | null;
13
13
  initializing: boolean;
14
+ isSignedIn: boolean;
14
15
  }
15
16
  //# sourceMappingURL=authentication.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"authentication.types.d.ts","sourceRoot":"","sources":["../../../../../../../src/auth/providers/authentication/types/authentication.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,MAAM,MAAM,kBAAkB,GAAG,iBAAiB,CAAC,kBAAkB,CAAC;AACtE,MAAM,MAAM,IAAI,GAAG,iBAAiB,CAAC,IAAI,CAAC;AAE1C,oBAAY,wBAAwB;IAClC,UAAU,eAAe;CAC1B;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,wBAAwB,CAAC,UAAU,CAAC;IAC1C,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;CACnB,CAAC;AAEF,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAClB,YAAY,EAAE,OAAO,CAAC;CACvB"}
1
+ {"version":3,"file":"authentication.types.d.ts","sourceRoot":"","sources":["../../../../../../../src/auth/providers/authentication/types/authentication.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,MAAM,MAAM,kBAAkB,GAAG,iBAAiB,CAAC,kBAAkB,CAAC;AACtE,MAAM,MAAM,IAAI,GAAG,iBAAiB,CAAC,IAAI,CAAC;AAE1C,oBAAY,wBAAwB;IAClC,UAAU,eAAe;CAC1B;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,wBAAwB,CAAC,UAAU,CAAC;IAC1C,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;CACnB,CAAC;AAEF,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAClB,YAAY,EAAE,OAAO,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;CACrB"}
@@ -0,0 +1,4 @@
1
+ export declare const useCheckCustomer: () => {
2
+ customer: any;
3
+ };
4
+ //# sourceMappingURL=useCheckCustomer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCheckCustomer.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useCheckCustomer.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,gBAAgB;;CAqC5B,CAAC"}
@@ -0,0 +1,58 @@
1
+ import { Address, CustomerProfileProps, SaveCardRequest } from '../types/customer';
2
+ export declare const useCustomerQueries: () => {
3
+ useFetchCustomer: () => import("@tanstack/react-query").UseQueryResult<any, unknown>;
4
+ useCreateCustomer: () => {
5
+ createCustomerHook: import("@tanstack/react-query").UseMutateAsyncFunction<void, {
6
+ code: string;
7
+ message: string;
8
+ }, void, unknown>;
9
+ createCustomerLoading: boolean;
10
+ };
11
+ useUpdateCustomer: () => {
12
+ updateCustomer: import("@tanstack/react-query").UseMutateFunction<void, {
13
+ code: string;
14
+ message: string;
15
+ }, CustomerProfileProps, unknown>;
16
+ updateCustomerLoading: boolean;
17
+ };
18
+ useSaveCustomerAddress: () => {
19
+ useSaveAddress: import("@tanstack/react-query").UseMutateFunction<void, {
20
+ code: string;
21
+ message: string;
22
+ }, Address, unknown>;
23
+ saveAddressLoading: boolean;
24
+ };
25
+ useFetchSavedCards: () => import("@tanstack/react-query").UseQueryResult<any, unknown>;
26
+ useFetchSquareProgram: (queryOptions?: object) => import("@tanstack/react-query").UseQueryResult<any, unknown>;
27
+ useFetchSquareLoyalty: (queryOptions?: object) => import("@tanstack/react-query").UseQueryResult<any, unknown>;
28
+ useSaveCustomerCard: () => {
29
+ saveCard: import("@tanstack/react-query").UseMutateFunction<void, {
30
+ code: string;
31
+ message: string;
32
+ }, SaveCardRequest, unknown>;
33
+ saveCardLoading: boolean;
34
+ };
35
+ useDisableCard: () => {
36
+ disableCard: import("@tanstack/react-query").UseMutateFunction<any, {
37
+ code: string;
38
+ message: string;
39
+ }, string, unknown>;
40
+ disableCardLoading: boolean;
41
+ };
42
+ useConnectSquareLoyalty: () => {
43
+ connectSquareLoyalty: import("@tanstack/react-query").UseMutateFunction<void, {
44
+ code: string;
45
+ message: string;
46
+ }, void, unknown>;
47
+ connectLoyaltyLoading: boolean;
48
+ };
49
+ useConnectSquareCustomer: () => {
50
+ connectSquare: import("@tanstack/react-query").UseMutateFunction<void, {
51
+ code: string;
52
+ message: string;
53
+ }, void, unknown>;
54
+ connectSquareLoading: boolean;
55
+ };
56
+ useFetchLoyaltyRewards: () => import("@tanstack/react-query").UseQueryResult<any, unknown>;
57
+ };
58
+ //# sourceMappingURL=useCustomer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCustomer.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useCustomer.ts"],"names":[],"mappings":"AAkBA,OAAO,EACL,OAAO,EACP,oBAAoB,EACpB,eAAe,EAChB,MAAM,mBAAmB,CAAC;AAK3B,eAAO,MAAM,kBAAkB;;;;kBAyCE,MAAM;qBAAW,MAAM;;;;;;kBA4BvB,MAAM;qBAAW,MAAM;;;;;;kBA4BvB,MAAM;qBAAW,MAAM;;;;;2CAsCb,MAAM;2CAwBN,MAAM;;;kBA4BhB,MAAM;qBAAW,MAAM;;;;;;kBA6BvB,MAAM;qBAAW,MAAM;;;;;;kBA4BvB,MAAM;qBAAW,MAAM;;;;;;kBA4BvB,MAAM;qBAAW,MAAM;;;;;CA+BvD,CAAC"}
@@ -1,3 +1,7 @@
1
+ export { Currency } from './utils/currency';
2
+ export { useCustomerQueries } from './hooks/useCustomer';
3
+ export { useCheckCustomer } from './hooks/useCheckCustomer';
4
+ export { SavedCards } from './screens/SavedCards/SavedCards';
1
5
  export { useMultiSnapBottomSheetRef, TMultiSnapBottomSheetRef, } from './utils/useMultiSnapBottomSheetRef';
2
6
  export { useSingleSnapBottomSheetRef, TSingleSnapBottomSheetRef, } from './utils/useSingleSnapBottomSheetRef';
3
7
  export declare function multiply(a: number, b: number): Promise<number>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,0BAA0B,EAC1B,wBAAwB,GACzB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACL,2BAA2B,EAC3B,yBAAyB,GAC1B,MAAM,qCAAqC,CAAC;AAE7C,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAE9D;AACD,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,kBAAkB,CAAC;AAEjC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAE7D,OAAO,EACL,0BAA0B,EAC1B,wBAAwB,GACzB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACL,2BAA2B,EAC3B,yBAAyB,GAC1B,MAAM,qCAAqC,CAAC;AAE7C,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAE9D;AACD,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,kBAAkB,CAAC;AAEjC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import { CustomerCardPayment } from '../../types/customer';
3
+ export declare const CardRow: ({ card, onDelete, onSelect, isSelectable, isSelected, isDisabled, }: {
4
+ card: CustomerCardPayment;
5
+ onDelete: (id: string) => void;
6
+ onSelect: (linkedObjectId: string) => void;
7
+ isSelectable: boolean;
8
+ isSelected: boolean;
9
+ isDisabled: boolean;
10
+ }) => JSX.Element;
11
+ //# sourceMappingURL=CardRow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CardRow.d.ts","sourceRoot":"","sources":["../../../../../src/screens/SavedCards/CardRow.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE3D,eAAO,MAAM,OAAO;UAQZ,mBAAmB;mBACV,MAAM,KAAK,IAAI;+BACH,MAAM,KAAK,IAAI;kBAC5B,OAAO;gBACT,OAAO;gBACP,OAAO;iBAyEpB,CAAC"}
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import { CustomerCardPayment } from '../../types/customer';
3
+ export declare const SavedCards: ({ onCheckout, total, }: {
4
+ onCheckout?: ((selectedCard: CustomerCardPayment) => void) | undefined;
5
+ total?: string | undefined;
6
+ }) => JSX.Element;
7
+ //# sourceMappingURL=SavedCards.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SavedCards.d.ts","sourceRoot":"","sources":["../../../../../src/screens/SavedCards/SavedCards.tsx"],"names":[],"mappings":";AAiBA,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE3D,eAAO,MAAM,UAAU;iCAIO,mBAAmB,KAAK,IAAI;;iBA6KzD,CAAC"}
@@ -2,6 +2,11 @@ export declare const queryKeys: {
2
2
  BUSINESSES: string;
3
3
  TERMS_AND_CONDITIONS: string;
4
4
  TERMS_AND_CONDITIONS_URL: string;
5
+ CARDS: string;
6
+ CUSTOMER: string;
7
+ PROGRAM: string;
8
+ LOYALTY: string;
9
+ REWARDS: string;
5
10
  };
6
11
  export declare const DEFAULT_STALE_TIME: number;
7
12
  //# sourceMappingURL=queryKeys.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"queryKeys.d.ts","sourceRoot":"","sources":["../../../../src/selectBusiness/queryKeys.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS;;;;CAIrB,CAAC;AAEF,eAAO,MAAM,kBAAkB,QAAmB,CAAC"}
1
+ {"version":3,"file":"queryKeys.d.ts","sourceRoot":"","sources":["../../../../src/selectBusiness/queryKeys.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS;;;;;;;;;CASrB,CAAC;AAEF,eAAO,MAAM,kBAAkB,QAAmB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { CustomerCardPayment } from '../types/customer';
2
+ export declare const getCardName: (card: CustomerCardPayment) => string;
3
+ //# sourceMappingURL=checkout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkout.d.ts","sourceRoot":"","sources":["../../../../src/utils/checkout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,eAAO,MAAM,WAAW,SAAU,mBAAmB,WAEpD,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare class Currency {
2
+ static usdFormatter: Intl.NumberFormat;
3
+ static formatToUsd(amount: number): string;
4
+ }
5
+ //# sourceMappingURL=currency.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"currency.d.ts","sourceRoot":"","sources":["../../../../src/utils/currency.ts"],"names":[],"mappings":"AAAA,qBAAa,QAAQ;IACnB,MAAM,CAAC,YAAY,oBAGhB;IAEH,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,MAAM;CAGlC"}
@@ -0,0 +1,6 @@
1
+ import { CardDetails } from 'react-native-square-in-app-payments';
2
+ /**
3
+ * An event listener to start card entry flow
4
+ */
5
+ export declare function onStartCardEntry(onSuccessCallback: (cardDetails: CardDetails) => void, onCancelCallback: () => void): Promise<void>;
6
+ //# sourceMappingURL=square.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"square.d.ts","sourceRoot":"","sources":["../../../../src/utils/square.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EAGZ,MAAM,qCAAqC,CAAC;AA6B7C;;GAEG;AACH,wBAAsB,gBAAgB,CACpC,iBAAiB,EAAE,CAAC,WAAW,EAAE,WAAW,KAAK,IAAI,EACrD,gBAAgB,EAAE,MAAM,IAAI,iBAW7B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiosinc/commons-rn",
3
- "version": "0.1.61",
3
+ "version": "0.1.63",
4
4
  "description": "Common Code",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -82,6 +82,7 @@
82
82
  "react-native-mmkv": "^2.10.2",
83
83
  "react-native-reanimated": "^3.5.4",
84
84
  "react-native-safe-area-context": "^4.7.4",
85
+ "react-native-square-in-app-payments": "^1.7.5",
85
86
  "react-native-webview": "^13.10.2",
86
87
  "release-it": "^15.0.0",
87
88
  "typescript": "^5.0.2"
@@ -200,6 +201,7 @@
200
201
  "react-native-international-phone-number": "^0.7.6",
201
202
  "react-native-paper": "^5.11.1",
202
203
  "react-native-size-matters": "^0.4.2",
204
+ "react-native-uuid": "^2.0.2",
203
205
  "react-native-video": "^5.2.1",
204
206
  "yup": "^1.3.2"
205
207
  }