@dfx.swiss/react 1.3.0-beta.27 → 1.3.0-beta.271
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/contexts/asset.context.js +2 -2
- package/dist/contexts/asset.context.js.map +1 -1
- package/dist/contexts/auth.context.d.ts +2 -2
- package/dist/contexts/auth.context.d.ts.map +1 -1
- package/dist/contexts/auth.context.js +23 -19
- package/dist/contexts/auth.context.js.map +1 -1
- package/dist/contexts/bank-account.context.d.ts +2 -1
- package/dist/contexts/bank-account.context.d.ts.map +1 -1
- package/dist/contexts/bank-account.context.js +58 -35
- package/dist/contexts/bank-account.context.js.map +1 -1
- package/dist/contexts/payment-routes.context.d.ts +22 -0
- package/dist/contexts/payment-routes.context.d.ts.map +1 -0
- package/dist/contexts/payment-routes.context.js +299 -0
- package/dist/contexts/payment-routes.context.js.map +1 -0
- package/dist/contexts/session.context.d.ts +6 -2
- package/dist/contexts/session.context.d.ts.map +1 -1
- package/dist/contexts/session.context.js +21 -15
- package/dist/contexts/session.context.js.map +1 -1
- package/dist/contexts/support.context.d.ts +19 -0
- package/dist/contexts/support.context.d.ts.map +1 -0
- package/dist/contexts/support.context.js +353 -0
- package/dist/contexts/support.context.js.map +1 -0
- package/dist/contexts/user.context.d.ts +23 -7
- package/dist/contexts/user.context.d.ts.map +1 -1
- package/dist/contexts/user.context.js +214 -62
- package/dist/contexts/user.context.js.map +1 -1
- package/dist/definitions/aml.d.ts +2 -0
- package/dist/definitions/aml.d.ts.map +1 -0
- package/dist/definitions/aml.js +2 -0
- package/dist/definitions/aml.js.map +1 -0
- package/dist/definitions/asset.d.ts +2 -31
- package/dist/definitions/asset.d.ts.map +1 -1
- package/dist/definitions/asset.js +1 -11
- package/dist/definitions/asset.js.map +1 -1
- package/dist/definitions/auth.d.ts +2 -25
- package/dist/definitions/auth.d.ts.map +1 -1
- package/dist/definitions/auth.js +1 -9
- package/dist/definitions/auth.js.map +1 -1
- package/dist/definitions/bank-account.d.ts +2 -17
- package/dist/definitions/bank-account.d.ts.map +1 -1
- package/dist/definitions/bank-account.js +1 -6
- package/dist/definitions/bank-account.js.map +1 -1
- package/dist/definitions/bank.d.ts +3 -0
- package/dist/definitions/bank.d.ts.map +1 -0
- package/dist/definitions/bank.js +2 -0
- package/dist/definitions/bank.js.map +1 -0
- package/dist/definitions/blockchain.d.ts +1 -16
- package/dist/definitions/blockchain.d.ts.map +1 -1
- package/dist/definitions/blockchain.js +1 -17
- package/dist/definitions/blockchain.js.map +1 -1
- package/dist/definitions/buy.d.ts +2 -54
- package/dist/definitions/buy.d.ts.map +1 -1
- package/dist/definitions/buy.js +1 -4
- package/dist/definitions/buy.js.map +1 -1
- package/dist/definitions/country.d.ts +2 -8
- package/dist/definitions/country.d.ts.map +1 -1
- package/dist/definitions/country.js +1 -1
- package/dist/definitions/country.js.map +1 -1
- package/dist/definitions/error.d.ts +2 -4
- package/dist/definitions/error.d.ts.map +1 -1
- package/dist/definitions/error.js +1 -1
- package/dist/definitions/error.js.map +1 -1
- package/dist/definitions/fees.d.ts +1 -8
- package/dist/definitions/fees.d.ts.map +1 -1
- package/dist/definitions/fiat.d.ts +2 -13
- package/dist/definitions/fiat.d.ts.map +1 -1
- package/dist/definitions/fiat.js +1 -1
- package/dist/definitions/fiat.js.map +1 -1
- package/dist/definitions/file.d.ts +2 -0
- package/dist/definitions/file.d.ts.map +1 -0
- package/dist/definitions/file.js +2 -0
- package/dist/definitions/file.js.map +1 -0
- package/dist/definitions/jwt.d.ts +2 -20
- package/dist/definitions/jwt.d.ts.map +1 -1
- package/dist/definitions/jwt.js +1 -11
- package/dist/definitions/jwt.js.map +1 -1
- package/dist/definitions/kyc.d.ts +2 -181
- package/dist/definitions/kyc.d.ts.map +1 -1
- package/dist/definitions/kyc.js +1 -110
- package/dist/definitions/kyc.js.map +1 -1
- package/dist/definitions/language.d.ts +2 -10
- package/dist/definitions/language.d.ts.map +1 -1
- package/dist/definitions/language.js +1 -1
- package/dist/definitions/language.js.map +1 -1
- package/dist/definitions/price-step.d.ts +1 -7
- package/dist/definitions/price-step.d.ts.map +1 -1
- package/dist/definitions/route.d.ts +3 -0
- package/dist/definitions/route.d.ts.map +1 -0
- package/dist/definitions/route.js +2 -0
- package/dist/definitions/route.js.map +1 -0
- package/dist/definitions/sell.d.ts +2 -41
- package/dist/definitions/sell.d.ts.map +1 -1
- package/dist/definitions/sell.js +1 -1
- package/dist/definitions/sell.js.map +1 -1
- package/dist/definitions/session.d.ts +1 -9
- package/dist/definitions/session.d.ts.map +1 -1
- package/dist/definitions/settings.d.ts +3 -0
- package/dist/definitions/settings.d.ts.map +1 -0
- package/dist/definitions/settings.js +2 -0
- package/dist/definitions/settings.js.map +1 -0
- package/dist/definitions/support.d.ts +2 -18
- package/dist/definitions/support.d.ts.map +1 -1
- package/dist/definitions/support.js +1 -10
- package/dist/definitions/support.js.map +1 -1
- package/dist/definitions/swap.d.ts +2 -37
- package/dist/definitions/swap.d.ts.map +1 -1
- package/dist/definitions/swap.js +1 -1
- package/dist/definitions/swap.js.map +1 -1
- package/dist/definitions/transaction.d.ts +2 -114
- package/dist/definitions/transaction.d.ts.map +1 -1
- package/dist/definitions/transaction.js +1 -68
- package/dist/definitions/transaction.js.map +1 -1
- package/dist/definitions/user.d.ts +2 -59
- package/dist/definitions/user.d.ts.map +1 -1
- package/dist/definitions/user.js +1 -7
- package/dist/definitions/user.js.map +1 -1
- package/dist/hooks/api-session.hook.d.ts +3 -2
- package/dist/hooks/api-session.hook.d.ts.map +1 -1
- package/dist/hooks/api-session.hook.js +30 -38
- package/dist/hooks/api-session.hook.js.map +1 -1
- package/dist/hooks/api.hook.d.ts +7 -0
- package/dist/hooks/api.hook.d.ts.map +1 -1
- package/dist/hooks/api.hook.js +60 -24
- package/dist/hooks/api.hook.js.map +1 -1
- package/dist/hooks/asset.hook.d.ts.map +1 -1
- package/dist/hooks/asset.hook.js +19 -18
- package/dist/hooks/asset.hook.js.map +1 -1
- package/dist/hooks/auth.hook.d.ts +5 -5
- package/dist/hooks/auth.hook.d.ts.map +1 -1
- package/dist/hooks/auth.hook.js +76 -60
- package/dist/hooks/auth.hook.js.map +1 -1
- package/dist/hooks/bank-account.hook.d.ts +3 -3
- package/dist/hooks/bank-account.hook.d.ts.map +1 -1
- package/dist/hooks/bank-account.hook.js +17 -36
- package/dist/hooks/bank-account.hook.js.map +1 -1
- package/dist/hooks/bank.hook.d.ts +6 -0
- package/dist/hooks/bank.hook.d.ts.map +1 -0
- package/dist/hooks/bank.hook.js +54 -0
- package/dist/hooks/bank.hook.js.map +1 -0
- package/dist/hooks/buy.hook.d.ts +3 -2
- package/dist/hooks/buy.hook.d.ts.map +1 -1
- package/dist/hooks/buy.hook.js +17 -14
- package/dist/hooks/buy.hook.js.map +1 -1
- package/dist/hooks/country.hook.js +7 -8
- package/dist/hooks/country.hook.js.map +1 -1
- package/dist/hooks/fiat.hook.d.ts.map +1 -1
- package/dist/hooks/fiat.hook.js +18 -16
- package/dist/hooks/fiat.hook.js.map +1 -1
- package/dist/hooks/kyc.hook.d.ts +22 -7
- package/dist/hooks/kyc.hook.d.ts.map +1 -1
- package/dist/hooks/kyc.hook.js +227 -129
- package/dist/hooks/kyc.hook.js.map +1 -1
- package/dist/hooks/language.hook.d.ts.map +1 -1
- package/dist/hooks/language.hook.js +12 -12
- package/dist/hooks/language.hook.js.map +1 -1
- package/dist/hooks/payment-routes.hook.d.ts +20 -0
- package/dist/hooks/payment-routes.hook.d.ts.map +1 -0
- package/dist/hooks/payment-routes.hook.js +196 -0
- package/dist/hooks/payment-routes.hook.js.map +1 -0
- package/dist/hooks/sell.hook.d.ts +4 -2
- package/dist/hooks/sell.hook.d.ts.map +1 -1
- package/dist/hooks/sell.hook.js +15 -6
- package/dist/hooks/sell.hook.js.map +1 -1
- package/dist/hooks/settings.hook.d.ts +6 -0
- package/dist/hooks/settings.hook.d.ts.map +1 -0
- package/dist/hooks/settings.hook.js +50 -0
- package/dist/hooks/settings.hook.js.map +1 -0
- package/dist/hooks/store.hook.d.ts +1 -1
- package/dist/hooks/store.hook.d.ts.map +1 -1
- package/dist/hooks/store.hook.js +4 -15
- package/dist/hooks/store.hook.js.map +1 -1
- package/dist/hooks/support.hook.d.ts +7 -5
- package/dist/hooks/support.hook.d.ts.map +1 -1
- package/dist/hooks/support.hook.js +44 -22
- package/dist/hooks/support.hook.js.map +1 -1
- package/dist/hooks/swap.hook.d.ts +4 -2
- package/dist/hooks/swap.hook.d.ts.map +1 -1
- package/dist/hooks/swap.hook.js +54 -7
- package/dist/hooks/swap.hook.js.map +1 -1
- package/dist/hooks/transaction.hook.d.ts +8 -1
- package/dist/hooks/transaction.hook.d.ts.map +1 -1
- package/dist/hooks/transaction.hook.js +123 -65
- package/dist/hooks/transaction.hook.js.map +1 -1
- package/dist/hooks/user.hook.d.ts +16 -3
- package/dist/hooks/user.hook.d.ts.map +1 -1
- package/dist/hooks/user.hook.js +135 -7
- package/dist/hooks/user.hook.js.map +1 -1
- package/dist/index.d.ts +30 -18
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +28 -7
- package/dist/index.js.map +1 -1
- package/dist/utils.d.ts +1 -13
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +1 -51
- package/dist/utils.js.map +1 -1
- package/dist/validations.d.ts +2 -26
- package/dist/validations.d.ts.map +1 -1
- package/dist/validations.js +1 -77
- package/dist/validations.js.map +1 -1
- package/package.json +7 -5
- package/LICENSE +0 -21
package/dist/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
// Contexts
|
|
2
2
|
export { DfxContextProvider } from './contexts/dfx.context';
|
|
3
|
+
export { SupportChatContextProvider } from './contexts/support.context';
|
|
4
|
+
export { PaymentRoutesContextProvider } from './contexts/payment-routes.context';
|
|
3
5
|
export { useAssetContext } from './contexts/asset.context';
|
|
4
6
|
export { useFiatContext } from './contexts/fiat.context';
|
|
5
7
|
export { useLanguageContext } from './contexts/language.context';
|
|
@@ -7,29 +9,48 @@ export { useAuthContext } from './contexts/auth.context';
|
|
|
7
9
|
export { useBankAccountContext } from './contexts/bank-account.context';
|
|
8
10
|
export { useSessionContext } from './contexts/session.context';
|
|
9
11
|
export { useUserContext } from './contexts/user.context';
|
|
12
|
+
export { usePaymentRoutesContext } from './contexts/payment-routes.context';
|
|
13
|
+
export { useSupportChatContext } from './contexts/support.context';
|
|
10
14
|
// Hooks
|
|
11
15
|
export { useApiSession } from './hooks/api-session.hook';
|
|
12
|
-
export { useApi } from './hooks/api.hook';
|
|
16
|
+
export { useApi, ResponseType } from './hooks/api.hook';
|
|
13
17
|
export { useAsset } from './hooks/asset.hook';
|
|
14
18
|
export { useAuth } from './hooks/auth.hook';
|
|
15
19
|
export { useBankAccount } from './hooks/bank-account.hook';
|
|
20
|
+
export { useBank } from './hooks/bank.hook';
|
|
16
21
|
export { useBuy } from './hooks/buy.hook';
|
|
17
22
|
export { useCountry } from './hooks/country.hook';
|
|
18
23
|
export { useFiat } from './hooks/fiat.hook';
|
|
24
|
+
export { usePaymentRoutes } from './hooks/payment-routes.hook';
|
|
25
|
+
export { useSettings } from './hooks/settings.hook';
|
|
19
26
|
export { useTransaction } from './hooks/transaction.hook';
|
|
20
27
|
export { useLanguage } from './hooks/language.hook';
|
|
21
28
|
export { useKyc } from './hooks/kyc.hook';
|
|
22
29
|
export { useSell } from './hooks/sell.hook';
|
|
23
30
|
export { useUser } from './hooks/user.hook';
|
|
24
31
|
export { useSwap } from './hooks/swap.hook';
|
|
25
|
-
export {
|
|
32
|
+
export { useSupportChat } from './hooks/support.hook';
|
|
26
33
|
// Definitions
|
|
27
|
-
export {
|
|
34
|
+
export { CheckStatus, AmlReason } from './definitions/aml';
|
|
35
|
+
export { AssetType, AssetCategory, AssetUrl } from './definitions/asset';
|
|
36
|
+
export { BankAccountUrl } from './definitions/bank-account';
|
|
37
|
+
export { BankUrl } from './definitions/bank';
|
|
28
38
|
export { Blockchain } from './definitions/blockchain';
|
|
29
|
-
export {
|
|
30
|
-
export {
|
|
31
|
-
export {
|
|
32
|
-
export {
|
|
39
|
+
export { BuyUrl } from './definitions/buy';
|
|
40
|
+
export { CountryUrl } from './definitions/country';
|
|
41
|
+
export { ApiException } from './definitions/error';
|
|
42
|
+
export { FiatUrl } from './definitions/fiat';
|
|
43
|
+
export { PaymentLinkStatus, PaymentLinkMode, PaymentLinkPaymentStatus, PaymentLinkPaymentMode, PaymentStandardType, PaymentQuoteStatus, MinCompletionStatus, PaymentLinkBlockchain, PaymentRoutesUrl, PaymentLinksUrl, } from './definitions/route';
|
|
44
|
+
export { SettingsUrl } from './definitions/settings';
|
|
45
|
+
export { LanguageUrl } from './definitions/language';
|
|
46
|
+
export { UserRole } from './definitions/jwt';
|
|
47
|
+
export { AccountType, KycStatus, KycState, KycLevel, LimitPeriod, KycStepName, KycStepCancelable, KycStepType, KycStepStatus, UrlType, KycStepReason, QuestionType, GenderType, DocumentType, TfaType, TfaLevel, Limit, InvestmentDate, FundOrigin, LegalEntity, SignatoryPower, FileType, StoreType, MerchantCategory, GoodsType, GoodsCategory, isStepDone, buildKycUrl, } from './definitions/kyc';
|
|
48
|
+
export { SellUrl, } from './definitions/sell';
|
|
49
|
+
export { SwapUrl } from './definitions/swap';
|
|
50
|
+
export { UserStatus, PhoneCallTime, PhoneCallStatus, UserUrl, } from './definitions/user';
|
|
51
|
+
export { AuthUrl, AuthWalletType } from './definitions/auth';
|
|
52
|
+
export { FiatPaymentMethod, CryptoPaymentMethod, TransactionError, TransactionType, TransactionState, TransactionFailureReason, ExportType, ExportFormat, TransactionUrl, } from './definitions/transaction';
|
|
53
|
+
export { SupportIssueReason, SupportIssueType, SupportIssueState, SupportIssueInternalState, SupportMessageStatus, Department, SupportUrl, } from './definitions/support';
|
|
33
54
|
// Utils & Validations
|
|
34
55
|
export { Utils } from './utils';
|
|
35
56
|
export { default as Validations } from './validations';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","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AEV,YAAY,EAUZ,cAAc,GACf,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAGL,kBAAkB,EAClB,gBAAgB,EAShB,iBAAiB,EACjB,yBAAyB,EACzB,oBAAoB,EACpB,UAAU,EAEV,UAAU,GACX,MAAM,uBAAuB,CAAC;AAE/B,sBAAsB;AACtB,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,OAAO,IAAI,WAAW,EAAyD,MAAM,eAAe,CAAC"}
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,14 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
[K in keyof T]: T[K] extends U ? K : never;
|
|
3
|
-
}[keyof T];
|
|
4
|
-
export declare class Utils {
|
|
5
|
-
static groupBy<T, U>(list: T[], key: KeyType<T, U>): Map<U, T[]>;
|
|
6
|
-
static createRules(rules: any): any;
|
|
7
|
-
private static updateObject;
|
|
8
|
-
static formatAmount(amount?: number, decimals?: number): string;
|
|
9
|
-
static formatAmountCrypto(amount: number, decimals?: number): string;
|
|
10
|
-
static formatIban(iban?: string): string | null;
|
|
11
|
-
static isJwt(jwt?: string): boolean;
|
|
12
|
-
}
|
|
13
|
-
export {};
|
|
1
|
+
export { Utils } from '@dfx.swiss/core';
|
|
14
2
|
//# sourceMappingURL=utils.d.ts.map
|
package/dist/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC"}
|
package/dist/utils.js
CHANGED
|
@@ -1,52 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
import * as IbanTools from 'ibantools';
|
|
13
|
-
var Utils = /** @class */ (function () {
|
|
14
|
-
function Utils() {
|
|
15
|
-
}
|
|
16
|
-
Utils.groupBy = function (list, key) {
|
|
17
|
-
return list.reduce(function (map, item) { var _a; return map.set(item[key], ((_a = map.get(item[key])) !== null && _a !== void 0 ? _a : []).concat(item)); }, new Map());
|
|
18
|
-
};
|
|
19
|
-
Utils.createRules = function (rules) {
|
|
20
|
-
for (var property in rules) {
|
|
21
|
-
if (rules[property] instanceof Array) {
|
|
22
|
-
rules[property] = rules[property].reduce(function (prev, curr) { return Utils.updateObject(prev, curr); }, {});
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
return rules;
|
|
26
|
-
};
|
|
27
|
-
Utils.updateObject = function (obj, update) {
|
|
28
|
-
return obj ? __assign(__assign({}, obj), update) : undefined;
|
|
29
|
-
};
|
|
30
|
-
Utils.formatAmount = function (amount, decimals) {
|
|
31
|
-
var _a;
|
|
32
|
-
if (decimals === void 0) { decimals = 2; }
|
|
33
|
-
return (_a = amount === null || amount === void 0 ? void 0 : amount.toFixed(decimals).replace(/\B(?=(\d{3})+(?!\d))/g, ' ')) !== null && _a !== void 0 ? _a : '';
|
|
34
|
-
};
|
|
35
|
-
Utils.formatAmountCrypto = function (amount, decimals) {
|
|
36
|
-
if (decimals === void 0) { decimals = 5; }
|
|
37
|
-
var r = (+amount.toPrecision(decimals)).toFixed(decimals);
|
|
38
|
-
if (r.match(/\./)) {
|
|
39
|
-
r = r.replace(/\.?0+$/, '');
|
|
40
|
-
}
|
|
41
|
-
return r;
|
|
42
|
-
};
|
|
43
|
-
Utils.formatIban = function (iban) {
|
|
44
|
-
return IbanTools.friendlyFormatIBAN(iban);
|
|
45
|
-
};
|
|
46
|
-
Utils.isJwt = function (jwt) {
|
|
47
|
-
return jwt ? /^[A-Za-z0-9_-]{2,}(?:\.[A-Za-z0-9_-]{2,}){2}$/.test(jwt) : false;
|
|
48
|
-
};
|
|
49
|
-
return Utils;
|
|
50
|
-
}());
|
|
51
|
-
export { Utils };
|
|
1
|
+
export { Utils } from '@dfx.swiss/core';
|
|
52
2
|
//# sourceMappingURL=utils.js.map
|
package/dist/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC"}
|
package/dist/validations.d.ts
CHANGED
|
@@ -1,27 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
get Required(): {
|
|
4
|
-
required: {
|
|
5
|
-
value: boolean;
|
|
6
|
-
message: string;
|
|
7
|
-
};
|
|
8
|
-
};
|
|
9
|
-
get Mail(): {
|
|
10
|
-
pattern: {
|
|
11
|
-
value: RegExp;
|
|
12
|
-
message: string;
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
get Phone(): {
|
|
16
|
-
validate: (val: any) => string | true;
|
|
17
|
-
};
|
|
18
|
-
Iban(countries: Country[]): {
|
|
19
|
-
validate: (val: any) => string | true;
|
|
20
|
-
};
|
|
21
|
-
Custom: (validator: (value: any) => true | string) => {
|
|
22
|
-
validate: (val: any) => string | true;
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
declare const Validations: ValidationsClass;
|
|
26
|
-
export default Validations;
|
|
1
|
+
export { Validations as default } from '@dfx.swiss/core';
|
|
2
|
+
export type { RequiredRule, PatternRule, CustomRule, ValidationRule } from '@dfx.swiss/core';
|
|
27
3
|
//# sourceMappingURL=validations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validations.d.ts","sourceRoot":"","sources":["../src/validations.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"validations.d.ts","sourceRoot":"","sources":["../src/validations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,IAAI,OAAO,EAAE,MAAM,iBAAiB,CAAC;AACzD,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC"}
|
package/dist/validations.js
CHANGED
|
@@ -1,78 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import BlockedIbans from './definitions/blocked-iban.json';
|
|
3
|
-
import PhoneNumber from 'libphonenumber-js';
|
|
4
|
-
var regex = {
|
|
5
|
-
Mail: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
|
|
6
|
-
};
|
|
7
|
-
var ValidationsClass = /** @class */ (function () {
|
|
8
|
-
function ValidationsClass() {
|
|
9
|
-
this.Custom = function (validator) { return ({
|
|
10
|
-
validate: function (val) { return validator(val); },
|
|
11
|
-
}); };
|
|
12
|
-
}
|
|
13
|
-
Object.defineProperty(ValidationsClass.prototype, "Required", {
|
|
14
|
-
get: function () {
|
|
15
|
-
return {
|
|
16
|
-
required: {
|
|
17
|
-
value: true,
|
|
18
|
-
message: 'required',
|
|
19
|
-
},
|
|
20
|
-
};
|
|
21
|
-
},
|
|
22
|
-
enumerable: false,
|
|
23
|
-
configurable: true
|
|
24
|
-
});
|
|
25
|
-
Object.defineProperty(ValidationsClass.prototype, "Mail", {
|
|
26
|
-
get: function () {
|
|
27
|
-
return {
|
|
28
|
-
pattern: {
|
|
29
|
-
value: regex.Mail,
|
|
30
|
-
message: 'pattern',
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
},
|
|
34
|
-
enumerable: false,
|
|
35
|
-
configurable: true
|
|
36
|
-
});
|
|
37
|
-
Object.defineProperty(ValidationsClass.prototype, "Phone", {
|
|
38
|
-
get: function () {
|
|
39
|
-
return this.Custom(function (number) {
|
|
40
|
-
var _a;
|
|
41
|
-
try {
|
|
42
|
-
if (number) {
|
|
43
|
-
if (!number.match(/^\+\d/))
|
|
44
|
-
return 'code_and_number';
|
|
45
|
-
if (!((_a = PhoneNumber(number)) === null || _a === void 0 ? void 0 : _a.isValid()))
|
|
46
|
-
return 'pattern';
|
|
47
|
-
}
|
|
48
|
-
return true;
|
|
49
|
-
}
|
|
50
|
-
catch (_b) {
|
|
51
|
-
return 'pattern';
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
},
|
|
55
|
-
enumerable: false,
|
|
56
|
-
configurable: true
|
|
57
|
-
});
|
|
58
|
-
ValidationsClass.prototype.Iban = function (countries) {
|
|
59
|
-
return this.Custom(function (iban) {
|
|
60
|
-
iban = iban.split(' ').join('');
|
|
61
|
-
// check country
|
|
62
|
-
var allowedCountries = countries.map(function (c) { return c.symbol.toLowerCase(); });
|
|
63
|
-
if (iban.length >= 2 && !allowedCountries.find(function (c) { return iban.toLowerCase().startsWith(c); })) {
|
|
64
|
-
return 'iban_country_blocked';
|
|
65
|
-
}
|
|
66
|
-
// check blocked IBANs
|
|
67
|
-
var blockedIbans = BlockedIbans.map(function (i) { return i.split(' ').join('').toLowerCase(); });
|
|
68
|
-
if (blockedIbans.some(function (i) { return iban.toLowerCase().match(i) != null; })) {
|
|
69
|
-
return 'iban_blocked';
|
|
70
|
-
}
|
|
71
|
-
return IbanTools.validateIBAN(iban).valid ? true : 'pattern';
|
|
72
|
-
});
|
|
73
|
-
};
|
|
74
|
-
return ValidationsClass;
|
|
75
|
-
}());
|
|
76
|
-
var Validations = new ValidationsClass();
|
|
77
|
-
export default Validations;
|
|
1
|
+
export { Validations as default } from '@dfx.swiss/core';
|
|
78
2
|
//# sourceMappingURL=validations.js.map
|
package/dist/validations.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validations.js","sourceRoot":"","sources":["../src/validations.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"validations.js","sourceRoot":"","sources":["../src/validations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,IAAI,OAAO,EAAE,MAAM,iBAAiB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"private": false,
|
|
3
3
|
"name": "@dfx.swiss/react",
|
|
4
|
-
"version": "1.3.0-beta.
|
|
4
|
+
"version": "1.3.0-beta.271",
|
|
5
5
|
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/DFXswiss/packages.git"
|
|
9
|
+
},
|
|
6
10
|
"publishConfig": {
|
|
7
11
|
"access": "public"
|
|
8
12
|
},
|
|
@@ -17,11 +21,9 @@
|
|
|
17
21
|
"pack": "npm pack"
|
|
18
22
|
},
|
|
19
23
|
"dependencies": {
|
|
20
|
-
"
|
|
24
|
+
"@dfx.swiss/core": "^0.2.0-beta.8",
|
|
21
25
|
"jwt-decode": "^3.1.2",
|
|
22
|
-
"libphonenumber-js": "^1.10.39",
|
|
23
26
|
"react": "^18.2.0",
|
|
24
27
|
"typescript": "^4.9.3"
|
|
25
|
-
}
|
|
26
|
-
"gitHead": "b32b1398dd0a0a786c9df251467079a0ef6df63d"
|
|
28
|
+
}
|
|
27
29
|
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2023 DFX
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|