@nicefer/types 1.0.201 → 1.0.203
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/index.d.ts +1 -1
- package/dist/index.org.d.ts +98 -0
- package/dist/org/index.d.ts +3 -2
- package/package.json +13 -3
package/dist/index.d.ts
CHANGED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { PaymentIntent } from "@stripe/stripe-js";
|
|
2
|
+
export declare namespace Org {
|
|
3
|
+
interface NiceEvent {
|
|
4
|
+
id: string;
|
|
5
|
+
title: string;
|
|
6
|
+
description: string;
|
|
7
|
+
inPerson: boolean;
|
|
8
|
+
organizerName: string;
|
|
9
|
+
createdBy: {
|
|
10
|
+
id: string;
|
|
11
|
+
name: string;
|
|
12
|
+
};
|
|
13
|
+
location: string;
|
|
14
|
+
coverUrl?: string;
|
|
15
|
+
startDate: Date;
|
|
16
|
+
endDate: Date;
|
|
17
|
+
createdAt: string;
|
|
18
|
+
updatedAt?: string;
|
|
19
|
+
}
|
|
20
|
+
type Currency = 'HNL' | 'EUR' | 'USD';
|
|
21
|
+
type DonationStatus = 'pending_pay' | 'pending' | 'payment_error' | 'processing' | 'resolve' | 'rejected' | 'expired' | 'used';
|
|
22
|
+
/**
|
|
23
|
+
* Tipos de donaciones usadas en el radar
|
|
24
|
+
*
|
|
25
|
+
* Valores posibles:
|
|
26
|
+
* - `direct_donation`: Donación directa a una persona
|
|
27
|
+
* - `event`: Evento
|
|
28
|
+
* - `operating_expenses`: Gastos operativos
|
|
29
|
+
*/
|
|
30
|
+
type UsedIn = 'direct_donation' | 'event' | 'operating_expenses';
|
|
31
|
+
/**
|
|
32
|
+
* Tipos de movimientos del radar
|
|
33
|
+
*
|
|
34
|
+
* Valores posibles:
|
|
35
|
+
* - `info`: Movimiento informativo
|
|
36
|
+
* - `cash_converted_to_hnl`: Convertido a lempiras
|
|
37
|
+
* - `cash_income`: Ingreso
|
|
38
|
+
* - `cash_expense`: Gasto
|
|
39
|
+
* - `cash_refund`: Reembolso
|
|
40
|
+
* - `cash_reversion`: Reversión
|
|
41
|
+
*
|
|
42
|
+
* @remarks
|
|
43
|
+
* El reembolso es para el cliente, mientras que la reversión
|
|
44
|
+
* es para devolver el dinero a la donación original.
|
|
45
|
+
*/
|
|
46
|
+
type FlowType = 'info' | 'cash_converted_to_hnl' | 'cash_income' | 'cash_expense' | 'cash_refund' | 'cash_reversion';
|
|
47
|
+
interface Movement {
|
|
48
|
+
id: string;
|
|
49
|
+
title: string;
|
|
50
|
+
desc?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Tipos de donaciones usadas en el radar
|
|
53
|
+
*
|
|
54
|
+
* Valores posibles:
|
|
55
|
+
* - `direct_donation`: Donación directa a una persona
|
|
56
|
+
* - `event`: Evento
|
|
57
|
+
* - `operating_expenses`: Gastos operativos
|
|
58
|
+
*/
|
|
59
|
+
usedIn: UsedIn;
|
|
60
|
+
icon: 'ok' | 'error' | 'info' | 'waiting';
|
|
61
|
+
type: FlowType;
|
|
62
|
+
/**
|
|
63
|
+
* Monto involucrado en el movimiento,
|
|
64
|
+
* se debe proporcionar `0` cuándo {@link FlowType} sea `none`.
|
|
65
|
+
* Ej. `amount: 0`
|
|
66
|
+
*/
|
|
67
|
+
amount: number;
|
|
68
|
+
createdAt: string;
|
|
69
|
+
}
|
|
70
|
+
interface DonationCharges {
|
|
71
|
+
subtotal: number;
|
|
72
|
+
fees: number;
|
|
73
|
+
total: number;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* La donación se puede recibir en HNL, USD o EUR,
|
|
77
|
+
* pero se deberá convertir a lempiras antes de ser usada.
|
|
78
|
+
*/
|
|
79
|
+
interface Donation {
|
|
80
|
+
id: string;
|
|
81
|
+
donorId: string;
|
|
82
|
+
fullname: string;
|
|
83
|
+
anonymous: boolean;
|
|
84
|
+
charges: DonationCharges;
|
|
85
|
+
/**
|
|
86
|
+
* Cuándo se reciba en una moneda distinta de HNL, se convertirá a HNL.
|
|
87
|
+
* De lo contrario será `undefined`
|
|
88
|
+
*/
|
|
89
|
+
chargesInHNL?: DonationCharges;
|
|
90
|
+
status: DonationStatus;
|
|
91
|
+
mainCcy: Currency;
|
|
92
|
+
paymentStatus?: PaymentIntent.Status;
|
|
93
|
+
radar?: {
|
|
94
|
+
[movementId: string]: Movement;
|
|
95
|
+
};
|
|
96
|
+
createdAt?: string;
|
|
97
|
+
}
|
|
98
|
+
}
|
package/dist/org/index.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
1
|
+
export interface PruebaOrg {
|
|
2
|
+
name: string;
|
|
3
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nicefer/types",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.203",
|
|
4
4
|
"description": "Tipos compartidos para Nicefer",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -10,10 +10,20 @@
|
|
|
10
10
|
],
|
|
11
11
|
"exports": {
|
|
12
12
|
".": {
|
|
13
|
-
"types": "./dist/index.d.ts"
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"default": "./dist/index.js"
|
|
14
15
|
},
|
|
15
16
|
"./org": {
|
|
16
|
-
"types": "./dist/org/index.d.ts"
|
|
17
|
+
"types": "./dist/org/index.d.ts",
|
|
18
|
+
"default": "./dist/org/index.js"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"typesVersions": {
|
|
22
|
+
"*": {
|
|
23
|
+
"org": [
|
|
24
|
+
"./dist/org/index.js",
|
|
25
|
+
"./dist/org/index.d.ts"
|
|
26
|
+
]
|
|
17
27
|
}
|
|
18
28
|
},
|
|
19
29
|
"scripts": {
|