@andco/protocol 0.1.0-ti.0 → 0.1.0-ti.2
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/rar/bank.d.ts +164 -12
- package/dist/rar/bank.d.ts.map +1 -1
- package/dist/rar/bank.js +51 -13
- package/dist/rar/catalog.d.ts +134 -4
- package/dist/rar/catalog.d.ts.map +1 -1
- package/dist/rar/catalog.js +12 -6
- package/dist/rar/json-schemas.generated.d.ts.map +1 -1
- package/dist/rar/json-schemas.generated.js +375 -3
- package/dist/rar/money.d.ts +1 -1
- package/dist/rar/money.js +1 -1
- package/dist/rest/accounts.d.ts +66 -44
- package/dist/rest/accounts.d.ts.map +1 -1
- package/dist/rest/accounts.js +31 -21
- package/dist/rest/contract.d.ts +21 -15
- package/dist/rest/contract.d.ts.map +1 -1
- package/dist/rest/contract.js +4 -4
- package/dist/rest/events.js +1 -1
- package/dist/rest/intents.d.ts +42 -1
- package/dist/rest/intents.d.ts.map +1 -1
- package/dist/rest/intents.js +11 -3
- package/dist/transport/financial-events.d.ts +1 -1
- package/dist/transport/generated/oauth-api.d.ts +48 -24
- package/dist/transport/generated/oauth-api.d.ts.map +1 -1
- package/dist/transport/rest.d.ts +5 -4
- package/dist/transport/rest.d.ts.map +1 -1
- package/dist/transport/rest.js +1 -1
- package/package.json +1 -1
|
@@ -802,12 +802,12 @@ export const ANDCO_RAR_JSON_SCHEMAS = {
|
|
|
802
802
|
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
803
803
|
}
|
|
804
804
|
},
|
|
805
|
-
"
|
|
805
|
+
"bank_movement": {
|
|
806
806
|
"grantRequest": {
|
|
807
807
|
"type": "object",
|
|
808
808
|
"properties": {
|
|
809
809
|
"type": {
|
|
810
|
-
"const": "
|
|
810
|
+
"const": "bank_movement"
|
|
811
811
|
},
|
|
812
812
|
"actions": {
|
|
813
813
|
"type": "array",
|
|
@@ -1041,7 +1041,7 @@ export const ANDCO_RAR_JSON_SCHEMAS = {
|
|
|
1041
1041
|
"type": "object",
|
|
1042
1042
|
"properties": {
|
|
1043
1043
|
"type": {
|
|
1044
|
-
"const": "
|
|
1044
|
+
"const": "bank_movement"
|
|
1045
1045
|
},
|
|
1046
1046
|
"actions": {
|
|
1047
1047
|
"type": "array",
|
|
@@ -2684,6 +2684,378 @@ export const ANDCO_RAR_JSON_SCHEMAS = {
|
|
|
2684
2684
|
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
2685
2685
|
}
|
|
2686
2686
|
},
|
|
2687
|
+
"bank_own_account_transfer": {
|
|
2688
|
+
"grantRequest": {
|
|
2689
|
+
"type": "object",
|
|
2690
|
+
"properties": {
|
|
2691
|
+
"type": {
|
|
2692
|
+
"const": "bank_own_account_transfer"
|
|
2693
|
+
},
|
|
2694
|
+
"actions": {
|
|
2695
|
+
"type": "array",
|
|
2696
|
+
"items": {
|
|
2697
|
+
"enum": [
|
|
2698
|
+
"create"
|
|
2699
|
+
],
|
|
2700
|
+
"type": "string"
|
|
2701
|
+
},
|
|
2702
|
+
"minItems": 1,
|
|
2703
|
+
"uniqueItems": true
|
|
2704
|
+
},
|
|
2705
|
+
"locations": {
|
|
2706
|
+
"type": "array",
|
|
2707
|
+
"items": [
|
|
2708
|
+
{
|
|
2709
|
+
"const": "https://api.andco.com"
|
|
2710
|
+
}
|
|
2711
|
+
],
|
|
2712
|
+
"minItems": 1,
|
|
2713
|
+
"additionalItems": false
|
|
2714
|
+
},
|
|
2715
|
+
"subject": {
|
|
2716
|
+
"anyOf": [
|
|
2717
|
+
{
|
|
2718
|
+
"oneOf": [
|
|
2719
|
+
{
|
|
2720
|
+
"type": "object",
|
|
2721
|
+
"properties": {
|
|
2722
|
+
"type": {
|
|
2723
|
+
"const": "profile"
|
|
2724
|
+
},
|
|
2725
|
+
"identifier": {
|
|
2726
|
+
"anyOf": [
|
|
2727
|
+
{
|
|
2728
|
+
"type": "string",
|
|
2729
|
+
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
|
|
2730
|
+
},
|
|
2731
|
+
{
|
|
2732
|
+
"type": "null"
|
|
2733
|
+
}
|
|
2734
|
+
]
|
|
2735
|
+
}
|
|
2736
|
+
},
|
|
2737
|
+
"required": [
|
|
2738
|
+
"type"
|
|
2739
|
+
],
|
|
2740
|
+
"additionalProperties": false
|
|
2741
|
+
},
|
|
2742
|
+
{
|
|
2743
|
+
"type": "object",
|
|
2744
|
+
"properties": {
|
|
2745
|
+
"type": {
|
|
2746
|
+
"const": "organization"
|
|
2747
|
+
},
|
|
2748
|
+
"identifier": {
|
|
2749
|
+
"anyOf": [
|
|
2750
|
+
{
|
|
2751
|
+
"type": "string",
|
|
2752
|
+
"pattern": "^[1-9][0-9]{0,9}$"
|
|
2753
|
+
},
|
|
2754
|
+
{
|
|
2755
|
+
"type": "null"
|
|
2756
|
+
}
|
|
2757
|
+
]
|
|
2758
|
+
},
|
|
2759
|
+
"editable": {
|
|
2760
|
+
"anyOf": [
|
|
2761
|
+
{
|
|
2762
|
+
"type": "boolean"
|
|
2763
|
+
},
|
|
2764
|
+
{
|
|
2765
|
+
"type": "null"
|
|
2766
|
+
}
|
|
2767
|
+
]
|
|
2768
|
+
}
|
|
2769
|
+
},
|
|
2770
|
+
"required": [
|
|
2771
|
+
"type"
|
|
2772
|
+
],
|
|
2773
|
+
"additionalProperties": false
|
|
2774
|
+
}
|
|
2775
|
+
]
|
|
2776
|
+
},
|
|
2777
|
+
{
|
|
2778
|
+
"type": "null"
|
|
2779
|
+
}
|
|
2780
|
+
]
|
|
2781
|
+
},
|
|
2782
|
+
"accounts": {
|
|
2783
|
+
"anyOf": [
|
|
2784
|
+
{
|
|
2785
|
+
"type": "array",
|
|
2786
|
+
"items": {
|
|
2787
|
+
"anyOf": [
|
|
2788
|
+
{
|
|
2789
|
+
"type": "object",
|
|
2790
|
+
"properties": {
|
|
2791
|
+
"type": {
|
|
2792
|
+
"anyOf": [
|
|
2793
|
+
{
|
|
2794
|
+
"const": "account_key"
|
|
2795
|
+
},
|
|
2796
|
+
{
|
|
2797
|
+
"type": "null"
|
|
2798
|
+
}
|
|
2799
|
+
]
|
|
2800
|
+
},
|
|
2801
|
+
"pattern": {
|
|
2802
|
+
"type": "string",
|
|
2803
|
+
"pattern": "^(?:\\*|[a-z][a-z0-9_-]{0,63}\\*?)$"
|
|
2804
|
+
},
|
|
2805
|
+
"editable": {
|
|
2806
|
+
"anyOf": [
|
|
2807
|
+
{
|
|
2808
|
+
"type": "boolean"
|
|
2809
|
+
},
|
|
2810
|
+
{
|
|
2811
|
+
"type": "null"
|
|
2812
|
+
}
|
|
2813
|
+
]
|
|
2814
|
+
},
|
|
2815
|
+
"selection": {
|
|
2816
|
+
"anyOf": [
|
|
2817
|
+
{
|
|
2818
|
+
"enum": [
|
|
2819
|
+
"single",
|
|
2820
|
+
"multiple"
|
|
2821
|
+
],
|
|
2822
|
+
"type": "string"
|
|
2823
|
+
},
|
|
2824
|
+
{
|
|
2825
|
+
"type": "null"
|
|
2826
|
+
}
|
|
2827
|
+
]
|
|
2828
|
+
}
|
|
2829
|
+
},
|
|
2830
|
+
"required": [
|
|
2831
|
+
"pattern"
|
|
2832
|
+
],
|
|
2833
|
+
"additionalProperties": false
|
|
2834
|
+
},
|
|
2835
|
+
{
|
|
2836
|
+
"type": "object",
|
|
2837
|
+
"properties": {
|
|
2838
|
+
"type": {
|
|
2839
|
+
"const": "account"
|
|
2840
|
+
},
|
|
2841
|
+
"id": {
|
|
2842
|
+
"type": "string",
|
|
2843
|
+
"format": "uuid"
|
|
2844
|
+
},
|
|
2845
|
+
"editable": {
|
|
2846
|
+
"anyOf": [
|
|
2847
|
+
{
|
|
2848
|
+
"type": "boolean"
|
|
2849
|
+
},
|
|
2850
|
+
{
|
|
2851
|
+
"type": "null"
|
|
2852
|
+
}
|
|
2853
|
+
]
|
|
2854
|
+
}
|
|
2855
|
+
},
|
|
2856
|
+
"required": [
|
|
2857
|
+
"type",
|
|
2858
|
+
"id"
|
|
2859
|
+
],
|
|
2860
|
+
"additionalProperties": false
|
|
2861
|
+
},
|
|
2862
|
+
{
|
|
2863
|
+
"type": "object",
|
|
2864
|
+
"properties": {
|
|
2865
|
+
"type": {
|
|
2866
|
+
"const": "any"
|
|
2867
|
+
},
|
|
2868
|
+
"limit": {
|
|
2869
|
+
"const": "own"
|
|
2870
|
+
},
|
|
2871
|
+
"editable": {
|
|
2872
|
+
"anyOf": [
|
|
2873
|
+
{
|
|
2874
|
+
"type": "boolean"
|
|
2875
|
+
},
|
|
2876
|
+
{
|
|
2877
|
+
"type": "null"
|
|
2878
|
+
}
|
|
2879
|
+
]
|
|
2880
|
+
},
|
|
2881
|
+
"selection": {
|
|
2882
|
+
"anyOf": [
|
|
2883
|
+
{
|
|
2884
|
+
"enum": [
|
|
2885
|
+
"single",
|
|
2886
|
+
"multiple"
|
|
2887
|
+
],
|
|
2888
|
+
"type": "string"
|
|
2889
|
+
},
|
|
2890
|
+
{
|
|
2891
|
+
"type": "null"
|
|
2892
|
+
}
|
|
2893
|
+
]
|
|
2894
|
+
}
|
|
2895
|
+
},
|
|
2896
|
+
"required": [
|
|
2897
|
+
"type",
|
|
2898
|
+
"limit"
|
|
2899
|
+
],
|
|
2900
|
+
"additionalProperties": false
|
|
2901
|
+
}
|
|
2902
|
+
]
|
|
2903
|
+
},
|
|
2904
|
+
"minItems": 1,
|
|
2905
|
+
"maxItems": 100,
|
|
2906
|
+
"uniqueItems": true
|
|
2907
|
+
},
|
|
2908
|
+
{
|
|
2909
|
+
"type": "null"
|
|
2910
|
+
}
|
|
2911
|
+
]
|
|
2912
|
+
}
|
|
2913
|
+
},
|
|
2914
|
+
"required": [
|
|
2915
|
+
"type",
|
|
2916
|
+
"actions",
|
|
2917
|
+
"locations"
|
|
2918
|
+
],
|
|
2919
|
+
"additionalProperties": false,
|
|
2920
|
+
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
2921
|
+
},
|
|
2922
|
+
"grant": {
|
|
2923
|
+
"type": "object",
|
|
2924
|
+
"properties": {
|
|
2925
|
+
"type": {
|
|
2926
|
+
"const": "bank_own_account_transfer"
|
|
2927
|
+
},
|
|
2928
|
+
"actions": {
|
|
2929
|
+
"type": "array",
|
|
2930
|
+
"items": {
|
|
2931
|
+
"enum": [
|
|
2932
|
+
"create"
|
|
2933
|
+
],
|
|
2934
|
+
"type": "string"
|
|
2935
|
+
},
|
|
2936
|
+
"minItems": 1,
|
|
2937
|
+
"uniqueItems": true
|
|
2938
|
+
},
|
|
2939
|
+
"locations": {
|
|
2940
|
+
"type": "array",
|
|
2941
|
+
"items": [
|
|
2942
|
+
{
|
|
2943
|
+
"const": "https://api.andco.com"
|
|
2944
|
+
}
|
|
2945
|
+
],
|
|
2946
|
+
"minItems": 1,
|
|
2947
|
+
"additionalItems": false
|
|
2948
|
+
},
|
|
2949
|
+
"subject": {
|
|
2950
|
+
"oneOf": [
|
|
2951
|
+
{
|
|
2952
|
+
"type": "object",
|
|
2953
|
+
"properties": {
|
|
2954
|
+
"type": {
|
|
2955
|
+
"const": "profile"
|
|
2956
|
+
},
|
|
2957
|
+
"identifier": {
|
|
2958
|
+
"type": "string",
|
|
2959
|
+
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
|
|
2960
|
+
}
|
|
2961
|
+
},
|
|
2962
|
+
"required": [
|
|
2963
|
+
"type",
|
|
2964
|
+
"identifier"
|
|
2965
|
+
],
|
|
2966
|
+
"additionalProperties": false
|
|
2967
|
+
},
|
|
2968
|
+
{
|
|
2969
|
+
"type": "object",
|
|
2970
|
+
"properties": {
|
|
2971
|
+
"type": {
|
|
2972
|
+
"const": "organization"
|
|
2973
|
+
},
|
|
2974
|
+
"identifier": {
|
|
2975
|
+
"type": "string",
|
|
2976
|
+
"pattern": "^[1-9][0-9]{0,9}$"
|
|
2977
|
+
}
|
|
2978
|
+
},
|
|
2979
|
+
"required": [
|
|
2980
|
+
"type",
|
|
2981
|
+
"identifier"
|
|
2982
|
+
],
|
|
2983
|
+
"additionalProperties": false
|
|
2984
|
+
}
|
|
2985
|
+
]
|
|
2986
|
+
},
|
|
2987
|
+
"accounts": {
|
|
2988
|
+
"type": "array",
|
|
2989
|
+
"items": {
|
|
2990
|
+
"anyOf": [
|
|
2991
|
+
{
|
|
2992
|
+
"type": "object",
|
|
2993
|
+
"properties": {
|
|
2994
|
+
"type": {
|
|
2995
|
+
"const": "account_key"
|
|
2996
|
+
},
|
|
2997
|
+
"pattern": {
|
|
2998
|
+
"type": "string",
|
|
2999
|
+
"pattern": "^(?:\\*|[a-z][a-z0-9_-]{0,63}\\*?)$"
|
|
3000
|
+
}
|
|
3001
|
+
},
|
|
3002
|
+
"required": [
|
|
3003
|
+
"type",
|
|
3004
|
+
"pattern"
|
|
3005
|
+
],
|
|
3006
|
+
"additionalProperties": false
|
|
3007
|
+
},
|
|
3008
|
+
{
|
|
3009
|
+
"type": "object",
|
|
3010
|
+
"properties": {
|
|
3011
|
+
"type": {
|
|
3012
|
+
"const": "account"
|
|
3013
|
+
},
|
|
3014
|
+
"id": {
|
|
3015
|
+
"type": "string",
|
|
3016
|
+
"format": "uuid"
|
|
3017
|
+
}
|
|
3018
|
+
},
|
|
3019
|
+
"required": [
|
|
3020
|
+
"type",
|
|
3021
|
+
"id"
|
|
3022
|
+
],
|
|
3023
|
+
"additionalProperties": false
|
|
3024
|
+
},
|
|
3025
|
+
{
|
|
3026
|
+
"type": "object",
|
|
3027
|
+
"properties": {
|
|
3028
|
+
"type": {
|
|
3029
|
+
"const": "any"
|
|
3030
|
+
},
|
|
3031
|
+
"limit": {
|
|
3032
|
+
"const": "own"
|
|
3033
|
+
}
|
|
3034
|
+
},
|
|
3035
|
+
"required": [
|
|
3036
|
+
"type",
|
|
3037
|
+
"limit"
|
|
3038
|
+
],
|
|
3039
|
+
"additionalProperties": false
|
|
3040
|
+
}
|
|
3041
|
+
]
|
|
3042
|
+
},
|
|
3043
|
+
"minItems": 1,
|
|
3044
|
+
"maxItems": 100,
|
|
3045
|
+
"uniqueItems": true
|
|
3046
|
+
}
|
|
3047
|
+
},
|
|
3048
|
+
"required": [
|
|
3049
|
+
"type",
|
|
3050
|
+
"actions",
|
|
3051
|
+
"locations",
|
|
3052
|
+
"subject",
|
|
3053
|
+
"accounts"
|
|
3054
|
+
],
|
|
3055
|
+
"additionalProperties": false,
|
|
3056
|
+
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
3057
|
+
}
|
|
3058
|
+
},
|
|
2687
3059
|
"bank_deposit": {
|
|
2688
3060
|
"grantRequest": {
|
|
2689
3061
|
"type": "object",
|
package/dist/rar/money.d.ts
CHANGED
|
@@ -40,7 +40,7 @@ export declare const MINIMUM_TRANSACTION_AMOUNT = "1000";
|
|
|
40
40
|
/**
|
|
41
41
|
* {@link MONEY_PATTERN} restricted to amounts of at least {@link MINIMUM_TRANSACTION_AMOUNT}: four to
|
|
42
42
|
* fifteen digits without a leading zero. It is a separate scalar, not a change to `MONEY_PATTERN`,
|
|
43
|
-
* because only the limits of a permission carry the floor; a
|
|
43
|
+
* because only the limits of a permission carry the floor; a Movement read back from an account
|
|
44
44
|
* may be smaller.
|
|
45
45
|
*
|
|
46
46
|
* The floor lives in the regex, rather than in a numeric comparison, because the generated JSON
|
package/dist/rar/money.js
CHANGED
|
@@ -38,7 +38,7 @@ export const MINIMUM_TRANSACTION_AMOUNT = "1000";
|
|
|
38
38
|
/**
|
|
39
39
|
* {@link MONEY_PATTERN} restricted to amounts of at least {@link MINIMUM_TRANSACTION_AMOUNT}: four to
|
|
40
40
|
* fifteen digits without a leading zero. It is a separate scalar, not a change to `MONEY_PATTERN`,
|
|
41
|
-
* because only the limits of a permission carry the floor; a
|
|
41
|
+
* because only the limits of a permission carry the floor; a Movement read back from an account
|
|
42
42
|
* may be smaller.
|
|
43
43
|
*
|
|
44
44
|
* The floor lives in the regex, rather than in a numeric comparison, because the generated JSON
|
package/dist/rest/accounts.d.ts
CHANGED
|
@@ -117,7 +117,7 @@ declare const InvalidCursor_base: (abstract new (data: {}, message?: string, hin
|
|
|
117
117
|
};
|
|
118
118
|
};
|
|
119
119
|
/**
|
|
120
|
-
* The `after` of the
|
|
120
|
+
* The `after` of the movements walk is not the cursor AndCo issued for the next page. The
|
|
121
121
|
* AndCo's cursor travels untouched: take it from `pageInfo.endCursor` and nothing else.
|
|
122
122
|
*/
|
|
123
123
|
export declare class InvalidCursor extends /* @__PURE__ */ InvalidCursor_base {
|
|
@@ -176,41 +176,54 @@ export declare const AccountPage: v.SchemaWithPipe<readonly [v.StrictObjectSchem
|
|
|
176
176
|
};
|
|
177
177
|
}, string>]>;
|
|
178
178
|
/**
|
|
179
|
-
* One account
|
|
180
|
-
*
|
|
181
|
-
*
|
|
179
|
+
* One Movement of an account: a credit or a debit, as AndCo reports it. The node is a closed list of
|
|
180
|
+
* fields with the names AndCo gives them, in snake_case: nothing else leaves the API, and a camelCase
|
|
181
|
+
* node or a field outside the list is refused. "Transaction" means only a ledger id, `transaction_id`.
|
|
182
|
+
*
|
|
183
|
+
* @example
|
|
184
|
+
* const movement: Movement = {
|
|
185
|
+
* object: "movement", id, transaction_id: "88213", description: "Transferencia", amount: 500000,
|
|
186
|
+
* currency: "CLP", movement_type: "withdrawal", movement_origin: null, movement_date,
|
|
187
|
+
* running_balance: 1200000, payment_type: null, reversed: false, note: null, transfer_id,
|
|
188
|
+
* };
|
|
182
189
|
*/
|
|
183
|
-
export declare const
|
|
190
|
+
export declare const Movement: v.StrictObjectSchema<{
|
|
191
|
+
readonly object: v.LiteralSchema<"movement", undefined>;
|
|
184
192
|
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
185
|
-
readonly
|
|
193
|
+
readonly transaction_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The ledger id of the transaction that posted this Movement, or null when AndCo has none. A Transfer that succeeded carries the same id of its debit.">]>;
|
|
186
194
|
readonly description: v.StringSchema<undefined>;
|
|
187
|
-
readonly amount: v.SchemaWithPipe<readonly [v.
|
|
188
|
-
readonly
|
|
189
|
-
readonly
|
|
190
|
-
readonly
|
|
191
|
-
readonly
|
|
192
|
-
readonly
|
|
195
|
+
readonly amount: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, number, undefined>, v.DescriptionAction<number, "A positive integer in whole pesos (CLP). What tells an inflow from an outflow is `movement_type`, not a sign.">]>;
|
|
196
|
+
readonly currency: v.SchemaWithPipe<readonly [v.LiteralSchema<"CLP", undefined>, v.DescriptionAction<"CLP", "The currency of the account: a permission never assumes it, so the node names it.">]>;
|
|
197
|
+
readonly movement_type: v.SchemaWithPipe<readonly [v.PicklistSchema<["deposit", "interest", "withdrawal"], undefined>, v.DescriptionAction<"deposit" | "interest" | "withdrawal", "The kind of Movement, in AndCo's own words. `deposit` and `interest` bring money into this account and raise its balance; `withdrawal` takes money out and lowers it. `amount` is always positive, so `movement_type` is what tells an inflow from an outflow.">]>;
|
|
198
|
+
readonly movement_origin: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
199
|
+
readonly movement_date: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
|
|
200
|
+
readonly running_balance: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, number, undefined>, v.MaxValueAction<number, number, undefined>]>, undefined>, v.DescriptionAction<number | null, "The balance after this Movement, an integer in whole pesos, or null when AndCo did not send one: it is never made up. Real balances do go negative, so the sign is not narrowed away.">]>;
|
|
201
|
+
readonly payment_type: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
193
202
|
readonly reversed: v.BooleanSchema<undefined>;
|
|
194
203
|
readonly note: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
204
|
+
readonly transfer_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, undefined>, v.DescriptionAction<string | null, "The id of the Transfer that this debit belongs to, only when the Grant may read that Transfer: one this client created for the same subject, or any Transfer of an account that a `bank_transfer` `read` detail covers. Always present. A null never means that no Transfer exists: it means no Transfer that this Grant may read, and it is also null for a Movement without a `transaction_id` and for one that AndCo has posted before AndCo recorded the Transfer, which fills on a later read. It is null for a credit too, except the credit leg of an own-account Transfer, which links by the same read rule as the debit.">]>;
|
|
195
205
|
}, undefined>;
|
|
196
|
-
/** One
|
|
197
|
-
export type
|
|
198
|
-
/** A page of one account's
|
|
199
|
-
export declare const
|
|
206
|
+
/** One Movement of an account. */
|
|
207
|
+
export type Movement = v.InferOutput<typeof Movement>;
|
|
208
|
+
/** A page of one account's Movements, read live from the bank. */
|
|
209
|
+
export declare const MovementPage: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
200
210
|
readonly edges: v.ArraySchema<v.StrictObjectSchema<{
|
|
201
211
|
readonly cursor: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
202
212
|
readonly node: v.StrictObjectSchema<{
|
|
213
|
+
readonly object: v.LiteralSchema<"movement", undefined>;
|
|
203
214
|
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
204
|
-
readonly
|
|
215
|
+
readonly transaction_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The ledger id of the transaction that posted this Movement, or null when AndCo has none. A Transfer that succeeded carries the same id of its debit.">]>;
|
|
205
216
|
readonly description: v.StringSchema<undefined>;
|
|
206
|
-
readonly amount: v.SchemaWithPipe<readonly [v.
|
|
207
|
-
readonly
|
|
208
|
-
readonly
|
|
209
|
-
readonly
|
|
210
|
-
readonly
|
|
211
|
-
readonly
|
|
217
|
+
readonly amount: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, number, undefined>, v.DescriptionAction<number, "A positive integer in whole pesos (CLP). What tells an inflow from an outflow is `movement_type`, not a sign.">]>;
|
|
218
|
+
readonly currency: v.SchemaWithPipe<readonly [v.LiteralSchema<"CLP", undefined>, v.DescriptionAction<"CLP", "The currency of the account: a permission never assumes it, so the node names it.">]>;
|
|
219
|
+
readonly movement_type: v.SchemaWithPipe<readonly [v.PicklistSchema<["deposit", "interest", "withdrawal"], undefined>, v.DescriptionAction<"deposit" | "interest" | "withdrawal", "The kind of Movement, in AndCo's own words. `deposit` and `interest` bring money into this account and raise its balance; `withdrawal` takes money out and lowers it. `amount` is always positive, so `movement_type` is what tells an inflow from an outflow.">]>;
|
|
220
|
+
readonly movement_origin: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
221
|
+
readonly movement_date: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
|
|
222
|
+
readonly running_balance: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, number, undefined>, v.MaxValueAction<number, number, undefined>]>, undefined>, v.DescriptionAction<number | null, "The balance after this Movement, an integer in whole pesos, or null when AndCo did not send one: it is never made up. Real balances do go negative, so the sign is not narrowed away.">]>;
|
|
223
|
+
readonly payment_type: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
212
224
|
readonly reversed: v.BooleanSchema<undefined>;
|
|
213
225
|
readonly note: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
226
|
+
readonly transfer_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, undefined>, v.DescriptionAction<string | null, "The id of the Transfer that this debit belongs to, only when the Grant may read that Transfer: one this client created for the same subject, or any Transfer of an account that a `bank_transfer` `read` detail covers. Always present. A null never means that no Transfer exists: it means no Transfer that this Grant may read, and it is also null for a Movement without a `transaction_id` and for one that AndCo has posted before AndCo recorded the Transfer, which fills on a later read. It is null for a credit too, except the credit leg of an own-account Transfer, which links by the same read rule as the debit.">]>;
|
|
214
227
|
}, undefined>;
|
|
215
228
|
}, undefined>, undefined>;
|
|
216
229
|
readonly pageInfo: v.StrictObjectSchema<{
|
|
@@ -223,17 +236,20 @@ export declare const BankTransactionPage: v.SchemaWithPipe<readonly [v.StrictObj
|
|
|
223
236
|
edges: {
|
|
224
237
|
cursor: string | null;
|
|
225
238
|
node: {
|
|
239
|
+
object: "movement";
|
|
226
240
|
id: string;
|
|
227
|
-
|
|
241
|
+
transaction_id: string | null;
|
|
228
242
|
description: string;
|
|
229
|
-
amount:
|
|
243
|
+
amount: number;
|
|
244
|
+
currency: "CLP";
|
|
230
245
|
movement_type: "deposit" | "interest" | "withdrawal";
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
246
|
+
movement_origin: string | null;
|
|
247
|
+
movement_date: string;
|
|
248
|
+
running_balance: number | null;
|
|
249
|
+
payment_type: string | null;
|
|
235
250
|
reversed: boolean;
|
|
236
251
|
note: string | null;
|
|
252
|
+
transfer_id: string | null;
|
|
237
253
|
};
|
|
238
254
|
}[];
|
|
239
255
|
pageInfo: {
|
|
@@ -291,8 +307,8 @@ export declare const listAccounts: import("@orpc/contract").ProcedureContractBui
|
|
|
291
307
|
hasNextPage: boolean;
|
|
292
308
|
};
|
|
293
309
|
}, string>]>, import("./api-error.js").AndcoAPIErrorMap<readonly [typeof InvalidRequest, typeof InvalidAccountsCursor, typeof InvalidToken, typeof InvalidOrigin, typeof InsufficientAuthorization, typeof UnsupportedVersion, typeof ServerError, typeof BankConnectionInteractionRequired, typeof TemporarilyUnavailable]>>;
|
|
294
|
-
/** Lists one account's
|
|
295
|
-
export declare const
|
|
310
|
+
/** Lists one account's Movements, newest first, read from the bank. */
|
|
311
|
+
export declare const listAccountMovements: import("@orpc/contract").ProcedureContractBuilderWithInputOutput<v.ObjectSchema<{
|
|
296
312
|
readonly after: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 2048, undefined>, v.DescriptionAction<string, "Opaque cursor previously returned by this collection.">]>, undefined>;
|
|
297
313
|
readonly first: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 100, undefined>]>, undefined>, v.DescriptionAction<number | undefined, "Cursor page size; forward and backward argument families are exclusive.">]>;
|
|
298
314
|
readonly bank_account_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 64, undefined>, v.DescriptionAction<string, "The account's identifier (a UUID) or its Account Key.">]>;
|
|
@@ -300,17 +316,20 @@ export declare const listAccountTransactions: import("@orpc/contract").Procedure
|
|
|
300
316
|
readonly edges: v.ArraySchema<v.StrictObjectSchema<{
|
|
301
317
|
readonly cursor: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
302
318
|
readonly node: v.StrictObjectSchema<{
|
|
319
|
+
readonly object: v.LiteralSchema<"movement", undefined>;
|
|
303
320
|
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>;
|
|
304
|
-
readonly
|
|
321
|
+
readonly transaction_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.StringSchema<undefined>, undefined>, v.DescriptionAction<string | null, "The ledger id of the transaction that posted this Movement, or null when AndCo has none. A Transfer that succeeded carries the same id of its debit.">]>;
|
|
305
322
|
readonly description: v.StringSchema<undefined>;
|
|
306
|
-
readonly amount: v.SchemaWithPipe<readonly [v.
|
|
307
|
-
readonly
|
|
308
|
-
readonly
|
|
309
|
-
readonly
|
|
310
|
-
readonly
|
|
311
|
-
readonly
|
|
323
|
+
readonly amount: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, number, undefined>, v.DescriptionAction<number, "A positive integer in whole pesos (CLP). What tells an inflow from an outflow is `movement_type`, not a sign.">]>;
|
|
324
|
+
readonly currency: v.SchemaWithPipe<readonly [v.LiteralSchema<"CLP", undefined>, v.DescriptionAction<"CLP", "The currency of the account: a permission never assumes it, so the node names it.">]>;
|
|
325
|
+
readonly movement_type: v.SchemaWithPipe<readonly [v.PicklistSchema<["deposit", "interest", "withdrawal"], undefined>, v.DescriptionAction<"deposit" | "interest" | "withdrawal", "The kind of Movement, in AndCo's own words. `deposit` and `interest` bring money into this account and raise its balance; `withdrawal` takes money out and lowers it. `amount` is always positive, so `movement_type` is what tells an inflow from an outflow.">]>;
|
|
326
|
+
readonly movement_origin: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
327
|
+
readonly movement_date: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
|
|
328
|
+
readonly running_balance: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, number, undefined>, v.MaxValueAction<number, number, undefined>]>, undefined>, v.DescriptionAction<number | null, "The balance after this Movement, an integer in whole pesos, or null when AndCo did not send one: it is never made up. Real balances do go negative, so the sign is not narrowed away.">]>;
|
|
329
|
+
readonly payment_type: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
312
330
|
readonly reversed: v.BooleanSchema<undefined>;
|
|
313
331
|
readonly note: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
332
|
+
readonly transfer_id: v.SchemaWithPipe<readonly [v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UuidAction<string, undefined>]>, undefined>, v.DescriptionAction<string | null, "The id of the Transfer that this debit belongs to, only when the Grant may read that Transfer: one this client created for the same subject, or any Transfer of an account that a `bank_transfer` `read` detail covers. Always present. A null never means that no Transfer exists: it means no Transfer that this Grant may read, and it is also null for a Movement without a `transaction_id` and for one that AndCo has posted before AndCo recorded the Transfer, which fills on a later read. It is null for a credit too, except the credit leg of an own-account Transfer, which links by the same read rule as the debit.">]>;
|
|
314
333
|
}, undefined>;
|
|
315
334
|
}, undefined>, undefined>;
|
|
316
335
|
readonly pageInfo: v.StrictObjectSchema<{
|
|
@@ -323,17 +342,20 @@ export declare const listAccountTransactions: import("@orpc/contract").Procedure
|
|
|
323
342
|
edges: {
|
|
324
343
|
cursor: string | null;
|
|
325
344
|
node: {
|
|
345
|
+
object: "movement";
|
|
326
346
|
id: string;
|
|
327
|
-
|
|
347
|
+
transaction_id: string | null;
|
|
328
348
|
description: string;
|
|
329
|
-
amount:
|
|
349
|
+
amount: number;
|
|
350
|
+
currency: "CLP";
|
|
330
351
|
movement_type: "deposit" | "interest" | "withdrawal";
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
352
|
+
movement_origin: string | null;
|
|
353
|
+
movement_date: string;
|
|
354
|
+
running_balance: number | null;
|
|
355
|
+
payment_type: string | null;
|
|
335
356
|
reversed: boolean;
|
|
336
357
|
note: string | null;
|
|
358
|
+
transfer_id: string | null;
|
|
337
359
|
};
|
|
338
360
|
}[];
|
|
339
361
|
pageInfo: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accounts.d.ts","sourceRoot":"","sources":["../../src/rest/accounts.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAG7B,OAAO,EAIL,yBAAyB,EACzB,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,YAAY,EACZ,QAAQ,EAER,WAAW,EACX,sBAAsB,EACtB,kBAAkB,EACnB,MAAM,aAAa,CAAC;AAGrB;;;;;GAKG;AACH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