@budgetbuddyde/types 1.0.25 → 1.0.27
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/lib/Stocks/Stock.types.d.ts +248 -0
- package/lib/Stocks/Stock.types.js +33 -1
- package/package.json +1 -1
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
export declare const ZIsin: z.ZodString;
|
|
3
|
+
export type TIsin = z.infer<typeof ZIsin>;
|
|
4
|
+
export declare const ZWKN: z.ZodString;
|
|
5
|
+
export type TWKN = z.infer<typeof ZWKN>;
|
|
2
6
|
export declare const ZCurrency: z.ZodString;
|
|
3
7
|
export type TCurrency = z.infer<typeof ZCurrency>;
|
|
4
8
|
export declare const ZTimeframe: z.ZodEnum<["1d", "1m", "3m", "1y", "5y", "ytd"]>;
|
|
@@ -2996,3 +3000,247 @@ export declare const ZUpdateStockPositionPayload: z.ZodObject<{
|
|
|
2996
3000
|
quantity: number;
|
|
2997
3001
|
}>;
|
|
2998
3002
|
export type TUpdateStockPositionPayload = z.infer<typeof ZUpdateStockPositionPayload>;
|
|
3003
|
+
export declare const ZRelatedStock: z.ZodObject<{
|
|
3004
|
+
asset: z.ZodObject<{
|
|
3005
|
+
_id: z.ZodObject<{
|
|
3006
|
+
identifier: z.ZodString;
|
|
3007
|
+
assetType: z.ZodString;
|
|
3008
|
+
}, "strip", z.ZodTypeAny, {
|
|
3009
|
+
identifier: string;
|
|
3010
|
+
assetType: string;
|
|
3011
|
+
}, {
|
|
3012
|
+
identifier: string;
|
|
3013
|
+
assetType: string;
|
|
3014
|
+
}>;
|
|
3015
|
+
assetType: z.ZodString;
|
|
3016
|
+
name: z.ZodString;
|
|
3017
|
+
logo: z.ZodString;
|
|
3018
|
+
security: z.ZodOptional<z.ZodObject<{
|
|
3019
|
+
website: z.ZodString;
|
|
3020
|
+
type: z.ZodString;
|
|
3021
|
+
wkn: z.ZodString;
|
|
3022
|
+
isin: z.ZodString;
|
|
3023
|
+
etfDomicile: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
3024
|
+
etfCompany: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
3025
|
+
}, "strip", z.ZodTypeAny, {
|
|
3026
|
+
type: string;
|
|
3027
|
+
isin: string;
|
|
3028
|
+
website: string;
|
|
3029
|
+
wkn: string;
|
|
3030
|
+
etfDomicile: string | null;
|
|
3031
|
+
etfCompany: string | null;
|
|
3032
|
+
}, {
|
|
3033
|
+
type: string;
|
|
3034
|
+
isin: string;
|
|
3035
|
+
website: string;
|
|
3036
|
+
wkn: string;
|
|
3037
|
+
etfDomicile?: string | null | undefined;
|
|
3038
|
+
etfCompany?: string | null | undefined;
|
|
3039
|
+
}>>;
|
|
3040
|
+
}, "strip", z.ZodTypeAny, {
|
|
3041
|
+
name: string;
|
|
3042
|
+
_id: {
|
|
3043
|
+
identifier: string;
|
|
3044
|
+
assetType: string;
|
|
3045
|
+
};
|
|
3046
|
+
assetType: string;
|
|
3047
|
+
logo: string;
|
|
3048
|
+
security?: {
|
|
3049
|
+
type: string;
|
|
3050
|
+
isin: string;
|
|
3051
|
+
website: string;
|
|
3052
|
+
wkn: string;
|
|
3053
|
+
etfDomicile: string | null;
|
|
3054
|
+
etfCompany: string | null;
|
|
3055
|
+
} | undefined;
|
|
3056
|
+
}, {
|
|
3057
|
+
name: string;
|
|
3058
|
+
_id: {
|
|
3059
|
+
identifier: string;
|
|
3060
|
+
assetType: string;
|
|
3061
|
+
};
|
|
3062
|
+
assetType: string;
|
|
3063
|
+
logo: string;
|
|
3064
|
+
security?: {
|
|
3065
|
+
type: string;
|
|
3066
|
+
isin: string;
|
|
3067
|
+
website: string;
|
|
3068
|
+
wkn: string;
|
|
3069
|
+
etfDomicile?: string | null | undefined;
|
|
3070
|
+
etfCompany?: string | null | undefined;
|
|
3071
|
+
} | undefined;
|
|
3072
|
+
}>;
|
|
3073
|
+
}, "strip", z.ZodTypeAny, {
|
|
3074
|
+
asset: {
|
|
3075
|
+
name: string;
|
|
3076
|
+
_id: {
|
|
3077
|
+
identifier: string;
|
|
3078
|
+
assetType: string;
|
|
3079
|
+
};
|
|
3080
|
+
assetType: string;
|
|
3081
|
+
logo: string;
|
|
3082
|
+
security?: {
|
|
3083
|
+
type: string;
|
|
3084
|
+
isin: string;
|
|
3085
|
+
website: string;
|
|
3086
|
+
wkn: string;
|
|
3087
|
+
etfDomicile: string | null;
|
|
3088
|
+
etfCompany: string | null;
|
|
3089
|
+
} | undefined;
|
|
3090
|
+
};
|
|
3091
|
+
}, {
|
|
3092
|
+
asset: {
|
|
3093
|
+
name: string;
|
|
3094
|
+
_id: {
|
|
3095
|
+
identifier: string;
|
|
3096
|
+
assetType: string;
|
|
3097
|
+
};
|
|
3098
|
+
assetType: string;
|
|
3099
|
+
logo: string;
|
|
3100
|
+
security?: {
|
|
3101
|
+
type: string;
|
|
3102
|
+
isin: string;
|
|
3103
|
+
website: string;
|
|
3104
|
+
wkn: string;
|
|
3105
|
+
etfDomicile?: string | null | undefined;
|
|
3106
|
+
etfCompany?: string | null | undefined;
|
|
3107
|
+
} | undefined;
|
|
3108
|
+
};
|
|
3109
|
+
}>;
|
|
3110
|
+
export type TRelatedStock = z.infer<typeof ZRelatedStock>;
|
|
3111
|
+
export declare const ZRelatedStockWithQuotes: z.ZodObject<{
|
|
3112
|
+
quotes: z.ZodArray<z.ZodObject<{
|
|
3113
|
+
date: z.ZodEffects<z.ZodUnion<[z.ZodUnion<[z.ZodDate, z.ZodNumber]>, z.ZodString]>, Date, string | number | Date>;
|
|
3114
|
+
price: z.ZodNumber;
|
|
3115
|
+
exchange: z.ZodString;
|
|
3116
|
+
currency: z.ZodString;
|
|
3117
|
+
}, "strip", z.ZodTypeAny, {
|
|
3118
|
+
currency: string;
|
|
3119
|
+
date: Date;
|
|
3120
|
+
exchange: string;
|
|
3121
|
+
price: number;
|
|
3122
|
+
}, {
|
|
3123
|
+
currency: string;
|
|
3124
|
+
date: (string | number | Date) & (string | number | Date | undefined);
|
|
3125
|
+
exchange: string;
|
|
3126
|
+
price: number;
|
|
3127
|
+
}>, "many">;
|
|
3128
|
+
asset: z.ZodObject<{
|
|
3129
|
+
_id: z.ZodObject<{
|
|
3130
|
+
identifier: z.ZodString;
|
|
3131
|
+
assetType: z.ZodString;
|
|
3132
|
+
}, "strip", z.ZodTypeAny, {
|
|
3133
|
+
identifier: string;
|
|
3134
|
+
assetType: string;
|
|
3135
|
+
}, {
|
|
3136
|
+
identifier: string;
|
|
3137
|
+
assetType: string;
|
|
3138
|
+
}>;
|
|
3139
|
+
assetType: z.ZodString;
|
|
3140
|
+
name: z.ZodString;
|
|
3141
|
+
logo: z.ZodString;
|
|
3142
|
+
security: z.ZodOptional<z.ZodObject<{
|
|
3143
|
+
website: z.ZodString;
|
|
3144
|
+
type: z.ZodString;
|
|
3145
|
+
wkn: z.ZodString;
|
|
3146
|
+
isin: z.ZodString;
|
|
3147
|
+
etfDomicile: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
3148
|
+
etfCompany: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
3149
|
+
}, "strip", z.ZodTypeAny, {
|
|
3150
|
+
type: string;
|
|
3151
|
+
isin: string;
|
|
3152
|
+
website: string;
|
|
3153
|
+
wkn: string;
|
|
3154
|
+
etfDomicile: string | null;
|
|
3155
|
+
etfCompany: string | null;
|
|
3156
|
+
}, {
|
|
3157
|
+
type: string;
|
|
3158
|
+
isin: string;
|
|
3159
|
+
website: string;
|
|
3160
|
+
wkn: string;
|
|
3161
|
+
etfDomicile?: string | null | undefined;
|
|
3162
|
+
etfCompany?: string | null | undefined;
|
|
3163
|
+
}>>;
|
|
3164
|
+
}, "strip", z.ZodTypeAny, {
|
|
3165
|
+
name: string;
|
|
3166
|
+
_id: {
|
|
3167
|
+
identifier: string;
|
|
3168
|
+
assetType: string;
|
|
3169
|
+
};
|
|
3170
|
+
assetType: string;
|
|
3171
|
+
logo: string;
|
|
3172
|
+
security?: {
|
|
3173
|
+
type: string;
|
|
3174
|
+
isin: string;
|
|
3175
|
+
website: string;
|
|
3176
|
+
wkn: string;
|
|
3177
|
+
etfDomicile: string | null;
|
|
3178
|
+
etfCompany: string | null;
|
|
3179
|
+
} | undefined;
|
|
3180
|
+
}, {
|
|
3181
|
+
name: string;
|
|
3182
|
+
_id: {
|
|
3183
|
+
identifier: string;
|
|
3184
|
+
assetType: string;
|
|
3185
|
+
};
|
|
3186
|
+
assetType: string;
|
|
3187
|
+
logo: string;
|
|
3188
|
+
security?: {
|
|
3189
|
+
type: string;
|
|
3190
|
+
isin: string;
|
|
3191
|
+
website: string;
|
|
3192
|
+
wkn: string;
|
|
3193
|
+
etfDomicile?: string | null | undefined;
|
|
3194
|
+
etfCompany?: string | null | undefined;
|
|
3195
|
+
} | undefined;
|
|
3196
|
+
}>;
|
|
3197
|
+
}, "strip", z.ZodTypeAny, {
|
|
3198
|
+
quotes: {
|
|
3199
|
+
currency: string;
|
|
3200
|
+
date: Date;
|
|
3201
|
+
exchange: string;
|
|
3202
|
+
price: number;
|
|
3203
|
+
}[];
|
|
3204
|
+
asset: {
|
|
3205
|
+
name: string;
|
|
3206
|
+
_id: {
|
|
3207
|
+
identifier: string;
|
|
3208
|
+
assetType: string;
|
|
3209
|
+
};
|
|
3210
|
+
assetType: string;
|
|
3211
|
+
logo: string;
|
|
3212
|
+
security?: {
|
|
3213
|
+
type: string;
|
|
3214
|
+
isin: string;
|
|
3215
|
+
website: string;
|
|
3216
|
+
wkn: string;
|
|
3217
|
+
etfDomicile: string | null;
|
|
3218
|
+
etfCompany: string | null;
|
|
3219
|
+
} | undefined;
|
|
3220
|
+
};
|
|
3221
|
+
}, {
|
|
3222
|
+
quotes: {
|
|
3223
|
+
currency: string;
|
|
3224
|
+
date: (string | number | Date) & (string | number | Date | undefined);
|
|
3225
|
+
exchange: string;
|
|
3226
|
+
price: number;
|
|
3227
|
+
}[];
|
|
3228
|
+
asset: {
|
|
3229
|
+
name: string;
|
|
3230
|
+
_id: {
|
|
3231
|
+
identifier: string;
|
|
3232
|
+
assetType: string;
|
|
3233
|
+
};
|
|
3234
|
+
assetType: string;
|
|
3235
|
+
logo: string;
|
|
3236
|
+
security?: {
|
|
3237
|
+
type: string;
|
|
3238
|
+
isin: string;
|
|
3239
|
+
website: string;
|
|
3240
|
+
wkn: string;
|
|
3241
|
+
etfDomicile?: string | null | undefined;
|
|
3242
|
+
etfCompany?: string | null | undefined;
|
|
3243
|
+
} | undefined;
|
|
3244
|
+
};
|
|
3245
|
+
}>;
|
|
3246
|
+
export type TRelatedStockWithQuotes = z.infer<typeof ZRelatedStockWithQuotes>;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ZUpdateStockPositionPayload = exports.ZCreateStockPositionPayload = exports.ZStockPositionWithQuote = exports.ZStockPosition = exports.ZStockExchange = exports.ZAssetDetails = exports.ZDividendDetailList = exports.ZDividendDetails = exports.ZDividend = exports.ZAssetChartQuote = exports.ZAssetSearchResult = exports.ZAsset = exports.ZStockQuote = exports.ZStockType = exports.ZTimeframe = exports.ZCurrency = void 0;
|
|
3
|
+
exports.ZRelatedStockWithQuotes = exports.ZRelatedStock = exports.ZUpdateStockPositionPayload = exports.ZCreateStockPositionPayload = exports.ZStockPositionWithQuote = exports.ZStockPosition = exports.ZStockExchange = exports.ZAssetDetails = exports.ZDividendDetailList = exports.ZDividendDetails = exports.ZDividend = exports.ZAssetChartQuote = exports.ZAssetSearchResult = exports.ZAsset = exports.ZStockQuote = exports.ZStockType = exports.ZTimeframe = exports.ZCurrency = exports.ZWKN = exports.ZIsin = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const PocketBase_types_1 = require("../PocketBase.types");
|
|
6
6
|
const Base_type_1 = require("../Base.type");
|
|
7
|
+
exports.ZIsin = zod_1.z.string().max(12, { message: 'ISIN can only be 12 characters long' });
|
|
8
|
+
exports.ZWKN = zod_1.z.string().max(6, { message: 'WKN can only be 6 characters long' });
|
|
7
9
|
exports.ZCurrency = zod_1.z.string().max(3, { message: 'Currency must be 3 characters long' });
|
|
8
10
|
exports.ZTimeframe = zod_1.z.enum(['1d', '1m', '3m', '1y', '5y', 'ytd']);
|
|
9
11
|
exports.ZStockType = zod_1.z.enum(['Aktie', 'ETF']).or(zod_1.z.string());
|
|
@@ -383,3 +385,33 @@ exports.ZUpdateStockPositionPayload = zod_1.z.object({
|
|
|
383
385
|
currency: exports.ZCurrency,
|
|
384
386
|
quantity: zod_1.z.number(),
|
|
385
387
|
});
|
|
388
|
+
exports.ZRelatedStock = zod_1.z.object({
|
|
389
|
+
asset: zod_1.z.object({
|
|
390
|
+
_id: zod_1.z.object({
|
|
391
|
+
identifier: exports.ZIsin,
|
|
392
|
+
assetType: zod_1.z.string(),
|
|
393
|
+
}),
|
|
394
|
+
assetType: zod_1.z.string(),
|
|
395
|
+
name: zod_1.z.string(),
|
|
396
|
+
logo: zod_1.z.string().url(),
|
|
397
|
+
security: zod_1.z
|
|
398
|
+
.object({
|
|
399
|
+
website: zod_1.z.string().url(),
|
|
400
|
+
type: zod_1.z.string(),
|
|
401
|
+
wkn: exports.ZWKN,
|
|
402
|
+
isin: exports.ZIsin,
|
|
403
|
+
etfDomicile: zod_1.z.string().nullable().default(null),
|
|
404
|
+
etfCompany: zod_1.z.string().nullable().default(null),
|
|
405
|
+
})
|
|
406
|
+
.optional(),
|
|
407
|
+
}),
|
|
408
|
+
});
|
|
409
|
+
exports.ZRelatedStockWithQuotes = zod_1.z.object({
|
|
410
|
+
...exports.ZRelatedStock.shape,
|
|
411
|
+
quotes: zod_1.z.array(zod_1.z.object({
|
|
412
|
+
date: Base_type_1.ZDate,
|
|
413
|
+
price: zod_1.z.number(),
|
|
414
|
+
exchange: zod_1.z.string(),
|
|
415
|
+
currency: exports.ZCurrency,
|
|
416
|
+
})),
|
|
417
|
+
});
|