@riocrypto/common 1.0.2081 → 1.0.2084

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.
@@ -0,0 +1,7 @@
1
+ import { Subjects } from "./subjects";
2
+ export interface OnboardingCreatedEvent {
3
+ subject: Subjects.OnboardingCreated;
4
+ data: {
5
+ id: string;
6
+ };
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -133,6 +133,7 @@ export declare enum Subjects {
133
133
  STPWithdrawalCompleted = "stpWithdrawal:completed",
134
134
  LiquidityOrderCreated = "liquidityOrder:created",
135
135
  OnboardingUpdated = "onboarding:updated",
136
+ OnboardingCreated = "onboarding:created",
136
137
  FXTradeCreated = "fxTrade:created",
137
138
  FXTradeUpdated = "fxTrade:updated",
138
139
  FXTradeCancelled = "fxTrade:cancelled",
@@ -137,6 +137,7 @@ var Subjects;
137
137
  Subjects["STPWithdrawalCompleted"] = "stpWithdrawal:completed";
138
138
  Subjects["LiquidityOrderCreated"] = "liquidityOrder:created";
139
139
  Subjects["OnboardingUpdated"] = "onboarding:updated";
140
+ Subjects["OnboardingCreated"] = "onboarding:created";
140
141
  Subjects["FXTradeCreated"] = "fxTrade:created";
141
142
  Subjects["FXTradeUpdated"] = "fxTrade:updated";
142
143
  Subjects["FXTradeCancelled"] = "fxTrade:cancelled";
package/build/index.d.ts CHANGED
@@ -187,6 +187,7 @@ export * from "./events/liquidity-reservation-consumed-event";
187
187
  export * from "./events/liquidity-reservation-partially-consumed-event";
188
188
  export * from "./events/liquidity-reservation-expired-event";
189
189
  export * from "./events/liquidity-reservation-cancelled-event";
190
+ export * from "./events/onboarding-created-event";
190
191
  export * from "./types/auth-payload";
191
192
  export * from "./types/admin-auth-payload";
192
193
  export * from "./types/admin-auth";
@@ -391,7 +392,6 @@ export * from "./helpers/round-to-decimals";
391
392
  export * from "./helpers/number-with-commas";
392
393
  export * from "./helpers/alpha-2-to-alpha-3";
393
394
  export * from "./helpers/get-user-name";
394
- export * from "./helpers/get-highest-onboarding-status";
395
395
  export * from "./helpers/get-auth-name";
396
396
  export * from "./helpers/validate-individual-name";
397
397
  export * from "./helpers/validate-business-name";
package/build/index.js CHANGED
@@ -203,6 +203,7 @@ __exportStar(require("./events/liquidity-reservation-consumed-event"), exports);
203
203
  __exportStar(require("./events/liquidity-reservation-partially-consumed-event"), exports);
204
204
  __exportStar(require("./events/liquidity-reservation-expired-event"), exports);
205
205
  __exportStar(require("./events/liquidity-reservation-cancelled-event"), exports);
206
+ __exportStar(require("./events/onboarding-created-event"), exports);
206
207
  __exportStar(require("./types/auth-payload"), exports);
207
208
  __exportStar(require("./types/admin-auth-payload"), exports);
208
209
  __exportStar(require("./types/admin-auth"), exports);
@@ -407,7 +408,6 @@ __exportStar(require("./helpers/round-to-decimals"), exports);
407
408
  __exportStar(require("./helpers/number-with-commas"), exports);
408
409
  __exportStar(require("./helpers/alpha-2-to-alpha-3"), exports);
409
410
  __exportStar(require("./helpers/get-user-name"), exports);
410
- __exportStar(require("./helpers/get-highest-onboarding-status"), exports);
411
411
  __exportStar(require("./helpers/get-auth-name"), exports);
412
412
  __exportStar(require("./helpers/validate-individual-name"), exports);
413
413
  __exportStar(require("./helpers/validate-business-name"), exports);
@@ -4,56 +4,10 @@ import { OnboardingStatus } from "./onboarding-status";
4
4
  import { PlatformFeeRange } from "./platform-fee-range";
5
5
  import { UserAttribute } from "./user-attribute";
6
6
  import { UserType } from "./user-type";
7
- import { ImmigrationStatus } from "./immigration-status";
8
7
  import { Country } from "./country";
9
8
  import { Fiat } from "./fiat";
10
9
  import { Crypto } from "./crypto";
11
10
  import { Side } from "./side";
12
- declare type OnboardingBase = {
13
- aipriseBusinessProfileId?: string;
14
- aipriseUserProfileId?: string;
15
- };
16
- declare type OnboardingCountryData = {
17
- [country in CountryOfOrigin]?: {
18
- status?: OnboardingStatus;
19
- hasAcceptedTerms?: boolean;
20
- bridgeId?: string;
21
- onboardingId?: string;
22
- personalId?: string;
23
- taxId?: string;
24
- immigrationStatus?: ImmigrationStatus;
25
- individualIdentityVerification?: {
26
- status?: "passed" | "failed" | "review";
27
- };
28
- legalRepresentative?: {
29
- firstName?: string;
30
- middleName?: string;
31
- lastName?: string;
32
- secondLastName?: string;
33
- verificationStatus?: "passed" | "failed" | "review";
34
- email?: string;
35
- };
36
- files?: {
37
- certificateOfIncorporation?: string;
38
- KYCReport?: string;
39
- taxTranscript?: string;
40
- proofOfAddress?: string;
41
- businessRegistration?: string;
42
- taxIdentificationCertificate?: string;
43
- legalRepresentativeIdPowerOfAttorney?: string;
44
- personalIdentificationCertificate?: string;
45
- extraFiles?: string[];
46
- };
47
- address?: {
48
- street1?: string;
49
- street2?: string;
50
- city?: string;
51
- state?: string;
52
- postalCode?: string;
53
- country?: CountryOfOrigin;
54
- };
55
- };
56
- };
57
11
  declare type IndividualUser = {
58
12
  id: string;
59
13
  individualData?: {
@@ -108,7 +62,24 @@ export declare type User = {
108
62
  sell?: PlatformFeeRange[];
109
63
  };
110
64
  };
111
- onboarding?: OnboardingBase & OnboardingCountryData;
65
+ onboarding: {
66
+ country: Country;
67
+ aipriseBusinessProfileId?: string;
68
+ aipriseUserProfileId?: string;
69
+ bridgeCustomerId?: string;
70
+ aipriseBusinessVerificationSessionUrl?: string;
71
+ aipriseUserVerificationSessionUrl?: string;
72
+ status: OnboardingStatus;
73
+ hasAcceptedTerms: boolean;
74
+ address?: {
75
+ street1?: string;
76
+ street2?: string;
77
+ city?: string;
78
+ state?: string;
79
+ postalCode?: string;
80
+ country?: CountryOfOrigin;
81
+ };
82
+ };
112
83
  invoicing?: {
113
84
  MX?: {
114
85
  shouldInvoice?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common",
3
- "version": "1.0.2081",
3
+ "version": "1.0.2084",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
@@ -1,8 +0,0 @@
1
- import { UBO } from "../types/UBO";
2
- import { CountryOfOrigin } from "../types/country-of-origin";
3
- import { OnboardingStatus } from "../types/onboarding-status";
4
- import { User } from "../types/user";
5
- export declare const getHighestOnboardingStatus: (user: User | UBO, excludeUS?: boolean) => {
6
- status?: OnboardingStatus | undefined;
7
- country?: CountryOfOrigin | undefined;
8
- };
@@ -1,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getHighestOnboardingStatus = void 0;
4
- const country_of_origin_1 = require("../types/country-of-origin");
5
- const onboarding_status_1 = require("../types/onboarding-status");
6
- const onboardingStatusOrder = [
7
- onboarding_status_1.OnboardingStatus.None,
8
- onboarding_status_1.OnboardingStatus.Started,
9
- onboarding_status_1.OnboardingStatus.Review,
10
- onboarding_status_1.OnboardingStatus.Approved,
11
- ];
12
- const getHighestOnboardingStatus = (user, excludeUS) => {
13
- var _a;
14
- let status = undefined;
15
- let statusCountry = undefined;
16
- if (user.onboarding) {
17
- for (const country of Object.keys(user.onboarding)) {
18
- if ((_a = user.onboarding[country]) === null || _a === void 0 ? void 0 : _a.status) {
19
- if (!status ||
20
- onboardingStatusOrder.indexOf(user.onboarding[country].status) > onboardingStatusOrder.indexOf(status)) {
21
- if (excludeUS && country === country_of_origin_1.CountryOfOrigin.UnitedStates) {
22
- continue;
23
- }
24
- status = user.onboarding[country].status;
25
- statusCountry = country;
26
- }
27
- }
28
- }
29
- }
30
- return { status, country: statusCountry };
31
- };
32
- exports.getHighestOnboardingStatus = getHighestOnboardingStatus;