forked from jmandel/fhir-js-client
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d84ce99
commit bddbbd6
Showing
17 changed files
with
206 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,19 @@ | ||
|
||
import { fhirclient } from "../types"; | ||
import Client from "../Client"; | ||
|
||
export = smart; | ||
|
||
type storageFactory = (options?: fhirclient.JsonObject) => fhirclient.Storage; | ||
|
||
|
||
// tslint:disable-next-line: no-namespace | ||
declare namespace smart { | ||
export const oauth2: OAuth2; | ||
export function client(stateOrURI: fhirclient.ClientState | string): Client; | ||
} | ||
|
||
interface OAuth2 { | ||
settings: fhirclient.fhirSettings; | ||
ready: fhirclient.readyFunction; | ||
authorize: (p: fhirclient.AuthorizeParams) => Promise<never>; | ||
init: (p: fhirclient.AuthorizeParams) => Promise<never|Client>; | ||
} | ||
declare const FHIR: { | ||
AbortController: { | ||
new (): AbortController; | ||
prototype: AbortController; | ||
}; | ||
client: (state: string | fhirclient.ClientState) => Client; | ||
oauth2: { | ||
settings: fhirclient.fhirSettings; | ||
ready: { | ||
(onSuccess: (client: Client) => any, onError?: (error: Error) => any): Promise<any>; | ||
(): Promise<Client>; | ||
}; | ||
authorize: (options: fhirclient.AuthorizeParams) => Promise<string | void>; | ||
init: (options: fhirclient.AuthorizeParams) => Promise<Client>; | ||
}; | ||
}; | ||
export = FHIR; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,11 @@ | ||
import { fhirclient } from "../types"; | ||
import Client from "../Client"; | ||
import { Request, ResponseToolkit } from "hapi"; | ||
|
||
export = smart; | ||
|
||
type storageFactory = (options?: fhirclient.JsonObject) => fhirclient.Storage; | ||
|
||
declare function smart( | ||
req: Request, | ||
h: ResponseToolkit, | ||
storage?: fhirclient.Storage | storageFactory | ||
): OAuth2; | ||
|
||
interface OAuth2 { | ||
settings: fhirclient.fhirSettings; | ||
ready: fhirclient.readyFunction; | ||
authorize: (p: fhirclient.AuthorizeParams) => Promise<never>; | ||
init: (p: fhirclient.AuthorizeParams) => Promise<never|Client>; | ||
import { ResponseToolkit, Request } from "hapi"; | ||
declare type storageFactory = (options?: fhirclient.JsonObject) => fhirclient.Storage; | ||
declare function smart(request: Request, h: ResponseToolkit, storage?: fhirclient.Storage | storageFactory): fhirclient.SMART; | ||
declare namespace smart { | ||
var AbortController: { | ||
new (): AbortController; | ||
prototype: AbortController; | ||
}; | ||
} | ||
|
||
export = smart; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,16 @@ | ||
// Do not edit! This is an entry point that provides CommonJS export from ESM | ||
module.exports = require("../adapters/HapiAdapter").default.smart; | ||
"use strict"; | ||
|
||
const HapiAdapter_1 = require("../adapters/HapiAdapter"); | ||
|
||
const cjs_ponyfill_1 = require("abortcontroller-polyfill/dist/cjs-ponyfill"); | ||
|
||
function smart(request, h, storage) { | ||
return new HapiAdapter_1.default({ | ||
request, | ||
responseToolkit: h, | ||
storage | ||
}).getSmartApi(); | ||
} | ||
|
||
smart.AbortController = cjs_ponyfill_1.AbortController; | ||
module.exports = smart; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,12 @@ | ||
/// <reference types="node" /> | ||
import { IncomingMessage, ServerResponse } from "http"; | ||
import { fhirclient } from "../types"; | ||
import Client from "../Client"; | ||
|
||
export = smart; | ||
|
||
type storageFactory = (options?: fhirclient.JsonObject) => fhirclient.Storage; | ||
|
||
|
||
// tslint:disable-next-line: no-namespace | ||
declare type storageFactory = (options?: fhirclient.JsonObject) => fhirclient.Storage; | ||
declare function smart(request: IncomingMessage, response: ServerResponse, storage?: fhirclient.Storage | storageFactory): fhirclient.SMART; | ||
declare namespace smart { | ||
export const oauth2: OAuth2; | ||
export function client(stateOrURI: fhirclient.ClientState | string): Client; | ||
} | ||
|
||
declare function smart( | ||
req: IncomingMessage, | ||
res: ServerResponse, | ||
storage?: fhirclient.Storage | storageFactory | ||
): OAuth2; | ||
|
||
interface OAuth2 { | ||
settings: fhirclient.fhirSettings; | ||
ready: fhirclient.readyFunction; | ||
authorize: (p: fhirclient.AuthorizeParams) => Promise<never>; | ||
init: (p: fhirclient.AuthorizeParams) => Promise<never|Client>; | ||
var AbortController: { | ||
new (): AbortController; | ||
prototype: AbortController; | ||
}; | ||
} | ||
export = smart; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,16 @@ | ||
// Do not edit! This is an entry point that provides CommonJS export from ESM | ||
module.exports = require("../adapters/NodeAdapter").default.smart; | ||
"use strict"; | ||
|
||
const NodeAdapter_1 = require("../adapters/NodeAdapter"); | ||
|
||
const cjs_ponyfill_1 = require("abortcontroller-polyfill/dist/cjs-ponyfill"); | ||
|
||
function smart(request, response, storage) { | ||
return new NodeAdapter_1.default({ | ||
request, | ||
response, | ||
storage | ||
}).getSmartApi(); | ||
} | ||
|
||
smart.AbortController = cjs_ponyfill_1.AbortController; | ||
module.exports = smart; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,23 @@ | ||
import HapiAdapter from "../adapters/HapiAdapter"; | ||
export default HapiAdapter.smart; | ||
import { fhirclient } from "../types"; | ||
import { AbortController as Controller } from "abortcontroller-polyfill/dist/cjs-ponyfill"; | ||
import { ResponseToolkit, Request } from "hapi"; | ||
|
||
type storageFactory = (options?: fhirclient.JsonObject) => fhirclient.Storage; | ||
|
||
function smart( | ||
request: Request, | ||
h: ResponseToolkit, | ||
storage?: fhirclient.Storage | storageFactory | ||
) | ||
{ | ||
return new HapiAdapter({ | ||
request, | ||
responseToolkit: h, | ||
storage | ||
}).getSmartApi(); | ||
} | ||
|
||
smart.AbortController = Controller as typeof AbortController; | ||
|
||
export = smart; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,23 @@ | ||
import NodeAdapter from "../adapters/NodeAdapter"; | ||
export default NodeAdapter.smart; | ||
import { IncomingMessage, ServerResponse } from "http"; | ||
import { fhirclient } from "../types"; | ||
import { AbortController as Controller } from "abortcontroller-polyfill/dist/cjs-ponyfill"; | ||
|
||
type storageFactory = (options?: fhirclient.JsonObject) => fhirclient.Storage; | ||
|
||
function smart( | ||
request: IncomingMessage, | ||
response: ServerResponse, | ||
storage?: fhirclient.Storage | storageFactory | ||
) | ||
{ | ||
return new NodeAdapter({ | ||
request, | ||
response, | ||
storage | ||
}).getSmartApi(); | ||
} | ||
|
||
smart.AbortController = Controller as typeof AbortController; | ||
|
||
export = smart; |
Oops, something went wrong.