@opencrvs/toolkit
Advanced tools
Comparing version
@@ -68,3 +68,7 @@ import { EventDocument } from '../events/EventDocument'; | ||
*/ | ||
export declare const event: { | ||
export declare function createEventConditionals(): { | ||
/** | ||
* Checks if the event contains a specific action type. | ||
* @param action - The action type to check for. | ||
*/ | ||
hasAction: (action: ActionType) => JSONSchema; | ||
@@ -84,7 +88,3 @@ }; | ||
*/ | ||
export declare function field(fieldId: string): { | ||
/** | ||
* @private Internal property used for field reference tracking. | ||
*/ | ||
_fieldId: string; | ||
export declare function createFieldConditionals(fieldId: string): { | ||
isAfter: () => { | ||
@@ -126,4 +126,7 @@ days: (days: number) => { | ||
isBetween: (min: number, max: number) => JSONSchema; | ||
getId: () => { | ||
fieldId: string; | ||
}; | ||
}; | ||
export {}; | ||
//# sourceMappingURL=conditionals.d.ts.map |
import { z } from 'zod'; | ||
import { TranslationConfig } from './TranslationConfig'; | ||
export declare const SearchQueryParams: z.ZodObject<{ | ||
eventType: z.ZodOptional<z.ZodString>; | ||
}, "strip", z.ZodUnion<[z.ZodString, z.ZodString, z.ZodUnion<[z.ZodString, z.ZodTuple<[z.ZodString, z.ZodString], null>]>, z.ZodBoolean, z.ZodNumber, z.ZodObject<{ | ||
filename: z.ZodString; | ||
originalFilename: z.ZodString; | ||
type: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
type: string; | ||
filename: string; | ||
originalFilename: string; | ||
}, { | ||
type: string; | ||
filename: string; | ||
originalFilename: string; | ||
}>, z.ZodArray<z.ZodObject<{ | ||
filename: z.ZodString; | ||
originalFilename: z.ZodString; | ||
type: z.ZodString; | ||
option: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
type: string; | ||
option: string; | ||
filename: string; | ||
originalFilename: string; | ||
}, { | ||
type: string; | ||
option: string; | ||
filename: string; | ||
originalFilename: string; | ||
}>, "many">, z.ZodObject<z.objectUtil.extendShape<{ | ||
country: z.ZodString; | ||
addressType: z.ZodLiteral<"DOMESTIC">; | ||
province: z.ZodString; | ||
district: z.ZodString; | ||
}, { | ||
urbanOrRural: z.ZodLiteral<"URBAN">; | ||
town: z.ZodOptional<z.ZodString>; | ||
residentialArea: z.ZodOptional<z.ZodString>; | ||
street: z.ZodOptional<z.ZodString>; | ||
number: z.ZodOptional<z.ZodString>; | ||
zipCode: z.ZodOptional<z.ZodString>; | ||
}>, "strip", z.ZodTypeAny, { | ||
country: string; | ||
district: string; | ||
addressType: "DOMESTIC"; | ||
province: string; | ||
urbanOrRural: "URBAN"; | ||
number?: string | undefined; | ||
town?: string | undefined; | ||
residentialArea?: string | undefined; | ||
street?: string | undefined; | ||
zipCode?: string | undefined; | ||
}, { | ||
country: string; | ||
district: string; | ||
addressType: "DOMESTIC"; | ||
province: string; | ||
urbanOrRural: "URBAN"; | ||
number?: string | undefined; | ||
town?: string | undefined; | ||
residentialArea?: string | undefined; | ||
street?: string | undefined; | ||
zipCode?: string | undefined; | ||
}>, z.ZodObject<z.objectUtil.extendShape<{ | ||
country: z.ZodString; | ||
addressType: z.ZodLiteral<"DOMESTIC">; | ||
province: z.ZodString; | ||
district: z.ZodString; | ||
}, { | ||
urbanOrRural: z.ZodLiteral<"RURAL">; | ||
village: z.ZodOptional<z.ZodString>; | ||
}>, "strip", z.ZodTypeAny, { | ||
country: string; | ||
district: string; | ||
addressType: "DOMESTIC"; | ||
province: string; | ||
urbanOrRural: "RURAL"; | ||
village?: string | undefined; | ||
}, { | ||
country: string; | ||
district: string; | ||
addressType: "DOMESTIC"; | ||
province: string; | ||
urbanOrRural: "RURAL"; | ||
village?: string | undefined; | ||
}>, z.ZodUndefined, z.ZodObject<{ | ||
country: z.ZodString; | ||
addressType: z.ZodLiteral<"INTERNATIONAL">; | ||
state: z.ZodString; | ||
district2: z.ZodString; | ||
cityOrTown: z.ZodOptional<z.ZodString>; | ||
addressLine1: z.ZodOptional<z.ZodString>; | ||
addressLine2: z.ZodOptional<z.ZodString>; | ||
addressLine3: z.ZodOptional<z.ZodString>; | ||
postcodeOrZip: z.ZodOptional<z.ZodString>; | ||
}, "strip", z.ZodTypeAny, { | ||
country: string; | ||
state: string; | ||
addressType: "INTERNATIONAL"; | ||
district2: string; | ||
cityOrTown?: string | undefined; | ||
addressLine1?: string | undefined; | ||
addressLine2?: string | undefined; | ||
addressLine3?: string | undefined; | ||
postcodeOrZip?: string | undefined; | ||
}, { | ||
country: string; | ||
state: string; | ||
addressType: "INTERNATIONAL"; | ||
district2: string; | ||
cityOrTown?: string | undefined; | ||
addressLine1?: string | undefined; | ||
addressLine2?: string | undefined; | ||
addressLine3?: string | undefined; | ||
postcodeOrZip?: string | undefined; | ||
}>]>, z.objectOutputType<{ | ||
eventType: z.ZodOptional<z.ZodString>; | ||
}, z.ZodUnion<[z.ZodString, z.ZodString, z.ZodUnion<[z.ZodString, z.ZodTuple<[z.ZodString, z.ZodString], null>]>, z.ZodBoolean, z.ZodNumber, z.ZodObject<{ | ||
filename: z.ZodString; | ||
originalFilename: z.ZodString; | ||
type: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
type: string; | ||
filename: string; | ||
originalFilename: string; | ||
}, { | ||
type: string; | ||
filename: string; | ||
originalFilename: string; | ||
}>, z.ZodArray<z.ZodObject<{ | ||
filename: z.ZodString; | ||
originalFilename: z.ZodString; | ||
type: z.ZodString; | ||
option: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
type: string; | ||
option: string; | ||
filename: string; | ||
originalFilename: string; | ||
}, { | ||
type: string; | ||
option: string; | ||
filename: string; | ||
originalFilename: string; | ||
}>, "many">, z.ZodObject<z.objectUtil.extendShape<{ | ||
country: z.ZodString; | ||
addressType: z.ZodLiteral<"DOMESTIC">; | ||
province: z.ZodString; | ||
district: z.ZodString; | ||
}, { | ||
urbanOrRural: z.ZodLiteral<"URBAN">; | ||
town: z.ZodOptional<z.ZodString>; | ||
residentialArea: z.ZodOptional<z.ZodString>; | ||
street: z.ZodOptional<z.ZodString>; | ||
number: z.ZodOptional<z.ZodString>; | ||
zipCode: z.ZodOptional<z.ZodString>; | ||
}>, "strip", z.ZodTypeAny, { | ||
country: string; | ||
district: string; | ||
addressType: "DOMESTIC"; | ||
province: string; | ||
urbanOrRural: "URBAN"; | ||
number?: string | undefined; | ||
town?: string | undefined; | ||
residentialArea?: string | undefined; | ||
street?: string | undefined; | ||
zipCode?: string | undefined; | ||
}, { | ||
country: string; | ||
district: string; | ||
addressType: "DOMESTIC"; | ||
province: string; | ||
urbanOrRural: "URBAN"; | ||
number?: string | undefined; | ||
town?: string | undefined; | ||
residentialArea?: string | undefined; | ||
street?: string | undefined; | ||
zipCode?: string | undefined; | ||
}>, z.ZodObject<z.objectUtil.extendShape<{ | ||
country: z.ZodString; | ||
addressType: z.ZodLiteral<"DOMESTIC">; | ||
province: z.ZodString; | ||
district: z.ZodString; | ||
}, { | ||
urbanOrRural: z.ZodLiteral<"RURAL">; | ||
village: z.ZodOptional<z.ZodString>; | ||
}>, "strip", z.ZodTypeAny, { | ||
country: string; | ||
district: string; | ||
addressType: "DOMESTIC"; | ||
province: string; | ||
urbanOrRural: "RURAL"; | ||
village?: string | undefined; | ||
}, { | ||
country: string; | ||
district: string; | ||
addressType: "DOMESTIC"; | ||
province: string; | ||
urbanOrRural: "RURAL"; | ||
village?: string | undefined; | ||
}>, z.ZodUndefined, z.ZodObject<{ | ||
country: z.ZodString; | ||
addressType: z.ZodLiteral<"INTERNATIONAL">; | ||
state: z.ZodString; | ||
district2: z.ZodString; | ||
cityOrTown: z.ZodOptional<z.ZodString>; | ||
addressLine1: z.ZodOptional<z.ZodString>; | ||
addressLine2: z.ZodOptional<z.ZodString>; | ||
addressLine3: z.ZodOptional<z.ZodString>; | ||
postcodeOrZip: z.ZodOptional<z.ZodString>; | ||
}, "strip", z.ZodTypeAny, { | ||
country: string; | ||
state: string; | ||
addressType: "INTERNATIONAL"; | ||
district2: string; | ||
cityOrTown?: string | undefined; | ||
addressLine1?: string | undefined; | ||
addressLine2?: string | undefined; | ||
addressLine3?: string | undefined; | ||
postcodeOrZip?: string | undefined; | ||
}, { | ||
country: string; | ||
state: string; | ||
addressType: "INTERNATIONAL"; | ||
district2: string; | ||
cityOrTown?: string | undefined; | ||
addressLine1?: string | undefined; | ||
addressLine2?: string | undefined; | ||
addressLine3?: string | undefined; | ||
postcodeOrZip?: string | undefined; | ||
}>]>, "strip">, z.objectInputType<{ | ||
eventType: z.ZodOptional<z.ZodString>; | ||
}, z.ZodUnion<[z.ZodString, z.ZodString, z.ZodUnion<[z.ZodString, z.ZodTuple<[z.ZodString, z.ZodString], null>]>, z.ZodBoolean, z.ZodNumber, z.ZodObject<{ | ||
filename: z.ZodString; | ||
originalFilename: z.ZodString; | ||
type: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
type: string; | ||
filename: string; | ||
originalFilename: string; | ||
}, { | ||
type: string; | ||
filename: string; | ||
originalFilename: string; | ||
}>, z.ZodArray<z.ZodObject<{ | ||
filename: z.ZodString; | ||
originalFilename: z.ZodString; | ||
type: z.ZodString; | ||
option: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
type: string; | ||
option: string; | ||
filename: string; | ||
originalFilename: string; | ||
}, { | ||
type: string; | ||
option: string; | ||
filename: string; | ||
originalFilename: string; | ||
}>, "many">, z.ZodObject<z.objectUtil.extendShape<{ | ||
country: z.ZodString; | ||
addressType: z.ZodLiteral<"DOMESTIC">; | ||
province: z.ZodString; | ||
district: z.ZodString; | ||
}, { | ||
urbanOrRural: z.ZodLiteral<"URBAN">; | ||
town: z.ZodOptional<z.ZodString>; | ||
residentialArea: z.ZodOptional<z.ZodString>; | ||
street: z.ZodOptional<z.ZodString>; | ||
number: z.ZodOptional<z.ZodString>; | ||
zipCode: z.ZodOptional<z.ZodString>; | ||
}>, "strip", z.ZodTypeAny, { | ||
country: string; | ||
district: string; | ||
addressType: "DOMESTIC"; | ||
province: string; | ||
urbanOrRural: "URBAN"; | ||
number?: string | undefined; | ||
town?: string | undefined; | ||
residentialArea?: string | undefined; | ||
street?: string | undefined; | ||
zipCode?: string | undefined; | ||
}, { | ||
country: string; | ||
district: string; | ||
addressType: "DOMESTIC"; | ||
province: string; | ||
urbanOrRural: "URBAN"; | ||
number?: string | undefined; | ||
town?: string | undefined; | ||
residentialArea?: string | undefined; | ||
street?: string | undefined; | ||
zipCode?: string | undefined; | ||
}>, z.ZodObject<z.objectUtil.extendShape<{ | ||
country: z.ZodString; | ||
addressType: z.ZodLiteral<"DOMESTIC">; | ||
province: z.ZodString; | ||
district: z.ZodString; | ||
}, { | ||
urbanOrRural: z.ZodLiteral<"RURAL">; | ||
village: z.ZodOptional<z.ZodString>; | ||
}>, "strip", z.ZodTypeAny, { | ||
country: string; | ||
district: string; | ||
addressType: "DOMESTIC"; | ||
province: string; | ||
urbanOrRural: "RURAL"; | ||
village?: string | undefined; | ||
}, { | ||
country: string; | ||
district: string; | ||
addressType: "DOMESTIC"; | ||
province: string; | ||
urbanOrRural: "RURAL"; | ||
village?: string | undefined; | ||
}>, z.ZodUndefined, z.ZodObject<{ | ||
country: z.ZodString; | ||
addressType: z.ZodLiteral<"INTERNATIONAL">; | ||
state: z.ZodString; | ||
district2: z.ZodString; | ||
cityOrTown: z.ZodOptional<z.ZodString>; | ||
addressLine1: z.ZodOptional<z.ZodString>; | ||
addressLine2: z.ZodOptional<z.ZodString>; | ||
addressLine3: z.ZodOptional<z.ZodString>; | ||
postcodeOrZip: z.ZodOptional<z.ZodString>; | ||
}, "strip", z.ZodTypeAny, { | ||
country: string; | ||
state: string; | ||
addressType: "INTERNATIONAL"; | ||
district2: string; | ||
cityOrTown?: string | undefined; | ||
addressLine1?: string | undefined; | ||
addressLine2?: string | undefined; | ||
addressLine3?: string | undefined; | ||
postcodeOrZip?: string | undefined; | ||
}, { | ||
country: string; | ||
state: string; | ||
addressType: "INTERNATIONAL"; | ||
district2: string; | ||
cityOrTown?: string | undefined; | ||
addressLine1?: string | undefined; | ||
addressLine2?: string | undefined; | ||
addressLine3?: string | undefined; | ||
postcodeOrZip?: string | undefined; | ||
}>]>, "strip">>; | ||
export type SearchQueryParams = z.infer<typeof SearchQueryParams>; | ||
export declare const FieldConfigSchema: z.ZodObject<z.objectUtil.extendShape<{ | ||
config: z.ZodObject<{ | ||
type: z.ZodEnum<["fuzzy", "exact", "range"]>; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "exact" | "fuzzy" | "range"; | ||
}, { | ||
type: "exact" | "fuzzy" | "range"; | ||
}>; | ||
options: z.ZodOptional<z.ZodArray<z.ZodObject<{ | ||
value: z.ZodString; | ||
label: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
}>; | ||
}, "strip", z.ZodTypeAny, { | ||
value: string; | ||
label: TranslationConfig; | ||
}, { | ||
value: string; | ||
label: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
}; | ||
}>, "many">>; | ||
searchCriteriaLabelPrefix: z.ZodOptional<z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
}>>; | ||
conditionals: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<"type", import("./Conditional").FieldConditionalType[]>, "many">>>; | ||
}, { | ||
fieldId: z.ZodString; | ||
fieldType: z.ZodLiteral<"field">; | ||
}>, "strip", z.ZodTypeAny, { | ||
config: { | ||
type: "exact" | "fuzzy" | "range"; | ||
}; | ||
fieldId: string; | ||
fieldType: "field"; | ||
options?: { | ||
value: string; | ||
label: TranslationConfig; | ||
}[] | undefined; | ||
conditionals?: ({ | ||
type: "SHOW"; | ||
conditional: import(".").JSONSchema; | ||
} | { | ||
type: "ENABLE"; | ||
conditional: import(".").JSONSchema; | ||
} | { | ||
type: "DISPLAY_ON_REVIEW"; | ||
conditional: import(".").JSONSchema; | ||
})[] | undefined; | ||
searchCriteriaLabelPrefix?: TranslationConfig | undefined; | ||
}, { | ||
config: { | ||
type: "exact" | "fuzzy" | "range"; | ||
}; | ||
fieldId: string; | ||
fieldType: "field"; | ||
options?: { | ||
value: string; | ||
label: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
}; | ||
}[] | undefined; | ||
conditionals?: ({ | ||
type: "SHOW"; | ||
conditional: import(".").JSONSchema; | ||
} | { | ||
type: "ENABLE"; | ||
conditional: import(".").JSONSchema; | ||
} | { | ||
type: "DISPLAY_ON_REVIEW"; | ||
conditional: import(".").JSONSchema; | ||
})[] | undefined; | ||
searchCriteriaLabelPrefix?: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
} | undefined; | ||
}>; | ||
export declare const EventFieldId: z.ZodEnum<["trackingId", "status", "legalStatus.REGISTERED.createdAt", "legalStatus.REGISTERED.createdAtLocation", "updatedAt"]>; | ||
export type EventFieldId = z.infer<typeof EventFieldId>; | ||
export declare const EventFieldConfigSchema: z.ZodObject<z.objectUtil.extendShape<{ | ||
config: z.ZodObject<{ | ||
type: z.ZodEnum<["fuzzy", "exact", "range"]>; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "exact" | "fuzzy" | "range"; | ||
}, { | ||
type: "exact" | "fuzzy" | "range"; | ||
}>; | ||
options: z.ZodOptional<z.ZodArray<z.ZodObject<{ | ||
value: z.ZodString; | ||
label: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
}>; | ||
}, "strip", z.ZodTypeAny, { | ||
value: string; | ||
label: TranslationConfig; | ||
}, { | ||
value: string; | ||
label: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
}; | ||
}>, "many">>; | ||
searchCriteriaLabelPrefix: z.ZodOptional<z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
}>>; | ||
conditionals: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<"type", import("./Conditional").FieldConditionalType[]>, "many">>>; | ||
}, { | ||
fieldId: z.ZodEnum<["trackingId", "status", "legalStatus.REGISTERED.createdAt", "legalStatus.REGISTERED.createdAtLocation", "updatedAt"]>; | ||
fieldType: z.ZodLiteral<"event">; | ||
}>, "strip", z.ZodTypeAny, { | ||
config: { | ||
type: "exact" | "fuzzy" | "range"; | ||
}; | ||
fieldId: "status" | "updatedAt" | "trackingId" | "legalStatus.REGISTERED.createdAt" | "legalStatus.REGISTERED.createdAtLocation"; | ||
fieldType: "event"; | ||
options?: { | ||
value: string; | ||
label: TranslationConfig; | ||
}[] | undefined; | ||
conditionals?: ({ | ||
type: "SHOW"; | ||
conditional: import(".").JSONSchema; | ||
} | { | ||
type: "ENABLE"; | ||
conditional: import(".").JSONSchema; | ||
} | { | ||
type: "DISPLAY_ON_REVIEW"; | ||
conditional: import(".").JSONSchema; | ||
})[] | undefined; | ||
searchCriteriaLabelPrefix?: TranslationConfig | undefined; | ||
}, { | ||
config: { | ||
type: "exact" | "fuzzy" | "range"; | ||
}; | ||
fieldId: "status" | "updatedAt" | "trackingId" | "legalStatus.REGISTERED.createdAt" | "legalStatus.REGISTERED.createdAtLocation"; | ||
fieldType: "event"; | ||
options?: { | ||
value: string; | ||
label: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
}; | ||
}[] | undefined; | ||
conditionals?: ({ | ||
type: "SHOW"; | ||
conditional: import(".").JSONSchema; | ||
} | { | ||
type: "ENABLE"; | ||
conditional: import(".").JSONSchema; | ||
} | { | ||
type: "DISPLAY_ON_REVIEW"; | ||
conditional: import(".").JSONSchema; | ||
})[] | undefined; | ||
searchCriteriaLabelPrefix?: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
} | undefined; | ||
}>; | ||
export declare const SearchField: z.ZodDiscriminatedUnion<"fieldType", [z.ZodObject<z.objectUtil.extendShape<{ | ||
config: z.ZodObject<{ | ||
type: z.ZodEnum<["fuzzy", "exact", "range"]>; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "exact" | "fuzzy" | "range"; | ||
}, { | ||
type: "exact" | "fuzzy" | "range"; | ||
}>; | ||
options: z.ZodOptional<z.ZodArray<z.ZodObject<{ | ||
value: z.ZodString; | ||
label: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
}>; | ||
}, "strip", z.ZodTypeAny, { | ||
value: string; | ||
label: TranslationConfig; | ||
}, { | ||
value: string; | ||
label: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
}; | ||
}>, "many">>; | ||
searchCriteriaLabelPrefix: z.ZodOptional<z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
}>>; | ||
conditionals: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<"type", import("./Conditional").FieldConditionalType[]>, "many">>>; | ||
}, { | ||
fieldId: z.ZodString; | ||
fieldType: z.ZodLiteral<"field">; | ||
}>, "strip", z.ZodTypeAny, { | ||
config: { | ||
type: "exact" | "fuzzy" | "range"; | ||
}; | ||
fieldId: string; | ||
fieldType: "field"; | ||
options?: { | ||
value: string; | ||
label: TranslationConfig; | ||
}[] | undefined; | ||
conditionals?: ({ | ||
type: "SHOW"; | ||
conditional: import(".").JSONSchema; | ||
} | { | ||
type: "ENABLE"; | ||
conditional: import(".").JSONSchema; | ||
} | { | ||
type: "DISPLAY_ON_REVIEW"; | ||
conditional: import(".").JSONSchema; | ||
})[] | undefined; | ||
searchCriteriaLabelPrefix?: TranslationConfig | undefined; | ||
}, { | ||
config: { | ||
type: "exact" | "fuzzy" | "range"; | ||
}; | ||
fieldId: string; | ||
fieldType: "field"; | ||
options?: { | ||
value: string; | ||
label: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
}; | ||
}[] | undefined; | ||
conditionals?: ({ | ||
type: "SHOW"; | ||
conditional: import(".").JSONSchema; | ||
} | { | ||
type: "ENABLE"; | ||
conditional: import(".").JSONSchema; | ||
} | { | ||
type: "DISPLAY_ON_REVIEW"; | ||
conditional: import(".").JSONSchema; | ||
})[] | undefined; | ||
searchCriteriaLabelPrefix?: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
} | undefined; | ||
}>, z.ZodObject<z.objectUtil.extendShape<{ | ||
config: z.ZodObject<{ | ||
type: z.ZodEnum<["fuzzy", "exact", "range"]>; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "exact" | "fuzzy" | "range"; | ||
}, { | ||
type: "exact" | "fuzzy" | "range"; | ||
}>; | ||
options: z.ZodOptional<z.ZodArray<z.ZodObject<{ | ||
value: z.ZodString; | ||
label: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
}>; | ||
}, "strip", z.ZodTypeAny, { | ||
value: string; | ||
label: TranslationConfig; | ||
}, { | ||
value: string; | ||
label: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
}; | ||
}>, "many">>; | ||
searchCriteriaLabelPrefix: z.ZodOptional<z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
}>>; | ||
conditionals: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<"type", import("./Conditional").FieldConditionalType[]>, "many">>>; | ||
}, { | ||
fieldId: z.ZodEnum<["trackingId", "status", "legalStatus.REGISTERED.createdAt", "legalStatus.REGISTERED.createdAtLocation", "updatedAt"]>; | ||
fieldType: z.ZodLiteral<"event">; | ||
}>, "strip", z.ZodTypeAny, { | ||
config: { | ||
type: "exact" | "fuzzy" | "range"; | ||
}; | ||
fieldId: "status" | "updatedAt" | "trackingId" | "legalStatus.REGISTERED.createdAt" | "legalStatus.REGISTERED.createdAtLocation"; | ||
fieldType: "event"; | ||
options?: { | ||
value: string; | ||
label: TranslationConfig; | ||
}[] | undefined; | ||
conditionals?: ({ | ||
type: "SHOW"; | ||
conditional: import(".").JSONSchema; | ||
} | { | ||
type: "ENABLE"; | ||
conditional: import(".").JSONSchema; | ||
} | { | ||
type: "DISPLAY_ON_REVIEW"; | ||
conditional: import(".").JSONSchema; | ||
})[] | undefined; | ||
searchCriteriaLabelPrefix?: TranslationConfig | undefined; | ||
}, { | ||
config: { | ||
type: "exact" | "fuzzy" | "range"; | ||
}; | ||
fieldId: "status" | "updatedAt" | "trackingId" | "legalStatus.REGISTERED.createdAt" | "legalStatus.REGISTERED.createdAtLocation"; | ||
fieldType: "event"; | ||
options?: { | ||
value: string; | ||
label: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
}; | ||
}[] | undefined; | ||
conditionals?: ({ | ||
type: "SHOW"; | ||
conditional: import(".").JSONSchema; | ||
} | { | ||
type: "ENABLE"; | ||
conditional: import(".").JSONSchema; | ||
} | { | ||
type: "DISPLAY_ON_REVIEW"; | ||
conditional: import(".").JSONSchema; | ||
})[] | undefined; | ||
searchCriteriaLabelPrefix?: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
} | undefined; | ||
}>]>; | ||
export type SearchField = z.infer<typeof SearchField>; | ||
export declare const AdvancedSearchConfig: z.ZodObject<{ | ||
@@ -9,30 +702,218 @@ title: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, { | ||
}>; | ||
fields: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{ | ||
fieldId: z.ZodString; | ||
config: z.ZodOptional<z.ZodObject<{ | ||
type: z.ZodEnum<["FUZZY", "EXACT", "RANGE"]>; | ||
fields: z.ZodArray<z.ZodDiscriminatedUnion<"fieldType", [z.ZodObject<z.objectUtil.extendShape<{ | ||
config: z.ZodObject<{ | ||
type: z.ZodEnum<["fuzzy", "exact", "range"]>; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "FUZZY" | "EXACT" | "RANGE"; | ||
type: "exact" | "fuzzy" | "range"; | ||
}, { | ||
type: "FUZZY" | "EXACT" | "RANGE"; | ||
type: "exact" | "fuzzy" | "range"; | ||
}>; | ||
options: z.ZodOptional<z.ZodArray<z.ZodObject<{ | ||
value: z.ZodString; | ||
label: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
}>; | ||
}, "strip", z.ZodTypeAny, { | ||
value: string; | ||
label: TranslationConfig; | ||
}, { | ||
value: string; | ||
label: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
}; | ||
}>, "many">>; | ||
searchCriteriaLabelPrefix: z.ZodOptional<z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
}>>; | ||
}, "strip", z.ZodTypeAny, { | ||
conditionals: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<"type", import("./Conditional").FieldConditionalType[]>, "many">>>; | ||
}, { | ||
fieldId: z.ZodString; | ||
fieldType: z.ZodLiteral<"field">; | ||
}>, "strip", z.ZodTypeAny, { | ||
config: { | ||
type: "exact" | "fuzzy" | "range"; | ||
}; | ||
fieldId: string; | ||
config?: { | ||
type: "FUZZY" | "EXACT" | "RANGE"; | ||
} | undefined; | ||
fieldType: "field"; | ||
options?: { | ||
value: string; | ||
label: TranslationConfig; | ||
}[] | undefined; | ||
conditionals?: ({ | ||
type: "SHOW"; | ||
conditional: import(".").JSONSchema; | ||
} | { | ||
type: "ENABLE"; | ||
conditional: import(".").JSONSchema; | ||
} | { | ||
type: "DISPLAY_ON_REVIEW"; | ||
conditional: import(".").JSONSchema; | ||
})[] | undefined; | ||
searchCriteriaLabelPrefix?: TranslationConfig | undefined; | ||
}, { | ||
config: { | ||
type: "exact" | "fuzzy" | "range"; | ||
}; | ||
fieldId: string; | ||
config?: { | ||
type: "FUZZY" | "EXACT" | "RANGE"; | ||
fieldType: "field"; | ||
options?: { | ||
value: string; | ||
label: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
}; | ||
}[] | undefined; | ||
conditionals?: ({ | ||
type: "SHOW"; | ||
conditional: import(".").JSONSchema; | ||
} | { | ||
type: "ENABLE"; | ||
conditional: import(".").JSONSchema; | ||
} | { | ||
type: "DISPLAY_ON_REVIEW"; | ||
conditional: import(".").JSONSchema; | ||
})[] | undefined; | ||
searchCriteriaLabelPrefix?: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
} | undefined; | ||
}>, "many">>>; | ||
}>, z.ZodObject<z.objectUtil.extendShape<{ | ||
config: z.ZodObject<{ | ||
type: z.ZodEnum<["fuzzy", "exact", "range"]>; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "exact" | "fuzzy" | "range"; | ||
}, { | ||
type: "exact" | "fuzzy" | "range"; | ||
}>; | ||
options: z.ZodOptional<z.ZodArray<z.ZodObject<{ | ||
value: z.ZodString; | ||
label: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
}>; | ||
}, "strip", z.ZodTypeAny, { | ||
value: string; | ||
label: TranslationConfig; | ||
}, { | ||
value: string; | ||
label: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
}; | ||
}>, "many">>; | ||
searchCriteriaLabelPrefix: z.ZodOptional<z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
}>>; | ||
conditionals: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<"type", import("./Conditional").FieldConditionalType[]>, "many">>>; | ||
}, { | ||
fieldId: z.ZodEnum<["trackingId", "status", "legalStatus.REGISTERED.createdAt", "legalStatus.REGISTERED.createdAtLocation", "updatedAt"]>; | ||
fieldType: z.ZodLiteral<"event">; | ||
}>, "strip", z.ZodTypeAny, { | ||
config: { | ||
type: "exact" | "fuzzy" | "range"; | ||
}; | ||
fieldId: "status" | "updatedAt" | "trackingId" | "legalStatus.REGISTERED.createdAt" | "legalStatus.REGISTERED.createdAtLocation"; | ||
fieldType: "event"; | ||
options?: { | ||
value: string; | ||
label: TranslationConfig; | ||
}[] | undefined; | ||
conditionals?: ({ | ||
type: "SHOW"; | ||
conditional: import(".").JSONSchema; | ||
} | { | ||
type: "ENABLE"; | ||
conditional: import(".").JSONSchema; | ||
} | { | ||
type: "DISPLAY_ON_REVIEW"; | ||
conditional: import(".").JSONSchema; | ||
})[] | undefined; | ||
searchCriteriaLabelPrefix?: TranslationConfig | undefined; | ||
}, { | ||
config: { | ||
type: "exact" | "fuzzy" | "range"; | ||
}; | ||
fieldId: "status" | "updatedAt" | "trackingId" | "legalStatus.REGISTERED.createdAt" | "legalStatus.REGISTERED.createdAtLocation"; | ||
fieldType: "event"; | ||
options?: { | ||
value: string; | ||
label: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
}; | ||
}[] | undefined; | ||
conditionals?: ({ | ||
type: "SHOW"; | ||
conditional: import(".").JSONSchema; | ||
} | { | ||
type: "ENABLE"; | ||
conditional: import(".").JSONSchema; | ||
} | { | ||
type: "DISPLAY_ON_REVIEW"; | ||
conditional: import(".").JSONSchema; | ||
})[] | undefined; | ||
searchCriteriaLabelPrefix?: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
} | undefined; | ||
}>]>, "many">; | ||
}, "strip", z.ZodTypeAny, { | ||
title: TranslationConfig; | ||
fields: { | ||
fields: ({ | ||
config: { | ||
type: "exact" | "fuzzy" | "range"; | ||
}; | ||
fieldId: string; | ||
config?: { | ||
type: "FUZZY" | "EXACT" | "RANGE"; | ||
} | undefined; | ||
}[]; | ||
fieldType: "field"; | ||
options?: { | ||
value: string; | ||
label: TranslationConfig; | ||
}[] | undefined; | ||
conditionals?: ({ | ||
type: "SHOW"; | ||
conditional: import(".").JSONSchema; | ||
} | { | ||
type: "ENABLE"; | ||
conditional: import(".").JSONSchema; | ||
} | { | ||
type: "DISPLAY_ON_REVIEW"; | ||
conditional: import(".").JSONSchema; | ||
})[] | undefined; | ||
searchCriteriaLabelPrefix?: TranslationConfig | undefined; | ||
} | { | ||
config: { | ||
type: "exact" | "fuzzy" | "range"; | ||
}; | ||
fieldId: "status" | "updatedAt" | "trackingId" | "legalStatus.REGISTERED.createdAt" | "legalStatus.REGISTERED.createdAtLocation"; | ||
fieldType: "event"; | ||
options?: { | ||
value: string; | ||
label: TranslationConfig; | ||
}[] | undefined; | ||
conditionals?: ({ | ||
type: "SHOW"; | ||
conditional: import(".").JSONSchema; | ||
} | { | ||
type: "ENABLE"; | ||
conditional: import(".").JSONSchema; | ||
} | { | ||
type: "DISPLAY_ON_REVIEW"; | ||
conditional: import(".").JSONSchema; | ||
})[] | undefined; | ||
searchCriteriaLabelPrefix?: TranslationConfig | undefined; | ||
})[]; | ||
}, { | ||
@@ -44,10 +925,64 @@ title: { | ||
}; | ||
fields?: { | ||
fields: ({ | ||
config: { | ||
type: "exact" | "fuzzy" | "range"; | ||
}; | ||
fieldId: string; | ||
config?: { | ||
type: "FUZZY" | "EXACT" | "RANGE"; | ||
fieldType: "field"; | ||
options?: { | ||
value: string; | ||
label: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
}; | ||
}[] | undefined; | ||
conditionals?: ({ | ||
type: "SHOW"; | ||
conditional: import(".").JSONSchema; | ||
} | { | ||
type: "ENABLE"; | ||
conditional: import(".").JSONSchema; | ||
} | { | ||
type: "DISPLAY_ON_REVIEW"; | ||
conditional: import(".").JSONSchema; | ||
})[] | undefined; | ||
searchCriteriaLabelPrefix?: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
} | undefined; | ||
}[] | undefined; | ||
} | { | ||
config: { | ||
type: "exact" | "fuzzy" | "range"; | ||
}; | ||
fieldId: "status" | "updatedAt" | "trackingId" | "legalStatus.REGISTERED.createdAt" | "legalStatus.REGISTERED.createdAtLocation"; | ||
fieldType: "event"; | ||
options?: { | ||
value: string; | ||
label: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
}; | ||
}[] | undefined; | ||
conditionals?: ({ | ||
type: "SHOW"; | ||
conditional: import(".").JSONSchema; | ||
} | { | ||
type: "ENABLE"; | ||
conditional: import(".").JSONSchema; | ||
} | { | ||
type: "DISPLAY_ON_REVIEW"; | ||
conditional: import(".").JSONSchema; | ||
})[] | undefined; | ||
searchCriteriaLabelPrefix?: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
} | undefined; | ||
})[]; | ||
}>; | ||
export type AdvancedSearchConfigInput = z.infer<typeof AdvancedSearchConfig>; | ||
export type AdvancedSearchConfig = z.infer<typeof AdvancedSearchConfig>; | ||
//# sourceMappingURL=AdvancedSearchConfig.d.ts.map |
@@ -12,3 +12,5 @@ import { z } from 'zod'; | ||
createdBy: z.ZodString; | ||
declaration: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodObject<{ | ||
createdByRole: z.ZodString; | ||
createdAtLocation: z.ZodOptional<z.ZodNullable<z.ZodString>>; | ||
declaration: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodString, z.ZodUnion<[z.ZodString, z.ZodTuple<[z.ZodString, z.ZodString], null>]>, z.ZodBoolean, z.ZodNumber, z.ZodObject<{ | ||
filename: z.ZodString; | ||
@@ -127,3 +129,3 @@ originalFilename: z.ZodString; | ||
}>]>>; | ||
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodObject<{ | ||
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodString, z.ZodUnion<[z.ZodString, z.ZodTuple<[z.ZodString, z.ZodString], null>]>, z.ZodBoolean, z.ZodNumber, z.ZodObject<{ | ||
filename: z.ZodString; | ||
@@ -242,3 +244,2 @@ originalFilename: z.ZodString; | ||
}>]>>>; | ||
createdAtLocation: z.ZodString; | ||
status: z.ZodEnum<["Requested", "Accepted", "Rejected"]>; | ||
@@ -254,2 +255,3 @@ originalActionId: z.ZodOptional<z.ZodString>; | ||
createdBy: string; | ||
createdByRole: string; | ||
declaration: Record<string, string | number | boolean | { | ||
@@ -292,4 +294,4 @@ type: string; | ||
originalFilename: string; | ||
}[] | undefined>; | ||
createdAtLocation: string; | ||
}[] | [string, string] | undefined>; | ||
createdAtLocation?: string | null | undefined; | ||
annotation?: Record<string, string | number | boolean | { | ||
@@ -332,3 +334,3 @@ type: string; | ||
originalFilename: string; | ||
}[] | undefined> | undefined; | ||
}[] | [string, string] | undefined> | undefined; | ||
originalActionId?: string | undefined; | ||
@@ -341,2 +343,3 @@ }, { | ||
createdBy: string; | ||
createdByRole: string; | ||
declaration: Record<string, string | number | boolean | { | ||
@@ -379,4 +382,4 @@ type: string; | ||
originalFilename: string; | ||
}[] | undefined>; | ||
createdAtLocation: string; | ||
}[] | [string, string] | undefined>; | ||
createdAtLocation?: string | null | undefined; | ||
annotation?: Record<string, string | number | boolean | { | ||
@@ -419,3 +422,3 @@ type: string; | ||
originalFilename: string; | ||
}[] | undefined> | undefined; | ||
}[] | [string, string] | undefined> | undefined; | ||
originalActionId?: string | undefined; | ||
@@ -434,2 +437,3 @@ }>; | ||
createdBy: string; | ||
createdByRole: string; | ||
declaration: Record<string, string | number | boolean | { | ||
@@ -472,4 +476,4 @@ type: string; | ||
originalFilename: string; | ||
}[] | undefined>; | ||
createdAtLocation: string; | ||
}[] | [string, string] | undefined>; | ||
createdAtLocation?: string | null | undefined; | ||
annotation?: Record<string, string | number | boolean | { | ||
@@ -512,3 +516,3 @@ type: string; | ||
originalFilename: string; | ||
}[] | undefined> | undefined; | ||
}[] | [string, string] | undefined> | undefined; | ||
originalActionId?: string | undefined; | ||
@@ -527,2 +531,3 @@ }; | ||
createdBy: string; | ||
createdByRole: string; | ||
declaration: Record<string, string | number | boolean | { | ||
@@ -565,4 +570,4 @@ type: string; | ||
originalFilename: string; | ||
}[] | undefined>; | ||
createdAtLocation: string; | ||
}[] | [string, string] | undefined>; | ||
createdAtLocation?: string | null | undefined; | ||
annotation?: Record<string, string | number | boolean | { | ||
@@ -605,3 +610,3 @@ type: string; | ||
originalFilename: string; | ||
}[] | undefined> | undefined; | ||
}[] | [string, string] | undefined> | undefined; | ||
originalActionId?: string | undefined; | ||
@@ -613,3 +618,3 @@ }; | ||
transactionId: z.ZodString; | ||
declaration: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodObject<{ | ||
declaration: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodString, z.ZodUnion<[z.ZodString, z.ZodTuple<[z.ZodString, z.ZodString], null>]>, z.ZodBoolean, z.ZodNumber, z.ZodObject<{ | ||
filename: z.ZodString; | ||
@@ -728,3 +733,3 @@ originalFilename: z.ZodString; | ||
}>]>>>; | ||
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodObject<{ | ||
annotation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodString, z.ZodUnion<[z.ZodString, z.ZodTuple<[z.ZodString, z.ZodString], null>]>, z.ZodBoolean, z.ZodNumber, z.ZodObject<{ | ||
filename: z.ZodString; | ||
@@ -847,4 +852,6 @@ originalFilename: z.ZodString; | ||
type: z.ZodEnum<["DELETE", "CREATE", "NOTIFY", "DECLARE", "VALIDATE", "REGISTER", "DETECT_DUPLICATE", "REJECT", "MARKED_AS_DUPLICATE", "ARCHIVE", "PRINT_CERTIFICATE", "REQUEST_CORRECTION", "REJECT_CORRECTION", "APPROVE_CORRECTION", "READ", "ASSIGN", "UNASSIGN"]>; | ||
status: z.ZodEnum<["Requested", "Accepted", "Rejected"]>; | ||
}>, "strip", z.ZodTypeAny, { | ||
type: "DECLARE" | "REGISTER" | "VALIDATE" | "DELETE" | "CREATE" | "NOTIFY" | "DETECT_DUPLICATE" | "REJECT" | "MARKED_AS_DUPLICATE" | "ARCHIVE" | "PRINT_CERTIFICATE" | "REQUEST_CORRECTION" | "REJECT_CORRECTION" | "APPROVE_CORRECTION" | "READ" | "ASSIGN" | "UNASSIGN"; | ||
status: "Rejected" | "Requested" | "Accepted"; | ||
transactionId: string; | ||
@@ -888,3 +895,3 @@ declaration: Record<string, string | number | boolean | { | ||
originalFilename: string; | ||
}[] | undefined>; | ||
}[] | [string, string] | undefined>; | ||
eventId: string; | ||
@@ -928,3 +935,3 @@ annotation?: Record<string, string | number | boolean | { | ||
originalFilename: string; | ||
}[] | undefined> | undefined; | ||
}[] | [string, string] | undefined> | undefined; | ||
originalActionId?: string | undefined; | ||
@@ -934,2 +941,3 @@ keepAssignment?: boolean | undefined; | ||
type: "DECLARE" | "REGISTER" | "VALIDATE" | "DELETE" | "CREATE" | "NOTIFY" | "DETECT_DUPLICATE" | "REJECT" | "MARKED_AS_DUPLICATE" | "ARCHIVE" | "PRINT_CERTIFICATE" | "REQUEST_CORRECTION" | "REJECT_CORRECTION" | "APPROVE_CORRECTION" | "READ" | "ASSIGN" | "UNASSIGN"; | ||
status: "Rejected" | "Requested" | "Accepted"; | ||
transactionId: string; | ||
@@ -974,3 +982,3 @@ eventId: string; | ||
originalFilename: string; | ||
}[] | undefined> | undefined; | ||
}[] | [string, string] | undefined> | undefined; | ||
annotation?: Record<string, string | number | boolean | { | ||
@@ -1013,3 +1021,3 @@ type: string; | ||
originalFilename: string; | ||
}[] | undefined> | undefined; | ||
}[] | [string, string] | undefined> | undefined; | ||
originalActionId?: string | undefined; | ||
@@ -1016,0 +1024,0 @@ keepAssignment?: boolean | undefined; |
@@ -1,2 +0,2 @@ | ||
import { z } from 'zod'; | ||
import { z, ZodType } from 'zod'; | ||
export declare const EventIndex: z.ZodObject<z.objectUtil.extendShape<{ | ||
@@ -15,13 +15,206 @@ id: z.ZodString; | ||
}>; | ||
legalStatuses: z.ZodObject<{ | ||
DECLARED: z.ZodOptional<z.ZodNullable<z.ZodObject<{ | ||
createdAt: z.ZodString; | ||
createdBy: z.ZodString; | ||
createdAtLocation: z.ZodOptional<z.ZodNullable<z.ZodString>>; | ||
acceptedAt: z.ZodString; | ||
createdByRole: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
createdAt: string; | ||
createdBy: string; | ||
createdByRole: string; | ||
acceptedAt: string; | ||
createdAtLocation?: string | null | undefined; | ||
}, { | ||
createdAt: string; | ||
createdBy: string; | ||
createdByRole: string; | ||
acceptedAt: string; | ||
createdAtLocation?: string | null | undefined; | ||
}>>>; | ||
REGISTERED: z.ZodOptional<z.ZodNullable<z.ZodObject<z.objectUtil.extendShape<{ | ||
createdAt: z.ZodString; | ||
createdBy: z.ZodString; | ||
createdAtLocation: z.ZodOptional<z.ZodNullable<z.ZodString>>; | ||
acceptedAt: z.ZodString; | ||
createdByRole: z.ZodString; | ||
}, { | ||
registrationNumber: z.ZodString; | ||
}>, "strip", z.ZodTypeAny, { | ||
createdAt: string; | ||
createdBy: string; | ||
createdByRole: string; | ||
registrationNumber: string; | ||
acceptedAt: string; | ||
createdAtLocation?: string | null | undefined; | ||
}, { | ||
createdAt: string; | ||
createdBy: string; | ||
createdByRole: string; | ||
registrationNumber: string; | ||
acceptedAt: string; | ||
createdAtLocation?: string | null | undefined; | ||
}>>>; | ||
}, "strip", z.ZodTypeAny, { | ||
DECLARED?: { | ||
createdAt: string; | ||
createdBy: string; | ||
createdByRole: string; | ||
acceptedAt: string; | ||
createdAtLocation?: string | null | undefined; | ||
} | null | undefined; | ||
REGISTERED?: { | ||
createdAt: string; | ||
createdBy: string; | ||
createdByRole: string; | ||
registrationNumber: string; | ||
acceptedAt: string; | ||
createdAtLocation?: string | null | undefined; | ||
} | null | undefined; | ||
}, { | ||
DECLARED?: { | ||
createdAt: string; | ||
createdBy: string; | ||
createdByRole: string; | ||
acceptedAt: string; | ||
createdAtLocation?: string | null | undefined; | ||
} | null | undefined; | ||
REGISTERED?: { | ||
createdAt: string; | ||
createdBy: string; | ||
createdByRole: string; | ||
registrationNumber: string; | ||
acceptedAt: string; | ||
createdAtLocation?: string | null | undefined; | ||
} | null | undefined; | ||
}>; | ||
createdAt: z.ZodString; | ||
dateOfEvent: z.ZodOptional<z.ZodNullable<z.ZodString>>; | ||
createdBy: z.ZodString; | ||
createdAtLocation: z.ZodString; | ||
updatedAtLocation: z.ZodString; | ||
modifiedAt: z.ZodString; | ||
updatedByUserRole: z.ZodString; | ||
createdAtLocation: z.ZodOptional<z.ZodNullable<z.ZodString>>; | ||
updatedAtLocation: z.ZodOptional<z.ZodNullable<z.ZodString>>; | ||
updatedAt: z.ZodString; | ||
assignedTo: z.ZodOptional<z.ZodNullable<z.ZodString>>; | ||
updatedBy: z.ZodString; | ||
updatedBy: z.ZodOptional<z.ZodNullable<z.ZodString>>; | ||
trackingId: z.ZodString; | ||
registrationNumber: z.ZodOptional<z.ZodNullable<z.ZodString>>; | ||
flags: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNativeEnum<{ | ||
readonly CERTIFICATE_PRINTED: "certificate-printed"; | ||
}>]>, "many">; | ||
}, { | ||
declaration: z.ZodRecord<z.ZodString, z.ZodAny>; | ||
declaration: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodString, z.ZodUnion<[z.ZodString, z.ZodTuple<[z.ZodString, z.ZodString], null>]>, z.ZodBoolean, z.ZodNumber, z.ZodObject<{ | ||
filename: z.ZodString; | ||
originalFilename: z.ZodString; | ||
type: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
type: string; | ||
filename: string; | ||
originalFilename: string; | ||
}, { | ||
type: string; | ||
filename: string; | ||
originalFilename: string; | ||
}>, z.ZodArray<z.ZodObject<{ | ||
filename: z.ZodString; | ||
originalFilename: z.ZodString; | ||
type: z.ZodString; | ||
option: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
type: string; | ||
option: string; | ||
filename: string; | ||
originalFilename: string; | ||
}, { | ||
type: string; | ||
option: string; | ||
filename: string; | ||
originalFilename: string; | ||
}>, "many">, z.ZodObject<z.objectUtil.extendShape<{ | ||
country: z.ZodString; | ||
addressType: z.ZodLiteral<"DOMESTIC">; | ||
province: z.ZodString; | ||
district: z.ZodString; | ||
}, { | ||
urbanOrRural: z.ZodLiteral<"URBAN">; | ||
town: z.ZodOptional<z.ZodString>; | ||
residentialArea: z.ZodOptional<z.ZodString>; | ||
street: z.ZodOptional<z.ZodString>; | ||
number: z.ZodOptional<z.ZodString>; | ||
zipCode: z.ZodOptional<z.ZodString>; | ||
}>, "strip", z.ZodTypeAny, { | ||
country: string; | ||
district: string; | ||
addressType: "DOMESTIC"; | ||
province: string; | ||
urbanOrRural: "URBAN"; | ||
number?: string | undefined; | ||
town?: string | undefined; | ||
residentialArea?: string | undefined; | ||
street?: string | undefined; | ||
zipCode?: string | undefined; | ||
}, { | ||
country: string; | ||
district: string; | ||
addressType: "DOMESTIC"; | ||
province: string; | ||
urbanOrRural: "URBAN"; | ||
number?: string | undefined; | ||
town?: string | undefined; | ||
residentialArea?: string | undefined; | ||
street?: string | undefined; | ||
zipCode?: string | undefined; | ||
}>, z.ZodObject<z.objectUtil.extendShape<{ | ||
country: z.ZodString; | ||
addressType: z.ZodLiteral<"DOMESTIC">; | ||
province: z.ZodString; | ||
district: z.ZodString; | ||
}, { | ||
urbanOrRural: z.ZodLiteral<"RURAL">; | ||
village: z.ZodOptional<z.ZodString>; | ||
}>, "strip", z.ZodTypeAny, { | ||
country: string; | ||
district: string; | ||
addressType: "DOMESTIC"; | ||
province: string; | ||
urbanOrRural: "RURAL"; | ||
village?: string | undefined; | ||
}, { | ||
country: string; | ||
district: string; | ||
addressType: "DOMESTIC"; | ||
province: string; | ||
urbanOrRural: "RURAL"; | ||
village?: string | undefined; | ||
}>, z.ZodUndefined, z.ZodObject<{ | ||
country: z.ZodString; | ||
addressType: z.ZodLiteral<"INTERNATIONAL">; | ||
state: z.ZodString; | ||
district2: z.ZodString; | ||
cityOrTown: z.ZodOptional<z.ZodString>; | ||
addressLine1: z.ZodOptional<z.ZodString>; | ||
addressLine2: z.ZodOptional<z.ZodString>; | ||
addressLine3: z.ZodOptional<z.ZodString>; | ||
postcodeOrZip: z.ZodOptional<z.ZodString>; | ||
}, "strip", z.ZodTypeAny, { | ||
country: string; | ||
state: string; | ||
addressType: "INTERNATIONAL"; | ||
district2: string; | ||
cityOrTown?: string | undefined; | ||
addressLine1?: string | undefined; | ||
addressLine2?: string | undefined; | ||
addressLine3?: string | undefined; | ||
postcodeOrZip?: string | undefined; | ||
}, { | ||
country: string; | ||
state: string; | ||
addressType: "INTERNATIONAL"; | ||
district2: string; | ||
cityOrTown?: string | undefined; | ||
addressLine1?: string | undefined; | ||
addressLine2?: string | undefined; | ||
addressLine3?: string | undefined; | ||
postcodeOrZip?: string | undefined; | ||
}>]>>; | ||
}>, "strip", z.ZodTypeAny, { | ||
@@ -33,10 +226,66 @@ type: string; | ||
createdBy: string; | ||
declaration: Record<string, any>; | ||
createdAtLocation: string; | ||
updatedAtLocation: string; | ||
declaration: Record<string, string | number | boolean | { | ||
type: string; | ||
filename: string; | ||
originalFilename: string; | ||
} | { | ||
country: string; | ||
district: string; | ||
addressType: "DOMESTIC"; | ||
province: string; | ||
urbanOrRural: "URBAN"; | ||
number?: string | undefined; | ||
town?: string | undefined; | ||
residentialArea?: string | undefined; | ||
street?: string | undefined; | ||
zipCode?: string | undefined; | ||
} | { | ||
country: string; | ||
district: string; | ||
addressType: "DOMESTIC"; | ||
province: string; | ||
urbanOrRural: "RURAL"; | ||
village?: string | undefined; | ||
} | { | ||
country: string; | ||
state: string; | ||
addressType: "INTERNATIONAL"; | ||
district2: string; | ||
cityOrTown?: string | undefined; | ||
addressLine1?: string | undefined; | ||
addressLine2?: string | undefined; | ||
addressLine3?: string | undefined; | ||
postcodeOrZip?: string | undefined; | ||
} | { | ||
type: string; | ||
option: string; | ||
filename: string; | ||
originalFilename: string; | ||
}[] | [string, string] | undefined>; | ||
updatedAt: string; | ||
trackingId: string; | ||
modifiedAt: string; | ||
updatedBy: string; | ||
legalStatuses: { | ||
DECLARED?: { | ||
createdAt: string; | ||
createdBy: string; | ||
createdByRole: string; | ||
acceptedAt: string; | ||
createdAtLocation?: string | null | undefined; | ||
} | null | undefined; | ||
REGISTERED?: { | ||
createdAt: string; | ||
createdBy: string; | ||
createdByRole: string; | ||
registrationNumber: string; | ||
acceptedAt: string; | ||
createdAtLocation?: string | null | undefined; | ||
} | null | undefined; | ||
}; | ||
updatedByUserRole: string; | ||
flags: string[]; | ||
createdAtLocation?: string | null | undefined; | ||
assignedTo?: string | null | undefined; | ||
registrationNumber?: string | null | undefined; | ||
dateOfEvent?: string | null | undefined; | ||
updatedAtLocation?: string | null | undefined; | ||
updatedBy?: string | null | undefined; | ||
}, { | ||
@@ -48,10 +297,66 @@ type: string; | ||
createdBy: string; | ||
declaration: Record<string, any>; | ||
createdAtLocation: string; | ||
updatedAtLocation: string; | ||
declaration: Record<string, string | number | boolean | { | ||
type: string; | ||
filename: string; | ||
originalFilename: string; | ||
} | { | ||
country: string; | ||
district: string; | ||
addressType: "DOMESTIC"; | ||
province: string; | ||
urbanOrRural: "URBAN"; | ||
number?: string | undefined; | ||
town?: string | undefined; | ||
residentialArea?: string | undefined; | ||
street?: string | undefined; | ||
zipCode?: string | undefined; | ||
} | { | ||
country: string; | ||
district: string; | ||
addressType: "DOMESTIC"; | ||
province: string; | ||
urbanOrRural: "RURAL"; | ||
village?: string | undefined; | ||
} | { | ||
country: string; | ||
state: string; | ||
addressType: "INTERNATIONAL"; | ||
district2: string; | ||
cityOrTown?: string | undefined; | ||
addressLine1?: string | undefined; | ||
addressLine2?: string | undefined; | ||
addressLine3?: string | undefined; | ||
postcodeOrZip?: string | undefined; | ||
} | { | ||
type: string; | ||
option: string; | ||
filename: string; | ||
originalFilename: string; | ||
}[] | [string, string] | undefined>; | ||
updatedAt: string; | ||
trackingId: string; | ||
modifiedAt: string; | ||
updatedBy: string; | ||
legalStatuses: { | ||
DECLARED?: { | ||
createdAt: string; | ||
createdBy: string; | ||
createdByRole: string; | ||
acceptedAt: string; | ||
createdAtLocation?: string | null | undefined; | ||
} | null | undefined; | ||
REGISTERED?: { | ||
createdAt: string; | ||
createdBy: string; | ||
createdByRole: string; | ||
registrationNumber: string; | ||
acceptedAt: string; | ||
createdAtLocation?: string | null | undefined; | ||
} | null | undefined; | ||
}; | ||
updatedByUserRole: string; | ||
flags: string[]; | ||
createdAtLocation?: string | null | undefined; | ||
assignedTo?: string | null | undefined; | ||
registrationNumber?: string | null | undefined; | ||
dateOfEvent?: string | null | undefined; | ||
updatedAtLocation?: string | null | undefined; | ||
updatedBy?: string | null | undefined; | ||
}>; | ||
@@ -67,2 +372,917 @@ export declare const EventSearchIndex: z.ZodIntersection<z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodObject<{ | ||
export type EventIndex = z.infer<typeof EventIndex>; | ||
declare const Fuzzy: z.ZodObject<{ | ||
type: z.ZodLiteral<"fuzzy">; | ||
term: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "fuzzy"; | ||
term: string; | ||
}, { | ||
type: "fuzzy"; | ||
term: string; | ||
}>; | ||
declare const Exact: z.ZodObject<{ | ||
type: z.ZodLiteral<"exact">; | ||
term: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "exact"; | ||
term: string; | ||
}, { | ||
type: "exact"; | ||
term: string; | ||
}>; | ||
declare const AnyOf: z.ZodObject<{ | ||
type: z.ZodLiteral<"anyOf">; | ||
terms: z.ZodArray<z.ZodString, "many">; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "anyOf"; | ||
terms: string[]; | ||
}, { | ||
type: "anyOf"; | ||
terms: string[]; | ||
}>; | ||
declare const Range: z.ZodObject<{ | ||
type: z.ZodLiteral<"range">; | ||
gte: z.ZodString; | ||
lte: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "range"; | ||
gte: string; | ||
lte: string; | ||
}, { | ||
type: "range"; | ||
gte: string; | ||
lte: string; | ||
}>; | ||
declare const Not: z.ZodObject<{ | ||
type: z.ZodLiteral<"not">; | ||
term: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "not"; | ||
term: string; | ||
}, { | ||
type: "not"; | ||
term: string; | ||
}>; | ||
declare const Within: z.ZodObject<{ | ||
type: z.ZodLiteral<"within">; | ||
location: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "within"; | ||
location: string; | ||
}, { | ||
type: "within"; | ||
location: string; | ||
}>; | ||
export declare const QueryInput: ZodType; | ||
export type BaseInput = z.infer<typeof Fuzzy> | z.infer<typeof Exact> | z.infer<typeof Range> | z.infer<typeof Within> | z.infer<typeof AnyOf> | z.infer<typeof Not>; | ||
type QueryMap = { | ||
[key: string]: BaseInput | QueryMap; | ||
}; | ||
export type QueryInputType = BaseInput | QueryMap; | ||
export declare const QueryExpression: z.ZodObject<{ | ||
eventType: z.ZodOptional<z.ZodString>; | ||
status: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodObject<{ | ||
type: z.ZodLiteral<"anyOf">; | ||
terms: z.ZodArray<z.ZodEnum<["CREATED", "NOTIFIED", "DECLARED", "VALIDATED", "REGISTERED", "CERTIFIED", "REJECTED", "ARCHIVED"]>, "many">; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "anyOf"; | ||
terms: ("ARCHIVED" | "CERTIFIED" | "DECLARED" | "REGISTERED" | "REJECTED" | "VALIDATED" | "CREATED" | "NOTIFIED")[]; | ||
}, { | ||
type: "anyOf"; | ||
terms: ("ARCHIVED" | "CERTIFIED" | "DECLARED" | "REGISTERED" | "REJECTED" | "VALIDATED" | "CREATED" | "NOTIFIED")[]; | ||
}>, z.ZodObject<{ | ||
type: z.ZodLiteral<"exact">; | ||
term: z.ZodEnum<["CREATED", "NOTIFIED", "DECLARED", "VALIDATED", "REGISTERED", "CERTIFIED", "REJECTED", "ARCHIVED"]>; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "exact"; | ||
term: "ARCHIVED" | "CERTIFIED" | "DECLARED" | "REGISTERED" | "REJECTED" | "VALIDATED" | "CREATED" | "NOTIFIED"; | ||
}, { | ||
type: "exact"; | ||
term: "ARCHIVED" | "CERTIFIED" | "DECLARED" | "REGISTERED" | "REJECTED" | "VALIDATED" | "CREATED" | "NOTIFIED"; | ||
}>]>>>; | ||
createdAt: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodObject<{ | ||
type: z.ZodLiteral<"exact">; | ||
term: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "exact"; | ||
term: string; | ||
}, { | ||
type: "exact"; | ||
term: string; | ||
}>, z.ZodObject<{ | ||
type: z.ZodLiteral<"range">; | ||
gte: z.ZodString; | ||
lte: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "range"; | ||
gte: string; | ||
lte: string; | ||
}, { | ||
type: "range"; | ||
gte: string; | ||
lte: string; | ||
}>]>>>; | ||
updatedAt: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodObject<{ | ||
type: z.ZodLiteral<"exact">; | ||
term: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "exact"; | ||
term: string; | ||
}, { | ||
type: "exact"; | ||
term: string; | ||
}>, z.ZodObject<{ | ||
type: z.ZodLiteral<"range">; | ||
gte: z.ZodString; | ||
lte: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "range"; | ||
gte: string; | ||
lte: string; | ||
}, { | ||
type: "range"; | ||
gte: string; | ||
lte: string; | ||
}>]>>>; | ||
'legalStatus.REGISTERED.createdAt': z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodObject<{ | ||
type: z.ZodLiteral<"exact">; | ||
term: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "exact"; | ||
term: string; | ||
}, { | ||
type: "exact"; | ||
term: string; | ||
}>, z.ZodObject<{ | ||
type: z.ZodLiteral<"range">; | ||
gte: z.ZodString; | ||
lte: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "range"; | ||
gte: string; | ||
lte: string; | ||
}, { | ||
type: "range"; | ||
gte: string; | ||
lte: string; | ||
}>]>>>; | ||
'legalStatus.REGISTERED.createdAtLocation': z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodObject<{ | ||
type: z.ZodLiteral<"within">; | ||
location: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "within"; | ||
location: string; | ||
}, { | ||
type: "within"; | ||
location: string; | ||
}>, z.ZodObject<{ | ||
type: z.ZodLiteral<"exact">; | ||
term: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "exact"; | ||
term: string; | ||
}, { | ||
type: "exact"; | ||
term: string; | ||
}>]>>>; | ||
createAtLocation: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodObject<{ | ||
type: z.ZodLiteral<"within">; | ||
location: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "within"; | ||
location: string; | ||
}, { | ||
type: "within"; | ||
location: string; | ||
}>, z.ZodObject<{ | ||
type: z.ZodLiteral<"exact">; | ||
term: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "exact"; | ||
term: string; | ||
}, { | ||
type: "exact"; | ||
term: string; | ||
}>]>>>; | ||
updatedAtLocation: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodObject<{ | ||
type: z.ZodLiteral<"within">; | ||
location: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "within"; | ||
location: string; | ||
}, { | ||
type: "within"; | ||
location: string; | ||
}>, z.ZodObject<{ | ||
type: z.ZodLiteral<"exact">; | ||
term: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "exact"; | ||
term: string; | ||
}, { | ||
type: "exact"; | ||
term: string; | ||
}>]>>>; | ||
createdBy: z.ZodOptional<z.ZodOptional<z.ZodObject<{ | ||
type: z.ZodLiteral<"exact">; | ||
term: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "exact"; | ||
term: string; | ||
}, { | ||
type: "exact"; | ||
term: string; | ||
}>>>; | ||
updatedBy: z.ZodOptional<z.ZodOptional<z.ZodObject<{ | ||
type: z.ZodLiteral<"exact">; | ||
term: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "exact"; | ||
term: string; | ||
}, { | ||
type: "exact"; | ||
term: string; | ||
}>>>; | ||
trackingId: z.ZodOptional<z.ZodOptional<z.ZodObject<{ | ||
type: z.ZodLiteral<"exact">; | ||
term: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "exact"; | ||
term: string; | ||
}, { | ||
type: "exact"; | ||
term: string; | ||
}>>>; | ||
flags: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodObject<{ | ||
type: z.ZodLiteral<"anyOf">; | ||
terms: z.ZodArray<z.ZodString, "many">; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "anyOf"; | ||
terms: string[]; | ||
}, { | ||
type: "anyOf"; | ||
terms: string[]; | ||
}>, z.ZodObject<{ | ||
type: z.ZodLiteral<"not">; | ||
term: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "not"; | ||
term: string; | ||
}, { | ||
type: "not"; | ||
term: string; | ||
}>]>, "many">>>; | ||
data: z.ZodOptional<z.ZodType<any, z.ZodTypeDef, any>>; | ||
}, "strip", z.ZodTypeAny, { | ||
status?: { | ||
type: "exact"; | ||
term: "ARCHIVED" | "CERTIFIED" | "DECLARED" | "REGISTERED" | "REJECTED" | "VALIDATED" | "CREATED" | "NOTIFIED"; | ||
} | { | ||
type: "anyOf"; | ||
terms: ("ARCHIVED" | "CERTIFIED" | "DECLARED" | "REGISTERED" | "REJECTED" | "VALIDATED" | "CREATED" | "NOTIFIED")[]; | ||
} | undefined; | ||
data?: any; | ||
createdAt?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "range"; | ||
gte: string; | ||
lte: string; | ||
} | undefined; | ||
createdBy?: { | ||
type: "exact"; | ||
term: string; | ||
} | undefined; | ||
updatedAt?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "range"; | ||
gte: string; | ||
lte: string; | ||
} | undefined; | ||
trackingId?: { | ||
type: "exact"; | ||
term: string; | ||
} | undefined; | ||
eventType?: string | undefined; | ||
'legalStatus.REGISTERED.createdAt'?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "range"; | ||
gte: string; | ||
lte: string; | ||
} | undefined; | ||
'legalStatus.REGISTERED.createdAtLocation'?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "within"; | ||
location: string; | ||
} | undefined; | ||
updatedAtLocation?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "within"; | ||
location: string; | ||
} | undefined; | ||
updatedBy?: { | ||
type: "exact"; | ||
term: string; | ||
} | undefined; | ||
flags?: ({ | ||
type: "anyOf"; | ||
terms: string[]; | ||
} | { | ||
type: "not"; | ||
term: string; | ||
})[] | undefined; | ||
createAtLocation?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "within"; | ||
location: string; | ||
} | undefined; | ||
}, { | ||
status?: { | ||
type: "exact"; | ||
term: "ARCHIVED" | "CERTIFIED" | "DECLARED" | "REGISTERED" | "REJECTED" | "VALIDATED" | "CREATED" | "NOTIFIED"; | ||
} | { | ||
type: "anyOf"; | ||
terms: ("ARCHIVED" | "CERTIFIED" | "DECLARED" | "REGISTERED" | "REJECTED" | "VALIDATED" | "CREATED" | "NOTIFIED")[]; | ||
} | undefined; | ||
data?: any; | ||
createdAt?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "range"; | ||
gte: string; | ||
lte: string; | ||
} | undefined; | ||
createdBy?: { | ||
type: "exact"; | ||
term: string; | ||
} | undefined; | ||
updatedAt?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "range"; | ||
gte: string; | ||
lte: string; | ||
} | undefined; | ||
trackingId?: { | ||
type: "exact"; | ||
term: string; | ||
} | undefined; | ||
eventType?: string | undefined; | ||
'legalStatus.REGISTERED.createdAt'?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "range"; | ||
gte: string; | ||
lte: string; | ||
} | undefined; | ||
'legalStatus.REGISTERED.createdAtLocation'?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "within"; | ||
location: string; | ||
} | undefined; | ||
updatedAtLocation?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "within"; | ||
location: string; | ||
} | undefined; | ||
updatedBy?: { | ||
type: "exact"; | ||
term: string; | ||
} | undefined; | ||
flags?: ({ | ||
type: "anyOf"; | ||
terms: string[]; | ||
} | { | ||
type: "not"; | ||
term: string; | ||
})[] | undefined; | ||
createAtLocation?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "within"; | ||
location: string; | ||
} | undefined; | ||
}>; | ||
export declare const QueryType: z.ZodObject<{ | ||
type: z.ZodUnion<[z.ZodLiteral<"and">, z.ZodLiteral<"or">]>; | ||
clauses: z.ZodEffects<z.ZodArray<z.ZodObject<{ | ||
eventType: z.ZodOptional<z.ZodString>; | ||
status: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodObject<{ | ||
type: z.ZodLiteral<"anyOf">; | ||
terms: z.ZodArray<z.ZodEnum<["CREATED", "NOTIFIED", "DECLARED", "VALIDATED", "REGISTERED", "CERTIFIED", "REJECTED", "ARCHIVED"]>, "many">; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "anyOf"; | ||
terms: ("ARCHIVED" | "CERTIFIED" | "DECLARED" | "REGISTERED" | "REJECTED" | "VALIDATED" | "CREATED" | "NOTIFIED")[]; | ||
}, { | ||
type: "anyOf"; | ||
terms: ("ARCHIVED" | "CERTIFIED" | "DECLARED" | "REGISTERED" | "REJECTED" | "VALIDATED" | "CREATED" | "NOTIFIED")[]; | ||
}>, z.ZodObject<{ | ||
type: z.ZodLiteral<"exact">; | ||
term: z.ZodEnum<["CREATED", "NOTIFIED", "DECLARED", "VALIDATED", "REGISTERED", "CERTIFIED", "REJECTED", "ARCHIVED"]>; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "exact"; | ||
term: "ARCHIVED" | "CERTIFIED" | "DECLARED" | "REGISTERED" | "REJECTED" | "VALIDATED" | "CREATED" | "NOTIFIED"; | ||
}, { | ||
type: "exact"; | ||
term: "ARCHIVED" | "CERTIFIED" | "DECLARED" | "REGISTERED" | "REJECTED" | "VALIDATED" | "CREATED" | "NOTIFIED"; | ||
}>]>>>; | ||
createdAt: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodObject<{ | ||
type: z.ZodLiteral<"exact">; | ||
term: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "exact"; | ||
term: string; | ||
}, { | ||
type: "exact"; | ||
term: string; | ||
}>, z.ZodObject<{ | ||
type: z.ZodLiteral<"range">; | ||
gte: z.ZodString; | ||
lte: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "range"; | ||
gte: string; | ||
lte: string; | ||
}, { | ||
type: "range"; | ||
gte: string; | ||
lte: string; | ||
}>]>>>; | ||
updatedAt: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodObject<{ | ||
type: z.ZodLiteral<"exact">; | ||
term: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "exact"; | ||
term: string; | ||
}, { | ||
type: "exact"; | ||
term: string; | ||
}>, z.ZodObject<{ | ||
type: z.ZodLiteral<"range">; | ||
gte: z.ZodString; | ||
lte: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "range"; | ||
gte: string; | ||
lte: string; | ||
}, { | ||
type: "range"; | ||
gte: string; | ||
lte: string; | ||
}>]>>>; | ||
'legalStatus.REGISTERED.createdAt': z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodObject<{ | ||
type: z.ZodLiteral<"exact">; | ||
term: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "exact"; | ||
term: string; | ||
}, { | ||
type: "exact"; | ||
term: string; | ||
}>, z.ZodObject<{ | ||
type: z.ZodLiteral<"range">; | ||
gte: z.ZodString; | ||
lte: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "range"; | ||
gte: string; | ||
lte: string; | ||
}, { | ||
type: "range"; | ||
gte: string; | ||
lte: string; | ||
}>]>>>; | ||
'legalStatus.REGISTERED.createdAtLocation': z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodObject<{ | ||
type: z.ZodLiteral<"within">; | ||
location: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "within"; | ||
location: string; | ||
}, { | ||
type: "within"; | ||
location: string; | ||
}>, z.ZodObject<{ | ||
type: z.ZodLiteral<"exact">; | ||
term: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "exact"; | ||
term: string; | ||
}, { | ||
type: "exact"; | ||
term: string; | ||
}>]>>>; | ||
createAtLocation: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodObject<{ | ||
type: z.ZodLiteral<"within">; | ||
location: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "within"; | ||
location: string; | ||
}, { | ||
type: "within"; | ||
location: string; | ||
}>, z.ZodObject<{ | ||
type: z.ZodLiteral<"exact">; | ||
term: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "exact"; | ||
term: string; | ||
}, { | ||
type: "exact"; | ||
term: string; | ||
}>]>>>; | ||
updatedAtLocation: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodObject<{ | ||
type: z.ZodLiteral<"within">; | ||
location: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "within"; | ||
location: string; | ||
}, { | ||
type: "within"; | ||
location: string; | ||
}>, z.ZodObject<{ | ||
type: z.ZodLiteral<"exact">; | ||
term: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "exact"; | ||
term: string; | ||
}, { | ||
type: "exact"; | ||
term: string; | ||
}>]>>>; | ||
createdBy: z.ZodOptional<z.ZodOptional<z.ZodObject<{ | ||
type: z.ZodLiteral<"exact">; | ||
term: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "exact"; | ||
term: string; | ||
}, { | ||
type: "exact"; | ||
term: string; | ||
}>>>; | ||
updatedBy: z.ZodOptional<z.ZodOptional<z.ZodObject<{ | ||
type: z.ZodLiteral<"exact">; | ||
term: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "exact"; | ||
term: string; | ||
}, { | ||
type: "exact"; | ||
term: string; | ||
}>>>; | ||
trackingId: z.ZodOptional<z.ZodOptional<z.ZodObject<{ | ||
type: z.ZodLiteral<"exact">; | ||
term: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "exact"; | ||
term: string; | ||
}, { | ||
type: "exact"; | ||
term: string; | ||
}>>>; | ||
flags: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodObject<{ | ||
type: z.ZodLiteral<"anyOf">; | ||
terms: z.ZodArray<z.ZodString, "many">; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "anyOf"; | ||
terms: string[]; | ||
}, { | ||
type: "anyOf"; | ||
terms: string[]; | ||
}>, z.ZodObject<{ | ||
type: z.ZodLiteral<"not">; | ||
term: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "not"; | ||
term: string; | ||
}, { | ||
type: "not"; | ||
term: string; | ||
}>]>, "many">>>; | ||
data: z.ZodOptional<z.ZodType<any, z.ZodTypeDef, any>>; | ||
}, "strip", z.ZodTypeAny, { | ||
status?: { | ||
type: "exact"; | ||
term: "ARCHIVED" | "CERTIFIED" | "DECLARED" | "REGISTERED" | "REJECTED" | "VALIDATED" | "CREATED" | "NOTIFIED"; | ||
} | { | ||
type: "anyOf"; | ||
terms: ("ARCHIVED" | "CERTIFIED" | "DECLARED" | "REGISTERED" | "REJECTED" | "VALIDATED" | "CREATED" | "NOTIFIED")[]; | ||
} | undefined; | ||
data?: any; | ||
createdAt?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "range"; | ||
gte: string; | ||
lte: string; | ||
} | undefined; | ||
createdBy?: { | ||
type: "exact"; | ||
term: string; | ||
} | undefined; | ||
updatedAt?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "range"; | ||
gte: string; | ||
lte: string; | ||
} | undefined; | ||
trackingId?: { | ||
type: "exact"; | ||
term: string; | ||
} | undefined; | ||
eventType?: string | undefined; | ||
'legalStatus.REGISTERED.createdAt'?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "range"; | ||
gte: string; | ||
lte: string; | ||
} | undefined; | ||
'legalStatus.REGISTERED.createdAtLocation'?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "within"; | ||
location: string; | ||
} | undefined; | ||
updatedAtLocation?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "within"; | ||
location: string; | ||
} | undefined; | ||
updatedBy?: { | ||
type: "exact"; | ||
term: string; | ||
} | undefined; | ||
flags?: ({ | ||
type: "anyOf"; | ||
terms: string[]; | ||
} | { | ||
type: "not"; | ||
term: string; | ||
})[] | undefined; | ||
createAtLocation?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "within"; | ||
location: string; | ||
} | undefined; | ||
}, { | ||
status?: { | ||
type: "exact"; | ||
term: "ARCHIVED" | "CERTIFIED" | "DECLARED" | "REGISTERED" | "REJECTED" | "VALIDATED" | "CREATED" | "NOTIFIED"; | ||
} | { | ||
type: "anyOf"; | ||
terms: ("ARCHIVED" | "CERTIFIED" | "DECLARED" | "REGISTERED" | "REJECTED" | "VALIDATED" | "CREATED" | "NOTIFIED")[]; | ||
} | undefined; | ||
data?: any; | ||
createdAt?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "range"; | ||
gte: string; | ||
lte: string; | ||
} | undefined; | ||
createdBy?: { | ||
type: "exact"; | ||
term: string; | ||
} | undefined; | ||
updatedAt?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "range"; | ||
gte: string; | ||
lte: string; | ||
} | undefined; | ||
trackingId?: { | ||
type: "exact"; | ||
term: string; | ||
} | undefined; | ||
eventType?: string | undefined; | ||
'legalStatus.REGISTERED.createdAt'?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "range"; | ||
gte: string; | ||
lte: string; | ||
} | undefined; | ||
'legalStatus.REGISTERED.createdAtLocation'?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "within"; | ||
location: string; | ||
} | undefined; | ||
updatedAtLocation?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "within"; | ||
location: string; | ||
} | undefined; | ||
updatedBy?: { | ||
type: "exact"; | ||
term: string; | ||
} | undefined; | ||
flags?: ({ | ||
type: "anyOf"; | ||
terms: string[]; | ||
} | { | ||
type: "not"; | ||
term: string; | ||
})[] | undefined; | ||
createAtLocation?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "within"; | ||
location: string; | ||
} | undefined; | ||
}>, "many">, { | ||
status?: { | ||
type: "exact"; | ||
term: "ARCHIVED" | "CERTIFIED" | "DECLARED" | "REGISTERED" | "REJECTED" | "VALIDATED" | "CREATED" | "NOTIFIED"; | ||
} | { | ||
type: "anyOf"; | ||
terms: ("ARCHIVED" | "CERTIFIED" | "DECLARED" | "REGISTERED" | "REJECTED" | "VALIDATED" | "CREATED" | "NOTIFIED")[]; | ||
} | undefined; | ||
data?: any; | ||
createdAt?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "range"; | ||
gte: string; | ||
lte: string; | ||
} | undefined; | ||
createdBy?: { | ||
type: "exact"; | ||
term: string; | ||
} | undefined; | ||
updatedAt?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "range"; | ||
gte: string; | ||
lte: string; | ||
} | undefined; | ||
trackingId?: { | ||
type: "exact"; | ||
term: string; | ||
} | undefined; | ||
eventType?: string | undefined; | ||
'legalStatus.REGISTERED.createdAt'?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "range"; | ||
gte: string; | ||
lte: string; | ||
} | undefined; | ||
'legalStatus.REGISTERED.createdAtLocation'?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "within"; | ||
location: string; | ||
} | undefined; | ||
updatedAtLocation?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "within"; | ||
location: string; | ||
} | undefined; | ||
updatedBy?: { | ||
type: "exact"; | ||
term: string; | ||
} | undefined; | ||
flags?: ({ | ||
type: "anyOf"; | ||
terms: string[]; | ||
} | { | ||
type: "not"; | ||
term: string; | ||
})[] | undefined; | ||
createAtLocation?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "within"; | ||
location: string; | ||
} | undefined; | ||
}[], unknown>; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "and" | "or"; | ||
clauses: { | ||
status?: { | ||
type: "exact"; | ||
term: "ARCHIVED" | "CERTIFIED" | "DECLARED" | "REGISTERED" | "REJECTED" | "VALIDATED" | "CREATED" | "NOTIFIED"; | ||
} | { | ||
type: "anyOf"; | ||
terms: ("ARCHIVED" | "CERTIFIED" | "DECLARED" | "REGISTERED" | "REJECTED" | "VALIDATED" | "CREATED" | "NOTIFIED")[]; | ||
} | undefined; | ||
data?: any; | ||
createdAt?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "range"; | ||
gte: string; | ||
lte: string; | ||
} | undefined; | ||
createdBy?: { | ||
type: "exact"; | ||
term: string; | ||
} | undefined; | ||
updatedAt?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "range"; | ||
gte: string; | ||
lte: string; | ||
} | undefined; | ||
trackingId?: { | ||
type: "exact"; | ||
term: string; | ||
} | undefined; | ||
eventType?: string | undefined; | ||
'legalStatus.REGISTERED.createdAt'?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "range"; | ||
gte: string; | ||
lte: string; | ||
} | undefined; | ||
'legalStatus.REGISTERED.createdAtLocation'?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "within"; | ||
location: string; | ||
} | undefined; | ||
updatedAtLocation?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "within"; | ||
location: string; | ||
} | undefined; | ||
updatedBy?: { | ||
type: "exact"; | ||
term: string; | ||
} | undefined; | ||
flags?: ({ | ||
type: "anyOf"; | ||
terms: string[]; | ||
} | { | ||
type: "not"; | ||
term: string; | ||
})[] | undefined; | ||
createAtLocation?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "within"; | ||
location: string; | ||
} | undefined; | ||
}[]; | ||
}, { | ||
type: "and" | "or"; | ||
clauses?: unknown; | ||
}>; | ||
export type QueryType = z.infer<typeof QueryType>; | ||
export type QueryExpression = z.infer<typeof QueryExpression>; | ||
export {}; | ||
//# sourceMappingURL=EventIndex.d.ts.map |
@@ -5,10 +5,23 @@ import { z } from 'zod'; | ||
type: z.ZodString; | ||
dateOfEvent: z.ZodOptional<z.ZodObject<{ | ||
fieldId: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
fieldId: string; | ||
}, { | ||
fieldId: string; | ||
}>>; | ||
}, "strip", z.ZodTypeAny, { | ||
type: string; | ||
transactionId: string; | ||
dateOfEvent?: { | ||
fieldId: string; | ||
} | undefined; | ||
}, { | ||
type: string; | ||
transactionId: string; | ||
dateOfEvent?: { | ||
fieldId: string; | ||
} | undefined; | ||
}>; | ||
export type EventInput = z.infer<typeof EventInput>; | ||
//# sourceMappingURL=EventInput.d.ts.map |
@@ -17,2 +17,11 @@ import { z } from 'zod'; | ||
export type EventStatus = (typeof EventStatus)[keyof typeof EventStatus]; | ||
export declare const EventStatusEnum: z.ZodEnum<["CREATED", "NOTIFIED", "DECLARED", "VALIDATED", "REGISTERED", "CERTIFIED", "REJECTED", "ARCHIVED"]>; | ||
export declare const CustomFlags: { | ||
readonly CERTIFICATE_PRINTED: "certificate-printed"; | ||
}; | ||
export type CustomFlags = (typeof CustomFlags)[keyof typeof CustomFlags]; | ||
export declare const Flag: z.ZodUnion<[z.ZodString, z.ZodNativeEnum<{ | ||
readonly CERTIFICATE_PRINTED: "certificate-printed"; | ||
}>]>; | ||
export type Flag = z.infer<typeof Flag>; | ||
export declare const eventStatuses: ("ARCHIVED" | "CERTIFIED" | "DECLARED" | "REGISTERED" | "REJECTED" | "VALIDATED" | "CREATED" | "NOTIFIED")[]; | ||
@@ -29,2 +38,123 @@ export declare const EventStatuses: z.ZodNativeEnum<{ | ||
}>; | ||
export declare const ZodDate: z.ZodString; | ||
export declare const ActionCreationMetadata: z.ZodObject<{ | ||
createdAt: z.ZodString; | ||
createdBy: z.ZodString; | ||
createdAtLocation: z.ZodOptional<z.ZodNullable<z.ZodString>>; | ||
acceptedAt: z.ZodString; | ||
createdByRole: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
createdAt: string; | ||
createdBy: string; | ||
createdByRole: string; | ||
acceptedAt: string; | ||
createdAtLocation?: string | null | undefined; | ||
}, { | ||
createdAt: string; | ||
createdBy: string; | ||
createdByRole: string; | ||
acceptedAt: string; | ||
createdAtLocation?: string | null | undefined; | ||
}>; | ||
export type ActionCreationMetadata = z.infer<typeof ActionCreationMetadata>; | ||
export declare const RegistrationCreationMetadata: z.ZodObject<z.objectUtil.extendShape<{ | ||
createdAt: z.ZodString; | ||
createdBy: z.ZodString; | ||
createdAtLocation: z.ZodOptional<z.ZodNullable<z.ZodString>>; | ||
acceptedAt: z.ZodString; | ||
createdByRole: z.ZodString; | ||
}, { | ||
registrationNumber: z.ZodString; | ||
}>, "strip", z.ZodTypeAny, { | ||
createdAt: string; | ||
createdBy: string; | ||
createdByRole: string; | ||
registrationNumber: string; | ||
acceptedAt: string; | ||
createdAtLocation?: string | null | undefined; | ||
}, { | ||
createdAt: string; | ||
createdBy: string; | ||
createdByRole: string; | ||
registrationNumber: string; | ||
acceptedAt: string; | ||
createdAtLocation?: string | null | undefined; | ||
}>; | ||
export type RegistrationCreationMetadata = z.infer<typeof RegistrationCreationMetadata>; | ||
export declare const LegalStatuses: z.ZodObject<{ | ||
DECLARED: z.ZodOptional<z.ZodNullable<z.ZodObject<{ | ||
createdAt: z.ZodString; | ||
createdBy: z.ZodString; | ||
createdAtLocation: z.ZodOptional<z.ZodNullable<z.ZodString>>; | ||
acceptedAt: z.ZodString; | ||
createdByRole: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
createdAt: string; | ||
createdBy: string; | ||
createdByRole: string; | ||
acceptedAt: string; | ||
createdAtLocation?: string | null | undefined; | ||
}, { | ||
createdAt: string; | ||
createdBy: string; | ||
createdByRole: string; | ||
acceptedAt: string; | ||
createdAtLocation?: string | null | undefined; | ||
}>>>; | ||
REGISTERED: z.ZodOptional<z.ZodNullable<z.ZodObject<z.objectUtil.extendShape<{ | ||
createdAt: z.ZodString; | ||
createdBy: z.ZodString; | ||
createdAtLocation: z.ZodOptional<z.ZodNullable<z.ZodString>>; | ||
acceptedAt: z.ZodString; | ||
createdByRole: z.ZodString; | ||
}, { | ||
registrationNumber: z.ZodString; | ||
}>, "strip", z.ZodTypeAny, { | ||
createdAt: string; | ||
createdBy: string; | ||
createdByRole: string; | ||
registrationNumber: string; | ||
acceptedAt: string; | ||
createdAtLocation?: string | null | undefined; | ||
}, { | ||
createdAt: string; | ||
createdBy: string; | ||
createdByRole: string; | ||
registrationNumber: string; | ||
acceptedAt: string; | ||
createdAtLocation?: string | null | undefined; | ||
}>>>; | ||
}, "strip", z.ZodTypeAny, { | ||
DECLARED?: { | ||
createdAt: string; | ||
createdBy: string; | ||
createdByRole: string; | ||
acceptedAt: string; | ||
createdAtLocation?: string | null | undefined; | ||
} | null | undefined; | ||
REGISTERED?: { | ||
createdAt: string; | ||
createdBy: string; | ||
createdByRole: string; | ||
registrationNumber: string; | ||
acceptedAt: string; | ||
createdAtLocation?: string | null | undefined; | ||
} | null | undefined; | ||
}, { | ||
DECLARED?: { | ||
createdAt: string; | ||
createdBy: string; | ||
createdByRole: string; | ||
acceptedAt: string; | ||
createdAtLocation?: string | null | undefined; | ||
} | null | undefined; | ||
REGISTERED?: { | ||
createdAt: string; | ||
createdBy: string; | ||
createdByRole: string; | ||
registrationNumber: string; | ||
acceptedAt: string; | ||
createdAtLocation?: string | null | undefined; | ||
} | null | undefined; | ||
}>; | ||
/** | ||
@@ -48,11 +178,91 @@ * Event metadata exposed to client. | ||
}>; | ||
legalStatuses: z.ZodObject<{ | ||
DECLARED: z.ZodOptional<z.ZodNullable<z.ZodObject<{ | ||
createdAt: z.ZodString; | ||
createdBy: z.ZodString; | ||
createdAtLocation: z.ZodOptional<z.ZodNullable<z.ZodString>>; | ||
acceptedAt: z.ZodString; | ||
createdByRole: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
createdAt: string; | ||
createdBy: string; | ||
createdByRole: string; | ||
acceptedAt: string; | ||
createdAtLocation?: string | null | undefined; | ||
}, { | ||
createdAt: string; | ||
createdBy: string; | ||
createdByRole: string; | ||
acceptedAt: string; | ||
createdAtLocation?: string | null | undefined; | ||
}>>>; | ||
REGISTERED: z.ZodOptional<z.ZodNullable<z.ZodObject<z.objectUtil.extendShape<{ | ||
createdAt: z.ZodString; | ||
createdBy: z.ZodString; | ||
createdAtLocation: z.ZodOptional<z.ZodNullable<z.ZodString>>; | ||
acceptedAt: z.ZodString; | ||
createdByRole: z.ZodString; | ||
}, { | ||
registrationNumber: z.ZodString; | ||
}>, "strip", z.ZodTypeAny, { | ||
createdAt: string; | ||
createdBy: string; | ||
createdByRole: string; | ||
registrationNumber: string; | ||
acceptedAt: string; | ||
createdAtLocation?: string | null | undefined; | ||
}, { | ||
createdAt: string; | ||
createdBy: string; | ||
createdByRole: string; | ||
registrationNumber: string; | ||
acceptedAt: string; | ||
createdAtLocation?: string | null | undefined; | ||
}>>>; | ||
}, "strip", z.ZodTypeAny, { | ||
DECLARED?: { | ||
createdAt: string; | ||
createdBy: string; | ||
createdByRole: string; | ||
acceptedAt: string; | ||
createdAtLocation?: string | null | undefined; | ||
} | null | undefined; | ||
REGISTERED?: { | ||
createdAt: string; | ||
createdBy: string; | ||
createdByRole: string; | ||
registrationNumber: string; | ||
acceptedAt: string; | ||
createdAtLocation?: string | null | undefined; | ||
} | null | undefined; | ||
}, { | ||
DECLARED?: { | ||
createdAt: string; | ||
createdBy: string; | ||
createdByRole: string; | ||
acceptedAt: string; | ||
createdAtLocation?: string | null | undefined; | ||
} | null | undefined; | ||
REGISTERED?: { | ||
createdAt: string; | ||
createdBy: string; | ||
createdByRole: string; | ||
registrationNumber: string; | ||
acceptedAt: string; | ||
createdAtLocation?: string | null | undefined; | ||
} | null | undefined; | ||
}>; | ||
createdAt: z.ZodString; | ||
dateOfEvent: z.ZodOptional<z.ZodNullable<z.ZodString>>; | ||
createdBy: z.ZodString; | ||
createdAtLocation: z.ZodString; | ||
updatedAtLocation: z.ZodString; | ||
modifiedAt: z.ZodString; | ||
updatedByUserRole: z.ZodString; | ||
createdAtLocation: z.ZodOptional<z.ZodNullable<z.ZodString>>; | ||
updatedAtLocation: z.ZodOptional<z.ZodNullable<z.ZodString>>; | ||
updatedAt: z.ZodString; | ||
assignedTo: z.ZodOptional<z.ZodNullable<z.ZodString>>; | ||
updatedBy: z.ZodString; | ||
updatedBy: z.ZodOptional<z.ZodNullable<z.ZodString>>; | ||
trackingId: z.ZodString; | ||
registrationNumber: z.ZodOptional<z.ZodNullable<z.ZodString>>; | ||
flags: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNativeEnum<{ | ||
readonly CERTIFICATE_PRINTED: "certificate-printed"; | ||
}>]>, "many">; | ||
}, "strip", z.ZodTypeAny, { | ||
@@ -64,9 +274,28 @@ type: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
updatedAtLocation: string; | ||
updatedAt: string; | ||
trackingId: string; | ||
modifiedAt: string; | ||
updatedBy: string; | ||
legalStatuses: { | ||
DECLARED?: { | ||
createdAt: string; | ||
createdBy: string; | ||
createdByRole: string; | ||
acceptedAt: string; | ||
createdAtLocation?: string | null | undefined; | ||
} | null | undefined; | ||
REGISTERED?: { | ||
createdAt: string; | ||
createdBy: string; | ||
createdByRole: string; | ||
registrationNumber: string; | ||
acceptedAt: string; | ||
createdAtLocation?: string | null | undefined; | ||
} | null | undefined; | ||
}; | ||
updatedByUserRole: string; | ||
flags: string[]; | ||
createdAtLocation?: string | null | undefined; | ||
assignedTo?: string | null | undefined; | ||
registrationNumber?: string | null | undefined; | ||
dateOfEvent?: string | null | undefined; | ||
updatedAtLocation?: string | null | undefined; | ||
updatedBy?: string | null | undefined; | ||
}, { | ||
@@ -78,13 +307,44 @@ type: string; | ||
createdBy: string; | ||
createdAtLocation: string; | ||
updatedAtLocation: string; | ||
updatedAt: string; | ||
trackingId: string; | ||
modifiedAt: string; | ||
updatedBy: string; | ||
legalStatuses: { | ||
DECLARED?: { | ||
createdAt: string; | ||
createdBy: string; | ||
createdByRole: string; | ||
acceptedAt: string; | ||
createdAtLocation?: string | null | undefined; | ||
} | null | undefined; | ||
REGISTERED?: { | ||
createdAt: string; | ||
createdBy: string; | ||
createdByRole: string; | ||
registrationNumber: string; | ||
acceptedAt: string; | ||
createdAtLocation?: string | null | undefined; | ||
} | null | undefined; | ||
}; | ||
updatedByUserRole: string; | ||
flags: string[]; | ||
createdAtLocation?: string | null | undefined; | ||
assignedTo?: string | null | undefined; | ||
registrationNumber?: string | null | undefined; | ||
dateOfEvent?: string | null | undefined; | ||
updatedAtLocation?: string | null | undefined; | ||
updatedBy?: string | null | undefined; | ||
}>; | ||
export type EventMetadata = z.infer<typeof EventMetadata>; | ||
export type EventMetadataKeys = `event.${keyof EventMetadata}`; | ||
export declare const EventMetadataKeys: z.ZodEnum<["id", "type", "status", "createdAt", "dateOfEvent", "createdBy", "updatedByUserRole", "createdAtLocation", "updatedAtLocation", "updatedAt", "assignedTo", "updatedBy", "trackingId", "legalStatuses", "flags"]>; | ||
export type EventMetadataKeys = z.infer<typeof EventMetadataKeys>; | ||
/** | ||
* This ensures `event.field()` takes a key from `EventMetadata` | ||
*/ | ||
export declare const EventMetadataParameter: z.ZodObject<{ | ||
$event: z.ZodEnum<["id", "type", "status", "createdAt", "dateOfEvent", "createdBy", "updatedByUserRole", "createdAtLocation", "updatedAtLocation", "updatedAt", "assignedTo", "updatedBy", "trackingId", "legalStatuses", "flags"]>; | ||
}, "strip", z.ZodTypeAny, { | ||
$event: "type" | "id" | "status" | "createdAt" | "createdBy" | "createdAtLocation" | "assignedTo" | "dateOfEvent" | "updatedAt" | "trackingId" | "legalStatuses" | "updatedByUserRole" | "updatedAtLocation" | "updatedBy" | "flags"; | ||
}, { | ||
$event: "type" | "id" | "status" | "createdAt" | "createdBy" | "createdAtLocation" | "assignedTo" | "dateOfEvent" | "updatedAt" | "trackingId" | "legalStatuses" | "updatedByUserRole" | "updatedAtLocation" | "updatedBy" | "flags"; | ||
}>; | ||
export type EventMetadataParameter = z.infer<typeof EventMetadataParameter>; | ||
/** | ||
* Mapping of event metadata keys to translation configuration. | ||
@@ -94,3 +354,3 @@ * Consider introducing type in same manner as we have in FieldConfig. | ||
*/ | ||
export declare const eventMetadataLabelMap: Record<EventMetadataKeys, TranslationConfig>; | ||
export declare const eventMetadataLabelMap: Record<Exclude<`event.${EventMetadataKeys}`, 'event.legalStatuses'>, TranslationConfig>; | ||
//# sourceMappingURL=EventMetadata.d.ts.map |
@@ -8,2 +8,3 @@ export declare const FieldType: { | ||
readonly DATE: "DATE"; | ||
readonly DATE_RANGE: "DATE_RANGE"; | ||
readonly PARAGRAPH: "PARAGRAPH"; | ||
@@ -14,3 +15,2 @@ readonly PAGE_HEADER: "PAGE_HEADER"; | ||
readonly FILE_WITH_OPTIONS: "FILE_WITH_OPTIONS"; | ||
readonly HIDDEN: "HIDDEN"; | ||
readonly BULLET_LIST: "BULLET_LIST"; | ||
@@ -28,3 +28,3 @@ readonly CHECKBOX: "CHECKBOX"; | ||
}; | ||
export declare const fieldTypes: ("ADDRESS" | "TEXT" | "NUMBER" | "TEXTAREA" | "EMAIL" | "DATE" | "PARAGRAPH" | "PAGE_HEADER" | "RADIO_GROUP" | "FILE" | "FILE_WITH_OPTIONS" | "HIDDEN" | "BULLET_LIST" | "CHECKBOX" | "SELECT" | "COUNTRY" | "LOCATION" | "DIVIDER" | "ADMINISTRATIVE_AREA" | "FACILITY" | "OFFICE" | "SIGNATURE" | "DATA")[]; | ||
export declare const fieldTypes: ("ADDRESS" | "TEXT" | "NUMBER" | "TEXTAREA" | "EMAIL" | "DATE" | "DATE_RANGE" | "PARAGRAPH" | "PAGE_HEADER" | "RADIO_GROUP" | "FILE" | "FILE_WITH_OPTIONS" | "BULLET_LIST" | "CHECKBOX" | "SELECT" | "COUNTRY" | "LOCATION" | "DIVIDER" | "ADMINISTRATIVE_AREA" | "FACILITY" | "OFFICE" | "SIGNATURE" | "DATA")[]; | ||
export type FieldType = (typeof fieldTypes)[number]; | ||
@@ -34,3 +34,3 @@ /** | ||
*/ | ||
export declare const compositeFieldTypes: ("ADDRESS" | "FILE" | "FILE_WITH_OPTIONS")[]; | ||
export declare const compositeFieldTypes: ("ADDRESS" | "DATE_RANGE" | "FILE" | "FILE_WITH_OPTIONS")[]; | ||
//# sourceMappingURL=FieldType.d.ts.map |
@@ -161,3 +161,3 @@ import { z } from 'zod'; | ||
originalFilename: string; | ||
}>, "many">>> | z.ZodBoolean | z.ZodOptional<z.ZodNullable<z.ZodBoolean>> | z.ZodNumber | z.ZodOptional<z.ZodNullable<z.ZodNumber>> | z.ZodUndefined | z.ZodOptional<z.ZodNullable<z.ZodUndefined>> | z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodDiscriminatedUnion<"urbanOrRural", [z.ZodObject<z.objectUtil.extendShape<{ | ||
}>, "many">>> | z.ZodUnion<[z.ZodString, z.ZodTuple<[z.ZodString, z.ZodString], null>]> | z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodString, z.ZodTuple<[z.ZodString, z.ZodString], null>]>>> | z.ZodBoolean | z.ZodOptional<z.ZodNullable<z.ZodBoolean>> | z.ZodNumber | z.ZodOptional<z.ZodNullable<z.ZodNumber>> | z.ZodUndefined | z.ZodOptional<z.ZodNullable<z.ZodUndefined>> | z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodDiscriminatedUnion<"urbanOrRural", [z.ZodObject<z.objectUtil.extendShape<{ | ||
country: z.ZodString; | ||
@@ -287,3 +287,3 @@ addressType: z.ZodLiteral<"DOMESTIC">; | ||
originalFilename: string; | ||
}[] | null | undefined; | ||
}[] | [string, string] | null | undefined; | ||
}, { | ||
@@ -327,3 +327,3 @@ [x: string]: string | number | boolean | { | ||
originalFilename: string; | ||
}[] | null | undefined; | ||
}[] | [string, string] | null | undefined; | ||
}>; | ||
@@ -333,3 +333,3 @@ /** | ||
*/ | ||
export declare function mapFieldTypeToMockValue(field: FieldConfig, i: number): string | true | 19 | { | ||
export declare function mapFieldTypeToMockValue(field: FieldConfig, i: number): string | true | string[] | 19 | { | ||
country: string; | ||
@@ -423,2 +423,9 @@ addressType: "DOMESTIC"; | ||
}; | ||
export declare const isDateRangeFieldType: (field: { | ||
config: FieldConfig; | ||
value: FieldValue; | ||
}) => field is { | ||
value: string; | ||
config: DateField; | ||
}; | ||
export declare const isPageHeaderFieldType: (field: { | ||
@@ -425,0 +432,0 @@ config: FieldConfig; |
@@ -16,4 +16,7 @@ import { z } from 'zod'; | ||
export declare const TextValue: z.ZodString; | ||
export declare const RequiredTextValue: z.ZodString; | ||
export declare const NonEmptyTextValue: z.ZodString; | ||
export declare const DateValue: z.ZodString; | ||
export declare const DatetimeValue: z.ZodString; | ||
export declare const DateRangeFieldValue: z.ZodUnion<[z.ZodString, z.ZodTuple<[z.ZodString, z.ZodString], null>]>; | ||
export type DateRangeFieldValue = z.infer<typeof DateRangeFieldValue>; | ||
export declare const EmailValue: z.ZodString; | ||
@@ -26,3 +29,3 @@ export declare const CheckboxFieldValue: z.ZodBoolean; | ||
export type DataFieldValue = z.infer<typeof DataFieldValue>; | ||
export declare const FieldValue: z.ZodUnion<[z.ZodString, z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodObject<{ | ||
export declare const FieldValue: z.ZodUnion<[z.ZodString, z.ZodString, z.ZodUnion<[z.ZodString, z.ZodTuple<[z.ZodString, z.ZodString], null>]>, z.ZodBoolean, z.ZodNumber, z.ZodObject<{ | ||
filename: z.ZodString; | ||
@@ -142,3 +145,3 @@ originalFilename: z.ZodString; | ||
export type FieldValue = z.infer<typeof FieldValue>; | ||
export declare const FieldUpdateValue: z.ZodUnion<[z.ZodString, z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodObject<{ | ||
export declare const FieldUpdateValue: z.ZodUnion<[z.ZodString, z.ZodString, z.ZodUnion<[z.ZodString, z.ZodTuple<[z.ZodString, z.ZodString], null>]>, z.ZodBoolean, z.ZodNumber, z.ZodObject<{ | ||
filename: z.ZodString; | ||
@@ -267,3 +270,3 @@ originalFilename: z.ZodString; | ||
* */ | ||
export type FieldUpdateValueSchema = typeof FileFieldValue | typeof FileFieldWithOptionValue | typeof CheckboxFieldValue | typeof AddressFieldUpdateValue | typeof NumberFieldValue | typeof DataFieldValue | z.ZodString | z.ZodBoolean; | ||
export type FieldUpdateValueSchema = typeof DateRangeFieldValue | typeof FileFieldValue | typeof FileFieldWithOptionValue | typeof CheckboxFieldValue | typeof AddressFieldUpdateValue | typeof NumberFieldValue | typeof DataFieldValue | z.ZodString | z.ZodBoolean; | ||
//# sourceMappingURL=FieldValue.d.ts.map |
@@ -36,2 +36,4 @@ export * from './ActionConfig'; | ||
export * from '../conditionals/validate'; | ||
export * from './field'; | ||
export * from './event'; | ||
//# sourceMappingURL=index.d.ts.map |
import { Scope } from '../scopes'; | ||
import { ActionType } from './ActionType'; | ||
export declare function hasAnyOfScopes(a: Scope[], b: Scope[]): boolean; | ||
export declare const CONFIG_GET_ALLOWED_SCOPES: ["record.declare-birth", "record.read", "record.declaration-submit-incomplete", "record.declaration-submit-for-review", "record.register", "record.export-records", "config", "config.update:all"]; | ||
export declare const CONFIG_SEARCH_ALLOWED_SCOPES: ("search.birth:my-jurisdiction" | "search.birth" | "search.death:my-jurisdiction" | "search.death" | "search.marriage:my-jurisdiction" | "search.marriage")[]; | ||
export declare const ACTION_ALLOWED_SCOPES: { | ||
@@ -24,3 +24,23 @@ READ: ["record.declare-birth", "record.read", "record.declaration-submit-incomplete", "record.declaration-submit-for-review", "record.register", "record.export-records"]; | ||
}; | ||
export declare const ACTION_ALLOWED_CONFIGURABLE_SCOPES: { | ||
READ: never[]; | ||
CREATE: "record.notify"[]; | ||
NOTIFY: "record.notify"[]; | ||
DECLARE: never[]; | ||
DELETE: never[]; | ||
VALIDATE: never[]; | ||
REGISTER: never[]; | ||
PRINT_CERTIFICATE: never[]; | ||
REQUEST_CORRECTION: never[]; | ||
REJECT_CORRECTION: never[]; | ||
APPROVE_CORRECTION: never[]; | ||
MARKED_AS_DUPLICATE: never[]; | ||
ARCHIVE: never[]; | ||
REJECT: never[]; | ||
ASSIGN: never[]; | ||
UNASSIGN: never[]; | ||
DETECT_DUPLICATE: never[]; | ||
}; | ||
export declare function hasAnyOfScopes(a: Scope[], b: Scope[]): boolean; | ||
export declare function filterUnallowedActions(actions: ActionType[], userScopes: Scope[]): ActionType[]; | ||
//# sourceMappingURL=scopes.d.ts.map |
import { z } from 'zod'; | ||
import { TranslationConfig } from './TranslationConfig'; | ||
export declare const SummaryConfig: z.ZodObject<{ | ||
title: z.ZodObject<{ | ||
id: z.ZodString; | ||
label: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
}>; | ||
emptyValueMessage: z.ZodOptional<z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
}>>; | ||
}, "strip", z.ZodTypeAny, { | ||
id: string; | ||
label: TranslationConfig; | ||
emptyValueMessage?: TranslationConfig | undefined; | ||
}, { | ||
id: string; | ||
label: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
}; | ||
emptyValueMessage?: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
} | undefined; | ||
}>; | ||
fields: z.ZodArray<z.ZodUnion<[z.ZodObject<z.objectUtil.extendShape<{ | ||
@@ -114,2 +85,7 @@ emptyValueMessage: z.ZodOptional<z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, { | ||
fieldId: z.ZodString; | ||
label: z.ZodOptional<z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
}>>; | ||
}>, "strip", z.ZodTypeAny, { | ||
@@ -121,2 +97,3 @@ fieldId: string; | ||
}[] | undefined; | ||
label?: TranslationConfig | undefined; | ||
emptyValueMessage?: TranslationConfig | undefined; | ||
@@ -129,2 +106,7 @@ }, { | ||
}[] | undefined; | ||
label?: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
} | undefined; | ||
emptyValueMessage?: { | ||
@@ -137,7 +119,2 @@ id: string; | ||
}, "strip", z.ZodTypeAny, { | ||
title: { | ||
id: string; | ||
label: TranslationConfig; | ||
emptyValueMessage?: TranslationConfig | undefined; | ||
}; | ||
fields: ({ | ||
@@ -149,2 +126,3 @@ fieldId: string; | ||
}[] | undefined; | ||
label?: TranslationConfig | undefined; | ||
emptyValueMessage?: TranslationConfig | undefined; | ||
@@ -162,15 +140,2 @@ } | { | ||
}, { | ||
title: { | ||
id: string; | ||
label: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
}; | ||
emptyValueMessage?: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
} | undefined; | ||
}; | ||
fields: ({ | ||
@@ -182,2 +147,7 @@ fieldId: string; | ||
}[] | undefined; | ||
label?: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
} | undefined; | ||
emptyValueMessage?: { | ||
@@ -184,0 +154,0 @@ id: string; |
@@ -1,2 +0,2 @@ | ||
import { ActionDocument, ActionUpdate } from './ActionDocument'; | ||
import { ActionDocument, ActionUpdate, EventState } from './ActionDocument'; | ||
import { ArchiveActionInput, AssignActionInput, DeclareActionInput, RegisterActionInput, RejectDeclarationActionInput, RequestCorrectionActionInput, UnassignActionInput, ValidateActionInput } from './ActionInput'; | ||
@@ -9,42 +9,4 @@ import { ActionType } from './ActionType'; | ||
import { EventInput } from './EventInput'; | ||
import { FieldValue } from './FieldValue'; | ||
import { TranslationConfig } from './TranslationConfig'; | ||
export declare function generateActionDeclarationInput(configuration: EventConfig, action: ActionType): import("lodash").Dictionary<string | number | boolean | { | ||
type: string; | ||
filename: string; | ||
originalFilename: string; | ||
} | { | ||
country: string; | ||
district: string; | ||
addressType: "DOMESTIC"; | ||
province: string; | ||
urbanOrRural: "URBAN"; | ||
number?: string | undefined; | ||
town?: string | undefined; | ||
residentialArea?: string | undefined; | ||
street?: string | undefined; | ||
zipCode?: string | undefined; | ||
} | { | ||
country: string; | ||
district: string; | ||
addressType: "DOMESTIC"; | ||
province: string; | ||
urbanOrRural: "RURAL"; | ||
village?: string | undefined; | ||
} | { | ||
country: string; | ||
state: string; | ||
addressType: "INTERNATIONAL"; | ||
district2: string; | ||
cityOrTown?: string | undefined; | ||
addressLine1?: string | undefined; | ||
addressLine2?: string | undefined; | ||
addressLine3?: string | undefined; | ||
postcodeOrZip?: string | undefined; | ||
} | { | ||
type: string; | ||
option: string; | ||
filename: string; | ||
originalFilename: string; | ||
}[] | undefined>; | ||
export declare function generateActionDeclarationInput(configuration: EventConfig, action: ActionType): EventState; | ||
export declare function generateActionAnnotationInput(configuration: EventConfig, action: ActionType): {}; | ||
@@ -106,3 +68,3 @@ export declare const eventPayloadGenerator: { | ||
originalFilename: string; | ||
}[] | undefined>; | ||
}[] | [string, string] | undefined>; | ||
annotation: {}; | ||
@@ -157,3 +119,3 @@ eventId: string; | ||
originalFilename: string; | ||
}[] | undefined>>; | ||
}[] | [string, string] | undefined>>; | ||
eventId: string; | ||
@@ -201,3 +163,3 @@ }; | ||
originalFilename: string; | ||
}[] | undefined>; | ||
}[] | [string, string] | undefined>; | ||
annotation: {}; | ||
@@ -225,7 +187,9 @@ duplicates: never[]; | ||
declaration: {}; | ||
annotation: { | ||
annotation: {}; | ||
duplicates: never[]; | ||
eventId: string; | ||
reason: { | ||
message: string; | ||
isDuplicate: boolean; | ||
}; | ||
duplicates: never[]; | ||
eventId: string; | ||
}; | ||
@@ -239,2 +203,5 @@ reject: (eventId: string, input?: Partial<Pick<RejectDeclarationActionInput, "transactionId" | "annotation">>) => { | ||
eventId: string; | ||
reason: { | ||
message: string; | ||
}; | ||
}; | ||
@@ -281,3 +248,3 @@ register: (eventId: string, input?: Partial<Pick<RegisterActionInput, "transactionId" | "declaration" | "annotation">>) => { | ||
originalFilename: string; | ||
}[] | undefined>; | ||
}[] | [string, string] | undefined>; | ||
annotation: {}; | ||
@@ -334,3 +301,3 @@ eventId: string; | ||
originalFilename: string; | ||
}[] | undefined>; | ||
}[] | [string, string] | undefined>; | ||
annotation: {}; | ||
@@ -367,5 +334,6 @@ eventId: string; | ||
}): EventDocument; | ||
export declare function generateEventDraftDocument(eventId: string, actionType?: ActionType, declaration?: Record<string, FieldValue>): Draft; | ||
export declare const eventQueryDataGenerator: (overrides?: Partial<EventIndex>) => EventIndex; | ||
export declare function generateEventDraftDocument(eventId: string, actionType?: ActionType, declaration?: EventState): Draft; | ||
export declare function getRandomDatetime(rng: () => number, start: Date, end: Date): string; | ||
export declare const eventQueryDataGenerator: (overrides?: Partial<EventIndex>, seed?: number) => EventIndex; | ||
export declare const generateTranslationConfig: (message: string) => TranslationConfig; | ||
//# sourceMappingURL=test.utils.d.ts.map |
@@ -13,7 +13,502 @@ import { z } from 'zod'; | ||
}>; | ||
/** | ||
* Placeholder untill the following gets merged to develop | ||
* https://github.com/opencrvs/opencrvs-core/blob/5fbe9854a88504a7a13fcc856b3e82594b70c38c/packages/commons/src/events/EventIndex.ts#L92-L93 | ||
*/ | ||
query: z.ZodString; | ||
query: z.ZodObject<{ | ||
type: z.ZodUnion<[z.ZodLiteral<"and">, z.ZodLiteral<"or">]>; | ||
clauses: z.ZodEffects<z.ZodArray<z.ZodObject<{ | ||
eventType: z.ZodOptional<z.ZodString>; | ||
status: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodObject<{ | ||
type: z.ZodLiteral<"anyOf">; | ||
terms: z.ZodArray<z.ZodEnum<["CREATED", "NOTIFIED", "DECLARED", "VALIDATED", "REGISTERED", "CERTIFIED", "REJECTED", "ARCHIVED"]>, "many">; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "anyOf"; | ||
terms: ("ARCHIVED" | "CERTIFIED" | "DECLARED" | "REGISTERED" | "REJECTED" | "VALIDATED" | "CREATED" | "NOTIFIED")[]; | ||
}, { | ||
type: "anyOf"; | ||
terms: ("ARCHIVED" | "CERTIFIED" | "DECLARED" | "REGISTERED" | "REJECTED" | "VALIDATED" | "CREATED" | "NOTIFIED")[]; | ||
}>, z.ZodObject<{ | ||
type: z.ZodLiteral<"exact">; | ||
term: z.ZodEnum<["CREATED", "NOTIFIED", "DECLARED", "VALIDATED", "REGISTERED", "CERTIFIED", "REJECTED", "ARCHIVED"]>; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "exact"; | ||
term: "ARCHIVED" | "CERTIFIED" | "DECLARED" | "REGISTERED" | "REJECTED" | "VALIDATED" | "CREATED" | "NOTIFIED"; | ||
}, { | ||
type: "exact"; | ||
term: "ARCHIVED" | "CERTIFIED" | "DECLARED" | "REGISTERED" | "REJECTED" | "VALIDATED" | "CREATED" | "NOTIFIED"; | ||
}>]>>>; | ||
createdAt: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodObject<{ | ||
type: z.ZodLiteral<"exact">; | ||
term: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "exact"; | ||
term: string; | ||
}, { | ||
type: "exact"; | ||
term: string; | ||
}>, z.ZodObject<{ | ||
type: z.ZodLiteral<"range">; | ||
gte: z.ZodString; | ||
lte: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "range"; | ||
gte: string; | ||
lte: string; | ||
}, { | ||
type: "range"; | ||
gte: string; | ||
lte: string; | ||
}>]>>>; | ||
updatedAt: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodObject<{ | ||
type: z.ZodLiteral<"exact">; | ||
term: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "exact"; | ||
term: string; | ||
}, { | ||
type: "exact"; | ||
term: string; | ||
}>, z.ZodObject<{ | ||
type: z.ZodLiteral<"range">; | ||
gte: z.ZodString; | ||
lte: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "range"; | ||
gte: string; | ||
lte: string; | ||
}, { | ||
type: "range"; | ||
gte: string; | ||
lte: string; | ||
}>]>>>; | ||
'legalStatus.REGISTERED.createdAt': z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodObject<{ | ||
type: z.ZodLiteral<"exact">; | ||
term: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "exact"; | ||
term: string; | ||
}, { | ||
type: "exact"; | ||
term: string; | ||
}>, z.ZodObject<{ | ||
type: z.ZodLiteral<"range">; | ||
gte: z.ZodString; | ||
lte: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "range"; | ||
gte: string; | ||
lte: string; | ||
}, { | ||
type: "range"; | ||
gte: string; | ||
lte: string; | ||
}>]>>>; | ||
'legalStatus.REGISTERED.createdAtLocation': z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodObject<{ | ||
type: z.ZodLiteral<"within">; | ||
location: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "within"; | ||
location: string; | ||
}, { | ||
type: "within"; | ||
location: string; | ||
}>, z.ZodObject<{ | ||
type: z.ZodLiteral<"exact">; | ||
term: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "exact"; | ||
term: string; | ||
}, { | ||
type: "exact"; | ||
term: string; | ||
}>]>>>; | ||
createAtLocation: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodObject<{ | ||
type: z.ZodLiteral<"within">; | ||
location: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "within"; | ||
location: string; | ||
}, { | ||
type: "within"; | ||
location: string; | ||
}>, z.ZodObject<{ | ||
type: z.ZodLiteral<"exact">; | ||
term: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "exact"; | ||
term: string; | ||
}, { | ||
type: "exact"; | ||
term: string; | ||
}>]>>>; | ||
updatedAtLocation: z.ZodOptional<z.ZodOptional<z.ZodUnion<[z.ZodObject<{ | ||
type: z.ZodLiteral<"within">; | ||
location: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "within"; | ||
location: string; | ||
}, { | ||
type: "within"; | ||
location: string; | ||
}>, z.ZodObject<{ | ||
type: z.ZodLiteral<"exact">; | ||
term: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "exact"; | ||
term: string; | ||
}, { | ||
type: "exact"; | ||
term: string; | ||
}>]>>>; | ||
createdBy: z.ZodOptional<z.ZodOptional<z.ZodObject<{ | ||
type: z.ZodLiteral<"exact">; | ||
term: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "exact"; | ||
term: string; | ||
}, { | ||
type: "exact"; | ||
term: string; | ||
}>>>; | ||
updatedBy: z.ZodOptional<z.ZodOptional<z.ZodObject<{ | ||
type: z.ZodLiteral<"exact">; | ||
term: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "exact"; | ||
term: string; | ||
}, { | ||
type: "exact"; | ||
term: string; | ||
}>>>; | ||
trackingId: z.ZodOptional<z.ZodOptional<z.ZodObject<{ | ||
type: z.ZodLiteral<"exact">; | ||
term: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "exact"; | ||
term: string; | ||
}, { | ||
type: "exact"; | ||
term: string; | ||
}>>>; | ||
flags: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodObject<{ | ||
type: z.ZodLiteral<"anyOf">; | ||
terms: z.ZodArray<z.ZodString, "many">; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "anyOf"; | ||
terms: string[]; | ||
}, { | ||
type: "anyOf"; | ||
terms: string[]; | ||
}>, z.ZodObject<{ | ||
type: z.ZodLiteral<"not">; | ||
term: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "not"; | ||
term: string; | ||
}, { | ||
type: "not"; | ||
term: string; | ||
}>]>, "many">>>; | ||
data: z.ZodOptional<z.ZodType<any, z.ZodTypeDef, any>>; | ||
}, "strip", z.ZodTypeAny, { | ||
status?: { | ||
type: "exact"; | ||
term: "ARCHIVED" | "CERTIFIED" | "DECLARED" | "REGISTERED" | "REJECTED" | "VALIDATED" | "CREATED" | "NOTIFIED"; | ||
} | { | ||
type: "anyOf"; | ||
terms: ("ARCHIVED" | "CERTIFIED" | "DECLARED" | "REGISTERED" | "REJECTED" | "VALIDATED" | "CREATED" | "NOTIFIED")[]; | ||
} | undefined; | ||
data?: any; | ||
createdAt?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "range"; | ||
gte: string; | ||
lte: string; | ||
} | undefined; | ||
createdBy?: { | ||
type: "exact"; | ||
term: string; | ||
} | undefined; | ||
updatedAt?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "range"; | ||
gte: string; | ||
lte: string; | ||
} | undefined; | ||
trackingId?: { | ||
type: "exact"; | ||
term: string; | ||
} | undefined; | ||
eventType?: string | undefined; | ||
'legalStatus.REGISTERED.createdAt'?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "range"; | ||
gte: string; | ||
lte: string; | ||
} | undefined; | ||
'legalStatus.REGISTERED.createdAtLocation'?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "within"; | ||
location: string; | ||
} | undefined; | ||
updatedAtLocation?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "within"; | ||
location: string; | ||
} | undefined; | ||
updatedBy?: { | ||
type: "exact"; | ||
term: string; | ||
} | undefined; | ||
flags?: ({ | ||
type: "anyOf"; | ||
terms: string[]; | ||
} | { | ||
type: "not"; | ||
term: string; | ||
})[] | undefined; | ||
createAtLocation?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "within"; | ||
location: string; | ||
} | undefined; | ||
}, { | ||
status?: { | ||
type: "exact"; | ||
term: "ARCHIVED" | "CERTIFIED" | "DECLARED" | "REGISTERED" | "REJECTED" | "VALIDATED" | "CREATED" | "NOTIFIED"; | ||
} | { | ||
type: "anyOf"; | ||
terms: ("ARCHIVED" | "CERTIFIED" | "DECLARED" | "REGISTERED" | "REJECTED" | "VALIDATED" | "CREATED" | "NOTIFIED")[]; | ||
} | undefined; | ||
data?: any; | ||
createdAt?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "range"; | ||
gte: string; | ||
lte: string; | ||
} | undefined; | ||
createdBy?: { | ||
type: "exact"; | ||
term: string; | ||
} | undefined; | ||
updatedAt?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "range"; | ||
gte: string; | ||
lte: string; | ||
} | undefined; | ||
trackingId?: { | ||
type: "exact"; | ||
term: string; | ||
} | undefined; | ||
eventType?: string | undefined; | ||
'legalStatus.REGISTERED.createdAt'?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "range"; | ||
gte: string; | ||
lte: string; | ||
} | undefined; | ||
'legalStatus.REGISTERED.createdAtLocation'?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "within"; | ||
location: string; | ||
} | undefined; | ||
updatedAtLocation?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "within"; | ||
location: string; | ||
} | undefined; | ||
updatedBy?: { | ||
type: "exact"; | ||
term: string; | ||
} | undefined; | ||
flags?: ({ | ||
type: "anyOf"; | ||
terms: string[]; | ||
} | { | ||
type: "not"; | ||
term: string; | ||
})[] | undefined; | ||
createAtLocation?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "within"; | ||
location: string; | ||
} | undefined; | ||
}>, "many">, { | ||
status?: { | ||
type: "exact"; | ||
term: "ARCHIVED" | "CERTIFIED" | "DECLARED" | "REGISTERED" | "REJECTED" | "VALIDATED" | "CREATED" | "NOTIFIED"; | ||
} | { | ||
type: "anyOf"; | ||
terms: ("ARCHIVED" | "CERTIFIED" | "DECLARED" | "REGISTERED" | "REJECTED" | "VALIDATED" | "CREATED" | "NOTIFIED")[]; | ||
} | undefined; | ||
data?: any; | ||
createdAt?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "range"; | ||
gte: string; | ||
lte: string; | ||
} | undefined; | ||
createdBy?: { | ||
type: "exact"; | ||
term: string; | ||
} | undefined; | ||
updatedAt?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "range"; | ||
gte: string; | ||
lte: string; | ||
} | undefined; | ||
trackingId?: { | ||
type: "exact"; | ||
term: string; | ||
} | undefined; | ||
eventType?: string | undefined; | ||
'legalStatus.REGISTERED.createdAt'?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "range"; | ||
gte: string; | ||
lte: string; | ||
} | undefined; | ||
'legalStatus.REGISTERED.createdAtLocation'?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "within"; | ||
location: string; | ||
} | undefined; | ||
updatedAtLocation?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "within"; | ||
location: string; | ||
} | undefined; | ||
updatedBy?: { | ||
type: "exact"; | ||
term: string; | ||
} | undefined; | ||
flags?: ({ | ||
type: "anyOf"; | ||
terms: string[]; | ||
} | { | ||
type: "not"; | ||
term: string; | ||
})[] | undefined; | ||
createAtLocation?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "within"; | ||
location: string; | ||
} | undefined; | ||
}[], unknown>; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "and" | "or"; | ||
clauses: { | ||
status?: { | ||
type: "exact"; | ||
term: "ARCHIVED" | "CERTIFIED" | "DECLARED" | "REGISTERED" | "REJECTED" | "VALIDATED" | "CREATED" | "NOTIFIED"; | ||
} | { | ||
type: "anyOf"; | ||
terms: ("ARCHIVED" | "CERTIFIED" | "DECLARED" | "REGISTERED" | "REJECTED" | "VALIDATED" | "CREATED" | "NOTIFIED")[]; | ||
} | undefined; | ||
data?: any; | ||
createdAt?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "range"; | ||
gte: string; | ||
lte: string; | ||
} | undefined; | ||
createdBy?: { | ||
type: "exact"; | ||
term: string; | ||
} | undefined; | ||
updatedAt?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "range"; | ||
gte: string; | ||
lte: string; | ||
} | undefined; | ||
trackingId?: { | ||
type: "exact"; | ||
term: string; | ||
} | undefined; | ||
eventType?: string | undefined; | ||
'legalStatus.REGISTERED.createdAt'?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "range"; | ||
gte: string; | ||
lte: string; | ||
} | undefined; | ||
'legalStatus.REGISTERED.createdAtLocation'?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "within"; | ||
location: string; | ||
} | undefined; | ||
updatedAtLocation?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "within"; | ||
location: string; | ||
} | undefined; | ||
updatedBy?: { | ||
type: "exact"; | ||
term: string; | ||
} | undefined; | ||
flags?: ({ | ||
type: "anyOf"; | ||
terms: string[]; | ||
} | { | ||
type: "not"; | ||
term: string; | ||
})[] | undefined; | ||
createAtLocation?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "within"; | ||
location: string; | ||
} | undefined; | ||
}[]; | ||
}, { | ||
type: "and" | "or"; | ||
clauses?: unknown; | ||
}>; | ||
actions: z.ZodArray<z.ZodObject<{ | ||
@@ -29,2 +524,30 @@ type: z.ZodString; | ||
}>, "many">; | ||
columns: z.ZodDefault<z.ZodArray<z.ZodObject<{ | ||
label: z.ZodObject<import("./TranslationConfig").MessageDescriptorZod, "strip", z.ZodTypeAny, TranslationConfig, { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
}>; | ||
value: z.ZodObject<{ | ||
$event: z.ZodEnum<["id", "type", "status", "createdAt", "dateOfEvent", "createdBy", "updatedByUserRole", "createdAtLocation", "updatedAtLocation", "updatedAt", "assignedTo", "updatedBy", "trackingId", "legalStatuses", "flags"]>; | ||
}, "strip", z.ZodTypeAny, { | ||
$event: "type" | "id" | "status" | "createdAt" | "createdBy" | "createdAtLocation" | "assignedTo" | "dateOfEvent" | "updatedAt" | "trackingId" | "legalStatuses" | "updatedByUserRole" | "updatedAtLocation" | "updatedBy" | "flags"; | ||
}, { | ||
$event: "type" | "id" | "status" | "createdAt" | "createdBy" | "createdAtLocation" | "assignedTo" | "dateOfEvent" | "updatedAt" | "trackingId" | "legalStatuses" | "updatedByUserRole" | "updatedAtLocation" | "updatedBy" | "flags"; | ||
}>; | ||
}, "strip", z.ZodTypeAny, { | ||
value: { | ||
$event: "type" | "id" | "status" | "createdAt" | "createdBy" | "createdAtLocation" | "assignedTo" | "dateOfEvent" | "updatedAt" | "trackingId" | "legalStatuses" | "updatedByUserRole" | "updatedAtLocation" | "updatedBy" | "flags"; | ||
}; | ||
label: TranslationConfig; | ||
}, { | ||
value: { | ||
$event: "type" | "id" | "status" | "createdAt" | "createdBy" | "createdAtLocation" | "assignedTo" | "dateOfEvent" | "updatedAt" | "trackingId" | "legalStatuses" | "updatedByUserRole" | "updatedAtLocation" | "updatedBy" | "flags"; | ||
}; | ||
label: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
}; | ||
}>, "many">>; | ||
}, "strip", z.ZodTypeAny, { | ||
@@ -36,4 +559,87 @@ name: TranslationConfig; | ||
}[]; | ||
query: string; | ||
query: { | ||
type: "and" | "or"; | ||
clauses: { | ||
status?: { | ||
type: "exact"; | ||
term: "ARCHIVED" | "CERTIFIED" | "DECLARED" | "REGISTERED" | "REJECTED" | "VALIDATED" | "CREATED" | "NOTIFIED"; | ||
} | { | ||
type: "anyOf"; | ||
terms: ("ARCHIVED" | "CERTIFIED" | "DECLARED" | "REGISTERED" | "REJECTED" | "VALIDATED" | "CREATED" | "NOTIFIED")[]; | ||
} | undefined; | ||
data?: any; | ||
createdAt?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "range"; | ||
gte: string; | ||
lte: string; | ||
} | undefined; | ||
createdBy?: { | ||
type: "exact"; | ||
term: string; | ||
} | undefined; | ||
updatedAt?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "range"; | ||
gte: string; | ||
lte: string; | ||
} | undefined; | ||
trackingId?: { | ||
type: "exact"; | ||
term: string; | ||
} | undefined; | ||
eventType?: string | undefined; | ||
'legalStatus.REGISTERED.createdAt'?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "range"; | ||
gte: string; | ||
lte: string; | ||
} | undefined; | ||
'legalStatus.REGISTERED.createdAtLocation'?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "within"; | ||
location: string; | ||
} | undefined; | ||
updatedAtLocation?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "within"; | ||
location: string; | ||
} | undefined; | ||
updatedBy?: { | ||
type: "exact"; | ||
term: string; | ||
} | undefined; | ||
flags?: ({ | ||
type: "anyOf"; | ||
terms: string[]; | ||
} | { | ||
type: "not"; | ||
term: string; | ||
})[] | undefined; | ||
createAtLocation?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "within"; | ||
location: string; | ||
} | undefined; | ||
}[]; | ||
}; | ||
slug: string; | ||
columns: { | ||
value: { | ||
$event: "type" | "id" | "status" | "createdAt" | "createdBy" | "createdAtLocation" | "assignedTo" | "dateOfEvent" | "updatedAt" | "trackingId" | "legalStatuses" | "updatedByUserRole" | "updatedAtLocation" | "updatedBy" | "flags"; | ||
}; | ||
label: TranslationConfig; | ||
}[]; | ||
}, { | ||
@@ -49,4 +655,17 @@ name: { | ||
}[]; | ||
query: string; | ||
query: { | ||
type: "and" | "or"; | ||
clauses?: unknown; | ||
}; | ||
slug: string; | ||
columns?: { | ||
value: { | ||
$event: "type" | "id" | "status" | "createdAt" | "createdBy" | "createdAtLocation" | "assignedTo" | "dateOfEvent" | "updatedAt" | "trackingId" | "legalStatuses" | "updatedByUserRole" | "updatedAtLocation" | "updatedBy" | "flags"; | ||
}; | ||
label: { | ||
id: string; | ||
description: string; | ||
defaultMessage: string; | ||
}; | ||
}[] | undefined; | ||
}>; | ||
@@ -61,5 +680,88 @@ export type WorkqueueConfig = z.infer<typeof WorkqueueConfig>; | ||
}[]; | ||
query: string; | ||
query: { | ||
type: "and" | "or"; | ||
clauses: { | ||
status?: { | ||
type: "exact"; | ||
term: "ARCHIVED" | "CERTIFIED" | "DECLARED" | "REGISTERED" | "REJECTED" | "VALIDATED" | "CREATED" | "NOTIFIED"; | ||
} | { | ||
type: "anyOf"; | ||
terms: ("ARCHIVED" | "CERTIFIED" | "DECLARED" | "REGISTERED" | "REJECTED" | "VALIDATED" | "CREATED" | "NOTIFIED")[]; | ||
} | undefined; | ||
data?: any; | ||
createdAt?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "range"; | ||
gte: string; | ||
lte: string; | ||
} | undefined; | ||
createdBy?: { | ||
type: "exact"; | ||
term: string; | ||
} | undefined; | ||
updatedAt?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "range"; | ||
gte: string; | ||
lte: string; | ||
} | undefined; | ||
trackingId?: { | ||
type: "exact"; | ||
term: string; | ||
} | undefined; | ||
eventType?: string | undefined; | ||
'legalStatus.REGISTERED.createdAt'?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "range"; | ||
gte: string; | ||
lte: string; | ||
} | undefined; | ||
'legalStatus.REGISTERED.createdAtLocation'?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "within"; | ||
location: string; | ||
} | undefined; | ||
updatedAtLocation?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "within"; | ||
location: string; | ||
} | undefined; | ||
updatedBy?: { | ||
type: "exact"; | ||
term: string; | ||
} | undefined; | ||
flags?: ({ | ||
type: "anyOf"; | ||
terms: string[]; | ||
} | { | ||
type: "not"; | ||
term: string; | ||
})[] | undefined; | ||
createAtLocation?: { | ||
type: "exact"; | ||
term: string; | ||
} | { | ||
type: "within"; | ||
location: string; | ||
} | undefined; | ||
}[]; | ||
}; | ||
slug: string; | ||
columns: { | ||
value: { | ||
$event: "type" | "id" | "status" | "createdAt" | "createdBy" | "createdAtLocation" | "assignedTo" | "dateOfEvent" | "updatedAt" | "trackingId" | "legalStatuses" | "updatedByUserRole" | "updatedAtLocation" | "updatedBy" | "flags"; | ||
}; | ||
label: TranslationConfig; | ||
}[]; | ||
}[]; | ||
//# sourceMappingURL=WorkqueueConfig.d.ts.map |
@@ -25,6 +25,6 @@ "use strict"; | ||
and: () => and, | ||
createEventConditionals: () => createEventConditionals, | ||
createFieldConditionals: () => createFieldConditionals, | ||
defineConditional: () => defineConditional, | ||
defineFormConditional: () => defineFormConditional, | ||
event: () => event, | ||
field: () => field, | ||
never: () => never, | ||
@@ -99,28 +99,34 @@ not: () => not, | ||
}; | ||
var event = { | ||
hasAction: (action) => defineConditional({ | ||
type: "object", | ||
properties: { | ||
$event: { | ||
type: "object", | ||
properties: { | ||
actions: { | ||
type: "array", | ||
contains: { | ||
type: "object", | ||
properties: { | ||
type: { | ||
const: action | ||
} | ||
}, | ||
required: ["type"] | ||
function createEventConditionals() { | ||
return { | ||
/** | ||
* Checks if the event contains a specific action type. | ||
* @param action - The action type to check for. | ||
*/ | ||
hasAction: (action) => defineConditional({ | ||
type: "object", | ||
properties: { | ||
$event: { | ||
type: "object", | ||
properties: { | ||
actions: { | ||
type: "array", | ||
contains: { | ||
type: "object", | ||
properties: { | ||
type: { | ||
const: action | ||
} | ||
}, | ||
required: ["type"] | ||
} | ||
} | ||
} | ||
}, | ||
required: ["actions"] | ||
} | ||
}, | ||
required: ["$event"] | ||
}) | ||
}; | ||
}, | ||
required: ["actions"] | ||
} | ||
}, | ||
required: ["$event"] | ||
}) | ||
}; | ||
} | ||
function getDateFromNow(days) { | ||
@@ -146,3 +152,3 @@ return new Date(Date.now() - days * 24 * 60 * 60 * 1e3).toISOString().split("T")[0]; | ||
} | ||
function field(fieldId) { | ||
function createFieldConditionals(fieldId) { | ||
const getDateRange = (date, clause) => ({ | ||
@@ -160,6 +166,2 @@ type: "object", | ||
return { | ||
/** | ||
* @private Internal property used for field reference tracking. | ||
*/ | ||
_fieldId: fieldId, | ||
isAfter: () => ({ | ||
@@ -331,4 +333,5 @@ days: (days) => ({ | ||
required: [fieldId] | ||
}) | ||
}), | ||
getId: () => ({ fieldId }) | ||
}; | ||
} |
@@ -0,1 +1,2 @@ | ||
import { z } from 'zod'; | ||
export declare const SCOPES: { | ||
@@ -21,2 +22,3 @@ readonly NATLSYSADMIN: "natlsysadmin"; | ||
readonly RECORD_DECLARE: "record.declare-birth"; | ||
readonly RECORD_IMPORT: "record.import"; | ||
readonly RECORD_DECLARE_BIRTH: "record.declare-birth"; | ||
@@ -87,4 +89,159 @@ readonly RECORD_DECLARE_BIRTH_MY_JURISDICTION: "record.declare-birth:my-jurisdiction"; | ||
}; | ||
export type Scope = (typeof SCOPES)[keyof typeof SCOPES]; | ||
declare const LiteralScopes: z.ZodUnion<[z.ZodLiteral<"natlsysadmin">, z.ZodLiteral<"bypassratelimit">, z.ZodLiteral<"declare">, z.ZodLiteral<"register">, z.ZodLiteral<"validate">, z.ZodLiteral<"demo">, z.ZodLiteral<"certify">, z.ZodLiteral<"performance">, z.ZodLiteral<"sysadmin">, z.ZodLiteral<"teams">, z.ZodLiteral<"config">, z.ZodLiteral<"webhook">, z.ZodLiteral<"nationalId">, z.ZodLiteral<"notification-api">, z.ZodLiteral<"recordsearch">, z.ZodLiteral<"record.import">, z.ZodLiteral<"record.declare-birth">, z.ZodLiteral<"record.declare-birth:my-jurisdiction">, z.ZodLiteral<"record.declare-death">, z.ZodLiteral<"record.declare-death:my-jurisdiction">, z.ZodLiteral<"record.declare-marriage">, z.ZodLiteral<"record.declare-marriage:my-jurisdiction">, z.ZodLiteral<"record.declaration-submit-incomplete">, z.ZodLiteral<"record.declaration-submit-for-review">, z.ZodLiteral<"record.unassign-others">, z.ZodLiteral<"record.declaration-submit-for-approval">, z.ZodLiteral<"record.declaration-submit-for-updates">, z.ZodLiteral<"record.declaration-edit">, z.ZodLiteral<"record.review-duplicates">, z.ZodLiteral<"record.declaration-archive">, z.ZodLiteral<"record.declaration-reinstate">, z.ZodLiteral<"record.register">, z.ZodLiteral<"record.export-records">, z.ZodLiteral<"record.declaration-print">, z.ZodLiteral<"record.declaration-print-supporting-documents">, z.ZodLiteral<"record.registration-print">, z.ZodLiteral<"record.registration-print&issue-certified-copies">, z.ZodLiteral<"record.registration-print-certified-copies">, z.ZodLiteral<"record.registration-bulk-print-certified-copies">, z.ZodLiteral<"record.registration-verify-certified-copies">, z.ZodLiteral<"record.registration-request-correction">, z.ZodLiteral<"record.registration-correct">, z.ZodLiteral<"record.registration-request-revocation">, z.ZodLiteral<"record.registration-revoke">, z.ZodLiteral<"record.registration-request-reinstatement">, z.ZodLiteral<"record.registration-reinstate">, z.ZodLiteral<"record.confirm-registration">, z.ZodLiteral<"record.reject-registration">, z.ZodLiteral<"search.birth:my-jurisdiction">, z.ZodLiteral<"search.birth">, z.ZodLiteral<"search.death:my-jurisdiction">, z.ZodLiteral<"search.death">, z.ZodLiteral<"search.marriage:my-jurisdiction">, z.ZodLiteral<"search.marriage">, z.ZodLiteral<"record.read">, z.ZodLiteral<"record.read-audit">, z.ZodLiteral<"record.read-comments">, z.ZodLiteral<"record.create-comments">, z.ZodLiteral<"profile.update">, z.ZodLiteral<"profile.electronic-signature">, z.ZodLiteral<"performance.read">, z.ZodLiteral<"performance.read-dashboards">, z.ZodLiteral<"performance.vital-statistics-export">, z.ZodLiteral<"organisation.read-locations:all">, z.ZodLiteral<"organisation.read-locations:my-office">, z.ZodLiteral<"organisation.read-locations:my-jurisdiction">, z.ZodLiteral<"user.read:all">, z.ZodLiteral<"user.read:my-office">, z.ZodLiteral<"user.read:my-jurisdiction">, z.ZodLiteral<"user.read:only-my-audit">, z.ZodLiteral<"user.create:all">, z.ZodLiteral<"user.create:my-jurisdiction">, z.ZodLiteral<"user.update:all">, z.ZodLiteral<"user.update:my-jurisdiction">, z.ZodLiteral<"config.update:all">, z.ZodLiteral<"user.data-seeding">]>; | ||
declare const ConfigurableScopes: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{ | ||
type: z.ZodLiteral<"user.create">; | ||
options: z.ZodObject<{ | ||
role: z.ZodArray<z.ZodString, "many">; | ||
}, "strip", z.ZodTypeAny, { | ||
role: string[]; | ||
}, { | ||
role: string[]; | ||
}>; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "user.create"; | ||
options: { | ||
role: string[]; | ||
}; | ||
}, { | ||
type: "user.create"; | ||
options: { | ||
role: string[]; | ||
}; | ||
}>, z.ZodObject<{ | ||
type: z.ZodLiteral<"user.edit">; | ||
options: z.ZodObject<{ | ||
role: z.ZodArray<z.ZodString, "many">; | ||
}, "strip", z.ZodTypeAny, { | ||
role: string[]; | ||
}, { | ||
role: string[]; | ||
}>; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "user.edit"; | ||
options: { | ||
role: string[]; | ||
}; | ||
}, { | ||
type: "user.edit"; | ||
options: { | ||
role: string[]; | ||
}; | ||
}>, z.ZodObject<{ | ||
type: z.ZodLiteral<"workqueue">; | ||
options: z.ZodObject<{ | ||
id: z.ZodArray<z.ZodString, "many">; | ||
}, "strip", z.ZodTypeAny, { | ||
id: string[]; | ||
}, { | ||
id: string[]; | ||
}>; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "workqueue"; | ||
options: { | ||
id: string[]; | ||
}; | ||
}, { | ||
type: "workqueue"; | ||
options: { | ||
id: string[]; | ||
}; | ||
}>, z.ZodObject<{ | ||
type: z.ZodLiteral<"record.notify">; | ||
options: z.ZodObject<{ | ||
event: z.ZodArray<z.ZodString, "many">; | ||
}, "strip", z.ZodTypeAny, { | ||
event: string[]; | ||
}, { | ||
event: string[]; | ||
}>; | ||
}, "strip", z.ZodTypeAny, { | ||
type: "record.notify"; | ||
options: { | ||
event: string[]; | ||
}; | ||
}, { | ||
type: "record.notify"; | ||
options: { | ||
event: string[]; | ||
}; | ||
}>]>; | ||
export type ConfigurableScopeType = ConfigurableScopes['type']; | ||
export type ConfigurableScopes = z.infer<typeof ConfigurableScopes>; | ||
export declare function findScope<T extends ConfigurableScopeType>(scopes: string[], scopeType: T): Extract<{ | ||
type: "user.create"; | ||
options: { | ||
role: string[]; | ||
}; | ||
}, { | ||
type: T; | ||
}> | Extract<{ | ||
type: "user.edit"; | ||
options: { | ||
role: string[]; | ||
}; | ||
}, { | ||
type: T; | ||
}> | Extract<{ | ||
type: "workqueue"; | ||
options: { | ||
id: string[]; | ||
}; | ||
}, { | ||
type: T; | ||
}> | Extract<{ | ||
type: "record.notify"; | ||
options: { | ||
event: string[]; | ||
}; | ||
}, { | ||
type: T; | ||
}> | undefined; | ||
/** | ||
* Parses a configurable scope string into a ConfigurableScopes object. | ||
* @param {string} scope - The scope string to parse | ||
* @returns {ConfigurableScopes | undefined} The parsed scope object if valid, undefined otherwise | ||
* @example | ||
* parseScope("user.create[role=field-agent|registration-agent]") | ||
* // Returns: { type: "user.create", options: { role: ["field-agent", "registration-agent"] } } | ||
*/ | ||
export declare function parseScope(scope: string): { | ||
type: "user.create"; | ||
options: { | ||
role: string[]; | ||
}; | ||
} | { | ||
type: "user.edit"; | ||
options: { | ||
role: string[]; | ||
}; | ||
} | { | ||
type: "workqueue"; | ||
options: { | ||
id: string[]; | ||
}; | ||
} | { | ||
type: "record.notify"; | ||
options: { | ||
event: string[]; | ||
}; | ||
} | { | ||
type: "natlsysadmin" | "bypassratelimit" | "declare" | "register" | "validate" | "demo" | "certify" | "performance" | "sysadmin" | "teams" | "config" | "webhook" | "nationalId" | "notification-api" | "recordsearch" | "record.declare-birth" | "record.import" | "record.declare-birth:my-jurisdiction" | "record.declare-death" | "record.declare-death:my-jurisdiction" | "record.declare-marriage" | "record.declare-marriage:my-jurisdiction" | "record.declaration-submit-incomplete" | "record.declaration-submit-for-review" | "record.unassign-others" | "record.declaration-submit-for-approval" | "record.declaration-submit-for-updates" | "record.declaration-edit" | "record.review-duplicates" | "record.declaration-archive" | "record.declaration-reinstate" | "record.register" | "record.export-records" | "record.declaration-print" | "record.declaration-print-supporting-documents" | "record.registration-print" | "record.registration-print&issue-certified-copies" | "record.registration-print-certified-copies" | "record.registration-bulk-print-certified-copies" | "record.registration-verify-certified-copies" | "record.registration-request-correction" | "record.registration-correct" | "record.registration-request-revocation" | "record.registration-revoke" | "record.registration-request-reinstatement" | "record.registration-reinstate" | "record.confirm-registration" | "record.reject-registration" | "search.birth:my-jurisdiction" | "search.birth" | "search.death:my-jurisdiction" | "search.death" | "search.marriage:my-jurisdiction" | "search.marriage" | "record.read" | "record.read-audit" | "record.read-comments" | "record.create-comments" | "profile.update" | "profile.electronic-signature" | "performance.read" | "performance.read-dashboards" | "performance.vital-statistics-export" | "organisation.read-locations:all" | "organisation.read-locations:my-office" | "organisation.read-locations:my-jurisdiction" | "user.read:all" | "user.read:my-office" | "user.read:my-jurisdiction" | "user.read:only-my-audit" | "user.create:all" | "user.create:my-jurisdiction" | "user.update:all" | "user.update:my-jurisdiction" | "config.update:all" | "user.data-seeding"; | ||
} | undefined; | ||
/** | ||
* Stringifies a ConfigurableScopes object into a scope string. | ||
* @param {ConfigurableScopes} scope - The scope object to stringify | ||
* @returns {string} The stringified scope in format "type[key1=value1|value2,key2=value3|value4]" | ||
* @example | ||
* stringifyScope({ | ||
* type: "record.notify", | ||
* options: { event: ["v2.birth", "tennis-club-membership"] } | ||
* }) | ||
* // Returns: "record.notify[event=v2.birth|tennis-club-membership]" | ||
*/ | ||
export declare function stringifyScope(scope: ConfigurableScopes): string; | ||
export declare const scopes: Scope[]; | ||
export type ParsedScopes = NonNullable<ReturnType<typeof parseScope>>; | ||
export type RawScopes = z.infer<typeof LiteralScopes> | (string & {}); | ||
export type Scope = RawScopes; | ||
export {}; | ||
//# sourceMappingURL=scopes.d.ts.map |
@@ -24,3 +24,6 @@ "use strict"; | ||
SCOPES: () => SCOPES, | ||
scopes: () => scopes | ||
findScope: () => findScope, | ||
parseScope: () => parseScope, | ||
scopes: () => scopes, | ||
stringifyScope: () => stringifyScope | ||
}); | ||
@@ -30,2 +33,3 @@ module.exports = __toCommonJS(scopes_exports); | ||
// ../commons/src/scopes.ts | ||
var import_zod = require("zod"); | ||
var SCOPES = { | ||
@@ -54,2 +58,4 @@ // TODO v1.8 legacy scopes | ||
// declare | ||
RECORD_IMPORT: "record.import", | ||
// declare | ||
RECORD_DECLARE_BIRTH: "record.declare-birth", | ||
@@ -142,2 +148,147 @@ RECORD_DECLARE_BIRTH_MY_JURISDICTION: "record.declare-birth:my-jurisdiction", | ||
}; | ||
var LiteralScopes = import_zod.z.union([ | ||
import_zod.z.literal(SCOPES.NATLSYSADMIN), | ||
import_zod.z.literal(SCOPES.BYPASSRATELIMIT), | ||
import_zod.z.literal(SCOPES.DECLARE), | ||
import_zod.z.literal(SCOPES.REGISTER), | ||
import_zod.z.literal(SCOPES.VALIDATE), | ||
import_zod.z.literal(SCOPES.DEMO), | ||
import_zod.z.literal(SCOPES.CERTIFY), | ||
import_zod.z.literal(SCOPES.PERFORMANCE), | ||
import_zod.z.literal(SCOPES.SYSADMIN), | ||
import_zod.z.literal(SCOPES.TEAMS), | ||
import_zod.z.literal(SCOPES.CONFIG), | ||
import_zod.z.literal(SCOPES.WEBHOOK), | ||
import_zod.z.literal(SCOPES.NATIONALID), | ||
import_zod.z.literal(SCOPES.NOTIFICATION_API), | ||
import_zod.z.literal(SCOPES.RECORDSEARCH), | ||
import_zod.z.literal(SCOPES.RECORD_IMPORT), | ||
import_zod.z.literal(SCOPES.RECORD_DECLARE_BIRTH), | ||
import_zod.z.literal(SCOPES.RECORD_DECLARE_BIRTH_MY_JURISDICTION), | ||
import_zod.z.literal(SCOPES.RECORD_DECLARE_DEATH), | ||
import_zod.z.literal(SCOPES.RECORD_DECLARE_DEATH_MY_JURISDICTION), | ||
import_zod.z.literal(SCOPES.RECORD_DECLARE_MARRIAGE), | ||
import_zod.z.literal(SCOPES.RECORD_DECLARE_MARRIAGE_MY_JURISDICTION), | ||
import_zod.z.literal(SCOPES.RECORD_SUBMIT_INCOMPLETE), | ||
import_zod.z.literal(SCOPES.RECORD_SUBMIT_FOR_REVIEW), | ||
import_zod.z.literal(SCOPES.RECORD_UNASSIGN_OTHERS), | ||
import_zod.z.literal(SCOPES.RECORD_SUBMIT_FOR_APPROVAL), | ||
import_zod.z.literal(SCOPES.RECORD_SUBMIT_FOR_UPDATES), | ||
import_zod.z.literal(SCOPES.RECORD_DECLARATION_EDIT), | ||
import_zod.z.literal(SCOPES.RECORD_REVIEW_DUPLICATES), | ||
import_zod.z.literal(SCOPES.RECORD_DECLARATION_ARCHIVE), | ||
import_zod.z.literal(SCOPES.RECORD_DECLARATION_REINSTATE), | ||
import_zod.z.literal(SCOPES.RECORD_REGISTER), | ||
import_zod.z.literal(SCOPES.RECORD_EXPORT_RECORDS), | ||
import_zod.z.literal(SCOPES.RECORD_DECLARATION_PRINT), | ||
import_zod.z.literal(SCOPES.RECORD_PRINT_RECORDS_SUPPORTING_DOCUMENTS), | ||
import_zod.z.literal(SCOPES.RECORD_REGISTRATION_PRINT), | ||
import_zod.z.literal(SCOPES.RECORD_PRINT_ISSUE_CERTIFIED_COPIES), | ||
import_zod.z.literal(SCOPES.RECORD_PRINT_CERTIFIED_COPIES), | ||
import_zod.z.literal(SCOPES.RECORD_BULK_PRINT_CERTIFIED_COPIES), | ||
import_zod.z.literal(SCOPES.RECORD_REGISTRATION_VERIFY_CERTIFIED_COPIES), | ||
import_zod.z.literal(SCOPES.RECORD_REGISTRATION_REQUEST_CORRECTION), | ||
import_zod.z.literal(SCOPES.RECORD_REGISTRATION_CORRECT), | ||
import_zod.z.literal(SCOPES.RECORD_REGISTRATION_REQUEST_REVOCATION), | ||
import_zod.z.literal(SCOPES.RECORD_REGISTRATION_REVOKE), | ||
import_zod.z.literal(SCOPES.RECORD_REGISTRATION_REQUEST_REINSTATEMENT), | ||
import_zod.z.literal(SCOPES.RECORD_REGISTRATION_REINSTATE), | ||
import_zod.z.literal(SCOPES.RECORD_CONFIRM_REGISTRATION), | ||
import_zod.z.literal(SCOPES.RECORD_REJECT_REGISTRATION), | ||
import_zod.z.literal(SCOPES.SEARCH_BIRTH_MY_JURISDICTION), | ||
import_zod.z.literal(SCOPES.SEARCH_BIRTH), | ||
import_zod.z.literal(SCOPES.SEARCH_DEATH_MY_JURISDICTION), | ||
import_zod.z.literal(SCOPES.SEARCH_DEATH), | ||
import_zod.z.literal(SCOPES.SEARCH_MARRIAGE_MY_JURISDICTION), | ||
import_zod.z.literal(SCOPES.SEARCH_MARRIAGE), | ||
import_zod.z.literal(SCOPES.RECORD_READ), | ||
import_zod.z.literal(SCOPES.RECORD_READ_AUDIT), | ||
import_zod.z.literal(SCOPES.RECORD_READ_COMMENTS), | ||
import_zod.z.literal(SCOPES.RECORD_CREATE_COMMENTS), | ||
import_zod.z.literal(SCOPES.PROFILE_UPDATE), | ||
import_zod.z.literal(SCOPES.PROFILE_ELECTRONIC_SIGNATURE), | ||
import_zod.z.literal(SCOPES.PERFORMANCE_READ), | ||
import_zod.z.literal(SCOPES.PERFORMANCE_READ_DASHBOARDS), | ||
import_zod.z.literal(SCOPES.PERFORMANCE_EXPORT_VITAL_STATISTICS), | ||
import_zod.z.literal(SCOPES.ORGANISATION_READ_LOCATIONS), | ||
import_zod.z.literal(SCOPES.ORGANISATION_READ_LOCATIONS_MY_OFFICE), | ||
import_zod.z.literal(SCOPES.ORGANISATION_READ_LOCATIONS_MY_JURISDICTION), | ||
import_zod.z.literal(SCOPES.USER_READ), | ||
import_zod.z.literal(SCOPES.USER_READ_MY_OFFICE), | ||
import_zod.z.literal(SCOPES.USER_READ_MY_JURISDICTION), | ||
import_zod.z.literal(SCOPES.USER_READ_ONLY_MY_AUDIT), | ||
import_zod.z.literal(SCOPES.USER_CREATE), | ||
import_zod.z.literal(SCOPES.USER_CREATE_MY_JURISDICTION), | ||
import_zod.z.literal(SCOPES.USER_UPDATE), | ||
import_zod.z.literal(SCOPES.USER_UPDATE_MY_JURISDICTION), | ||
import_zod.z.literal(SCOPES.CONFIG_UPDATE_ALL), | ||
import_zod.z.literal(SCOPES.USER_DATA_SEEDING) | ||
]); | ||
var rawConfigurableScopeRegex = /^([a-zA-Z\.]+)\[((?:\w+=[\w.-]+(?:\|[\w.-]+)*)(?:,[\w]+=[\w.-]+(?:\|[\w.-]+)*)*)\]$/; | ||
var rawConfigurableScope = import_zod.z.string().regex(rawConfigurableScopeRegex); | ||
var CreateUserScope = import_zod.z.object({ | ||
type: import_zod.z.literal("user.create"), | ||
options: import_zod.z.object({ | ||
role: import_zod.z.array(import_zod.z.string()) | ||
}) | ||
}); | ||
var EditUserScope = import_zod.z.object({ | ||
type: import_zod.z.literal("user.edit"), | ||
options: import_zod.z.object({ | ||
role: import_zod.z.array(import_zod.z.string()) | ||
}) | ||
}); | ||
var WorkqueueScope = import_zod.z.object({ | ||
type: import_zod.z.literal("workqueue"), | ||
options: import_zod.z.object({ | ||
id: import_zod.z.array(import_zod.z.string()) | ||
}) | ||
}); | ||
var NotifyRecordScope = import_zod.z.object({ | ||
type: import_zod.z.literal("record.notify"), | ||
options: import_zod.z.object({ | ||
event: import_zod.z.array(import_zod.z.string()) | ||
}) | ||
}); | ||
var ConfigurableScopes = import_zod.z.discriminatedUnion("type", [ | ||
CreateUserScope, | ||
EditUserScope, | ||
WorkqueueScope, | ||
NotifyRecordScope | ||
]); | ||
function findScope(scopes2, scopeType) { | ||
const parsedScopes = scopes2.map((rawScope) => parseScope(rawScope)); | ||
return parsedScopes.find( | ||
(parsedScope) => parsedScope?.type === scopeType | ||
); | ||
} | ||
function parseScope(scope) { | ||
const maybeLiteralScope = LiteralScopes.safeParse(scope); | ||
if (maybeLiteralScope.success) { | ||
return { | ||
type: maybeLiteralScope.data | ||
}; | ||
} | ||
const maybeConfigurableScope = rawConfigurableScope.safeParse(scope); | ||
if (!maybeConfigurableScope.success) { | ||
return; | ||
} | ||
const rawScope = maybeConfigurableScope.data; | ||
const [, type, rawOptions] = rawScope.match(rawConfigurableScopeRegex) ?? []; | ||
const options = rawOptions.split(",").reduce((acc, option) => { | ||
const [key, value] = option.split("="); | ||
acc[key] = value.split("|"); | ||
return acc; | ||
}, {}); | ||
const parsedScope = { | ||
type, | ||
options | ||
}; | ||
const result = ConfigurableScopes.safeParse(parsedScope); | ||
return result.success ? result.data : void 0; | ||
} | ||
function stringifyScope(scope) { | ||
const options = Object.entries(scope.options).map(([key, value]) => `${key}=${value.join("|")}`).join(","); | ||
return `${scope.type}[${options}]`; | ||
} | ||
var scopes = Object.values(SCOPES); |
{ | ||
"name": "@opencrvs/toolkit", | ||
"version": "1.8.0-rc.271e385", | ||
"version": "1.8.0-rc.272ac86", | ||
"description": "OpenCRVS toolkit for building country configurations", | ||
@@ -23,3 +23,4 @@ "license": "MPL-2.0", | ||
"@trpc/client": "^11.0.0-rc.648", | ||
"@trpc/server": "^11.0.0-rc.532" | ||
"@trpc/server": "^11.0.0-rc.532", | ||
"zod-openapi": "^4.2.4" | ||
}, | ||
@@ -26,0 +27,0 @@ "devDependencies": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
11665224
426.67%63
5%296047
396.86%7
16.67%1
Infinity%+ Added
+ Added
+ Added