Skip to content

Commit

Permalink
fix(js core): get only resources
Browse files Browse the repository at this point in the history
  • Loading branch information
letzabelin committed Feb 2, 2024
1 parent 2ffbf9e commit ececf1a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/generator/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,9 @@
(.write r "export interface SubsSubscription {\nid?:string;\nresourceType: 'SubsSubscription';\nstatus: 'active' | 'off';trigger: Partial<Record<ResourceType, { event: Array<'all' | 'create' | 'update' | 'delete'>; filter?: unknown }>>; channel: {\ntype: 'rest-hook';\nendpoint: string;\npayload?: { content: string; contentType: string; context: unknown };headers?: Record<string, string>;\ntimeout?: number;\n};\n}")
(.write r "export type ResourceTypeMap = {\n SubsSubscription: SubsSubscription;\n User: Record<string,any>;\n")
(mapv #(when-not (contains? #{"string" "boolean"} %) (.write r (format " %s: %s;\n" % %)))
(keys (get @r/schema package)))
(map first
(filter #(not (nil? (get-in (last %) [:base :isResource])))
(get @r/schema "hl7-fhir-r4-core"))))
(.write r "}\n")
(.write r "export type ResourceType = keyof ResourceTypeMap;\n")))
(w/generate-types :typescript @r/schema {:target-path path})))
Expand Down

0 comments on commit ececf1a

Please sign in to comment.