Closed Raynos closed 10 months ago
I've had to add type-coverage ignore to everything coming out of our typescript namespace.
type Payload = z.infer< typeof Schemas.AsyncJobQueueMessage.transactionSideEffects >;
Expected it not say tranasactionSideEffects is any ; but it does
tranasactionSideEffects
any
See namespace definition
export namespace AsyncJobQueueMessage { export const actionIngressMessage = z.object({ idempotencyKey: z.string().nullish(), version: z.literal('ACTION_SCHEMA_V1'), action: z.object({ id: z.string(), occurredAt: z.preprocess(arg => { if (typeof arg == 'string' || arg instanceof Date) return new Date(arg); return null; }, z.date()), }), payload: z.discriminatedUnion('type', [ z.object({ type: z.literal(ActionType.USER_PURCHASED_NFT), collectionType: z .nativeEnum(ActivityFeedGroupPurchaseCollectionType) .optional(), collector: z.object({ id: z.string(), }), release: z.object({ id: z.string(), }), }), z.object({ type: z.literal(ActionType.ADDED_RELEASE_TO_SHELF), user: z.object({ id: z.string(), }), shelf: z.object({ id: z.string(), isNewShelf: z.boolean(), }), }), z.object({ type: z.literal(ActionType.USER_ADDED_RELEASE), user: z.object({ id: z.string(), }), release: z.object({ id: z.string(), }), }), z.object({ type: z.literal(ActionType.USER_LIKED_RELEASE), user: z.object({ id: z.string(), }), release: z.object({ id: z.string(), }), shelf: z.object({ id: z.string(), }), }), z.object({ type: z.literal(ActionType.USER_LIKED_SHELF), user: z.object({ id: z.string(), }), shelf: z.object({ id: z.string(), }), }), ]), }); export const actionFanoutMessage = actionIngressMessage.extend({ activityFeed: z.object({ id: z.string(), }), }); export const audioTranscodeMessage = z.object({ version: z.literal('AUDIO_TRANSCODE_SCHEMA_V1'), mediaItem: z.object({ associationType: z.string(), associationId: z.string(), mediaType: z.string(), }), replaceExisting: z.boolean().optional(), }); export const audioFingerprintingUploadAcrCloudMessage = z.object({ method: z.literal('audioFingerprinting-upload-AcrCloud'), track: z.object({ mediaSource: z.object({ bucket: z.string(), key: z.string(), }), id: z.string(), releaseId: z.string(), }), }); .... export const transactionSideEffects = z.object({ method: z.literal('processTransactionSideEffects'), artistId: z.string(), artistUserId: z.string(), collectorsAddresses: z.array(z.string()), collectorUserIds: z.array(z.string()), releaseId: z.string(), nftIds: z.array(z.string()), uniqueKey: z.string(), }); ...
This was not the issue, the issue was that this z.object() generic thinger contains an any :(
z.object()
Version(if relevant): 1.0.0
Environment(if relevant):
I've had to add type-coverage ignore to everything coming out of our typescript namespace.
Code(if relevant):
Expected:
Expected it not say
tranasactionSideEffects
isany
; but it doesSee namespace definition